@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
@@ -50,12 +50,14 @@ export function defaultWorkingFolder(agentId) {
50
50
  * Why a working folder can't be used, or `null` when it can. It must be a
51
51
  * path relative to the workspace with `/` between its parts, that stays in
52
52
  * the workspace and doesn't point into a {@link PROTECTED_TOP_NAMES} entry
53
- * or a top folder whose name starts with `.`: tools such as git, Claude
54
- * Code, Codex and editors read hooks, commands and tasks from those
53
+ * or, at any depth, a folder whose name starts with `.`: tools such as git,
54
+ * Claude Code, Codex and editors read hooks, commands and tasks from those
55
55
  * (`.git`, `.claude`, `.codex`, `.vscode`), and would run them outside the
56
- * sandbox. Parts that Windows or macOS would read as another name are refused
57
- * too, in fullwidth forms as well (see {@link relativePathProblem}). Symlinks
58
- * are resolved later, when the sandbox profile is built.
56
+ * sandbox. Any depth, because a nested clone such as `vendor/lib` has a
57
+ * `.git` of its own (HAL-5951). Parts that Windows or macOS would read as
58
+ * another name are refused too, in fullwidth forms as well (see
59
+ * {@link relativePathProblem}). Symlinks are resolved later, when the
60
+ * sandbox profile is built.
59
61
  *
60
62
  * @param path - the `workingFolder` value
61
63
  * @returns a message, or `null`
@@ -64,12 +66,14 @@ export function workingFolderProblem(path) {
64
66
  const pathProblem = relativePathProblem(path, { root: "the workspace", part: "folder name" });
65
67
  if (pathProblem !== null)
66
68
  return pathProblem;
67
- const shown = path.split("/")[0] ?? "";
68
- const top = foldName(path).split("/")[0] ?? "";
69
- if (PROTECTED_TOP_NAMES.includes(top)) {
70
- return `The agent can't write in '${shown}': it holds definitions or Halonic's own data`;
69
+ const shownParts = path.split("/");
70
+ const parts = foldName(path).split("/");
71
+ if (PROTECTED_TOP_NAMES.includes(parts[0] ?? "")) {
72
+ return `The agent can't write in '${shownParts[0]}': it holds definitions or Halonic's own data`;
71
73
  }
72
- if (top.startsWith(".")) {
74
+ const dotPart = parts.findIndex((part) => part.startsWith("."));
75
+ if (dotPart !== -1) {
76
+ const shown = shownParts.slice(0, dotPart + 1).join("/");
73
77
  return `The agent can't write in '${shown}': tools read settings and hooks from folders that start with '.'`;
74
78
  }
75
79
  return null;
@@ -195,3 +199,18 @@ export const AllowedSite = s.string().superRefine((site, context) => {
195
199
  if (problem !== null)
196
200
  context.addIssue({ code: "custom", message: problem });
197
201
  });
202
+ /**
203
+ * A list of {@link AllowedSite}s, at most {@link MAX_ALLOWED_SITES}, for a
204
+ * field inside a union, such as a connector's `transport`. The cap is a
205
+ * refinement rather than `max`, because a union reports a list that's too
206
+ * long only as its whole input being wrong, not at the list. The JSON
207
+ * Schema still shows the cap as `maxItems`, so editors know it too.
208
+ */
209
+ export const AllowedSitesInUnion = s
210
+ .array(AllowedSite)
211
+ .superRefine((sites, context) => {
212
+ if (sites.length > MAX_ALLOWED_SITES) {
213
+ context.addIssue({ code: "custom", message: `Name at most ${MAX_ALLOWED_SITES} sites` });
214
+ }
215
+ })
216
+ .meta({ maxItems: MAX_ALLOWED_SITES });
@@ -136,6 +136,11 @@ export declare const Agent: import("zod").ZodObject<{
136
136
  }>>;
137
137
  workingFolder: import("zod").ZodOptional<import("zod").ZodString>;
138
138
  allowedSites: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
139
+ harnessLimits: import("zod").ZodOptional<import("zod").ZodObject<{
140
+ maxSteps: import("zod").ZodOptional<import("zod").ZodNumber>;
141
+ maxMinutes: import("zod").ZodOptional<import("zod").ZodNumber>;
142
+ maxCost: import("zod").ZodOptional<import("zod").ZodNumber>;
143
+ }, import("zod/v4/core").$strict>>;
139
144
  }, import("zod/v4/core").$strict>;
140
145
  /** An agent, with defaults filled in. */
141
146
  export type Agent = Infer<typeof Agent>;
@@ -1,5 +1,6 @@
1
1
  import { s } from "../../../../schema-kit/src/index.js";
2
- import { collectionId, id, ModelParams, version } from "../../shared/fields.js";
2
+ import { agentId, collectionId, id, ModelParams, version } from "../../shared/fields.js";
3
+ import { HarnessLimits } from "./harness-limits.js";
3
4
  import { AgentHarness, AllowedSite, MAX_ALLOWED_SITES, WorkingFolder } from "./sandbox-fields.js";
4
5
  /** The shape of an agent's reply: free text, one of a list of options, or JSON. */
5
6
  export const AgentOutput = s.discriminatedUnion("type", [
@@ -74,7 +75,7 @@ export const AgentCharacter = s
74
75
  export const Agent = s
75
76
  .object({
76
77
  version,
77
- id,
78
+ id: agentId,
78
79
  name: s.string().min(1),
79
80
  description: s.string().optional(),
80
81
  /** Model alias (preferred) or "provider/model". */
@@ -103,5 +104,7 @@ export const Agent = s
103
104
  workingFolder: WorkingFolder.optional(),
104
105
  /** Sites a harness agent may reach besides Halonic: host names or `*.` and a domain. */
105
106
  allowedSites: s.array(AllowedSite).max(MAX_ALLOWED_SITES).optional(),
107
+ /** The step, time and cost limits of one step in a harness program. */
108
+ harnessLimits: HarnessLimits.optional(),
106
109
  })
107
110
  .strict();
@@ -14,7 +14,7 @@ export function connectorIsLocal(connector) {
14
14
  if ("stdio" in transport) {
15
15
  return true;
16
16
  }
17
- if ("google" in transport) {
17
+ if ("google" in transport || "integration" in transport || "plugin" in transport) {
18
18
  return false;
19
19
  }
20
20
  const host = hostOf(transport.http.url);
@@ -1,3 +1,5 @@
1
+ import { isHalonicSecretName, isPluginSecretName, passesNameRule } from "../../../../ports/src/index.js";
2
+ import { isSecretVariableName } from "../../../../std/src/index.js";
1
3
  import { checkKeysIn } from "../../shared/key-in-value.js";
2
4
  import { checkSecretName, looksLikeKey } from "../../shared/secret-name.js";
3
5
  import { approveAll, Connector } from "./schema.js";
@@ -15,7 +17,9 @@ export const connectorKind = {
15
17
  ...checkSecretNames(connector),
16
18
  ...checkGoogleValues(connector),
17
19
  ...checkPastedKeys(connector),
20
+ ...checkInheritedNames(connector),
18
21
  ...checkApprovedTools(connector),
22
+ ...checkReadTools(connector),
19
23
  ],
20
24
  };
21
25
  /**
@@ -35,9 +39,30 @@ function secretNames(connector) {
35
39
  }
36
40
  return names;
37
41
  }
38
- /** The secrets are named in the file, so a bad name or a pasted key is caught here, not at run time. */
42
+ /*
43
+ * The words are the team's, next to `secret-name.ts`: a small wording on a
44
+ * check the board already approved (HAL-11237).
45
+ */
46
+ const reservedNameMessage = "This secret name belongs to Halonic or to a plugin, so a connector can't use it. Store the value under a name of your own, such as my-service-key.";
47
+ /**
48
+ * The secrets are named in the file, so a bad name or a pasted key is caught
49
+ * here, not at run time. A name that belongs to Halonic (`token-key`,
50
+ * `serve-password`) or to a plugin is refused too: the file is the
51
+ * workspace's, and what it names reaches a program or a server.
52
+ */
39
53
  function checkSecretNames(connector) {
40
- return secretNames(connector).flatMap(([name, path]) => checkSecretName(name, path) ?? []);
54
+ return secretNames(connector).flatMap(([name, path]) => {
55
+ const problem = checkSecretName(name, path);
56
+ if (problem !== undefined) {
57
+ return [problem];
58
+ }
59
+ if (isHalonicSecretName(name) || isPluginSecretName(name)) {
60
+ return [
61
+ { severity: "error", code: "secret-name-reserved", path, message: reservedNameMessage },
62
+ ];
63
+ }
64
+ return [];
65
+ });
41
66
  }
42
67
  /**
43
68
  * A Google connector's `client` and `secret` name no secret. The account's
@@ -78,6 +103,51 @@ function checkPastedKeys(connector) {
78
103
  }
79
104
  return [];
80
105
  }
106
+ /** A variable name a program can be given: letters, digits and `_`, not starting with a digit. */
107
+ const variableName = /^[A-Za-z_][A-Za-z0-9_]*$/;
108
+ /*
109
+ * The words are the team's (HAL-6266), next to the placeholders of
110
+ * `secret-name.ts` and `key-in-value.ts` that wait on the board.
111
+ */
112
+ const inheritWords = {
113
+ "inherit-env-name": (name) => `"${name}" isn't a variable name. Use only letters, digits and _, not starting with a digit.`,
114
+ "inherit-env-secret": (name) => `"${name}" looks like it holds a secret, so it can't be taken from your environment. Store the value as a secret and set this variable under secretEnv to the secret's name instead.`,
115
+ "inherit-env-duplicate": (name) => `"${name}" is already in this list. Name each variable once, whatever its letter case.`,
116
+ };
117
+ /**
118
+ * `inheritEnv` names variables a local program takes from the app's own
119
+ * environment. A name that says it holds a secret, such as
120
+ * `ANTHROPIC_API_KEY`, is refused: a workspace file must not reach for a
121
+ * key in the person's shell, and `secretEnv` names the secret openly. A name
122
+ * written twice, in any letter case, is refused too, since Windows reads
123
+ * `Aws_Profile` and `AWS_PROFILE` as one variable.
124
+ */
125
+ function checkInheritedNames(connector) {
126
+ if (!("stdio" in connector.transport)) {
127
+ return [];
128
+ }
129
+ const problems = [];
130
+ const seen = new Set();
131
+ (connector.transport.stdio.inheritEnv ?? []).forEach((name, index) => {
132
+ const path = ["transport", "stdio", "inheritEnv", index];
133
+ const folded = name.toUpperCase();
134
+ const repeated = seen.has(folded);
135
+ seen.add(folded);
136
+ if (!variableName.test(name)) {
137
+ const code = "inherit-env-name";
138
+ problems.push({ severity: "error", code, path, message: inheritWords[code](name) });
139
+ }
140
+ else if (isSecretVariableName(name)) {
141
+ const code = "inherit-env-secret";
142
+ problems.push({ severity: "error", code, path, message: inheritWords[code](name) });
143
+ }
144
+ else if (repeated) {
145
+ const code = "inherit-env-duplicate";
146
+ problems.push({ severity: "error", code, path, message: inheritWords[code](name) });
147
+ }
148
+ });
149
+ return problems;
150
+ }
81
151
  /**
82
152
  * An argument's value and the option it belongs to: `--api-key=…` and
83
153
  * `--api-key …` both name the value, so a key without a known format is
@@ -117,3 +187,53 @@ function checkApprovedTools(connector) {
117
187
  });
118
188
  return problems;
119
189
  }
190
+ /** Characters that make a name in `tools.read` look like a pattern, not a tool's name. */
191
+ const patternCharacters = /[*?[\]{}]/;
192
+ /**
193
+ * Said when a name in `tools.read` fails the listed-tool name rule. It
194
+ * doesn't quote the name: the character at fault may be invisible, so the
195
+ * name would look right. Wording: Sofia, HAL-5762.
196
+ */
197
+ const readNameBreaksRule = `"read" needs exact tool names: letters a–z and A–Z, digits 0–9, "_" and "-", up to 64 characters. This one doesn't match, often because of a space, a look-alike letter or an invisible character.`;
198
+ /**
199
+ * `tools.read` takes exact names only, so a pattern is refused rather than
200
+ * matching nothing in silence. A name must also pass the name rule that a
201
+ * server's tool names pass, so a look-alike letter, a space or an invisible
202
+ * character can't make a name read as one tool and be another; it is
203
+ * refused too. A name that `tools.allow` leaves out is never offered, so
204
+ * say so. Without `tools.allow` nothing checks the names against a listing:
205
+ * a name, exactly as written, makes a tool `read` as soon as a server lists
206
+ * a tool by that name. Wording: Sofia, HAL-5582 and HAL-5762.
207
+ */
208
+ function checkReadTools(connector) {
209
+ const { allow, read } = connector.tools;
210
+ const problems = [];
211
+ read?.forEach((tool, index) => {
212
+ const path = ["tools", "read", index];
213
+ if (patternCharacters.test(tool)) {
214
+ problems.push({
215
+ severity: "error",
216
+ code: "read-tool-pattern",
217
+ path,
218
+ message: `"read" needs exact tool names. "${tool}" looks like a pattern.`,
219
+ });
220
+ }
221
+ else if (!passesNameRule(tool)) {
222
+ problems.push({
223
+ severity: "error",
224
+ code: "read-tool-name",
225
+ path,
226
+ message: readNameBreaksRule,
227
+ });
228
+ }
229
+ else if (allow !== undefined && !allow.includes(tool)) {
230
+ problems.push({
231
+ severity: "warning",
232
+ code: "read-tool-not-allowed",
233
+ path,
234
+ message: `"read" lists "${tool}", but this connector has no tool by that name. Check the spelling.`,
235
+ });
236
+ }
237
+ });
238
+ return problems;
239
+ }
@@ -21,18 +21,29 @@ export declare const Connector: import("zod").ZodObject<{
21
21
  args: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
22
22
  env: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
23
23
  secretEnv: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
24
+ inheritEnv: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
24
25
  cwd: import("zod").ZodOptional<import("zod").ZodString>;
26
+ sites: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
25
27
  }, import("zod/v4/core").$strict>;
26
28
  }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
27
29
  google: import("zod").ZodObject<{
28
30
  account: import("zod").ZodString;
29
31
  client: import("zod").ZodDefault<import("zod").ZodString>;
30
32
  }, import("zod/v4/core").$strict>;
33
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
34
+ integration: import("zod").ZodObject<{
35
+ folder: import("zod").ZodString;
36
+ }, import("zod/v4/core").$strict>;
37
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
38
+ plugin: import("zod").ZodObject<{
39
+ id: import("zod").ZodString;
40
+ }, import("zod/v4/core").$strict>;
31
41
  }, import("zod/v4/core").$strict>]>;
32
42
  secret: import("zod").ZodOptional<import("zod").ZodString>;
33
43
  tools: import("zod").ZodDefault<import("zod").ZodObject<{
34
44
  allow: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
35
45
  approve: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodArray<import("zod").ZodString>, import("zod").ZodLiteral<"all">]>>;
46
+ read: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
36
47
  }, import("zod/v4/core").$strict>>;
37
48
  local: import("zod").ZodOptional<import("zod").ZodBoolean>;
38
49
  }, import("zod/v4/core").$strict>;
@@ -48,3 +59,30 @@ export type Connector = Infer<typeof Connector>;
48
59
  * needsApproval({ approve: ["send_mail"] }, "read_mail"); // false
49
60
  */
50
61
  export declare function needsApproval(tools: Pick<Connector["tools"], "approve">, tool: string): boolean;
62
+ /**
63
+ * Whether the workspace marks `tool` as only reading, as the connector's
64
+ * `tools.read` says: the list names it exactly, and `tools.approve` doesn't
65
+ * make it ask first, so `approve` wins when both name a tool. `tool` is the
66
+ * name the server lists the tool under. A tool this says `false` for counts
67
+ * as `write`, or `send` when its listing says so.
68
+ *
69
+ * @example
70
+ * marksRead({ approve: [], read: ["search_issues"] }, "search_issues"); // true
71
+ * marksRead({ approve: ["search_issues"], read: ["search_issues"] }, "search_issues"); // false
72
+ * marksRead({ approve: [] }, "search_issues"); // false
73
+ */
74
+ export declare function marksRead(tools: Pick<Connector["tools"], "approve" | "read">, tool: string): boolean;
75
+ /**
76
+ * Whether every call to `tool` waits for a person: the rule the engine
77
+ * counts a listed tool's risk by, so `halonic tools review` and Studio say
78
+ * what a run then does. A tool runs without asking only when the workspace
79
+ * marks it as only reading ({@link marksRead}) and its listing doesn't say
80
+ * `send`: a server can raise its tool's risk, and the `read` list can't lower
81
+ * `send`. `listedRisk` is the risk its listing gives, absent when it gives none.
82
+ *
83
+ * @example
84
+ * asksBeforeEachUse({ approve: [] }, "lookup"); // true
85
+ * asksBeforeEachUse({ approve: [], read: ["lookup"] }, "lookup"); // false
86
+ * asksBeforeEachUse({ approve: [], read: ["mail"] }, "mail", "send"); // true
87
+ */
88
+ export declare function asksBeforeEachUse(tools: Pick<Connector["tools"], "approve" | "read">, tool: string, listedRisk?: "read" | "write" | "send"): boolean;
@@ -1,5 +1,6 @@
1
1
  import { s } from "../../../../schema-kit/src/index.js";
2
2
  import { id, version } from "../../shared/fields.js";
3
+ import { AllowedSitesInUnion } from "../agent/sandbox-fields.js";
3
4
  /** A remote MCP server over HTTP. */
4
5
  const HttpTransport = s
5
6
  .object({
@@ -19,8 +20,20 @@ const StdioTransport = s
19
20
  env: s.record(s.string(), s.string()).optional(),
20
21
  /** Environment variable → secret name. */
21
22
  secretEnv: s.record(s.string(), s.string()).optional(),
23
+ /**
24
+ * Variables taken from the app's own environment by name, such as
25
+ * `AWS_PROFILE`, on top of the base every program gets. No secret:
26
+ * a key goes in `secretEnv`.
27
+ */
28
+ inheritEnv: s.array(s.string()).optional(),
22
29
  /** Working directory, relative to the workspace root. */
23
30
  cwd: s.string().optional(),
31
+ /**
32
+ * The sites the program may reach when it runs in a sandbox: host
33
+ * names or `*.` and a domain, with the agent file's `allowedSites`
34
+ * rules. Without a sandbox the program runs as before, unfenced.
35
+ */
36
+ sites: AllowedSitesInUnion.optional(),
24
37
  })
25
38
  .strict(),
26
39
  })
