@linnlabs/linnkit 0.38.0 → 0.39.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 (42) hide show
  1. package/CHANGELOG.md +33 -1
  2. package/dist/cli.cjs +111 -79
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +111 -79
  5. package/dist/cli.js.map +1 -1
  6. package/dist/context-manager.cjs +23 -17
  7. package/dist/context-manager.cjs.map +1 -1
  8. package/dist/context-manager.js +23 -17
  9. package/dist/context-manager.js.map +1 -1
  10. package/dist/contracts/contextPolicy.d.cts +2 -1
  11. package/dist/contracts/contextPolicy.d.ts +2 -1
  12. package/dist/contracts/token-accounting.d.cts +8 -8
  13. package/dist/contracts/token-accounting.d.ts +8 -8
  14. package/dist/contracts.cjs.map +1 -1
  15. package/dist/contracts.js.map +1 -1
  16. package/dist/index.cjs +157 -80
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.js +157 -80
  19. package/dist/index.js.map +1 -1
  20. package/dist/quickstart.cjs +111 -79
  21. package/dist/quickstart.cjs.map +1 -1
  22. package/dist/quickstart.js +111 -79
  23. package/dist/quickstart.js.map +1 -1
  24. package/dist/runtime-kernel/events.cjs.map +1 -1
  25. package/dist/runtime-kernel/events.js.map +1 -1
  26. package/dist/runtime-kernel/llm/definitions/llmCallInvocationContext.d.cts +4 -1
  27. package/dist/runtime-kernel/llm/definitions/llmCallInvocationContext.d.ts +4 -1
  28. package/dist/runtime-kernel.cjs +157 -80
  29. package/dist/runtime-kernel.cjs.map +1 -1
  30. package/dist/runtime-kernel.js +157 -80
  31. package/dist/runtime-kernel.js.map +1 -1
  32. package/dist/shared/prompt-budget.d.cts +4 -2
  33. package/dist/shared/prompt-budget.d.ts +4 -2
  34. package/dist/testkit.cjs +157 -80
  35. package/dist/testkit.cjs.map +1 -1
  36. package/dist/testkit.js +157 -80
  37. package/dist/testkit.js.map +1 -1
  38. package/docs/integration/agent-registration-guide.md +1 -1
  39. package/docs/integration/context-engineering.md +12 -8
  40. package/docs/integration/token-management.md +6 -1
  41. package/docs/integration/tools.md +4 -0
  42. package/package.json +2 -2
@@ -1115,7 +1115,8 @@ type AgentSpecContextPolicyInput = Omit<z.input<typeof AgentSpecContextPolicy>,
1115
1115
  * - schema 保持 optional,避免现有 host 的 `{ profileId: 'agent' }` 类型大面积变红;
1116
1116
  * - 框架拥有的行为策略在这里补齐;
1117
1117
  * - `budget.maxTokens` 与 `budget.reservedForResponse` 是 Agent 显式容量上限,
1118
- * 未声明时必须保持缺失,让 orchestration 使用模型 route 能力。
1118
+ * 未声明时必须保持缺失;route 声明能力,最终输出按实际剩余窗口决定,
1119
+ * 不能把 route 最大输出能力当作必须占满的响应预留。
1119
1120
  */
1120
1121
  declare function defineContextPolicy(input?: AgentSpecContextPolicyInput): AgentSpecContextPolicy;
1121
1122
 
@@ -1115,7 +1115,8 @@ type AgentSpecContextPolicyInput = Omit<z.input<typeof AgentSpecContextPolicy>,
1115
1115
  * - schema 保持 optional,避免现有 host 的 `{ profileId: 'agent' }` 类型大面积变红;
1116
1116
  * - 框架拥有的行为策略在这里补齐;
1117
1117
  * - `budget.maxTokens` 与 `budget.reservedForResponse` 是 Agent 显式容量上限,
1118
- * 未声明时必须保持缺失,让 orchestration 使用模型 route 能力。
1118
+ * 未声明时必须保持缺失;route 声明能力,最终输出按实际剩余窗口决定,
1119
+ * 不能把 route 最大输出能力当作必须占满的响应预留。
1119
1120
  */
1120
1121
  declare function defineContextPolicy(input?: AgentSpecContextPolicyInput): AgentSpecContextPolicy;
1121
1122
 
@@ -210,6 +210,7 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
210
210
  conversationId?: string | undefined;
211
211
  turnId?: string | undefined;
212
212
  modelId?: string | undefined;
213
+ stepId?: string | undefined;
213
214
  route?: {
214
215
  modelId: string;
215
216
  capabilityId: string;
@@ -222,7 +223,6 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
222
223
  baseURL?: string | undefined;
223
224
  endpointModelId?: string | undefined;
224
225
  } | undefined;
