@linnlabs/linnkit 0.43.0 → 0.44.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 (90) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/cli.cjs +101 -4
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +101 -4
  5. package/dist/cli.js.map +1 -1
  6. package/dist/context-manager/profiles/agent/context/config.d.cts +1 -1
  7. package/dist/context-manager/profiles/agent/context/config.d.ts +1 -1
  8. package/dist/context-manager.cjs +37 -4
  9. package/dist/context-manager.cjs.map +1 -1
  10. package/dist/context-manager.js +37 -4
  11. package/dist/context-manager.js.map +1 -1
  12. package/dist/contracts/agentSpec.d.cts +5 -5
  13. package/dist/contracts/agentSpec.d.ts +5 -5
  14. package/dist/contracts/audit.d.cts +10 -10
  15. package/dist/contracts/audit.d.ts +10 -10
  16. package/dist/contracts/contextPolicy.d.cts +14 -14
  17. package/dist/contracts/contextPolicy.d.ts +14 -14
  18. package/dist/contracts/events.d.cts +121 -117
  19. package/dist/contracts/events.d.ts +121 -117
  20. package/dist/contracts/execution.d.cts +2 -2
  21. package/dist/contracts/execution.d.ts +2 -2
  22. package/dist/contracts/llm-retry.d.cts +2 -2
  23. package/dist/contracts/llm-retry.d.ts +2 -2
  24. package/dist/contracts/messages.d.cts +256 -32
  25. package/dist/contracts/messages.d.ts +256 -32
  26. package/dist/contracts/sse.d.cts +161 -97
  27. package/dist/contracts/sse.d.ts +161 -97
  28. package/dist/contracts/sub-run-trace-payload.d.cts +8 -8
  29. package/dist/contracts/sub-run-trace-payload.d.ts +8 -8
  30. package/dist/contracts/token-accounting.d.cts +12 -12
  31. package/dist/contracts/token-accounting.d.ts +12 -12
  32. package/dist/contracts.cjs +19 -2
  33. package/dist/contracts.cjs.map +1 -1
  34. package/dist/contracts.d.cts +1 -1
  35. package/dist/contracts.d.ts +1 -1
  36. package/dist/contracts.js +19 -3
  37. package/dist/contracts.js.map +1 -1
  38. package/dist/index.cjs +103 -4
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.js +103 -4
  41. package/dist/index.js.map +1 -1
  42. package/dist/quickstart.cjs +101 -4
  43. package/dist/quickstart.cjs.map +1 -1
  44. package/dist/quickstart.js +101 -4
  45. package/dist/quickstart.js.map +1 -1
  46. package/dist/runtime-kernel/events/agentEvents.d.cts +2 -2
  47. package/dist/runtime-kernel/events/agentEvents.d.ts +2 -2
  48. package/dist/runtime-kernel/events.cjs +29 -2
  49. package/dist/runtime-kernel/events.cjs.map +1 -1
  50. package/dist/runtime-kernel/events.js +29 -2
  51. package/dist/runtime-kernel/events.js.map +1 -1
  52. package/dist/runtime-kernel/graph-engine/definitions/pendingUserInput.d.cts +27 -0
  53. package/dist/runtime-kernel/graph-engine/definitions/pendingUserInput.d.ts +27 -0
  54. package/dist/runtime-kernel/graph-engine/engine.d.cts +1 -1
  55. package/dist/runtime-kernel/graph-engine/engine.d.ts +1 -1
  56. package/dist/runtime-kernel/graph-engine/index.d.cts +1 -0
  57. package/dist/runtime-kernel/graph-engine/index.d.ts +1 -0
  58. package/dist/runtime-kernel/graph-engine/types.d.cts +3 -0
  59. package/dist/runtime-kernel/graph-engine/types.d.ts +3 -0
  60. package/dist/runtime-kernel.cjs +101 -4
  61. package/dist/runtime-kernel.cjs.map +1 -1
  62. package/dist/runtime-kernel.d.cts +1 -0
  63. package/dist/runtime-kernel.d.ts +1 -0
  64. package/dist/runtime-kernel.js +101 -4
  65. package/dist/runtime-kernel.js.map +1 -1
  66. package/dist/testkit/agent-harness/scriptedInferenceHarness.d.cts +24 -6
  67. package/dist/testkit/agent-harness/scriptedInferenceHarness.d.ts +24 -6
  68. package/dist/testkit/scenario/graphScenario.d.cts +89 -0
  69. package/dist/testkit/scenario/graphScenario.d.ts +89 -0
  70. package/dist/testkit/scenario/pendingUserInputQueue.d.cts +26 -0
  71. package/dist/testkit/scenario/pendingUserInputQueue.d.ts +26 -0
  72. package/dist/testkit/scenario/runtimeEventRecorder.d.cts +36 -0
  73. package/dist/testkit/scenario/runtimeEventRecorder.d.ts +36 -0
  74. package/dist/testkit/scenario/scriptedToolRuntime.d.cts +51 -0
  75. package/dist/testkit/scenario/scriptedToolRuntime.d.ts +51 -0
  76. package/dist/testkit/scenario/steeringInvariants.d.cts +33 -0
  77. package/dist/testkit/scenario/steeringInvariants.d.ts +33 -0
  78. package/dist/testkit/scenario/timeline.d.cts +27 -0
  79. package/dist/testkit/scenario/timeline.d.ts +27 -0
  80. package/dist/testkit.cjs +671 -17
  81. package/dist/testkit.cjs.map +1 -1
  82. package/dist/testkit.d.cts +7 -1
  83. package/dist/testkit.d.ts +7 -1
  84. package/dist/testkit.js +663 -18
  85. package/dist/testkit.js.map +1 -1
  86. package/docs/integration/README.md +1 -0
  87. package/docs/integration/mid-run-user-input.md +73 -0
  88. package/docs/integration/realtime.md +4 -0
  89. package/docs/integration/testing.md +40 -4
  90. package/package.json +2 -2
