@usine/agents 0.1.0 → 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 (77) hide show
  1. package/README.md +33 -6
  2. package/dist/pi/authentication.d.ts +4 -4
  3. package/dist/pi/authentication.d.ts.map +1 -1
  4. package/dist/pi/authentication.js +2 -2
  5. package/dist/pi/authentication.js.map +1 -1
  6. package/dist/pi/children.d.ts +4 -1
  7. package/dist/pi/children.d.ts.map +1 -1
  8. package/dist/pi/children.js +4 -1
  9. package/dist/pi/children.js.map +1 -1
  10. package/dist/pi/claude.d.ts +6 -2
  11. package/dist/pi/claude.d.ts.map +1 -1
  12. package/dist/pi/claude.js +18 -11
  13. package/dist/pi/claude.js.map +1 -1
  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 +15 -6
  19. package/dist/pi/codex/app-server.d.ts.map +1 -1
  20. package/dist/pi/codex/app-server.js +61 -22
  21. package/dist/pi/codex/app-server.js.map +1 -1
  22. package/dist/pi/codex/codex.d.ts +2 -0
  23. package/dist/pi/codex/codex.d.ts.map +1 -1
  24. package/dist/pi/codex/codex.js +54 -34
  25. package/dist/pi/codex/codex.js.map +1 -1
  26. package/dist/pi/live.d.ts +4 -0
  27. package/dist/pi/live.d.ts.map +1 -0
  28. package/dist/pi/{index.js → live.js} +2 -9
  29. package/dist/pi/live.js.map +1 -0
  30. package/dist/pi/pi.d.ts +3 -1
  31. package/dist/pi/pi.d.ts.map +1 -1
  32. package/dist/pi/pi.js +64 -26
  33. package/dist/pi/pi.js.map +1 -1
  34. package/dist/pi/sdk.d.ts +18 -13
  35. package/dist/pi/sdk.d.ts.map +1 -1
  36. package/dist/pi/sdk.js +15 -10
  37. package/dist/pi/sdk.js.map +1 -1
  38. package/dist/pi/session.d.ts +20 -21
  39. package/dist/pi/session.d.ts.map +1 -1
  40. package/dist/pi/session.js +9 -10
  41. package/dist/pi/session.js.map +1 -1
  42. package/dist/pi/subagents.d.ts +15 -11
  43. package/dist/pi/subagents.d.ts.map +1 -1
  44. package/dist/pi/subagents.js +73 -43
  45. package/dist/pi/subagents.js.map +1 -1
  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 +15 -11
  59. package/dist/prompt.d.ts.map +1 -1
  60. package/dist/prompt.js +14 -11
  61. package/dist/prompt.js.map +1 -1
  62. package/dist/protocol/codex.d.ts +20 -6
  63. package/dist/protocol/codex.d.ts.map +1 -1
  64. package/dist/protocol/codex.js +7 -1
  65. package/dist/protocol/codex.js.map +1 -1
  66. package/dist/runtime.d.ts +42 -24
  67. package/dist/runtime.d.ts.map +1 -1
  68. package/dist/runtime.js +47 -34
  69. package/dist/runtime.js.map +1 -1
  70. package/package.json +34 -10
  71. package/dist/index.d.ts +0 -4
  72. package/dist/index.d.ts.map +0 -1
  73. package/dist/index.js +0 -4
  74. package/dist/index.js.map +0 -1
  75. package/dist/pi/index.d.ts +0 -11
  76. package/dist/pi/index.d.ts.map +0 -1
  77. package/dist/pi/index.js.map +0 -1
@@ -1,10 +1,12 @@
1
+ import { Schema } from "effect";
1
2
  /**
2
- * NodeNext-compatible view of the exact-pinned generated app-server protocol
3
- * (`@pwrdrvr/codex-app-server-protocol@0.144.0`, mirroring codex-cli 0.144.0).
4
- * The upstream package omits extensions in its generated source, so it only
5
- * resolves under bundler-style resolution; these are the request shapes usine
6
- * sends on that pinned wire version. `protocol-conformance/check.ts` compiles
7
- * against the real package and fails `pnpm check` when this view drifts.
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.
8
10
  */
