@halonicjs/testing 0.1.0 → 0.1.2

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 (228) hide show
  1. package/NOTICE +4 -0
  2. package/README.md +1 -1
  3. package/dist/adapters/http-kit/src/address-checking.d.ts +19 -0
  4. package/dist/adapters/http-kit/src/address-checking.js +1 -0
  5. package/dist/adapters/http-kit/src/connector-host-class.d.ts +14 -0
  6. package/dist/adapters/http-kit/src/connector-host-class.js +34 -0
  7. package/dist/adapters/http-kit/src/index.d.ts +3 -0
  8. package/dist/adapters/http-kit/src/index.js +2 -0
  9. package/dist/adapters/http-kit/src/ollama-tags.d.ts +20 -0
  10. package/dist/adapters/http-kit/src/ollama-tags.js +38 -0
  11. package/dist/adapters/integration-kit/src/auth-placement.d.ts +40 -0
  12. package/dist/adapters/integration-kit/src/auth-placement.js +102 -0
  13. package/dist/adapters/integration-kit/src/current-secret-forms.d.ts +28 -0
  14. package/dist/adapters/integration-kit/src/current-secret-forms.js +60 -0
  15. package/dist/adapters/integration-kit/src/declaration.d.ts +2 -1
  16. package/dist/adapters/integration-kit/src/declaration.js +4 -3
  17. package/dist/adapters/integration-kit/src/host.d.ts +7 -1
  18. package/dist/adapters/integration-kit/src/host.js +1 -0
  19. package/dist/adapters/integration-kit/src/index.d.ts +5 -2
  20. package/dist/adapters/integration-kit/src/index.js +2 -0
  21. package/dist/adapters/integration-kit/src/leak-attempt.d.ts +4 -2
  22. package/dist/adapters/integration-kit/src/leak-attempt.js +5 -2
  23. package/dist/adapters/integration-kit/src/limited-http.d.ts +7 -1
  24. package/dist/adapters/integration-kit/src/limited-http.js +53 -10
  25. package/dist/adapters/integration-kit/src/loader.d.ts +28 -11
  26. package/dist/adapters/integration-kit/src/loader.js +36 -21
  27. package/dist/adapters/integration-kit/src/own-request.d.ts +2 -2
  28. package/dist/adapters/integration-kit/src/own-request.js +1 -1
  29. package/dist/adapters/integration-kit/src/plugin-load.d.ts +3 -3
  30. package/dist/adapters/integration-kit/src/plugin-load.js +5 -5
  31. package/dist/adapters/integration-kit/src/policy.d.ts +28 -0
  32. package/dist/adapters/integration-kit/src/response-body.d.ts +6 -2
  33. package/dist/adapters/integration-kit/src/secret-filter.d.ts +3 -3
  34. package/dist/adapters/integration-kit/src/secret-filter.js +19 -4
  35. package/dist/adapters/integration-kit/src/secret-in-request.d.ts +3 -0
  36. package/dist/adapters/integration-kit/src/secret-in-request.js +8 -2
  37. package/dist/adapters/integration-kit/src/secret-placement.d.ts +35 -25
  38. package/dist/adapters/integration-kit/src/secret-placement.js +65 -95
  39. package/dist/adapters/integration-kit/src/sign-in-placement.d.ts +29 -0
  40. package/dist/adapters/integration-kit/src/sign-in-placement.js +92 -0
  41. package/dist/adapters/integration-kit/src/workspace-choices.d.ts +37 -0
  42. package/dist/adapters/integration-kit/src/workspace-choices.js +37 -0
  43. package/dist/core/events/src/blocked-sites.d.ts +57 -0
  44. package/dist/core/events/src/blocked-sites.js +89 -0
  45. package/dist/core/events/src/connector-listing-failed.d.ts +18 -0
  46. package/dist/core/events/src/connector-listing-failed.js +1 -0
  47. package/dist/core/events/src/home-path.d.ts +4 -1
  48. package/dist/core/events/src/home-path.js +14 -3
  49. package/dist/core/events/src/index.d.ts +8 -2
  50. package/dist/core/events/src/index.js +5 -0
  51. package/dist/core/events/src/provider-notes.d.ts +16 -0
  52. package/dist/core/events/src/provider-notes.js +24 -0
  53. package/dist/core/events/src/run-basics.d.ts +131 -10
  54. package/dist/core/events/src/run-event.d.ts +120 -11
  55. package/dist/core/events/src/run-reads.d.ts +25 -0
  56. package/dist/core/events/src/run-reads.js +44 -0
  57. package/dist/core/events/src/run-sends.d.ts +47 -0
  58. package/dist/core/events/src/run-sends.js +68 -0
  59. package/dist/core/events/src/run-summary.d.ts +11 -1
  60. package/dist/core/events/src/sandbox-opened-read.d.ts +2 -1
  61. package/dist/core/events/src/sandbox-opened-read.js +27 -2
  62. package/dist/core/events/src/sandbox-opened.d.ts +37 -4
  63. package/dist/core/events/src/sandbox-opened.js +13 -3
  64. package/dist/core/events/src/summarize.js +8 -1
  65. package/dist/core/events/src/timeline-entry.js +1 -0
  66. package/dist/core/events/src/tool-failure-cause.d.ts +25 -0
  67. package/dist/core/events/src/tool-failure-cause.js +66 -0
  68. package/dist/core/format/src/index.d.ts +9 -6
  69. package/dist/core/format/src/index.js +7 -3
  70. package/dist/core/format/src/integration/index.d.ts +3 -2
  71. package/dist/core/format/src/integration/index.js +2 -1
  72. package/dist/core/format/src/kinds/agent/harness-limits.d.ts +14 -0
  73. package/dist/core/format/src/kinds/agent/harness-limits.js +27 -0
  74. package/dist/core/format/src/kinds/agent/sandbox-fields.d.ts +15 -5
  75. package/dist/core/format/src/kinds/agent/sandbox-fields.js +29 -10
  76. package/dist/core/format/src/kinds/agent/schema.d.ts +5 -0
  77. package/dist/core/format/src/kinds/agent/schema.js +5 -2
  78. package/dist/core/format/src/kinds/connector/is-local.js +1 -1
  79. package/dist/core/format/src/kinds/connector/kind.js +122 -2
  80. package/dist/core/format/src/kinds/connector/schema.d.ts +38 -0
  81. package/dist/core/format/src/kinds/connector/schema.js +71 -2
  82. package/dist/core/format/src/kinds/deployments/kind.js +25 -1
  83. package/dist/core/format/src/kinds/deployments/schema.d.ts +40 -0
  84. package/dist/core/format/src/kinds/deployments/schema.js +52 -0
  85. package/dist/core/format/src/kinds/integration/approved-sign-ins.d.ts +62 -0
  86. package/dist/core/format/src/kinds/integration/approved-sign-ins.js +125 -0
  87. package/dist/core/format/src/kinds/integration/host-key.d.ts +7 -0
  88. package/dist/core/format/src/kinds/integration/host-key.js +8 -0
  89. package/dist/core/format/src/kinds/integration/kind.d.ts +4 -2
  90. package/dist/core/format/src/kinds/integration/kind.js +49 -12
  91. package/dist/core/format/src/kinds/integration/policy.d.ts +47 -2
  92. package/dist/core/format/src/kinds/integration/policy.js +61 -2
  93. package/dist/core/format/src/kinds/integration/schema.d.ts +180 -3
  94. package/dist/core/format/src/kinds/integration/schema.js +133 -7
  95. package/dist/core/format/src/kinds/integration/sign-in-checks.d.ts +14 -0
  96. package/dist/core/format/src/kinds/integration/sign-in-checks.js +150 -0
  97. package/dist/core/format/src/kinds/integration/sign-in-urls.d.ts +19 -0
  98. package/dist/core/format/src/kinds/integration/sign-in-urls.js +47 -0
  99. package/dist/core/format/src/kinds/plugin/checks.d.ts +3 -2
  100. package/dist/core/format/src/kinds/plugin/checks.js +24 -6
  101. package/dist/core/format/src/kinds/plugin/schema.d.ts +130 -0
  102. package/dist/core/format/src/kinds/plugin/schema.js +26 -6
  103. package/dist/core/format/src/kinds/plugin/ui-checks.d.ts +1 -1
  104. package/dist/core/format/src/kinds/plugin/ui-checks.js +1 -10
  105. package/dist/core/format/src/kinds/provider/kind.js +40 -1
  106. package/dist/core/format/src/kinds/provider/types.d.ts +19 -0
  107. package/dist/core/format/src/kinds/provider/types.js +22 -0
  108. package/dist/core/format/src/kinds/routine/kind.js +38 -1
  109. package/dist/core/format/src/kinds/routine/schema.d.ts +20 -5
  110. package/dist/core/format/src/kinds/routine/schema.js +42 -14
  111. package/dist/core/format/src/kinds/routine/webhook-headers.d.ts +9 -0
  112. package/dist/core/format/src/kinds/routine/webhook-headers.js +26 -0
  113. package/dist/core/format/src/kinds/workflow/schema.js +1 -1
  114. package/dist/core/format/src/kinds/workspace/kind.js +1 -1
  115. package/dist/core/format/src/kinds/workspace/schema.d.ts +2 -2
  116. package/dist/core/format/src/kinds/workspace/schema.js +6 -5
  117. package/dist/core/format/src/parse-file.js +3 -1
  118. package/dist/core/format/src/shared/fields.d.ts +12 -8
  119. package/dist/core/format/src/shared/fields.js +48 -19
  120. package/dist/core/format/src/shared/guard.d.ts +8 -0
  121. package/dist/core/format/src/shared/guard.js +50 -1
  122. package/dist/core/format/src/shared/missing-keys.d.ts +17 -0
  123. package/dist/core/format/src/shared/missing-keys.js +110 -0
  124. package/dist/core/ports/src/agent-runs-not-available.d.ts +21 -0
  125. package/dist/core/ports/src/agent-runs-not-available.js +25 -0
  126. package/dist/core/ports/src/blob-store.d.ts +12 -0
  127. package/dist/core/ports/src/blob-store.js +22 -0
  128. package/dist/core/ports/src/chat.d.ts +8 -0
  129. package/dist/core/ports/src/connector-client.d.ts +48 -4
  130. package/dist/core/ports/src/connector-client.js +17 -0
  131. package/dist/core/ports/src/connector-start-failure.d.ts +31 -0
  132. package/dist/core/ports/src/connector-start-failure.js +32 -0
  133. package/dist/core/ports/src/connector-tool-error.d.ts +33 -0
  134. package/dist/core/ports/src/connector-tool-error.js +40 -0
  135. package/dist/core/ports/src/definition-store-left-out.d.ts +46 -0
  136. package/dist/core/ports/src/definition-store-left-out.js +47 -0
  137. package/dist/core/ports/src/definition-store.d.ts +36 -5
  138. package/dist/core/ports/src/definition-store.js +1 -1
  139. package/dist/core/ports/src/deploy-target.d.ts +358 -0
  140. package/dist/core/ports/src/deploy-target.js +2 -0
  141. package/dist/core/ports/src/harness-bridge-server.d.ts +67 -7
  142. package/dist/core/ports/src/harness-sign-in-command.d.ts +27 -0
  143. package/dist/core/ports/src/harness-sign-in-command.js +31 -0
  144. package/dist/core/ports/src/harness.d.ts +79 -15
  145. package/dist/core/ports/src/harness.js +1 -1
  146. package/dist/core/ports/src/host-settings-store.d.ts +116 -0
  147. package/dist/core/ports/src/host-settings-store.js +106 -0
  148. package/dist/core/ports/src/host-too-old.d.ts +23 -0
  149. package/dist/core/ports/src/host-too-old.js +27 -0
  150. package/dist/core/ports/src/index.d.ts +32 -13
  151. package/dist/core/ports/src/index.js +28 -8
  152. package/dist/core/ports/src/instruction-trust-store.d.ts +81 -0
  153. package/dist/core/ports/src/instruction-trust-store.js +43 -0
  154. package/dist/core/ports/src/integration.d.ts +71 -7
  155. package/dist/core/ports/src/integration.js +22 -4
  156. package/dist/core/ports/src/llm-provider.d.ts +39 -6
  157. package/dist/core/ports/src/llm-provider.js +46 -3
  158. package/dist/core/ports/src/pairing-codes.d.ts +111 -0
  159. package/dist/core/ports/src/pairing-codes.js +336 -0
  160. package/dist/core/ports/src/pairing-qr-bytes.d.ts +32 -0
  161. package/dist/core/ports/src/pairing-qr-bytes.js +116 -0
  162. package/dist/core/ports/src/password-hasher.d.ts +36 -20
  163. package/dist/core/ports/src/port-versions.d.ts +13 -6
  164. package/dist/core/ports/src/port-versions.js +14 -0
  165. package/dist/core/ports/src/program-probe.d.ts +25 -2
  166. package/dist/core/ports/src/program-probe.js +1 -1
  167. package/dist/core/ports/src/provider-default-base-url.d.ts +10 -0
  168. package/dist/core/ports/src/provider-default-base-url.js +18 -0
  169. package/dist/core/ports/src/record-store.d.ts +17 -0
  170. package/dist/core/ports/src/record-store.js +70 -0
  171. package/dist/core/ports/src/remote-control.d.ts +159 -0
  172. package/dist/core/ports/src/remote-control.js +26 -0
  173. package/dist/core/ports/src/remote-gateway-protocol.d.ts +220 -0
  174. package/dist/core/ports/src/remote-gateway-protocol.js +62 -0
  175. package/dist/core/ports/src/remote-gateway-session.d.ts +194 -0
  176. package/dist/core/ports/src/remote-gateway-session.js +241 -0
  177. package/dist/core/ports/src/run-executor.d.ts +44 -7
  178. package/dist/core/ports/src/run-executor.js +1 -1
  179. package/dist/core/ports/src/run-target-not-found.d.ts +34 -0
  180. package/dist/core/ports/src/run-target-not-found.js +41 -0
  181. package/dist/core/ports/src/sandbox-setting-store.d.ts +68 -0
  182. package/dist/core/ports/src/sandbox-setting-store.js +33 -0
  183. package/dist/core/ports/src/sandbox.d.ts +149 -13
  184. package/dist/core/ports/src/sandbox.js +52 -2
  185. package/dist/core/ports/src/secrets.d.ts +105 -1
  186. package/dist/core/ports/src/secrets.js +75 -2
  187. package/dist/core/ports/src/tool-approval-store.d.ts +50 -8
  188. package/dist/core/ports/src/tool-approval-store.js +59 -0
  189. package/dist/core/ports/src/tunnel-provider.d.ts +117 -0
  190. package/dist/core/ports/src/tunnel-provider.js +65 -0
  191. package/dist/core/ports/src/tunnel-resolver.d.ts +83 -0
  192. package/dist/core/ports/src/tunnel-resolver.js +36 -0
  193. package/dist/core/ports/src/vcs-status.d.ts +8 -0
  194. package/dist/core/ports/src/vcs-status.js +90 -0
  195. package/dist/core/ports/src/vcs.d.ts +30 -0
  196. package/dist/core/schema-kit/src/builders.d.ts +5 -0
  197. package/dist/core/schema-kit/src/builders.js +5 -0
  198. package/dist/core/std/src/amount.d.ts +13 -0
  199. package/dist/core/std/src/amount.js +22 -0
  200. package/dist/core/std/src/hidden-characters.d.ts +28 -0
  201. package/dist/core/std/src/hidden-characters.js +72 -0
  202. package/dist/core/std/src/index.d.ts +7 -0
  203. package/dist/core/std/src/index.js +7 -0
  204. package/dist/core/std/src/path-overlap.d.ts +22 -0
  205. package/dist/core/std/src/path-overlap.js +57 -0
  206. package/dist/core/std/src/public-suffixes.generated.d.ts +9 -0
  207. package/dist/core/std/src/public-suffixes.generated.js +10428 -0
  208. package/dist/core/std/src/registrable-domain.d.ts +10 -0
  209. package/dist/core/std/src/registrable-domain.js +62 -0
  210. package/dist/core/std/src/secret-variable-name.d.ts +12 -0
  211. package/dist/core/std/src/secret-variable-name.js +34 -0
  212. package/dist/core/std/src/site-name.d.ts +35 -0
  213. package/dist/core/std/src/site-name.js +111 -0
  214. package/dist/core/std/src/url-host.d.ts +35 -0
  215. package/dist/core/std/src/url-host.js +170 -0
  216. package/dist/core/std/src/word-diff.d.ts +28 -0
  217. package/dist/core/std/src/word-diff.js +77 -0
  218. package/dist/core/yaml/src/edit-data.d.ts +7 -0
  219. package/dist/core/yaml/src/edit-data.js +62 -3
  220. package/dist/core/yaml/src/edit.d.ts +7 -0
  221. package/dist/core/yaml/src/edit.js +34 -3
  222. package/dist/core/yaml/src/splice-node.d.ts +6 -0
  223. package/dist/core/yaml/src/splice-node.js +10 -0
  224. package/dist/core/yaml/src/splice.js +20 -10
  225. package/dist/testing/integration/src/checks.d.ts +5 -3
  226. package/dist/testing/integration/src/checks.js +31 -3
  227. package/dist/testing/integration/src/load.js +3 -1
  228. package/package.json +9 -2
