mandala-computer-mcp 0.5.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.
Files changed (66) hide show
  1. package/README.md +119 -11
  2. package/dist/api.d.ts +47 -1
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js +248 -22
  5. package/dist/api.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +17 -0
  8. package/dist/cli.js.map +1 -1
  9. package/dist/errors.d.ts +93 -2
  10. package/dist/errors.d.ts.map +1 -1
  11. package/dist/errors.js +166 -7
  12. package/dist/errors.js.map +1 -1
  13. package/dist/format.d.ts +25 -0
  14. package/dist/format.d.ts.map +1 -1
  15. package/dist/format.js +31 -2
  16. package/dist/format.js.map +1 -1
  17. package/dist/http.d.ts +42 -0
  18. package/dist/http.d.ts.map +1 -1
  19. package/dist/http.js +379 -3
  20. package/dist/http.js.map +1 -1
  21. package/dist/index.d.ts +4 -3
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +3 -3
  24. package/dist/index.js.map +1 -1
  25. package/dist/paths.d.ts +10 -2
  26. package/dist/paths.d.ts.map +1 -1
  27. package/dist/paths.js +15 -5
  28. package/dist/paths.js.map +1 -1
  29. package/dist/secret-errors.d.ts +59 -0
  30. package/dist/secret-errors.d.ts.map +1 -0
  31. package/dist/secret-errors.js +199 -0
  32. package/dist/secret-errors.js.map +1 -0
  33. package/dist/secret-store.d.ts +115 -0
  34. package/dist/secret-store.d.ts.map +1 -0
  35. package/dist/secret-store.js +105 -0
  36. package/dist/secret-store.js.map +1 -0
  37. package/dist/server.d.ts +1 -1
  38. package/dist/server.js +1 -1
  39. package/dist/session.d.ts +6 -1
  40. package/dist/session.d.ts.map +1 -1
  41. package/dist/session.js +1 -1
  42. package/dist/session.js.map +1 -1
  43. package/dist/tool-filters.d.ts +1 -1
  44. package/dist/tool-filters.d.ts.map +1 -1
  45. package/dist/tool-filters.js +9 -1
  46. package/dist/tool-filters.js.map +1 -1
  47. package/dist/tools/computers.d.ts.map +1 -1
  48. package/dist/tools/computers.js +11 -10
  49. package/dist/tools/computers.js.map +1 -1
  50. package/dist/tools/guest.d.ts.map +1 -1
  51. package/dist/tools/guest.js +134 -20
  52. package/dist/tools/guest.js.map +1 -1
  53. package/dist/tools/input.d.ts +2 -0
  54. package/dist/tools/input.d.ts.map +1 -1
  55. package/dist/tools/input.js +31 -5
  56. package/dist/tools/input.js.map +1 -1
  57. package/dist/tools/secrets.d.ts +33 -13
  58. package/dist/tools/secrets.d.ts.map +1 -1
  59. package/dist/tools/secrets.js +259 -15
  60. package/dist/tools/secrets.js.map +1 -1
  61. package/dist/tools/snapshots.d.ts.map +1 -1
  62. package/dist/tools/snapshots.js +9 -3
  63. package/dist/tools/snapshots.js.map +1 -1
  64. package/dist/tools/webhooks.js +1 -1
  65. package/dist/tools/webhooks.js.map +1 -1
  66. package/package.json +1 -1