@@ -42,8 +55,17 @@ const GoogleTransport = s
42
55
  .strict(),
43
56
  })
44
57
  .strict();
58
+ /**
59
+ * A local integration: a folder under `integrations/` whose code runs in the
60
+ * I5 runner. The tools offered are the ones its permission sheet names.
61
+ */
62
+ const IntegrationTransport = s.object({ integration: s.object({ folder: id }).strict() }).strict();
63
+ /** A plugin's backend, started in the I5 runner. Same rules as a local integration. */
64
+ const PluginTransport = s.object({ plugin: s.object({ id }).strict() }).strict();
45
65
  /** The `tools.approve` value that makes every tool of the connector ask a person first. */
46
66
  export const approveAll = "all";
67
+ /** Said when `tools.read` isn't a list of tool names. Wording: Sofia, HAL-5582. */
68
+ const readNotAList = '"read" must be a list of tool names.';
47
69
  /**
48
70
  * `library/connectors/<id>.connector.yaml`: tools for agents from an MCP
49
71
  * server or a built-in service. Secrets are referenced by name only.
@@ -54,7 +76,13 @@ export const Connector = s
54
76
  id,
55
77
  name: s.string().optional(),
56
78
  description: s.string().optional(),
57
- transport: s.union([HttpTransport, StdioTransport, GoogleTransport]),
79
+ transport: s.union([
80
+ HttpTransport,
81
+ StdioTransport,
82
+ GoogleTransport,
83
+ IntegrationTransport,
84
+ PluginTransport,
85
+ ]),
58
86
  /**
59
87
  * HTTP: the secret sent as a bearer token. Google: kept so older files
60
88
  * still read, but it names no secret: the account's Google setup keeps
@@ -71,10 +99,18 @@ export const Connector = s
71
99
  * adds later: a new MCP connector starts with it.
72
100
  */