@@ -1,7 +1,8 @@
1
1
  import type { AgentResume, RunEventBody, RunEventType } from "../../events/src/index.js";
2
+ import type { BridgeProvider } from "./harness-bridge-server.js";
2
3
  import type { SandboxProfile, SandboxSession } from "./sandbox.js";
3
4
  /** Version of the {@link Harness} port. A breaking change bumps it and comes with an ADR. */
4
- export declare const harnessVersion = 2;
5
+ export declare const harnessVersion = 3;
5
6
  /**
6
7
  * Whether a harness can run on this machine, as `detect()` finds it. Studio
7
8
  * turns it into the sentence next to the harness choice, so each case
@@ -17,14 +18,20 @@ export declare const harnessVersion = 2;
17
18
  * if (found.status === "signed-out") show(`Found ${codex.name} ${found.version} · not signed in`);
18
19
  */
19
20
  export type HarnessDetection =
20
- /** Installed in a version Halonic supports, and signed in, or its sign-in can't be checked. */
21
+ /**
22
+ * Installed in a version Halonic supports, and signed in, or its sign-in
23
+ * can't be checked. Asked about an agent's settings folder, "signed in"
24
+ * means that agent is; otherwise it means the person is, in their own
25
+ * settings, which a run never uses.
26
+ */
21
27
  {
22
28
  status: "ready";
23
29
  version: string;
24
30
  }