@@ -0,0 +1,199 @@
1
+ /**
2
+ * The one way an error leaves the Api from a secret-store route (OPL-5026).
3
+ *
4
+ * A request to `secrets` or `secrets/:id` may carry a secret value, and every
5
+ * piece of a response is text the other end chose: a refusal's sentence, a
6
+ * reason, a header, a redirect's Location, the text of a transport failure. A
7
+ * filter per field kept leaking through the next field nobody had filtered, so
8
+ * instead every error raised for these routes — an HTTP refusal, a redirect, a
9
+ * malformed answer, a network failure, a cancellation, anything else — is
10
+ * REBUILT here before it is thrown, from a short list of things that cannot
11
+ * carry a value:
12
+ *
13
+ * - the numeric status and the request's method;
14
+ * - a `reason` that is exactly one of the documented words;
15
+ * - a request id in the platform's own UUID format, from the header;
16
+ * - an `Allow` that is a comma list of HTTP method names.
17
+ *
18
+ * Everything else is dropped: `Location`, `WWW-Authenticate`, the body, the
19
+ * original message and any `cause`. Each kind of error gets a fixed message
20
+ * that names the route pattern (never the id) and the method. As a last layer,
21
+ * a kept field that shares four or more characters with the value sent is
22
+ * dropped too.
23
+ *
24
+ * The class is kept — a 404 is still a {@link NotFoundError}, a 409 a
25
+ * {@link ConflictError}, a lost answer a {@link ConnectivityInterruptedError} —
26
+ * so `instanceof` and {@link isTransient} answer as they would have.
27
+ */
28
+ import { APIError, AuthenticationError, CancelledError, ConflictError, ConnectivityError, ConnectivityInterruptedError, CreateOnlyConflictError, FileExistsError, GatewayTimeoutError, MandalaError, MethodNotAllowedError, MoveRequiredError, NotFoundError, OriginResponseError, OriginTLSError, OriginUnreachableError, PermissionDeniedError, PlanLimitError, RangeNotSatisfiableError, RateLimitError, RedirectError, UnavailableError, } from './errors.js';
29
+ import { DOCUMENTED_REASONS, isRequestId, overlaps } from './secret-store.js';
30
+ /** A secret store answer that arrived and is not the documented shape. */
31
+ export class MalformedSecretAnswerError extends MandalaError {
32
+ name = 'MalformedSecretAnswerError';
33
+ }
34
+ const METHOD_TOKENS = new Set([
35
+ 'GET',
36
+ 'HEAD',
37
+ 'POST',
38
+ 'PUT',
39
+ 'PATCH',
40
+ 'DELETE',
41
+ 'OPTIONS',
42
+ ]);
43
+ /** An `Allow` value made only of HTTP method names, comma-separated. */
44
+ export function isAllowList(v) {
45
+ if (typeof v !== 'string' || v.trim() === '')
46
+ return false;
47
+ return v.split(',').every((t) => METHOD_TOKENS.has(t.trim()));
48
+ }
49
+ /** Errors already rebuilt here, so a second pass leaves them alone. */
50
+ const SANITIZED = new WeakSet();
51
+ /**
52
+ * The store route a canonical path (relative to the API root, no leading
53
+ * slash, percent-decoded) names, or `undefined`. Case-insensitive, because
54
+ * treating a path that is not the store as if it were costs a plainer error
55
+ * message and nothing else, while the reverse leaks.
56
+ */
57
+ export function secretRouteOf(canonical) {
58
+ const parts = canonical.toLowerCase().split('/').filter(Boolean);
59
+ if (parts[0] !== 'secrets')
60
+ return undefined;
61
+ if (parts.length === 1)
62
+ return 'secrets';
63
+ // Anything deeper is the store too, conservatively: an id carrying an
64
+ // encoded slash decodes into extra segments, and the platform has no other
65
+ // route under `secrets`, so sanitizing a descendant costs nothing.
66
+ return 'secrets/:id';
67
+ }
68
+ /** Whether a path is one of the account's secret store routes, as written. */
69
+ export function isSecretStoreRoute(path) {
70
+ try {
71
+ return secretRouteOf(decodeURIComponent(path.split('?')[0])) !== undefined;
72
+ }
73
+ catch {
74
+ return true;
75
+ }
76
+ }
77
+ /**
78
+ * The secret a request carries, read without letting anything escape: a
79
+ * getter that throws, a proxy, anything that is not a plain string is no value.
80
+ */
81
+ export function secretValueOf(read) {
82
+ try {
83
+ const body = read();
84
+ if (body === null || typeof body !== 'object')
85
+ return typeof body === 'string' ? body : undefined;
86
+ const v = body.value;
87
+ return typeof v === 'string' ? v : undefined;
88
+ }
89
+ catch {
90
+ return undefined;
91
+ }
92
+ }
93
+ /**
94
+ * The error classes a secret-route error keeps, by the constructor that made
95
+ * it. Kept by CLASS, independently of which of its fields survive redaction,
96
+ * so {@link isTransient} gives the same answer after as before — a 409 `exists`
97
+ * whose reason overlaps the value is still a FileExistsError.
98
+ */
99
+ const KEPT_CLASSES = new Set([
100
+ APIError,
101
+ AuthenticationError,
102
+ PlanLimitError,
103
+ PermissionDeniedError,
104
+ NotFoundError,
105
+ MethodNotAllowedError,
106
+ ConflictError,
107
+ FileExistsError,
108
+ CreateOnlyConflictError,
109
+ RateLimitError,
110
+ UnavailableError,
111
+ GatewayTimeoutError,
112
+ OriginUnreachableError,
113
+ RedirectError,
114
+ OriginResponseError,
115
+ OriginTLSError,
116
+ ]);
117
+ /**
118
+ * The error to throw in place of `err`, for a request to a secret-store route.
119
+ *
120
+ * `value` reads the secret the request carried, if any; it is read here, under
121
+ * this function's own guard. Never throws: if anything goes wrong while
122
+ * rebuilding, the answer is a fixed error carrying the status and method only.
123
+ */
124
+ export function sanitizeSecretError(err, method, route, value = () => undefined) {
125
+ const verb = safeVerb(method);
126
+ const where = `${verb} /${route}`;
127
+ let status;
128
+ try {
129
+ if (err !== null && typeof err === 'object' && SANITIZED.has(err))
130
+ return err;
131
+ if (err instanceof APIError && Number.isInteger(err.status))
132
+ status = err.status;
133
+ const secret = secretValueOf(value);
134
+ const out = rebuild(err, verb, where, secret);
135
+ SANITIZED.add(out);
136
+ return out;
137
+ }
138
+ catch {
139
+ const out = status === undefined
140
+ ? new MandalaError(`${where} failed (details not shown).`)
141
+ : new APIError(`${where} was answered HTTP ${status} (details not shown).`, status, undefined, undefined, {
142
+ method: verb,
143
+ });
144
+ SANITIZED.add(out);
145
+ return out;
146
+ }
147
+ }
148
+ function safeVerb(method) {
149
+ try {
150
+ const v = String(method).toUpperCase();
151
+ return /^[A-Z]{1,10}$/.test(v) ? v : 'REQUEST';
152
+ }
153
+ catch {
154
+ return 'REQUEST';
155
+ }
156
+ }
157
+ function rebuild(err, verb, where, value) {
158
+ const change = verb !== 'GET' && verb !== 'HEAD';
159
+ const mayHave = change
160
+ ? ' THE CHANGE MAY HAVE BEEN MADE — read the secret back before sending it again.'
161
+ : '';
162
+ const keep = (v) => v === undefined || (value !== undefined && value !== '' && overlaps(v, value)) ? undefined : v;
163
+ if (err instanceof APIError) {
164
+ const status = err.status;
165
+ const reason = typeof err.reason === 'string' && DOCUMENTED_REASONS.has(err.reason)
166
+ ? keep(err.reason)
167
+ : undefined;
168
+ // No Retry-After, no body, no header text beyond these three, no cause.
169
+ const meta = {
170
+ requestId: isRequestId(err.requestId) ? keep(err.requestId) : undefined,
171
+ allow: isAllowList(err.allow) ? keep(err.allow) : undefined,
172
+ method: verb,
173
+ };
174
+ const body = reason === undefined ? undefined : { reason };
175
+ const said = err instanceof RedirectError
176
+ ? `${where} was answered HTTP ${status}, a redirect this client does not follow; check MANDALA_BASE_URL. The response is not shown.`
177
+ : `${where} was answered HTTP ${status}. The response is not shown, because a secret-store response could echo the value.`;
178
+ if (err instanceof RangeNotSatisfiableError)
179
+ return new RangeNotSatisfiableError(said, status, body, undefined, undefined, meta);
180
+ if (err instanceof MoveRequiredError)
181
+ return new MoveRequiredError(said, status, body, err.movePossible === true, undefined, meta);
182
+ const Ctor = KEPT_CLASSES.has(err.constructor)
183
+ ? err.constructor
184
+ : APIError;
185
+ return new Ctor(said, status, body, undefined, meta);
186
+ }
187
+ if (err instanceof MalformedSecretAnswerError)
188
+ return new MalformedSecretAnswerError(`${where} answered with something that is not the documented secret shape (not shown).${mayHave}`);
189
+ if (err instanceof CancelledError)
190
+ return new CancelledError(`${where} was cancelled before its answer arrived.${change ? ' The change may have been made.' : ''}`);
191
+ if (err instanceof ConnectivityInterruptedError)
192
+ return new ConnectivityInterruptedError(`${where}: the connection was lost before the answer arrived.${mayHave}`);
193
+ if (err instanceof ConnectivityError)
194
+ return new ConnectivityError(`${where}: the platform could not be reached.`);
195
+ if (err instanceof MandalaError)
196
+ return new MandalaError(`${where}: the answer could not be read (not shown).${mayHave}`);
197
+ return new MandalaError(`${where} failed inside this client (details not shown).${mayHave}`);
198
+ }
199
+ //# sourceMappingURL=secret-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret-errors.js","sourceRoot":"","sources":["../src/secret-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,4BAA4B,EAC5B,uBAAuB,EACvB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,aAAa,EACb,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE9E,0EAA0E;AAC1E,MAAM,OAAO,0BAA2B,SAAQ,YAAY;IACjD,IAAI,GAAG,4BAA4B,CAAC;CAC9C;AAED,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC;IACjD,KAAK;IACL,MAAM;IACN,MAAM;IACN,K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AAS,EAAE,IAAI,CAAC,CAAC;QAC/F,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC;YAC5C,CAAC,CAAE,GAAG,CAAC,WAA+B;YACtC,CAAC,CAAC,QAAQ,CAAC;QACb,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IACD,IAAI,GAAG,YAAY,0BAA0B;QAC3C,OAAO,IAAI,0BAA0B,CACnC,GAAG,KAAK,gFAAgF,OAAO,EAAE,CAClG,CAAC;IACJ,IAAI,GAAG,YAAY,cAAc;QAC/B,OAAO,IAAI,cAAc,CACvB,GAAG,KAAK,4CAA4C,MAAM,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,EAAE,EAAE,CACtG,CAAC;IACJ,IAAI,GAAG,YAAY,4BAA4B;QAC7C,OAAO,IAAI,4BAA4B,CACrC,GAAG,KAAK,uDAAuD,OAAO,EAAE,CACzE,CAAC;IACJ,IAAI,GAAG,YAAY,iBAAiB;QAClC,OAAO,IAAI,iBAAiB,CAAC,GAAG,KAAK,sCAAsC,CAAC,CAAC;IAC/E,IAAI,GAAG,YAAY,YAAY;QAC7B,OAAO,IAAI,YAAY,CAAC,GAAG,KAAK,8CAA8C,OAAO,EAAE,CAAC,CAAC;IAC3F,OAAO,IAAI,YAAY,CAAC,GAAG,KAAK,kDAAkD,OAAO,EAAE,CAAC,CAAC;AAC/F,CAAC"}
@@ -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 +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CAAC;IAC5F,2FAA2F;IAC3F,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE;;;;OAIG;IACH,OAAO,CACL,EAAE,EAAE,MAAM,EACV,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GACvE,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvF;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,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
+ //# sourceMappingURL=secret-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret-store.js","sourceRoot":"","sources":["../src/secret-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAwEH;;;;;;;;;;GAUG;AACH,MA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AAa;IACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IACtC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,QAAQ,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC/E,OAAO,SAAS,CAAC;IACnB,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAC;IAC5F,IACE,CAAC,OAAO,CAAC,cAAc,CAAC;QACxB,CAAC,OAAO,CAAC,eAAe,CAAC;QACzB,CAAC,OAAO,CAAC,kBAAkB,CAAC;QAC5B,CAAC,OAAO,CAAC,mBAAmB,CAAC;QAE7B,OAAO,SAAS,CAAC;IACnB,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,CAAC,MAAM;YAAE,OAAO,SAAS,CAAC;QAC9B,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IACD,OAAO;QACL,OAAO,EAAE,GAAG;QACZ,QAAQ;QACR,MAAM,EAAE,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE;KACrF,CAAC;AACJ,CAAC"}
package/dist/server.d.ts CHANGED
@@ -3,7 +3,7 @@ import { type SessionConfig } from './session.js';
3
3
  import { type ToolFilters } from './tool-filters.js';
