Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions docs/issues/plugin-settings-surface-isolation/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Plugin Settings Surface Isolation Plan

## Implementation Approach

- Show the plugin settings action whenever the plugin list item exposes a settings contribution,
regardless of whether the plugin is currently enabled.
- Remove the enablement guard from the dedicated plugin settings window flow.
- In development, prefer workspace plugin directories over user-data installation directories when
discovering official plugins so stale local installs cannot mask newer settings metadata.
- In development, re-copy workspace directory plugins into userData installs during activation so
script-only fixes land even when `plugin.json` is unchanged.
- Treat an installed official plugin as stale when its hydrated manifest differs from the current
official manifest, even if the version string is unchanged.
- Preserve plugin-local `config.json` when reinstalling a stale official plugin so credentials do
not disappear during self-healing.
- When discovery rejects an installed official plugin as unsupported or untrusted, remove the
persisted installation record and disable plugin-owned MCP servers, settings resources, and tool
policies before initialization tries to reactivate them.
- Keep Feishu's MCP bootstrap self-contained with only Node builtins in the installed entrypoint,
and use a built-in stdio warning responder when credentials are missing.
- Clear the Feishu settings page message banner on non-error MCP states so prior failures do not
linger after recovery.
- Pin the Feishu `npx` package invocation and only pass through an explicit registry override from
the environment.
- Replace Feishu's blanket MCP auto-approval with an empty default allowlist.
- Resolve settings contributions from the current official manifest instead of trusting an older
installed manifest copy, while still reusing installed file paths when those assets exist.
- Resolve plugin settings contributions from the installed plugin manifest when stored plugin
resource records are absent or no longer point to valid files.
- Materialize packaged official plugin assets on demand when a settings contribution exists but no
installed plugin directory is available yet.
- Reuse the same resolved settings contribution for plugin list serialization and for opening the
dedicated plugin settings window.
- Filter plugin-owned MCP servers out of the existing global MCP settings renderer so plugin MCP
remains a plugin-local concern while existing built-in and user-managed MCP behavior stays
unchanged.

## Affected Areas

- `src/main/presenter/pluginPresenter/index.ts`
- `plugins/feishu/settings/assets/index.js`
- `plugins/feishu/mcp/serve.mjs`
- `plugins/feishu/plugin.json`
- `src/renderer/src/components/mcp-config/components/McpServers.vue`
- Focused presenter and renderer regression tests

## Test Strategy

- Add a renderer regression test covering a disabled plugin that still shows the settings action.
- Add a main-process regression test covering plugin settings availability and opening when stored
resources are missing.
- Add a main-process regression test covering opening settings for a disabled packaged plugin.
- Add a main-process regression test covering startup self-heal for stale same-version installs.
- Add a main-process regression test covering dev-directory sync when only plugin files changed.
- Add a main-process regression test covering cleanup when discovery rejects a persisted official
plugin installation.
- Add a regression assertion that the Feishu installed MCP bootstrap does not statically import host
SDK packages.
- Add focused Feishu regression assertions for the pinned bootstrap package version, registry
override behavior, safer auto-approve defaults, and stale settings error clearing.
- Add a renderer regression test covering plugin-owned MCP servers being hidden from the global MCP
settings list.

## Risks

- Low to moderate. Manifest fallback must only return settings entries whose installed files exist,
or the UI could expose an unusable settings action.
52 changes: 52 additions & 0 deletions docs/issues/plugin-settings-surface-isolation/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Plugin Settings Surface Isolation

## User Need

As a user enabling the Feishu plugin, I need an immediate settings entry on the plugin card so I can
configure the plugin, and I need the plugin-owned MCP server to stay inside the plugin experience
instead of being mixed into the existing global settings or MCP settings surfaces.

## Acceptance Criteria

- Plugins with a declared settings contribution expose their settings action even while disabled so
users can configure required credentials before enabling the plugin.
- Plugin settings contributions still resolve when an older installed plugin copy lags behind the
current official manifest metadata.
- In development, when a workspace plugin and an installed plugin directory share the same official
plugin id, settings metadata resolves from the workspace plugin before the stale installed copy.
- Official plugins reinstall when a same-version installed copy is stale, so outdated MCP entrypoints
cannot survive on version equality alone.
- In development, official plugin directory installs stay synchronized with workspace files even when
only non-manifest files changed.
- Discovery that rejects an official plugin as unsupported or untrusted clears its persisted
installation record and plugin-owned runtime resources before startup activation can reuse them.
- Enabling an official plugin with a declared settings contribution exposes the plugin settings
action on the Plugins settings page without depending on previously persisted resource records.
- Opening plugin settings still works when persisted plugin resource records are missing or stale,
as long as the installed plugin manifest still declares a valid settings contribution.
- Reinstalling a stale official plugin preserves plugin-local configuration such as `config.json`.
- Plugin-owned MCP entrypoints remain runnable after installation into userData and must not rely on
static imports from the workspace or app-level `node_modules`.
- The Feishu plugin settings page clears stale MCP error text whenever the Feishu MCP is not in an
error state.
- The Feishu MCP bootstrap launches a pinned upstream package version and only honors explicit
registry overrides instead of injecting a hardcoded registry fallback.
- The Feishu plugin manifest does not auto-approve every MCP tool call by default.
- Global MCP settings do not render plugin-owned MCP servers identified by `source: plugin`.
- Plugin-owned MCP runtime status remains available from plugin-specific settings/status surfaces.

