@nowcrew/daemon 0.6.66 → 0.6.67
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/dist/agent-ability/materializer.js +20 -1
- package/dist/agent-ability/resolver.js +7 -10
- package/dist/agent-ability/runtime.js +3 -0
- package/dist/automatic-install-target.js +15 -10
- package/dist/computer-cli.js +10 -1
- package/dist/computer-service.js +41 -1
- package/dist/config.js +44 -0
- package/dist/daemon-migration-controller.js +16 -18
- package/dist/execution-runner.js +3 -1
- package/dist/local-execution-prompt.js +14 -9
- package/dist/local-executor.js +56 -3
- package/dist/local-memory/index-budget.js +74 -0
- package/dist/local-memory/pending.js +111 -0
- package/dist/local-memory/runtime.js +87 -0
- package/dist/local-memory/types.js +1 -0
- package/dist/local-memory/write.js +448 -0
- package/dist/machine-info.js +3 -2
- package/dist/main.js +83 -0
- package/dist/managed-service-lifecycle.js +47 -2
- package/dist/managed-service-startup.js +2 -0
- package/dist/profile-layout.js +10 -4
- package/dist/project-skills/controller.js +2 -0
- package/dist/prompt.js +19 -1
- package/dist/runner.js +3 -0
- package/dist/runtimes/codex-app-server-runner.js +54 -14
- package/dist/runtimes/codex-command-safety.js +75 -0
- package/dist/runtimes/codex-contract.js +20 -5
- package/dist/runtimes/codex-turn-retry.js +69 -0
- package/dist/runtimes/codex.js +4 -0
- package/dist/serve.js +68 -3
- package/dist/storage-config.js +175 -0
- package/dist/storage-control.js +193 -0
- package/dist/storage-copy.js +609 -0
- package/dist/storage-credential-guard.js +21 -0
- package/dist/storage-doctor.js +228 -0
- package/dist/storage-identity.js +29 -0
- package/dist/storage-layout.js +143 -0
- package/dist/storage-manifest.js +855 -0
- package/dist/storage-migration-controller.js +417 -0
- package/dist/storage-migration-manifest.js +105 -0
- package/dist/storage-migration-policy.js +100 -0
- package/dist/storage-runtime-controller.js +339 -0
- package/dist/storage-runtime-readiness.js +184 -0
- package/dist/storage-runtime.js +39 -0
- package/dist/storage-safe-fs.js +302 -0
- package/dist/storage-serve-adapter.js +65 -0
- package/dist/storage-status-delivery.js +209 -0
- package/dist/storage-status-replay.js +125 -0
- package/dist/storage-target-confirmation.js +129 -0
- package/dist/storage-worker-command.js +27 -0
- package/dist/storage-worker-executor.js +384 -0
- package/dist/storage-worker-handoff.js +151 -0
- package/dist/storage-worker-operation.js +284 -0
- package/dist/storage-worker-status.js +232 -0
- package/dist/supervised-runtime.js +3 -0
- package/dist/workspace.js +24 -1
- package/package.json +1 -1
package/dist/workspace.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* spawn runtime 时把 <ws>/.crew 置于 PATH 最前,于是 agent 的 `crew ...` 命中 wrapper。
|
|
10
10
|
*/
|
|
11
|
-
import { mkdir, writeFile, readFile, chmod, access } from "node:fs/promises";
|
|
11
|
+
import { mkdir, writeFile, readFile, chmod, access, lstat } from "node:fs/promises";
|
|
12
12
|
import { createHash, randomUUID } from "node:crypto";
|
|
13
13
|
import { dirname, join } from "node:path";
|
|
14
14
|
import { dslog } from "./slog.js";
|
|
@@ -34,8 +34,28 @@ async function exists(p) {
|
|
|
34
34
|
return false;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
async function hasLocalMemoryV2Marker(agentDir) {
|
|
38
|
+
const crewDir = join(agentDir, ".crew");
|
|
39
|
+
const memoryDir = join(crewDir, "memory");
|
|
40
|
+
const markerPath = join(agentDir, ".crew", "memory", "v2-enabled");
|
|
41
|
+
try {
|
|
42
|
+
const crewStat = await lstat(crewDir);
|
|
43
|
+
const memoryStat = await lstat(memoryDir);
|
|
44
|
+
if (!crewStat.isDirectory() || crewStat.isSymbolicLink()
|
|
45
|
+
|| !memoryStat.isDirectory() || memoryStat.isSymbolicLink())
|
|
46
|
+
return false;
|
|
47
|
+
const stat = await lstat(markerPath);
|
|
48
|
+
if (!stat.isFile() || stat.isSymbolicLink())
|
|
49
|
+
return false;
|
|
50
|
+
return (await readFile(markerPath, "utf8")) === "1\n";
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
37
56
|
export async function prepareWorkspace(input) {
|
|
38
57
|
const dir = join(input.agentsRoot, input.handle);
|
|
58
|
+
const agentHomePreexisted = await exists(dir);
|
|
39
59
|
const crewDir = join(dir, ".crew");
|
|
40
60
|
await mkdir(crewDir, { recursive: true });
|
|
41
61
|
// 预先创建明细目录,让收尾流程可以按功能创建 notes/<topic>.md。
|
|
@@ -43,6 +63,7 @@ export async function prepareWorkspace(input) {
|
|
|
43
63
|
// MEMORY.md:首次创建"持久身份 + 知识索引"骨架,之后由 agent 自己维护
|
|
44
64
|
const memoryPath = join(dir, "MEMORY.md");
|
|
45
65
|
const memorySeedCreated = !(await exists(memoryPath));
|
|
66
|
+
const localMemoryV2Initialized = await hasLocalMemoryV2Marker(dir);
|
|
46
67
|
if (memorySeedCreated) {
|
|
47
68
|
try {
|
|
48
69
|
await writeFile(memoryPath, memorySeed(input.handle, input.description), "utf8");
|
|
@@ -124,7 +145,9 @@ export async function prepareWorkspace(input) {
|
|
|
124
145
|
crewDir,
|
|
125
146
|
systemPromptPath,
|
|
126
147
|
memory,
|
|
148
|
+
agentHomePreexisted,
|
|
127
149
|
memorySeedCreated,
|
|
150
|
+
localMemoryV2Initialized,
|
|
128
151
|
homeDir,
|
|
129
152
|
runDir,
|
|
130
153
|
workLogPath,
|