225
- stepId?: string | undefined;
226
226
  createdAt?: number | undefined;
227
227
  }, {
228
228
  id: string;
@@ -244,6 +244,7 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
244
244
  conversationId?: string | undefined;
245
245
  turnId?: string | undefined;
246
246
  modelId?: string | undefined;
247
+ stepId?: string | undefined;
247
248
  route?: {
248
249
  modelId: string;
249
250
  capabilityId: string;
@@ -256,7 +257,6 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
256
257
  baseURL?: string | undefined;
257
258
  endpointModelId?: string | undefined;
258
259
  } | undefined;
259
- stepId?: string | undefined;
260
260
  createdAt?: number | undefined;
261
261
  }>;
262
262
  type LlmUsageTokenLedgerEntry = z.infer<typeof LlmUsageTokenLedgerEntry>;
@@ -413,6 +413,7 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
413
413
  parentRunId?: string | undefined;
414
414
  conversationId?: string | undefined;
415
415
  turnId?: string | undefined;
416
+ stepId?: string | undefined;
416
417
  route?: {
417
418
  modelId: string;
418
419
  capabilityId: string;
@@ -425,7 +426,6 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
425
426
  baseURL?: string | undefined;
426
427
  endpointModelId?: string | undefined;
427
428
  } | undefined;
428
- stepId?: string | undefined;
429
429
  createdAt?: number | undefined;
430
430
  }, {
431
431
  id: string;
@@ -458,6 +458,7 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
458
458
  parentRunId?: string | undefined;
459
459
  conversationId?: string | undefined;
460
460
  turnId?: string | undefined;
461
+ stepId?: string | undefined;
461
462
  route?: {
462
463
  modelId: string;
463
464
  capabilityId: string;
@@ -470,7 +471,6 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
470
471
  baseURL?: string | undefined;
471
472
  endpointModelId?: string | undefined;
472
473
  } | undefined;
473
- stepId?: string | undefined;
474
474
  createdAt?: number | undefined;
475
475
  }>;
476
476
  type ContextComponentTokenLedgerEntry = z.infer<typeof ContextComponentTokenLedgerEntry>;
@@ -583,6 +583,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
583
583
  conversationId?: string | undefined;
584
584
  turnId?: string | undefined;
585
585
  modelId?: string | undefined;
586
+ stepId?: string | undefined;
586
587
  route?: {
587
588
  modelId: string;
588
589
  capabilityId: string;
@@ -595,7 +596,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
595
596
  baseURL?: string | undefined;
596
597
  endpointModelId?: string | undefined;
597
598
  } | undefined;
598
- stepId?: string | undefined;
599
599
  createdAt?: number | undefined;
600
600
  }, {
601
601
  id: string;
@@ -617,6 +617,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
617
617
  conversationId?: string | undefined;
618
618
  turnId?: string | undefined;
619
619
  modelId?: string | undefined;
620
+ stepId?: string | undefined;
620
621
  route?: {
621
622
  modelId: string;
622
623
  capabilityId: string;
@@ -629,7 +630,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
629
630
  baseURL?: string | undefined;
630
631
  endpointModelId?: string | undefined;
631
632
  } | undefined;
632
- stepId?: string | undefined;
633
633
  createdAt?: number | undefined;
634
634
  }>, z.ZodObject<{
635
635
  id: z.ZodString;
@@ -784,6 +784,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
784
784
  parentRunId?: string | undefined;
785
785
  conversationId?: string | undefined;
786
786
  turnId?: string | undefined;
787
+ stepId?: string | undefined;
787
788
  route?: {
788
789
  modelId: string;
789
790
  capabilityId: string;
@@ -796,7 +797,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
796
797
  baseURL?: string | undefined;
797
798
  endpointModelId?: string | undefined;
798
799
  } | undefined;
799
- stepId?: string | undefined;
800
800
  createdAt?: number | undefined;
801
801
  }, {
802
802
  id: string;
@@ -829,6 +829,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
829
829
  parentRunId?: string | undefined;
830
830
  conversationId?: string | undefined;
831
831
  turnId?: string | undefined;
832
+ stepId?: string | undefined;
832
833
  route?: {
833
834
  modelId: string;
834
835
  capabilityId: string;
@@ -841,7 +842,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
841
842
  baseURL?: string | undefined;
842
843
  endpointModelId?: string | undefined;
843
844
  } | undefined;
844
- stepId?: string | undefined;
845
845
  createdAt?: number | undefined;
846
846
  }>]>;
847
847
  type TokenLedgerEntry = z.infer<typeof TokenLedgerEntry>;
@@ -210,6 +210,7 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
210
210
  conversationId?: string | undefined;
211
211
  turnId?: string | undefined;
212
212
  modelId?: string | undefined;
