@nowcrew/daemon 0.6.91-beta.7 → 0.6.91-beta.9

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 (39) hide show
  1. package/dist/computer-main.js +0 -0
  2. package/dist/console.js +5 -4
  3. package/dist/execution-journal.js +3 -1
  4. package/dist/execution-protocol.js +1 -1
  5. package/dist/execution-runner.js +3 -1
  6. package/dist/i18n.js +4 -3
  7. package/dist/local-execution-prompt.js +8 -3
  8. package/dist/local-executor.js +14 -35
  9. package/dist/local-memory/execution-workspace.js +36 -0
  10. package/dist/local-memory/full-index-search.js +47 -0
  11. package/dist/local-memory/index-budget.js +9 -3
  12. package/dist/local-memory/migration-access.js +118 -0
  13. package/dist/local-memory/migration-cli.js +54 -0
  14. package/dist/local-memory/migration-io.js +199 -0
  15. package/dist/local-memory/migration-plan.js +278 -0
  16. package/dist/local-memory/migration-schema.js +55 -0
  17. package/dist/local-memory/migration-store.js +424 -0
  18. package/dist/local-memory/migration-tool-entry.js +21 -0
  19. package/dist/local-memory/prompt.js +20 -4
  20. package/dist/local-memory/read-cli.js +36 -1
  21. package/dist/local-memory/rollout.js +53 -8
  22. package/dist/local-memory/runtime.js +5 -2
  23. package/dist/local-memory/storage-format.js +152 -0
  24. package/dist/local-memory/write.js +108 -17
  25. package/dist/machine-info.js +3 -0
  26. package/dist/main.js +0 -0
  27. package/dist/memory-migration-controller.js +84 -0
  28. package/dist/memory-migration-inspect.js +74 -0
  29. package/dist/memory-migration-journal.js +14 -0
  30. package/dist/memory-migration-protocol.js +14 -0
  31. package/dist/memory-migration-runtime.js +305 -0
  32. package/dist/message-file-preview.js +11 -1
  33. package/dist/prompt.js +5 -1
  34. package/dist/runner.js +1 -1
  35. package/dist/runtime-startup-gate.js +1 -1
  36. package/dist/serve.js +36 -3
  37. package/dist/token.js +1 -0
  38. package/dist/workspace-control-handler.js +16 -3
  39. package/package.json +8 -9
@@ -1,9 +1,22 @@
1
1
  /** 控制面文件/技能查看的按需处理,独立于执行生命周期。 */
2
- import { join } from "node:path";
2
+ import { lstat } from "node:fs/promises";
3
+ import { join, resolve } from "node:path";
3
4
  import { readSharedMessageFile } from "./message-file-preview.js";
4
5
  import { listWorkspace, readWorkspaceFile } from "./workspace-fs.js";
5
6
  import { listSkills } from "./skills.js";
6
7
  import { listRuntimeModels } from "./list-models.js";
8
+ import { withMemoryAccess } from "./local-memory/migration-access.js";
9
+ async function listProtectedWorkspace(root, path) {
10
+ try {
11
+ await lstat(root);
12
+ }
13
+ catch (error) {
14
+ if (error.code !== "ENOENT")
15
+ throw error;
16
+ return { root: resolve(root), path: path.replace(/^\/+/, ""), entries: [] };
17
+ }
18
+ return withMemoryAccess(root, () => listWorkspace(root, path));
19
+ }
7
20
  export async function handleWorkspaceControlRequest(raw, agentsRoot, registry, models = listRuntimeModels) {
8
21
  if (!raw || typeof raw !== "object")
9
22
  return null;
@@ -15,8 +28,8 @@ export async function handleWorkspaceControlRequest(raw, agentsRoot, registry, m
15
28
  try {
16
29
  const root = join(agentsRoot, request.handle);
17
30
  const data = request.type === "fs:read-shared" ? await readSharedMessageFile(agentsRoot, raw, registry)
18
- : request.type === "fs:list" ? await listWorkspace(root, request.path)
19
- : request.type === "fs:read" ? await readWorkspaceFile(root, request.path)
31
+ : request.type === "fs:list" ? await listProtectedWorkspace(root, request.path)
32
+ : request.type === "fs:read" ? await withMemoryAccess(root, () => readWorkspaceFile(root, request.path))
20
33
  : request.type === "skills:list" ? await listSkills(request.runtime)
21
34
  : { models: await models(request.runtime ?? "") };
22
35
  return { type: "fs:result", reqId: request.reqId, ok: true, data };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nowcrew/daemon",
3
- "version": "0.6.91-beta.7",
3
+ "version": "0.6.91-beta.9",
4
4
  "type": "module",
5
5
  "description": "crew daemon — 运行在用户机器:拉起/管理 agent 进程,注入 crew CLI,归一化 runtime 事件",
6
6
  "license": "Apache-2.0",
@@ -18,13 +18,6 @@
18
18
  "publishConfig": {
19
19
  "access": "public"
20
20
  },
21
- "scripts": {
22
- "daemon": "pnpm --filter @nowcrew/cli build && tsx src/main.ts",
23
- "build": "tsc -p tsconfig.json",
24
- "prepublishOnly": "pnpm build && node ../scripts/daemon-release-artifact.mjs --strict-registry",
25
- "test": "vitest run",
26
- "typecheck": "tsc --noEmit"
27
- },
28
21
  "dependencies": {
29
22
  "@agentclientprotocol/sdk": "1.2.1",
30
23
  "@nowcrew/cli": "0.4.17",
@@ -46,5 +39,11 @@
46
39
  "tsx": "^4.19.0",
47
40
  "typescript": "^5.6.0",
48
41
  "vitest": "^2.1.0"
42
+ },
43
+ "scripts": {
44
+ "daemon": "pnpm --filter @nowcrew/cli build && tsx src/main.ts",
45
+ "build": "tsc -p tsconfig.json",
46
+ "test": "vitest run",
47
+ "typecheck": "tsc --noEmit"
49
48
  }
50
- }
49
+ }