@intentic/gate 1.248.0 → 1.249.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.
- package/README.md +23 -1
- package/dist/cli.js +35 -2
- package/dist/cli.js.map +1 -1
- package/dist/gate.d.ts +6 -1
- package/dist/gate.d.ts.map +1 -1
- package/dist/gate.js +8 -3
- package/dist/gate.js.map +1 -1
- package/dist/run.d.ts +62 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +229 -0
- package/dist/run.js.map +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -20,10 +20,32 @@ npx @intentic/gate "commit $SHA on $BRANCH — preview at $URL"
|
|
|
20
20
|
ceiling, network), which needs the pipeline's owner rather than the product's.
|
|
21
21
|
|
|
22
22
|
The URL (token and all) comes from `--url` or the `INTENTIC_GATE_URL` environment variable: the shape every
|
|
23
|
-
CI secret store hands things over in.
|
|
23
|
+
CI secret store hands things over in. On the wire the token leaves the URL: it is sent as `authorization:
|
|
24
|
+
Bearer …`, so the address that reaches the edge, the tunnel and every proxy's log names the door and nothing
|
|
25
|
+
else (`dialOf`). The request is the arguments joined, or stdin when none are given. The
|
|
24
26
|
`--wait` deadline (default 1800 s) rides to the server, and the HTTP client waits a minute longer, so the
|
|
25
27
|
deadline that fires is the server's: which stops the run instead of abandoning it mid-spend.
|
|
26
28
|
|
|
29
|
+
## Driving the agent: `intentic-gate run`
|
|
30
|
+
|
|
31
|
+
The same binary's second exchange, and not a door: with a control token minted on **Sandbox → Access → API
|
|
32
|
+
tokens** (`drive` scope, or `land` to merge as well) it starts an agent turn at the sandbox's own address, polls
|
|
33
|
+
the agent's card until it settles, and exits on how it ended:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
INTENTIC_URL=https://sandbox-….intentic.dev INTENTIC_TOKEN=ict_… \
|
|
37
|
+
npx @intentic/gate run --land "fix the flaky test in ci and open the diff"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- `completed` exits 0; `parked` (the agent asked a person for something) and `failed` exit 1, with the card's
|
|
41
|
+
own sentence; `timeout` exits 2, the deadline decided and the agent keeps working in the sandbox.
|
|
42
|
+
- One conversation per CI run and attempt (`--conversation` to pin one), its own branch, landed only with
|
|
43
|
+
`--land`. `--agent` picks the runtime, `--wait` the patience.
|
|
44
|
+
|
|
45
|
+
[src/run.ts](src/run.ts) is that exchange as pure functions plus `runExchange` with its effects injected, so the
|
|
46
|
+
CLI here and the Marketplace action share one implementation and [src/run.test.ts](src/run.test.ts) drives it
|
|
47
|
+
against a scripted daemon.
|
|
48
|
+
|
|
27
49
|
## Pipeline templates
|
|
28
50
|
|
|
29
51
|
GitHub Actions has a step of its own: the Marketplace action (`_sandbox/gate-action`), which wraps this
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
2
3
|
import { errorMessage } from "@intentic/base/errors";
|
|
3
|
-
import { clientTimeoutMs, exitOf, parseArgs, readVerdict,
|
|
4
|
+
import { clientTimeoutMs, dialOf, exitOf, parseArgs, readVerdict, USAGE } from "./gate.js";
|
|
5
|
+
import { exitOfRun, parseRunArgs, RUN_USAGE, RunExchangeError, runExchange } from "./run.js";
|
|
4
6
|
const readStdin = async () => {
|
|
5
7
|
const chunks = [];
|
|
6
8
|
for await (const chunk of process.stdin) {
|
|
@@ -8,6 +10,35 @@ const readStdin = async () => {
|
|
|
8
10
|
}
|
|
9
11
|
return Buffer.concat(chunks).toString("utf8");
|
|
10
12
|
};
|
|
13
|
+
if (process.argv[2] === "run") {
|
|
14
|
+
const parsedRun = parseRunArgs(process.argv.slice(3), process.env, randomUUID);
|
|
15
|
+
if (parsedRun.kind === "help") {
|
|
16
|
+
console.log(RUN_USAGE);
|
|
17
|
+
process.exit(0);
|
|
18
|
+
}
|
|
19
|
+
if (parsedRun.kind === "error") {
|
|
20
|
+
console.error(parsedRun.message);
|
|
21
|
+
console.error(`\n${RUN_USAGE}`);
|
|
22
|
+
process.exit(2);
|
|
23
|
+
}
|
|
24
|
+
const { call } = parsedRun;
|
|
25
|
+
const prompt = call.prompt !== "" ? call.prompt : process.stdin.isTTY ? "" : (await readStdin()).trim();
|
|
26
|
+
if (prompt === "") {
|
|
27
|
+
console.error("nothing to tell the agent: pass the prompt as arguments or on stdin");
|
|
28
|
+
process.exit(2);
|
|
29
|
+
}
|
|
30
|
+
let outcome;
|
|
31
|
+
try {
|
|
32
|
+
outcome = await runExchange({ ...call, prompt }, { fetch, sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)), now: Date.now });
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
console.error(error instanceof RunExchangeError ? error.message : errorMessage(error));
|
|
36
|
+
process.exit(2);
|
|
37
|
+
}
|
|
38
|
+
console.log(`${outcome.status}: ${outcome.summary}`);
|
|
39
|
+
console.log(`conversation ${outcome.conversationId}${outcome.branch === undefined ? "" : ` on ${outcome.branch}`}${outcome.landed === undefined ? "" : outcome.landed ? ", landed" : ", not landed"}`);
|
|
40
|
+
process.exit(exitOfRun(outcome.status));
|
|
41
|
+
}
|
|
11
42
|
const parsed = parseArgs(process.argv.slice(2), process.env["INTENTIC_GATE_URL"]);
|
|
12
43
|
if (parsed.kind === "help") {
|
|
13
44
|
console.log(USAGE);
|
|
@@ -22,8 +53,10 @@ const { call } = parsed;
|
|
|
22
53
|
const request = call.request !== "" ? call.request : process.stdin.isTTY ? "" : (await readStdin()).trim();
|
|
23
54
|
let response;
|
|
24
55
|
try {
|
|
25
|
-
|
|
56
|
+
const dial = dialOf(call.url, call.waitS);
|
|
57
|
+
response = await fetch(dial.url, {
|
|
26
58
|
method: "POST",
|
|
59
|
+
headers: dial.headers,
|
|
27
60
|
body: request,
|
|
28
61
|
signal: AbortSignal.timeout(clientTimeoutMs(call.waitS)),
|
|
29
62
|
});
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAmB,WAAW,EAAE,MAAM,UAAU,CAAC;AAK9G,MAAM,SAAS,GAAG,KAAK,IAAqB,EAAE;IAC1C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC,CAAC;AAGF,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC;IAC5B,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAC/E,IAAI,SAAS,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,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,IAAI,CAAC;IACD,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAAC,MAAM,CAAC;IACL,IAAI,GAAG,SAAS,CAAC;AACrB,CAAC;AACD,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AAClC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;IACxB,OAAO,CAAC,KAAK,CAAC,wCAAwC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAGD,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACrD,OAAO,CAAC,GAAG,CAAC,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;AACpC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC"}
|
package/dist/gate.d.ts
CHANGED
|
@@ -22,8 +22,13 @@ export type Parsed = {
|
|
|
22
22
|
export declare const WAIT_DEFAULT_S = 1800;
|
|
23
23
|
export declare const USAGE = "intentic-gate: run an intentic release gate and exit on its verdict\n\nusage: intentic-gate [options] [request...]\n\nThe request, what this pipeline knows: commit, branch, preview URL, is the arguments joined,\nor stdin when none are given (so `git log -1 | intentic-gate` works).\n\noptions:\n --url <url> the gate's webhook URL, token and all (or env INTENTIC_GATE_URL)\n --wait <seconds> how long the gate holds the connection (default 1800; the server caps at 3h)\n --blocked <code> exit code for a blocked verdict (default 0: \"could not judge\" is not a failed build)\n -h, --help this text\n\nexit codes: 0 pass (and blocked, unless --blocked says otherwise) \u00B7 1 fail \u00B7 2 the exchange itself\nfailed, wrong token, no such gate, daily ceiling reached, network. 2 is never a verdict: it means\nthe pipeline's wiring needs a person, not that the product does.";
|
|
24
24
|
export declare const parseArgs: (argv: readonly string[], envUrl: string | undefined) => Parsed;
|
|
25
|
-
export
|
|
25
|
+
export interface Dial {
|
|
26
|
+
readonly url: string;
|
|
27
|
+
readonly headers: Record<string, string>;
|
|
28
|
+
}
|
|
29
|
+
export declare const dialOf: (url: string, waitS?: number) => Dial;
|
|
26
30
|
export declare const clientTimeoutMs: (waitS: number) => number;
|
|
27
31
|
export declare const readVerdict: (body: unknown) => GateVerdict | undefined;
|
|
28
32
|
export declare const exitOf: (verdict: GateVerdict, blockedExit: number) => number;
|
|
33
|
+
export * from "./run.js";
|
|
29
34
|
//# sourceMappingURL=gate.d.ts.map
|
package/dist/gate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,QAAQ;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,MAAM,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9G,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,eAAO,MAAM,KAAK,m4BAe+C,CAAC;AAElE,eAAO,MAAM,SAAS,SAAU,SAAS,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,KAAG,MAwC/E,CAAC;AAIF,MAAM,WAAW,IAAI;IACjB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5C;AAED,eAAO,MAAM,MAAM,QAAS,MAAM,UAAU,MAAM,KAAG,IAQpD,CAAC;AAGF,eAAO,MAAM,eAAe,UAAW,MAAM,KAAG,MAA8B,CAAC;AAM/E,eAAO,MAAM,WAAW,SAAU,OAAO,KAAG,WAAW,GAAG,SAczD,CAAC;AAEF,eAAO,MAAM,MAAM,YAAa,WAAW,eAAe,MAAM,KAAG,MAKlE,CAAC;AAGF,cAAc,UAAU,CAAC"}
|
package/dist/gate.js
CHANGED
|
@@ -57,10 +57,14 @@ export const parseArgs = (argv, envUrl) => {
|
|
|
57
57
|
}
|
|
58
58
|
return { kind: "call", call: { url, waitS, blockedExit, request: words.join(" ") } };
|
|
59
59
|
};
|
|
60
|
-
export const
|
|
60
|
+
export const dialOf = (url, waitS) => {
|
|
61
61
|
const target = new URL(url);
|
|
62
|
-
target.searchParams.
|
|
63
|
-
|
|
62
|
+
const token = target.searchParams.get("token");
|
|
63
|
+
target.searchParams.delete("token");
|
|
64
|
+
if (waitS !== undefined) {
|
|
65
|
+
target.searchParams.set("wait", String(waitS));
|
|
66
|
+
}
|
|
67
|
+
return { url: target.toString(), headers: token === null || token === "" ? {} : { authorization: `Bearer ${token}` } };
|
|
64
68
|
};
|
|
65
69
|
export const clientTimeoutMs = (waitS) => (waitS + 60) * 1_000;
|
|
66
70
|
const OUTCOMES = new Set(["pass", "fail", "blocked"]);
|
|
@@ -85,4 +89,5 @@ export const exitOf = (verdict, blockedExit) => {
|
|
|
85
89
|
}
|
|
86
90
|
return verdict.outcome === "fail" ? 1 : blockedExit;
|
|
87
91
|
};
|
|
92
|
+
export * from "./run.js";
|
|
88
93
|
//# sourceMappingURL=gate.js.map
|
package/dist/gate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.js","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gate.js","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;sEASiD,cAAc;;;;;;iEAMnB,CAAC;AAElE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAuB,EAAE,MAA0B,EAAU,EAAE;IACrF,IAAI,GAAG,GAAG,MAAM,CAAC;IACjB,IAAI,KAAK,GAAG,cAAc,CAAC;IAC3B,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,CAAW,CAAC;QAC/B,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YACnC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC5B,CAAC;QACD,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;YAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YAC3B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACtB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG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QACH,OAAO,EAAE,OAAiC;QAC1C,MAAM;QACN,KAAK;QACL,GAAG,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAoB,EAAE,WAAmB,EAAU,EAAE;IACxE,IAAI,OAAO,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;QAC7B,OAAO,CAAC,CAAC;IACb,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;AACxD,CAAC,CAAC;AAGF,cAAc,UAAU,CAAC"}
|
package/dist/run.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export declare const RUN_WAIT_DEFAULT_S = 1800;
|
|
2
|
+
export declare const RUN_POLL_MS = 5000;
|
|
3
|
+
export interface RunCall {
|
|
4
|
+
readonly origin: string;
|
|
5
|
+
readonly token: string;
|
|
6
|
+
readonly prompt: string;
|
|
7
|
+
readonly conversationId: string;
|
|
8
|
+
readonly agent?: string;
|
|
9
|
+
readonly waitS: number;
|
|
10
|
+
readonly land: boolean;
|
|
11
|
+
}
|
|
12
|
+
export type RunStatus = "completed" | "parked" | "failed" | "timeout";
|
|
13
|
+
export interface RunOutcome {
|
|
14
|
+
readonly status: RunStatus;
|
|
15
|
+
readonly conversationId: string;
|
|
16
|
+
readonly branch?: string;
|
|
17
|
+
readonly summary: string;
|
|
18
|
+
readonly landed?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const runRequestBody: (call: RunCall) => Record<string, unknown>;
|
|
21
|
+
export declare const conversationIdFor: (env: Readonly<Record<string, string | undefined>>, random: () => string) => string;
|
|
22
|
+
export interface AgentCard {
|
|
23
|
+
readonly status: string;
|
|
24
|
+
readonly title?: string;
|
|
25
|
+
readonly failure?: string;
|
|
26
|
+
readonly branch?: string;
|
|
27
|
+
readonly attention?: Readonly<Record<string, boolean>>;
|
|
28
|
+
}
|
|
29
|
+
export declare const readCard: (body: unknown) => AgentCard | undefined;
|
|
30
|
+
export declare const settledOf: (card: AgentCard) => RunStatus | undefined;
|
|
31
|
+
export declare const summaryOfCard: (card: AgentCard, status: RunStatus) => string;
|
|
32
|
+
export declare const exitOfRun: (status: RunStatus) => number;
|
|
33
|
+
export type ParsedRun = {
|
|
34
|
+
kind: "call";
|
|
35
|
+
call: RunCall;
|
|
36
|
+
} | {
|
|
37
|
+
kind: "help";
|
|
38
|
+
} | {
|
|
39
|
+
kind: "error";
|
|
40
|
+
message: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const RUN_USAGE = "intentic-gate run: start an agent turn in your sandbox and exit on how it ended\n\nusage: intentic-gate run [options] [prompt...]\n\nThe prompt is the arguments joined, or stdin when none are given.\n\noptions:\n --url <origin> the sandbox's own address (or env INTENTIC_URL)\n --token <ict_\u2026> a control token minted on Sandbox \u2192 Access (or env INTENTIC_TOKEN); drive scope, or\n land scope with --land\n --agent <name> which agent runs it (claude, codex, \u2026); default: the sandbox's own\n --conversation <id> the conversation to open or continue; default: one per CI run\n --wait <seconds> how long to wait for the turn to settle (default 1800)\n --land merge the branch into the main tree once the turn completes\n -h, --help this text\n\nexit codes: 0 completed \u00B7 1 parked on a person, or failed \u00B7 2 the exchange itself failed, or the turn\nwas still running at the deadline (it keeps working in the sandbox).";
|
|
43
|
+
export declare const parseRunArgs: (argv: readonly string[], env: Readonly<Record<string, string | undefined>>, random: () => string) => ParsedRun;
|
|
44
|
+
export declare const originOf: (url: string) => string | undefined;
|
|
45
|
+
export interface RunDeps {
|
|
46
|
+
readonly fetch: (url: string, init: {
|
|
47
|
+
method: string;
|
|
48
|
+
headers: Record<string, string>;
|
|
49
|
+
body?: string;
|
|
50
|
+
}) => Promise<{
|
|
51
|
+
ok: boolean;
|
|
52
|
+
status: number;
|
|
53
|
+
text: () => Promise<string>;
|
|
54
|
+
}>;
|
|
55
|
+
readonly sleep: (ms: number) => Promise<void>;
|
|
56
|
+
readonly now: () => number;
|
|
57
|
+
}
|
|
58
|
+
export declare class RunExchangeError extends Error {
|
|
59
|
+
}
|
|
60
|
+
export declare const detailOf: (text: string) => string;
|
|
61
|
+
export declare const runExchange: (call: RunCall, deps: RunDeps) => Promise<RunOutcome>;
|
|
62
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,eAAO,MAAM,WAAW,OAAQ,CAAC;AAEjC,MAAM,WAAW,OAAO;IAEpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEtE,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC7B;AAGD,eAAO,MAAM,cAAc,SAAU,OAAO,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAMnE,CAAC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IACpB,QAAQ,CAAC,KAAK,EAAE,CACZ,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KACvE,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC,CAAC;IAC3E,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;CAC9B;AAID,qBAAa,gBAAiB,SAAQ,KAAK;CAAG;AAI9C,eAAO,MAAM,QAAQ,SAAU,MAAM,KAAG,MAOvC,CAAC;AA4BF,eAAO,MAAM,WAAW,SAAgB,OAAO,QAAQ,OAAO,KAAG,OAAO,CAAC,UAAU,CAoClF,CAAC"}
|
package/dist/run.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
export const RUN_WAIT_DEFAULT_S = 1800;
|
|
2
|
+
export const RUN_POLL_MS = 5_000;
|
|
3
|
+
export const runRequestBody = (call) => ({
|
|
4
|
+
prompt: call.prompt,
|
|
5
|
+
conversationId: call.conversationId,
|
|
6
|
+
isolated: true,
|
|
7
|
+
...(call.agent === undefined ? {} : { agent: call.agent }),
|
|
8
|
+
});
|
|
9
|
+
export const conversationIdFor = (env, random) => {
|
|
10
|
+
const runId = env["GITHUB_RUN_ID"] ?? "";
|
|
11
|
+
if (runId === "") {
|
|
12
|
+
return `ci-${random()
|
|
13
|
+
.replaceAll(/[^a-zA-Z0-9_-]/g, "")
|
|
14
|
+
.slice(0, 24)}`;
|
|
15
|
+
}
|
|
16
|
+
const attempt = env["GITHUB_RUN_ATTEMPT"] ?? "1";
|
|
17
|
+
return `ci-${runId}-${attempt}`.replaceAll(/[^a-zA-Z0-9_-]/g, "-").slice(0, 64);
|
|
18
|
+
};
|
|
19
|
+
export const readCard = (body) => {
|
|
20
|
+
if (typeof body !== "object" || body === null) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
const { status, title, failure, branch, attention } = body;
|
|
24
|
+
if (typeof status !== "string") {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
status,
|
|
29
|
+
...(typeof title === "string" ? { title } : {}),
|
|
30
|
+
...(typeof failure === "string" ? { failure } : {}),
|
|
31
|
+
...(typeof branch === "string" ? { branch } : {}),
|
|
32
|
+
...(typeof attention === "object" && attention !== null ? { attention: attention } : {}),
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const IN_FLIGHT = new Set(["running", "stopping", "dismissing", "resuming"]);
|
|
36
|
+
export const settledOf = (card) => {
|
|
37
|
+
if (IN_FLIGHT.has(card.status)) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
if (card.status === "awaiting") {
|
|
41
|
+
return "parked";
|
|
42
|
+
}
|
|
43
|
+
return card.status === "error" || card.status === "interrupted" || card.status === "conflict" ? "failed" : "completed";
|
|
44
|
+
};
|
|
45
|
+
const PARKED_ON = [
|
|
46
|
+
["plan", "a plan waiting for approval"],
|
|
47
|
+
["question", "a question"],
|
|
48
|
+
["permission", "a permission request"],
|
|
49
|
+
["capability", "something to be connected"],
|
|
50
|
+
["credential", "a gated credential"],
|
|
51
|
+
];
|
|
52
|
+
export const summaryOfCard = (card, status) => {
|
|
53
|
+
if (status === "parked") {
|
|
54
|
+
const on = PARKED_ON.find(([key]) => card.attention?.[key] === true)?.[1] ?? "a card only a person can answer";
|
|
55
|
+
return `The agent is parked on ${on}: open the conversation in the sandbox to answer it.`;
|
|
56
|
+
}
|
|
57
|
+
if (status === "failed") {
|
|
58
|
+
return card.failure ?? `The turn ended with status "${card.status}".`;
|
|
59
|
+
}
|
|
60
|
+
return card.title ?? "The agent finished.";
|
|
61
|
+
};
|
|
62
|
+
export const exitOfRun = (status) => (status === "completed" ? 0 : status === "timeout" ? 2 : 1);
|
|
63
|
+
export const RUN_USAGE = `intentic-gate run: start an agent turn in your sandbox and exit on how it ended
|
|
64
|
+
|
|
65
|
+
usage: intentic-gate run [options] [prompt...]
|
|
66
|
+
|
|
67
|
+
The prompt is the arguments joined, or stdin when none are given.
|
|
68
|
+
|
|
69
|
+
options:
|
|
70
|
+
--url <origin> the sandbox's own address (or env INTENTIC_URL)
|
|
71
|
+
--token <ict_…> a control token minted on Sandbox → Access (or env INTENTIC_TOKEN); drive scope, or
|
|
72
|
+
land scope with --land
|
|
73
|
+
--agent <name> which agent runs it (claude, codex, …); default: the sandbox's own
|
|
74
|
+
--conversation <id> the conversation to open or continue; default: one per CI run
|
|
75
|
+
--wait <seconds> how long to wait for the turn to settle (default ${RUN_WAIT_DEFAULT_S})
|
|
76
|
+
--land merge the branch into the main tree once the turn completes
|
|
77
|
+
-h, --help this text
|
|
78
|
+
|
|
79
|
+
exit codes: 0 completed · 1 parked on a person, or failed · 2 the exchange itself failed, or the turn
|
|
80
|
+
was still running at the deadline (it keeps working in the sandbox).`;
|
|
81
|
+
const VALUE_OPTIONS = new Set(["--url", "--token", "--agent", "--conversation", "--wait"]);
|
|
82
|
+
const scanRunArgs = (argv) => {
|
|
83
|
+
const values = new Map();
|
|
84
|
+
const words = [];
|
|
85
|
+
let land = false;
|
|
86
|
+
for (let at = 0; at < argv.length; at += 1) {
|
|
87
|
+
const arg = argv[at];
|
|
88
|
+
if (arg === "-h" || arg === "--help") {
|
|
89
|
+
return { help: true, land, values, words };
|
|
90
|
+
}
|
|
91
|
+
if (arg === "--land") {
|
|
92
|
+
land = true;
|
|
93
|
+
}
|
|
94
|
+
else if (VALUE_OPTIONS.has(arg)) {
|
|
95
|
+
const value = argv[at + 1];
|
|
96
|
+
if (value === undefined) {
|
|
97
|
+
return { help: false, land, values, words, error: `${arg} needs a value` };
|
|
98
|
+
}
|
|
99
|
+
values.set(arg, value);
|
|
100
|
+
at += 1;
|
|
101
|
+
}
|
|
102
|
+
else if (arg.startsWith("--")) {
|
|
103
|
+
return { help: false, land, values, words, error: `unknown option ${arg}` };
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
words.push(arg);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return { help: false, land, values, words };
|
|
110
|
+
};
|
|
111
|
+
const waitOf = (raw) => {
|
|
112
|
+
if (raw === undefined) {
|
|
113
|
+
return RUN_WAIT_DEFAULT_S;
|
|
114
|
+
}
|
|
115
|
+
const numeric = Number(raw);
|
|
116
|
+
return Number.isInteger(numeric) && numeric >= 0 ? numeric : { error: `--wait needs a whole number, not "${raw}"` };
|
|
117
|
+
};
|
|
118
|
+
const addressOf = (scanned, env) => {
|
|
119
|
+
const url = scanned.values.get("--url") ?? env["INTENTIC_URL"] ?? "";
|
|
120
|
+
const token = scanned.values.get("--token") ?? env["INTENTIC_TOKEN"] ?? "";
|
|
121
|
+
if (url === "") {
|
|
122
|
+
return { error: "no sandbox URL: pass --url or set INTENTIC_URL" };
|
|
123
|
+
}
|
|
124
|
+
if (token === "") {
|
|
125
|
+
return { error: "no control token: pass --token or set INTENTIC_TOKEN (minted on Sandbox → Access → API tokens)" };
|
|
126
|
+
}
|
|
127
|
+
const origin = originOf(url);
|
|
128
|
+
return origin === undefined ? { error: `the URL is not a sandbox address: ${url}` } : { origin, token };
|
|
129
|
+
};
|
|
130
|
+
export const parseRunArgs = (argv, env, random) => {
|
|
131
|
+
const scanned = scanRunArgs(argv);
|
|
132
|
+
if (scanned.error !== undefined) {
|
|
133
|
+
return { kind: "error", message: scanned.error };
|
|
134
|
+
}
|
|
135
|
+
if (scanned.help) {
|
|
136
|
+
return { kind: "help" };
|
|
137
|
+
}
|
|
138
|
+
const address = addressOf(scanned, env);
|
|
139
|
+
if ("error" in address) {
|
|
140
|
+
return { kind: "error", message: address.error };
|
|
141
|
+
}
|
|
142
|
+
const waitS = waitOf(scanned.values.get("--wait"));
|
|
143
|
+
if (typeof waitS !== "number") {
|
|
144
|
+
return { kind: "error", message: waitS.error };
|
|
145
|
+
}
|
|
146
|
+
const agent = scanned.values.get("--agent");
|
|
147
|
+
return {
|
|
148
|
+
kind: "call",
|
|
149
|
+
call: {
|
|
150
|
+
...address,
|
|
151
|
+
prompt: scanned.words.join(" "),
|
|
152
|
+
conversationId: scanned.values.get("--conversation") ?? conversationIdFor(env, random),
|
|
153
|
+
...(agent === undefined ? {} : { agent }),
|
|
154
|
+
waitS,
|
|
155
|
+
land: scanned.land,
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
export const originOf = (url) => {
|
|
160
|
+
try {
|
|
161
|
+
return new URL(url).origin;
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
export class RunExchangeError extends Error {
|
|
168
|
+
}
|
|
169
|
+
export const detailOf = (text) => {
|
|
170
|
+
try {
|
|
171
|
+
const body = JSON.parse(text);
|
|
172
|
+
return typeof body.error === "string" ? body.error : text;
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
return text;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
const headersFor = (call) => ({ "x-intentic-control": call.token, "content-type": "application/json" });
|
|
179
|
+
const answerOf = async (deps, what, url, init) => {
|
|
180
|
+
const response = await deps.fetch(url, init).catch((error) => {
|
|
181
|
+
throw new RunExchangeError(`${what} could not be reached: ${error instanceof Error ? error.message : String(error)}`);
|
|
182
|
+
});
|
|
183
|
+
const text = await response.text();
|
|
184
|
+
if (!response.ok) {
|
|
185
|
+
const hint = response.status === 403 && what === "the land" ? " (the token needs land scope)" : "";
|
|
186
|
+
throw new RunExchangeError(`${what} answered ${response.status}: ${detailOf(text)}${hint}`);
|
|
187
|
+
}
|
|
188
|
+
try {
|
|
189
|
+
return JSON.parse(text);
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
throw new RunExchangeError(`${what}'s answer was not JSON: ${text.slice(0, 200)}`);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
export const runExchange = async (call, deps) => {
|
|
196
|
+
const cardUrl = `${call.origin}/agents/${encodeURIComponent(call.conversationId)}`;
|
|
197
|
+
await answerOf(deps, "the agent", `${call.origin}/agent`, {
|
|
198
|
+
method: "POST",
|
|
199
|
+
headers: headersFor(call),
|
|
200
|
+
body: JSON.stringify(runRequestBody(call)),
|
|
201
|
+
});
|
|
202
|
+
const deadline = deps.now() + call.waitS * 1_000;
|
|
203
|
+
let card;
|
|
204
|
+
let status;
|
|
205
|
+
while (status === undefined) {
|
|
206
|
+
await deps.sleep(RUN_POLL_MS);
|
|
207
|
+
card = readCard(await answerOf(deps, "the agent card", cardUrl, { method: "GET", headers: headersFor(call) }));
|
|
208
|
+
if (card === undefined) {
|
|
209
|
+
throw new RunExchangeError("the agent card could not be read");
|
|
210
|
+
}
|
|
211
|
+
status = settledOf(card);
|
|
212
|
+
if (status === undefined && deps.now() >= deadline) {
|
|
213
|
+
status = "timeout";
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const branch = card?.branch ?? `agent/${call.conversationId}`;
|
|
217
|
+
const outcome = {
|
|
218
|
+
status,
|
|
219
|
+
conversationId: call.conversationId,
|
|
220
|
+
branch,
|
|
221
|
+
summary: status === "timeout" ? `Still running after ${call.waitS}s; it keeps working in the sandbox.` : summaryOfCard(card, status),
|
|
222
|
+
};
|
|
223
|
+
if (!call.land || status !== "completed") {
|
|
224
|
+
return outcome;
|
|
225
|
+
}
|
|
226
|
+
const landed = (await answerOf(deps, "the land", `${cardUrl}/land`, { method: "POST", headers: headersFor(call), body: "{}" }));
|
|
227
|
+
return { ...outcome, landed: landed.landed === true };
|
|
228
|
+
};
|
|
229
|
+
//# sourceMappingURL=run.js.map
|
package/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U,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAE7H,CAAC;IACF,OAAO,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;AAC1D,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentic/gate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.249.0",
|
|
4
4
|
"description": "Run an intentic release gate from a CI pipeline, POST what the pipeline knows, wait for the run, exit on the verdict",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"intentic-gate": "./dist/cli.js"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@intentic/base": "1.
|
|
33
|
+
"@intentic/base": "1.249.0",
|
|
34
34
|
"tslib": "2.8.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@intentic/sandbox-contract": "1.
|
|
37
|
+
"@intentic/sandbox-contract": "1.249.0",
|
|
38
38
|
"@intentic/testing": "0.0.0",
|
|
39
39
|
"@intentic/tsconfig": "0.0.0",
|
|
40
40
|
"@types/node": "24.13.2",
|