witnora 0.18.8 → 0.18.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -255,7 +255,7 @@ else if (command === "gateway") {
255
255
  throw new Error("Use witnora gateway service install|uninstall.");
256
256
  }
257
257
  else if (action === "supervise") {
258
- await superviseManagedCustomerGateway({ repository: readFlag("--repo") ?? process.cwd(), dir: readFlag("--dir"), output: (message) => process.stdout.write(message) });
258
+ await superviseManagedCustomerGateway({ repository: readFlag("--repo") ?? process.cwd(), dir: readFlag("--dir"), configHome: readFlag("--config-home"), output: (message) => process.stdout.write(message) });
259
259
  }
260
260
  else if (action === "stop") {
261
261
  const result = await stopManagedCustomerGateway({ repository: readFlag("--repo") ?? process.cwd(), dir: readFlag("--dir") });
@@ -7,6 +7,13 @@ import { promisify } from "node:util";
7
7
  const execFileAsync = promisify(execFile);
8
8
  export async function installGatewayService(input) {
9
9
  const plan = createGatewayServicePlan(input);
10
+ // A prior task can still be supervising an older generated Gateway. End it
11
+ // before replacing the definition so onboarding never leaves two owners
12
+ // racing for the same localhost port.
13
+ if (plan.kind === "WINDOWS_TASK")
14
+ await input.run(plan.stop.command, plan.stop.args).catch(() => undefined);
15
+ if (plan.launcher)
16
+ await input.writeDefinition(plan.launcher.path, plan.launcher.definition);
10
17
  await input.writeDefinition(plan.definitionPath, plan.definition);
11
18
  if (plan.kind === "SYSTEMD_USER")
12
19
  await input.run("systemctl", ["--user", "daemon-reload"]);
@@ -35,6 +42,8 @@ export async function uninstallCurrentGatewayService(options) {
35
42
  if (plan.kind === "SYSTEMD_USER")
36
43
  await run("systemctl", ["--user", "daemon-reload"]);
37
44
  await rm(plan.definitionPath, { force: true });
45
+ if (plan.launcher)
46
+ await rm(plan.launcher.path, { force: true });
38
47
  return { uninstalled: true, plan };
39
48
  }
40
49
  export async function restartCurrentGatewayService(options) {
@@ -48,6 +57,8 @@ export function createGatewayServicePlan(input) {
48
57
  const suffix = createHash("sha256").update(`${input.repository}\n${input.gatewayDirectory}`).digest("hex").slice(0, 12);
49
58
  const id = `witnora-gateway-${suffix}`;
50
59
  const superviseArgs = [input.cliEntry, "gateway", "supervise", "--repo", input.repository, "--dir", input.gatewayDirectory];
60
+ if (input.configHome)
61
+ superviseArgs.push("--config-home", input.configHome);
51
62
  if (input.platform === "win32")
52
63
  return windowsPlan(input, id, superviseArgs);
53
64
  if (input.platform === "darwin")
@@ -58,17 +69,23 @@ export function createGatewayServicePlan(input) {
58
69
  }
59
70
  function windowsPlan(input, id, args) {
60
71
  const definitionPath = `${input.serviceHome}\\${id}.xml`;
61
- const hiddenCommand = `& ${[input.nodeExecutable, ...args].map(powerShellArgument).join(" ")}`;
62
- const argumentsValue = ["-NoLogo", "-NoProfile", "-NonInteractive", "-WindowStyle", "Hidden", "-Command", hiddenCommand]
63
- .map(windowsArgument).join(" ");
72
+ const launcherPath = `${input.serviceHome}\\${id}.vbs`;
73
+ const commandLine = [input.nodeExecutable, ...args].map(windowsArgument).join(" ");
74
+ const launcherDefinition = [
75
+ 'Set shell = CreateObject("WScript.Shell")',
76
+ `shell.CurrentDirectory = ${vbScriptString(input.repository)}`,
77
+ `exitCode = shell.Run(${vbScriptString(commandLine)}, 0, True)`,
78
+ "WScript.Quit exitCode",
79
+ ].join("\r\n");
80
+ const argumentsValue = ["//B", "//NoLogo", launcherPath].map(windowsArgument).join(" ");
64
81
  const definition = `<?xml version="1.0" encoding="UTF-16"?>
65
82
  <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
66
83
  <Triggers><LogonTrigger><Enabled>true</Enabled><UserId>${xml(input.userId)}</UserId></LogonTrigger></Triggers>
67
84
  <Principals><Principal id="Author"><UserId>${xml(input.userId)}</UserId><LogonType>InteractiveToken</LogonType><RunLevel>LeastPrivilege</RunLevel></Principal></Principals>
68
- <Settings><MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy><StartWhenAvailable>true</StartWhenAvailable><ExecutionTimeLimit>PT0S</ExecutionTimeLimit><RestartOnFailure><Interval>PT1M</Interval><Count>999</Count></RestartOnFailure></Settings>
69
- <Actions Context="Author"><Exec><Command>powershell.exe</Command><Arguments>${xml(argumentsValue)}</Arguments><WorkingDirectory>${xml(input.repository)}</WorkingDirectory></Exec></Actions>
85
+ <Settings><MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy><StartWhenAvailable>true</StartWhenAvailable><Hidden>true</Hidden><ExecutionTimeLimit>PT0S</ExecutionTimeLimit><RestartOnFailure><Interval>PT1M</Interval><Count>999</Count></RestartOnFailure></Settings>
86
+ <Actions Context="Author"><Exec><Command>wscript.exe</Command><Arguments>${xml(argumentsValue)}</Arguments><WorkingDirectory>${xml(input.repository)}</WorkingDirectory></Exec></Actions>
70
87
  </Task>`;
71
- return { id, kind: "WINDOWS_TASK", definitionPath, definition,
88
+ return { id, kind: "WINDOWS_TASK", definitionPath, definition, launcher: { path: launcherPath, definition: launcherDefinition },
72
89
  install: { command: "schtasks.exe", args: ["/Create", "/TN", id, "/XML", definitionPath, "/F"] },
73
90
  start: { command: "schtasks.exe", args: ["/Run", "/TN", id] },
74
91
  stop: { command: "schtasks.exe", args: ["/End", "/TN", id] },
@@ -82,13 +99,13 @@ function currentPlanInput(options) {
82
99
  const env = options.env ?? process.env;
83
100
  const serviceHome = platform === "win32" ? join(env.LOCALAPPDATA ?? join(homedir(), "AppData", "Local"), "Witnora", "services")
84
101
  : platform === "darwin" ? join(homedir(), "Library", "LaunchAgents") : join(homedir(), ".config", "systemd", "user");
85
- return { platform, repository, gatewayDirectory: resolve(repository, options.gatewayDirectory ?? ".witnora/gateway"), cliEntry: resolve(options.cliEntry), nodeExecutable: options.nodeExecutable ?? process.execPath, serviceHome, userId: platform === "win32" ? `${env.USERDOMAIN ? `${env.USERDOMAIN}\\` : ""}${env.USERNAME ?? userInfo().username}` : userInfo().username };
102
+ return { platform, repository, gatewayDirectory: resolve(repository, options.gatewayDirectory ?? ".witnora/gateway"), cliEntry: resolve(options.cliEntry), nodeExecutable: options.nodeExecutable ?? process.execPath, serviceHome, userId: platform === "win32" ? `${env.USERDOMAIN ? `${env.USERDOMAIN}\\` : ""}${env.USERNAME ?? userInfo().username}` : userInfo().username, configHome: options.configHome ?? env.WITNORA_CONFIG_HOME };
86
103
  }
87
104
  async function runCommand(command, args) { await execFileAsync(command, args, { windowsHide: true }); }
88
105
  function systemdPlan(input, id, args) {
89
106
  const unit = `${id}.service`;
90
107
  const definitionPath = `${input.serviceHome}/${unit}`;
91
- const definition = `[Unit]\nDescription=Witnora customer-owned Gateway\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=${systemd(input.repository)}\nExecStart=${[input.nodeExecutable, ...args].map(systemd).join(" ")}\nRestart=always\nRestartSec=5\n\n[Install]\nWantedBy=default.target\n`;
108
+ const definition = `[Unit]\nDescription=Witnora customer-owned Gateway\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=${systemdPath(input.repository)}\nExecStart=${[input.nodeExecutable, ...args].map(systemd).join(" ")}\nRestart=always\nRestartSec=5\n\n[Install]\nWantedBy=default.target\n`;
92
109
  return { id, kind: "SYSTEMD_USER", definitionPath, definition,
93
110
  install: { command: "systemctl", args: ["--user", "enable", "--now", unit] },
94
111
  start: { command: "systemctl", args: ["--user", "start", unit] },
@@ -108,6 +125,12 @@ function launchdPlan(input, id, args) {
108
125
  uninstall: { command: "launchctl", args: ["bootout", domain, definitionPath] } };
109
126
  }
110
127
  function windowsArgument(value) { return `"${value.replaceAll('"', '\\"')}"`; }
111
- function powerShellArgument(value) { return `'${value.replaceAll("'", "''")}'`; }
128
+ function vbScriptString(value) { return `"${value.replaceAll('"', '""')}"`; }
112
129
  function systemd(value) { return `"${value.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`; }
130
+ function systemdPath(value) {
131
+ return value
132
+ .replaceAll("\\", "\\\\")
133
+ .replaceAll("%", "%%")
134
+ .replace(/[\s#;]/g, (character) => `\\x${character.charCodeAt(0).toString(16).padStart(2, "0")}`);
135
+ }
113
136
  function xml(value) { return value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&apos;"); }
package/dist/gateway.js CHANGED
@@ -1111,7 +1111,7 @@ export async function restartManagedCustomerGateway(options = {}) {
1111
1111
  }
1112
1112
  export async function superviseManagedCustomerGateway(options = {}) {
1113
1113
  const inspect = options.inspect ?? (() => statusManagedCustomerGateway({ repository: options.repository, dir: options.dir }));
1114
- const start = options.start ?? (() => startManagedCustomerGateway({ repository: options.repository, dir: options.dir }));
1114
+ const start = options.start ?? (() => startManagedCustomerGateway({ repository: options.repository, dir: options.dir, configHome: options.configHome }));
1115
1115
  const sleep = options.sleep ?? wait;
1116
1116
  const maxCycles = options.maxCycles ?? Number.POSITIVE_INFINITY;
1117
1117
  let recoveries = 0;
@@ -1425,7 +1425,7 @@ function gatewayClient(config) {
1425
1425
  const requestHelper = `async function actionRequest(path, init = {}) {\n const headers = new Headers(init.headers);\n headers.set("authorization", \`Bearer \${await token()}\`);\n if (init.body) headers.set("content-type", "application/json");\n const response = await fetch(\`\${baseUrl}\${path}\`, { ...init, headers });\n const result = await response.json().catch(() => ({}));\n if (!response.ok) throw new Error(result.error ?? \`Witnora Gateway returned HTTP \${response.status}.\`);\n return result;\n}\n`;
1426
1426
  const actionMethods = ` proposeAction(proposal, idempotencyKey = proposal?.externalId) {\n if (typeof idempotencyKey !== "string" || !idempotencyKey) throw new Error("Witnora action proposal requires an idempotency key or externalId.");\n return actionRequest("/v1/actions", { method: "POST", body: JSON.stringify({ proposal, idempotencyKey }) });\n },\n getAction(actionId) {\n if (!/^[A-Za-z0-9._:-]+$/.test(actionId)) throw new Error("Witnora actionId contains unsupported characters.");\n return actionRequest(\`/v1/actions/\${encodeURIComponent(actionId)}\`);\n },\n issueExecutionGrant(actionId, grant, idempotencyKey = \`grant:\${actionId}\`) {\n if (!/^[A-Za-z0-9._:-]+$/.test(actionId)) throw new Error("Witnora actionId contains unsupported characters.");\n return actionRequest(\`/v1/actions/\${encodeURIComponent(actionId)}/execution-grant\`, { method: "POST", body: JSON.stringify({ grant, idempotencyKey }) });\n },\n`;
1427
1427
  const localSandboxMethod = config.runtimeWorker?.adapterId === LOCAL_SANDBOX_ADAPTER_ID && config.runtimeWorker.mandateId && config.runtimeWorker.sandboxPrincipalId
1428
- ? ` async proposeLocalSandboxUpdate({ resourceId, status = "UPDATED", externalId = \`runtime-sandbox-\${crypto.randomUUID()}\`, agentBuildId = "witnora-local-sandbox-task@1.0.0" }) {\n if (!/^[A-Za-z0-9._:-]+$/.test(resourceId)) throw new Error("Local sandbox resourceId contains unsupported characters.");\n const approvedParameters = { resourceId, status };\n const digest = Buffer.from(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(agentBuildId))).toString("hex");\n const proposal = {\n externalId, principal: { id: "${config.runtimeWorker.sandboxPrincipalId}", version: "sandbox-v1" },\n actionType: "UPDATE", targetSystem: "WitnoraLocalSandbox", requestedPermissions: [], sensitive: true, expectedState: approvedParameters,\n mandateId: "${config.runtimeWorker.mandateId}", requireMandate: true,\n executionIntent: { adapterId: "${LOCAL_SANDBOX_ADAPTER_ID}", adapterVersionConstraint: "^${LOCAL_SANDBOX_ADAPTER_VERSION}", allowedOrigins: ["${config.runtimeWorker.sandboxOrigin}"], approvedParameters, outcomePredicate: { type: "state_subset", expected: approvedParameters }, agentBuildId, agentBuildDigest: digest, allowedOperation: "UPDATE", allowedResource: \`mock-state/\${resourceId}\` },\n };\n return this.proposeAction(proposal, externalId);\n },\n`
1428
+ ? ` async proposeLocalSandboxUpdate({ resourceId, status = "UPDATED", externalId = \`runtime-sandbox-\${crypto.randomUUID()}\`, agentBuildId = "witnora-local-sandbox-task@1.0.0" }) {\n if (!/^[A-Za-z0-9._:-]+$/.test(resourceId)) throw new Error("Local sandbox resourceId contains unsupported characters.");\n const approvedParameters = { resourceId, status };\n const digest = Buffer.from(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(agentBuildId))).toString("hex");\n const proposal = {\n externalId, agentId: "${config.connectionName}", principal: { id: "${config.runtimeWorker.sandboxPrincipalId}", version: "sandbox-v1" },\n actionType: "UPDATE", targetSystem: "WitnoraLocalSandbox", requestedPermissions: [], sensitive: true, expectedState: approvedParameters,\n mandateId: "${config.runtimeWorker.mandateId}", requireMandate: true,\n executionIntent: { adapterId: "${LOCAL_SANDBOX_ADAPTER_ID}", adapterVersionConstraint: "^${LOCAL_SANDBOX_ADAPTER_VERSION}", allowedOrigins: ["${config.runtimeWorker.sandboxOrigin}"], approvedParameters, outcomePredicate: { type: "state_subset", expected: approvedParameters }, agentBuildId, agentBuildDigest: digest, allowedOperation: "UPDATE", allowedResource: \`mock-state/\${resourceId}\` },\n };\n return this.proposeAction(proposal, externalId);\n },\n`
1429
1429
  : "";
1430
1430
  const realPathSandboxMethod = config.runtimeWorker?.adapterId === LOCAL_SANDBOX_ADAPTER_ID && config.runtimeWorker.mandateId && config.runtimeWorker.sandboxPrincipalId
1431
1431
  ? ` async proposeRealPathSandboxSimulation({ integrationId, resourceId, status = "SUBMITTED", externalId = \`real-path-sandbox-\${crypto.randomUUID()}\`, agentBuildId = "witnora-real-path-sandbox@1.0.0" }) {\n if (!/^[A-Za-z0-9._:-]+$/.test(integrationId) || !/^[A-Za-z0-9._:-]+$/.test(resourceId)) throw new Error("Real-path integrationId and resourceId must be identifiers.");\n const harness = JSON.parse(await readFile(new URL("./workflow-harness.json", import.meta.url), "utf8"));\n const matches = Array.isArray(harness.realPathActivations) ? harness.realPathActivations.filter((item) => item?.integrationId === integrationId) : [];\n if (matches.length !== 1) throw new Error("Real-path sandbox simulation requires one exact active Harness integration.");\n const activation = matches[0];\n if (activation.environment !== "sandbox" || !Array.isArray(activation.actionPathIds) || activation.actionPathIds.length !== 1) throw new Error("Real-path sandbox simulation requires one exact sandbox action path.");\n const approvedParameters = { resourceId, status };\n const digest = Buffer.from(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(agentBuildId))).toString("hex");\n const proposal = {\n externalId, agentId: activation.agentId, principal: { id: "${config.runtimeWorker.sandboxPrincipalId}", version: "sandbox-v1" },\n actionType: "UPDATE", targetSystem: "WitnoraLocalSandbox", requestedPermissions: [], sensitive: true, expectedState: approvedParameters,\n businessTaskBinding: { taskContractId: activation.taskContractId, taskContractDigestSha256: activation.taskContractDigestSha256, actionPathId: activation.actionPathIds[0], environment: "sandbox", realPathIntegrationId: activation.integrationId, realPathIntegrationDigestSha256: activation.integrationDigestSha256 },\n mandateId: "${config.runtimeWorker.mandateId}", requireMandate: true,\n executionIntent: { adapterId: "${LOCAL_SANDBOX_ADAPTER_ID}", adapterVersionConstraint: "^${LOCAL_SANDBOX_ADAPTER_VERSION}", allowedOrigins: ["${config.runtimeWorker.sandboxOrigin}"], approvedParameters, outcomePredicate: { type: "state_subset", expected: approvedParameters }, agentBuildId, agentBuildDigest: digest, allowedOperation: "UPDATE", allowedResource: \`mock-state/\${resourceId}\` },\n };\n return this.proposeAction(proposal, externalId);\n },\n`
@@ -28,6 +28,12 @@ export interface DurableWorkerAction {
28
28
  verificationSuccess?: boolean;
29
29
  receiptId?: string;
30
30
  receiptSignatureCount?: number;
31
+ supersededByActionId?: string;
32
+ businessTaskBinding?: {
33
+ taskContractId?: string;
34
+ actionPathId?: string;
35
+ [key: string]: unknown;
36
+ };
31
37
  assuranceContext?: {
32
38
  executionIntent?: {
33
39
  adapterId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"durable-action-worker.d.ts","sourceRoot":"","sources":["../../../../agentcert-sdk/src/durable-action-worker.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,kBAAkB,GAClB,QAAQ,GACR,SAAS,GACT,SAAS,GACT,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,UAAU,GACV,QAAQ,GACR,oBAAoB,GACpB,WAAW,CAAC;AAEhB,MAAM,WAAW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"file":"durable-action-worker.d.ts","sourceRoot":"","sources":["../../../../agentcert-sdk/src/durable-action-worker.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,kBAAkB,GAClB,QAAQ,GACR,SAAS,GACT,SAAS,GACT,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,UAAU,GACV,QAAQ,GACR,oBAAoB,GACpB,WAAW,CAAC;AAEhB,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,eAAe,EAAE;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,wBAAwB,EAAE,MAAM,CAAC;QACjC,cAAc,EAAE,MAAM,EAAE,CAAC;QACzB,gBAAgB,EAAE,MAAM,CAAC;QACzB,eAAe,EAAE,MAAM,CAAC;QACxB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC5C,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC1C,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,kBAAkB,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,kBAAkB,GAAG,eAAe,GAAG,UAAU,GAAG,MAAM,CAAC;IACzI,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,i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Q,CAAgB;gBAEZ,OAAO,EAAE,kCAAkC;IAUlE,KAAK,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,qBAAqB,CAAA;KAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAgB3G,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAOxD,KAAK,IAAI,IAAI;IAcb,IAAI,IAAI,IAAI;IAEN,MAAM,IAAI,OAAO,CAAC,yBAAyB,CAAC;YAapC,QAAQ;YA6IR,OAAO;CAMtB;AA2DD,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAY3F"}
@@ -157,6 +157,19 @@ export class DurableApprovedActionWorker {
157
157
  if (terminal(checkpoint.phase))
158
158
  return checkpoint;
159
159
  const action = await this.options.hosted.getAction(actionId);
160
+ if (action.supersededByActionId) {
161
+ if (action.status !== "REJECTED" && action.status !== "DENIED") {
162
+ return this.persist(checkpoint, "BLOCKED", { limitation: "Hosted action named a successor before the original request was denied." });
163
+ }
164
+ const successor = await this.options.hosted.getAction(action.supersededByActionId);
165
+ const successorProposal = { ...checkpoint.proposal, externalId: successor.externalId };
166
+ if (!successor.businessTaskBinding?.taskContractId || !successor.businessTaskBinding.actionPathId
167
+ || !exactActionMatches(successor, successor.id, successorProposal, this.options.config.adapterId, this.options.config.adapterVersion)) {
168
+ return this.persist(checkpoint, "BLOCKED", { limitation: "The replacement action does not match the original local intent and exact confirmed Business Task path." });
169
+ }
170
+ await this.track({ actionId: successor.id, proposal: successorProposal });
171
+ return this.persist(checkpoint, "DENIED", { limitation: `Replaced by exact task-bound action ${successor.id}.` });
172
+ }
160
173
  if (!exactActionMatches(action, actionId, checkpoint.proposal, this.options.config.adapterId, this.options.config.adapterVersion)) {
161
174
  return this.persist(checkpoint, "BLOCKED", { limitation: "Hosted action no longer matches the exact locally configured action, adapter, or build binding." });
162
175
  }
package/dist/onboard.js CHANGED
@@ -8,7 +8,7 @@ import { verifyControlPlaneConnection } from "./control-plane.js";
8
8
  import { inferPrivateCapabilities, runPrivateCapabilityDiscovery } from "./private-discovery.js";
9
9
  import { parseAgentTemplate, starterAdapter, starterProfile, starterTripwireConfig } from "./onboarding-templates.js";
10
10
  import { writeTryEvidence } from "./try.js";
11
- import { doctorCustomerGateway, activateManagedWorkflowHarness, ensureCustomerGatewayPortAvailable, initializeCustomerGateway, inspectLocalRuntimeBinding, inspectCustomerGatewayFiles, startManagedCustomerGateway, stopManagedCustomerGateway, upgradeCustomerGatewayRuntime, RuntimeSetupNotReadyError, } from "./gateway.js";
11
+ import { doctorCustomerGateway, activateManagedWorkflowHarness, ensureCustomerGatewayPortAvailable, initializeCustomerGateway, inspectLocalRuntimeBinding, inspectCustomerGatewayFiles, startManagedCustomerGateway, statusManagedCustomerGateway, stopManagedCustomerGateway, upgradeCustomerGatewayRuntime, RuntimeSetupNotReadyError, } from "./gateway.js";
12
12
  import { discoverRuntimeReferences, planRuntimeSandboxModules } from "./runtime-sandbox-kit.js";
13
13
  import { automaticRuntimeReferencesUsable, bootstrapLocalRuntime, verifyAutomaticRuntimeProbe } from "./runtime-bootstrap.js";
14
14
  import { activateRealPathIntegrations } from "./real-path-activation.js";
@@ -218,18 +218,29 @@ export async function runOnboard(options) {
218
218
  throw new Error("The prior managed Gateway process did not stop before Assurance Harness activation.");
219
219
  }
220
220
  if (!options.gatewayLifecycle) {
221
+ // Stop any detached Gateway left by an earlier CLI before the OS-owned
222
+ // supervisor is installed. The service becomes the single process owner.
223
+ await gatewayLifecycle.stop({ repository: repositoryPath, configHome: options.configHome, fetch: requestFetch }).catch(() => undefined);
221
224
  const port = await ensureCustomerGatewayPortAvailable({ repository: repositoryPath });
222
225
  if (port.changed)
223
226
  output(`Rebound this repository's generated Gateway to available localhost port ${port.port}; another project remains untouched.\n`);
224
- const installed = await installCurrentGatewayService({ repository: repositoryPath, cliEntry: fileURLToPath(new URL("./cli.js", import.meta.url)) });
227
+ const installed = await installCurrentGatewayService({ repository: repositoryPath, cliEntry: fileURLToPath(new URL("./cli.js", import.meta.url)), configHome: options.configHome });
225
228
  continuousService = { state: "INSTALLED", kind: installed.plan.kind, id: installed.plan.id };
229
+ managedGateway = await waitForInstalledGatewayService({
230
+ repository: repositoryPath,
231
+ fetch: requestFetch,
232
+ sleep: options.sleep,
233
+ timeoutMs: options.timeoutMs,
234
+ });
235
+ }
236
+ else {
237
+ managedGateway = await gatewayLifecycle.start({
238
+ repository: repositoryPath,
239
+ configHome: options.configHome,
240
+ fetch: requestFetch,
241
+ output,
242
+ });
226
243
  }
227
- managedGateway = await gatewayLifecycle.start({
228
- repository: repositoryPath,
229
- configHome: options.configHome,
230
- fetch: requestFetch,
231
- output,
232
- });
233
244
  if (!managedGateway.healthy)
234
245
  throw new Error(managedGateway.detail);
235
246
  const doctor = await doctorCustomerGateway({ repository: repositoryPath, configHome: options.configHome, fetch: requestFetch });
@@ -280,6 +291,20 @@ export async function runOnboard(options) {
280
291
  throw new Error(`Witnora Setup Autopilot rolled back this install attempt: ${diagnosis}`);
281
292
  }
282
293
  }
294
+ async function waitForInstalledGatewayService(options) {
295
+ const pause = options.sleep ?? ((milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)));
296
+ const deadline = Date.now() + (options.timeoutMs ?? 12_000);
297
+ let last = await statusManagedCustomerGateway({ repository: options.repository, fetch: options.fetch });
298
+ while (Date.now() < deadline) {
299
+ if (last.state === "RUNNING_MANAGED" && last.healthy)
300
+ return { ...last, started: true };
301
+ if (last.state === "CONFLICT")
302
+ throw new Error(last.detail);
303
+ await pause(120);
304
+ last = await statusManagedCustomerGateway({ repository: options.repository, fetch: options.fetch });
305
+ }
306
+ throw new Error(`The operating-system-managed Gateway did not become healthy before the startup deadline. ${last.detail}`);
307
+ }
283
308
  function configuredGatewayPorts(environment) {
284
309
  const value = environment.WITNORA_GATEWAY_PORT?.trim();
285
310
  if (!value)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "witnora",
3
- "version": "0.18.8",
3
+ "version": "0.18.10",
4
4
  "description": "Independent assurance for covered agent action paths across models and frameworks.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",