73
101
  approve: s.union([s.array(s.string()), s.literal(approveAll)]).default([]),
102
+ /**
103
+ * Tools listed here run without asking. Only list tools that don't
104
+ * change anything. Exact names only, no patterns: every tool not
105
+ * listed still asks first, and a tool `approve` names asks whatever
106
+ * this list says. Only the person writing this file sets it; nothing
107
+ * a connector's server lists can add a tool to it.
108
+ */
109
+ read: s.array(s.string({ error: readNotAList }), { error: readNotAList }).optional(),
74
110
  })
75
111
  .strict()
76
112
  .default({ approve: [] }),
77
- /** Runs on this machine or your own network. Default: true for stdio and localhost URLs. */
113
+ /** Runs on this machine or your own network. Default: true for stdio and localhost URLs, false for integrations and plugins, whose sheet can name outside sites. */
78
114
  local: s.boolean().optional(),
79
115
  })
80
116
  .strict();
@@ -90,3 +126,36 @@ export const Connector = s
90
126
  export function needsApproval(tools, tool) {
91
127
  return tools.approve === approveAll || tools.approve.includes(tool);
92
128
  }
129
+ /**
130
+ * Whether the workspace marks `tool` as only reading, as the connector's
131
+ * `tools.read` says: the list names it exactly, and `tools.approve` doesn't
132
+ * make it ask first, so `approve` wins when both name a tool. `tool` is the
133
+ * name the server lists the tool under. A tool this says `false` for counts
134
+ * as `write`, or `send` when its listing says so.
135
+ *
136
+ * @example
137
+ * marksRead({ approve: [], read: ["search_issues"] }, "search_issues"); // true
138
+ * marksRead({ approve: ["search_issues"], read: ["search_issues"] }, "search_issues"); // false
139
+ * marksRead({ approve: [] }, "search_issues"); // false
140
+ */
141
+ export function marksRead(tools, tool) {
142
+ return (tools.read?.includes(tool) ?? false) && !needsApproval(tools, tool);
143
+ }
144
+ /**
145
+ * Whether every call to `tool` waits for a person: the rule the engine
146
+ * counts a listed tool's risk by, so `halonic tools review` and Studio say
147
+ * what a run then does. A tool runs without asking only when the workspace
148
+ * marks it as only reading ({@link marksRead}) and its listing doesn't say
149
+ * `send`: a server can raise its tool's risk, and the `read` list can't lower
150
+ * `send`. `listedRisk` is the risk its listing gives, absent when it gives none.
151
+ *
152
+ * @example
153
+ * asksBeforeEachUse({ approve: [] }, "lookup"); // true
154
+ * asksBeforeEachUse({ approve: [], read: ["lookup"] }, "lookup"); // false
155
+ * asksBeforeEachUse({ approve: [], read: ["mail"] }, "mail", "send"); // true
156
+ */
157
+ export function asksBeforeEachUse(tools, tool,
158
+ // Written out rather than ports' `ToolRisk`: the connector entry imports only schema-kit and std.
159
+ listedRisk) {
160
+ return listedRisk === "send" || !marksRead(tools, tool);
161
+ }
@@ -9,8 +9,15 @@ export const deploymentsKind = {
9
9
  idFromPlace: "none",
10
10
  check: checkDeployments,
11
11
  };
