@tangle-network/agent-runtime 0.94.11 → 0.94.13

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 (67) hide show
  1. package/README.md +65 -1
  2. package/dist/agent.d.ts +2 -1
  3. package/dist/agent.js +2 -1
  4. package/dist/agent.js.map +1 -1
  5. package/dist/{agentic-generator-JT47GnAp.d.ts → agentic-generator-DDMM45kZ.d.ts} +2 -2
  6. package/dist/analyst-loop.d.ts +2 -1
  7. package/dist/backends-BO4Jqoe2.d.ts +134 -0
  8. package/dist/candidate-execution/index.d.ts +2 -2
  9. package/dist/candidate-execution/index.js +2 -2
  10. package/dist/chunk-AEG3NGJ2.js +639 -0
  11. package/dist/chunk-AEG3NGJ2.js.map +1 -0
  12. package/dist/{chunk-37V4KQDC.js → chunk-CNH7DF7Z.js} +173 -84
  13. package/dist/chunk-CNH7DF7Z.js.map +1 -0
  14. package/dist/{chunk-OLZ6ZZQ2.js → chunk-D3H7F6L2.js} +11 -8
  15. package/dist/chunk-D3H7F6L2.js.map +1 -0
  16. package/dist/{chunk-5LIOH5DR.js → chunk-PCURO3DL.js} +4 -4
  17. package/dist/chunk-PCURO3DL.js.map +1 -0
  18. package/dist/{chunk-FTXM7Q7P.js → chunk-TVJQAYQM.js} +13 -21
  19. package/dist/chunk-TVJQAYQM.js.map +1 -0
  20. package/dist/{chunk-YP6B7RZ2.js → chunk-U33YZ7B2.js} +6 -635
  21. package/dist/chunk-U33YZ7B2.js.map +1 -0
  22. package/dist/chunk-VYA2YEKA.js +1187 -0
  23. package/dist/chunk-VYA2YEKA.js.map +1 -0
  24. package/dist/{chunk-MXBQNVFE.js → chunk-XP5KDM3R.js} +5 -5
  25. package/dist/{completion-gate-Bn4AZ_Kw.d.ts → completion-gate-D1gX1-hg.d.ts} +1 -1
  26. package/dist/conversation.d.ts +793 -0
  27. package/dist/conversation.js +56 -0
  28. package/dist/conversation.js.map +1 -0
  29. package/dist/{coordination-DzwagV_s.d.ts → coordination-Dr_axlAf.d.ts} +5 -4
  30. package/dist/environment-provider.d.ts +3 -2
  31. package/dist/{improve-BucbjddC.d.ts → improve-BN3HyXIO.d.ts} +1 -1
  32. package/dist/index.d.ts +29 -943
  33. package/dist/index.js +60 -1161
  34. package/dist/index.js.map +1 -1
  35. package/dist/intelligence.d.ts +6 -5
  36. package/dist/intelligence.js +6 -6
  37. package/dist/knowledge.d.ts +7 -6
  38. package/dist/lifecycle.d.ts +2 -2
  39. package/dist/lifecycle.js +1 -1
  40. package/dist/{loop-runner-bin-D6K_C6op.d.ts → loop-runner-bin-BRQSQdHa.d.ts} +2 -2
  41. package/dist/loop-runner-bin.d.ts +6 -5
  42. package/dist/loop-runner-bin.js +4 -3
  43. package/dist/loops.d.ts +15 -14
  44. package/dist/loops.js +2 -1
  45. package/dist/mcp/index.d.ts +9 -8
  46. package/dist/mcp/index.js +2 -1
  47. package/dist/mcp/index.js.map +1 -1
  48. package/dist/{mcp-serve-verifier-i6nTNSnu.d.ts → mcp-serve-verifier-DQQDbuyz.d.ts} +1 -1
  49. package/dist/{openai-tools-0wACz8f8.d.ts → openai-tools-fnj6SRVg.d.ts} +1 -1
  50. package/dist/{prepare-DIeVgQG3.d.ts → prepare-CtdtsFNG.d.ts} +18 -14
  51. package/dist/primeintellect/index.d.ts +214 -0
  52. package/dist/primeintellect/index.js +1120 -0
  53. package/dist/primeintellect/index.js.map +1 -0
  54. package/dist/profiles.d.ts +2 -1
  55. package/dist/{sanitize-Dcbjp0tU.d.ts → sanitize-BTSsdBXw.d.ts} +1 -1
  56. package/dist/{supervise-CzyytS-o.d.ts → supervise-DmYOug5f.d.ts} +4 -4
  57. package/dist/{types-CogNCaw7.d.ts → types-1d5QGK3t.d.ts} +1 -1
  58. package/dist/types-BwoZWq-i.d.ts +510 -0
  59. package/dist/{types-CKmyZ9TP.d.ts → types-ByAYqlVb.d.ts} +3 -509
  60. package/dist/{worktree-fanout-Bn7w_1bM.d.ts → worktree-fanout-CPprU-qI.d.ts} +3 -3
  61. package/package.json +17 -5
  62. package/dist/chunk-37V4KQDC.js.map +0 -1
  63. package/dist/chunk-5LIOH5DR.js.map +0 -1
  64. package/dist/chunk-FTXM7Q7P.js.map +0 -1
  65. package/dist/chunk-OLZ6ZZQ2.js.map +0 -1
  66. package/dist/chunk-YP6B7RZ2.js.map +0 -1
  67. /package/dist/{chunk-MXBQNVFE.js.map → chunk-XP5KDM3R.js.map} +0 -0
