@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/session/memory.d.ts
CHANGED
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
* auto-extracted entries (extract-memories output). LLM may
|
|
13
13
|
* only modify these through permission-gated tool calls.
|
|
14
14
|
* - dream/ The dream pipeline's workspace. The LLM is free to add /
|
|
15
|
-
* merge / delete entries here
|
|
15
|
+
* merge / delete entries here. The dream loop may ALSO maintain
|
|
16
|
+
* user/ entries whose origin is `auto` or `dream` (dedup/merge/
|
|
17
|
+
* improve), but origin:`manual` user entries — things the user
|
|
18
|
+
* explicitly asked to remember — are never touched by dream.
|
|
19
|
+
* See dream-consolidation.ts (the origin guard at ~:240).
|
|
16
20
|
*
|
|
17
21
|
* MEMORY.md is the index file (one per scope).
|
|
18
22
|
*
|
|
@@ -29,15 +33,20 @@
|
|
|
29
33
|
* panel. Keeps the global layer curated — nothing auto-lands global.
|
|
30
34
|
*/
|
|
31
35
|
export type MemoryScope = "user" | "dream" | "pending";
|
|
36
|
+
export type MemoryOrigin = "auto" | "manual" | "dream";
|
|
32
37
|
export interface MemoryEntry {
|
|
38
|
+
/** Stable identity. Legacy files without frontmatter id read as legacy:<scope>:<fileName>. */
|
|
39
|
+
id?: string;
|
|
33
40
|
name: string;
|
|
34
41
|
description: string;
|
|
35
42
|
type: "user" | "feedback" | "project" | "reference";
|
|
36
43
|
content: string;
|
|
37
44
|
fileName: string;
|
|
38
45
|
scope: MemoryScope;
|
|
46
|
+
/** Semantic last content update time from frontmatter. */
|
|
47
|
+
updatedAt?: string;
|
|
39
48
|
/** File mtime in epoch ms — drives maxAge filtering (TODO 8.1). 0 if unknown. */
|
|
40
|
-
|
|
49
|
+
mtimeMs?: number;
|
|
41
50
|
/**
|
|
42
51
|
* 固定/置顶 (feedback#18 方案 A): a pinned memory is exempt from maxAge
|
|
43
52
|
* injection filtering and sorts first in the injected context. UI surfaces
|
|
@@ -49,15 +58,20 @@ export interface MemoryEntry {
|
|
|
49
58
|
* "manual" (or absent — legacy files) = written by the user/UI. Lets the
|
|
50
59
|
* UI distinguish curated memories from extractor noise.
|
|
51
60
|
*/
|
|
52
|
-
origin?:
|
|
61
|
+
origin?: MemoryOrigin;
|
|
53
62
|
/**
|
|
54
|
-
* Recall lifecycle (召回 TTL). `
|
|
55
|
-
* hits this entry; `
|
|
56
|
-
* is set on first save and preserved across UPDATE. Drives recall-based TTL:
|
|
63
|
+
* Recall lifecycle (召回 TTL). `useCount` increments each time MemoryRead
|
|
64
|
+
* hits this entry; `lastUsedAt` is the ISO timestamp of that last hit;
|
|
65
|
+
* `createdAt` is set on first save and preserved across UPDATE. Drives recall-based TTL:
|
|
57
66
|
* a `project`-type memory not read for N days is pruned. Stored in frontmatter
|
|
58
|
-
* — no SQLite. Legacy
|
|
59
|
-
*
|
|
67
|
+
* — no SQLite. Legacy `usageCount/lastUsed/created` fields are still read and
|
|
68
|
+
* exposed through their old aliases for compatibility.
|
|
60
69
|
*/
|
|
70
|
+
useCount?: number;
|
|
71
|
+
updateCount?: number;
|
|
72
|
+
lastUsedAt?: string;
|
|
73
|
+
createdAt?: string;
|
|
74
|
+
/** Legacy compatibility aliases. New writes use useCount/lastUsedAt/createdAt. */
|
|
61
75
|
usageCount?: number;
|
|
62
76
|
lastUsed?: string;
|
|
63
77
|
created?: string;
|
|
@@ -67,6 +81,15 @@ export interface MemoryEntry {
|
|
|
67
81
|
* user store (not the current one). Absent → fall back to no-repo / global.
|
|
68
82
|
*/
|
|
69
83
|
originProject?: string;
|
|
84
|
+
/** Global dream promotion metadata (P1). */
|
|
85
|
+
promotionKey?: string;
|
|
86
|
+
originProjects?: string[];
|
|
87
|
+
evidenceCount?: number;
|
|
88
|
+
firstSeenAt?: string;
|
|
89
|
+
lastSeenAt?: string;
|
|
90
|
+
promotionReason?: string;
|
|
91
|
+
promotionStatus?: "pending" | "rejected";
|
|
92
|
+
promotionSourceId?: string;
|
|
70
93
|
}
|
|
71
94
|
/**
|
|
72
95
|
* Drop memories older than `maxAgeDays` (by file mtime) for context injection
|
|
@@ -75,6 +98,12 @@ export interface MemoryEntry {
|
|
|
75
98
|
* just because we couldn't read its timestamp. Pure + testable.
|
|
76
99
|
*/
|
|
77
100
|
export declare function filterByAge(entries: MemoryEntry[], maxAgeDays?: number, now?: number): MemoryEntry[];
|
|
101
|
+
export interface SaveMemoryOptions {
|
|
102
|
+
/** False for lifecycle-only writes such as recordRecall and pin/unpin. */
|
|
103
|
+
incrementUpdateCount?: boolean;
|
|
104
|
+
/** Force provenance regardless of model/tool args. Used by origin guards. */
|
|
105
|
+
forceOrigin?: MemoryOrigin;
|
|
106
|
+
}
|
|
78
107
|
export interface MemoryManagerOptions {
|
|
79
108
|
/** Project root path; when set, memories are scoped under projects/<hash>/memory. */
|
|
80
109
|
projectDir?: string;
|
|
@@ -97,13 +126,18 @@ export declare class MemoryManager {
|
|
|
97
126
|
getMemoryDir(): string;
|
|
98
127
|
getScope(): MemoryScope;
|
|
99
128
|
/**
|
|
100
|
-
* Save a memory entry.
|
|
129
|
+
* Save a memory entry. New entries get a stable id and `<id>.md`; entries
|
|
130
|
+
* carrying an existing id update that file even when name changes.
|
|
101
131
|
*/
|
|
102
|
-
save(entry: Omit<MemoryEntry, "fileName" | "scope"
|
|
132
|
+
save(entry: Omit<MemoryEntry, "fileName" | "scope">, opts?: SaveMemoryOptions): string;
|
|
103
133
|
/**
|
|
104
134
|
* Load all memory entries.
|
|
105
135
|
*/
|
|
106
136
|
loadAll(): MemoryEntry[];
|
|
137
|
+
findById(id: string): MemoryEntry | undefined;
|
|
138
|
+
find(nameOrFileOrId: string): MemoryEntry | undefined;
|
|
139
|
+
isOwnedBy(entry: MemoryEntry | undefined, allowedOrigins: readonly MemoryOrigin[]): boolean;
|
|
140
|
+
deleteIfOwned(nameOrFileOrId: string, allowedOrigins: readonly MemoryOrigin[]): "deleted" | "not_found" | "protected";
|
|
107
141
|
/**
|
|
108
142
|
* Load a single memory file.
|
|
109
143
|
*/
|
|
@@ -136,13 +170,14 @@ export declare class MemoryManager {
|
|
|
136
170
|
*/
|
|
137
171
|
pruneByRecall(ttlDays: number, now?: Date): string[];
|
|
138
172
|
/**
|
|
139
|
-
* Approve a pending memory: move it from the pending scope into the
|
|
140
|
-
* of the SAME memory root
|
|
141
|
-
* approval
|
|
142
|
-
*
|
|
173
|
+
* Approve a pending memory: move it from the pending scope into the global
|
|
174
|
+
* dream scope of the SAME memory root. Pending only ever exists at the global
|
|
175
|
+
* root; approval gates whether a suggested global dream becomes injected.
|
|
176
|
+
* Must be called on a pending-scope manager. Returns the new global dream
|
|
177
|
+
* filename, or null if not found / wrong scope.
|
|
143
178
|
*
|
|
144
|
-
* 审批门 (用户拍板): the only path that moves
|
|
145
|
-
*
|
|
179
|
+
* 审批门 (用户拍板): the only path that moves a suggested global dream into the
|
|
180
|
+
* injected global dream store.
|
|
146
181
|
*/
|
|
147
182
|
approvePending(nameOrFile: string): string | null;
|
|
148
183
|
/**
|
|
@@ -150,7 +185,12 @@ export declare class MemoryManager {
|
|
|
150
185
|
* user store (originProject)。无 originProject 时落全局 user(兜底,不丢)。
|
|
151
186
|
*/
|
|
152
187
|
demotePending(nameOrFile: string): string | null;
|
|
153
|
-
/**
|
|
188
|
+
/**
|
|
189
|
+
* Reject a pending global-dream suggestion. The project dream entry stays in
|
|
190
|
+
* place, but is marked so the same source is not suggested again.
|
|
191
|
+
*/
|
|
192
|
+
rejectPending(nameOrFile: string): boolean;
|
|
193
|
+
/** Shared move for approve(→global dream)/demote(→origin-project user). */
|
|
154
194
|
private movePending;
|
|
155
195
|
/**
|
|
156
196
|
* Promote a project-level user memory to the GLOBAL user store (用户手动点
|
|
@@ -214,5 +254,8 @@ export declare class MemoryManager {
|
|
|
214
254
|
*/
|
|
215
255
|
private ensureIndexCache;
|
|
216
256
|
private writeIndex;
|
|
217
|
-
private
|
|
257
|
+
private generateId;
|
|
258
|
+
private availableFileNameForId;
|
|
259
|
+
private fileNameForId;
|
|
260
|
+
private parseSyntheticLegacyId;
|
|
218
261
|
}
|