25
31
  /**
26
32
  * Installed in a version Halonic supports, but the program says no one is
27
- * signed in on this computer. It can still run when Halonic holds a key
33
+ * signed in: for the agent whose settings folder `detect()` was given, or
34
+ * else on this computer. It can still run when Halonic holds a key
28
35
  * for the agent's model provider, so this isn't an error on its own.
29
36
  */
30
37
  | {
@@ -50,6 +57,16 @@ export type HarnessDetection =
50
57
  status: "failed";
51
58
  error: string;
52
59
  };
60
+ /** What `detect()` may be asked about. */
61
+ export interface HarnessDetectOptions {
62
+ /**
63
+ * The agent's own settings folder, the one its runs get as
64
+ * `settingsFolder`. With it, the sign-in answer is about that agent, which
65
+ * is what a run needs. Without it, `detect()` checks the program and the
66
+ * person's own sign-in, as `halonic doctor` does outside an agent.
67
+ */
68
+ settingsFolder?: string;
69
+ }
53
70
  /** What a harness run is asked to do: one agent of one run, with the agent's own settings. */
54
71
  export interface HarnessTask {
55
72
  /** The run this agent belongs to. Every event the harness reports is written to its log. */
@@ -59,10 +76,28 @@ export interface HarnessTask {
59
76
  agentId: string;
60
77
  /** The agent's instructions from its file; empty when it has none. */
61
78
  instructions: string;
79
+ /**
80
+ * The run's own folder of pinned instruction files, which the sandbox
81
+ * opens read-only: `AGENTS.md` and each selected skill as
82
+ * `skills/<id>/SKILL.md`. Absent when the agent has none. The harness
83
+ * hands the skills to its program and never writes in the folder.
84
+ */
85
+ instructionsFolder?: string;
62
86
  /** What the agent is asked to do in this run: the task step's prompt, or the chat message. */
63
87
  prompt: string;
64
- /** The model the agent's file names; the harness's own default when absent. */
88
+ /**
89
+ * The model the agent's file names, or for a `models.yaml` alias its
90
+ * provider's model id; the harness's own default when absent.
91
+ */
65
92
  model?: string;
93
+ /**
94
+ * True when `model` came from an alias: the file named exactly one model,
95
+ * so the harness uses it for every call of its program, its background
96
+ * and subagent calls too, rather than the program's own smaller models,
97
+ * which a compatible provider doesn't have. Absent for a name the program
98
+ * resolves itself, such as `sonnet`.
99
+ */
100
+ modelForEveryCall?: true;
66
101
  }
67
102
  /**
68
103
  * The request header that carries the run's bridge token. The token has a
@@ -72,19 +107,37 @@ export interface HarnessTask {
72
107
  */
73
108
  export declare const harnessBridgeTokenHeader = "x-halonic-run-token";
74
109
  /**
75
- * The Halonic bridge of one run: a loopback address in Halonic that serves
76
- * the model gateway and Halonic's tools over MCP. The harness points its
77
- * program at `url` and has it send `token` in the
78
- * {@link harnessBridgeTokenHeader} header on every request.
110
+ * The Halonic bridge of one run: an address in Halonic that serves the model
111
+ * gateway and Halonic's tools over MCP. The harness points its program at
112
+ * `url` and has it send `token` in the {@link harnessBridgeTokenHeader}
113
+ * header on every request.
79
114
  *
80
115
  * The token is a credential for this run only. A harness never writes it into
81
116
  * an event, a log line or an error message.
82
117
  */
83
118
  export interface HarnessBridge {
84
- /** The bridge's address on loopback, such as "http://127.0.0.1:41817". */
119
+ /**
120
+ * The address the program calls: on loopback, such as
121
+ * "http://127.0.0.1:41817", or, when the bridge serves a Unix socket, the
122
+ * name the sandbox's proxy sends to it, such as
123
+ * "http://bridge.halonic.invalid".
124
+ */
85
125
  url: string;
86
126
  /** The run's random token. */
87
127
  token: string;
128
+ /**
129
+ * The absolute path of the Unix socket the bridge serves, when it serves
130
+ * one instead of a loopback port. Absent for a loopback bridge.
131
+ */
132
+ socketPath?: string;
133
+ /**
134
+ * The providers this bridge calls with a key Halonic keeps, which it puts
135
+ * in place of the program's own (requirement `harness-bridge.key-providers`).
136
+ * A program that won't call its model without a key of its own, such as
137
+ * Claude Code, then gets a stand-in that holds no secret. Absent when every
138
+ * provider is reached with the program's own sign-in.
139
+ */
140
+ keyProviders?: readonly BridgeProvider[];
88
141
  }
89
142
  /** The body of the run log event with this `type`. */
90
143
  type RunEventOf<Type extends RunEventType> = Extract<RunEventBody, {
@@ -151,7 +204,11 @@ export interface HarnessRun extends AsyncIterable<HarnessEvent> {
151
204
  * @throws when the run has ended, or no `approval.requested` with that `callId` is waiting
152
205
  */
153
206
  send(input: HarnessInput): Promise<void>;
154
- /** Stops the run. Resolves once every program it started has stopped; does nothing on a run that has ended. */
207
+ /**
208
+ * Stops the run. Resolves once every program it started has stopped; does nothing on a run that has ended.
209
+ *
210
+ * @throws when a program it started can't be stopped, so it may still be running; the error never contains the bridge token
211
+ */
155
212
  cancel(): Promise<void>;
156
213
  }
157
214
  /**
@@ -167,7 +224,8 @@ export interface HarnessRun extends AsyncIterable<HarnessEvent> {
167
224
  * `start` throws, so the same loop runs there without stdio connectors.
168
225
  *
169
226
  * @example
170
- * if ((await harness.detect()).status !== "ready") return;
227
+ * const found = await harness.detect({ settingsFolder: agentSettingsFolder });
228
+ * if (found.status !== "ready") return;
171
229
  * const extra = harness.environment?.(bridge, profile) ?? {};
172
230
  * const session = await sandbox.open({ ...profile, env: addHarnessEnvironment(profile.env, extra) });
173
231
  * const run = harness.start(task, session, bridge);
@@ -183,10 +241,12 @@ export interface Harness {
183
241
  readonly name: string;
184
242
  /**
185
243
  * Finds the harness's program on this machine, checks its version and,
186
- * where the program can tell, whether someone is signed in to it. Never
187
- * throws: a problem is a {@link HarnessDetection}.
244
+ * where the program can tell, whether someone is signed in to it. Given
245
+ * an agent's settings folder, it asks the program about that folder's
246
+ * sign-in (requirement `ports.harness-detect-folder`). Never throws: a
247
+ * problem is a {@link HarnessDetection}.
188
248
  */
189
- detect(): Promise<HarnessDetection>;
249
+ detect(options?: HarnessDetectOptions): Promise<HarnessDetection>;
190
250
  /**
191
251
  * The environment variables the harness's program needs, such as the
192
252
  * bridge's address, the token header and the program's own settings and
@@ -195,9 +255,13 @@ export interface Harness {
195
255
  * with {@link addHarnessEnvironment}, so `session.profile` stays exactly
196
256
  * what the program gets.
197
257
  *
258
+ * `model` is the task's model, which the engine knows before the sandbox
259
+ * opens, so a harness can point its program's background models at it
260
+ * when `modelForEveryCall` is set. Left out, the task names no model.
261
+ *
198
262
  * Optional: the built-in loop starts no program, so it has none.
199
263
  */
200
- environment?(bridge: HarnessBridge, folders: Pick<SandboxProfile, "workingFolder" | "tempFolder" | "settingsFolder">): Record<string, string>;
264
+ environment?(bridge: HarnessBridge, folders: Pick<SandboxProfile, "workingFolder" | "tempFolder" | "settingsFolder">, model?: Pick<HarnessTask, "model" | "modelForEveryCall">): Record<string, string>;
201
265
  /**
202
266
  * Starts the agent on `task` inside the sandbox `session`, pointed at the
203
267
  * run's `bridge`. Returns at once; a program that can't start ends the
@@ -1,5 +1,5 @@
1
1
  /** Version of the {@link Harness} port. A breaking change bumps it and comes with an ADR. */
2
- export const harnessVersion = 2;
2
+ export const harnessVersion = 3;
3
3
  /**
4
4
  * The request header that carries the run's bridge token. The token has a
5
5
  * header of its own because `Authorization` isn't free: with a subscription,
@@ -0,0 +1,116 @@
1
+ /** Version of the {@link HostSettingsStore} port. A breaking change bumps it and comes with an ADR. */
2
+ export declare const hostSettingsStoreVersion = 1;
3
+ /** A saved setting's value: anything `JSON.parse` can give back. */
4
+ export type HostSettingValue = null | boolean | number | string | readonly HostSettingValue[] | {
5
+ readonly [name: string]: HostSettingValue;
6
+ };
7
+ /**
8
+ * Every saved setting, by key.
9
+ *
10
+ * @example
11
+ * const values: HostSettingValues = { "assistant.turn-limit": 16, "assistant.connector-tools": true };
12
+ */
13
+ export type HostSettingValues = Readonly<Record<string, HostSettingValue>>;
14
+ /**
15
+ * The most bytes every saved value may take together, as compact JSON of
16
+ * the values by key (`JSON.stringify(values)` in UTF-8), so long
17
+ * instructions fit and a runaway value doesn't.
18
+ */
19
+ export declare const hostSettingsMaxBytes: number;
20
+ /**
21
+ * Whether `key` can name a host setting: at most 64 characters, the section
22
+ * first, such as `assistant.turn-limit` or `sandbox.new-agents`. Adapters
23
+ * refuse any other key, so no key can be `__proto__` or hold a path.
24
+ *
25
+ * @example
26
+ * isHostSettingKey("assistant.turn-limit"); // true
27
+ * isHostSettingKey("turn-limit"); // false: no section
28
+ */
29
+ export declare function isHostSettingKey(key: string): boolean;
30
+ /**
31
+ * The settings kept where Halonic runs, for every workspace on that
32
+ * computer: the assistant and the sandbox default (`host`-scoped settings
33
+ * in Studio). They live in the user's profile, `settings/host.json` for the
34
+ * CLI, `serve` and the desktop app, memory for tests and the browser demo,
35
+ * and **never in a workspace file**. A provider key is never one of them,
36
+ * only its secret name.
37
+ *
38
+ * The port only stores JSON values by key. `HostSettings` in `core/app`
39
+ * gives each setting its schema and default, so a value that doesn't fit
40
+ * reads as the default. The saved settings are `{ "version": 1, "values":
41
+ * {…} }`; the contract suite's golden cases
42
+ * (`packages/testing/contracts/src/golden/host-settings-limits.json`) list
43
+ * the keys, sizes and saved shapes every adapter, the desktop shell's Rust
44
+ * side too, agrees on.
45
+ *
46
+ * - Saved settings that can't be parsed read as none saved, so every
47
+ * setting starts from its default. The first save over them keeps them
48
+ * first as a broken copy (`host.json.broken`, replacing an older one),
49
+ * so they can still be recovered.
50
+ * - A save keeps everything it doesn't change exactly as it is: other
51
+ * keys, keys `read` leaves out, and the fields and `version` of settings
52
+ * saved by a newer Halonic.
53
+ * - Saves through one store run one at a time, so two saves of different
54
+ * keys keep both, and so do two windows of the desktop app, which save
55
+ * through one process. Between processes (the CLI and the desktop app
56
+ * saving at the same moment) the last save wins.
57
+ * - Settings that can't be read at all (no permission, a link) make `read`
58
+ * throw, so Studio can say it couldn't load them.
59
+ */
60
+ export interface HostSettingsStore {
61
+ /** Every saved value by key; an empty object when none is saved or they can't be parsed. */
62
+ read(): Promise<HostSettingValues>;
63
+ /**
64
+ * Saves one key's value and leaves every other key as it is. A reader
65
+ * sees the settings from before the save or after it, never half of them.
66
+ *
67
+ * @throws RangeError when the key isn't one {@link isHostSettingKey} allows, a
68
+ * number isn't finite, or the settings would be over {@link hostSettingsMaxBytes};
69
+ * nothing is saved then
70
+ */
71
+ set(key: string, value: HostSettingValue): Promise<void>;
72
+ /**
73
+ * Removes one key and leaves every other key as it is. Removing a key
74
+ * that isn't saved is not an error, and a removal is never refused for
75
+ * size, even when the saved settings are already over
76
+ * {@link hostSettingsMaxBytes}.
77
+ *
78
+ * @throws RangeError when the key isn't one {@link isHostSettingKey} allows; nothing is saved then
79
+ */
80
+ remove(key: string): Promise<void>;
81
+ /**
82
+ * Calls `listener` after the saved settings may have changed, by this
83
+ * store or by anything else (another window, the CLI). It may call more
84
+ * than once for one change, and once for several, so the caller reads
85
+ * again and compares. It never calls after the returned stop function.
86
+ */
87
+ watch(listener: () => void): () => void;
88
+ }
89
+ /**
90
+ * The values in saved settings' text, leaving out any key
91
+ * {@link isHostSettingKey} refuses; `undefined` when the text can't be
92
+ * parsed as `{ "values": {…} }`. For adapters, which only read and write.
93
+ *
94
+ * @example
95
+ * readSavedHostSettings('{"version":1,"values":{"assistant.turn-limit":20}}'); // { "assistant.turn-limit": 20 }
96
+ * readSavedHostSettings('{"version":1,"values":{'); // undefined
97
+ */
98
+ export declare function readSavedHostSettings(text: string): HostSettingValues | undefined;
99
+ /** What an adapter writes for one save, from {@link changeSavedHostSettings}. */
100
+ export interface SavedHostSettingsChange {
101
+ /** The settings' new text. */
102
+ readonly text: string;
103
+ /** Whether the old text couldn't be parsed, so the adapter keeps it as a broken copy first. */
104
+ readonly broken: boolean;
105
+ }
106
+ /**
107
+ * The saved settings' text with one key saved, or removed when `value` is
108
+ * `undefined`, and everything else kept as it is. For adapters, which only
109
+ * read and write.
110
+ *
111
+ * @param text - the saved settings' text, `undefined` when none is saved
112
+ * @throws RangeError when the key isn't one {@link isHostSettingKey} allows, a
113
+ * number isn't finite, or a saved value would bring the values over
114
+ * {@link hostSettingsMaxBytes}; a removal is never refused for size
115
+ */
116
+ export declare function changeSavedHostSettings(text: string | undefined, key: string, value: HostSettingValue | undefined): SavedHostSettingsChange;
@@ -0,0 +1,106 @@
1
+ /** Version of the {@link HostSettingsStore} port. A breaking change bumps it and comes with an ADR. */
2
+ export const hostSettingsStoreVersion = 1;
3
+ /**
4
+ * The most bytes every saved value may take together, as compact JSON of
5
+ * the values by key (`JSON.stringify(values)` in UTF-8), so long
6
+ * instructions fit and a runaway value doesn't.
7
+ */
8
+ export const hostSettingsMaxBytes = 256 * 1024;
9
+ /** A key is two or more lowercase words joined by dots, each word letters and digits with single `-`. */
10
+ const keyPattern = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*(?:\.[a-z][a-z0-9]*(?:-[a-z0-9]+)*)+$/;
11
+ /**
12
+ * Whether `key` can name a host setting: at most 64 characters, the section
13
+ * first, such as `assistant.turn-limit` or `sandbox.new-agents`. Adapters
14
+ * refuse any other key, so no key can be `__proto__` or hold a path.
15
+ *
16
+ * @example
17
+ * isHostSettingKey("assistant.turn-limit"); // true
18
+ * isHostSettingKey("turn-limit"); // false: no section
19
+ */
20
+ export function isHostSettingKey(key) {
21
+ return key.length <= 64 && keyPattern.test(key);
22
+ }
23
+ /**
24
+ * The values in saved settings' text, leaving out any key
25
+ * {@link isHostSettingKey} refuses; `undefined` when the text can't be
26
+ * parsed as `{ "values": {…} }`. For adapters, which only read and write.
27
+ *
28
+ * @example
29
+ * readSavedHostSettings('{"version":1,"values":{"assistant.turn-limit":20}}'); // { "assistant.turn-limit": 20 }
30
+ * readSavedHostSettings('{"version":1,"values":{'); // undefined
31
+ */
32
+ export function readSavedHostSettings(text) {
33
+ const saved = parseSaved(text);
34
+ if (saved === undefined)
35
+ return undefined;
36
+ return Object.fromEntries(Object.entries(saved.values).filter(([key]) => isHostSettingKey(key)));
37
+ }
38
+ /**
39
+ * The saved settings' text with one key saved, or removed when `value` is
40
+ * `undefined`, and everything else kept as it is. For adapters, which only
41
+ * read and write.
42
+ *
43
+ * @param text - the saved settings' text, `undefined` when none is saved
44
+ * @throws RangeError when the key isn't one {@link isHostSettingKey} allows, a
45
+ * number isn't finite, or a saved value would bring the values over
46
+ * {@link hostSettingsMaxBytes}; a removal is never refused for size
47
+ */
48
+ export function changeSavedHostSettings(text, key, value) {
49
+ if (!isHostSettingKey(key)) {
50
+ throw new RangeError(`${JSON.stringify(key)} can't name a setting.`);
51
+ }
52
+ if (value !== undefined && !holdsOnlyFiniteNumbers(value)) {
53
+ throw new RangeError(`The value for ${key} has a number that isn't finite.`);
54
+ }
55
+ const saved = text === undefined ? undefined : parseSaved(text);
56
+ const values = { ...saved?.values };
57
+ if (value === undefined)
58
+ delete values[key];
59
+ else
60
+ values[key] = value;
61
+ // A removal is never refused for size, so settings already over it (saved
62
+ // by a newer Halonic, or edited by hand) can still be brought back under it.
63
+ if (value !== undefined && utf8Length(JSON.stringify(values)) > hostSettingsMaxBytes) {
64
+ throw new RangeError(`The settings would be over ${hostSettingsMaxBytes} bytes with ${key}.`);
65
+ }
66
+ return {
67
+ text: `${JSON.stringify({ version: 1, ...saved, values }, null, 2)}\n`,
68
+ broken: text !== undefined && saved === undefined,
69
+ };
70
+ }
71
+ function parseSaved(text) {
72
+ let parsed;
73
+ try {
74
+ parsed = JSON.parse(text);
75
+ }
76
+ catch {
77
+ return undefined;
78
+ }
79
+ return isObject(parsed) && isObject(parsed["values"]) ? parsed : undefined;
80
+ }
81
+ function isObject(value) {
82
+ return typeof value === "object" && value !== null && !Array.isArray(value);
83
+ }
84
+ /** `text`'s length in UTF-8 bytes. The core has no `TextEncoder`; JSON text has no lone surrogates. */
85
+ function utf8Length(text) {
86
+ let bytes = 0;
87
+ for (const character of text) {
88
+ const code = character.codePointAt(0) ?? 0;
89
+ if (code < 0x80)
90
+ bytes += 1;
91
+ else if (code < 0x800)
92
+ bytes += 2;
93
+ else if (code < 0x10000)
94
+ bytes += 3;
95
+ else
96
+ bytes += 4;
97
+ }
98
+ return bytes;
99
+ }
100
+ function holdsOnlyFiniteNumbers(value) {
101
+ if (typeof value === "number")
102
+ return Number.isFinite(value);
103
+ if (typeof value !== "object" || value === null)
104
+ return true;
105
+ return Object.values(value).every(holdsOnlyFiniteNumbers);
106
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * What a remote {@link RunExecutor.send} throws, sending nothing, when the answer names a wait
3
+ * step and the host is too old to check it (requirement `ports.host-too-old`). A caller that
4
+ * answers a person, such as an Inbox card, can then ask to update the host instead of offering
5
+ * a **Try again** that can't work.
6
+ *
7
+ * It is a `RangeError`, as the refusal threw before, so a caller that caught that still does.
8
+ * Check for it with {@link isHostTooOld}, not `instanceof`: an executor may be built against its
9
+ * own copy of this package.
10
+ *
11
+ * @example
12
+ * throw new HostTooOld("This host is too old to check which wait step an answer is for.");
13
+ */
14
+ export declare class HostTooOld extends RangeError {
15
+ readonly name = "HostTooOld";
16
+ /** @param message - safe to log; Studio shows its own words for it */
17
+ constructor(message: string);
18
+ }
19
+ /**
20
+ * Whether `value` is a {@link HostTooOld}: an `Error` named "HostTooOld". It works across copies
21
+ * of this package, where `instanceof` doesn't.
22
+ */
23
+ export declare function isHostTooOld(value: unknown): value is HostTooOld;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * What a remote {@link RunExecutor.send} throws, sending nothing, when the answer names a wait
3
+ * step and the host is too old to check it (requirement `ports.host-too-old`). A caller that
4
+ * answers a person, such as an Inbox card, can then ask to update the host instead of offering
5
+ * a **Try again** that can't work.
6
+ *
7
+ * It is a `RangeError`, as the refusal threw before, so a caller that caught that still does.
8
+ * Check for it with {@link isHostTooOld}, not `instanceof`: an executor may be built against its
9
+ * own copy of this package.
10
+ *
11
+ * @example
12
+ * throw new HostTooOld("This host is too old to check which wait step an answer is for.");
13
+ */
14
+ export class HostTooOld extends RangeError {
15
+ name = "HostTooOld";
16
+ /** @param message - safe to log; Studio shows its own words for it */
17
+ constructor(message) {
18
+ super(message);
19
+ }
20
+ }
21
+ /**
22
+ * Whether `value` is a {@link HostTooOld}: an `Error` named "HostTooOld". It works across copies
23
+ * of this package, where `instanceof` doesn't.
24
+ */
25
+ export function isHostTooOld(value) {
26
+ return value instanceof Error && value.name === "HostTooOld";
27
+ }
@@ -1,37 +1,56 @@
1
1
  export { type AgentPlacementKey, type AgentPlacementRecord, type AgentPlacementStore, agentPlacementStoreVersion, isAgentPlacementFor, } from "./agent-placement-store.js";
2
- export { type BlobRef, type BlobStore, blobStoreVersion } from "./blob-store.js";
2
+ export { AgentRunsNotAvailable, isAgentRunsNotAvailable } from "./agent-runs-not-available.js";
3
+ export { type BlobRef, type BlobStore, blobStoreVersion, checkBlobMediaType, isBlobHash, } from "./blob-store.js";
3
4
  export { CantTryError, isCantTryError } from "./cant-try-error.js";
4
5
  export type { ChatMessage, ChatParams, ChatRequest, ChatResponse, ChatStreamEvent, ProviderReplay, ToolCall, ToolDefinition, } from "./chat.js";
5
6
  export { type Clock, clockVersion } from "./clock.js";
6
7
  export { type ConnectionKey, type ConnectionSettingsRecord, type ConnectionSettingsStore, connectionSettingsStoreVersion, } from "./connection-settings-store.js";
7
- export { type ConnectorCallOptions, type ConnectorClient, type ConnectorConfig, type ConnectorFactory, type ConnectorFactoryContext, type ConnectorPin, type ConnectorTool, type ConnectorTransport, connectorClientVersion, type ToolRisk, type TrustGrant, } from "./connector-client.js";
8
+ export { type ConnectorCallOptions, type ConnectorClient, type ConnectorConfig, type ConnectorFactory, type ConnectorFactoryContext, type ConnectorPin, type ConnectorTool, type ConnectorTransport, connectorClientVersion, passesNameRule, type ToolRisk, type TrustGrant, } from "./connector-client.js";
9
+ export { type ConnectorStartFailure, connectorStartFailureOf, } from "./connector-start-failure.js";
10
+ export { ConnectorToolError, isConnectorToolError } from "./connector-tool-error.js";
8
11
  export { type Coordination, type CounterResult, coordinationVersion, type Lease, type WindowCount, } from "./coordination.js";
9
- export { checkPublicWorkspacePath, checkWorkspacePath, type DefinitionSource, type DefinitionStore, type DefinitionWatch, type DefinitionWatchListener, definitionStoreVersion, type ExpectedContent, isPrivateWorkspacePath, isUnreadableWorkspaceFolderError, segmentAsOpened, UnreadableWorkspaceFolderError, type WorkspaceFileChange, type WriteOptions, type WriteResult, } from "./definition-store.js";
12
+ export { checkPublicWorkspacePath, checkWorkspacePath, type DefinitionSource, type DefinitionStore, type DefinitionWatch, type DefinitionWatchListener, definitionStoreVersion, type ExpectedContent, isPrivateWorkspacePath, isUnreadableWorkspaceFolderError, type RemoveOptions, type RemoveResult, segmentAsOpened, UnreadableWorkspaceFolderError, type WorkspaceFileChange, type WriteOptions, type WriteResult, } from "./definition-store.js";
13
+ export { checkLeaveOut, isLeftOut, type LeaveOut, type ListOptions, type VersionOptions, } from "./definition-store-left-out.js";
14
+ export * from "./deploy-target.js";
10
15
  export { type Digest, digestVersion } from "./digest.js";
11
16
  export { type FolderEntriesOptions, type FolderEntry, type FolderReader, folderReaderVersion, } from "./folder-reader.js";
12
- export { addHarnessEnvironment, type Harness, type HarnessBridge, type HarnessDetection, type HarnessEvent, type HarnessInput, type HarnessRun, type HarnessSignIn, type HarnessTask, harnessBridgeTokenHeader, harnessVersion, } from "./harness.js";
17
+ export { addHarnessEnvironment, type Harness, type HarnessBridge, type HarnessDetection, type HarnessDetectOptions, type HarnessEvent, type HarnessInput, type HarnessRun, type HarnessSignIn, type HarnessTask, harnessBridgeTokenHeader, harnessVersion, } from "./harness.js";
13
18
  export { type BridgeApprovalDecision, type BridgeApprovalRequest, type BridgeApprovals, type BridgeCallCharge, type BridgeEvent, type BridgeProvider, type BridgeProviderAccess, type BridgeRecorder, type BridgeToolCheck, type BridgeToolResult, type BridgeTools, bridgeCallCharge, bridgeCallCost, type HarnessBridgeOptions, type HarnessBridgeServer, harnessBridgeServerVersion, type OpenHarnessBridge, } from "./harness-bridge-server.js";
19
+ export { type SignInShell, signInCommandText } from "./harness-sign-in-command.js";
20
+ export { changeSavedHostSettings, type HostSettingsStore, type HostSettingValue, type HostSettingValues, hostSettingsMaxBytes, hostSettingsStoreVersion, isHostSettingKey, readSavedHostSettings, type SavedHostSettingsChange, } from "./host-settings-store.js";
21
+ export { HostTooOld, isHostTooOld } from "./host-too-old.js";
14
22
  export { type HttpClient, httpClientVersion } from "./http-client.js";
15
23
  export { type IdGenerator, idGeneratorVersion } from "./id-generator.js";
16
- export { type Integration, type IntegrationConnection, type IntegrationHost, type IntegrationHttpClient, type IntegrationRequestInit, type IntegrationTool, integrationVersion, maxIntegrationWaitMs, type SecretPlacement, } from "./integration.js";
24
+ export { type InstructionChanges, type InstructionPin, type InstructionTrustKey, type InstructionTrustRecord, type InstructionTrustStore, instructionTrustStoreVersion, isInstructionTrustFor, } from "./instruction-trust-store.js";
25
+ export { type AuthPlacement, type Integration, type IntegrationConnection, type IntegrationHost, type IntegrationHttpClient, type IntegrationRequestInit, type IntegrationTool, integrationVersion, maxIntegrationWaitMs, type SecretPlacement, SignInNeededError, type SignInPlacement, type SignInTokens, } from "./integration.js";
17
26
  export { type KnowledgeCapabilities, type KnowledgeDoc, type KnowledgeHit, type KnowledgeProvider, type KnowledgeProviderContext, type KnowledgeProviderFactory, knowledgeProviderVersion, } from "./knowledge-provider.js";
18
27
  export { type LlmCache, llmCacheVersion } from "./llm-cache.js";
19
- export { isModelCallError, isModelOutOfMemory, isVendorErrorText, type LlmCapabilities, type LlmProvider, type LlmProviderFactory, llmProviderVersion, ModelCallError, type ModelCallErrorReason, modelCallErrorReasons, type ProviderConfig, type ProviderFactoryContext, VendorErrorText, } from "./llm-provider.js";
28
+ export { isModelCallError, isModelOutOfMemory, isVendorErrorText, type LlmCapabilities, type LlmProvider, type LlmProviderFactory, llmProviderVersion, ModelCallError, type ModelCallErrorReason, modelCallErrorReasons, networkCauseOf, type ProviderConfig, type ProviderFactoryContext, VendorErrorText, } from "./llm-provider.js";
20
29
  export { type ModelPrice, priceOf } from "./model-price.js";
30
+ export { checkCodeFromBytes, checkCodeInfo, checkCodeInputBytes, checkCodeLength, decodePairingQr, encodePairingQr, formatCheckCode, formatPairingCode, newPairingCode, type PairingQrPayload, pairingAlphabet, pairingCodeLength, pairingPskInfo, pairingPskInput, pairingQrMaxBytes, pairingQrMaxEndpoints, pairingQrMaxHostNameBytes, pairingQrPrefix, readCheckCode, readPairingCode, } from "./pairing-codes.js";
21
31
  export { type PasswordHasher, passwordHasherVersion } from "./password-hasher.js";
22
32
  export { checkPluginFiles, checkPluginId, type PlacePluginOptions, type PluginFolderWriter, type PluginPlacement, pluginFolderWriterVersion, } from "./plugin-folder-writer.js";
23
33
  export { type PortName, portVersions } from "./port-versions.js";
24
- export { type ProgramProbe, type ProgramProbeResult, programProbeVersion, } from "./program-probe.js";
25
- export { type CurrentRecord, compactedChanges, foldRecords, type RecordChange, type RecordStore, recordStoreVersion, } from "./record-store.js";
34
+ export { type ProgramProbe, type ProgramProbeResult, type ProgramQuestion, type ProgramSettingsFolder, programProbeVersion, } from "./program-probe.js";
35
+ export { defaultBaseUrl } from "./provider-default-base-url.js";
36
+ export { type CurrentRecord, compactedChanges, foldRecords, formatRecordLines, parseRecordLines, type RecordChange, type RecordStore, recordStoreVersion, } from "./record-store.js";
37
+ export { type CodeEndReason, codeEndReasons, type PairedPhone, type PairingEndReason, type PairingEvent, type PairingSession, type PhonePlatform, pairingEndReasons, phonePlatforms, type RemoteControl, type RemoteState, remoteControlVersion, } from "./remote-control.js";
38
+ export { type GatewayApproval, type GatewayClientMessage, type GatewayErrorCode, type GatewayEventBody, type GatewayHostMessage, type GatewayPairDeniedReason, type GatewaySession, gatewayClosingErrorCodes, gatewayErrorCodes, gatewayMaxBufferedBytes, gatewayMaxIdLength, gatewayMaxMessageBytes, gatewayMaxPromptLength, gatewayMaxWatches, gatewayProtocolVersion, gatewayRefusalCodes, } from "./remote-gateway-protocol.js";
39
+ export { decodeCleartextFrame, encodeCleartextFrame, type GatewayCleartextFrame, type GatewayFrameKind, gatewayFallbackHostName, gatewayFallbackPhoneName, gatewayFrameKinds, gatewayHostName, gatewayMaxFrameBytes, gatewayMaxHandshakeBytes, gatewayMaxNameBytes, gatewayNoisePrologue, gatewayPairingPattern, gatewayReadableName, gatewayReconnectPattern, gatewaySessionLimits, noiseMaxMessageBytes, type PairCommitPayload, type PairHostPayload, type PairPhonePayload, type PairRefusedReason, pairCommitInput, pairCommitLabel, pairCommitNonceBytes, pairingRules, pairRefusedReasons, } from "./remote-gateway-session.js";
26
40
  export { type FolderSize, type ProcessUsage, type ResourceProbe, resourceProbeVersion, } from "./resource-probe.js";
27
- export { type ChatAgentSettings, type ChatTurnRefusal, type ChatTurnRequest, type ChatTurnResponse, type ChatTurnSkip, type EngineConnection, type EngineConnectionState, type RunEventListener, type RunExecutor, type RunSubscription, runExecutorVersion, type SendOptions, type StartAgentRequest, type StartRunRequest, } from "./run-executor.js";
41
+ export { type ChatAgentSettings, type ChatTurnRefusal, type ChatTurnRequest, type ChatTurnResponse, type ChatTurnSkip, type ChatTurnWaiting, type EngineConnection, type EngineConnectionState, type RunEventListener, type RunExecutor, type RunSubscription, runExecutorVersion, type SendOptions, type StartAgentRequest, type StartRunRequest, } from "./run-executor.js";
28
42
  export { type AdapterFailure, adapterFailures, isRunFailureError, RunFailureError, } from "./run-failure-error.js";
29
43
  export { type AppendOptions, type AppendResult, checkRunAppend, checkRunId, compareRunSummaries, formatLogLines, isRunId, matchesRunFilter, parseLogLines, type RunFilter, type RunLockRecord, type RunSnapshot, type RunStore, runLockFormat, runLockStaleAfterMs, runLockTakeoverStaleAfterMs, runStoreVersion, startedAtOrAfter, } from "./run-store.js";
30
- export { type Sandbox, type SandboxBlock, type SandboxBlockListener, type SandboxCapabilities, type SandboxCheck, type SandboxCommand, type SandboxExit, type SandboxFence, type SandboxFileAccess, type SandboxNetwork, type SandboxProcess, type SandboxProfile, type SandboxSession, type SandboxStrength, type SandboxUnavailableReason, sandboxUnavailableReasons, sandboxVersion, } from "./sandbox.js";
44
+ export { isRunTargetNotFound, type RunTargetKind, RunTargetNotFound, } from "./run-target-not-found.js";
45
+ export { type Sandbox, type SandboxBlock, type SandboxBlockListener, type SandboxBridge, type SandboxCapabilities, type SandboxCheck, type SandboxCommand, type SandboxExit, type SandboxFence, type SandboxFileAccess, type SandboxFix, type SandboxNetwork, type SandboxPackageManager, type SandboxProcess, type SandboxProfile, type SandboxResidual, type SandboxSession, type SandboxStrength, type SandboxUnavailableReason, sandboxPackageManagers, sandboxResiduals, sandboxUnavailableReasons, sandboxVersion, } from "./sandbox.js";
46
+ export { isSandboxSetting, type SandboxBackendId, type SandboxSetting, type SandboxSettingStore, sandboxBackendIds, sandboxSettingStoreVersion, } from "./sandbox-setting-store.js";
31
47
  export { type ScheduledTimer, type Scheduler, type SchedulerFactory, type SchedulerListener, schedulerVersion, } from "./scheduler.js";
32
- export { describeSecretName, halonicSecretNames, isHalonicSecretName, isPluginSecretName, isQuotableSecretName, isSecretName, maxSecretNameLength, pluginSecretNamePrefix, type Secrets, secretKey, secretsVersion, tokenNamePrefix, workspaceSecrets, } from "./secrets.js";
48
+ export { checkSecretValue, describeSecretName, halonicSecretNames, hostSecretNames, isHalonicSecretName, isPluginSecretName, isQuotableSecretName, isSecretName, type KeyOrigins, maxAllowedOrigins, maxSecretNameLength, maxSecretValueLength, noKeyOrigins, pluginSecretNamePrefix, pluginSecretSeparator, pluginSecrets, type SecretStore, type Secrets, secretKey, secretsVersion, tokenNamePrefix, workspaceSecrets, } from "./secrets.js";
33
49
  export { type TokenStore, tokenStoreVersion } from "./token-store.js";
34
- export { isUnreadableToolApprovalError, type ListedToolFingerprint, type ListedToolText, maxWaitingVersions, type ToolApproval, type ToolApprovalKey, type ToolApprovalStore, type ToolServer, toolApprovalStoreVersion, UnreadableToolApprovalError, type WaitingVersion, type WrittenDigest, } from "./tool-approval-store.js";
50
+ export { isUnreadableToolApprovalError, keptWaitingVersions, type ListedToolFingerprint, type ListedToolText, listedToolFingerprintPattern, maxWaitingTools, maxWaitingVersions, type ToolApproval, type ToolApprovalKey, type ToolApprovalStore, type ToolServer, toolApprovalStoreVersion, UnreadableToolApprovalError, type WaitingVersion, type WrittenDigest, waitingVersionKeptMs, } from "./tool-approval-store.js";
35
51
  export { type TrustOrigin, type TrustRecord, type TrustStore, trustStoreVersion, } from "./trust-store.js";
52
+ export { assertGatewayTunnelConfig, assertTunnelConfig, type TunnelCapabilities, type TunnelConfig, type TunnelEndpoint, type TunnelProvider, type TunnelReason, type TunnelState, type TunnelStatus, tunnelProviderVersion, tunnelReasons, tunnelStates, } from "./tunnel-provider.js";
53
+ export { type TunnelResolver, type TunnelTransport, type TunnelTransportState, tunnelBackoff, tunnelReconnectDelayMs, tunnelResolverVersion, } from "./tunnel-resolver.js";
36
54
  export { type UnfencedRunConsent, type UnfencedRunConsentStore, unfencedRunConsentStoreVersion, } from "./unfenced-run-consent-store.js";
37
- export { checkCommitId, checkProposalRef, unversionedFolders, type Vcs, type VcsApplyOptions, type VcsChange, type VcsCommit, type VcsCommitVersionOptions, type VcsCommitWorktreeOptions, type VcsDiffStatus, type VcsFileDiff, type VcsFileStatus, type VcsStatus, type VcsWorktree, vcsVersion, } from "./vcs.js";
55
+ export { checkCommitId, checkProposalRef, unversionedFolders, type Vcs, type VcsApplyOptions, type VcsChange, type VcsCommit, type VcsCommitVersionOptions, type VcsCommitWorktreeOptions, type VcsDiffStatus, type VcsDivergence, type VcsFileDiff, type VcsFileStatus, type VcsStatus, type VcsWorktree, vcsVersion, } from "./vcs.js";
56
+ export { parseStatus } from "./vcs-status.js";
@@ -1,36 +1,56 @@
1
1
  export { agentPlacementStoreVersion, isAgentPlacementFor, } from "./agent-placement-store.js";
2
- export { blobStoreVersion } from "./blob-store.js";
2
+ export { AgentRunsNotAvailable, isAgentRunsNotAvailable } from "./agent-runs-not-available.js";
3
+ export { blobStoreVersion, checkBlobMediaType, isBlobHash, } from "./blob-store.js";
3
4
  export { CantTryError, isCantTryError } from "./cant-try-error.js";
4
5
  export { clockVersion } from "./clock.js";
5
6
  export { connectionSettingsStoreVersion, } from "./connection-settings-store.js";
6
- export { connectorClientVersion, } from "./connector-client.js";
7
+ export { connectorClientVersion, passesNameRule, } from "./connector-client.js";
8
+ export { connectorStartFailureOf, } from "./connector-start-failure.js";
9
+ export { ConnectorToolError, isConnectorToolError } from "./connector-tool-error.js";
7
10
  export { coordinationVersion, } from "./coordination.js";
8
11
  export { checkPublicWorkspacePath, checkWorkspacePath, definitionStoreVersion, isPrivateWorkspacePath, isUnreadableWorkspaceFolderError, segmentAsOpened, UnreadableWorkspaceFolderError, } from "./definition-store.js";
12
+ export { checkLeaveOut, isLeftOut, } from "./definition-store-left-out.js";
13
+ // biome-ignore lint/performance/noReExportAll: keeps the barrel under the file-size limit; the names are listed in that file
14
+ export * from "./deploy-target.js";
9
15
  export { digestVersion } from "./digest.js";
10
16
  export { folderReaderVersion, } from "./folder-reader.js";
11
17
  export { addHarnessEnvironment, harnessBridgeTokenHeader, harnessVersion, } from "./harness.js";
12
18
  export { bridgeCallCharge, bridgeCallCost, harnessBridgeServerVersion, } from "./harness-bridge-server.js";
19
+ export { signInCommandText } from "./harness-sign-in-command.js";
20
+ export { changeSavedHostSettings, hostSettingsMaxBytes, hostSettingsStoreVersion, isHostSettingKey, readSavedHostSettings, } from "./host-settings-store.js";
21
+ export { HostTooOld, isHostTooOld } from "./host-too-old.js";
13
22
  export { httpClientVersion } from "./http-client.js";
14
23
  export { idGeneratorVersion } from "./id-generator.js";
15
- export { integrationVersion, maxIntegrationWaitMs, } from "./integration.js";
24
+ export { instructionTrustStoreVersion, isInstructionTrustFor, } from "./instruction-trust-store.js";
25
+ export { integrationVersion, maxIntegrationWaitMs, SignInNeededError, } from "./integration.js";
16
26
  export { knowledgeProviderVersion, } from "./knowledge-provider.js";
17
27
  export { llmCacheVersion } from "./llm-cache.js";
18
- export { isModelCallError, isModelOutOfMemory, isVendorErrorText, llmProviderVersion, ModelCallError, modelCallErrorReasons, VendorErrorText, } from "./llm-provider.js";
28
+ export { isModelCallError, isModelOutOfMemory, isVendorErrorText, llmProviderVersion, ModelCallError, modelCallErrorReasons, networkCauseOf, VendorErrorText, } from "./llm-provider.js";
19
29
  export { priceOf } from "./model-price.js";
30
+ export { checkCodeFromBytes, checkCodeInfo, checkCodeInputBytes, checkCodeLength, decodePairingQr, encodePairingQr, formatCheckCode, formatPairingCode, newPairingCode, pairingAlphabet, pairingCodeLength, pairingPskInfo, pairingPskInput, pairingQrMaxBytes, pairingQrMaxEndpoints, pairingQrMaxHostNameBytes, pairingQrPrefix, readCheckCode, readPairingCode, } from "./pairing-codes.js";
20
31
  export { passwordHasherVersion } from "./password-hasher.js";
21
32
  export { checkPluginFiles, checkPluginId, pluginFolderWriterVersion, } from "./plugin-folder-writer.js";
22
33
  export { portVersions } from "./port-versions.js";
23
34
  export { programProbeVersion, } from "./program-probe.js";
24
- export { compactedChanges, foldRecords, recordStoreVersion, } from "./record-store.js";
35
+ export { defaultBaseUrl } from "./provider-default-base-url.js";
36
+ export { compactedChanges, foldRecords, formatRecordLines, parseRecordLines, recordStoreVersion, } from "./record-store.js";
37
+ export { codeEndReasons, pairingEndReasons, phonePlatforms, remoteControlVersion, } from "./remote-control.js";
38
+ export { gatewayClosingErrorCodes, gatewayErrorCodes, gatewayMaxBufferedBytes, gatewayMaxIdLength, gatewayMaxMessageBytes, gatewayMaxPromptLength, gatewayMaxWatches, gatewayProtocolVersion, gatewayRefusalCodes, } from "./remote-gateway-protocol.js";
39
+ export { decodeCleartextFrame, encodeCleartextFrame, gatewayFallbackHostName, gatewayFallbackPhoneName, gatewayFrameKinds, gatewayHostName, gatewayMaxFrameBytes, gatewayMaxHandshakeBytes, gatewayMaxNameBytes, gatewayNoisePrologue, gatewayPairingPattern, gatewayReadableName, gatewayReconnectPattern, gatewaySessionLimits, noiseMaxMessageBytes, pairCommitInput, pairCommitLabel, pairCommitNonceBytes, pairingRules, pairRefusedReasons, } from "./remote-gateway-session.js";
25
40
  export { resourceProbeVersion, } from "./resource-probe.js";
26
41
  export { runExecutorVersion, } from "./run-executor.js";
27
42
  export { adapterFailures, isRunFailureError, RunFailureError, } from "./run-failure-error.js";
28
43
  export { checkRunAppend, checkRunId, compareRunSummaries, formatLogLines, isRunId, matchesRunFilter, parseLogLines, runLockFormat, runLockStaleAfterMs, runLockTakeoverStaleAfterMs, runStoreVersion, startedAtOrAfter, } from "./run-store.js";
29
- export { sandboxUnavailableReasons, sandboxVersion, } from "./sandbox.js";
44
+ export { isRunTargetNotFound, RunTargetNotFound, } from "./run-target-not-found.js";
45
+ export { sandboxPackageManagers, sandboxResiduals, sandboxUnavailableReasons, sandboxVersion, } from "./sandbox.js";
46
+ export { isSandboxSetting, sandboxBackendIds, sandboxSettingStoreVersion, } from "./sandbox-setting-store.js";
30
47
  export { schedulerVersion, } from "./scheduler.js";
31
- export { describeSecretName, halonicSecretNames, isHalonicSecretName, isPluginSecretName, isQuotableSecretName, isSecretName, maxSecretNameLength, pluginSecretNamePrefix, secretKey, secretsVersion, tokenNamePrefix, workspaceSecrets, } from "./secrets.js";
48
+ export { checkSecretValue, describeSecretName, halonicSecretNames, hostSecretNames, isHalonicSecretName, isPluginSecretName, isQuotableSecretName, isSecretName, maxAllowedOrigins, maxSecretNameLength, maxSecretValueLength, noKeyOrigins, pluginSecretNamePrefix, pluginSecretSeparator, pluginSecrets, secretKey, secretsVersion, tokenNamePrefix, workspaceSecrets, } from "./secrets.js";
32
49
  export { tokenStoreVersion } from "./token-store.js";
33
- export { isUnreadableToolApprovalError, maxWaitingVersions, toolApprovalStoreVersion, UnreadableToolApprovalError, } from "./tool-approval-store.js";
50
+ export { isUnreadableToolApprovalError, keptWaitingVersions, listedToolFingerprintPattern, maxWaitingTools, maxWaitingVersions, toolApprovalStoreVersion, UnreadableToolApprovalError, waitingVersionKeptMs, } from "./tool-approval-store.js";
34
51
  export { trustStoreVersion, } from "./trust-store.js";
52
+ export { assertGatewayTunnelConfig, assertTunnelConfig, tunnelProviderVersion, tunnelReasons, tunnelStates, } from "./tunnel-provider.js";
53
+ export { tunnelBackoff, tunnelReconnectDelayMs, tunnelResolverVersion, } from "./tunnel-resolver.js";
35
54
  export { unfencedRunConsentStoreVersion, } from "./unfenced-run-consent-store.js";
36
55
  export { checkCommitId, checkProposalRef, unversionedFolders, vcsVersion, } from "./vcs.js";
56
+ export { parseStatus } from "./vcs-status.js";