@nowcrew/daemon 0.6.77 → 0.6.79-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.
Files changed (71) hide show
  1. package/README.md +27 -0
  2. package/dist/automatic-daemon-installer.js +44 -24
  3. package/dist/automatic-install-target.js +34 -9
  4. package/dist/computer-cli.js +43 -14
  5. package/dist/computer-profile.js +15 -2
  6. package/dist/computer-service.js +26 -5
  7. package/dist/config.js +28 -8
  8. package/dist/control-plane-url.js +3 -9
  9. package/dist/daemon-installation-lease.js +7 -4
  10. package/dist/daemon-local-home.js +108 -0
  11. package/dist/daemon-migration-controller.js +15 -4
  12. package/dist/daemon-registry.js +20 -0
  13. package/dist/daemon-update-controller.js +1 -0
  14. package/dist/daemon-update-eligibility.js +17 -7
  15. package/dist/daemon-updater.js +26 -26
  16. package/dist/execution-runner.js +7 -7
  17. package/dist/host-execution-coordinator.js +4 -3
  18. package/dist/local-executor.js +23 -17
  19. package/dist/local-memory/runtime.js +5 -3
  20. package/dist/machine-info.js +3 -0
  21. package/dist/main.js +13 -2
  22. package/dist/managed-service-diagnostics.js +1 -0
  23. package/dist/managed-service-registry.js +12 -7
  24. package/dist/managed-service-startup.js +4 -1
  25. package/dist/npm-command.js +9 -0
  26. package/dist/project-skills/controller.js +6 -71
  27. package/dist/project-skills/execution-adapter.js +7 -0
  28. package/dist/project-skills/execution-projection.js +163 -0
  29. package/dist/project-skills/initialized-reconciler.js +10 -8
  30. package/dist/project-skills/legacy-cleanup.js +224 -0
  31. package/dist/project-skills/machine-hello-publisher.js +20 -0
  32. package/dist/project-skills/reconciler.js +114 -500
  33. package/dist/project-skills/resolution-records.js +63 -0
  34. package/dist/project-skills/runtime-launch.js +0 -42
  35. package/dist/project-skills/runtime-warning.js +1 -3
  36. package/dist/project-skills/scanner.js +1 -17
  37. package/dist/project-skills/startup-cleanup.js +24 -0
  38. package/dist/runner.js +2 -1
  39. package/dist/serve.js +49 -49
  40. package/dist/slog.js +14 -1
  41. package/dist/storage-control.js +12 -1
  42. package/dist/storage-identity.js +15 -1
  43. package/dist/storage-migration-controller.js +25 -4
  44. package/dist/storage-ownership.js +55 -0
  45. package/dist/storage-runtime-controller.js +29 -7
  46. package/dist/storage-runtime-readiness.js +26 -4
  47. package/dist/storage-runtime.js +18 -2
  48. package/dist/storage-status-delivery.js +4 -0
  49. package/dist/storage-status-replay.js +16 -1
  50. package/dist/storage-worker-executor.js +1 -0
  51. package/dist/storage-worker-operation.js +4 -0
  52. package/package.json +1 -1
  53. package/dist/project-skills/capability.js +0 -109
  54. package/dist/project-skills/controller-convergence.js +0 -57
  55. package/dist/project-skills/projection-set-switch.js +0 -419
  56. package/dist/project-skills/projection-state-domain.js +0 -170
  57. package/dist/project-skills/projection-state-store.js +0 -842
  58. package/dist/project-skills/projection-state-transaction.js +0 -322
  59. package/dist/project-skills/projection-state.js +0 -3
  60. package/dist/project-skills/runtime-root-bootstrap.js +0 -47
  61. package/dist/project-skills/runtime-root-domain.js +0 -268
  62. package/dist/project-skills/runtime-root-gc.js +0 -293
  63. package/dist/project-skills/runtime-root-lease-artifact.js +0 -46
  64. package/dist/project-skills/runtime-root-leases.js +0 -487
  65. package/dist/project-skills/runtime-root-source-identity.js +0 -60
  66. package/dist/project-skills/runtime-root-startup.js +0 -49
  67. package/dist/project-skills/runtime-root-state-artifact-domain.js +0 -143
  68. package/dist/project-skills/runtime-root-state-index.js +0 -356
  69. package/dist/project-skills/runtime-root-store.js +0 -722
  70. package/dist/project-skills/serve-capability.js +0 -28
  71. package/dist/project-skills/serve-startup.js +0 -37
@@ -1,28 +0,0 @@
1
- import { WebSocket } from "ws";
2
- import { daemonCapabilityBindings, } from "../machine-info.js";
3
- import { prepareProjectSkillConnectionCapabilities, } from "./capability.js";
4
- export function createProjectSkillConnectionCapabilityProvider(input) {
5
- return async () => daemonCapabilityBindings(input.platform, await prepareProjectSkillConnectionCapabilities(input));
6
- }
7
- export function createProjectSkillMachineHelloPublisher(input) {
8
- let latest = null;
9
- let latestSocket = null;
10
- const republish = () => {
11
- if (latest === null || latestSocket?.readyState !== WebSocket.OPEN)
12
- return;
13
- const hello = input.effective(latest, input.status());
14
- try {
15
- latestSocket.send(JSON.stringify(hello));
16
- input.onSent(hello);
17
- }
18
- catch { /* 非 OPEN,忽略 */ }
19
- };
20
- return Object.freeze({
21
- publish: (hello, socket) => {
22
- latest = hello;
23
- latestSocket = socket;
24
- republish();
25
- },
26
- republish,
27
- });
28
- }
@@ -1,37 +0,0 @@
1
- import { createExecutionJournal } from "../execution-journal.js";
2
- import { reconcileExecutionJournal } from "../execution-recovery.js";
3
- import { dslog, flushSlog } from "../slog.js";
4
- export async function initializeProjectSkillProtectedExecutionJournal(input) {
5
- return input.startup.initializeAfterLeaseProtection(input.config.agentsRoot, async (snapshot) => {
6
- input.protectedExecutionIds.clear();
7
- for (const executionId of snapshot)
8
- input.protectedExecutionIds.add(executionId);
9
- const journal = input.injectedJournal ?? createExecutionJournal(input.config.agentsRoot, {
10
- protectedExecutionIds: () => input.protectedExecutionIds,
11
- onOperationTiming: (event) => {
12
- if (event.operation !== "mark_runtime_ready"
13
- && event.queueWaitMs < 250
14
- && event.operationMs < 250)
15
- return;
16
- dslog("execution.journal_operation", "execution journal 操作完成", {
17
- level: event.outcome === "succeeded" ? "INFO" : "ERROR",
18
- execution_id: event.executionId,
19
- operation: event.operation,
20
- outcome: event.outcome,
21
- queue_wait_ms: event.queueWaitMs,
22
- operation_ms: event.operationMs,
23
- total_ms: event.queueWaitMs + event.operationMs,
24
- });
25
- },
26
- });
27
- await reconcileExecutionJournal(journal, {
28
- agentsRoot: input.config.agentsRoot,
29
- serverUrl: input.config.serverUrl,
30
- ...(input.profileName === undefined ? {} : { profileName: input.profileName }),
31
- log: dslog,
32
- flush: flushSlog,
33
- writeStderr: (line) => process.stderr.write(line),
34
- });
35
- return journal;
36
- });
37
- }