9
11
  export interface InitializeParams {
10
12
  readonly clientInfo: {
@@ -19,6 +21,9 @@ export interface ModelListParams {
19
21
  readonly limit?: number | null;
20
22
  readonly includeHidden?: boolean | null;
21
23
  }
24
+ export interface GetAccountParams {
25
+ readonly refreshToken?: boolean;
26
+ }
22
27
  export interface ThreadStartParams {
23
28
  readonly model?: string | null;
24
29
  readonly allowProviderModelFallback?: boolean;
@@ -52,5 +57,14 @@ export interface TurnInterruptParams {
52
57
  readonly threadId: string;
53
58
  readonly turnId: string;
54
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
+ }>;
55
69
  export {};
56
70
  //# sourceMappingURL=codex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/protocol/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;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,CA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AChC,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"}
@@ -1,2 +1,8 @@
1
- export {};
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) });
2
8
  //# sourceMappingURL=codex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/protocol/codex.ts"],"names":[],"mappings":""}
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"}
package/dist/runtime.d.ts CHANGED
@@ -1,27 +1,29 @@
1
- import { Agent, AttemptChannel, AttemptFailure } from "@usine/core";
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";
2
4
  import { Context, Effect, Schema, Scope, Stream } from "effect";
3
- /** Value object: process-local working directory for one isolated Attempt. */
5
+ /** The checkout directory one Attempt runs in. */
4
6
  export declare const WorkingDirectory: Schema.brand<Schema.NonEmptyString, "AgentWorkingDirectory">;
5
7
  export type WorkingDirectory = typeof WorkingDirectory.Type;
6
8
  declare const LaunchRequest_base: Schema.Class<LaunchRequest, Schema.Struct<{
7
9
  readonly spec: typeof AttemptChannel.RunSpec;
8
10
  readonly cwd: Schema.brand<Schema.NonEmptyString, "AgentWorkingDirectory">;
9
11
  }>, {}>;
10
- /** Complete input required to start the Pi parent inside one Attempt checkout. */
12
+ /** The Attempt's task and Agent choices, together with the prepared checkout where its parent starts. */
11
13
  export declare class LaunchRequest extends LaunchRequest_base {
12
14
  }
13
15
  declare const ChildRequest_base: Schema.Class<ChildRequest, Schema.Struct<{
14
- readonly session: typeof Agent.ChildSession;
16
+ readonly session: typeof ChildSession;
15
17
  readonly cwd: Schema.brand<Schema.NonEmptyString, "AgentWorkingDirectory">;
16
18
  readonly prompt: Schema.NonEmptyString;
17
19
  }>, {}>;
18
- /** Complete input for exactly one first-level child session. */
20
+ /** Work delegated to one child, with its assigned identity and the checkout it shares with the parent. */
19
21
  export declare class ChildRequest extends ChildRequest_base {
20
22
  }
21
23
  declare const SessionResult_base: Schema.Class<SessionResult, Schema.Struct<{
22
24
  readonly message: Schema.NonEmptyString;
23
25
  }>, {}>;
24
- /** Terminal semantic output from a parent or child SDK session. */
26
+ /** The final message a parent or child session returns. */
25
27
  export declare class SessionResult extends SessionResult_base {
26
28
  }
27
29
  declare const UnknownModelError_base: Schema.Class<UnknownModelError, Schema.TaggedStruct<"UnknownModelError", {
@@ -29,7 +31,7 @@ declare const UnknownModelError_base: Schema.Class<UnknownModelError, Schema.Tag
29
31
  readonly model: Schema.brand<Schema.String, "ModelId">;
30
32
  readonly message: Schema.NonEmptyString;
31
33
  }>, import("effect/Cause").YieldableError>;
32
- /** The configured vendor model id is well-formed but absent from the selected SDK registry. */
34
+ /** The rostered model id is well-formed but the SDK's registry does not list it. */
33
35
  export declare class UnknownModelError extends UnknownModelError_base {
34
36
  }
