@tangle-network/agent-runtime 0.94.11 → 0.94.12

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 (58) 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/chunk-AEG3NGJ2.js +639 -0
  9. package/dist/chunk-AEG3NGJ2.js.map +1 -0
  10. package/dist/{chunk-OLZ6ZZQ2.js → chunk-D3H7F6L2.js} +11 -8
  11. package/dist/chunk-D3H7F6L2.js.map +1 -0
  12. package/dist/{chunk-5LIOH5DR.js → chunk-PCURO3DL.js} +4 -4
  13. package/dist/chunk-PCURO3DL.js.map +1 -0
  14. package/dist/{chunk-YP6B7RZ2.js → chunk-U33YZ7B2.js} +6 -635
  15. package/dist/chunk-U33YZ7B2.js.map +1 -0
  16. package/dist/chunk-VYA2YEKA.js +1187 -0
  17. package/dist/chunk-VYA2YEKA.js.map +1 -0
  18. package/dist/{chunk-MXBQNVFE.js → chunk-XP5KDM3R.js} +5 -5
  19. package/dist/{completion-gate-Bn4AZ_Kw.d.ts → completion-gate-D1gX1-hg.d.ts} +1 -1
  20. package/dist/conversation.d.ts +793 -0
  21. package/dist/conversation.js +56 -0
  22. package/dist/conversation.js.map +1 -0
  23. package/dist/{coordination-DzwagV_s.d.ts → coordination-Dr_axlAf.d.ts} +5 -4
  24. package/dist/environment-provider.d.ts +3 -2
  25. package/dist/{improve-BucbjddC.d.ts → improve-BN3HyXIO.d.ts} +1 -1
  26. package/dist/index.d.ts +28 -942
  27. package/dist/index.js +58 -1159
  28. package/dist/index.js.map +1 -1
  29. package/dist/intelligence.d.ts +5 -4
  30. package/dist/intelligence.js +5 -5
  31. package/dist/knowledge.d.ts +7 -6
  32. package/dist/lifecycle.d.ts +2 -2
  33. package/dist/lifecycle.js +1 -1
  34. package/dist/{loop-runner-bin-D6K_C6op.d.ts → loop-runner-bin-BRQSQdHa.d.ts} +2 -2
  35. package/dist/loop-runner-bin.d.ts +6 -5
  36. package/dist/loop-runner-bin.js +4 -3
  37. package/dist/loops.d.ts +15 -14
  38. package/dist/loops.js +2 -1
  39. package/dist/mcp/index.d.ts +9 -8
  40. package/dist/mcp/index.js +2 -1
  41. package/dist/mcp/index.js.map +1 -1
  42. package/dist/{mcp-serve-verifier-i6nTNSnu.d.ts → mcp-serve-verifier-DQQDbuyz.d.ts} +1 -1
  43. package/dist/{openai-tools-0wACz8f8.d.ts → openai-tools-fnj6SRVg.d.ts} +1 -1
  44. package/dist/primeintellect/index.d.ts +214 -0
  45. package/dist/primeintellect/index.js +1120 -0
  46. package/dist/primeintellect/index.js.map +1 -0
  47. package/dist/profiles.d.ts +2 -1
  48. package/dist/{sanitize-Dcbjp0tU.d.ts → sanitize-BTSsdBXw.d.ts} +1 -1
  49. package/dist/{supervise-CzyytS-o.d.ts → supervise-DmYOug5f.d.ts} +4 -4
  50. package/dist/{types-CogNCaw7.d.ts → types-1d5QGK3t.d.ts} +1 -1
  51. package/dist/types-BwoZWq-i.d.ts +510 -0
  52. package/dist/{types-CKmyZ9TP.d.ts → types-ByAYqlVb.d.ts} +3 -509
  53. package/dist/{worktree-fanout-Bn7w_1bM.d.ts → worktree-fanout-CPprU-qI.d.ts} +3 -3
  54. package/package.json +15 -3
  55. package/dist/chunk-5LIOH5DR.js.map +0 -1
  56. package/dist/chunk-OLZ6ZZQ2.js.map +0 -1
  57. package/dist/chunk-YP6B7RZ2.js.map +0 -1
  58. /package/dist/{chunk-MXBQNVFE.js.map → chunk-XP5KDM3R.js.map} +0 -0