4
4
  import type { ToolOptions } from './tools/types.js';
5
5
  export declare const SERVER_NAME = "mandala-computer";
6
- export declare const SERVER_VERSION = "0.5.0";
6
+ export declare const SERVER_VERSION = "0.6.0";
7
7
  export type ServerConfig = SessionConfig & ToolFilters & Partial<ToolOptions> & {
8
8
  /** Internal HTTP hook: hold a session active for the real tool callback lifetime. */
9
9
  activity?: () => () => void;
package/dist/server.js CHANGED
@@ -21,7 +21,7 @@ import { registerSSH } from './tools/ssh.js';
21
21
  import { registerTemplates } from './tools/templates.js';
22
22
  import { registerWebhooks } from './tools/webhooks.js';
23
23
  export const SERVER_NAME = 'mandala-computer';
24
- export const SERVER_VERSION = '0.5.0';
24
+ export const SERVER_VERSION = '0.6.0';
25
25
  /**
26
26
  * Told to the client on connect, and shown to the model before any tool is
27
27
  * called. It is the only place to say the things that are true of the whole
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.
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAoB,MAAM,UAAU,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;CAChC,CAAC;AAEF;;;;;;;GAOG;AACH,qB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
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);
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAA2B,MAAM,aAAa,CAAC;AAyBhE;;;;;;;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,GAAG,EAAkB,CAAC;IACxD,6EAA6E;IACpE,cAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;IACpD,gFAAgF;IAChF,MAAM,CAAU,uBAAuB,GAAG,GAAG,CAAC;IAE9C,YAAY,GAAkB;QAC5B,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,IAAI,gBAAgB,CAAC,CAAC;QAChE,IAAI,CAAC,MAAM,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;QACpD,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAA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,QAAQ,IAAI,UAAU;YAAE,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC;IAChF,CAAC;IAED;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAiB;QACvB,MAAM,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC;QAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,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"}
@@ -16,7 +16,7 @@ export declare const TOOL_TAGS: {
16
16
  readonly results: readonly ["get_activity_results", "retain_execution_output", "get_result", "read_result_output", "delete_result"];
17
17
  readonly snapshots: readonly ["list_snapshots", "snapshot_holdings", "create_snapshot", "restore_snapshot", "clone_snapshot", "snapshot_schedule", "get_retention", "delete_snapshot"];
18
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"];
19
+ readonly secrets: readonly ["get_computer_secrets", "set_computer_secrets", "list_secrets", "get_secret", "create_secret", "replace_secret", "delete_secret"];
20
20
  readonly ssh: readonly ["list_ssh_keys", "add_ssh_key", "remove_ssh_key", "get_computer_ssh", "set_computer_ssh"];
21
21
  readonly usage: readonly ["get_usage"];
22
22
  readonly webhooks: readonly ["list_webhooks", "create_webhook", "get_webhook", "update_webhook", "rotate_webhook_secret", "test_webhook", "list_webhook_deliveries", "delete_webhook"];
@@ -1 +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;;;;;;;;;;;;;;;;;;;;CA6FZ,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"}
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"}
@@ -79,7 +79,15 @@ export const TOOL_TAGS = {
79
79
  'get_build',
80
80
  'watch_build',
81
81
  ],
82
- secrets: ['get_computer_secrets', 'set_computer_secrets'],
82
+ secrets: [
83
+ 'get_computer_secrets',
84
+ 'set_computer_secrets',
85
+ 'list_secrets',
86
+ 'get_secret',
87
+ 'create_secret',
88
+ 'replace_secret',
89
+ 'delete_secret',
90
+ ],
83
91
  ssh: ['list_ssh_keys', 'add_ssh_key', 'remove_ssh_key', 'get_computer_ssh', 'set_computer_ssh'],
84
92
  usage: ['get_usage'],
85
93
  webhooks: [
@@ -1 +1 @@
1
- {"version":3,"file":"tool-filters.js","sourceRoot":"","sources":["../src/tool-filters.ts"],"names":[],"mappings":"AAEA,sEAAsE;AACtE,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,KAAK,EAAE,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACtC,UAAU,EAAE,CAAC,iBAAiB,EAAE,cAAc,EAAE,sBAAsB,CAAC;IACvE,OAAO,EAAE,CAAC,cAAc,CAAC;IACzB,SAAS,EAAE,CAAC,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,CAAC;IACnF,SAAS,EAAE;QACT,gBAAgB;QAChB,cAAc;QACd,cAAc;QACd,mBAAmB;QACnB,iBAAiB;QACjB,YAAY;KACb;IACD,MAAM,EAAE,CAAC,gBAAgB,EAAE,aAAa,EAAE,sBAAsB,CAAC;IACjE,UAAU,EAAE,CAAC,eAAe,EAAE,uBAAuB,CAAC;IAC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EAAE,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC;IACvC,OAAO;QACL,QAAQ,EAAE,QAAQ,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;QACrC,MAAM,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE;YAC5B,yEAAyE;YACzE,0DAA0D;YAC1D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,2BAA2B,CAAC,CAAC;YAChF,OAAO,CACL,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,WAAW,EAAE,YAAY,KAAK,IAAI,CAAC,CAC1F,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"computers.d.ts","sourceRoot":"","sources":["../../src/tools/computers.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAiS5C,eAAO,MAAM,iBAAiB,EAAE,SAq4C/B,CAAC"}
1
+ {"version":3,"file":"computers.d.ts","sourceRoot":"","sources":["../../src/tools/computers.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAiS5C,eAAO,MAAM,iBAAiB,EAAE,SAs4C/B,CAAC"}