@tencent-ai/agent-sdk 0.3.252 → 0.3.253
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/CHANGELOG.md +22 -0
- package/cli/dist/codebuddy-headless.js +73 -58
- package/cli/dist/codebuddy-lite-wb.mjs +96 -81
- package/cli/dist/lazy/{427.68132a34.js → 427.74b982af.js} +4 -4
- package/cli/dist/lazy-headless/{834.391fb41e.js → 834.3b674e07.js} +9 -9
- package/cli/dist-server/3556.codebuddy.js +1 -1
- package/cli/dist-server/6037.codebuddy.js +1 -1
- package/cli/dist-server/6784.codebuddy.js +1 -1
- package/cli/dist-server/codebuddy.js +45 -30
- package/cli/dist-server/types/node/agent/openai-agents-types.d.ts +5 -5
- package/cli/dist-server/types/node/mcp/mcp-sdk-values.d.ts +1 -1
- package/cli/dist-server/types/node/model/model-provider.d.ts +3 -1
- package/cli/dist-server/types/node/tools/a2a-get-task-tool.d.ts +139 -34
- package/cli/dist-server/types/node/tools/a2a-poll-retry.d.ts +46 -0
- package/cli/package.json +1 -1
- package/cli/product.cloudhosted.json +2 -2
- package/cli/product.internal.json +2 -2
- package/cli/product.ioa.json +2 -2
- package/cli/product.json +4 -4
- package/cli/product.selfhosted.json +2 -2
- package/package.json +1 -1
- package/cli/dist-server/types/node/acp/acp-view-rewind-to.d.ts +0 -34
- package/cli/dist-server/types/node/acp/acp-web-ui-client.d.ts +0 -22
- package/cli/dist-server/types/node/acp/usage-by-category-calculator.d.ts +0 -45
- package/cli/dist-server/types/node/acp/usage-by-category-char-weight.d.ts +0 -9
- package/cli/dist-server/types/node/acp/usage-by-category-distribute.d.ts +0 -6
- package/cli/dist-server/types/node/acp/usage-by-category-tools-split.d.ts +0 -11
- package/cli/dist-server/types/node/agent-home/agent-home-envelope-body.d.ts +0 -54
- package/cli/dist-server/types/node/agent-home/agent-home-inbox-events.d.ts +0 -14
- package/cli/dist-server/types/node/agent-home/agent-home-room-contacts.d.ts +0 -30
- package/cli/dist-server/types/node/agent-team/permission-bridge-client.d.ts +0 -32
- package/cli/dist-server/types/node/agent-team/permission-bridge-protocol.d.ts +0 -47
- package/cli/dist-server/types/node/agent-view/handoff-policy.d.ts +0 -80
- package/cli/dist-server/types/node/agent-view/job-respawn-prefs.d.ts +0 -12
- package/cli/dist-server/types/node/agent-view/session-handoff.d.ts +0 -161
- package/cli/dist-server/types/node/ask/index.d.ts +0 -3
- package/cli/dist-server/types/node/bash-sandbox/bash-sandbox-manager.d.ts +0 -125
- package/cli/dist-server/types/node/bash-sandbox/legacy-sandbox-shell-service.d.ts +0 -33
- package/cli/dist-server/types/node/bash-sandbox/managed-security-policy.d.ts +0 -6
- package/cli/dist-server/types/node/bash-sandbox/workbuddy-directory-protection.d.ts +0 -12
- package/cli/dist-server/types/node/checkpoint/checkpoint-service.d.ts +0 -70
- package/cli/dist-server/types/node/checkpoint/file-changes-controller.d.ts +0 -29
- package/cli/dist-server/types/node/checkpoint/file-track-service.d.ts +0 -11
- package/cli/dist-server/types/node/checkpoint/file-version-manager.d.ts +0 -10
- package/cli/dist-server/types/node/checkpoint/file-version-store.d.ts +0 -9
- package/cli/dist-server/types/node/checkpoint/file-version-update-strategies.d.ts +0 -62
- package/cli/dist-server/types/node/command/add-dir-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/agents-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/auto-compact-command-executor.d.ts +0 -20
- package/cli/dist-server/types/node/command/background-command-executor.d.ts +0 -29
- package/cli/dist-server/types/node/command/btw-command-executor.d.ts +0 -19
- package/cli/dist-server/types/node/command/clear-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/config-command-executor.d.ts +0 -15
- package/cli/dist-server/types/node/command/context-command-executor.d.ts +0 -42
- package/cli/dist-server/types/node/command/copy-command-executor.d.ts +0 -10
- package/cli/dist-server/types/node/command/cost-command-executor.d.ts +0 -13
- package/cli/dist-server/types/node/command/debug-command-executor.d.ts +0 -15
- package/cli/dist-server/types/node/command/deep-research-command-executor.d.ts +0 -25
- package/cli/dist-server/types/node/command/doctor-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/effort-command-executor.d.ts +0 -46
- package/cli/dist-server/types/node/command/exit-command-executor.d.ts +0 -14
- package/cli/dist-server/types/node/command/export-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/feedback-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/fork-bg-command-executor.d.ts +0 -30
- package/cli/dist-server/types/node/command/fork-command-executor.d.ts +0 -28
- package/cli/dist-server/types/node/command/goal-command-executor.d.ts +0 -50
- package/cli/dist-server/types/node/command/handoff-message-adapter.d.ts +0 -9
- package/cli/dist-server/types/node/command/help-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/hooks-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/ide-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/mcp-command-executor.d.ts +0 -15
- package/cli/dist-server/types/node/command/memory-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/mode-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/model-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/model-image-to-image-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-image-to-video-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-lite-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-reasoning-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-text-to-image-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-text-to-video-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/multitask-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/permissions-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/plan-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/plugin-command-executor.d.ts +0 -25
- package/cli/dist-server/types/node/command/plugin-validate-command-executor.d.ts +0 -21
- package/cli/dist-server/types/node/command/release-notes-command-executor.d.ts +0 -18
- package/cli/dist-server/types/node/command/reload-plugins-command-executor.d.ts +0 -24
- package/cli/dist-server/types/node/command/remote-control-command-executor.d.ts +0 -44
- package/cli/dist-server/types/node/command/rename-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/reset-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/resume-command-executor.d.ts +0 -21
- package/cli/dist-server/types/node/command/rewind-command-executor.d.ts +0 -10
- package/cli/dist-server/types/node/command/sandbox-command-executor.d.ts +0 -20
- package/cli/dist-server/types/node/command/save-workflow-command-executor.d.ts +0 -43
- package/cli/dist-server/types/node/command/session-reset-notifier.d.ts +0 -23
- package/cli/dist-server/types/node/command/skills-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/stats-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/status-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/tasks-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/terminal-setup-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/theme-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/todos-command-executor.d.ts +0 -16
- package/cli/dist-server/types/node/command/upgrade-command-executor.d.ts +0 -13
- package/cli/dist-server/types/node/command/vim-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/workflows-command-executor.d.ts +0 -26
- package/cli/dist-server/types/node/feedback/feedback-protocol.d.ts +0 -32
- package/cli/dist-server/types/node/feedback/feedback-service.d.ts +0 -19
- package/cli/dist-server/types/node/feedback/index.d.ts +0 -2
- package/cli/dist-server/types/node/goal/goal-policy.d.ts +0 -55
- package/cli/dist-server/types/node/goal/goal-protocol.d.ts +0 -178
- package/cli/dist-server/types/node/goal/goal-service.d.ts +0 -201
- package/cli/dist-server/types/node/goal/goal-session-start-hook.d.ts +0 -24
- package/cli/dist-server/types/node/hooks/parse-frontmatter-hooks.d.ts +0 -42
- package/cli/dist-server/types/node/install/index.d.ts +0 -6
- package/cli/dist-server/types/node/install/install-controller.d.ts +0 -15
- package/cli/dist-server/types/node/install/install-env.d.ts +0 -12
- package/cli/dist-server/types/node/install/install-errors.d.ts +0 -46
- package/cli/dist-server/types/node/install/install-protocol.d.ts +0 -83
- package/cli/dist-server/types/node/install/install-service.d.ts +0 -36
- package/cli/dist-server/types/node/install/install-utils.d.ts +0 -7
- package/cli/dist-server/types/node/install/releases-service.d.ts +0 -18
- package/cli/dist-server/types/node/install/shell-setup.d.ts +0 -36
- package/cli/dist-server/types/node/mcp/mcp-cancellation.d.ts +0 -65
- package/cli/dist-server/types/node/mcp/mcp-controller.d.ts +0 -56
- package/cli/dist-server/types/node/mcp/mcp-model-id-header-helper.d.ts +0 -12
- package/cli/dist-server/types/node/mcp/mcp-oauth-callback-html.d.ts +0 -6
- package/cli/dist-server/types/node/mcp/mcp-oauth-controller.d.ts +0 -26
- package/cli/dist-server/types/node/mcp/mcp-output-storage.d.ts +0 -57
- package/cli/dist-server/types/node/mcp/mcp-server-override-impl.d.ts +0 -136
- package/cli/dist-server/types/node/mcp/mcp-server-override.d.ts +0 -29
- package/cli/dist-server/types/node/mcp/mcp-tool-result-sideband.d.ts +0 -26
- package/cli/dist-server/types/node/mcp/mcp-validate-middleware.d.ts +0 -25
- package/cli/dist-server/types/node/mcp/models/mcp-server.d.ts +0 -18
- package/cli/dist-server/types/node/mcp/node-websocket-transport.d.ts +0 -38
- package/cli/dist-server/types/node/mcp/official-mcp-egress-policy.d.ts +0 -17
- package/cli/dist-server/types/node/mcp/sdk-mcp-server.d.ts +0 -143
- package/cli/dist-server/types/node/mcp/sdk-mcp-transport.d.ts +0 -97
- package/cli/dist-server/types/node/message-queue/followup-queue.d.ts +0 -35
- package/cli/dist-server/types/node/message-queue/index.d.ts +0 -11
- package/cli/dist-server/types/node/plugins/concurrency.d.ts +0 -1
- package/cli/dist-server/types/node/plugins/dependency-resolver.d.ts +0 -43
- package/cli/dist-server/types/node/plugins/directory-plugin-cache-projection.d.ts +0 -2
- package/cli/dist-server/types/node/plugins/guards/index.d.ts +0 -2
- package/cli/dist-server/types/node/plugins/guards/weixinpay-integrity-guard.d.ts +0 -15
- package/cli/dist-server/types/node/plugins/installers/git-plugin-installer.d.ts +0 -42
- package/cli/dist-server/types/node/plugins/installers/git-subdir-plugin-installer.d.ts +0 -19
- package/cli/dist-server/types/node/plugins/installers/index.d.ts +0 -4
- package/cli/dist-server/types/node/plugins/installers/local-plugin-installer.d.ts +0 -40
- package/cli/dist-server/types/node/plugins/installers/npm-plugin-installer.d.ts +0 -23
- package/cli/dist-server/types/node/plugins/loaders/agent-loader.d.ts +0 -43
- package/cli/dist-server/types/node/plugins/loaders/command-loader.d.ts +0 -37
- package/cli/dist-server/types/node/plugins/loaders/hook-loader.d.ts +0 -55
- package/cli/dist-server/types/node/plugins/loaders/index.d.ts +0 -8
- package/cli/dist-server/types/node/plugins/loaders/lsp-loader.d.ts +0 -47
- package/cli/dist-server/types/node/plugins/loaders/mcp-loader.d.ts +0 -75
- package/cli/dist-server/types/node/plugins/loaders/output-style-loader.d.ts +0 -49
- package/cli/dist-server/types/node/plugins/loaders/plugin-loader-manager.d.ts +0 -49
- package/cli/dist-server/types/node/plugins/loaders/skill-loader.d.ts +0 -45
- package/cli/dist-server/types/node/plugins/marketplace-name-validator.d.ts +0 -50
- package/cli/dist-server/types/node/plugins/marketplace-path-safety.d.ts +0 -86
- package/cli/dist-server/types/node/plugins/marketplaces/base-marketplace.d.ts +0 -43
- package/cli/dist-server/types/node/plugins/marketplaces/builtin-marketplace-provider.d.ts +0 -22
- package/cli/dist-server/types/node/plugins/marketplaces/directory-marketplace.d.ts +0 -19
- package/cli/dist-server/types/node/plugins/marketplaces/git-availability-detector.d.ts +0 -62
- package/cli/dist-server/types/node/plugins/marketplaces/git-fallback-coordinator.d.ts +0 -42
- package/cli/dist-server/types/node/plugins/marketplaces/git-to-zip-url-converter.d.ts +0 -50
- package/cli/dist-server/types/node/plugins/marketplaces/github-marketplace.d.ts +0 -41
- package/cli/dist-server/types/node/plugins/marketplaces/http-marketplace.d.ts +0 -47
- package/cli/dist-server/types/node/plugins/marketplaces/index.d.ts +0 -13
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-config-manager.d.ts +0 -39
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-factory.d.ts +0 -11
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-storage.d.ts +0 -141
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-update-checker.d.ts +0 -38
- package/cli/dist-server/types/node/plugins/marketplaces/workspace-project-root.d.ts +0 -14
- package/cli/dist-server/types/node/plugins/marketplaces/zip-marketplace.d.ts +0 -134
- package/cli/dist-server/types/node/plugins/mcpb-handler.d.ts +0 -29
- package/cli/dist-server/types/node/plugins/plugin-controller.d.ts +0 -75
- package/cli/dist-server/types/node/plugins/plugin-error-collector.d.ts +0 -17
- package/cli/dist-server/types/node/plugins/plugin-install-stats-service.d.ts +0 -20
- package/cli/dist-server/types/node/plugins/plugin-manager.d.ts +0 -692
- package/cli/dist-server/types/node/plugins/plugin-policy-service.d.ts +0 -53
- package/cli/dist-server/types/node/plugins/plugin-validator.d.ts +0 -48
- package/cli/dist-server/types/node/plugins/zip-utils.d.ts +0 -93
- package/cli/dist-server/types/node/remote-control/clients/liveness-watchdog.d.ts +0 -56
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-activity.d.ts +0 -23
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-auth.d.ts +0 -64
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-client-factory.d.ts +0 -47
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-client.d.ts +0 -191
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-inbound.d.ts +0 -7
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-interaction.d.ts +0 -142
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-live.d.ts +0 -78
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-media.d.ts +0 -35
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-qr-bind.d.ts +0 -49
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-respond-queue.d.ts +0 -33
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-types.d.ts +0 -207
- package/cli/dist-server/types/node/remote-control/remote-control-protocol.d.ts +0 -288
- package/cli/dist-server/types/node/remote-gateway/gateway-protocol.d.ts +0 -502
- package/cli/dist-server/types/node/remote-gateway/utils/qrcode-utils.d.ts +0 -16
- package/cli/dist-server/types/node/session/session-preview-utils.d.ts +0 -30
- package/cli/dist-server/types/node/settings/model-setting-utils.d.ts +0 -2
- package/cli/dist-server/types/node/tool-control/tool-control-policy.d.ts +0 -35
- package/cli/dist-server/types/node/tools/auto-mode/auto-mode-critique-client.d.ts +0 -51
- package/cli/dist-server/types/node/tools/auto-mode/auto-mode-strategy.d.ts +0 -19
- package/cli/dist-server/types/node/utils/add-dir-utils.d.ts +0 -20
- package/cli/dist-server/types/node/utils/compress-path.source.d.ts +0 -59
- package/cli/dist-server/types/node/vim/index.d.ts +0 -2
- package/cli/dist-server/types/node/vim/vim-manager.d.ts +0 -12
- package/cli/dist-server/types/node/vim/vim-protocol.d.ts +0 -24
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { PathResolver } from '@celljs/web';
|
|
2
|
-
import { Context, Middleware, RequestMatcher } from '@celljs/web/lib/node';
|
|
3
|
-
import { ConsoleManager } from '../console';
|
|
4
|
-
import { McpConfigManager, McpManager } from './mcp-protocol';
|
|
5
|
-
export declare class McpValidateMiddleWare implements Middleware {
|
|
6
|
-
protected readonly mcpManager: McpManager;
|
|
7
|
-
protected readonly mcpConfigManager: McpConfigManager;
|
|
8
|
-
protected readonly consoleManager: ConsoleManager;
|
|
9
|
-
protected readonly requestMatcher: RequestMatcher;
|
|
10
|
-
protected readonly pathResolver: PathResolver;
|
|
11
|
-
readonly priority: number;
|
|
12
|
-
handle(ctx: Context, next: () => Promise<void>): Promise<void>;
|
|
13
|
-
private canHandle;
|
|
14
|
-
/**
|
|
15
|
-
* Process MCP config from CLI parameter.
|
|
16
|
-
*
|
|
17
|
-
* Supports JSONC format with:
|
|
18
|
-
* - Single-line comments (//)
|
|
19
|
-
* - Multi-line comments (/* *\/)
|
|
20
|
-
* - Trailing commas
|
|
21
|
-
*
|
|
22
|
-
* @param mcpConfigParam - JSON string or file path to config
|
|
23
|
-
*/
|
|
24
|
-
private processMcpConfig;
|
|
25
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type Event } from '@celljs/core';
|
|
2
|
-
import { McpConfig, McpScope, McpServerModel, McpServerStatus } from '../mcp-protocol';
|
|
3
|
-
export declare class McpServerModelImpl implements McpServerModel {
|
|
4
|
-
readonly scope: McpScope;
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly config: McpConfig;
|
|
7
|
-
private _state;
|
|
8
|
-
private _status;
|
|
9
|
-
private _statusEmitter;
|
|
10
|
-
get onDidChangeStatus(): Event<McpServerStatus>;
|
|
11
|
-
get status(): McpServerStatus;
|
|
12
|
-
set status(value: McpServerStatus);
|
|
13
|
-
needsAuth: boolean;
|
|
14
|
-
constructor(scope: McpScope, name: string, config: McpConfig);
|
|
15
|
-
private generateState;
|
|
16
|
-
state(): string;
|
|
17
|
-
isActive(): boolean;
|
|
18
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
2
|
-
import type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
-
interface WebSocketLike {
|
|
4
|
-
readonly readyState: number;
|
|
5
|
-
close(code?: number, reason?: string): void;
|
|
6
|
-
send(data: string): void;
|
|
7
|
-
}
|
|
8
|
-
export declare class NodeWebSocketTransport implements Transport {
|
|
9
|
-
private ws;
|
|
10
|
-
private started;
|
|
11
|
-
private opened;
|
|
12
|
-
private isBun;
|
|
13
|
-
onclose?: () => void;
|
|
14
|
-
onerror?: (error: Error) => void;
|
|
15
|
-
onmessage?: (message: JSONRPCMessage) => void;
|
|
16
|
-
constructor(ws: WebSocketLike);
|
|
17
|
-
private onBunMessage;
|
|
18
|
-
private onBunError;
|
|
19
|
-
private onBunClose;
|
|
20
|
-
private onNodeMessage;
|
|
21
|
-
private onNodeError;
|
|
22
|
-
private onNodeClose;
|
|
23
|
-
private handleError;
|
|
24
|
-
private handleCloseCleanup;
|
|
25
|
-
/**
|
|
26
|
-
* Start the transport (MCP Transport interface)
|
|
27
|
-
*/
|
|
28
|
-
start(): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Close the transport (MCP Transport interface)
|
|
31
|
-
*/
|
|
32
|
-
close(): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Send message through transport (MCP Transport interface)
|
|
35
|
-
*/
|
|
36
|
-
send(message: JSONRPCMessage): Promise<void>;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type SensitiveEgressReusePolicy as SensitiveEgressReusePolicyInterface, type ToolEgressReviewRequest } from '../sensitive-content/sensitive-content-protocol';
|
|
2
|
-
import { McpPluginRegistry } from './mcp-plugin-registry';
|
|
3
|
-
import { type McpServerModelManager as McpServerModelManagerInterface } from './mcp-protocol';
|
|
4
|
-
export declare class OfficialMcpEgressPolicy implements SensitiveEgressReusePolicyInterface {
|
|
5
|
-
private readonly bundledIdentityCache;
|
|
6
|
-
protected readonly mcpPluginRegistry?: McpPluginRegistry;
|
|
7
|
-
protected readonly mcpServerModelManager?: McpServerModelManagerInterface;
|
|
8
|
-
resolveCandidates(request: ToolEgressReviewRequest): readonly string[] | undefined;
|
|
9
|
-
private matchesIdentity;
|
|
10
|
-
private matchesBundledDynamicIdentity;
|
|
11
|
-
private verifyBundledStdioIdentity;
|
|
12
|
-
private isNodeCommand;
|
|
13
|
-
private hasBundledPluginPath;
|
|
14
|
-
private matchesManifest;
|
|
15
|
-
private parseDestination;
|
|
16
|
-
private parsePayload;
|
|
17
|
-
}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SDK MCP Server
|
|
3
|
-
*
|
|
4
|
-
* SDK MCP Server 是一种特殊类型的 MCP 服务器,它不通过标准的 stdio 或 HTTP 传输层通信,
|
|
5
|
-
* 而是通过 CLI 程序内部的 control_request/control_response 消息机制进行通信。
|
|
6
|
-
*
|
|
7
|
-
* 使用场景:IDE/SDK 集成时,由外部 SDK(如 VS Code 扩展)注册和管理的 MCP 服务器。
|
|
8
|
-
*/
|
|
9
|
-
import type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';
|
|
10
|
-
import { GetPromptResult, McpPrompt, McpResource, McpResourceTemplate, MCPServer, ReadResourceResult } from './mcp-protocol';
|
|
11
|
-
/**
|
|
12
|
-
* Logger 接口(简化版本,与 @openai/agents-core 的 Logger 兼容)
|
|
13
|
-
*/
|
|
14
|
-
interface SimpleLogger {
|
|
15
|
-
debug?: (...args: unknown[]) => void;
|
|
16
|
-
info?: (...args: unknown[]) => void;
|
|
17
|
-
warn?: (...args: unknown[]) => void;
|
|
18
|
-
error?: (...args: unknown[]) => void;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* SDK MCP Server 配置参数
|
|
22
|
-
*/
|
|
23
|
-
export interface SdkMcpServerParams {
|
|
24
|
-
/**
|
|
25
|
-
* 服务器名称
|
|
26
|
-
*/
|
|
27
|
-
name: string;
|
|
28
|
-
/**
|
|
29
|
-
* 发送 MCP 消息的函数
|
|
30
|
-
* 通过 control_request 发送消息到 SDK 端
|
|
31
|
-
* (控制通道形态必填;进程内 sdkInstance 形态不需要)
|
|
32
|
-
*/
|
|
33
|
-
sendMcpMessage?: (serverName: string, message: JSONRPCMessage, signal?: AbortSignal) => Promise<JSONRPCMessage>;
|
|
34
|
-
/**
|
|
35
|
-
* 进程内 SDK MCP Server 实例(`createSdkMcpServer()` 的 `instance`,
|
|
36
|
-
* 即 @modelcontextprotocol/sdk 的 McpServer)。提供时经 InMemoryTransport
|
|
37
|
-
* 直连——宿主与内核同进程(/server 库形态),无需 control 通道。
|
|
38
|
-
* 与 sendMcpMessage 二选一。
|
|
39
|
-
*/
|
|
40
|
-
sdkInstance?: unknown;
|
|
41
|
-
/**
|
|
42
|
-
* 日志记录器
|
|
43
|
-
*/
|
|
44
|
-
logger?: SimpleLogger;
|
|
45
|
-
/**
|
|
46
|
-
* 连接超时时间(毫秒)
|
|
47
|
-
*/
|
|
48
|
-
timeout?: number;
|
|
49
|
-
/**
|
|
50
|
-
* 工具过滤器(权限/deny 过滤)
|
|
51
|
-
* 由 OpenAI agents SDK 在每次构建工具列表时调用
|
|
52
|
-
*/
|
|
53
|
-
toolFilter?: (...args: any[]) => Promise<boolean>;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* SDK MCP Server 实现
|
|
57
|
-
*
|
|
58
|
-
* 实现了 MCPServer 接口,使用 SdkMcpTransport 作为传输层,
|
|
59
|
-
* 通过 control_request/control_response 机制与 SDK 端的 MCP 服务器通信。
|
|
60
|
-
*/
|
|
61
|
-
export declare class SdkMcpServer implements MCPServer {
|
|
62
|
-
readonly name: string;
|
|
63
|
-
private readonly params;
|
|
64
|
-
private readonly logger;
|
|
65
|
-
/**
|
|
66
|
-
* Tool filter exposed for the OpenAI agents SDK.
|
|
67
|
-
* The SDK reads `server.toolFilter` during `getFunctionToolsFromServer`
|
|
68
|
-
* to decide which tools to include in the LLM tool list.
|
|
69
|
-
*/
|
|
70
|
-
toolFilter?: (...args: any[]) => Promise<boolean>;
|
|
71
|
-
private transport;
|
|
72
|
-
private session;
|
|
73
|
-
private _toolsList;
|
|
74
|
-
private _cacheDirty;
|
|
75
|
-
cacheToolsList: boolean;
|
|
76
|
-
private _lastListToolsFailure;
|
|
77
|
-
onToolsListChanged?: () => void;
|
|
78
|
-
/**
|
|
79
|
-
* Short timeout (ms) for resources/list and resources/templates/list. These
|
|
80
|
-
* sit on the per-turn reply critical path, so a stalled server must degrade
|
|
81
|
-
* fast rather than wait out the default 60s request timeout.
|
|
82
|
-
*/
|
|
83
|
-
private static readonly RESOURCE_LIST_TIMEOUT_MS;
|
|
84
|
-
private static readonly mockLogger;
|
|
85
|
-
constructor(params: SdkMcpServerParams);
|
|
86
|
-
/**
|
|
87
|
-
* 连接到 SDK MCP Server
|
|
88
|
-
*
|
|
89
|
-
* 创建 SdkMcpTransport 并通过它连接到 SDK 端的 MCP 服务器。
|
|
90
|
-
*/
|
|
91
|
-
connect(): Promise<void>;
|
|
92
|
-
/**
|
|
93
|
-
* 关闭 SDK MCP Server 连接
|
|
94
|
-
*/
|
|
95
|
-
close(): Promise<void>;
|
|
96
|
-
/**
|
|
97
|
-
* Register channel notification handlers on MCP Client session.
|
|
98
|
-
* Wake-up pattern mirrors startTeamLeadInboxPolling() in team-create-tool.ts.
|
|
99
|
-
*/
|
|
100
|
-
private registerChannelNotificationHandlers;
|
|
101
|
-
/**
|
|
102
|
-
* 使工具缓存失效
|
|
103
|
-
*/
|
|
104
|
-
invalidateToolsCache(): Promise<void>;
|
|
105
|
-
/** Cooldown period (ms) after a listTools failure before retrying. */
|
|
106
|
-
private static readonly LIST_TOOLS_RETRY_COOLDOWN;
|
|
107
|
-
/**
|
|
108
|
-
* 列出可用工具
|
|
109
|
-
*/
|
|
110
|
-
listTools(): ReturnType<MCPServer['listTools']>;
|
|
111
|
-
/**
|
|
112
|
-
* 调用工具
|
|
113
|
-
*/
|
|
114
|
-
callTool(toolName: string, args: Record<string, unknown> | null, meta?: Record<string, unknown> | null): ReturnType<MCPServer['callTool']>;
|
|
115
|
-
/**
|
|
116
|
-
* 列出可用 prompts
|
|
117
|
-
*/
|
|
118
|
-
listPrompts(): Promise<McpPrompt[]>;
|
|
119
|
-
/**
|
|
120
|
-
* Capability declared at `initialize` and cached by the MCP client, so this
|
|
121
|
-
* is a memory read that cannot time out — see MCPServer.supportsResources.
|
|
122
|
-
*/
|
|
123
|
-
supportsResources(): boolean;
|
|
124
|
-
/**
|
|
125
|
-
* 列出可用 resources
|
|
126
|
-
*/
|
|
127
|
-
listResources(): Promise<McpResource[]>;
|
|
128
|
-
/**
|
|
129
|
-
* 列出 resource templates
|
|
130
|
-
*/
|
|
131
|
-
listResourceTemplates(): Promise<McpResourceTemplate[]>;
|
|
132
|
-
/**
|
|
133
|
-
* 获取 prompt
|
|
134
|
-
*/
|
|
135
|
-
getPrompt(promptName: string, args?: Record<string, string>): Promise<GetPromptResult['messages']>;
|
|
136
|
-
/**
|
|
137
|
-
* 读取 resource
|
|
138
|
-
*/
|
|
139
|
-
readResource(request: {
|
|
140
|
-
uri: string;
|
|
141
|
-
}): Promise<ReadResourceResult['contents']>;
|
|
142
|
-
}
|
|
143
|
-
export {};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SDK MCP Transport
|
|
3
|
-
*
|
|
4
|
-
* 实现 MCP Transport 接口,通过 control_request/control_response 机制
|
|
5
|
-
* 与 SDK 端的 MCP 服务器通信。
|
|
6
|
-
*
|
|
7
|
-
* 参考: Claude Code SDK MCP Server 架构
|
|
8
|
-
* - 不通过标准的 stdio 或 HTTP 传输层通信
|
|
9
|
-
* - 使用 CLI 程序内部的消息传递机制
|
|
10
|
-
* - 不使用固定超时,通过 AbortSignal 在 transport 关闭时取消所有请求
|
|
11
|
-
*/
|
|
12
|
-
import type { Transport, TransportSendOptions } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
13
|
-
import type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';
|
|
14
|
-
/**
|
|
15
|
-
* SDK MCP Transport 配置选项
|
|
16
|
-
*/
|
|
17
|
-
export interface SdkMcpTransportOptions {
|
|
18
|
-
/**
|
|
19
|
-
* MCP 服务器名称
|
|
20
|
-
*/
|
|
21
|
-
serverName: string;
|
|
22
|
-
/**
|
|
23
|
-
* 发送 MCP 消息的函数
|
|
24
|
-
* 通过 control_request 发送消息到 SDK 端
|
|
25
|
-
*/
|
|
26
|
-
sendMcpMessage: (serverName: string, message: JSONRPCMessage, signal?: AbortSignal) => Promise<JSONRPCMessage>;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* SDK MCP Transport 实现
|
|
30
|
-
*
|
|
31
|
-
* 实现了 @modelcontextprotocol/sdk 的 Transport 接口,
|
|
32
|
-
* 将 MCP 协议消息通过 control_request/control_response 机制发送到 SDK 端。
|
|
33
|
-
*
|
|
34
|
-
* 每个 send() 调用创建独立的 AbortController,transport 关闭时取消所有进行中的请求。
|
|
35
|
-
*/
|
|
36
|
-
export declare class SdkMcpTransport implements Transport {
|
|
37
|
-
private readonly serverName;
|
|
38
|
-
private readonly sendMcpMessage;
|
|
39
|
-
private isClosed;
|
|
40
|
-
private _sessionId?;
|
|
41
|
-
/** 追踪进行中的请求,用于 close() 时取消 */
|
|
42
|
-
private readonly inflightControllers;
|
|
43
|
-
/**
|
|
44
|
-
* 连接关闭时的回调
|
|
45
|
-
*/
|
|
46
|
-
onclose?: () => void;
|
|
47
|
-
/**
|
|
48
|
-
* 错误发生时的回调
|
|
49
|
-
*/
|
|
50
|
-
onerror?: (error: Error) => void;
|
|
51
|
-
/**
|
|
52
|
-
* 接收到消息时的回调
|
|
53
|
-
*/
|
|
54
|
-
onmessage?: (message: JSONRPCMessage) => void;
|
|
55
|
-
/**
|
|
56
|
-
* 会话 ID
|
|
57
|
-
*/
|
|
58
|
-
get sessionId(): string | undefined;
|
|
59
|
-
set sessionId(value: string | undefined);
|
|
60
|
-
constructor(options: SdkMcpTransportOptions);
|
|
61
|
-
/**
|
|
62
|
-
* 启动传输层
|
|
63
|
-
*
|
|
64
|
-
* SDK 传输层不需要启动过程,因为它不创建子进程或网络连接。
|
|
65
|
-
* 消息通过 control_request/response 机制直接传递。
|
|
66
|
-
*/
|
|
67
|
-
start(): Promise<void>;
|
|
68
|
-
/**
|
|
69
|
-
* 发送 JSON-RPC 消息
|
|
70
|
-
*
|
|
71
|
-
* 通过 sendMcpMessage 函数将消息发送到 SDK 端,
|
|
72
|
-
* SDK 端会返回响应,然后触发 onmessage 回调。
|
|
73
|
-
* 每个请求创建独立的 AbortController,transport 关闭时取消。
|
|
74
|
-
*
|
|
75
|
-
* @param message JSON-RPC 消息
|
|
76
|
-
* @param _options 发送选项(目前未使用)
|
|
77
|
-
*/
|
|
78
|
-
send(message: JSONRPCMessage, _options?: TransportSendOptions): Promise<void>;
|
|
79
|
-
/**
|
|
80
|
-
* 关闭传输层
|
|
81
|
-
*
|
|
82
|
-
* 标记传输层为已关闭状态,取消所有进行中的请求,并触发 onclose 回调。
|
|
83
|
-
*/
|
|
84
|
-
close(): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* 设置协议版本
|
|
87
|
-
*
|
|
88
|
-
* 当收到 initialize 响应时调用,用于记录协议版本。
|
|
89
|
-
*
|
|
90
|
-
* @param _version 协议版本
|
|
91
|
-
*/
|
|
92
|
-
setProtocolVersion(_version: string): void;
|
|
93
|
-
/**
|
|
94
|
-
* 检查传输层是否已关闭
|
|
95
|
-
*/
|
|
96
|
-
get closed(): boolean;
|
|
97
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type AcpBroadcastService } from '../acp/acp-protocol';
|
|
2
|
-
import { type AgentInputItem } from '../agent/openai-agents-types';
|
|
3
|
-
import { MessageQueueManager, type Session } from '../session/session-protocol';
|
|
4
|
-
import { type FollowupQueueItemView, type FollowupQueueService, type FollowupQueueSnapshot, type FollowupSteerFn } from './followup-queue-protocol';
|
|
5
|
-
export declare function isFollowupQueueAvailable(session: Session): boolean;
|
|
6
|
-
export declare function contentBlocksToFollowupItem(contentBlocks: unknown[], hold: boolean): AgentInputItem;
|
|
7
|
-
export declare function ensureFollowupItemId(item: AgentInputItem): string;
|
|
8
|
-
export declare function previewFollowupItem(item: AgentInputItem): string;
|
|
9
|
-
export declare function previewFollowupTeammate(item: AgentInputItem): FollowupQueueItemView['teammate'];
|
|
10
|
-
export declare function snapshotFollowupQueue(session: Session): FollowupQueueSnapshot;
|
|
11
|
-
export declare function findFollowupIndex(session: Session, itemId: string): number;
|
|
12
|
-
/** 把队列项还原成 ACP contentBlocks,供 `session/steer` 立即插入。 */
|
|
13
|
-
export declare function followupItemToContentBlocks(item: AgentInputItem): unknown[];
|
|
14
|
-
export declare class FollowupQueueServiceImpl implements FollowupQueueService {
|
|
15
|
-
protected readonly messageQueueManager: MessageQueueManager;
|
|
16
|
-
protected readonly acpBroadcastService?: AcpBroadcastService;
|
|
17
|
-
private readonly watches;
|
|
18
|
-
/**
|
|
19
|
-
* Queue draining can synchronously emit several queueSubject snapshots
|
|
20
|
-
* (clear, then re-enqueue the items that remain). Coalesce those emissions
|
|
21
|
-
* so the Web UI never observes a transient empty queue and promotes a
|
|
22
|
-
* still-pending item into the transcript.
|
|
23
|
-
*/
|
|
24
|
-
private readonly pendingBroadcasts;
|
|
25
|
-
snapshot(session: Session): FollowupQueueSnapshot;
|
|
26
|
-
enqueue(session: Session, contentBlocks: unknown[], hold: boolean): FollowupQueueSnapshot;
|
|
27
|
-
remove(session: Session, itemId: string): FollowupQueueSnapshot;
|
|
28
|
-
sendNow(session: Session, itemId: string, steer?: FollowupSteerFn): Promise<FollowupQueueSnapshot>;
|
|
29
|
-
watch(session: Session): void;
|
|
30
|
-
unwatch(sessionId: string): void;
|
|
31
|
-
private releaseHold;
|
|
32
|
-
private scheduleBroadcast;
|
|
33
|
-
private broadcast;
|
|
34
|
-
}
|
|
35
|
-
export { FollowupQueueService, FOLLOWUP_QUEUE_META_KEY } from './followup-queue-protocol';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './injectable-content';
|
|
2
|
-
export * from './notification-injection-buffer-protocol';
|
|
3
|
-
export * from './notification-injection-buffer';
|
|
4
|
-
export * from './prompt-mid-turn-buffer-protocol';
|
|
5
|
-
export * from './prompt-mid-turn-buffer';
|
|
6
|
-
export * from './rich-queue-manager-protocol';
|
|
7
|
-
export * from './rich-queue-manager';
|
|
8
|
-
export * from './steer-input-buffer-protocol';
|
|
9
|
-
export * from './steer-input-buffer';
|
|
10
|
-
export * from './followup-queue-protocol';
|
|
11
|
-
export * from './followup-queue';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function mapWithConcurrencyLimit<T, R>(items: readonly T[], concurrency: number, mapper: (item: T, index: number) => Promise<R>): Promise<R[]>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 插件依赖解析器
|
|
3
|
-
* DFS 闭包算法,支持循环检测、跨市场限制、自动降级
|
|
4
|
-
*
|
|
5
|
-
* 参考: Claude Code dependencyResolver.ts (305行)
|
|
6
|
-
*/
|
|
7
|
-
export interface PluginDependencyNode {
|
|
8
|
-
/** 插件 ID (name@marketplace) */
|
|
9
|
-
id: string;
|
|
10
|
-
/** 插件名称 */
|
|
11
|
-
name: string;
|
|
12
|
-
/** 市场名称 */
|
|
13
|
-
marketplace: string;
|
|
14
|
-
/** 依赖列表(插件 ID 格式) */
|
|
15
|
-
dependencies: string[];
|
|
16
|
-
}
|
|
17
|
-
export interface DependencyResolutionResult {
|
|
18
|
-
/** 解析成功的依赖闭包(按拓扑排序) */
|
|
19
|
-
resolved: string[];
|
|
20
|
-
/** 缺失的依赖 */
|
|
21
|
-
missing: string[];
|
|
22
|
-
/** 循环依赖链 */
|
|
23
|
-
cycles: string[][];
|
|
24
|
-
/** 被降级(自动禁用)的插件 */
|
|
25
|
-
demoted: string[];
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* 使用 DFS 解析插件的传递依赖闭包
|
|
29
|
-
*
|
|
30
|
-
* @param rootId 根插件 ID
|
|
31
|
-
* @param lookup 所有可用插件的映射
|
|
32
|
-
* @returns 传递依赖的 ID 集合(不包含 rootId 本身)
|
|
33
|
-
*/
|
|
34
|
-
export declare function resolveDependencyClosure(rootId: string, lookup: Map<string, PluginDependencyNode>): DependencyResolutionResult;
|
|
35
|
-
/**
|
|
36
|
-
* 验证并降级:检查所有插件的依赖是否满足
|
|
37
|
-
* 如果某个插件的依赖缺失或有循环,自动将其标记为降级(禁用)
|
|
38
|
-
*
|
|
39
|
-
* @param plugins 所有启用的插件列表
|
|
40
|
-
* @param allowCrossMarketplaceDeps 是否允许跨市场依赖(默认 false)
|
|
41
|
-
* @returns 降级结果
|
|
42
|
-
*/
|
|
43
|
-
export declare function verifyAndDemote(plugins: PluginDependencyNode[], allowCrossMarketplaceDeps?: boolean): DependencyResolutionResult;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Weixinpay plugin directory integrity guard.
|
|
3
|
-
*
|
|
4
|
-
* On Windows, verifies the weixinpay plugin directory against its
|
|
5
|
-
* manifest.qmsig using QmProtectorLib.dll (via koffi FFI).
|
|
6
|
-
* On other platforms or when the DLL/koffi is unavailable, passthrough.
|
|
7
|
-
*/
|
|
8
|
-
import { PluginInfo, PluginLoadGuard } from '../plugin-protocol';
|
|
9
|
-
export declare class WeixinpayIntegrityGuard implements PluginLoadGuard {
|
|
10
|
-
private readonly logger;
|
|
11
|
-
private bindingCache;
|
|
12
|
-
canLoad(plugin: PluginInfo): Promise<boolean>;
|
|
13
|
-
private getBinding;
|
|
14
|
-
private pathExists;
|
|
15
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { MarketplacePluginEntry, PluginErrorCollector, PluginInstaller, PluginSource, ProgressCallback } from '../plugin-protocol';
|
|
2
|
-
/**
|
|
3
|
-
* Git远程仓库插件安装器
|
|
4
|
-
* 处理source.source === 'url'的插件
|
|
5
|
-
*/
|
|
6
|
-
export declare class GitPluginInstaller implements PluginInstaller {
|
|
7
|
-
protected readonly errorCollector: PluginErrorCollector;
|
|
8
|
-
/**
|
|
9
|
-
* 判断是否支持该插件源
|
|
10
|
-
* 支持: PluginSource对象且source === 'url' 或 'github'
|
|
11
|
-
*/
|
|
12
|
-
support(pluginSource: string | PluginSource | undefined): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* 安装Git远程插件
|
|
15
|
-
* 克隆Git仓库到指定目录
|
|
16
|
-
*/
|
|
17
|
-
install(pluginEntry: MarketplacePluginEntry, targetDir: string, onProgress?: ProgressCallback): Promise<string>;
|
|
18
|
-
/**
|
|
19
|
-
* 更新已安装的Git插件
|
|
20
|
-
* 执行git pull更新内容
|
|
21
|
-
*/
|
|
22
|
-
update(pluginEntry: MarketplacePluginEntry, installedPath: string, onProgress?: ProgressCallback): Promise<string>;
|
|
23
|
-
/**
|
|
24
|
-
* 检查Git插件是否已安装
|
|
25
|
-
*/
|
|
26
|
-
isInstalled(pluginEntry: MarketplacePluginEntry, marketplaceInstalledPath: string): Promise<string | undefined>;
|
|
27
|
-
/**
|
|
28
|
-
* 获取插件的当前版本信息(commit hash)
|
|
29
|
-
*/
|
|
30
|
-
getInstalledVersion(installedPath: string): Promise<string | undefined>;
|
|
31
|
-
/**
|
|
32
|
-
* 获取插件的远程URL
|
|
33
|
-
*/
|
|
34
|
-
getRemoteUrl(installedPath: string): Promise<string | undefined>;
|
|
35
|
-
/**
|
|
36
|
-
* 从PluginSource解析实际的Git URL
|
|
37
|
-
* @param source 插件源配置
|
|
38
|
-
* @returns Git URL
|
|
39
|
-
*/
|
|
40
|
-
private resolveGitUrl;
|
|
41
|
-
private validateGitSha;
|
|
42
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@celljs/core';
|
|
2
|
-
import { MarketplacePluginEntry, PluginInstaller, PluginSource } from '../plugin-protocol';
|
|
3
|
-
/**
|
|
4
|
-
* Git 子目录插件安装器
|
|
5
|
-
* 使用 git sparse checkout 从 monorepo 的子目录安装插件
|
|
6
|
-
* 避免全量克隆整个仓库
|
|
7
|
-
*
|
|
8
|
-
* 参考: Claude Code schemas.ts:1131-1157
|
|
9
|
-
*/
|
|
10
|
-
export declare class GitSubdirPluginInstaller implements PluginInstaller {
|
|
11
|
-
protected readonly logger: Logger;
|
|
12
|
-
protected init(): void;
|
|
13
|
-
support(pluginSource: string | PluginSource): boolean;
|
|
14
|
-
install(pluginEntry: MarketplacePluginEntry, targetDir: string, onProgress?: (message: string) => void): Promise<string>;
|
|
15
|
-
update(pluginEntry: MarketplacePluginEntry, installedPath: string, onProgress?: (message: string) => void): Promise<string>;
|
|
16
|
-
isInstalled(pluginInfo: MarketplacePluginEntry, marketplaceInstalledPath: string): Promise<string | undefined>;
|
|
17
|
-
private validateGitSha;
|
|
18
|
-
private getValidatedSubdir;
|
|
19
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { MarketplacePluginEntry, PluginErrorCollector, PluginInstaller, PluginSource, ProgressCallback } from '../plugin-protocol';
|
|
2
|
-
/**
|
|
3
|
-
* 本地相对路径插件安装器
|
|
4
|
-
* 处理source.source === 'local'的插件
|
|
5
|
-
*/
|
|
6
|
-
export declare class LocalPluginInstaller implements PluginInstaller {
|
|
7
|
-
protected readonly errorCollector: PluginErrorCollector;
|
|
8
|
-
/**
|
|
9
|
-
* 判断是否支持该插件源
|
|
10
|
-
* 支持:
|
|
11
|
-
* 1. 字符串类型source(视为本地相对路径)
|
|
12
|
-
* 2. PluginSource对象且source === 'local'
|
|
13
|
-
*/
|
|
14
|
-
support(pluginSource: string | PluginSource): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* 安装本地插件
|
|
17
|
-
* 本地插件无需实际安装,只需解析路径
|
|
18
|
-
*/
|
|
19
|
-
install(pluginEntry: MarketplacePluginEntry, targetDir: string, onProgress?: ProgressCallback): Promise<string>;
|
|
20
|
-
/**
|
|
21
|
-
* 更新本地插件
|
|
22
|
-
* 本地插件无需更新,直接返回路径
|
|
23
|
-
*/
|
|
24
|
-
update(pluginEntry: MarketplacePluginEntry, installedPath: string, onProgress?: ProgressCallback): Promise<string>;
|
|
25
|
-
/**
|
|
26
|
-
* 检查本地插件是否已安装(已解析)
|
|
27
|
-
*/
|
|
28
|
-
isInstalled(pluginEntry: MarketplacePluginEntry, marketplaceInstalledPath: string): Promise<string | undefined>;
|
|
29
|
-
/**
|
|
30
|
-
* 解析插件的实际路径
|
|
31
|
-
* 支持两种路径模式:
|
|
32
|
-
* 1. 直接指向插件根目录: targetDir/path(含 "." / "./" = 市场根本身)
|
|
33
|
-
* 2. 指向插件的父目录: targetDir/path/pluginName
|
|
34
|
-
*/
|
|
35
|
-
private resolvePluginPath;
|
|
36
|
-
/**
|
|
37
|
-
* 标准化插件源为PluginSource对象
|
|
38
|
-
*/
|
|
39
|
-
private normalizeSource;
|
|
40
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@celljs/core';
|
|
2
|
-
import { MarketplacePluginEntry, PluginInstaller, PluginSource } from '../plugin-protocol';
|
|
3
|
-
/**
|
|
4
|
-
* npm 插件安装器
|
|
5
|
-
* 通过 npm install 安装插件包到指定目录
|
|
6
|
-
*
|
|
7
|
-
* 参考: Claude Code schemas.ts:974-1050
|
|
8
|
-
*/
|
|
9
|
-
export declare class NpmPluginInstaller implements PluginInstaller {
|
|
10
|
-
protected readonly logger: Logger;
|
|
11
|
-
protected init(): void;
|
|
12
|
-
support(pluginSource: string | PluginSource): boolean;
|
|
13
|
-
install(pluginEntry: MarketplacePluginEntry, targetDir: string, onProgress?: (message: string) => void): Promise<string>;
|
|
14
|
-
update(pluginEntry: MarketplacePluginEntry, installedPath: string, onProgress?: (message: string) => void): Promise<string>;
|
|
15
|
-
isInstalled(pluginInfo: MarketplacePluginEntry, marketplaceInstalledPath: string): Promise<string | undefined>;
|
|
16
|
-
/** Fail-closed: package name must be a valid npm id (scoped ok); never a path. */
|
|
17
|
-
private resolvePackageName;
|
|
18
|
-
/**
|
|
19
|
-
* Resolve `node_modules/<package>` under the install dir. Scoped names become
|
|
20
|
-
* two segments (`@scope`, `name`); containment rejects any escape (#71947).
|
|
21
|
-
*/
|
|
22
|
-
private resolvePackageDir;
|
|
23
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@celljs/core';
|
|
2
|
-
import { Agent } from '@genie/product';
|
|
3
|
-
import { PluginEnvironmentContext } from '../plugin-environment';
|
|
4
|
-
import { PluginErrorCollector, PluginExtensionType } from '../plugin-protocol';
|
|
5
|
-
/**
|
|
6
|
-
* Agent 扩展加载器
|
|
7
|
-
* 从扩展目录的 agents 子目录中加载 agent 配置
|
|
8
|
-
* 支持配置路径和默认扫描的合并
|
|
9
|
-
*/
|
|
10
|
-
export declare class AgentExtensionLoader {
|
|
11
|
-
readonly type = PluginExtensionType.Agent;
|
|
12
|
-
protected readonly logger: Logger;
|
|
13
|
-
protected readonly errorCollector: PluginErrorCollector;
|
|
14
|
-
protected init(): void;
|
|
15
|
-
/**
|
|
16
|
-
* 加载 agents
|
|
17
|
-
* 如果提供了 agentPaths 配置,则加载指定路径;否则默认扫描 agents 目录
|
|
18
|
-
* 两种方式的结果会被合并,并通过路径去重避免重复加载
|
|
19
|
-
* @param extensionDir 扩展目录路径
|
|
20
|
-
* @param extensionName 扩展名称(用于标记)
|
|
21
|
-
* @param agentPaths 可选的 agent 路径配置数组,相对于 extensionDir
|
|
22
|
-
* @returns Agent 数组
|
|
23
|
-
*/
|
|
24
|
-
load(extensionDir: string, extensionName: string, agentPaths?: string[], pluginEnvironment?: PluginEnvironmentContext): Promise<Agent[]>;
|
|
25
|
-
/**
|
|
26
|
-
* 从指定的 agent 路径加载
|
|
27
|
-
* @param extensionDir 扩展目录路径
|
|
28
|
-
* @param extensionName 扩展名称
|
|
29
|
-
* @param agentPaths agent 路径配置数组
|
|
30
|
-
* @param loadedPaths 已加载的路径集合,用于去重
|
|
31
|
-
* @returns Agent 数组
|
|
32
|
-
*/
|
|
33
|
-
private loadFromPaths;
|
|
34
|
-
private pathExists;
|
|
35
|
-
/**
|
|
36
|
-
* 递归枚举插件 agents 目录下的 .md 文件(走 data-fs seam,注入卷可见)。
|
|
37
|
-
* 深度上限防御异常插件树;软链条目用 stat 归类,与 DirectoryScanUtils 一致。
|
|
38
|
-
*/
|
|
39
|
-
private scanMdFiles;
|
|
40
|
-
private scanAgentsDirectory;
|
|
41
|
-
private parseAgentFile;
|
|
42
|
-
private generateSourceLabel;
|
|
43
|
-
}
|