35
37
  declare const PoolUnavailableError_base: Schema.Class<PoolUnavailableError, Schema.TaggedStruct<"PoolUnavailableError", {
@@ -38,7 +40,7 @@ declare const PoolUnavailableError_base: Schema.Class<PoolUnavailableError, Sche
38
40
  readonly pool: Schema.Literals<readonly ["apiKeys", "claudePlan", "chatgptPlan"]>;
39
41
  readonly message: Schema.NonEmptyString;
40
42
  }>, import("effect/Cause").YieldableError>;
41
- /** The selected credential cannot draw from the billing pool required by this session. */
43
+ /** The credential cannot spend from the billing pool this session needs. */
42
44
  export declare class PoolUnavailableError extends PoolUnavailableError_base {
43
45
  }
44
46
  declare const UnsupportedEffortError_base: Schema.Class<UnsupportedEffortError, Schema.TaggedStruct<"UnsupportedEffortError", {
@@ -47,16 +49,24 @@ declare const UnsupportedEffortError_base: Schema.Class<UnsupportedEffortError,
47
49
  readonly effort: Schema.Literals<readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
48
50
  readonly message: Schema.NonEmptyString;
49
51
  }>, import("effect/Cause").YieldableError>;
50
- /** The selected model exists but does not support the rostered reasoning effort. */
52
+ /** The model exists but does not support the rostered reasoning effort. */
51
53
  export declare class UnsupportedEffortError extends UnsupportedEffortError_base {
52
54
  }
53
55
  declare const AgentResultError_base: Schema.Class<AgentResultError, Schema.TaggedStruct<"AgentResultError", {
54
56
  readonly sessionId: Schema.OptionFromNullOr<Schema.brand<Schema.NonEmptyString, "AgentSessionId">>;
55
57
  readonly message: Schema.NonEmptyString;
56
58
  }>, import("effect/Cause").YieldableError>;
57
- /** The session ran to a terminal state and reported that the work itself failed. */
59
+ /** The session finished and reported that the work itself failed. */
58
60
  export declare class AgentResultError extends AgentResultError_base {
59
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
+ }
60
70
  export declare const SESSION_OPERATIONS: readonly ["launch", "stream", "steer", "interrupt"];
61
71
  export declare const SessionOperation: Schema.Literals<readonly ["launch", "stream", "steer", "interrupt"]>;
62
72
  export type SessionOperation = typeof SessionOperation.Type;
@@ -66,48 +76,56 @@ declare const SessionOperationError_base: Schema.Class<SessionOperationError, Sc
66
76
  readonly message: Schema.NonEmptyString;
67
77
  readonly cause: Schema.Defect;
68
78
  }>, import("effect/Cause").YieldableError>;
69
- /** SDK/process failure after model and harness validation. */
79
+ /** The SDK or its process failed after the model and harness were validated. */
70
80
  export declare class SessionOperationError extends SessionOperationError_base {
71
81
  }
72
- export declare const AgentSessionError: Schema.Union<readonly [typeof UnknownModelError, typeof PoolUnavailableError, typeof UnsupportedEffortError, typeof AgentResultError, typeof SessionOperationError]>;
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]>;
73
84
  export type AgentSessionError = typeof AgentSessionError.Type;
74
85
  /**
75
- * The one place the session error union meets the ADR 0002 retry taxonomy:
76
- * SDK/process trouble is retryable infrastructure; a bad roster spec or the
77
- * agent failing its own work always waits for the operator.
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).
78
89
  */
79
- export declare const toAttemptFailure: (error: AgentSessionError) => AttemptFailure.AttemptFailure;
80
- /** Live SDK session. Its event stream and controls are backend-independent. */
90
+ export declare const toAttemptFailure: (error: AgentSessionError) => AttemptFailure;
91
+ /** A live parent or child session whose activity can be observed while its work continues. */
81
92
  export interface RunningSession {
82
- readonly session: Agent.Session;
83
- readonly events: Stream.Stream<Agent.SessionEvent, AgentSessionError>;
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. */
84
97
  readonly result: Effect.Effect<SessionResult, AgentSessionError>;
98
+ /** Adds operator guidance to the running session without creating a new Attempt. */
85
99
  readonly steer: (message: string) => Effect.Effect<void, AgentSessionError>;
100
+ /** Requests that this session stop its current work. */
86
101
  readonly interrupt: Effect.Effect<void, AgentSessionError>;
87
102
  }
