diff --git a/.sandcastle/package-lock.json b/.sandcastle/package-lock.json index e998bfa..6c38bcd 100644 --- a/.sandcastle/package-lock.json +++ b/.sandcastle/package-lock.json @@ -8,7 +8,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@ai-hero/sandcastle": "^0.10.0", + "@ai-hero/sandcastle": "^0.12.0", "headroom-ai": "^0.1.0" }, "devDependencies": { @@ -19,9 +19,9 @@ } }, "node_modules/@ai-hero/sandcastle": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@ai-hero/sandcastle/-/sandcastle-0.10.0.tgz", - "integrity": "sha512-7iUX90cF/RWP80OfcOf/1fkJyoPRAJo4ICyttpWWokKoFGGnuQ82lvxKpU3IEiWPbwT/g8O2PotTzgiimtQT7g==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@ai-hero/sandcastle/-/sandcastle-0.12.0.tgz", + "integrity": "sha512-kdQ414rM8t1QiWeqZ3Klz4KSd0PqQG4bRVuqGpRDUomWhojSZkEAc1tbcEcThVmBEaHkCt8LmYR49vqEPNIoYQ==", "license": "MIT", "dependencies": { "@clack/prompts": "^1.1.0" diff --git a/.sandcastle/package.json b/.sandcastle/package.json index 03007f8..c66a2a7 100644 --- a/.sandcastle/package.json +++ b/.sandcastle/package.json @@ -18,7 +18,7 @@ "typescript": "^6.0.3" }, "dependencies": { - "@ai-hero/sandcastle": "^0.10.0", + "@ai-hero/sandcastle": "^0.12.0", "headroom-ai": "^0.1.0" } } diff --git a/.sandcastle/patches/@ai-hero+sandcastle+0.10.0.patch b/.sandcastle/patches/@ai-hero+sandcastle+0.10.0.patch deleted file mode 100644 index ce1167c..0000000 --- a/.sandcastle/patches/@ai-hero+sandcastle+0.10.0.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/node_modules/@ai-hero/sandcastle/dist/index.d.ts b/node_modules/@ai-hero/sandcastle/dist/index.d.ts -index e6b1b0d..3c40e71 100644 ---- a/node_modules/@ai-hero/sandcastle/dist/index.d.ts -+++ b/node_modules/@ai-hero/sandcastle/dist/index.d.ts -@@ -308,6 +308,15 @@ interface IterationResult { - */ - type PromptArgs = Record; - -+/** -+ * Prompt compression callback — invoked after prompt file resolution and {{KEY}} -+ * argument substitution, returning compressed text before the prompt reaches the agent. -+ * The callback must return valid (possibly compressed) text that the agent can parse; -+ * Sandcastle does not validate it. Useful for integrating with headroom-ai or other -+ * compression layers: `promptCompression: (prompt) => compress(prompt).compressed`. -+ */ -+type PromptCompression = (prompt: string) => string | Promise; -+ - /** Branded output definition for `Output.object({ tag, schema })`. */ - interface OutputObjectDefinition { - readonly _tag: "object"; -@@ -551,6 +560,12 @@ interface RunOptions { - * See ADR 0010 for design rationale. - */ - readonly output?: OutputDefinition; -+ /** -+ * Prompt compression callback invoked after {{KEY}} argument substitution, -+ * before the prompt reaches the agent. Return compressed text that the agent -+ * can still parse. Useful for integrating with headroom-ai or other layers. -+ */ -+ readonly promptCompression?: PromptCompression; - } - - type ResumeRunResultOptions = Omit; -@@ -729,6 +744,11 @@ interface SandboxRunOptions { - * with a fresh signal, or `.close()` to tear down. - */ - readonly signal?: AbortSignal; -+ /** -+ * Prompt compression callback invoked after {{KEY}} substitution, before the -+ * prompt reaches the agent. Return compressed text that the agent can still parse. -+ */ -+ readonly promptCompression?: PromptCompression; - } - interface SandboxRunResult { - /** Per-iteration results (use `iterations.length` for the count). */ -@@ -888,6 +908,11 @@ interface WorktreeRunOptions { - * - The `Worktree` handle remains usable for subsequent operations. - */ - readonly signal?: AbortSignal; -+ /** -+ * Prompt compression callback invoked after {{KEY}} substitution, before the -+ * prompt reaches the agent. Return compressed text that the agent can still parse. -+ */ -+ readonly promptCompression?: PromptCompression; - } - interface WorktreeRunResult { - /** Per-iteration results (use `iterations.length` for the count). */ -@@ -963,4 +988,4 @@ interface CwdError extends Error { - /** The provided `cwd` path does not exist or is not a directory. */ - declare const CwdError: CwdErrorConstructor; - --export { type AgentCommandOptions, type AgentProvider, type AgentStreamEvent, AnySandboxProvider, BindMountSandboxHandle, BranchStrategy, type ClaudeCodeOptions, type CloseResult, type CodexOptions, type CopilotOptions, type CreateSandboxOptions, type CreateWorktreeOptions, type CursorOptions, CwdError, type HostSessionLookup, type InteractiveOptions, type InteractiveResult, type IterationResult, type IterationUsage, type LoggingOption, MergeToHeadBranchStrategy, NamedBranchStrategy, type OpenCodeOptions, Output, type OutputDefinition, type OutputObjectDefinition, type OutputStringDefinition, type PiOptions, type PrintCommand, type PromptArgs, type RunOptions, type RunResult, type Sandbox, type SandboxHooks, type SandboxInteractiveOptions, type SandboxInteractiveResult, SandboxProvider, type SandboxRunOptions, type SandboxRunResult, StructuredOutputError, type Timeouts, type Worktree, type WorktreeBranchStrategy, type WorktreeCreateSandboxOptions, type WorktreeInteractiveOptions, type WorktreeRunOptions, type WorktreeRunResult, claudeCode, claudeHostSessionPath, claudeSandboxSessionPath, codex, copilot, createSandbox, createWorktree, cursor, encodeProjectPath, findClaudeSessionOnHost, findCodexSessionOnHost, interactive, opencode, pi, run, transferClaudeSession, transferCodexSession }; -+export { type AgentCommandOptions, type AgentProvider, type AgentStreamEvent, AnySandboxProvider, BindMountSandboxHandle, BranchStrategy, type ClaudeCodeOptions, type CloseResult, type CodexOptions, type CopilotOptions, type CreateSandboxOptions, type CreateWorktreeOptions, type CursorOptions, CwdError, type HostSessionLookup, type InteractiveOptions, type InteractiveResult, type IterationResult, type IterationUsage, type LoggingOption, MergeToHeadBranchStrategy, NamedBranchStrategy, type OpenCodeOptions, Output, type OutputDefinition, type OutputObjectDefinition, type OutputStringDefinition, type PiOptions, type PrintCommand, type PromptArgs, type PromptCompression, type RunOptions, type RunResult, type Sandbox, type SandboxHooks, type SandboxInteractiveOptions, type SandboxInteractiveResult, SandboxProvider, type SandboxRunOptions, type SandboxRunResult, StructuredOutputError, type Timeouts, type Worktree, type WorktreeBranchStrategy, type WorktreeCreateSandboxOptions, type WorktreeInteractiveOptions, type WorktreeRunOptions, type WorktreeRunResult, claudeCode, claudeHostSessionPath, claudeSandboxSessionPath, codex, copilot, createSandbox, createWorktree, cursor, encodeProjectPath, findClaudeSessionOnHost, findCodexSessionOnHost, interactive, opencode, pi, run, transferClaudeSession, transferCodexSession };