mandala-computer-mcp 0.3.0 → 0.4.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 (52) hide show
  1. package/README.md +12 -8
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/api.js +103 -28
  4. package/dist/api.js.map +1 -1
  5. package/dist/errors.d.ts +26 -3
  6. package/dist/errors.d.ts.map +1 -1
  7. package/dist/errors.js +54 -4
  8. package/dist/errors.js.map +1 -1
  9. package/dist/events.d.ts +11 -2
  10. package/dist/events.d.ts.map +1 -1
  11. package/dist/events.js +213 -95
  12. package/dist/events.js.map +1 -1
  13. package/dist/format.d.ts.map +1 -1
  14. package/dist/format.js +80 -3
  15. package/dist/format.js.map +1 -1
  16. package/dist/limits.d.ts +17 -0
  17. package/dist/limits.d.ts.map +1 -0
  18. package/dist/limits.js +17 -0
  19. package/dist/limits.js.map +1 -0
  20. package/dist/paths.d.ts +2 -2
  21. package/dist/paths.d.ts.map +1 -1
  22. package/dist/paths.js +4 -3
  23. package/dist/paths.js.map +1 -1
  24. package/dist/poll.d.ts +5 -1
  25. package/dist/poll.d.ts.map +1 -1
  26. package/dist/poll.js +120 -16
  27. package/dist/poll.js.map +1 -1
  28. package/dist/server.d.ts +1 -1
  29. package/dist/server.d.ts.map +1 -1
  30. package/dist/server.js +2 -1
  31. package/dist/server.js.map +1 -1
  32. package/dist/tools/agent.d.ts.map +1 -1
  33. package/dist/tools/agent.js +58 -3
  34. package/dist/tools/agent.js.map +1 -1
  35. package/dist/tools/computers.d.ts.map +1 -1
  36. package/dist/tools/computers.js +282 -240
  37. package/dist/tools/computers.js.map +1 -1
  38. package/dist/tools/events.d.ts.map +1 -1
  39. package/dist/tools/events.js +66 -22
  40. package/dist/tools/events.js.map +1 -1
  41. package/dist/tools/guest.js +7 -2
  42. package/dist/tools/guest.js.map +1 -1
  43. package/dist/tools/input.d.ts.map +1 -1
  44. package/dist/tools/input.js +63 -5
  45. package/dist/tools/input.js.map +1 -1
  46. package/dist/tools/snapshots.d.ts.map +1 -1
  47. package/dist/tools/snapshots.js +169 -159
  48. package/dist/tools/snapshots.js.map +1 -1
  49. package/dist/tools/templates.d.ts.map +1 -1
  50. package/dist/tools/templates.js +9 -13
  51. package/dist/tools/templates.js.map +1 -1
  52. package/package.json +1 -1