103
+ /** Launches coding sessions for tasks delegated by an Attempt's parent. */
88
104
  export interface ChildBackendService {
105
+ /** Starts the assigned child and returns its controls; its result is awaited separately. */
89
106
  readonly launch: (request: ChildRequest) => Effect.Effect<RunningSession, AgentSessionError, Scope.Scope>;
90
107
  }
91
108
  declare const ChildBackend_base: Context.ServiceClass<ChildBackend, "@usine/agents/ChildBackend", ChildBackendService>;
92
- /** Stable first-level child seam selected by the authored BrainSpec harness. */
109
+ /** Runs the coding work delegated by an Attempt's parent. */
93
110
  export declare class ChildBackend extends ChildBackend_base {
94
111
  }
95
112
  declare const ClaudeChildBackend_base: Context.ServiceClass<ClaudeChildBackend, "@usine/agents/ClaudeChildBackend", ChildBackendService>;
96
- /** Concrete Claude child implementation consumed by the harness dispatcher. */
113
+ /** Runs delegated coding work with Claude Code. */
97
114
  export declare class ClaudeChildBackend extends ClaudeChildBackend_base {
98
115
  }
99
116
  declare const CodexChildBackend_base: Context.ServiceClass<CodexChildBackend, "@usine/agents/CodexChildBackend", ChildBackendService>;
100
- /** Concrete Codex child implementation consumed by the harness dispatcher. */
117
+ /** Runs delegated coding work with Codex. */
101
118
  export declare class CodexChildBackend extends CodexChildBackend_base {
102
119
  }
103
120
  declare const PiChildBackend_base: Context.ServiceClass<PiChildBackend, "@usine/agents/PiChildBackend", ChildBackendService>;
104
- /** Concrete Pi child implementation consumed by the harness dispatcher. */
121
+ /** Runs delegated coding work with Pi. */
105
122
  export declare class PiChildBackend extends PiChildBackend_base {
106
123
  }
107
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. */
108
126
  readonly launch: (request: LaunchRequest) => Effect.Effect<RunningSession, AgentSessionError, Scope.Scope>;
109
127
  }>;
110
- /** Stable parent seam consumed by the run host. */
128
+ /** Starts the parent that coordinates one Attempt's task and delegates coding work to children. */
111
129
  export declare class AgentRuntime extends AgentRuntime_base {
112
130
  }
113
131
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAS,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,8DAAoE,CAAC;AAClG,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAC;;;;;AAE5D,kFAAkF;AAClF,qBAAa,aAAc,SAAQ,kBAGjC;CAAG;;;;;;AAEL,gEAAgE;AAChE,qBAAa,YAAa,SAAQ,iBAIhC;CAAG;;;;AAEL,mEAAmE;AACnE,qBAAa,aAAc,SAAQ,kBAEjC;CAAG;;;;;;AAEL,+FAA+F;AAC/F,qBAAa,iB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AC,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"}
package/dist/runtime.js CHANGED
@@ -1,96 +1,109 @@
1
- import { Agent, AttemptChannel, AttemptFailure } from "@usine/core";
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";
2
5
  import { Context, Effect, Match, Schema, Scope, Stream } from "effect";
3
- /** Value object: process-local working directory for one isolated Attempt. */
6
+ /** The checkout directory one Attempt runs in. */
4
7
  export const WorkingDirectory = Schema.NonEmptyString.pipe(Schema.brand("AgentWorkingDirectory"));
5
- /** Complete input required to start the Pi parent inside one Attempt checkout. */
8
+ /** The Attempt's task and Agent choices, together with the prepared checkout where its parent starts. */
6
9
  export class LaunchRequest extends Schema.Class("@usine/agents/LaunchRequest")({
7
10
  spec: AttemptChannel.RunSpec,
8
11
  cwd: WorkingDirectory,
9
12
  }) {
10
13
  }
