@nowcrew/daemon 0.6.79 → 0.6.80-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.
- package/dist/agent-ability/resolver.js +7 -10
- package/dist/execution-protocol.js +0 -1
- package/dist/execution-runner.js +3 -9
- package/dist/local-execution-prompt.js +2 -3
- package/dist/local-executor.js +35 -59
- package/dist/machine-info.js +0 -3
- package/dist/main.js +0 -0
- package/dist/package-manager-env.js +75 -0
- package/dist/provider-env.js +3 -21
- package/dist/runner.js +1 -1
- package/dist/runtime-env.js +21 -0
- package/dist/runtimes/codex-app-server-runner.js +1 -9
- package/dist/runtimes/codex-deepseek-config.js +7 -17
- package/dist/runtimes/codex.js +0 -3
- package/dist/supervised-runtime.js +0 -1
- package/dist/workspace.js +10 -13
- package/package.json +10 -9
- package/dist/project-skills/capability.js +0 -109
- package/dist/project-skills/controller-convergence.js +0 -57
- package/dist/project-skills/projection-set-switch.js +0 -419
- package/dist/project-skills/projection-state-domain.js +0 -170
- package/dist/project-skills/projection-state-store.js +0 -842
- package/dist/project-skills/projection-state-transaction.js +0 -322
- package/dist/project-skills/projection-state.js +0 -3
- package/dist/project-skills/runtime-root-bootstrap.js +0 -53
- package/dist/project-skills/runtime-root-domain.js +0 -268
- package/dist/project-skills/runtime-root-gc.js +0 -293
- package/dist/project-skills/runtime-root-lease-artifact.js +0 -46
- package/dist/project-skills/runtime-root-leases.js +0 -487
- package/dist/project-skills/runtime-root-source-identity.js +0 -60
- package/dist/project-skills/runtime-root-startup.js +0 -50
- package/dist/project-skills/runtime-root-state-artifact-domain.js +0 -143
- package/dist/project-skills/runtime-root-state-index.js +0 -356
- package/dist/project-skills/runtime-root-store.js +0 -722
- package/dist/project-skills/serve-capability.js +0 -28
- package/dist/project-skills/serve-startup.js +0 -60
- package/dist/self-training-workspace.js +0 -15
|
@@ -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,60 +0,0 @@
|
|
|
1
|
-
import { createExecutionJournal } from "../execution-journal.js";
|
|
2
|
-
import { reconcileExecutionJournal } from "../execution-recovery.js";
|
|
3
|
-
import { dslog, flushSlog } from "../slog.js";
|
|
4
|
-
/**
|
|
5
|
-
* 每次连接 preflight 的 Runtime root / lease 恢复。重连时本进程仍在跑的 execution 合法持有 lease,
|
|
6
|
-
* 必须当作存活而非孤儿;失败也必须留痕,否则整条连接静默摘掉 Project Skills 能力
|
|
7
|
-
* (incident: 2026-09-02,绑定项目的 Agent 全部 execution_spec_incompatible)。
|
|
8
|
-
*/
|
|
9
|
-
export function createProjectSkillReconnectRecovery(startup, agentsRoot, journal, protectedExecutionIds, liveExecutionIds) {
|
|
10
|
-
return async () => {
|
|
11
|
-
const live = liveExecutionIds();
|
|
12
|
-
try {
|
|
13
|
-
await startup.recover(agentsRoot, journal(), protectedExecutionIds, live);
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
dslog("project_skills.preflight_recovery_failed", "Project Skill runtime root 恢复失败,本连接不宣告 Project Skills 能力", {
|
|
18
|
-
level: "ERROR",
|
|
19
|
-
error_code: error.code ?? "unknown",
|
|
20
|
-
error_message: error.message,
|
|
21
|
-
live_execution_count: live.size,
|
|
22
|
-
});
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export async function initializeProjectSkillProtectedExecutionJournal(input) {
|
|
28
|
-
return input.startup.initializeAfterLeaseProtection(input.config.agentsRoot, async (snapshot) => {
|
|
29
|
-
input.protectedExecutionIds.clear();
|
|
30
|
-
for (const executionId of snapshot)
|
|
31
|
-
input.protectedExecutionIds.add(executionId);
|
|
32
|
-
const journal = input.injectedJournal ?? createExecutionJournal(input.config.agentsRoot, {
|
|
33
|
-
protectedExecutionIds: () => input.protectedExecutionIds,
|
|
34
|
-
onOperationTiming: (event) => {
|
|
35
|
-
if (event.operation !== "mark_runtime_ready"
|
|
36
|
-
&& event.queueWaitMs < 250
|
|
37
|
-
&& event.operationMs < 250)
|
|
38
|
-
return;
|
|
39
|
-
dslog("execution.journal_operation", "execution journal 操作完成", {
|
|
40
|
-
level: event.outcome === "succeeded" ? "INFO" : "ERROR",
|
|
41
|
-
execution_id: event.executionId,
|
|
42
|
-
operation: event.operation,
|
|
43
|
-
outcome: event.outcome,
|
|
44
|
-
queue_wait_ms: event.queueWaitMs,
|
|
45
|
-
operation_ms: event.operationMs,
|
|
46
|
-
total_ms: event.queueWaitMs + event.operationMs,
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
await reconcileExecutionJournal(journal, {
|
|
51
|
-
agentsRoot: input.config.agentsRoot,
|
|
52
|
-
serverUrl: input.config.serverUrl,
|
|
53
|
-
...(input.profileName === undefined ? {} : { profileName: input.profileName }),
|
|
54
|
-
log: dslog,
|
|
55
|
-
flush: flushSlog,
|
|
56
|
-
writeStderr: (line) => process.stderr.write(line),
|
|
57
|
-
});
|
|
58
|
-
return journal;
|
|
59
|
-
});
|
|
60
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { rm } from "node:fs/promises";
|
|
2
|
-
import { isAbsolute, relative, sep } from "node:path";
|
|
3
|
-
/** Delete only a concrete child of this Agent's tasks root; never follow an ambiguous target. */
|
|
4
|
-
export async function cleanupSelfTrainingRunDir(tasksRoot, runDir) {
|
|
5
|
-
const child = relative(tasksRoot, runDir);
|
|
6
|
-
if (child === "" || isAbsolute(child) || child === ".." || child.startsWith(`..${sep}`))
|
|
7
|
-
return;
|
|
8
|
-
try {
|
|
9
|
-
await rm(runDir, { recursive: true, force: true });
|
|
10
|
-
}
|
|
11
|
-
catch (error) {
|
|
12
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
13
|
-
process.stderr.write(`[execution] failed to remove self-training run dir ${runDir}: ${detail}\n`);
|
|
14
|
-
}
|
|
15
|
-
}
|