@tangle-network/agent-runtime 0.22.0 → 0.23.1

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.
package/dist/index.js CHANGED
@@ -1,3 +1,10 @@
1
+ import {
2
+ createOtelExporter,
3
+ loopEventToOtelSpan,
4
+ mcpToolsForRuntimeMcp,
5
+ mcpToolsForRuntimeMcpSubset
6
+ } from "./chunk-QZEDHTT2.js";
7
+ import "./chunk-UNQM6XQO.js";
1
8
  import {
2
9
  AgentEvalError,
3
10
  BackendTransportError,
@@ -388,6 +395,12 @@ async function* streamResponseEvents(response, context, requestedModel) {
388
395
  function* parseStreamChunk(chunk, context, usage, toolCalls) {
389
396
  const lines = chunk.split(/\r?\n/);
390
397
  const dataLines = lines.filter((line) => line.startsWith("data:"));
398
+ if (dataLines.length === 0 && lines.every((line) => {
399
+ const trimmed = line.trim();
400
+ return trimmed.length === 0 || trimmed.startsWith(":");
401
+ })) {
402
+ return;
403
+ }
391
404
  const data = dataLines.length > 0 ? dataLines.map((line) => line.slice(5).trimStart()).join("\n") : chunk.trim();
392
405
  if (!data || data === "[DONE]") return;
393
406
  let parsed;
@@ -1678,6 +1691,7 @@ export {
1678
1691
  cleanModelId,
1679
1692
  createIterableBackend,
1680
1693
  createOpenAICompatibleBackend,
1694
+ createOtelExporter,
1681
1695
  createRuntimeEventCollector,
1682
1696
  createRuntimeStreamEventCollector,
1683
1697
  createSandboxPromptBackend,
@@ -1685,6 +1699,9 @@ export {
1685
1699
  deriveExecutionId,
1686
1700
  getModels,
1687
1701
  handleChatTurn,
1702
+ loopEventToOtelSpan,
1703
+ mcpToolsForRuntimeMcp,
1704
+ mcpToolsForRuntimeMcpSubset,
1688
1705
  readinessServerSentEvent,
1689
1706
  resolveChatModel,
1690
1707
  resolveRouterBaseUrl,