@@ -0,0 +1,214 @@
1
+ import { c as AgentExecutionBackend, A as AgentBackendInput } from '../types-BwoZWq-i.js';
2
+ import { c as createOpenAICompatibleBackend } from '../backends-BO4Jqoe2.js';
3
+ import { RunRecord } from '@tangle-network/agent-eval';
4
+
5
+ type PrimeIntellectSplit = 'train' | 'eval';
6
+ type PrimeIntellectJson = null | boolean | number | string | PrimeIntellectJson[] | {
7
+ [key: string]: PrimeIntellectJson;
8
+ };
9
+ type PrimeIntellectContent = string | Array<{
10
+ type: 'text';
11
+ text: string;
12
+ } | {
13
+ type: 'image_url';
14
+ image_url: {
15
+ url: string;
16
+ };
17
+ }>;
18
+ type PrimeIntellectMessage = {
19
+ role: 'system' | 'user';
20
+ content: PrimeIntellectContent;
21
+ } | {
22
+ role: 'assistant';
23
+ content?: string | null;
24
+ reasoning_content?: string | null;
25
+ tool_calls?: Array<{
26
+ id: string;
27
+ name: string;
28
+ arguments: string;
29
+ }>;
30
+ provider_state?: Array<Record<string, PrimeIntellectJson>>;
31
+ } | {
32
+ role: 'tool';
33
+ tool_call_id: string;
34
+ content: PrimeIntellectContent;
35
+ name?: string;
36
+ };
37
+ /** One immutable problem. References stay inside Prime's task process. */
38
+ interface PrimeIntellectTask {
39
+ id: string;
40
+ split: PrimeIntellectSplit;
41
+ prompt: string | PrimeIntellectMessage[];
42
+ systemPrompt?: string;
43
+ answer?: string | string[];
44
+ metadata?: Record<string, PrimeIntellectJson>;
45
+ }
46
+ type PrimeIntellectScoring = {
47
+ kind: 'exact';
48
+ normalization?: 'none' | 'trim' | 'trim-casefold';
49
+ } | {
50
+ kind: 'reference-judge';
51
+ model: string;
52
+ prompt?: string;
53
+ view?: 'last_reply' | 'full_trace';
54
+ } | {
55
+ kind: 'command';
56
+ command: readonly [string, ...string[]];
57
+ files?: Readonly<Record<string, string>>;
58
+ forwardEnv?: readonly string[];
59
+ timeoutSeconds?: number;
60
+ };
61
+ type PrimeIntellectSetupCommand = readonly [string, ...string[]];
62
+ /** Files and commands that make the caller's real agent program runnable. */
63
+ interface PrimeIntellectRunner {
64
+ command: readonly [string, ...string[]];
65
+ files?: Readonly<Record<string, string>>;
66
+ setup?: readonly PrimeIntellectSetupCommand[];
67
+ forwardEnv?: readonly string[];
68
+ /** Container image used by the generated eval config. */
69
+ image: string;
70
+ }
71
+ interface PrimeIntellectPackageOptions {
72
+ name: string;
73
+ version: string;
74
+ description?: string;
75
+ tasks: readonly PrimeIntellectTask[];
76
+ scoring: PrimeIntellectScoring;
77
+ runner: PrimeIntellectRunner;
78
+ /** Prime-enforced model turn cap. Default 16. */
79
+ maxTurns?: number;
80
+ maxInputTokens?: number;
81
+ maxOutputTokens?: number;
82
+ maxTotalTokens?: number;
83
+ rolloutTimeoutSeconds?: number;
84
+ scoringTimeoutSeconds?: number;
85
+ }
86
+ interface PrimeIntellectPackageManifest {
87
+ schema: 'tangle.primeintellect.package/v1';
88
+ name: string;
89
+ moduleName: string;
90
+ version: string;
91
+ verifiers: '>=0.2.0,<0.3.0';
92
+ taskCount: number;
93
+ splits: Record<PrimeIntellectSplit, number>;
94
+ taskIdsSha256: string;
95
+ filesSha256: Record<string, string>;
96
+ }
97
+ interface PrimeIntellectPackageBundle {
98
+ manifest: PrimeIntellectPackageManifest;
99
+ /** Relative package path to UTF-8 contents. */
100
+ files: Readonly<Record<string, string>>;
101
+ }
102
+ /** The answer-free task exposed to the caller's runtime program. */
103
+ interface PrimeIntellectPublicTask {
104
+ id: string;
105
+ split: PrimeIntellectSplit;
106
+ prompt: string | PrimeIntellectMessage[];
107
+ systemPrompt?: string;
108
+ metadata?: Record<string, PrimeIntellectJson>;
109
+ }
110
+ interface PrimeIntellectEpisodeContext {
111
+ protocol: 'tangle.primeintellect.episode/v1';
112
+ task: PrimeIntellectPublicTask;
113
+ model: {
114
+ name: string;
115
+ baseUrl: string;
116
+ apiKey: string;
117
+ };
118
+ mcpServers: Readonly<Record<string, string>>;
119
+ }
120
+
121
+ interface WritePrimeIntellectPackageOptions {
122
+ /** Replace an existing generated package and restore it if the final swap fails. */
123
+ replace?: boolean;
124
+ }
125
+ /** Build a complete PrimeIntellect Verifiers v1 package without writing to disk. */
126
+ declare function createPrimeIntellectPackage(options: PrimeIntellectPackageOptions): PrimeIntellectPackageBundle;
127
+ /** Write a bundle through a sibling temporary directory, then rename it into place. */
128
+ declare function writePrimeIntellectPackage(bundle: PrimeIntellectPackageBundle, outputDirectory: string, options?: WritePrimeIntellectPackageOptions): Promise<string>;
129
+
130
+ interface RunPrimeIntellectProgramOptions {
131
+ env?: NodeJS.ProcessEnv;
132
+ }
133
+ type PrimeIntellectBackendOptions = Omit<Parameters<typeof createOpenAICompatibleBackend>[0], 'apiKey' | 'baseUrl' | 'model'>;
134
+ /** Read and validate the private process contract installed by the generated Prime harness. */
135
+ declare function readPrimeIntellectEpisodeContext(env?: NodeJS.ProcessEnv): PrimeIntellectEpisodeContext;
136
+ /** Build the existing runtime backend against Prime's intercepted model endpoint. */
137
+ declare function createPrimeIntellectBackend(context: PrimeIntellectEpisodeContext, options?: PrimeIntellectBackendOptions): AgentExecutionBackend<AgentBackendInput>;
138
+ /**
139
+ * Execute the caller's canonical runtime program inside a Prime rollout.
140
+ * The callback may call runPersonified, runAgentic, runLoop, or any product wrapper.
141
+ */
142
+ declare function runPrimeIntellectProgram<Result>(run: (context: PrimeIntellectEpisodeContext) => Promise<Result>, options?: RunPrimeIntellectProgramOptions): Promise<Result>;
143
+
144
+ interface PrimeUsage {
145
+ prompt_tokens: number;
146
+ completion_tokens: number;
147
+ cached_input_tokens?: number | null;
148
+ reasoning_tokens?: number | null;
149
+ cost?: number | null;
150
+ }
151
+ interface PrimeTraceNode {
152
+ parent?: number | null;
153
+ sampled?: boolean;
154
+ usage?: PrimeUsage | null;
155
+ message?: unknown;
156
+ }
157
+ interface PrimeTimeSpan {
158
+ start?: number;
159
+ end?: number;
160
+ }
161
+ interface PrimeIntellectTrace {
162
+ id: string;
163
+ task: {
164
+ type: string;
165
+ data: {
166
+ idx: number;
167
+ name?: string | null;
168
+ split?: 'train' | 'eval';
169
+ prompt?: unknown;
170
+ system_prompt?: string | null;
171
+ metadata?: Record<string, unknown>;
172
+ [key: string]: unknown;
173
+ };
174
+ };
175
+ runtime?: unknown;
176
+ nodes: PrimeTraceNode[];
177
+ rewards: Record<string, number>;
178
+ metrics: Record<string, number>;
179
+ info?: Record<string, unknown>;
180
+ extra_usage?: PrimeUsage[];
181
+ is_completed?: boolean;
182
+ stop_condition?: string | null;
183
+ errors?: Array<{
184
+ type: string;
185
+ message: string;
186
+ traceback?: string | null;
187
+ }>;
188
+ timing?: {
189
+ start?: number;
190
+ setup?: PrimeTimeSpan;
191
+ generation?: PrimeTimeSpan;
192
+ finalize?: PrimeTimeSpan;
193
+ scoring?: PrimeTimeSpan;
194
+ };
195
+ }
196
+ interface PrimeIntellectTraceImportOptions {
197
+ experimentId: string;
198
+ candidateId: string;
199
+ seed: number;
200
+ /** Snapshot-pinned model id required by RunRecord validation. */
201
+ model: string;
202
+ promptHash: string;
203
+ configHash: string;
204
+ commitSha: string;
205
+ }
206
+ type PrimeIntellectImportDefaults = PrimeIntellectTraceImportOptions;
207
+ /** Parse Prime's durable `traces.jsonl` and reject malformed rows with a line number. */
208
+ declare function parsePrimeIntellectTraces(jsonl: string): PrimeIntellectTrace[];
209
+ /** Convert all Prime traces to agent-eval RunRecords while retaining one shared run config. */
210
+ declare function importPrimeIntellectTraces(jsonl: string, defaults: PrimeIntellectImportDefaults): RunRecord[];
211
+ /** Project one complete Prime trace into the common agent-eval analysis row. */
212
+ declare function primeIntellectTraceToRunRecord(trace: PrimeIntellectTrace, options: PrimeIntellectTraceImportOptions): RunRecord;
213
+
214
+ export { type PrimeIntellectBackendOptions, type PrimeIntellectContent, type PrimeIntellectEpisodeContext, type PrimeIntellectImportDefaults, type PrimeIntellectJson, type PrimeIntellectMessage, type PrimeIntellectPackageBundle, type PrimeIntellectPackageManifest, type PrimeIntellectPackageOptions, type PrimeIntellectPublicTask, type PrimeIntellectRunner, type PrimeIntellectScoring, type PrimeIntellectSetupCommand, type PrimeIntellectSplit, type PrimeIntellectTask, type PrimeIntellectTrace, type PrimeIntellectTraceImportOptions, type RunPrimeIntellectProgramOptions, type WritePrimeIntellectPackageOptions, createPrimeIntellectBackend, createPrimeIntellectPackage, importPrimeIntellectTraces, parsePrimeIntellectTraces, primeIntellectTraceToRunRecord, readPrimeIntellectEpisodeContext, runPrimeIntellectProgram, writePrimeIntellectPackage };