## Constraints

- Keep plugin-owned MCP server configs in the existing MCP config store for runtime compatibility.
- Preserve the existing plugin settings window flow and plugin manifest contract.
- Packaged official plugins may need to materialize their settings assets before the plugin is
enabled so the settings window can load from a real file path.

## Non-goals

- Redesigning plugin installation, runtime detection, or plugin settings UX.
- Changing core MCP lifecycle behavior beyond renderer visibility for plugin-owned servers.

## Open Questions

None.
17 changes: 17 additions & 0 deletions docs/issues/plugin-settings-surface-isolation/tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Plugin Settings Surface Isolation Tasks

- [x] Allow disabled plugins to expose and open their settings contribution.
- [x] Add plugin settings contribution fallback in `PluginPresenter`.
- [x] Prefer current official plugin settings metadata when an installed copy is stale.
- [x] Prefer workspace official plugin directories over stale installed copies during dev discovery.
- [x] Reinstall stale same-version official plugins and preserve `config.json` during refresh.
- [x] Keep dev directory plugin installs synced even when only file contents changed.
- [x] Clear persisted plugin installation state when discovery rejects unsupported or untrusted
official plugins.
- [x] Keep Feishu installed MCP bootstrap self-contained and free of static host SDK imports.
- [x] Clear stale MCP error text from the Feishu settings page after healthy status refreshes.
- [x] Pin the Feishu MCP bootstrap package and remove the hardcoded registry fallback.
- [x] Replace Feishu's blanket MCP auto-approve default with an empty allowlist.
- [x] Hide plugin-owned MCP servers from the global MCP settings list.
- [x] Add focused regression coverage for presenter and renderer behavior.
- [x] Run focused validation and repo-required format/i18n/lint checks as feasible.
28 changes: 28 additions & 0 deletions docs/issues/plugin-skill-tool-guidance/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Plugin Skill Tool Guidance Plan

## Implementation Approach

- Add a `skills` contribution to the Feishu plugin manifest that points at a plugin-owned agent
skill folder.
- Create a `SKILL.md` file for the Feishu plugin that frames `feishu-tools` as an MCP server tool
surface and tells the model to invoke matching tools directly for Feishu/Lark tasks.
- Keep the skill generic enough to work with whichever Feishu/Lark tools are currently exposed by
the active MCP preset, using the live tool names and descriptions as the source of truth.
- Add a focused regression assertion that the Feishu manifest and skill file stay wired together.

## Affected Areas

- `plugins/feishu/plugin.json`
- `plugins/feishu/skills/feishu-tools/SKILL.md`
- `test/main/presenter/pluginPresenter.test.ts`

## Test Strategy

- Add a source-level regression test asserting that the Feishu plugin manifest declares the plugin
skill contribution.
- Assert that the skill file includes explicit MCP routing guidance so the regression catches future
removals of the usage instructions.

## Risks

- Low. The change adds guidance metadata but does not alter plugin startup or runtime behavior.
34 changes: 34 additions & 0 deletions docs/issues/plugin-skill-tool-guidance/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Plugin Skill Tool Guidance

## User Need

As a user who already enabled the Feishu plugin and can see its tools in DeepChat, I need the AI to
understand that the plugin exposes MCP tools for Feishu/Lark work so it invokes those tools directly
instead of asking me to classify the plugin type or explain how to call it.

## Acceptance Criteria

- The Feishu plugin declares an agent skill contribution in its manifest so DeepChat can register a
plugin-owned skill alongside the MCP server.
- The skill explicitly tells the model that the plugin is an MCP tool surface and that it should not
ask the user to classify the plugin as MCP, CLI, or another type.
- The skill gives direct routing guidance for common Feishu/Lark requests such as documents,
spreadsheets, knowledge content, and other supported workspace artifacts.
- The skill explains that available Feishu/Lark tools depend on the current MCP preset and that the
model should use currently exposed tool names and descriptions as the source of truth.

## Constraints

- Keep the change within the Feishu plugin manifest and skill assets.
- Do not redesign plugin MCP startup, settings UX, or global tool routing.
- Keep the guidance compatible with the current plugin skill registration path in `PluginPresenter`.

## Non-goals

- Changing Feishu MCP tool implementations.
- Rewriting DeepChat's global tool-selection prompt.
- Adding renderer UI for skill management.

## Open Questions

None.
6 changes: 6 additions & 0 deletions docs/issues/plugin-skill-tool-guidance/tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Plugin Skill Tool Guidance Tasks

- [x] Add a Feishu plugin `skills` contribution in `plugin.json`.
- [x] Create the Feishu plugin `SKILL.md` guidance for MCP tool usage.
- [x] Add focused regression coverage for the manifest-to-skill wiring.
- [x] Run focused validation and repo-required format/i18n/lint checks as feasible.
Loading