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.
Files changed (128) hide show
  1. package/README.md +558 -29
  2. package/dist/api.d.ts +59 -1
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js +404 -33
  5. package/dist/api.js.map +1 -1
  6. package/dist/artifacts.d.ts +63 -0
  7. package/dist/artifacts.d.ts.map +1 -0
  8. package/dist/artifacts.js +81 -0
  9. package/dist/artifacts.js.map +1 -0
  10. package/dist/cli.d.ts +4 -0
  11. package/dist/cli.d.ts.map +1 -1
  12. package/dist/cli.js +52 -21
  13. package/dist/cli.js.map +1 -1
  14. package/dist/credentials.d.ts +33 -0
  15. package/dist/credentials.d.ts.map +1 -0
  16. package/dist/credentials.js +395 -0
  17. package/dist/credentials.js.map +1 -0
  18. package/dist/errors.d.ts +122 -11
  19. package/dist/errors.d.ts.map +1 -1
  20. package/dist/errors.js +237 -41
  21. package/dist/errors.js.map +1 -1
  22. package/dist/executions.d.ts +43 -0
  23. package/dist/executions.d.ts.map +1 -0
  24. package/dist/executions.js +162 -0
  25. package/dist/executions.js.map +1 -0
  26. package/dist/format.d.ts +33 -8
  27. package/dist/format.d.ts.map +1 -1
  28. package/dist/format.js +107 -12
  29. package/dist/format.js.map +1 -1
  30. package/dist/http.d.ts +42 -0
  31. package/dist/http.d.ts.map +1 -1
  32. package/dist/http.js +383 -3
  33. package/dist/http.js.map +1 -1
  34. package/dist/index.d.ts +5 -4
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +3 -3
  37. package/dist/index.js.map +1 -1
  38. package/dist/paths.d.ts +50 -2
  39. package/dist/paths.d.ts.map +1 -1
  40. package/dist/paths.js +65 -5
  41. package/dist/paths.js.map +1 -1
  42. package/dist/results.d.ts +97 -0
  43. package/dist/results.d.ts.map +1 -0
  44. package/dist/results.js +263 -0
  45. package/dist/results.js.map +1 -0
  46. package/dist/secret-errors.d.ts +59 -0
  47. package/dist/secret-errors.d.ts.map +1 -0
  48. package/dist/secret-errors.js +199 -0
  49. package/dist/secret-errors.js.map +1 -0
  50. package/dist/secret-store.d.ts +115 -0
  51. package/dist/secret-store.d.ts.map +1 -0
  52. package/dist/secret-store.js +105 -0
  53. package/dist/secret-store.js.map +1 -0
  54. package/dist/server.d.ts +3 -2
  55. package/dist/server.d.ts.map +1 -1
  56. package/dist/server.js +60 -9
  57. package/dist/server.js.map +1 -1
  58. package/dist/session.d.ts +6 -1
  59. package/dist/session.d.ts.map +1 -1
  60. package/dist/session.js +1 -1
  61. package/dist/session.js.map +1 -1
  62. package/dist/stdio.d.ts +5 -1
  63. package/dist/stdio.d.ts.map +1 -1
  64. package/dist/stdio.js +10 -4
  65. package/dist/stdio.js.map +1 -1
  66. package/dist/tool-filters.d.ts +38 -0
  67. package/dist/tool-filters.d.ts.map +1 -0
  68. package/dist/tool-filters.js +137 -0
  69. package/dist/tool-filters.js.map +1 -0
  70. package/dist/tools/account.d.ts +3 -0
  71. package/dist/tools/account.d.ts.map +1 -0
  72. package/dist/tools/account.js +122 -0
  73. package/dist/tools/account.js.map +1 -0
  74. package/dist/tools/activities.d.ts +3 -0
  75. package/dist/tools/activities.d.ts.map +1 -0
  76. package/dist/tools/activities.js +140 -0
  77. package/dist/tools/activities.js.map +1 -0
  78. package/dist/tools/agent.d.ts.map +1 -1
  79. package/dist/tools/agent.js +21 -9
  80. package/dist/tools/agent.js.map +1 -1
  81. package/dist/tools/artifacts.d.ts +3 -0
  82. package/dist/tools/artifacts.d.ts.map +1 -0
  83. package/dist/tools/artifacts.js +97 -0
  84. package/dist/tools/artifacts.js.map +1 -0
  85. package/dist/tools/chat.d.ts +6 -0
  86. package/dist/tools/chat.d.ts.map +1 -0
  87. package/dist/tools/chat.js +192 -0
  88. package/dist/tools/chat.js.map +1 -0
  89. package/dist/tools/computers.d.ts.map +1 -1
  90. package/dist/tools/computers.js +28 -16
  91. package/dist/tools/computers.js.map +1 -1
  92. package/dist/tools/directory.d.ts +13 -0
  93. package/dist/tools/directory.d.ts.map +1 -0
  94. package/dist/tools/directory.js +88 -0
  95. package/dist/tools/directory.js.map +1 -0
  96. package/dist/tools/executions.d.ts +3 -0
  97. package/dist/tools/executions.d.ts.map +1 -0
  98. package/dist/tools/executions.js +87 -0
  99. package/dist/tools/executions.js.map +1 -0
  100. package/dist/tools/guest.d.ts.map +1 -1
  101. package/dist/tools/guest.js +184 -35
  102. package/dist/tools/guest.js.map +1 -1
  103. package/dist/tools/input.d.ts +2 -0
  104. package/dist/tools/input.d.ts.map +1 -1
  105. package/dist/tools/input.js +31 -5
  106. package/dist/tools/input.js.map +1 -1
  107. package/dist/tools/results.d.ts +30 -0
  108. package/dist/tools/results.d.ts.map +1 -0
  109. package/dist/tools/results.js +106 -0
  110. package/dist/tools/results.js.map +1 -0
  111. package/dist/tools/secrets.d.ts +78 -0
  112. package/dist/tools/secrets.d.ts.map +1 -0
  113. package/dist/tools/secrets.js +448 -0
  114. package/dist/tools/secrets.js.map +1 -0
  115. package/dist/tools/signals.d.ts +3 -0
  116. package/dist/tools/signals.d.ts.map +1 -0
  117. package/dist/tools/signals.js +116 -0
  118. package/dist/tools/signals.js.map +1 -0
  119. package/dist/tools/snapshots.d.ts.map +1 -1
  120. package/dist/tools/snapshots.js +52 -10
  121. package/dist/tools/snapshots.js.map +1 -1
  122. package/dist/tools/ssh.d.ts +3 -0
  123. package/dist/tools/ssh.d.ts.map +1 -0
  124. package/dist/tools/ssh.js +186 -0
  125. package/dist/tools/ssh.js.map +1 -0
  126. package/dist/tools/webhooks.js +1 -1
  127. package/dist/tools/webhooks.js.map +1 -1
  128. package/package.json +1 -1