12
- /** The default deployment, when one is named, must be one of the listed ones. */
12
+ /**
13
+ * The default deployment, when one is named, must be one of the listed ones,
14
+ * and Cloudflare settings on another host are flagged as unused.
15
+ */
13
16
  function checkDeployments(file) {
17
+ return [...checkDefault(file), ...checkUnusedCloudflare(file)];
18
+ }
19
+ /** The default deployment, when one is named, must be one of the listed ones. */
20
+ function checkDefault(file) {
14
21
  if (file.default === undefined || Object.hasOwn(file.deployments, file.default)) {
15
22
  return [];
16
23
  }
@@ -23,3 +30,20 @@ function checkDeployments(file) {
23
30
  },
24
31
  ];
25
32
  }
33
+ /**
34
+ * Cloudflare settings on a deployment that runs elsewhere are a warning, not
35
+ * an error: moving a deployment to another host changes only `host:`, so the
36
+ * settings may stay behind for the way back (ADR HAL-35, 2).
37
+ */
38
+ function checkUnusedCloudflare(file) {
39
+ return Object.entries(file.deployments).flatMap(([id, deployment]) => deployment.cloudflare === undefined || deployment.host === "cloudflare"
40
+ ? []
41
+ : [
42
+ {
43
+ severity: "warning",
44
+ code: "cloudflare-settings-unused",
45
+ path: ["deployments", id, "cloudflare"],
46
+ message: `Deployment "${id}" runs on host "${deployment.host}", so its cloudflare settings are not used`,
47
+ },
48
+ ]);
49
+ }
@@ -1,4 +1,20 @@
1
1
  import { type Infer } from "../../../../schema-kit/src/index.js";
