@qduc/term2 0.24.1 → 0.25.0
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/dist/agent.d.ts +3 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +2 -1
- package/dist/agent.js.map +1 -1
- package/dist/app.d.ts +10 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +33 -6
- package/dist/app.js.map +1 -1
- package/dist/cli.js +43 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/mcp-login-command.d.ts +24 -0
- package/dist/commands/mcp-login-command.d.ts.map +1 -0
- package/dist/commands/mcp-login-command.js +65 -0
- package/dist/commands/mcp-login-command.js.map +1 -0
- package/dist/commands/mcp-status-command.d.ts +19 -0
- package/dist/commands/mcp-status-command.d.ts.map +1 -0
- package/dist/commands/mcp-status-command.js +19 -0
- package/dist/commands/mcp-status-command.js.map +1 -0
- package/dist/components/input/ApplicationInputSurface.d.ts +4 -0
- package/dist/components/input/ApplicationInputSurface.d.ts.map +1 -1
- package/dist/components/input/ApplicationInputSurface.js +2 -0
- package/dist/components/input/ApplicationInputSurface.js.map +1 -1
- package/dist/components/input/McpMenuSession.d.ts +9 -0
- package/dist/components/input/McpMenuSession.d.ts.map +1 -0
- package/dist/components/input/McpMenuSession.js +370 -0
- package/dist/components/input/McpMenuSession.js.map +1 -0
- package/dist/components/input/mcp-intent-host.d.ts +10 -0
- package/dist/components/input/mcp-intent-host.d.ts.map +1 -0
- package/dist/components/input/mcp-intent-host.js +31 -0
- package/dist/components/input/mcp-intent-host.js.map +1 -0
- package/dist/components/input/menu-controller.d.ts.map +1 -1
- package/dist/components/input/menu-controller.js +8 -5
- package/dist/components/input/menu-controller.js.map +1 -1
- package/dist/components/input/menu-registry.d.ts.map +1 -1
- package/dist/components/input/menu-registry.js +2 -0
- package/dist/components/input/menu-registry.js.map +1 -1
- package/dist/components/input/menu-types.d.ts +22 -1
- package/dist/components/input/menu-types.d.ts.map +1 -1
- package/dist/components/layout/BottomArea.d.ts +6 -1
- package/dist/components/layout/BottomArea.d.ts.map +1 -1
- package/dist/components/layout/BottomArea.js +9 -6
- package/dist/components/layout/BottomArea.js.map +1 -1
- package/dist/components/menu/McpSelectionMenu.d.ts +15 -0
- package/dist/components/menu/McpSelectionMenu.d.ts.map +1 -0
- package/dist/components/menu/McpSelectionMenu.js +19 -0
- package/dist/components/menu/McpSelectionMenu.js.map +1 -0
- package/dist/components/message/command-message-helpers.d.ts +2 -2
- package/dist/components/message/command-message-helpers.d.ts.map +1 -1
- package/dist/components/prompt/ApprovalPrompt.d.ts.map +1 -1
- package/dist/components/prompt/ApprovalPrompt.js +3 -0
- package/dist/components/prompt/ApprovalPrompt.js.map +1 -1
- package/dist/contracts/conversation.d.ts +2 -0
- package/dist/contracts/conversation.d.ts.map +1 -1
- package/dist/contracts/conversation.js.map +1 -1
- package/dist/hooks/conversation-ui-reducer.d.ts +1 -1
- package/dist/hooks/conversation-ui-reducer.d.ts.map +1 -1
- package/dist/hooks/settings-completion-config.d.ts.map +1 -1
- package/dist/hooks/settings-completion-config.js +1 -0
- package/dist/hooks/settings-completion-config.js.map +1 -1
- package/dist/hooks/use-app-commands.d.ts +9 -1
- package/dist/hooks/use-app-commands.d.ts.map +1 -1
- package/dist/hooks/use-app-commands.js +14 -1
- package/dist/hooks/use-app-commands.js.map +1 -1
- package/dist/hooks/use-conversation.d.ts +1 -1
- package/dist/hooks/use-mcp-notices.d.ts +10 -0
- package/dist/hooks/use-mcp-notices.d.ts.map +1 -0
- package/dist/hooks/use-mcp-notices.js +47 -0
- package/dist/hooks/use-mcp-notices.js.map +1 -0
- package/dist/hooks/use-settings-value-completion.d.ts +3 -2
- package/dist/hooks/use-settings-value-completion.d.ts.map +1 -1
- package/dist/hooks/use-settings-value-completion.js +21 -3
- package/dist/hooks/use-settings-value-completion.js.map +1 -1
- package/dist/hooks/use-shell-mode.d.ts +1 -0
- package/dist/hooks/use-shell-mode.d.ts.map +1 -1
- package/dist/hooks/use-shell-mode.js +1 -0
- package/dist/hooks/use-shell-mode.js.map +1 -1
- package/dist/lib/agent-client.d.ts +1 -0
- package/dist/lib/agent-client.d.ts.map +1 -1
- package/dist/lib/agent-client.js +2 -0
- package/dist/lib/agent-client.js.map +1 -1
- package/dist/lib/agent-configuration.d.ts +4 -0
- package/dist/lib/agent-configuration.d.ts.map +1 -1
- package/dist/lib/agent-configuration.js +8 -0
- package/dist/lib/agent-configuration.js.map +1 -1
- package/dist/lib/agent-factory.d.ts +2 -0
- package/dist/lib/agent-factory.d.ts.map +1 -1
- package/dist/lib/agent-factory.js +1 -0
- package/dist/lib/agent-factory.js.map +1 -1
- package/dist/lib/oauth-loopback.d.ts +79 -0
- package/dist/lib/oauth-loopback.d.ts.map +1 -0
- package/dist/lib/oauth-loopback.js +221 -0
- package/dist/lib/oauth-loopback.js.map +1 -0
- package/dist/non-interactive.d.ts +2 -0
- package/dist/non-interactive.d.ts.map +1 -1
- package/dist/non-interactive.js +19 -0
- package/dist/non-interactive.js.map +1 -1
- package/dist/providers/oauth-pkce.d.ts +5 -1
- package/dist/providers/oauth-pkce.d.ts.map +1 -1
- package/dist/providers/oauth-pkce.js +28 -208
- package/dist/providers/oauth-pkce.js.map +1 -1
- package/dist/providers/openrouter-decisions.d.ts +15 -0
- package/dist/providers/openrouter-decisions.d.ts.map +1 -0
- package/dist/providers/openrouter-decisions.js +25 -0
- package/dist/providers/openrouter-decisions.js.map +1 -0
- package/dist/services/approval/decision-shadow.d.ts +15 -0
- package/dist/services/approval/decision-shadow.d.ts.map +1 -0
- package/dist/services/approval/decision-shadow.js +77 -0
- package/dist/services/approval/decision-shadow.js.map +1 -0
- package/dist/services/approval/non-interactive-approval-policy.d.ts +5 -0
- package/dist/services/approval/non-interactive-approval-policy.d.ts.map +1 -1
- package/dist/services/approval/non-interactive-approval-policy.js +14 -0
- package/dist/services/approval/non-interactive-approval-policy.js.map +1 -1
- package/dist/services/approval/shell-auto-approval-evaluator.d.ts +5 -1
- package/dist/services/approval/shell-auto-approval-evaluator.d.ts.map +1 -1
- package/dist/services/approval/shell-auto-approval-evaluator.js +80 -4
- package/dist/services/approval/shell-auto-approval-evaluator.js.map +1 -1
- package/dist/services/conversation/conversation-orchestrator.d.ts.map +1 -1
- package/dist/services/conversation/conversation-orchestrator.js +16 -2
- package/dist/services/conversation/conversation-orchestrator.js.map +1 -1
- package/dist/services/conversation/conversation-orchestrator.types.d.ts +1 -1
- package/dist/services/conversation/conversation-orchestrator.types.d.ts.map +1 -1
- package/dist/services/mcp/mcp-config-controller.d.ts +32 -0
- package/dist/services/mcp/mcp-config-controller.d.ts.map +1 -0
- package/dist/services/mcp/mcp-config-controller.js +89 -0
- package/dist/services/mcp/mcp-config-controller.js.map +1 -0
- package/dist/services/mcp/mcp-config.d.ts +61 -0
- package/dist/services/mcp/mcp-config.d.ts.map +1 -0
- package/dist/services/mcp/mcp-config.js +232 -0
- package/dist/services/mcp/mcp-config.js.map +1 -0
- package/dist/services/mcp/mcp-connection-manager.d.ts +126 -0
- package/dist/services/mcp/mcp-connection-manager.d.ts.map +1 -0
- package/dist/services/mcp/mcp-connection-manager.js +488 -0
- package/dist/services/mcp/mcp-connection-manager.js.map +1 -0
- package/dist/services/mcp/mcp-oauth-login.d.ts +79 -0
- package/dist/services/mcp/mcp-oauth-login.d.ts.map +1 -0
- package/dist/services/mcp/mcp-oauth-login.js +126 -0
- package/dist/services/mcp/mcp-oauth-login.js.map +1 -0
- package/dist/services/mcp/mcp-oauth-provider.d.ts +77 -0
- package/dist/services/mcp/mcp-oauth-provider.d.ts.map +1 -0
- package/dist/services/mcp/mcp-oauth-provider.js +121 -0
- package/dist/services/mcp/mcp-oauth-provider.js.map +1 -0
- package/dist/services/mcp/mcp-oauth-store.d.ts +106 -0
- package/dist/services/mcp/mcp-oauth-store.d.ts.map +1 -0
- package/dist/services/mcp/mcp-oauth-store.js +278 -0
- package/dist/services/mcp/mcp-oauth-store.js.map +1 -0
- package/dist/services/mcp/mcp-status.d.ts +41 -0
- package/dist/services/mcp/mcp-status.d.ts.map +1 -0
- package/dist/services/mcp/mcp-status.js +69 -0
- package/dist/services/mcp/mcp-status.js.map +1 -0
- package/dist/services/mcp/mcp-stdio-launcher.d.ts +26 -0
- package/dist/services/mcp/mcp-stdio-launcher.d.ts.map +1 -0
- package/dist/services/mcp/mcp-stdio-launcher.js +8 -0
- package/dist/services/mcp/mcp-stdio-launcher.js.map +1 -0
- package/dist/services/mcp/mcp-tool-source.d.ts +77 -0
- package/dist/services/mcp/mcp-tool-source.d.ts.map +1 -0
- package/dist/services/mcp/mcp-tool-source.js +10 -0
- package/dist/services/mcp/mcp-tool-source.js.map +1 -0
- package/dist/services/mcp/test-fixtures/fake-authorization-server.d.ts +25 -0
- package/dist/services/mcp/test-fixtures/fake-authorization-server.d.ts.map +1 -0
- package/dist/services/mcp/test-fixtures/fake-authorization-server.js +147 -0
- package/dist/services/mcp/test-fixtures/fake-authorization-server.js.map +1 -0
- package/dist/services/mcp/test-fixtures/protected-mcp-server.d.ts +29 -0
- package/dist/services/mcp/test-fixtures/protected-mcp-server.d.ts.map +1 -0
- package/dist/services/mcp/test-fixtures/protected-mcp-server.js +87 -0
- package/dist/services/mcp/test-fixtures/protected-mcp-server.js.map +1 -0
- package/dist/services/mcp/turn-stable-mcp-tool-source.d.ts +19 -0
- package/dist/services/mcp/turn-stable-mcp-tool-source.d.ts.map +1 -0
- package/dist/services/mcp/turn-stable-mcp-tool-source.js +37 -0
- package/dist/services/mcp/turn-stable-mcp-tool-source.js.map +1 -0
- package/dist/services/models/decision-model-listing.d.ts +26 -0
- package/dist/services/models/decision-model-listing.d.ts.map +1 -0
- package/dist/services/models/decision-model-listing.js +61 -0
- package/dist/services/models/decision-model-listing.js.map +1 -0
- package/dist/services/profiles/registry.d.ts +1 -1
- package/dist/services/profiles/registry.d.ts.map +1 -1
- package/dist/services/profiles/registry.js +2 -1
- package/dist/services/profiles/registry.js.map +1 -1
- package/dist/services/settings/settings-schema.d.ts +4 -0
- package/dist/services/settings/settings-schema.d.ts.map +1 -1
- package/dist/services/settings/settings-schema.js +8 -0
- package/dist/services/settings/settings-schema.js.map +1 -1
- package/dist/services/settings/settings-sources.d.ts +2 -0
- package/dist/services/settings/settings-sources.d.ts.map +1 -1
- package/dist/services/settings/settings-sources.js +2 -0
- package/dist/services/settings/settings-sources.js.map +1 -1
- package/dist/services/settings/test-helpers/settings-consumer-inventory.d.ts +1 -1
- package/dist/services/settings/test-helpers/settings-consumer-inventory.d.ts.map +1 -1
- package/dist/services/settings/test-helpers/settings-consumer-inventory.js +1 -0
- package/dist/services/settings/test-helpers/settings-consumer-inventory.js.map +1 -1
- package/dist/services/shell/shell-interaction-session.d.ts +2 -0
- package/dist/services/shell/shell-interaction-session.d.ts.map +1 -1
- package/dist/services/shell/shell-interaction-session.js +11 -2
- package/dist/services/shell/shell-interaction-session.js.map +1 -1
- package/dist/services/subagents/subagent-notification-store.js.map +1 -1
- package/dist/tools/system/run-code/mcp-script-surface.d.ts +28 -0
- package/dist/tools/system/run-code/mcp-script-surface.d.ts.map +1 -0
- package/dist/tools/system/run-code/mcp-script-surface.js +165 -0
- package/dist/tools/system/run-code/mcp-script-surface.js.map +1 -0
- package/dist/tools/system/run-code/run-code-runtime.d.ts.map +1 -1
- package/dist/tools/system/run-code/run-code-runtime.js +13 -1
- package/dist/tools/system/run-code/run-code-runtime.js.map +1 -1
- package/dist/tools/system/run-code/run-code.d.ts +3 -0
- package/dist/tools/system/run-code/run-code.d.ts.map +1 -1
- package/dist/tools/system/run-code/run-code.js +32 -4
- package/dist/tools/system/run-code/run-code.js.map +1 -1
- package/dist/utils/conversation/conversation-event-handler.js.map +1 -1
- package/dist/utils/conversation/conversation-utils.d.ts +1 -5
- package/dist/utils/conversation/conversation-utils.d.ts.map +1 -1
- package/dist/utils/conversation/conversation-utils.js +4 -1
- package/dist/utils/conversation/conversation-utils.js.map +1 -1
- package/dist/utils/value-suggestions.d.ts +14 -0
- package/dist/utils/value-suggestions.d.ts.map +1 -1
- package/dist/utils/value-suggestions.js +31 -0
- package/dist/utils/value-suggestions.js.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { createServer } from 'node:http';
|
|
3
|
+
function listen(server) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
server.once('error', reject);
|
|
6
|
+
server.listen(0, '127.0.0.1', () => {
|
|
7
|
+
server.off('error', reject);
|
|
8
|
+
resolve(server.address().port);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
async function readBody(req) {
|
|
13
|
+
const chunks = [];
|
|
14
|
+
for await (const chunk of req)
|
|
15
|
+
chunks.push(Buffer.from(chunk));
|
|
16
|
+
return Buffer.concat(chunks).toString('utf8');
|
|
17
|
+
}
|
|
18
|
+
function sendJson(res, status, body) {
|
|
19
|
+
const payload = JSON.stringify(body);
|
|
20
|
+
res.writeHead(status, { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(payload) });
|
|
21
|
+
res.end(payload);
|
|
22
|
+
}
|
|
23
|
+
function sendError(res, status, error, description) {
|
|
24
|
+
sendJson(res, status, { error, error_description: description });
|
|
25
|
+
}
|
|
26
|
+
const s256 = (verifier) => crypto.createHash('sha256').update(verifier).digest('base64url');
|
|
27
|
+
export async function startFakeAuthorizationServer() {
|
|
28
|
+
const codes = new Map();
|
|
29
|
+
const knownRefreshTokens = new Set();
|
|
30
|
+
const state = {
|
|
31
|
+
issuer: '',
|
|
32
|
+
issuedAccessTokens: [],
|
|
33
|
+
refreshGrants: [],
|
|
34
|
+
registeredClientIds: [],
|
|
35
|
+
refusedTokenRequests: 0,
|
|
36
|
+
stop: () => new Promise((resolve) => server.close(() => resolve())),
|
|
37
|
+
};
|
|
38
|
+
const issueTokens = () => {
|
|
39
|
+
const accessToken = `at-${crypto.randomUUID()}`;
|
|
40
|
+
const refreshToken = `rt-${crypto.randomUUID()}`;
|
|
41
|
+
state.issuedAccessTokens.push(accessToken);
|
|
42
|
+
knownRefreshTokens.add(refreshToken);
|
|
43
|
+
return { access_token: accessToken, refresh_token: refreshToken, token_type: 'Bearer', expires_in: 3600 };
|
|
44
|
+
};
|
|
45
|
+
const handleAuthorize = (url, res) => {
|
|
46
|
+
const redirectUri = url.searchParams.get('redirect_uri');
|
|
47
|
+
const codeChallenge = url.searchParams.get('code_challenge');
|
|
48
|
+
const clientId = url.searchParams.get('client_id');
|
|
49
|
+
if (url.searchParams.get('response_type') !== 'code') {
|
|
50
|
+
return sendError(res, 400, 'unsupported_response_type', 'only the code response type is supported');
|
|
51
|
+
}
|
|
52
|
+
if (url.searchParams.get('code_challenge_method') !== 'S256') {
|
|
53
|
+
return sendError(res, 400, 'invalid_request', 'code_challenge_method must be S256');
|
|
54
|
+
}
|
|
55
|
+
if (!codeChallenge || !redirectUri || !clientId) {
|
|
56
|
+
return sendError(res, 400, 'invalid_request', 'client_id, redirect_uri and code_challenge are required');
|
|
57
|
+
}
|
|
58
|
+
const code = `code-${crypto.randomUUID()}`;
|
|
59
|
+
codes.set(code, { clientId, redirectUri, codeChallenge });
|
|
60
|
+
const location = new URL(redirectUri);
|
|
61
|
+
location.searchParams.set('code', code);
|
|
62
|
+
const clientState = url.searchParams.get('state');
|
|
63
|
+
if (clientState)
|
|
64
|
+
location.searchParams.set('state', clientState);
|
|
65
|
+
// The user is never asked to consent: this server approves every request.
|
|
66
|
+
res.writeHead(302, { Location: location.href });
|
|
67
|
+
res.end();
|
|
68
|
+
};
|
|
69
|
+
const handleToken = async (req, res) => {
|
|
70
|
+
const params = new URLSearchParams(await readBody(req));
|
|
71
|
+
const grantType = params.get('grant_type');
|
|
72
|
+
if (grantType === 'authorization_code') {
|
|
73
|
+
const code = params.get('code') ?? '';
|
|
74
|
+
const pending = codes.get(code);
|
|
75
|
+
// Single use: a replayed code must not mint a second token set.
|
|
76
|
+
codes.delete(code);
|
|
77
|
+
const verifier = params.get('code_verifier') ?? '';
|
|
78
|
+
if (!pending)
|
|
79
|
+
return refuse(res, 'unknown or already-used authorization code');
|
|
80
|
+
if (pending.redirectUri !== params.get('redirect_uri'))
|
|
81
|
+
return refuse(res, 'redirect_uri does not match');
|
|
82
|
+
if (pending.clientId !== params.get('client_id'))
|
|
83
|
+
return refuse(res, 'client_id does not match');
|
|
84
|
+
if (pending.codeChallenge !== s256(verifier)) {
|
|
85
|
+
return refuse(res, 'code_verifier does not match the S256 challenge');
|
|
86
|
+
}
|
|
87
|
+
return sendJson(res, 200, issueTokens());
|
|
88
|
+
}
|
|
89
|
+
if (grantType === 'refresh_token') {
|
|
90
|
+
const presented = params.get('refresh_token') ?? '';
|
|
91
|
+
if (!knownRefreshTokens.has(presented))
|
|
92
|
+
return refuse(res, 'unknown refresh token');
|
|
93
|
+
state.refreshGrants.push(presented);
|
|
94
|
+
// Rotation: the presented refresh token is spent by this grant.
|
|
95
|
+
knownRefreshTokens.delete(presented);
|
|
96
|
+
return sendJson(res, 200, issueTokens());
|
|
97
|
+
}
|
|
98
|
+
return sendError(res, 400, 'unsupported_grant_type', `unsupported grant_type: ${grantType ?? '(missing)'}`);
|
|
99
|
+
};
|
|
100
|
+
const refuse = (res, reason) => {
|
|
101
|
+
state.refusedTokenRequests += 1;
|
|
102
|
+
sendError(res, 400, 'invalid_grant', reason);
|
|
103
|
+
};
|
|
104
|
+
const server = createServer(async (req, res) => {
|
|
105
|
+
const url = new URL(req.url ?? '/', state.issuer || 'http://127.0.0.1');
|
|
106
|
+
try {
|
|
107
|
+
if (req.method === 'GET' && url.pathname === '/.well-known/oauth-authorization-server') {
|
|
108
|
+
return sendJson(res, 200, {
|
|
109
|
+
issuer: state.issuer,
|
|
110
|
+
authorization_endpoint: `${state.issuer}/authorize`,
|
|
111
|
+
token_endpoint: `${state.issuer}/token`,
|
|
112
|
+
registration_endpoint: `${state.issuer}/register`,
|
|
113
|
+
response_types_supported: ['code'],
|
|
114
|
+
grant_types_supported: ['authorization_code', 'refresh_token'],
|
|
115
|
+
code_challenge_methods_supported: ['S256'],
|
|
116
|
+
token_endpoint_auth_methods_supported: ['none'],
|
|
117
|
+
scopes_supported: ['mcp'],
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (req.method === 'GET' && url.pathname === '/authorize')
|
|
121
|
+
return handleAuthorize(url, res);
|
|
122
|
+
if (req.method === 'POST' && url.pathname === '/token')
|
|
123
|
+
return await handleToken(req, res);
|
|
124
|
+
if (req.method === 'POST' && url.pathname === '/register') {
|
|
125
|
+
// RFC 7591: the response carries the client id plus the metadata that
|
|
126
|
+
// was registered, which the client validates against its own request.
|
|
127
|
+
const metadata = JSON.parse((await readBody(req)) || '{}');
|
|
128
|
+
const clientId = `dcr-${state.registeredClientIds.length + 1}`;
|
|
129
|
+
state.registeredClientIds.push(clientId);
|
|
130
|
+
return sendJson(res, 201, {
|
|
131
|
+
...metadata,
|
|
132
|
+
client_id: clientId,
|
|
133
|
+
token_endpoint_auth_method: 'none',
|
|
134
|
+
client_id_issued_at: Math.floor(Date.now() / 1000),
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
sendJson(res, 404, { error: 'not_found', path: url.pathname });
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
sendJson(res, 500, { error: 'server_error', error_description: String(error) });
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
const port = await listen(server);
|
|
144
|
+
state.issuer = `http://127.0.0.1:${port}`;
|
|
145
|
+
return state;
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=fake-authorization-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-authorization-server.js","sourceRoot":"","sources":["../../../../source/services/mcp/test-fixtures/fake-authorization-server.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAC;AAgCpF,SAAS,MAAM,CAAC,MAA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AI,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClF,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;IAClC,KAAK,CAAC,MAAM,GAAG,oBAAoB,IAAI,EAAE,CAAC;IAC1C,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An MCP server that requires a bearer token and publishes RFC 9728 protected
|
|
3
|
+
* resource metadata pointing at its authorization server — the shape a client
|
|
4
|
+
* hits when it connects to an OAuth-protected remote server.
|
|
5
|
+
*
|
|
6
|
+
* Serving goes through the real v2 SDK handler, so a test that reaches a tool
|
|
7
|
+
* here has done the actual MCP handshake over Streamable HTTP.
|
|
8
|
+
*/
|
|
9
|
+
export type ProtectedMcpServerOptions = {
|
|
10
|
+
/** The authorization server's issuer identifier. */
|
|
11
|
+
authorizationServerUrl: string;
|
|
12
|
+
/** Returns the auth info for a token, or null when the token is not valid. */
|
|
13
|
+
verifyToken: (token: string) => Promise<{
|
|
14
|
+
clientId: string;
|
|
15
|
+
scopes: string[];
|
|
16
|
+
expiresAt: number;
|
|
17
|
+
} | null>;
|
|
18
|
+
};
|
|
19
|
+
export type ProtectedMcpServer = {
|
|
20
|
+
/** Base URL of the MCP endpoint. */
|
|
21
|
+
url: string;
|
|
22
|
+
/** RFC 9728 metadata URL advertised in the 401 challenge. */
|
|
23
|
+
resourceMetadataUrl: string;
|
|
24
|
+
/** Every HTTP request the fixture has seen, including refused ones. */
|
|
25
|
+
requestCount: () => number;
|
|
26
|
+
stop: () => Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
export declare function startProtectedMcpServer(options: ProtectedMcpServerOptions): Promise<ProtectedMcpServer>;
|
|
29
|
+
//# sourceMappingURL=protected-mcp-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protected-mcp-server.d.ts","sourceRoot":"","sources":["../../../../source/services/mcp/test-fixtures/protected-mcp-server.ts"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,oDAAoD;IACpD,sBAAsB,EAAE,MAAM,CAAC;IAC/B,8EAA8E;IAC9E,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;CAC3G,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uEAAuE;IACvE,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AA+BF,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA6D7G"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { createServer } from 'node:http';
|
|
2
|
+
import { McpServer, OAuthError, OAuthErrorCode, createMcpHandler, getOAuthProtectedResourceMetadataUrl, oauthMetadataResponse, requireBearerAuth, } from '@modelcontextprotocol/server';
|
|
3
|
+
function listen(server) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
server.once('error', reject);
|
|
6
|
+
server.listen(0, '127.0.0.1', () => {
|
|
7
|
+
server.off('error', reject);
|
|
8
|
+
resolve(server.address().port);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
async function toResponse(res, response) {
|
|
13
|
+
res.writeHead(response.status, Object.fromEntries(response.headers));
|
|
14
|
+
if (response.body) {
|
|
15
|
+
for await (const chunk of response.body)
|
|
16
|
+
res.write(chunk);
|
|
17
|
+
}
|
|
18
|
+
res.end();
|
|
19
|
+
}
|
|
20
|
+
/** Builds one `Request` and lets each gate read from it. */
|
|
21
|
+
async function asRequest(req, url) {
|
|
22
|
+
const chunks = [];
|
|
23
|
+
for await (const chunk of req)
|
|
24
|
+
chunks.push(Buffer.from(chunk));
|
|
25
|
+
return new Request(url, {
|
|
26
|
+
method: req.method,
|
|
27
|
+
headers: req.headers,
|
|
28
|
+
...(chunks.length ? { body: Buffer.concat(chunks) } : {}),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export async function startProtectedMcpServer(options) {
|
|
32
|
+
let origin = '';
|
|
33
|
+
let requests = 0;
|
|
34
|
+
const resourceUrl = () => `${origin}/mcp`;
|
|
35
|
+
const resourceMetadataUrl = () => getOAuthProtectedResourceMetadataUrl(new URL(resourceUrl()));
|
|
36
|
+
const mcp = new McpServer({ name: 'protected-fixture', version: '1.0.0' });
|
|
37
|
+
mcp.registerTool('echo', { description: 'reports that the server is reachable' }, async () => ({
|
|
38
|
+
content: [{ type: 'text', text: 'echo' }],
|
|
39
|
+
}));
|
|
40
|
+
const handler = createMcpHandler(() => mcp);
|
|
41
|
+
const verifier = {
|
|
42
|
+
verifyAccessToken: async (token) => {
|
|
43
|
+
const verified = await options.verifyToken(token);
|
|
44
|
+
if (!verified)
|
|
45
|
+
throw new OAuthError(OAuthErrorCode.InvalidToken, 'Unknown access token');
|
|
46
|
+
return { token, clientId: verified.clientId, scopes: verified.scopes, expiresAt: verified.expiresAt };
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
// Rebuilt per request because the challenge must advertise the metadata URL of
|
|
50
|
+
// the port the server actually bound, which is only known after `listen`.
|
|
51
|
+
const gate = (request) => requireBearerAuth({ verifier, resourceMetadataUrl: resourceMetadataUrl() })(request);
|
|
52
|
+
const server = createServer(async (req, res) => {
|
|
53
|
+
requests += 1;
|
|
54
|
+
const request = await asRequest(req, `http://${req.headers.host}${req.url}`);
|
|
55
|
+
// The protected-resource document is what an unauthenticated client reads to
|
|
56
|
+
// find the authorization server; it must not require a token itself.
|
|
57
|
+
const metadata = oauthMetadataResponse(request, {
|
|
58
|
+
oauthMetadata: {
|
|
59
|
+
issuer: options.authorizationServerUrl,
|
|
60
|
+
authorization_endpoint: `${options.authorizationServerUrl}/authorize`,
|
|
61
|
+
token_endpoint: `${options.authorizationServerUrl}/token`,
|
|
62
|
+
registration_endpoint: `${options.authorizationServerUrl}/register`,
|
|
63
|
+
response_types_supported: ['code'],
|
|
64
|
+
grant_types_supported: ['authorization_code', 'refresh_token'],
|
|
65
|
+
code_challenge_methods_supported: ['S256'],
|
|
66
|
+
},
|
|
67
|
+
resourceServerUrl: new URL(resourceUrl()),
|
|
68
|
+
resourceName: 'protected-fixture',
|
|
69
|
+
scopesSupported: ['mcp'],
|
|
70
|
+
});
|
|
71
|
+
if (metadata)
|
|
72
|
+
return toResponse(res, metadata);
|
|
73
|
+
const auth = await gate(request);
|
|
74
|
+
if (auth instanceof Response)
|
|
75
|
+
return toResponse(res, auth);
|
|
76
|
+
return toResponse(res, await handler.fetch(request, { authInfo: auth }));
|
|
77
|
+
});
|
|
78
|
+
const port = await listen(server);
|
|
79
|
+
origin = `http://127.0.0.1:${port}`;
|
|
80
|
+
return {
|
|
81
|
+
url: resourceUrl(),
|
|
82
|
+
resourceMetadataUrl: resourceMetadataUrl(),
|
|
83
|
+
requestCount: () => requests,
|
|
84
|
+
stop: () => new Promise((resolve) => server.close(() => resolve())),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=protected-mcp-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protected-mcp-server.js","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AC;QACH,IAAI,QAAQ;YAAE,OAAO,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAE/C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,IAAI,YAAY,QAAQ;YAAE,OAAO,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAE3D,OAAO,UAAU,CAAC,GAAG,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,GAAG,oBAAoB,IAAI,EAAE,CAAC;IACpC,OAAO;QACL,GAAG,EAAE,WAAW,EAAE;QAClB,mBAAmB,EAAE,mBAAmB,EAAE;QAC1C,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ;QAC5B,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;KAC1E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { McpCallOptions, McpCallResult, McpServerSnapshot, McpToolSource } from './mcp-tool-source.js';
|
|
2
|
+
/**
|
|
3
|
+
* Keeps the catalog used to describe an agent stable until the caller starts
|
|
4
|
+
* the next turn. Calls deliberately remain live so a server can recover while
|
|
5
|
+
* a prompt is in flight.
|
|
6
|
+
*/
|
|
7
|
+
export declare class TurnStableMcpToolSource implements McpToolSource {
|
|
8
|
+
private readonly live;
|
|
9
|
+
private catalog;
|
|
10
|
+
private pending;
|
|
11
|
+
private readonly unsubscribe;
|
|
12
|
+
constructor(live: McpToolSource);
|
|
13
|
+
beginTurn(): void;
|
|
14
|
+
snapshot(): readonly McpServerSnapshot[];
|
|
15
|
+
callTool(server: string, tool: string, args: Record<string, unknown>, options: McpCallOptions): Promise<McpCallResult>;
|
|
16
|
+
onCatalogChanged(listener: () => void): () => void;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=turn-stable-mcp-tool-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn-stable-mcp-tool-source.d.ts","sourceRoot":"","sources":["../../../source/services/mcp/turn-stable-mcp-tool-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE5G;;;;GAIG;AACH,qBAAa,uBAAwB,YAAW,aAAa;IAK/C,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJjC,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IAEzC,YAA6B,IAAI,EAAE,aAAa,EAK/C;IAED,SAAS,IAAI,IAAI,CAKhB;IAED,QAAQ,IAAI,SAAS,iBAAiB,EAAE,CAEvC;IAED,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,aAAa,CAAC,CAExB;IAED,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAEjD;IAED,OAAO,IAAI,IAAI,CAEd;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps the catalog used to describe an agent stable until the caller starts
|
|
3
|
+
* the next turn. Calls deliberately remain live so a server can recover while
|
|
4
|
+
* a prompt is in flight.
|
|
5
|
+
*/
|
|
6
|
+
export class TurnStableMcpToolSource {
|
|
7
|
+
live;
|
|
8
|
+
catalog;
|
|
9
|
+
pending = false;
|
|
10
|
+
unsubscribe;
|
|
11
|
+
constructor(live) {
|
|
12
|
+
this.live = live;
|
|
13
|
+
this.catalog = live.snapshot();
|
|
14
|
+
this.unsubscribe = live.onCatalogChanged(() => {
|
|
15
|
+
this.pending = true;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
beginTurn() {
|
|
19
|
+
if (this.pending) {
|
|
20
|
+
this.catalog = this.live.snapshot();
|
|
21
|
+
this.pending = false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
snapshot() {
|
|
25
|
+
return this.catalog;
|
|
26
|
+
}
|
|
27
|
+
callTool(server, tool, args, options) {
|
|
28
|
+
return this.live.callTool(server, tool, args, options);
|
|
29
|
+
}
|
|
30
|
+
onCatalogChanged(listener) {
|
|
31
|
+
return this.live.onCatalogChanged(listener);
|
|
32
|
+
}
|
|
33
|
+
dispose() {
|
|
34
|
+
this.unsubscribe();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=turn-stable-mcp-tool-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn-stable-mcp-tool-source.js","sourceRoot":"","sources":["../../../source/services/mcp/turn-stable-mcp-tool-source.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,OAAO,uBAAuB;IAKL,IAAI;IAJzB,OAAO,CAA+B;IACtC,OAAO,GAAG,KAAK,CAAC;IACP,WAAW,CAAa;IAEzC,YAA6B,IAAmB;oBAAnB,IAAI;QAC/B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;YAC5C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,SAAS;QACP,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,QAAQ,CACN,MAAc,EACd,IAAY,EACZ,IAA6B,EAC7B,OAAuB;QAEvB,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,gBAAgB,CAAC,QAAoB;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO;QACL,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Listing of OpenRouter models served by the alpha Decisions endpoint
|
|
3
|
+
* (`output_modalities` contains `decisions`). Chat models on
|
|
4
|
+
* `/api/v1/chat/completions` are NOT valid here: the Decisions endpoint only
|
|
5
|
+
* answers typed questions about a state, so the catalog filter — not the
|
|
6
|
+
* chat-model catalog — defines what `agent.autoApproveDecisionShadowModel`
|
|
7
|
+
* may be set to. The endpoint is public and needs no API key.
|
|
8
|
+
*/
|
|
9
|
+
export type DecisionModelInfo = {
|
|
10
|
+
id: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function clearDecisionModelListCache(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Fetch the decisions-capable model list. Returns the cached list within the
|
|
16
|
+
* TTL; returns null on fetch, HTTP, or payload failure without caching the
|
|
17
|
+
* failure, so a later open of the picker retries.
|
|
18
|
+
*/
|
|
19
|
+
export declare function fetchDecisionModels(opts?: {
|
|
20
|
+
fetchImpl?: typeof fetch;
|
|
21
|
+
ttlMs?: number;
|
|
22
|
+
now?: () => number;
|
|
23
|
+
}): Promise<DecisionModelInfo[] | null>;
|
|
24
|
+
/** The one setting whose picker is populated from the decisions catalog. */
|
|
25
|
+
export declare function isDecisionShadowModelKey(key: string): boolean;
|
|
26
|
+
//# sourceMappingURL=decision-model-listing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-model-listing.d.ts","sourceRoot":"","sources":["../../../source/services/models/decision-model-listing.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAOF,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AAgBD;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,CAAC,EAAE;IAC/C,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC,CA2BtC;AAED,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE7D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SETTING_KEYS } from '../settings/settings-schema.js';
|
|
2
|
+
const DECISION_MODELS_URL = 'https://openrouter.ai/api/v1/models?output_modalities=decisions';
|
|
3
|
+
const DEFAULT_TTL_MS = 60 * 60 * 1000;
|
|
4
|
+
let cache;
|
|
5
|
+
export function clearDecisionModelListCache() {
|
|
6
|
+
cache = undefined;
|
|
7
|
+
}
|
|
8
|
+
function parseDecisionModels(payload) {
|
|
9
|
+
if (typeof payload !== 'object' || payload === null)
|
|
10
|
+
return null;
|
|
11
|
+
const data = payload.data;
|
|
12
|
+
if (!Array.isArray(data))
|
|
13
|
+
return null;
|
|
14
|
+
const models = [];
|
|
15
|
+
for (const entry of data) {
|
|
16
|
+
if (typeof entry !== 'object' || entry === null)
|
|
17
|
+
continue;
|
|
18
|
+
const { id, name } = entry;
|
|
19
|
+
if (typeof id !== 'string' || id.length === 0)
|
|
20
|
+
continue;
|
|
21
|
+
models.push({ id, ...(typeof name === 'string' && name.length > 0 ? { name } : {}) });
|
|
22
|
+
}
|
|
23
|
+
return models;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Fetch the decisions-capable model list. Returns the cached list within the
|
|
27
|
+
* TTL; returns null on fetch, HTTP, or payload failure without caching the
|
|
28
|
+
* failure, so a later open of the picker retries.
|
|
29
|
+
*/
|
|
30
|
+
export async function fetchDecisionModels(opts) {
|
|
31
|
+
const fetchImpl = opts?.fetchImpl ?? fetch;
|
|
32
|
+
const ttlMs = opts?.ttlMs ?? DEFAULT_TTL_MS;
|
|
33
|
+
const now = opts?.now ?? Date.now;
|
|
34
|
+
if (cache) {
|
|
35
|
+
const age = now() - cache.timestamp;
|
|
36
|
+
if (age >= 0 && age < ttlMs) {
|
|
37
|
+
return cache.models;
|
|
38
|
+
}
|
|
39
|
+
cache = undefined;
|
|
40
|
+
}
|
|
41
|
+
let payload;
|
|
42
|
+
try {
|
|
43
|
+
const response = await fetchImpl(DECISION_MODELS_URL);
|
|
44
|
+
if (!response.ok)
|
|
45
|
+
return null;
|
|
46
|
+
payload = await response.json();
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const models = parseDecisionModels(payload);
|
|
52
|
+
if (models === null)
|
|
53
|
+
return null;
|
|
54
|
+
cache = { models, timestamp: now() };
|
|
55
|
+
return models;
|
|
56
|
+
}
|
|
57
|
+
/** The one setting whose picker is populated from the decisions catalog. */
|
|
58
|
+
export function isDecisionShadowModelKey(key) {
|
|
59
|
+
return key === SETTING_KEYS.AGENT_AUTO_APPROVE_DECISION_SHADOW_MODEL;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=decision-model-listing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-model-listing.js","sourceRoot":"","sources":["../../../source/services/models/decision-model-listing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAgB9D,MAAM,mBAAmB,GAAG,iEAAiE,CAAC;AAC9F,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEtC,IAAI,KAAqE,CAAC;AAE1E,MAAM,UAAU,2BAA2B;IACzC,KAAK,GAAG,SAAS,CAAC;AACpB,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAgB;IAC3C,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjE,MAAM,IAAI,GAAI,OAA8B,CAAC,IAAI,CAAC;IAClD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QACzB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;YAAE,SAAS;QAC1D,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,KAAyC,CAAC;QAC/D,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACxD,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACxF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAA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
|
2
2
|
/** Stable source kinds owned by the application. Profile data cannot invent one. */
|
|
3
3
|
export declare const BUILTIN_CONTEXT_SOURCES: readonly ['environment', 'workspace', 'project-instructions', 'skills-catalog', 'memory', 'session-browser', 'repository-guidance', 'profile-document'];
|
|
4
|
-
export declare const BUILTIN_TOOL_CAPABILITIES: readonly ['filesystem-read-workspace', 'filesystem-read-external', 'filesystem-write', 'shell', 'web', 'memory', 'sessions', 'skills', 'mentor', 'subagents', 'background-tasks', 'user-interaction', 'code-context'];
|
|
4
|
+
export declare const BUILTIN_TOOL_CAPABILITIES: readonly ['filesystem-read-workspace', 'filesystem-read-external', 'filesystem-write', 'shell', 'web', 'memory', 'sessions', 'skills', 'mentor', 'subagents', 'background-tasks', 'user-interaction', 'code-context', 'mcp'];
|
|
5
5
|
export declare const BUILTIN_ENFORCEMENT_POLICIES: readonly ['builtin:enforcement/normal', 'builtin:enforcement/plan-read-only'];
|
|
6
6
|
export declare const BUILTIN_INTEGRATIONS: readonly ['builtin:integration/mentor', 'builtin:integration/async-subagents', 'builtin:integration/background-task-control'];
|
|
7
7
|
export declare const builtinBlocks: readonly RegisteredBlock[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../source/services/profiles/registry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,SAAS,EAET,2BAA2B,EAC3B,qBAAqB,EAErB,iBAAiB,EACjB,eAAe,EACf,eAAe,EAEhB,MAAM,YAAY,CAAC;AAKpB,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,YAClC,aAAa,EACb,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,CACV,CAAC;AAEX,eAAO,MAAM,yBAAyB,YACpC,2BAA2B,EAC3B,0BAA0B,EAC1B,kBAAkB,EAClB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../source/services/profiles/registry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,SAAS,EAET,2BAA2B,EAC3B,qBAAqB,EAErB,iBAAiB,EACjB,eAAe,EACf,eAAe,EAEhB,MAAM,YAAY,CAAC;AAKpB,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,YAClC,aAAa,EACb,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,CACV,CAAC;AAEX,eAAO,MAAM,yBAAyB,YACpC,2BAA2B,EAC3B,0BAA0B,EAC1B,kBAAkB,EAClB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,KAAK,CACG,CAAC;AAEX,eAAO,MAAM,4BAA4B,YACvC,4BAA4B,EAC5B,oCAAoC,CAC5B,CAAC;AAEX,eAAO,MAAM,oBAAoB,YAC/B,4BAA4B,EAC5B,qCAAqC,EACrC,6CAA6C,CACrC,CAAC;AA4BX,eAAO,MAAM,aAAa,EAAE,SAAS,eAAe,EAqBnD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,2BAA2B,EAQjE,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,SAAS,qBAAqB,EAI/D,CAAC;AAWF,eAAO,MAAM,eAAe,EAAE,SAAS,iBAAiB,EA6CvD,CAAC;AAKF,eAAO,MAAM,sBAAsB,EAAE,eAKpC,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,sCAAgC,CAAC;AAElE,eAAO,MAAM,sBAAsB,UAAW,MAAM,KAAG,OACS,CAAC;AACjE,eAAO,MAAM,uBAAuB,UAAW,MAAM,KAAG,OACU,CAAC;AACnE,eAAO,MAAM,kBAAkB,UAAW,MAAM,KAAG,KAAK,IAAI,SACyD,CAAC"}
|
|
@@ -26,6 +26,7 @@ export const BUILTIN_TOOL_CAPABILITIES = [
|
|
|
26
26
|
'background-tasks',
|
|
27
27
|
'user-interaction',
|
|
28
28
|
'code-context',
|
|
29
|
+
'mcp',
|
|
29
30
|
];
|
|
30
31
|
export const BUILTIN_ENFORCEMENT_POLICIES = [
|
|
31
32
|
'builtin:enforcement/normal',
|
|
@@ -85,7 +86,7 @@ export const builtinPolicies = [
|
|
|
85
86
|
{
|
|
86
87
|
id: BUILTIN_ENFORCEMENT_POLICIES[1],
|
|
87
88
|
kind: 'enforcement',
|
|
88
|
-
denials: ['filesystem-mutation', 'shell-mutation', 'delegated-write', 'unknown-delegated-role'],
|
|
89
|
+
denials: ['filesystem-mutation', 'shell-mutation', 'mcp', 'delegated-write', 'unknown-delegated-role'],
|
|
89
90
|
handoffRestriction: 'plan-read-only',
|
|
90
91
|
},
|
|
91
92
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../source/services/profiles/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAa7B,MAAM,MAAM,GAAG,CAAC,IAAY,EAAU,EAAE,CACtC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AAExF,oFAAoF;AACpF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,aAAa;IACb,WAAW;IACX,sBAAsB;IACtB,gBAAgB;IAChB,QAAQ;IACR,iBAAiB;IACjB,qBAAqB;IACrB,kBAAkB;CACV,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,2BAA2B;IAC3B,0BAA0B;IAC1B,kBAAkB;IAClB,OAAO;IACP,KAAK;IACL,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../source/services/profiles/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAa7B,MAAM,MAAM,GAAG,CAAC,IAAY,EAAU,EAAE,CACtC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AAExF,oFAAoF;AACpF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,aAAa;IACb,WAAW;IACX,sBAAsB;IACtB,gBAAgB;IAChB,QAAQ;IACR,iBAAiB;IACjB,qBAAqB;IACrB,kBAAkB;CACV,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,2BAA2B;IAC3B,0BAA0B;IAC1B,kBAAkB;IAClB,OAAO;IACP,KAAK;IACL,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;IACd,KAAK;CACG,CAAC;AAEX,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,4BAA4B;IAC5B,oCAAoC;CAC5B,CAAC;AAEX,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,4BAA4B;IAC5B,qCAAqC;IACrC,6CAA6C;CACrC,CAAC;AAEX,MAAM,eAAe,GAAiB;IACpC,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,kBAAkB,CAAC,CAAC,GAA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gentSettingsSchema: z.ZodObject<{
|
|
|
151
151
|
none: "none";
|
|
152
152
|
xhigh: "xhigh";
|
|
153
153
|
}>>;
|
|
154
|
+
autoApproveDecisionShadowModel: z.ZodOptional<z.ZodString>;
|
|
154
155
|
subagentExplorerModel: z.ZodOptional<z.ZodString>;
|
|
155
156
|
subagentExplorerProvider: z.ZodOptional<z.ZodString>;
|
|
156
157
|
subagentExplorerReasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
@@ -565,6 +566,7 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
565
566
|
none: "none";
|
|
566
567
|
xhigh: "xhigh";
|
|
567
568
|
}>>;
|
|
569
|
+
autoApproveDecisionShadowModel: z.ZodOptional<z.ZodString>;
|
|
568
570
|
subagentExplorerModel: z.ZodOptional<z.ZodString>;
|
|
569
571
|
subagentExplorerProvider: z.ZodOptional<z.ZodString>;
|
|
570
572
|
subagentExplorerReasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
@@ -859,6 +861,7 @@ export interface SettingsWithSources {
|
|
|
859
861
|
autoApproveModel: SettingWithSource<string>;
|
|
860
862
|
autoApproveProvider: SettingWithSource<string | undefined>;
|
|
861
863
|
autoApproveReasoningEffort: SettingWithSource<string>;
|
|
864
|
+
autoApproveDecisionShadowModel: SettingWithSource<string | undefined>;
|
|
862
865
|
subagentExplorerModel: SettingWithSource<string | undefined>;
|
|
863
866
|
subagentExplorerProvider: SettingWithSource<string | undefined>;
|
|
864
867
|
subagentExplorerReasoningEffort: SettingWithSource<string | undefined>;
|
|
@@ -1080,6 +1083,7 @@ export declare const SETTING_KEYS: {
|
|
|
1080
1083
|
readonly AGENT_AUTO_APPROVE_MODEL: 'agent.autoApproveModel';
|
|
1081
1084
|
readonly AGENT_AUTO_APPROVE_PROVIDER: 'agent.autoApproveProvider';
|
|
1082
1085
|
readonly AGENT_AUTO_APPROVE_REASONING_EFFORT: 'agent.autoApproveReasoningEffort';
|
|
1086
|
+
readonly AGENT_AUTO_APPROVE_DECISION_SHADOW_MODEL: 'agent.autoApproveDecisionShadowModel';
|
|
1083
1087
|
readonly AGENT_SUBAGENT_EXPLORER_MODEL: 'agent.subagentExplorerModel';
|
|
1084
1088
|
readonly AGENT_SUBAGENT_EXPLORER_PROVIDER: 'agent.subagentExplorerProvider';
|
|
1085
1089
|
readonly AGENT_SUBAGENT_EXPLORER_REASONING_EFFORT: 'agent.subagentExplorerReasoningEffort';
|