@@ -0,0 +1,263 @@
1
+ import { APIError, CancelledError } from './errors.js';
2
+ import { refused, withErrorMetadata } from './format.js';
3
+ export const RETAINED_OPERATION_MS = 90000;
4
+ export const PRESENTATION_DEFAULT = 4096, PRESENTATION_MAX = 16384, RETAINED_RESULT_MAX = 256 * 1024;
5
+ export class RetainedValueError extends Error {
6
+ constructor() {
7
+ super('Invalid or unsupported retained response or request.');
8
+ }
9
+ }
10
+ export const record = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
11
+ export const integer = (v, min = 0, max = Number.MAX_SAFE_INTEGER) => Number.isSafeInteger(v) && v >= min && v <= max;
12
+ export function requireValue(condition) {
13
+ if (!condition)
14
+ throw new RetainedValueError();
15
+ }
16
+ export const resultId = (v) => typeof v === 'string' && v.length === 36 && /^res_[a-f0-9]{32}$/.test(v);
17
+ export const executionId = (v) => typeof v === 'string' && v.length === 37 && /^exec_[a-f0-9]{32}$/.test(v);
18
+ export const scopeId = (v) => typeof v === 'string' && v.match(/^[A-Za-z0-9_-]{1,100}$/)?.[0] === v;
19
+ export const digest = (v) => typeof v === 'string' && v.length === 64 && /^[a-f0-9]{64}$/.test(v);
20
+ export function time(v) {
21
+ requireValue(typeof v === 'string' &&
22
+ v.endsWith('Z') &&
23
+ /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,9})?Z$/.test(v));
24
+ const parsed = Date.parse(v);
25
+ requireValue(Number.isFinite(parsed) && new Date(parsed).toISOString().slice(0, 19) === v.slice(0, 19));
26
+ return (BigInt(Math.floor(parsed / 1000)) * 1000000000n +
27
+ BigInt((v.split('.')[1]?.slice(0, -1) ?? '').padEnd(9, '0')));
28
+ }
29
+ export function retainOptions(v) {
30
+ requireValue(record(v) &&
31
+ Object.keys(v).every((k) => k === 'max_bytes_per_stream' || k === 'retention_seconds'));
32
+ const out = {};
33
+ if ('max_bytes_per_stream' in v) {
34
+ requireValue(integer(v.max_bytes_per_stream, 1, 4 * 1024 * 1024));
35
+ out.max_bytes_per_stream = v.max_bytes_per_stream;
36
+ }
37
+ if ('retention_seconds' in v) {
38
+ requireValue(integer(v.retention_seconds, 1, 604800));
39
+ out.retention_seconds = v.retention_seconds;
40
+ }
41
+ return out;
42
+ }
43
+ export function retainIntent(v, background) {
44
+ if (v === undefined || v === false)
45
+ return undefined;
46
+ requireValue(!background);
47
+ return v === true ? true : retainOptions(v);
48
+ }
49
+ export function resultMetadata(v, computer, id, execution, options) {
50
+ requireValue(record(v) &&
51
+ v.version === 1 &&
52
+ resultId(v.result_id) &&
53
+ (!id || v.result_id === id) &&
54
+ v.computer_id === computer &&
55
+ scopeId(v.computer_id) &&
56
+ scopeId(v.account_id) &&
57
+ (v.workspace_id === null || scopeId(v.workspace_id)) &&
58
+ v.state === 'ready');
59
+ const sync = v.kind === 'synchronous-output';
60
+ requireValue(sync || v.kind === 'background-output');
61
+ requireValue(sync
62
+ ? v.execution_id === null && v.source === 'exec_response'
63
+ : executionId(v.execution_id) && v.source === 'volatile_guest_files');
64
+ if (execution)
65
+ requireValue(!sync && v.execution_id === execution);
66
+ const start = time(v.capture_started_at), end = time(v.captured_at), expires = time(v.expires_at);
67
+ requireValue(end >= start && expires > end && expires - start <= 604800000000000n);
68
+ const o = v.execution_observation;
69
+ requireValue(record(o));
70
+ const observed = time(o.observed_at);
71
+ requireValue(observed >= start && observed <= end);
72
+ requireValue(o.status === 'exited'
73
+ ? integer(o.exit_code, -2147483648, 2147483647)
74
+ : !sync && o.status === 'running' && !('exit_code' in o));
75
+ const observation = {
76
+ status: o.status,
77
+ observed_at: o.observed_at,
78
+ ...(o.status === 'exited' ? { exit_code: o.exit_code } : {}),
79
+ };
80
+ const prefix = (p) => {
81
+ requireValue(record(p) &&
82
+ integer(p.bytes, 0, 4 * 1024 * 1024) &&
83
+ digest(p.sha256) &&
84
+ p.source_offset === 0 &&
85
+ p.next_source_offset === p.bytes);
86
+ if (sync)
87
+ requireValue(integer(p.source_response_bytes, p.bytes, 16 * 1024 * 1024) &&
88
+ typeof p.upstream_truncated === 'boolean' &&
89
+ p.end_reason === (p.bytes === p.source_response_bytes ? 'response_end' : 'byte_limit'));
90
+ else
91
+ requireValue(p.end_reason === 'observed_eof' || p.end_reason === 'byte_limit');
92
+ return {
93
+ bytes: p.bytes,
94
+ sha256: p.sha256,
95
+ source_offset: 0,
96
+ next_source_offset: p.bytes,
97
+ end_reason: p.end_reason,
98
+ ...(sync
99
+ ? {
100
+ source_response_bytes: p.source_response_bytes,
101
+ upstream_truncated: p.upstream_truncated,
102
+ }
103
+ : {}),
104
+ };
105
+ };
106
+ let diagnostic = null;
107
+ if (sync)
108
+ requireValue(v.diagnostic === null);
109
+ else {
110
+ const d = v.diagnostic;
111
+ requireValue(record(d) &&
112
+ integer(d.bytes, 0, 65536) &&
113
+ digest(d.sha256) &&
114
+ d.source === 'wrapper' &&
115
+ typeof d.diagnostic_truncated === 'boolean');
116
+ diagnostic = {
117
+ bytes: d.bytes,
118
+ sha256: d.sha256,
119
+ source: 'wrapper',
120
+ diagnostic_truncated: d.diagnostic_truncated,
121
+ };
122
+ }
123
+ if (options) {
124
+ requireValue(record(v.stdout) &&
125
+ record(v.stderr) &&
126
+ integer(v.stdout.bytes, 0, options.max_bytes_per_stream ?? 1048576) &&
127
+ integer(v.stderr.bytes, 0, options.max_bytes_per_stream ?? 1048576) &&
128
+ expires - start <= BigInt(options.retention_seconds ?? 86400) * 1000000000n);
129
+ }
130
+ return {
131
+ version: 1,
132
+ result_id: v.result_id,
133
+ kind: v.kind,
134
+ state: 'ready',
135
+ account_id: v.account_id,
136
+ computer_id: v.computer_id,
137
+ workspace_id: v.workspace_id,
138
+ execution_id: v.execution_id,
139
+ source: v.source,
140
+ capture_started_at: v.capture_started_at,
141
+ captured_at: v.captured_at,
142
+ expires_at: v.expires_at,
143
+ execution_observation: observation,
144
+ stdout: prefix(v.stdout),
145
+ stderr: prefix(v.stderr),
146
+ diagnostic,
147
+ };
148
+ }
149
+ export function resultQuery(stream, offset, limit = PRESENTATION_DEFAULT) {
150
+ requireValue(['stdout', 'stderr', 'diagnostic'].includes(stream) &&
151
+ integer(offset) &&
152
+ integer(limit, 1, PRESENTATION_MAX) &&
153
+ Number.isSafeInteger(offset + limit));
154
+ return { stream: stream, offset, limit };
155
+ }
156
+ export function binaryContent(bytes) {
157
+ try {
158
+ const text = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(bytes);
159
+ if (!bytes.some((byte) => byte === 127 || (byte < 32 && byte !== 9 && byte !== 10 && byte !== 13)) &&
160
+ Buffer.from(text, 'utf8').equals(Buffer.from(bytes)))
161
+ return { text };
162
+ }
163
+ catch {
164
+ /* exact binary follows */
165
+ }
166
+ return { base64: Buffer.from(bytes).toString('base64') };
167
+ }
168
+ export function resultPage(response, id, query) {
169
+ const h = response.headers, bytes = response.bytes;
170
+ const number = (name) => {
171
+ const raw = h[name];
172
+ requireValue(typeof raw === 'string' &&
173
+ /^(0|[1-9][0-9]*)$/.test(raw) &&
174
+ String(Number(raw)) === raw &&
175
+ integer(Number(raw)));
176
+ return Number(raw);
177
+ };
178
+ requireValue(h['content-type']?.split(';')[0].trim().toLowerCase() === 'application/octet-stream');
179
+ requireValue(number('content-length') === bytes.length &&
180
+ number('x-result-offset') === query.offset &&
181
+ number('x-result-next-offset') === query.offset + bytes.length &&
182
+ bytes.length <= query.limit);
183
+ requireValue(h['x-result-eof'] === 'true' || h['x-result-eof'] === 'false');
184
+ const eof = h['x-result-eof'] === 'true';
185
+ requireValue(eof || bytes.length === query.limit);
186
+ return {
187
+ result_id: id,
188
+ stream: query.stream,
189
+ offset: query.offset,
190
+ next_offset: query.offset + bytes.length,
191
+ eof,
192
+ bytes: bytes.length,
193
+ ...binaryContent(bytes),
194
+ };
195
+ }
196
+ /** One deadline for the whole callback, including metadata, bytes and presentation. */
197
+ export async function retainedCall(parent, mutation, fn) {
198
+ const controller = new AbortController(), abort = () => controller.abort(parent.reason);
199
+ parent.addEventListener('abort', abort, { once: true });
200
+ if (parent.aborted)
201
+ abort();
202
+ const timer = setTimeout(() => controller.abort(), RETAINED_OPERATION_MS), signal = controller.signal, end = performance.now() + RETAINED_OPERATION_MS;
203
+ try {
204
+ if (signal.aborted)
205
+ throw new CancelledError('cancelled');
206
+ const result = await fn(signal);
207
+ if (signal.aborted || performance.now() >= end)
208
+ throw new CancelledError('cancelled');
209
+ requireValue(Buffer.byteLength(JSON.stringify(result)) <= RETAINED_RESULT_MAX);
210
+ if (signal.aborted || performance.now() >= end)
211
+ throw new CancelledError('cancelled');
212
+ return result;
213
+ }
214
+ catch (error) {
215
+ const suffix = mutation
216
+ ? ' Publication or deletion may have committed; its response is unconfirmed. Do not repeat a capture or command to recover this answer.'
217
+ : ' No fallback or command replay was attempted.';
218
+ if (signal.aborted || error instanceof CancelledError)
219
+ return refused(`Retained operation cancelled.${suffix}`);
220
+ if (error instanceof APIError)
221
+ return withErrorMetadata(refused(`Retained operation failed (HTTP ${error.status}). Current authorization, availability or server support could not be confirmed.${suffix}`), error);
222
+ return refused(`Retained operation could not be completed or validated.${suffix}`);
223
+ }
224
+ finally {
225
+ clearTimeout(timer);
226
+ parent.removeEventListener('abort', abort);
227
+ controller.abort();
228
+ }
229
+ }
230
+ /** Optional metadata must never change an already executed command's interpretation. */
231
+ export function synchronousResultId(v, status) {
232
+ if (!record(v) ||
233
+ status !== 200 ||
234
+ !resultId(v.result_id) ||
235
+ v.timed_out !== false ||
236
+ !integer(v.exit_code, -2147483648, 2147483647) ||
237
+ typeof v.out_truncated !== 'boolean' ||
238
+ typeof v.err_truncated !== 'boolean')
239
+ return undefined;
240
+ for (const key of ['stdout_b64', 'stderr_b64']) {
241
+ const data = v[key];
242
+ if (typeof data !== 'string' || data.length > 22369624 || data.length % 4)
243
+ return undefined;
244
+ // Validate canonical padding without allocating the decoded large stream.
245
+ const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', pad = data.endsWith('==') ? 2 : data.endsWith('=') ? 1 : 0;
246
+ for (let i = 0; i < data.length - pad; i++) {
247
+ const c = data.charCodeAt(i);
248
+ if (!((c >= 65 && c <= 90) ||
249
+ (c >= 97 && c <= 122) ||
250
+ (c >= 48 && c <= 57) ||
251
+ c === 43 ||
252
+ c === 47))
253
+ return undefined;
254
+ }
255
+ if (pad &&
256
+ (data.length < 4 || alphabet.indexOf(data[data.length - pad - 1]) & (pad === 2 ? 15 : 3)))
257
+ return undefined;
258
+ if ((data.length / 4) * 3 - pad > 16 * 1024 * 1024)
259
+ return undefined;
260
+ }
261
+ return v.result_id;
262
+ }
263
+ //# sourceMappingURL=results.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"results.js","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,EACtC,gBAAgB,GAAG,KAAK,EACxB,mBAAmB,GAAG,GAAG,GAAG,IAAI,CAAC;AACnC,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C;QACE,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAChE,CAAC;CACF;AACD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAU,EAAgC,EAAE,CACjE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACpD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAU,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,gBAAgB,EAAe,EAAE,CACzF,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAK,CAAY,IAAI,GAAG,IAAK,CAAY,IAAI,GAAG,CAAC;AAC1E,MAAM,UAAU,YAAY,CAAC,SAAkB;IAC7C,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,kBAAkB,EAAE,CAAC;AACjD,CAAC;AACD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAe,EAAE,CACl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AAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7B,IACE,CAAC,CACC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;gBACpB,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC;gBACrB,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;gBACpB,CAAC,KAAK,EAAE;gBACR,CAAC,KAAK,EAAE,CACT;gBAED,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,IACE,GAAG;YACH,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAEzF,OAAO,SAAS,CAAC;QACnB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI;YAAE,OAAO,SAAS,CAAC;IACvE,CAAC;IACD,OAAO,CAAC,CAAC,SAAS,CAAC;AACrB,CAAC"}
@@ -0,0 +1,59 @@
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 { MandalaError } from './errors.js';
29
+ /** A secret store answer that arrived and is not the documented shape. */
30
+ export declare class MalformedSecretAnswerError extends MandalaError {
31
+ name: string;
32
+ }
33
+ /** An `Allow` value made only of HTTP method names, comma-separated. */
34
+ export declare function isAllowList(v: unknown): v is string;
35
+ /** Which of the two store routes a canonical relative path names. */
36
+ export type SecretRoute = 'secrets' | 'secrets/:id';
37
+ /**
38
+ * The store route a canonical path (relative to the API root, no leading
39
+ * slash, percent-decoded) names, or `undefined`. Case-insensitive, because
40
+ * treating a path that is not the store as if it were costs a plainer error
41
+ * message and nothing else, while the reverse leaks.
42
+ */
43
+ export declare function secretRouteOf(canonical: string): SecretRoute | undefined;
44
+ /** Whether a path is one of the account's secret store routes, as written. */
45
+ export declare function isSecretStoreRoute(path: string): boolean;
46
+ /**
47
+ * The secret a request carries, read without letting anything escape: a
48
+ * getter that throws, a proxy, anything that is not a plain string is no value.
49
+ */
50
+ export declare function secretValueOf(read: () => unknown): string | undefined;
51
+ /**
52
+ * The error to throw in place of `err`, for a request to a secret-store route.
53
+ *
54
+ * `value` reads the secret the request carried, if any; it is read here, under
55
+ * this function's own guard. Never throws: if anything goes wrong while
56
+ * rebuilding, the answer is a fixed error carrying the status and method only.
57
+ */
58
+ export declare function sanitizeSecretError(err: unknown, method: string, route: SecretRoute, value?: () => unknown): Error;
59
+ //# sourceMappingURL=secret-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret-errors.d.ts","sourceRoot":"","sources":["../src/secret-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAUL,YAAY,EAab,MAAM,aAAa,CAAC;AAGrB,0EAA0E;AAC1E,qBAAa,0BAA2B,SAAQ,YAAY;IACjD,IAAI,SAAgC;CAC9C;AAYD,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAGnD;AAKD,qEAAqE;AACrE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,aAAa,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAQxE;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMxD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,OAAO,GAAG,MAAM,GAAG,SAAS,CAUrE;AA2BD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,WAAW,EAClB,KAAK,GAAE,MAAM,OAAyB,GACrC,KAAK,CA2BP"}
@@ -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,iBAAi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