@indigoai-us/hq-cli 5.345.212 → 5.345.215-beta.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/CHANGELOG.md +49 -0
- package/dist/bin/hq-auth-refresh.js +2 -1
- package/dist/command-catalog.generated.d.ts +442 -50
- package/dist/command-catalog.generated.js +541 -50
- package/dist/commands/agent-inbox.d.ts +11 -1
- package/dist/commands/agent-inbox.js +128 -38
- package/dist/commands/agent-kit.js +2 -2
- 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 +169 -51
- package/dist/commands/cloud.d.ts +66 -13
- package/dist/commands/cloud.js +120 -39
- 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-handoff.js +1 -0
- package/dist/commands/core-hq-session-native.js +2 -2
- package/dist/commands/core-pin-native.js +1 -1
- package/dist/commands/core-policy.js +1 -1
- package/dist/commands/core-resolve-company-native.js +1 -1
- package/dist/commands/core-sentry-report-fast.d.ts +2 -0
- package/dist/commands/core-sentry-report-fast.js +3 -1
- package/dist/commands/daemon.js +11 -1
- package/dist/commands/integrations-connect.d.ts +17 -4
- package/dist/commands/integrations-connect.js +224 -26
- package/dist/commands/lanes-link.js +10 -5
- package/dist/commands/lanes.js +26 -9
- package/dist/commands/rescue.js +13 -0
- package/dist/commands/secrets.d.ts +11 -0
- package/dist/commands/secrets.js +41 -7
- 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-mode.js +5 -0
- package/dist/commands/whoami.js +4 -0
- package/dist/index.js +2 -0
- package/dist/lazy-commands.js +2 -0
- package/dist/lib/agent-kit/inbox-fetch.d.ts +122 -1
- package/dist/lib/agent-kit/inbox-fetch.js +215 -3
- package/dist/lib/agent-kit/inbox-redact.js +1 -1
- package/dist/lib/agent-kit/inbox-state.d.ts +98 -1
- package/dist/lib/agent-kit/inbox-state.js +261 -4
- package/dist/lib/agent-kit/mcp/tools.d.ts +3 -3
- package/dist/lib/agent-kit/mcp/tools.js +68 -25
- package/dist/lib/agent-kit/run/inbox.js +4 -2
- package/dist/lib/agent-kit/skills.js +4 -1
- package/dist/lib/agent-kit/wake.d.ts +9 -1
- package/dist/lib/agent-kit/wake.js +10 -3
- 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.js +193 -14
- package/dist/lib/bot/fleet-download.d.ts +2 -0
- package/dist/lib/bot/fleet-download.js +23 -0
- package/dist/lib/bot/fleet-local.d.ts +34 -1
- package/dist/lib/bot/fleet-local.js +254 -37
- 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/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/runtime-auth.d.ts +30 -0
- package/dist/lib/bot/runtime-auth.js +94 -3
- package/dist/lib/bot/status.d.ts +2 -0
- 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/core-utils/session-id.d.ts +1 -1
- package/dist/lib/core-utils/session-id.js +4 -0
- package/dist/lib/daemon/catalog.js +11 -1
- package/dist/lib/daemon/run.js +9 -1
- package/dist/lib/daemon/updater.d.ts +34 -2
- package/dist/lib/daemon/updater.js +51 -2
- package/dist/lib/db/sqlite-binding.d.ts +1 -0
- package/dist/lib/db/sqlite-binding.js +1 -1
- package/dist/lib/delivery/artifacts.d.ts +99 -0
- package/dist/lib/delivery/artifacts.js +548 -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/enrollment.d.ts +142 -0
- package/dist/lib/delivery/enrollment.js +382 -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/migrations.d.ts +139 -0
- package/dist/lib/delivery/migrations.js +623 -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 +61 -0
- package/dist/lib/delivery/mqtt.js +112 -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 +151 -0
- package/dist/lib/delivery/reconciler.js +492 -0
- package/dist/lib/delivery/restore.d.ts +35 -0
- package/dist/lib/delivery/restore.js +134 -0
- package/dist/lib/delivery/store.d.ts +161 -0
- package/dist/lib/delivery/store.js +940 -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 +176 -0
- package/dist/lib/delivery/workers/macos.js +901 -0
- package/dist/lib/delivery/workers/windows-boundary.d.ts +453 -0
- package/dist/lib/delivery/workers/windows-boundary.js +693 -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.d.ts +241 -0
- package/dist/lib/delivery/workers/windows.js +608 -0
- package/dist/lib/doctor/checks/release-links.d.ts +50 -8
- package/dist/lib/doctor/checks/release-links.js +260 -24
- package/dist/lib/doctor/fix/apply.js +24 -8
- package/dist/lib/doctor/fix/remediation.js +15 -5
- package/dist/lib/install/provider-wrappers.d.ts +2 -0
- package/dist/lib/install/provider-wrappers.js +68 -3
- package/dist/lib/lanes/autopilot-registry.d.ts +14 -0
- package/dist/lib/lanes/autopilot-registry.js +59 -7
- package/dist/lib/lanes/links.d.ts +14 -0
- package/dist/lib/lanes/links.js +320 -25
- package/dist/lib/lanes/outpost-pruner-install.d.ts +10 -0
- package/dist/lib/lanes/outpost-pruner-install.js +4 -3
- package/dist/main.js +3 -1
- package/dist/sentry-init.d.ts +2 -0
- package/dist/sentry-init.js +13 -2
- package/dist/sentry.d.ts +2 -0
- package/dist/sentry.js +5 -1
- package/dist/utils/cli-network-lifecycle.d.ts +9 -0
- package/dist/utils/cli-network-lifecycle.js +52 -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/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/safe-link.d.ts +63 -0
- package/dist/utils/safe-link.js +246 -0
- package/dist/utils/sentry-keepalive-transport.d.ts +28 -0
- package/dist/utils/sentry-keepalive-transport.js +70 -0
- package/dist/utils/vault-api.js +7 -0
- package/package.json +7 -7
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The native Windows Job Object supervisor (US-006), as C# source.
|
|
3
|
+
*
|
|
4
|
+
* Node cannot create a Job Object or start a process suspended, so the worker
|
|
5
|
+
* compiles this source once with the csc.exe that ships with the .NET
|
|
6
|
+
* Framework 4 in every supported Windows install, and runs the result as a
|
|
7
|
+
* small supervisor per job. No package or system software is installed.
|
|
8
|
+
*
|
|
9
|
+
* Protocol. The worker writes the spec to the helper's stdin as
|
|
10
|
+
* "key<TAB>base64(utf8 value)" lines ended by "end". Keys: app, cmd, cwd,
|
|
11
|
+
* log, env (one line per KEY=VALUE), mem (bytes), procs, cpu (ms). The helper
|
|
12
|
+
* writes one event per stdout line:
|
|
13
|
+
* started <pid> the root process is in the job and resumed
|
|
14
|
+
* process <pid> a process joined the job
|
|
15
|
+
* exit <reason> <code> the job is empty; reason is exited, cancelled,
|
|
16
|
+
* memory_limit, process_limit or cpu_limit
|
|
17
|
+
* error <stage> <win32> the job could not be set up; nothing was resumed
|
|
18
|
+
* After "end", a stdin line "cancel", or stdin closing, terminates the job.
|
|
19
|
+
*
|
|
20
|
+
* Containment. One job per run with KILL_ON_JOB_CLOSE, a job memory limit, an
|
|
21
|
+
* active process limit, a per-job user CPU time limit and
|
|
22
|
+
* DIE_ON_UNHANDLED_EXCEPTION. Breakaway is not allowed, so
|
|
23
|
+
* CREATE_BREAKAWAY_FROM_JOB fails for a process directly in the job. A process
|
|
24
|
+
* in a nested job that allows breakaway (node puts its children in one) may
|
|
25
|
+
* leave that inner job, but it stays in this one. The root process is created
|
|
26
|
+
* suspended, assigned to the job, and only then resumed, so it never runs
|
|
27
|
+
* outside the job. The helper holds the only job handle: if the helper dies
|
|
28
|
+
* for any reason the handle closes and Windows kills the whole tree. When the
|
|
29
|
+
* root process exits, the rest of the tree is terminated with it.
|
|
30
|
+
*
|
|
31
|
+
* "--selftest" builds a job with the same limits, reads them back and prints
|
|
32
|
+
* "selftest ok"; the worker runs it after every build.
|
|
33
|
+
*/
|
|
34
|
+
export declare const HELPER_SOURCE: string;
|
|
35
|
+
//# sourceMappingURL=windows-job-helper.d.ts.map
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The native Windows Job Object supervisor (US-006), as C# source.
|
|
3
|
+
*
|
|
4
|
+
* Node cannot create a Job Object or start a process suspended, so the worker
|
|
5
|
+
* compiles this source once with the csc.exe that ships with the .NET
|
|
6
|
+
* Framework 4 in every supported Windows install, and runs the result as a
|
|
7
|
+
* small supervisor per job. No package or system software is installed.
|
|
8
|
+
*
|
|
9
|
+
* Protocol. The worker writes the spec to the helper's stdin as
|
|
10
|
+
* "key<TAB>base64(utf8 value)" lines ended by "end". Keys: app, cmd, cwd,
|
|
11
|
+
* log, env (one line per KEY=VALUE), mem (bytes), procs, cpu (ms). The helper
|
|
12
|
+
* writes one event per stdout line:
|
|
13
|
+
* started <pid> the root process is in the job and resumed
|
|
14
|
+
* process <pid> a process joined the job
|
|
15
|
+
* exit <reason> <code> the job is empty; reason is exited, cancelled,
|
|
16
|
+
* memory_limit, process_limit or cpu_limit
|
|
17
|
+
* error <stage> <win32> the job could not be set up; nothing was resumed
|
|
18
|
+
* After "end", a stdin line "cancel", or stdin closing, terminates the job.
|
|
19
|
+
*
|
|
20
|
+
* Containment. One job per run with KILL_ON_JOB_CLOSE, a job memory limit, an
|
|
21
|
+
* active process limit, a per-job user CPU time limit and
|
|
22
|
+
* DIE_ON_UNHANDLED_EXCEPTION. Breakaway is not allowed, so
|
|
23
|
+
* CREATE_BREAKAWAY_FROM_JOB fails for a process directly in the job. A process
|
|
24
|
+
* in a nested job that allows breakaway (node puts its children in one) may
|
|
25
|
+
* leave that inner job, but it stays in this one. The root process is created
|
|
26
|
+
* suspended, assigned to the job, and only then resumed, so it never runs
|
|
27
|
+
* outside the job. The helper holds the only job handle: if the helper dies
|
|
28
|
+
* for any reason the handle closes and Windows kills the whole tree. When the
|
|
29
|
+
* root process exits, the rest of the tree is terminated with it.
|
|
30
|
+
*
|
|
31
|
+
* "--selftest" builds a job with the same limits, reads them back and prints
|
|
32
|
+
* "selftest ok"; the worker runs it after every build.
|
|
33
|
+
*/
|
|
34
|
+
export const HELPER_SOURCE = String.raw `
|
|
35
|
+
using System;
|
|
36
|
+
using System.Collections.Generic;
|
|
37
|
+
using System.IO;
|
|
38
|
+
using System.Runtime.InteropServices;
|
|
39
|
+
using System.Text;
|
|
40
|
+
using System.Threading;
|
|
41
|
+
|
|
42
|
+
static class HqJob {
|
|
43
|
+
const uint CREATE_SUSPENDED = 0x4, CREATE_UNICODE_ENVIRONMENT = 0x400, CREATE_NO_WINDOW = 0x08000000;
|
|
44
|
+
const uint LIMIT_JOB_TIME = 0x4, LIMIT_ACTIVE_PROCESS = 0x8, LIMIT_JOB_MEMORY = 0x200;
|
|
45
|
+
const uint LIMIT_DIE_ON_UNHANDLED_EXCEPTION = 0x400, LIMIT_KILL_ON_JOB_CLOSE = 0x2000;
|
|
46
|
+
const int BasicAccounting = 1, BasicProcessIdList = 3, PortAssociation = 7, ExtendedLimit = 9;
|
|
47
|
+
const uint MSG_END_OF_JOB_TIME = 1, MSG_ACTIVE_PROCESS_LIMIT = 3, MSG_ACTIVE_PROCESS_ZERO = 4, MSG_NEW_PROCESS = 6;
|
|
48
|
+
const uint MSG_PROCESS_MEMORY_LIMIT = 9, MSG_JOB_MEMORY_LIMIT = 10;
|
|
49
|
+
|
|
50
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
51
|
+
struct BASIC_LIMIT { public long PerProcessUserTimeLimit, PerJobUserTimeLimit; public uint LimitFlags; public UIntPtr MinimumWorkingSetSize, MaximumWorkingSetSize; public uint ActiveProcessLimit; public UIntPtr Affinity; public uint PriorityClass, SchedulingClass; }
|
|
52
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
53
|
+
struct IO_COUNTERS { public ulong ReadOps, WriteOps, OtherOps, ReadBytes, WriteBytes, OtherBytes; }
|
|
54
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
55
|
+
struct EXT_LIMIT { public BASIC_LIMIT Basic; public IO_COUNTERS Io; public UIntPtr ProcessMemoryLimit, JobMemoryLimit, PeakProcessMemoryUsed, PeakJobMemoryUsed; }
|
|
56
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
57
|
+
struct PORT_ASSOC { public IntPtr CompletionKey, CompletionPort; }
|
|
58
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
59
|
+
struct BASIC_ACCOUNTING { public long TotalUserTime, TotalKernelTime, ThisPeriodTotalUserTime, ThisPeriodTotalKernelTime; public uint TotalPageFaultCount, TotalProcesses, ActiveProcesses, TotalTerminatedProcesses; }
|
|
60
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
61
|
+
struct SECURITY_ATTRIBUTES { public int nLength; public IntPtr lpSecurityDescriptor; public bool bInheritHandle; }
|
|
62
|
+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
|
63
|
+
struct STARTUPINFO { public int cb; public string lpReserved, lpDesktop, lpTitle; public int dwX, dwY, dwXSize, dwYSize, dwXCountChars, dwYCountChars, dwFillAttribute, dwFlags; public short wShowWindow, cbReserved2; public IntPtr lpReserved2, hStdInput, hStdOutput, hStdError; }
|
|
64
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
65
|
+
struct PROCESS_INFORMATION { public IntPtr hProcess, hThread; public int dwProcessId, dwThreadId; }
|
|
66
|
+
|
|
67
|
+
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] static extern IntPtr CreateJobObjectW(IntPtr sa, string name);
|
|
68
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool SetInformationJobObject(IntPtr job, int cls, ref EXT_LIMIT info, int size);
|
|
69
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool SetInformationJobObject(IntPtr job, int cls, ref PORT_ASSOC info, int size);
|
|
70
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool QueryInformationJobObject(IntPtr job, int cls, ref EXT_LIMIT info, int size, IntPtr ret);
|
|
71
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool QueryInformationJobObject(IntPtr job, int cls, ref BASIC_ACCOUNTING info, int size, IntPtr ret);
|
|
72
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool QueryInformationJobObject(IntPtr job, int cls, IntPtr info, int size, IntPtr ret);
|
|
73
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool AssignProcessToJobObject(IntPtr job, IntPtr process);
|
|
74
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool TerminateJobObject(IntPtr job, uint code);
|
|
75
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr CreateIoCompletionPort(IntPtr file, IntPtr port, UIntPtr key, uint threads);
|
|
76
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool GetQueuedCompletionStatus(IntPtr port, out uint bytes, out IntPtr key, out IntPtr overlapped, uint ms);
|
|
77
|
+
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] static extern IntPtr CreateFileW(string name, uint access, uint share, ref SECURITY_ATTRIBUTES sa, uint disposition, uint flags, IntPtr template);
|
|
78
|
+
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] static extern bool CreateProcessW(string app, StringBuilder cmd, IntPtr pa, IntPtr ta, bool inherit, uint flags, IntPtr env, string cwd, ref STARTUPINFO si, out PROCESS_INFORMATION pi);
|
|
79
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern uint ResumeThread(IntPtr thread);
|
|
80
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool TerminateProcess(IntPtr process, uint code);
|
|
81
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern uint WaitForSingleObject(IntPtr handle, uint ms);
|
|
82
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool GetExitCodeProcess(IntPtr process, out uint code);
|
|
83
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool CloseHandle(IntPtr handle);
|
|
84
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr GetStdHandle(int which);
|
|
85
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool SetHandleInformation(IntPtr handle, uint mask, uint flags);
|
|
86
|
+
|
|
87
|
+
static readonly object outLock = new object();
|
|
88
|
+
static StreamWriter stdout;
|
|
89
|
+
static IntPtr job;
|
|
90
|
+
static readonly HashSet<long> seen = new HashSet<long>();
|
|
91
|
+
static string reason;
|
|
92
|
+
static uint reasonCode;
|
|
93
|
+
|
|
94
|
+
static void Emit(string line) { lock (outLock) { stdout.Write(line + "\n"); stdout.Flush(); } }
|
|
95
|
+
|
|
96
|
+
static void Seen(long pid) {
|
|
97
|
+
bool added;
|
|
98
|
+
lock (seen) added = seen.Add(pid);
|
|
99
|
+
if (added) Emit("process " + pid);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The first reason wins. A limit or a cancel terminates the job at once. */
|
|
103
|
+
static void Stop(string why, uint code) {
|
|
104
|
+
lock (outLock) {
|
|
105
|
+
if (reason != null) return;
|
|
106
|
+
reason = why;
|
|
107
|
+
reasonCode = code;
|
|
108
|
+
}
|
|
109
|
+
TerminateJobObject(job, code);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
static EXT_LIMIT Limits(long mem, uint procs, long cpuMs) {
|
|
113
|
+
var ext = new EXT_LIMIT();
|
|
114
|
+
ext.Basic.LimitFlags = LIMIT_KILL_ON_JOB_CLOSE | LIMIT_JOB_MEMORY | LIMIT_ACTIVE_PROCESS | LIMIT_JOB_TIME | LIMIT_DIE_ON_UNHANDLED_EXCEPTION;
|
|
115
|
+
ext.Basic.PerJobUserTimeLimit = cpuMs * 10000;
|
|
116
|
+
ext.Basic.ActiveProcessLimit = procs;
|
|
117
|
+
ext.JobMemoryLimit = new UIntPtr((ulong)mem);
|
|
118
|
+
return ext;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
static int SelfTest() {
|
|
122
|
+
IntPtr j = CreateJobObjectW(IntPtr.Zero, null);
|
|
123
|
+
if (j == IntPtr.Zero) { Emit("error create " + Marshal.GetLastWin32Error()); return 3; }
|
|
124
|
+
var ext = Limits(64L << 20, 4, 1000);
|
|
125
|
+
if (!SetInformationJobObject(j, ExtendedLimit, ref ext, Marshal.SizeOf(typeof(EXT_LIMIT)))) { Emit("error limits " + Marshal.GetLastWin32Error()); return 3; }
|
|
126
|
+
var back = new EXT_LIMIT();
|
|
127
|
+
if (!QueryInformationJobObject(j, ExtendedLimit, ref back, Marshal.SizeOf(typeof(EXT_LIMIT)), IntPtr.Zero)) { Emit("error query " + Marshal.GetLastWin32Error()); return 3; }
|
|
128
|
+
bool ok = back.Basic.LimitFlags == ext.Basic.LimitFlags && back.Basic.ActiveProcessLimit == 4 && back.JobMemoryLimit.ToUInt64() == (64UL << 20) && back.Basic.PerJobUserTimeLimit == 1000L * 10000;
|
|
129
|
+
CloseHandle(j);
|
|
130
|
+
Emit(ok ? "selftest ok" : "selftest mismatch");
|
|
131
|
+
return ok ? 0 : 3;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
static string EnvBlock(List<string> pairs) {
|
|
135
|
+
pairs.Sort((a, b) => string.Compare(a.Substring(0, a.IndexOf('=')), b.Substring(0, b.IndexOf('=')), StringComparison.OrdinalIgnoreCase));
|
|
136
|
+
var sb = new StringBuilder();
|
|
137
|
+
foreach (var p in pairs) { sb.Append(p); sb.Append('\0'); }
|
|
138
|
+
sb.Append('\0');
|
|
139
|
+
return sb.ToString();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
static void PollList() {
|
|
143
|
+
int size = 8 + IntPtr.Size * 1024;
|
|
144
|
+
IntPtr buf = Marshal.AllocHGlobal(size);
|
|
145
|
+
try {
|
|
146
|
+
if (!QueryInformationJobObject(job, BasicProcessIdList, buf, size, IntPtr.Zero)) return;
|
|
147
|
+
int n = Marshal.ReadInt32(buf, 4);
|
|
148
|
+
for (int i = 0; i < n; i++) Seen(Marshal.ReadIntPtr(buf, 8 + i * IntPtr.Size).ToInt64());
|
|
149
|
+
} finally { Marshal.FreeHGlobal(buf); }
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Returns true when the job has no processes left. */
|
|
153
|
+
static bool Handle(uint msg, IntPtr ov) {
|
|
154
|
+
if (msg == MSG_NEW_PROCESS) Seen(ov.ToInt64());
|
|
155
|
+
else if (msg == MSG_JOB_MEMORY_LIMIT || msg == MSG_PROCESS_MEMORY_LIMIT) Stop("memory_limit", 0xE0000001);
|
|
156
|
+
else if (msg == MSG_ACTIVE_PROCESS_LIMIT) Stop("process_limit", 0xE0000002);
|
|
157
|
+
else if (msg == MSG_END_OF_JOB_TIME) Stop("cpu_limit", 0xE0000003);
|
|
158
|
+
else if (msg == MSG_ACTIVE_PROCESS_ZERO) return true;
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
static int Main(string[] args) {
|
|
163
|
+
stdout = new StreamWriter(Console.OpenStandardOutput(), new UTF8Encoding(false));
|
|
164
|
+
if (args.Length == 1 && args[0] == "--selftest") return SelfTest();
|
|
165
|
+
|
|
166
|
+
// The helper's own pipes to the worker must not leak into the job.
|
|
167
|
+
for (int i = -10; i >= -12; i--) SetHandleInformation(GetStdHandle(i), 1, 0);
|
|
168
|
+
|
|
169
|
+
var input = new StreamReader(Console.OpenStandardInput(), new UTF8Encoding(false));
|
|
170
|
+
var spec = new Dictionary<string, string>();
|
|
171
|
+
var env = new List<string>();
|
|
172
|
+
for (string line; (line = input.ReadLine()) != null && line != "end";) {
|
|
173
|
+
int tab = line.IndexOf('\t');
|
|
174
|
+
if (tab < 0) continue;
|
|
175
|
+
string key = line.Substring(0, tab), val = Encoding.UTF8.GetString(Convert.FromBase64String(line.Substring(tab + 1)));
|
|
176
|
+
if (key == "env") env.Add(val); else spec[key] = val;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
job = CreateJobObjectW(IntPtr.Zero, null);
|
|
180
|
+
if (job == IntPtr.Zero) { Emit("error create " + Marshal.GetLastWin32Error()); return 3; }
|
|
181
|
+
var ext = Limits(long.Parse(spec["mem"]), uint.Parse(spec["procs"]), long.Parse(spec["cpu"]));
|
|
182
|
+
if (!SetInformationJobObject(job, ExtendedLimit, ref ext, Marshal.SizeOf(typeof(EXT_LIMIT)))) { Emit("error limits " + Marshal.GetLastWin32Error()); return 3; }
|
|
183
|
+
IntPtr port = CreateIoCompletionPort(new IntPtr(-1), IntPtr.Zero, UIntPtr.Zero, 1);
|
|
184
|
+
var assoc = new PORT_ASSOC { CompletionKey = job, CompletionPort = port };
|
|
185
|
+
if (port == IntPtr.Zero || !SetInformationJobObject(job, PortAssociation, ref assoc, Marshal.SizeOf(typeof(PORT_ASSOC)))) { Emit("error port " + Marshal.GetLastWin32Error()); return 3; }
|
|
186
|
+
|
|
187
|
+
var sa = new SECURITY_ATTRIBUTES { nLength = Marshal.SizeOf(typeof(SECURITY_ATTRIBUTES)), bInheritHandle = true };
|
|
188
|
+
IntPtr log = CreateFileW(spec["log"], 0x40000000, 7, ref sa, 2, 0x80, IntPtr.Zero);
|
|
189
|
+
IntPtr nul = CreateFileW("NUL", 0x80000000, 3, ref sa, 3, 0, IntPtr.Zero);
|
|
190
|
+
if (log == new IntPtr(-1) || nul == new IntPtr(-1)) { Emit("error log " + Marshal.GetLastWin32Error()); return 3; }
|
|
191
|
+
|
|
192
|
+
var si = new STARTUPINFO { cb = Marshal.SizeOf(typeof(STARTUPINFO)), dwFlags = 0x100, hStdInput = nul, hStdOutput = log, hStdError = log };
|
|
193
|
+
IntPtr block = Marshal.StringToHGlobalUni(EnvBlock(env));
|
|
194
|
+
PROCESS_INFORMATION pi;
|
|
195
|
+
bool created = CreateProcessW(spec["app"], new StringBuilder(spec["cmd"]), IntPtr.Zero, IntPtr.Zero, true,
|
|
196
|
+
CREATE_SUSPENDED | CREATE_UNICODE_ENVIRONMENT | CREATE_NO_WINDOW, block, spec["cwd"], ref si, out pi);
|
|
197
|
+
int createErr = Marshal.GetLastWin32Error();
|
|
198
|
+
Marshal.FreeHGlobal(block);
|
|
199
|
+
CloseHandle(log);
|
|
200
|
+
CloseHandle(nul);
|
|
201
|
+
if (!created) { Emit("error create_process " + createErr); return 3; }
|
|
202
|
+
if (!AssignProcessToJobObject(job, pi.hProcess)) {
|
|
203
|
+
int err = Marshal.GetLastWin32Error();
|
|
204
|
+
TerminateProcess(pi.hProcess, 1);
|
|
205
|
+
Emit("error assign " + err);
|
|
206
|
+
return 3;
|
|
207
|
+
}
|
|
208
|
+
// The root is in the job but still suspended. If it cannot be resumed it
|
|
209
|
+
// never runs: terminate the job so nothing is left behind, and report it.
|
|
210
|
+
if (ResumeThread(pi.hThread) == 0xFFFFFFFF) {
|
|
211
|
+
int err = Marshal.GetLastWin32Error();
|
|
212
|
+
TerminateJobObject(job, 1);
|
|
213
|
+
CloseHandle(pi.hThread);
|
|
214
|
+
Emit("error resume " + err);
|
|
215
|
+
return 3;
|
|
216
|
+
}
|
|
217
|
+
CloseHandle(pi.hThread);
|
|
218
|
+
Emit("started " + pi.dwProcessId);
|
|
219
|
+
Seen(pi.dwProcessId);
|
|
220
|
+
|
|
221
|
+
var reader = new Thread(() => {
|
|
222
|
+
try {
|
|
223
|
+
for (string line; (line = input.ReadLine()) != null;) if (line == "cancel") break;
|
|
224
|
+
} catch (Exception) { }
|
|
225
|
+
Stop("cancelled", 0xE0000000);
|
|
226
|
+
});
|
|
227
|
+
reader.IsBackground = true;
|
|
228
|
+
reader.Start();
|
|
229
|
+
|
|
230
|
+
bool rootDone = false;
|
|
231
|
+
uint rootCode = 0;
|
|
232
|
+
long cpuLimit = long.Parse(spec["cpu"]) * 10000;
|
|
233
|
+
for (;;) {
|
|
234
|
+
uint msg; IntPtr key, ov;
|
|
235
|
+
if (GetQueuedCompletionStatus(port, out msg, out key, out ov, 200)) {
|
|
236
|
+
if (Handle(msg, ov)) break;
|
|
237
|
+
} else {
|
|
238
|
+
PollList();
|
|
239
|
+
var acct = new BASIC_ACCOUNTING();
|
|
240
|
+
if (QueryInformationJobObject(job, BasicAccounting, ref acct, Marshal.SizeOf(typeof(BASIC_ACCOUNTING)), IntPtr.Zero)) {
|
|
241
|
+
if (acct.TotalUserTime >= cpuLimit) Stop("cpu_limit", 0xE0000003);
|
|
242
|
+
if (acct.ActiveProcesses == 0) break;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (!rootDone && WaitForSingleObject(pi.hProcess, 0) == 0) {
|
|
246
|
+
rootDone = true;
|
|
247
|
+
GetExitCodeProcess(pi.hProcess, out rootCode);
|
|
248
|
+
// A limit message posted before the root exited is still queued; read it first.
|
|
249
|
+
bool empty = false;
|
|
250
|
+
while (GetQueuedCompletionStatus(port, out msg, out key, out ov, 0)) if (Handle(msg, ov)) { empty = true; break; }
|
|
251
|
+
Stop("exited", rootCode);
|
|
252
|
+
if (empty) break;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (!rootDone) GetExitCodeProcess(pi.hProcess, out rootCode);
|
|
256
|
+
string why;
|
|
257
|
+
uint code;
|
|
258
|
+
lock (outLock) { why = reason ?? "exited"; code = reason == null ? rootCode : (reason == "exited" ? rootCode : reasonCode); }
|
|
259
|
+
Emit("exit " + why + " " + code);
|
|
260
|
+
return 0;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
`;
|
|
264
|
+
//# sourceMappingURL=windows-job-helper.js.map
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import type { DeliveryAccess } from "../enrollment.js";
|
|
2
|
+
import type { WorkerIdentity } from "../identity.js";
|
|
3
|
+
import { type BoundaryContext, type BoundaryProbe, type BoundaryRun } from "./windows-boundary.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
|
+
}
|
|
14
|
+
export interface Requirements {
|
|
15
|
+
/** The job runs on any one of these platforms. */
|
|
16
|
+
platforms: string[];
|
|
17
|
+
/** Toolchain name -> semver range the installed version must satisfy. */
|
|
18
|
+
toolchains?: Record<string, string>;
|
|
19
|
+
capabilities?: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface InputRef {
|
|
22
|
+
/** File name inside the attempt's inputs directory. */
|
|
23
|
+
name: string;
|
|
24
|
+
sha256: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ResourceLimits {
|
|
27
|
+
/** Committed memory of the whole job, in bytes. */
|
|
28
|
+
memoryBytes: number;
|
|
29
|
+
/** Processes alive in the job at once. */
|
|
30
|
+
maxProcesses: number;
|
|
31
|
+
/** User-mode CPU time of the whole job, in milliseconds. */
|
|
32
|
+
cpuTimeMs: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ExecutionSpec {
|
|
35
|
+
schemaVersion: string;
|
|
36
|
+
tenantId: string;
|
|
37
|
+
runId: string;
|
|
38
|
+
jobId: string;
|
|
39
|
+
requires: Requirements;
|
|
40
|
+
/** file is an absolute path; it runs in the attempt directory. */
|
|
41
|
+
command: {
|
|
42
|
+
file: string;
|
|
43
|
+
args: string[];
|
|
44
|
+
};
|
|
45
|
+
inputs: InputRef[];
|
|
46
|
+
/** The complete environment of the job. Nothing is inherited. */
|
|
47
|
+
env: Record<string, string>;
|
|
48
|
+
limits: ResourceLimits;
|
|
49
|
+
}
|
|
50
|
+
/** What the native launcher contains. A job may require any of these. */
|
|
51
|
+
export declare const CONTAINMENT_CAPABILITIES: readonly string[];
|
|
52
|
+
export declare const KNOWN_CAPABILITIES: readonly string[];
|
|
53
|
+
export type RefusalCode = "INVALID_SPEC" | "UNKNOWN_JOB" | "PLATFORM_MISMATCH" | "TOOLCHAIN_MISMATCH" | "UNKNOWN_CAPABILITY" | "CAPABILITY_MISSING" | "INPUT_MISSING" | "INPUT_CHANGED" | "CONTAINMENT_UNAVAILABLE";
|
|
54
|
+
export type MatchResult = {
|
|
55
|
+
ok: true;
|
|
56
|
+
} | {
|
|
57
|
+
ok: false;
|
|
58
|
+
code: RefusalCode;
|
|
59
|
+
detail: string;
|
|
60
|
+
};
|
|
61
|
+
/** The profile of the host this process runs on. */
|
|
62
|
+
export declare function detectProfile(): WorkerProfile;
|
|
63
|
+
/** Check a worker profile against a job's requirements. Platform first, then toolchains, then capabilities. */
|
|
64
|
+
export declare function matchCapabilities(profile: WorkerProfile, req: Requirements): MatchResult;
|
|
65
|
+
/** The first problem with a spec, or null when it is well formed. */
|
|
66
|
+
export declare function validateSpec(spec: ExecutionSpec): string | null;
|
|
67
|
+
/**
|
|
68
|
+
* Content-addressed input blobs. An admitted input is stored under its hash,
|
|
69
|
+
* read-only; a job names the hash, and the bytes are checked again before the
|
|
70
|
+
* claim and when they are copied into the attempt.
|
|
71
|
+
*/
|
|
72
|
+
export declare class InputStore {
|
|
73
|
+
private readonly dir;
|
|
74
|
+
private constructor();
|
|
75
|
+
static open(dir: string): InputStore;
|
|
76
|
+
admit(name: string, path: string): InputRef;
|
|
77
|
+
blobPath(hash: string): string;
|
|
78
|
+
/** null when the blob is present and unchanged. */
|
|
79
|
+
verify(ref: InputRef): "INPUT_MISSING" | "INPUT_CHANGED" | null;
|
|
80
|
+
/** Copy a verified blob to destDir/name, read-only. */
|
|
81
|
+
materialize(ref: InputRef, destDir: string): string;
|
|
82
|
+
}
|
|
83
|
+
export type ResultKind = "refused" | "succeeded" | "failed" | "cancelled" | "limit_exceeded";
|
|
84
|
+
export interface TerminalResult {
|
|
85
|
+
schemaVersion: string;
|
|
86
|
+
kind: ResultKind;
|
|
87
|
+
code: string;
|
|
88
|
+
detail: string;
|
|
89
|
+
tenantId: string;
|
|
90
|
+
runId: string;
|
|
91
|
+
jobId: string;
|
|
92
|
+
attemptId: string | null;
|
|
93
|
+
pid: number | null;
|
|
94
|
+
exitCode: number | null;
|
|
95
|
+
/** The declared environment keys, sorted. Values are never recorded. */
|
|
96
|
+
envKeys: string[];
|
|
97
|
+
startedAt: string | null;
|
|
98
|
+
finishedAt: string;
|
|
99
|
+
}
|
|
100
|
+
/** Append-only JSON lines of terminal results. One result per attempt. */
|
|
101
|
+
export declare class ResultLog {
|
|
102
|
+
private readonly path;
|
|
103
|
+
private readonly lines;
|
|
104
|
+
private constructor();
|
|
105
|
+
static open(path: string): ResultLog;
|
|
106
|
+
/** Append a result. A second result for the same attempt is not written; the first is returned. */
|
|
107
|
+
append(result: TerminalResult): TerminalResult;
|
|
108
|
+
all(): TerminalResult[];
|
|
109
|
+
forJob(jobId: string): TerminalResult[];
|
|
110
|
+
}
|
|
111
|
+
export interface LaunchRequest {
|
|
112
|
+
file: string;
|
|
113
|
+
args: string[];
|
|
114
|
+
cwd: string;
|
|
115
|
+
env: Record<string, string>;
|
|
116
|
+
/** stdout and stderr of the job go here. */
|
|
117
|
+
logPath: string;
|
|
118
|
+
limits: ResourceLimits;
|
|
119
|
+
}
|
|
120
|
+
export type LaunchOutcome = {
|
|
121
|
+
reason: "exited";
|
|
122
|
+
exitCode: number;
|
|
123
|
+
} | {
|
|
124
|
+
reason: "cancelled";
|
|
125
|
+
exitCode?: number;
|
|
126
|
+
} | {
|
|
127
|
+
reason: "limit";
|
|
128
|
+
limit: "memory" | "processes" | "cpu";
|
|
129
|
+
exitCode?: number;
|
|
130
|
+
} | {
|
|
131
|
+
reason: "supervisor_lost";
|
|
132
|
+
detail: string;
|
|
133
|
+
} | {
|
|
134
|
+
reason: "spawn_failed";
|
|
135
|
+
detail: string;
|
|
136
|
+
};
|
|
137
|
+
export interface ContainedProcess {
|
|
138
|
+
/** The supervisor's pid until the root process starts; read ready for the root pid. */
|
|
139
|
+
readonly pid: number;
|
|
140
|
+
/** The process that owns the containment, or null when there is none. */
|
|
141
|
+
supervisorPid: number | null;
|
|
142
|
+
/** The root pid once it runs inside the containment, or -1 when it never started. Never rejects. */
|
|
143
|
+
ready: Promise<number>;
|
|
144
|
+
/** Every pid seen in the containment so far. */
|
|
145
|
+
processes(): number[];
|
|
146
|
+
/** Kill the whole tree. Safe to call more than once. */
|
|
147
|
+
cancel(): void;
|
|
148
|
+
done: Promise<LaunchOutcome>;
|
|
149
|
+
}
|
|
150
|
+
export interface LaunchRun {
|
|
151
|
+
tenantId: string;
|
|
152
|
+
runId: string;
|
|
153
|
+
jobId: string;
|
|
154
|
+
}
|
|
155
|
+
export interface ContainedLauncher {
|
|
156
|
+
/** The worker passes the run it prepared, so a launcher can check it admitted that run. */
|
|
157
|
+
launch(req: LaunchRequest, run?: LaunchRun): ContainedProcess;
|
|
158
|
+
/** Throws a WorkerRefusal when the launcher cannot contain this run's job on this host. Runs before the claim. */
|
|
159
|
+
prepare?(run?: LaunchRun): void;
|
|
160
|
+
}
|
|
161
|
+
export declare class WorkerRefusal extends Error {
|
|
162
|
+
readonly code: string;
|
|
163
|
+
readonly detail: string;
|
|
164
|
+
constructor(code: string, detail: string);
|
|
165
|
+
}
|
|
166
|
+
/** Quote one argument for a Windows command line, following the CommandLineToArgvW rules. */
|
|
167
|
+
export declare function quoteWindowsArg(arg: string): string;
|
|
168
|
+
/**
|
|
169
|
+
* Map what the job helper reported to a launch outcome. An error line before
|
|
170
|
+
* any "started" line (for example "error resume <code>", sent after the helper
|
|
171
|
+
* has terminated the job) is a spawn failure.
|
|
172
|
+
*/
|
|
173
|
+
export declare function helperOutcome(h: {
|
|
174
|
+
exitLine?: string;
|
|
175
|
+
errorLine?: string;
|
|
176
|
+
rootPid: number;
|
|
177
|
+
code: number | null;
|
|
178
|
+
spawnError?: string;
|
|
179
|
+
stderr: string;
|
|
180
|
+
}): LaunchOutcome;
|
|
181
|
+
/** Submits an admitted job to the boundary service. Root's service binding implements this. */
|
|
182
|
+
export interface ServiceTransport {
|
|
183
|
+
submit(req: LaunchRequest, run: BoundaryRun): ContainedProcess;
|
|
184
|
+
}
|
|
185
|
+
export interface NativeWindowsLauncherOptions {
|
|
186
|
+
/** Reports the seven boundary predicates for a run. Without one the launcher refuses. */
|
|
187
|
+
probe?: BoundaryProbe;
|
|
188
|
+
/** The installation, configuration and freshness a probe result must match. */
|
|
189
|
+
context?: BoundaryContext;
|
|
190
|
+
/** The authenticated channel to the service. Without one the launcher refuses. */
|
|
191
|
+
transport?: ServiceTransport;
|
|
192
|
+
/** Defaults to process.platform. */
|
|
193
|
+
platform?: NodeJS.Platform;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* The native Windows launcher (proposal 039). A job runs only through the
|
|
197
|
+
* boundary service: the probe must report all seven predicates as passing,
|
|
198
|
+
* fresh and for this installation, and the job goes to the service over the
|
|
199
|
+
* transport. There is no local compile and no same-user fallback; any missing
|
|
200
|
+
* piece is CONTAINMENT_UNAVAILABLE before the claim.
|
|
201
|
+
*/
|
|
202
|
+
export declare function nativeWindowsLauncher(opts?: NativeWindowsLauncherOptions): ContainedLauncher;
|
|
203
|
+
export type StartResult = {
|
|
204
|
+
kind: "refused";
|
|
205
|
+
result: TerminalResult;
|
|
206
|
+
} | {
|
|
207
|
+
kind: "failed";
|
|
208
|
+
result: TerminalResult;
|
|
209
|
+
} | {
|
|
210
|
+
kind: "started";
|
|
211
|
+
attemptId: string;
|
|
212
|
+
pid: number;
|
|
213
|
+
process: ContainedProcess;
|
|
214
|
+
logPath: string;
|
|
215
|
+
cancel: () => void;
|
|
216
|
+
result: Promise<TerminalResult>;
|
|
217
|
+
};
|
|
218
|
+
export interface WindowsWorkerOptions {
|
|
219
|
+
access: DeliveryAccess;
|
|
220
|
+
identity: WorkerIdentity;
|
|
221
|
+
profile: WorkerProfile;
|
|
222
|
+
inputs: InputStore;
|
|
223
|
+
results: ResultLog;
|
|
224
|
+
/** Each attempt runs in workDir/<attemptId>. */
|
|
225
|
+
workDir: string;
|
|
226
|
+
launcher: ContainedLauncher;
|
|
227
|
+
clock?: () => Date;
|
|
228
|
+
}
|
|
229
|
+
export declare class WindowsWorker {
|
|
230
|
+
private readonly opts;
|
|
231
|
+
private readonly clock;
|
|
232
|
+
constructor(opts: WindowsWorkerOptions);
|
|
233
|
+
private now;
|
|
234
|
+
private result;
|
|
235
|
+
private refuse;
|
|
236
|
+
/** Report the ledger outcome, then append the one terminal result. A ledger or result-log failure is reported, never thrown. */
|
|
237
|
+
private finish;
|
|
238
|
+
start(spec: ExecutionSpec): Promise<StartResult>;
|
|
239
|
+
private mapOutcome;
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=windows.d.ts.map
|