@zvada/agent-server 0.3.24 → 0.3.26
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/CHANGELOG.md +110 -0
- package/README.md +3 -0
- package/dist/client/client.js +93 -34
- package/dist/core/agents/acp/acp-agent.js +91 -14
- package/dist/core/agents/acp/mappings.js +5 -1
- package/dist/core/agents/claude-code/approvals.js +2 -1
- package/dist/core/agents/claude-code/claude-agent.js +12 -2
- package/dist/core/agents/claude-code/mcp.js +9 -1
- package/dist/core/agents/claude-code/models.js +16 -10
- package/dist/core/agents/claude-code/options.js +23 -2
- package/dist/core/agents/claude-code/session.js +21 -1
- package/dist/core/agents/claude-code/tools.js +9 -4
- package/dist/core/agents/claude-code/turn.js +2 -0
- package/dist/core/agents/codex-app-server/adapter.js +2 -0
- package/dist/core/agents/codex-app-server/client.js +8 -5
- package/dist/core/agents/codex-app-server/codex-agent.js +35 -2
- package/dist/core/agents/codex-app-server/effort.js +13 -6
- package/dist/core/agents/codex-app-server/mcp.js +35 -18
- package/dist/core/agents/codex-app-server/models.js +10 -10
- package/dist/core/agents/codex-app-server/options.js +11 -2
- package/dist/core/agents/codex-app-server/session.js +11 -4
- package/dist/core/agents/codex-app-server/thread-settings.js +30 -11
- package/dist/core/agents/host-tools.js +493 -0
- package/dist/core/agents/mcp-config.js +6 -2
- package/dist/core/agents/scripted/scripted-agent.js +11 -4
- package/dist/core/agents/scripted/steps.js +5 -1
- package/dist/core/agents/session-agent.js +70 -2
- package/dist/core/agents/thinking-levels.js +8 -5
- package/dist/core/index.js +1 -0
- package/dist/core/presets.js +12 -2
- package/dist/core/processes/identity.js +1 -0
- package/dist/core/processes/lifeline.js +13 -1
- package/dist/core/processes/process-table.js +1 -0
- package/dist/core/provision/extract.js +1 -0
- package/dist/core/provision/pins.js +7 -16
- package/dist/core/provision/releases.js +25 -25
- package/dist/core/proxy/loopback.js +22 -4
- package/dist/core/runtime/agent-runtime.js +6 -3
- package/dist/core/runtime/turn.js +20 -10
- package/dist/protocol/config.js +21 -1
- package/dist/protocol/credentials.js +2 -1
- package/dist/protocol/errors.js +12 -3
- package/dist/protocol/model-catalog.js +58 -18
- package/dist/protocol/models.js +6 -27
- package/dist/protocol/thinking.js +22 -9
- package/dist/protocol/wire-api.js +2 -2
- package/dist/server/bin.js +6 -4
- package/dist/server/routes.js +3 -2
- package/dist/types/client/client.d.ts +6 -1
- package/dist/types/client/client.d.ts.map +1 -1
- package/dist/types/core/agents/acp/acp-agent.d.ts +15 -0
- package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
- package/dist/types/core/agents/acp/mappings.d.ts +5 -1
- package/dist/types/core/agents/acp/mappings.d.ts.map +1 -1
- package/dist/types/core/agents/acp/requests.d.ts +2 -0
- package/dist/types/core/agents/acp/requests.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/approvals.d.ts +2 -1
- package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/claude-agent.d.ts +1 -0
- package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/mcp.d.ts +8 -1
- package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/models.d.ts +9 -5
- package/dist/types/core/agents/claude-code/models.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/options.d.ts +14 -1
- package/dist/types/core/agents/claude-code/options.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/session.d.ts +2 -0
- package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/turn.d.ts +3 -0
- package/dist/types/core/agents/claude-code/turn.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/client.d.ts +2 -0
- package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +11 -0
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/effort.d.ts +7 -7
- package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/mcp.d.ts +11 -3
- package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/models.d.ts +4 -1
- package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/options.d.ts +9 -2
- package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/requests.d.ts +2 -0
- package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/session.d.ts +6 -3
- package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -1
- package/dist/types/core/agents/host-tools.d.ts +162 -0
- package/dist/types/core/agents/host-tools.d.ts.map +1 -0
- package/dist/types/core/agents/mcp-config.d.ts +11 -2
- package/dist/types/core/agents/mcp-config.d.ts.map +1 -1
- package/dist/types/core/agents/scripted/scripted-agent.d.ts.map +1 -1
- package/dist/types/core/agents/scripted/steps.d.ts +1 -1
- package/dist/types/core/agents/scripted/steps.d.ts.map +1 -1
- package/dist/types/core/agents/session-agent.d.ts +2 -7
- package/dist/types/core/agents/session-agent.d.ts.map +1 -1
- package/dist/types/core/agents/thinking-levels.d.ts +7 -3
- package/dist/types/core/agents/thinking-levels.d.ts.map +1 -1
- package/dist/types/core/index.d.ts +1 -0
- package/dist/types/core/index.d.ts.map +1 -1
- package/dist/types/core/presets.d.ts +11 -1
- package/dist/types/core/presets.d.ts.map +1 -1
- package/dist/types/core/processes/identity.d.ts.map +1 -1
- package/dist/types/core/processes/lifeline.d.ts.map +1 -1
- package/dist/types/core/processes/process-table.d.ts.map +1 -1
- package/dist/types/core/provision/extract.d.ts.map +1 -1
- package/dist/types/core/provision/pins.d.ts +5 -4
- package/dist/types/core/provision/pins.d.ts.map +1 -1
- package/dist/types/core/proxy/loopback.d.ts.map +1 -1
- package/dist/types/core/runtime/agent-runtime.d.ts +4 -1
- package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -1
- package/dist/types/core/runtime/turn.d.ts +12 -7
- package/dist/types/core/runtime/turn.d.ts.map +1 -1
- package/dist/types/protocol/clis.d.ts +3 -3
- package/dist/types/protocol/config.d.ts +12 -19
- package/dist/types/protocol/config.d.ts.map +1 -1
- package/dist/types/protocol/conversation.d.ts +10 -42
- package/dist/types/protocol/conversation.d.ts.map +1 -1
- package/dist/types/protocol/credentials.d.ts +13 -1
- package/dist/types/protocol/credentials.d.ts.map +1 -1
- package/dist/types/protocol/errors.d.ts +6 -4
- package/dist/types/protocol/errors.d.ts.map +1 -1
- package/dist/types/protocol/execution.d.ts +2 -18
- package/dist/types/protocol/execution.d.ts.map +1 -1
- package/dist/types/protocol/lifecycle.d.ts +12 -76
- package/dist/types/protocol/lifecycle.d.ts.map +1 -1
- package/dist/types/protocol/model-catalog.d.ts.map +1 -1
- package/dist/types/protocol/models.d.ts +4 -42
- package/dist/types/protocol/models.d.ts.map +1 -1
- package/dist/types/protocol/thinking.d.ts +19 -19
- package/dist/types/protocol/thinking.d.ts.map +1 -1
- package/dist/types/protocol/wire-api.d.ts +32 -117
- package/dist/types/protocol/wire-api.d.ts.map +1 -1
- package/dist/types/protocol/wire.d.ts +24 -125
- package/dist/types/protocol/wire.d.ts.map +1 -1
- package/dist/types/server/routes.d.ts.map +1 -1
- package/docs/consuming.md +92 -12
- package/docs/deploy.md +8 -0
- package/docs/harnesses.md +88 -27
- package/package.json +4 -4
- package/src/client/client.ts +114 -44
- package/src/core/agents/acp/acp-agent.ts +123 -17
- package/src/core/agents/acp/mappings.ts +5 -1
- package/src/core/agents/acp/requests.ts +2 -0
- package/src/core/agents/claude-code/approvals.ts +2 -1
- package/src/core/agents/claude-code/claude-agent.ts +14 -2
- package/src/core/agents/claude-code/mcp.ts +11 -1
- package/src/core/agents/claude-code/models.ts +15 -10
- package/src/core/agents/claude-code/options.ts +37 -3
- package/src/core/agents/claude-code/session.ts +26 -1
- package/src/core/agents/claude-code/tools.ts +10 -4
- package/src/core/agents/claude-code/turn.ts +4 -0
- package/src/core/agents/codex-app-server/adapter.ts +2 -0
- package/src/core/agents/codex-app-server/client.ts +11 -5
- package/src/core/agents/codex-app-server/codex-agent.ts +45 -1
- package/src/core/agents/codex-app-server/effort.ts +15 -20
- package/src/core/agents/codex-app-server/mcp.ts +46 -23
- package/src/core/agents/codex-app-server/models.ts +10 -10
- package/src/core/agents/codex-app-server/options.ts +16 -2
- package/src/core/agents/codex-app-server/requests.ts +2 -0
- package/src/core/agents/codex-app-server/session.ts +19 -4
- package/src/core/agents/codex-app-server/thread-settings.ts +31 -11
- package/src/core/agents/host-tools.ts +649 -0
- package/src/core/agents/mcp-config.ts +15 -3
- package/src/core/agents/scripted/scripted-agent.ts +11 -3
- package/src/core/agents/scripted/steps.ts +5 -1
- package/src/core/agents/session-agent.ts +78 -2
- package/src/core/agents/thinking-levels.ts +9 -6
- package/src/core/index.ts +9 -0
- package/src/core/presets.ts +24 -3
- package/src/core/processes/identity.ts +1 -0
- package/src/core/processes/lifeline.ts +14 -1
- package/src/core/processes/process-table.ts +1 -0
- package/src/core/provision/extract.ts +1 -0
- package/src/core/provision/pins.ts +7 -16
- package/src/core/provision/releases.ts +25 -25
- package/src/core/proxy/loopback.ts +25 -4
- package/src/core/runtime/agent-runtime.ts +6 -3
- package/src/core/runtime/turn.ts +21 -9
- package/src/protocol/config.ts +22 -1
- package/src/protocol/credentials.ts +19 -5
- package/src/protocol/errors.ts +12 -3
- package/src/protocol/model-catalog.ts +58 -18
- package/src/protocol/models.ts +6 -26
- package/src/protocol/thinking.ts +27 -14
- package/src/protocol/wire-api.ts +2 -2
- package/src/server/bin.ts +6 -4
- package/src/server/routes.ts +3 -2
|
@@ -4,6 +4,7 @@ import type { DiagnosticHandler } from "../../diagnostics.ts";
|
|
|
4
4
|
import type { NativeProcesses } from "../../processes/native-processes.ts";
|
|
5
5
|
import type { AgentExecuteOptions } from "../base.ts";
|
|
6
6
|
import type { CredentialSource } from "../credentials.ts";
|
|
7
|
+
import type { HostToolSessions, HostTools } from "../host-tools.ts";
|
|
7
8
|
import type { InheritConfig } from "../inherit-config.ts";
|
|
8
9
|
import { type ClaudeSpawn } from "./spawn.ts";
|
|
9
10
|
/**
|
|
@@ -27,7 +28,8 @@ export type ClaudeSdkOptionOverrides = Partial<Omit<CCOptions, "canUseTool" | "o
|
|
|
27
28
|
* asks about, questions (AskUserQuestion) and plan approvals (ExitPlanMode)
|
|
28
29
|
* included, BEFORE the interactive permission broker and elicitation. Claude
|
|
29
30
|
* asks about a call its mode and rules do not approve by themselves: under
|
|
30
|
-
* `bypass_permissions`,
|
|
31
|
+
* `bypass_permissions`, questions, plans and, since Claude Code 2.1.326, the
|
|
32
|
+
* few calls it holds back as dangerous. Returns the SDK's own
|
|
31
33
|
* `PermissionResult` (so hosts keep full native power: `updatedInput`,
|
|
32
34
|
* `updatedPermissions`) or undefined to fall through to the broker.
|
|
33
35
|
* Operator embed-tier only — never wire-sourced.
|
|
@@ -104,6 +106,11 @@ export interface ClaudeCodeAgentOptions {
|
|
|
104
106
|
* wire-configured servers.
|
|
105
107
|
*/
|
|
106
108
|
sdkMcpServers?: (ctx: SessionSpawn) => SdkMcpServers | Promise<SdkMcpServers>;
|
|
109
|
+
/**
|
|
110
|
+
* The host's tools for each session (LLP 0018), run in process: no secret,
|
|
111
|
+
* no HTTP. A turn's own server may not take their name. Operator-level only.
|
|
112
|
+
*/
|
|
113
|
+
hostTools?: HostTools;
|
|
107
114
|
/**
|
|
108
115
|
* Pre-broker tool policy (SDK PermissionResult or undefined = fall through
|
|
109
116
|
* to the interactive broker). Operator embed-tier only.
|
|
@@ -120,6 +127,10 @@ export interface ClaudeCodeAgentOptions {
|
|
|
120
127
|
* recorders — instead of re-deriving termination from side effects.
|
|
121
128
|
* NOTE: `replaced` sessions usually respawn immediately with context
|
|
122
129
|
* preserved; drop only resources bound to the dead subprocess.
|
|
130
|
+
* A cancel during a start answers at once; this callback for that
|
|
131
|
+
* process (`released`, as for a close) can come after the cancel's
|
|
132
|
+
* answer, and comes before that turn's end: set up the next turn's
|
|
133
|
+
* per-session resources after the turn's end, not the cancel's answer.
|
|
123
134
|
*/
|
|
124
135
|
onSessionEnd?: (sessionId: string, reason: ClaudeSessionEndReason) => void;
|
|
125
136
|
/** Operational diagnostics (interrupt timeouts). */
|
|
@@ -157,6 +168,8 @@ export type ClaudeSessionExtras = Pick<ClaudeCodeAgentOptions, "sdkMcpServers" |
|
|
|
157
168
|
export type ClaudeSessionSettings = ClaudeSessionExtras & Pick<ClaudeCodeAgentOptions, "idleTimeoutMs" | "cancelConfirmMs"> & {
|
|
158
169
|
/** The agent's: where its sessions' `claude` processes start. */
|
|
159
170
|
processes: NativeProcesses;
|
|
171
|
+
/** The agent's: its sessions' host tools. */
|
|
172
|
+
host?: HostToolSessions;
|
|
160
173
|
};
|
|
161
174
|
/** What a turn asks of the Claude session it runs on. */
|
|
162
175
|
export type ClaudeSessionConfig = Pick<AgentExecuteOptions, "cwd" | "additionalDirectories" | "model" | "thinkingLevel" | "permissionMode" | "maxTurns" | "subagentMode" | "systemPromptAppend" | "resumeSessionId" | "resumeSessionAt" | "mcpServers" | "env" | "apiKey" | "disableTools"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,OAAO,IAAI,SAAS,EACpB,8BAA8B,EAC9B,gBAAgB,EAChB,gBAAgB,EAEhB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAA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EAAE,IAAI,CAAC,mBAAmB,EAAE,KAAK,GAAG,eAAe,CAAC,GACxD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAEpC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,EAC/C,aAAa,CAAC,EAAE,aAAa,EAC7B,SAAS,CAAC,EAAE,wBAAwB,EACpC,KAAK,CAAC,EAAE,WAAW,GACjB,SAAS,CA6FX"}
|
|
@@ -97,6 +97,8 @@ export declare class ClaudeSession implements PooledProcess, PooledClient {
|
|
|
97
97
|
* resumes the conversation on a new one.
|
|
98
98
|
*/
|
|
99
99
|
applyLiveChange(next: ClaudeSessionConfig, signal: AbortSignal): Promise<boolean>;
|
|
100
|
+
/** The turn running now and the mode the process runs in, for a host tool's caller. */
|
|
101
|
+
private liveTurn;
|
|
100
102
|
start(): Promise<void>;
|
|
101
103
|
/**
|
|
102
104
|
* Send a turn's prompt: the turn's events stream until its result. One turn
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,mBAAmB,EAMnB,cAAc,EACd,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,mBAAmB,EAMnB,cAAc,EACd,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAMlF,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,WAAW,EACX,MAAM,oBAAoB,CAAC;AAI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GG;IACH,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,OAAO;CAKf;AAED,sFAAsF;AACtF,MAAM,WAAW,cAAc;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,wFAAwF;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,gFAAgF;AAChF,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAAC,sBAAsB,EAAE,cAAc,CAAC,GAC5E,iBAAiB,CAiDnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAgB,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE5F;;;;GAIG;AAGH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAgB,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE5F;;;;GAIG;AAGH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAqD1D,CAAC;AA2BH;;;;;GAKG;AACH,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAM,GAC5B,OAAO,GAAG,SAAS,CAarB;AASD;;;;GAIG;AACH,wBAAgB,cAAc,CAC7B,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,GACxB,QAAQ,CAaV"}
|
|
@@ -6,6 +6,8 @@ import type { ClaudeQuerySpend } from "./spend.ts";
|
|
|
6
6
|
/** What a turn starts with: its id, and the brokers its requests go to. */
|
|
7
7
|
export interface ClaudeTurnStart {
|
|
8
8
|
turnId: string;
|
|
9
|
+
/** The turn's cancel: a host tool's call under way ends with it. */
|
|
10
|
+
signal?: AbortSignal;
|
|
9
11
|
/**
|
|
10
12
|
* The engine's permission broker for this turn. Absent (a turn driven
|
|
11
13
|
* outside the runtime), Claude's permission mode alone decides.
|
|
@@ -26,6 +28,7 @@ export interface ClaudeTurnStart {
|
|
|
26
28
|
*/
|
|
27
29
|
export declare class ClaudeTurn {
|
|
28
30
|
readonly id: string;
|
|
31
|
+
readonly signal?: AbortSignal;
|
|
29
32
|
readonly permissions?: PermissionRequestHandler;
|
|
30
33
|
readonly elicitation?: ElicitationRequestHandler;
|
|
31
34
|
/** What the turn yields, until its result or its failure. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/turn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AASnD,2EAA2E;AAC3E,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC;;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AAY;IA+FpB,OAAO,CAAC,QAAQ;IA+BhB,OAAO,CAAC,YAAY;IA4CpB,kFAAkF;IAClF,OAAO,CAAC,IAAI;IAYZ,OAAO,CAAC,WAAW;IA8BnB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,QAAQ;IAqBhB,OAAO,CAAC,SAAS;IAuBjB,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,YAAY;CAapB;AAED,wBAAgB,+BAA+B,CAAC,GAAG,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,gBAAgB,CAE5F;AAwCD,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAkC3E"}
|
|
@@ -57,6 +57,8 @@ export declare class CodexRpcError extends Error {
|
|
|
57
57
|
readonly data?: unknown | undefined;
|
|
58
58
|
constructor(message: string, code?: number | undefined, data?: unknown | undefined);
|
|
59
59
|
}
|
|
60
|
+
/** The `-c key=value` overrides the app-server starts with, for these options. */
|
|
61
|
+
export declare function configArgs(opts: Pick<CodexAppServerClientOptions, "ephemeralCredentials" | "pluginsOff">): string[];
|
|
60
62
|
export interface CodexAppServerClientOptions {
|
|
61
63
|
codexPath?: string;
|
|
62
64
|
cwd?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAiBvD,KAAK,mBAAmB,GAAG,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAE1D,iFAAiF;AACjF,MAAM,MAAM,oBAAoB,GAAG,CAClC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,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Descriptor } from "../../../protocol/index.ts";
|
|
|
2
2
|
import { type NativeProcesses } from "../../processes/native-processes.ts";
|
|
3
3
|
import type { AgentExecuteOptions, ListModelsOptions, RawAgentEvent } from "../base.ts";
|
|
4
4
|
import type { CredentialSource } from "../credentials.ts";
|
|
5
|
+
import { type HostTools } from "../host-tools.ts";
|
|
5
6
|
import type { InheritConfig } from "../inherit-config.ts";
|
|
6
7
|
import { SessionAgent } from "../session-agent.ts";
|
|
7
8
|
import { type CodexAppServerClientOptions, type CodexConnection } from "./client.ts";
|
|
@@ -84,6 +85,12 @@ export interface CodexAppServerAgentOptions {
|
|
|
84
85
|
* default. Operator-level only.
|
|
85
86
|
*/
|
|
86
87
|
userLogin?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The host's tools for each session (LLP 0018): Codex reaches them at the
|
|
90
|
+
* engine's loopback, by a secret of the session's own in its thread's
|
|
91
|
+
* config. Operator-level only.
|
|
92
|
+
*/
|
|
93
|
+
hostTools?: HostTools;
|
|
87
94
|
}
|
|
88
95
|
/**
|
|
89
96
|
* Codex harness backed by a long-lived `codex app-server` subprocess speaking
|
|
@@ -112,6 +119,7 @@ export declare class CodexAppServerAgent extends SessionAgent {
|
|
|
112
119
|
readonly processes: NativeProcesses;
|
|
113
120
|
private readonly timing;
|
|
114
121
|
private readonly sessions;
|
|
122
|
+
private readonly host?;
|
|
115
123
|
readonly login: CodexCliLogin;
|
|
116
124
|
/**
|
|
117
125
|
* The user's own login (`userLogin`), read from an app-server with the
|
|
@@ -122,6 +130,9 @@ export declare class CodexAppServerAgent extends SessionAgent {
|
|
|
122
130
|
/** On a product's credentials, each session may list as a different account. */
|
|
123
131
|
get modelsPerSession(): boolean;
|
|
124
132
|
protected executeTurn(input: AgentInput, options: AgentExecuteOptions, controller: AbortController): AsyncIterableIterator<RawAgentEvent>;
|
|
133
|
+
protected hostSecret(sessionId: string): string | undefined;
|
|
134
|
+
/** The host's server for the session, by the name its source gives, when it has one. */
|
|
135
|
+
private hostServer;
|
|
125
136
|
/**
|
|
126
137
|
* The user's own login, for a turn (or a model list) whose `env` names a
|
|
127
138
|
* home, when the operator set `userLogin`: read again for each, so a login
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-agent.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/codex-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,UAAU,EACV,eAAe,EAEf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"codex-agent.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/codex-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,UAAU,EACV,eAAe,EAEf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,qCAAqC,CAAC;AAGlG,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAExF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAEN,KAAK,SAAS,EAGd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAqB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAEN,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACpB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAwB,KAAK,iBAAiB,EAAoB,MAAM,cAAc,CAAC;AAqC9F,MAAM,WAAW,0BAA0B;IAC1C,sGAAsG;IACtG,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,2BAA2B,KAAK,eAAe,CAAC;IACzE,8GAA8G;IAC9G,aAAa,CAAC,EAAE,MAA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E,eAAe,GACzB,qBAAqB,CAAC,aAAa,CAAC;cAyFpB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIpE,wFAAwF;YAC1E,UAAU;IAiBxB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAOpB,sFAAsF;IACtF,OAAO,CAAC,OAAO;cAgBI,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAI3D;;;;;OAKG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IA0BxE,mFAAmF;cAChE,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS;IAInF,mFAAmF;IACnF,wBAAwB,IAAI,IAAI;IAIhC,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAInB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWzC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5C;;;OAGG;YACW,OAAO;IAOrB;;;OAGG;YACW,OAAO;CA6BrB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type ThinkingLevel } from "../../../protocol/index.ts";
|
|
2
|
-
/** Codex reasoning-effort string for a level (matches the `ReasoningEffort` enum). */
|
|
3
|
-
type CodexReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
4
2
|
/**
|
|
5
3
|
* The effort Codex runs for `level`. `supported` is what the model accepts, in
|
|
6
4
|
* this vocabulary, where `off` stands for its least effort: `offEffort`, the
|
|
7
|
-
* native `none` or `minimal` the model advertises. A level it
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* native `none` or `minimal` the model advertises. A level it lists is sent as
|
|
6
|
+
* it is, and one it lacks is fitted to the nearest level this build can order;
|
|
7
|
+
* when there is none (a level this build does not know, or a model listing
|
|
8
|
+
* none it knows), the level is not applied: `undefined`. Without `supported`,
|
|
9
|
+
* the level is sent as asked, and `off` becomes `low`: no model the pinned CLI
|
|
10
|
+
* lists accepts `none` or `minimal`, and every one accepts `low`.
|
|
10
11
|
*/
|
|
11
|
-
export declare function codexReasoningEffort
|
|
12
|
-
export {};
|
|
12
|
+
export declare function codexReasoningEffort(level: ThinkingLevel, supported?: readonly ThinkingLevel[], offEffort?: "none" | "minimal"): string | undefined;
|
|
13
13
|
//# sourceMappingURL=effort.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effort.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/effort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,4BAA4B,CAAC;AAEpF
|
|
1
|
+
{"version":3,"file":"effort.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/effort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,4BAA4B,CAAC;AAEpF;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,aAAa,EACpB,SAAS,CAAC,EAAE,SAAS,aAAa,EAAE,EACpC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,GAAG,SAAS,CAOpB"}
|
|
@@ -3,6 +3,8 @@ import type { AgentExecuteOptions } from "../base.ts";
|
|
|
3
3
|
import { type CodexConnection } from "./client.ts";
|
|
4
4
|
import type { CodexHomes } from "./homes.ts";
|
|
5
5
|
import type { CodexNotification } from "./protocol.ts";
|
|
6
|
+
/** Codex supports stdio and Streamable HTTP, not the legacy SSE transport. */
|
|
7
|
+
export declare function codexMcpServers(servers: Record<string, McpServerConfig>): Record<string, unknown>;
|
|
6
8
|
/**
|
|
7
9
|
* Codex's startup error for a server, readable: its Rust type paths out, a
|
|
8
10
|
* chain it repeats said once, and no prefix naming the server again.
|
|
@@ -21,8 +23,14 @@ export interface CodexTurnMcp {
|
|
|
21
23
|
/** For the thread's own config: a turn with servers that names no home, which the engine never writes. */
|
|
22
24
|
thread?: Record<string, unknown>;
|
|
23
25
|
}
|
|
24
|
-
/** The
|
|
25
|
-
export
|
|
26
|
+
/** The host's tools, as the session's turns name them (`HostToolSessions.http`). */
|
|
27
|
+
export type CodexHostServer = Record<string, McpServerConfig>;
|
|
28
|
+
/**
|
|
29
|
+
* The turn's servers, snapshotted before anything asynchronous can let the
|
|
30
|
+
* caller change them. The host's server goes in the thread's own config
|
|
31
|
+
* whether or not the turn names a home: its secret is never written to disk.
|
|
32
|
+
*/
|
|
33
|
+
export declare function codexTurnMcp(options: AgentExecuteOptions, homes: CodexHomes, host?: CodexHostServer): CodexTurnMcp;
|
|
26
34
|
/**
|
|
27
35
|
* Which `mcp_servers` table a thread was opened with (`threadServers`): a
|
|
28
36
|
* turn that needs another runs on the thread opened again in a new process.
|
|
@@ -64,7 +72,7 @@ export declare class CodexMcpState {
|
|
|
64
72
|
* Read before the thread opens, so no connection is made first, and
|
|
65
73
|
* before each turn.
|
|
66
74
|
*/
|
|
67
|
-
threadServers({
|
|
75
|
+
threadServers({ thread }: CodexTurnMcp): Promise<Record<string, unknown> | undefined>;
|
|
68
76
|
/**
|
|
69
77
|
* Get the thread's servers ready for a turn: configured, started, and the
|
|
70
78
|
* ones it goes on without said through `onWarning`. A required server that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAQtD,OAAO,EAAE,KAAK,eAAe,EAAS,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,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C,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,CAE3F;AAED;;;;GAIG;AACH,qBAAa,aAAa;IAgBxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAhBrB,qFAAqF;IACrF,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,kGAAkG;IAClG,OAAO,CAAC,QAAQ,CAAS;IACzB,8EAA8E;IAC9E,OAAO,CAAC,SAAS,CAAS;IAC1B;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IACpD,qEAAqE;IACrE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+B;gBAGzC,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,MAAM;IAG7B,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAUtE;;;;OAIG;IACG,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAazD;;;;;OAKG;IACG,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAU3F;;;;OAIG;IACG,OAAO,CACZ,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,GAC5D,OAAO,CAAC,IAAI,CAAC;IAwBhB;;;OAGG;YACW,gBAAgB;IAU9B;;;;;OAKG;YACW,kBAAkB;CAOhC"}
|
|
@@ -9,7 +9,10 @@ export interface CodexModelThinking {
|
|
|
9
9
|
/** The native effort the model runs when the thread sets none. */
|
|
10
10
|
defaultEffort?: string;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* The level a native Codex effort is: `none` and `minimal` are `off`, and any
|
|
14
|
+
* other effort is a level of its own name, known to this build or not.
|
|
15
|
+
*/
|
|
13
16
|
export declare function codexThinkingLevel(effort: unknown): ThinkingLevel | undefined;
|
|
14
17
|
/**
|
|
15
18
|
* The thinking levels each model the logged-in account can run accepts, from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG/F,OAAO,EAAE,KAAK,eAAe,EAAS,MAAM,aAAa,CAAC;AAO1D,+DAA+D;AAC/D,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,gFAAgF;AAChF,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;IACjC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAG7E;AAuDD;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC3C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,GACtC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,SAAS,CAAC,CAQ9D;AAED,qEAAqE;AACrE,MAAM,WAAW,mBAAmB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAsBD;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EACxC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,mBAAmB,CAAC,CAQ9B;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE,kBAAkB,CAAC,EAClD,eAAe,CAAC,EAAE,MAAM,GACtB,eAAe,EAAE,CA0BnB;AAED,yDAAyD;AACzD,UAAU,iBAAiB;IAC1B,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,4EAA4E;AAC5E,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EACxC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,iBAAiB,CAAC,CAO5B;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACpC,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,MAAM,EACX,EACC,MAAM,EACN,KAAK,GACL,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAAO,GAClF,OAAO,CAAC,iBAAiB,CAAC,CAY5B"}
|
|
@@ -38,13 +38,20 @@ export declare function codexSessionCompatible(existing: CodexProcessIdentity &
|
|
|
38
38
|
export declare function clientOptionsFor(codexPath: string, { cwd, env }: {
|
|
39
39
|
cwd: string;
|
|
40
40
|
env?: Record<string, string>;
|
|
41
|
-
}, auth: CodexAuth | undefined, experimentalApi: boolean, inheritConfig?: InheritConfig
|
|
41
|
+
}, auth: CodexAuth | undefined, experimentalApi: boolean, inheritConfig?: InheritConfig,
|
|
42
|
+
/** The engine serves host tools on loopback: reach it directly, past any proxy. */
|
|
43
|
+
loopback?: boolean): Omit<CodexAppServerClientOptions, "processes">;
|
|
42
44
|
/**
|
|
43
45
|
* Codex's own tools, by group, that the operator leaves on (the default for
|
|
44
46
|
* each, Codex's own behaviour) or turns off for every thread (LLP 0017).
|
|
45
47
|
*/
|
|
46
48
|
export interface CodexBuiltInTools {
|
|
47
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* The local environment: the shell, unified exec, `apply_patch`,
|
|
51
|
+
* `view_image`, `write_stdin`. Off, Codex (since 0.164) still lists
|
|
52
|
+
* `apply_patch` to the model and refuses a call to it, so nothing the agent
|
|
53
|
+
* calls reads or writes the disk.
|
|
54
|
+
*/
|
|
48
55
|
local?: boolean;
|
|
49
56
|
webSearch?: boolean;
|
|
50
57
|
imageGeneration?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;;GAQG;AACH,eA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jC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAED,kFAAkF;AAClF,MAAM,WAAW,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACjE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,mBAAmB,EAC5B,MAAM,GAAE,iBAAsB,EAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,iBAAiB,CA8DnB"}
|
|
@@ -20,6 +20,8 @@ export interface CodexTurnScope {
|
|
|
20
20
|
items: TurnItems;
|
|
21
21
|
/** The mode the turn runs in now: its own, until the user approves a plan. */
|
|
22
22
|
mode: PermissionMode;
|
|
23
|
+
/** The engine's id of the turn, for a host tool's caller. */
|
|
24
|
+
turnId?: string;
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
25
27
|
* Answer Codex's requests (server → client) for the turn that has the session.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAQtF,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,kBAAkB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,mDAAmD;IACnD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,sEAAsE;IACtE,oBAAoB,CAAC,EAAE,yBAAyB,CAAC;IACjD,MAAM,EAAE,WAAW,CAAC;IACpB,wDAAwD;IACxD,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,8EAA8E;IAC9E,IAAI,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAQtF,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,kBAAkB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,mDAAmD;IACnD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,sEAAsE;IACtE,oBAAoB,CAAC,EAAE,yBAAyB,CAAC;IACjD,MAAM,EAAE,WAAW,CAAC;IACpB,wDAAwD;IACxD,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,8EAA8E;IAC9E,IAAI,EAAE,cAAc,CAAC;IACrB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAkDD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAoB9D;AA4MD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAazB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AgentExecuteOptions } from "../base.ts";
|
|
2
|
+
import type { LiveTurn } from "../host-tools.ts";
|
|
2
3
|
import type { CodexConnection } from "./client.ts";
|
|
3
4
|
import { type CodexAuth } from "./credentials.ts";
|
|
4
|
-
import { CodexMcpState, type CodexTurnMcp } from "./mcp.ts";
|
|
5
|
+
import { type CodexHostServer, CodexMcpState, type CodexTurnMcp } from "./mcp.ts";
|
|
5
6
|
import type { CodexModelThinking } from "./models.ts";
|
|
6
7
|
import { type CodexProcessIdentity, type CodexThreadPolicy } from "./options.ts";
|
|
7
8
|
import { type CodexTurnScope } from "./requests.ts";
|
|
@@ -61,8 +62,10 @@ export declare class CodexSessions {
|
|
|
61
62
|
/** The operator's: what a thread loads by itself, whether every turn needs a home, and Codex's own tools. */
|
|
62
63
|
policy?: CodexThreadPolicy);
|
|
63
64
|
get(sessionId: string): CodexSession | undefined;
|
|
64
|
-
/** The turn's MCP servers, in the `CODEX_HOME` the session claims when the turn names one. */
|
|
65
|
-
mcpFor(options: AgentExecuteOptions): CodexTurnMcp;
|
|
65
|
+
/** The turn's MCP servers, in the `CODEX_HOME` the session claims when the turn names one, and the host's. */
|
|
66
|
+
mcpFor(options: AgentExecuteOptions, host?: CodexHostServer): CodexTurnMcp;
|
|
67
|
+
/** The turn the session runs now, and its mode, for a host tool's caller. */
|
|
68
|
+
live(sessionId: string): ReturnType<LiveTurn>;
|
|
66
69
|
/**
|
|
67
70
|
* The session's process for the turn, which takes it (the pool's rule):
|
|
68
71
|
* the running one when the turn can run there as the same account, else a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,KAAK,SAAS,EAA0B,MAAM,kBAAkB,CAAC;AAG1E,OAAO,EACN,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,YAAY,EAGjB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACN,KAAK,oBAAoB,EAEzB,KAAK,iBAAiB,EAItB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,0EAA0E;AAC1E,MAAM,WAAW,YAAa,SAAQ,oBAAoB;IACzD,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,EAAE,aAAa,CAAC;IACnB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,EAAE,CAAC;IAClB,yEAAyE;IACzE,MAAM,EAAE,WAAW,CAAC;IACpB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;;;OAIG;IACH,mBAAmB,IAAI,OAAO,CAAC;IAC/B,wGAAwG;IACxG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E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OAAO,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC5B;AAED,2FAA2F;AAC3F,UAAU,YAAY;IACrB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,uFAAuF;IACvF,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,IAAI,EAAE,cAAc,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,cAAc,GAClB;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,CAiB3D;
|
|
1
|
+
{"version":3,"file":"thread-settings.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/thread-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AASxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAKjD;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,gGAAgG;IAChG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,6DAA6D;IAC7D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC5B;AAED,2FAA2F;AAC3F,UAAU,YAAY;IACrB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,uFAAuF;IACvF,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,IAAI,EAAE,cAAc,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,cAAc,GAClB;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,CAiB3D;AA0CD,0EAA0E;AAC1E,qBAAa,WAAW;IACvB,QAAQ,EAAE,cAAc,CAAyC;IACjE,kFAAkF;IAClF,OAAO,CAAC,QAAQ,CAAC,CAA+B;IAEhD;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI;IAuBpE;;;;;OAKG;IACG,OAAO,CACZ,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,cAAc,GAClB,OAAO,CAAC,YAAY,CAAC;IAqExB;;;;;;OAMG;IACG,OAAO,CACZ,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,OAAO,CAAC,IAAI,CAAC;IA2BhB;;;OAGG;IACH,OAAO,CAAC,WAAW;IAcnB;;;;OAIG;YACW,aAAa;CAU3B"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { type AgentHarness, type McpServerConfig, type PermissionMode } from "../../protocol/index.ts";
|
|
2
|
+
/** A tool the host gives its sessions' agents. */
|
|
3
|
+
export interface HostTool {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
/** The JSON Schema of its arguments: an object schema. */
|
|
7
|
+
inputSchema: Record<string, unknown>;
|
|
8
|
+
/** MCP's `readOnlyHint` and `destructiveHint`: Codex runs a read-only tool without asking. */
|
|
9
|
+
annotations?: {
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
destructive?: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export type HostToolContent = {
|
|
15
|
+
type: "text";
|
|
16
|
+
text: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: "image";
|
|
19
|
+
data: string;
|
|
20
|
+
mimeType: string;
|
|
21
|
+
};
|
|
22
|
+
/** What a call answers: its content, and whether it failed (the model reads why). */
|
|
23
|
+
export interface HostToolResult {
|
|
24
|
+
content: HostToolContent[];
|
|
25
|
+
isError?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** Who calls, as only the engine knows it at the moment of the call. */
|
|
28
|
+
export interface HostToolCaller {
|
|
29
|
+
sessionId: string;
|
|
30
|
+
harness: AgentHarness;
|
|
31
|
+
/** The turn running when the call came: a call outside a turn is refused before the host sees it. */
|
|
32
|
+
turnId: string;
|
|
33
|
+
/** The mode the session runs in at the moment of the call, a change mid-turn included. */
|
|
34
|
+
permissionMode: PermissionMode;
|
|
35
|
+
}
|
|
36
|
+
/** A session's tools: one MCP server, named `name` on every harness. */
|
|
37
|
+
export interface HostToolSource {
|
|
38
|
+
name: string;
|
|
39
|
+
tools: readonly HostTool[];
|
|
40
|
+
/** Words for the model about the tools (MCP's `instructions`). */
|
|
41
|
+
instructions?: string;
|
|
42
|
+
/** How long one call may run, on every harness (30 minutes by default). */
|
|
43
|
+
timeoutMs?: number;
|
|
44
|
+
/** Run a tool. `signal` aborts when the agent gives the call up. A throw is the call's failure. */
|
|
45
|
+
call(name: string, args: Record<string, unknown>, caller: HostToolCaller, signal: AbortSignal): Promise<HostToolResult>;
|
|
46
|
+
}
|
|
47
|
+
/** The host's tools for a session, asked once, at its first turn; none gives it none. */
|
|
48
|
+
export type HostTools = (session: {
|
|
49
|
+
sessionId: string;
|
|
50
|
+
cwd: string;
|
|
51
|
+
harness: AgentHarness;
|
|
52
|
+
}) => HostToolSource | undefined | Promise<HostToolSource | undefined>;
|
|
53
|
+
/** What the engine knows of a session's turn when a tool is called, and the turn's own cancel. */
|
|
54
|
+
export type LiveTurn = () => (Pick<HostToolCaller, "turnId" | "permissionMode"> & {
|
|
55
|
+
signal?: AbortSignal;
|
|
56
|
+
}) | undefined;
|
|
57
|
+
/** How long a host tool call may run unless its source says otherwise. */
|
|
58
|
+
export declare const HOST_TOOL_TIMEOUT_MS: number;
|
|
59
|
+
/** The MCP transport the Claude Agent SDK hands an in-process server (`connect`). */
|
|
60
|
+
interface SdkTransport {
|
|
61
|
+
onmessage?: (message: unknown) => void;
|
|
62
|
+
onclose?: () => void;
|
|
63
|
+
send(message: unknown): Promise<void>;
|
|
64
|
+
start(): Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
/** The hosts a harness process must reach directly, never through a proxy (`NO_PROXY`). */
|
|
67
|
+
export declare const LOOPBACK_HOSTS: string[];
|
|
68
|
+
export interface HostToolSessionsOptions {
|
|
69
|
+
/** The session's turn now, for a call over HTTP. */
|
|
70
|
+
live?: (sessionId: string) => ReturnType<LiveTurn>;
|
|
71
|
+
/**
|
|
72
|
+
* The harness cannot be relied on to ask the person before a tool that
|
|
73
|
+
* changes something (an ACP agent): such a tool runs only with full access.
|
|
74
|
+
*/
|
|
75
|
+
writesNeedFullAccess?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/** A session's source, bound to the entry it came from: its HTTP server is that entry's or none. */
|
|
78
|
+
export interface HostLease {
|
|
79
|
+
source: HostToolSource;
|
|
80
|
+
/**
|
|
81
|
+
* The session's server on the engine's loopback, as a turn names it: the
|
|
82
|
+
* same URL and secret for the session's life, so a Codex thread's config
|
|
83
|
+
* does not change between its turns. A loopback that cannot start is the
|
|
84
|
+
* server's `mcp_unavailable`; a session released meanwhile gets nothing.
|
|
85
|
+
*/
|
|
86
|
+
http(): Promise<McpServerConfig>;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A harness's host tools: each session's source, asked once; for Claude an
|
|
90
|
+
* in-process server, for an agent that reaches it over HTTP the engine's own
|
|
91
|
+
* loopback endpoint, which knows a session by the secret its config carries.
|
|
92
|
+
*/
|
|
93
|
+
export declare class HostToolSessions {
|
|
94
|
+
private readonly hostTools;
|
|
95
|
+
private readonly harness;
|
|
96
|
+
private readonly options;
|
|
97
|
+
private readonly entries;
|
|
98
|
+
private readonly bySecret;
|
|
99
|
+
private loopback?;
|
|
100
|
+
private closed;
|
|
101
|
+
constructor(hostTools: HostTools, harness: AgentHarness, options?: HostToolSessionsOptions);
|
|
102
|
+
/** The session's source: asked at its first turn, the same one after. */
|
|
103
|
+
source(sessionId: string, cwd: string): Promise<HostToolSource | undefined>;
|
|
104
|
+
/** The session's source and its HTTP server, both bound to the entry asked now. */
|
|
105
|
+
lease(sessionId: string, cwd: string): Promise<HostLease | undefined>;
|
|
106
|
+
private entry;
|
|
107
|
+
/** Claude's in-process server for the session's source, its caller read from `live` at each call. */
|
|
108
|
+
inProcess(sessionId: string, source: HostToolSource, live: LiveTurn): {
|
|
109
|
+
type: "sdk";
|
|
110
|
+
name: string;
|
|
111
|
+
timeout: number;
|
|
112
|
+
instance: {
|
|
113
|
+
connect(transport: SdkTransport): Promise<void>;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
private http;
|
|
117
|
+
/** The session's secret, when it has one: no text the engine lets out may hold it. */
|
|
118
|
+
secretOf(sessionId: string): string | undefined;
|
|
119
|
+
/** Forget the session: its source, its calls, and its secret, which answers no more. */
|
|
120
|
+
release(sessionId: string): void;
|
|
121
|
+
close(): Promise<void>;
|
|
122
|
+
private caller;
|
|
123
|
+
private refuse;
|
|
124
|
+
/** The session a request's bearer names, and its entry, when both still stand. */
|
|
125
|
+
private bearer;
|
|
126
|
+
/** One MCP POST: a secret of no session's, or none, is refused; never a 401, which starts OAuth. */
|
|
127
|
+
private serve;
|
|
128
|
+
}
|
|
129
|
+
/** A harness's host tools, when the operator gives any. */
|
|
130
|
+
export declare function hostToolSessions(hostTools: HostTools | undefined, harness: AgentHarness, options?: HostToolSessionsOptions): HostToolSessions | undefined;
|
|
131
|
+
/** A turn's own server may not take the host tools' name: neither harness would say whose it is. */
|
|
132
|
+
export declare function refuseHostName(servers: Readonly<Record<string, unknown>> | undefined, name: string): void;
|
|
133
|
+
/**
|
|
134
|
+
* The environment `env` changes to for the loopback to be reached directly,
|
|
135
|
+
* each value `""` for a variable to leave out:
|
|
136
|
+
* - each of `NO_PROXY` and `no_proxy` that is set gets the loopback hosts
|
|
137
|
+
* added to its own list (a tool may read either, and the two may differ);
|
|
138
|
+
* with neither set, both name the loopback;
|
|
139
|
+
* - one whose value is exactly `*` (no proxy for anything) is left as it is,
|
|
140
|
+
* since a client may honour `*` only as the whole value (Codex 0.169.1 sent
|
|
141
|
+
* its model's traffic through the proxy once it read `*,127.0.0.1`); when
|
|
142
|
+
* the value a client reads (`NO_PROXY`, else `no_proxy`) is exactly `*`, the
|
|
143
|
+
* proxy variables are left out instead: Codex's MCP client (hyper-util
|
|
144
|
+
* 0.1.20) checks an IP address only against IP entries, so `*` alone left
|
|
145
|
+
* 127.0.0.1 to the proxy, and with `*` the person asked for no proxy at all.
|
|
146
|
+
* A `*` inside a longer list is extended like any other list.
|
|
147
|
+
*/
|
|
148
|
+
export declare function loopbackDirect(env: Record<string, string | undefined>): Record<string, string>;
|
|
149
|
+
/** `env` with the loopback reached directly: a variable left out is gone, not empty. */
|
|
150
|
+
export declare function withLoopbackDirect(env: Record<string, string | undefined>): Record<string, string | undefined>;
|
|
151
|
+
/**
|
|
152
|
+
* `value` with `secret` replaced by `[redacted]` in every string, key and
|
|
153
|
+
* value alike, at any depth. A first pass looks for it without copying, so
|
|
154
|
+
* an event that does not hold it is returned as it is. One that does is
|
|
155
|
+
* copied whole (arrays and plain objects; strings are shared), each object
|
|
156
|
+
* once, so two fields sharing an object share its copy and a cycle stays a
|
|
157
|
+
* cycle in the copy. An error is changed in place: its message, stack,
|
|
158
|
+
* cause and every own field (`data`). Other objects are left as they are.
|
|
159
|
+
*/
|
|
160
|
+
export declare function withoutSecret<T>(value: T, secret: string | undefined): T;
|
|
161
|
+
export {};
|
|
162
|
+
//# sourceMappingURL=host-tools.d.ts.map
|