@@ -1,512 +1,6 @@
1
- import { ControlEvalResult, KnowledgeRequirement, ControlBudget, KnowledgeReadinessReport, ControlStep, ControlDecision, UserQuestion, DataAcquisitionPlan, ControlRunResult, RunRecord, TraceStore, DefaultVerdict } from '@tangle-network/agent-eval';
1
+ import { DefaultVerdict } from '@tangle-network/agent-eval';
2
2
  import { CreateSandboxOptions, SandboxInstance, SandboxEvent, AgentProfile } from '@tangle-network/sandbox';
3
-
4
- /**
5
- *
6
- * Core task, session, adapter, and stream-event types for the runtime.
7
- *
8
- * This module owns the public shape of every cross-cutting record (`TaskSpec`,
9
- * `RuntimeSession`, `RuntimeStreamEvent`). Everything else in the runtime
10
- * imports from here so type-level changes ripple in one place.
11
- *
12
- * @stable
13
- */
14
-
15
- /** @stable */
16
- interface AgentTaskSpec {
17
- id: string;
18
- intent: string;
19
- /** Domain is metadata, not an architectural boundary: tax, legal, gtm, creative, blueprint, redteam, etc. */
20
- domain?: string;
21
- inputs?: Record<string, unknown>;
22
- requiredKnowledge?: KnowledgeRequirement[];
23
- budget?: Partial<ControlBudget>;
24
- metadata?: Record<string, unknown>;
25
- }
26
- /** @stable */
27
- interface AgentKnowledgeProvider {
28
- buildReadiness?(task: AgentTaskSpec): Promise<KnowledgeReadinessReport> | KnowledgeReadinessReport;
29
- answerQuestions?(questions: UserQuestion[], task: AgentTaskSpec): Promise<Record<string, string>> | Record<string, string>;
30
- executeAcquisitionPlans?(plans: DataAcquisitionPlan[], task: AgentTaskSpec): Promise<string[]> | string[];
31
- refreshReadiness?(input: {
32
- task: AgentTaskSpec;
33
- previous: KnowledgeReadinessReport;
34
- userAnswers: Record<string, string>;
35
- acquiredEvidenceIds: string[];
36
- }): Promise<KnowledgeReadinessReport> | KnowledgeReadinessReport;
37
- }
38
- /** @stable */
39
- interface AgentTaskContext<TState, TAction, TActionResult, TEval extends ControlEvalResult = ControlEvalResult> {
40
- task: AgentTaskSpec;
41
- knowledge: KnowledgeReadinessReport;
42
- state: TState;
43
- evals: TEval[];
44
- history: ControlStep<TState, TAction, TActionResult, TEval>[];
45
- budget: ControlBudget;
46
- stepIndex: number;
47
- wallMs: number;
48
- spentCostUsd: number;
49
- remainingCostUsd?: number;
50
- abortSignal: AbortSignal;
51
- }
52
- /** @stable */
53
- interface AgentAdapter<TState, TAction, TActionResult, TEval extends ControlEvalResult = ControlEvalResult> {
54
- observe(ctx: {
55
- task: AgentTaskSpec;
56
- knowledge: KnowledgeReadinessReport;
57
- history: ControlStep<TState, TAction, TActionResult, TEval>[];
58
- abortSignal: AbortSignal;
59
- }): Promise<TState> | TState;
60
- validate(ctx: {
61
- task: AgentTaskSpec;
62
- knowledge: KnowledgeReadinessReport;
63
- state: TState;
64
- history: ControlStep<TState, TAction, TActionResult, TEval>[];
65
- abortSignal: AbortSignal;
66
- }): Promise<TEval[]> | TEval[];
67
- decide(ctx: AgentTaskContext<TState, TAction, TActionResult, TEval>): Promise<ControlDecision<TAction>> | ControlDecision<TAction>;
68
- act(action: TAction, ctx: AgentTaskContext<TState, TAction, TActionResult, TEval>): Promise<TActionResult> | TActionResult;
69
- shouldStop?(ctx: AgentTaskContext<TState, TAction, TActionResult, TEval>): Promise<{
70
- stop: boolean;
71
- pass: boolean;
72
- reason: string;
73
- score?: number;
74
- }> | {
75
- stop: boolean;
76
- pass: boolean;
77
- reason: string;
78
- score?: number;
79
- };
80
- onKnowledgeBlocked?(ctx: {
81
- task: AgentTaskSpec;
82
- knowledge: KnowledgeReadinessReport;
83
- questions: UserQuestion[];
84
- acquisitionPlans: DataAcquisitionPlan[];
85
- }): Promise<ControlDecision<TAction>> | ControlDecision<TAction>;
86
- getActionCostUsd?(ctx: {
87
- action: TAction;
88
- result: TActionResult;
89
- task: AgentTaskSpec;
90
- state: TState;
91
- evals: TEval[];
92
- history: ControlStep<TState, TAction, TActionResult, TEval>[];
93
- }): number | undefined;
94
- projectRunRecords?(result: ControlRunResult<TState, TAction, TActionResult, TEval>, task: AgentTaskSpec): RunRecord[];
95
- }
96
- /** @stable */
97
- type AgentTaskStatus = 'completed' | 'blocked' | 'failed' | 'aborted';
98
- /** @stable */
99
- type AgentRuntimeEvent<TState = unknown, TAction = unknown, TActionResult = unknown, TEval extends ControlEvalResult = ControlEvalResult> = {
100
- type: 'task_start';
101
- task: AgentTaskSpec;
102
- } | {
103
- type: 'readiness_start';
104
- task: AgentTaskSpec;
105
- } | {
106
- type: 'readiness_end';
107
- task: AgentTaskSpec;
108
- knowledge: KnowledgeReadinessReport;
109
- } | {
110
- type: 'questions_start';
111
- task: AgentTaskSpec;
112
- questions: UserQuestion[];
113
- } | {
114
- type: 'questions_end';
115
- task: AgentTaskSpec;
116
- questions: UserQuestion[];
117
- userAnswers: Record<string, string>;
118
- } | {
119
- type: 'acquisition_start';
120
- task: AgentTaskSpec;
121
- acquisitionPlans: DataAcquisitionPlan[];
122
- } | {
123
- type: 'acquisition_end';
124
- task: AgentTaskSpec;
125
- acquisitionPlans: DataAcquisitionPlan[];
126
- acquiredEvidenceIds: string[];
127
- } | {
128
- type: 'control_start';
129
- task: AgentTaskSpec;
130
- knowledge: KnowledgeReadinessReport;
131
- } | {
132
- type: 'control_step';
133
- task: AgentTaskSpec;
134
- step: ControlStep<TState, TAction, TActionResult, TEval>;
135
- } | {
136
- type: 'control_end';
137
- task: AgentTaskSpec;
138
- control: ControlRunResult<TState, TAction, TActionResult, TEval>;
139
- } | {
140
- type: 'task_end';
141
- task: AgentTaskSpec;
142
- status: AgentTaskStatus;
143
- reason: string;
144
- };
145
- /** @stable */
146
- type AgentRuntimeEventSink<TState = unknown, TAction = unknown, TActionResult = unknown, TEval extends ControlEvalResult = ControlEvalResult> = (event: AgentRuntimeEvent<TState, TAction, TActionResult, TEval>) => Promise<void> | void;
147
- /**
148
- *
149
- * Typed transport / backend failure detail. Carried on `backend_error` and
150
- * `final` events when the backend's stream throws or the upstream HTTP call
151
- * returns a non-success status. Lets consumers (a) distinguish "stream
152
- * completed with no text" from "stream never reached the model" and
153
- * (b) reconstruct the precise upstream signal (status + truncated body) when
154
- * building a `RunRecord.error`.
155
- *
156
- * `body` is truncated to 2 KiB by the backend so an HTML error page from a
157
- * misconfigured proxy never bloats event payloads or logs. Consumers needing
158
- * the full body should inspect the underlying `BackendTransportError.body`
159
- * via a custom `mapEvent` or backend wrapper.
160
- *
161
- * @stable
162
- */
163
- interface BackendErrorDetail {
164
- /**
165
- * `'transport'` — upstream HTTP / network failure with optional status code.
166
- * `'backend'` — the backend's `stream()` generator threw for a non-transport
167
- * reason (e.g. a custom adapter error, sandbox crash).
168
- */
169
- kind: 'transport' | 'backend';
170
- message: string;
171
- /** Upstream HTTP status when known. `0` for connection / abort errors. */
172
- status?: number;
173
- /** Truncated response body (≤2 KiB). Diagnostic only — never machine-parsed. */
174
- body?: string;
175
- }
176
- /**
177
- *
178
- * OpenAI Chat Completions tool descriptor. The shape mirrors the
179
- * `/v1/chat/completions` `tools[]` parameter so callers can pass tool
180
- * definitions through `createOpenAICompatibleBackend({ tools })` without any
181
- * runtime translation. The router proxies this shape verbatim to Anthropic
182
- * (translated server-side), DeepSeek, Groq, OpenAI, and Gemini — every model
183
- * that the eval surface targets.
184
- *
185
- * Callers that build their tool list from MCP servers should run a one-shot
186
- * MCP `tools/list` at config time and project the result into this shape. The
187
- * runtime intentionally does NOT depend on `@modelcontextprotocol/sdk` —
188
- * keeping the backend transport thin lets domain repos own MCP plumbing.
189
- *
190
- * @stable
191
- */
192
- interface OpenAIChatTool {
193
- type: 'function';
194
- function: {
195
- name: string;
196
- description?: string;
197
- parameters?: Record<string, unknown>;
198
- };
199
- }
200
- /**
201
- *
202
- * `tool_choice` parameter for OpenAI-compat chat. Same shape as the OpenAI
203
- * spec: `'auto'` (default — model decides), `'none'` (disable tool calling
204
- * for this turn), `'required'` (force a tool call), or a specific function
205
- * pin `{ type: 'function', function: { name } }`.
206
- *
207
- * @stable
208
- */
209
- type OpenAIChatToolChoice = 'auto' | 'none' | 'required' | {
210
- type: 'function';
211
- function: {
212
- name: string;
213
- };
214
- };
215
- /**
216
- *
217
- * `response_format` parameter for OpenAI-compatible chat endpoints. Use
218
- * `json_object` when the caller needs syntactically valid JSON, or
219
- * `json_schema` when the upstream provider supports schema-constrained JSON.
220
- *
221
- * @stable
222
- */
223
- type OpenAIChatResponseFormat = {
224
- type: 'text';
225
- } | {
226
- type: 'json_object';
227
- } | {
228
- type: 'json_schema';
229
- json_schema: Record<string, unknown>;
230
- };
231
- /** @stable */
232
- type RuntimeStreamEvent = {
233
- type: 'task_start';
234
- task: AgentTaskSpec;
235
- timestamp: string;
236
- } | {
237
- type: 'readiness_start';
238
- task: AgentTaskSpec;
239
- timestamp: string;
240
- } | {
241
- type: 'readiness_end';
242
- task: AgentTaskSpec;
243
- knowledge: KnowledgeReadinessReport;
244
- decision: KnowledgeReadinessDecision;
245
- timestamp: string;
246
- } | {
247
- type: 'questions_start';
248
- task: AgentTaskSpec;
249
- questions: UserQuestion[];
250
- timestamp: string;
251
- } | {
252
- type: 'questions_end';
253
- task: AgentTaskSpec;
254
- questions: UserQuestion[];
255
- userAnswers: Record<string, string>;
256
- timestamp: string;
257
- } | {
258
- type: 'acquisition_start';
259
- task: AgentTaskSpec;
260
- acquisitionPlans: DataAcquisitionPlan[];
261
- timestamp: string;
262
- } | {
263
- type: 'acquisition_end';
264
- task: AgentTaskSpec;
265
- acquisitionPlans: DataAcquisitionPlan[];
266
- acquiredEvidenceIds: string[];
267
- timestamp: string;
268
- } | {
269
- type: 'session_created';
270
- task: AgentTaskSpec;
271
- session: RuntimeSession;
272
- timestamp: string;
273
- } | {
274
- type: 'session_resumed';
275
- task: AgentTaskSpec;
276
- session: RuntimeSession;
277
- timestamp: string;
278
- } | {
279
- type: 'backend_start';
280
- task: AgentTaskSpec;
281
- session: RuntimeSession;
282
- backend: string;
283
- timestamp: string;
284
- } | {
285
- type: 'text_delta';
286
- task?: AgentTaskSpec;
287
- session?: RuntimeSession;
288
- text: string;
289
- timestamp?: string;
290
- } | {
291
- type: 'reasoning_delta';
292
- task?: AgentTaskSpec;
293
- session?: RuntimeSession;
294
- text: string;
295
- timestamp?: string;
296
- } | {
297
- type: 'tool_call';
298
- task?: AgentTaskSpec;
299
- session?: RuntimeSession;
300
- toolName: string;
301
- toolCallId?: string;
302
- args?: unknown;
303
- timestamp?: string;
304
- } | {
305
- type: 'tool_result';
306
- task?: AgentTaskSpec;
307
- session?: RuntimeSession;
308
- toolName: string;
309
- toolCallId?: string;
310
- result?: unknown;
311
- timestamp?: string;
312
- } | {
313
- type: 'llm_call';
314
- task?: AgentTaskSpec;
315
- session?: RuntimeSession;
316
- model: string;
317
- tokensIn?: number;
318
- tokensOut?: number;
319
- costUsd?: number;
320
- latencyMs?: number;
321
- finishReason?: string;
322
- timestamp?: string;
323
- } | {
324
- type: 'artifact';
325
- task?: AgentTaskSpec;
326
- session?: RuntimeSession;
327
- artifactId: string;
328
- name?: string;
329
- mimeType?: string;
330
- uri?: string;
331
- content?: string;
332
- metadata?: Record<string, unknown>;
333
- timestamp?: string;
334
- } | {
335
- type: 'proposal_created';
336
- task?: AgentTaskSpec;
337
- session?: RuntimeSession;
338
- proposalId: string;
339
- title: string;
340
- status?: 'pending' | 'approved' | 'rejected';
341
- content?: string;
342
- timestamp?: string;
343
- } | {
344
- type: 'backend_error';
345
- task: AgentTaskSpec;
346
- session?: RuntimeSession;
347
- backend: string;
348
- message: string;
349
- recoverable: boolean;
350
- /**
351
- * Typed transport diagnostic. Present when the upstream returned a
352
- * non-success HTTP status or every retry attempt threw. Consumers MUST
353
- * surface this onto their `RunRecord.error` — silently treating a
354
- * `backend_error` as "no output" hides credit exhaustion, auth failure,
355
- * and upstream outages from operators.
356
- * - `kind: 'transport'` — HTTP / network failure with optional `status`
357
- * + truncated response `body`.
358
- * - `kind: 'backend'` — the backend's `stream()` generator threw for a
359
- * reason that isn't a recognized transport failure.
360
- */
361
- error?: BackendErrorDetail;
362
- timestamp: string;
363
- } | {
364
- type: 'backend_end';
365
- task: AgentTaskSpec;
366
- session: RuntimeSession;
367
- backend: string;
368
- timestamp: string;
369
- } | {
370
- type: 'task_end';
371
- task: AgentTaskSpec;
372
- status: AgentTaskStatus;
373
- reason: string;
374
- timestamp: string;
375
- } | {
376
- type: 'final';
377
- task: AgentTaskSpec;
378
- session?: RuntimeSession;
379
- status: AgentTaskStatus;
380
- reason: string;
381
- text?: string;
382
- metadata?: Record<string, unknown>;
383
- /**
384
- * Typed terminal-error diagnostic. Mirrors the `backend_error.error`
385
- * shape so a consumer that only listens for `final` still receives a
386
- * loud, structured failure when the backend never produced output. Only
387
- * set when `status !== 'completed'`. Consumers building a `RunRecord`
388
- * MUST map this to `RunRecord.error` rather than recording silent
389
- * `error: null` with empty `finalText`.
390
- */
391
- error?: BackendErrorDetail;
392
- timestamp: string;
393
- };
394
- /** @stable */
395
- interface RuntimeSession {
396
- id: string;
397
- backend: string;
398
- status: 'active' | 'completed' | 'failed' | 'aborted';
399
- resumeToken?: string;
400
- createdAt: string;
401
- updatedAt: string;
402
- metadata?: Record<string, unknown>;
403
- }
404
- /** @stable */
405
- interface RuntimeSessionStore {
406
- get(sessionId: string): Promise<RuntimeSession | undefined> | RuntimeSession | undefined;
407
- put(session: RuntimeSession): Promise<void> | void;
408
- appendEvent?(sessionId: string, event: RuntimeStreamEvent): Promise<void> | void;
409
- listEvents?(sessionId: string): Promise<RuntimeStreamEvent[]> | RuntimeStreamEvent[];
410
- }
411
- /** @stable */
412
- interface AgentBackendInput {
413
- task: AgentTaskSpec;
414
- message?: string;
415
- messages?: Array<{
416
- role: string;
417
- content: string;
418
- }>;
419
- inputs?: Record<string, unknown>;
420
- }
421
- /** @stable */
422
- interface AgentBackendContext {
423
- task: AgentTaskSpec;
424
- knowledge: KnowledgeReadinessReport;
425
- session: RuntimeSession;
426
- signal?: AbortSignal;
427
- /**
428
- * Conversation/run identifier when this call is part of a multi-agent run.
429
- * Backends should stamp it into any trace/log emission so cross-participant
430
- * events correlate. Absent when the call is a stand-alone `runAgentTask`.
431
- */
432
- runId?: string;
433
- /**
434
- * Deterministic turn id for this single call. Stable across retries of the
435
- * same logical turn so a caching gateway / idempotent backend can dedupe.
436
- */
437
- turnId?: string;
438
- /**
439
- * If this call is itself nested inside a higher-order conversation
440
- * (recursion via `createConversationBackend`), the enclosing turn's id.
441
- * Used for trace stitching across nested orchestration.
442
- */
443
- parentTurnId?: string;
444
- /**
445
- * Headers to forward verbatim to any outbound HTTP the backend issues:
446
- * `X-Tangle-Forwarded-Authorization`, `X-Tangle-Forwarded-Depth`,
447
- * run/turn correlation. Backends that issue HTTP MUST merge these into
448
- * the outbound request; backends that don't issue HTTP may ignore them.
449
- */
450
- propagatedHeaders?: Readonly<Record<string, string>>;
451
- }
452
- /** @stable */
453
- interface AgentExecutionBackend<TInput extends AgentBackendInput = AgentBackendInput> {
454
- kind: string;
455
- start?(input: TInput, context: Omit<AgentBackendContext, 'session'> & {
456
- requestedSessionId?: string;
457
- }): Promise<RuntimeSession> | RuntimeSession;
458
- resume?(session: RuntimeSession, input: TInput, context: Omit<AgentBackendContext, 'session'>): Promise<RuntimeSession> | RuntimeSession;
459
- stream(input: TInput, context: AgentBackendContext): AsyncIterable<RuntimeStreamEvent>;
460
- stop?(session: RuntimeSession, reason: string): Promise<void> | void;
461
- }
462
- /** @stable */
463
- interface RunAgentTaskStreamOptions<TInput extends AgentBackendInput = AgentBackendInput> {
464
- task: AgentTaskSpec;
465
- backend: AgentExecutionBackend<TInput>;
466
- input?: Omit<TInput, 'task'>;
467
- knowledge?: AgentKnowledgeProvider;
468
- sessionStore?: RuntimeSessionStore;
469
- sessionId?: string;
470
- resume?: boolean;
471
- signal?: AbortSignal;
472
- minimumReadinessScore?: number;
473
- }
474
- /** @stable */
475
- interface RunAgentTaskOptions<TState, TAction, TActionResult, TEval extends ControlEvalResult = ControlEvalResult> {
476
- task: AgentTaskSpec;
477
- adapter: AgentAdapter<TState, TAction, TActionResult, TEval>;
478
- knowledge?: AgentKnowledgeProvider;
479
- onEvent?: AgentRuntimeEventSink<TState, TAction, TActionResult, TEval>;
480
- store?: TraceStore;
481
- signal?: AbortSignal;
482
- scenarioId?: string;
483
- projectId?: string;
484
- variantId?: string;
485
- minimumReadinessScore?: number;
486
- }
487
- /** @stable */
488
- interface AgentTaskRunResult<TState, TAction, TActionResult, TEval extends ControlEvalResult = ControlEvalResult> {
489
- task: AgentTaskSpec;
490
- status: AgentTaskStatus;
491
- knowledge: KnowledgeReadinessReport;
492
- questions: UserQuestion[];
493
- acquisitionPlans: DataAcquisitionPlan[];
494
- userAnswers: Record<string, string>;
495
- acquiredEvidenceIds: string[];
496
- control: ControlRunResult<TState, TAction, TActionResult, TEval>;
497
- runRecords: RunRecord[];
498
- }
499
- /** @stable */
500
- interface KnowledgeReadinessDecision {
501
- passed: boolean;
502
- status: 'ready' | 'blocked' | 'caveat';
503
- reason: string;
504
- readinessScore: number;
505
- recommendedAction: KnowledgeReadinessReport['recommendedAction'];
506
- severity: KnowledgeReadinessReport['severity'];
507
- blockingGapIds: string[];
508
- nonBlockingGapIds: string[];
509
- }
3
+ import { g as AgentTaskSpec, R as RuntimeStreamEvent } from './types-BwoZWq-i.js';
510
4
 