@@ -42,9 +42,9 @@ declare const AgentSpec: z.ZodObject<{
42
42
  }, z.core.$strip>>;
43
43
  toolHistory: z.ZodOptional<z.ZodObject<{
44
44
  strategy: z.ZodOptional<z.ZodEnum<{
45
+ none: "none";
45
46
  "per-pair": "per-pair";
46
47
  "per-run": "per-run";
47
- none: "none";
48
48
  }>>;
49
49
  retentionMode: z.ZodOptional<z.ZodEnum<{
50
50
  drop: "drop";
@@ -75,16 +75,16 @@ declare const AgentSpec: z.ZodObject<{
75
75
  }, z.core.$strip>>;
76
76
  mustKeep: z.ZodOptional<z.ZodObject<{
77
77
  alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
78
+ user_input: "user_input";
78
79
  tool_calls: "tool_calls";
79
- system_prompt: "system_prompt";
80
+ tool_output: "tool_output";
81
+ final_answer: "final_answer";
80
82
  history_summary: "history_summary";
83
+ system_prompt: "system_prompt";
81
84
  context_injection: "context_injection";
82
- user_input: "user_input";
83
85
  task_request: "task_request";
84
- final_answer: "final_answer";
85
86
  tool_code: "tool_code";
86
87
  task_completion: "task_completion";
87
- tool_output: "tool_output";
88
88
  }>>>;
89
89
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
90
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -42,9 +42,9 @@ declare const AgentSpec: z.ZodObject<{
42
42
  }, z.core.$strip>>;
43
43
  toolHistory: z.ZodOptional<z.ZodObject<{
44
44
  strategy: z.ZodOptional<z.ZodEnum<{
45
+ none: "none";
45
46
  "per-pair": "per-pair";
46
47
  "per-run": "per-run";
47
- none: "none";
48
48
  }>>;
49
49
  retentionMode: z.ZodOptional<z.ZodEnum<{
50
50
  drop: "drop";
@@ -75,16 +75,16 @@ declare const AgentSpec: z.ZodObject<{
75
75
  }, z.core.$strip>>;
76
76
  mustKeep: z.ZodOptional<z.ZodObject<{
77
77
  alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
78
+ user_input: "user_input";
78
79
  tool_calls: "tool_calls";
79
- system_prompt: "system_prompt";
80
+ tool_output: "tool_output";
81
+ final_answer: "final_answer";
80
82
  history_summary: "history_summary";
83
+ system_prompt: "system_prompt";
81
84
  context_injection: "context_injection";
82
- user_input: "user_input";
83
85
  task_request: "task_request";
84
- final_answer: "final_answer";
85
86
  tool_code: "tool_code";
86
87
  task_completion: "task_completion";
87
- tool_output: "tool_output";
88
88
  }>>>;
89
89
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
90
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -4,12 +4,12 @@ declare const AUDIT_ACTIONS: readonly ["model.select", "model.fallback", "tool.a
4
4
  declare const AUDIT_DECISION_OUTCOMES: readonly ["allowed", "denied", "fallback", "retry", "cancelled", "paused", "resumed", "requested", "recorded"];
5
5
  declare const AuditActor: z.ZodObject<{
6
6
  kind: z.ZodEnum<{
7
- system: "system";
8
7
  user: "user";
9
- tool: "tool";
8
+ system: "system";
10
9
  host: "host";
11
10
  agent: "agent";
12
11
  model: "model";
12
+ tool: "tool";
13
13
  }>;
14
14
  id: z.ZodOptional<z.ZodString>;
15
15
  name: z.ZodOptional<z.ZodString>;
@@ -17,14 +17,14 @@ declare const AuditActor: z.ZodObject<{
17
17
  type AuditActor = z.infer<typeof AuditActor>;
18
18
  declare const AuditDecision: z.ZodObject<{
19
19
  outcome: z.ZodEnum<{
20
- requested: "requested";
20
+ cancelled: "cancelled";
21
+ retry: "retry";
21
22
  allowed: "allowed";
22
23
  denied: "denied";
23
24
  fallback: "fallback";
24
- retry: "retry";
25
- cancelled: "cancelled";
26
25
  paused: "paused";
27
26
  resumed: "resumed";
27
+ requested: "requested";
28
28
  recorded: "recorded";
29
29
  }>;
30
30
  reason: z.ZodOptional<z.ZodString>;
@@ -75,12 +75,12 @@ declare const AuditEnvelope: z.ZodObject<{
75
75
  ts: z.ZodNumber;
76
76
  actor: z.ZodObject<{
77
77
  kind: z.ZodEnum<{
78
- system: "system";
79
78
  user: "user";
80
- tool: "tool";
79
+ system: "system";
81
80
  host: "host";
82
81
  agent: "agent";
83
82
  model: "model";
83
+ tool: "tool";
84
84
  }>;
85
85
  id: z.ZodOptional<z.ZodString>;
86
86
  name: z.ZodOptional<z.ZodString>;
@@ -88,14 +88,14 @@ declare const AuditEnvelope: z.ZodObject<{
88
88
  action: z.ZodString;
89
89
  decision: z.ZodOptional<z.ZodObject<{
90
90
  outcome: z.ZodEnum<{
91
- requested: "requested";
91
+ cancelled: "cancelled";
92
+ retry: "retry";
92
93
  allowed: "allowed";
93
94
  denied: "denied";
94
95
  fallback: "fallback";
95
- retry: "retry";
96
- cancelled: "cancelled";
97
96
  paused: "paused";
98
97
  resumed: "resumed";
98
+ requested: "requested";
99
99
  recorded: "recorded";
100
100
  }>;
101
101
  reason: z.ZodOptional<z.ZodString>;
@@ -4,12 +4,12 @@ declare const AUDIT_ACTIONS: readonly ["model.select", "model.fallback", "tool.a
4
4
  declare const AUDIT_DECISION_OUTCOMES: readonly ["allowed", "denied", "fallback", "retry", "cancelled", "paused", "resumed", "requested", "recorded"];
5
5
  declare const AuditActor: z.ZodObject<{
6
6
  kind: z.ZodEnum<{
7
- system: "system";
8
7
  user: "user";
9
- tool: "tool";
8
+ system: "system";
10
9
  host: "host";
11
10
  agent: "agent";
12
11
  model: "model";
12
+ tool: "tool";
13
13
  }>;
14
14
  id: z.ZodOptional<z.ZodString>;
15
15
  name: z.ZodOptional<z.ZodString>;
@@ -17,14 +17,14 @@ declare const AuditActor: z.ZodObject<{
17
17
  type AuditActor = z.infer<typeof AuditActor>;
18
18
  declare const AuditDecision: z.ZodObject<{
19
19
  outcome: z.ZodEnum<{
20
- requested: "requested";
20
+ cancelled: "cancelled";
21
+ retry: "retry";
21
22
  allowed: "allowed";
22
23
  denied: "denied";
23
24
  fallback: "fallback";
24
- retry: "retry";
25
- cancelled: "cancelled";
26
25
  paused: "paused";
27
26
  resumed: "resumed";
27
+ requested: "requested";
28
28
  recorded: "recorded";
29
29
  }>;
30
30
  reason: z.ZodOptional<z.ZodString>;
@@ -75,12 +75,12 @@ declare const AuditEnvelope: z.ZodObject<{
75
75
  ts: z.ZodNumber;
76
76
  actor: z.ZodObject<{
77
77
  kind: z.ZodEnum<{
78
- system: "system";
79
78
  user: "user";
80
- tool: "tool";
79
+ system: "system";
81
80
  host: "host";
82
81
  agent: "agent";
83
82
  model: "model";
83
+ tool: "tool";
84
84
  }>;
85
85
  id: z.ZodOptional<z.ZodString>;
86
86
  name: z.ZodOptional<z.ZodString>;
@@ -88,14 +88,14 @@ declare const AuditEnvelope: z.ZodObject<{
88
88
  action: z.ZodString;
89
89
  decision: z.ZodOptional<z.ZodObject<{
90
90
  outcome: z.ZodEnum<{
91
- requested: "requested";
91
+ cancelled: "cancelled";
92
+ retry: "retry";
92
93
  allowed: "allowed";
93
94
  denied: "denied";
94
95
  fallback: "fallback";
95
- retry: "retry";
96
- cancelled: "cancelled";
97
96
  paused: "paused";
98
97
  resumed: "resumed";
98
+ requested: "requested";
99
99
  recorded: "recorded";
100
100
  }>;
101
101
  reason: z.ZodOptional<z.ZodString>;
@@ -2,16 +2,16 @@ import { SerializableJsonValue } from './json.cjs';
2
2
  import { z } from 'zod';
3
3
 
4
4
  declare const AgentSpecMessageType: z.ZodEnum<{
5
+ user_input: "user_input";
5
6
  tool_calls: "tool_calls";
6
- system_prompt: "system_prompt";
7
+ tool_output: "tool_output";
8
+ final_answer: "final_answer";
7
9
  history_summary: "history_summary";
10
+ system_prompt: "system_prompt";
8
11
  context_injection: "context_injection";
9
- user_input: "user_input";
10
12
  task_request: "task_request";
11
- final_answer: "final_answer";
12
13
  tool_code: "tool_code";
13
14
  task_completion: "task_completion";
14
- tool_output: "tool_output";
15
15
  }>;
16
16
  type AgentSpecMessageType = z.infer<typeof AgentSpecMessageType>;
17
17
  declare const AgentSpecBudgetPolicy: z.ZodObject<{
@@ -22,9 +22,9 @@ declare const AgentSpecBudgetPolicy: z.ZodObject<{
22
22
  type AgentSpecBudgetPolicy = z.infer<typeof AgentSpecBudgetPolicy>;
23
23
  declare const AgentSpecToolHistoryPolicy: z.ZodObject<{
24
24
  strategy: z.ZodOptional<z.ZodEnum<{
25
+ none: "none";
25
26
  "per-pair": "per-pair";
26
27
  "per-run": "per-run";
27
- none: "none";
28
28
  }>>;
29
29
  retentionMode: z.ZodOptional<z.ZodEnum<{
30
30
  drop: "drop";
@@ -71,16 +71,16 @@ declare const AgentSpecMustKeepTruncationRule: z.ZodObject<{
71
71
  type AgentSpecMustKeepTruncationRule = z.infer<typeof AgentSpecMustKeepTruncationRule>;
72
72
  declare const AgentSpecMustKeepPolicy: z.ZodObject<{
73
73
  alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
74
+ user_input: "user_input";
74
75
  tool_calls: "tool_calls";
75
- system_prompt: "system_prompt";
76
+ tool_output: "tool_output";
77
+ final_answer: "final_answer";
76
78
  history_summary: "history_summary";
79
+ system_prompt: "system_prompt";
77
80
  context_injection: "context_injection";
78
- user_input: "user_input";
79
81
  task_request: "task_request";
80
- final_answer: "final_answer";
81
82
  tool_code: "tool_code";
82
83
  task_completion: "task_completion";
83
- tool_output: "tool_output";
84
84
  }>>>;
85
85
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
86
86
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -185,9 +185,9 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
185
185
  }, z.core.$strip>>;
186
186
  toolHistory: z.ZodOptional<z.ZodObject<{
187
187
  strategy: z.ZodOptional<z.ZodEnum<{
188
+ none: "none";
188
189
  "per-pair": "per-pair";
189
190
  "per-run": "per-run";
190
- none: "none";
191
191
  }>>;
192
192
  retentionMode: z.ZodOptional<z.ZodEnum<{
193
193
  drop: "drop";
@@ -218,16 +218,16 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
218
218
  }, z.core.$strip>>;
219
219
  mustKeep: z.ZodOptional<z.ZodObject<{
220
220
  alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
221
+ user_input: "user_input";
221
222
  tool_calls: "tool_calls";
222
- system_prompt: "system_prompt";
223
+ tool_output: "tool_output";
224
+ final_answer: "final_answer";
223
225
  history_summary: "history_summary";
226
+ system_prompt: "system_prompt";
224
227
  context_injection: "context_injection";
225
- user_input: "user_input";
226
228
  task_request: "task_request";
227
- final_answer: "final_answer";
228
229
  tool_code: "tool_code";
229
230
  task_completion: "task_completion";
230
- tool_output: "tool_output";
231
231
  }>>>;
232
232
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
233
233
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -2,16 +2,16 @@ import { SerializableJsonValue } from './json.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  declare const AgentSpecMessageType: z.ZodEnum<{
5
+ user_input: "user_input";
5
6
  tool_calls: "tool_calls";
6
- system_prompt: "system_prompt";
7
+ tool_output: "tool_output";
8
+ final_answer: "final_answer";
7
9
  history_summary: "history_summary";
10
+ system_prompt: "system_prompt";
8
11
  context_injection: "context_injection";
9
- user_input: "user_input";
10
12
  task_request: "task_request";
11
- final_answer: "final_answer";
12
13
  tool_code: "tool_code";
13
14
  task_completion: "task_completion";
14
- tool_output: "tool_output";
15
15
  }>;
16
16
  type AgentSpecMessageType = z.infer<typeof AgentSpecMessageType>;
17
17
  declare const AgentSpecBudgetPolicy: z.ZodObject<{
@@ -22,9 +22,9 @@ declare const AgentSpecBudgetPolicy: z.ZodObject<{
22
22
  type AgentSpecBudgetPolicy = z.infer<typeof AgentSpecBudgetPolicy>;
23
23
  declare const AgentSpecToolHistoryPolicy: z.ZodObject<{
24
24
  strategy: z.ZodOptional<z.ZodEnum<{
25
+ none: "none";
25
26
  "per-pair": "per-pair";
26
27
  "per-run": "per-run";
27
- none: "none";
28
28
  }>>;
29
29
  retentionMode: z.ZodOptional<z.ZodEnum<{
30
30
  drop: "drop";
@@ -71,16 +71,16 @@ declare const AgentSpecMustKeepTruncationRule: z.ZodObject<{
71
71
  type AgentSpecMustKeepTruncationRule = z.infer<typeof AgentSpecMustKeepTruncationRule>;
72
72
  declare const AgentSpecMustKeepPolicy: z.ZodObject<{
73
73
  alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
74
+ user_input: "user_input";
74
75
  tool_calls: "tool_calls";
75
- system_prompt: "system_prompt";
76
+ tool_output: "tool_output";
77
+ final_answer: "final_answer";
76
78
  history_summary: "history_summary";
79
+ system_prompt: "system_prompt";
77
80
  context_injection: "context_injection";
78
- user_input: "user_input";
79
81
  task_request: "task_request";
80
- final_answer: "final_answer";
81
82
  tool_code: "tool_code";
82
83
  task_completion: "task_completion";
83
- tool_output: "tool_output";
84
84
  }>>>;
85
85
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
86
86
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -185,9 +185,9 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
185
185
  }, z.core.$strip>>;
186
186
  toolHistory: z.ZodOptional<z.ZodObject<{
187
187
  strategy: z.ZodOptional<z.ZodEnum<{
188
+ none: "none";
188
189
  "per-pair": "per-pair";
189
190
  "per-run": "per-run";
190
- none: "none";
191
191
  }>>;
192
192
  retentionMode: z.ZodOptional<z.ZodEnum<{
193
193
  drop: "drop";
@@ -218,16 +218,16 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
218
218
  }, z.core.$strip>>;
219
219
  mustKeep: z.ZodOptional<z.ZodObject<{
220
220
  alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
221
+ user_input: "user_input";
221
222
  tool_calls: "tool_calls";
222
- system_prompt: "system_prompt";
223
+ tool_output: "tool_output";
224
+ final_answer: "final_answer";
223
225
  history_summary: "history_summary";
226
+ system_prompt: "system_prompt";
224
227
  context_injection: "context_injection";
225
- user_input: "user_input";
226
228
  task_request: "task_request";
227
- final_answer: "final_answer";
228
229
  tool_code: "tool_code";
229
230
  task_completion: "task_completion";
230
- tool_output: "tool_output";
231
231
  }>>>;
232
232
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
233
233
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{