11
- /** Complete input for exactly one first-level child session. */
14
+ /** Work delegated to one child, with its assigned identity and the checkout it shares with the parent. */
12
15
  export class ChildRequest extends Schema.Class("@usine/agents/ChildRequest")({
13
- session: Agent.ChildSession,
16
+ session: ChildSession,
14
17
  cwd: WorkingDirectory,
15
18
  prompt: Schema.NonEmptyString,
16
19
  }) {
17
20
  }
18
- /** Terminal semantic output from a parent or child SDK session. */
21
+ /** The final message a parent or child session returns. */
19
22
  export class SessionResult extends Schema.Class("@usine/agents/SessionResult")({
20
23
  message: Schema.NonEmptyString,
21
24
  }) {
22
25
  }
23
- /** The configured vendor model id is well-formed but absent from the selected SDK registry. */
26
+ /** The rostered model id is well-formed but the SDK's registry does not list it. */
24
27
  export class UnknownModelError extends Schema.TaggedError("@usine/agents/UnknownModelError")("UnknownModelError", {
25
- harness: Agent.Harness,
26
- model: Agent.ModelId,
28
+ harness: Harness,
29
+ model: ModelId,
27
30
  message: Schema.NonEmptyString,
28
31
  }) {
29
32
  }
30
- /** The selected credential cannot draw from the billing pool required by this session. */
33
+ /** The credential cannot spend from the billing pool this session needs. */
31
34
  export class PoolUnavailableError extends Schema.TaggedError("@usine/agents/PoolUnavailableError")("PoolUnavailableError", {
32
- harness: Agent.Harness,
33
- model: Agent.ModelId,
34
- pool: Agent.Pool,
35
+ harness: Harness,
36
+ model: ModelId,
37
+ pool: BillingPool,
35
38
  message: Schema.NonEmptyString,
36
39
  }) {
37
40
  }
38
- /** The selected model exists but does not support the rostered reasoning effort. */
41
+ /** The model exists but does not support the rostered reasoning effort. */
39
42
  export class UnsupportedEffortError extends Schema.TaggedError("@usine/agents/UnsupportedEffortError")("UnsupportedEffortError", {
40
- harness: Agent.Harness,
41
- model: Agent.ModelId,
42
- effort: Agent.Effort,
43
+ harness: Harness,
44
+ model: ModelId,
45
+ effort: Effort,
43
46
  message: Schema.NonEmptyString,
44
47
  }) {
45
48
  }
46
- /** The session ran to a terminal state and reported that the work itself failed. */
49
+ /** The session finished and reported that the work itself failed. */
47
50
  export class AgentResultError extends Schema.TaggedError("@usine/agents/AgentResultError")("AgentResultError", {
48
- sessionId: Schema.OptionFromNullOr(Agent.SessionId),
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,
49
59
  message: Schema.NonEmptyString,
50
60
  }) {
51
61
  }
52
62
  export const SESSION_OPERATIONS = ["launch", "stream", "steer", "interrupt"];
53
63
  export const SessionOperation = Schema.Literals(SESSION_OPERATIONS);
54
- /** SDK/process failure after model and harness validation. */
64
+ /** The SDK or its process failed after the model and harness were validated. */
55
65
  export class SessionOperationError extends Schema.TaggedError("@usine/agents/SessionOperationError")("SessionOperationError", {
56
66
  operation: SessionOperation,
57
- sessionId: Schema.OptionFromNullOr(Agent.SessionId),
67
+ sessionId: Schema.OptionFromNullOr(AgentSessionId),
58
68
  message: Schema.NonEmptyString,
59
69
  cause: Schema.Defect(),
60
70
  }) {
61
71
  }
72
+ /** A session could not start, continue, or finish its work; the failure determines whether retry needs an operator. */
62
73
  export const AgentSessionError = Schema.Union([
63
74
  UnknownModelError,
64
75
  PoolUnavailableError,
65
76
  UnsupportedEffortError,
66
77
  AgentResultError,
78
+ ChildSessionBudgetExceededError,
67
79
  SessionOperationError,
68
80
  ]);
69
81
  /**
70
- * The one place the session error union meets the ADR 0002 retry taxonomy:
71
- * SDK/process trouble is retryable infrastructure; a bad roster spec or the
72
- * agent failing its own work always waits for the operator.
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).
73
85
  */
