@lamplitisles/dsh-nanocodex 0.1.0-beta.0
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/LICENSE +65 -0
- package/NOTICE +2 -0
- package/README.md +182 -0
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/cordis.patch.yml +52 -0
- package/dist/index.d.ts +435 -0
- package/dist/index.js +3405 -0
- package/dist/standard-preset.d.ts +7 -0
- package/dist/standard-preset.js +25 -0
- package/engine-release.json +14 -0
- package/package.json +119 -0
- package/presets/standard/agent.cordis.yml +6 -0
- package/presets/standard/preset.yml +2 -0
- package/vendor/nanocodex/README.md +1344 -0
- package/vendor/nanocodex/actions/events.d.mts +10 -0
- package/vendor/nanocodex/actions/events.mjs +163 -0
- package/vendor/nanocodex/actions/index.d.mts +13 -0
- package/vendor/nanocodex/actions/index.mjs +35 -0
- package/vendor/nanocodex/actions/session.d.mts +66 -0
- package/vendor/nanocodex/actions/session.mjs +59 -0
- package/vendor/nanocodex/actions/turn.d.mts +59 -0
- package/vendor/nanocodex/actions/turn.mjs +37 -0
- package/vendor/nanocodex/actions/voice.d.mts +22 -0
- package/vendor/nanocodex/actions/voice.mjs +50 -0
- package/vendor/nanocodex/browser/Agent.d.mts +55 -0
- package/vendor/nanocodex/browser/Agent.mjs +11 -0
- package/vendor/nanocodex/browser/ChatGptSubscription.d.mts +7 -0
- package/vendor/nanocodex/browser/ChatGptSubscription.mjs +19 -0
- package/vendor/nanocodex/browser/InlineAgent.mjs +266 -0
- package/vendor/nanocodex/browser/Transport.d.mts +74 -0
- package/vendor/nanocodex/browser/Transport.mjs +61 -0
- package/vendor/nanocodex/browser/Voice.d.mts +71 -0
- package/vendor/nanocodex/browser/Voice.mjs +291 -0
- package/vendor/nanocodex/browser/VoiceSession.mjs +688 -0
- package/vendor/nanocodex/browser/WorkerAgent.d.mts +65 -0
- package/vendor/nanocodex/browser/WorkerAgent.mjs +1472 -0
- package/vendor/nanocodex/browser/agent.worker.mjs +3 -0
- package/vendor/nanocodex/browser/config.d.mts +36 -0
- package/vendor/nanocodex/browser/config.mjs +439 -0
- package/vendor/nanocodex/browser/engine.mjs +13 -0
- package/vendor/nanocodex/browser/harness.mjs +55 -0
- package/vendor/nanocodex/browser/host.d.mts +83 -0
- package/vendor/nanocodex/browser/host.mjs +555 -0
- package/vendor/nanocodex/browser/hostManagedWebSocket.d.mts +14 -0
- package/vendor/nanocodex/browser/hostManagedWebSocket.mjs +110 -0
- package/vendor/nanocodex/browser/index.d.mts +92 -0
- package/vendor/nanocodex/browser/index.mjs +23 -0
- package/vendor/nanocodex/browser/indexeddb-durability-store.mjs +197 -0
- package/vendor/nanocodex/browser/workspace.d.mts +16 -0
- package/vendor/nanocodex/browser/workspace.mjs +107 -0
- package/vendor/nanocodex/cloud/Client.d.mts +83 -0
- package/vendor/nanocodex/cloud/Client.mjs +231 -0
- package/vendor/nanocodex/cloud/Decorator.d.mts +31 -0
- package/vendor/nanocodex/cloud/Decorator.mjs +37 -0
- package/vendor/nanocodex/cloud/Dialog.d.mts +113 -0
- package/vendor/nanocodex/cloud/Dialog.mjs +366 -0
- package/vendor/nanocodex/cloud/Errors.d.mts +22 -0
- package/vendor/nanocodex/cloud/Errors.mjs +39 -0
- package/vendor/nanocodex/cloud/Principal.d.mts +26 -0
- package/vendor/nanocodex/cloud/Principal.mjs +88 -0
- package/vendor/nanocodex/cloud/RemoteProvider.mjs +88 -0
- package/vendor/nanocodex/cloud/Transport.d.mts +47 -0
- package/vendor/nanocodex/cloud/Transport.mjs +454 -0
- package/vendor/nanocodex/cloud/actions/account.d.mts +9 -0
- package/vendor/nanocodex/cloud/actions/account.mjs +19 -0
- package/vendor/nanocodex/cloud/actions/agent.d.mts +18 -0
- package/vendor/nanocodex/cloud/actions/agent.mjs +428 -0
- package/vendor/nanocodex/cloud/actions/connection.d.mts +133 -0
- package/vendor/nanocodex/cloud/actions/connection.mjs +580 -0
- package/vendor/nanocodex/cloud/actions/grant.d.mts +10 -0
- package/vendor/nanocodex/cloud/actions/grant.mjs +12 -0
- package/vendor/nanocodex/cloud/actions/index.d.mts +7 -0
- package/vendor/nanocodex/cloud/actions/index.mjs +7 -0
- package/vendor/nanocodex/cloud/actions/machineUsd.d.mts +23 -0
- package/vendor/nanocodex/cloud/actions/machineUsd.mjs +37 -0
- package/vendor/nanocodex/cloud/actions/model.d.mts +12 -0
- package/vendor/nanocodex/cloud/actions/model.mjs +50 -0
- package/vendor/nanocodex/cloud/actions/mpp.d.mts +28 -0
- package/vendor/nanocodex/cloud/actions/mpp.mjs +39 -0
- package/vendor/nanocodex/cloud/index.d.mts +30 -0
- package/vendor/nanocodex/cloud/index.mjs +9 -0
- package/vendor/nanocodex/cloud/internal.mjs +533 -0
- package/vendor/nanocodex/cloud/mercator.mjs +108 -0
- package/vendor/nanocodex/cloud/server/HostPrincipal.d.mts +34 -0
- package/vendor/nanocodex/cloud/server/HostPrincipal.mjs +202 -0
- package/vendor/nanocodex/cloud/server/index.d.mts +1 -0
- package/vendor/nanocodex/cloud/server/index.mjs +1 -0
- package/vendor/nanocodex/cloud/types.d.mts +211 -0
- package/vendor/nanocodex/cloudflare/Agent.d.mts +133 -0
- package/vendor/nanocodex/cloudflare/Agent.mjs +811 -0
- package/vendor/nanocodex/cloudflare/egress-subject.mjs +19 -0
- package/vendor/nanocodex/cloudflare/egress.d.mts +41 -0
- package/vendor/nanocodex/cloudflare/egress.mjs +119 -0
- package/vendor/nanocodex/cloudflare/event-socket.mjs +316 -0
- package/vendor/nanocodex/cloudflare/index.d.mts +7 -0
- package/vendor/nanocodex/cloudflare/index.mjs +6 -0
- package/vendor/nanocodex/host/Agent.d.mts +55 -0
- package/vendor/nanocodex/host/Agent.mjs +1 -0
- package/vendor/nanocodex/host/index.d.mts +82 -0
- package/vendor/nanocodex/host/index.mjs +10 -0
- package/vendor/nanocodex/index.d.mts +81 -0
- package/vendor/nanocodex/index.mjs +12 -0
- package/vendor/nanocodex/internal.mjs +1275 -0
- package/vendor/nanocodex/managed/Agent.d.mts +380 -0
- package/vendor/nanocodex/managed/Agent.mjs +1694 -0
- package/vendor/nanocodex/managed/ManagedError.d.mts +9 -0
- package/vendor/nanocodex/managed/ManagedError.mjs +8 -0
- package/vendor/nanocodex/managed/README.md +241 -0
- package/vendor/nanocodex/managed/Voice.mjs +202 -0
- package/vendor/nanocodex/managed/index.d.mts +20 -0
- package/vendor/nanocodex/managed/index.mjs +2 -0
- package/vendor/nanocodex/managed/internal.mjs +119 -0
- package/vendor/nanocodex/node/Agent.d.mts +50 -0
- package/vendor/nanocodex/node/Agent.mjs +203 -0
- package/vendor/nanocodex/node/ChatGptSubscription.d.mts +9 -0
- package/vendor/nanocodex/node/ChatGptSubscription.mjs +17 -0
- package/vendor/nanocodex/node/Transport.d.mts +44 -0
- package/vendor/nanocodex/node/Transport.mjs +46 -0
- package/vendor/nanocodex/node/host.mjs +731 -0
- package/vendor/nanocodex/node/index.d.mts +73 -0
- package/vendor/nanocodex/node/index.mjs +17 -0
- package/vendor/nanocodex/node/workspace.d.mts +10 -0
- package/vendor/nanocodex/node/workspace.mjs +198 -0
- package/vendor/nanocodex/package.json +200 -0
- package/vendor/nanocodex/pkg-node/nanocodex.d.ts +675 -0
- package/vendor/nanocodex/pkg-node/nanocodex.js +2628 -0
- package/vendor/nanocodex/pkg-node/nanocodex_bg.wasm.d.ts +105 -0
- package/vendor/nanocodex/pkg-node/package.json +1 -0
- package/vendor/nanocodex/pkg-web/.nanocodex-bindgen-stamp +6 -0
- package/vendor/nanocodex/pkg-web/nanocodex-build.json +1 -0
- package/vendor/nanocodex/pkg-web/nanocodex.d.ts +805 -0
- package/vendor/nanocodex/pkg-web/nanocodex.js +2714 -0
- package/vendor/nanocodex/pkg-web/nanocodex_bg.js +2615 -0
- package/vendor/nanocodex/pkg-web/nanocodex_bg.wasm +0 -0
- package/vendor/nanocodex/pkg-web/nanocodex_bg.wasm.d.ts +105 -0
- package/vendor/nanocodex/pkg-web/nanocodex_worker.js +9 -0
- package/vendor/nanocodex/pkg-web/package.json +1 -0
- package/vendor/nanocodex/runtime/chatgpt-subscription.mjs +212 -0
- package/vendor/nanocodex/runtime/cloudflare-durability-store.d.mts +26 -0
- package/vendor/nanocodex/runtime/cloudflare-durability-store.mjs +168 -0
- package/vendor/nanocodex/runtime/code-evaluator.worker.mjs +137 -0
- package/vendor/nanocodex/runtime/code-runtime.mjs +1 -0
- package/vendor/nanocodex/runtime/durability-store.d.mts +85 -0
- package/vendor/nanocodex/runtime/durability-store.mjs +631 -0
- package/vendor/nanocodex/runtime/durability.mjs +153 -0
- package/vendor/nanocodex/runtime/managed-transport.mjs +460 -0
- package/vendor/nanocodex/runtime/mcp-runtime.mjs +534 -0
- package/vendor/nanocodex/runtime/postgres-durability-store.d.mts +64 -0
- package/vendor/nanocodex/runtime/postgres-durability-store.mjs +532 -0
- package/vendor/nanocodex/runtime/quickjs-evaluator.d.mts +17 -0
- package/vendor/nanocodex/runtime/quickjs-evaluator.mjs +236 -0
- package/vendor/nanocodex/runtime/responses-transport.mjs +22 -0
- package/vendor/nanocodex/runtime/subagents.d.mts +107 -0
- package/vendor/nanocodex/runtime/subagents.mjs +54 -0
- package/vendor/nanocodex/runtime/subscription-store.d.mts +8 -0
- package/vendor/nanocodex/runtime/subscription-store.mjs +42 -0
- package/vendor/nanocodex/runtime/tempo-provider.d.mts +125 -0
- package/vendor/nanocodex/runtime/tempo-provider.mjs +264 -0
- package/vendor/nanocodex/runtime/tool-configuration.mjs +1 -0
- package/vendor/nanocodex/runtime/tool-router.mjs +1 -0
- package/vendor/nanocodex/runtime/utf8.mjs +1 -0
- package/vendor/nanocodex/runtime/worker-evaluator.mjs +162 -0
- package/vendor/nanocodex/runtime/workspace.d.mts +1 -0
- package/vendor/nanocodex/runtime/workspace.mjs +1 -0
- package/vendor/nanocodex/tools/Tools.d.mts +56 -0
- package/vendor/nanocodex/tools/Tools.mjs +136 -0
- package/vendor/nanocodex/tools/artifact.d.mts +1 -0
- package/vendor/nanocodex/tools/artifact.mjs +1 -0
- package/vendor/nanocodex/tools/attachment.mjs +1 -0
- package/vendor/nanocodex/tools/bash.d.mts +1 -0
- package/vendor/nanocodex/tools/bash.mjs +1 -0
- package/vendor/nanocodex/tools/browser/accountInfo.mjs +795 -0
- package/vendor/nanocodex/tools/browser/browserBuffer.mjs +18 -0
- package/vendor/nanocodex/tools/browser/browserCompiler.mjs +155 -0
- package/vendor/nanocodex/tools/browser/browserEgress.mjs +161 -0
- package/vendor/nanocodex/tools/browser/browserPython.mjs +133 -0
- package/vendor/nanocodex/tools/browser/browserShell.mjs +1075 -0
- package/vendor/nanocodex/tools/browser/browserSprintf.mjs +4 -0
- package/vendor/nanocodex/tools/browser/browserSsh.mjs +201 -0
- package/vendor/nanocodex/tools/browser/browserZlib.mjs +136 -0
- package/vendor/nanocodex/tools/browser/compiler.worker.mjs +160 -0
- package/vendor/nanocodex/tools/browser/devTunnelsSshBrowser.mjs +13 -0
- package/vendor/nanocodex/tools/browser/index.d.mts +209 -0
- package/vendor/nanocodex/tools/browser/index.mjs +174 -0
- package/vendor/nanocodex/tools/browser/opfsGit.mjs +248 -0
- package/vendor/nanocodex/tools/browser/python.worker.mjs +114 -0
- package/vendor/nanocodex/tools/browser/threadGit.mjs +197 -0
- package/vendor/nanocodex/tools/browser/unsupportedNodeRsa.mjs +5 -0
- package/vendor/nanocodex/tools/browser/workspace.mjs +83 -0
- package/vendor/nanocodex/tools/dataset.d.mts +1 -0
- package/vendor/nanocodex/tools/dataset.mjs +1 -0
- package/vendor/nanocodex/tools/datasetContract.mjs +1 -0
- package/vendor/nanocodex/tools/datasetEngine.mjs +1 -0
- package/vendor/nanocodex/tools/hostedCatalog.d.mts +1 -0
- package/vendor/nanocodex/tools/hostedCatalog.mjs +1 -0
- package/vendor/nanocodex/tools/index.d.mts +49 -0
- package/vendor/nanocodex/tools/index.mjs +19 -0
- package/vendor/nanocodex/tools/namedTool.mjs +1 -0
- package/vendor/nanocodex/tools/repository-workspace.d.mts +1 -0
- package/vendor/nanocodex/tools/repository-workspace.mjs +1 -0
- package/vendor/nanocodex/tools/ssh.d.mts +1 -0
- package/vendor/nanocodex/tools/ssh.mjs +1 -0
- package/vendor/nanocodex/tools/standard.mjs +1 -0
- package/vendor/nanocodex/tools/standardDescriptions.mjs +1 -0
- package/vendor/nanocodex/types.d.mts +663 -0
- package/vendor/nanocodex/wasm.d.mts +4 -0
- package/vendor/nanocodex/worker/ChatGptSubscription.d.mts +9 -0
- package/vendor/nanocodex/worker/ChatGptSubscription.mjs +29 -0
- package/vendor/nanocodex/worker/index.d.mts +18 -0
- package/vendor/nanocodex/worker/index.mjs +5 -0
- package/vendor/nanocodex-tools/README.md +65 -0
- package/vendor/nanocodex-tools/dist/hosted/app-tool-catalog.d.ts +7 -0
- package/vendor/nanocodex-tools/dist/hosted/app-tool-catalog.js +14 -0
- package/vendor/nanocodex-tools/dist/hosted/broker-core.d.ts +172 -0
- package/vendor/nanocodex-tools/dist/hosted/broker-core.js +1278 -0
- package/vendor/nanocodex-tools/dist/hosted/index.d.ts +3 -0
- package/vendor/nanocodex-tools/dist/hosted/index.js +3 -0
- package/vendor/nanocodex-tools/dist/hosted/protocol.d.ts +120 -0
- package/vendor/nanocodex-tools/dist/hosted/protocol.js +415 -0
- package/vendor/nanocodex-tools/dist/index.d.ts +19 -0
- package/vendor/nanocodex-tools/dist/index.js +14 -0
- package/vendor/nanocodex-tools/dist/memory.d.ts +204 -0
- package/vendor/nanocodex-tools/dist/memory.js +411 -0
- package/vendor/nanocodex-tools/dist/namespace.d.ts +87 -0
- package/vendor/nanocodex-tools/dist/namespace.js +338 -0
- package/vendor/nanocodex-tools/dist/repository-archive.d.ts +4 -0
- package/vendor/nanocodex-tools/dist/repository-archive.js +104 -0
- package/vendor/nanocodex-tools/dist/runtime.d.ts +30 -0
- package/vendor/nanocodex-tools/dist/runtime.js +37 -0
- package/vendor/nanocodex-tools/dist/session.d.ts +167 -0
- package/vendor/nanocodex-tools/dist/session.js +286 -0
- package/vendor/nanocodex-tools/dist/shell.d.ts +51 -0
- package/vendor/nanocodex-tools/dist/shell.js +553 -0
- package/vendor/nanocodex-tools/dist/ssh.d.ts +29 -0
- package/vendor/nanocodex-tools/dist/ssh.js +66 -0
- package/vendor/nanocodex-tools/dist/workspace.d.ts +45 -0
- package/vendor/nanocodex-tools/dist/workspace.js +237 -0
- package/vendor/nanocodex-tools/package.json +122 -0
- package/vendor/nanocodex-tools/runtime/code-runtime.mjs +817 -0
- package/vendor/nanocodex-tools/runtime/tool-configuration.mjs +50 -0
- package/vendor/nanocodex-tools/runtime/tool-router.mjs +730 -0
- package/vendor/nanocodex-tools/runtime/utf8.d.mts +2 -0
- package/vendor/nanocodex-tools/runtime/utf8.mjs +25 -0
- package/vendor/nanocodex-tools/tools/artifact.d.mts +69 -0
- package/vendor/nanocodex-tools/tools/artifact.mjs +270 -0
- package/vendor/nanocodex-tools/tools/attachment.mjs +603 -0
- package/vendor/nanocodex-tools/tools/bash.d.mts +90 -0
- package/vendor/nanocodex-tools/tools/bash.mjs +742 -0
- package/vendor/nanocodex-tools/tools/dataset.d.mts +9 -0
- package/vendor/nanocodex-tools/tools/dataset.mjs +47 -0
- package/vendor/nanocodex-tools/tools/datasetContract.mjs +54 -0
- package/vendor/nanocodex-tools/tools/datasetEngine.mjs +1167 -0
- package/vendor/nanocodex-tools/tools/execution-contract.d.mts +5 -0
- package/vendor/nanocodex-tools/tools/execution-contract.mjs +63 -0
- package/vendor/nanocodex-tools/tools/hostedCatalog.d.mts +20 -0
- package/vendor/nanocodex-tools/tools/hostedCatalog.mjs +67 -0
- package/vendor/nanocodex-tools/tools/hostedMachine.d.mts +10 -0
- package/vendor/nanocodex-tools/tools/hostedMachine.mjs +56 -0
- package/vendor/nanocodex-tools/tools/just-bash-browser.d.mts +1 -0
- package/vendor/nanocodex-tools/tools/just-bash-browser.mjs +1 -0
- package/vendor/nanocodex-tools/tools/namedTool.d.mts +3 -0
- package/vendor/nanocodex-tools/tools/namedTool.mjs +3 -0
- package/vendor/nanocodex-tools/tools/nodeProcess.d.mts +10 -0
- package/vendor/nanocodex-tools/tools/nodeProcess.mjs +314 -0
- package/vendor/nanocodex-tools/tools/processOutput.mjs +56 -0
- package/vendor/nanocodex-tools/tools/repository-workspace.d.mts +55 -0
- package/vendor/nanocodex-tools/tools/repository-workspace.mjs +397 -0
- package/vendor/nanocodex-tools/tools/ssh.d.mts +56 -0
- package/vendor/nanocodex-tools/tools/ssh.mjs +503 -0
- package/vendor/nanocodex-tools/tools/standard.mjs +458 -0
- package/vendor/nanocodex-tools/tools/standardDescriptions.mjs +3 -0
- package/vendor/nanocodex-tools/tools/types.d.mts +83 -0
- package/vendor/nanocodex-tools/tools/workspace.d.mts +25 -0
- package/vendor/nanocodex-tools/tools/workspace.mjs +282 -0
- package/vendor/nanocodex-tools/tools/x.d.mts +30 -0
- package/vendor/nanocodex-tools/tools/x.mjs +91 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
import { CompactionAgentContext, CompactionEngine, CompactionResult, ManualCompactAgentContext, compactCheckpointSource } from "@deepseek-ai/dsh-compaction";
|
|
2
|
+
import { GenerateOptions, LlmAdapter, LlmModelInfo, LlmResolvedModelInfo, Message, StreamChunk, UserMessage } from "@deepseek-ai/dsh-llm";
|
|
3
|
+
import { AgentCancelCause, Session, SessionId, SessionSeq } from "@deepseek-ai/dsh-session";
|
|
4
|
+
import { KvTable } from "@deepseek-ai/dsh-storage-domain";
|
|
5
|
+
import { PromptAssembly } from "@deepseek-ai/dsh-system-prompt";
|
|
6
|
+
import { CompactionOutcome, CompactionReplacedEventPayload, HistoryItem, HistorySeed, NamedTool, SessionSnapshot, ToolDefinition } from "../vendor/nanocodex/node/index.d.mts";
|
|
7
|
+
import { CredentialRef } from "@deepseek-ai/dsh-credentials";
|
|
8
|
+
import z from "@deepseek-ai/schemastery";
|
|
9
|
+
import { AttachmentStore } from "@deepseek-ai/dsh-attachment";
|
|
10
|
+
import { Agent as Agent$1, AgentFactory, AgentHandle, AgentOptions, AgentStatus, CancelOptions, CreateAgentOptions, Inbox, ResumeAgentOptions } from "@deepseek-ai/dsh-agent";
|
|
11
|
+
import { FileSystem } from "@deepseek-ai/dsh-fs";
|
|
12
|
+
import { ToolDefinition as ToolDefinition$1, ToolExecutionResult, ToolRunContext, ToolRuntime } from "@deepseek-ai/dsh-tools";
|
|
13
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
14
|
+
//#region src/constants.d.ts
|
|
15
|
+
export declare const INTERRUPTED_TOOL_OUTPUT = "Tool execution was interrupted before a complete result was recorded. It may have had side effects; inspect the current state before retrying.";
|
|
16
|
+
export declare const PLUGIN_NAME: "dsh-nanocodex";
|
|
17
|
+
export declare const APPLY_PATCH_NAME: "apply_patch";
|
|
18
|
+
export declare const APPLY_PATCH_DESCRIPTION: "Apply a raw Codex patch to text files in the active workspace. Call apply_patch(input: string) with a complete Add File/Update File patch. Supports Add File and Update File with contextual hunks; Delete File and Move to are not supported.";
|
|
19
|
+
export declare const APPLY_PATCH_GRAMMAR: string;
|
|
20
|
+
export declare const DEFAULT_MAX_PATCH_CHARS = 4000000;
|
|
21
|
+
export declare const DEFAULT_MAX_PATCH_FILES = 64;
|
|
22
|
+
export declare const DEFAULT_MAX_PATCH_FILE_BYTES = 4000000;
|
|
23
|
+
export declare const MODEL_CONTEXT_WINDOW = 200000;
|
|
24
|
+
export declare const SUPPORTED_MODELS: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra"];
|
|
25
|
+
export type NanocodexModel = (typeof SUPPORTED_MODELS)[number];
|
|
26
|
+
export declare function isSupportedModel(value: string | undefined): value is NanocodexModel;
|
|
27
|
+
export declare function isSupportedRoute(provider: string | undefined, api: string | undefined): boolean;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/engine.d.ts
|
|
30
|
+
export interface NanocodexCompactionResult {
|
|
31
|
+
readonly summary: string;
|
|
32
|
+
readonly outcome: CompactionOutcome;
|
|
33
|
+
readonly selection: NanocodexCompactionSelection;
|
|
34
|
+
/** The engine-owned checkpoint captured immediately after installation. */
|
|
35
|
+
readonly snapshot: SessionSnapshot;
|
|
36
|
+
readonly provider: string;
|
|
37
|
+
readonly model: NanocodexModel;
|
|
38
|
+
}
|
|
39
|
+
export interface NanocodexAutomaticCompaction {
|
|
40
|
+
readonly outcome: CompactionOutcome;
|
|
41
|
+
readonly phase: CompactionReplacedEventPayload["phase"];
|
|
42
|
+
readonly afterModelCallIndex: number;
|
|
43
|
+
/** DSH surface nodes admitted to the engine at this compaction boundary. */
|
|
44
|
+
readonly admittedSurfaceSeqs: readonly SessionSeq[];
|
|
45
|
+
}
|
|
46
|
+
type NanocodexCompactionMappingBoundary = Pick<NanocodexAutomaticCompaction, "phase" | "afterModelCallIndex" | "admittedSurfaceSeqs">;
|
|
47
|
+
export interface NanocodexCompactionSelection {
|
|
48
|
+
readonly shadowedRange: {
|
|
49
|
+
readonly start: SessionSeq;
|
|
50
|
+
readonly end: SessionSeq;
|
|
51
|
+
};
|
|
52
|
+
readonly shadowedSeqs: readonly SessionSeq[];
|
|
53
|
+
}
|
|
54
|
+
export interface EngineRunResult {
|
|
55
|
+
readonly provider: string;
|
|
56
|
+
readonly model: NanocodexModel;
|
|
57
|
+
/** The exact public Nanocodex snapshot at the successful DSH boundary. */
|
|
58
|
+
readonly snapshot: SessionSnapshot;
|
|
59
|
+
/**
|
|
60
|
+
* Nanocodex may compact its private model context during a normal turn. The
|
|
61
|
+
* adapter projects the validated private checkpoint into DSH only after the
|
|
62
|
+
* turn has completed successfully.
|
|
63
|
+
*/
|
|
64
|
+
readonly automaticCompactions: readonly NanocodexAutomaticCompaction[];
|
|
65
|
+
}
|
|
66
|
+
interface SurfaceBoundary {
|
|
67
|
+
readonly replaceGeneration: number;
|
|
68
|
+
readonly surfaceSeqs: readonly SessionSeq[];
|
|
69
|
+
readonly messageCount: number;
|
|
70
|
+
readonly fingerprint: string;
|
|
71
|
+
}
|
|
72
|
+
export interface NanocodexCheckpoint {
|
|
73
|
+
readonly version: 1;
|
|
74
|
+
readonly provider: string;
|
|
75
|
+
readonly model: NanocodexModel;
|
|
76
|
+
readonly boundary: SurfaceBoundary;
|
|
77
|
+
readonly snapshot: SessionSnapshot;
|
|
78
|
+
}
|
|
79
|
+
export type NanocodexCheckpointStore = Pick<KvTable<SessionId, NanocodexCheckpoint>, "get" | "put">;
|
|
80
|
+
export declare const nanocodexCheckpointDomain: {
|
|
81
|
+
name: string;
|
|
82
|
+
version: number;
|
|
83
|
+
layout: "per-record";
|
|
84
|
+
tables: {
|
|
85
|
+
sessions: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec<SessionId, NanocodexCheckpoint>;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
/** The only provider-facing owner in the DSH Nanocodex package. */
|
|
89
|
+
export declare class NanocodexEngine {
|
|
90
|
+
private readonly ctx;
|
|
91
|
+
private readonly checkpoints;
|
|
92
|
+
private quickJsPromise;
|
|
93
|
+
private readonly requestSurfaceGeneration;
|
|
94
|
+
private readonly runtimes;
|
|
95
|
+
constructor(ctx: Context, checkpoints: NanocodexCheckpointStore);
|
|
96
|
+
private quickJs;
|
|
97
|
+
run(agent: Agent$1, previousMessages: readonly Message[], messages: readonly UserMessage[], assembly: PromptAssembly, turn: number, step: number, signal: AbortSignal, advanceStep: () => number): Promise<EngineRunResult>;
|
|
98
|
+
/** Release the retained Nanocodex host after DSH has drained the Agent. */
|
|
99
|
+
dispose(agent: Agent$1): Promise<void>;
|
|
100
|
+
/** Invalidate a runtime whose private context no longer matches DSH. */
|
|
101
|
+
invalidate(agent: Agent$1): Promise<void>;
|
|
102
|
+
/** Mark the retained runtime at the current authoritative DSH surface. */
|
|
103
|
+
markSurfaceBoundary(agent: Agent$1): void;
|
|
104
|
+
private consumeCompactionOutcome;
|
|
105
|
+
private runtimeFor;
|
|
106
|
+
/**
|
|
107
|
+
* Map Nanocodex's exact retained-tail identities to the current DSH surface.
|
|
108
|
+
* The engine owns the selection; DSH never guesses from a fixed message count.
|
|
109
|
+
*/
|
|
110
|
+
mapCompactionOutcome(agent: Pick<Agent$1, "session">, outcome: CompactionOutcome, signal: AbortSignal, mapping?: NanocodexCompactionMappingBoundary): Promise<NanocodexCompactionSelection>;
|
|
111
|
+
private resolveCompactionInstruction;
|
|
112
|
+
/** Persist the exact successful engine snapshot at the current DSH surface. */
|
|
113
|
+
persistCheckpoint(agent: Agent$1, provider: string, model: NanocodexModel, snapshot: SessionSnapshot, signal: AbortSignal): Promise<void>;
|
|
114
|
+
private createNodeAgent;
|
|
115
|
+
private closeRuntime;
|
|
116
|
+
/** Run custom compaction on the already-live Nanocodex runtime. */
|
|
117
|
+
compact(agent: Agent$1, signal: AbortSignal): Promise<NanocodexCompactionResult>;
|
|
118
|
+
private appendRequestFacts;
|
|
119
|
+
private appendToolResult;
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/agent.d.ts
|
|
123
|
+
/**
|
|
124
|
+
* DSH's public Agent handle backed by Nanocodex turns. DSH owns the queue and
|
|
125
|
+
* durable log; each model step is hydrated from the active surface.
|
|
126
|
+
*/
|
|
127
|
+
export declare class NanocodexAgent implements Agent$1 {
|
|
128
|
+
readonly id: Agent$1["id"];
|
|
129
|
+
readonly options: AgentOptions;
|
|
130
|
+
readonly session: Session;
|
|
131
|
+
readonly inbox: Inbox;
|
|
132
|
+
readonly ctx: Context;
|
|
133
|
+
private readonly loopCtx;
|
|
134
|
+
private readonly engine;
|
|
135
|
+
private readonly scope;
|
|
136
|
+
private readonly dispatch;
|
|
137
|
+
private phase;
|
|
138
|
+
private activityDone;
|
|
139
|
+
private runtimeContextText;
|
|
140
|
+
constructor(loopCtx: Context, id: Agent$1["id"], options: AgentOptions, session: Session, engine: NanocodexEngine);
|
|
141
|
+
get status(): AgentStatus;
|
|
142
|
+
send(message: UserMessage, target: "next-turn" | "next-step", wakeup: boolean): void;
|
|
143
|
+
followup(message: UserMessage): void;
|
|
144
|
+
steer(message: UserMessage): void;
|
|
145
|
+
inject(message: UserMessage): void;
|
|
146
|
+
cancel(cause: AgentCancelCause, options?: CancelOptions): void;
|
|
147
|
+
whenIdle(): Promise<void>;
|
|
148
|
+
private waitForIdle;
|
|
149
|
+
runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>;
|
|
150
|
+
wakeDriver(wakeAfterAbort?: boolean): void;
|
|
151
|
+
dispose(): Promise<void>;
|
|
152
|
+
private kick;
|
|
153
|
+
private preStep;
|
|
154
|
+
private turn;
|
|
155
|
+
private findRuntimeContext;
|
|
156
|
+
private projectRuntimeContext;
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/compaction-engine.d.ts
|
|
160
|
+
type CommandId = NonNullable<Parameters<typeof compactCheckpointSource>[1]>;
|
|
161
|
+
/**
|
|
162
|
+
* Minimal DSH compaction owner. The checkpoint is model-private and lands only
|
|
163
|
+
* as the normal non-expandable compact checkpoint message. The selected range
|
|
164
|
+
* and all transaction markers remain fully durable in DSH's event log.
|
|
165
|
+
*/
|
|
166
|
+
export declare class NanocodexCompactionEngine extends CompactionEngine {
|
|
167
|
+
private readonly engine;
|
|
168
|
+
constructor(ctx: Context, engine: NanocodexEngine);
|
|
169
|
+
compactIfNeeded(agent: CompactionAgentContext, _trigger: "pressure" | "context-overflow", signal: AbortSignal): Promise<CompactionResult | null>;
|
|
170
|
+
compactNow(agent: ManualCompactAgentContext, signal: AbortSignal, sourceCommandId?: CommandId): Promise<CompactionResult | null>;
|
|
171
|
+
compactRegion(start: SessionSeq, end: SessionSeq, agent: CompactionAgentContext, signal?: AbortSignal): Promise<CompactionResult>;
|
|
172
|
+
/**
|
|
173
|
+
* Commit a summary produced by Nanocodex's automatic private compaction.
|
|
174
|
+
* Nanocodex owns the model call; DSH still owns the durable surface and the
|
|
175
|
+
* non-expandable checkpoint visible to Companion.
|
|
176
|
+
*/
|
|
177
|
+
commitAutomaticSummary(agent: CompactionAgentContext, automatic: NanocodexAutomaticCompaction, signal: AbortSignal): Promise<CompactionResult>;
|
|
178
|
+
private compactSelection;
|
|
179
|
+
private beginCompaction;
|
|
180
|
+
private endFailedCompaction;
|
|
181
|
+
private commitSummary;
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/factory.d.ts
|
|
185
|
+
/** AgentFactory implementation installed by the selected Cordis row. */
|
|
186
|
+
export declare class NanocodexFactory implements AgentFactory {
|
|
187
|
+
private readonly ctx;
|
|
188
|
+
private readonly engine;
|
|
189
|
+
private readonly live;
|
|
190
|
+
private closed;
|
|
191
|
+
constructor(ctx: Context, engine: NanocodexEngine);
|
|
192
|
+
createAgent(ownerCtx: Context, options: CreateAgentOptions): Promise<AgentHandle>;
|
|
193
|
+
resume(ownerCtx: Context, options: ResumeAgentOptions): Promise<AgentHandle>;
|
|
194
|
+
disposeAll(): Promise<void>;
|
|
195
|
+
private publish;
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/history.d.ts
|
|
199
|
+
export interface HistoryContext {
|
|
200
|
+
readonly attachments: AttachmentStore;
|
|
201
|
+
}
|
|
202
|
+
/** Pi Responses IDs store call_id|item_id; only the call part pairs results. */
|
|
203
|
+
export declare function historyToolCallId(value: string): string;
|
|
204
|
+
export interface HistoryProjectionItem {
|
|
205
|
+
readonly message: Message;
|
|
206
|
+
readonly item: HistoryItem;
|
|
207
|
+
}
|
|
208
|
+
export interface HistoryProjection extends HistorySeed {
|
|
209
|
+
readonly items: readonly HistoryProjectionItem[];
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Convert the authoritative active DSH surface to Nanocodex's typed history.
|
|
213
|
+
* Tool calls are represented as history items only; no handler is invoked while
|
|
214
|
+
* hydrating a session.
|
|
215
|
+
*/
|
|
216
|
+
export declare function buildHistoryProjection(messages: readonly Message[], ctx: HistoryContext, signal?: AbortSignal): Promise<HistoryProjection>;
|
|
217
|
+
export declare function buildHistorySeed(messages: readonly Message[], ctx: HistoryContext, signal?: AbortSignal): Promise<HistorySeed>;
|
|
218
|
+
export interface PromptInputContext {
|
|
219
|
+
readonly attachments: AttachmentStore;
|
|
220
|
+
}
|
|
221
|
+
export type NanocodexPromptItem = {
|
|
222
|
+
readonly type: "text";
|
|
223
|
+
readonly text: string;
|
|
224
|
+
} | {
|
|
225
|
+
readonly type: "image";
|
|
226
|
+
readonly image_url: string;
|
|
227
|
+
readonly detail: "auto";
|
|
228
|
+
};
|
|
229
|
+
/** Convert newly admitted DSH user content into one Nanocodex prompt. */
|
|
230
|
+
export declare function buildPromptInput(messages: readonly Message[], ctx: PromptInputContext, signal?: AbortSignal): Promise<string | readonly NanocodexPromptItem[]>;
|
|
231
|
+
export declare function plainText(messages: readonly Message[]): string;
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/llm-adapter.d.ts
|
|
234
|
+
/** Native DSH model-catalog adapter for the Nanocodex-owned routes. */
|
|
235
|
+
export declare class NanocodexLlmAdapter extends LlmAdapter {
|
|
236
|
+
private readonly ctx;
|
|
237
|
+
constructor(ctx: Context);
|
|
238
|
+
providerInfo(provider: string): {
|
|
239
|
+
id: "openai" | "openai-codex-responses";
|
|
240
|
+
name: string;
|
|
241
|
+
};
|
|
242
|
+
listModels(provider: string): Promise<readonly LlmModelInfo[]>;
|
|
243
|
+
resolveModel(provider: string, model: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
244
|
+
/**
|
|
245
|
+
* The retained session-title consumer uses this one-shot path. Ordinary
|
|
246
|
+
* conversation turns remain owned by NanocodexAgent/NanocodexEngine and do
|
|
247
|
+
* not recurse through DSH's LLM runtime.
|
|
248
|
+
*/
|
|
249
|
+
stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
250
|
+
private streamOneShot;
|
|
251
|
+
}
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/settings.d.ts
|
|
254
|
+
export declare const SETTINGS_NAMESPACE: "llm-pi-ai";
|
|
255
|
+
export declare const SUPPORTED_PROVIDERS: readonly ["openai", "openai-codex-responses"];
|
|
256
|
+
export type NanocodexProvider = (typeof SUPPORTED_PROVIDERS)[number];
|
|
257
|
+
/** The small part of the retired pi-ai profile that the adapter consumes. */
|
|
258
|
+
export interface NanocodexProviderProfile {
|
|
259
|
+
readonly apiKeyEnv?: string;
|
|
260
|
+
readonly api?: string;
|
|
261
|
+
readonly baseURL?: string;
|
|
262
|
+
readonly websocketURL?: string;
|
|
263
|
+
readonly reasoning?: string;
|
|
264
|
+
}
|
|
265
|
+
export interface NanocodexSettings {
|
|
266
|
+
readonly providers: Record<string, NanocodexProviderProfile>;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Keep the existing settings namespace and profile shape readable by DSH
|
|
270
|
+
* configuration surfaces while accepting fields owned by older pi-ai
|
|
271
|
+
* profiles. Nanocodex intentionally validates only the route fields it can
|
|
272
|
+
* act on at request admission.
|
|
273
|
+
*/
|
|
274
|
+
export declare const NanocodexSettingsSchema: z<NanocodexSettings>;
|
|
275
|
+
export declare function configuredNanocodexProviders(value: NanocodexSettings): NanocodexProvider[];
|
|
276
|
+
export interface ResolvedNanocodexRoute {
|
|
277
|
+
readonly provider: string;
|
|
278
|
+
readonly model: NanocodexModel;
|
|
279
|
+
readonly apiKey: string;
|
|
280
|
+
readonly apiBaseUrl?: string;
|
|
281
|
+
readonly websocketUrl?: string;
|
|
282
|
+
readonly thinking?: "none" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
283
|
+
}
|
|
284
|
+
export interface SettingsContext {
|
|
285
|
+
readonly settings: {
|
|
286
|
+
get(namespace: string): unknown;
|
|
287
|
+
};
|
|
288
|
+
readonly credentials: {
|
|
289
|
+
resolve(ref: CredentialRef): Promise<{
|
|
290
|
+
value: string;
|
|
291
|
+
} | undefined>;
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
export declare function supportedThinking(value: string | undefined): "none" | "low" | "medium" | "high" | "xhigh" | "max" | "pro" | undefined;
|
|
295
|
+
/** Resolve one explicit DSH route without provider or credential fallbacks. */
|
|
296
|
+
export declare function resolveNanocodexRoute(ctx: SettingsContext, options: AgentOptions): Promise<ResolvedNanocodexRoute>;
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/session-id.d.ts
|
|
299
|
+
/** Convert the DSH `session-<UUID>` identity to Nanocodex's UUID identity. */
|
|
300
|
+
export declare function normalizeNanocodexSessionId(value: string): string;
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/tool-bridge.d.ts
|
|
303
|
+
export interface ToolBridgeCallbacks {
|
|
304
|
+
onCall(call: {
|
|
305
|
+
readonly id: string;
|
|
306
|
+
readonly name: string;
|
|
307
|
+
readonly arguments: string;
|
|
308
|
+
readonly parentCallId?: string;
|
|
309
|
+
}): SessionSeq | undefined | Promise<SessionSeq | undefined>;
|
|
310
|
+
onResult(call: {
|
|
311
|
+
readonly id: string;
|
|
312
|
+
readonly callSeq: SessionSeq | undefined;
|
|
313
|
+
readonly result: ToolExecutionResult;
|
|
314
|
+
readonly parentCallId?: string;
|
|
315
|
+
}): void | Promise<void>;
|
|
316
|
+
}
|
|
317
|
+
export interface ToolBridgeContext {
|
|
318
|
+
readonly tools: ToolRuntime;
|
|
319
|
+
readonly agent: Agent$1;
|
|
320
|
+
readonly callbacks: ToolBridgeCallbacks;
|
|
321
|
+
readonly signal: AbortSignal;
|
|
322
|
+
/** Provider-native definitions for tools whose wire input is not JSON. */
|
|
323
|
+
readonly customDefinitions?: ReadonlyMap<string, ToolDefinition>;
|
|
324
|
+
}
|
|
325
|
+
/** Build one model-facing tool set from the active DSH scope. */
|
|
326
|
+
export declare function createToolBridge(context: ToolBridgeContext): NamedTool[];
|
|
327
|
+
export type ToolBridge = ReturnType<typeof createToolBridge>;
|
|
328
|
+
//#endregion
|
|
329
|
+
//#region src/apply-patch/types.d.ts
|
|
330
|
+
/** The deliberately small operation set accepted by the direct Codex tool. */
|
|
331
|
+
type PatchOperation = AddFileOperation | UpdateFileOperation;
|
|
332
|
+
interface AddFileOperation {
|
|
333
|
+
readonly kind: "add";
|
|
334
|
+
readonly path: string;
|
|
335
|
+
content: string;
|
|
336
|
+
readonly line: number;
|
|
337
|
+
}
|
|
338
|
+
interface UpdateFileOperation {
|
|
339
|
+
readonly kind: "update";
|
|
340
|
+
readonly path: string;
|
|
341
|
+
chunks: UpdateChunk[];
|
|
342
|
+
readonly line: number;
|
|
343
|
+
}
|
|
344
|
+
interface UpdateChunk {
|
|
345
|
+
readonly changeContext?: string;
|
|
346
|
+
readonly oldLines: string[];
|
|
347
|
+
readonly newLines: string[];
|
|
348
|
+
readonly contextLineIndices: Array<readonly [oldIndex: number, newIndex: number]>;
|
|
349
|
+
isEndOfFile: boolean;
|
|
350
|
+
readonly line: number;
|
|
351
|
+
}
|
|
352
|
+
interface ParsedPatch {
|
|
353
|
+
readonly operations: PatchOperation[];
|
|
354
|
+
readonly normalizedPatch: string;
|
|
355
|
+
}
|
|
356
|
+
interface PresentationDiff {
|
|
357
|
+
readonly path: string;
|
|
358
|
+
readonly oldText: string | null;
|
|
359
|
+
readonly newText: string;
|
|
360
|
+
}
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region src/apply-patch/tool.d.ts
|
|
363
|
+
interface ApplyPatchLimits {
|
|
364
|
+
readonly maxPatchChars: number;
|
|
365
|
+
readonly maxPatchFiles: number;
|
|
366
|
+
readonly maxPatchFileBytes: number;
|
|
367
|
+
}
|
|
368
|
+
interface ApplyPatchServices {
|
|
369
|
+
readonly fs: FileSystem;
|
|
370
|
+
readonly ctx: Context;
|
|
371
|
+
}
|
|
372
|
+
type PatchOperationStatus = "committed" | "failed" | "unattempted";
|
|
373
|
+
interface PatchOperationOutcome {
|
|
374
|
+
readonly path: string;
|
|
375
|
+
readonly action: "add" | "update";
|
|
376
|
+
readonly status: PatchOperationStatus;
|
|
377
|
+
readonly error?: {
|
|
378
|
+
readonly code: string;
|
|
379
|
+
readonly message: string;
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
interface ApplyPatchOutcome {
|
|
383
|
+
readonly status: "applied" | "partial" | "failed" | "cancelled";
|
|
384
|
+
readonly summary: string;
|
|
385
|
+
readonly diff: string;
|
|
386
|
+
readonly operations: PatchOperationOutcome[];
|
|
387
|
+
readonly diffs: PresentationDiff[];
|
|
388
|
+
readonly error?: {
|
|
389
|
+
readonly code: string;
|
|
390
|
+
readonly message: string;
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
interface PatchProgress {
|
|
394
|
+
readonly outcome: ApplyPatchOutcome;
|
|
395
|
+
}
|
|
396
|
+
type PatchExecution = Pick<ToolRunContext, "agent" | "signal">;
|
|
397
|
+
/**
|
|
398
|
+
* Preflight and publish a supported Codex patch through the DSH filesystem.
|
|
399
|
+
*
|
|
400
|
+
* Every operation is resolved, observed, read, matched, and calculated before
|
|
401
|
+
* the first guarded atomic write. Publication is ordered and intentionally
|
|
402
|
+
* non-transactional: a later failure leaves committed earlier files in place
|
|
403
|
+
* and returns their diffs with explicit per-operation progress.
|
|
404
|
+
*/
|
|
405
|
+
export declare function applyPatchToFileSystem(input: string, services: ApplyPatchServices, exec: PatchExecution, limits?: ApplyPatchLimits): Promise<ApplyPatchOutcome>;
|
|
406
|
+
/** Build the registry definition for the direct raw patch tool. */
|
|
407
|
+
export declare function createApplyPatchTool(services: ApplyPatchServices, progressByExecution: WeakMap<object, PatchProgress>, limits?: ApplyPatchLimits): ToolDefinition$1;
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/apply-patch/errors.d.ts
|
|
410
|
+
type PatchErrorCode = "PATCH_INVALID" | "PATCH_UNSUPPORTED" | "PATCH_CONTEXT_NOT_FOUND" | "PATCH_TOO_LARGE" | "PATCH_PATH_INVALID";
|
|
411
|
+
export declare class PatchError extends Error {
|
|
412
|
+
readonly code: PatchErrorCode;
|
|
413
|
+
readonly line?: number;
|
|
414
|
+
constructor(message: string, code: PatchErrorCode, options?: ErrorOptions & {
|
|
415
|
+
line?: number;
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/apply-patch/matcher.d.ts
|
|
420
|
+
/** Codex's exact, trimmed, and Unicode-normalized context matching order. */
|
|
421
|
+
export declare function seekSequence(lines: readonly string[], pattern: readonly string[], start: number, atEnd: boolean): number | undefined;
|
|
422
|
+
/** Apply update chunks entirely in memory before a filesystem write. */
|
|
423
|
+
export declare function applyChunks(content: string, path: string, chunks: readonly UpdateChunk[]): string;
|
|
424
|
+
//#endregion
|
|
425
|
+
//#region src/apply-patch/parser.d.ts
|
|
426
|
+
/** Parse the supported Add File and Update File Codex patch subset. */
|
|
427
|
+
export declare function parsePatch(input: string): ParsedPatch;
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region src/index.d.ts
|
|
430
|
+
export declare const name: "dsh-nanocodex";
|
|
431
|
+
export declare const inject: readonly ["agents", "sessions", "settings", "credentials", "llm", "attachments", "commands", "systemPrompt", "tools", "fs", "storageDomain"];
|
|
432
|
+
/** Install the selected Nanocodex AgentFactory and private compaction owner. */
|
|
433
|
+
export declare function apply(ctx: Context): Promise<void>;
|
|
434
|
+
//#endregion
|
|
435
|
+
export type { ApplyPatchLimits, ApplyPatchOutcome, PatchOperationOutcome };
|