@alpacakit/agents 0.1.0-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +224 -0
  3. package/dist/agents/builtin.d.ts +19 -0
  4. package/dist/agents/builtin.d.ts.map +1 -0
  5. package/dist/agents/builtin.js +14 -0
  6. package/dist/agents/claude.d.ts +20 -0
  7. package/dist/agents/claude.d.ts.map +1 -0
  8. package/dist/agents/claude.js +480 -0
  9. package/dist/agents/codex.d.ts +19 -0
  10. package/dist/agents/codex.d.ts.map +1 -0
  11. package/dist/agents/codex.js +355 -0
  12. package/dist/agents/openai-compatible/config.d.ts +16 -0
  13. package/dist/agents/openai-compatible/config.d.ts.map +1 -0
  14. package/dist/agents/openai-compatible/config.js +160 -0
  15. package/dist/agents/openai-compatible/engine.d.ts +18 -0
  16. package/dist/agents/openai-compatible/engine.d.ts.map +1 -0
  17. package/dist/agents/openai-compatible/engine.js +10 -0
  18. package/dist/agents/openai-compatible/fetch-engine.d.ts +38 -0
  19. package/dist/agents/openai-compatible/fetch-engine.d.ts.map +1 -0
  20. package/dist/agents/openai-compatible/fetch-engine.js +216 -0
  21. package/dist/agents/openai-compatible/pi/engine.d.ts +32 -0
  22. package/dist/agents/openai-compatible/pi/engine.d.ts.map +1 -0
  23. package/dist/agents/openai-compatible/pi/engine.js +98 -0
  24. package/dist/agents/openai-compatible/pi/module.d.ts +87 -0
  25. package/dist/agents/openai-compatible/pi/module.d.ts.map +1 -0
  26. package/dist/agents/openai-compatible/pi/module.js +43 -0
  27. package/dist/agents/openai-compatible/pi/sandbox.d.ts +25 -0
  28. package/dist/agents/openai-compatible/pi/sandbox.d.ts.map +1 -0
  29. package/dist/agents/openai-compatible/pi/sandbox.js +69 -0
  30. package/dist/agents/openai-compatible/pi/session.d.ts +17 -0
  31. package/dist/agents/openai-compatible/pi/session.d.ts.map +1 -0
  32. package/dist/agents/openai-compatible/pi/session.js +354 -0
  33. package/dist/agents/openai-compatible/response.d.ts +19 -0
  34. package/dist/agents/openai-compatible/response.d.ts.map +1 -0
  35. package/dist/agents/openai-compatible/response.js +203 -0
  36. package/dist/agents/openai-compatible/types.d.ts +34 -0
  37. package/dist/agents/openai-compatible/types.d.ts.map +1 -0
  38. package/dist/agents/openai-compatible/types.js +1 -0
  39. package/dist/agents/openai-compatible.d.ts +12 -0
  40. package/dist/agents/openai-compatible.d.ts.map +1 -0
  41. package/dist/agents/openai-compatible.js +45 -0
  42. package/dist/auth/login-probe.d.ts +21 -0
  43. package/dist/auth/login-probe.d.ts.map +1 -0
  44. package/dist/auth/login-probe.js +47 -0
  45. package/dist/auth/login.d.ts +79 -0
  46. package/dist/auth/login.d.ts.map +1 -0
  47. package/dist/auth/login.js +9 -0
  48. package/dist/auth/material.d.ts +87 -0
  49. package/dist/auth/material.d.ts.map +1 -0
  50. package/dist/auth/material.js +59 -0
  51. package/dist/auth/profile-store.d.ts +14 -0
  52. package/dist/auth/profile-store.d.ts.map +1 -0
  53. package/dist/auth/profile-store.js +101 -0
  54. package/dist/auth/secrets.d.ts +14 -0
  55. package/dist/auth/secrets.d.ts.map +1 -0
  56. package/dist/auth/secrets.js +40 -0
  57. package/dist/codex/app-server.d.ts +30 -0
  58. package/dist/codex/app-server.d.ts.map +1 -0
  59. package/dist/codex/app-server.js +322 -0
  60. package/dist/codex/index.d.ts +3 -0
  61. package/dist/codex/index.d.ts.map +1 -0
  62. package/dist/codex/index.js +1 -0
  63. package/dist/codex/protocol.d.ts +124 -0
  64. package/dist/codex/protocol.d.ts.map +1 -0
  65. package/dist/codex/protocol.js +283 -0
  66. package/dist/config/agent-config-validation.d.ts +22 -0
  67. package/dist/config/agent-config-validation.d.ts.map +1 -0
  68. package/dist/config/agent-config-validation.js +31 -0
  69. package/dist/config/agent-configs.d.ts +37 -0
  70. package/dist/config/agent-configs.d.ts.map +1 -0
  71. package/dist/config/agent-configs.js +214 -0
  72. package/dist/config/compose.d.ts +10 -0
  73. package/dist/config/compose.d.ts.map +1 -0
  74. package/dist/config/compose.js +89 -0
  75. package/dist/config/config.d.ts +21 -0
  76. package/dist/config/config.d.ts.map +1 -0
  77. package/dist/config/config.js +33 -0
  78. package/dist/config/errors.d.ts +45 -0
  79. package/dist/config/errors.d.ts.map +1 -0
  80. package/dist/config/errors.js +37 -0
  81. package/dist/config/extension.d.ts +3 -0
  82. package/dist/config/extension.d.ts.map +1 -0
  83. package/dist/config/extension.js +1 -0
  84. package/dist/config/ids.d.ts +8 -0
  85. package/dist/config/ids.d.ts.map +1 -0
  86. package/dist/config/ids.js +4 -0
  87. package/dist/config/index.d.ts +12 -0
  88. package/dist/config/index.d.ts.map +1 -0
  89. package/dist/config/index.js +6 -0
  90. package/dist/config/model.d.ts +105 -0
  91. package/dist/config/model.d.ts.map +1 -0
  92. package/dist/config/model.js +1 -0
  93. package/dist/config/paths.d.ts +7 -0
  94. package/dist/config/paths.d.ts.map +1 -0
  95. package/dist/config/paths.js +10 -0
  96. package/dist/config/schema.d.ts +59 -0
  97. package/dist/config/schema.d.ts.map +1 -0
  98. package/dist/config/schema.js +83 -0
  99. package/dist/config/store.d.ts +34 -0
  100. package/dist/config/store.d.ts.map +1 -0
  101. package/dist/config/store.js +420 -0
  102. package/dist/config/support.d.ts +14 -0
  103. package/dist/config/support.d.ts.map +1 -0
  104. package/dist/config/support.js +32 -0
  105. package/dist/config/values.d.ts +21 -0
  106. package/dist/config/values.d.ts.map +1 -0
  107. package/dist/config/values.js +22 -0
  108. package/dist/config/xdg.d.ts +20 -0
  109. package/dist/config/xdg.d.ts.map +1 -0
  110. package/dist/config/xdg.js +23 -0
  111. package/dist/core/async-queue.d.ts +14 -0
  112. package/dist/core/async-queue.d.ts.map +1 -0
  113. package/dist/core/async-queue.js +46 -0
  114. package/dist/core/env.d.ts +19 -0
  115. package/dist/core/env.d.ts.map +1 -0
  116. package/dist/core/env.js +39 -0
  117. package/dist/core/error.d.ts +121 -0
  118. package/dist/core/error.d.ts.map +1 -0
  119. package/dist/core/error.js +88 -0
  120. package/dist/core/fs.d.ts +16 -0
  121. package/dist/core/fs.d.ts.map +1 -0
  122. package/dist/core/fs.js +30 -0
  123. package/dist/core/json.d.ts +20 -0
  124. package/dist/core/json.d.ts.map +1 -0
  125. package/dist/core/json.js +42 -0
  126. package/dist/core/node-ports.d.ts +9 -0
  127. package/dist/core/node-ports.d.ts.map +1 -0
  128. package/dist/core/node-ports.js +135 -0
  129. package/dist/core/ports.d.ts +71 -0
  130. package/dist/core/ports.d.ts.map +1 -0
  131. package/dist/core/ports.js +19 -0
  132. package/dist/core/redact.d.ts +8 -0
  133. package/dist/core/redact.d.ts.map +1 -0
  134. package/dist/core/redact.js +66 -0
  135. package/dist/core/run.d.ts +125 -0
  136. package/dist/core/run.d.ts.map +1 -0
  137. package/dist/core/run.js +27 -0
  138. package/dist/core/values.d.ts +12 -0
  139. package/dist/core/values.d.ts.map +1 -0
  140. package/dist/core/values.js +9 -0
  141. package/dist/corpus/failure-corpus.d.ts +21 -0
  142. package/dist/corpus/failure-corpus.d.ts.map +1 -0
  143. package/dist/corpus/failure-corpus.js +89 -0
  144. package/dist/fleet/fleet.d.ts +120 -0
  145. package/dist/fleet/fleet.d.ts.map +1 -0
  146. package/dist/fleet/fleet.js +409 -0
  147. package/dist/fleet/policy.d.ts +45 -0
  148. package/dist/fleet/policy.d.ts.map +1 -0
  149. package/dist/fleet/policy.js +50 -0
  150. package/dist/fleet/store.d.ts +28 -0
  151. package/dist/fleet/store.d.ts.map +1 -0
  152. package/dist/fleet/store.js +225 -0
  153. package/dist/host/capabilities.d.ts +146 -0
  154. package/dist/host/capabilities.d.ts.map +1 -0
  155. package/dist/host/capabilities.js +59 -0
  156. package/dist/host/context.d.ts +29 -0
  157. package/dist/host/context.d.ts.map +1 -0
  158. package/dist/host/context.js +11 -0
  159. package/dist/host/github-dir.d.ts +16 -0
  160. package/dist/host/github-dir.d.ts.map +1 -0
  161. package/dist/host/github-dir.js +164 -0
  162. package/dist/host/mcp-list.d.ts +12 -0
  163. package/dist/host/mcp-list.d.ts.map +1 -0
  164. package/dist/host/mcp-list.js +122 -0
  165. package/dist/host/requirement-ref.d.ts +12 -0
  166. package/dist/host/requirement-ref.d.ts.map +1 -0
  167. package/dist/host/requirement-ref.js +40 -0
  168. package/dist/host/run-command.d.ts +27 -0
  169. package/dist/host/run-command.d.ts.map +1 -0
  170. package/dist/host/run-command.js +66 -0
  171. package/dist/host/validate-spec.d.ts +10 -0
  172. package/dist/host/validate-spec.d.ts.map +1 -0
  173. package/dist/host/validate-spec.js +69 -0
  174. package/dist/index.d.ts +69 -0
  175. package/dist/index.d.ts.map +1 -0
  176. package/dist/index.js +41 -0
  177. package/dist/kernel/classify.d.ts +44 -0
  178. package/dist/kernel/classify.d.ts.map +1 -0
  179. package/dist/kernel/classify.js +136 -0
  180. package/dist/kernel/cli-agent.d.ts +62 -0
  181. package/dist/kernel/cli-agent.d.ts.map +1 -0
  182. package/dist/kernel/cli-agent.js +281 -0
  183. package/dist/kernel/cli-login.d.ts +13 -0
  184. package/dist/kernel/cli-login.d.ts.map +1 -0
  185. package/dist/kernel/cli-login.js +199 -0
  186. package/dist/kernel/definition.d.ts +41 -0
  187. package/dist/kernel/definition.d.ts.map +1 -0
  188. package/dist/kernel/definition.js +13 -0
  189. package/dist/kernel/env-template.d.ts +17 -0
  190. package/dist/kernel/env-template.d.ts.map +1 -0
  191. package/dist/kernel/env-template.js +78 -0
  192. package/dist/kernel/facets.d.ts +58 -0
  193. package/dist/kernel/facets.d.ts.map +1 -0
  194. package/dist/kernel/facets.js +102 -0
  195. package/dist/kernel/guard.d.ts +24 -0
  196. package/dist/kernel/guard.d.ts.map +1 -0
  197. package/dist/kernel/guard.js +69 -0
  198. package/dist/kernel/handle.d.ts +29 -0
  199. package/dist/kernel/handle.d.ts.map +1 -0
  200. package/dist/kernel/handle.js +97 -0
  201. package/dist/kernel/keyed.d.ts +19 -0
  202. package/dist/kernel/keyed.d.ts.map +1 -0
  203. package/dist/kernel/keyed.js +35 -0
  204. package/dist/kernel/login.d.ts +20 -0
  205. package/dist/kernel/login.d.ts.map +1 -0
  206. package/dist/kernel/login.js +74 -0
  207. package/dist/kernel/options.d.ts +73 -0
  208. package/dist/kernel/options.d.ts.map +1 -0
  209. package/dist/kernel/options.js +41 -0
  210. package/dist/kernel/run.d.ts +20 -0
  211. package/dist/kernel/run.d.ts.map +1 -0
  212. package/dist/kernel/run.js +245 -0
  213. package/dist/kernel/runtime.d.ts +48 -0
  214. package/dist/kernel/runtime.d.ts.map +1 -0
  215. package/dist/kernel/runtime.js +108 -0
  216. package/dist/keyring/index.d.ts +2 -0
  217. package/dist/keyring/index.d.ts.map +1 -0
  218. package/dist/keyring/index.js +1 -0
  219. package/dist/keyring/resolver.d.ts +9 -0
  220. package/dist/keyring/resolver.d.ts.map +1 -0
  221. package/dist/keyring/resolver.js +62 -0
  222. package/dist/run-agent.d.ts +19 -0
  223. package/dist/run-agent.d.ts.map +1 -0
  224. package/dist/run-agent.js +25 -0
  225. package/dist/structured/extract.d.ts +27 -0
  226. package/dist/structured/extract.d.ts.map +1 -0
  227. package/dist/structured/extract.js +188 -0
  228. package/dist/structured/run-structured.d.ts +83 -0
  229. package/dist/structured/run-structured.d.ts.map +1 -0
  230. package/dist/structured/run-structured.js +202 -0
  231. package/dist/structured/standard-schema.d.ts +34 -0
  232. package/dist/structured/standard-schema.d.ts.map +1 -0
  233. package/dist/structured/standard-schema.js +6 -0
  234. package/dist/testing/fake-agent.d.ts +32 -0
  235. package/dist/testing/fake-agent.d.ts.map +1 -0
  236. package/dist/testing/fake-agent.js +43 -0
  237. package/dist/testing/fake-clock.d.ts +8 -0
  238. package/dist/testing/fake-clock.d.ts.map +1 -0
  239. package/dist/testing/fake-clock.js +44 -0
  240. package/dist/testing/fake-exec.d.ts +26 -0
  241. package/dist/testing/fake-exec.d.ts.map +1 -0
  242. package/dist/testing/fake-exec.js +69 -0
  243. package/dist/testing/fake-secrets.d.ts +3 -0
  244. package/dist/testing/fake-secrets.d.ts.map +1 -0
  245. package/dist/testing/fake-secrets.js +5 -0
  246. package/dist/testing/index.d.ts +10 -0
  247. package/dist/testing/index.d.ts.map +1 -0
  248. package/dist/testing/index.js +9 -0
  249. package/package.json +75 -0
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Library-wide rule (design F7): every surfaced diagnostic passes secret
3
+ * redaction before it can appear in an error message or telemetry event.
4
+ */
5
+ const SECRET_PATTERNS = [
6
+ /\bsk-[A-Za-z0-9_-]{8,}\b/g,
7
+ /\bsk-ant-[A-Za-z0-9_-]{8,}\b/g,
8
+ /\bgh[pousr]_[A-Za-z0-9]{20,}\b/g,
9
+ /\bgithub_pat_[A-Za-z0-9_]{20,}\b/g,
10
+ /\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g,
11
+ /\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/g,
12
+ /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9._-]{10,}\b/g,
13
+ ];
14
+ const REDACTED = "[redacted]";
15
+ const SENSITIVE_JSON_KEY_SUFFIXES = [
16
+ "apikey",
17
+ "accesskey",
18
+ "passwd",
19
+ "password",
20
+ "privatekey",
21
+ "secret",
22
+ "token",
23
+ ];
24
+ const CREDENTIAL_REDACTION_RULES = [
25
+ {
26
+ pattern: /([a-z][a-z0-9+.-]*:\/\/)([^/\s:@]+):([^/\s@]+)@/giu,
27
+ replacement: `$1${REDACTED}@`,
28
+ },
29
+ {
30
+ pattern: /(^|[\s;])((?:_?auth[_-]?token|api[_-]?key|access[_-]?token|password|passwd|secret|token)\s*=\s*)([^\s"'`]+)/giu,
31
+ replacement: `$1$2${REDACTED}`,
32
+ },
33
+ {
34
+ pattern: /(^|[;\r\n])((?:_?auth[_-]?token|api[_-]?key|access[_-]?token|password|passwd|secret|token)\s*:\s*)([^\s"'`]+)/giu,
35
+ replacement: `$1$2${REDACTED}`,
36
+ },
37
+ ];
38
+ export function redactSecrets(text) {
39
+ let redacted = text;
40
+ for (const pattern of SECRET_PATTERNS) {
41
+ redacted = redacted.replace(pattern, REDACTED);
42
+ }
43
+ for (const rule of CREDENTIAL_REDACTION_RULES) {
44
+ redacted = redacted.replace(rule.pattern, rule.replacement);
45
+ }
46
+ return redacted;
47
+ }
48
+ export function redactJsonSecrets(value) {
49
+ if (typeof value === "string") {
50
+ return redactSecrets(value);
51
+ }
52
+ if (Array.isArray(value)) {
53
+ return value.map(redactJsonSecrets);
54
+ }
55
+ if (value === null || typeof value !== "object") {
56
+ return value;
57
+ }
58
+ return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
59
+ key,
60
+ isSensitiveJsonKey(key) ? REDACTED : redactJsonSecrets(entry),
61
+ ]));
62
+ }
63
+ function isSensitiveJsonKey(key) {
64
+ const normalized = key.replaceAll(/[^a-z0-9]/giu, "").toLowerCase();
65
+ return SENSITIVE_JSON_KEY_SUFFIXES.some((suffix) => normalized.endsWith(suffix));
66
+ }
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Run-plane vocabulary. Adapters yield only `AgentEvent`; the kernel
3
+ * brackets every run with `started`/`ended`, so lifecycle forgery is
4
+ * unrepresentable. Outbound types follow absence rule 2: keys always
5
+ * present, `null` is meaningful absence.
6
+ */
7
+ import type { AgentErrorCode } from "./error.js";
8
+ import type { OutputChannel } from "./values.js";
9
+ export declare const AGENT_EVENT_TYPE: {
10
+ readonly output: "output";
11
+ readonly message: "message";
12
+ readonly turn: "turn";
13
+ readonly tool: "tool";
14
+ readonly trace: "trace";
15
+ readonly failureClassified: "failure_classified";
16
+ };
17
+ export declare const RUN_EVENT_TYPE: {
18
+ readonly started: "started";
19
+ readonly ended: "ended";
20
+ };
21
+ export declare const RUN_OUTCOME: {
22
+ readonly completed: "completed";
23
+ readonly failed: "failed";
24
+ readonly cancelled: "cancelled";
25
+ };
26
+ export declare const RUN_COMPLETION_KIND: {
27
+ readonly natural: "natural";
28
+ readonly earlyGrace: "early-grace";
29
+ };
30
+ export type AgentEvent = {
31
+ type: typeof AGENT_EVENT_TYPE.output;
32
+ channel: OutputChannel;
33
+ chunk: string;
34
+ } | {
35
+ type: typeof AGENT_EVENT_TYPE.message;
36
+ text: string;
37
+ } | {
38
+ type: typeof AGENT_EVENT_TYPE.turn;
39
+ } | {
40
+ type: typeof AGENT_EVENT_TYPE.tool;
41
+ name: string;
42
+ } | {
43
+ type: typeof AGENT_EVENT_TYPE.trace;
44
+ data: unknown;
45
+ } | {
46
+ type: typeof AGENT_EVENT_TYPE.failureClassified;
47
+ code: AgentErrorCode;
48
+ evidence: {
49
+ stdoutTail: string | null;
50
+ stderrTail: string | null;
51
+ exitCode: number | null;
52
+ signal: string | null;
53
+ };
54
+ };
55
+ export type RunEvent = AgentEvent | {
56
+ type: typeof RUN_EVENT_TYPE.started;
57
+ model: string | null;
58
+ } | {
59
+ type: typeof RUN_EVENT_TYPE.ended;
60
+ outcome: (typeof RUN_OUTCOME)[keyof typeof RUN_OUTCOME];
61
+ };
62
+ /** Identity lives on the telemetry envelope, never on each event. */
63
+ export type RunTelemetry = {
64
+ runId: string;
65
+ agentId: string;
66
+ event: RunEvent;
67
+ };
68
+ export type RunTiming = {
69
+ startedAt: string;
70
+ endedAt: string;
71
+ durationMs: number;
72
+ };
73
+ export type RunCompletion = {
74
+ kind: typeof RUN_COMPLETION_KIND.natural;
75
+ } | {
76
+ kind: typeof RUN_COMPLETION_KIND.earlyGrace;
77
+ };
78
+ export type RunExit = {
79
+ code: number | null;
80
+ signal: string | null;
81
+ completion: RunCompletion;
82
+ };
83
+ export type RunUsage = {
84
+ inputTokens: number | null;
85
+ outputTokens: number | null;
86
+ costUsd: number | null;
87
+ };
88
+ export type RunResult = {
89
+ runId: string;
90
+ text: string;
91
+ agentId: string;
92
+ model: string | null;
93
+ timing: RunTiming;
94
+ exit: RunExit | null;
95
+ raw: {
96
+ stdout: string;
97
+ stderr: string;
98
+ } | null;
99
+ usage: RunUsage | null;
100
+ };
101
+ /**
102
+ * What an adapter's generator returns. The kernel completes it into a
103
+ * `RunResult` — adapters cannot know `runId` or timing, so those never
104
+ * appear on the adapter side.
105
+ */
106
+ export type AgentRunOutcome = {
107
+ text: string;
108
+ model: string | null;
109
+ exit: RunExit | null;
110
+ raw: {
111
+ stdout: string;
112
+ stderr: string;
113
+ } | null;
114
+ usage: RunUsage | null;
115
+ };
116
+ /**
117
+ * Awaitable handle (execa-style): `await handle` ≡ `await handle.result`.
118
+ * Streaming callers iterate `events`; not consuming never blocks the run.
119
+ */
120
+ export type RunHandle = PromiseLike<RunResult> & {
121
+ readonly runId: string;
122
+ readonly events: AsyncIterable<RunEvent>;
123
+ readonly result: Promise<RunResult>;
124
+ };
125
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/core/run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,gBAAgB;;;;;;;CAOnB,CAAC;AAEX,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAEX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,OAAO,gBAAgB,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IAAE,IAAI,EAAE,OAAO,gBAAgB,CAAC,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,OAAO,gBAAgB,CAAC,IAAI,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,OAAO,gBAAgB,CAAC,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACpD;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ent`; the kernel
3
+ * brackets every run with `started`/`ended`, so lifecycle forgery is
4
+ * unrepresentable. Outbound types follow absence rule 2: keys always
5
+ * present, `null` is meaningful absence.
6
+ */
7
+ export const AGENT_EVENT_TYPE = {
8
+ output: "output",
9
+ message: "message",
10
+ turn: "turn",
11
+ tool: "tool",
12
+ trace: "trace",
13
+ failureClassified: "failure_classified",
14
+ };
15
+ export const RUN_EVENT_TYPE = {
16
+ started: "started",
17
+ ended: "ended",
18
+ };
19
+ export const RUN_OUTCOME = {
20
+ completed: "completed",
21
+ failed: "failed",
22
+ cancelled: "cancelled",
23
+ };
24
+ export const RUN_COMPLETION_KIND = {
25
+ natural: "natural",
26
+ earlyGrace: "early-grace",
27
+ };
@@ -0,0 +1,12 @@
1
+ export declare const OUTPUT_CHANNEL: {
2
+ readonly stdout: "stdout";
3
+ readonly stderr: "stderr";
4
+ };
5
+ export type OutputChannel = (typeof OUTPUT_CHANNEL)[keyof typeof OUTPUT_CHANNEL];
6
+ export declare const PROCESS_SIGNAL: {
7
+ readonly sigterm: "SIGTERM";
8
+ readonly sigkill: "SIGKILL";
9
+ };
10
+ export type ProcessSignal = (typeof PROCESS_SIGNAL)[keyof typeof PROCESS_SIGNAL];
11
+ export declare const TEXT_ENCODING = "utf8";
12
+ //# sourceMappingURL=values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/core/values.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAEX,MAAM,MAAM,aAAa,GACvB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAEX,MAAM,MAAM,aAAa,GACvB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD,eAAO,MAAM,aAAa,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ export const OUTPUT_CHANNEL = {
2
+ stdout: "stdout",
3
+ stderr: "stderr",
4
+ };
5
+ export const PROCESS_SIGNAL = {
6
+ sigterm: "SIGTERM",
7
+ sigkill: "SIGKILL",
8
+ };
9
+ export const TEXT_ENCODING = "utf8";
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Consumer-side corpus capture (design v D2): a `TelemetrySink` that a
3
+ * composition subscribes behind an explicit dev flag. It lives outside
4
+ * the kernel on purpose — the kernel only emits `failure_classified` on
5
+ * the run event stream; recording candidates to disk is a consumer
6
+ * concern. Promotion into `tests/fixtures/classify/` is manual curation.
7
+ */
8
+ import type { TelemetrySink } from "../core/ports.js";
9
+ export interface FailureCorpusRecorder extends TelemetrySink {
10
+ /** Settle pending writes; rejects once with the last write failure. */
11
+ flush(): Promise<void>;
12
+ }
13
+ /**
14
+ * Recording is opt-in by construction: a composition that does not want
15
+ * a corpus simply never creates a recorder.
16
+ */
17
+ export type FailureCorpusRecorderOptions = {
18
+ directory: string;
19
+ };
20
+ export declare function createFailureCorpusRecorder(options: FailureCorpusRecorderOptions): FailureCorpusRecorder;
21
+ //# sourceMappingURL=failure-corpus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failure-corpus.d.ts","sourceRoot":"","sources":["../../src/corpus/failure-corpus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOtD,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,uEAAuE;IACvE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA8GF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,4BAA4B,GACpC,qBAAqB,CAEvB"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Consumer-side corpus capture (design v D2): a `TelemetrySink` that a
3
+ * composition subscribes behind an explicit dev flag. It lives outside
4
+ * the kernel on purpose — the kernel only emits `failure_classified` on
5
+ * the run event stream; recording candidates to disk is a consumer
6
+ * concern. Promotion into `tests/fixtures/classify/` is manual curation.
7
+ */
8
+ import { readdir, rm } from "node:fs/promises";
9
+ import path from "node:path";
10
+ import { writeFileAtomically } from "../core/fs.js";
11
+ import { redactSecrets } from "../core/redact.js";
12
+ import { AGENT_EVENT_TYPE } from "../core/run.js";
13
+ const MAX_CORPUS_FILES = 200;
14
+ const CORPUS_FILE_EXTENSION = ".json";
15
+ function isFailureClassifiedTelemetry(telemetry) {
16
+ return telemetry.event.type === AGENT_EVENT_TYPE.failureClassified;
17
+ }
18
+ function safeFilePart(value) {
19
+ return value.replace(/[^A-Za-z0-9_.-]/gu, "_");
20
+ }
21
+ async function pruneCorpusFiles(directory) {
22
+ const entries = await readdir(directory, { withFileTypes: true });
23
+ const files = entries
24
+ .filter((entry) => entry.isFile() && entry.name.endsWith(CORPUS_FILE_EXTENSION))
25
+ .map((entry) => entry.name)
26
+ .sort();
27
+ const excess = files.length - MAX_CORPUS_FILES;
28
+ if (excess <= 0) {
29
+ return;
30
+ }
31
+ await Promise.all(files.slice(0, excess).map((file) => rm(path.join(directory, file))));
32
+ }
33
+ async function writeCandidate(directory, telemetry, sequence) {
34
+ const event = telemetry.event;
35
+ const agentDirectory = path.join(directory, safeFilePart(telemetry.agentId));
36
+ const fixture = {
37
+ description: `Captured ${telemetry.agentId} failure classified as ${event.code}`,
38
+ evidence: {
39
+ stdout: event.evidence.stdoutTail ?? "",
40
+ stderr: event.evidence.stderrTail ?? "",
41
+ exitCode: event.evidence.exitCode,
42
+ signal: event.evidence.signal,
43
+ },
44
+ expected: null,
45
+ };
46
+ const filename = [
47
+ String(Date.now()).padStart(13, "0"),
48
+ String(sequence).padStart(4, "0"),
49
+ safeFilePart(telemetry.runId),
50
+ ].join("-");
51
+ const raw = `${JSON.stringify(fixture, null, 2)}\n`;
52
+ await writeFileAtomically(path.join(agentDirectory, `${filename}${CORPUS_FILE_EXTENSION}`), redactSecrets(raw));
53
+ await pruneCorpusFiles(agentDirectory);
54
+ }
55
+ class FileFailureCorpusRecorder {
56
+ directory;
57
+ sequence = 0;
58
+ // The chain never rejects: each link swallows its own failure into
59
+ // `lastWriteError` so one bad write cannot poison later candidates or
60
+ // leave an unhandled rejection dangling.
61
+ queue = Promise.resolve();
62
+ lastWriteError = null;
63
+ constructor(directory) {
64
+ this.directory = directory;
65
+ }
66
+ emit(telemetry) {
67
+ if (!isFailureClassifiedTelemetry(telemetry)) {
68
+ return;
69
+ }
70
+ this.sequence += 1;
71
+ const current = this.sequence;
72
+ this.queue = this.queue
73
+ .then(() => writeCandidate(this.directory, telemetry, current))
74
+ .catch((error) => {
75
+ this.lastWriteError = error;
76
+ });
77
+ }
78
+ async flush() {
79
+ await this.queue;
80
+ if (this.lastWriteError !== null) {
81
+ const error = this.lastWriteError;
82
+ this.lastWriteError = null;
83
+ throw error;
84
+ }
85
+ }
86
+ }
87
+ export function createFailureCorpusRecorder(options) {
88
+ return new FileFailureCorpusRecorder(options.directory);
89
+ }
@@ -0,0 +1,120 @@
1
+ /**
2
+ * The fleet (design "Fleet"): failover is a strategy over an ordered
3
+ * candidate list plus a state store. The consumer decides what the
4
+ * candidates are and in which order; `attempt` is the composition seam.
5
+ * The agent handed to `attempt` is candidate-bound: auth env, model /
6
+ * effort defaults, and the linked signal are already folded in.
7
+ */
8
+ import type { AuthProfile } from "../auth/material.js";
9
+ import { AgentError, type AgentErrorCode } from "../core/error.js";
10
+ import type { RunResult } from "../core/run.js";
11
+ import type { RunOptions } from "../kernel/options.js";
12
+ import type { Agent, AgentRuntime } from "../kernel/runtime.js";
13
+ import type { StructuredResult, StructuredRunOptions } from "../structured/run-structured.js";
14
+ import { type FailurePolicy } from "./policy.js";
15
+ import { type CooldownKey, type FleetStateStore } from "./store.js";
16
+ /** Inbound (rule 1); `profile.agentId` must equal `agentId`. */
17
+ export type Candidate<Id extends string = string> = {
18
+ agentId: Id;
19
+ profile?: AuthProfile<Id>;
20
+ model?: string;
21
+ effort?: string;
22
+ };
23
+ export type CandidateOptions = {
24
+ readonly model?: string;
25
+ readonly effort?: string;
26
+ };
27
+ export declare function candidateFromProfile<const Id extends string>(profile: AuthProfile<Id>, options?: CandidateOptions): Candidate<Id>;
28
+ export declare function candidateForAgent<const Id extends string>(agentId: Id, options?: CandidateOptions): Candidate<Id>;
29
+ export declare function candidateKey(candidate: Candidate): CooldownKey;
30
+ /**
31
+ * Store key for a profile-scoped cooldown (`CooldownScope` "profile").
32
+ * The store stays a flat key-value map, but the key is an encoded,
33
+ * branded value so raw profile/model text cannot collide by separator.
34
+ */
35
+ export declare function profileCooldownKey(profileId: string): CooldownKey;
36
+ export declare const BLOCKER_REASON: {
37
+ readonly cooldown: "cooldown";
38
+ readonly retryableFailure: "retryable-failure";
39
+ readonly authInvalid: "auth-invalid";
40
+ readonly manualAuthRequired: "manual-auth-required";
41
+ };
42
+ export type BlockerReason = (typeof BLOCKER_REASON)[keyof typeof BLOCKER_REASON];
43
+ export type Blocker<Id extends string = string> = {
44
+ candidate: Candidate<Id>;
45
+ reason: typeof BLOCKER_REASON.cooldown;
46
+ until: string;
47
+ } | {
48
+ candidate: Candidate<Id>;
49
+ reason: typeof BLOCKER_REASON.retryableFailure | typeof BLOCKER_REASON.authInvalid | typeof BLOCKER_REASON.manualAuthRequired;
50
+ until: null;
51
+ };
52
+ export declare const ATTEMPT_STATUS: {
53
+ readonly completed: "completed";
54
+ readonly failed: "failed";
55
+ readonly skipped: "skipped";
56
+ };
57
+ export type AttemptStatus = (typeof ATTEMPT_STATUS)[keyof typeof ATTEMPT_STATUS];
58
+ export type AttemptTrace<Id extends string = string> = {
59
+ candidate: Candidate<Id>;
60
+ status: typeof ATTEMPT_STATUS.completed;
61
+ } | {
62
+ candidate: Candidate<Id>;
63
+ status: typeof ATTEMPT_STATUS.failed;
64
+ code: AgentErrorCode;
65
+ detail: string;
66
+ } | {
67
+ candidate: Candidate<Id>;
68
+ status: typeof ATTEMPT_STATUS.skipped;
69
+ reason: BlockerReason;
70
+ detail: string;
71
+ };
72
+ export declare const FLEET_OUTCOME_STATUS: {
73
+ readonly completed: "completed";
74
+ readonly deferred: "deferred";
75
+ readonly failed: "failed";
76
+ };
77
+ export type FleetOutcomeStatus = (typeof FLEET_OUTCOME_STATUS)[keyof typeof FLEET_OUTCOME_STATUS];
78
+ export type FleetOutcome<T, Id extends string = string> = {
79
+ status: typeof FLEET_OUTCOME_STATUS.completed;
80
+ value: T;
81
+ candidate: Candidate<Id>;
82
+ attempts: AttemptTrace<Id>[];
83
+ } | {
84
+ status: typeof FLEET_OUTCOME_STATUS.deferred;
85
+ blockers: Blocker<Id>[];
86
+ earliestRetryAt: string | null;
87
+ attempts: AttemptTrace<Id>[];
88
+ } | {
89
+ status: typeof FLEET_OUTCOME_STATUS.failed;
90
+ error: AgentError;
91
+ attempts: AttemptTrace<Id>[];
92
+ };
93
+ export type FleetAttemptRunOptions<T, Id extends string = string> = {
94
+ candidates: readonly Candidate<Id>[];
95
+ attempt: (agent: Agent<Id>, candidate: Candidate<Id>) => Promise<T>;
96
+ signal?: AbortSignal;
97
+ };
98
+ export type FleetPlainRunOptions<Id extends string = string> = {
99
+ candidates: readonly Candidate<Id>[];
100
+ runOptions: RunOptions;
101
+ signal?: AbortSignal;
102
+ };
103
+ export type FleetStructuredRunOptions<T, Id extends string = string> = {
104
+ candidates: readonly Candidate<Id>[];
105
+ runOptions: StructuredRunOptions<T>;
106
+ signal?: AbortSignal;
107
+ };
108
+ export type FleetRunOptions<T, Id extends string = string> = FleetAttemptRunOptions<T, Id> | FleetPlainRunOptions<Id> | FleetStructuredRunOptions<T, Id>;
109
+ export interface Fleet<Id extends string = string> {
110
+ run<T>(options: FleetStructuredRunOptions<T, Id>): Promise<FleetOutcome<StructuredResult<T>, Id>>;
111
+ run(options: FleetPlainRunOptions<Id>): Promise<FleetOutcome<RunResult, Id>>;
112
+ run<T>(options: FleetAttemptRunOptions<T, Id>): Promise<FleetOutcome<T, Id>>;
113
+ }
114
+ export type CreateFleetOptions<Id extends string> = {
115
+ runtime: AgentRuntime<Id>;
116
+ store?: FleetStateStore;
117
+ policy?: Partial<FailurePolicy>;
118
+ };
119
+ export declare function createFleet<Id extends string>(options: CreateFleetOptions<Id>): Fleet<Id>;
120
+ //# sourceMappingURL=fleet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fleet.d.ts","sourceRoot":"","sources":["../../src/fleet/fleet.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAMvD,OAAO,EAEL,UAAU,EACV,KAAK,cAAc,EAEpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAEV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAKL,KAAK,aAAa,EAGnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EAErB,MAAM,YAAY,CAAC;AAEpB,gEAAgE;AAChE,MAAM,MAAM,SAAS,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,IAAI;IAClD,OAAO,EAAE,EAAE,CAAC;IACZ,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CA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