@usine/agents 0.0.1 → 0.2.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.
Files changed (74) hide show
  1. package/README.md +52 -2
  2. package/dist/pi/authentication.d.ts +13 -0
  3. package/dist/pi/authentication.d.ts.map +1 -0
  4. package/dist/pi/authentication.js +14 -0
  5. package/dist/pi/authentication.js.map +1 -0
  6. package/dist/pi/children.d.ts +8 -0
  7. package/dist/pi/children.d.ts.map +1 -0
  8. package/dist/pi/children.js +29 -0
  9. package/dist/pi/children.js.map +1 -0
  10. package/dist/pi/claude.d.ts +36 -0
  11. package/dist/pi/claude.d.ts.map +1 -0
  12. package/dist/pi/claude.js +244 -0
  13. package/dist/pi/claude.js.map +1 -0
  14. package/dist/pi/codex/account.d.ts +11 -0
  15. package/dist/pi/codex/account.d.ts.map +1 -0
  16. package/dist/pi/codex/account.js +43 -0
  17. package/dist/pi/codex/account.js.map +1 -0
  18. package/dist/pi/codex/app-server.d.ts +33 -0
  19. package/dist/pi/codex/app-server.d.ts.map +1 -0
  20. package/dist/pi/codex/app-server.js +227 -0
  21. package/dist/pi/codex/app-server.js.map +1 -0
  22. package/dist/pi/codex/codex.d.ts +7 -0
  23. package/dist/pi/codex/codex.d.ts.map +1 -0
  24. package/dist/pi/codex/codex.js +362 -0
  25. package/dist/pi/codex/codex.js.map +1 -0
  26. package/dist/pi/live.d.ts +4 -0
  27. package/dist/pi/live.d.ts.map +1 -0
  28. package/dist/pi/live.js +11 -0
  29. package/dist/pi/live.js.map +1 -0
  30. package/dist/pi/pi.d.ts +9 -0
  31. package/dist/pi/pi.d.ts.map +1 -0
  32. package/dist/pi/pi.js +311 -0
  33. package/dist/pi/pi.js.map +1 -0
  34. package/dist/pi/sdk.d.ts +71 -0
  35. package/dist/pi/sdk.d.ts.map +1 -0
  36. package/dist/pi/sdk.js +159 -0
  37. package/dist/pi/sdk.js.map +1 -0
  38. package/dist/pi/session.d.ts +45 -0
  39. package/dist/pi/session.d.ts.map +1 -0
  40. package/dist/pi/session.js +179 -0
  41. package/dist/pi/session.js.map +1 -0
  42. package/dist/pi/subagents.d.ts +27 -0
  43. package/dist/pi/subagents.d.ts.map +1 -0
  44. package/dist/pi/subagents.js +113 -0
  45. package/dist/pi/subagents.js.map +1 -0
  46. package/dist/pi/thinking.d.ts +8 -0
  47. package/dist/pi/thinking.d.ts.map +1 -0
  48. package/dist/pi/thinking.js +15 -0
  49. package/dist/pi/thinking.js.map +1 -0
  50. package/dist/preflight/command.d.ts +7 -0
  51. package/dist/preflight/command.d.ts.map +1 -0
  52. package/dist/preflight/command.js +42 -0
  53. package/dist/preflight/command.js.map +1 -0
  54. package/dist/preflight/preflight.d.ts +13 -0
  55. package/dist/preflight/preflight.d.ts.map +1 -0
  56. package/dist/preflight/preflight.js +100 -0
  57. package/dist/preflight/preflight.js.map +1 -0
  58. package/dist/prompt.d.ts +26 -0
  59. package/dist/prompt.d.ts.map +1 -0
  60. package/dist/prompt.js +45 -0
  61. package/dist/prompt.js.map +1 -0
  62. package/dist/protocol/codex.d.ts +70 -0
  63. package/dist/protocol/codex.d.ts.map +1 -0
  64. package/dist/protocol/codex.js +8 -0
  65. package/dist/protocol/codex.js.map +1 -0
  66. package/dist/runtime.d.ts +132 -0
  67. package/dist/runtime.d.ts.map +1 -0
  68. package/dist/runtime.js +109 -0
  69. package/dist/runtime.js.map +1 -0
  70. package/package.json +48 -5
  71. package/dist/index.d.ts +0 -8
  72. package/dist/index.d.ts.map +0 -1
  73. package/dist/index.js +0 -8
  74. package/dist/index.js.map +0 -1
