@linnlabs/linnkit 0.37.1 → 0.37.2

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 (56) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cli.cjs +2 -10
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +2 -10
  5. package/dist/cli.js.map +1 -1
  6. package/dist/context-manager.cjs +1 -3
  7. package/dist/context-manager.cjs.map +1 -1
  8. package/dist/context-manager.js +1 -3
  9. package/dist/context-manager.js.map +1 -1
  10. package/dist/contracts/agentSpec.d.cts +30 -30
  11. package/dist/contracts/agentSpec.d.ts +30 -30
  12. package/dist/contracts/audit.d.cts +32 -32
  13. package/dist/contracts/audit.d.ts +32 -32
  14. package/dist/contracts/contextPolicy.d.cts +36 -36
  15. package/dist/contracts/contextPolicy.d.ts +36 -36
  16. package/dist/contracts/events.d.cts +1113 -1113
  17. package/dist/contracts/events.d.ts +1113 -1113
  18. package/dist/contracts/execution.d.cts +8 -8
  19. package/dist/contracts/execution.d.ts +8 -8
  20. package/dist/contracts/messages.d.cts +1178 -1178
  21. package/dist/contracts/messages.d.ts +1178 -1178
  22. package/dist/contracts/provider-continuation.d.cts +28 -28
  23. package/dist/contracts/provider-continuation.d.ts +28 -28
  24. package/dist/contracts/sse.d.cts +897 -897
  25. package/dist/contracts/sse.d.ts +897 -897
  26. package/dist/contracts/sub-run-trace-payload.d.cts +26 -26
  27. package/dist/contracts/sub-run-trace-payload.d.ts +26 -26
  28. package/dist/contracts/token-accounting.d.cts +38 -38
  29. package/dist/contracts/token-accounting.d.ts +38 -38
  30. package/dist/index.cjs +2 -10
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.js +2 -10
  33. package/dist/index.js.map +1 -1
  34. package/dist/quickstart.cjs +2 -10
  35. package/dist/quickstart.cjs.map +1 -1
  36. package/dist/quickstart.js +2 -10
  37. package/dist/quickstart.js.map +1 -1
  38. package/dist/runtime-kernel/events/agentEvents.d.cts +172 -172
  39. package/dist/runtime-kernel/events/agentEvents.d.ts +172 -172
  40. package/dist/runtime-kernel/events.cjs +1 -3
  41. package/dist/runtime-kernel/events.cjs.map +1 -1
  42. package/dist/runtime-kernel/events.js +1 -3
  43. package/dist/runtime-kernel/events.js.map +1 -1
  44. package/dist/runtime-kernel/graph-engine/executorContextBuilder.d.cts +1 -0
  45. package/dist/runtime-kernel/graph-engine/executorContextBuilder.d.ts +1 -0
  46. package/dist/runtime-kernel.cjs +2 -10
  47. package/dist/runtime-kernel.cjs.map +1 -1
  48. package/dist/runtime-kernel.js +2 -10
  49. package/dist/runtime-kernel.js.map +1 -1
  50. package/dist/testkit.cjs +2 -10
  51. package/dist/testkit.cjs.map +1 -1
  52. package/dist/testkit.js +2 -10
  53. package/dist/testkit.js.map +1 -1
  54. package/docs/integration/llm-provider.md +1 -0
  55. package/docs/integration/realtime.md +5 -0
  56. package/package.json +2 -2
@@ -15,6 +15,7 @@ interface GraphExecutorOutputProcessor {
15
15
  * runtime-kernel 调用时必须保留对象接收者,不要拆成裸函数传递。
16
16
  */
17
17
  processResponse?(this: GraphExecutorOutputProcessor, rawResponse: string): string;
18
+ /** 返回空串只隐藏当前正文;已经分配的 chunk identity/seq 仍原样进入 Graph 与实时通道。 */
18
19
  processStreamChunk?(this: GraphExecutorOutputProcessor, chunk: string): string;
19
20
  }
20
21
  interface GraphExecutorContextBuildInput {
@@ -15,6 +15,7 @@ interface GraphExecutorOutputProcessor {
15
15
  * runtime-kernel 调用时必须保留对象接收者,不要拆成裸函数传递。
16
16
  */
17
17
  processResponse?(this: GraphExecutorOutputProcessor, rawResponse: string): string;
18
+ /** 返回空串只隐藏当前正文;已经分配的 chunk identity/seq 仍原样进入 Graph 与实时通道。 */
18
19
  processStreamChunk?(this: GraphExecutorOutputProcessor, chunk: string): string;
19
20
  }
20
21
  interface GraphExecutorContextBuildInput {
@@ -5032,10 +5032,7 @@ function createExecuteLlmStage(dependencies) {
5032
5032
  const promptBudget = ctx.promptBudget;
5033
5033
  const promptUsageMeasurementPolicy = ctx.promptUsageMeasurementPolicy;
5034
5034
  const streamEventHandler = ctx.input.stream && ctx.eventHandler ? (event) => {
5035
- const processedEvent = processStreamEvent(event, ctx.outputProcessor);
5036
- if (processedEvent) {
5037
- ctx.eventHandler?.(processedEvent);
5038
- }
5035
+ ctx.eventHandler?.(processStreamEvent(event, ctx.outputProcessor));
5039
5036
  } : void 0;
5040
5037
  const llmCallStartedAt = Date.now();
5041
5038
  let llmResp;
@@ -5191,9 +5188,6 @@ function processStreamEvent(event, outputProcessor) {
5191
5188
  return event;
5192
5189
  }
5193
5190
  const processedContent = outputProcessor.processStreamChunk(event.content);
5194
- if (processedContent.length === 0) {
5195
- return null;
5196
- }
5197
5191
  return {
5198
5192
  ...event,
5199
5193
  content: processedContent
@@ -6764,9 +6758,7 @@ function mapToolProgressToRuntime(toolEvent, context, options, id, timestamp) {
6764
6758
  return event;
6765
6759
  }
6766
6760
  function mapStreamChunkToRuntime(streamEvent, context, id, timestamp) {
6767
- const text = streamEvent.content ?? "";
6768
- if (!text) return null;
6769
- const chunkEvent = createFinalAnswerChunkEvent(id, context.conversationId, context.turnId, streamEvent.answer_id, streamEvent.seq, text, {
6761
+ const chunkEvent = createFinalAnswerChunkEvent(id, context.conversationId, context.turnId, streamEvent.answer_id, streamEvent.seq, streamEvent.content, {
6770
6762
  timestamp,
6771
6763
  is_last: streamEvent.is_last === true
6772
6764
  });