@nowcrew/daemon 0.5.26 → 0.5.28

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 (67) hide show
  1. package/package.json +1 -1
  2. package/dist/attachments.js +0 -196
  3. package/dist/bound-im-decision.js +0 -22
  4. package/dist/completion-retransmitter.js +0 -77
  5. package/dist/computer-cli.js +0 -274
  6. package/dist/computer-profile-lock.js +0 -395
  7. package/dist/computer-profile.js +0 -364
  8. package/dist/computer-service.js +0 -358
  9. package/dist/config.js +0 -82
  10. package/dist/console-collapse.js +0 -13
  11. package/dist/console-formatter.js +0 -77
  12. package/dist/console-payload.js +0 -73
  13. package/dist/console.js +0 -329
  14. package/dist/daemon-startup-error.js +0 -30
  15. package/dist/execution-backend.js +0 -44
  16. package/dist/execution-event-limit.js +0 -64
  17. package/dist/execution-journal-lock.js +0 -421
  18. package/dist/execution-journal.js +0 -716
  19. package/dist/execution-protocol.js +0 -342
  20. package/dist/execution-recovery.js +0 -95
  21. package/dist/execution-runner.js +0 -659
  22. package/dist/execution-supervisor-child.js +0 -236
  23. package/dist/execution-supervisor.js +0 -302
  24. package/dist/execution-telemetry-journal.js +0 -71
  25. package/dist/external-output.js +0 -114
  26. package/dist/i18n.js +0 -64
  27. package/dist/json-result.js +0 -27
  28. package/dist/list-models.js +0 -92
  29. package/dist/local-executor.js +0 -439
  30. package/dist/log-format.js +0 -10
  31. package/dist/machine-info.js +0 -124
  32. package/dist/main.js +0 -118
  33. package/dist/normalize.js +0 -170
  34. package/dist/origin-decision.js +0 -44
  35. package/dist/platform.js +0 -8
  36. package/dist/prompt.js +0 -307
  37. package/dist/provider-env.js +0 -90
  38. package/dist/runner.js +0 -234
  39. package/dist/runtime-cancellation.js +0 -74
  40. package/dist/runtime-capabilities.js +0 -43
  41. package/dist/runtime-path.js +0 -60
  42. package/dist/runtimes/claude.js +0 -51
  43. package/dist/runtimes/codex-app-server-runner.js +0 -340
  44. package/dist/runtimes/codex-deepseek-catalog.js +0 -7
  45. package/dist/runtimes/codex-deepseek-config.js +0 -50
  46. package/dist/runtimes/codex.js +0 -53
  47. package/dist/runtimes/kimi-acp-runner.js +0 -364
  48. package/dist/runtimes/kimi.js +0 -45
  49. package/dist/runtimes/progress-watchdog.js +0 -26
  50. package/dist/scheduled-report.js +0 -51
  51. package/dist/scheduled-run-report.js +0 -57
  52. package/dist/serve-lifecycle.js +0 -82
  53. package/dist/serve.js +0 -868
  54. package/dist/session.js +0 -82
  55. package/dist/shared-execution-slots.js +0 -68
  56. package/dist/shutdown-deadline.js +0 -32
  57. package/dist/skill-preview.js +0 -21
  58. package/dist/skills.js +0 -56
  59. package/dist/slog.js +0 -228
  60. package/dist/supervised-runtime.js +0 -104
  61. package/dist/token.js +0 -24
  62. package/dist/unified-diff.js +0 -84
  63. package/dist/websocket-shutdown.js +0 -53
  64. package/dist/win32-job-object.js +0 -193
  65. package/dist/workspace-fs.js +0 -80
  66. package/dist/workspace-import.js +0 -127
  67. package/dist/workspace.js +0 -148
@@ -1,82 +0,0 @@
1
- import { dslog, flushSlog } from "./slog.js";
2
- function defaultDiagnose(diagnostic) {
3
- const fields = {
4
- signal: diagnostic.signal,
5
- stage: diagnostic.stage,
6
- active_execution_count: diagnostic.activeExecutionCount,
7
- active_legacy_count: diagnostic.activeLegacyCount,
8
- deadline_ms: diagnostic.deadlineMs,
9
- ...(diagnostic.error === undefined ? {} : { error: diagnostic.error }),
10
- };
11
- try {
12
- dslog(diagnostic.stage === "failed" ? "daemon.shutdown_failed" : "daemon.shutdown", `daemon shutdown ${diagnostic.stage}`, { level: diagnostic.stage === "failed" ? "ERROR" : "INFO", ...fields });
13
- process.stderr.write(`${JSON.stringify({
14
- level: diagnostic.stage === "failed" ? "ERROR" : "INFO",
15
- event_type: diagnostic.stage === "failed" ? "daemon.shutdown_failed" : "daemon.shutdown",
16
- ...fields,
17
- })}\n`);
18
- }
19
- catch { /* shutdown diagnostics must never interrupt cleanup */ }
20
- }
21
- export async function runServeLifecycle(service, dependencies = {}) {
22
- const signals = dependencies.signals ?? process;
23
- const flush = dependencies.flush ?? flushSlog;
24
- const diagnose = dependencies.diagnose ?? defaultDiagnose;
25
- let receivedSignal = null;
26
- let resolveSignal;
27
- const signalReceived = new Promise((resolve) => { resolveSignal = resolve; });
28
- const receive = (signal) => {
29
- if (receivedSignal !== null)
30
- return;
31
- receivedSignal = signal;
32
- resolveSignal(signal);
33
- };
34
- const onSigint = () => receive("SIGINT");
35
- const onSigterm = () => receive("SIGTERM");
36
- signals.on("SIGINT", onSigint);
37
- signals.on("SIGTERM", onSigterm);
38
- try {
39
- try {
40
- await service.ready;
41
- }
42
- catch (readyError) {
43
- try {
44
- await service.stop();
45
- }
46
- catch { /* preserve the readiness error */ }
47
- try {
48
- await flush();
49
- }
50
- catch { /* slog is best effort */ }
51
- throw readyError;
52
- }
53
- const signal = await signalReceived;
54
- const snapshot = service.shutdownSnapshot();
55
- diagnose({ signal, stage: "stopping", ...snapshot });
56
- let stopError;
57
- try {
58
- await service.stop();
59
- diagnose({ signal, stage: "completed", ...snapshot });
60
- }
61
- catch (error) {
62
- stopError = error;
63
- diagnose({
64
- signal,
65
- stage: "failed",
66
- error: error instanceof Error ? error.message : String(error),
67
- ...snapshot,
68
- });
69
- }
70
- try {
71
- await flush();
72
- }
73
- catch { /* slog owns its own spool fallback */ }
74
- if (stopError !== undefined)
75
- throw stopError;
76
- return { signal };
77
- }
78
- finally {
79
- signals.off("SIGINT", onSigint);
80
- signals.off("SIGTERM", onSigterm);
81
- }
82
- }