@@ -0,0 +1,42 @@
1
+ import { HarnessUnavailableError } from "@usine/core/agent/capability";
2
+ import { Effect, Option, Stream } from "effect";
3
+ import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
4
+ import { homedir } from "node:os";
5
+ import { SessionOperationError } from "../runtime.js";
6
+ /** Runs a bounded readiness command without retaining its potentially sensitive diagnostics. */
7
+ export const probeCommand = Effect.fn("HarnessPreflight.command")(function* (harness, capability, command, args) {
8
+ yield* Effect.annotateCurrentSpan({ harness, capability });
9
+ const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
10
+ return yield* Effect.scoped(Effect.gen(function* () {
11
+ const handle = yield* spawner.spawn(ChildProcess.make(command, args, {
12
+ cwd: homedir(),
13
+ detached: false,
14
+ forceKillAfter: "2 seconds",
15
+ }));
16
+ const [stdout, , exitCode] = yield* Effect.all([
17
+ handle.stdout.pipe(Stream.decodeText(), Stream.mkString),
18
+ handle.stderr.pipe(Stream.runDrain),
19
+ handle.exitCode,
20
+ ], { concurrency: "unbounded" });
21
+ if (exitCode !== 0)
22
+ return yield* new HarnessUnavailableError({
23
+ harness,
24
+ capability,
25
+ message: `${command} ${args.join(" ")} failed; check the Worker's ${harness} installation and login`,
26
+ });
27
+ return stdout.trim();
28
+ })).pipe(Effect.timeout("30 seconds"), Effect.catchTags({
29
+ PlatformError: () => new HarnessUnavailableError({
30
+ harness,
31
+ capability,
32
+ message: `Worker cannot execute ${command}`,
33
+ }),
34
+ TimeoutError: (cause) => new SessionOperationError({
35
+ operation: "launch",
36
+ sessionId: Option.none(),
37
+ message: `${command} readiness check timed out`,
38
+ cause,
39
+ }),
40
+ }));
41
+ });
42
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/preflight/command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAA0B,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,gGAAgG;AAChG,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,C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AAC,OAAO,CAAC,YAAY,CAAC,EAC5B,MAAM,CAAC,SAAS,CAAC;QACf,aAAa,EAAE,GAAG,EAAE,CAClB,IAAI,uBAAuB,CAAC;YAC1B,OAAO;YACP,UAAU;YACV,OAAO,EAAE,yBAAyB,OAAO,EAAE;SAC5C,CAAC;QACJ,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE,CACtB,IAAI,qBAAqB,CAAC;YACxB,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE;YACxB,OAAO,EAAE,GAAG,OAAO,4BAA4B;YAC/C,KAAK;SACN,CAAC;KACL,CAAC,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { BrainSpec } from "@usine/core/agent/brain";
2
+ import { HarnessReady, HarnessUnavailableError } from "@usine/core/agent/capability";
3
+ import { Effect } from "effect";
4
+ import { SessionOperationError } from "../runtime.ts";
5
+ import { CodexAppServer } from "../pi/codex/app-server.ts";
6
+ import { PiSdk } from "../pi/sdk.ts";
7
+ /** Baseline Codex CLI version used by the pinned app-server protocol conformance gate. */
8
+ export declare const CODEX_CLI_VERSION = "0.144.0";
9
+ /** Verifies a rostered brain through supplied process and SDK services; starts no prompt. */
10
+ export declare const verifyHarness: (brain: BrainSpec) => Effect.Effect<HarnessReady, HarnessUnavailableError | SessionOperationError, import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner | CodexAppServer | PiSdk>;
11
+ /** Checks only the requested brain using the worker user's configuration, without running a prompt or logging in. */
12
+ export declare const preflight: (brain: BrainSpec) => Effect.Effect<HarnessReady, HarnessUnavailableError | SessionOperationError, import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner>;
13
+ //# sourceMappingURL=preflight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/preflight/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAoB,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,cAAc,EAAsB,MAAM,2BAA2B,CAAC;AAE/E,OAAO,EAAE,KAAK,EAAyB,MAAM,cAAc,CAAC;AAG5D,0FAA0F;AAC1F,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAW3C,6FAA6F;AAC7F,eAAO,MAAM,aAAa,wMA4GzB,CAAC;AAEF,qHAAqH;AACrH,eAAO,MAAM,SAAS,UAAW,SAAS,4JACgD,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { HarnessReady, HarnessUnavailableError } from "@usine/core/agent/capability";
2
+ import { Effect, Option, Schema } from "effect";
3
+ import { homedir } from "node:os";
4
+ import { SessionOperationError, WorkingDirectory } from "../runtime.js";
5
+ import { CodexAppServer, codexAppServerLive } from "../pi/codex/app-server.js";
6
+ import { initializeCodex, verifyCodexAccount } from "../pi/codex/account.js";
7
+ import { PiSdk, piSdkLive, usePiStart } from "../pi/sdk.js";
8
+ import { probeCommand } from "./command.js";
9
+ /** Baseline Codex CLI version used by the pinned app-server protocol conformance gate. */
10
+ export const CODEX_CLI_VERSION = "0.144.0";
11
+ // Additional exact builds require generated-type review and the live contracts.
12
+ const supportedCodexVersions = [CODEX_CLI_VERSION, "0.153.4"];
13
+ const ClaudeAuthentication = Schema.Struct({
14
+ loggedIn: Schema.Boolean,
15
+ authMethod: Schema.String,
16
+ apiProvider: Schema.String,
17
+ });
18
+ /** Verifies a rostered brain through supplied process and SDK services; starts no prompt. */
19
+ export const verifyHarness = Effect.fn("HarnessPreflight.verify")(function* (brain) {
20
+ yield* Effect.annotateCurrentSpan({ harness: brain.harness, model: brain.model });
21
+ const loginError = (message) => new HarnessUnavailableError({
22
+ harness: brain.harness,
23
+ capability: "login",
24
+ message,
25
+ });
26
+ switch (brain.harness) {
27
+ case "codex": {
28
+ const version = yield* probeCommand("codex", "binary", "codex", ["--version"]);
29
+ if (!supportedCodexVersions.some((supported) => version === `codex-cli ${supported}`))
30
+ return yield* new HarnessUnavailableError({
31
+ harness: "codex",
32
+ capability: "version",
33
+ message: `Worker has ${/^codex-cli [0-9]+\.[0-9]+\.[0-9]+$/u.test(version) ? version : "an unrecognized Codex version"}; supported Codex CLI versions: ${supportedCodexVersions.join(", ")}`,
34
+ });
35
+ yield* Effect.scoped(Effect.gen(function* () {
36
+ const server = yield* CodexAppServer;
37
+ const connection = yield* server.open({
38
+ cwd: WorkingDirectory.make(homedir()),
39
+ sessionId: Option.none(),
40
+ });
41
+ yield* initializeCodex(connection);
42
+ yield* verifyCodexAccount(connection, brain.model);
43
+ })).pipe(Effect.catchTag("PoolUnavailableError", (error) => loginError(error.message)));
44
+ break;
45
+ }
46
+ case "claude": {
47
+ yield* probeCommand("claude", "binary", "claude", ["--version"]);
48
+ const response = yield* probeCommand("claude", "login", "claude", [
49
+ "auth",
50
+ "status",
51
+ "--json",
52
+ ]);
53
+ const auth = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(ClaudeAuthentication))(response).pipe(Effect.mapError(() => loginError("Claude returned an unrecognized login status")));
54
+ if (!auth.loggedIn || auth.authMethod !== "claude.ai" || auth.apiProvider !== "firstParty")
55
+ return yield* loginError("Claude requires a subscription login; run claude auth login on the Worker");
56
+ break;
57
+ }
58
+ case "pi": {
59
+ // Pi is the SDK installed with this run host, not a separate CLI binary.
60
+ const sdk = yield* PiSdk;
61
+ yield* usePiStart((signal) => sdk.start({
62
+ cwd: homedir(),
63
+ extensions: [],
64
+ model: Option.some(brain.model),
65
+ signal,
66
+ thinkingLevel: brain.effort,
67
+ toolMode: "repository",
68
+ }), (cause) => new SessionOperationError({
69
+ operation: "launch",
70
+ sessionId: Option.none(),
71
+ message: `Pi could not check authentication for ${brain.model}`,
72
+ cause,
73
+ }), (acquired) => Effect.gen(function* () {
74
+ const result = acquired.result;
75
+ yield* Effect.sync(acquired.dispose);
76
+ if (result._tag !== "Started" || result.pool !== "apiKeys")
77
+ return yield* loginError(`Pi child model ${brain.model} requires an available model, supported effort, and API-key authentication`);
78
+ }));
79
+ break;
80
+ }
81
+ }
82
+ yield* Effect.logInfo("Worker harness verified", {
83
+ harness: brain.harness,
84
+ model: brain.model,
85
+ });
86
+ return new HarnessReady({ harness: brain.harness });
87
+ }, (effect, brain) => effect.pipe(Effect.timeout("60 seconds"), Effect.catchTag("TimeoutError", (cause) => new SessionOperationError({
88
+ operation: "launch",
89
+ sessionId: Option.none(),
90
+ message: `${brain.harness} readiness check timed out`,
91
+ cause,
92
+ })), Effect.tapError((error) => Effect.logError("Worker harness preflight failed", {
93
+ harness: brain.harness,
94
+ model: brain.model,
95
+ errorTag: error._tag,
96
+ message: error.message,
97
+ }))));
98
+ /** Checks only the requested brain using the worker user's configuration, without running a prompt or logging in. */
99
+ export const preflight = (brain) => verifyHarness(brain).pipe(Effect.provide(codexAppServerLive), Effect.provide(piSdkLive));
100
+ //# sourceMappingURL=preflight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.js","sourceRoot":"","sources":["../../src/preflight/preflight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE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0 +1,26 @@
1
+ import type { AgentPersona, AgentName } from "@usine/core/agent";
2
+ import type { AttemptTask } from "@usine/core/attempt";
3
+ import type { RepositoryName } from "@usine/core/repository";
4
+ import type { Schema } from "effect";
5
+ /** The recorded trigger context, Agent instructions, and effective task presented to the parent. */
6
+ export interface PromptParts {
7
+ readonly repository: RepositoryName;
8
+ readonly payload: Schema.Json;
9
+ readonly agent: AgentName;
10
+ readonly persona: AgentPersona;
11
+ readonly task: AttemptTask;
12
+ }
13
+ /** The Agent's standing instructions and the focused task the parent delegates to a child. */
14
+ export interface ChildPromptParts {
15
+ readonly agent: AgentName;
16
+ readonly persona: AgentPersona;
17
+ /** Free text authored by the parent model, not the rendered loop task. */
18
+ readonly task: string;
19
+ }
20
+ /** The attribution line every GitHub comment or review written by an Agent ends with. */
21
+ export declare const githubSignature: (agent: AgentName) => string;
22
+ /** Builds the parent's instructions from the saved payload, effective task, and Agent persona, including GitHub attribution. */
23
+ export declare const assemblePrompt: (parts: PromptParts) => string;
24
+ /** Builds a child's instructions from the delegated task and Agent persona, including GitHub attribution. */
25
+ export declare const assembleChildPrompt: (parts: ChildPromptParts) => string;
26
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,oGAAoG;AACpG,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B;AAED,8FAA8F;AAC9F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,yFAAyF;AACzF,eAAO,MAAM,eAAe,UAAW,SAAS,KAAG,MAAmC,CAAC;AAYvF,gIAAgI;AAChI,eAAO,MAAM,cAAc,UAAW,WAAW,KAAG,MAoBtC,CAAC;AAEf,6GAA6G;AAC7G,eAAO,MAAM,mBAAmB,UAAW,gBAAgB,KAAG,MAWhD,CAAC"}
package/dist/prompt.js ADDED
@@ -0,0 +1,45 @@
1
+ /** The attribution line every GitHub comment or review written by an Agent ends with. */
2
+ export const githubSignature = (agent) => `— usine agent: ${agent}`;
3
+ const githubInstructions = (agent) => [
4
+ "# GitHub identity",
5
+ "",
6
+ "All factory Agents use the same GitHub App identity, including the Agent that opened a pull request.",
7
+ "Submit pull request reviews with event COMMENT (gh pr review --comment), never APPROVE or REQUEST_CHANGES. Attach each review to the exact commit you reviewed.",
8
+ "Use the Loop's outcome labels to report findings or a passed review, and remove the opposite outcome label. A passed label does not satisfy GitHub required approvals; the operator provides any independent approval and merges.",
9
+ "Append this signature to every GitHub comment, issue, pull request, or review you publish:",
10
+ githubSignature(agent),
11
+ ];
12
+ /** Builds the parent's instructions from the saved payload, effective task, and Agent persona, including GitHub attribution. */
13
+ export const assemblePrompt = (parts) => [
14
+ "# Run context",
15
+ "",
16
+ `Repository: ${parts.repository}`,
17
+ "",
18
+ "Payload snapshot:",
19
+ "```json",
20
+ JSON.stringify(parts.payload, undefined, 2),
21
+ "```",
22
+ "",
23
+ "# Agent persona",
24
+ "",
25
+ parts.persona,
26
+ "",
27
+ "# Task",
28
+ "",
29
+ parts.task,
30
+ "",
31
+ ...githubInstructions(parts.agent),
32
+ ].join("\n");
33
+ /** Builds a child's instructions from the delegated task and Agent persona, including GitHub attribution. */
34
+ export const assembleChildPrompt = (parts) => [
35
+ "# Agent persona",
36
+ "",
37
+ parts.persona,
38
+ "",
39
+ "# Delegated task",
40
+ "",
41
+ parts.task,
42
+ "",
43
+ ...githubInstructions(parts.agent),
44
+ ].join("\n");
45
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAsBA,yFAAyF;AACzF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAgB,EAAU,EAAE,CAAC,kBAAkB,KAAK,EAAE,CAAC;AAEvF,MAAM,kBAAkB,GAAG,CAAC,KAAgB,EAAyB,EAAE,CAAC;IACtE,mBAAmB;IACnB,EAAE;IACF,sGAAsG;IACtG,iKAAiK;IACjK,mOAAmO;IACnO,4FAA4F;IAC5F,eAAe,CAAC,KAAK,CAAC;CACvB,CAAC;AAEF,gIAAgI;AAChI,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAkB,EAAU,EAAE,CAC3D;IACE,eAAe;IACf,EAAE;IACF,eAAe,KAAK,CAAC,UAAU,EAAE;IACjC,EAAE;IACF,mBAAmB;IACnB,SAAS;IACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC3C,KAAK;IACL,EAAE;IACF,iBAAiB;IACjB,EAAE;IACF,KAAK,CAAC,OAAO;IACb,EAAE;IACF,QAAQ;IACR,EAAE;IACF,KAAK,CAAC,IAAI;IACV,EAAE;IACF,GAAG,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC;CACnC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEf,6GAA6G;AAC7G,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAuB,EAAU,EAAE,CACrE;IACE,iBAAiB;IACjB,EAAE;IACF,KAAK,CAAC,OAAO;IACb,EAAE;IACF,kBAAkB;IAClB,EAAE;IACF,KAAK,CAAC,IAAI;IACV,EAAE;IACF,GAAG,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC;CACnC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * The request shapes usine sends to the Codex app server, restated from
4
+ * `@pwrdrvr/codex-app-server-protocol@0.144.0` (codex-cli 0.144.0) because
5
+ * that package resolves only under bundler-style resolution.
6
+ * This is the baseline protocol. Additional supported CLI builds are verified
7
+ * against their generated types and the live steering/interruption contracts.
8
+ * `protocol-conformance/check.ts` compiles against the baseline package and fails
9
+ * `pnpm check` when these shapes drift.
10
+ */
11
+ export interface InitializeParams {
12
+ readonly clientInfo: {
13
+ readonly name: string;
14
+ readonly title: string | null;
15
+ readonly version: string;
16
+ };
17
+ readonly capabilities: null;
18
+ }
19
+ export interface ModelListParams {
20
+ readonly cursor?: string | null;
21
+ readonly limit?: number | null;
22
+ readonly includeHidden?: boolean | null;
23
+ }
24
+ export interface GetAccountParams {
25
+ readonly refreshToken?: boolean;
26
+ }
27
+ export interface ThreadStartParams {
28
+ readonly model?: string | null;
29
+ readonly allowProviderModelFallback?: boolean;
30
+ readonly cwd?: string | null;
31
+ readonly approvalPolicy?: "never" | "on-request" | "untrusted" | null;
32
+ readonly sandbox?: "read-only" | "workspace-write" | "danger-full-access" | null;
33
+ readonly serviceName?: string | null;
34
+ readonly ephemeral?: boolean | null;
35
+ }
36
+ interface TextInput {
37
+ readonly type: "text";
38
+ readonly text: string;
39
+ readonly text_elements: ReadonlyArray<never>;
40
+ }
41
+ export interface TurnStartParams {
42
+ readonly threadId: string;
43
+ readonly input: ReadonlyArray<TextInput>;
44
+ readonly cwd?: string | null;
45
+ readonly approvalPolicy?: "never" | "on-request" | "untrusted" | null;
46
+ readonly sandboxPolicy?: {
47
+ readonly type: "dangerFullAccess";
48
+ } | null;
49
+ readonly effort?: string | null;
50
+ }
51
+ export interface TurnSteerParams {
52
+ readonly threadId: string;
53
+ readonly expectedTurnId: string;
54
+ readonly input: ReadonlyArray<TextInput>;
55
+ }
56
+ export interface TurnInterruptParams {
57
+ readonly threadId: string;
58
+ readonly turnId: string;
59
+ }
60
+ export declare const AccountResponse: Schema.Struct<{
61
+ readonly account: Schema.NullOr<Schema.Struct<{
62
+ readonly type: Schema.String;
63
+ }>>;
64
+ readonly requiresOpenaiAuth: Schema.Boolean;
65
+ }>;
66
+ export declare const AccountUpdated: Schema.Struct<{
67
+ readonly authMode: Schema.NullOr<Schema.String>;
68
+ }>;
69
+ export {};
70
+ //# sourceMappingURL=codex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/protocol/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WA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;IAChC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAGD,eAAO,MAAM,eAAe;;;;;EAG1B,CAAC;AACH,eAAO,MAAM,cAAc;;EAA4D,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Schema } from "effect";
2
+ // Only authentication mode crosses this boundary; account identity is never logged.
3
+ export const AccountResponse = Schema.Struct({
4
+ account: Schema.NullOr(Schema.Struct({ type: Schema.String })),
5
+ requiresOpenaiAuth: Schema.Boolean,
6
+ });
7
+ export const AccountUpdated = Schema.Struct({ authMode: Schema.NullOr(Schema.String) });
8
+ //# sourceMappingURL=codex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/protocol/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAkEhC,oFAAoF;AACpF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9D,kBAAkB,EAAE,MAAM,CAAC,OAAO;CACnC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,132 @@
1
+ import { AgentSession, AgentSessionEvent, ChildSession } from "@usine/core/agent/session";
2
+ import * as AttemptChannel from "@usine/core/attempt/channel";
3
+ import { AttemptFailure } from "@usine/core/attempt/failure";
4
+ import { Context, Effect, Schema, Scope, Stream } from "effect";
5
+ /** The checkout directory one Attempt runs in. */
6
+ export declare const WorkingDirectory: Schema.brand<Schema.NonEmptyString, "AgentWorkingDirectory">;
7
+ export type WorkingDirectory = typeof WorkingDirectory.Type;
8
+ declare const LaunchRequest_base: Schema.Class<LaunchRequest, Schema.Struct<{
9
+ readonly spec: typeof AttemptChannel.RunSpec;
10
+ readonly cwd: Schema.brand<Schema.NonEmptyString, "AgentWorkingDirectory">;
11
+ }>, {}>;
12
+ /** The Attempt's task and Agent choices, together with the prepared checkout where its parent starts. */
13
+ export declare class LaunchRequest extends LaunchRequest_base {
14
+ }
15
+ declare const ChildRequest_base: Schema.Class<ChildRequest, Schema.Struct<{
16
+ readonly session: typeof ChildSession;
17
+ readonly cwd: Schema.brand<Schema.NonEmptyString, "AgentWorkingDirectory">;
18
+ readonly prompt: Schema.NonEmptyString;
19
+ }>, {}>;
20
+ /** Work delegated to one child, with its assigned identity and the checkout it shares with the parent. */
21
+ export declare class ChildRequest extends ChildRequest_base {
22
+ }
23
+ declare const SessionResult_base: Schema.Class<SessionResult, Schema.Struct<{
24
+ readonly message: Schema.NonEmptyString;
25
+ }>, {}>;
26
+ /** The final message a parent or child session returns. */
27
+ export declare class SessionResult extends SessionResult_base {
28
+ }
29
+ declare const UnknownModelError_base: Schema.Class<UnknownModelError, Schema.TaggedStruct<"UnknownModelError", {
30
+ readonly harness: Schema.Literals<readonly ["claude", "codex", "pi"]>;
31
+ readonly model: Schema.brand<Schema.String, "ModelId">;
32
+ readonly message: Schema.NonEmptyString;
33
+ }>, import("effect/Cause").YieldableError>;
34
+ /** The rostered model id is well-formed but the SDK's registry does not list it. */
35
+ export declare class UnknownModelError extends UnknownModelError_base {
36
+ }
37
+ declare const PoolUnavailableError_base: Schema.Class<PoolUnavailableError, Schema.TaggedStruct<"PoolUnavailableError", {
38
+ readonly harness: Schema.Literals<readonly ["claude", "codex", "pi"]>;
39
+ readonly model: Schema.brand<Schema.String, "ModelId">;
40
+ readonly pool: Schema.Literals<readonly ["apiKeys", "claudePlan", "chatgptPlan"]>;
41
+ readonly message: Schema.NonEmptyString;
42
+ }>, import("effect/Cause").YieldableError>;
43
+ /** The credential cannot spend from the billing pool this session needs. */
44
+ export declare class PoolUnavailableError extends PoolUnavailableError_base {
45
+ }
46
+ declare const UnsupportedEffortError_base: Schema.Class<UnsupportedEffortError, Schema.TaggedStruct<"UnsupportedEffortError", {
47
+ readonly harness: Schema.Literals<readonly ["claude", "codex", "pi"]>;
48
+ readonly model: Schema.brand<Schema.String, "ModelId">;
49
+ readonly effort: Schema.Literals<readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
50
+ readonly message: Schema.NonEmptyString;
51
+ }>, import("effect/Cause").YieldableError>;
52
+ /** The model exists but does not support the rostered reasoning effort. */
53
+ export declare class UnsupportedEffortError extends UnsupportedEffortError_base {
54
+ }
55
+ declare const AgentResultError_base: Schema.Class<AgentResultError, Schema.TaggedStruct<"AgentResultError", {
56
+ readonly sessionId: Schema.OptionFromNullOr<Schema.brand<Schema.NonEmptyString, "AgentSessionId">>;
57
+ readonly message: Schema.NonEmptyString;
58
+ }>, import("effect/Cause").YieldableError>;
59
+ /** The session finished and reported that the work itself failed. */
60
+ export declare class AgentResultError extends AgentResultError_base {
61
+ }
62
+ declare const ChildSessionBudgetExceededError_base: Schema.Class<ChildSessionBudgetExceededError, Schema.TaggedStruct<"ChildSessionBudgetExceededError", {
63
+ readonly maxChildren: Schema.brand<Schema.Int, "ChildSessionBudget">;
64
+ readonly attemptedChildren: Schema.brand<Schema.Int, "ChildSessionCount">;
65
+ readonly message: Schema.NonEmptyString;
66
+ }>, import("effect/Cause").YieldableError>;
67
+ /** The Pi parent asked for one more child than this Attempt's budget allows. */
68
+ export declare class ChildSessionBudgetExceededError extends ChildSessionBudgetExceededError_base {
69
+ }
70
+ export declare const SESSION_OPERATIONS: readonly ["launch", "stream", "steer", "interrupt"];
71
+ export declare const SessionOperation: Schema.Literals<readonly ["launch", "stream", "steer", "interrupt"]>;
72
+ export type SessionOperation = typeof SessionOperation.Type;
73
+ declare const SessionOperationError_base: Schema.Class<SessionOperationError, Schema.TaggedStruct<"SessionOperationError", {
74
+ readonly operation: Schema.Literals<readonly ["launch", "stream", "steer", "interrupt"]>;
75
+ readonly sessionId: Schema.OptionFromNullOr<Schema.brand<Schema.NonEmptyString, "AgentSessionId">>;
76
+ readonly message: Schema.NonEmptyString;
77
+ readonly cause: Schema.Defect;
78
+ }>, import("effect/Cause").YieldableError>;
79
+ /** The SDK or its process failed after the model and harness were validated. */
80
+ export declare class SessionOperationError extends SessionOperationError_base {
81
+ }
82
+ /** A session could not start, continue, or finish its work; the failure determines whether retry needs an operator. */
83
+ export declare const AgentSessionError: Schema.Union<readonly [typeof UnknownModelError, typeof PoolUnavailableError, typeof UnsupportedEffortError, typeof AgentResultError, typeof ChildSessionBudgetExceededError, typeof SessionOperationError]>;
84
+ export type AgentSessionError = typeof AgentSessionError.Type;
85
+ /**
86
+ * Maps session errors onto the retry taxonomy: an SDK or process failure is
87
+ * retryable infrastructure, while a bad roster spec or the agent failing its
88
+ * own work waits for the operator (ADR 0002).
89
+ */
90
+ export declare const toAttemptFailure: (error: AgentSessionError) => AttemptFailure;
91
+ /** A live parent or child session whose activity can be observed while its work continues. */
92
+ export interface RunningSession {
93
+ readonly session: AgentSession;
94
+ /** Activity to record in the Attempt transcript while waiting for the result. */
95
+ readonly events: Stream.Stream<AgentSessionEvent, AgentSessionError>;
96
+ /** Waits for the final message or the failure that ends this session's work. */
97
+ readonly result: Effect.Effect<SessionResult, AgentSessionError>;
98
+ /** Adds operator guidance to the running session without creating a new Attempt. */
99
+ readonly steer: (message: string) => Effect.Effect<void, AgentSessionError>;
100
+ /** Requests that this session stop its current work. */
101
+ readonly interrupt: Effect.Effect<void, AgentSessionError>;
102
+ }
103
+ /** Launches coding sessions for tasks delegated by an Attempt's parent. */
104
+ export interface ChildBackendService {
105
+ /** Starts the assigned child and returns its controls; its result is awaited separately. */
106
+ readonly launch: (request: ChildRequest) => Effect.Effect<RunningSession, AgentSessionError, Scope.Scope>;
107
+ }
108
+ declare const ChildBackend_base: Context.ServiceClass<ChildBackend, "@usine/agents/ChildBackend", ChildBackendService>;
109
+ /** Runs the coding work delegated by an Attempt's parent. */
110
+ export declare class ChildBackend extends ChildBackend_base {
111
+ }
112
+ declare const ClaudeChildBackend_base: Context.ServiceClass<ClaudeChildBackend, "@usine/agents/ClaudeChildBackend", ChildBackendService>;
113
+ /** Runs delegated coding work with Claude Code. */
114
+ export declare class ClaudeChildBackend extends ClaudeChildBackend_base {
115
+ }
116
+ declare const CodexChildBackend_base: Context.ServiceClass<CodexChildBackend, "@usine/agents/CodexChildBackend", ChildBackendService>;
117
+ /** Runs delegated coding work with Codex. */
118
+ export declare class CodexChildBackend extends CodexChildBackend_base {
119
+ }
120
+ declare const PiChildBackend_base: Context.ServiceClass<PiChildBackend, "@usine/agents/PiChildBackend", ChildBackendService>;
121
+ /** Runs delegated coding work with Pi. */
122
+ export declare class PiChildBackend extends PiChildBackend_base {
123
+ }
124
+ declare const AgentRuntime_base: Context.ServiceClass<AgentRuntime, "@usine/agents/AgentRuntime", {
125
+ /** Starts work in the prepared checkout and returns controls for observing and guiding the parent. */
126
+ readonly launch: (request: LaunchRequest) => Effect.Effect<RunningSession, AgentSessionError, Scope.Scope>;
127
+ }>;
128
+ /** Starts the parent that coordinates one Attempt's task and delegates coding work to children. */
129
+ export declare class AgentRuntime extends AgentRuntime_base {
130
+ }
131
+ export {};
132
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,iBAAiB,EAGjB,YAAY,EAGb,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAEL,cAAc,EAGf,MAAM,6BAA6B,CAAC;AACrC,OAAO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AAO,EAAE,YAAY,CAAC;IAC/B,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;IACrE,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACjE,oFAAoF;IACpF,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IAC5E,wDAAwD;IACxD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;CAC5D;AAED,2EAA2E;AAC3E,MAAM,WAAW,mBAAmB;IAClC,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,EAAE,CACf,OAAO,EAAE,YAAY,KAClB,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;CACpE;;AAED,6DAA6D;AAC7D,qBAAa,YAAa,SAAQ,iBAEjC;CAAG;;AAEJ,mDAAmD;AACnD,qBAAa,kBAAmB,SAAQ,uBAEvC;CAAG;;AAEJ,6CAA6C;AAC7C,qBAAa,iBAAkB,SAAQ,sBAEtC;CAAG;;AAEJ,0CAA0C;AAC1C,qBAAa,cAAe,SAAQ,mBAEnC;CAAG;;IAMA,sGAAsG;qBACrF,CACf,OAAO,EAAE,aAAa,KACnB,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC;;AAPtE,mGAAmG;AACnG,qBAAa,YAAa,SAAQ,iBAQD;CAAG"}
@@ -0,0 +1,109 @@
1
+ import { Effort, Harness, ModelId } from "@usine/core/agent/brain";
2
+ import { AgentSession, AgentSessionEvent, AgentSessionId, BillingPool, ChildSession, ChildSessionBudget, ChildSessionCount, } from "@usine/core/agent/session";
3
+ import * as AttemptChannel from "@usine/core/attempt/channel";
4
+ import { AgentFailure, AttemptFailure, ChildSessionBudgetFailure, InfraFailure, } from "@usine/core/attempt/failure";
5
+ import { Context, Effect, Match, Schema, Scope, Stream } from "effect";
6
+ /** The checkout directory one Attempt runs in. */
7
+ export const WorkingDirectory = Schema.NonEmptyString.pipe(Schema.brand("AgentWorkingDirectory"));
8
+ /** The Attempt's task and Agent choices, together with the prepared checkout where its parent starts. */
9
+ export class LaunchRequest extends Schema.Class("@usine/agents/LaunchRequest")({
10
+ spec: AttemptChannel.RunSpec,
11
+ cwd: WorkingDirectory,
12
+ }) {
13
+ }
14
+ /** Work delegated to one child, with its assigned identity and the checkout it shares with the parent. */
15
+ export class ChildRequest extends Schema.Class("@usine/agents/ChildRequest")({
16
+ session: ChildSession,
17
+ cwd: WorkingDirectory,
18
+ prompt: Schema.NonEmptyString,
19
+ }) {
20
+ }
21
+ /** The final message a parent or child session returns. */
22
+ export class SessionResult extends Schema.Class("@usine/agents/SessionResult")({
23
+ message: Schema.NonEmptyString,
24
+ }) {
25
+ }
26
+ /** The rostered model id is well-formed but the SDK's registry does not list it. */
27
+ export class UnknownModelError extends Schema.TaggedError("@usine/agents/UnknownModelError")("UnknownModelError", {
28
+ harness: Harness,
29
+ model: ModelId,
30
+ message: Schema.NonEmptyString,
31
+ }) {
32
+ }
33
+ /** The credential cannot spend from the billing pool this session needs. */
34
+ export class PoolUnavailableError extends Schema.TaggedError("@usine/agents/PoolUnavailableError")("PoolUnavailableError", {
35
+ harness: Harness,
36
+ model: ModelId,
37
+ pool: BillingPool,
38
+ message: Schema.NonEmptyString,
39
+ }) {
40
+ }
41
+ /** The model exists but does not support the rostered reasoning effort. */
42
+ export class UnsupportedEffortError extends Schema.TaggedError("@usine/agents/UnsupportedEffortError")("UnsupportedEffortError", {
43
+ harness: Harness,
44
+ model: ModelId,
45
+ effort: Effort,
46
+ message: Schema.NonEmptyString,
47
+ }) {
48
+ }
49
+ /** The session finished and reported that the work itself failed. */
50
+ export class AgentResultError extends Schema.TaggedError("@usine/agents/AgentResultError")("AgentResultError", {
51
+ sessionId: Schema.OptionFromNullOr(AgentSessionId),
52
+ message: Schema.NonEmptyString,
53
+ }) {
54
+ }
55
+ /** The Pi parent asked for one more child than this Attempt's budget allows. */
56
+ export class ChildSessionBudgetExceededError extends Schema.TaggedError("@usine/agents/ChildSessionBudgetExceededError")("ChildSessionBudgetExceededError", {
57
+ maxChildren: ChildSessionBudget,
58
+ attemptedChildren: ChildSessionCount,
59
+ message: Schema.NonEmptyString,
60
+ }) {
61
+ }
62
+ export const SESSION_OPERATIONS = ["launch", "stream", "steer", "interrupt"];
63
+ export const SessionOperation = Schema.Literals(SESSION_OPERATIONS);
64
+ /** The SDK or its process failed after the model and harness were validated. */
65
+ export class SessionOperationError extends Schema.TaggedError("@usine/agents/SessionOperationError")("SessionOperationError", {
66
+ operation: SessionOperation,
67
+ sessionId: Schema.OptionFromNullOr(AgentSessionId),
68
+ message: Schema.NonEmptyString,
69
+ cause: Schema.Defect(),
70
+ }) {
71
+ }
72
+ /** A session could not start, continue, or finish its work; the failure determines whether retry needs an operator. */
73
+ export const AgentSessionError = Schema.Union([
74
+ UnknownModelError,
75
+ PoolUnavailableError,
76
+ UnsupportedEffortError,
77
+ AgentResultError,
78
+ ChildSessionBudgetExceededError,
79
+ SessionOperationError,
80
+ ]);
81
+ /**
82
+ * Maps session errors onto the retry taxonomy: an SDK or process failure is
83
+ * retryable infrastructure, while a bad roster spec or the agent failing its
84
+ * own work waits for the operator (ADR 0002).
85
+ */
86
+ export const toAttemptFailure = (error) => Match.valueTags(error, {
87
+ SessionOperationError: (operation) => new InfraFailure({ message: operation.message, cause: operation.cause }),
88
+ UnknownModelError: ({ message }) => new AgentFailure({ message }),
89
+ PoolUnavailableError: ({ message }) => new AgentFailure({ message }),
90
+ UnsupportedEffortError: ({ message }) => new AgentFailure({ message }),
91
+ AgentResultError: ({ message }) => new AgentFailure({ message }),
92
+ ChildSessionBudgetExceededError: ({ attemptedChildren, maxChildren }) => new ChildSessionBudgetFailure({ attemptedChildren, maxChildren }),
93
+ });
94
+ /** Runs the coding work delegated by an Attempt's parent. */
95
+ export class ChildBackend extends Context.Service()("@usine/agents/ChildBackend") {
96
+ }
97
+ /** Runs delegated coding work with Claude Code. */
98
+ export class ClaudeChildBackend extends Context.Service()("@usine/agents/ClaudeChildBackend") {
99
+ }
100
+ /** Runs delegated coding work with Codex. */
101
+ export class CodexChildBackend extends Context.Service()("@usine/agents/CodexChildBackend") {
102
+ }
103
+ /** Runs delegated coding work with Pi. */
104
+ export class PiChildBackend extends Context.Service()("@usine/agents/PiChildBackend") {
105
+ }
106
+ /** Starts the parent that coordinates one Attempt's task and delegates coding work to children. */
107
+ export class AgentRuntime extends Context.Service()("@usine/agents/AgentRuntime") {
108
+ }
109
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EACL,YAAY,EACZ,cAAc,EACd,yBAAyB,EACzB,YAAY,GACb,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEvE,kDAAkD;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;AAGlG,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