sim 2.2.32 → 2.2.33-preview.316.1

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 (35) hide show
  1. package/README.md +42 -0
  2. package/THIRD_PARTY_LICENSES +31 -0
  3. package/dist/auth/refresh.d.ts +2 -1
  4. package/dist/commands/protocol/files-get.d.ts +3 -0
  5. package/dist/commands/protocol/result.d.ts +7 -1
  6. package/dist/commands/protocol/source-dir.d.ts +263 -0
  7. package/dist/commands/protocol/source-exit-codes.d.ts +8 -0
  8. package/dist/commands/protocol/source-primer.d.ts +14 -0
  9. package/dist/commands/protocol/source-status.d.ts +145 -0
  10. package/dist/commands/protocol/source-tree.d.ts +159 -0
  11. package/dist/commands/protocol/source-ui.d.ts +89 -0
  12. package/dist/commands/protocol/stored-edges.d.ts +44 -0
  13. package/dist/commands/protocol/workflow-source-apply.d.ts +38 -0
  14. package/dist/commands/protocol/workflow-source-check.d.ts +70 -0
  15. package/dist/commands/protocol/workflow-source-get.d.ts +40 -0
  16. package/dist/commands/protocol/workflow-source-params.d.ts +7 -0
  17. package/dist/commands/protocol/workflow-source-status.d.ts +14 -0
  18. package/dist/commands/protocol/workspace-source-apply.d.ts +15 -0
  19. package/dist/commands/protocol/workspace-source-blobs.d.ts +111 -0
  20. package/dist/commands/protocol/workspace-source-check.d.ts +7 -0
  21. package/dist/commands/protocol/workspace-source-dir.d.ts +135 -0
  22. package/dist/commands/protocol/workspace-source-get.d.ts +13 -0
  23. package/dist/commands/protocol/workspace-source-status.d.ts +13 -0
  24. package/dist/embed-context.d.ts +6 -3
  25. package/dist/exit-codes.d.ts +66 -0
  26. package/dist/generated/v2-api.d.ts +1297 -1
  27. package/dist/http/client.d.ts +22 -0
  28. package/dist/index.js +58843 -20211
  29. package/dist/output/io.d.ts +6 -0
  30. package/dist/program.d.ts +1 -1
  31. package/dist/runtime.js +59083 -20451
  32. package/dist/terminal/interrupts.d.ts +23 -0
  33. package/dist/terminal/line-input.d.ts +8 -0
  34. package/dist/terminal.d.ts +1 -0
  35. package/package.json +5 -1
@@ -0,0 +1,23 @@
1
+ /** How long an interrupt waits for a deferred write before the command stops without it. */
2
+ export declare const DEFERRED_INTERRUPT_BOUND_MS = 60000;
3
+ /**
4
+ * Whether an interrupt arriving now is held by {@link deferInterrupts}. A signal handler that
5
+ * cleans up and ends the process returns without acting while this holds: the deferral raises
6
+ * the signal again once its write is done (or abandoned), and the handler runs then.
7
+ */
8
+ export declare function interruptsDeferred(): boolean;
9
+ export interface DeferInterruptsOptions {
10
+ /** Printed at the first interrupt: what the command finishes before it stops. */
11
+ waiting: string;
12
+ /** Printed when the command stops without finishing: a second interrupt, or the bound elapsed. */
13
+ abandoned: string;
14
+ boundMs?: number;
15
+ }
16
+ /**
17
+ * Runs `run`, a write the server may already be committing followed by saving its answer
18
+ * locally, with Ctrl-C (and `SIGTERM`) held until it ends: stopping in between leaves a write the
19
+ * server made that the directory never recorded. The first interrupt prints `waiting`; when
20
+ * `run` settles the process ends by that signal (exit 130 for Ctrl-C). A second interrupt, or
21
+ * `boundMs` passing, stops at once and prints `abandoned`, which names how to recover.
22
+ */
23
+ export declare function deferInterrupts<T>(run: () => Promise<T>, options: DeferInterruptsOptions): Promise<T>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Asks `question` on stderr and resolves the line typed, or `null` when the input ends first
3
+ * (Ctrl-D, or a stdin closed under the prompt), so a caller cancels cleanly instead of hanging
4
+ * or printing a runtime's stack trace. Ctrl-C at a terminal, which readline reads as a key rather
5
+ * than delivering the signal, rejects with a `CANCELLED` error that exits 130, as an interrupt
6
+ * anywhere else does.
7
+ */
8
+ export declare function askLine(question: string): Promise<string | null>;
@@ -3,5 +3,6 @@ import type { Command } from 'commander';
3
3
  * Anything the CLI can explain prints as one line and exits with its code. A
4
4
  * failure is reported here, where its class and code are known; every other
5
5
  * way the process ends is reported from the exit listener telemetry installs.
6
+ * Every exit waits for stdout and stderr to drain first (see {@link flushOutput}).
6
7
  */
7
8
  export declare function runTerminalCli(suppliedProgram?: Command): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sim",
3
- "version": "2.2.32",
3
+ "version": "2.2.33-preview.316.1",
4
4
  "description": "Sim CLI - talk to the Sim API from your terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -50,6 +50,7 @@
50
50
  "chalk": "5.6.2",
51
51
  "commander": "^11.1.0",
52
52
  "csv-parse": "7.0.3",
53
+ "diff": "9.0.0",
53
54
  "js-yaml": "4.3.2",
54
55
  "minisearch": "7.2.0",
55
56
  "proper-lockfile": "4.1.2"
@@ -57,6 +58,9 @@
57
58
  "devDependencies": {
58
59
  "@sim/tsconfig": "0.0.0",
59
60
  "@sim/utils": "0.1.0",
61
+ "@sim/workflow-code": "0.1.0",
62
+ "@sim/workflow-sdk": "0.1.0",
63
+ "@sim/workspace-code": "0.1.0",
60
64
  "@types/js-yaml": "4.0.9",
61
65
  "@types/node": "24.19.2",
62
66
  "@types/proper-lockfile": "4.1.4",