@dailephd/my-centcom 0.1.0 → 0.3.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.
Files changed (175) hide show
  1. package/README.md +10 -5
  2. package/apps/daemon/dist/artifacts/returnSnapshots.d.ts +12 -0
  3. package/apps/daemon/dist/artifacts/returnSnapshots.js +41 -0
  4. package/apps/daemon/dist/bootstrap/app.d.ts +21 -0
  5. package/apps/daemon/dist/bootstrap/app.js +27 -0
  6. package/apps/daemon/dist/bootstrap/installLayout.d.ts +81 -0
  7. package/apps/daemon/dist/bootstrap/installLayout.js +164 -0
  8. package/apps/daemon/dist/bootstrap/main.d.ts +14 -0
  9. package/apps/daemon/dist/bootstrap/main.js +141 -0
  10. package/apps/daemon/dist/bootstrap/operatorConsole.d.ts +75 -0
  11. package/apps/daemon/dist/bootstrap/operatorConsole.js +293 -0
  12. package/apps/daemon/dist/bootstrap/privateDataRoot.d.ts +38 -0
  13. package/apps/daemon/dist/bootstrap/privateDataRoot.js +204 -0
  14. package/apps/daemon/dist/bootstrap/secureMain.d.ts +118 -0
  15. package/apps/daemon/dist/bootstrap/secureMain.js +403 -0
  16. package/apps/daemon/dist/bootstrap/setup.d.ts +93 -0
  17. package/apps/daemon/dist/bootstrap/setup.js +738 -0
  18. package/apps/daemon/dist/context/changeProposal.d.ts +97 -0
  19. package/apps/daemon/dist/context/changeProposal.js +259 -0
  20. package/apps/daemon/dist/context/gitEvidence.d.ts +88 -0
  21. package/apps/daemon/dist/context/gitEvidence.js +332 -0
  22. package/apps/daemon/dist/context/gitObservation.d.ts +30 -0
  23. package/apps/daemon/dist/context/gitObservation.js +113 -0
  24. package/apps/daemon/dist/context/projectReadIssuer.d.ts +68 -0
  25. package/apps/daemon/dist/context/projectReadIssuer.js +158 -0
  26. package/apps/daemon/dist/context/projectReadService.d.ts +153 -0
  27. package/apps/daemon/dist/context/projectReadService.js +652 -0
  28. package/apps/daemon/dist/context/projectViewService.d.ts +85 -0
  29. package/apps/daemon/dist/context/projectViewService.js +332 -0
  30. package/apps/daemon/dist/context/proposalRecorder.d.ts +11 -0
  31. package/apps/daemon/dist/context/proposalRecorder.js +19 -0
  32. package/apps/daemon/dist/plugins/drivers/codexMcpConfig.d.ts +40 -0
  33. package/apps/daemon/dist/plugins/drivers/codexMcpConfig.js +73 -0
  34. package/apps/daemon/dist/plugins/drivers/codexModelCompatibility.d.ts +49 -0
  35. package/apps/daemon/dist/plugins/drivers/codexModelCompatibility.js +70 -0
  36. package/apps/daemon/dist/plugins/drivers/fakePluginDriver.d.ts +16 -0
  37. package/apps/daemon/dist/plugins/drivers/fakePluginDriver.js +115 -0
  38. package/apps/daemon/dist/plugins/drivers/finiteCliDriver.d.ts +153 -0
  39. package/apps/daemon/dist/plugins/drivers/finiteCliDriver.js +505 -0
  40. package/apps/daemon/dist/plugins/registry/operationCatalog.d.ts +23 -0
  41. package/apps/daemon/dist/plugins/registry/operationCatalog.js +41 -0
  42. package/apps/daemon/dist/plugins/registry/registryOperationCatalog.d.ts +14 -0
  43. package/apps/daemon/dist/plugins/registry/registryOperationCatalog.js +29 -0
  44. package/apps/daemon/dist/plugins/registry/verifiedCapabilityRegistry.d.ts +151 -0
  45. package/apps/daemon/dist/plugins/registry/verifiedCapabilityRegistry.js +579 -0
  46. package/apps/daemon/dist/projects/codingAuthority.d.ts +102 -0
  47. package/apps/daemon/dist/projects/codingAuthority.js +244 -0
  48. package/apps/daemon/dist/projects/fixtureAuthorization.d.ts +54 -0
  49. package/apps/daemon/dist/projects/fixtureAuthorization.js +172 -0
  50. package/apps/daemon/dist/projects/pairedAuthority.d.ts +158 -0
  51. package/apps/daemon/dist/projects/pairedAuthority.js +273 -0
  52. package/apps/daemon/dist/projects/trustedCliConsent.d.ts +47 -0
  53. package/apps/daemon/dist/projects/trustedCliConsent.js +84 -0
  54. package/apps/daemon/dist/runs/changeApplier.d.ts +59 -0
  55. package/apps/daemon/dist/runs/changeApplier.js +319 -0
  56. package/apps/daemon/dist/runs/codingWorkflowService.d.ts +283 -0
  57. package/apps/daemon/dist/runs/codingWorkflowService.js +785 -0
  58. package/apps/daemon/dist/runs/durableIntentCoordinator.d.ts +72 -0
  59. package/apps/daemon/dist/runs/durableIntentCoordinator.js +160 -0
  60. package/apps/daemon/dist/runs/inMemoryCoordinator.d.ts +55 -0
  61. package/apps/daemon/dist/runs/inMemoryCoordinator.js +375 -0
  62. package/apps/daemon/dist/runs/runExecutor.d.ts +154 -0
  63. package/apps/daemon/dist/runs/runExecutor.js +295 -0
  64. package/apps/daemon/dist/runs/workflowService.d.ts +185 -0
  65. package/apps/daemon/dist/runs/workflowService.js +300 -0
  66. package/apps/daemon/dist/runtime/boundedProcessHost.d.ts +111 -0
  67. package/apps/daemon/dist/runtime/boundedProcessHost.js +752 -0
  68. package/apps/daemon/dist/runtime/evidenceRedaction.d.ts +30 -0
  69. package/apps/daemon/dist/runtime/evidenceRedaction.js +79 -0
  70. package/apps/daemon/dist/runtime/executionDiagnostics.d.ts +134 -0
  71. package/apps/daemon/dist/runtime/executionDiagnostics.js +213 -0
  72. package/apps/daemon/dist/runtime/modelExecutionPolicy.d.ts +22 -0
  73. package/apps/daemon/dist/runtime/modelExecutionPolicy.js +19 -0
  74. package/apps/daemon/dist/runtime/mxcExecution.d.ts +12 -0
  75. package/apps/daemon/dist/runtime/mxcExecution.js +163 -0
  76. package/apps/daemon/dist/runtime/mxcIntegrity.d.ts +24 -0
  77. package/apps/daemon/dist/runtime/mxcIntegrity.js +81 -0
  78. package/apps/daemon/dist/runtime/mxcWorker.d.ts +2 -0
  79. package/apps/daemon/dist/runtime/mxcWorker.js +45 -0
  80. package/apps/daemon/dist/runtime/provisionedExecution.d.ts +150 -0
  81. package/apps/daemon/dist/runtime/provisionedExecution.js +653 -0
  82. package/apps/daemon/dist/runtime/testExecution.d.ts +76 -0
  83. package/apps/daemon/dist/runtime/testExecution.js +106 -0
  84. package/apps/daemon/dist/runtime/testProfiles.d.ts +10 -0
  85. package/apps/daemon/dist/runtime/testProfiles.js +4 -0
  86. package/apps/daemon/dist/runtime/trustedAgentStaging.d.ts +89 -0
  87. package/apps/daemon/dist/runtime/trustedAgentStaging.js +262 -0
  88. package/apps/daemon/dist/runtime/trustedCaBundle.d.ts +77 -0
  89. package/apps/daemon/dist/runtime/trustedCaBundle.js +125 -0
  90. package/apps/daemon/dist/runtime/windows/windowsJobSupervisor.d.ts +166 -0
  91. package/apps/daemon/dist/runtime/windows/windowsJobSupervisor.js +521 -0
  92. package/apps/daemon/dist/storage/diagnosticLog.d.ts +63 -0
  93. package/apps/daemon/dist/storage/diagnosticLog.js +136 -0
  94. package/apps/daemon/dist/storage/executionTelemetry.d.ts +63 -0
  95. package/apps/daemon/dist/storage/executionTelemetry.js +247 -0
  96. package/apps/daemon/dist/storage/protectedSecrets.d.ts +39 -0
  97. package/apps/daemon/dist/storage/protectedSecrets.js +106 -0
  98. package/apps/daemon/dist/storage/sqliteLedger.d.ts +786 -0
  99. package/apps/daemon/dist/storage/sqliteLedger.js +1303 -0
  100. package/apps/daemon/dist/transports/http/dispatch.d.ts +43 -0
  101. package/apps/daemon/dist/transports/http/dispatch.js +405 -0
  102. package/apps/daemon/dist/transports/http/secureRoutes.d.ts +40 -0
  103. package/apps/daemon/dist/transports/http/secureRoutes.js +332 -0
  104. package/apps/daemon/dist/transports/http/workflowRoutes.d.ts +41 -0
  105. package/apps/daemon/dist/transports/http/workflowRoutes.js +473 -0
  106. package/apps/daemon/dist/transports/mcp/localProjectReadServer.d.ts +182 -0
  107. package/apps/daemon/dist/transports/mcp/localProjectReadServer.js +221 -0
  108. package/apps/daemon/dist/transports/native/nativeHost.d.ts +24 -0
  109. package/apps/daemon/dist/transports/native/nativeHost.js +344 -0
  110. package/apps/daemon/package.json +24 -0
  111. package/apps/daemon/src/runtime/benign/referenceEcho.mjs +27 -0
  112. package/apps/daemon/src/runtime/windows/buildSupervisor.mjs +87 -0
  113. package/apps/daemon/src/runtime/windows/supervisorMain.cs +676 -0
  114. package/apps/extension/manifest.secure.json +25 -0
  115. package/apps/extension/scripts/build.mjs +173 -0
  116. package/apps/extension/src/background/secureWorker.ts +1595 -0
  117. package/apps/extension/src/background/serviceWorker.ts +892 -0
  118. package/apps/extension/src/content/captureSelection.ts +64 -0
  119. package/apps/extension/src/content/secureInsert.ts +207 -0
  120. package/apps/extension/src/probe/index.html +41 -0
  121. package/apps/extension/src/probe/main.ts +201 -0
  122. package/apps/extension/src/sidepanel/index.html +203 -0
  123. package/apps/extension/src/sidepanel/main.ts +903 -0
  124. package/package.json +19 -3
  125. package/packages/contracts/dist/artifacts.d.ts +66 -0
  126. package/packages/contracts/dist/artifacts.js +64 -0
  127. package/packages/contracts/dist/automation.d.ts +540 -0
  128. package/packages/contracts/dist/automation.js +191 -0
  129. package/packages/contracts/dist/browser.d.ts +251 -0
  130. package/packages/contracts/dist/browser.js +131 -0
  131. package/packages/contracts/dist/context.d.ts +71 -0
  132. package/packages/contracts/dist/context.js +73 -0
  133. package/packages/contracts/dist/diagnostics.d.ts +99 -0
  134. package/packages/contracts/dist/diagnostics.js +284 -0
  135. package/packages/contracts/dist/effects.d.ts +42 -0
  136. package/packages/contracts/dist/effects.js +42 -0
  137. package/packages/contracts/dist/errors.d.ts +75 -0
  138. package/packages/contracts/dist/errors.js +70 -0
  139. package/packages/contracts/dist/events.d.ts +50 -0
  140. package/packages/contracts/dist/events.js +34 -0
  141. package/packages/contracts/dist/executionDiagnostics.d.ts +212 -0
  142. package/packages/contracts/dist/executionDiagnostics.js +101 -0
  143. package/packages/contracts/dist/identity.d.ts +54 -0
  144. package/packages/contracts/dist/identity.js +40 -0
  145. package/packages/contracts/dist/index.d.ts +20 -0
  146. package/packages/contracts/dist/index.js +20 -0
  147. package/packages/contracts/dist/invocation.d.ts +90 -0
  148. package/packages/contracts/dist/invocation.js +77 -0
  149. package/packages/contracts/dist/lifecycle.d.ts +130 -0
  150. package/packages/contracts/dist/lifecycle.js +135 -0
  151. package/packages/contracts/dist/plugin.d.ts +214 -0
  152. package/packages/contracts/dist/plugin.js +117 -0
  153. package/packages/contracts/dist/projectRead.d.ts +205 -0
  154. package/packages/contracts/dist/projectRead.js +162 -0
  155. package/packages/contracts/dist/secure.d.ts +128 -0
  156. package/packages/contracts/dist/secure.js +99 -0
  157. package/packages/contracts/package.json +32 -0
  158. package/packages/contracts/src/artifacts.ts +83 -0
  159. package/packages/contracts/src/automation.ts +238 -0
  160. package/packages/contracts/src/browser.ts +164 -0
  161. package/packages/contracts/src/context.ts +91 -0
  162. package/packages/contracts/src/diagnostics.ts +318 -0
  163. package/packages/contracts/src/effects.ts +49 -0
  164. package/packages/contracts/src/errors.ts +83 -0
  165. package/packages/contracts/src/events.ts +46 -0
  166. package/packages/contracts/src/executionDiagnostics.ts +116 -0
  167. package/packages/contracts/src/identity.ts +68 -0
  168. package/packages/contracts/src/index.ts +20 -0
  169. package/packages/contracts/src/invocation.ts +96 -0
  170. package/packages/contracts/src/lifecycle.ts +169 -0
  171. package/packages/contracts/src/plugin.ts +174 -0
  172. package/packages/contracts/src/projectRead.ts +179 -0
  173. package/packages/contracts/src/secure.ts +136 -0
  174. package/provenance.json +179 -9
  175. package/source.zip +0 -0
