@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.
Files changed (57) hide show
  1. package/dist/agent-ability/materializer.js +20 -1
  2. package/dist/agent-ability/resolver.js +7 -10
  3. package/dist/agent-ability/runtime.js +3 -0
  4. package/dist/automatic-install-target.js +15 -10
  5. package/dist/computer-cli.js +10 -1
  6. package/dist/computer-service.js +41 -1
  7. package/dist/config.js +44 -0
  8. package/dist/daemon-migration-controller.js +16 -18
  9. package/dist/execution-runner.js +3 -1
  10. package/dist/local-execution-prompt.js +14 -9
  11. package/dist/local-executor.js +56 -3
  12. package/dist/local-memory/index-budget.js +74 -0
  13. package/dist/local-memory/pending.js +111 -0
  14. package/dist/local-memory/runtime.js +87 -0
  15. package/dist/local-memory/types.js +1 -0
  16. package/dist/local-memory/write.js +448 -0
  17. package/dist/machine-info.js +3 -2
  18. package/dist/main.js +83 -0
  19. package/dist/managed-service-lifecycle.js +47 -2
  20. package/dist/managed-service-startup.js +2 -0
  21. package/dist/profile-layout.js +10 -4
  22. package/dist/project-skills/controller.js +2 -0
  23. package/dist/prompt.js +19 -1
  24. package/dist/runner.js +3 -0
  25. package/dist/runtimes/codex-app-server-runner.js +54 -14
  26. package/dist/runtimes/codex-command-safety.js +75 -0
  27. package/dist/runtimes/codex-contract.js +20 -5
  28. package/dist/runtimes/codex-turn-retry.js +69 -0
  29. package/dist/runtimes/codex.js +4 -0
  30. package/dist/serve.js +68 -3
  31. package/dist/storage-config.js +175 -0
  32. package/dist/storage-control.js +193 -0
  33. package/dist/storage-copy.js +609 -0
  34. package/dist/storage-credential-guard.js +21 -0
  35. package/dist/storage-doctor.js +228 -0
  36. package/dist/storage-identity.js +29 -0
  37. package/dist/storage-layout.js +143 -0
  38. package/dist/storage-manifest.js +855 -0
  39. package/dist/storage-migration-controller.js +417 -0
  40. package/dist/storage-migration-manifest.js +105 -0
  41. package/dist/storage-migration-policy.js +100 -0
  42. package/dist/storage-runtime-controller.js +339 -0
  43. package/dist/storage-runtime-readiness.js +184 -0
  44. package/dist/storage-runtime.js +39 -0
  45. package/dist/storage-safe-fs.js +302 -0
  46. package/dist/storage-serve-adapter.js +65 -0
  47. package/dist/storage-status-delivery.js +209 -0
  48. package/dist/storage-status-replay.js +125 -0
  49. package/dist/storage-target-confirmation.js +129 -0
  50. package/dist/storage-worker-command.js +27 -0
  51. package/dist/storage-worker-executor.js +384 -0
  52. package/dist/storage-worker-handoff.js +151 -0
  53. package/dist/storage-worker-operation.js +284 -0
  54. package/dist/storage-worker-status.js +232 -0
  55. package/dist/supervised-runtime.js +3 -0
  56. package/dist/workspace.js +24 -1
  57. 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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nowcrew/daemon",
3
- "version": "0.6.66",
3
+ "version": "0.6.67",
4
4
  "type": "module",
5
5
  "description": "crew daemon — 运行在用户机器:拉起/管理 agent 进程,注入 crew CLI,归一化 runtime 事件",
6
6
  "license": "Apache-2.0",