2
+ /**
3
+ * Non-secret settings for a deployment with `host: cloudflare` (ADR HAL-35,
4
+ * 5.7). They carry no account id, token or key, so the file stays safe to
5
+ * commit and the same file deploys from any account.
6
+ */
7
+ export declare const CloudflareSettings: import("zod").ZodObject<{
8
+ worker: import("zod").ZodString;
9
+ domain: import("zod").ZodOptional<import("zod").ZodString>;
10
+ location: import("zod").ZodOptional<import("zod").ZodEnum<{
11
+ eu: "eu";
12
+ }>>;
13
+ }, import("zod/v4/core").$strict>;
14
+ /** Ceilings the deployment's handler enforces, because Cloudflare has no hard spending cap. */
15
+ export declare const DeploymentLimits: import("zod").ZodObject<{
16
+ dailyRequests: import("zod").ZodOptional<import("zod").ZodNumber>;
17
+ }, import("zod/v4/core").$strict>;
2
18
  /** One place the workspace runs, with its own data (runs, Inbox, records, simulations). */
3
19
  export declare const Deployment: import("zod").ZodObject<{
4
20
  name: import("zod").ZodString;
@@ -12,6 +28,16 @@ export declare const Deployment: import("zod").ZodObject<{
12
28
  production: "production";
13
29
  }>>;
14
30
  shadow: import("zod").ZodDefault<import("zod").ZodBoolean>;
31
+ cloudflare: import("zod").ZodOptional<import("zod").ZodObject<{
32
+ worker: import("zod").ZodString;
33
+ domain: import("zod").ZodOptional<import("zod").ZodString>;
34
+ location: import("zod").ZodOptional<import("zod").ZodEnum<{
35
+ eu: "eu";
36
+ }>>;
37
+ }, import("zod/v4/core").$strict>>;
38
+ limits: import("zod").ZodOptional<import("zod").ZodObject<{
39
+ dailyRequests: import("zod").ZodOptional<import("zod").ZodNumber>;
40
+ }, import("zod/v4/core").$strict>>;
15
41
  }, import("zod/v4/core").$strict>;