74
86
  export const toAttemptFailure = (error) => Match.valueTags(error, {
75
- SessionOperationError: (operation) => new AttemptFailure.InfraFailure({ message: operation.message, cause: operation.cause }),
76
- UnknownModelError: ({ message }) => new AttemptFailure.AgentFailure({ message }),
77
- PoolUnavailableError: ({ message }) => new AttemptFailure.AgentFailure({ message }),
78
- UnsupportedEffortError: ({ message }) => new AttemptFailure.AgentFailure({ message }),
79
- AgentResultError: ({ message }) => new AttemptFailure.AgentFailure({ message }),
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 }),
80
93
  });
81
- /** Stable first-level child seam selected by the authored BrainSpec harness. */
94
+ /** Runs the coding work delegated by an Attempt's parent. */
82
95
  export class ChildBackend extends Context.Service()("@usine/agents/ChildBackend") {
83
96
  }
84
- /** Concrete Claude child implementation consumed by the harness dispatcher. */
97
+ /** Runs delegated coding work with Claude Code. */
85
98
  export class ClaudeChildBackend extends Context.Service()("@usine/agents/ClaudeChildBackend") {
86
99
  }
87
- /** Concrete Codex child implementation consumed by the harness dispatcher. */
100
+ /** Runs delegated coding work with Codex. */
88
101
  export class CodexChildBackend extends Context.Service()("@usine/agents/CodexChildBackend") {
89
102
  }
90
- /** Concrete Pi child implementation consumed by the harness dispatcher. */
103
+ /** Runs delegated coding work with Pi. */
91
104
  export class PiChildBackend extends Context.Service()("@usine/agents/PiChildBackend") {
92
105
  }
93
- /** Stable parent seam consumed by the run host. */
106
+ /** Starts the parent that coordinates one Attempt's task and delegates coding work to children. */
94
107
  export class AgentRuntime extends Context.Service()("@usine/agents/AgentRuntime") {
95
108
  }
96
109
  //# sourceMappingURL=runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEvE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;AAGlG,kFAAkF;AAClF,MAAM,OAAO,aAAc,SAAQ,MAAM,CAAC,KAAK,CAAgB,6BAA6B,CAAC,CAAC;IAC5F,IAAI,EAAE,cAAc,CAAC,OAAO;IAC5B,GAAG,EAAE,gBAAgB;CACtB,CAAC;CAAG;AAEL,gEAAgE;AAChE,MAAM,OAAO,YAAa,SAAQ,MAAM,CAAC,KAAK,CAAe,4BAA4B,CAAC,CAAC;IACzF,OAAO,EAAE,KAAK,CAAC,YAAY;IAC3B,GAAG,EAAE,gBAAgB;IACrB,MAAM,EAAE,MAAM,CAAC,cAAc;CAC9B,CAAC;CAAG;AAEL,mEAAmE;AACnE,MAAM,OAAO,aAAc,SAAQ,MAAM,CAAC,KAAK,CAAgB,6BAA6B,CAAC,CAAC;IAC5F,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC;CAAG;AAEL,+FAA+F;AAC/F,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,WAAW,CACvD,iCAAiC,CAClC,CAAC,mBAAmB,EAAE;IACrB,OAAO,EAAE,KAAK,CAAC,OAAO;IACtB,KAAK,EAAE,KAAK,CAAC,OAAO;IACpB,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAA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EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC;IACtE,gBAAgB,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC;IAChE,+BAA+B,EAAE,CAAC,EAAE,iBAAiB,EAAE,WAAW,EAAE,EAAE,EAAE,CACtE,IAAI,yBAAyB,CAAC,EAAE,iBAAiB,EAAE,WAAW,EAAE,CAAC;CACpE,CAAC,CAAC;AAuBL,6DAA6D;AAC7D,MAAM,OAAO,YAAa,SAAQ,OAAO,CAAC,OAAO,EAAqC,CACpF,4BAA4B,CAC7B;CAAG;AAEJ,mDAAmD;AACnD,MAAM,OAAO,kBAAmB,SAAQ,OAAO,CAAC,OAAO,EAA2C,CAChG,kCAAkC,CACnC;CAAG;AAEJ,6CAA6C;AAC7C,MAAM,OAAO,iBAAkB,SAAQ,OAAO,CAAC,OAAO,EAA0C,CAC9F,iCAAiC,CAClC;CAAG;AAEJ,0CAA0C;AAC1C,MAAM,OAAO,cAAe,SAAQ,OAAO,CAAC,OAAO,EAAuC,CACxF,8BAA8B,CAC/B;CAAG;AAEJ,mGAAmG;AACnG,MAAM,OAAO,YAAa,SAAQ,OAAO,CAAC,OAAO,EAQ9C,CAAC,4BAA4B,CAAC;CAAG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usine/agents",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "The usine agent layer: Pi parent adapter, subagents extension, team roster and brain specs.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -14,23 +14,47 @@
