@nowcrew/daemon 0.6.101-beta.7 → 0.6.101-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.
- package/dist/computer-main.js +0 -0
- package/dist/execution-protocol.js +2 -0
- package/dist/execution-runner.js +14 -11
- package/dist/machine-info.js +1 -0
- package/dist/main.js +0 -0
- package/package.json +9 -10
package/dist/computer-main.js
CHANGED
|
File without changes
|
|
@@ -207,6 +207,8 @@ export const ExecutionStartSchema = z.object({
|
|
|
207
207
|
model: z.string().optional(),
|
|
208
208
|
reasoning: ReasoningSchema.optional(),
|
|
209
209
|
timeoutMs: z.number().int().positive().optional(),
|
|
210
|
+
// Server-owned policy; 0 disables the total runtime timer. Capability-gated.
|
|
211
|
+
taskTimeoutMs: z.number().int().min(0).max(2_145_600_000).optional(),
|
|
210
212
|
}).strict(),
|
|
211
213
|
permissions: z.object({
|
|
212
214
|
requested: PermissionSchema,
|
package/dist/execution-runner.js
CHANGED
|
@@ -416,7 +416,7 @@ export async function runExecution(config, input, dependencies) {
|
|
|
416
416
|
return { kind: "rejected", frame };
|
|
417
417
|
}
|
|
418
418
|
const { permission } = checked;
|
|
419
|
-
const effectiveTimeoutMs = spec.runtime.timeoutMs ?? config.executionLimits.maxTimeoutMs;
|
|
419
|
+
const effectiveTimeoutMs = spec.runtime.taskTimeoutMs ?? spec.runtime.timeoutMs ?? config.executionLimits.maxTimeoutMs;
|
|
420
420
|
const accepted = await dependencies.journal.accept(spec.executionId, specHash, {
|
|
421
421
|
runtime: spec.runtime.name,
|
|
422
422
|
...(spec.runtime.model === undefined ? {} : { model: spec.runtime.model }),
|
|
@@ -492,6 +492,7 @@ export async function runExecution(config, input, dependencies) {
|
|
|
492
492
|
let timeout;
|
|
493
493
|
let timedOut = false;
|
|
494
494
|
let firstOutputTimer;
|
|
495
|
+
let runtimeTimersStarted = false;
|
|
495
496
|
let firstOutputTimedOut = false;
|
|
496
497
|
let abandonedRuntimeRunningCompletion = null;
|
|
497
498
|
let completion;
|
|
@@ -617,7 +618,8 @@ export async function runExecution(config, input, dependencies) {
|
|
|
617
618
|
if (dependencies.cancellation?.isRequested())
|
|
618
619
|
return;
|
|
619
620
|
const cancel = runtimeCancel;
|
|
620
|
-
if (cancel !== null &&
|
|
621
|
+
if (cancel !== null && !runtimeTimersStarted && !dependencies.cancellation?.isRequested()) {
|
|
622
|
+
runtimeTimersStarted = true;
|
|
621
623
|
const firstOutputDeadline = config.executionLimits.maxFirstOutputWaitMs
|
|
622
624
|
+ config.executionLimits.firstOutputGraceMs;
|
|
623
625
|
firstOutputTimer = setTimeout(() => {
|
|
@@ -629,15 +631,16 @@ export async function runExecution(config, input, dependencies) {
|
|
|
629
631
|
rejectCancellationFailure(error);
|
|
630
632
|
}
|
|
631
633
|
}, firstOutputDeadline);
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
634
|
+
if (effectiveTimeoutMs > 0)
|
|
635
|
+
timeout = setTimeout(() => {
|
|
636
|
+
timedOut = true;
|
|
637
|
+
try {
|
|
638
|
+
void cancel().catch(rejectCancellationFailure);
|
|
639
|
+
}
|
|
640
|
+
catch (error) {
|
|
641
|
+
rejectCancellationFailure(error);
|
|
642
|
+
}
|
|
643
|
+
}, effectiveTimeoutMs);
|
|
641
644
|
}
|
|
642
645
|
dependencies.onRuntimePhase?.("running", spec.runtime.name);
|
|
643
646
|
const journalStartedAt = Date.now();
|
package/dist/machine-info.js
CHANGED
|
@@ -42,6 +42,7 @@ export const NATIVE_PROJECT_WORKSPACE_READINESS = Object.freeze({
|
|
|
42
42
|
});
|
|
43
43
|
export const DAEMON_CAPABILITIES = Object.freeze([
|
|
44
44
|
RUNTIME_TOOL_UPDATES_CAPABILITY,
|
|
45
|
+
"execution_task_timeout_v1",
|
|
45
46
|
MARKETPLACE_CAPABILITY,
|
|
46
47
|
MAINTENANCE_CAPABILITY,
|
|
47
48
|
"scheduled_job_v1",
|
package/dist/main.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nowcrew/daemon",
|
|
3
|
-
"version": "0.6.101-beta.
|
|
3
|
+
"version": "0.6.101-beta.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "crew daemon — 运行在用户机器:拉起/管理 agent 进程,注入 crew CLI,归一化 runtime 事件",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -18,14 +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
|
-
"test:release-critical": "vitest run test/automatic-daemon-installer.test.ts test/automatic-install-target.test.ts test/automatic-service-migration.test.ts test/computer-cli.test.ts test/computer-service.test.ts test/computer-setup-client.test.ts test/computer-setup-orchestration.test.ts test/computer-setup.test.ts test/daemon-release-version.test.ts test/daemon-update-controller.test.ts test/daemon-update-eligibility.test.ts test/daemon-updater.test.ts test/execution-protocol.test.ts test/machine-info.test.ts --maxWorkers=2 --minWorkers=1",
|
|
27
|
-
"typecheck": "tsc --noEmit"
|
|
28
|
-
},
|
|
29
21
|
"dependencies": {
|
|
30
22
|
"@agentclientprotocol/sdk": "1.2.1",
|
|
31
23
|
"@nowcrew/cli": "0.4.17",
|
|
@@ -47,5 +39,12 @@
|
|
|
47
39
|
"tsx": "^4.19.0",
|
|
48
40
|
"typescript": "^5.6.0",
|
|
49
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
|
+
"test:release-critical": "vitest run test/automatic-daemon-installer.test.ts test/automatic-install-target.test.ts test/automatic-service-migration.test.ts test/computer-cli.test.ts test/computer-service.test.ts test/computer-setup-client.test.ts test/computer-setup-orchestration.test.ts test/computer-setup.test.ts test/daemon-release-version.test.ts test/daemon-update-controller.test.ts test/daemon-update-eligibility.test.ts test/daemon-updater.test.ts test/execution-protocol.test.ts test/machine-info.test.ts --maxWorkers=2 --minWorkers=1",
|
|
48
|
+
"typecheck": "tsc --noEmit"
|
|
50
49
|
}
|
|
51
|
-
}
|
|
50
|
+
}
|