16
42
  /** `deployments.yaml`: the places the workspace runs. */
17
43
  export declare const Deployments: import("zod").ZodObject<{
@@ -29,8 +55,22 @@ export declare const Deployments: import("zod").ZodObject<{
29
55
  production: "production";
30
56
  }>>;
31
57
  shadow: import("zod").ZodDefault<import("zod").ZodBoolean>;
58
+ cloudflare: import("zod").ZodOptional<import("zod").ZodObject<{
59
+ worker: import("zod").ZodString;
60
+ domain: import("zod").ZodOptional<import("zod").ZodString>;
61
+ location: import("zod").ZodOptional<import("zod").ZodEnum<{
62
+ eu: "eu";
63
+ }>>;
64
+ }, import("zod/v4/core").$strict>>;
65
+ limits: import("zod").ZodOptional<import("zod").ZodObject<{
66
+ dailyRequests: import("zod").ZodOptional<import("zod").ZodNumber>;
67
+ }, import("zod/v4/core").$strict>>;
32
68
  }, import("zod/v4/core").$strict>>;
33
69
  }, import("zod/v4/core").$strict>;
70
+ /** A deployment's Cloudflare settings. */
71
+ export type CloudflareSettings = Infer<typeof CloudflareSettings>;
72
+ /** A deployment's ceilings. */
73
+ export type DeploymentLimits = Infer<typeof DeploymentLimits>;
34
74
  /** One deployment, with defaults filled in. */
