@tangle-network/sdk-provider-cli-base 0.13.60 → 0.13.62
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/adapters/amp/index.d.mts +1 -1
- package/dist/adapters/amp/index.mjs +1 -1
- package/dist/adapters/factory-droids/index.d.mts +1 -1
- package/dist/adapters/factory-droids/index.mjs +1 -1
- package/dist/adapters/grok/index.d.mts +1 -1
- package/dist/adapters/grok/index.mjs +1 -1
- package/dist/adapters/hermes/index.d.mts +1 -1
- package/dist/adapters/hermes/index.mjs +3 -12
- package/dist/adapters/nanoclaw/index.d.mts +1 -1
- package/dist/adapters/nanoclaw/index.mjs +1 -1
- package/dist/adapters/nanocode/index.d.mts +104 -0
- package/dist/adapters/nanocode/index.mjs +102 -0
- package/dist/adapters/openclaw/index.d.mts +1 -1
- package/dist/adapters/openclaw/index.mjs +1 -1
- package/dist/adapters/prime/index.d.mts +1 -1
- package/dist/adapters/prime/index.mjs +1 -1
- package/dist/{index-DlhkLYCz.d.mts → index-DePFb23d.d.mts} +3 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-ECfad1u7.mjs → src-CqOi8nrB.mjs} +13 -2
- package/package.json +11 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase } from "../../index-
|
|
1
|
+
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase } from "../../index-DePFb23d.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { McpConfig, ProviderConfig, StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as toolResultEvents, Et as sessionObservedEvents, H as recordCliTokenUsage, I as jsonEventParser, J as localMcpEnv, Ot as textDeltaEvents, Tt as reasoningEvents, U as CliProviderAdapterBase, jt as toolStartEvents, q as localMcpArgv } from "../../src-
|
|
1
|
+
import { At as toolResultEvents, Et as sessionObservedEvents, H as recordCliTokenUsage, I as jsonEventParser, J as localMcpEnv, Ot as textDeltaEvents, Tt as reasoningEvents, U as CliProviderAdapterBase, jt as toolStartEvents, q as localMcpArgv } from "../../src-CqOi8nrB.mjs";
|
|
2
2
|
//#region src/adapters/amp/types.ts
|
|
3
3
|
/**
|
|
4
4
|
* Type guard for AMP events.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase } from "../../index-
|
|
1
|
+
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase } from "../../index-DePFb23d.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { AgentExecutionInput, AgentExecutionResult, BackendCapabilities, InteractionResponse, McpConfig, ProviderConfig, SdkHostServices, StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as McpInteractionSupport, At as toolResultEvents, Dt as streamPartBase, Et as sessionObservedEvents, H as recordCliTokenUsage, I as jsonEventParser, J as localMcpEnv, K as isLocalMcpConfig, Ot as textDeltaEvents, Tt as reasoningEvents, U as CliProviderAdapterBase, Y as enabledInteractionKinds, jt as toolStartEvents, q as localMcpArgv, tt as withTurnInteractions } from "../../src-
|
|
1
|
+
import { A as McpInteractionSupport, At as toolResultEvents, Dt as streamPartBase, Et as sessionObservedEvents, H as recordCliTokenUsage, I as jsonEventParser, J as localMcpEnv, K as isLocalMcpConfig, Ot as textDeltaEvents, Tt as reasoningEvents, U as CliProviderAdapterBase, Y as enabledInteractionKinds, jt as toolStartEvents, q as localMcpArgv, tt as withTurnInteractions } from "../../src-CqOi8nrB.mjs";
|
|
2
2
|
import { createHash, randomUUID } from "node:crypto";
|
|
3
3
|
import { InteractionKind } from "@tangle-network/agent-interface";
|
|
4
4
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase } from "../../index-
|
|
1
|
+
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase } from "../../index-DePFb23d.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Et as sessionObservedEvents, L as plaintextResponseParser, U as CliProviderAdapterBase, st as prependPromptSection } from "../../src-
|
|
1
|
+
import { Et as sessionObservedEvents, L as plaintextResponseParser, U as CliProviderAdapterBase, st as prependPromptSection } from "../../src-CqOi8nrB.mjs";
|
|
2
2
|
//#region src/adapters/grok/adapter.ts
|
|
3
3
|
const DECLARE_MODEL = "d=$HOME/.grok; [ -z \"$GROK_HOME\" ] || d=$GROK_HOME; t=\"[model.\\\"$1\\\"]\"; mkdir -p \"$d\" && { grep -qxF \"$t\" \"$d/managed_config.toml\" 2>/dev/null || printf '%s\\nmodel = \"%s\"\\n' \"$t\" \"$1\" >> \"$d/managed_config.toml\"; }; shift; exec \"$@\"";
|
|
4
4
|
var GrokProviderAdapter = class extends CliProviderAdapterBase {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase, n as HarnessId } from "../../index-
|
|
1
|
+
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase, n as HarnessId } from "../../index-DePFb23d.mjs";
|
|
2
2
|
import { i as PreparedAttachment } from "../../prompt-input-CD7okX8T.mjs";
|
|
3
3
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
4
4
|
import { InputPart, McpConfig, StreamEvent } from "@tangle-network/agent-interface";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Et as sessionObservedEvents, H as recordCliTokenUsage, J as localMcpEnv, K as isLocalMcpConfig, L as plaintextResponseParser, U as CliProviderAdapterBase, at as partitionImageAttachments, q as localMcpArgv, st as prependPromptSection } from "../../src-
|
|
1
|
+
import { Et as sessionObservedEvents, H as recordCliTokenUsage, J as localMcpEnv, K as isLocalMcpConfig, L as plaintextResponseParser, U as CliProviderAdapterBase, at as partitionImageAttachments, q as localMcpArgv, st as prependPromptSection } from "../../src-CqOi8nrB.mjs";
|
|
2
2
|
import { resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
3
|
-
import {
|
|
3
|
+
import { writeFile } from "node:fs/promises";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { DatabaseSync } from "node:sqlite";
|
|
@@ -80,17 +80,8 @@ var HermesProviderAdapter = class extends CliProviderAdapterBase {
|
|
|
80
80
|
if (this.activeSessionId && this.activeSessionId !== sessionId) throw new Error("Hermes backend cannot serve two native sessions");
|
|
81
81
|
this.activeSessionId = sessionId;
|
|
82
82
|
const home = this.resolveHermesHome();
|
|
83
|
-
|
|
83
|
+
await this.ensureSubprocessOwnedDir(home, dirname(home));
|
|
84
84
|
await writeFile(join(home, "config.yaml"), "agent:\n auto_recovery_cycles: 0\n", { flag: "wx" }).catch(() => void 0);
|
|
85
|
-
const owner = this.subprocessIdentity();
|
|
86
|
-
if (owner) {
|
|
87
|
-
const sessions = dirname(home);
|
|
88
|
-
const top = created !== void 0 && sessions.startsWith(`${created}/`) ? created : sessions;
|
|
89
|
-
for (let dir = home;; dir = dirname(dir)) {
|
|
90
|
-
await lchown(dir, owner.uid, owner.gid);
|
|
91
|
-
if (dir === top) break;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
85
|
return super.preparePromptInput(parts, workspaceRoot, sessionId, { inlineImageBudgetBytes: 0 });
|
|
95
86
|
}
|
|
96
87
|
nativeAttachmentKinds() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase, n as HarnessId } from "../../index-
|
|
1
|
+
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase, n as HarnessId } from "../../index-DePFb23d.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as parseCliUsageLine, Et as sessionObservedEvents, H as recordCliTokenUsage, L as plaintextResponseParser, U as CliProviderAdapterBase, st as prependPromptSection } from "../../src-
|
|
1
|
+
import { B as parseCliUsageLine, Et as sessionObservedEvents, H as recordCliTokenUsage, L as plaintextResponseParser, U as CliProviderAdapterBase, st as prependPromptSection } from "../../src-CqOi8nrB.mjs";
|
|
2
2
|
import { normalizeOpenAiCompatibleBaseUrl, resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
//#region src/adapters/nanoclaw/adapter.ts
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase } from "../../index-DePFb23d.mjs";
|
|
2
|
+
import { i as PreparedAttachment } from "../../prompt-input-CD7okX8T.mjs";
|
|
3
|
+
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
4
|
+
import { InputPart, StreamEvent } from "@tangle-network/agent-interface";
|
|
5
|
+
import { MessagePart } from "@tangle-network/sdk-session-persistence";
|
|
6
|
+
|
|
7
|
+
//#region src/adapters/nanocode/types.d.ts
|
|
8
|
+
type NanocodeAuthMode = "api-key" | "oauth";
|
|
9
|
+
/** The harness `nc` dispatches to. Only `codex` has an OpenAI base-URL
|
|
10
|
+
* override, so it is the one the Tangle Router can serve; it is the default. */
|
|
11
|
+
type NanocodeHarness = "codex" | "claude";
|
|
12
|
+
interface NanocodeConfig extends CliProviderConfig {
|
|
13
|
+
/** Path to the nanocode CLI executable. Default: "nc" (resolved on PATH). */
|
|
14
|
+
cliPath?: string;
|
|
15
|
+
/** Model to use (e.g. "zai/glm-5.2"). Forwarded as `-m/--model`. */
|
|
16
|
+
model?: string;
|
|
17
|
+
/**
|
|
18
|
+
* API key. When present under `authMode: "api-key"`, written to
|
|
19
|
+
* `NANOCODE_OPENAI_API_KEY` so `nc` authenticates against the Router (or a
|
|
20
|
+
* caller endpoint).
|
|
21
|
+
*/
|
|
22
|
+
apiKey?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Authentication mode. Defaults to "api-key" when an apiKey is present;
|
|
25
|
+
* otherwise "oauth" (the CLI reads its own credential store).
|
|
26
|
+
*/
|
|
27
|
+
authMode?: NanocodeAuthMode;
|
|
28
|
+
/**
|
|
29
|
+
* Base URL for the OpenAI-compatible endpoint. Forwarded as
|
|
30
|
+
* `NANOCODE_OPENAI_BASE_URL` so `nc` routes through
|
|
31
|
+
* `https://router.tangle.tools/v1`.
|
|
32
|
+
*/
|
|
33
|
+
baseUrl?: string;
|
|
34
|
+
/** Which `nc --harness`. Defaults to "codex" (the Router-served wire). */
|
|
35
|
+
harness?: NanocodeHarness;
|
|
36
|
+
/** Reasoning tier, forwarded as `-t/--thinking <tier>`. */
|
|
37
|
+
thinking?: string;
|
|
38
|
+
/** Extra flags appended before the terminal positional prompt. */
|
|
39
|
+
extraFlags?: string[];
|
|
40
|
+
}
|
|
41
|
+
/** Emitted for every stdout line — accumulated into the response text. */
|
|
42
|
+
interface NanocodeTextEvent {
|
|
43
|
+
type: "text";
|
|
44
|
+
line: string;
|
|
45
|
+
}
|
|
46
|
+
/** The native session id observed on stderr (`session <id>`). */
|
|
47
|
+
interface NanocodeSessionEvent {
|
|
48
|
+
type: "session";
|
|
49
|
+
id: string;
|
|
50
|
+
}
|
|
51
|
+
/** Emitted when `nc` prints a recognizable error line. */
|
|
52
|
+
interface NanocodeErrorEvent {
|
|
53
|
+
type: "error";
|
|
54
|
+
message: string;
|
|
55
|
+
}
|
|
56
|
+
type NanocodeEvent = NanocodeTextEvent | NanocodeSessionEvent | NanocodeErrorEvent;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/adapters/nanocode/adapter.d.ts
|
|
59
|
+
declare class NanocodeProviderAdapter extends CliProviderAdapterBase<NanocodeConfig, NanocodeEvent> {
|
|
60
|
+
readonly provider = "nanocode";
|
|
61
|
+
protected readonly defaultCliPath = "nc";
|
|
62
|
+
private activeSessionId?;
|
|
63
|
+
protected isBenignNonZeroExit({
|
|
64
|
+
exitCode,
|
|
65
|
+
stderr,
|
|
66
|
+
state
|
|
67
|
+
}: {
|
|
68
|
+
exitCode: number | null;
|
|
69
|
+
stderr: string;
|
|
70
|
+
state: ExecutionState;
|
|
71
|
+
}): boolean;
|
|
72
|
+
/** The store under the private runtime home, or a workspace fallback. */
|
|
73
|
+
private resolveNanocodeHome;
|
|
74
|
+
protected preparePromptInput(parts: InputPart[], workspaceRoot: string, sessionId: string): Promise<{
|
|
75
|
+
promptText: string;
|
|
76
|
+
persistedParts: MessagePart[];
|
|
77
|
+
attachments: PreparedAttachment[];
|
|
78
|
+
}>;
|
|
79
|
+
protected buildExecArgs(params: {
|
|
80
|
+
message: string;
|
|
81
|
+
config: NanocodeConfig;
|
|
82
|
+
model?: string;
|
|
83
|
+
sessionId?: string;
|
|
84
|
+
workspaceRoot: string;
|
|
85
|
+
systemPrompt?: string;
|
|
86
|
+
}): CliExecArgs;
|
|
87
|
+
protected buildExecEnv(config: NanocodeConfig): Record<string, string | undefined>;
|
|
88
|
+
protected afterCliProcessExit(params: {
|
|
89
|
+
state: ExecutionState;
|
|
90
|
+
stderr: string;
|
|
91
|
+
exit: {
|
|
92
|
+
success: boolean;
|
|
93
|
+
};
|
|
94
|
+
workspaceRoot: string;
|
|
95
|
+
env: Record<string, string | undefined>;
|
|
96
|
+
onEvent?: (event: StreamEvent) => void;
|
|
97
|
+
}): Promise<void>;
|
|
98
|
+
protected createEventParser(state: ExecutionState, onEvent?: (event: StreamEvent) => void): StreamParserConfig<NanocodeEvent>;
|
|
99
|
+
}
|
|
100
|
+
/** The native session id `nc exec` prints to stderr as `session <id>`. */
|
|
101
|
+
declare function parseNanocodeSessionId(stderr: string): string | undefined;
|
|
102
|
+
//#endregion
|
|
103
|
+
export { type NanocodeAuthMode, type NanocodeConfig, type NanocodeErrorEvent, type NanocodeEvent, type NanocodeHarness, NanocodeProviderAdapter, type NanocodeSessionEvent, type NanocodeTextEvent, parseNanocodeSessionId };
|
|
104
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Et as sessionObservedEvents, L as plaintextResponseParser, U as CliProviderAdapterBase, st as prependPromptSection } from "../../src-CqOi8nrB.mjs";
|
|
2
|
+
import { normalizeOpenAiCompatibleBaseUrl, resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
//#region src/adapters/nanocode/adapter.ts
|
|
5
|
+
var NanocodeProviderAdapter = class extends CliProviderAdapterBase {
|
|
6
|
+
provider = "nanocode";
|
|
7
|
+
defaultCliPath = "nc";
|
|
8
|
+
activeSessionId;
|
|
9
|
+
isBenignNonZeroExit({ exitCode, stderr, state }) {
|
|
10
|
+
if (exitCode === null || exitCode === 0) return false;
|
|
11
|
+
if (state.textBuffer.trim().length > 0) return true;
|
|
12
|
+
return /^\s*session\s+\S/im.test(stderr);
|
|
13
|
+
}
|
|
14
|
+
/** The store under the private runtime home, or a workspace fallback. */
|
|
15
|
+
resolveNanocodeHome() {
|
|
16
|
+
const runtimeHome = this.config.runtimeHome?.trim();
|
|
17
|
+
if (runtimeHome) return join(runtimeHome, ".nanocode");
|
|
18
|
+
if (!this.activeSessionId) throw new Error("Nanocode native session id is required before resolving NANOCODE_HOME");
|
|
19
|
+
return join(process.env.AGENT_WORKSPACE_ROOT?.trim() || this.storagePath, ".nanocode", "sessions", this.activeSessionId);
|
|
20
|
+
}
|
|
21
|
+
async preparePromptInput(parts, workspaceRoot, sessionId) {
|
|
22
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/.test(sessionId)) throw new Error("Nanocode native session id is not a safe directory name");
|
|
23
|
+
if (this.activeSessionId && this.activeSessionId !== sessionId) throw new Error("Nanocode backend cannot serve two native sessions");
|
|
24
|
+
this.activeSessionId = sessionId;
|
|
25
|
+
await this.ensureSubprocessOwnedDir(this.resolveNanocodeHome());
|
|
26
|
+
return super.preparePromptInput(parts, workspaceRoot, sessionId);
|
|
27
|
+
}
|
|
28
|
+
buildExecArgs(params) {
|
|
29
|
+
const gatewayDefaults = resolveTangleRouterDefaults();
|
|
30
|
+
const model = params.model ?? params.config.model ?? gatewayDefaults.model;
|
|
31
|
+
const args = [
|
|
32
|
+
"exec",
|
|
33
|
+
"--harness",
|
|
34
|
+
params.config.harness ?? "codex"
|
|
35
|
+
];
|
|
36
|
+
if (model) args.push("-m", model);
|
|
37
|
+
args.push("-C", params.workspaceRoot);
|
|
38
|
+
if (params.config.thinking) args.push("-t", params.config.thinking);
|
|
39
|
+
if (params.sessionId) args.push("-r", params.sessionId);
|
|
40
|
+
if (params.config.extraFlags?.length) args.push(...params.config.extraFlags);
|
|
41
|
+
const fullMessage = prependPromptSection(params.systemPrompt, params.message);
|
|
42
|
+
args.push(fullMessage);
|
|
43
|
+
return {
|
|
44
|
+
command: this.getCliPath(),
|
|
45
|
+
args,
|
|
46
|
+
useStdin: false
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
buildExecEnv(config) {
|
|
50
|
+
const env = this.agentEnvironmentValues();
|
|
51
|
+
env.NANOCODE_HOME = this.resolveNanocodeHome();
|
|
52
|
+
const authMode = config.authMode ?? (config.apiKey ? "api-key" : "oauth");
|
|
53
|
+
const gatewayDefaults = resolveTangleRouterDefaults(env);
|
|
54
|
+
const baseUrl = config.baseUrl ? normalizeOpenAiCompatibleBaseUrl(config.baseUrl) : gatewayDefaults.baseUrl;
|
|
55
|
+
env.NANOCODE_OPENAI_BASE_URL = baseUrl;
|
|
56
|
+
env.NANOCODE_MODELS_URL = `${baseUrl.replace(/\/+$/u, "")}/models`;
|
|
57
|
+
if (authMode === "api-key" && config.apiKey) env.NANOCODE_OPENAI_API_KEY = config.apiKey;
|
|
58
|
+
const model = config.model ?? gatewayDefaults.model;
|
|
59
|
+
if (model) env.NANOCODE_MODEL = model;
|
|
60
|
+
return env;
|
|
61
|
+
}
|
|
62
|
+
async afterCliProcessExit(params) {
|
|
63
|
+
const sessionId = parseNanocodeSessionId(params.stderr);
|
|
64
|
+
if (!sessionId) return;
|
|
65
|
+
for (const event of sessionObservedEvents(params.state, "nanocode", sessionId)) params.onEvent?.(event);
|
|
66
|
+
}
|
|
67
|
+
createEventParser(state, onEvent) {
|
|
68
|
+
return plaintextResponseParser(state, onEvent, {
|
|
69
|
+
classify: (line) => /^(error:|api call failed|nanocode:)/i.test(line) ? {
|
|
70
|
+
type: "error",
|
|
71
|
+
message: line
|
|
72
|
+
} : {
|
|
73
|
+
type: "text",
|
|
74
|
+
line
|
|
75
|
+
},
|
|
76
|
+
map: (event, response) => {
|
|
77
|
+
switch (event.type) {
|
|
78
|
+
case "text":
|
|
79
|
+
response.text(event.line);
|
|
80
|
+
return [];
|
|
81
|
+
case "error":
|
|
82
|
+
response.error(event.message);
|
|
83
|
+
return [{
|
|
84
|
+
type: "warning",
|
|
85
|
+
code: "NANOCODE_ERROR",
|
|
86
|
+
message: event.message
|
|
87
|
+
}];
|
|
88
|
+
case "session": return [];
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
emptyFailureDetail: "nanocode exited without producing a response body"
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
/** The native session id `nc exec` prints to stderr as `session <id>`. */
|
|
96
|
+
function parseNanocodeSessionId(stderr) {
|
|
97
|
+
return /^\s*session\s+(\S+)\s*$/im.exec(stderr)?.[1];
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { NanocodeProviderAdapter, parseNanocodeSessionId };
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase, n as HarnessId, o as WorkspacePlanApplication } from "../../index-
|
|
1
|
+
import { Mt as CliExecArgs, Pt as CliProviderConfig, Rt as ExecutionState, ht as CliProviderAdapterBase, n as HarnessId, o as WorkspacePlanApplication } from "../../index-DePFb23d.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { CliAuthFile, ProviderConfig, StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Et as sessionObservedEvents, H as recordCliTokenUsage, S as nativeEffortArgs, U as CliProviderAdapterBase, st as prependPromptSection, wt as finalTextEvent } from "../../src-
|
|
1
|
+
import { Et as sessionObservedEvents, H as recordCliTokenUsage, S as nativeEffortArgs, U as CliProviderAdapterBase, st as prependPromptSection, wt as finalTextEvent } from "../../src-CqOi8nrB.mjs";
|
|
2
2
|
import { resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
3
3
|
//#region src/adapters/openclaw/adapter.ts
|
|
4
4
|
/** openclaw's default agent id; the synthesized config declares only it. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as AcpTurn, Ct as AcpBridgeConfig, mn as AcpProcessSpec, mt as AcpProviderAdapterBase, pn as AcpBridgeSpawn, wt as AcpContentBlock } from "../../index-
|
|
1
|
+
import { At as AcpTurn, Ct as AcpBridgeConfig, mn as AcpProcessSpec, mt as AcpProviderAdapterBase, pn as AcpBridgeSpawn, wt as AcpContentBlock } from "../../index-DePFb23d.mjs";
|
|
2
2
|
import { i as PreparedAttachment } from "../../prompt-input-CD7okX8T.mjs";
|
|
3
3
|
import { PRIME_AGENT_DIR_ENV_VAR, PRIME_AGENT_DIR_ENV_VARS, PRIME_HARNESS_STATE_ENV_DENYLIST, PRIME_KERNEL_DEAD_MARKERS, PRIME_KERNEL_ENV_PASSTHROUGH, PRIME_MCP_UNSUPPORTED_REASON, PrimeHarnessStateError, PrimeMaterializeOptions, PrimeProfileControls, PrimeProfileControls as PrimeProfileControls$1, PrimeProfileError, PrimeProfileSkill, PrimeProfileSubagent, assertPrimeModelAgreement, hasPrimeProfileMaterial, matchPrimeKernelDeadMarker, materializePrimeProfileControls, primeAgentDirEnv, primeProfileNeedsAgentDir, primeSubagentEntryId as subagentEntryId, primeThinkingLevel, prunePrimeProfileMaterial, readPrimeProfileControls } from "@tangle-network/agent-profile-materialize";
|
|
4
4
|
import { RpcBridge } from "@tangle-network/sdk-cli-runner";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { It as spawnAcpBridge, R as AcpProviderAdapterBase, st as prependPromptSection } from "../../src-
|
|
1
|
+
import { It as spawnAcpBridge, R as AcpProviderAdapterBase, st as prependPromptSection } from "../../src-CqOi8nrB.mjs";
|
|
2
2
|
import { PRIME_AGENT_DIR_ENV_VAR, PRIME_AGENT_DIR_ENV_VARS, PRIME_HARNESS_STATE_ENV_DENYLIST, PRIME_HARNESS_STATE_ENV_DENYLIST as PRIME_HARNESS_STATE_ENV_DENYLIST$1, PRIME_KERNEL_DEAD_MARKERS, PRIME_KERNEL_ENV_PASSTHROUGH, PRIME_KERNEL_ENV_PASSTHROUGH as PRIME_KERNEL_ENV_PASSTHROUGH$1, PRIME_MCP_UNSUPPORTED_REASON, PrimeHarnessStateError, PrimeProfileError, assertPrimeModelAgreement, assertPrimeModelAgreement as assertPrimeModelAgreement$1, buildPiModelsConfig, hasPrimeProfileMaterial, matchPrimeKernelDeadMarker, materializePrimeProfileControls, materializePrimeProfileControls as materializePrimeProfileControls$1, primeAgentDirEnv, primeAgentDirEnv as primeAgentDirEnv$1, primeHarnessStatePath, primeProfileNeedsAgentDir, primeSubagentEntryId as subagentEntryId, primeThinkingLevel, primeThinkingLevel as primeThinkingLevel$1, prunePrimeProfileMaterial, readPrimeProfileControls, readPrimeProfileControls as readPrimeProfileControls$1, writePrimeAgentFile } from "@tangle-network/agent-profile-materialize";
|
|
3
3
|
import { isAbsolute, join, relative, sep } from "node:path";
|
|
4
4
|
import { existsSync, lchownSync, lstatSync, mkdirSync } from "node:fs";
|
|
@@ -424,6 +424,8 @@ declare abstract class CliAdapterLifecycle<TConfig extends CliProviderConfig = C
|
|
|
424
424
|
uid: number;
|
|
425
425
|
gid: number;
|
|
426
426
|
} | undefined;
|
|
427
|
+
/** Create `dir` and lchown it (never through a planted symlink) to the subprocess user, with each parent up to `upTo` or the topmost directory this call made. */
|
|
428
|
+
protected ensureSubprocessOwnedDir(dir: string, upTo?: string): Promise<void>;
|
|
427
429
|
/** `subprocessIdentity` shaped for `spawn`'s options bag. */
|
|
428
430
|
protected subprocessSpawnOptions(): {
|
|
429
431
|
uid?: number;
|
|
@@ -1269,4 +1271,4 @@ declare function homeXdgEnv(home: string): {
|
|
|
1269
1271
|
};
|
|
1270
1272
|
//#endregion
|
|
1271
1273
|
export { deterministicFilePartId as $, SecretProfileMcpCredentialProxy as $t, isTrustedStoreBinary as A, AcpTurn as At, localMcpEnv as B, InteractionToggleKind as Bt, createRepeatedToolFailureGuard as C, AcpBridgeConfig as Ct, NATIVE_SESSION_CONTRACTS$1 as D, AcpNewSessionResult as Dt, nativeEffortArgs as E, AcpInitializeResult as Et, parseCliUsageLine as F, CliProviderLogger as Ft, InteractionMcpServerConfig$1 as G, interactionToggleEnabled as Gt, AskUserBridge as H, ToolCallState as Ht, readCliTokenUsage as I, CliProviderOptions as It, RequestPlanBridge as J, turnInteractionEnabled as Jt, PermissionPromptBridge as K, readEphemeralContext as Kt, recordCliTokenUsage as L, EphemeralContextInput as Lt, refuseSecretLaunch as M, CliExecArgs as Mt, resolveExecutableRealpath as N, CliExecutionInput as Nt, SEALED_NATIVE_HOME_LAYOUT as O, AcpPromptResult as Ot, accumulateCliTokenUsage as P, CliProviderConfig as Pt, deriveFilePart as Q, SECRET_REFERENCE_PREFIX as Qt, isLocalMcpConfig as R, ExecutionState as Rt, RepeatedToolFailureGuardOptions as S, ACP_PROTOCOL_VERSION as St, kimiThinkingArgs as T, AcpInitializeParams as Tt, DEFAULT_INTERACTION_MCP_SERVER_NAME as U, TurnEndReason as Ut, McpInteractionSupport as V, PerTurnInteractionInput as Vt, InteractionMcpServer$1 as W, enabledInteractionKinds as Wt, interactionMcpToolName as X, withTurnInteractions as Xt, brokerInteractionTools$1 as Y, withEphemeralContext as Yt, buildFileUrl as Z, SECRET_REFERENCE as Zt, toolResultEvents as _, createExecutionState as _t, PERMISSION_DECISION_TIMEOUT_MS as a, isPlainRecord as an, MANAGED_QUOTE_VERSION_HEADER as at, secretMcpScope as b, PreparedCliLaunch as bt, homeXdgEnv as c, resolveReferences as cn, jsonEventParser as ct, finalTextEvent as d, servableStdioServer as dn, SessionRehydrationError as dt, SecretProfileMcpLease as en, inferMediaType as et, reasoningEvents as f, untilSettledOrAborted as fn, rejectNotLaunched as ft, textSnapshotEvents as g, runtimeSecretsOverlay as gt, textDeltaEvents as h, spawnAcpBridge as hn, CliProviderAdapterBase as ht, InteractionHttpBridge as i, isLoopbackEndpoint as in, EXECUTION_TRACE_HEADER as it, provenStoreBinary as j, acpContentText as jt, assertSealedNativeHome as k, AcpSessionUpdateParams as kt, TerminalPlanSupport as l, secretSessionTurnQueue as ln, plaintextResponseParser as lt, streamPartBase as m, AcpProcessSpec as mn, AcpProviderAdapterBase as mt, HarnessId$1 as n, assertSealedNativeSearchPath as nn, EXECUTION_CORRELATION_HEADERS as nt, WorkspacePlanApplication$1 as o, joinQueue as on, executionCorrelationHeaders as ot, sessionObservedEvents as p, AcpBridgeSpawn as pn, wasNeverLaunched as pt, RequestPermissionBridge as q, turnEndReason as qt, InteractionBroker$1 as r, directStdioMcpServers as rn, EXECUTION_ID_HEADER as rt, codexDeveloperInstructionArgs as s, requireRecord as sn, PlaintextResponse as st, CODEX_DISABLED_FEATURE_ARGS as t, SecretProfileMcpServer as tn, trackFilePart as tt, TerminalPlanSupportOptions as u, servableMcpServer as un, InvalidAttachmentError as ut, toolStartEvents as v, CliTurnProcess as vt, trackReasoningBlock as w, AcpContentBlock as wt, RepeatedToolFailure as x, ACP_MIN_PROTOCOL_VERSION as xt, forgetSessionScopes as y, CliTurnSpawn as yt, localMcpArgv as z, InteractionToggleConfig as zt };
|
|
1272
|
-
//# sourceMappingURL=index-
|
|
1274
|
+
//# sourceMappingURL=index-DePFb23d.d.mts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as deterministicFilePartId, $t as SecretProfileMcpCredentialProxy, A as isTrustedStoreBinary, At as AcpTurn, B as localMcpEnv, Bt as InteractionToggleKind, C as createRepeatedToolFailureGuard, Ct as AcpBridgeConfig, D as NATIVE_SESSION_CONTRACTS, Dt as AcpNewSessionResult, E as nativeEffortArgs, Et as AcpInitializeResult, F as parseCliUsageLine, Ft as CliProviderLogger, G as InteractionMcpServerConfig, Gt as interactionToggleEnabled, H as AskUserBridge, Ht as ToolCallState, I as readCliTokenUsage, It as CliProviderOptions, J as RequestPlanBridge, Jt as turnInteractionEnabled, K as PermissionPromptBridge, Kt as readEphemeralContext, L as recordCliTokenUsage, Lt as EphemeralContextInput, M as refuseSecretLaunch, Mt as CliExecArgs, N as resolveExecutableRealpath, Nt as CliExecutionInput, O as SEALED_NATIVE_HOME_LAYOUT, Ot as AcpPromptResult, P as accumulateCliTokenUsage, Pt as CliProviderConfig, Q as deriveFilePart, Qt as SECRET_REFERENCE_PREFIX, R as isLocalMcpConfig, Rt as ExecutionState, S as RepeatedToolFailureGuardOptions, St as ACP_PROTOCOL_VERSION, T as kimiThinkingArgs, Tt as AcpInitializeParams, U as DEFAULT_INTERACTION_MCP_SERVER_NAME, Ut as TurnEndReason, V as McpInteractionSupport, Vt as PerTurnInteractionInput, W as InteractionMcpServer, Wt as enabledInteractionKinds, X as interactionMcpToolName, Xt as withTurnInteractions, Y as brokerInteractionTools, Yt as withEphemeralContext, Z as buildFileUrl, Zt as SECRET_REFERENCE, _ as toolResultEvents, _t as createExecutionState, a as PERMISSION_DECISION_TIMEOUT_MS, an as isPlainRecord, at as MANAGED_QUOTE_VERSION_HEADER, b as secretMcpScope, bt as PreparedCliLaunch, c as homeXdgEnv, cn as resolveReferences, ct as jsonEventParser, d as finalTextEvent, dn as servableStdioServer, dt as SessionRehydrationError, en as SecretProfileMcpLease, et as inferMediaType, f as reasoningEvents, fn as untilSettledOrAborted, ft as rejectNotLaunched, g as textSnapshotEvents, gt as runtimeSecretsOverlay, h as textDeltaEvents, hn as spawnAcpBridge, ht as CliProviderAdapterBase, i as InteractionHttpBridge, in as isLoopbackEndpoint, it as EXECUTION_TRACE_HEADER, j as provenStoreBinary, jt as acpContentText, k as assertSealedNativeHome, kt as AcpSessionUpdateParams, l as TerminalPlanSupport, ln as secretSessionTurnQueue, lt as plaintextResponseParser, m as streamPartBase, mn as AcpProcessSpec, mt as AcpProviderAdapterBase, n as HarnessId, nn as assertSealedNativeSearchPath, nt as EXECUTION_CORRELATION_HEADERS, o as WorkspacePlanApplication, on as joinQueue, ot as executionCorrelationHeaders, p as sessionObservedEvents, pn as AcpBridgeSpawn, pt as wasNeverLaunched, q as RequestPermissionBridge, qt as turnEndReason, r as InteractionBroker, rn as directStdioMcpServers, rt as EXECUTION_ID_HEADER, s as codexDeveloperInstructionArgs, sn as requireRecord, st as PlaintextResponse, t as CODEX_DISABLED_FEATURE_ARGS, tn as SecretProfileMcpServer, tt as trackFilePart, u as TerminalPlanSupportOptions, un as servableMcpServer, ut as InvalidAttachmentError, v as toolStartEvents, vt as CliTurnProcess, w as trackReasoningBlock, wt as AcpContentBlock, x as RepeatedToolFailure, xt as ACP_MIN_PROTOCOL_VERSION, y as forgetSessionScopes, yt as CliTurnSpawn, z as localMcpArgv, zt as InteractionToggleConfig } from "./index-
|
|
1
|
+
import { $ as deterministicFilePartId, $t as SecretProfileMcpCredentialProxy, A as isTrustedStoreBinary, At as AcpTurn, B as localMcpEnv, Bt as InteractionToggleKind, C as createRepeatedToolFailureGuard, Ct as AcpBridgeConfig, D as NATIVE_SESSION_CONTRACTS, Dt as AcpNewSessionResult, E as nativeEffortArgs, Et as AcpInitializeResult, F as parseCliUsageLine, Ft as CliProviderLogger, G as InteractionMcpServerConfig, Gt as interactionToggleEnabled, H as AskUserBridge, Ht as ToolCallState, I as readCliTokenUsage, It as CliProviderOptions, J as RequestPlanBridge, Jt as turnInteractionEnabled, K as PermissionPromptBridge, Kt as readEphemeralContext, L as recordCliTokenUsage, Lt as EphemeralContextInput, M as refuseSecretLaunch, Mt as CliExecArgs, N as resolveExecutableRealpath, Nt as CliExecutionInput, O as SEALED_NATIVE_HOME_LAYOUT, Ot as AcpPromptResult, P as accumulateCliTokenUsage, Pt as CliProviderConfig, Q as deriveFilePart, Qt as SECRET_REFERENCE_PREFIX, R as isLocalMcpConfig, Rt as ExecutionState, S as RepeatedToolFailureGuardOptions, St as ACP_PROTOCOL_VERSION, T as kimiThinkingArgs, Tt as AcpInitializeParams, U as DEFAULT_INTERACTION_MCP_SERVER_NAME, Ut as TurnEndReason, V as McpInteractionSupport, Vt as PerTurnInteractionInput, W as InteractionMcpServer, Wt as enabledInteractionKinds, X as interactionMcpToolName, Xt as withTurnInteractions, Y as brokerInteractionTools, Yt as withEphemeralContext, Z as buildFileUrl, Zt as SECRET_REFERENCE, _ as toolResultEvents, _t as createExecutionState, a as PERMISSION_DECISION_TIMEOUT_MS, an as isPlainRecord, at as MANAGED_QUOTE_VERSION_HEADER, b as secretMcpScope, bt as PreparedCliLaunch, c as homeXdgEnv, cn as resolveReferences, ct as jsonEventParser, d as finalTextEvent, dn as servableStdioServer, dt as SessionRehydrationError, en as SecretProfileMcpLease, et as inferMediaType, f as reasoningEvents, fn as untilSettledOrAborted, ft as rejectNotLaunched, g as textSnapshotEvents, gt as runtimeSecretsOverlay, h as textDeltaEvents, hn as spawnAcpBridge, ht as CliProviderAdapterBase, i as InteractionHttpBridge, in as isLoopbackEndpoint, it as EXECUTION_TRACE_HEADER, j as provenStoreBinary, jt as acpContentText, k as assertSealedNativeHome, kt as AcpSessionUpdateParams, l as TerminalPlanSupport, ln as secretSessionTurnQueue, lt as plaintextResponseParser, m as streamPartBase, mn as AcpProcessSpec, mt as AcpProviderAdapterBase, n as HarnessId, nn as assertSealedNativeSearchPath, nt as EXECUTION_CORRELATION_HEADERS, o as WorkspacePlanApplication, on as joinQueue, ot as executionCorrelationHeaders, p as sessionObservedEvents, pn as AcpBridgeSpawn, pt as wasNeverLaunched, q as RequestPermissionBridge, qt as turnEndReason, r as InteractionBroker, rn as directStdioMcpServers, rt as EXECUTION_ID_HEADER, s as codexDeveloperInstructionArgs, sn as requireRecord, st as PlaintextResponse, t as CODEX_DISABLED_FEATURE_ARGS, tn as SecretProfileMcpServer, tt as trackFilePart, u as TerminalPlanSupportOptions, un as servableMcpServer, ut as InvalidAttachmentError, v as toolStartEvents, vt as CliTurnProcess, w as trackReasoningBlock, wt as AcpContentBlock, x as RepeatedToolFailure, xt as ACP_MIN_PROTOCOL_VERSION, y as forgetSessionScopes, yt as CliTurnSpawn, z as localMcpArgv, zt as InteractionToggleConfig } from "./index-DePFb23d.mjs";
|
|
2
2
|
import { a as partitionImageAttachments, i as PreparedAttachment, n as MAX_TOTAL_INLINE_IMAGE_BYTES, o as preparePromptInputParts, r as PROMPT_SECTION_SEPARATOR, s as prependPromptSection, t as MAX_INLINE_IMAGE_BYTES } from "./prompt-input-CD7okX8T.mjs";
|
|
3
3
|
export { ACP_MIN_PROTOCOL_VERSION, ACP_PROTOCOL_VERSION, AcpBridgeConfig, AcpBridgeSpawn, AcpContentBlock, AcpInitializeParams, AcpInitializeResult, AcpNewSessionResult, AcpProcessSpec, AcpPromptResult, AcpProviderAdapterBase, AcpSessionUpdateParams, AcpTurn, AskUserBridge, CODEX_DISABLED_FEATURE_ARGS, CliExecArgs, CliExecutionInput, CliProviderAdapterBase, CliProviderConfig, CliProviderLogger, CliProviderOptions, CliTurnProcess, CliTurnSpawn, DEFAULT_INTERACTION_MCP_SERVER_NAME, EXECUTION_CORRELATION_HEADERS, EXECUTION_ID_HEADER, EXECUTION_TRACE_HEADER, EphemeralContextInput, ExecutionState, HarnessId, InteractionBroker, InteractionHttpBridge, InteractionMcpServer, InteractionMcpServerConfig, InteractionToggleConfig, InteractionToggleKind, InvalidAttachmentError, MANAGED_QUOTE_VERSION_HEADER, MAX_INLINE_IMAGE_BYTES, MAX_TOTAL_INLINE_IMAGE_BYTES, McpInteractionSupport, NATIVE_SESSION_CONTRACTS, PERMISSION_DECISION_TIMEOUT_MS, PROMPT_SECTION_SEPARATOR, PerTurnInteractionInput, PermissionPromptBridge, PlaintextResponse, PreparedAttachment, PreparedCliLaunch, RepeatedToolFailure, RepeatedToolFailureGuardOptions, RequestPermissionBridge, RequestPlanBridge, SEALED_NATIVE_HOME_LAYOUT, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SecretProfileMcpCredentialProxy, SecretProfileMcpLease, SecretProfileMcpServer, SessionRehydrationError, TerminalPlanSupport, TerminalPlanSupportOptions, ToolCallState, TurnEndReason, WorkspacePlanApplication, accumulateCliTokenUsage, acpContentText, assertSealedNativeHome, assertSealedNativeSearchPath, brokerInteractionTools, buildFileUrl, codexDeveloperInstructionArgs, createExecutionState, createRepeatedToolFailureGuard, deriveFilePart, deterministicFilePartId, directStdioMcpServers, enabledInteractionKinds, executionCorrelationHeaders, finalTextEvent, forgetSessionScopes, homeXdgEnv, inferMediaType, interactionMcpToolName, interactionToggleEnabled, isLocalMcpConfig, isLoopbackEndpoint, isPlainRecord, isTrustedStoreBinary, joinQueue, jsonEventParser, kimiThinkingArgs, localMcpArgv, localMcpEnv, nativeEffortArgs, parseCliUsageLine, partitionImageAttachments, plaintextResponseParser, preparePromptInputParts, prependPromptSection, provenStoreBinary, readCliTokenUsage, readEphemeralContext, reasoningEvents, recordCliTokenUsage, refuseSecretLaunch, rejectNotLaunched, requireRecord, resolveExecutableRealpath, resolveReferences, runtimeSecretsOverlay, secretMcpScope, secretSessionTurnQueue, servableMcpServer, servableStdioServer, sessionObservedEvents, spawnAcpBridge, streamPartBase, textDeltaEvents, textSnapshotEvents, toolResultEvents, toolStartEvents, trackFilePart, trackReasoningBlock, turnEndReason, turnInteractionEnabled, untilSettledOrAborted, wasNeverLaunched, withEphemeralContext, withTurnInteractions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as turnInteractionEnabled, A as McpInteractionSupport, At as toolResultEvents, B as parseCliUsageLine, C as NATIVE_SESSION_CONTRACTS, Ct as homeXdgEnv, D as provenStoreBinary, Dt as streamPartBase, E as isTrustedStoreBinary, Et as sessionObservedEvents, F as interactionMcpToolName, Ft as acpContentText, G as createExecutionState, H as recordCliTokenUsage, I as jsonEventParser, It as spawnAcpBridge, J as localMcpEnv, K as isLocalMcpConfig, L as plaintextResponseParser, M as DEFAULT_INTERACTION_MCP_SERVER_NAME, Mt as trackReasoningBlock, N as InteractionMcpServer, Nt as ACP_MIN_PROTOCOL_VERSION, O as refuseSecretLaunch, Ot as textDeltaEvents, P as brokerInteractionTools, Pt as ACP_PROTOCOL_VERSION, Q as turnEndReason, R as AcpProviderAdapterBase, S as nativeEffortArgs, St as executionCorrelationHeaders, T as assertSealedNativeHome, Tt as reasoningEvents, U as CliProviderAdapterBase, V as readCliTokenUsage, W as createRepeatedToolFailureGuard, X as interactionToggleEnabled, Y as enabledInteractionKinds, Z as readEphemeralContext, _ as secretSessionTurnQueue, _t as runtimeSecretsOverlay, a as codexDeveloperInstructionArgs, at as partitionImageAttachments, b as untilSettledOrAborted, bt as EXECUTION_TRACE_HEADER, c as SECRET_REFERENCE, ct as buildFileUrl, d as directStdioMcpServers, dt as inferMediaType, et as withEphemeralContext, f as isLoopbackEndpoint, ft as trackFilePart, g as resolveReferences, gt as wasNeverLaunched, h as requireRecord, ht as rejectNotLaunched, i as PERMISSION_DECISION_TIMEOUT_MS, it as PROMPT_SECTION_SEPARATOR, j as TerminalPlanSupport, jt as toolStartEvents, k as resolveExecutableRealpath, kt as textSnapshotEvents, l as SECRET_REFERENCE_PREFIX, lt as deriveFilePart, m as joinQueue, mt as SessionRehydrationError, n as InteractionBroker, nt as MAX_INLINE_IMAGE_BYTES, o as forgetSessionScopes, ot as preparePromptInputParts, p as isPlainRecord, pt as InvalidAttachmentError, q as localMcpArgv, r as InteractionHttpBridge, rt as MAX_TOTAL_INLINE_IMAGE_BYTES, s as secretMcpScope, st as prependPromptSection, t as CODEX_DISABLED_FEATURE_ARGS, tt as withTurnInteractions, u as assertSealedNativeSearchPath, ut as deterministicFilePartId, v as servableMcpServer, vt as EXECUTION_CORRELATION_HEADERS, w as SEALED_NATIVE_HOME_LAYOUT, wt as finalTextEvent, x as kimiThinkingArgs, xt as MANAGED_QUOTE_VERSION_HEADER, y as servableStdioServer, yt as EXECUTION_ID_HEADER, z as accumulateCliTokenUsage } from "./src-
|
|
1
|
+
import { $ as turnInteractionEnabled, A as McpInteractionSupport, At as toolResultEvents, B as parseCliUsageLine, C as NATIVE_SESSION_CONTRACTS, Ct as homeXdgEnv, D as provenStoreBinary, Dt as streamPartBase, E as isTrustedStoreBinary, Et as sessionObservedEvents, F as interactionMcpToolName, Ft as acpContentText, G as createExecutionState, H as recordCliTokenUsage, I as jsonEventParser, It as spawnAcpBridge, J as localMcpEnv, K as isLocalMcpConfig, L as plaintextResponseParser, M as DEFAULT_INTERACTION_MCP_SERVER_NAME, Mt as trackReasoningBlock, N as InteractionMcpServer, Nt as ACP_MIN_PROTOCOL_VERSION, O as refuseSecretLaunch, Ot as textDeltaEvents, P as brokerInteractionTools, Pt as ACP_PROTOCOL_VERSION, Q as turnEndReason, R as AcpProviderAdapterBase, S as nativeEffortArgs, St as executionCorrelationHeaders, T as assertSealedNativeHome, Tt as reasoningEvents, U as CliProviderAdapterBase, V as readCliTokenUsage, W as createRepeatedToolFailureGuard, X as interactionToggleEnabled, Y as enabledInteractionKinds, Z as readEphemeralContext, _ as secretSessionTurnQueue, _t as runtimeSecretsOverlay, a as codexDeveloperInstructionArgs, at as partitionImageAttachments, b as untilSettledOrAborted, bt as EXECUTION_TRACE_HEADER, c as SECRET_REFERENCE, ct as buildFileUrl, d as directStdioMcpServers, dt as inferMediaType, et as withEphemeralContext, f as isLoopbackEndpoint, ft as trackFilePart, g as resolveReferences, gt as wasNeverLaunched, h as requireRecord, ht as rejectNotLaunched, i as PERMISSION_DECISION_TIMEOUT_MS, it as PROMPT_SECTION_SEPARATOR, j as TerminalPlanSupport, jt as toolStartEvents, k as resolveExecutableRealpath, kt as textSnapshotEvents, l as SECRET_REFERENCE_PREFIX, lt as deriveFilePart, m as joinQueue, mt as SessionRehydrationError, n as InteractionBroker, nt as MAX_INLINE_IMAGE_BYTES, o as forgetSessionScopes, ot as preparePromptInputParts, p as isPlainRecord, pt as InvalidAttachmentError, q as localMcpArgv, r as InteractionHttpBridge, rt as MAX_TOTAL_INLINE_IMAGE_BYTES, s as secretMcpScope, st as prependPromptSection, t as CODEX_DISABLED_FEATURE_ARGS, tt as withTurnInteractions, u as assertSealedNativeSearchPath, ut as deterministicFilePartId, v as servableMcpServer, vt as EXECUTION_CORRELATION_HEADERS, w as SEALED_NATIVE_HOME_LAYOUT, wt as finalTextEvent, x as kimiThinkingArgs, xt as MANAGED_QUOTE_VERSION_HEADER, y as servableStdioServer, yt as EXECUTION_ID_HEADER, z as accumulateCliTokenUsage } from "./src-CqOi8nrB.mjs";
|
|
2
2
|
export { ACP_MIN_PROTOCOL_VERSION, ACP_PROTOCOL_VERSION, AcpProviderAdapterBase, CODEX_DISABLED_FEATURE_ARGS, CliProviderAdapterBase, DEFAULT_INTERACTION_MCP_SERVER_NAME, EXECUTION_CORRELATION_HEADERS, EXECUTION_ID_HEADER, EXECUTION_TRACE_HEADER, InteractionBroker, InteractionHttpBridge, InteractionMcpServer, InvalidAttachmentError, MANAGED_QUOTE_VERSION_HEADER, MAX_INLINE_IMAGE_BYTES, MAX_TOTAL_INLINE_IMAGE_BYTES, McpInteractionSupport, NATIVE_SESSION_CONTRACTS, PERMISSION_DECISION_TIMEOUT_MS, PROMPT_SECTION_SEPARATOR, SEALED_NATIVE_HOME_LAYOUT, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SessionRehydrationError, TerminalPlanSupport, accumulateCliTokenUsage, acpContentText, assertSealedNativeHome, assertSealedNativeSearchPath, brokerInteractionTools, buildFileUrl, codexDeveloperInstructionArgs, createExecutionState, createRepeatedToolFailureGuard, deriveFilePart, deterministicFilePartId, directStdioMcpServers, enabledInteractionKinds, executionCorrelationHeaders, finalTextEvent, forgetSessionScopes, homeXdgEnv, inferMediaType, interactionMcpToolName, interactionToggleEnabled, isLocalMcpConfig, isLoopbackEndpoint, isPlainRecord, isTrustedStoreBinary, joinQueue, jsonEventParser, kimiThinkingArgs, localMcpArgv, localMcpEnv, nativeEffortArgs, parseCliUsageLine, partitionImageAttachments, plaintextResponseParser, preparePromptInputParts, prependPromptSection, provenStoreBinary, readCliTokenUsage, readEphemeralContext, reasoningEvents, recordCliTokenUsage, refuseSecretLaunch, rejectNotLaunched, requireRecord, resolveExecutableRealpath, resolveReferences, runtimeSecretsOverlay, secretMcpScope, secretSessionTurnQueue, servableMcpServer, servableStdioServer, sessionObservedEvents, spawnAcpBridge, streamPartBase, textDeltaEvents, textSnapshotEvents, toolResultEvents, toolStartEvents, trackFilePart, trackReasoningBlock, turnEndReason, turnInteractionEnabled, untilSettledOrAborted, wasNeverLaunched, withEphemeralContext, withTurnInteractions };
|
|
@@ -5,7 +5,7 @@ import { createHash, createHmac, randomUUID } from "node:crypto";
|
|
|
5
5
|
import { AgentExecutionError, AgentExecutionOutcomeSchema, AgentRuntimeAttachmentsSchema, InteractionExecutionBindingSchema, InteractionKind, ProxySecretReceiptSchema, REASONING_EFFORTS, agentProfileSchema, nativeReasoningControl, normalizeInputParts } from "@tangle-network/agent-interface";
|
|
6
6
|
import { HarnessSessionContractError, assertArgvHonoursSessionContract, assertFlagsHonourSessionContract, assertStoreLocationHonoursSessionContract, compileSessionStoreGlob } from "@tangle-network/cli-agent-registry/session-contract";
|
|
7
7
|
import { MAX_SECRET_PROFILE_REPLAY_CHARS, RESTORED_SESSION_CONTEXT_PREAMBLE, RESTORED_SESSION_CONTEXT_TAG, buildCompleteForkContextBlock, buildForkContextBlock, createMessageStore, createSessionStore, forkSessionWithMessages, readProviderMessageIds } from "@tangle-network/sdk-session-persistence";
|
|
8
|
-
import { mkdir, open, readdir, writeFile } from "node:fs/promises";
|
|
8
|
+
import { lchown, mkdir, open, readdir, writeFile } from "node:fs/promises";
|
|
9
9
|
import path, { basename, dirname, isAbsolute, join, normalize, resolve } from "node:path";
|
|
10
10
|
import * as fs$1 from "node:fs";
|
|
11
11
|
import fs, { constants, lstatSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
@@ -693,6 +693,17 @@ var CliAdapterLifecycle = class {
|
|
|
693
693
|
gid
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
|
+
/** Create `dir` and lchown it (never through a planted symlink) to the subprocess user, with each parent up to `upTo` or the topmost directory this call made. */
|
|
697
|
+
async ensureSubprocessOwnedDir(dir, upTo = dir) {
|
|
698
|
+
const created = await mkdir(dir, { recursive: true });
|
|
699
|
+
const owner = this.subprocessIdentity();
|
|
700
|
+
if (!owner) return;
|
|
701
|
+
const top = created && upTo.startsWith(`${created}/`) ? created : upTo;
|
|
702
|
+
for (let at = dir;; at = dirname(at)) {
|
|
703
|
+
await lchown(at, owner.uid, owner.gid);
|
|
704
|
+
if (at === top) break;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
696
707
|
/** `subprocessIdentity` shaped for `spawn`'s options bag. */
|
|
697
708
|
subprocessSpawnOptions() {
|
|
698
709
|
return this.subprocessIdentity() ?? {};
|
|
@@ -4645,4 +4656,4 @@ async function forgetSessionScopes(target) {
|
|
|
4645
4656
|
//#endregion
|
|
4646
4657
|
export { turnInteractionEnabled as $, McpInteractionSupport as A, toolResultEvents as At, parseCliUsageLine as B, NATIVE_SESSION_CONTRACTS$1 as C, homeXdgEnv as Ct, provenStoreBinary as D, streamPartBase as Dt, isTrustedStoreBinary as E, sessionObservedEvents as Et, interactionMcpToolName as F, acpContentText as Ft, createExecutionState as G, recordCliTokenUsage as H, jsonEventParser as I, spawnAcpBridge as It, localMcpEnv as J, isLocalMcpConfig as K, plaintextResponseParser as L, DEFAULT_INTERACTION_MCP_SERVER_NAME as M, trackReasoningBlock as Mt, InteractionMcpServer$1 as N, ACP_MIN_PROTOCOL_VERSION as Nt, refuseSecretLaunch as O, textDeltaEvents as Ot, brokerInteractionTools$1 as P, ACP_PROTOCOL_VERSION as Pt, turnEndReason as Q, AcpProviderAdapterBase as R, nativeEffortArgs as S, executionCorrelationHeaders as St, assertSealedNativeHome as T, reasoningEvents as Tt, CliProviderAdapterBase as U, readCliTokenUsage as V, createRepeatedToolFailureGuard as W, interactionToggleEnabled as X, enabledInteractionKinds as Y, readEphemeralContext as Z, secretSessionTurnQueue as _, runtimeSecretsOverlay as _t, codexDeveloperInstructionArgs as a, partitionImageAttachments as at, untilSettledOrAborted as b, EXECUTION_TRACE_HEADER as bt, SECRET_REFERENCE as c, buildFileUrl as ct, directStdioMcpServers as d, inferMediaType as dt, withEphemeralContext as et, isLoopbackEndpoint as f, trackFilePart as ft, resolveReferences as g, wasNeverLaunched as gt, requireRecord as h, rejectNotLaunched as ht, PERMISSION_DECISION_TIMEOUT_MS as i, PROMPT_SECTION_SEPARATOR as it, TerminalPlanSupport as j, toolStartEvents as jt, resolveExecutableRealpath as k, textSnapshotEvents as kt, SECRET_REFERENCE_PREFIX as l, deriveFilePart as lt, joinQueue as m, SessionRehydrationError as mt, InteractionBroker$1 as n, MAX_INLINE_IMAGE_BYTES as nt, forgetSessionScopes as o, preparePromptInputParts as ot, isPlainRecord as p, InvalidAttachmentError as pt, localMcpArgv as q, InteractionHttpBridge as r, MAX_TOTAL_INLINE_IMAGE_BYTES as rt, secretMcpScope as s, prependPromptSection as st, CODEX_DISABLED_FEATURE_ARGS as t, withTurnInteractions as tt, assertSealedNativeSearchPath as u, deterministicFilePartId as ut, servableMcpServer as v, EXECUTION_CORRELATION_HEADERS as vt, SEALED_NATIVE_HOME_LAYOUT as w, finalTextEvent as wt, kimiThinkingArgs as x, MANAGED_QUOTE_VERSION_HEADER as xt, servableStdioServer as y, EXECUTION_ID_HEADER as yt, accumulateCliTokenUsage as z };
|
|
4647
4658
|
|
|
4648
|
-
//# sourceMappingURL=src-
|
|
4659
|
+
//# sourceMappingURL=src-CqOi8nrB.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sdk-provider-cli-base",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.62",
|
|
4
4
|
"description": "Base adapter for CLI-based AI agent providers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
"import": "./dist/adapters/nanoclaw/index.mjs",
|
|
24
24
|
"types": "./dist/adapters/nanoclaw/index.d.mts"
|
|
25
25
|
},
|
|
26
|
+
"./nanocode": {
|
|
27
|
+
"import": "./dist/adapters/nanocode/index.mjs",
|
|
28
|
+
"types": "./dist/adapters/nanocode/index.d.mts"
|
|
29
|
+
},
|
|
26
30
|
"./openclaw": {
|
|
27
31
|
"import": "./dist/adapters/openclaw/index.mjs",
|
|
28
32
|
"types": "./dist/adapters/openclaw/index.d.mts"
|
|
@@ -51,12 +55,12 @@
|
|
|
51
55
|
"dependencies": {
|
|
52
56
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
53
57
|
"@tangle-network/agent-core": "^1.0.3",
|
|
54
|
-
"@tangle-network/agent-interface": "^5.10.
|
|
55
|
-
"@tangle-network/agent-profile-materialize": "1.1.
|
|
58
|
+
"@tangle-network/agent-interface": "^5.10.22",
|
|
59
|
+
"@tangle-network/agent-profile-materialize": "1.1.99",
|
|
56
60
|
"@tangle-network/agent-trace-contract": "^2.2.0",
|
|
57
|
-
"@tangle-network/cli-agent-registry": "0.15.
|
|
61
|
+
"@tangle-network/cli-agent-registry": "0.15.72",
|
|
58
62
|
"@tangle-network/sdk-cli-runner": "0.3.12",
|
|
59
|
-
"@tangle-network/sdk-session-persistence": "0.7.
|
|
63
|
+
"@tangle-network/sdk-session-persistence": "0.7.9",
|
|
60
64
|
"zod": "4.6.7"
|
|
61
65
|
},
|
|
62
66
|
"devDependencies": {
|
|
@@ -71,8 +75,8 @@
|
|
|
71
75
|
"registry": "https://registry.npmjs.org"
|
|
72
76
|
},
|
|
73
77
|
"tangleRelease": {
|
|
74
|
-
"sourceSha": "
|
|
75
|
-
"mergedAt": "2026-11-
|
|
78
|
+
"sourceSha": "1a4c8fa7a209ac030e7d523b64191a391eb45286",
|
|
79
|
+
"mergedAt": "2026-11-10T12:34:00-08:00"
|
|
76
80
|
},
|
|
77
81
|
"scripts": {
|
|
78
82
|
"build": "tsdown",
|