@cjhyy/code-shell-core 0.6.0-rc.8 → 0.7.0-beta.1
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/THIRD_PARTY_NOTICES.md +206 -0
- package/dist/automation/scheduler.d.ts +13 -7
- package/dist/automation/scheduler.js +116 -37
- package/dist/capability-control/service.d.ts +2 -0
- package/dist/capability-control/service.js +4 -2
- package/dist/cc-orchestrator/agent-adapter.d.ts +2 -0
- package/dist/cc-orchestrator/agent-adapter.js +7 -1
- package/dist/cc-orchestrator/codex-session-history.js +1 -1
- package/dist/cc-orchestrator/cwd-normalize.d.ts +2 -0
- package/dist/cc-orchestrator/cwd-normalize.js +19 -0
- package/dist/cc-orchestrator/external-agent-bindings.d.ts +27 -0
- package/dist/cc-orchestrator/external-agent-bindings.js +150 -0
- package/dist/cc-orchestrator/external-agent-driver.d.ts +1 -0
- package/dist/cc-orchestrator/external-agent-driver.js +102 -51
- package/dist/cc-orchestrator/external-agent-session-store.d.ts +23 -0
- package/dist/cc-orchestrator/external-agent-session-store.js +146 -0
- package/dist/cc-orchestrator/session-history.js +2 -2
- package/dist/cli/agent-server-stdio.js +9 -2
- package/dist/context/compaction.d.ts +38 -1
- package/dist/context/compaction.js +138 -0
- package/dist/context/manager.d.ts +34 -2
- package/dist/context/manager.js +254 -58
- package/dist/context/token-counter.js +13 -0
- package/dist/credentials/access.d.ts +56 -0
- package/dist/credentials/access.js +183 -0
- package/dist/credentials/index.d.ts +1 -0
- package/dist/credentials/index.js +1 -0
- package/dist/credentials/inject-credential-tool.d.ts +3 -1
- package/dist/credentials/inject-credential-tool.js +30 -11
- package/dist/credentials/types.d.ts +2 -2
- package/dist/credentials/use-credential-tool.d.ts +9 -1
- package/dist/credentials/use-credential-tool.js +58 -45
- package/dist/engine/engine.d.ts +38 -12
- package/dist/engine/engine.js +477 -163
- package/dist/engine/image-policy.d.ts +6 -0
- package/dist/engine/image-policy.js +17 -6
- package/dist/engine/input-attachments.d.ts +13 -0
- package/dist/engine/input-attachments.js +255 -0
- package/dist/engine/model-facade.d.ts +5 -2
- package/dist/engine/model-facade.js +6 -16
- package/dist/engine/parse-task.d.ts +10 -0
- package/dist/engine/parse-task.js +5 -0
- package/dist/engine/query.js +2 -0
- package/dist/engine/session-usage.d.ts +12 -0
- package/dist/engine/session-usage.js +56 -0
- package/dist/engine/steer-queue.d.ts +2 -1
- package/dist/engine/steer-queue.js +2 -2
- package/dist/engine/streaming-tool-queue.d.ts +11 -7
- package/dist/engine/streaming-tool-queue.js +11 -7
- package/dist/engine/turn-loop.d.ts +34 -2
- package/dist/engine/turn-loop.js +269 -52
- package/dist/engine/types.d.ts +8 -0
- package/dist/git/worktree/crud.d.ts +69 -0
- package/dist/git/worktree/crud.js +206 -0
- package/dist/git/worktree/diff.d.ts +14 -0
- package/dist/git/worktree/diff.js +82 -0
- package/dist/git/worktree/git-exec.d.ts +7 -0
- package/dist/git/worktree/git-exec.js +51 -0
- package/dist/git/worktree/index.d.ts +5 -0
- package/dist/git/worktree/index.js +5 -0
- package/dist/git/worktree/query.d.ts +42 -0
- package/dist/git/worktree/query.js +121 -0
- package/dist/git/worktree/slug.d.ts +11 -0
- package/dist/git/worktree/slug.js +58 -0
- package/dist/git/worktree.d.ts +1 -84
- package/dist/git/worktree.js +5 -230
- package/dist/index.d.ts +31 -28
- package/dist/index.js +27 -25
- package/dist/logging/logger.js +6 -6
- package/dist/logging/sanitize-messages.d.ts +10 -2
- package/dist/logging/sanitize-messages.js +21 -6
- package/dist/plugins/installer/checkUpdate.d.ts +4 -1
- package/dist/plugins/installer/checkUpdate.js +4 -2
- package/dist/plugins/installer/install.js +2 -0
- package/dist/plugins/installer/installFromSource.js +9 -1
- package/dist/plugins/installer/parseSource.d.ts +4 -1
- package/dist/plugins/installer/parseSource.js +28 -10
- package/dist/plugins/installer/sourcePath.d.ts +9 -0
- package/dist/plugins/installer/sourcePath.js +50 -0
- package/dist/plugins/installer/update.d.ts +4 -1
- package/dist/plugins/installer/update.js +5 -3
- package/dist/plugins/parseMarketplaceInput.d.ts +4 -1
- package/dist/plugins/parseMarketplaceInput.js +4 -3
- package/dist/plugins/pluginInstaller.js +24 -22
- package/dist/preset/index.d.ts +1 -0
- package/dist/preset/index.js +16 -9
- package/dist/prompt/sections/base.md +1 -1
- package/dist/protocol/chat-session-manager.d.ts +2 -0
- package/dist/protocol/chat-session-manager.js +38 -2
- package/dist/protocol/chat-session.d.ts +5 -0
- package/dist/protocol/chat-session.js +2 -0
- package/dist/protocol/client.d.ts +13 -5
- package/dist/protocol/client.js +26 -3
- package/dist/protocol/server.d.ts +43 -12
- package/dist/protocol/server.js +326 -104
- package/dist/protocol/types.d.ts +51 -0
- package/dist/protocol/types.js +6 -0
- package/dist/run/FileRunStore.js +10 -1
- package/dist/run/Heartbeat.js +12 -0
- package/dist/run/RunApprovalBackend.d.ts +3 -0
- package/dist/run/RunApprovalBackend.js +41 -6
- package/dist/run/RunLock.js +2 -0
- package/dist/run/RunManager.d.ts +2 -0
- package/dist/run/RunManager.js +64 -24
- package/dist/run/ids.d.ts +2 -0
- package/dist/run/ids.js +23 -0
- package/dist/runtime/background-shell.d.ts +1 -0
- package/dist/runtime/background-shell.js +23 -13
- package/dist/runtime/safe-spawn.js +74 -11
- package/dist/runtime/spawn-common.js +10 -0
- package/dist/services/auto-dream.d.ts +15 -4
- package/dist/services/auto-dream.js +20 -20
- package/dist/services/dream-consolidation.d.ts +2 -3
- package/dist/services/dream-consolidation.js +65 -15
- package/dist/services/extract-memories.d.ts +14 -5
- package/dist/services/extract-memories.js +20 -3
- package/dist/services/global-dream-promotion.d.ts +23 -0
- package/dist/services/global-dream-promotion.js +112 -0
- package/dist/services/memory-orchestrator.js +347 -34
- package/dist/session/memory.d.ts +61 -18
- package/dist/session/memory.js +342 -79
- package/dist/session/session-manager.d.ts +35 -1
- package/dist/session/session-manager.js +197 -4
- package/dist/session/transcript.d.ts +5 -1
- package/dist/session/transcript.js +38 -5
- package/dist/settings/manager.d.ts +1 -0
- package/dist/settings/manager.js +87 -37
- package/dist/settings/schema-export.d.ts +2 -3
- package/dist/settings/schema-export.js +2 -3
- package/dist/settings/schema.d.ts +21 -0
- package/dist/settings/schema.js +12 -0
- package/dist/skills/scanner.d.ts +3 -2
- package/dist/skills/scanner.js +12 -9
- package/dist/tool-system/builtin/background-jobs.d.ts +10 -1
- package/dist/tool-system/builtin/background-jobs.js +12 -1
- package/dist/tool-system/builtin/background-work.d.ts +17 -18
- package/dist/tool-system/builtin/background-work.js +51 -5
- package/dist/tool-system/builtin/config.d.ts +2 -1
- package/dist/tool-system/builtin/config.js +16 -11
- package/dist/tool-system/builtin/drive-claude-code.d.ts +16 -2
- package/dist/tool-system/builtin/drive-claude-code.js +301 -47
- package/dist/tool-system/builtin/edit.js +5 -2
- package/dist/tool-system/builtin/generate-video.d.ts +1 -0
- package/dist/tool-system/builtin/generate-video.js +13 -4
- package/dist/tool-system/builtin/index.d.ts +8 -3
- package/dist/tool-system/builtin/index.js +37 -21
- package/dist/tool-system/builtin/lsp.d.ts +2 -1
- package/dist/tool-system/builtin/lsp.js +6 -3
- package/dist/tool-system/builtin/memory.js +40 -8
- package/dist/tool-system/builtin/notebook-edit.js +5 -2
- package/dist/tool-system/builtin/powershell.d.ts +5 -2
- package/dist/tool-system/builtin/powershell.js +11 -7
- package/dist/tool-system/builtin/read.js +118 -6
- package/dist/tool-system/builtin/view-image.d.ts +2 -2
- package/dist/tool-system/builtin/view-image.js +109 -19
- package/dist/tool-system/builtin/worktree.d.ts +4 -4
- package/dist/tool-system/builtin/worktree.js +297 -74
- package/dist/tool-system/builtin/write.js +5 -3
- package/dist/tool-system/context.d.ts +23 -1
- package/dist/tool-system/executor.d.ts +1 -5
- package/dist/tool-system/executor.js +94 -115
- package/dist/tool-system/mcp-manager.d.ts +18 -5
- package/dist/tool-system/mcp-manager.js +157 -74
- package/dist/tool-system/mcp-stdio-diagnostics.d.ts +9 -0
- package/dist/tool-system/mcp-stdio-diagnostics.js +93 -0
- package/dist/tool-system/path-policy.d.ts +2 -0
- package/dist/tool-system/path-policy.js +41 -12
- package/dist/tool-system/permission.d.ts +28 -7
- package/dist/tool-system/permission.js +130 -49
- package/dist/tool-system/registry.js +11 -4
- package/dist/tool-system/tool-result-redaction.d.ts +7 -0
- package/dist/tool-system/tool-result-redaction.js +48 -0
- package/dist/tool-system/workspace-bridge.d.ts +11 -0
- package/dist/tool-system/workspace-bridge.js +1 -0
- package/dist/types.d.ts +86 -5
- package/dist/utils/toolDisplay.js +1 -1
- package/package.json +4 -3
package/dist/engine/engine.d.ts
CHANGED
|
@@ -6,14 +6,17 @@ import { ToolRegistry } from "../tool-system/registry.js";
|
|
|
6
6
|
import { type BuiltinToolFn } from "../tool-system/builtin/index.js";
|
|
7
7
|
import { HookRegistry } from "../hooks/registry.js";
|
|
8
8
|
import { type GoalConfig, type GoalExtension } from "./goal.js";
|
|
9
|
+
import { type CompactStrategy } from "../context/manager.js";
|
|
9
10
|
import { SessionManager } from "../session/session-manager.js";
|
|
10
11
|
import type { AskUserFn } from "../tool-system/builtin/ask-user.js";
|
|
11
12
|
import type { CapabilityOverride } from "../settings/schema.js";
|
|
12
13
|
import { type FeatureFlagName } from "../settings/feature-flags.js";
|
|
13
14
|
import type { ToolContext } from "../tool-system/context.js";
|
|
15
|
+
import { type SandboxBackend } from "../tool-system/sandbox/index.js";
|
|
14
16
|
import { ModelPool, type ModelEntry } from "../llm/model-pool.js";
|
|
15
17
|
import { AgentDefinitionRegistry } from "../agent/agent-definition-registry.js";
|
|
16
18
|
import { EngineRuntime } from "./runtime.js";
|
|
19
|
+
import type { InputAttachmentMeta } from "../protocol/types.js";
|
|
17
20
|
/**
|
|
18
21
|
* Build ScanOptions.compatFileNames from the user's instruction compat toggles.
|
|
19
22
|
* Primary file name stays hard-wired to CODESHELL.md (not exposed). Turning a
|
|
@@ -27,6 +30,10 @@ export declare function compatFileNamesFrom(instructions?: {
|
|
|
27
30
|
}): string[];
|
|
28
31
|
export type { EngineConfig, EngineHookConfig, EngineResult } from "./types.js";
|
|
29
32
|
import type { EngineConfig, EngineResult } from "./types.js";
|
|
33
|
+
export interface EnqueueSteerResult {
|
|
34
|
+
accepted: boolean;
|
|
35
|
+
id: string;
|
|
36
|
+
}
|
|
30
37
|
export { diskDefaultsFrom, type DiskDefaultPatch } from "../settings/disk-defaults.js";
|
|
31
38
|
/**
|
|
32
39
|
* Resolve the LLM config for a spawned child Engine.
|
|
@@ -48,7 +55,7 @@ export declare function resolveChildLlm(modelKey: string | undefined, pool: Mode
|
|
|
48
55
|
* Names in `disabledAgents` are filtered out so the LLM never sees them.
|
|
49
56
|
*/
|
|
50
57
|
/**
|
|
51
|
-
* Resolve the working directory for a run. Precedence:
|
|
58
|
+
* Resolve the working directory for a run. Precedence for legacy sessions:
|
|
52
59
|
* options.cwd > resumed session's state.cwd > config.cwd > process.cwd()
|
|
53
60
|
*
|
|
54
61
|
* The session-cwd tier is what stops a project-bound session from being
|
|
@@ -256,20 +263,22 @@ export declare class Engine {
|
|
|
256
263
|
* clear "no browser panel" error.
|
|
257
264
|
*/
|
|
258
265
|
setBrowserBridge(bridge: import("../tool-system/browser-bridge.js").BrowserBridge | undefined): void;
|
|
266
|
+
/** Inject the host-backed workspace bridge after construction. */
|
|
267
|
+
setWorkspaceBridge(bridge: import("../tool-system/workspace-bridge.js").WorkspaceBridge | undefined): void;
|
|
259
268
|
/**
|
|
260
269
|
* Queue a user message to be spliced into the in-flight run for `sessionId`
|
|
261
270
|
* at the next turn-loop step boundary — the 不打断 steering path (vs cancel +
|
|
262
271
|
* resend). General-purpose: any host path (UI 引导, future agent coordination,
|
|
263
|
-
* external triggers) can call it. If no run is active for
|
|
264
|
-
*
|
|
265
|
-
*
|
|
272
|
+
* external triggers) can call it. If no run is active for this session, reject
|
|
273
|
+
* without queueing so the host can downgrade to a normal run immediately.
|
|
274
|
+
* No-op on blank text.
|
|
266
275
|
*
|
|
267
276
|
* `id` is the host's stable queue-entry id. It rides through to the
|
|
268
277
|
* `steer_injected` event (so the host can match the injected bubble back to
|
|
269
278
|
* the queued draft) and is the handle `unsteer` uses to revoke a still-pending
|
|
270
279
|
* entry. A blank id is tolerated but means the entry can't be revoked.
|
|
271
280
|
*/
|
|
272
|
-
enqueueSteer(sessionId: string, text: string, id?: string):
|
|
281
|
+
enqueueSteer(sessionId: string, text: string, id?: string, clientMessageId?: string): EnqueueSteerResult;
|
|
273
282
|
/**
|
|
274
283
|
* Revoke a still-pending steer entry (the 撤回 path). Returns true if it was
|
|
275
284
|
* removed, false if it was already consumed by the turn loop (can't take it
|
|
@@ -318,6 +327,10 @@ export declare class Engine {
|
|
|
318
327
|
* on replay (matching the live UI, which shows only the assistant reply).
|
|
319
328
|
*/
|
|
320
329
|
injected?: boolean;
|
|
330
|
+
/** Stable id for this user-intent, used to make duplicate submits idempotent. */
|
|
331
|
+
clientMessageId?: string;
|
|
332
|
+
/** Structured input attachments. Legacy `<codeshell-image>` blocks remain supported. */
|
|
333
|
+
attachments?: InputAttachmentMeta[];
|
|
321
334
|
}): Promise<EngineResult>;
|
|
322
335
|
/**
|
|
323
336
|
* Run the end-of-session memory pipeline as a fire-and-forget background
|
|
@@ -332,6 +345,11 @@ export declare class Engine {
|
|
|
332
345
|
* active run's client) when unset, unknown, or on any build failure — aux
|
|
333
346
|
* work is best-effort and must never break a run.
|
|
334
347
|
*/
|
|
348
|
+
/**
|
|
349
|
+
* Build the SummarizeFn used for context compaction. Extracted so both the
|
|
350
|
+
* run path and forceCompact share one definition of the summarization call.
|
|
351
|
+
*/
|
|
352
|
+
private buildSummarizeFn;
|
|
335
353
|
private resolveAuxClient;
|
|
336
354
|
private runMemoryPipeline;
|
|
337
355
|
/**
|
|
@@ -363,10 +381,8 @@ export declare class Engine {
|
|
|
363
381
|
*/
|
|
364
382
|
switchModel(key: string): ModelEntry;
|
|
365
383
|
/**
|
|
366
|
-
* Zero
|
|
367
|
-
*
|
|
368
|
-
* cache-hit stats from the prior model are no longer meaningful. The next
|
|
369
|
-
* run's baseline (snapshotted from state.tokenUsage) then starts from zero.
|
|
384
|
+
* Zero the legacy/model-scoped token/cache usage window on disk. The
|
|
385
|
+
* whole-session cumulative counters are intentionally left alone.
|
|
370
386
|
*/
|
|
371
387
|
resetSessionUsage(sessionId: string): void;
|
|
372
388
|
/**
|
|
@@ -450,16 +466,22 @@ export declare class Engine {
|
|
|
450
466
|
* session with no active goal is a no-op returning false.
|
|
451
467
|
*/
|
|
452
468
|
clearGoal(sessionId: string): boolean;
|
|
469
|
+
/**
|
|
470
|
+
* Reset a session's workspace pointer back to its main root. If the session is
|
|
471
|
+
* actively running, mutate that live SessionBundle first so the run's next
|
|
472
|
+
* saveState cannot resurrect a stale worktree pointer.
|
|
473
|
+
*/
|
|
474
|
+
releaseSessionWorkspace(sessionId: string): import("../types.js").SessionWorkspace | null;
|
|
453
475
|
injectContext(sessionId: string, content: string): void;
|
|
454
476
|
/**
|
|
455
477
|
* Force context compaction on a session.
|
|
456
478
|
* Returns token stats before/after.
|
|
457
479
|
*/
|
|
458
|
-
forceCompact(sessionId?: string): {
|
|
480
|
+
forceCompact(sessionId?: string): Promise<{
|
|
459
481
|
before: number;
|
|
460
482
|
after: number;
|
|
461
|
-
strategy:
|
|
462
|
-
}
|
|
483
|
+
strategy: "none (no active session)" | "no compaction needed" | "compacted" | CompactStrategy;
|
|
484
|
+
}>;
|
|
463
485
|
private stripUserContextMessage;
|
|
464
486
|
private getSettingsManager;
|
|
465
487
|
/**
|
|
@@ -560,6 +582,7 @@ export declare class Engine {
|
|
|
560
582
|
* by tests that want a ToolContext without a full run() cycle.
|
|
561
583
|
*/
|
|
562
584
|
private resolveSandboxWithoutRuntime;
|
|
585
|
+
private resolveSandboxConfigForCwd;
|
|
563
586
|
/**
|
|
564
587
|
* Build the shell env layered onto the Bash tool / background shells (see
|
|
565
588
|
* mergeShellEnv). Three user-configured sources, merged lowest → highest:
|
|
@@ -612,6 +635,9 @@ export declare class Engine {
|
|
|
612
635
|
linux?: string;
|
|
613
636
|
windows?: string;
|
|
614
637
|
} | undefined;
|
|
638
|
+
readWorktreeBranchPrefix(cwd?: string): string | undefined;
|
|
639
|
+
resolveWorktreeSetupSandbox(cwd: string): Promise<SandboxBackend | undefined>;
|
|
640
|
+
readWorktreeSetupShellEnv(cwd?: string): Record<string, string> | undefined;
|
|
615
641
|
buildToolContext(): ToolContext;
|
|
616
642
|
/**
|
|
617
643
|
* Read settings.disabledSkills + settings.disabledPlugins in a single
|