35
75
  export type Deployment = Infer<typeof Deployment>;
36
76
  /** The content of `deployments.yaml`, with defaults filled in. */
@@ -1,5 +1,53 @@
1
1
  import { s } from "../../../../schema-kit/src/index.js";
2
2
  import { deploymentId, version } from "../../shared/fields.js";
3
+ /**
4
+ * The most characters a Worker name may have: it becomes the first label of
5
+ * `<worker>.<account>.workers.dev`, and a DNS label holds at most 63.
6
+ */
7
+ const WORKER_NAME_MAX_LENGTH = 63;
8
+ /** The most characters a host name may have in DNS. */
9
+ const HOST_NAME_MAX_LENGTH = 253;
10
+ /**
11
+ * A host name: lowercase labels of letters, digits and inner `-`, joined by
12
+ * dots, with a top-level label that isn't all digits. The length cap is a
13
+ * separate `maxLength`, not a lookahead, so the JSON Schema's pattern also
14
+ * works in Go and Rust regex libraries, which have no lookaround.
15
+ */
16
+ const HOST_NAME_PATTERN = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
17
+ /**
18
+ * Non-secret settings for a deployment with `host: cloudflare` (ADR HAL-35,
19
+ * 5.7). They carry no account id, token or key, so the file stays safe to
20
+ * commit and the same file deploys from any account.
21
+ */
22
+ export const CloudflareSettings = s
23
+ .object({
24
+ /** The Worker's name; it serves at `<worker>.<account>.workers.dev`. */
25
+ worker: s
26
+ .string()
27
+ .min(1)
28
+ .max(WORKER_NAME_MAX_LENGTH, `use at most ${WORKER_NAME_MAX_LENGTH} characters, so the name fits in a workers.dev address`)
29
+ .regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/, "use lowercase letters, digits or '-', not at the start or end"),
30
+ /** A custom domain the Worker also serves at, such as `halonic.example.com`. */
31
+ domain: s
32
+ .string()
33
+ .max(HOST_NAME_MAX_LENGTH, `use at most ${HOST_NAME_MAX_LENGTH} characters`)
34
+ .regex(HOST_NAME_PATTERN, "use a lowercase host name such as halonic.example.com")
35
+ .optional(),
36
+ /**
37
+ * Where the deployment keeps its data. `eu` keeps D1, R2 and Durable
38
+ * Objects in the EU jurisdiction. Cloudflare fixes it when the data is
39
+ * first created, so changing it later needs an export and an import.
40
+ */
41
+ location: s.enum(["eu"]).optional(),
42
+ })
43
+ .strict();
44
+ /** Ceilings the deployment's handler enforces, because Cloudflare has no hard spending cap. */
45
+ export const DeploymentLimits = s
46
+ .object({
47
+ /** The most requests the deployment answers per UTC day; beyond it, it refuses them. */
48
+ dailyRequests: s.number().int().positive().optional(),
49
+ })
50
+ .strict();
3
51
  /** One place the workspace runs, with its own data (runs, Inbox, records, simulations). */
4
52
  export const Deployment = s
5
53
  .object({
@@ -10,6 +58,10 @@ export const Deployment = s
10
58
  stage: s.enum(["development", "production"]).default("development"),
11
59
  /** Every write a connector would make is only recorded, never done. */
12
60
  shadow: s.boolean().default(false),
61
+ /** Settings used when `host` is `cloudflare`. */
62
+ cloudflare: CloudflareSettings.optional(),
63
+ /** Ceilings on what the deployment answers, such as requests per day. */
64
+ limits: DeploymentLimits.optional(),
13
65
  })
14
66
  .strict();
15
67
  /** `deployments.yaml`: the places the workspace runs. */