@indigoai-us/hq-cli 5.345.214 → 5.345.215
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/CHANGELOG.md +93 -0
- package/assets/scaffold/core/scripts/hq-delegate-verify.sh +5 -2
- package/dist/command-catalog.generated.d.ts +180 -13
- package/dist/command-catalog.generated.js +221 -13
- package/dist/commands/agents.d.ts +51 -1
- package/dist/commands/agents.js +154 -2
- package/dist/commands/bot-jobs.d.ts +2 -15
- package/dist/commands/bot-jobs.js +2 -94
- package/dist/commands/bot-runtime.d.ts +46 -5
- package/dist/commands/bot-runtime.js +228 -18
- package/dist/commands/bot.d.ts +16 -9
- package/dist/commands/bot.js +231 -55
- package/dist/commands/capacity.d.ts +4 -1
- package/dist/commands/capacity.js +46 -10
- package/dist/commands/cloud.d.ts +66 -13
- package/dist/commands/cloud.js +121 -40
- package/dist/commands/company-restore.d.ts +23 -0
- package/dist/commands/company-restore.js +128 -0
- package/dist/commands/company.js +2 -0
- package/dist/commands/core-delegate-w1b.js +15 -1
- package/dist/commands/core-policy.js +67 -8
- package/dist/commands/daemon.js +5 -0
- package/dist/commands/files-browse.d.ts +11 -4
- package/dist/commands/files-browse.js +21 -4
- package/dist/commands/files.d.ts +1 -1
- package/dist/commands/files.js +25 -11
- package/dist/commands/integrations-auth-rules.d.ts +27 -0
- package/dist/commands/integrations-auth-rules.js +79 -0
- package/dist/commands/integrations-connect.d.ts +10 -3
- package/dist/commands/integrations-connect.js +87 -13
- package/dist/commands/integrations-import.js +124 -12
- package/dist/commands/lanes.js +28 -11
- package/dist/commands/mesh.d.ts +2 -0
- package/dist/commands/mesh.js +60 -35
- package/dist/commands/sources.js +6 -0
- package/dist/commands/storage-offload.d.ts +12 -0
- package/dist/commands/storage-offload.js +41 -3
- package/dist/commands/sync-held.js +5 -2
- package/dist/commands/sync-mode.js +5 -0
- package/dist/commands/whoami.js +4 -0
- package/dist/lazy-commands.js +3 -5
- package/dist/lib/bot/config.d.ts +1 -0
- package/dist/lib/bot/config.js +10 -0
- package/dist/lib/bot/eventbridge-cron.d.ts +22 -0
- package/dist/lib/bot/eventbridge-cron.js +104 -0
- package/dist/lib/bot/fleet-cron.d.ts +8 -0
- package/dist/lib/bot/fleet-cron.js +35 -3
- package/dist/lib/bot/fleet-daemon.d.ts +46 -0
- package/dist/lib/bot/fleet-daemon.js +99 -1
- package/dist/lib/bot/fleet-local.d.ts +33 -1
- package/dist/lib/bot/fleet-local.js +215 -31
- package/dist/lib/bot/fleet-python.d.ts +3 -0
- package/dist/lib/bot/fleet-python.js +34 -4
- package/dist/lib/bot/fleet-runtime-sources.d.ts +15 -0
- package/dist/lib/bot/fleet-runtime-sources.js +30 -0
- package/dist/lib/bot/legacy-provider-login.d.ts +8 -0
- package/dist/lib/bot/legacy-provider-login.js +19 -2
- package/dist/lib/bot/probe.js +7 -1
- package/dist/lib/bot/prompt.js +1 -1
- package/dist/lib/bot/readiness.d.ts +8 -0
- package/dist/lib/bot/readiness.js +17 -3
- package/dist/lib/bot/run.js +20 -1
- package/dist/lib/bot/runtime/codex.js +1 -1
- package/dist/lib/bot/runtime/grok-acp.d.ts +5 -1
- package/dist/lib/bot/runtime/grok-acp.js +6 -3
- package/dist/lib/bot/runtime/index.js +19 -9
- package/dist/lib/bot/runtime/messages-stream.js +2 -2
- package/dist/lib/bot/runtime/types.d.ts +15 -0
- package/dist/lib/bot/runtime/types.js +9 -0
- package/dist/lib/bot/runtime-auth.d.ts +30 -0
- package/dist/lib/bot/runtime-auth.js +94 -3
- package/dist/lib/bot/runtime-failure.d.ts +23 -0
- package/dist/lib/bot/runtime-failure.js +43 -1
- package/dist/lib/bot/status.d.ts +2 -0
- package/dist/lib/capacity/accounts.d.ts +8 -0
- package/dist/lib/capacity/accounts.js +19 -0
- package/dist/lib/capacity/available.d.ts +154 -0
- package/dist/lib/capacity/available.js +905 -0
- package/dist/lib/capacity/codex-availability.d.ts +14 -1
- package/dist/lib/capacity/codex-availability.js +26 -1
- package/dist/lib/capacity/collectors/claude-oauth.d.ts +29 -2
- package/dist/lib/capacity/collectors/claude-oauth.js +104 -7
- package/dist/lib/capacity/collectors/codex.js +10 -7
- package/dist/lib/capacity/collectors/grok-refresh.d.ts +80 -0
- package/dist/lib/capacity/collectors/grok-refresh.js +189 -0
- package/dist/lib/capacity/collectors/grok.d.ts +5 -0
- package/dist/lib/capacity/collectors/grok.js +56 -5
- package/dist/lib/capacity/ledger.d.ts +37 -1
- package/dist/lib/capacity/ledger.js +207 -30
- package/dist/lib/capacity/project.d.ts +26 -0
- package/dist/lib/capacity/project.js +137 -8
- package/dist/lib/capacity/refusal-rows.d.ts +31 -0
- package/dist/lib/capacity/refusal-rows.js +61 -0
- package/dist/lib/capacity/refusal.d.ts +53 -2
- package/dist/lib/capacity/refusal.js +284 -65
- package/dist/lib/capacity/route.js +46 -11
- package/dist/lib/capacity/widget.d.ts +12 -1
- package/dist/lib/capacity/widget.js +91 -3
- package/dist/lib/daemon/catalog.js +11 -1
- package/dist/lib/daemon/resolver.d.ts +2 -0
- package/dist/lib/daemon/resolver.js +3 -0
- package/dist/lib/daemon/run.d.ts +9 -0
- package/dist/lib/daemon/run.js +54 -1
- package/dist/lib/daemon/server.d.ts +2 -0
- package/dist/lib/daemon/server.js +10 -1
- package/dist/lib/daemon/tcc-eperm.d.ts +153 -0
- package/dist/lib/daemon/tcc-eperm.js +310 -0
- package/dist/lib/db/sqlite-binding.d.ts +1 -0
- package/dist/lib/db/sqlite-binding.js +1 -1
- package/dist/lib/delivery/admission.d.ts +86 -0
- package/dist/lib/delivery/admission.js +148 -0
- package/dist/lib/delivery/artifacts.d.ts +105 -0
- package/dist/lib/delivery/artifacts.js +567 -0
- package/dist/lib/delivery/attempt-id.d.ts +13 -0
- package/dist/lib/delivery/attempt-id.js +16 -0
- package/dist/lib/delivery/backup.d.ts +78 -0
- package/dist/lib/delivery/backup.js +343 -0
- package/dist/lib/delivery/cache.d.ts +29 -0
- package/dist/lib/delivery/cache.js +33 -0
- package/dist/lib/delivery/contracts.d.ts +142 -0
- package/dist/lib/delivery/contracts.js +289 -0
- package/dist/lib/delivery/credentials.d.ts +54 -0
- package/dist/lib/delivery/credentials.js +119 -0
- package/dist/lib/delivery/disposable-target.d.ts +42 -0
- package/dist/lib/delivery/disposable-target.js +111 -0
- package/dist/lib/delivery/effects.d.ts +136 -0
- package/dist/lib/delivery/effects.js +541 -0
- package/dist/lib/delivery/enrollment.d.ts +146 -0
- package/dist/lib/delivery/enrollment.js +460 -0
- package/dist/lib/delivery/escalations.d.ts +51 -0
- package/dist/lib/delivery/escalations.js +60 -0
- package/dist/lib/delivery/identity.d.ts +25 -0
- package/dist/lib/delivery/identity.js +82 -0
- package/dist/lib/delivery/inbox.d.ts +116 -0
- package/dist/lib/delivery/inbox.js +260 -0
- package/dist/lib/delivery/lease.d.ts +80 -0
- package/dist/lib/delivery/lease.js +134 -0
- package/dist/lib/delivery/migrations.d.ts +255 -0
- package/dist/lib/delivery/migrations.js +823 -0
- package/dist/lib/delivery/mqtt-adapter.d.ts +50 -0
- package/dist/lib/delivery/mqtt-adapter.js +242 -0
- package/dist/lib/delivery/mqtt.d.ts +63 -0
- package/dist/lib/delivery/mqtt.js +119 -0
- package/dist/lib/delivery/outbox.d.ts +95 -0
- package/dist/lib/delivery/outbox.js +187 -0
- package/dist/lib/delivery/provenance.d.ts +129 -0
- package/dist/lib/delivery/provenance.js +93 -0
- package/dist/lib/delivery/reconciler.d.ts +215 -0
- package/dist/lib/delivery/reconciler.js +703 -0
- package/dist/lib/delivery/restore.d.ts +35 -0
- package/dist/lib/delivery/restore.js +134 -0
- package/dist/lib/delivery/rpc/client.d.ts +22 -0
- package/dist/lib/delivery/rpc/client.js +159 -0
- package/dist/lib/delivery/rpc/port.d.ts +40 -0
- package/dist/lib/delivery/rpc/port.js +16 -0
- package/dist/lib/delivery/rpc/server.d.ts +30 -0
- package/dist/lib/delivery/rpc/server.js +205 -0
- package/dist/lib/delivery/rpc/wire.d.ts +85 -0
- package/dist/lib/delivery/rpc/wire.js +143 -0
- package/dist/lib/delivery/store.d.ts +163 -0
- package/dist/lib/delivery/store.js +944 -0
- package/dist/lib/delivery/windows-service-install.d.ts +262 -0
- package/dist/lib/delivery/windows-service-install.js +892 -0
- package/dist/lib/delivery/workers/macos-job-helper.d.ts +103 -0
- package/dist/lib/delivery/workers/macos-job-helper.js +927 -0
- package/dist/lib/delivery/workers/macos.d.ts +191 -0
- package/dist/lib/delivery/workers/macos.js +943 -0
- package/dist/lib/delivery/workers/windows-job-helper.d.ts +35 -0
- package/dist/lib/delivery/workers/windows-job-helper.js +264 -0
- package/dist/lib/delivery/workers/windows-service-live.d.ts +121 -0
- package/dist/lib/delivery/workers/windows-service-live.js +711 -0
- package/dist/lib/delivery/workers/windows-service-runner.d.ts +33 -0
- package/dist/lib/delivery/workers/windows-service-runner.js +82 -0
- package/dist/lib/delivery/workers/windows-service.d.ts +140 -0
- package/dist/lib/delivery/workers/windows-service.js +584 -0
- package/dist/lib/delivery/workers/windows.d.ts +251 -0
- package/dist/lib/delivery/workers/windows.js +594 -0
- package/dist/lib/hot-channels/adapters/meetings.d.ts +15 -0
- package/dist/lib/hot-channels/adapters/meetings.js +36 -3
- package/dist/lib/hot-channels/signals-pass.d.ts +10 -0
- package/dist/lib/hot-channels/signals-pass.js +71 -2
- package/dist/lib/hot-channels/signals-redo.js +10 -2
- package/dist/lib/install/provider-wrappers.d.ts +2 -0
- package/dist/lib/install/provider-wrappers.js +68 -3
- package/dist/lib/lanes/watcher.js +35 -0
- package/dist/lib/signals/steps/extract.js +40 -4
- package/dist/schemas/hq-available-ai.v1.schema.json +76 -0
- package/dist/utils/catalog-runtime-paths.d.ts +34 -0
- package/dist/utils/catalog-runtime-paths.js +53 -0
- package/dist/utils/cognito-callback-port.d.ts +14 -0
- package/dist/utils/cognito-callback-port.js +24 -0
- package/dist/utils/cognito-session.js +3 -3
- package/dist/utils/deleted-company-notice.d.ts +59 -0
- package/dist/utils/deleted-company-notice.js +156 -0
- package/dist/utils/files-browse-acl.js +1 -1
- package/dist/utils/login-browser.d.ts +1 -1
- package/dist/utils/login-browser.js +7 -5
- package/dist/utils/resident-package-preload.js +30 -15
- package/dist/utils/vault-api.js +7 -0
- package/package.json +7 -7
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import type { AdminScope, DeliveryAccess, EnrollmentRequest, IssuedEnrollment } from "../enrollment.js";
|
|
2
|
+
import type { WorkerIdentity } from "../identity.js";
|
|
3
|
+
import type { WorkerTrust } from "../migrations.js";
|
|
4
|
+
export declare const EXECUTION_SPEC_VERSION = "hq-delivery.execution.v1";
|
|
5
|
+
export declare const WORKER_RESULT_VERSION = "hq-delivery.worker-result.v1";
|
|
6
|
+
export type Platform = "windows" | "macos" | "linux";
|
|
7
|
+
export interface WorkerProfile {
|
|
8
|
+
platform: string;
|
|
9
|
+
arch: string;
|
|
10
|
+
/** Toolchain name -> installed version. */
|
|
11
|
+
toolchains: Record<string, string>;
|
|
12
|
+
capabilities: string[];
|
|
13
|
+
/** "untrusted" on Windows: see WINDOWS_TRUST_NOTE. */
|
|
14
|
+
resultTrust?: "untrusted";
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Owner decision 2026-10-28 ("Mark Windows untrusted"). Why Windows results
|
|
18
|
+
* are untrusted, as advertised in the profile and the docs.
|
|
19
|
+
*/
|
|
20
|
+
export declare const WINDOWS_TRUST_NOTE = "Windows results are not trusted against a hostile job: under proposal 040 the job runs as the shared runner identity (the service's virtual account), so a job can write its own or another job's events and results. Workers are capped at standard trust and their results are never release-eligible. Closing this needs a separate job account (future work).";
|
|
21
|
+
/** The highest trust a Windows worker may hold. */
|
|
22
|
+
export declare const WINDOWS_MAX_TRUST: WorkerTrust;
|
|
23
|
+
/** Issue an enrollment ticket for a Windows worker. Release trust is refused with WINDOWS_TRUST_CAPPED; nothing is issued. */
|
|
24
|
+
export declare function issueWindowsEnrollment(access: DeliveryAccess, scope: AdminScope, request: EnrollmentRequest): IssuedEnrollment;
|
|
25
|
+
/** Redeem a Windows enrollment. Release trust is refused with WINDOWS_TRUST_CAPPED, whatever the ticket allows. */
|
|
26
|
+
export declare function enrollWindowsWorker(access: DeliveryAccess, input: EnrollmentRequest & {
|
|
27
|
+
ticket: string;
|
|
28
|
+
}): WorkerIdentity;
|
|
29
|
+
/**
|
|
30
|
+
* The promotion gate for Windows results. Every Windows result is untrusted,
|
|
31
|
+
* so this always refuses with WINDOWS_RESULT_UNTRUSTED. Merge point: US-008's
|
|
32
|
+
* shared release-eligibility check (assertJobTrust on the integration branch)
|
|
33
|
+
* should call this for Windows results; this base does not have it.
|
|
34
|
+
*/
|
|
35
|
+
export declare function assertReleaseEligible(result: Pick<TerminalResult, "resultTrust" | "jobId" | "kind">): never;
|
|
36
|
+
export interface Requirements {
|
|
37
|
+
/** The job runs on any one of these platforms. */
|
|
38
|
+
platforms: string[];
|
|
39
|
+
/** Toolchain name -> semver range the installed version must satisfy. */
|
|
40
|
+
toolchains?: Record<string, string>;
|
|
41
|
+
capabilities?: string[];
|
|
42
|
+
}
|
|
43
|
+
export interface InputRef {
|
|
44
|
+
/** File name inside the attempt's inputs directory. */
|
|
45
|
+
name: string;
|
|
46
|
+
sha256: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ResourceLimits {
|
|
49
|
+
/** Committed memory of the whole job, in bytes. */
|
|
50
|
+
memoryBytes: number;
|
|
51
|
+
/** Processes alive in the job at once. */
|
|
52
|
+
maxProcesses: number;
|
|
53
|
+
/** User-mode CPU time of the whole job, in milliseconds. */
|
|
54
|
+
cpuTimeMs: number;
|
|
55
|
+
}
|
|
56
|
+
export interface ExecutionSpec {
|
|
57
|
+
schemaVersion: string;
|
|
58
|
+
tenantId: string;
|
|
59
|
+
runId: string;
|
|
60
|
+
jobId: string;
|
|
61
|
+
requires: Requirements;
|
|
62
|
+
/** file is an absolute path; it runs in the attempt directory. */
|
|
63
|
+
command: {
|
|
64
|
+
file: string;
|
|
65
|
+
args: string[];
|
|
66
|
+
};
|
|
67
|
+
inputs: InputRef[];
|
|
68
|
+
/** The complete environment of the job. Nothing is inherited. */
|
|
69
|
+
env: Record<string, string>;
|
|
70
|
+
limits: ResourceLimits;
|
|
71
|
+
}
|
|
72
|
+
/** What the native launcher contains. A job may require any of these. */
|
|
73
|
+
export declare const CONTAINMENT_CAPABILITIES: readonly string[];
|
|
74
|
+
export declare const KNOWN_CAPABILITIES: readonly string[];
|
|
75
|
+
export type RefusalCode = "INVALID_SPEC" | "UNKNOWN_JOB" | "PLATFORM_MISMATCH" | "TOOLCHAIN_MISMATCH" | "UNKNOWN_CAPABILITY" | "CAPABILITY_MISSING" | "INPUT_MISSING" | "INPUT_CHANGED" | "CONTAINMENT_UNAVAILABLE";
|
|
76
|
+
export type MatchResult = {
|
|
77
|
+
ok: true;
|
|
78
|
+
} | {
|
|
79
|
+
ok: false;
|
|
80
|
+
code: RefusalCode;
|
|
81
|
+
detail: string;
|
|
82
|
+
};
|
|
83
|
+
/** The profile of the host this process runs on. */
|
|
84
|
+
export declare function detectProfile(): WorkerProfile;
|
|
85
|
+
/** Check a worker profile against a job's requirements. Platform first, then toolchains, then capabilities. */
|
|
86
|
+
export declare function matchCapabilities(profile: WorkerProfile, req: Requirements): MatchResult;
|
|
87
|
+
/** The first problem with a spec, or null when it is well formed. */
|
|
88
|
+
export declare function validateSpec(spec: ExecutionSpec): string | null;
|
|
89
|
+
/**
|
|
90
|
+
* Content-addressed input blobs. An admitted input is stored under its hash,
|
|
91
|
+
* read-only; a job names the hash, and the bytes are checked again before the
|
|
92
|
+
* claim and when they are copied into the attempt.
|
|
93
|
+
*/
|
|
94
|
+
export declare class InputStore {
|
|
95
|
+
private readonly dir;
|
|
96
|
+
private constructor();
|
|
97
|
+
static open(dir: string): InputStore;
|
|
98
|
+
admit(name: string, path: string): InputRef;
|
|
99
|
+
blobPath(hash: string): string;
|
|
100
|
+
/** null when the blob is present and unchanged. */
|
|
101
|
+
verify(ref: InputRef): "INPUT_MISSING" | "INPUT_CHANGED" | null;
|
|
102
|
+
/** Copy a verified blob to destDir/name, read-only. */
|
|
103
|
+
materialize(ref: InputRef, destDir: string): string;
|
|
104
|
+
}
|
|
105
|
+
export type ResultKind = "refused" | "succeeded" | "failed" | "cancelled" | "limit_exceeded";
|
|
106
|
+
export interface TerminalResult {
|
|
107
|
+
schemaVersion: string;
|
|
108
|
+
kind: ResultKind;
|
|
109
|
+
code: string;
|
|
110
|
+
detail: string;
|
|
111
|
+
tenantId: string;
|
|
112
|
+
runId: string;
|
|
113
|
+
jobId: string;
|
|
114
|
+
attemptId: string | null;
|
|
115
|
+
pid: number | null;
|
|
116
|
+
exitCode: number | null;
|
|
117
|
+
/** The declared environment keys, sorted. Values are never recorded. */
|
|
118
|
+
envKeys: string[];
|
|
119
|
+
startedAt: string | null;
|
|
120
|
+
finishedAt: string;
|
|
121
|
+
/** Set to "untrusted" on every Windows worker result (WINDOWS_TRUST_NOTE). Other workers sharing this type may omit it. */
|
|
122
|
+
resultTrust?: "untrusted";
|
|
123
|
+
/** false on every Windows worker result: never release-eligible. */
|
|
124
|
+
releaseEligible?: boolean;
|
|
125
|
+
}
|
|
126
|
+
/** Append-only JSON lines of terminal results. One result per attempt. */
|
|
127
|
+
export declare class ResultLog {
|
|
128
|
+
private readonly path;
|
|
129
|
+
private readonly lines;
|
|
130
|
+
private constructor();
|
|
131
|
+
static open(path: string): ResultLog;
|
|
132
|
+
/** Append a result. A second result for the same attempt is not written; the first is returned. */
|
|
133
|
+
append(result: TerminalResult): TerminalResult;
|
|
134
|
+
all(): TerminalResult[];
|
|
135
|
+
forJob(jobId: string): TerminalResult[];
|
|
136
|
+
}
|
|
137
|
+
export interface LaunchRequest {
|
|
138
|
+
file: string;
|
|
139
|
+
args: string[];
|
|
140
|
+
cwd: string;
|
|
141
|
+
env: Record<string, string>;
|
|
142
|
+
/** stdout and stderr of the job go here. */
|
|
143
|
+
logPath: string;
|
|
144
|
+
limits: ResourceLimits;
|
|
145
|
+
}
|
|
146
|
+
export type LaunchOutcome = {
|
|
147
|
+
reason: "exited";
|
|
148
|
+
exitCode: number;
|
|
149
|
+
} | {
|
|
150
|
+
reason: "cancelled";
|
|
151
|
+
exitCode?: number;
|
|
152
|
+
} | {
|
|
153
|
+
reason: "limit";
|
|
154
|
+
limit: "memory" | "processes" | "cpu";
|
|
155
|
+
exitCode?: number;
|
|
156
|
+
} | {
|
|
157
|
+
reason: "supervisor_lost";
|
|
158
|
+
detail: string;
|
|
159
|
+
} | {
|
|
160
|
+
reason: "spawn_failed";
|
|
161
|
+
detail: string;
|
|
162
|
+
};
|
|
163
|
+
export interface ContainedProcess {
|
|
164
|
+
/** The supervisor's pid until the root process starts; read ready for the root pid. */
|
|
165
|
+
readonly pid: number;
|
|
166
|
+
/** The process that owns the containment, or null when there is none. */
|
|
167
|
+
supervisorPid: number | null;
|
|
168
|
+
/** The root pid once it runs inside the containment, or -1 when it never started. Never rejects. */
|
|
169
|
+
ready: Promise<number>;
|
|
170
|
+
/** Every pid seen in the containment so far. */
|
|
171
|
+
processes(): number[];
|
|
172
|
+
/** Kill the whole tree. Safe to call more than once. */
|
|
173
|
+
cancel(): void;
|
|
174
|
+
done: Promise<LaunchOutcome>;
|
|
175
|
+
}
|
|
176
|
+
export interface LaunchRun {
|
|
177
|
+
tenantId: string;
|
|
178
|
+
runId: string;
|
|
179
|
+
jobId: string;
|
|
180
|
+
}
|
|
181
|
+
export interface ContainedLauncher {
|
|
182
|
+
/** The worker passes the run it prepared, so a launcher can check it admitted that run. */
|
|
183
|
+
launch(req: LaunchRequest, run?: LaunchRun): ContainedProcess;
|
|
184
|
+
/** Throws a WorkerRefusal when the launcher cannot contain this run's job on this host. Runs before the claim. */
|
|
185
|
+
prepare?(run?: LaunchRun): void;
|
|
186
|
+
}
|
|
187
|
+
export declare class WorkerRefusal extends Error {
|
|
188
|
+
readonly code: string;
|
|
189
|
+
readonly detail: string;
|
|
190
|
+
constructor(code: string, detail: string);
|
|
191
|
+
}
|
|
192
|
+
/** Quote one argument for a Windows command line, following the CommandLineToArgvW rules. */
|
|
193
|
+
export declare function quoteWindowsArg(arg: string): string;
|
|
194
|
+
/**
|
|
195
|
+
* Map what the job helper reported to a launch outcome. An error line before
|
|
196
|
+
* any "started" line (for example "error resume <code>", sent after the helper
|
|
197
|
+
* has terminated the job) is a spawn failure.
|
|
198
|
+
*/
|
|
199
|
+
export declare function helperOutcome(h: {
|
|
200
|
+
exitLine?: string;
|
|
201
|
+
errorLine?: string;
|
|
202
|
+
rootPid: number;
|
|
203
|
+
code: number | null;
|
|
204
|
+
spawnError?: string;
|
|
205
|
+
stderr: string;
|
|
206
|
+
}): LaunchOutcome;
|
|
207
|
+
/** Submits an admitted job to the service runner (windows-service.ts). */
|
|
208
|
+
export interface ServiceTransport {
|
|
209
|
+
submit(req: LaunchRequest, run: LaunchRun): ContainedProcess;
|
|
210
|
+
/** Throws a WorkerRefusal unless the runner can take a job now. */
|
|
211
|
+
check(): unknown;
|
|
212
|
+
}
|
|
213
|
+
export type StartResult = {
|
|
214
|
+
kind: "refused";
|
|
215
|
+
result: TerminalResult;
|
|
216
|
+
} | {
|
|
217
|
+
kind: "failed";
|
|
218
|
+
result: TerminalResult;
|
|
219
|
+
} | {
|
|
220
|
+
kind: "started";
|
|
221
|
+
attemptId: string;
|
|
222
|
+
pid: number;
|
|
223
|
+
process: ContainedProcess;
|
|
224
|
+
logPath: string;
|
|
225
|
+
cancel: () => void;
|
|
226
|
+
result: Promise<TerminalResult>;
|
|
227
|
+
};
|
|
228
|
+
export interface WindowsWorkerOptions {
|
|
229
|
+
access: DeliveryAccess;
|
|
230
|
+
identity: WorkerIdentity;
|
|
231
|
+
profile: WorkerProfile;
|
|
232
|
+
inputs: InputStore;
|
|
233
|
+
results: ResultLog;
|
|
234
|
+
/** Each attempt runs in workDir/<attemptId>. */
|
|
235
|
+
workDir: string;
|
|
236
|
+
launcher: ContainedLauncher;
|
|
237
|
+
clock?: () => Date;
|
|
238
|
+
}
|
|
239
|
+
export declare class WindowsWorker {
|
|
240
|
+
private readonly opts;
|
|
241
|
+
private readonly clock;
|
|
242
|
+
constructor(opts: WindowsWorkerOptions);
|
|
243
|
+
private now;
|
|
244
|
+
private result;
|
|
245
|
+
private refuse;
|
|
246
|
+
/** Report the ledger outcome, then append the one terminal result. A ledger or result-log failure is reported, never thrown. */
|
|
247
|
+
private finish;
|
|
248
|
+
start(spec: ExecutionSpec): Promise<StartResult>;
|
|
249
|
+
private mapOutcome;
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=windows.d.ts.map
|