mandala-computer-mcp 0.4.0 → 0.6.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/README.md +558 -29
- package/dist/api.d.ts +59 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +404 -33
- package/dist/api.js.map +1 -1
- package/dist/artifacts.d.ts +63 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +81 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +52 -21
- package/dist/cli.js.map +1 -1
- package/dist/credentials.d.ts +33 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +395 -0
- package/dist/credentials.js.map +1 -0
- package/dist/errors.d.ts +122 -11
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +237 -41
- package/dist/errors.js.map +1 -1
- package/dist/executions.d.ts +43 -0
- package/dist/executions.d.ts.map +1 -0
- package/dist/executions.js +162 -0
- package/dist/executions.js.map +1 -0
- package/dist/format.d.ts +33 -8
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +107 -12
- package/dist/format.js.map +1 -1
- package/dist/http.d.ts +42 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +383 -3
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +50 -2
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +65 -5
- package/dist/paths.js.map +1 -1
- package/dist/results.d.ts +97 -0
- package/dist/results.d.ts.map +1 -0
- package/dist/results.js +263 -0
- package/dist/results.js.map +1 -0
- package/dist/secret-errors.d.ts +59 -0
- package/dist/secret-errors.d.ts.map +1 -0
- package/dist/secret-errors.js +199 -0
- package/dist/secret-errors.js.map +1 -0
- package/dist/secret-store.d.ts +115 -0
- package/dist/secret-store.d.ts.map +1 -0
- package/dist/secret-store.js +105 -0
- package/dist/secret-store.js.map +1 -0
- package/dist/server.d.ts +3 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +60 -9
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +6 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +1 -1
- package/dist/session.js.map +1 -1
- package/dist/stdio.d.ts +5 -1
- package/dist/stdio.d.ts.map +1 -1
- package/dist/stdio.js +10 -4
- package/dist/stdio.js.map +1 -1
- package/dist/tool-filters.d.ts +38 -0
- package/dist/tool-filters.d.ts.map +1 -0
- package/dist/tool-filters.js +137 -0
- package/dist/tool-filters.js.map +1 -0
- package/dist/tools/account.d.ts +3 -0
- package/dist/tools/account.d.ts.map +1 -0
- package/dist/tools/account.js +122 -0
- package/dist/tools/account.js.map +1 -0
- package/dist/tools/activities.d.ts +3 -0
- package/dist/tools/activities.d.ts.map +1 -0
- package/dist/tools/activities.js +140 -0
- package/dist/tools/activities.js.map +1 -0
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/agent.js +21 -9
- package/dist/tools/agent.js.map +1 -1
- package/dist/tools/artifacts.d.ts +3 -0
- package/dist/tools/artifacts.d.ts.map +1 -0
- package/dist/tools/artifacts.js +97 -0
- package/dist/tools/artifacts.js.map +1 -0
- package/dist/tools/chat.d.ts +6 -0
- package/dist/tools/chat.d.ts.map +1 -0
- package/dist/tools/chat.js +192 -0
- package/dist/tools/chat.js.map +1 -0
- package/dist/tools/computers.d.ts.map +1 -1
- package/dist/tools/computers.js +28 -16
- package/dist/tools/computers.js.map +1 -1
- package/dist/tools/directory.d.ts +13 -0
- package/dist/tools/directory.d.ts.map +1 -0
- package/dist/tools/directory.js +88 -0
- package/dist/tools/directory.js.map +1 -0
- package/dist/tools/executions.d.ts +3 -0
- package/dist/tools/executions.d.ts.map +1 -0
- package/dist/tools/executions.js +87 -0
- package/dist/tools/executions.js.map +1 -0
- package/dist/tools/guest.d.ts.map +1 -1
- package/dist/tools/guest.js +184 -35
- package/dist/tools/guest.js.map +1 -1
- package/dist/tools/input.d.ts +2 -0
- package/dist/tools/input.d.ts.map +1 -1
- package/dist/tools/input.js +31 -5
- package/dist/tools/input.js.map +1 -1
- package/dist/tools/results.d.ts +30 -0
- package/dist/tools/results.d.ts.map +1 -0
- package/dist/tools/results.js +106 -0
- package/dist/tools/results.js.map +1 -0
- package/dist/tools/secrets.d.ts +78 -0
- package/dist/tools/secrets.d.ts.map +1 -0
- package/dist/tools/secrets.js +448 -0
- package/dist/tools/secrets.js.map +1 -0
- package/dist/tools/signals.d.ts +3 -0
- package/dist/tools/signals.d.ts.map +1 -0
- package/dist/tools/signals.js +116 -0
- package/dist/tools/signals.js.map +1 -0
- package/dist/tools/snapshots.d.ts.map +1 -1
- package/dist/tools/snapshots.js +52 -10
- package/dist/tools/snapshots.js.map +1 -1
- package/dist/tools/ssh.d.ts +3 -0
- package/dist/tools/ssh.d.ts.map +1 -0
- package/dist/tools/ssh.js +186 -0
- package/dist/tools/ssh.js.map +1 -0
- package/dist/tools/webhooks.js +1 -1
- package/dist/tools/webhooks.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The account's secret store, as the platform answers it (OPL-4984 part 2).
|
|
3
|
+
*
|
|
4
|
+
* A secret is a named value, encrypted when saved and never readable again: no
|
|
5
|
+
* route answers a value, so none of the shapes here has one. Computers are bound
|
|
6
|
+
* to secrets by id with `PUT computers/:id/secrets`; this is where those ids,
|
|
7
|
+
* and the revision a replace or delete needs, come from.
|
|
8
|
+
*
|
|
9
|
+
* Decoded strictly. Every field the published schema marks required is checked,
|
|
10
|
+
* and a decoded secret carries exactly those fields — so an answer that somehow
|
|
11
|
+
* held a `value` could not carry it any further than the decoder.
|
|
12
|
+
*/
|
|
13
|
+
/** One secret, without its value. */
|
|
14
|
+
export type Secret = {
|
|
15
|
+
/** `csec-` and sixteen hex characters: what a binding names as `secret_id`. */
|
|
16
|
+
id: string;
|
|
17
|
+
/** Unique within its scope. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** The workspace it belongs to, or `null` for one available account-wide. */
|
|
20
|
+
workspace_id: string | null;
|
|
21
|
+
/** Moves every time the value is replaced; a replace or delete sends back the one it read. */
|
|
22
|
+
revision_id: string;
|
|
23
|
+
created_at: string;
|
|
24
|
+
/** The last replace, or the create. */
|
|
25
|
+
updated_at: string;
|
|
26
|
+
/** When it was last delivered to a computer; `null` until it has been. */
|
|
27
|
+
last_used_at: string | null;
|
|
28
|
+
};
|
|
29
|
+
/** The store's limits, as `GET secrets` reports them. */
|
|
30
|
+
export type SecretLimits = {
|
|
31
|
+
name_max_chars: number;
|
|
32
|
+
value_max_bytes: number;
|
|
33
|
+
/** How many the account may hold at once, across every workspace. Deleting frees a place. */
|
|
34
|
+
active_per_account: number;
|
|
35
|
+
/** How many the account may ever create, deleted ones included. Deleting does not free one. */
|
|
36
|
+
created_per_account: number;
|
|
37
|
+
};
|
|
38
|
+
/** One scope's secrets, whether they can be bound here, and the limits. */
|
|
39
|
+
export type SecretList = {
|
|
40
|
+
secrets: Secret[];
|
|
41
|
+
/** Whether a secret can be bound to a computer on this platform; stored either way. */
|
|
42
|
+
delivery: boolean;
|
|
43
|
+
limits: SecretLimits;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The store's five calls, as `Api.secrets` offers them.
|
|
47
|
+
*
|
|
48
|
+
* `workspaceId` names the scope: left out, the account-wide secrets; a key
|
|
49
|
+
* confined to a workspace works in that workspace, and naming another is a 403.
|
|
50
|
+
*/
|
|
51
|
+
export interface SecretStore {
|
|
52
|
+
/** `GET secrets`: one scope's secrets, whether binding is on, and the limits. Never a value. */
|
|
53
|
+
list(opts?: {
|
|
54
|
+
workspaceId?: string;
|
|
55
|
+
}): Promise<SecretList>;
|
|
56
|
+
/**
|
|
57
|
+
* `POST secrets`: store a value under a name. Owners only; a taken name is a
|
|
58
|
+
* 409 and the store's two limits are 400s. `workspaceId: null` or left out is
|
|
59
|
+
* account-wide. NOT safe to repeat blind: a lost answer may be a secret that
|
|
60
|
+
* now exists — list before creating again.
|
|
61
|
+
*/
|
|
62
|
+
create(args: {
|
|
63
|
+
name: string;
|
|
64
|
+
value: string;
|
|
65
|
+
workspaceId?: string | null;
|
|
66
|
+
}): Promise<Secret>;
|
|
67
|
+
/** `GET secrets/:id`: one secret's name, scope and current revision, without its value. */
|
|
68
|
+
get(id: string, opts?: {
|
|
69
|
+
workspaceId?: string;
|
|
70
|
+
}): Promise<Secret>;
|
|
71
|
+
/**
|
|
72
|
+
* `PUT secrets/:id`: replace the value, conditional on `revisionId` — a stale
|
|
73
|
+
* one is a 409 and nothing changed. Answers the secret at its new revision.
|
|
74
|
+
* Owners only.
|
|
75
|
+
*/
|
|
76
|
+
replace(id: string, args: {
|
|
77
|
+
value: string;
|
|
78
|
+
revisionId: string;
|
|
79
|
+
workspaceId?: string | null;
|
|
80
|
+
}): Promise<Secret>;
|
|
81
|
+
/**
|
|
82
|
+
* `DELETE secrets/:id`: delete it, conditional on `revisionId` (required; a
|
|
83
|
+
* stale one is a 409 and nothing is deleted). Owners only. A computer still
|
|
84
|
+
* bound to it cannot be given its secrets again: its next start is refused.
|
|
85
|
+
*/
|
|
86
|
+
delete(id: string, args: {
|
|
87
|
+
revisionId: string;
|
|
88
|
+
workspaceId?: string;
|
|
89
|
+
}): Promise<void>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The refusal words the platform documents, and the only ones a secret-store
|
|
93
|
+
* refusal is allowed to carry through this package. Taken from the published
|
|
94
|
+
* `Error.reason` (contention, starting, unavailable, unsupported, exists,
|
|
95
|
+
* revoked) and the API-key ingress words beside it (missing, invalid).
|
|
96
|
+
*
|
|
97
|
+
* An allow-list rather than a shape check, because a shape check is exactly
|
|
98
|
+
* what a secret prefix passes: `sk-proj-abc…` cut to thirty-two characters is a
|
|
99
|
+
* perfectly word-like string (OPL-5026 review). Any other word is dropped, not
|
|
100
|
+
* shown — the status still says what kind of failure it was.
|
|
101
|
+
*/
|
|
102
|
+
export declare const DOCUMENTED_REASONS: ReadonlySet<string>;
|
|
103
|
+
/** Whether a string is a request id the platform could have minted. */
|
|
104
|
+
export declare const isRequestId: (v: unknown) => v is string;
|
|
105
|
+
/**
|
|
106
|
+
* Whether two strings share any run of four or more characters — the test for
|
|
107
|
+
* "this metadata may be a piece of that value". Used to drop even a documented
|
|
108
|
+
* word or a well-formed id that happens to overlap the value sent.
|
|
109
|
+
*/
|
|
110
|
+
export declare function overlaps(a: string, b: string, run?: number): boolean;
|
|
111
|
+
/** A secret, checked field by field, or `undefined`. Only the documented fields survive. */
|
|
112
|
+
export declare function secretOf(body: unknown): Secret | undefined;
|
|
113
|
+
/** A listing, checked: every secret in it, the delivery flag and all four limits, or `undefined`. */
|
|
114
|
+
export declare function secretListOf(body: unknown): SecretList | undefined;
|
|
115
|
+
//# sourceMappingURL=secret-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-store.d.ts","sourceRoot":"","sources":["../src/secret-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,qCAAqC;AACrC,MAAM,MAAM,MAAM,GAAG;IACnB,+EAA+E;IAC/E,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,8FAA8F;IAC9F,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF,yDAAyD;AACzD,MAAM,MAAM,YAAY,GAAG;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,6F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kBAAkB,EAAE,WAAW,CAAC,MAAM,CASjD,CAAC;AAQH,uEAAuE;AACvE,eAAO,MAAM,WAAW,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,MAAqD,CAAC;AAEpG;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,SAAI,GAAG,OAAO,CAQ/D;AAWD,4FAA4F;AAC5F,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAS1D;AAED,qGAAqG;AACrG,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAwBlE"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The account's secret store, as the platform answers it (OPL-4984 part 2).
|
|
3
|
+
*
|
|
4
|
+
* A secret is a named value, encrypted when saved and never readable again: no
|
|
5
|
+
* route answers a value, so none of the shapes here has one. Computers are bound
|
|
6
|
+
* to secrets by id with `PUT computers/:id/secrets`; this is where those ids,
|
|
7
|
+
* and the revision a replace or delete needs, come from.
|
|
8
|
+
*
|
|
9
|
+
* Decoded strictly. Every field the published schema marks required is checked,
|
|
10
|
+
* and a decoded secret carries exactly those fields — so an answer that somehow
|
|
11
|
+
* held a `value` could not carry it any further than the decoder.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The refusal words the platform documents, and the only ones a secret-store
|
|
15
|
+
* refusal is allowed to carry through this package. Taken from the published
|
|
16
|
+
* `Error.reason` (contention, starting, unavailable, unsupported, exists,
|
|
17
|
+
* revoked) and the API-key ingress words beside it (missing, invalid).
|
|
18
|
+
*
|
|
19
|
+
* An allow-list rather than a shape check, because a shape check is exactly
|
|
20
|
+
* what a secret prefix passes: `sk-proj-abc…` cut to thirty-two characters is a
|
|
21
|
+
* perfectly word-like string (OPL-5026 review). Any other word is dropped, not
|
|
22
|
+
* shown — the status still says what kind of failure it was.
|
|
23
|
+
*/
|
|
24
|
+
export const DOCUMENTED_REASONS = new Set([
|
|
25
|
+
'contention',
|
|
26
|
+
'starting',
|
|
27
|
+
'unavailable',
|
|
28
|
+
'unsupported',
|
|
29
|
+
'exists',
|
|
30
|
+
'revoked',
|
|
31
|
+
'missing',
|
|
32
|
+
'invalid',
|
|
33
|
+
]);
|
|
34
|
+
/**
|
|
35
|
+
* A request id in the platform's own format: a random UUID, which is all it
|
|
36
|
+
* mints (callers' ids are ignored). Anything else is not repeated.
|
|
37
|
+
*/
|
|
38
|
+
const REQUEST_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
39
|
+
/** Whether a string is a request id the platform could have minted. */
|
|
40
|
+
export const isRequestId = (v) => typeof v === 'string' && REQUEST_ID.test(v);
|
|
41
|
+
/**
|
|
42
|
+
* Whether two strings share any run of four or more characters — the test for
|
|
43
|
+
* "this metadata may be a piece of that value". Used to drop even a documented
|
|
44
|
+
* word or a well-formed id that happens to overlap the value sent.
|
|
45
|
+
*/
|
|
46
|
+
export function overlaps(a, b, run = 4) {
|
|
47
|
+
if (!a || !b)
|
|
48
|
+
return false;
|
|
49
|
+
const [short, long] = a.length <= b.length ? [a, b] : [b, a];
|
|
50
|
+
if (short.length < run)
|
|
51
|
+
return long.includes(short);
|
|
52
|
+
for (let i = 0; i + run <= short.length; i++) {
|
|
53
|
+
if (long.includes(short.slice(i, i + run)))
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
const isRecord = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
59
|
+
/** An id or timestamp as the platform spells one: not empty, nothing around it. */
|
|
60
|
+
const isToken = (v) => typeof v === 'string' && v !== '' && v.trim() === v;
|
|
61
|
+
const isCount = (v) => typeof v === 'number' && Number.isSafeInteger(v) && v >= 0;
|
|
62
|
+
/** A secret, checked field by field, or `undefined`. Only the documented fields survive. */
|
|
63
|
+
export function secretOf(body) {
|
|
64
|
+
if (!isRecord(body))
|
|
65
|
+
return undefined;
|
|
66
|
+
const { id, name, workspace_id, revision_id, created_at, updated_at, last_used_at } = body;
|
|
67
|
+
if (!isToken(id) || !isToken(revision_id))
|
|
68
|
+
return undefined;
|
|
69
|
+
if (typeof name !== 'string' || name === '')
|
|
70
|
+
return undefined;
|
|
71
|
+
if (workspace_id !== null && !isToken(workspace_id))
|
|
72
|
+
return undefined;
|
|
73
|
+
if (!isToken(created_at) || !isToken(updated_at))
|
|
74
|
+
return undefined;
|
|
75
|
+
if (last_used_at !== null && !isToken(last_used_at))
|
|
76
|
+
return undefined;
|
|
77
|
+
return { id, name, workspace_id, revision_id, created_at, updated_at, last_used_at };
|
|
78
|
+
}
|
|
79
|
+
/** A listing, checked: every secret in it, the delivery flag and all four limits, or `undefined`. */
|
|
80
|
+
export function secretListOf(body) {
|
|
81
|
+
if (!isRecord(body))
|
|
82
|
+
return undefined;
|
|
83
|
+
const { secrets, delivery, limits } = body;
|
|
84
|
+
if (!Array.isArray(secrets) || typeof delivery !== 'boolean' || !isRecord(limits))
|
|
85
|
+
return undefined;
|
|
86
|
+
const { name_max_chars, value_max_bytes, active_per_account, created_per_account } = limits;
|
|
87
|
+
if (!isCount(name_max_chars) ||
|
|
88
|
+
!isCount(value_max_bytes) ||
|
|
89
|
+
!isCount(active_per_account) ||
|
|
90
|
+
!isCount(created_per_account))
|
|
91
|
+
return undefined;
|
|
92
|
+
const out = [];
|
|
93
|
+
for (const row of secrets) {
|
|
94
|
+
const secret = secretOf(row);
|
|
95
|
+
if (!secret)
|
|
96
|
+
return undefined;
|
|
97
|
+
out.push(secret);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
secrets: out,
|
|
101
|
+
delivery,
|
|
102
|
+
limits: { name_max_chars, value_max_bytes, active_per_account, created_per_account },
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
//# sour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mcp.js';
|
|
2
2
|
import { type SessionConfig } from './session.js';
|
|
3
|
+
import { type ToolFilters } from './tool-filters.js';
|
|
3
4
|
import type { ToolOptions } from './tools/types.js';
|
|
4
5
|
export declare const SERVER_NAME = "mandala-computer";
|
|
5
|
-
export declare const SERVER_VERSION = "0.
|
|
6
|
-
export type ServerConfig = SessionConfig & Partial<ToolOptions> & {
|
|
6
|
+
export declare const SERVER_VERSION = "0.6.0";
|
|
7
|
+
export type ServerConfig = SessionConfig & ToolFilters & Partial<ToolOptions> & {
|
|
7
8
|
/** Internal HTTP hook: hold a session active for the real tool callback lifetime. */
|
|
8
9
|
activity?: () => () => void;
|
|
9
10
|
};
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQpE,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,KAAK,WAAW,EAAc,MAAM,mBAAmB,CAAC;AAkBjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAC9C,eAAO,MAAM,cAAc,UAAU,CAAC;AA6CtC,MAAM,MAAM,YAAY,GAAG,aAAa,GACtC,WAAW,GACX,OAAO,CAAC,WAAW,CAAC,GAAG;IACrB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEJ;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,YAAY,GAAG,SAAS,CAmFzD"}
|
package/dist/server.js
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from '@modelcontextprotocol/sdk/types.js';
|
|
2
3
|
import { Session } from './session.js';
|
|
4
|
+
import { toolFilter } from './tool-filters.js';
|
|
5
|
+
import { registerAccount } from './tools/account.js';
|
|
6
|
+
import { registerActivities } from './tools/activities.js';
|
|
3
7
|
import { registerAgent } from './tools/agent.js';
|
|
8
|
+
import { registerArtifacts } from './tools/artifacts.js';
|
|
9
|
+
import { registerChat } from './tools/chat.js';
|
|
4
10
|
import { registerComputers } from './tools/computers.js';
|
|
11
|
+
import { registerDirectory } from './tools/directory.js';
|
|
5
12
|
import { registerEvents } from './tools/events.js';
|
|
13
|
+
import { registerExecutions } from './tools/executions.js';
|
|
6
14
|
import { registerGuest } from './tools/guest.js';
|
|
7
15
|
import { registerInput } from './tools/input.js';
|
|
16
|
+
import { registerResults } from './tools/results.js';
|
|
17
|
+
import { registerSecrets } from './tools/secrets.js';
|
|
18
|
+
import { registerSignals } from './tools/signals.js';
|
|
8
19
|
import { registerSnapshots } from './tools/snapshots.js';
|
|
20
|
+
import { registerSSH } from './tools/ssh.js';
|
|
9
21
|
import { registerTemplates } from './tools/templates.js';
|
|
10
22
|
import { registerWebhooks } from './tools/webhooks.js';
|
|
11
23
|
export const SERVER_NAME = 'mandala-computer';
|
|
12
|
-
export const SERVER_VERSION = '0.
|
|
24
|
+
export const SERVER_VERSION = '0.6.0';
|
|
13
25
|
/**
|
|
14
26
|
* Told to the client on connect, and shown to the model before any tool is
|
|
15
27
|
* called. It is the only place to say the things that are true of the whole
|
|
@@ -43,6 +55,13 @@ Things that are true here and are not obvious:
|
|
|
43
55
|
- Who you are is checked again while a call is in flight, not only when it starts, so a long call can be refused after part of its work is already done. A 401 or a 403 means the credential or the role behind it stopped being accepted: re-authenticate, or say what was refused. Do not resend it, and never resend one that creates, starts, moves, writes or deletes without first checking what took effect. A 402 is the plan as it stands now rather than a fault on the computer, and waiting does not change it. Any of the three can arrive with completed work attached — read that before deciding what is left to do.
|
|
44
56
|
- A 409 is not one thing, and retrying blindly is how a turn gets burned. Most describe a passing state and clear on their own: a guest still booting, a guest agent busy with another call. Some describe a DECISION about what you asked for — a size the host cannot run, a computer that has to be stopped first — and those answer the same way forever; the message says which, and usually says what to do instead. A 400 never clears.
|
|
45
57
|
- Growing a computer past what its host can run is the refusal worth knowing by name: update_computer says a move is possible, and move_computer is how you take that up. It moves the machine to different hardware and copies its disk, so say what it costs before you call it.`;
|
|
58
|
+
const filteredInstructions = `Mandala Computer gives you access to a Linux desktop in the cloud.
|
|
59
|
+
|
|
60
|
+
This session exposes a filtered set of tools. Use only the tools in its tool list; some desktop workflows may be unavailable. Pass computer_id explicitly on computer-specific calls unless a computer was already bound to this session. A running VM does not imply that its guest desktop is ready.
|
|
61
|
+
|
|
62
|
+
Read each available tool's description before calling it. Read-only access follows the tool's readOnlyHint annotation: a read that can resume or bill a computer is not read-only. A running computer still costs money, and passive observation does not prevent idle suspension.
|
|
63
|
+
|
|
64
|
+
Who you are is checked again while a call is in flight. A 401 or 403 means the credential or role stopped being accepted; a 402 means the current plan refuses the work. Do not resend these calls. Inspect any completed work attached before deciding what remains. A 409 may describe either a temporary condition or a decision that will not change on retry; read its message. A 400 never clears.`;
|
|
46
65
|
/**
|
|
47
66
|
* One MCP server over one account's API key.
|
|
48
67
|
*
|
|
@@ -51,16 +70,24 @@ Things that are true here and are not obvious:
|
|
|
51
70
|
* transport builds exactly one and that is the same thing with n=1.
|
|
52
71
|
*/
|
|
53
72
|
export function createServer(cfg) {
|
|
73
|
+
const filter = toolFilter(cfg);
|
|
54
74
|
const session = new Session(cfg);
|
|
55
75
|
const opts = { lifecycle: cfg.lifecycle ?? true };
|
|
56
|
-
const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION }, {
|
|
76
|
+
const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION }, {
|
|
77
|
+
capabilities: { logging: {}, tools: {} },
|
|
78
|
+
instructions: filter.filtered ? filteredInstructions : instructions(opts.lifecycle),
|
|
79
|
+
});
|
|
57
80
|
// A cancelled Streamable HTTP response can let transport.handleRequest()
|
|
58
81
|
// settle while the tool callback is still awaiting platform work. Wrap tool
|
|
59
82
|
// registration once so the HTTP session lease follows that real lifetime.
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
83
|
+
// Withheld tools never reach the SDK registry or acquire an activity lease.
|
|
84
|
+
const register = server.registerTool.bind(server);
|
|
85
|
+
let registered = false;
|
|
86
|
+
server.registerTool = ((...args) => {
|
|
87
|
+
const [name, config] = args;
|
|
88
|
+
if (!filter.allows(name, config.annotations))
|
|
89
|
+
return;
|
|
90
|
+
if (cfg.activity) {
|
|
64
91
|
const handlerIndex = args.length - 1;
|
|
65
92
|
const handler = args[handlerIndex];
|
|
66
93
|
args[handlerIndex] = async (...handlerArgs) => {
|
|
@@ -72,17 +99,41 @@ export function createServer(cfg) {
|
|
|
72
99
|
release?.();
|
|
73
100
|
}
|
|
74
101
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
102
|
+
}
|
|
103
|
+
if (!registered) {
|
|
104
|
+
server.server.removeRequestHandler('tools/list');
|
|
105
|
+
server.server.removeRequestHandler('tools/call');
|
|
106
|
+
}
|
|
107
|
+
const tool = register(...args);
|
|
108
|
+
registered = true;
|
|
109
|
+
return tool;
|
|
110
|
+
});
|
|
111
|
+
registerAccount(server, session, opts);
|
|
78
112
|
registerComputers(server, session, opts);
|
|
79
113
|
registerInput(server, session, opts);
|
|
80
114
|
registerGuest(server, session, opts);
|
|
115
|
+
registerExecutions(server, session, opts);
|
|
116
|
+
registerResults(server, session, opts);
|
|
117
|
+
registerArtifacts(server, session, opts);
|
|
81
118
|
registerSnapshots(server, session, opts);
|
|
82
119
|
registerTemplates(server, session, opts);
|
|
83
120
|
registerEvents(server, session, opts);
|
|
84
121
|
registerWebhooks(server, session, opts);
|
|
122
|
+
registerSSH(server, session, opts);
|
|
123
|
+
registerSecrets(server, session, opts);
|
|
85
124
|
registerAgent(server, session, opts);
|
|
125
|
+
registerDirectory(server, session, opts);
|
|
126
|
+
registerActivities(server, session, opts);
|
|
127
|
+
registerSignals(server, session, opts);
|
|
128
|
+
registerChat(server, session, opts);
|
|
129
|
+
// The SDK installs tool handlers on the first registration. An empty
|
|
130
|
+
// selection still needs a valid tools/list response and must refuse calls.
|
|
131
|
+
if (!registered) {
|
|
132
|
+
server.server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: [] }));
|
|
133
|
+
server.server.setRequestHandler(CallToolRequestSchema, () => {
|
|
134
|
+
throw new McpError(ErrorCode.InvalidParams, 'No tools are available in this session');
|
|
135
|
+
});
|
|
136
|
+
}
|
|
86
137
|
// The event sockets outlive every tool call by design (OPL-3926), so nothing
|
|
87
138
|
// in a tool can be the thing that closes them. This is the end of the
|
|
88
139
|
// session, which is the lifetime they actually have — without it an HTTP
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAsB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE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CAAC,CAAC,CAAC;QAC/E,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,GAAG,EAAE;YAC1D,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,aAAa,EAAE,wCAAwC,CAAC,CAAC;QACxF,CAAC,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,sEAAsE;IACtE,yEAAyE;IACzE,yEAAyE;IACzE,kDAAkD;IAClD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;IACrC,MAAM,CAAC,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE;QAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC1B,MAAM,EAAE,EAAE,CAAC;IACb,CAAC,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/session.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Api } from './api.js';
|
|
1
|
+
import { Api, type ApiOptions } from './api.js';
|
|
2
2
|
import { EventHub, type EventSocketFactory } from './events.js';
|
|
3
3
|
export type SessionConfig = {
|
|
4
4
|
apiKey: string;
|
|
@@ -21,6 +21,11 @@ export type SessionConfig = {
|
|
|
21
21
|
* in for by replacing the global.
|
|
22
22
|
*/
|
|
23
23
|
webSocket?: EventSocketFactory;
|
|
24
|
+
/**
|
|
25
|
+
* What the hosted transport adds to this session's platform requests: the
|
|
26
|
+
* service header, and the hook that hears a refused bearer. See ApiOptions.
|
|
27
|
+
*/
|
|
28
|
+
platform?: ApiOptions;
|
|
24
29
|
};
|
|
25
30
|
/**
|
|
26
31
|
* One MCP session's state: whose account, and which computer.
|
package/dist/session.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAoB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":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oFAAoF;IACpF,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IA8BhC,oEAAoE;IACpE,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;IAI7D;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM;CAUnC"}
|
package/dist/session.js
CHANGED
|
@@ -30,7 +30,7 @@ export class Session {
|
|
|
30
30
|
/** Bound so a long-lived stdio session cannot grow one entry per deleted id. */
|
|
31
31
|
static #MAX_SELECTION_VERSIONS = 256;
|
|
32
32
|
constructor(cfg) {
|
|
33
|
-
this.api = new Api(cfg.apiKey, cfg.baseUrl ?? DEFAULT_BASE_URL);
|
|
33
|
+
this.api = new Api(cfg.apiKey, cfg.baseUrl ?? DEFAULT_BASE_URL, undefined, cfg.platform);
|
|
34
34
|
this.events = new EventHub(this.api, cfg.webSocket);
|
|
35
35
|
this.modelKey = cfg.modelKey;
|
|
36
36
|
this.#current = id(cfg.computerId);
|
package/dist/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAA2B,MAAM,aAAa,CAAC;AA8BhE;;;;;;;GAOG;AACH,MAAM,OAAO,OAAO;IACT,GAAG,CAAM;IAClB;;;;;;OAMG;IACM,MAAM,CAAW;IACjB,QAAQ,CAAU;IAC3B,QAAQ,CAAU;IAClB,+EAA+E;IAC/E,OAAO,CAAU;IACjB,iFAAiF;IACxE,kBAAkB,GAAG,IAAI,GAA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AM,IAAI,YAAY,CACpB,4EAA4E;gBAC1E,mEAAmE,CACtE,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;;AAGH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAS,EAAE,CAAC,KAAyB;IACnC,MAAM,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC;IACxB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3B,CAAC"}
|
package/dist/stdio.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type ServerConfig } from './server.js';
|
|
2
|
+
export type StdioConfig = Omit<ServerConfig, 'apiKey'> & {
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
profile?: string;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* The local install: one process, one key, spawned by the MCP client.
|
|
4
8
|
*
|
|
@@ -7,5 +11,5 @@ import { type ServerConfig } from './server.js';
|
|
|
7
11
|
* here may ever write to stdout: that stream is the protocol, and one stray
|
|
8
12
|
* console.log is a parse error at the other end. Diagnostics go to stderr.
|
|
9
13
|
*/
|
|
10
|
-
export declare function runStdio(cfg
|
|
14
|
+
export declare function runStdio(cfg?: StdioConfig): Promise<void>;
|
|
11
15
|
//# sourceMappingURL=stdio.d.ts.map
|
package/dist/stdio.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../src/stdio.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAE9D;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../src/stdio.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAE9D,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/F;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,GAAG,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCnE"}
|
package/dist/stdio.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
2
|
-
import {
|
|
2
|
+
import { resolveCredentials } from './credentials.js';
|
|
3
3
|
import { createServer } from './server.js';
|
|
4
4
|
/**
|
|
5
5
|
* The local install: one process, one key, spawned by the MCP client.
|
|
@@ -9,8 +9,14 @@ import { createServer } from './server.js';
|
|
|
9
9
|
* here may ever write to stdout: that stream is the protocol, and one stray
|
|
10
10
|
* console.log is a parse error at the other end. Diagnostics go to stderr.
|
|
11
11
|
*/
|
|
12
|
-
export async function runStdio(cfg) {
|
|
13
|
-
const
|
|
12
|
+
export async function runStdio(cfg = {}) {
|
|
13
|
+
const credentials = resolveCredentials(cfg);
|
|
14
|
+
const resolved = {
|
|
15
|
+
...cfg,
|
|
16
|
+
apiKey: credentials.apiKey,
|
|
17
|
+
baseUrl: credentials.baseUrl,
|
|
18
|
+
};
|
|
19
|
+
const server = createServer(resolved);
|
|
14
20
|
const transport = new StdioServerTransport();
|
|
15
21
|
await server.connect(transport);
|
|
16
22
|
// The end of the client, and therefore the end of this process.
|
|
@@ -38,6 +44,6 @@ export async function runStdio(cfg) {
|
|
|
38
44
|
const shutdown = () => void server.close().catch(() => { });
|
|
39
45
|
process.stdin.once('end', shutdown);
|
|
40
46
|
process.stdin.once('close', shutdown);
|
|
41
|
-
console.error(`mandala-computer-mcp on stdio → ${new URL(
|
|
47
|
+
console.error(`mandala-computer-mcp on stdio → ${new URL(credentials.baseUrl).origin}`);
|
|
42
48
|
}
|
|
43
49
|
//# sourceMappingURL=stdio.js.map
|
package/dist/stdio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../src/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../src/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAqB,MAAM,aAAa,CAAC;AAI9D;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,MAAmB,EAAE;IAClD,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAiB;QAC7B,GAAG,GAAG;QACN,MAAM,EAAE,WAAW,CAAC,MAAM;QAC1B,OAAO,EAAE,WAAW,CAAC,OAAO;KAC7B,CAAC;IACF,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,gEAAgE;IAChE,EAAE;IACF,+EAA+E;IAC/E,4EAA4E;IAC5E,6EAA6E;IAC7E,uEAAuE;IACvE,oEAAoE;IACpE,+EAA+E;IAC/E,iCAAiC;IACjC,EAAE;IACF,yEAAyE;IACzE,+EAA+E;IAC/E,4EAA4E;IAC5E,2EAA2E;IAC3E,2EAA2E;IAC3E,+DAA+D;IAC/D,EAAE;IACF,8EAA8E;IAC9E,4EAA4E;IAC5E,yEAAyE;IACzE,0EAA0E;IAC1E,qBAAqB;IACrB,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC3D,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACpC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACtC,OAAO,CAAC,KAAK,CAAC,mCAAmC,IAAI,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
/** Tags describe capabilities, not whether calling a tool is safe. */
|
|
3
|
+
export declare const TOOL_TAGS: {
|
|
4
|
+
readonly account: readonly ["get_account"];
|
|
5
|
+
readonly agent: readonly ["run_agent", "run_agent_chat"];
|
|
6
|
+
readonly activities: readonly ["list_activities", "get_activity", "get_activity_results"];
|
|
7
|
+
readonly signals: readonly ["read_signals"];
|
|
8
|
+
readonly artifacts: readonly ["publish_artifact", "get_artifact", "read_artifact", "delete_artifact"];
|
|
9
|
+
readonly computers: readonly ["list_computers", "get_computer", "use_computer", "wait_for_computer", "get_desktop_url", "list_sizes"];
|
|
10
|
+
readonly events: readonly ["wait_for_event", "poll_events", "wait_for_file_change"];
|
|
11
|
+
readonly executions: readonly ["get_execution", "read_execution_output"];
|
|
12
|
+
readonly files: readonly ["list_directory", "read_file", "write_file", "wait_for_file_change"];
|
|
13
|
+
readonly guest: readonly ["exec", "exec_poll", "exec_kill", "open_url", "list_windows", "window_action", "read_clipboard", "write_clipboard"];
|
|
14
|
+
readonly input: readonly ["screenshot", "click", "type_text", "press_key", "scroll", "drag", "move_mouse", "mouse_button", "cursor_position", "wait"];
|
|
15
|
+
readonly lifecycle: readonly ["create_computer", "start_computer", "stop_computer", "suspend_computer", "restart_computer", "update_computer", "clone_computer", "delete_computer", "move_computer", "list_moves"];
|
|
16
|
+
readonly results: readonly ["get_activity_results", "retain_execution_output", "get_result", "read_result_output", "delete_result"];
|
|
17
|
+
readonly snapshots: readonly ["list_snapshots", "snapshot_holdings", "create_snapshot", "restore_snapshot", "clone_snapshot", "snapshot_schedule", "get_retention", "delete_snapshot"];
|
|
18
|
+
readonly templates: readonly ["list_templates", "get_template_schema", "check_template", "publish_template", "get_template", "retire_template", "build_template", "list_builds", "get_build", "watch_build"];
|
|
19
|
+
readonly secrets: readonly ["get_computer_secrets", "set_computer_secrets", "list_secrets", "get_secret", "create_secret", "replace_secret", "delete_secret"];
|
|
20
|
+
readonly ssh: readonly ["list_ssh_keys", "add_ssh_key", "remove_ssh_key", "get_computer_ssh", "set_computer_ssh"];
|
|
21
|
+
readonly usage: readonly ["get_usage"];
|
|
22
|
+
readonly webhooks: readonly ["list_webhooks", "create_webhook", "get_webhook", "update_webhook", "rotate_webhook_secret", "test_webhook", "list_webhook_deliveries", "delete_webhook"];
|
|
23
|
+
};
|
|
24
|
+
export type ToolTag = keyof typeof TOOL_TAGS;
|
|
25
|
+
export type ToolFilters = {
|
|
26
|
+
/** Keep only tools whose existing readOnlyHint is exactly true. */
|
|
27
|
+
readOnly?: boolean;
|
|
28
|
+
/** Union of these tags; absent or empty means all tags. Names are lowercase. */
|
|
29
|
+
tags?: readonly string[];
|
|
30
|
+
};
|
|
31
|
+
export declare const VALID_TAGS: ToolTag[];
|
|
32
|
+
export declare function parseToolTags(raw: string | undefined): ToolTag[];
|
|
33
|
+
/** Validate before constructing the session; never infer read-only from a name or verb. */
|
|
34
|
+
export declare function toolFilter(cfg: ToolFilters): {
|
|
35
|
+
filtered: boolean;
|
|
36
|
+
allows: (name: string, annotations?: ToolAnnotations) => boolean;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=tool-filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-filters.d.ts","sourceRoot":"","sources":["../src/tool-filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAE1E,sEAAsE;AACtE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAqGZ,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,SAAS,CAAC;AAC7C,MAAM,MAAM,WAAW,GAAG;IACxB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gFAAgF;IAChF,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAoC,OAAO,EAAE,CAAC;AAcrE,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,EAAE,CAEhE;AAED,2FAA2F;AAC3F,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC;CAClE,CAmBA"}
|