package/dist/poll.js CHANGED
@@ -90,7 +90,97 @@ export function heartbeat(extra, log, everyMs = HEARTBEAT_MS) {
90
90
  let spoken = false;
91
91
  let last = '';
92
92
  let at = 0;
93
- return async (line) => {
93
+ let current;
94
+ let timer;
95
+ let stopped = false;
96
+ let notifying = false;
97
+ let pendingNotification;
98
+ let logging = false;
99
+ let pendingLog;
100
+ const schedule = () => {
101
+ if (timer !== undefined)
102
+ clearTimeout(timer);
103
+ timer = undefined;
104
+ if (stopped || !spoken)
105
+ return;
106
+ timer = setTimeout(() => {
107
+ timer = undefined;
108
+ if (current !== undefined)
109
+ emit(current);
110
+ }, Math.max(0, everyMs - (Date.now() - at)));
111
+ timer.unref?.();
112
+ };
113
+ const notify = (line) => {
114
+ if (stopped || progressToken === undefined)
115
+ return;
116
+ if (notifying) {
117
+ // One latest frame is enough to catch up after a slow receiver. Keeping
118
+ // every timer tick would make the queue grow for as long as it was slow.
119
+ pendingNotification = line;
120
+ return;
121
+ }
122
+ notifying = true;
123
+ sent += 1;
124
+ let delivery;
125
+ try {
126
+ delivery = extra.sendNotification({
127
+ method: 'notifications/progress',
128
+ // `progress` is the count of notifications, which the SDK's
129
+ // ProgressSchema asks to increase every time. No `total`: a wait does
130
+ // not know how many turns it will take, and a total of 0 renders as a
131
+ // finished bar.
132
+ params: { progressToken, progress: sent, message: line },
133
+ });
134
+ }
135
+ catch {
136
+ delivery = Promise.resolve();
137
+ }
138
+ const finished = () => {
139
+ notifying = false;
140
+ if (stopped) {
141
+ pendingNotification = undefined;
142
+ return;
143
+ }
144
+ const pending = pendingNotification;
145
+ pendingNotification = undefined;
146
+ if (pending !== undefined)
147
+ notify(pending);
148
+ };
149
+ void delivery.then(finished, finished);
150
+ };
151
+ const writeLog = (line) => {
152
+ if (stopped || !log)
153
+ return;
154
+ if (logging) {
155
+ // Logging is useful to a person but cannot keep the MCP request alive.
156
+ // Keep its backlog bounded and, above all, keep it out of progress's way.
157
+ pendingLog = line;
158
+ return;
159
+ }
160
+ logging = true;
161
+ let delivery;
162
+ try {
163
+ delivery = log.sendLoggingMessage({ level: 'info', data: line });
164
+ }
165
+ catch {
166
+ delivery = Promise.resolve();
167
+ }
168
+ const finished = () => {
169
+ logging = false;
170
+ if (stopped) {
171
+ pendingLog = undefined;
172
+ return;
173
+ }
174
+ const pending = pendingLog;
175
+ pendingLog = undefined;
176
+ if (pending !== undefined)
177
+ writeLog(pending);
178
+ };
179
+ void delivery.then(finished, finished);
180
+ };
181
+ const emit = (line) => {
182
+ if (stopped)
183
+ return;
94
184
  const now = Date.now();
95
185
  // A changed line is news and goes out at once; an unchanged one is a
96
186
  // keepalive and goes out on the interval. `spoken` covers the first turn,
@@ -105,25 +195,39 @@ export function heartbeat(extra, log, everyMs = HEARTBEAT_MS) {
105
195
  // half-hour capture, which is the flood the comment above says is avoided.
106
196
  // The two are different questions — whether anything has been said, and how
107
197
  // many progress frames have gone out — and only the first gates this.
108
- if (spoken && line === last && now - at < everyMs)
198
+ // Rearmed rather than returned, because this is also the path a timer that
199
+ // fired early lands on. The timer callback has already cleared `timer`, and
200
+ // `schedule` is the only thing that sets another: returning here would end
201
+ // the keepalive for the rest of the operation on a wake that was a
202
+ // millisecond short of its own deadline, which libuv is entitled to deliver.
203
+ // That is the silence OPL-4743 repaired, reintroduced by the repair.
204
+ if (spoken && line === last && now - at < everyMs) {
205
+ schedule();
109
206
  return;
207
+ }
110
208
  spoken = true;
111
209
  last = line;
112
210
  at = now;
113
- if (progressToken !== undefined) {
114
- sent += 1;
115
- await extra
116
- .sendNotification({
117
- method: 'notifications/progress',
118
- // `progress` is the count of notifications, which the SDK's
119
- // ProgressSchema asks to increase every time. No `total`: a wait does
120
- // not know how many turns it will take, and a total of 0 renders as a
121
- // finished bar.
122
- params: { progressToken, progress: sent, message: line },
123
- })
124
- .catch(() => { });
125
- }
126
- await log?.sendLoggingMessage({ level: 'info', data: line }).catch(() => { });
211
+ notify(line);
212
+ writeLog(line);
213
+ schedule();
214
+ };
215
+ const beat = ((line) => {
216
+ if (stopped)
217
+ return Promise.resolve();
218
+ current = line;
219
+ emit(line);
220
+ return Promise.resolve();
221
+ });
222
+ beat.stop = () => {
223
+ stopped = true;
224
+ if (timer !== undefined)
225
+ clearTimeout(timer);
226
+ timer = undefined;
227
+ pendingNotification = undefined;
228
+ pendingLog = undefined;
229
+ return Promise.resolve();
127
230
  };
231
+ return beat;
128
232
  }
129
233
  //# sourceMappingURL=poll.js.map
package/dist/poll.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"poll.js","sourceRoot":"","sources":["../src/poll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,MAAoB,EAAE,EAAE,CACxD,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;IAC5B,IAAI,MAAM,EAAE,OAAO;QAAE,OAAO,OAAO,EAAE,CAAC;IACtC,MAAM,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC/B,SAAS,IAAI;QACX,YAAY,CAAC,CAAC,CAAC,CAAC;QAChB,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC3C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1D,CAAC,CAAC,CAAC;AAEL,gDAAgD;AAChD,MAAM,CAAC,MAAM,O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IAAI,IAAI,GAAG,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;YAClD,QAAQ,EAAE,CAAC;YACX,OAAO;QACT,CAAC;QACD,MAAM,GAAG,IAAI,CAAC;QACd,IAAI,GAAG,IAAI,CAAC;QACZ,EAAE,GAAG,GAAG,CAAC;QACT,MAAM,CAAC,IAAI,CAAC,CAAC;QACb,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC;IAEF,MAAM,IAAI,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE;QAC7B,IAAI,OAAO;YAAE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QACtC,OAAO,GAAG,IAAI,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,CAAC;QACX,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC,CAAc,CAAC;IAChB,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE;QACf,OAAO,GAAG,IAAI,CAAC;QACf,IAAI,KAAK,KAAK,SAAS;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;QAC7C,KAAK,GAAG,SAAS,CAAC;QAClB,mBAAmB,GAAG,SAAS,CAAC;QAChC,UAAU,GAAG,SAAS,CAAC;QACvB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
package/dist/server.d.ts CHANGED
@@ -2,7 +2,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { type SessionConfig } from './session.js';
3
3
  import type { ToolOptions } from './tools/types.js';
4
4
  export declare const SERVER_NAME = "mandala-computer";
5
- export declare const SERVER_VERSION = "0.3.0";
5
+ export declare const SERVER_VERSION = "0.4.0";
6
6
  export type ServerConfig = SessionConfig & Partial<ToolOptions> & {
7
7
  /** Internal HTTP hook: hold a session active for the real tool callback lifetime. */
8
8
  activity?: () => () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAC9C,eAAO,MAAM,cAAc,UAAU,CAAC;AAoCtC,MAAM,MAAM,YAAY,GAAG,aAAa,GACtC,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,CAmDzD"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAC9C,eAAO,MAAM,cAAc,UAAU,CAAC;AAqCtC,MAAM,MAAM,YAAY,GAAG,aAAa,GACtC,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,CAmDzD"}
package/dist/server.js CHANGED
@@ -9,7 +9,7 @@ import { registerSnapshots } from './tools/snapshots.js';
9
9
  import { registerTemplates } from './tools/templates.js';
10
10
  import { registerWebhooks } from './tools/webhooks.js';
11
11
  export const SERVER_NAME = 'mandala-computer';
12
- export const SERVER_VERSION = '0.3.0';
12
+ export const SERVER_VERSION = '0.4.0';
13
13
  /**
14
14
  * Told to the client on connect, and shown to the model before any tool is
15
15
  * called. It is the only place to say the things that are true of the whole
@@ -40,6 +40,7 @@ Things that are true here and are not obvious:
40
40
  - Waiting for a FILE is its own call, because a directory has to be nominated before the machine reports anything under it: wait_for_file_change takes an absolute directory in the guest, makes sure the guest is genuinely watching it, and then blocks until something under it is created, changed or deleted. Use it for a build's output or a download landing, in place of running ls in a loop. Nominate the narrowest directory you care about — a home directory under a build reports one "too much changed" marker instead of the changes — and read that marker as "list the directory again", not as a failure.
41
41
  - list_windows tells you what is on the screen as data. It is how you distinguish an application that failed to start from one that has not painted yet, which a screenshot alone cannot do.
42
42
  - A computer suspends itself when nobody uses it — 30 minutes by default. Input, exec and file transfers all count as use and resume it. Screenshots deliberately do not, so a loop that only watches can see its own machine go down.
43
+ - 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.
43
44
  - 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.
44
45
  - 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.`;
45
46
  /**
@@ -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;A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,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACzC,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACzC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACtC,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACxC,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAErC,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/tools/agent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,EAAE,SAqJ3B,CAAC"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/tools/agent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,EAAE,SAiK3B,CAAC"}
@@ -34,7 +34,7 @@ export const registerAgent = (server, session) => {
34
34
  .min(1)
35
35
  .max(100)
36
36
  .default(20)
37
- .describe('Each step is a model call plus a screenshot on your key, so this is a spending cap as much as a loop bound.'),
37
+ .describe('How many ACTIONS the loop may take on the desktop. Not a count of model calls and not a proxy for what your key is billed: one model reply can ask for several actions and spends a step on each, a paused turn is resubmitted for tokens and no step, and a bash call or a cursor read takes no screenshot. So a run can make more model calls than steps AND more steps than screenshots — bound the work with this, and budget the bill on the key itself. Defaults to 20 and is capped at 100 here, so a larger value is refused before the call rather than after it.'),
38
38
  },
39
39
  annotations: { openWorldHint: true },
40
40
  }, ({ computer_id, prompt, system, max_steps }, extra) => guarded(async () => {
@@ -60,7 +60,7 @@ export const registerAgent = (server, session) => {
60
60
  // shared/protocol.js resets a pending request's timer, and
61
61
  // `notifications/message` — what sendLoggingMessage emits — never
62
62
  // touches it. This tool had only the logging half, so a run of the
63
- // default 20 steps, each a model call plus a screenshot, sailed past
63
+ // default 20 steps, most of them a model call and a screenshot, sailed past
64
64
  // the client's 60s default and was cancelled while the platform went
65
65
  // on driving the desktop on the caller's own Anthropic key.
66
66
  //
@@ -122,7 +122,16 @@ export const registerAgent = (server, session) => {
122
122
  // level from a run that worked — a caller checking whether the step
123
123
  // succeeded would read this one as a success that happened to have
124
124
  // a discouraging sentence in it.
125
- return refused(`The run failed after ${steps.length} step(s).`, ev.data);
125
+ //
126
+ // And it has to say WHY in words, because this is the one place a
127
+ // status cannot be read off the response: the platform answered 200
128
+ // before the first step, so a run stopped by the credential, the role
129
+ // or the plan arrives as a frame in a successful stream. A model
130
+ // handed "the run failed" and a JSON blob does the natural thing,
131
+ // which is to call this tool again with the same prompt — paying for
132
+ // every completed step a second time to be refused the same way.
133
+ return refused(`The run failed after ${steps.length} step(s).${stopReason(ev.data)}` +
134
+ (steps.length ? `\n\nWhat it did, and is billed for:\n${steps.join('\n')}` : ''), ev.data);
126
135
  }
127
136
  }
128
137
  if (!done) {
@@ -155,5 +164,51 @@ export const registerAgent = (server, session) => {
155
164
  return stop === 'end_turn' ? said(result, done) : refused(result, done);
156
165
  }));
157
166
  };
167
+ /**
168
+ * What an `error` frame says about whether calling this tool again can work.
169
+ *
170
+ * Three of the statuses a run can stop on are about the CALLER rather than the
171
+ * computer — the credential stopped being accepted, the role or the account
172
+ * changed, the plan does not cover the work — and every one of them answers a
173
+ * second run the same way. They are also the three that can arrive with steps
174
+ * already completed and billed, which is what makes a retry expensive as well as
175
+ * useless. Each gets its own clause rather than one shared "auth" sentence: only
176
+ * the first is fixed by authenticating again, and telling the other two to try
177
+ * that is telling them to spend another run finding out it did not help.
178
+ *
179
+ * Anything else is left as the platform's own sentence. A run can fail for
180
+ * reasons that are worth another attempt, and inventing a verdict for a status
181
+ * this version has not been told about would be the same mistake in the other
182
+ * direction: the leading space is part of the returned clause so that an
183
+ * unclassified stop reads as one sentence rather than as a missing one.
184
+ */
185
+ function stopReason(data) {
186
+ const frame = isRecord(data) ? data : undefined;
187
+ const status = typeof frame?.status === 'number' ? frame.status : undefined;
188
+ const said = typeof frame?.error === 'string' && frame.error ? frame.error : undefined;
189
+ const why = said ? ` ${said}` : '';
190
+ // 401 and 403 are split, because the recovery is not the same one. A shared
191
+ // clause told a caller whose ROLE had been taken away to re-authenticate,
192
+ // which restores nothing and sends it round the same refusal with another
193
+ // prompt's worth of billed steps behind it (Codex review).
194
+ if (status === 401) {
195
+ return (` It was stopped because this server's credential is no longer accepted (HTTP ${status}) —` +
196
+ ` not by anything wrong with the computer.${why} Do NOT call run_agent again with the same` +
197
+ ` prompt: it is refused the same way until the credential is fixed. Once it is, read what` +
198
+ ` the steps below already did before deciding what is left to do.`);
199
+ }
200
+ if (status === 403) {
201
+ return (` It was stopped because this account does not permit the run (HTTP ${status}) — a role that` +
202
+ ` changed or an account suspended, not anything wrong with the computer.${why} Nothing you` +
203
+ ` can send changes that, and a new credential does not either: say what was refused and` +
204
+ ` stop, rather than calling run_agent again.`);
205
+ }
206
+ if (status === 402) {
207
+ return (` It was stopped by the plan on this account as it stands now (HTTP ${status}), not by` +
208
+ ` anything wrong with the computer.${why} Calling run_agent again does not change that;` +
209
+ ` say what was refused, and note that the steps below were still billed.`);
210
+ }
211
+ return why;
212
+ }
158
213
  const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
159
214
  //#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AC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IACvF,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACnC,4EAA4E;IAC5E,0EAA0E;IAC1E,0EAA0E;IAC1E,2DAA2D;IAC3D,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,CACL,gFAAgF,MAAM,KAAK;YAC3F,4CAA4C,GAAG,4CAA4C;YAC3F,0FAA0F;YAC1F,kEAAkE,CACnE,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,CACL,sEAAsE,MAAM,iBAAiB;YAC7F,0EAA0E,GAAG,cAAc;YAC3F,wFAAwF;YACxF,6CAA6C,CAC9C,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,CACL,sEAAsE,MAAM,WAAW;YACvF,qCAAqC,GAAG,gDAAgD;YACxF,yEAAyE,CAC1E,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"computers.d.ts","sourceRoot":"","sources":["../../src/tools/computers.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAiQ5C,eAAO,MAAM,iBAAiB,EAAE,SAo2C/B,CAAC"}
1
+ {"version":3,"file":"computers.d.ts","sourceRoot":"","sources":["../../src/tools/computers.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAiS5C,eAAO,MAAM,iBAAiB,EAAE,SAu3C/B,CAAC"}