sim 2.3.0-preview.323.1 → 2.3.0-preview.325.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.
- package/README.md +3 -2
- package/dist/commands/protocol/deployed-urls.d.ts +25 -0
- package/dist/commands/protocol/run-source-location.d.ts +7 -0
- package/dist/commands/protocol/source-check.d.ts +2 -0
- package/dist/commands/protocol/source-dir/command-lock.d.ts +1 -1
- package/dist/commands/protocol/source-loop-help.d.ts +4 -0
- package/dist/commands/protocol/source-primer.d.ts +5 -2
- package/dist/commands/protocol/source-ui.d.ts +6 -2
- package/dist/contract/types.d.ts +2 -0
- package/dist/exit-codes.d.ts +8 -0
- package/dist/generated/v2-api.d.ts +51 -51
- package/dist/http/client.d.ts +2 -0
- package/dist/index.js +14676 -14142
- package/dist/output/github-actions.d.ts +23 -0
- package/dist/runtime.js +14676 -14142
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -325,8 +325,9 @@ creates and dry runs, are resent up to 6 times first, each wait the longer of `R
|
|
|
325
325
|
release both exited 1. Ctrl-C exits 130; a source apply or create already sent is finished and
|
|
326
326
|
saved into its directory first. The `workflows source` and `workspaces source` commands also use
|
|
327
327
|
5 (stale), 6 (a locked workflow or folder; a locked block exits 1), 7 (too large), 8 (a workspace
|
|
328
|
-
apply stopped part-way), 10 (busy), 11 (status: local changes)
|
|
329
|
-
|
|
328
|
+
apply stopped part-way), 10 (busy), 11 (status: local changes), 12 (status: the server changed),
|
|
329
|
+
14 (a write without `--yes` where no terminal can ask: it printed the plan and wrote nothing) and 15
|
|
330
|
+
(a workspace apply wrote part of its plan and held the rest back). Command-specific codes: [Exit codes](https://docs.sim.ai/cli/scripting#exit-codes).
|
|
330
331
|
|
|
331
332
|
## Workflows and workspaces as code
|
|
332
333
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { GetWorkflowDeploymentResponse } from '../../generated/v2-api';
|
|
2
|
+
import type { OperationClient } from '../../runtime/called-operations';
|
|
3
|
+
/** A webhook of a deployed workflow, which callers reach at `url`. */
|
|
4
|
+
export interface DeployedUrl {
|
|
5
|
+
/** The block key, with its const name when the lock names one: `leadin (hook)`. */
|
|
6
|
+
block: string;
|
|
7
|
+
url: string;
|
|
8
|
+
}
|
|
9
|
+
/** How source names a block: its key, with its const when that differs (`leadin (hook)`). */
|
|
10
|
+
export declare function blockLabel(key: string, ident: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Each block id of a lock (`.sim/lock.json`, parsed or as JSON text) mapped to its
|
|
13
|
+
* {@link blockLabel}; empty when the lock does not parse.
|
|
14
|
+
*/
|
|
15
|
+
export declare function lockBlockNames(lockInput: unknown): Map<string, string>;
|
|
16
|
+
/** The deployment's webhook URLs, each named through `names` (block id → source name). */
|
|
17
|
+
export declare function namedUrls(webhooks: GetWorkflowDeploymentResponse['data']['webhooks'], names: ReadonlyMap<string, string>): DeployedUrl[];
|
|
18
|
+
/**
|
|
19
|
+
* The URL of each webhook `workflowId`'s live deployment serves, named through `names`. A failed
|
|
20
|
+
* read is reported and yields none: the deploy itself stands. A cancelled read is rethrown, so a
|
|
21
|
+
* cancelled command never reports success.
|
|
22
|
+
*/
|
|
23
|
+
export declare function deployedUrls(client: OperationClient<'getWorkflowDeployment'>, workflowId: string, names: ReadonlyMap<string, string>): Promise<DeployedUrl[]>;
|
|
24
|
+
/** The URLs as one display line: `leadin (hook) https://…, …`. */
|
|
25
|
+
export declare function deployedUrlsText(urls: readonly DeployedUrl[]): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prints where a failed run failed in `dir` (on stderr, and as a GitHub Actions annotation in a
|
|
3
|
+
* job), or that `dir` cannot say. Prints nothing for a failure that names no block (a timeout, an
|
|
4
|
+
* input refused), and never throws: a directory it cannot read is a note, so the run's own failure
|
|
5
|
+
* and exit code stand.
|
|
6
|
+
*/
|
|
7
|
+
export declare function printRunFailureSite(dir: string, workflowId: string, error: unknown): Promise<void>;
|
|
@@ -75,6 +75,8 @@ export declare function reportCheck(output: Parameters<typeof printProtocolResul
|
|
|
75
75
|
verbose?: boolean;
|
|
76
76
|
bound?: AnswerBound;
|
|
77
77
|
unlisted?: UnlistedCounts;
|
|
78
|
+
/** The source directory, which GitHub Actions annotations resolve finding files under. */
|
|
79
|
+
dir?: string;
|
|
78
80
|
}): void;
|
|
79
81
|
/** The catalog a cache read found, or a refusal naming `get`, the command that caches one. */
|
|
80
82
|
export declare function cachedOrRefuse(catalog: BlockCatalog | null, workspaceId: string, get: string): BlockCatalog;
|
|
@@ -11,7 +11,7 @@ import { type Stats } from 'node:fs';
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const SOURCE_DIR_LOCK = ".sim/command.lock";
|
|
13
13
|
/** The help line every command that holds {@link SOURCE_DIR_LOCK} adds to its exit codes. */
|
|
14
|
-
export declare const SOURCE_DIR_BUSY_HELP = "\nExit 10 (busy, retry): another sim workspaces source command is using
|
|
14
|
+
export declare const SOURCE_DIR_BUSY_HELP = "\nExit 10 (busy, retry): another sim workspaces source or workflows source command is using\nthis directory or a workflow folder in it (SOURCE_DIR_BUSY); nothing was read or written. Run this one\nagain once it finished.";
|
|
15
15
|
/** The lock folder a command found, as it found it: which folder, and when it last changed. */
|
|
16
16
|
type LockSighting = Pick<Stats, 'dev' | 'ino' | 'mtimeMs'>;
|
|
17
17
|
/**
|
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
import type { BlockCatalog } from '@sim/workflow-code';
|
|
7
7
|
/** Which directory a primer is for. */
|
|
8
8
|
export type PrimerKind = 'workflow' | 'workspace';
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The primer without its builder snippets stays within this many bytes: about one screen, room for
|
|
11
|
+
* the rules agents otherwise spend a lookup on (renames, failures, test runs).
|
|
12
|
+
*/
|
|
13
|
+
export declare const PRIMER_MAX_BYTES = 4096;
|
|
11
14
|
/** The primer for a `kind` directory, without builder snippets. */
|
|
12
15
|
export declare function sourcePrimer(kind: PrimerKind): string;
|
|
13
16
|
/** The primer with the snippets of the builders `sources` call. */
|
|
@@ -18,6 +18,8 @@ export declare function refusedExitCode(diagnostics: ReadonlyArray<Pick<Diagnost
|
|
|
18
18
|
type ResultDiagnostic = Omit<FlatDiagnostic, 'frame' | 'code'> & {
|
|
19
19
|
code: Diagnostic['code'];
|
|
20
20
|
};
|
|
21
|
+
/** Whether `format` prints one machine document on stdout rather than lines for a person. */
|
|
22
|
+
export declare function isMachine(format: OutputFormat): boolean;
|
|
21
23
|
/** Records `key` in `printed`, returning whether it was new. */
|
|
22
24
|
export declare function fresh(printed: Set<string>, key: string): boolean;
|
|
23
25
|
/**
|
|
@@ -40,11 +42,13 @@ export interface FindingsOutput {
|
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
43
|
-
* The {@link FindingsOutput} of `format`; `verbose` keeps info findings in a machine result
|
|
45
|
+
* The {@link FindingsOutput} of `format`; `verbose` keeps info findings in a machine result, and
|
|
46
|
+
* the {@link QUIET_INFO_CODES} in a display one. In a GitHub Actions step every error and warning
|
|
47
|
+
* is also annotated at its file under the source directory `dir`, whatever the format. It is
|
|
44
48
|
* the CLI's output edge, where each finding's message and hint are cut (`boundFindingText`): a
|
|
45
49
|
* finding an offline check made is as long as its source made it until here.
|
|
46
50
|
*/
|
|
47
|
-
export declare function findingsOutput(format: OutputFormat, verbose?: boolean): FindingsOutput;
|
|
51
|
+
export declare function findingsOutput(format: OutputFormat, verbose?: boolean, dir?: string): FindingsOutput;
|
|
48
52
|
/** A resource a source write created, as its result lists it; `id` once it is written. */
|
|
49
53
|
export interface CreatedResource {
|
|
50
54
|
kind: string;
|
package/dist/contract/types.d.ts
CHANGED
|
@@ -282,6 +282,8 @@ export interface CommandSpec {
|
|
|
282
282
|
variants?: readonly CommandVariantSpec[];
|
|
283
283
|
/** One-line help. Falls back to the OpenAPI summary for the operation. */
|
|
284
284
|
describe?: string;
|
|
285
|
+
/** Prose `--help` prints after the options: how the fields combine, where one flag cannot say. */
|
|
286
|
+
helpText?: string;
|
|
285
287
|
/** Per-field flag overrides, keyed by the contract's field name. */
|
|
286
288
|
flags?: Record<string, FlagSpec>;
|
|
287
289
|
/** Friendly mutually-exclusive flags for an otherwise opaque union body. */
|
package/dist/exit-codes.d.ts
CHANGED
|
@@ -70,5 +70,13 @@ export declare const AUTH_REQUIRED_EXIT_CODE = 13;
|
|
|
70
70
|
* the same command with `--yes` to apply that plan.
|
|
71
71
|
*/
|
|
72
72
|
export declare const SOURCE_PLANNED_EXIT_CODE = 14;
|
|
73
|
+
/**
|
|
74
|
+
* A `workspaces source apply` (or a promotion with `--to`) that wrote part of its plan and held the
|
|
75
|
+
* rest back: a change that uses a declared secret the workspace has no value for, or a declared
|
|
76
|
+
* credential key nothing binds to. What was written is saved; set the secret or connect the
|
|
77
|
+
* credential and apply again. Apart from exit 1 (nothing written), so a script can tell a clean
|
|
78
|
+
* refusal from a target left half-applied.
|
|
79
|
+
*/
|
|
80
|
+
export declare const SOURCE_HELD_EXIT_CODE = 15;
|
|
73
81
|
/** The error code of an {@link AUTH_REQUIRED_EXIT_CODE} refusal the CLI raises itself. */
|
|
74
82
|
export declare const AUTH_REQUIRED_CODE = "AUTH_REQUIRED";
|