@tangle-network/sdk-provider-cli-base 0.13.134 → 0.13.136

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.
@@ -38,7 +38,7 @@ interface NanocodeConfig extends CliProviderConfig {
38
38
  /** Extra flags appended before the terminal positional prompt. */
39
39
  extraFlags?: string[];
40
40
  }
41
- /** Emitted for every stdout line — accumulated into the response text. */
41
+ /** Text in a decoded chunk of the native assistant's stdout. */
42
42
  interface NanocodeTextEvent {
43
43
  type: "text";
44
44
  line: string;
@@ -1,4 +1,4 @@
1
- import { C as plaintextResponseParser, Rt as sessionObservedEvents, _t as prependPromptSection, k as CliProviderAdapterBase } from "../../src-BjWuYvIc.mjs";
1
+ import { Bt as textDeltaEvents, Rt as sessionObservedEvents, _t as prependPromptSection, k as CliProviderAdapterBase } from "../../src-BjWuYvIc.mjs";
2
2
  import { qualifyModelId } from "@tangle-network/agent-profile-materialize";
3
3
  import { normalizeOpenAiCompatibleBaseUrl, resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
4
4
  import { join } from "node:path";
@@ -57,35 +57,28 @@ var NanocodeProviderAdapter = class extends CliProviderAdapterBase {
57
57
  }
58
58
  async afterCliProcessExit(params) {
59
59
  const sessionId = parseNanocodeSessionId(params.stderr);
60
- if (!sessionId) return;
61
- for (const event of sessionObservedEvents(params.state, "nanocode", sessionId)) params.onEvent?.(event);
60
+ if (sessionId) for (const event of sessionObservedEvents(params.state, "nanocode", sessionId)) params.onEvent?.(event);
61
+ if (params.exit.success && params.state.textBuffer) params.onEvent?.({
62
+ type: "status",
63
+ status: "completed"
64
+ });
62
65
  }
63
66
  createEventParser(state, onEvent) {
64
- return plaintextResponseParser(state, onEvent, {
65
- classify: (line) => /^(error:|api call failed|nanocode:)/i.test(line) ? {
66
- type: "error",
67
- message: line
68
- } : {
67
+ let whitespace = "";
68
+ return {
69
+ parseAs: "chunks",
70
+ transform: (raw) => ({
69
71
  type: "text",
70
- line
71
- },
72
- map: (event, response) => {
73
- switch (event.type) {
74
- case "text":
75
- response.text(event.line);
76
- return [];
77
- case "error":
78
- response.error(event.message);
79
- return [{
80
- type: "warning",
81
- code: "NANOCODE_ERROR",
82
- message: event.message
83
- }];
84
- case "session": return [];
85
- }
86
- },
87
- emptyFailureDetail: "nanocode exited without producing a response body"
88
- });
72
+ line: String(raw)
73
+ }),
74
+ onEvent: (event) => {
75
+ if (event.type !== "text") return;
76
+ const chunk = whitespace + event.line;
77
+ const text = chunk.trimEnd();
78
+ whitespace = chunk.slice(text.length);
79
+ if (text) for (const delta of textDeltaEvents(state, text)) onEvent?.(delta);
80
+ }
81
+ };
89
82
  }
90
83
  };
91
84
  /** nanocode's catalog is the Router's `/models`, keyed `provider/model`; the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sdk-provider-cli-base",
3
- "version": "0.13.134",
3
+ "version": "0.13.136",
4
4
  "description": "Base adapter for CLI-based AI agent providers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -60,10 +60,10 @@
60
60
  "@modelcontextprotocol/sdk": "^1.32.2",
61
61
  "@tangle-network/agent-core": "^1.0.3",
62
62
  "@tangle-network/agent-interface": "^5.10.28",
63
- "@tangle-network/agent-profile-materialize": "1.1.145",
63
+ "@tangle-network/agent-profile-materialize": "1.1.146",
64
64
  "@tangle-network/agent-trace-contract": "^2.2.0",
65
- "@tangle-network/cli-agent-registry": "0.15.128",
66
- "@tangle-network/sdk-cli-runner": "0.3.14",
65
+ "@tangle-network/cli-agent-registry": "0.15.129",
66
+ "@tangle-network/sdk-cli-runner": "0.3.15",
67
67
  "@tangle-network/sdk-session-persistence": "0.7.16",
68
68
  "zod": "4.6.7"
69
69
  },
@@ -79,8 +79,8 @@
79
79
  "registry": "https://registry.npmjs.org"
80
80
  },
81
81
  "tangleRelease": {
82
- "sourceSha": "0244e4448595669e92a2ab258e29eb7148739239",
83
- "mergedAt": "2026-11-19T19:38:26-08:00"
82
+ "sourceSha": "d1d8d7fc09bb99ec424b7c9b838b6e10d1d24cfd",
83
+ "mergedAt": "2026-11-19T20:56:37-08:00"
84
84
  },
85
85
  "scripts": {
86
86
  "build": "tsdown",