14
14
  "type": "module",
15
15
  "sideEffects": false,
16
16
  "exports": {
17
- ".": {
18
- "types": "./dist/index.d.ts",
19
- "default": "./dist/index.js"
20
- },
21
17
  "./pi": {
22
- "types": "./dist/pi/index.d.ts",
23
- "default": "./dist/pi/index.js"
18
+ "types": "./dist/pi/pi.d.ts",
19
+ "default": "./dist/pi/pi.js"
20
+ },
21
+ "./children": {
22
+ "types": "./dist/pi/children.d.ts",
23
+ "default": "./dist/pi/children.js"
24
+ },
25
+ "./claude": {
26
+ "types": "./dist/pi/claude.d.ts",
27
+ "default": "./dist/pi/claude.js"
28
+ },
29
+ "./codex": {
30
+ "types": "./dist/pi/codex/codex.d.ts",
31
+ "default": "./dist/pi/codex/codex.js"
32
+ },
33
+ "./pi/live": {
34
+ "types": "./dist/pi/live.d.ts",
35
+ "default": "./dist/pi/live.js"
36
+ },
37
+ "./prompt": {
38
+ "types": "./dist/prompt.d.ts",
39
+ "default": "./dist/prompt.js"
40
+ },
41
+ "./runtime": {
42
+ "types": "./dist/runtime.d.ts",
43
+ "default": "./dist/runtime.js"
44
+ },
45
+ "./preflight": {
46
+ "types": "./dist/preflight/preflight.d.ts",
47
+ "default": "./dist/preflight/preflight.js"
24
48
  }
25
49
  },
26
50
  "publishConfig": {
27
51
  "access": "public"
28
52
  },
29
53
  "dependencies": {
30
- "@anthropic-ai/claude-agent-sdk": "0.3.251",
31
- "@earendil-works/pi-coding-agent": "0.84.4",
54
+ "@anthropic-ai/claude-agent-sdk": "0.3.261",
55
+ "@earendil-works/pi-coding-agent": "0.85.1",
32
56
  "typebox": "1.3.7",
33
- "@usine/core": "0.1.0"
57
+ "@usine/core": "0.2.0"
34
58
  },
35
59
  "devDependencies": {
36
60
  "@effect/platform-node": "4.0.0-rc.111",
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /** @usine/agents — parent-agent and harness-child contracts for usine. */
2
- export * from "./prompt.ts";
3
- export * from "./runtime.ts";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAE1E,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
package/dist/index.js DELETED
@@ -1,4 +0,0 @@
1
- /** @usine/agents — parent-agent and harness-child contracts for usine. */
2
- export * from "./prompt.js";
3
- export * from "./runtime.js";
4
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAE1E,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -1,11 +0,0 @@
1
- /** Node-only Pi parent plus all harness child adapters. */
2
- import { Layer } from "effect";
3
- export * from "./claude.ts";
4
- export * from "./children.ts";
5
- export * from "./codex/app-server.ts";
6
- export * from "./codex/codex.ts";
7
- export * from "./pi.ts";
8
- export * from "./subagents.ts";
9
- /** Production in-process agent runtime: Pi parent with the three harness child backends. */
10
- export declare const layer: Layer.Layer<import("../runtime.ts").AgentRuntime, never, import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner>;
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pi/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAO/B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAW/B,4FAA4F;AAC5F,eAAO,MAAM,KAAK,qIAAuE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pi/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD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