@relayflows/sdk 2.0.17 → 2.0.19
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/dist/authored-flow-error.d.ts +21 -1
- package/dist/authored-flow-error.d.ts.map +1 -1
- package/dist/authored-flow-error.js +14 -0
- package/dist/authored-flow-error.js.map +1 -1
- package/dist/authored-flow-executor.d.ts.map +1 -1
- package/dist/authored-flow-executor.js +47 -3
- package/dist/authored-flow-executor.js.map +1 -1
- package/dist/authored-human.d.ts +49 -0
- package/dist/authored-human.d.ts.map +1 -0
- package/dist/authored-human.js +97 -0
- package/dist/authored-human.js.map +1 -0
- package/dist/authored-node-entry.js +3 -2
- package/dist/authored-node-entry.js.map +1 -1
- package/dist/authored-node-runner.d.ts.map +1 -1
- package/dist/authored-node-runner.js +15 -4
- package/dist/authored-node-runner.js.map +1 -1
- package/dist/authored-root.d.ts.map +1 -1
- package/dist/authored-root.js +29 -1
- package/dist/authored-root.js.map +1 -1
- package/dist/cli/answer.d.ts +17 -0
- package/dist/cli/answer.d.ts.map +1 -0
- package/dist/cli/answer.js +89 -0
- package/dist/cli/answer.js.map +1 -0
- package/dist/cli/build.d.ts +9 -0
- package/dist/cli/build.d.ts.map +1 -1
- package/dist/cli/build.js +26 -7
- package/dist/cli/build.js.map +1 -1
- package/dist/cli/check-triggers.d.ts.map +1 -1
- package/dist/cli/check-triggers.js +2 -0
- package/dist/cli/check-triggers.js.map +1 -1
- package/dist/cli/check.d.ts +11 -0
- package/dist/cli/check.d.ts.map +1 -1
- package/dist/cli/check.js +14 -2
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/cloud-connect-cli.d.ts +54 -0
- package/dist/cli/cloud-connect-cli.d.ts.map +1 -0
- package/dist/cli/cloud-connect-cli.js +109 -0
- package/dist/cli/cloud-connect-cli.js.map +1 -0
- package/dist/cli/cloud-deploy.d.ts +3 -1
- package/dist/cli/cloud-deploy.d.ts.map +1 -1
- package/dist/cli/cloud-deploy.js +44 -6
- package/dist/cli/cloud-deploy.js.map +1 -1
- package/dist/cli/cloud-run.d.ts +9 -2
- package/dist/cli/cloud-run.d.ts.map +1 -1
- package/dist/cli/cloud-run.js +27 -15
- package/dist/cli/cloud-run.js.map +1 -1
- package/dist/cli/cloud-schedule.d.ts +3 -1
- package/dist/cli/cloud-schedule.d.ts.map +1 -1
- package/dist/cli/cloud-schedule.js +31 -6
- package/dist/cli/cloud-schedule.js.map +1 -1
- package/dist/cli/cloud-sync.d.ts +8 -1
- package/dist/cli/cloud-sync.d.ts.map +1 -1
- package/dist/cli/cloud-sync.js +79 -8
- package/dist/cli/cloud-sync.js.map +1 -1
- package/dist/cli/deploy.d.ts +6 -0
- package/dist/cli/deploy.d.ts.map +1 -1
- package/dist/cli/deploy.js +29 -4
- package/dist/cli/deploy.js.map +1 -1
- package/dist/cli/direct-run.d.ts.map +1 -1
- package/dist/cli/direct-run.js +5 -1
- package/dist/cli/direct-run.js.map +1 -1
- package/dist/cli/run.d.ts +22 -2
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +34 -1
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/serve-webhook.d.ts +7 -1
- package/dist/cli/serve-webhook.d.ts.map +1 -1
- package/dist/cli/serve-webhook.js +19 -9
- package/dist/cli/serve-webhook.js.map +1 -1
- package/dist/cli-commands.d.ts +398 -0
- package/dist/cli-commands.d.ts.map +1 -0
- package/dist/cli-commands.js +254 -0
- package/dist/cli-commands.js.map +1 -0
- package/dist/cli-watch.d.ts +3 -1
- package/dist/cli-watch.d.ts.map +1 -1
- package/dist/cli-watch.js +4 -10
- package/dist/cli-watch.js.map +1 -1
- package/dist/cli.d.ts +127 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +195 -57
- package/dist/cli.js.map +1 -1
- package/dist/cloud-connect.d.ts +52 -0
- package/dist/cloud-connect.d.ts.map +1 -0
- package/dist/cloud-connect.js +138 -0
- package/dist/cloud-connect.js.map +1 -0
- package/dist/cloud-deploy.d.ts +19 -1
- package/dist/cloud-deploy.d.ts.map +1 -1
- package/dist/cloud-deploy.js +40 -1
- package/dist/cloud-deploy.js.map +1 -1
- package/dist/cloud-http.d.ts +2 -2
- package/dist/cloud-http.d.ts.map +1 -1
- package/dist/cloud-http.js.map +1 -1
- package/dist/cloud-schedule.d.ts +7 -0
- package/dist/cloud-schedule.d.ts.map +1 -1
- package/dist/cloud-schedule.js +22 -1
- package/dist/cloud-schedule.js.map +1 -1
- package/dist/cloud-sync.d.ts +85 -2
- package/dist/cloud-sync.d.ts.map +1 -1
- package/dist/cloud-sync.js +123 -10
- package/dist/cloud-sync.js.map +1 -1
- package/dist/failure-kinds.d.ts +1 -1
- package/dist/failure-kinds.d.ts.map +1 -1
- package/dist/failure-kinds.js +2 -0
- package/dist/failure-kinds.js.map +1 -1
- package/dist/flow-requirements.d.ts +68 -0
- package/dist/flow-requirements.d.ts.map +1 -0
- package/dist/flow-requirements.js +152 -0
- package/dist/flow-requirements.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/journal-client.d.ts +11 -0
- package/dist/journal-client.d.ts.map +1 -1
- package/dist/journal-client.js +13 -0
- package/dist/journal-client.js.map +1 -1
- package/dist/progress.d.ts +2 -1
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +9 -3
- package/dist/progress.js.map +1 -1
- package/dist/protocol.d.ts +25 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/relay-cli.d.ts +50 -0
- package/dist/relay-cli.d.ts.map +1 -0
- package/dist/relay-cli.js +64 -0
- package/dist/relay-cli.js.map +1 -0
- package/package.json +7 -2
- package/src/authored-flow-error.ts +29 -0
- package/src/authored-flow-executor.ts +54 -2
- package/src/authored-human.ts +150 -0
- package/src/authored-node-entry.ts +3 -2
- package/src/authored-node-runner.ts +20 -5
- package/src/authored-root.ts +28 -1
- package/src/cli/answer.ts +98 -0
- package/src/cli/build.ts +21 -7
- package/src/cli/check-triggers.ts +2 -0
- package/src/cli/check.ts +24 -2
- package/src/cli/cloud-connect-cli.ts +130 -0
- package/src/cli/cloud-deploy.ts +40 -6
- package/src/cli/cloud-run.ts +26 -15
- package/src/cli/cloud-schedule.ts +31 -6
- package/src/cli/cloud-sync.ts +85 -8
- package/src/cli/deploy.ts +27 -5
- package/src/cli/direct-run.ts +5 -0
- package/src/cli/run.ts +48 -2
- package/src/cli/serve-webhook.ts +15 -8
- package/src/cli-commands.ts +339 -0
- package/src/cli-watch.ts +8 -9
- package/src/cli.ts +206 -54
- package/src/cloud-connect.ts +187 -0
- package/src/cloud-deploy.ts +57 -2
- package/src/cloud-http.ts +1 -1
- package/src/cloud-schedule.ts +20 -3
- package/src/cloud-sync.ts +164 -11
- package/src/failure-kinds.ts +2 -0
- package/src/flow-requirements.ts +201 -0
- package/src/index.ts +12 -2
- package/src/journal-client.ts +20 -0
- package/src/progress.ts +11 -4
- package/src/protocol.ts +23 -0
- package/src/relay-cli.ts +117 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-webhook.d.ts","sourceRoot":"","sources":["../../src/cli/serve-webhook.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,MAAM,EAAuB,MAAM,WAAW,CAAC;AAG3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"serve-webhook.d.ts","sourceRoot":"","sources":["../../src/cli/serve-webhook.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,MAAM,EAAuB,MAAM,WAAW,CAAC;AAG3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIvC,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAO5F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG;IACzD,OAAO,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvF,GAAG,SAAS,CA4BZ;AAOD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAIrH;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAED,sFAAsF;AACtF,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,MAAM,CAAC,CA6HjB;AAOD,wBAAsB,eAAe,CACnC,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAAE,EAAE,EAAE,KAAK;AACnF;;;;GAIG;AACH,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAyBhB"}
|
|
@@ -3,6 +3,7 @@ import { mkdir, open, rename, unlink, lstat } from 'node:fs/promises';
|
|
|
3
3
|
import { createServer } from 'node:http';
|
|
4
4
|
import { join, resolve } from 'node:path';
|
|
5
5
|
import { TextDecoder } from 'node:util';
|
|
6
|
+
import { DEFAULT_DATA_DIR } from '../daemon-connection.js';
|
|
6
7
|
import { providerInboxEvent } from '../trigger-executor.js';
|
|
7
8
|
import { verifySignature, schemeFor } from '../webhook-signature.js';
|
|
8
9
|
import { TokenBucketLimiter, keyFor } from '../webhook-rate-limit.js';
|
|
@@ -19,9 +20,12 @@ export function parseWebhookArgs(args) {
|
|
|
19
20
|
return undefined;
|
|
20
21
|
values.set(flag, value);
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
// `--data-dir` is optional here as it is on every other verb, and defaults to
|
|
24
|
+
// the same directory: the command surface advertises that default, so a
|
|
25
|
+
// receiver started without the flag has to run rather than exit 2.
|
|
26
|
+
const dataDir = values.get('--data-dir') ?? DEFAULT_DATA_DIR;
|
|
23
27
|
const portText = values.get('--port');
|
|
24
|
-
if (!
|
|
28
|
+
if (!portText || !/^\d+$/.test(portText))
|
|
25
29
|
return undefined;
|
|
26
30
|
const port = Number(portText);
|
|
27
31
|
if (!Number.isInteger(port) || port < 0 || port > 65535)
|
|
@@ -200,7 +204,13 @@ async function directory(path) {
|
|
|
200
204
|
if (!(await lstat(path)).isDirectory())
|
|
201
205
|
throw new Error('inbox directory must not be a symlink');
|
|
202
206
|
}
|
|
203
|
-
export async function runServeWebhook(options, io
|
|
207
|
+
export async function runServeWebhook(options, io,
|
|
208
|
+
/**
|
|
209
|
+
* Shutdown, owned by the caller. `runCli` supplies either the embedder's
|
|
210
|
+
* signal or one it drives from SIGINT/SIGTERM, so the receiver installs no
|
|
211
|
+
* process-wide handler of its own.
|
|
212
|
+
*/
|
|
213
|
+
signal) {
|
|
204
214
|
try {
|
|
205
215
|
const admittedNames = options.admitted === undefined ? undefined : new Set(options.admitted);
|
|
206
216
|
const server = await startWebhookServer(options.dataDir, options.port, { admittedNames });
|
|
@@ -216,12 +226,12 @@ export async function runServeWebhook(options, io) {
|
|
|
216
226
|
server.closeAllConnections();
|
|
217
227
|
};
|
|
218
228
|
server.once('error', reject);
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
229
|
+
if (signal.aborted) {
|
|
230
|
+
stop();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
signal.addEventListener('abort', stop, { once: true });
|
|
234
|
+
server.once('close', () => signal.removeEventListener('abort', stop));
|
|
225
235
|
});
|
|
226
236
|
return 0;
|
|
227
237
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-webhook.js","sourceRoot":"","sources":["../../src/cli/serve-webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAoC,MAAM,WAAW,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAwB,MAAM,0BAA0B,CAAC;AAE5F,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AACnC,MAAM,IAAI,GAAG,mCAAmC,CAAC;AAEjD,MAAM,kBAAkB,GAAoB,EAAE,aAAa,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAE7E,MAAM,UAAU,gBAAgB,CAAC,IAAuB;IAGtD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,CAAC,YAAY,EA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K,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;gBACxD,MAAM,CAAC,mBAAmB,EAAE,CAAC;YAC/B,CAAC,CAAC;YACF,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC7B,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBAAC,IAAI,EAAE,CAAC;gBAAC,OAAO;YAAC,CAAC;YACvC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YACvD,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,EAAE,CAAC,MAAM,CAAC,2BAA2B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACnG,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import type { ParsedArgs } from './cli.js';
|
|
2
|
+
/**
|
|
3
|
+
* The one declaration of the `flows` command surface.
|
|
4
|
+
*
|
|
5
|
+
* Two consumers read this table and nothing else:
|
|
6
|
+
*
|
|
7
|
+
* 1. `parseArgs` in `cli.ts` gates its verb dispatch on {@link CLI_VERB_NAMES},
|
|
8
|
+
* so a token that is not in this table can never reach a parser.
|
|
9
|
+
* 2. `createRelayCliSurface` in `relay-cli.ts` projects it into the
|
|
10
|
+
* `RelayCliSurface.commands` tree the `agent-relay` host mounts.
|
|
11
|
+
*
|
|
12
|
+
* Because both sides derive from one array, `commands` and `run` cannot
|
|
13
|
+
* describe different trees. The drift test proves the remaining direction --
|
|
14
|
+
* that each declared command actually parses -- and {@link CLI_VERBS} carries a
|
|
15
|
+
* compile-time assertion that every `ParsedArgs` variant is claimed by some
|
|
16
|
+
* verb, so extending the union without extending this table fails `tsc`.
|
|
17
|
+
*
|
|
18
|
+
* The types here are deliberately local rather than imported from
|
|
19
|
+
* `@agent-relay/cli-surface`: they are structurally identical, and keeping the
|
|
20
|
+
* import out means `dist/relay-cli.d.ts` stands alone, so a consumer of
|
|
21
|
+
* `@relayflows/sdk` never needs the contract package resolvable. Assignability
|
|
22
|
+
* to the real contract is asserted in `tests/relay-cli-surface.test.ts`.
|
|
23
|
+
*/
|
|
24
|
+
/** A positional argument. Mirrors `RelayCliArgSpec`. */
|
|
25
|
+
export interface CliArgSpec {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
required: boolean;
|
|
29
|
+
variadic?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** A flag, in commander's flag-string form. Mirrors `RelayCliOptionSpec`. */
|
|
32
|
+
export interface CliOptionSpec {
|
|
33
|
+
flags: string;
|
|
34
|
+
description: string;
|
|
35
|
+
defaultValue?: string | boolean | number;
|
|
36
|
+
}
|
|
37
|
+
/** One node of the command tree. Mirrors `RelayCliCommandSpec`. */
|
|
38
|
+
export interface CliCommandSpec {
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
aliases?: readonly string[];
|
|
42
|
+
args?: readonly CliArgSpec[];
|
|
43
|
+
options?: readonly CliOptionSpec[];
|
|
44
|
+
subcommands?: readonly CliCommandSpec[];
|
|
45
|
+
}
|
|
46
|
+
/** A top-level verb, plus the `ParsedArgs` variants it can produce. */
|
|
47
|
+
export interface CliVerbSpec extends CliCommandSpec {
|
|
48
|
+
/**
|
|
49
|
+
* Every `ParsedArgs.command` this verb can parse to.
|
|
50
|
+
*
|
|
51
|
+
* Usually one, but the verb set and the variant set are not one-to-one:
|
|
52
|
+
* `deploy` produces `deploy` for a digest reference and `cloud-deploy` for
|
|
53
|
+
* authored source, and `run` produces `cloud-run` under `--cloud`.
|
|
54
|
+
*/
|
|
55
|
+
variants: readonly ParsedArgs['command'][];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* `as const satisfies` rather than a type annotation on purpose: an annotation
|
|
59
|
+
* would widen every `variants` entry to `ParsedArgs['command']` and the
|
|
60
|
+
* compile-time exhaustiveness assertion below would pass vacuously.
|
|
61
|
+
*/
|
|
62
|
+
export declare const CLI_VERBS: readonly [{
|
|
63
|
+
readonly name: "add";
|
|
64
|
+
readonly description: "Install a helper plugin into this project";
|
|
65
|
+
readonly args: readonly [{
|
|
66
|
+
readonly name: "helper";
|
|
67
|
+
readonly description: "Helper name or @flows/<helper-name>";
|
|
68
|
+
readonly required: true;
|
|
69
|
+
}];
|
|
70
|
+
readonly variants: readonly ["add"];
|
|
71
|
+
}, {
|
|
72
|
+
readonly name: "answer";
|
|
73
|
+
readonly description: "Answer a run’s parked f.human question; `flows resume` then continues the body";
|
|
74
|
+
readonly args: readonly [{
|
|
75
|
+
readonly name: "run-id";
|
|
76
|
+
readonly description: "Run parked on the question";
|
|
77
|
+
readonly required: true;
|
|
78
|
+
}, {
|
|
79
|
+
readonly name: "wait-id";
|
|
80
|
+
readonly description: "Which question to answer, named human-<n> in the order the body asked";
|
|
81
|
+
readonly required: true;
|
|
82
|
+
}, {
|
|
83
|
+
readonly name: "answer";
|
|
84
|
+
readonly description: "The decision, as yes or no (also true or false)";
|
|
85
|
+
readonly required: true;
|
|
86
|
+
}];
|
|
87
|
+
readonly options: readonly [CliOptionSpec, CliOptionSpec, {
|
|
88
|
+
readonly flags: "--no-spawn";
|
|
89
|
+
readonly description: "Require a running relayflowd rather than starting one";
|
|
90
|
+
}, {
|
|
91
|
+
readonly flags: "--note <text>";
|
|
92
|
+
readonly description: "Reason recorded on the journal alongside the answer";
|
|
93
|
+
}, {
|
|
94
|
+
readonly flags: "--by <identity>";
|
|
95
|
+
readonly description: "Who answered, when relaying a person’s decision; defaults to the OS user";
|
|
96
|
+
}];
|
|
97
|
+
readonly variants: readonly ["answer"];
|
|
98
|
+
}, {
|
|
99
|
+
readonly name: "build";
|
|
100
|
+
readonly description: "Compile a flow into a sealed, content-addressed bundle";
|
|
101
|
+
readonly args: readonly [{
|
|
102
|
+
readonly name: "source";
|
|
103
|
+
readonly description: "flow.yaml, flow.ts, or a bundle directory with --verify";
|
|
104
|
+
readonly required: true;
|
|
105
|
+
}];
|
|
106
|
+
readonly options: readonly [{
|
|
107
|
+
readonly flags: "--out <dir>";
|
|
108
|
+
readonly description: "Directory to write the bundle into; not valid with --verify";
|
|
109
|
+
}, {
|
|
110
|
+
readonly flags: "--verify";
|
|
111
|
+
readonly description: "Verify an existing bundle directory instead of building";
|
|
112
|
+
}, CliOptionSpec];
|
|
113
|
+
readonly variants: readonly ["build"];
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: "check";
|
|
116
|
+
readonly description: "Compile and preflight a flow without running it, or opening a daemon socket";
|
|
117
|
+
readonly args: readonly [{
|
|
118
|
+
readonly name: "source";
|
|
119
|
+
readonly description: "flow.ts, flow.yaml, or spec.json";
|
|
120
|
+
readonly required: true;
|
|
121
|
+
}];
|
|
122
|
+
readonly options: readonly [CliOptionSpec, {
|
|
123
|
+
readonly flags: "--watch";
|
|
124
|
+
readonly description: "Re-check on every change to the flow and its imports";
|
|
125
|
+
}];
|
|
126
|
+
readonly variants: readonly ["check"];
|
|
127
|
+
}, {
|
|
128
|
+
readonly name: "deploy";
|
|
129
|
+
readonly description: "Copy a sealed bundle into a file bucket, or deploy a hosted trigger listener";
|
|
130
|
+
readonly args: readonly [{
|
|
131
|
+
readonly name: "flow";
|
|
132
|
+
readonly description: "flow.ts for a hosted listener, or <flow>@sha256:<digest> for a bundle";
|
|
133
|
+
readonly required: true;
|
|
134
|
+
}];
|
|
135
|
+
readonly options: readonly [{
|
|
136
|
+
readonly flags: "--to <file-bucket-uri>";
|
|
137
|
+
readonly description: "Destination file bucket for a sealed bundle";
|
|
138
|
+
}, {
|
|
139
|
+
readonly flags: "--repo <owner/name>";
|
|
140
|
+
readonly description: "Repository the hosted listener watches";
|
|
141
|
+
}, {
|
|
142
|
+
readonly flags: "--on <provider>";
|
|
143
|
+
readonly description: "Trigger source, as <provider>[:key=value,...]; repeatable";
|
|
144
|
+
}, {
|
|
145
|
+
readonly flags: "--approver <handle>";
|
|
146
|
+
readonly description: "Handle delivered to every launched run as input.approver";
|
|
147
|
+
}, {
|
|
148
|
+
readonly flags: "--agents <list>";
|
|
149
|
+
readonly description: "Agent harnesses to allow, as claude[,codex]";
|
|
150
|
+
}, {
|
|
151
|
+
readonly flags: "--name <name>";
|
|
152
|
+
readonly description: "Name for the hosted listener";
|
|
153
|
+
}, {
|
|
154
|
+
readonly flags: "--draft";
|
|
155
|
+
readonly description: "Create the listener without activating it";
|
|
156
|
+
}, CliOptionSpec, CliOptionSpec];
|
|
157
|
+
readonly variants: readonly ["deploy", "cloud-deploy"];
|
|
158
|
+
}, {
|
|
159
|
+
readonly name: "deployments";
|
|
160
|
+
readonly description: "List this workspace’s hosted trigger listeners";
|
|
161
|
+
readonly options: readonly [CliOptionSpec];
|
|
162
|
+
readonly variants: readonly ["deployments"];
|
|
163
|
+
}, {
|
|
164
|
+
readonly name: "hn-monitor";
|
|
165
|
+
readonly description: "Hacker News monitor: poll for matching stories and launch a flow per hit";
|
|
166
|
+
readonly subcommands: readonly [{
|
|
167
|
+
readonly name: "start";
|
|
168
|
+
readonly description: "Start polling in the foreground";
|
|
169
|
+
readonly args: readonly [{
|
|
170
|
+
readonly name: "spec";
|
|
171
|
+
readonly description: "Monitor spec.json";
|
|
172
|
+
readonly required: true;
|
|
173
|
+
}];
|
|
174
|
+
readonly options: readonly [CliOptionSpec, {
|
|
175
|
+
readonly flags: "--poll-interval-ms <ms>";
|
|
176
|
+
readonly description: "Milliseconds between polls";
|
|
177
|
+
}];
|
|
178
|
+
}];
|
|
179
|
+
readonly variants: readonly ["hn-monitor"];
|
|
180
|
+
}, {
|
|
181
|
+
readonly name: "observer";
|
|
182
|
+
readonly description: "Mint a read-only observer link without running a flow";
|
|
183
|
+
readonly options: readonly [CliOptionSpec];
|
|
184
|
+
readonly variants: readonly ["observer"];
|
|
185
|
+
}, {
|
|
186
|
+
readonly name: "replay";
|
|
187
|
+
readonly description: "Replay a finished run from its local journal";
|
|
188
|
+
readonly args: readonly [{
|
|
189
|
+
readonly name: "run-id";
|
|
190
|
+
readonly description: "Run id to replay";
|
|
191
|
+
readonly required: true;
|
|
192
|
+
}];
|
|
193
|
+
readonly options: readonly [CliOptionSpec, CliOptionSpec, {
|
|
194
|
+
readonly flags: "--at <step-id>";
|
|
195
|
+
readonly description: "Replay up to this step";
|
|
196
|
+
}, {
|
|
197
|
+
readonly flags: "--allow-human-influenced";
|
|
198
|
+
readonly description: "Proceed even though the run carries human-influenced state";
|
|
199
|
+
}];
|
|
200
|
+
readonly variants: readonly ["replay"];
|
|
201
|
+
}, {
|
|
202
|
+
readonly name: "resume";
|
|
203
|
+
readonly description: "Resume an interrupted local run from where its journal left off";
|
|
204
|
+
readonly args: readonly [{
|
|
205
|
+
readonly name: "run-id";
|
|
206
|
+
readonly description: "Run id to resume";
|
|
207
|
+
readonly required: true;
|
|
208
|
+
}];
|
|
209
|
+
readonly options: readonly [CliOptionSpec, CliOptionSpec, {
|
|
210
|
+
readonly flags: "--local-agent";
|
|
211
|
+
readonly description: "Run agent steps in this process instead of a worker";
|
|
212
|
+
}, {
|
|
213
|
+
readonly flags: "--no-spawn";
|
|
214
|
+
readonly description: "Require a running relayflowd rather than starting one";
|
|
215
|
+
}, {
|
|
216
|
+
readonly flags: "--no-observer-link";
|
|
217
|
+
readonly description: "Do not mint an observer link for this run";
|
|
218
|
+
}, {
|
|
219
|
+
readonly flags: "--allow-human-influenced";
|
|
220
|
+
readonly description: "Proceed even though the run carries human-influenced state";
|
|
221
|
+
}];
|
|
222
|
+
readonly variants: readonly ["resume"];
|
|
223
|
+
}, {
|
|
224
|
+
readonly name: "run";
|
|
225
|
+
readonly description: "Run a flow locally, or submit it to Cloud with --cloud";
|
|
226
|
+
readonly args: readonly [{
|
|
227
|
+
readonly name: "flow";
|
|
228
|
+
readonly description: "flow.yaml, flow.ts, spec.json, or <flow>@sha256:<digest>";
|
|
229
|
+
readonly required: true;
|
|
230
|
+
}];
|
|
231
|
+
readonly options: readonly [CliOptionSpec, CliOptionSpec, {
|
|
232
|
+
readonly flags: "--local-agent";
|
|
233
|
+
readonly description: "Run agent steps in this process instead of a worker";
|
|
234
|
+
}, {
|
|
235
|
+
readonly flags: "--no-spawn";
|
|
236
|
+
readonly description: "Require a running relayflowd rather than starting one";
|
|
237
|
+
}, {
|
|
238
|
+
readonly flags: "--no-observer-link";
|
|
239
|
+
readonly description: "Do not mint an observer link for this run";
|
|
240
|
+
}, {
|
|
241
|
+
readonly flags: "--allow-human-influenced";
|
|
242
|
+
readonly description: "Proceed even though the run carries human-influenced state";
|
|
243
|
+
}, {
|
|
244
|
+
readonly flags: "--input <json-or-file>";
|
|
245
|
+
readonly description: "Input for an authored .flow.ts, inline JSON or a file path";
|
|
246
|
+
}, {
|
|
247
|
+
readonly flags: "--bucket <file-bucket-uri>";
|
|
248
|
+
readonly description: "File bucket to fetch a sealed bundle from";
|
|
249
|
+
}, {
|
|
250
|
+
readonly flags: "--reuse-from <run-id>";
|
|
251
|
+
readonly description: "Reuse memoized step outputs from an earlier run";
|
|
252
|
+
}, {
|
|
253
|
+
readonly flags: "--cloud";
|
|
254
|
+
readonly description: "Submit to Agent Relay Cloud instead of running locally";
|
|
255
|
+
}, {
|
|
256
|
+
readonly flags: "--wait";
|
|
257
|
+
readonly description: "With --cloud, poll until the hosted run reaches a terminal state";
|
|
258
|
+
}, {
|
|
259
|
+
readonly flags: "--sync-code";
|
|
260
|
+
readonly description: "With --cloud, upload the working directory as the run’s tree; pull results back with `flows sync`";
|
|
261
|
+
}, {
|
|
262
|
+
readonly flags: "--no-connect";
|
|
263
|
+
readonly description: "With --cloud, refuse a missing integration instead of offering to connect it";
|
|
264
|
+
}];
|
|
265
|
+
readonly variants: readonly ["run", "cloud-run"];
|
|
266
|
+
}, {
|
|
267
|
+
readonly name: "schedule";
|
|
268
|
+
readonly description: "Register a flow to run in Cloud on a cron or interval, or on the one it declares";
|
|
269
|
+
readonly args: readonly [{
|
|
270
|
+
readonly name: "flow";
|
|
271
|
+
readonly description: "flow.yaml or flow.ts submitted on every fire";
|
|
272
|
+
readonly required: true;
|
|
273
|
+
}];
|
|
274
|
+
readonly options: readonly [{
|
|
275
|
+
readonly flags: "--cron <expr>";
|
|
276
|
+
readonly description: "Cron expression to fire on; with neither this nor --every, the flow’s own schedule.* handler supplies it";
|
|
277
|
+
}, {
|
|
278
|
+
readonly flags: "--every <duration>";
|
|
279
|
+
readonly description: "Fixed cadence, as <n><s|m|h|d>; not valid with --cron";
|
|
280
|
+
}, {
|
|
281
|
+
readonly flags: "--tz <iana>";
|
|
282
|
+
readonly description: "IANA timezone the cron is read in";
|
|
283
|
+
}, {
|
|
284
|
+
readonly flags: "--input <json-or-file>";
|
|
285
|
+
readonly description: "Input for an authored .flow.ts, inline JSON or a file path";
|
|
286
|
+
}, {
|
|
287
|
+
readonly flags: "--name <name>";
|
|
288
|
+
readonly description: "Name for the schedule";
|
|
289
|
+
}, CliOptionSpec, CliOptionSpec];
|
|
290
|
+
readonly variants: readonly ["schedule"];
|
|
291
|
+
}, {
|
|
292
|
+
readonly name: "schedules";
|
|
293
|
+
readonly description: "List this workspace’s Cloud schedules";
|
|
294
|
+
readonly options: readonly [CliOptionSpec];
|
|
295
|
+
readonly variants: readonly ["schedules"];
|
|
296
|
+
}, {
|
|
297
|
+
readonly name: "serve-webhook";
|
|
298
|
+
readonly description: "Run the local webhook receiver that writes provider deliveries into the trigger inbox";
|
|
299
|
+
readonly options: readonly [CliOptionSpec, {
|
|
300
|
+
readonly flags: "--port <port>";
|
|
301
|
+
readonly description: "Port to listen on, bound to 127.0.0.1; required";
|
|
302
|
+
}, {
|
|
303
|
+
readonly flags: "--allow <names>";
|
|
304
|
+
readonly description: "Comma-separated flow names this receiver admits";
|
|
305
|
+
}];
|
|
306
|
+
readonly variants: readonly ["serve-webhook"];
|
|
307
|
+
}, {
|
|
308
|
+
readonly name: "sync";
|
|
309
|
+
readonly description: "Apply a hosted run’s code changes to a local tree (replaces `agent-relay cloud sync`)";
|
|
310
|
+
readonly args: readonly [{
|
|
311
|
+
readonly name: "run-id";
|
|
312
|
+
readonly description: "Hosted run id whose patch to apply";
|
|
313
|
+
readonly required: true;
|
|
314
|
+
}];
|
|
315
|
+
readonly options: readonly [CliOptionSpec, {
|
|
316
|
+
readonly flags: "--dry-run";
|
|
317
|
+
readonly description: "Print the patch and apply nothing";
|
|
318
|
+
}, {
|
|
319
|
+
readonly flags: "--dir <path>";
|
|
320
|
+
readonly description: "Tree to apply the patch to";
|
|
321
|
+
readonly defaultValue: ".";
|
|
322
|
+
}];
|
|
323
|
+
readonly variants: readonly ["sync"];
|
|
324
|
+
}, {
|
|
325
|
+
readonly name: "tick";
|
|
326
|
+
readonly description: "Interval scheduler: launch a flow on a fixed local cadence";
|
|
327
|
+
readonly subcommands: readonly [{
|
|
328
|
+
readonly name: "start";
|
|
329
|
+
readonly description: "Start ticking in the foreground";
|
|
330
|
+
readonly args: readonly [{
|
|
331
|
+
readonly name: "spec";
|
|
332
|
+
readonly description: "Flow spec.json to launch each tick";
|
|
333
|
+
readonly required: true;
|
|
334
|
+
}];
|
|
335
|
+
readonly options: readonly [CliOptionSpec, {
|
|
336
|
+
readonly flags: "--schedule-id <id>";
|
|
337
|
+
readonly description: "Stable id identifying this schedule";
|
|
338
|
+
}, {
|
|
339
|
+
readonly flags: "--interval-ms <ms>";
|
|
340
|
+
readonly description: "Milliseconds between ticks";
|
|
341
|
+
}, {
|
|
342
|
+
readonly flags: "--epoch-ms <ms>";
|
|
343
|
+
readonly description: "Epoch the tick grid is aligned to";
|
|
344
|
+
}, {
|
|
345
|
+
readonly flags: "--max-catch-up <n>";
|
|
346
|
+
readonly description: "Most missed ticks to replay after a gap";
|
|
347
|
+
}, {
|
|
348
|
+
readonly flags: "--poll-interval-ms <ms>";
|
|
349
|
+
readonly description: "Milliseconds between schedule polls";
|
|
350
|
+
}];
|
|
351
|
+
}];
|
|
352
|
+
readonly variants: readonly ["tick"];
|
|
353
|
+
}, {
|
|
354
|
+
readonly name: "undeploy";
|
|
355
|
+
readonly description: "Remove a hosted trigger listener";
|
|
356
|
+
readonly args: readonly [{
|
|
357
|
+
readonly name: "deployment-id";
|
|
358
|
+
readonly description: "Deployment id to remove";
|
|
359
|
+
readonly required: true;
|
|
360
|
+
}];
|
|
361
|
+
readonly options: readonly [CliOptionSpec];
|
|
362
|
+
readonly variants: readonly ["undeploy"];
|
|
363
|
+
}, {
|
|
364
|
+
readonly name: "unschedule";
|
|
365
|
+
readonly description: "Remove a Cloud schedule, so it stops firing";
|
|
366
|
+
readonly args: readonly [{
|
|
367
|
+
readonly name: "schedule-id";
|
|
368
|
+
readonly description: "Schedule id to remove";
|
|
369
|
+
readonly required: true;
|
|
370
|
+
}];
|
|
371
|
+
readonly options: readonly [CliOptionSpec];
|
|
372
|
+
readonly variants: readonly ["unschedule"];
|
|
373
|
+
}];
|
|
374
|
+
/**
|
|
375
|
+
* Every `ParsedArgs` variant claimed by some verb in {@link CLI_VERBS}.
|
|
376
|
+
*
|
|
377
|
+
* Widened from the table rather than written down, so it tracks the table.
|
|
378
|
+
*/
|
|
379
|
+
type DeclaredVariant = (typeof CLI_VERBS)[number]['variants'][number];
|
|
380
|
+
/**
|
|
381
|
+
* Compile-time drift guard, the half a runtime test cannot cover.
|
|
382
|
+
*
|
|
383
|
+
* Adding a variant to `ParsedArgs` without giving some verb a claim on it
|
|
384
|
+
* leaves `Exclude<ParsedArgs['command'], DeclaredVariant>` non-`never`, and
|
|
385
|
+
* this assignment stops compiling. The reverse direction catches a table entry
|
|
386
|
+
* naming a variant that no longer exists.
|
|
387
|
+
*/
|
|
388
|
+
type AssertNever<T extends never> = T;
|
|
389
|
+
export type _EveryVariantIsDeclared = AssertNever<Exclude<ParsedArgs['command'], DeclaredVariant>>;
|
|
390
|
+
export type _EveryDeclaredVariantExists = AssertNever<Exclude<DeclaredVariant, ParsedArgs['command']>>;
|
|
391
|
+
/**
|
|
392
|
+
* The verbs `parseArgs` accepts. A token outside this set is refused before any
|
|
393
|
+
* per-verb parser sees it, which is what keeps dispatch and {@link CLI_VERBS}
|
|
394
|
+
* from drifting apart.
|
|
395
|
+
*/
|
|
396
|
+
export declare const CLI_VERB_NAMES: ReadonlySet<string>;
|
|
397
|
+
export {};
|
|
398
|
+
//# sourceMappingURL=cli-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-commands.d.ts","sourceRoot":"","sources":["../src/cli-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,wDAAwD;AACxD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,6EAA6E;AAC7E,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;CAC1C;AAED,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,IAAI,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,SAAS,aAAa,E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