511
5
  /**
512
6
  *
@@ -1305,4 +799,4 @@ interface ExecCtx {
1305
799
  parentSpanId?: string;
1306
800
  }
1307
801
 
1308
- export { type SelectionReceipt as $, type AgentRuntimeEvent as A, type BackendErrorDetail as B, type RuntimeHookErrorContext as C, type Driver as D, type ExecCtx as E, type RuntimeHookEvent as F, type RuntimeHookPhase as G, type RuntimeHookTarget as H, type Iteration as I, type RuntimeRunHandle as J, type KnowledgeReadinessDecision as K, type LoopTokenUsage as L, type RuntimeRunPersistenceAdapter as M, type RuntimeRunRow as N, type OpenAIChatTool as O, composeRuntimeHooks as P, defineRuntimeHooks as Q, type RuntimeHooks as R, type SandboxClient as S, notifyRuntimeDecisionPoint as T, notifyRuntimeHookEvent as U, type Validator as V, startRuntimeRun as W, type LoopWinner as X, type LoopLineageOptions as Y, type LoopResult as Z, type MountRecorder as _, type RuntimeStreamEvent as a, type LoopDecisionPayload as a0, type LoopEndedPayload as a1, type LoopIterationDispatchPayload as a2, type LoopIterationEndedPayload as a3, type LoopIterationStartedPayload as a4, type LoopPlanDescription as a5, type LoopPlanPayload as a6, type LoopStartedPayload as a7, type LoopTeardownFailedPayload as a8, type MountManifestEntry as a9, type RunProvenance as aa, type ValidationCtx as ab, type AgentTaskStatus as b, type OutputAdapter as c, type AgentRunSpec as d, type LoopTraceEvent as e, type LoopSandboxPlacement as f, type LoopTraceEmitter as g, type AgentBackendInput as h, type OpenAIChatToolChoice as i, type OpenAIChatResponseFormat as j, type AgentExecutionBackend as k, type AgentBackendContext as l, type RunAgentTaskOptions as m, type AgentTaskRunResult as n, type RunAgentTaskStreamOptions as o, type RuntimeSessionStore as p, type RuntimeSession as q, type AgentAdapter as r, type AgentKnowledgeProvider as s, type AgentRuntimeEventSink as t, type AgentTaskContext as u, type AgentTaskSpec as v, type RuntimeDecisionEvidenceRef as w, type RuntimeDecisionKind as x, type RuntimeDecisionPoint as y, type RuntimeHookContext as z };
802
+ export { type AgentRunSpec as A, type LoopIterationEndedPayload as B, type LoopIterationStartedPayload as C, type Driver as D, type ExecCtx as E, type LoopPlanDescription as F, type LoopPlanPayload as G, type LoopStartedPayload as H, type Iteration as I, type LoopTeardownFailedPayload as J, type MountManifestEntry as K, type LoopTokenUsage as L, type MountRecorder as M, type RunProvenance as N, type OutputAdapter as O, type ValidationCtx as P, type RuntimeHooks as R, type SandboxClient as S, type Validator as V, type LoopTraceEvent as a, type LoopSandboxPlacement as b, type RuntimeDecisionEvidenceRef as c, type RuntimeDecisionKind as d, type RuntimeDecisionPoint as e, type RuntimeHookContext as f, type RuntimeHookErrorContext as g, type RuntimeHookEvent as h, type RuntimeHookPhase as i, type RuntimeHookTarget as j, type RuntimeRunHandle as k, type RuntimeRunPersistenceAdapter as l, type RuntimeRunRow as m, composeRuntimeHooks as n, defineRuntimeHooks as o, notifyRuntimeDecisionPoint as p, notifyRuntimeHookEvent as q, type LoopTraceEmitter as r, startRuntimeRun as s, type LoopWinner as t, type LoopLineageOptions as u, type LoopResult as v, type SelectionReceipt as w, type LoopDecisionPayload as x, type LoopEndedPayload as y, type LoopIterationDispatchPayload as z };
@@ -1,9 +1,9 @@
1
1
  import { AgentProfile } from '@tangle-network/agent-interface';
2
2
  import { AnalystFinding, DefaultVerdict } from '@tangle-network/agent-eval';
3
- import { d as AgentSpec, e as ExecutorRegistry, B as Budget, A as Agent, f as SpawnJournal, a as ResultBlobStore, g as RootHandle, b as SupervisedResult, N as NodeId, h as Settled, i as Spend, S as Scope, c as Executor } from './types-CogNCaw7.js';
4
- import { R as RuntimeHooks, I as Iteration } from './types-CKmyZ9TP.js';
3
+ import { d as AgentSpec, e as ExecutorRegistry, B as Budget, A as Agent, f as SpawnJournal, a as ResultBlobStore, g as RootHandle, b as SupervisedResult, N as NodeId, h as Settled, i as Spend, S as Scope, c as Executor } from './types-1d5QGK3t.js';
4
+ import { R as RuntimeHooks, I as Iteration } from './types-ByAYqlVb.js';
5
5
  import { BackendType } from '@tangle-network/sandbox';
6
- import { W as WorktreeHarnessResult, G as GitRunner, a as WorktreeCheckRunner, D as DeliverableSpec } from './completion-gate-Bn4AZ_Kw.js';
6
+ import { W as WorktreeHarnessResult, G as GitRunner, a as WorktreeCheckRunner, D as DeliverableSpec } from './completion-gate-D1gX1-hg.js';
7
7
  import { L as LocalHarness, r as runLocalHarness } from './local-harness-ZqCx51u7.js';
8
8
 
9
9
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-runtime",
3
- "version": "0.94.11",
3
+ "version": "0.94.13",
4
4
  "description": "Shared task-lifecycle skeleton for agents: a recursive loop kernel for chat turns, one-shot tasks, and multi-attempt loops, with trace capture and eval-gated self-improvement. Domain behavior lives in adapters; scoring and ship-gates in @tangle-network/agent-eval.",
5
5
  "homepage": "https://github.com/tangle-network/agent-runtime#readme",
6
6
  "repository": {
@@ -24,6 +24,11 @@
24
24
  "import": "./dist/agent.js",
25
25
  "default": "./dist/agent.js"
26
26
  },
27
+ "./conversation": {
28
+ "types": "./dist/conversation.d.ts",
29
+ "import": "./dist/conversation.js",
30
+ "default": "./dist/conversation.js"
31
+ },
27
32
  "./intelligence": {
28
33
  "types": "./dist/intelligence.d.ts",
29
34
  "import": "./dist/intelligence.js",
@@ -64,6 +69,11 @@
64
69
  "import": "./dist/platform.js",
65
70
  "default": "./dist/platform.js"
66
71
  },
72
+ "./primeintellect": {
73
+ "types": "./dist/primeintellect/index.d.ts",
74
+ "import": "./dist/primeintellect/index.js",
75
+ "default": "./dist/primeintellect/index.js"
76
+ },
67
77
  "./candidate-execution": {
68
78
  "types": "./dist/candidate-execution/index.d.ts",
69
79
  "import": "./dist/candidate-execution/index.js",
@@ -98,14 +108,16 @@
98
108
  "typecheck": "tsc --noEmit && pnpm run typecheck:examples",
99
109
  "typecheck:examples": "tsc --noEmit -p tsconfig.examples.json",
100
110
  "verify:package": "node scripts/verify-package-exports.mjs",
111
+ "verify:primeintellect": "pnpm build && node scripts/verify-primeintellect-v1.mjs",
112
+ "verify:primeintellect:live": "pnpm build && node scripts/verify-primeintellect-live.mjs",
101
113
  "docs:api": "typedoc && node scripts/gen-primitive-catalog.mjs",
102
114
  "docs:freshness": "node scripts/check-docs-freshness.mjs",
103
115
  "docs:check": "pnpm run docs:api && git diff --exit-code -- docs/api && pnpm run docs:freshness"
104
116
  },
105
117
  "devDependencies": {
106
118
  "@biomejs/biome": "^2.4.15",
107
- "@tangle-network/agent-eval": "0.117.1",
108
- "@tangle-network/agent-interface": "^0.25.0",
119
+ "@tangle-network/agent-eval": "0.120.1",
120
+ "@tangle-network/agent-interface": "0.26.1",
109
121
  "@tangle-network/sandbox": "^0.9.7",
110
122
  "@types/node": "^25.9.3",
111
123
  "@types/tar-stream": "3.1.4",
@@ -135,8 +147,8 @@
135
147
  "license": "MIT",
136
148
  "packageManager": "pnpm@10.28.0",
137
149
  "peerDependencies": {
138
- "@tangle-network/agent-eval": ">=0.117.1 <0.118.0",
139
- "@tangle-network/agent-interface": ">=0.25.0 <0.26.0",
150
+ "@tangle-network/agent-eval": ">=0.120.1 <0.121.0",
151
+ "@tangle-network/agent-interface": ">=0.26.1 <0.27.0",
140
152
  "@tangle-network/sandbox": ">=0.8.0 <1.0.0",
141
153
  "playwright": "^1.40.0"
142
154
  },