sim 2.2.32 → 2.2.33-preview.317.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 (36) 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 +154 -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/contract/types.d.ts +5 -0
  25. package/dist/embed-context.d.ts +6 -3
  26. package/dist/exit-codes.d.ts +66 -0
  27. package/dist/generated/v2-api.d.ts +1297 -1
  28. package/dist/http/client.d.ts +22 -0
  29. package/dist/index.js +59130 -20427
  30. package/dist/output/io.d.ts +6 -0
  31. package/dist/program.d.ts +1 -1
  32. package/dist/runtime.js +59149 -20446
  33. package/dist/terminal/interrupts.d.ts +23 -0
  34. package/dist/terminal/line-input.d.ts +8 -0
  35. package/dist/terminal.d.ts +1 -0
  36. package/package.json +5 -1
@@ -17,6 +17,14 @@ export declare class SimApiError extends Error {
17
17
  /** The server's id for the failed request (`x-request-id`), to quote to support. */
18
18
  requestId?: string | null);
19
19
  }
20
+ /** The code of a request the caller cancelled (its signal aborted): not an unreachable server. */
21
+ export declare const REQUEST_CANCELLED = "REQUEST_CANCELLED";
22
+ /**
23
+ * Whether a request got no answer from the server: no connection or a timeout (status 0 with no
24
+ * code, so never a cancellation), or one of the gateway `statuses` the caller treats as a gateway
25
+ * that gave up.
26
+ */
27
+ export declare function noAnswer(error: SimApiError, statuses: ReadonlySet<number>): boolean;
20
28
  /** `{ data, nextCursor }` — one page of a list. */
21
29
  export interface V2Page<T> {
22
30
  data: T[];
@@ -35,12 +43,20 @@ export interface RequestOptions {
35
43
  method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
36
44
  query?: Record<string, QueryValue>;
37
45
  body?: unknown;
46
+ /** A multipart body, sent as is (its boundary sets the content type) in place of `body`. */
47
+ form?: FormData;
38
48
  /** Contract-declared headers, e.g. the `upload-token` a transfer is bound to. */
39
49
  headers?: Record<string, string>;
40
50
  /** Cancels both the initial request and any subsequent streaming body read. */
41
51
  signal?: AbortSignal;
42
52
  /** Self-hosted, auth-disabled routes may deliberately omit a local API key. */
43
53
  auth?: AuthRequirement;
54
+ /**
55
+ * Resend a write the server answered `429`, as every GET is. Only for a route that rate limits
56
+ * before it acts: a v2 route charges its bucket at admission, ahead of the use case, so the
57
+ * refused request did nothing and sending it again is sending it for the first time.
58
+ */
59
+ retryRateLimited?: boolean;
44
60
  }
45
61
  export interface WorkspaceOptions {
46
62
  auth?: AuthRequirement;
@@ -139,6 +155,12 @@ export declare class SimClient {
139
155
  * endpoint. A `Location` that is missing or unparseable still has to produce a
140
156
  * sentence — the redirect is the finding either way.
141
157
  */
158
+ /**
159
+ * What to do about a credential the server refused, by where it came from: `sim login` replaces
160
+ * a stored login, but a key from `SIM_API_KEY` or `--api-key` overrides any login, so logging in
161
+ * again would change nothing.
162
+ */
163
+ private credentialRemedy;
142
164
  private toRedirectError;
143
165
  }
144
166
  /**