package/README.md CHANGED
@@ -1,9 +1,14 @@
1
- # my-centcom 0.1.0
1
+ # my-centcom 0.3.0
2
2
 
3
- HISTORICAL SOURCE CHECKPOINT
3
+ WINDOWS APPLICATION DISTRIBUTION
4
4
 
5
- Shared contracts and historical schema tests.
5
+ Existing Windows daemon, secure native host, setup CLI and Chrome extension.
6
6
 
7
- Source-only archival checkpoint. No executable or install lifecycle hooks. Historical lockfiles may contain vulnerable dependencies.
7
+ Windows and Node 24 required. Setup and Chrome loading are explicit actions. Trusted CLI execution is NOT_ISOLATED. Production TEST is disabled and unverified. Optional native isolation tooling is outside this distribution.
8
8
 
9
- Original source: ab35567503a414fefb1f128ae7842382f697399f
9
+ Original source: 17b92b9a5175aecf993083c734b728baefeaadcb
10
+
11
+ In a dedicated writable npm project install this package as a local dependency.
12
+ Run node_modules\.bin\centcom.cmd plan and status to review the installation.
13
+ Follow plan for attended setup. Use --register-native-host --consent only when approving Chrome native-host registration.
14
+ Load the generated unpacked extension from the location shown by setup.
@@ -0,0 +1,12 @@
1
+ import type { ReturnDecision, RunEvidence } from '../storage/sqliteLedger.js';
2
+ /**
3
+ * C08 (B05) return-snapshot policy. Pure: it reads committed run evidence and answers whether one run's reported final message may become an
4
+ * immutable return snapshot. It performs no I/O, executes nothing, and never reads a path. Storage and immutability belong to C09
5
+ * (SqliteLedger.prepareReturnSnapshot); transport belongs to C02. The text is the AGENT'S REPORTED final message: untrusted prose.
6
+ */
7
+ export declare const RETURN_TEXT_MAX_BYTES = 16384;
8
+ /** Deterministic id: the same run and the same bytes always yield the same id; different bytes yield a different id. */
9
+ export declare function returnIdFor(runId: string, sha256: string): string;
10
+ /** Refusal codes are fixed strings. They never contain output text. */
11
+ export declare function decideReturnSnapshot(runId: string, lifecycleState: string, evidence: RunEvidence): ReturnDecision;
12
+ //# sourceMappingURL=returnSnapshots.d.ts.map
@@ -0,0 +1,41 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { RETURN_TEXT_MAX_UTF8_BYTES } from '../../../../packages/contracts/dist/index.js';
3
+ /**
4
+ * C08 (B05) return-snapshot policy. Pure: it reads committed run evidence and answers whether one run's reported final message may become an
5
+ * immutable return snapshot. It performs no I/O, executes nothing, and never reads a path. Storage and immutability belong to C09
6
+ * (SqliteLedger.prepareReturnSnapshot); transport belongs to C02. The text is the AGENT'S REPORTED final message: untrusted prose.
7
+ */
8
+ export const RETURN_TEXT_MAX_BYTES = RETURN_TEXT_MAX_UTF8_BYTES;
9
+ /** Deterministic id: the same run and the same bytes always yield the same id; different bytes yield a different id. */
10
+ export function returnIdFor(runId, sha256) {
11
+ return `ret.${createHash('sha256').update(`${runId}\n${sha256}`, 'utf8').digest('hex').slice(0, 32)}`;
12
+ }
13
+ const LONE_SURROGATE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/;
14
+ /** Refusal codes are fixed strings. They never contain output text. */
15
+ export function decideReturnSnapshot(runId, lifecycleState, evidence) {
16
+ if (lifecycleState !== 'COMPLETED')
17
+ return { kind: 'REFUSE', code: 'RUN_NOT_COMPLETED' };
18
+ const o = evidence.outcome;
19
+ // COMPLETED alone is not enough: the same strict facts the executor required to call a run COMPLETED must still hold in the committed outcome.
20
+ if (!evidence.launch || !o || !o.processLaunched || o.processOutcome !== 'EXITED' || o.exitCode !== 0 || o.treeTerminated !== true || !o.childTokenVerified || o.cancellationRacing) {
21
+ return { kind: 'REFUSE', code: 'RUN_NOT_CLEAN_COMPLETION' };
22
+ }
23
+ const text = o.finalMessage;
24
+ if (text === null || text.trim().length === 0)
25
+ return { kind: 'REFUSE', code: 'NO_FINAL_TEXT' };
26
+ // The parser bounds the message at 8192 characters and records `truncated` only on the output event: a truncated message is never returnable.
27
+ const last = [...evidence.outputEvents].reverse().find((e) => e.eventKind === 'agent_message');
28
+ if (!last)
29
+ return { kind: 'REFUSE', code: 'FINAL_TEXT_UNVERIFIED' };
30
+ if (last.payload.truncated !== false)
31
+ return { kind: 'REFUSE', code: 'FINAL_TEXT_TRUNCATED' };
32
+ if (last.payload.text !== text)
33
+ return { kind: 'REFUSE', code: 'FINAL_TEXT_INCONSISTENT' };
34
+ if (text.includes('\u0000') || LONE_SURROGATE.test(text))
35
+ return { kind: 'REFUSE', code: 'FINAL_TEXT_INVALID' };
36
+ if (Buffer.byteLength(text, 'utf8') > RETURN_TEXT_MAX_BYTES)
37
+ return { kind: 'REFUSE', code: 'FINAL_TEXT_TOO_LARGE' };
38
+ const sha = createHash('sha256').update(text, 'utf8').digest('hex');
39
+ return { kind: 'SNAPSHOT', text, returnId: returnIdFor(runId, sha) };
40
+ }
41
+ //# sourceMappingURL=returnSnapshots.js.map
@@ -0,0 +1,21 @@
1
+ import { FastifyInstance } from 'fastify';
2
+ import { M03Dependencies } from '../transports/http/dispatch.js';
3
+ import { SecureDependencies } from '../transports/http/secureRoutes.js';
4
+ export { M03Dependencies, SecureDependencies };
5
+ export type DaemonAppOptions = {
6
+ mode: 'fixture';
7
+ dependencies: M03Dependencies;
8
+ } | {
9
+ mode: 'secure';
10
+ dependencies: SecureDependencies;
11
+ };
12
+ /**
13
+ * Single Fastify composition root with discriminated modes.
14
+ * - fixture: the M03/M04 fixture routes only (fixture token, fake driver).
15
+ * - secure: paired-loopback routes only; fixture endpoints are never registered.
16
+ * Invariant: Does not start listening or spawn subprocesses upon creation.
17
+ */
18
+ export declare function createDaemonApp(options: DaemonAppOptions): FastifyInstance;
19
+ /** Backward-compatible fixture factory (unchanged behavior). */
20
+ export declare function createM03App(dependencies: M03Dependencies): FastifyInstance;
21
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1,27 @@
1
+ import Fastify from 'fastify';
2
+ import { M03_HTTP_BODY_LIMIT_BYTES, registerDispatchRoutes, } from '../transports/http/dispatch.js';
3
+ import { SECURE_HTTP_BODY_LIMIT_BYTES, registerSecureRoutes, } from '../transports/http/secureRoutes.js';
4
+ /**
5
+ * Single Fastify composition root with discriminated modes.
6
+ * - fixture: the M03/M04 fixture routes only (fixture token, fake driver).
7
+ * - secure: paired-loopback routes only; fixture endpoints are never registered.
8
+ * Invariant: Does not start listening or spawn subprocesses upon creation.
9
+ */
10
+ export function createDaemonApp(options) {
11
+ if (options.mode === 'secure') {
12
+ const app = Fastify({ logger: false, bodyLimit: SECURE_HTTP_BODY_LIMIT_BYTES, routerOptions: { maxParamLength: 128 } });
13
+ registerSecureRoutes(app, options.dependencies);
14
+ return app;
15
+ }
16
+ const app = Fastify({
17
+ logger: false,
18
+ bodyLimit: M03_HTTP_BODY_LIMIT_BYTES,
19
+ });
20
+ registerDispatchRoutes(app, options.dependencies);
21
+ return app;
22
+ }
23
+ /** Backward-compatible fixture factory (unchanged behavior). */
24
+ export function createM03App(dependencies) {
25
+ return createDaemonApp({ mode: 'fixture', dependencies });
26
+ }
27
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * SW-062 installation layout and pinned host configuration (single owner, shared by the setup CLI and the native bootstrap host).
4
+ *
5
+ * Everything lives inside the project root:
6
+ * <root>\.switchyard-data\private\ verified private data root (DACL exactly {user, SYSTEM}); daemon ledger, logs, keys, run\
7
+ * <root>\.switchyard-data\private\install\host-config.json pinned host configuration + DPAPI-protected installation secret + HMAC over the config
8
+ * <root>\.switchyard-data\private\native-host\ Chrome native messaging host manifest (allowed_origins = exactly ONE extension) and its launcher
9
+ * <root>\.switchyard-data\centcom-extension\ the installed (pinned-key) extension build that the user loads once
10
+ */
11
+ export declare const HOST_VERSION = "0.3.0";
12
+ export declare const INSTALL_DIR = "install";
13
+ export declare const HOST_CONFIG_FILE = "host-config.json";
14
+ export declare const NATIVE_HOST_DIR = "native-host";
15
+ export declare const HOST_LAUNCHER_FILE = "centcom-native-host.cmd";
16
+ export declare const EXTENSION_INSTALL_DIR: string;
17
+ export declare const CHROME_NATIVE_HOSTS_KEY = "HKCU\\Software\\Google\\Chrome\\NativeMessagingHosts";
18
+ export declare const HostConfigV1Schema: z.ZodObject<{
19
+ schemaVersion: z.ZodLiteral<1>;
20
+ hostVersion: z.ZodString;
21
+ installationId: z.ZodString;
22
+ extensionId: z.ZodString;
23
+ extensionOrigin: z.ZodString;
24
+ projectRoot: z.ZodString;
25
+ dataRoot: z.ZodString;
26
+ nodeExe: z.ZodString;
27
+ nodeSha256: z.ZodString;
28
+ daemonEntry: z.ZodString;
29
+ daemonTreeSha256: z.ZodString;
30
+ approvedProject: z.ZodNullable<z.ZodObject<{
31
+ projectId: z.ZodString;
32
+ root: z.ZodString;
33
+ }, z.core.$strict>>;
34
+ devSmokeProfiles: z.ZodBoolean;
35
+ protectedSecretB64: z.ZodString;
36
+ createdAt: z.ZodString;
37
+ updatedAt: z.ZodString;
38
+ configMac: z.ZodString;
39
+ }, z.core.$strict>;
40
+ export type HostConfigV1 = z.infer<typeof HostConfigV1Schema>;
41
+ export interface InstallPaths {
42
+ projectRoot: string;
43
+ dataRoot: string;
44
+ installDir: string;
45
+ hostConfig: string;
46
+ nativeHostDir: string;
47
+ hostManifest: string;
48
+ hostLauncher: string;
49
+ extensionDir: string;
50
+ daemonEntry: string;
51
+ nativeHostEntry: string;
52
+ }
53
+ export declare function installPaths(projectRoot: string, dataRoot?: string, hostName?: string): InstallPaths;
54
+ export declare const sha256File: (p: string) => string;
55
+ /** Canonical JSON of the config without its MAC (stable key order). */
56
+ export declare function canonicalConfig(c: Omit<HostConfigV1, 'configMac'> | HostConfigV1): string;
57
+ /** The config MAC is keyed with the installation secret: changing any pinned field (an executable path, a digest, the origin) without the secret is detected. */
58
+ export declare const configMac: (secret: string, c: Omit<HostConfigV1, "configMac"> | HostConfigV1) => string;
59
+ export declare function macMatches(secret: string, c: HostConfigV1): boolean;
60
+ /**
61
+ * Digest over the code the host would start: every file of the compiled daemon and contracts trees plus their package manifests (sorted relative path +
62
+ * content digest). Rebuilding or editing any of it changes the digest, which the host treats as an update that needs one re-consent (`centcom update`).
63
+ * Third-party packages in node_modules are NOT covered (stated limitation).
64
+ */
65
+ /**
66
+ * SW-065: the identity of the extension SOURCES that a secure build would bundle (12 hex). Must equal apps/extension/scripts/build.mjs extensionSourceId(),
67
+ * which stamps it into the built manifest as version_name "<version> build <id>". Comparing the two tells whether the installed build is current.
68
+ */
69
+ export declare function extensionSourceId(projectRoot: string): string;
70
+ /** The build id stamped into a built extension's manifest (version_name "<version> build <id>"), or undefined for an unstamped (pre-SW-065) build. */
71
+ export declare function builtExtensionId(manifestJson: string): string | undefined;
72
+ export declare function daemonTreeDigest(projectRoot: string): string;
73
+ /** Digest of every file of the installed extension build (tamper / version check for the self-test). */
74
+ export declare function extensionTreeDigest(extDir: string): string;
75
+ /** Chrome's extension id for a manifest "key": the first 128 bits of SHA-256(DER SubjectPublicKeyInfo), each hex digit mapped 0-f -> a-p. */
76
+ export declare function extensionIdFromPublicKeyDer(der: Buffer): string;
77
+ /** The Chrome native messaging host manifest: exactly one allowed origin, never a wildcard. */
78
+ export declare function hostManifestJson(hostName: string, launcherPath: string, extensionId: string): string;
79
+ /** The launcher Chrome starts (hidden, by Chrome). Fixed program and arguments; the only variable part Chrome appends is its own origin argument. */
80
+ export declare function hostLauncherCmd(nodeExe: string, hostEntry: string, hostConfig: string): string;
81
+ //# sourceMappingURL=installLayout.d.ts.map
@@ -0,0 +1,164 @@
1
+ import { createHash, createHmac, timingSafeEqual } from 'node:crypto';
2
+ import { existsSync, lstatSync, readdirSync, readFileSync } from 'node:fs';
3
+ import { join, relative, sep } from 'node:path';
4
+ import { z } from 'zod';
5
+ /**
6
+ * SW-062 installation layout and pinned host configuration (single owner, shared by the setup CLI and the native bootstrap host).
7
+ *
8
+ * Everything lives inside the project root:
9
+ * <root>\.switchyard-data\private\ verified private data root (DACL exactly {user, SYSTEM}); daemon ledger, logs, keys, run\
10
+ * <root>\.switchyard-data\private\install\host-config.json pinned host configuration + DPAPI-protected installation secret + HMAC over the config
11
+ * <root>\.switchyard-data\private\native-host\ Chrome native messaging host manifest (allowed_origins = exactly ONE extension) and its launcher
12
+ * <root>\.switchyard-data\centcom-extension\ the installed (pinned-key) extension build that the user loads once
13
+ */
14
+ export const HOST_VERSION = '0.3.0';
15
+ export const INSTALL_DIR = 'install';
16
+ export const HOST_CONFIG_FILE = 'host-config.json';
17
+ export const NATIVE_HOST_DIR = 'native-host';
18
+ export const HOST_LAUNCHER_FILE = 'centcom-native-host.cmd';
19
+ export const EXTENSION_INSTALL_DIR = join('.switchyard-data', 'centcom-extension');
20
+ export const CHROME_NATIVE_HOSTS_KEY = 'HKCU\\Software\\Google\\Chrome\\NativeMessagingHosts';
21
+ const Sha = z.string().regex(/^[a-f0-9]{64}$/);
22
+ const Abs = z.string().min(3).max(1024).refine((p) => /^[A-Za-z]:\\/.test(p) || p.startsWith('/'), 'absolute path');
23
+ export const HostConfigV1Schema = z.strictObject({
24
+ schemaVersion: z.literal(1),
25
+ hostVersion: z.string().max(32),
26
+ installationId: z.string().regex(/^inst\.[A-Za-z0-9_-]{8,64}$/),
27
+ extensionId: z.string().regex(/^[a-p]{32}$/),
28
+ extensionOrigin: z.string().regex(/^chrome-extension:\/\/[a-p]{32}$/),
29
+ projectRoot: Abs,
30
+ dataRoot: Abs,
31
+ nodeExe: Abs,
32
+ nodeSha256: Sha,
33
+ daemonEntry: Abs,
34
+ daemonTreeSha256: Sha,
35
+ approvedProject: z.strictObject({ projectId: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/), root: Abs }).nullable(),
36
+ devSmokeProfiles: z.boolean(),
37
+ protectedSecretB64: z.string().regex(/^[A-Za-z0-9+/]+={0,2}$/).max(8192),
38
+ createdAt: z.string().datetime(),
39
+ updatedAt: z.string().datetime(),
40
+ configMac: Sha,
41
+ });
42
+ export function installPaths(projectRoot, dataRoot = join(projectRoot, '.switchyard-data', 'private'), hostName = 'com.my_centcom.bridge') {
43
+ const installDir = join(dataRoot, INSTALL_DIR);
44
+ const nativeHostDir = join(dataRoot, NATIVE_HOST_DIR);
45
+ return {
46
+ projectRoot, dataRoot, installDir,
47
+ hostConfig: join(installDir, HOST_CONFIG_FILE),
48
+ nativeHostDir,
49
+ hostManifest: join(nativeHostDir, `${hostName}.json`),
50
+ hostLauncher: join(nativeHostDir, HOST_LAUNCHER_FILE),
51
+ extensionDir: join(projectRoot, EXTENSION_INSTALL_DIR),
52
+ daemonEntry: join(projectRoot, 'apps', 'daemon', 'dist', 'bootstrap', 'main.js'),
53
+ nativeHostEntry: join(projectRoot, 'apps', 'daemon', 'dist', 'transports', 'native', 'nativeHost.js'),
54
+ };
55
+ }
56
+ export const sha256File = (p) => createHash('sha256').update(readFileSync(p)).digest('hex');
57
+ /** Canonical JSON of the config without its MAC (stable key order). */
58
+ export function canonicalConfig(c) {
59
+ const { configMac: _omit, ...rest } = c;
60
+ void _omit;
61
+ return JSON.stringify(Object.keys(rest).sort().reduce((o, k) => { o[k] = rest[k]; return o; }, {}));
62
+ }
63
+ /** The config MAC is keyed with the installation secret: changing any pinned field (an executable path, a digest, the origin) without the secret is detected. */
64
+ export const configMac = (secret, c) => createHmac('sha256', Buffer.from(secret, 'utf8')).update(canonicalConfig(c), 'utf8').digest('hex');
65
+ export function macMatches(secret, c) {
66
+ const a = Buffer.from(configMac(secret, c), 'hex');
67
+ const b = Buffer.from(c.configMac, 'hex');
68
+ return a.length === b.length && timingSafeEqual(a, b);
69
+ }
70
+ /**
71
+ * Digest over the code the host would start: every file of the compiled daemon and contracts trees plus their package manifests (sorted relative path +
72
+ * content digest). Rebuilding or editing any of it changes the digest, which the host treats as an update that needs one re-consent (`centcom update`).
73
+ * Third-party packages in node_modules are NOT covered (stated limitation).
74
+ */
75
+ /**
76
+ * SW-065: the identity of the extension SOURCES that a secure build would bundle (12 hex). Must equal apps/extension/scripts/build.mjs extensionSourceId(),
77
+ * which stamps it into the built manifest as version_name "<version> build <id>". Comparing the two tells whether the installed build is current.
78
+ */
79
+ export function extensionSourceId(projectRoot) {
80
+ const ext = join(projectRoot, 'apps', 'extension');
81
+ const files = [join(ext, 'manifest.secure.json'), join(ext, 'scripts', 'build.mjs')];
82
+ const walk = (d) => {
83
+ for (const e of readdirSync(d, { withFileTypes: true })) {
84
+ const p = join(d, e.name);
85
+ if (e.isDirectory())
86
+ walk(p);
87
+ else if (e.isFile())
88
+ files.push(p);
89
+ }
90
+ };
91
+ walk(join(ext, 'src'));
92
+ walk(join(projectRoot, 'packages', 'contracts', 'src'));
93
+ const h = createHash('sha256');
94
+ for (const f of files.map((p) => ({ p, rel: relative(projectRoot, p).split(sep).join('/') })).sort((a, b) => (a.rel < b.rel ? -1 : a.rel > b.rel ? 1 : 0))) {
95
+ // CRLF is hashed as LF: a Git checkout with autocrlf must not make an identical source look like a different build
96
+ h.update(`${f.rel}\n${createHash('sha256').update(Buffer.from(readFileSync(f.p).toString('latin1').replace(/\r\n/g, '\n'), 'latin1')).digest('hex')}\n`);
97
+ }
98
+ return h.digest('hex').slice(0, 12);
99
+ }
100
+ /** The build id stamped into a built extension's manifest (version_name "<version> build <id>"), or undefined for an unstamped (pre-SW-065) build. */
101
+ export function builtExtensionId(manifestJson) {
102
+ try {
103
+ return /\bbuild ([a-f0-9]{12})$/.exec(String(JSON.parse(manifestJson).version_name ?? ''))?.[1];
104
+ }
105
+ catch {
106
+ return undefined;
107
+ }
108
+ }
109
+ export function daemonTreeDigest(projectRoot) {
110
+ const roots = [join(projectRoot, 'apps', 'daemon', 'dist'), join(projectRoot, 'packages', 'contracts', 'dist')];
111
+ const files = [join(projectRoot, 'apps', 'daemon', 'package.json'), join(projectRoot, 'packages', 'contracts', 'package.json')];
112
+ const walk = (d) => {
113
+ if (!existsSync(d))
114
+ return;
115
+ for (const e of readdirSync(d, { withFileTypes: true })) {
116
+ const p = join(d, e.name);
117
+ if (e.isDirectory())
118
+ walk(p);
119
+ else if (e.isFile() && !lstatSync(p).isSymbolicLink() && !e.name.endsWith('.map') && !e.name.endsWith('.tsbuildinfo'))
120
+ files.push(p);
121
+ }
122
+ };
123
+ for (const r of roots)
124
+ walk(r);
125
+ const h = createHash('sha256');
126
+ for (const f of files.map((p) => ({ p, rel: relative(projectRoot, p).split(sep).join('/') })).sort((a, b) => (a.rel < b.rel ? -1 : a.rel > b.rel ? 1 : 0))) {
127
+ h.update(`${f.rel}\n${existsSync(f.p) ? sha256File(f.p) : 'MISSING'}\n`);
128
+ }
129
+ return h.digest('hex');
130
+ }
131
+ /** Digest of every file of the installed extension build (tamper / version check for the self-test). */
132
+ export function extensionTreeDigest(extDir) {
133
+ const files = [];
134
+ const walk = (d) => {
135
+ for (const e of readdirSync(d, { withFileTypes: true })) {
136
+ const p = join(d, e.name);
137
+ if (e.isDirectory())
138
+ walk(p);
139
+ else if (e.isFile())
140
+ files.push(p);
141
+ }
142
+ };
143
+ walk(extDir);
144
+ const h = createHash('sha256');
145
+ for (const rel of files.map((p) => relative(extDir, p).split(sep).join('/')).sort())
146
+ h.update(`${rel}\n${sha256File(join(extDir, rel))}\n`);
147
+ return h.digest('hex');
148
+ }
149
+ /** Chrome's extension id for a manifest "key": the first 128 bits of SHA-256(DER SubjectPublicKeyInfo), each hex digit mapped 0-f -> a-p. */
150
+ export function extensionIdFromPublicKeyDer(der) {
151
+ return createHash('sha256').update(der).digest('hex').slice(0, 32).split('').map((c) => String.fromCharCode('a'.charCodeAt(0) + parseInt(c, 16))).join('');
152
+ }
153
+ /** The Chrome native messaging host manifest: exactly one allowed origin, never a wildcard. */
154
+ export function hostManifestJson(hostName, launcherPath, extensionId) {
155
+ return `${JSON.stringify({ name: hostName, description: 'my-centcom local bootstrap bridge (connects the extension to the local daemon; no shell, no file access)', path: launcherPath, type: 'stdio', allowed_origins: [`chrome-extension://${extensionId}/`] }, null, 2)}\n`;
156
+ }
157
+ /** The launcher Chrome starts (hidden, by Chrome). Fixed program and arguments; the only variable part Chrome appends is its own origin argument. */
158
+ export function hostLauncherCmd(nodeExe, hostEntry, hostConfig) {
159
+ for (const p of [nodeExe, hostEntry, hostConfig])
160
+ if (/["%^&|<>\r\n]/.test(p))
161
+ throw new Error('UNSAFE_PATH_CHARACTER');
162
+ return `@echo off\r\n"${nodeExe}" "${hostEntry}" --config "${hostConfig}" %*\r\n`;
163
+ }
164
+ //# sourceMappingURL=installLayout.js.map
@@ -0,0 +1,14 @@
1
+ import { FastifyInstance } from 'fastify';
2
+ import { M03Dependencies } from '../transports/http/dispatch.js';
3
+ export interface DaemonServer {
4
+ port: number;
5
+ url: string;
6
+ app: FastifyInstance;
7
+ close: () => Promise<void>;
8
+ }
9
+ /**
10
+ * Starts the M03 Fastify daemon binding strictly to loopback 127.0.0.1.
11
+ * Supports port 0 for automatic ephemeral port assignment.
12
+ */
13
+ export declare function startM03Daemon(dependencies: M03Dependencies, port?: number): Promise<DaemonServer>;
14
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1,141 @@
1
+ import { realpathSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { createM03App } from './app.js';
5
+ import { FakePluginDriver } from '../plugins/drivers/fakePluginDriver.js';
6
+ import { authorizeM03Fixture } from '../projects/fixtureAuthorization.js';
7
+ import { createInMemoryCoordinator } from '../runs/inMemoryCoordinator.js';
8
+ import { SecureStartupError, startSecureDaemon } from './secureMain.js';
9
+ /**
10
+ * Starts the M03 Fastify daemon binding strictly to loopback 127.0.0.1.
11
+ * Supports port 0 for automatic ephemeral port assignment.
12
+ */
13
+ export async function startM03Daemon(dependencies, port = 0) {
14
+ const app = createM03App(dependencies);
15
+ await app.listen({
16
+ port,
17
+ host: '127.0.0.1',
18
+ });
19
+ const addresses = app.server.address();
20
+ let boundPort = port;
21
+ if (addresses && typeof addresses === 'object') {
22
+ boundPort = addresses.port;
23
+ }
24
+ const url = `http://127.0.0.1:${boundPort}`;
25
+ return {
26
+ port: boundPort,
27
+ url,
28
+ app,
29
+ close: async () => {
30
+ await app.close();
31
+ },
32
+ };
33
+ }
34
+ /** Default entry: nonexecuting secure daemon; fails closed without an explicit verified project root. */
35
+ async function mainSecure() {
36
+ const rawPort = process.env.PORT;
37
+ const port = rawPort === undefined || rawPort === '' ? 0 : /^\d{1,5}$/.test(rawPort) ? Number(rawPort) : -1;
38
+ // The attended operator console exists only when the operator deliberately asks for it AND both streams are a
39
+ // real terminal. A redirected or piped stdin/stdout never gets a secret-issuing console (checked before any
40
+ // data directory or database is touched).
41
+ const wantConsole = process.argv.includes('--operator-console');
42
+ if (wantConsole && !(process.stdin.isTTY === true && process.stdout.isTTY === true)) {
43
+ throw new SecureStartupError('OPERATOR_TTY_REQUIRED');
44
+ }
45
+ const approvedRoot = process.env.MY_CENTCOM_APPROVED_PROJECT_ROOT;
46
+ const server = await startSecureDaemon({
47
+ projectRoot: process.env.MY_CENTCOM_PROJECT_ROOT ?? '',
48
+ dataRoot: process.env.MY_CENTCOM_DATA_ROOT || undefined,
49
+ approvedProject: approvedRoot ? { projectId: process.env.MY_CENTCOM_APPROVED_PROJECT_ID || 'project.primary', root: approvedRoot } : undefined,
50
+ operatorConsole: wantConsole ? { input: process.stdin, output: process.stdout } : undefined,
51
+ devSmokeProfiles: process.env.MY_CENTCOM_DEV_SMOKE === '1',
52
+ // SW-062: started by the native bootstrap host (or the setup self-test): take the single-instance lock and publish the runtime record.
53
+ publishRuntime: process.env.MY_CENTCOM_PUBLISH_RUNTIME === '1',
54
+ port,
55
+ });
56
+ console.log(`[daemon] my-centcom secure nonexecuting daemon listening at ${server.url}`);
57
+ if (process.env.MY_CENTCOM_DEV_SMOKE === '1')
58
+ console.log('[daemon] DEV_SMOKE profiles are ENABLED (benign reference operations are offered to the operator console). Not a production setting.');
59
+ installShutdown(server.close);
60
+ if (server.operator) {
61
+ await server.operator.run(); // returns on quit, end of input, or close; then the daemon is closed through its normal path
62
+ await server.close();
63
+ process.exit(0);
64
+ }
65
+ }
66
+ function installShutdown(close) {
67
+ const shutdown = async () => {
68
+ console.log('[daemon] Shutting down cleanly...');
69
+ await close();
70
+ process.exit(0);
71
+ };
72
+ process.on('SIGINT', shutdown);
73
+ process.on('SIGTERM', shutdown);
74
+ }
75
+ /**
76
+ * Direct execution. Secure (nonexecuting) is the default. The legacy fixture daemon, with its
77
+ * hard-coded token, starts ONLY with BOTH MY_CENTCOM_MODE=fixture and MY_CENTCOM_ALLOW_FIXTURE=1.
78
+ */
79
+ async function main() {
80
+ const mode = process.env.MY_CENTCOM_MODE;
81
+ if (mode === 'fixture') {
82
+ if (process.env.MY_CENTCOM_ALLOW_FIXTURE !== '1') {
83
+ console.error('[daemon] Startup failure: FIXTURE_MODE_NOT_ENABLED');
84
+ process.exit(1);
85
+ }
86
+ return mainFixture();
87
+ }
88
+ if (mode !== undefined && mode !== '' && mode !== 'secure') {
89
+ console.error('[daemon] Startup failure: MODE_INVALID');
90
+ process.exit(1);
91
+ }
92
+ try {
93
+ await mainSecure();
94
+ }
95
+ catch (err) {
96
+ console.error(`[daemon] Startup failure: ${err instanceof SecureStartupError ? err.code : 'SECURE_STARTUP_FAILED'}`);
97
+ process.exit(1);
98
+ }
99
+ }
100
+ /** Legacy fixture entry (explicit opt-in only). */
101
+ async function mainFixture() {
102
+ const driver = new FakePluginDriver();
103
+ const coordinator = createInMemoryCoordinator(driver);
104
+ const expectedToken = process.env.M03_FIXTURE_TOKEN || 'fixture-token-m03';
105
+ const server = await startM03Daemon({
106
+ driver,
107
+ authorize: authorizeM03Fixture,
108
+ coordinator,
109
+ expectedToken,
110
+ }, Number(process.env.PORT || 0));
111
+ console.log(`[daemon] my-centcom M03 daemon listening at ${server.url}`);
112
+ installShutdown(server.close);
113
+ }
114
+ /**
115
+ * True only when this module is the process entry script. Compares canonical filesystem paths
116
+ * (never a file URL against a raw path, which breaks on percent-encoded characters such as spaces).
117
+ */
118
+ function isDirectExecution() {
119
+ const entry = process.argv[1];
120
+ if (!entry) {
121
+ return false;
122
+ }
123
+ try {
124
+ const canonical = (p) => {
125
+ const real = realpathSync(resolve(p));
126
+ return process.platform === 'win32' ? real.toLowerCase() : real;
127
+ };
128
+ return canonical(fileURLToPath(import.meta.url)) === canonical(entry);
129
+ }
130
+ catch {
131
+ return false;
132
+ }
133
+ }
134
+ // Only run main if executed directly; importing this module never starts a listener.
135
+ if (isDirectExecution()) {
136
+ main().catch((err) => {
137
+ console.error('[daemon] Startup failure:', err);
138
+ process.exit(1);
139
+ });
140
+ }
141
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Attended local operator console (B02-E). Presentation only: it parses a tiny fixed command language and
3
+ * forwards each valid command to ONE narrow private actions interface supplied by the composition root.
4
+ * It decides nothing, writes no SQL, mints no token, and never touches HTTP. It is inert unless both stdin and
5
+ * stdout are a real TTY; automated tests may inject streams only through allowInjectedTestStreams, in which case
6
+ * the banner says TEST_OPERATOR_INPUT (a test, not a human gesture or physical consent).
7
+ *
8
+ * The console deliberately prints a one-time pairing or approval code ONCE to its attached terminal. That output
9
+ * is privileged and is never logged, stored or echoed anywhere else.
10
+ */
11
+ export interface OperatorActions {
12
+ issuePairingCodeForExtension(extensionId: string): {
13
+ challengeId: string;
14
+ code: string;
15
+ expiresAt: string;
16
+ };
17
+ grantVerifiedOperation(principalId: string, pluginId: string, operationId: string): {
18
+ expiresAt: string;
19
+ };
20
+ revokeOperationGrant(principalId: string, pluginId: string, operationId: string): {
21
+ revoked: number;
22
+ };
23
+ issuePendingRunApproval(runId: string): {
24
+ approvalId: string;
25
+ approvalCode: string;
26
+ expiresAt: string;
27
+ };
28
+ /** SW-060 (optional: absent means the console answers ERR NOT_AVAILABLE). Provisioning is an attended-operator action only. */
29
+ provisionOperation?(a: {
30
+ pluginId: string;
31
+ operationId: string;
32
+ profileId: string;
33
+ executablePath: string;
34
+ codeInputPath?: string;
35
+ }): Promise<{
36
+ executableSha256: string;
37
+ manifestFingerprint: string;
38
+ }>;
39
+ listProvisioned?(): ReadonlyArray<{
40
+ pluginId: string;
41
+ operationId: string;
42
+ profileId: string;
43
+ enabled: boolean;
44
+ executableSha256: string;
45
+ disabledReason: string | null;
46
+ }>;
47
+ disableProvisioned?(pluginId: string, operationId: string): boolean;
48
+ /** SW-062 (optional): a RUN_CLICK grant (verified read operations only): the user's own Run click is then the per-run consent. */
49
+ grantRunClickOperation?(principalId: string, pluginId: string, operationId: string): {
50
+ expiresAt: string;
51
+ };
52
+ /** SW-062 (optional): redacted recent diagnostic lines, newest last. Optionally filtered to one correlation id. */
53
+ recentDiagnostics?(count: number, correlationId?: string): readonly string[];
54
+ }
55
+ export type OperatorStream = {
56
+ isTTY?: boolean;
57
+ };
58
+ export interface OperatorConsoleOptions {
59
+ input: NodeJS.ReadableStream & OperatorStream;
60
+ output: NodeJS.WritableStream & OperatorStream;
61
+ actions: OperatorActions;
62
+ /** Test composition only. Never derived from an environment variable, header, message or command-line flag. */
63
+ allowInjectedTestStreams?: boolean;
64
+ }
65
+ export type OperatorRunResult = 'QUIT' | 'EOF' | 'CLOSED' | 'DENIED_NOT_ATTENDED';
66
+ export interface OperatorConsole {
67
+ run(): Promise<OperatorRunResult>;
68
+ close(): void;
69
+ /** Writes one sanitized notice line (for example a pairing receipt) while the console is running. */
70
+ notify(line: string): void;
71
+ }
72
+ export declare const MAX_LINE_BYTES = 256;
73
+ export declare const MAX_QUEUED_LINES = 5;
74
+ export declare function createOperatorConsole(options: OperatorConsoleOptions): OperatorConsole;
75
+ //# sourceMappingURL=operatorConsole.d.ts.map