213
+ stepId?: string | undefined;
213
214
  route?: {
214
215
  modelId: string;
215
216
  capabilityId: string;
@@ -222,7 +223,6 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
222
223
  baseURL?: string | undefined;
223
224
  endpointModelId?: string | undefined;
224
225
  } | undefined;
225
- stepId?: string | undefined;
226
226
  createdAt?: number | undefined;
227
227
  }, {
228
228
  id: string;
@@ -244,6 +244,7 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
244
244
  conversationId?: string | undefined;
245
245
  turnId?: string | undefined;
246
246
  modelId?: string | undefined;
247
+ stepId?: string | undefined;
247
248
  route?: {
248
249
  modelId: string;
249
250
  capabilityId: string;
@@ -256,7 +257,6 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
256
257
  baseURL?: string | undefined;
257
258
  endpointModelId?: string | undefined;
258
259
  } | undefined;
259
- stepId?: string | undefined;
260
260
  createdAt?: number | undefined;
261
261
  }>;
262
262
  type LlmUsageTokenLedgerEntry = z.infer<typeof LlmUsageTokenLedgerEntry>;
@@ -413,6 +413,7 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
413
413
  parentRunId?: string | undefined;
414
414
  conversationId?: string | undefined;
415
415
  turnId?: string | undefined;
416
+ stepId?: string | undefined;
416
417
  route?: {
417
418
  modelId: string;
418
419
  capabilityId: string;
@@ -425,7 +426,6 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
425
426
  baseURL?: string | undefined;
426
427
  endpointModelId?: string | undefined;
427
428
  } | undefined;
428
- stepId?: string | undefined;
429
429
  createdAt?: number | undefined;
430
430
  }, {
431
431
  id: string;
@@ -458,6 +458,7 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
458
458
  parentRunId?: string | undefined;
459
459
  conversationId?: string | undefined;
460
460
  turnId?: string | undefined;
461
+ stepId?: string | undefined;
461
462
  route?: {
462
463
  modelId: string;
463
464
  capabilityId: string;
@@ -470,7 +471,6 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
470
471
  baseURL?: string | undefined;
471
472
  endpointModelId?: string | undefined;
472
473
  } | undefined;
473
- stepId?: string | undefined;
474
474
  createdAt?: number | undefined;
475
475
  }>;
476
476
  type ContextComponentTokenLedgerEntry = z.infer<typeof ContextComponentTokenLedgerEntry>;
@@ -583,6 +583,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
583
583
  conversationId?: string | undefined;
584
584
  turnId?: string | undefined;
585
585
  modelId?: string | undefined;
586
+ stepId?: string | undefined;
586
587
  route?: {
587
588
  modelId: string;
588
589
  capabilityId: string;
@@ -595,7 +596,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
595
596
  baseURL?: string | undefined;
596
597
  endpointModelId?: string | undefined;
597
598
  } | undefined;
598
- stepId?: string | undefined;
599
599
  createdAt?: number | undefined;
600
600
  }, {
601
601
  id: string;
@@ -617,6 +617,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
617
617
  conversationId?: string | undefined;
618
618
  turnId?: string | undefined;
619
619
  modelId?: string | undefined;
620
+ stepId?: string | undefined;
620
621
  route?: {
621
622
  modelId: string;
622
623
  capabilityId: string;
@@ -629,7 +630,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
629
630
  baseURL?: string | undefined;
630
631
  endpointModelId?: string | undefined;
631
632
  } | undefined;
632
- stepId?: string | undefined;
633
633
  createdAt?: number | undefined;
634
634
  }>, z.ZodObject<{
635
635
  id: z.ZodString;
@@ -784,6 +784,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
784
784
  parentRunId?: string | undefined;
785
785
  conversationId?: string | undefined;
786
786
  turnId?: string | undefined;
787
+ stepId?: string | undefined;
787
788
  route?: {
788
789
  modelId: string;
789
790
  capabilityId: string;
@@ -796,7 +797,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
796
797
  baseURL?: string | undefined;
797
798
  endpointModelId?: string | undefined;
798
799
  } | undefined;
799
- stepId?: string | undefined;
800
800
  createdAt?: number | undefined;
801
801
  }, {
802
802
  id: string;
@@ -829,6 +829,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
829
829
  parentRunId?: string | undefined;
830
830
  conversationId?: string | undefined;
831
831
  turnId?: string | undefined;
832
+ stepId?: string | undefined;
832
833
  route?: {
833
834
  modelId: string;
834
835
  capabilityId: string;
@@ -841,7 +842,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
841
842
  baseURL?: string | undefined;
842
843
  endpointModelId?: string | undefined;
843
844
  } | undefined;
844
- stepId?: string | undefined;
845
845
  createdAt?: number | undefined;
846
846
  }>]>;
847
847
  type TokenLedgerEntry = z.infer<typeof TokenLedgerEntry>;