harnery 0.43.0 → 0.45.0
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/README.md +3 -3
- package/dist/commander.js +1 -0
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +41 -48
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +38 -11
- package/dist/commands/diagnostics.d.ts.map +1 -1
- package/dist/commands/diagnostics.js +10 -0
- package/dist/commands/doctor.d.ts +12 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +22 -7
- package/dist/commands/files.d.ts +2 -2
- package/dist/commands/files.d.ts.map +1 -1
- package/dist/commands/files.js +7 -4
- package/dist/commands/governor.js +22 -10
- package/dist/commands/inbox.d.ts +1 -1
- package/dist/commands/inbox.d.ts.map +1 -1
- package/dist/commands/inbox.js +55 -2
- package/dist/commands/rm.d.ts.map +1 -1
- package/dist/commands/rm.js +28 -4
- package/dist/commands/servers.d.ts.map +1 -1
- package/dist/commands/servers.js +26 -17
- package/dist/commands/supervisor.d.ts.map +1 -1
- package/dist/commands/supervisor.js +7 -2
- package/dist/commands/toc.d.ts +14 -0
- package/dist/commands/toc.d.ts.map +1 -1
- package/dist/commands/toc.js +7 -4
- package/dist/commands/tunnel.d.ts +15 -0
- package/dist/commands/tunnel.d.ts.map +1 -1
- package/dist/commands/tunnel.js +453 -153
- package/dist/commands/turn-rollback.d.ts +5 -0
- package/dist/commands/turn-rollback.d.ts.map +1 -0
- package/dist/commands/turn-rollback.js +76 -0
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +68 -30
- package/dist/core/agents/coord-client.d.ts.map +1 -1
- package/dist/core/agents/coord-client.js +18 -0
- package/dist/core/agents/live-authority-v3.d.ts +1 -0
- package/dist/core/agents/live-authority-v3.d.ts.map +1 -1
- package/dist/core/agents/live-authority-v3.js +11 -0
- package/dist/core/agents/live-lifecycle-v3.d.ts +4 -2
- package/dist/core/agents/live-lifecycle-v3.d.ts.map +1 -1
- package/dist/core/agents/live-lifecycle-v3.js +28 -7
- package/dist/core/agents/mailbox.d.ts +9 -8
- package/dist/core/agents/mailbox.d.ts.map +1 -1
- package/dist/core/agents/mailbox.js +24 -17
- package/dist/core/agents/render/prompt-context.d.ts +2 -0
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +8 -12
- package/dist/core/agents/render/session-context.d.ts +2 -8
- package/dist/core/agents/render/session-context.d.ts.map +1 -1
- package/dist/core/agents/render/session-context.js +7 -30
- package/dist/core/agents/rules/stop-hook.js +3 -3
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +25 -14
- package/dist/core/agents/state/live-coordination-writer.d.ts.map +1 -1
- package/dist/core/agents/state/live-coordination-writer.js +5 -0
- package/dist/core/agents/state/pidmap.d.ts.map +1 -1
- package/dist/core/agents/state/pidmap.js +5 -0
- package/dist/core/agents/state/proc-start.d.ts +19 -1
- package/dist/core/agents/state/proc-start.d.ts.map +1 -1
- package/dist/core/agents/state/proc-start.js +46 -1
- package/dist/core/agents/state/process-handle.d.ts +26 -0
- package/dist/core/agents/state/process-handle.d.ts.map +1 -0
- package/dist/core/agents/state/process-handle.js +121 -0
- package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
- package/dist/core/agents/state/stale-sweep.js +180 -70
- package/dist/core/agents/state/unchanged-file.d.ts +44 -0
- package/dist/core/agents/state/unchanged-file.d.ts.map +1 -0
- package/dist/core/agents/state/unchanged-file.js +390 -0
- package/dist/core/artifacts/delivery-card.d.ts.map +1 -1
- package/dist/core/artifacts/delivery-card.js +2 -1
- package/dist/core/context/index.d.ts +22 -10
- package/dist/core/context/index.d.ts.map +1 -1
- package/dist/core/context/index.js +381 -119
- package/dist/core/context/observation.d.ts +26 -0
- package/dist/core/context/observation.d.ts.map +1 -0
- package/dist/core/context/observation.js +11 -0
- package/dist/core/diagnostics/bundle.d.ts.map +1 -1
- package/dist/core/diagnostics/bundle.js +25 -14
- package/dist/core/diagnostics/path-identity.d.ts +3 -0
- package/dist/core/diagnostics/path-identity.d.ts.map +1 -0
- package/dist/core/diagnostics/path-identity.js +12 -0
- package/dist/core/diagnostics/sanitize.d.ts.map +1 -1
- package/dist/core/diagnostics/sanitize.js +4 -3
- package/dist/core/events/v3/authority-outbox.d.ts.map +1 -1
- package/dist/core/events/v3/authority-outbox.js +29 -0
- package/dist/core/events/v3/generation-custody.d.ts +5 -0
- package/dist/core/events/v3/generation-custody.d.ts.map +1 -0
- package/dist/core/events/v3/generation-custody.js +50 -0
- package/dist/core/events/v3/producers/coordination-recorder.d.ts +1 -0
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/coordination-recorder.js +7 -0
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/recorder.js +77 -64
- package/dist/core/governor/planning.d.ts.map +1 -1
- package/dist/core/governor/planning.js +14 -1
- package/dist/core/governor/service-read.d.ts +10 -2
- package/dist/core/governor/service-read.d.ts.map +1 -1
- package/dist/core/governor/service-read.js +105 -22
- package/dist/core/governor/service.d.ts +20 -2
- package/dist/core/governor/service.d.ts.map +1 -1
- package/dist/core/governor/service.js +72 -47
- package/dist/core/hooks/cli.js +33 -5
- package/dist/core/inbox/contract.d.ts +2 -1
- package/dist/core/inbox/contract.d.ts.map +1 -1
- package/dist/core/inbox/index.d.ts +2 -0
- package/dist/core/inbox/index.d.ts.map +1 -1
- package/dist/core/inbox/index.js +2 -0
- package/dist/core/inbox/peer-messages.d.ts +37 -0
- package/dist/core/inbox/peer-messages.d.ts.map +1 -0
- package/dist/core/inbox/peer-messages.js +72 -0
- package/dist/core/inbox/service.d.ts +8 -1
- package/dist/core/inbox/service.d.ts.map +1 -1
- package/dist/core/inbox/service.js +67 -21
- package/dist/core/inbox/targets.d.ts +22 -0
- package/dist/core/inbox/targets.d.ts.map +1 -0
- package/dist/core/inbox/targets.js +108 -0
- package/dist/core/inbox/watcher.js +7 -3
- package/dist/core/journal/index.d.ts.map +1 -1
- package/dist/core/journal/index.js +17 -2
- package/dist/core/resources/contract.d.ts +3 -0
- package/dist/core/resources/contract.d.ts.map +1 -1
- package/dist/core/resources/service-status.d.ts +14 -1
- package/dist/core/resources/service-status.d.ts.map +1 -1
- package/dist/core/resources/service-status.js +23 -13
- package/dist/core/resources/service.d.ts +7 -13
- package/dist/core/resources/service.d.ts.map +1 -1
- package/dist/core/resources/service.js +34 -91
- package/dist/core/resources/status.d.ts +2 -5
- package/dist/core/resources/status.d.ts.map +1 -1
- package/dist/core/resources/status.js +36 -7
- package/dist/core/semantic/service.d.ts.map +1 -1
- package/dist/core/semantic/service.js +2 -9
- package/dist/core/servers/index.d.ts +34 -22
- package/dist/core/servers/index.d.ts.map +1 -1
- package/dist/core/servers/index.js +297 -144
- package/dist/core/servers/tunnels.d.ts +7 -7
- package/dist/core/servers/tunnels.d.ts.map +1 -1
- package/dist/core/servers/tunnels.js +47 -10
- package/dist/core/supervisor/contract.d.ts +12 -0
- package/dist/core/supervisor/contract.d.ts.map +1 -1
- package/dist/core/supervisor/explanations.d.ts.map +1 -1
- package/dist/core/supervisor/explanations.js +2 -1
- package/dist/core/supervisor/findings.d.ts.map +1 -1
- package/dist/core/supervisor/findings.js +54 -9
- package/dist/core/supervisor/service.d.ts +7 -1
- package/dist/core/supervisor/service.d.ts.map +1 -1
- package/dist/core/supervisor/service.js +59 -29
- package/dist/core/supervisor/services.d.ts.map +1 -1
- package/dist/core/supervisor/services.js +22 -1
- package/dist/core/supervisor/status.d.ts +17 -2
- package/dist/core/supervisor/status.d.ts.map +1 -1
- package/dist/core/supervisor/status.js +70 -12
- package/dist/core/supervisor/timeline.d.ts.map +1 -1
- package/dist/core/supervisor/timeline.js +2 -1
- package/dist/core/turn-rollback/content.d.ts +53 -0
- package/dist/core/turn-rollback/content.d.ts.map +1 -0
- package/dist/core/turn-rollback/content.js +396 -0
- package/dist/core/turn-rollback/index.d.ts +72 -0
- package/dist/core/turn-rollback/index.d.ts.map +1 -0
- package/dist/core/turn-rollback/index.js +443 -0
- package/dist/core/work/state.js +7 -7
- package/dist/core/workflow/engine.d.ts.map +1 -1
- package/dist/core/workflow/engine.js +105 -32
- package/dist/core/workflow/failure-evidence.d.ts +16 -0
- package/dist/core/workflow/failure-evidence.d.ts.map +1 -0
- package/dist/core/workflow/failure-evidence.js +114 -0
- package/dist/core/workflow/index.d.ts +5 -3
- package/dist/core/workflow/index.d.ts.map +1 -1
- package/dist/core/workflow/index.js +3 -2
- package/dist/core/workflow/live-session-v3.d.ts +6 -0
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -1
- package/dist/core/workflow/live-session-v3.js +126 -5
- package/dist/core/workflow/proof.d.ts +5 -5
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +115 -20
- package/dist/core/workflow/recovery-audit.d.ts +30 -0
- package/dist/core/workflow/recovery-audit.d.ts.map +1 -0
- package/dist/core/workflow/recovery-audit.js +116 -0
- package/dist/core/workflow/run-state.d.ts +20 -1
- package/dist/core/workflow/run-state.d.ts.map +1 -1
- package/dist/core/workflow/run-state.js +141 -32
- package/dist/core/workflow/spawn-claude.d.ts.map +1 -1
- package/dist/core/workflow/spawn-claude.js +19 -0
- package/dist/core/workflow/spawn-codex.d.ts.map +1 -1
- package/dist/core/workflow/spawn-codex.js +13 -0
- package/dist/core/workflow/spawn-cursor.d.ts.map +1 -1
- package/dist/core/workflow/spawn-cursor.js +19 -0
- package/dist/core/workflow/spawn-opencode.d.ts.map +1 -1
- package/dist/core/workflow/spawn-opencode.js +14 -0
- package/dist/core/workflow/types.d.ts +64 -17
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/index.d.ts +0 -1
- package/dist/core/workflow/workspaces/index.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/index.js +0 -1
- package/dist/core/workflow/workspaces/leases.d.ts +3 -1
- package/dist/core/workflow/workspaces/leases.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/leases.js +30 -16
- package/dist/core/workflow/workspaces/local-git.d.ts +6 -2
- package/dist/core/workflow/workspaces/local-git.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/local-git.js +328 -8
- package/dist/core/workflow/workspaces/ownership.d.ts +11 -0
- package/dist/core/workflow/workspaces/ownership.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/ownership.js +194 -0
- package/dist/core/workflow/workspaces/reclaim.d.ts +40 -0
- package/dist/core/workflow/workspaces/reclaim.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/reclaim.js +14 -0
- package/dist/core/workflow/workspaces/recovery.d.ts +2 -0
- package/dist/core/workflow/workspaces/recovery.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/recovery.js +42 -10
- package/dist/core/workflow/workspaces/state.d.ts +1 -0
- package/dist/core/workflow/workspaces/state.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/state.js +21 -1
- package/dist/lib/browser/windows-chrome.d.ts +100 -12
- package/dist/lib/browser/windows-chrome.d.ts.map +1 -1
- package/dist/lib/browser/windows-chrome.js +262 -73
- package/dist/lib/docs-links.d.ts.map +1 -1
- package/dist/lib/docs-links.js +45 -2
- package/dist/lib/guarded-remove.d.ts +7 -0
- package/dist/lib/guarded-remove.d.ts.map +1 -1
- package/dist/lib/guarded-remove.js +106 -12
- package/dist/lib/identities/assume.d.ts.map +1 -1
- package/dist/lib/identities/assume.js +4 -0
- package/dist/lib/tunnel/state.d.ts +13 -6
- package/dist/lib/tunnel/state.d.ts.map +1 -1
- package/dist/lib/tunnel/state.js +58 -12
- package/dist/lib/zip/index.d.ts +41 -0
- package/dist/lib/zip/index.d.ts.map +1 -0
- package/dist/lib/zip/index.js +398 -0
- package/package.json +12 -1
- package/src/commander.ts +10 -0
- package/src/commands/agents.ts +54 -63
- package/src/commands/browse.ts +50 -14
- package/src/commands/diagnostics.ts +10 -0
- package/src/commands/doctor.ts +26 -7
- package/src/commands/files.ts +13 -5
- package/src/commands/governor.ts +23 -10
- package/src/commands/inbox.ts +52 -2
- package/src/commands/rm.ts +43 -4
- package/src/commands/servers.ts +27 -26
- package/src/commands/supervisor.ts +7 -2
- package/src/commands/toc.ts +14 -6
- package/src/commands/tunnel.ts +533 -166
- package/src/commands/turn-rollback.ts +111 -0
- package/src/commands/workflow.ts +89 -30
- package/src/core/agents/coord-client.ts +20 -0
- package/src/core/agents/live-authority-v3.ts +17 -0
- package/src/core/agents/live-lifecycle-v3.ts +52 -14
- package/src/core/agents/mailbox.ts +26 -17
- package/src/core/agents/render/prompt-context.ts +10 -12
- package/src/core/agents/render/session-context.ts +9 -32
- package/src/core/agents/rules/stop-hook.ts +3 -3
- package/src/core/agents/state/heartbeat-writer.ts +29 -12
- package/src/core/agents/state/live-coordination-writer.ts +29 -0
- package/src/core/agents/state/pidmap.ts +13 -0
- package/src/core/agents/state/proc-start.ts +62 -2
- package/src/core/agents/state/process-handle.ts +165 -0
- package/src/core/agents/state/stale-sweep.ts +247 -82
- package/src/core/agents/state/unchanged-file.ts +456 -0
- package/src/core/artifacts/delivery-card.ts +7 -1
- package/src/core/context/index.ts +446 -136
- package/src/core/context/observation.ts +29 -0
- package/src/core/diagnostics/bundle.ts +23 -18
- package/src/core/diagnostics/path-identity.ts +15 -0
- package/src/core/diagnostics/sanitize.ts +4 -3
- package/src/core/events/v3/authority-outbox.ts +56 -0
- package/src/core/events/v3/generation-custody.ts +59 -0
- package/src/core/events/v3/producers/coordination-recorder.ts +15 -0
- package/src/core/events/v3/producers/recorder.ts +94 -68
- package/src/core/governor/planning.ts +20 -8
- package/src/core/governor/service-read.ts +128 -20
- package/src/core/governor/service.ts +119 -42
- package/src/core/hooks/cli.ts +33 -5
- package/src/core/inbox/contract.ts +2 -1
- package/src/core/inbox/index.ts +2 -0
- package/src/core/inbox/peer-messages.ts +94 -0
- package/src/core/inbox/service.ts +88 -22
- package/src/core/inbox/targets.ts +148 -0
- package/src/core/inbox/watcher.ts +8 -9
- package/src/core/journal/index.ts +19 -2
- package/src/core/resources/contract.ts +4 -0
- package/src/core/resources/service-status.ts +35 -12
- package/src/core/resources/service.ts +57 -95
- package/src/core/resources/status.ts +57 -8
- package/src/core/semantic/service.ts +2 -8
- package/src/core/servers/index.ts +376 -141
- package/src/core/servers/tunnels.ts +57 -13
- package/src/core/supervisor/contract.ts +13 -0
- package/src/core/supervisor/explanations.ts +4 -1
- package/src/core/supervisor/findings.ts +68 -10
- package/src/core/supervisor/service.ts +87 -26
- package/src/core/supervisor/services.ts +26 -8
- package/src/core/supervisor/status.ts +89 -12
- package/src/core/supervisor/timeline.ts +2 -1
- package/src/core/turn-rollback/content.ts +499 -0
- package/src/core/turn-rollback/index.ts +580 -0
- package/src/core/work/state.ts +7 -7
- package/src/core/workflow/engine.ts +131 -49
- package/src/core/workflow/failure-evidence.ts +141 -0
- package/src/core/workflow/index.ts +12 -2
- package/src/core/workflow/live-session-v3.ts +146 -5
- package/src/core/workflow/proof.ts +134 -26
- package/src/core/workflow/recovery-audit.ts +181 -0
- package/src/core/workflow/run-state.ts +165 -34
- package/src/core/workflow/spawn-claude.ts +18 -0
- package/src/core/workflow/spawn-codex.ts +13 -0
- package/src/core/workflow/spawn-cursor.ts +18 -0
- package/src/core/workflow/spawn-opencode.ts +14 -0
- package/src/core/workflow/types.ts +51 -17
- package/src/core/workflow/workspaces/index.ts +0 -1
- package/src/core/workflow/workspaces/leases.ts +48 -17
- package/src/core/workflow/workspaces/local-git.ts +388 -7
- package/src/core/workflow/workspaces/ownership.ts +232 -0
- package/src/core/workflow/workspaces/reclaim.ts +62 -0
- package/src/core/workflow/workspaces/recovery.ts +45 -10
- package/src/core/workflow/workspaces/state.ts +20 -0
- package/src/lib/browser/windows-chrome.ts +346 -86
- package/src/lib/docs-links.ts +49 -2
- package/src/lib/guarded-remove.ts +132 -14
- package/src/lib/identities/assume.ts +4 -0
- package/src/lib/tunnel/state.ts +70 -15
- package/src/lib/zip/index.ts +483 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { type ProcessGenerationSignalDependencies, type ProcessGenerationVerdict } from "../agents/state/proc-start.js";
|
|
1
2
|
import { type ResourceServiceStatus, type ResourceServiceStatusRecord } from "./contract.js";
|
|
2
3
|
import { sampleResources } from "./sampler.js";
|
|
4
|
+
import { type ResourceProcessDependencies } from "./service-status.js";
|
|
3
5
|
export declare const RESOURCE_SERVICE_DEFAULT_INTERVAL_MS = 2000;
|
|
4
6
|
export interface RunResourceServiceInput {
|
|
5
7
|
coordRoot: string;
|
|
@@ -9,18 +11,10 @@ export interface RunResourceServiceInput {
|
|
|
9
11
|
sample?: typeof sampleResources;
|
|
10
12
|
wait?: (milliseconds: number) => Promise<void>;
|
|
11
13
|
}
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
status: ResourceServiceStatus;
|
|
18
|
-
error: string;
|
|
19
|
-
};
|
|
20
|
-
export declare function spawnResourceService(coordRootRaw: string, options?: {
|
|
21
|
-
intervalMs?: number;
|
|
22
|
-
}): Promise<ResourceServiceStatus>;
|
|
23
|
-
export declare function ensureResourceServiceRunning(coordRoot: string): Promise<EnsureResourceServiceResult>;
|
|
24
|
-
export declare function requestResourceServiceStop(coordRootRaw: string): ResourceServiceStatus;
|
|
14
|
+
export interface ResourceServiceStopResult extends ResourceServiceStatus {
|
|
15
|
+
signal_sent: boolean;
|
|
16
|
+
signal_verdict: ProcessGenerationVerdict;
|
|
17
|
+
}
|
|
18
|
+
export declare function requestResourceServiceStop(coordRootRaw: string, dependencies?: ResourceProcessDependencies & ProcessGenerationSignalDependencies): ResourceServiceStopResult;
|
|
25
19
|
export declare function runResourceService(input: RunResourceServiceInput): Promise<ResourceServiceStatusRecord>;
|
|
26
20
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/core/resources/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/core/resources/service.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAG9B,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EACjC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EACL,KAAK,2BAA2B,EAGjC,MAAM,qBAAqB,CAAC;AAG7B,eAAO,MAAM,oCAAoC,OAAQ,CAAC;AAY1D,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,eAAe,CAAC;IAChC,IAAI,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB;IACtE,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,wBAAwB,CAAC;CAC1C;AAED,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,EACpB,YAAY,GAAE,2BAA2B,GAAG,mCAAwC,GACnF,yBAAyB,CAuB3B;AAED,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,2BAA2B,CAAC,CA4FtC"}
|
|
@@ -1,103 +1,43 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
1
|
import { randomUUID } from "node:crypto";
|
|
3
2
|
import { closeSync, existsSync, mkdirSync, openSync, readFileSync, rmSync, unlinkSync, writeFileSync, } from "node:fs";
|
|
4
|
-
import { hostname
|
|
3
|
+
import { hostname } from "node:os";
|
|
5
4
|
import { resolve } from "node:path";
|
|
6
|
-
import {
|
|
5
|
+
import { processStartToken, signalIfSameGeneration, } from "../agents/state/proc-start.js";
|
|
6
|
+
import { resolveBinName } from "../config.js";
|
|
7
7
|
import { closeProcessLoggers, legacyLogFields, processLogger } from "../storage/logger.js";
|
|
8
8
|
import { stateDirMode, stateFileMode } from "../storage/modes.js";
|
|
9
9
|
import { RESOURCE_SERVICE_STATUS_SCHEMA_VERSION, } from "./contract.js";
|
|
10
10
|
import { sampleResources } from "./sampler.js";
|
|
11
|
-
import { readResourceServiceStatus } from "./service-status.js";
|
|
11
|
+
import { readResourceServiceStatus, resourceProcessLiveness, } from "./service-status.js";
|
|
12
12
|
import { resourcePaths, writePrivateJsonAtomic } from "./storage.js";
|
|
13
13
|
export const RESOURCE_SERVICE_DEFAULT_INTERVAL_MS = 2_000;
|
|
14
14
|
const RESOURCE_SERVICE_MIN_INTERVAL_MS = 500;
|
|
15
15
|
const RESOURCE_SERVICE_MAX_INTERVAL_MS = 60_000;
|
|
16
|
-
export
|
|
16
|
+
export function requestResourceServiceStop(coordRootRaw, dependencies = {}) {
|
|
17
17
|
const coordRoot = resolve(coordRootRaw);
|
|
18
|
-
const current = readResourceServiceStatus(coordRoot);
|
|
19
|
-
if (current.running) {
|
|
20
|
-
throw new Error(`resource observer is already running under pid ${current.record?.pid}`);
|
|
21
|
-
}
|
|
22
|
-
const intervalMs = normalizeInterval(options.intervalMs);
|
|
23
18
|
const paths = resourcePaths(coordRoot);
|
|
24
|
-
|
|
25
|
-
rmSync(paths.stop, { force: true });
|
|
26
|
-
const harnBin = new URL("../../../bin/harn", import.meta.url).pathname;
|
|
27
|
-
if (!existsSync(harnBin))
|
|
28
|
-
throw new Error(`cannot find harn executable at ${harnBin}`);
|
|
29
|
-
let spawnError;
|
|
30
|
-
const child = spawn(harnBin, ["resources", "service", "daemon", "--root", coordRoot, "--interval-ms", String(intervalMs)], {
|
|
31
|
-
cwd: coordRoot,
|
|
32
|
-
detached: true,
|
|
33
|
-
stdio: ["ignore", "ignore", "ignore"],
|
|
34
|
-
env: {
|
|
35
|
-
...process.env,
|
|
36
|
-
HARNERY_COORD_ROOT_OVERRIDE: coordRoot,
|
|
37
|
-
HARNERY_OUTPUT_SESSION_TEE: "0",
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
child.once("error", (error) => {
|
|
41
|
-
spawnError = error;
|
|
42
|
-
});
|
|
43
|
-
child.unref();
|
|
44
|
-
const deadline = Date.now() + 5_000;
|
|
45
|
-
while (Date.now() < deadline) {
|
|
46
|
-
await delay(50);
|
|
47
|
-
if (spawnError)
|
|
48
|
-
throw spawnError;
|
|
49
|
-
const status = readResourceServiceStatus(coordRoot);
|
|
50
|
-
if (status.running && status.record?.pid === child.pid)
|
|
51
|
-
return status;
|
|
52
|
-
if (child.exitCode !== null)
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
throw new Error(`resource observer failed to start; inspect ${paths.service}`);
|
|
56
|
-
}
|
|
57
|
-
export async function ensureResourceServiceRunning(coordRoot) {
|
|
58
|
-
const status = readResourceServiceStatus(coordRoot);
|
|
59
|
-
if (status.running)
|
|
60
|
-
return { state: "running", status };
|
|
61
|
-
if (platform() !== "linux") {
|
|
62
|
-
return {
|
|
63
|
-
state: "unsupported",
|
|
64
|
-
status,
|
|
65
|
-
error: `resource observer does not yet support ${platform()}`,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
try {
|
|
69
|
-
const started = await spawnResourceService(coordRoot);
|
|
70
|
-
return { state: "started", status: started };
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
return {
|
|
74
|
-
state: "unavailable",
|
|
75
|
-
status: readResourceServiceStatus(coordRoot),
|
|
76
|
-
error: error instanceof Error ? error.message : String(error),
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
export function requestResourceServiceStop(coordRootRaw) {
|
|
81
|
-
const coordRoot = resolve(coordRootRaw);
|
|
82
|
-
const paths = resourcePaths(coordRoot);
|
|
83
|
-
const status = readResourceServiceStatus(coordRoot);
|
|
19
|
+
const status = readResourceServiceStatus(coordRoot, Date.now(), dependencies);
|
|
84
20
|
mkdirSync(paths.root, { recursive: true, mode: stateDirMode() });
|
|
85
21
|
writePrivateJsonAtomic(paths.stop, {
|
|
86
22
|
requested_at: new Date().toISOString(),
|
|
87
23
|
requested_by_pid: process.pid,
|
|
88
24
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
return readResourceServiceStatus(coordRoot);
|
|
25
|
+
const signal = status.liveness === "running" && status.record?.host === hostname()
|
|
26
|
+
? signalIfSameGeneration(status.record.pid, status.record.start_token, "SIGTERM", dependencies)
|
|
27
|
+
: { sent: false, verdict: status.generation };
|
|
28
|
+
return {
|
|
29
|
+
...readResourceServiceStatus(coordRoot, Date.now(), dependencies),
|
|
30
|
+
signal_sent: signal.sent,
|
|
31
|
+
signal_verdict: signal.verdict,
|
|
32
|
+
};
|
|
98
33
|
}
|
|
99
34
|
export async function runResourceService(input) {
|
|
100
35
|
const coordRoot = resolve(input.coordRoot);
|
|
36
|
+
const current = readResourceServiceStatus(coordRoot);
|
|
37
|
+
if (current.liveness === "unknown")
|
|
38
|
+
throw unknownResourceOwnerError();
|
|
39
|
+
if (current.liveness === "running")
|
|
40
|
+
throw new Error(`resource observer is already running under pid ${current.record?.pid}`);
|
|
101
41
|
const paths = resourcePaths(coordRoot);
|
|
102
42
|
const intervalMs = normalizeInterval(input.intervalMs);
|
|
103
43
|
const now = input.now ?? (() => new Date());
|
|
@@ -212,7 +152,10 @@ function acquireLease(coordRoot, now) {
|
|
|
212
152
|
if (error.code !== "EEXIST")
|
|
213
153
|
throw error;
|
|
214
154
|
const existing = readLease(paths.lease);
|
|
215
|
-
|
|
155
|
+
const liveness = existing ? leaseIsLive(existing) : "unknown";
|
|
156
|
+
if (liveness === "unknown")
|
|
157
|
+
throw unknownResourceOwnerError();
|
|
158
|
+
if (existing && liveness === "running") {
|
|
216
159
|
throw new Error(`resource observer lease is held by pid ${existing.pid}`);
|
|
217
160
|
}
|
|
218
161
|
try {
|
|
@@ -239,7 +182,13 @@ function releaseLease(path, nonce) {
|
|
|
239
182
|
function readLease(path) {
|
|
240
183
|
try {
|
|
241
184
|
const value = JSON.parse(readFileSync(path, "utf8"));
|
|
242
|
-
return value &&
|
|
185
|
+
return value &&
|
|
186
|
+
Number.isSafeInteger(value.pid) &&
|
|
187
|
+
value.pid > 0 &&
|
|
188
|
+
typeof value.host === "string" &&
|
|
189
|
+
value.host.length > 0 &&
|
|
190
|
+
typeof value.nonce === "string" &&
|
|
191
|
+
value.nonce.length > 0
|
|
243
192
|
? value
|
|
244
193
|
: undefined;
|
|
245
194
|
}
|
|
@@ -248,16 +197,10 @@ function readLease(path) {
|
|
|
248
197
|
}
|
|
249
198
|
}
|
|
250
199
|
function leaseIsLive(lease) {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
catch (error) {
|
|
257
|
-
if (error.code !== "EPERM")
|
|
258
|
-
return false;
|
|
259
|
-
}
|
|
260
|
-
return checkPidToken(lease.pid, lease.start_token) !== "mismatch";
|
|
200
|
+
return resourceProcessLiveness(lease).liveness;
|
|
201
|
+
}
|
|
202
|
+
function unknownResourceOwnerError() {
|
|
203
|
+
return new Error(`resource observer process identity is unknown; run ${resolveBinName()} supervisor stop to write the durable stop request before starting again`);
|
|
261
204
|
}
|
|
262
205
|
function log(coordRoot, event, fields, error) {
|
|
263
206
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PressureAssessment, type PressureHysteresisState } from "../diagnostics/contract.js";
|
|
2
|
-
import { type SupervisorCapability, type SupervisorPressureRecord } from "../supervisor/contract.js";
|
|
2
|
+
import { type SupervisorCapability, type SupervisorPressureRecord, type SupervisorStatus } from "../supervisor/contract.js";
|
|
3
3
|
import { type ResourceDiskSample, type ResourceHostSample, type ResourceIoSample, type ResourceMachineSample, type ResourceOomSample, type ResourcePressureSample, type ResourceProcessSample, type ResourceSnapshot } from "./contract.js";
|
|
4
4
|
export declare const RESOURCE_STATUS_STALE_MS = 15000;
|
|
5
5
|
export declare const RESOURCE_STATUS_MAX_BYTES: number;
|
|
@@ -15,10 +15,7 @@ export interface ResourceStatus {
|
|
|
15
15
|
platform: NodeJS.Platform | null;
|
|
16
16
|
namespace: ResourceSnapshot["namespace"];
|
|
17
17
|
support: ResourceSnapshot["support"] | null;
|
|
18
|
-
writer:
|
|
19
|
-
running: boolean;
|
|
20
|
-
stale: boolean;
|
|
21
|
-
};
|
|
18
|
+
writer: Pick<SupervisorStatus, "running" | "stale" | "generation" | "liveness" | "running_build" | "installed_build" | "restart_needed" | "build_status">;
|
|
22
19
|
/**
|
|
23
20
|
* The one published pressure assessment, read from the observer's record so
|
|
24
21
|
* this surface, the prompt notice, the dashboard, and a diagnostic bundle all
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/core/resources/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/core/resources/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,k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C;IAC9B,EAAE,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,KAAK,CACf,IAAI,CACF,qBAAqB,EACrB,KAAK,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,CACzE,CACF,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3D,cAAc,CA8HhB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAsBpE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CA6EhF;AAaD,eAAO,MAAM,yBAAyB,QAAa,CAAC;AAEpD,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,gBAAgB,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACjD,UAAU,EAAE,oBAAoB,CAAC;IACjC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CAAC;CACzC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,KAAK,SAAa,EAClB,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAChC,iBAAiB,CAkFnB"}
|
|
@@ -2,7 +2,7 @@ import { closeSync, fstatSync, openSync, readSync, statSync } from "node:fs";
|
|
|
2
2
|
import { unknownPressureAssessment } from "../diagnostics/advice.js";
|
|
3
3
|
import { PRESSURE_ASSESSMENT_SCHEMA_VERSION, PRESSURE_POLICY, } from "../diagnostics/contract.js";
|
|
4
4
|
import { SUPERVISOR_PRESSURE_SCHEMA_VERSION, } from "../supervisor/contract.js";
|
|
5
|
-
import { readSupervisorStatus } from "../supervisor/status.js";
|
|
5
|
+
import { installedSupervisorBuild, readSupervisorStatus } from "../supervisor/status.js";
|
|
6
6
|
import { supervisorPaths } from "../supervisor/storage.js";
|
|
7
7
|
import { RESOURCE_SNAPSHOT_SCHEMA_VERSION, } from "./contract.js";
|
|
8
8
|
import { resourcePaths } from "./storage.js";
|
|
@@ -156,11 +156,13 @@ export function formatResourceSummary(status) {
|
|
|
156
156
|
? "unknown"
|
|
157
157
|
: `${formatBytes(m.memory_available_bytes)} available`;
|
|
158
158
|
const diskText = disk ? `${formatBytes(disk.available_bytes)} available` : "unknown";
|
|
159
|
-
return `${lead} ${status.namespace}/${status.platform}: CPU ${cpu}, RAM ${ram}, disk ${diskText}; ${Math.round((status.sample_age_ms ?? 0) / 1_000)}s old${status.support?.state === "partial" ? "; partial" : ""}${!status.writer.running ? "
|
|
159
|
+
return `${lead} ${status.namespace}/${status.platform}: CPU ${cpu}, RAM ${ram}, disk ${diskText}; ${Math.round((status.sample_age_ms ?? 0) / 1_000)}s old${status.support?.state === "partial" ? "; partial" : ""}${!status.writer.running ? `; writer ${status.writer.liveness === "unknown" ? "unknown" : status.writer.stale ? "stale" : "stopped"}` : ""}.`;
|
|
160
160
|
}
|
|
161
161
|
export function formatResourceStatus(status, bin) {
|
|
162
162
|
const a = status.assessment;
|
|
163
163
|
const lines = [formatResourceSummary(status)];
|
|
164
|
+
const writer = status.writer;
|
|
165
|
+
lines.push(`Writer: ${writer.liveness}; generation ${writer.generation}; running build ${writer.running_build ? `${writer.running_build.version} (${writer.running_build.revision})` : "unknown"}; installed build ${writer.installed_build.version} (${writer.installed_build.revision}); ${writer.build_status}.`);
|
|
164
166
|
lines.push(`Assessment: ${a.state} at ${a.scope} scope; limiting resource ${a.limiting_resource}; trend ${a.trend}; evidence ${a.evidence_state}; recommended action ${a.recommended_action}.`);
|
|
165
167
|
lines.push(`Evidence age: ${a.sample_age_ms === null ? "unknown" : `${Math.round(a.sample_age_ms / 1_000)}s`}; assessment source ${status.assessment_capability.state}${status.assessment_capability.reason_code ? ` (${status.assessment_capability.reason_code})` : ""}.`);
|
|
166
168
|
for (const item of a.reasons)
|
|
@@ -176,7 +178,9 @@ export function formatResourceStatus(status, bin) {
|
|
|
176
178
|
}
|
|
177
179
|
if (a.unattributed_memory_percent !== null)
|
|
178
180
|
lines.push(`Unattributed memory: ${Math.round(a.unattributed_memory_percent)}% of machine memory has no validated owner.`);
|
|
179
|
-
if (status.
|
|
181
|
+
if (status.writer.liveness === "unknown")
|
|
182
|
+
lines.push(`Inspect the writer with ${bin} supervisor status. Run ${bin} supervisor stop to write its durable stop request before starting again.`);
|
|
183
|
+
else if (status.state !== "fresh" || !status.writer.running)
|
|
180
184
|
lines.push(`Start or inspect the writer with ${bin} supervisor start --keep-alive and ${bin} supervisor status.`);
|
|
181
185
|
if (status.host)
|
|
182
186
|
lines.push(`Windows host: ${status.host.state}${status.host.machine ? `; CPU ${status.host.machine.cpu_percent === null ? "warming up" : `${Math.round(status.host.machine.cpu_percent)}%`}, RAM ${status.host.machine.memory_available_bytes === null ? "unknown" : `${formatBytes(status.host.machine.memory_available_bytes)} available`}` : `; ${status.host.reason ?? "unavailable"}`}`);
|
|
@@ -238,7 +242,11 @@ export function readPublishedPressure(coordRoot, nowMs = Date.now(), writer) {
|
|
|
238
242
|
});
|
|
239
243
|
// A record can only be trusted while its writer is alive. Every surface makes
|
|
240
244
|
// the same check here so none of them reports a state the others do not.
|
|
241
|
-
|
|
245
|
+
const observer = writer ?? readWriterState(coordRoot, nowMs);
|
|
246
|
+
if (observer.liveness === "unknown") {
|
|
247
|
+
return gap("error", "pressure_observer_unknown", "Local resource pressure cannot be determined because the resource observer's process identity is unknown.");
|
|
248
|
+
}
|
|
249
|
+
if (!observer.running) {
|
|
242
250
|
return gap("expired", "pressure_observer_not_running", "Local resource pressure cannot be determined because the resource observer is not running.");
|
|
243
251
|
}
|
|
244
252
|
const path = supervisorPaths(coordRoot).pressure;
|
|
@@ -275,20 +283,41 @@ function readWriterState(coordRoot, nowMs) {
|
|
|
275
283
|
// Keep malformed service metadata from making the read expensive. The shared
|
|
276
284
|
// status reader retains ownership of PID/start-token liveness checks.
|
|
277
285
|
if (statSync(supervisorPaths(coordRoot).service).size > 65_536) {
|
|
278
|
-
return
|
|
286
|
+
return unknownWriterState();
|
|
279
287
|
}
|
|
280
288
|
const writer = readSupervisorStatus(coordRoot, nowMs);
|
|
281
289
|
const futureHeartbeat = writer.record && Date.parse(writer.record.heartbeat_at) > nowMs + FUTURE_TOLERANCE_MS;
|
|
282
290
|
return {
|
|
283
291
|
running: writer.running && !futureHeartbeat,
|
|
284
292
|
stale: writer.stale || !!futureHeartbeat,
|
|
293
|
+
generation: writer.generation,
|
|
294
|
+
liveness: writer.liveness,
|
|
295
|
+
running_build: writer.running_build,
|
|
296
|
+
installed_build: writer.installed_build,
|
|
297
|
+
restart_needed: writer.restart_needed,
|
|
298
|
+
build_status: writer.build_status,
|
|
285
299
|
};
|
|
286
300
|
}
|
|
287
|
-
catch {
|
|
301
|
+
catch (error) {
|
|
288
302
|
// A missing writer must not break normal coordination.
|
|
289
|
-
return {
|
|
303
|
+
return {
|
|
304
|
+
...unknownWriterState(),
|
|
305
|
+
liveness: error.code === "ENOENT" ? "stopped" : "unknown",
|
|
306
|
+
};
|
|
290
307
|
}
|
|
291
308
|
}
|
|
309
|
+
function unknownWriterState() {
|
|
310
|
+
return {
|
|
311
|
+
running: false,
|
|
312
|
+
stale: false,
|
|
313
|
+
generation: "unknown",
|
|
314
|
+
liveness: "unknown",
|
|
315
|
+
running_build: null,
|
|
316
|
+
installed_build: installedSupervisorBuild(),
|
|
317
|
+
restart_needed: true,
|
|
318
|
+
build_status: "running build unknown; restart needed",
|
|
319
|
+
};
|
|
320
|
+
}
|
|
292
321
|
function validPressureRecord(v) {
|
|
293
322
|
if (!object(v) ||
|
|
294
323
|
v.schema_version !== SUPERVISOR_PRESS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AM,WAAW,iCAAiC;IAChD,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,qBAAqB,CAAC;IACzD,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC7D,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CAC1C;AAED,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAO,GACtC,OAAO,CAAC,qBAAqB,CAAC,CAgDhC;AAED;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAChD,YAAY,EAAE,MAAM,EACpB,SAAS,GAAE,OAAO,CAAC,iCAAiC,CAAM,GACzD,OAAO,CAAC,2BAA2B,CAAC,CAsBtC;AAED,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,qBAAqB,CAUtF;AAED,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,2BAA2B,CAAC,CA8MtC;AAED,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,IAAI,CAuC5E;AAmID,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,QAAQ,GAAG,QAAQ,CAerB"}
|
|
@@ -132,20 +132,13 @@ export async function ensureSemanticServiceRunning(coordRootRaw, overrides = {})
|
|
|
132
132
|
}
|
|
133
133
|
export function requestSemanticServiceStop(coordRootRaw) {
|
|
134
134
|
const coordRoot = resolve(coordRootRaw);
|
|
135
|
-
const status = readSemanticServiceStatus(coordRoot);
|
|
136
135
|
mkdirSync(semanticPaths(coordRoot).root, { recursive: true, mode: stateDirMode() });
|
|
137
136
|
writePrivateJsonAtomic(semanticPaths(coordRoot).stop, {
|
|
138
137
|
requested_at: new Date().toISOString(),
|
|
139
138
|
requested_by_pid: process.pid,
|
|
140
139
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
process.kill(status.record.pid, "SIGTERM");
|
|
144
|
-
}
|
|
145
|
-
catch {
|
|
146
|
-
// The durable stop request remains for a racing or restarted daemon.
|
|
147
|
-
}
|
|
148
|
-
}
|
|
140
|
+
// This record has no generation witness. The durable request is the stop
|
|
141
|
+
// authority; a numeric PID cannot authorize an additional signal.
|
|
149
142
|
return readSemanticServiceStatus(coordRoot);
|
|
150
143
|
}
|
|
151
144
|
export async function runSemanticServiceDaemon(input) {
|
|
@@ -14,21 +14,25 @@
|
|
|
14
14
|
* for `gc` once its starting agent has ended or been unobserved for a long
|
|
15
15
|
* time AND nobody has used the server for the idle window.
|
|
16
16
|
*
|
|
17
|
-
* Fail-closed rules: a record whose pid was recycled is
|
|
18
|
-
*
|
|
17
|
+
* Fail-closed rules: a record whose pid was recycled is never signalled;
|
|
18
|
+
* an unreadable start token or coordination view is `unknown`,
|
|
19
19
|
* which `gc` never stops; a record without an owner is never stopped
|
|
20
20
|
* automatically.
|
|
21
21
|
*/
|
|
22
|
+
import { type ProcessGenerationSignalDependencies, type ProcessGenerationVerdict } from "../agents/state/proc-start.js";
|
|
22
23
|
import { type ScanSupport } from "./net.js";
|
|
24
|
+
export { processStartToken, signalIfSameGeneration, verifyProcessGeneration, } from "../agents/state/proc-start.js";
|
|
25
|
+
export { acquireNoClobberLease } from "../workflow/workspaces/leases.js";
|
|
23
26
|
export { ancestry, establishedConnectionCounts, listListeningPorts, listListeningSockets, lsofConnectionCounts, lsofListeningSockets, parseElapsed, parseLsofListen, parseProcNetTcp, processStartedAt, psProcessInfo, readProcessInfo, scanSupport, } from "./net.js";
|
|
24
|
-
export { tunnelServerId, tunnelServerInput } from "./tunnels.js";
|
|
25
|
-
export declare const SERVER_RECORD_SCHEMA_VERSION =
|
|
27
|
+
export { createTunnelReadinessVerifier, tunnelServerId, tunnelServerInput } from "./tunnels.js";
|
|
28
|
+
export declare const SERVER_RECORD_SCHEMA_VERSION = 2;
|
|
26
29
|
export declare const SERVER_DEFAULT_IDLE_HOURS = 2;
|
|
27
30
|
export declare const SERVER_DEFAULT_OWNER_STALE_HOURS = 24;
|
|
28
31
|
export type ServerKind = "service" | "session";
|
|
29
32
|
export interface ServerRecord {
|
|
30
33
|
schema_version: typeof SERVER_RECORD_SCHEMA_VERSION;
|
|
31
34
|
id: string;
|
|
35
|
+
registration_id: string;
|
|
32
36
|
kind: ServerKind;
|
|
33
37
|
/** Free-form family name: `preview`, `tunnel`, `dashboard`, ... */
|
|
34
38
|
type: string;
|
|
@@ -40,13 +44,13 @@ export interface ServerRecord {
|
|
|
40
44
|
start_token?: string;
|
|
41
45
|
/** Further processes that belong to this server (helpers, children). */
|
|
42
46
|
pids?: number[];
|
|
47
|
+
/** Generation witnesses captured when the further processes registered. */
|
|
48
|
+
pids_start_tokens?: Record<string, string>;
|
|
43
49
|
host: string;
|
|
44
50
|
/** What the server serves, usually a directory. */
|
|
45
51
|
scope?: string;
|
|
46
52
|
cwd?: string;
|
|
47
53
|
log?: string;
|
|
48
|
-
/** Graceful stop command; signals are the fallback. */
|
|
49
|
-
stop_argv?: string[];
|
|
50
54
|
owner?: {
|
|
51
55
|
instance_id: string;
|
|
52
56
|
name?: string;
|
|
@@ -63,11 +67,12 @@ export interface RegisterServerInput {
|
|
|
63
67
|
url?: string;
|
|
64
68
|
port?: number;
|
|
65
69
|
pid?: number;
|
|
70
|
+
/** Preserve an observed witness when adopting, rather than probing a new generation. */
|
|
71
|
+
start_token?: string;
|
|
66
72
|
pids?: number[];
|
|
67
73
|
scope?: string;
|
|
68
74
|
cwd?: string;
|
|
69
75
|
log?: string;
|
|
70
|
-
stop_argv?: string[];
|
|
71
76
|
started_at?: string;
|
|
72
77
|
/** `null` records no owner; omitted resolves the calling agent session. */
|
|
73
78
|
owner?: {
|
|
@@ -78,7 +83,7 @@ export interface RegisterServerInput {
|
|
|
78
83
|
export interface ServerOptions {
|
|
79
84
|
coordRoot?: string | null;
|
|
80
85
|
}
|
|
81
|
-
export type ServerState = "running" | "dead" | "other-host";
|
|
86
|
+
export type ServerState = "running" | "dead" | "other-host" | "unknown";
|
|
82
87
|
export type OwnerState = "live" | "abandoned" | "ended" | "unknown" | "none";
|
|
83
88
|
export interface ServerView {
|
|
84
89
|
record: ServerRecord;
|
|
@@ -90,6 +95,8 @@ export interface ServerView {
|
|
|
90
95
|
}
|
|
91
96
|
export interface UnregisteredListener {
|
|
92
97
|
pid: number;
|
|
98
|
+
/** Captured during the scan, before a stop can be authorized. */
|
|
99
|
+
start_token?: string;
|
|
93
100
|
port: number;
|
|
94
101
|
address: string;
|
|
95
102
|
command: string;
|
|
@@ -115,13 +122,11 @@ export declare function isValidServerId(id: string): boolean;
|
|
|
115
122
|
export declare function registerServer(input: RegisterServerInput, options?: ServerOptions): ServerRecord | null;
|
|
116
123
|
/** Best-effort registration that never throws (for server start paths). */
|
|
117
124
|
export declare function tryRegisterServer(input: RegisterServerInput, options?: ServerOptions): ServerRecord | null;
|
|
118
|
-
/**
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
export declare function
|
|
123
|
-
pid?: number;
|
|
124
|
-
}): boolean;
|
|
125
|
+
/** Remove only the exact registration receipt observed by the caller. */
|
|
126
|
+
export declare function unregisterServer(record: ServerRecord, options?: ServerOptions): boolean;
|
|
127
|
+
/** Hold the exact registration receipt until a synchronous or asynchronous effect settles. */
|
|
128
|
+
export declare function withServerRegistrationCustody<T>(record: ServerRecord, options: ServerOptions, effect: () => PromiseLike<T>): Promise<T>;
|
|
129
|
+
export declare function withServerRegistrationCustody<T>(record: ServerRecord, options: ServerOptions, effect: () => T): T;
|
|
125
130
|
export declare function readServer(id: string, options?: ServerOptions): ServerRecord | null;
|
|
126
131
|
/** Mark a server as used now. */
|
|
127
132
|
export declare function touchServer(id: string, options?: ServerOptions & {
|
|
@@ -134,7 +139,7 @@ export declare function touchServer(id: string, options?: ServerOptions & {
|
|
|
134
139
|
export declare function createServerToucher(id: string, options?: ServerOptions): () => void;
|
|
135
140
|
export declare function readServerRecords(options?: ServerOptions): ServerRecord[];
|
|
136
141
|
export declare function pidAlive(pid: number): boolean;
|
|
137
|
-
export declare function serverState(record: ServerRecord): ServerState;
|
|
142
|
+
export declare function serverState(record: ServerRecord, readToken?: (pid: number) => string | null, probePid?: (pid: number) => boolean): ServerState;
|
|
138
143
|
export interface ListServersOptions extends ServerOptions {
|
|
139
144
|
/** Look for listening processes inside the project that never registered. */
|
|
140
145
|
scan?: boolean;
|
|
@@ -147,8 +152,6 @@ export interface ListServersOptions extends ServerOptions {
|
|
|
147
152
|
}
|
|
148
153
|
/** Read every record, observe it, and optionally find unregistered listeners. */
|
|
149
154
|
export declare function listServers(options?: ListServersOptions): ServersReport;
|
|
150
|
-
/** Register running tunnels that have no current record. Returns adopted ids. */
|
|
151
|
-
export declare function adoptRunningTunnels(coordRoot: string): string[];
|
|
152
155
|
/**
|
|
153
156
|
* Listening processes that run inside the project (working directory or
|
|
154
157
|
* command line within the coordination root) but are not covered by any
|
|
@@ -175,16 +178,21 @@ export declare function planServerGc(views: ServerView[], policy?: GcPolicy): Gc
|
|
|
175
178
|
export interface StopResult {
|
|
176
179
|
id: string;
|
|
177
180
|
stopped: boolean;
|
|
178
|
-
method: "not-running" | "
|
|
181
|
+
method: "not-running" | "signal" | "refused";
|
|
182
|
+
generation?: ProcessGenerationVerdict;
|
|
179
183
|
detail?: string;
|
|
180
184
|
}
|
|
185
|
+
export interface ServerProcessDependencies extends ProcessGenerationSignalDependencies {
|
|
186
|
+
probePid?: (pid: number) => boolean;
|
|
187
|
+
}
|
|
181
188
|
/**
|
|
182
|
-
* Stop
|
|
183
|
-
*
|
|
184
|
-
*
|
|
189
|
+
* Stop a verified server with SIGTERM, then SIGKILL after the grace period.
|
|
190
|
+
* Every signal targets one retained process handle, including auxiliary processes.
|
|
191
|
+
* Each target requires a fresh generation check. Unknown or different generations retain the record.
|
|
185
192
|
*/
|
|
186
193
|
export declare function stopServer(record: ServerRecord, options?: ServerOptions & {
|
|
187
194
|
graceMs?: number;
|
|
195
|
+
signalDependencies?: ServerProcessDependencies;
|
|
188
196
|
}): Promise<StopResult>;
|
|
189
197
|
/**
|
|
190
198
|
* The first free port in the configured range for `type`
|
|
@@ -200,6 +208,10 @@ export interface AdoptOptions extends ServerOptions {
|
|
|
200
208
|
scope?: string;
|
|
201
209
|
/** `self` (default) records the adopting agent as owner; `none` records no owner. */
|
|
202
210
|
owner?: "self" | "none";
|
|
211
|
+
dependencies?: {
|
|
212
|
+
listServers?: typeof listServers;
|
|
213
|
+
readToken?: (pid: number) => string | null;
|
|
214
|
+
};
|
|
203
215
|
}
|
|
204
216
|
/**
|
|
205
217
|
* Register a running server that never registered itself. Only a pid the scan
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/servers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/servers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH,OAAO,EACL,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAI9B,MAAM,+BAA+B,CAAC;AAUvC,OAAO,EAOL,KAAK,WAAW,EAEjB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EACL,QAAQ,EACR,2BAA2B,EAC3B,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,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