@vess-id/vess 0.0.0-dev-20260902121045
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/LICENSE +64 -0
- package/README.md +215 -0
- package/bin/vess.js +2 -0
- package/dist/__mocks__/@napi-rs/keyring.d.ts +9 -0
- package/dist/__mocks__/@napi-rs/keyring.d.ts.map +1 -0
- package/dist/__mocks__/@napi-rs/keyring.js +33 -0
- package/dist/__mocks__/@napi-rs/keyring.js.map +1 -0
- package/dist/__mocks__/node-mac-auth.d.ts +8 -0
- package/dist/__mocks__/node-mac-auth.d.ts.map +1 -0
- package/dist/__mocks__/node-mac-auth.js +29 -0
- package/dist/__mocks__/node-mac-auth.js.map +1 -0
- package/dist/adapter/mcp/http-transport.d.ts +40 -0
- package/dist/adapter/mcp/http-transport.d.ts.map +1 -0
- package/dist/adapter/mcp/http-transport.js +228 -0
- package/dist/adapter/mcp/http-transport.js.map +1 -0
- package/dist/adapter/mcp/mcp-adapter.d.ts +43 -0
- package/dist/adapter/mcp/mcp-adapter.d.ts.map +1 -0
- package/dist/adapter/mcp/mcp-adapter.js +65 -0
- package/dist/adapter/mcp/mcp-adapter.js.map +1 -0
- package/dist/adapter/mcp/mcp-server.factory.d.ts +44 -0
- package/dist/adapter/mcp/mcp-server.factory.d.ts.map +1 -0
- package/dist/adapter/mcp/mcp-server.factory.js +311 -0
- package/dist/adapter/mcp/mcp-server.factory.js.map +1 -0
- package/dist/adapter/mcp/stdio-transport.d.ts +7 -0
- package/dist/adapter/mcp/stdio-transport.d.ts.map +1 -0
- package/dist/adapter/mcp/stdio-transport.js +13 -0
- package/dist/adapter/mcp/stdio-transport.js.map +1 -0
- package/dist/adapter/mcp/transport.d.ts +10 -0
- package/dist/adapter/mcp/transport.d.ts.map +1 -0
- package/dist/adapter/mcp/transport.js +14 -0
- package/dist/adapter/mcp/transport.js.map +1 -0
- package/dist/approval/approval-token.d.ts +23 -0
- package/dist/approval/approval-token.d.ts.map +1 -0
- package/dist/approval/approval-token.js +81 -0
- package/dist/approval/approval-token.js.map +1 -0
- package/dist/audit/audit-dto-mapper.d.ts +29 -0
- package/dist/audit/audit-dto-mapper.d.ts.map +1 -0
- package/dist/audit/audit-dto-mapper.js +61 -0
- package/dist/audit/audit-dto-mapper.js.map +1 -0
- package/dist/audit/audit-logger.d.ts +35 -0
- package/dist/audit/audit-logger.d.ts.map +1 -0
- package/dist/audit/audit-logger.js +67 -0
- package/dist/audit/audit-logger.js.map +1 -0
- package/dist/audit/audit-sync.d.ts +12 -0
- package/dist/audit/audit-sync.d.ts.map +1 -0
- package/dist/audit/audit-sync.js +65 -0
- package/dist/audit/audit-sync.js.map +1 -0
- package/dist/auth/user-authenticator.d.ts +51 -0
- package/dist/auth/user-authenticator.d.ts.map +1 -0
- package/dist/auth/user-authenticator.js +155 -0
- package/dist/auth/user-authenticator.js.map +1 -0
- package/dist/bootstrap/sdk-precheck.d.ts +9 -0
- package/dist/bootstrap/sdk-precheck.d.ts.map +1 -0
- package/dist/bootstrap/sdk-precheck.js +103 -0
- package/dist/bootstrap/sdk-precheck.js.map +1 -0
- package/dist/cli/claude-config-path.d.ts +17 -0
- package/dist/cli/claude-config-path.d.ts.map +1 -0
- package/dist/cli/claude-config-path.js +59 -0
- package/dist/cli/claude-config-path.js.map +1 -0
- package/dist/cli/cli-db.d.ts +12 -0
- package/dist/cli/cli-db.d.ts.map +1 -0
- package/dist/cli/cli-db.js +20 -0
- package/dist/cli/cli-db.js.map +1 -0
- package/dist/cli/cli-utils.d.ts +14 -0
- package/dist/cli/cli-utils.d.ts.map +1 -0
- package/dist/cli/cli-utils.js +57 -0
- package/dist/cli/cli-utils.js.map +1 -0
- package/dist/cli/daemon-utils.d.ts +30 -0
- package/dist/cli/daemon-utils.d.ts.map +1 -0
- package/dist/cli/daemon-utils.js +131 -0
- package/dist/cli/daemon-utils.js.map +1 -0
- package/dist/cli/daemon.d.ts +13 -0
- package/dist/cli/daemon.d.ts.map +1 -0
- package/dist/cli/daemon.js +207 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/doctor.d.ts +6 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +136 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/env-delete.d.ts +6 -0
- package/dist/cli/env-delete.d.ts.map +1 -0
- package/dist/cli/env-delete.js +80 -0
- package/dist/cli/env-delete.js.map +1 -0
- package/dist/cli/env-list.d.ts +5 -0
- package/dist/cli/env-list.d.ts.map +1 -0
- package/dist/cli/env-list.js +42 -0
- package/dist/cli/env-list.js.map +1 -0
- package/dist/cli/env-post-integration.d.ts +21 -0
- package/dist/cli/env-post-integration.d.ts.map +1 -0
- package/dist/cli/env-post-integration.js +300 -0
- package/dist/cli/env-post-integration.js.map +1 -0
- package/dist/cli/env-restore.d.ts +15 -0
- package/dist/cli/env-restore.d.ts.map +1 -0
- package/dist/cli/env-restore.js +130 -0
- package/dist/cli/env-restore.js.map +1 -0
- package/dist/cli/env.d.ts +14 -0
- package/dist/cli/env.d.ts.map +1 -0
- package/dist/cli/env.js +182 -0
- package/dist/cli/env.js.map +1 -0
- package/dist/cli/error-handlers.d.ts +13 -0
- package/dist/cli/error-handlers.d.ts.map +1 -0
- package/dist/cli/error-handlers.js +32 -0
- package/dist/cli/error-handlers.js.map +1 -0
- package/dist/cli/hook-check-env.d.ts +12 -0
- package/dist/cli/hook-check-env.d.ts.map +1 -0
- package/dist/cli/hook-check-env.js +117 -0
- package/dist/cli/hook-check-env.js.map +1 -0
- package/dist/cli/hook-session-project.d.ts +10 -0
- package/dist/cli/hook-session-project.d.ts.map +1 -0
- package/dist/cli/hook-session-project.js +206 -0
- package/dist/cli/hook-session-project.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +361 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init-guard.d.ts +13 -0
- package/dist/cli/init-guard.d.ts.map +1 -0
- package/dist/cli/init-guard.js +62 -0
- package/dist/cli/init-guard.js.map +1 -0
- package/dist/cli/init.d.ts +19 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +440 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/install.d.ts +14 -0
- package/dist/cli/install.d.ts.map +1 -0
- package/dist/cli/install.js +183 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/cli/login.d.ts +6 -0
- package/dist/cli/login.d.ts.map +1 -0
- package/dist/cli/login.js +76 -0
- package/dist/cli/login.js.map +1 -0
- package/dist/cli/logs.d.ts +32 -0
- package/dist/cli/logs.d.ts.map +1 -0
- package/dist/cli/logs.js +147 -0
- package/dist/cli/logs.js.map +1 -0
- package/dist/cli/otel-headers.d.ts +12 -0
- package/dist/cli/otel-headers.d.ts.map +1 -0
- package/dist/cli/otel-headers.js +38 -0
- package/dist/cli/otel-headers.js.map +1 -0
- package/dist/cli/project.d.ts +8 -0
- package/dist/cli/project.d.ts.map +1 -0
- package/dist/cli/project.js +102 -0
- package/dist/cli/project.js.map +1 -0
- package/dist/cli/reset.d.ts +8 -0
- package/dist/cli/reset.d.ts.map +1 -0
- package/dist/cli/reset.js +137 -0
- package/dist/cli/reset.js.map +1 -0
- package/dist/cli/run.d.ts +22 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +103 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/start.d.ts +2 -0
- package/dist/cli/start.d.ts.map +1 -0
- package/dist/cli/start.js +29 -0
- package/dist/cli/start.js.map +1 -0
- package/dist/cli/status.d.ts +12 -0
- package/dist/cli/status.d.ts.map +1 -0
- package/dist/cli/status.js +131 -0
- package/dist/cli/status.js.map +1 -0
- package/dist/cli/telemetry-setup.d.ts +27 -0
- package/dist/cli/telemetry-setup.d.ts.map +1 -0
- package/dist/cli/telemetry-setup.js +157 -0
- package/dist/cli/telemetry-setup.js.map +1 -0
- package/dist/cli/uninstall.d.ts +8 -0
- package/dist/cli/uninstall.d.ts.map +1 -0
- package/dist/cli/uninstall.js +110 -0
- package/dist/cli/uninstall.js.map +1 -0
- package/dist/cli/version.d.ts +2 -0
- package/dist/cli/version.d.ts.map +1 -0
- package/dist/cli/version.js +10 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/config/config.d.ts +10 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +64 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/constants.d.ts +11 -0
- package/dist/config/constants.d.ts.map +1 -0
- package/dist/config/constants.js +14 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/config/paths.d.ts +9 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +58 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/version.d.ts +3 -0
- package/dist/config/version.d.ts.map +1 -0
- package/dist/config/version.js +80 -0
- package/dist/config/version.js.map +1 -0
- package/dist/core/execution-engine.d.ts +289 -0
- package/dist/core/execution-engine.d.ts.map +1 -0
- package/dist/core/execution-engine.js +1931 -0
- package/dist/core/execution-engine.js.map +1 -0
- package/dist/core/runtime.d.ts +43 -0
- package/dist/core/runtime.d.ts.map +1 -0
- package/dist/core/runtime.js +147 -0
- package/dist/core/runtime.js.map +1 -0
- package/dist/core/sync-scheduler.d.ts +42 -0
- package/dist/core/sync-scheduler.d.ts.map +1 -0
- package/dist/core/sync-scheduler.js +131 -0
- package/dist/core/sync-scheduler.js.map +1 -0
- package/dist/core/types.d.ts +106 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +7 -0
- package/dist/core/types.js.map +1 -0
- package/dist/daemon/service-manager.d.ts +68 -0
- package/dist/daemon/service-manager.d.ts.map +1 -0
- package/dist/daemon/service-manager.js +303 -0
- package/dist/daemon/service-manager.js.map +1 -0
- package/dist/env/env-classifier.d.ts +14 -0
- package/dist/env/env-classifier.d.ts.map +1 -0
- package/dist/env/env-classifier.js +94 -0
- package/dist/env/env-classifier.js.map +1 -0
- package/dist/env/env-parser.d.ts +13 -0
- package/dist/env/env-parser.d.ts.map +1 -0
- package/dist/env/env-parser.js +33 -0
- package/dist/env/env-parser.js.map +1 -0
- package/dist/env/env-profile-store.d.ts +15 -0
- package/dist/env/env-profile-store.d.ts.map +1 -0
- package/dist/env/env-profile-store.js +35 -0
- package/dist/env/env-profile-store.js.map +1 -0
- package/dist/env/env-reference.d.ts +10 -0
- package/dist/env/env-reference.d.ts.map +1 -0
- package/dist/env/env-reference.js +33 -0
- package/dist/env/env-reference.js.map +1 -0
- package/dist/env/env-resolver.d.ts +18 -0
- package/dist/env/env-resolver.d.ts.map +1 -0
- package/dist/env/env-resolver.js +48 -0
- package/dist/env/env-resolver.js.map +1 -0
- package/dist/env/fs-utils.d.ts +9 -0
- package/dist/env/fs-utils.d.ts.map +1 -0
- package/dist/env/fs-utils.js +59 -0
- package/dist/env/fs-utils.js.map +1 -0
- package/dist/env/secret-backend.d.ts +15 -0
- package/dist/env/secret-backend.d.ts.map +1 -0
- package/dist/env/secret-backend.js +24 -0
- package/dist/env/secret-backend.js.map +1 -0
- package/dist/executor/executor-registry.d.ts +22 -0
- package/dist/executor/executor-registry.d.ts.map +1 -0
- package/dist/executor/executor-registry.js +42 -0
- package/dist/executor/executor-registry.js.map +1 -0
- package/dist/executor/process-launcher.d.ts +26 -0
- package/dist/executor/process-launcher.d.ts.map +1 -0
- package/dist/executor/process-launcher.js +98 -0
- package/dist/executor/process-launcher.js.map +1 -0
- package/dist/executor/secret-file.d.ts +28 -0
- package/dist/executor/secret-file.d.ts.map +1 -0
- package/dist/executor/secret-file.js +127 -0
- package/dist/executor/secret-file.js.map +1 -0
- package/dist/gateway/auth.d.ts +26 -0
- package/dist/gateway/auth.d.ts.map +1 -0
- package/dist/gateway/auth.js +66 -0
- package/dist/gateway/auth.js.map +1 -0
- package/dist/gateway/gateway-client.d.ts +363 -0
- package/dist/gateway/gateway-client.d.ts.map +1 -0
- package/dist/gateway/gateway-client.js +611 -0
- package/dist/gateway/gateway-client.js.map +1 -0
- package/dist/identity/agent-identity.d.ts +29 -0
- package/dist/identity/agent-identity.d.ts.map +1 -0
- package/dist/identity/agent-identity.js +54 -0
- package/dist/identity/agent-identity.js.map +1 -0
- package/dist/identity/did-manager.d.ts +17 -0
- package/dist/identity/did-manager.d.ts.map +1 -0
- package/dist/identity/did-manager.js +29 -0
- package/dist/identity/did-manager.js.map +1 -0
- package/dist/identity/key-manager.d.ts +21 -0
- package/dist/identity/key-manager.d.ts.map +1 -0
- package/dist/identity/key-manager.js +126 -0
- package/dist/identity/key-manager.js.map +1 -0
- package/dist/identity/session-key.d.ts +13 -0
- package/dist/identity/session-key.d.ts.map +1 -0
- package/dist/identity/session-key.js +17 -0
- package/dist/identity/session-key.js.map +1 -0
- package/dist/policy/policy-evaluator.d.ts +63 -0
- package/dist/policy/policy-evaluator.d.ts.map +1 -0
- package/dist/policy/policy-evaluator.js +266 -0
- package/dist/policy/policy-evaluator.js.map +1 -0
- package/dist/policy/policy-loader.d.ts +10 -0
- package/dist/policy/policy-loader.d.ts.map +1 -0
- package/dist/policy/policy-loader.js +71 -0
- package/dist/policy/policy-loader.js.map +1 -0
- package/dist/policy/types.d.ts +21 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +3 -0
- package/dist/policy/types.js.map +1 -0
- package/dist/telemetry/claude-settings.d.ts +67 -0
- package/dist/telemetry/claude-settings.d.ts.map +1 -0
- package/dist/telemetry/claude-settings.js +191 -0
- package/dist/telemetry/claude-settings.js.map +1 -0
- package/dist/telemetry/otel-headers.d.ts +27 -0
- package/dist/telemetry/otel-headers.d.ts.map +1 -0
- package/dist/telemetry/otel-headers.js +33 -0
- package/dist/telemetry/otel-headers.js.map +1 -0
- package/dist/telemetry/project-key.d.ts +12 -0
- package/dist/telemetry/project-key.d.ts.map +1 -0
- package/dist/telemetry/project-key.js +113 -0
- package/dist/telemetry/project-key.js.map +1 -0
- package/dist/utils/credential-errors.d.ts +73 -0
- package/dist/utils/credential-errors.d.ts.map +1 -0
- package/dist/utils/credential-errors.js +90 -0
- package/dist/utils/credential-errors.js.map +1 -0
- package/dist/utils/resource-canonicalizer.d.ts +19 -0
- package/dist/utils/resource-canonicalizer.d.ts.map +1 -0
- package/dist/utils/resource-canonicalizer.js +100 -0
- package/dist/utils/resource-canonicalizer.js.map +1 -0
- package/dist/utils/vc-utils.d.ts +23 -0
- package/dist/utils/vc-utils.d.ts.map +1 -0
- package/dist/utils/vc-utils.js +53 -0
- package/dist/utils/vc-utils.js.map +1 -0
- package/dist/wallet/sqlite.d.ts +4 -0
- package/dist/wallet/sqlite.d.ts.map +1 -0
- package/dist/wallet/sqlite.js +158 -0
- package/dist/wallet/sqlite.js.map +1 -0
- package/dist/wallet/vp-builder.d.ts +26 -0
- package/dist/wallet/vp-builder.d.ts.map +1 -0
- package/dist/wallet/vp-builder.js +55 -0
- package/dist/wallet/vp-builder.js.map +1 -0
- package/dist/wallet/wallet.d.ts +64 -0
- package/dist/wallet/wallet.d.ts.map +1 -0
- package/dist/wallet/wallet.js +179 -0
- package/dist/wallet/wallet.js.map +1 -0
- package/package.json +71 -0
- package/required-sdk-symbols.json +15 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-transport.js","sourceRoot":"","sources":["../../../src/adapter/mcp/http-transport.ts"],"names":[],"mappings":";;AAyFA,gDA4LC;AArRD;;;;;;;;;;;;;;;GAeG;AACH,0FAAkG;AAElG,yCAAyE;AACzE,6CAAwC;AACxC,sDAM+B;AAoC/B,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACxB,CAAC;AAED,2EAA2E;AAC3E,MAAM,gBAAgB,GAAG,KAAK,CAAA;AAE9B,SAAS,gBAAgB,CAAC,SAA4C;IACpE,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,KAAK,GAAG,UAAU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Q,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE;gBAC/D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;gBACzE,IAAI,CAAC;oBACH,MAAM,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;oBACzC,MAAM,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;gBACxC,CAAC;gBAAC,MAAM,CAAC,CAAC,0CAA0C,CAAC,CAAC;YACxD,CAAC,CAAC,CAAA;YACF,MAAM,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;YAChC,QAAQ,CAAC,KAAK,EAAE,CAAA;YAChB,sDAAsD;YACtD,UAAU,CAAC,mBAAmB,EAAE,CAAA;YAChC,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC3C,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;oBACvB,IAAI,GAAG;wBAAE,MAAM,CAAC,GAAG,CAAC,CAAA;;wBACf,OAAO,EAAE,CAAA;gBAChB,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ExecutionEngine } from '../../core/execution-engine';
|
|
2
|
+
import { MCPToolHandler } from './mcp-server.factory';
|
|
3
|
+
import { ReauthRequiredExecutionInfo } from '../../core/types';
|
|
4
|
+
export declare class McpAdapter implements MCPToolHandler {
|
|
5
|
+
private readonly engine;
|
|
6
|
+
constructor(engine: ExecutionEngine);
|
|
7
|
+
callTool(args: {
|
|
8
|
+
tool: string;
|
|
9
|
+
action: string;
|
|
10
|
+
parameters?: Record<string, any>;
|
|
11
|
+
approval?: {
|
|
12
|
+
token: string;
|
|
13
|
+
choice: string;
|
|
14
|
+
vcTTLMinutes?: number;
|
|
15
|
+
request_id?: string;
|
|
16
|
+
outcome_id?: string;
|
|
17
|
+
granted_at?: string;
|
|
18
|
+
granted_by?: string;
|
|
19
|
+
};
|
|
20
|
+
pendingRequestId?: string;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
success: boolean;
|
|
23
|
+
data?: any;
|
|
24
|
+
error?: string;
|
|
25
|
+
approvalRequired?: any;
|
|
26
|
+
waitingForApproval?: any;
|
|
27
|
+
reauthRequired?: ReauthRequiredExecutionInfo;
|
|
28
|
+
}>;
|
|
29
|
+
issueToolPermission(args: {
|
|
30
|
+
tool: string;
|
|
31
|
+
actions: string[];
|
|
32
|
+
}): Promise<{
|
|
33
|
+
success: boolean;
|
|
34
|
+
data?: any;
|
|
35
|
+
error?: string;
|
|
36
|
+
}>;
|
|
37
|
+
listAvailableTools(): Promise<{
|
|
38
|
+
success: boolean;
|
|
39
|
+
data?: any;
|
|
40
|
+
error?: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=mcp-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-adapter.d.ts","sourceRoot":"","sources":["../../../src/adapter/mcp/mcp-adapter.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAkB,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AAE9E,qBAAa,UAAW,YAAW,cAAc;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,eAAe;IAE9C,QAAQ,CAAC,IAAI,EAAE;QACnB,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAChC,QAAQ,CAAC,EAAE;YACT,KAAK,EAAE,MAAM,CAAA;YACb,MAAM,EAAE,MAAM,CAAA;YACd,YAAY,CAAC,EAAE,MAAM,CAAA;YAIrB,UAAU,CAAC,EAAE,MAAM,CAAA;YACnB,UAAU,CAAC,EAAE,MAAM,CAAA;YAInB,UAAU,CAAC,EAAE,MAAM,CAAA;YACnB,UAAU,CAAC,EAAE,MAAM,CAAA;SACpB,CAAA;QACD,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAC1B,GAAG,OAAO,CAAC;QACV,OAAO,EAAE,OAAO,CAAA;QAChB,IAAI,CAAC,EAAE,GAAG,CAAA;QACV,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,gBAAgB,CAAC,EAAE,GAAG,CAAA;QACtB,kBAAkB,CAAC,EAAE,GAAG,CAAA;QAIxB,cAAc,CAAC,EAAE,2BAA2B,CAAA;KAC7C,CAAC;IA4BI,mBAAmB,CAAC,IAAI,EAAE;QAC9B,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,EAAE,CAAA;KAClB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAQvD,kBAAkB,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAGtF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.McpAdapter = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* MCP Adapter — thin bridge between MCP protocol and agentd core.
|
|
6
|
+
*
|
|
7
|
+
* This adapter does NOT:
|
|
8
|
+
* - Evaluate policies
|
|
9
|
+
* - Acquire or verify VCs/VPs
|
|
10
|
+
* - Access credentials or tokens
|
|
11
|
+
* - Make Gateway API calls
|
|
12
|
+
* - Decide execution routing
|
|
13
|
+
*
|
|
14
|
+
* It ONLY:
|
|
15
|
+
* - Receives MCP tool calls
|
|
16
|
+
* - Normalizes action names (MCP-specific format quirks)
|
|
17
|
+
* - Passes action + input to ExecutionEngine
|
|
18
|
+
* - Returns the result
|
|
19
|
+
*/
|
|
20
|
+
const ai_identity_1 = require("@vess-id/ai-identity");
|
|
21
|
+
class McpAdapter {
|
|
22
|
+
engine;
|
|
23
|
+
constructor(engine) {
|
|
24
|
+
this.engine = engine;
|
|
25
|
+
}
|
|
26
|
+
async callTool(args) {
|
|
27
|
+
if (!args.tool || !args.action) {
|
|
28
|
+
return {
|
|
29
|
+
success: false,
|
|
30
|
+
error: 'Both "tool" and "action" are required. When retrying after approval, include the original tool and action along with pendingRequestId.',
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const action = (0, ai_identity_1.normalizeMcpActionName)(args.tool, args.action);
|
|
34
|
+
return this.engine.execute({
|
|
35
|
+
action,
|
|
36
|
+
input: args.parameters || {},
|
|
37
|
+
approval: args.approval ? {
|
|
38
|
+
token: args.approval.token,
|
|
39
|
+
choice: args.approval.choice,
|
|
40
|
+
vcTTLMinutes: args.approval.vcTTLMinutes,
|
|
41
|
+
// Thread the Cedar retry-path context through so the engine can
|
|
42
|
+
// consume the single-use ledger token (Step 3.5). All optional — the
|
|
43
|
+
// engine only takes the retry path when request_id + outcome_id +
|
|
44
|
+
// granted_at + granted_by are all present.
|
|
45
|
+
request_id: args.approval.request_id,
|
|
46
|
+
outcome_id: args.approval.outcome_id,
|
|
47
|
+
granted_at: args.approval.granted_at,
|
|
48
|
+
granted_by: args.approval.granted_by,
|
|
49
|
+
} : undefined,
|
|
50
|
+
pendingRequestId: args.pendingRequestId,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
async issueToolPermission(args) {
|
|
54
|
+
if (!args.tool || !Array.isArray(args.actions) || args.actions.length === 0) {
|
|
55
|
+
return { success: false, error: '"tool" and at least one "action" are required for issueToolPermission.' };
|
|
56
|
+
}
|
|
57
|
+
const actions = args.actions.map(a => (0, ai_identity_1.normalizeMcpActionName)(args.tool, a));
|
|
58
|
+
return this.engine.requestPermissions(actions);
|
|
59
|
+
}
|
|
60
|
+
async listAvailableTools() {
|
|
61
|
+
return this.engine.listAvailableTools();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.McpAdapter = McpAdapter;
|
|
65
|
+
//# sourceMappingURL=mcp-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-adapter.js","sourceRoot":"","sources":["../../../src/adapter/mcp/mcp-adapter.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,sDAA6D;AAK7D,MAAa,UAAU;IACQ;IAA7B,YAA6B,MAAuB;QAAvB,WAAM,GAAN,MAAM,CAAiB;IAAG,CAAC;IAExD,KAAK,CAAC,QAAQ,CAAC,IAoBd;QAWC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YAC/B,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,wIAAwI;aAChJ,CAAA;QACH,CAAC;QACD,MAAM,MAAM,GAAG,IAAA,oCAAsB,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAC7D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACzB,MAAM;YACN,KAAK,EAAE,IAAI,CAAC,UAAU,IAAI,EAAE;YAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACxB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK;gBAC1B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAwB;gBAC9C,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY;gBACxC,gEAAgE;gBAChE,qEAAqE;gBACrE,kEAAkE;gBAClE,2CAA2C;gBAC3C,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU;gBACpC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU;gBACpC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU;gBACpC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU;aACrC,CAAC,CAAC,CAAC,SAAS;YACb,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;SACxC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,IAGzB;QACC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,wEAAwE,EAAE,CAAA;QAC5G,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,oCAAsB,EAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;QAC3E,OAAO,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAA;IACzC,CAAC;CACF;AA3ED,gCA2EC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { ReauthRequiredExecutionInfo } from '../../core/types';
|
|
3
|
+
export declare const CALL_TOOL_DESCRIPTION = "Execute an action on an external service or local resource on behalf of the user.\nThis is the PRIMARY tool \u2014 always use this to perform actions. Permission is handled automatically:\n- Read-type actions (low risk) are auto-approved and execute immediately.\n- Write-type actions that need approval will return an approval_required response. Re-call with the approval parameter to confirm or deny.\nDo NOT call aidentity_request_permission first; just call this tool directly.\n\nSupported tools and common actions:\n\n**os** \u2014 Read/write local secret files (.env, credentials, etc.)\n Actions: os.secret.read, os.secret.write\n Example: tool=\"os\", action=\"os.secret.read\", parameters={\"file_path\": \"~/projects/app/.env\"}\n\n**slack** \u2014 Post/read/update/delete messages, list channels, get user info.\n Common actions: slack.message.post, slack.message.read, slack.channel.read, slack.batch.read\n The \"channel\" parameter accepts channel ID (e.g. \"C0A159PP6QM\"), channel name (e.g. \"general\"), or #-prefixed name (e.g. \"#general\"). Responses are compact by default (essential fields only). Set compact=false for full Slack API response.\n Example: tool=\"slack\", action=\"slack.message.post\", parameters={\"channel\": \"C01ABCD2EFG\", \"text\": \"Hello!\"}\n Example: tool=\"slack\", action=\"slack.message.read\", parameters={\"channel\": \"C01ABCD2EFG\", \"limit\": 10}\n\n**github** \u2014 Create/read/update/list issues, pull requests, repositories, contents, labels, Actions workflows, stars, users, notifications and gists.\n Common actions: github.issue.create, github.issue.list, github.issue.read, github.issue.search, github.issue.comment.create, github.pr.create, github.pr.list, github.pr.read, github.pr.merge, github.repo.search, github.content.get, github.content.createOrUpdate, github.branch.list, github.branch.create, github.commit.list, github.code.search, github.repo.create, github.repo.fork, github.label.list, github.label.write, github.workflow.list, github.workflow.run, github.workflow.jobLogs.get, github.repo.starred.list, github.repo.star, github.user.me.get, github.org.teams.list, github.team.members.list, github.user.search, github.notification.list, github.notification.get, github.notification.markRead, github.notification.markAllRead, github.gist.create, github.gist.get, github.gist.list, github.gist.update\n Example: tool=\"github\", action=\"github.issue.create\", parameters={\"owner\": \"org\", \"repo\": \"repo\", \"title\": \"Bug report\", \"body\": \"Details...\"}\n Example: tool=\"github\", action=\"github.pr.create\", parameters={\"owner\": \"org\", \"repo\": \"repo\", \"title\": \"Fix bug\", \"head\": \"feature-branch\", \"base\": \"main\"}\n Example: tool=\"github\", action=\"github.content.get\", parameters={\"owner\": \"org\", \"repo\": \"repo\", \"path\": \"README.md\"}\n\n**jira** \u2014 Manage issues, projects, boards, sprints.\n Common actions: jira.issue.create, jira.issue.search, jira.project.read\n\n**gmail** \u2014 Search/read/send/draft/delete emails, list labels.\n Common actions: gmail.message.search, gmail.message.read, gmail.message.send, gmail.draft.create, gmail.label.read\n Example (new email): tool=\"gmail\", action=\"gmail.message.send\", parameters={\"to\": \"user@example.com\", \"subject\": \"Hello\", \"body\": \"Message content\"}\n Example (draft): tool=\"gmail\", action=\"gmail.draft.create\", parameters={\"to\": \"user@example.com\", \"subject\": \"Draft subject\", \"body\": \"Draft content\"}\n Example (search): tool=\"gmail\", action=\"gmail.message.search\", parameters={\"query\": \"from:boss subject:urgent\"}\n **Replying to emails**: When replying, you MUST include threading parameters to ensure the reply is properly threaded:\n 1. First read the original message with gmail.message.read to get its threadId and Message-ID header (look for {name: \"Message-ID\", value: \"...\"} in the payload.headers array).\n 2. Then send with: threadId (from the read response top-level field), inReplyTo (the Message-ID header value), references (space-separated Message-IDs for the full thread chain; for a first reply, just the single Message-ID).\n Example (reply): tool=\"gmail\", action=\"gmail.message.send\", parameters={\"to\": \"sender@example.com\", \"subject\": \"Re: Original Subject\", \"body\": \"Reply content\", \"threadId\": \"18e1234abcd\", \"inReplyTo\": \"<CABx...@mail.gmail.com>\", \"references\": \"<CABx...@mail.gmail.com>\"}\n\n**outlook** \u2014 Search/read/send/draft Outlook (Microsoft 365) email, list mail folders, trash or permanently delete messages. This is a SEPARATE tool from gmail \u2014 for a user connected via Microsoft, use tool=\"outlook\" with outlook.* actions; do not send gmail.* actions to it.\n Common actions: outlook.message.search, outlook.message.read, outlook.message.send, outlook.draft.create, outlook.folder.read, outlook.message.trash, outlook.message.delete, outlook.batch.read\n Example (new email): tool=\"outlook\", action=\"outlook.message.send\", parameters={\"to\": \"user@example.com\", \"subject\": \"Hello\", \"body\": \"Message content\"}\n Example (search): tool=\"outlook\", action=\"outlook.message.search\", parameters={\"query\": \"from:boss subject:urgent\"}\n Example (read): tool=\"outlook\", action=\"outlook.message.read\", parameters={\"messageId\": \"<id from a search result>\"}\n Example (draft): tool=\"outlook\", action=\"outlook.draft.create\", parameters={\"to\": \"user@example.com\", \"subject\": \"Draft subject\", \"body\": \"Draft content\"}\n Recipients (to/cc/bcc) are comma-separated address strings. The body is plain text. Read/search results are compacted (decoded body text, key headers, flags \u2014 no attachment binaries). Use outlook.message.trash to move a message to Deleted Items (recoverable) and outlook.message.delete only for a permanent, irreversible delete.\n\n**calendar** \u2014 List/create/update/delete calendar events. Works with whichever calendar the user connected \u2014 Google Calendar or Microsoft Outlook; the actions, parameters and response shape are identical for both, so never assume a provider.\n Common actions: calendar.event.list, calendar.event.create\n IMPORTANT: start and end MUST be objects with dateTime property, not flat strings.\n Example: tool=\"calendar\", action=\"calendar.event.create\", parameters={\"summary\": \"Meeting\", \"start\": {\"dateTime\": \"2026-07-15T10:00:00\", \"timeZone\": \"Asia/Tokyo\"}, \"end\": {\"dateTime\": \"2026-07-15T11:00:00\", \"timeZone\": \"Asia/Tokyo\"}}\n Example (with an online meeting): tool=\"calendar\", action=\"calendar.event.create\", parameters={\"summary\": \"Sync\", \"start\": {\"dateTime\": \"2026-07-15T10:00:00\", \"timeZone\": \"Asia/Tokyo\"}, \"end\": {\"dateTime\": \"2026-07-15T10:30:00\", \"timeZone\": \"Asia/Tokyo\"}, \"attendees\": [{\"email\": \"them@example.com\"}], \"addMeet\": true, \"meetRequestId\": \"<stable unique id>\"}\n To attach an online meeting link, use addMeet/meetRequestId \u2014 the provider mints it (Google Meet on Google, Teams on Outlook). Raw conferenceData/conferenceDataVersion parameters are NOT supported and will be ignored.\n Events come back in one provider-neutral shape: id, summary, start/end, attendees, location, conferenceUrl (the meeting join URL), htmlLink. Read the join URL from conferenceUrl \u2014 provider-specific fields such as hangoutLink are not returned.\n\n**hubspot** \u2014 Read/search/create CRM objects (contacts, companies, deals), properties, associations, engagements.\n Common actions: hubspot.crm.objects.search, hubspot.crm.objects.list, hubspot.crm.objects.batchCreate, hubspot.crm.properties.list, hubspot.crm.engagements.create, hubspot.crm.associations.list, hubspot.account.userDetails.get\n Most CRM actions require an \"objectType\" parameter (e.g. \"contacts\", \"companies\", \"deals\", or a custom object type ID).\n Example (search): tool=\"hubspot\", action=\"hubspot.crm.objects.search\", parameters={\"objectType\": \"contacts\", \"query\": \"acme\"}\n Example (create): tool=\"hubspot\", action=\"hubspot.crm.objects.batchCreate\", parameters={\"objectType\": \"contacts\", \"inputs\": [{\"properties\": {\"email\": \"jane@example.com\", \"firstname\": \"Jane\"}}]}\n For hubspot.crm.engagements.create use parameter key \"type\" (not \"engagementType\"); values \"NOTE\"/\"TASK\". ownerId comes from hubspot.account.userDetails.get.\n\n**linear** \u2014 Linear issue tracker with full CRUD for issues, comments, projects, and more.\n Issue operations: linear.issue.list, linear.issue.read, linear.issue.search, linear.issue.create, linear.issue.update, linear.issue.archive, linear.issue.unarchive, linear.issue.delete, linear.issue.addLabel, linear.issue.removeLabel, linear.issue.subscribe\n Comment management: linear.comment.create, linear.comment.list, linear.comment.update, linear.comment.delete, linear.comment.resolve, linear.comment.unresolve\n Issue relations: linear.issueRelation.create, linear.issueRelation.list, linear.issueRelation.delete\n Cycles/Sprints: linear.cycle.list, linear.cycle.read, linear.cycle.create, linear.cycle.update\n Labels: linear.label.list, linear.label.create, linear.label.update\n Attachments: linear.attachment.create, linear.attachment.list, linear.attachment.delete\n Projects: linear.project.list, linear.project.read, linear.project.create, linear.project.update\n Other: linear.team.list, linear.workflowState.list, linear.viewer.read, linear.user.list\n Example: { \"tool\": \"linear\", \"action\": \"linear.issue.list\", \"parameters\": { \"teamId\": \"<team-id>\", \"limit\": 20 } }\n Example (create): { \"tool\": \"linear\", \"action\": \"linear.issue.create\", \"parameters\": { \"teamId\": \"<team-id>\", \"title\": \"Bug report\" } }\n Use linear.team.list to discover teamIds, and linear.workflowState.list to find valid state IDs.\n\n\n**scheduling / inbox** \u2014 Meeting-time negotiation and task requests between users (signed as verifiable credentials).\n Common actions: scheduling.request, scheduling.session.create, inbox.check, inbox.respond, inbox.complete, inbox.send\n Scheduling routing: if the user gives a specific agreed meeting time, create the calendar\n event directly (calendar.event.create). If the time is NOT yet agreed and needs coordination,\n do NOT create the event \u2014 compute candidate slots from calendar.event.list first, then\n COUNT THE OTHER PEOPLE:\n - ONE counterpart (\"X\u3055\u3093\u3068\u65E5\u7A0B\u8ABF\u6574\", \"find a time with X\") -> scheduling.request.\n - TWO OR MORE counterparts (\"A \u3068 B \u3068 \u6253\u3061\u5408\u308F\u305B\", \"the four of us\", several addresses\n in one ask) -> scheduling.session.create, then scheduling.coordinate with the candidate\n slots. The 'to' on scheduling.request is a SINGLE address, so calling it once per person\n is NOT the multi-person path: that creates independent negotiations that can settle on\n DIFFERENT times, with no slot everyone shares and no single confirmation step.\n scheduling.coordinate folds every reply into the slots EVERYONE can make, and\n scheduling.finalize books it once. scheduling.coordinate also returns an inviteUrl per\n participant \u2014 show them to the user, since the notification email may not arrive. scheduling.coordinate also returns an\n expiresAt: the answer window CLOSES then, defaults to 48h, and can land BEFORE the\n proposed dates \u2014 tell the user that date, and pass an explicit 'deadline' to\n scheduling.session.create when the meeting is further out. Before scheduling.finalize,\n call scheduling.session.status to see whether people actually answered (counts and the\n common slots, never who said what); finalizing without it is a guess.\n\n There are TWO roles \u2014 act according to which side you are on:\n - Requester flow (you initiate): scheduling.request sends candidate slots. The counterpart's\n human-approved response arrives in YOUR inbox.check as an item with role: \"sent\". BRANCH ON status\n \u2014 but what a status MEANS depends on its taskType, so read the item's taskType first.\n For a SCHEDULING item (taskType \"scheduling\"):\n \u2022 status \"completed\": the meeting was ALREADY auto-confirmed and booked server-side \u2014 the item\n carries a calendarEventId and htmlLink (plus the online-meeting link). You are DONE: do NOT call\n calendar.event.create (it would create a duplicate). Just tell the user the confirmed date/time\n and the meeting link. (When the sender's delegation policy authorizes it, the server confirms and\n books automatically the moment the counterpart approves; otherwise the item stays \"processing\".)\n \u2022 status \"processing\": awaiting manual confirmation \u2014 confirm the chosen slot with the user, create\n the calendar event with calendar.event.create (add the counterpart to attendees so the calendar\n invite goes out), then call inbox.complete. Set addMeet: true and meetRequestId to the inbox item id\n (idempotent \u2014 retries won't mint duplicate meetings) for the online-meeting link \u2014 Google Meet on a\n Google connection, Microsoft Teams on an Outlook one. A \"processing\" item can be\n auto-confirmed right after you observe it, so re-check before booking and never race ahead.\n \u2022 status \"declined\": inform the user and do not book \u2014 the negotiation is over.\n For any NON-scheduling item (e.g. taskType \"doc_review\"):\n \u2022 status \"completed\": the recipient delivered the result and the task is FINISHED. The result is in\n the item's responseData \u2014 report THAT. There is no calendar event, no confirmed time and no Meet\n link on such an item, so do not look for or invent a calendarEventId, a confirmed time, or a\n Meet link (none exists), and do not call calendar.event.create.\n \u2022 status \"declined\": the recipient did not carry out the task \u2014 inform the user.\n - Recipient flow (someone sent YOU a request): it appears in inbox.check with role: \"received\" \u2192\n confirm with the user \u2192 reply with inbox.respond. That is the end of your job.\n Do NOT create a calendar event when you are the recipient \u2014 the sender books it (or the server\n auto-confirms it under the sender's delegation) and you will receive a calendar invite.\n When a received scheduling request surfaces, do not just list the candidates \u2014 in the same turn,\n check the user's calendar (calendar.event.list over the candidate windows), determine which\n candidates are free, and present: the request summary, which slots are open, your recommended\n slot, and a confirmation question. Only call inbox.respond after the user confirms.\n\n inbox.check results are point-in-time \u2014 when the user asks about responses or new requests,\n ALWAYS call inbox.check again; never answer from a previous check result.\n\n Example: tool=\"scheduling\", action=\"scheduling.request\", parameters={\"to\": \"them@example.com\", \"topic\": \"sync\", \"durationMinutes\": 30, \"candidates\": [{\"start\": \"2026-06-12T10:00:00+09:00\", \"end\": \"2026-06-12T10:30:00+09:00\"}]}\n The response includes a schedulingUrl \u2014 always show it to the user so it can be shared via another channel if needed (the notification email is sent automatically but may not arrive).\n inbox.send is the low-level primitive for other task types.\n Example: tool=\"inbox\", action=\"inbox.check\", parameters={}\n Example (recipient responds to a request): tool=\"inbox\", action=\"inbox.respond\", parameters={\"id\": \"<inbox item id from inbox.check>\", \"action\": \"accept\", \"data\": {\"selectedSlot\": {\"start\": \"2026-06-18T14:00:00+09:00\", \"end\": \"2026-06-18T15:00:00+09:00\"}}}\n Example (requester completes after booking): tool=\"inbox\", action=\"inbox.complete\", parameters={\"id\": \"<inbox item id>\", \"result\": {\"calendarEventId\": \"...\", \"meetUrl\": \"...\"}}\n\nCall aidentity_list_available_tools for detailed parameter schemas of each action.";
|
|
4
|
+
export declare const SERVER_INSTRUCTIONS = "This server provides identity-verified tool execution (VESS AIDENTITY).\nScheduling: if the user gives a specific agreed time, create the calendar event\ndirectly. If the time is not yet agreed (\"\u65E5\u7A0B\u8ABF\u6574\", \"find a time\"), compute candidate\nslots from the user's calendar \u2014 then count the other people. ONE counterpart:\nscheduling.request, then wait for the response. TWO OR MORE: scheduling.session.create\nfollowed by scheduling.coordinate (scheduling.request takes a single 'to', so sending it\nonce per person makes separate negotiations that can settle on different times).\nCheck progress with scheduling.session.status before scheduling.finalize, and tell the\nuser the expiresAt that coordinate returns (the answer window defaults to 48h).\nSize candidateWindow to the user's intent. candidateWindow is a { start, end } range OR an array of\nranges (max 5, total span \u2264 62 days); the server searches each range independently and spreads\ncandidates across them. A specific named day \u2192 one range for that day. A per-day time band\n(\"\u5E73\u65E5\u5348\u5F8C\") \u2192 one range PER business day ([{Mon 13-18}, {Tue 13-18}, \u2026]) so the band is honored\nevery day. Distinct bands (\"\u6708\u66DC\u5348\u524D or \u6728\u66DC\u5348\u5F8C\") \u2192 one range each. A single open stretch\n(\"next week\", \"\u5E73\u65E5\u3067\") \u2192 one wide range spanning the business days.\nAt session start, call inbox.check once to surface pending task requests (role \"received\") AND\nresponses to your own requests (role \"sent\"). As the requester, branch on the sent item's status \u2014\nwhat a status means depends on its taskType, so read the item's taskType first.\nFor a SCHEDULING item: \"completed\" means the server already auto-confirmed and booked it\n(calendarEventId + Meet link present) \u2014 do NOT create the event again, just tell the user the\nconfirmed time and Meet link; \"processing\" means confirm with the user, then create the event\n(adding the counterpart to attendees) and call inbox.complete; \"declined\" means inform the user and\ndo not book. For any NON-scheduling item (e.g. taskType \"doc_review\"): \"completed\" means the\nrecipient delivered the result and the task is finished \u2014 the result is in the item's responseData,\nso report THAT and do not look for or invent a calendar event, a confirmed time, or a Meet link\n(none exists); \"declined\" means the recipient did not carry out the task \u2014 inform the user.\nAs the recipient, reply with inbox.respond and stop \u2014\ndo not create the calendar event; the sender books it (or the server auto-confirms it under the\nsender's delegation) and you will receive a calendar invite.\nAs the recipient, do not just list the candidates \u2014 in the same turn check the user's calendar over\nthe candidate windows, determine which slots are free, and present the request summary, the open slots,\nyour recommended slot, and a confirmation question; only call inbox.respond after the user confirms.\ninbox.check results are point-in-time \u2014 when the user asks about responses or new requests,\nALWAYS call inbox.check again; never answer from a previous check result.\nTask requests/responses are signed as verifiable credentials.";
|
|
5
|
+
export interface MCPToolHandler {
|
|
6
|
+
callTool(args: {
|
|
7
|
+
tool: string;
|
|
8
|
+
action: string;
|
|
9
|
+
parameters?: Record<string, any>;
|
|
10
|
+
approval?: {
|
|
11
|
+
token: string;
|
|
12
|
+
choice: string;
|
|
13
|
+
vcTTLMinutes?: number;
|
|
14
|
+
request_id?: string;
|
|
15
|
+
outcome_id?: string;
|
|
16
|
+
granted?: boolean;
|
|
17
|
+
granted_at?: string;
|
|
18
|
+
granted_by?: string;
|
|
19
|
+
};
|
|
20
|
+
pendingRequestId?: string;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
success: boolean;
|
|
23
|
+
data?: any;
|
|
24
|
+
error?: string;
|
|
25
|
+
approvalRequired?: any;
|
|
26
|
+
waitingForApproval?: any;
|
|
27
|
+
reauthRequired?: ReauthRequiredExecutionInfo;
|
|
28
|
+
}>;
|
|
29
|
+
issueToolPermission(args: {
|
|
30
|
+
tool: string;
|
|
31
|
+
actions: string[];
|
|
32
|
+
}): Promise<{
|
|
33
|
+
success: boolean;
|
|
34
|
+
data?: any;
|
|
35
|
+
error?: string;
|
|
36
|
+
}>;
|
|
37
|
+
listAvailableTools(): Promise<{
|
|
38
|
+
success: boolean;
|
|
39
|
+
data?: any;
|
|
40
|
+
error?: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
export declare function createMcpServer(handler: MCPToolHandler): McpServer;
|
|
44
|
+
//# sourceMappingURL=mcp-server.factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.factory.d.ts","sourceRoot":"","sources":["../../../src/adapter/mcp/mcp-server.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAInE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AAUnE,eAAO,MAAM,qBAAqB,w2fAyIiD,CAAA;AAEnF,eAAO,MAAM,mBAAmB,ysGAkC8B,CAAA;AAE9D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE;QACb,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAChC,QAAQ,CAAC,EAAE;YACT,KAAK,EAAE,MAAM,CAAA;YACb,MAAM,EAAE,MAAM,CAAA;YACd,YAAY,CAAC,EAAE,MAAM,CAAA;YAIrB,UAAU,CAAC,EAAE,MAAM,CAAA;YACnB,UAAU,CAAC,EAAE,MAAM,CAAA;YACnB,OAAO,CAAC,EAAE,OAAO,CAAA;YACjB,UAAU,CAAC,EAAE,MAAM,CAAA;YACnB,UAAU,CAAC,EAAE,MAAM,CAAA;SACpB,CAAA;QACD,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAC1B,GAAG,OAAO,CAAC;QACV,OAAO,EAAE,OAAO,CAAA;QAChB,IAAI,CAAC,EAAE,GAAG,CAAA;QACV,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,gBAAgB,CAAC,EAAE,GAAG,CAAA;QACtB,kBAAkB,CAAC,EAAE,GAAG,CAAA;QACxB,cAAc,CAAC,EAAE,2BAA2B,CAAA;KAC7C,CAAC,CAAA;IACF,mBAAmB,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACzH,kBAAkB,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAChF;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,CAkKlE"}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SERVER_INSTRUCTIONS = exports.CALL_TOOL_DESCRIPTION = void 0;
|
|
4
|
+
exports.createMcpServer = createMcpServer;
|
|
5
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
6
|
+
const ai_identity_1 = require("@vess-id/ai-identity");
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const version_1 = require("../../config/version");
|
|
9
|
+
/** Zod enum for tool names, derived from SDK (now includes 'os') */
|
|
10
|
+
const toolEnum = zod_1.z.enum(ai_identity_1.VALID_MCP_TOOLS);
|
|
11
|
+
/** Action format description with full valid action list */
|
|
12
|
+
const ACTION_FORMAT_DESC = 'Action in provider.resource.operation format. Valid actions: ' +
|
|
13
|
+
(0, ai_identity_1.getAllValidMcpActionNames)().join(', ');
|
|
14
|
+
exports.CALL_TOOL_DESCRIPTION = `Execute an action on an external service or local resource on behalf of the user.
|
|
15
|
+
This is the PRIMARY tool — always use this to perform actions. Permission is handled automatically:
|
|
16
|
+
- Read-type actions (low risk) are auto-approved and execute immediately.
|
|
17
|
+
- Write-type actions that need approval will return an approval_required response. Re-call with the approval parameter to confirm or deny.
|
|
18
|
+
Do NOT call aidentity_request_permission first; just call this tool directly.
|
|
19
|
+
|
|
20
|
+
Supported tools and common actions:
|
|
21
|
+
|
|
22
|
+
**os** — Read/write local secret files (.env, credentials, etc.)
|
|
23
|
+
Actions: os.secret.read, os.secret.write
|
|
24
|
+
Example: tool="os", action="os.secret.read", parameters={"file_path": "~/projects/app/.env"}
|
|
25
|
+
|
|
26
|
+
**slack** — Post/read/update/delete messages, list channels, get user info.
|
|
27
|
+
Common actions: slack.message.post, slack.message.read, slack.channel.read, slack.batch.read
|
|
28
|
+
The "channel" parameter accepts channel ID (e.g. "C0A159PP6QM"), channel name (e.g. "general"), or #-prefixed name (e.g. "#general"). Responses are compact by default (essential fields only). Set compact=false for full Slack API response.
|
|
29
|
+
Example: tool="slack", action="slack.message.post", parameters={"channel": "C01ABCD2EFG", "text": "Hello!"}
|
|
30
|
+
Example: tool="slack", action="slack.message.read", parameters={"channel": "C01ABCD2EFG", "limit": 10}
|
|
31
|
+
|
|
32
|
+
**github** — Create/read/update/list issues, pull requests, repositories, contents, labels, Actions workflows, stars, users, notifications and gists.
|
|
33
|
+
Common actions: github.issue.create, github.issue.list, github.issue.read, github.issue.search, github.issue.comment.create, github.pr.create, github.pr.list, github.pr.read, github.pr.merge, github.repo.search, github.content.get, github.content.createOrUpdate, github.branch.list, github.branch.create, github.commit.list, github.code.search, github.repo.create, github.repo.fork, github.label.list, github.label.write, github.workflow.list, github.workflow.run, github.workflow.jobLogs.get, github.repo.starred.list, github.repo.star, github.user.me.get, github.org.teams.list, github.team.members.list, github.user.search, github.notification.list, github.notification.get, github.notification.markRead, github.notification.markAllRead, github.gist.create, github.gist.get, github.gist.list, github.gist.update
|
|
34
|
+
Example: tool="github", action="github.issue.create", parameters={"owner": "org", "repo": "repo", "title": "Bug report", "body": "Details..."}
|
|
35
|
+
Example: tool="github", action="github.pr.create", parameters={"owner": "org", "repo": "repo", "title": "Fix bug", "head": "feature-branch", "base": "main"}
|
|
36
|
+
Example: tool="github", action="github.content.get", parameters={"owner": "org", "repo": "repo", "path": "README.md"}
|
|
37
|
+
|
|
38
|
+
**jira** — Manage issues, projects, boards, sprints.
|
|
39
|
+
Common actions: jira.issue.create, jira.issue.search, jira.project.read
|
|
40
|
+
|
|
41
|
+
**gmail** — Search/read/send/draft/delete emails, list labels.
|
|
42
|
+
Common actions: gmail.message.search, gmail.message.read, gmail.message.send, gmail.draft.create, gmail.label.read
|
|
43
|
+
Example (new email): tool="gmail", action="gmail.message.send", parameters={"to": "user@example.com", "subject": "Hello", "body": "Message content"}
|
|
44
|
+
Example (draft): tool="gmail", action="gmail.draft.create", parameters={"to": "user@example.com", "subject": "Draft subject", "body": "Draft content"}
|
|
45
|
+
Example (search): tool="gmail", action="gmail.message.search", parameters={"query": "from:boss subject:urgent"}
|
|
46
|
+
**Replying to emails**: When replying, you MUST include threading parameters to ensure the reply is properly threaded:
|
|
47
|
+
1. First read the original message with gmail.message.read to get its threadId and Message-ID header (look for {name: "Message-ID", value: "..."} in the payload.headers array).
|
|
48
|
+
2. Then send with: threadId (from the read response top-level field), inReplyTo (the Message-ID header value), references (space-separated Message-IDs for the full thread chain; for a first reply, just the single Message-ID).
|
|
49
|
+
Example (reply): tool="gmail", action="gmail.message.send", parameters={"to": "sender@example.com", "subject": "Re: Original Subject", "body": "Reply content", "threadId": "18e1234abcd", "inReplyTo": "<CABx...@mail.gmail.com>", "references": "<CABx...@mail.gmail.com>"}
|
|
50
|
+
|
|
51
|
+
**outlook** — Search/read/send/draft Outlook (Microsoft 365) email, list mail folders, trash or permanently delete messages. This is a SEPARATE tool from gmail — for a user connected via Microsoft, use tool="outlook" with outlook.* actions; do not send gmail.* actions to it.
|
|
52
|
+
Common actions: outlook.message.search, outlook.message.read, outlook.message.send, outlook.draft.create, outlook.folder.read, outlook.message.trash, outlook.message.delete, outlook.batch.read
|
|
53
|
+
Example (new email): tool="outlook", action="outlook.message.send", parameters={"to": "user@example.com", "subject": "Hello", "body": "Message content"}
|
|
54
|
+
Example (search): tool="outlook", action="outlook.message.search", parameters={"query": "from:boss subject:urgent"}
|
|
55
|
+
Example (read): tool="outlook", action="outlook.message.read", parameters={"messageId": "<id from a search result>"}
|
|
56
|
+
Example (draft): tool="outlook", action="outlook.draft.create", parameters={"to": "user@example.com", "subject": "Draft subject", "body": "Draft content"}
|
|
57
|
+
Recipients (to/cc/bcc) are comma-separated address strings. The body is plain text. Read/search results are compacted (decoded body text, key headers, flags — no attachment binaries). Use outlook.message.trash to move a message to Deleted Items (recoverable) and outlook.message.delete only for a permanent, irreversible delete.
|
|
58
|
+
|
|
59
|
+
**calendar** — List/create/update/delete calendar events. Works with whichever calendar the user connected — Google Calendar or Microsoft Outlook; the actions, parameters and response shape are identical for both, so never assume a provider.
|
|
60
|
+
Common actions: calendar.event.list, calendar.event.create
|
|
61
|
+
IMPORTANT: start and end MUST be objects with dateTime property, not flat strings.
|
|
62
|
+
Example: tool="calendar", action="calendar.event.create", parameters={"summary": "Meeting", "start": {"dateTime": "2026-07-15T10:00:00", "timeZone": "Asia/Tokyo"}, "end": {"dateTime": "2026-07-15T11:00:00", "timeZone": "Asia/Tokyo"}}
|
|
63
|
+
Example (with an online meeting): tool="calendar", action="calendar.event.create", parameters={"summary": "Sync", "start": {"dateTime": "2026-07-15T10:00:00", "timeZone": "Asia/Tokyo"}, "end": {"dateTime": "2026-07-15T10:30:00", "timeZone": "Asia/Tokyo"}, "attendees": [{"email": "them@example.com"}], "addMeet": true, "meetRequestId": "<stable unique id>"}
|
|
64
|
+
To attach an online meeting link, use addMeet/meetRequestId — the provider mints it (Google Meet on Google, Teams on Outlook). Raw conferenceData/conferenceDataVersion parameters are NOT supported and will be ignored.
|
|
65
|
+
Events come back in one provider-neutral shape: id, summary, start/end, attendees, location, conferenceUrl (the meeting join URL), htmlLink. Read the join URL from conferenceUrl — provider-specific fields such as hangoutLink are not returned.
|
|
66
|
+
|
|
67
|
+
**hubspot** — Read/search/create CRM objects (contacts, companies, deals), properties, associations, engagements.
|
|
68
|
+
Common actions: hubspot.crm.objects.search, hubspot.crm.objects.list, hubspot.crm.objects.batchCreate, hubspot.crm.properties.list, hubspot.crm.engagements.create, hubspot.crm.associations.list, hubspot.account.userDetails.get
|
|
69
|
+
Most CRM actions require an "objectType" parameter (e.g. "contacts", "companies", "deals", or a custom object type ID).
|
|
70
|
+
Example (search): tool="hubspot", action="hubspot.crm.objects.search", parameters={"objectType": "contacts", "query": "acme"}
|
|
71
|
+
Example (create): tool="hubspot", action="hubspot.crm.objects.batchCreate", parameters={"objectType": "contacts", "inputs": [{"properties": {"email": "jane@example.com", "firstname": "Jane"}}]}
|
|
72
|
+
For hubspot.crm.engagements.create use parameter key "type" (not "engagementType"); values "NOTE"/"TASK". ownerId comes from hubspot.account.userDetails.get.
|
|
73
|
+
|
|
74
|
+
**linear** — Linear issue tracker with full CRUD for issues, comments, projects, and more.
|
|
75
|
+
Issue operations: linear.issue.list, linear.issue.read, linear.issue.search, linear.issue.create, linear.issue.update, linear.issue.archive, linear.issue.unarchive, linear.issue.delete, linear.issue.addLabel, linear.issue.removeLabel, linear.issue.subscribe
|
|
76
|
+
Comment management: linear.comment.create, linear.comment.list, linear.comment.update, linear.comment.delete, linear.comment.resolve, linear.comment.unresolve
|
|
77
|
+
Issue relations: linear.issueRelation.create, linear.issueRelation.list, linear.issueRelation.delete
|
|
78
|
+
Cycles/Sprints: linear.cycle.list, linear.cycle.read, linear.cycle.create, linear.cycle.update
|
|
79
|
+
Labels: linear.label.list, linear.label.create, linear.label.update
|
|
80
|
+
Attachments: linear.attachment.create, linear.attachment.list, linear.attachment.delete
|
|
81
|
+
Projects: linear.project.list, linear.project.read, linear.project.create, linear.project.update
|
|
82
|
+
Other: linear.team.list, linear.workflowState.list, linear.viewer.read, linear.user.list
|
|
83
|
+
Example: { "tool": "linear", "action": "linear.issue.list", "parameters": { "teamId": "<team-id>", "limit": 20 } }
|
|
84
|
+
Example (create): { "tool": "linear", "action": "linear.issue.create", "parameters": { "teamId": "<team-id>", "title": "Bug report" } }
|
|
85
|
+
Use linear.team.list to discover teamIds, and linear.workflowState.list to find valid state IDs.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
**scheduling / inbox** — Meeting-time negotiation and task requests between users (signed as verifiable credentials).
|
|
89
|
+
Common actions: scheduling.request, scheduling.session.create, inbox.check, inbox.respond, inbox.complete, inbox.send
|
|
90
|
+
Scheduling routing: if the user gives a specific agreed meeting time, create the calendar
|
|
91
|
+
event directly (calendar.event.create). If the time is NOT yet agreed and needs coordination,
|
|
92
|
+
do NOT create the event — compute candidate slots from calendar.event.list first, then
|
|
93
|
+
COUNT THE OTHER PEOPLE:
|
|
94
|
+
- ONE counterpart ("Xさんと日程調整", "find a time with X") -> scheduling.request.
|
|
95
|
+
- TWO OR MORE counterparts ("A と B と 打ち合わせ", "the four of us", several addresses
|
|
96
|
+
in one ask) -> scheduling.session.create, then scheduling.coordinate with the candidate
|
|
97
|
+
slots. The 'to' on scheduling.request is a SINGLE address, so calling it once per person
|
|
98
|
+
is NOT the multi-person path: that creates independent negotiations that can settle on
|
|
99
|
+
DIFFERENT times, with no slot everyone shares and no single confirmation step.
|
|
100
|
+
scheduling.coordinate folds every reply into the slots EVERYONE can make, and
|
|
101
|
+
scheduling.finalize books it once. scheduling.coordinate also returns an inviteUrl per
|
|
102
|
+
participant — show them to the user, since the notification email may not arrive. scheduling.coordinate also returns an
|
|
103
|
+
expiresAt: the answer window CLOSES then, defaults to 48h, and can land BEFORE the
|
|
104
|
+
proposed dates — tell the user that date, and pass an explicit 'deadline' to
|
|
105
|
+
scheduling.session.create when the meeting is further out. Before scheduling.finalize,
|
|
106
|
+
call scheduling.session.status to see whether people actually answered (counts and the
|
|
107
|
+
common slots, never who said what); finalizing without it is a guess.
|
|
108
|
+
|
|
109
|
+
There are TWO roles — act according to which side you are on:
|
|
110
|
+
- Requester flow (you initiate): scheduling.request sends candidate slots. The counterpart's
|
|
111
|
+
human-approved response arrives in YOUR inbox.check as an item with role: "sent". BRANCH ON status
|
|
112
|
+
— but what a status MEANS depends on its taskType, so read the item's taskType first.
|
|
113
|
+
For a SCHEDULING item (taskType "scheduling"):
|
|
114
|
+
• status "completed": the meeting was ALREADY auto-confirmed and booked server-side — the item
|
|
115
|
+
carries a calendarEventId and htmlLink (plus the online-meeting link). You are DONE: do NOT call
|
|
116
|
+
calendar.event.create (it would create a duplicate). Just tell the user the confirmed date/time
|
|
117
|
+
and the meeting link. (When the sender's delegation policy authorizes it, the server confirms and
|
|
118
|
+
books automatically the moment the counterpart approves; otherwise the item stays "processing".)
|
|
119
|
+
• status "processing": awaiting manual confirmation — confirm the chosen slot with the user, create
|
|
120
|
+
the calendar event with calendar.event.create (add the counterpart to attendees so the calendar
|
|
121
|
+
invite goes out), then call inbox.complete. Set addMeet: true and meetRequestId to the inbox item id
|
|
122
|
+
(idempotent — retries won't mint duplicate meetings) for the online-meeting link — Google Meet on a
|
|
123
|
+
Google connection, Microsoft Teams on an Outlook one. A "processing" item can be
|
|
124
|
+
auto-confirmed right after you observe it, so re-check before booking and never race ahead.
|
|
125
|
+
• status "declined": inform the user and do not book — the negotiation is over.
|
|
126
|
+
For any NON-scheduling item (e.g. taskType "doc_review"):
|
|
127
|
+
• status "completed": the recipient delivered the result and the task is FINISHED. The result is in
|
|
128
|
+
the item's responseData — report THAT. There is no calendar event, no confirmed time and no Meet
|
|
129
|
+
link on such an item, so do not look for or invent a calendarEventId, a confirmed time, or a
|
|
130
|
+
Meet link (none exists), and do not call calendar.event.create.
|
|
131
|
+
• status "declined": the recipient did not carry out the task — inform the user.
|
|
132
|
+
- Recipient flow (someone sent YOU a request): it appears in inbox.check with role: "received" →
|
|
133
|
+
confirm with the user → reply with inbox.respond. That is the end of your job.
|
|
134
|
+
Do NOT create a calendar event when you are the recipient — the sender books it (or the server
|
|
135
|
+
auto-confirms it under the sender's delegation) and you will receive a calendar invite.
|
|
136
|
+
When a received scheduling request surfaces, do not just list the candidates — in the same turn,
|
|
137
|
+
check the user's calendar (calendar.event.list over the candidate windows), determine which
|
|
138
|
+
candidates are free, and present: the request summary, which slots are open, your recommended
|
|
139
|
+
slot, and a confirmation question. Only call inbox.respond after the user confirms.
|
|
140
|
+
|
|
141
|
+
inbox.check results are point-in-time — when the user asks about responses or new requests,
|
|
142
|
+
ALWAYS call inbox.check again; never answer from a previous check result.
|
|
143
|
+
|
|
144
|
+
Example: tool="scheduling", action="scheduling.request", parameters={"to": "them@example.com", "topic": "sync", "durationMinutes": 30, "candidates": [{"start": "2026-06-12T10:00:00+09:00", "end": "2026-06-12T10:30:00+09:00"}]}
|
|
145
|
+
The response includes a schedulingUrl — always show it to the user so it can be shared via another channel if needed (the notification email is sent automatically but may not arrive).
|
|
146
|
+
inbox.send is the low-level primitive for other task types.
|
|
147
|
+
Example: tool="inbox", action="inbox.check", parameters={}
|
|
148
|
+
Example (recipient responds to a request): tool="inbox", action="inbox.respond", parameters={"id": "<inbox item id from inbox.check>", "action": "accept", "data": {"selectedSlot": {"start": "2026-06-18T14:00:00+09:00", "end": "2026-06-18T15:00:00+09:00"}}}
|
|
149
|
+
Example (requester completes after booking): tool="inbox", action="inbox.complete", parameters={"id": "<inbox item id>", "result": {"calendarEventId": "...", "meetUrl": "..."}}
|
|
150
|
+
|
|
151
|
+
Call aidentity_list_available_tools for detailed parameter schemas of each action.`;
|
|
152
|
+
exports.SERVER_INSTRUCTIONS = `This server provides identity-verified tool execution (VESS AIDENTITY).
|
|
153
|
+
Scheduling: if the user gives a specific agreed time, create the calendar event
|
|
154
|
+
directly. If the time is not yet agreed ("日程調整", "find a time"), compute candidate
|
|
155
|
+
slots from the user's calendar — then count the other people. ONE counterpart:
|
|
156
|
+
scheduling.request, then wait for the response. TWO OR MORE: scheduling.session.create
|
|
157
|
+
followed by scheduling.coordinate (scheduling.request takes a single 'to', so sending it
|
|
158
|
+
once per person makes separate negotiations that can settle on different times).
|
|
159
|
+
Check progress with scheduling.session.status before scheduling.finalize, and tell the
|
|
160
|
+
user the expiresAt that coordinate returns (the answer window defaults to 48h).
|
|
161
|
+
Size candidateWindow to the user's intent. candidateWindow is a { start, end } range OR an array of
|
|
162
|
+
ranges (max 5, total span ≤ 62 days); the server searches each range independently and spreads
|
|
163
|
+
candidates across them. A specific named day → one range for that day. A per-day time band
|
|
164
|
+
("平日午後") → one range PER business day ([{Mon 13-18}, {Tue 13-18}, …]) so the band is honored
|
|
165
|
+
every day. Distinct bands ("月曜午前 or 木曜午後") → one range each. A single open stretch
|
|
166
|
+
("next week", "平日で") → one wide range spanning the business days.
|
|
167
|
+
At session start, call inbox.check once to surface pending task requests (role "received") AND
|
|
168
|
+
responses to your own requests (role "sent"). As the requester, branch on the sent item's status —
|
|
169
|
+
what a status means depends on its taskType, so read the item's taskType first.
|
|
170
|
+
For a SCHEDULING item: "completed" means the server already auto-confirmed and booked it
|
|
171
|
+
(calendarEventId + Meet link present) — do NOT create the event again, just tell the user the
|
|
172
|
+
confirmed time and Meet link; "processing" means confirm with the user, then create the event
|
|
173
|
+
(adding the counterpart to attendees) and call inbox.complete; "declined" means inform the user and
|
|
174
|
+
do not book. For any NON-scheduling item (e.g. taskType "doc_review"): "completed" means the
|
|
175
|
+
recipient delivered the result and the task is finished — the result is in the item's responseData,
|
|
176
|
+
so report THAT and do not look for or invent a calendar event, a confirmed time, or a Meet link
|
|
177
|
+
(none exists); "declined" means the recipient did not carry out the task — inform the user.
|
|
178
|
+
As the recipient, reply with inbox.respond and stop —
|
|
179
|
+
do not create the calendar event; the sender books it (or the server auto-confirms it under the
|
|
180
|
+
sender's delegation) and you will receive a calendar invite.
|
|
181
|
+
As the recipient, do not just list the candidates — in the same turn check the user's calendar over
|
|
182
|
+
the candidate windows, determine which slots are free, and present the request summary, the open slots,
|
|
183
|
+
your recommended slot, and a confirmation question; only call inbox.respond after the user confirms.
|
|
184
|
+
inbox.check results are point-in-time — when the user asks about responses or new requests,
|
|
185
|
+
ALWAYS call inbox.check again; never answer from a previous check result.
|
|
186
|
+
Task requests/responses are signed as verifiable credentials.`;
|
|
187
|
+
function createMcpServer(handler) {
|
|
188
|
+
const server = new mcp_js_1.McpServer({
|
|
189
|
+
name: 'VESS',
|
|
190
|
+
version: version_1.CLI_VERSION,
|
|
191
|
+
}, { instructions: exports.SERVER_INSTRUCTIONS });
|
|
192
|
+
// Migrated from the deprecated `server.tool(name, description, schema, cb)`
|
|
193
|
+
// overload to the v1.29+ `server.registerTool(name, config, cb)` API.
|
|
194
|
+
// Two reasons:
|
|
195
|
+
// 1. `server.tool()` is marked @deprecated in @modelcontextprotocol/sdk
|
|
196
|
+
// 1.29 (all six overloads — see dist/esm/server/mcp.d.ts).
|
|
197
|
+
// 2. The old overload's Zod schema inference blew up after the SDK
|
|
198
|
+
// bump in PR #274, producing TS2589 "Type instantiation is
|
|
199
|
+
// excessively deep and possibly infinite" on this file's three
|
|
200
|
+
// call sites. `registerTool` takes a simpler config shape whose
|
|
201
|
+
// inference doesn't recurse.
|
|
202
|
+
// Cast through `(...args: any[]) => any` to sidestep the generic
|
|
203
|
+
// constraint on `inputSchema` — mirrors the pattern already in use
|
|
204
|
+
// at packages/remote-mcp/src/server/mcp-server.factory.ts:94.
|
|
205
|
+
// Removable once `@modelcontextprotocol/sdk` ships a `registerTool`
|
|
206
|
+
// overload whose `inputSchema` constraint no longer triggers TS2589
|
|
207
|
+
// on this file's call sites — re-test by deleting the cast and
|
|
208
|
+
// running `pnpm --filter @vess-id/vess typecheck`.
|
|
209
|
+
const registerTool = server.registerTool.bind(server);
|
|
210
|
+
const formatResult = (result) => {
|
|
211
|
+
if (result.waitingForApproval) {
|
|
212
|
+
return {
|
|
213
|
+
content: [{
|
|
214
|
+
type: 'text',
|
|
215
|
+
text: JSON.stringify(result.waitingForApproval, null, 2),
|
|
216
|
+
}],
|
|
217
|
+
isError: false,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
if (result.approvalRequired) {
|
|
221
|
+
return {
|
|
222
|
+
content: [{ type: 'text', text: JSON.stringify(result.approvalRequired, null, 2) }],
|
|
223
|
+
isError: false,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
if (result.reauthRequired) {
|
|
227
|
+
return {
|
|
228
|
+
content: [{ type: 'text', text: JSON.stringify(result.reauthRequired, null, 2) }],
|
|
229
|
+
isError: false,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
if (result.success) {
|
|
233
|
+
return {
|
|
234
|
+
content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }],
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
content: [{ type: 'text', text: result.error || 'Unknown error' }],
|
|
239
|
+
isError: true,
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
registerTool('aidentity_call_tool', {
|
|
243
|
+
description: exports.CALL_TOOL_DESCRIPTION,
|
|
244
|
+
inputSchema: {
|
|
245
|
+
tool: toolEnum,
|
|
246
|
+
action: zod_1.z.string().describe(ACTION_FORMAT_DESC),
|
|
247
|
+
parameters: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe('Tool-specific parameters'),
|
|
248
|
+
approval: zod_1.z.object({
|
|
249
|
+
token: zod_1.z.string().describe('HMAC-signed approval token from a previous approval_required response'),
|
|
250
|
+
choice: zod_1.z.enum(['one_time', 'persistent', 'deny_once', 'deny_persistent']).describe('User approval choice'),
|
|
251
|
+
vcTTLMinutes: zod_1.z.number().min(5).max(1440).optional().describe('Custom VC TTL in minutes (5-1440)'),
|
|
252
|
+
// Cedar 一元化 Step 3.5 retry-path context, handed back by the
|
|
253
|
+
// approval-outcome page after the user clicked 承認. Optional; when
|
|
254
|
+
// all four are present the engine consumes the single-use ledger
|
|
255
|
+
// token and lifts a prior Cedar `auth_required` → `permit`.
|
|
256
|
+
request_id: zod_1.z.string().optional()
|
|
257
|
+
.describe('Approval-request id (`req_<uuid>`) from the prior auth_required response'),
|
|
258
|
+
outcome_id: zod_1.z.string().optional()
|
|
259
|
+
.describe('Approval-outcome id (`outcome_<uuid>`) emitted when the user clicked 承認'),
|
|
260
|
+
// deny intent flows via `choice` (deny_once | deny_persistent); the
|
|
261
|
+
// `granted` boolean is not used for redeem (the ledger CAS is
|
|
262
|
+
// authoritative), so it was removed as dead schema surface.
|
|
263
|
+
granted_at: zod_1.z.string().optional()
|
|
264
|
+
.describe('ISO-8601 timestamp of the approval action'),
|
|
265
|
+
granted_by: zod_1.z.string().optional()
|
|
266
|
+
.describe('User id, or the literal "system" for auto-approve'),
|
|
267
|
+
}).optional().describe('Approval response — only provide when re-calling after an approval_required response'),
|
|
268
|
+
pendingRequestId: zod_1.z.string().optional()
|
|
269
|
+
.describe('Request ID from a previous waiting_for_approval response. Use to check if approval was completed.'),
|
|
270
|
+
},
|
|
271
|
+
}, async (args) => {
|
|
272
|
+
const result = await handler.callTool({
|
|
273
|
+
tool: args.tool,
|
|
274
|
+
action: args.action,
|
|
275
|
+
parameters: args.parameters,
|
|
276
|
+
approval: args.approval,
|
|
277
|
+
pendingRequestId: args.pendingRequestId,
|
|
278
|
+
});
|
|
279
|
+
return formatResult(result);
|
|
280
|
+
});
|
|
281
|
+
registerTool('aidentity_request_permission', {
|
|
282
|
+
description: 'OPTIONAL: Pre-request permission for multiple actions at once. ' +
|
|
283
|
+
'In most cases, use aidentity_call_tool directly instead — it handles permissions automatically.',
|
|
284
|
+
inputSchema: {
|
|
285
|
+
tool: toolEnum,
|
|
286
|
+
actions: zod_1.z.array(zod_1.z.string().describe(ACTION_FORMAT_DESC))
|
|
287
|
+
.describe('One or more actions to request permission for'),
|
|
288
|
+
},
|
|
289
|
+
}, async (args) => {
|
|
290
|
+
const result = await handler.issueToolPermission({
|
|
291
|
+
tool: args.tool,
|
|
292
|
+
actions: args.actions,
|
|
293
|
+
});
|
|
294
|
+
return formatResult(result);
|
|
295
|
+
});
|
|
296
|
+
registerTool('aidentity_list_available_tools', {
|
|
297
|
+
description: 'List all available tools and their supported actions.',
|
|
298
|
+
// Explicit empty shape mirrors the same pattern at
|
|
299
|
+
// packages/remote-mcp/src/server/mcp-server.factory.ts:197. The
|
|
300
|
+
// `any` cast above lets TS accept a missing `inputSchema`, but
|
|
301
|
+
// at runtime SDK 1.29 still wants the key present — omitting it
|
|
302
|
+
// silently works today but becomes a footgun if the SDK
|
|
303
|
+
// tightens the contract.
|
|
304
|
+
inputSchema: {},
|
|
305
|
+
}, async () => {
|
|
306
|
+
const result = await handler.listAvailableTools();
|
|
307
|
+
return formatResult(result);
|
|
308
|
+
});
|
|
309
|
+
return server;
|
|
310
|
+
}
|
|
311
|
+
//# sourceMappingURL=mcp-server.factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.factory.js","sourceRoot":"","sources":["../../../src/adapter/mcp/mcp-server.factory.ts"],"names":[],"mappings":";;;AA4NA,0CAkKC;AA9XD,oEAAmE;AACnE,sDAAiF;AACjF,6BAAuB;AACvB,kDAAkD;AAGlD,oEAAoE;AACpE,MAAM,QAAQ,GAAG,OAAC,CAAC,IAAI,CAAC,6BAAwC,CAAC,CAAA;AAEjE,4DAA4D;AAC5D,MAAM,kBAAkB,GACtB,+DAA+D;IAC/D,IAAA,uCAAyB,GAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAE3B,QAAA,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mFAyI8C,CAAA;AAEtE,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAkC2B,CAAA;AAiC9D,SAAgB,eAAe,CAAC,OAAuB;IACrD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BACtD,QAAQ,CAAC,+CAA+C,CAAC;SAC7D;KACF,EACD,KAAK,EAAE,IAAS,EAAE,EAAE;QAClB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,mBAAmB,CAAC;YAC/C,IAAI,EAAE,IAAI,CAAC,IAAc;YACzB,OAAO,EAAE,IAAI,CAAC,OAAmB;SAClC,CAAC,CAAA;QACF,OAAO,YAAY,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC,CACF,CAAA;IAED,YAAY,CACV,gCAAgC,EAChC;QACE,WAAW,EAAE,uDAAuD;QACpE,mDAAmD;QACnD,gEAAgE;QAChE,+DAA+D;QAC/D,gEAAgE;QAChE,wDAAwD;QACxD,yBAAyB;QACzB,WAAW,EAAE,EAAE;KAChB,EACD,KAAK,IAAI,EAAE;QACT,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAA;QACjD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC,CACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
/**
|
|
3
|
+
* Connect MCP server via stdio transport.
|
|
4
|
+
* This is how AI clients (Claude Code, etc.) communicate with vess.
|
|
5
|
+
*/
|
|
6
|
+
export declare function connectStdioTransport(server: McpServer): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=stdio-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio-transport.d.ts","sourceRoot":"","sources":["../../../src/adapter/mcp/stdio-transport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAG5E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.connectStdioTransport = connectStdioTransport;
|
|
4
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
5
|
+
/**
|
|
6
|
+
* Connect MCP server via stdio transport.
|
|
7
|
+
* This is how AI clients (Claude Code, etc.) communicate with vess.
|
|
8
|
+
*/
|
|
9
|
+
async function connectStdioTransport(server) {
|
|
10
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
11
|
+
await server.connect(transport);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=stdio-transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio-transport.js","sourceRoot":"","sources":["../../../src/adapter/mcp/stdio-transport.ts"],"names":[],"mappings":";;AAOA,sDAGC;AAVD,wEAAgF;AAGhF;;;GAGG;AACI,KAAK,UAAU,qBAAqB,CAAC,MAAiB;IAC3D,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAA;IAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AACjC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport layer re-exports.
|
|
3
|
+
*
|
|
4
|
+
* - stdio: for single-client mode (used internally by MCP)
|
|
5
|
+
* - http: for multi-client daemon mode (vess daemon start)
|
|
6
|
+
*/
|
|
7
|
+
export { connectStdioTransport } from './stdio-transport';
|
|
8
|
+
export { startHttpTransport } from './http-transport';
|
|
9
|
+
export type { HttpTransportHandle } from './http-transport';
|
|
10
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/adapter/mcp/transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA"}
|