@usine/agents 0.1.0 → 0.3.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 (93) hide show
  1. package/README.md +35 -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 +80 -15
  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/codec.d.ts +96 -0
  23. package/dist/pi/codex/codec.d.ts.map +1 -0
  24. package/dist/pi/codex/codec.js +110 -0
  25. package/dist/pi/codex/codec.js.map +1 -0
  26. package/dist/pi/codex/codex.d.ts +2 -0
  27. package/dist/pi/codex/codex.d.ts.map +1 -1
  28. package/dist/pi/codex/codex.js +143 -148
  29. package/dist/pi/codex/codex.js.map +1 -1
  30. package/dist/pi/conversation.d.ts +26 -0
  31. package/dist/pi/conversation.d.ts.map +1 -0
  32. package/dist/pi/conversation.js +93 -0
  33. package/dist/pi/conversation.js.map +1 -0
  34. package/dist/pi/live.d.ts +4 -0
  35. package/dist/pi/live.d.ts.map +1 -0
  36. package/dist/pi/{index.js → live.js} +2 -9
  37. package/dist/pi/live.js.map +1 -0
  38. package/dist/pi/pi.d.ts +3 -1
  39. package/dist/pi/pi.d.ts.map +1 -1
  40. package/dist/pi/pi.js +90 -64
  41. package/dist/pi/pi.js.map +1 -1
  42. package/dist/pi/sdk.d.ts +18 -13
  43. package/dist/pi/sdk.d.ts.map +1 -1
  44. package/dist/pi/sdk.js +15 -10
  45. package/dist/pi/sdk.js.map +1 -1
  46. package/dist/pi/session.d.ts +20 -21
  47. package/dist/pi/session.d.ts.map +1 -1
  48. package/dist/pi/session.js +23 -11
  49. package/dist/pi/session.js.map +1 -1
  50. package/dist/pi/subagents.d.ts +17 -11
  51. package/dist/pi/subagents.d.ts.map +1 -1
  52. package/dist/pi/subagents.js +81 -44
  53. package/dist/pi/subagents.js.map +1 -1
  54. package/dist/pi/thinking.d.ts +8 -0
  55. package/dist/pi/thinking.d.ts.map +1 -0
  56. package/dist/pi/thinking.js +15 -0
  57. package/dist/pi/thinking.js.map +1 -0
  58. package/dist/pi/turns.d.ts +28 -0
  59. package/dist/pi/turns.d.ts.map +1 -0
  60. package/dist/pi/turns.js +54 -0
  61. package/dist/pi/turns.js.map +1 -0
  62. package/dist/pi/usage.d.ts +25 -0
  63. package/dist/pi/usage.d.ts.map +1 -0
  64. package/dist/pi/usage.js +72 -0
  65. package/dist/pi/usage.js.map +1 -0
  66. package/dist/preflight/command.d.ts +7 -0
  67. package/dist/preflight/command.d.ts.map +1 -0
  68. package/dist/preflight/command.js +42 -0
  69. package/dist/preflight/command.js.map +1 -0
  70. package/dist/preflight/preflight.d.ts +13 -0
  71. package/dist/preflight/preflight.d.ts.map +1 -0
  72. package/dist/preflight/preflight.js +100 -0
  73. package/dist/preflight/preflight.js.map +1 -0
  74. package/dist/prompt.d.ts +15 -11
  75. package/dist/prompt.d.ts.map +1 -1
  76. package/dist/prompt.js +14 -11
  77. package/dist/prompt.js.map +1 -1
  78. package/dist/protocol/codex.d.ts +20 -6
  79. package/dist/protocol/codex.d.ts.map +1 -1
  80. package/dist/protocol/codex.js +7 -1
  81. package/dist/protocol/codex.js.map +1 -1
  82. package/dist/runtime.d.ts +59 -25
  83. package/dist/runtime.d.ts.map +1 -1
  84. package/dist/runtime.js +47 -34
  85. package/dist/runtime.js.map +1 -1
  86. package/package.json +34 -10
  87. package/dist/index.d.ts +0 -4
  88. package/dist/index.d.ts.map +0 -1
  89. package/dist/index.js +0 -4
  90. package/dist/index.js.map +0 -1
  91. package/dist/pi/index.d.ts +0 -11
  92. package/dist/pi/index.d.ts.map +0 -1
  93. package/dist/pi/index.js.map +0 -1
@@ -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,iBAAkB,SAAQ,sBAMrC;CAAG;;;;;;;AAEL,0FAA0F;AAC1F,qBAAa,oBAAqB,SAAQ,yBAOxC;CAAG;;;;;;;AAEL,oFAAoF;AACpF,qBAAa,sBAAuB,SAAQ,2BAO1C;CAAG;;;;;AAEL,oFAAoF;AACpF,qBAAa,gBAAiB,SAAQ,qBAKpC;CAAG;AAEL,eAAO,MAAM,kBAAkB,YAAI,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAU,CAAC;AACtF,eAAO,M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AAE,KAAK,CAAC,KAAK,CAAC,CAAC;CACzF;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;;;;OAIG;qBACc,CACf,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,aAAa,KACpB,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC;;AAZtE,mGAAmG;AACnG,qBAAa,YAAa,SAAQ,iBAaD;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,OAA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AAY,CAAC,EAAE,OAAO,EAAE,CAAC;IACpE,sBAAsB,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;AAsCL,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,EAa9C,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.3.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.3.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,O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