@intentic/sandbox-contract 1.393.0 → 1.395.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +26 -0
  2. package/dist/app-routes/app-pages.d.ts +97 -0
  3. package/dist/app-routes/app-pages.d.ts.map +1 -0
  4. package/dist/app-routes/app-pages.js +71 -0
  5. package/dist/app-routes/app-pages.js.map +1 -0
  6. package/dist/app-routes/index.d.ts +5 -0
  7. package/dist/app-routes/index.d.ts.map +1 -0
  8. package/dist/app-routes/index.js +5 -0
  9. package/dist/app-routes/index.js.map +1 -0
  10. package/dist/app-routes/legacy.d.ts +10 -0
  11. package/dist/app-routes/legacy.d.ts.map +1 -0
  12. package/dist/app-routes/legacy.js +92 -0
  13. package/dist/app-routes/legacy.js.map +1 -0
  14. package/dist/app-routes/paths.d.ts +38 -0
  15. package/dist/app-routes/paths.d.ts.map +1 -0
  16. package/dist/app-routes/paths.js +89 -0
  17. package/dist/app-routes/paths.js.map +1 -0
  18. package/dist/app-routes/patterns.d.ts +5 -0
  19. package/dist/app-routes/patterns.d.ts.map +1 -0
  20. package/dist/app-routes/patterns.js +94 -0
  21. package/dist/app-routes/patterns.js.map +1 -0
  22. package/dist/chores/stack.d.ts.map +1 -1
  23. package/dist/chores/stack.js +13 -2
  24. package/dist/chores/stack.js.map +1 -1
  25. package/dist/contracts/agent.contract.d.ts +115 -0
  26. package/dist/contracts/agent.contract.d.ts.map +1 -1
  27. package/dist/contracts/agents.contract.d.ts +1300 -11
  28. package/dist/contracts/agents.contract.d.ts.map +1 -1
  29. package/dist/contracts/agents.contract.js +11 -1
  30. package/dist/contracts/agents.contract.js.map +1 -1
  31. package/dist/contracts/capabilities.contract.d.ts +8 -0
  32. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  33. package/dist/contracts/endpoints.contract.d.ts +45 -0
  34. package/dist/contracts/endpoints.contract.d.ts.map +1 -1
  35. package/dist/contracts/endpoints.contract.js +9 -0
  36. package/dist/contracts/endpoints.contract.js.map +1 -1
  37. package/dist/contracts/git.contract.d.ts +5 -0
  38. package/dist/contracts/git.contract.d.ts.map +1 -1
  39. package/dist/contracts/org.contract.d.ts +8 -0
  40. package/dist/contracts/org.contract.d.ts.map +1 -1
  41. package/dist/contracts/runner.contract.d.ts +87 -0
  42. package/dist/contracts/runner.contract.d.ts.map +1 -1
  43. package/dist/contracts/seal.contract.d.ts +2760 -0
  44. package/dist/contracts/seal.contract.d.ts.map +1 -0
  45. package/dist/contracts/seal.contract.js +95 -0
  46. package/dist/contracts/seal.contract.js.map +1 -0
  47. package/dist/contracts/sessions.contract.d.ts +16 -0
  48. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  49. package/dist/contracts/settings.contract.d.ts +97 -2
  50. package/dist/contracts/settings.contract.d.ts.map +1 -1
  51. package/dist/contracts/settings.contract.js +21 -3
  52. package/dist/contracts/settings.contract.js.map +1 -1
  53. package/dist/contracts/system.contract.d.ts +422 -194
  54. package/dist/contracts/system.contract.d.ts.map +1 -1
  55. package/dist/contracts/system.contract.js +11 -2
  56. package/dist/contracts/system.contract.js.map +1 -1
  57. package/dist/contracts/webext.contract.d.ts +4 -0
  58. package/dist/contracts/webext.contract.d.ts.map +1 -1
  59. package/dist/contracts/workspace.contract.d.ts +6 -0
  60. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  61. package/dist/contracts/workspace.contract.js +11 -1
  62. package/dist/contracts/workspace.contract.js.map +1 -1
  63. package/dist/events/agent-events.d.ts +80 -1
  64. package/dist/events/agent-events.d.ts.map +1 -1
  65. package/dist/events/agent-events.js +16 -0
  66. package/dist/events/agent-events.js.map +1 -1
  67. package/dist/events/agent-transcript.d.ts +16 -0
  68. package/dist/events/agent-transcript.d.ts.map +1 -1
  69. package/dist/events/requests.d.ts +2 -0
  70. package/dist/events/requests.d.ts.map +1 -1
  71. package/dist/events/requests.js +4 -0
  72. package/dist/events/requests.js.map +1 -1
  73. package/dist/events/system-events.d.ts +292 -62
  74. package/dist/events/system-events.d.ts.map +1 -1
  75. package/dist/events/system-events.js +3 -0
  76. package/dist/events/system-events.js.map +1 -1
  77. package/dist/events/transcript.d.ts +96 -0
  78. package/dist/events/transcript.d.ts.map +1 -1
  79. package/dist/events/transcript.js +7 -1
  80. package/dist/events/transcript.js.map +1 -1
  81. package/dist/ids/row-ids.d.ts.map +1 -1
  82. package/dist/ids/row-ids.js +7 -2
  83. package/dist/ids/row-ids.js.map +1 -1
  84. package/dist/index.d.ts +107 -34467
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +7 -3
  87. package/dist/index.js.map +1 -1
  88. package/dist/models/model-roles.d.ts +8 -0
  89. package/dist/models/model-roles.d.ts.map +1 -1
  90. package/dist/models/model-roles.js +8 -0
  91. package/dist/models/model-roles.js.map +1 -1
  92. package/dist/policy/org-locks.d.ts +1 -1
  93. package/dist/policy/org-locks.d.ts.map +1 -1
  94. package/dist/policy/org-locks.js +9 -1
  95. package/dist/policy/org-locks.js.map +1 -1
  96. package/dist/policy/request-status.d.ts.map +1 -1
  97. package/dist/policy/request-status.js +26 -10
  98. package/dist/policy/request-status.js.map +1 -1
  99. package/dist/protocol/raw/raw-json-routes.d.ts +6 -0
  100. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  101. package/dist/protocol/routes.d.ts +6 -0
  102. package/dist/protocol/routes.d.ts.map +1 -1
  103. package/dist/protocol/routes.js +64 -8
  104. package/dist/protocol/routes.js.map +1 -1
  105. package/dist/protocol/sse.d.ts.map +1 -1
  106. package/dist/protocol/sse.js +5 -1
  107. package/dist/protocol/sse.js.map +1 -1
  108. package/dist/schemas/agent-land.d.ts +78 -0
  109. package/dist/schemas/agent-land.d.ts.map +1 -0
  110. package/dist/schemas/agent-land.js +47 -0
  111. package/dist/schemas/agent-land.js.map +1 -0
  112. package/dist/schemas/agent.d.ts +4 -0
  113. package/dist/schemas/agent.d.ts.map +1 -1
  114. package/dist/schemas/agent.js +1 -0
  115. package/dist/schemas/agent.js.map +1 -1
  116. package/dist/schemas/agents-list.d.ts +130 -0
  117. package/dist/schemas/agents-list.d.ts.map +1 -1
  118. package/dist/schemas/agents.d.ts +196 -76
  119. package/dist/schemas/agents.d.ts.map +1 -1
  120. package/dist/schemas/agents.js +5 -46
  121. package/dist/schemas/agents.js.map +1 -1
  122. package/dist/schemas/capabilities.d.ts +4 -0
  123. package/dist/schemas/capabilities.d.ts.map +1 -1
  124. package/dist/schemas/commit-attribution.d.ts +41 -0
  125. package/dist/schemas/commit-attribution.d.ts.map +1 -0
  126. package/dist/schemas/commit-attribution.js +16 -0
  127. package/dist/schemas/commit-attribution.js.map +1 -0
  128. package/dist/schemas/composer-drafts.d.ts +19 -0
  129. package/dist/schemas/composer-drafts.d.ts.map +1 -1
  130. package/dist/schemas/composer-drafts.js +10 -0
  131. package/dist/schemas/composer-drafts.js.map +1 -1
  132. package/dist/schemas/environment.d.ts +12 -0
  133. package/dist/schemas/environment.d.ts.map +1 -1
  134. package/dist/schemas/environment.js +1 -0
  135. package/dist/schemas/environment.js.map +1 -1
  136. package/dist/schemas/git/git-history.d.ts +10 -0
  137. package/dist/schemas/git/git-history.d.ts.map +1 -1
  138. package/dist/schemas/git/git-history.js +8 -0
  139. package/dist/schemas/git/git-history.js.map +1 -1
  140. package/dist/schemas/gpu-settings.d.ts +15 -0
  141. package/dist/schemas/gpu-settings.d.ts.map +1 -0
  142. package/dist/schemas/gpu-settings.js +18 -0
  143. package/dist/schemas/gpu-settings.js.map +1 -0
  144. package/dist/schemas/metrics.d.ts +39 -2
  145. package/dist/schemas/metrics.d.ts.map +1 -1
  146. package/dist/schemas/metrics.js +40 -1
  147. package/dist/schemas/metrics.js.map +1 -1
  148. package/dist/schemas/night-hours.d.ts +31 -0
  149. package/dist/schemas/night-hours.d.ts.map +1 -0
  150. package/dist/schemas/night-hours.js +33 -0
  151. package/dist/schemas/night-hours.js.map +1 -0
  152. package/dist/schemas/organisation.d.ts +33 -0
  153. package/dist/schemas/organisation.d.ts.map +1 -1
  154. package/dist/schemas/organisation.js +9 -0
  155. package/dist/schemas/organisation.js.map +1 -1
  156. package/dist/schemas/privacy.d.ts +1 -0
  157. package/dist/schemas/privacy.d.ts.map +1 -1
  158. package/dist/schemas/privacy.js +1 -0
  159. package/dist/schemas/privacy.js.map +1 -1
  160. package/dist/schemas/providers/plan-limits.d.ts +16 -0
  161. package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
  162. package/dist/schemas/providers/plan-limits.js +3 -0
  163. package/dist/schemas/providers/plan-limits.js.map +1 -1
  164. package/dist/schemas/sandbox-mode.d.ts +20 -0
  165. package/dist/schemas/sandbox-mode.d.ts.map +1 -0
  166. package/dist/schemas/sandbox-mode.js +54 -0
  167. package/dist/schemas/sandbox-mode.js.map +1 -0
  168. package/dist/schemas/seal-proof.d.ts +20 -0
  169. package/dist/schemas/seal-proof.d.ts.map +1 -0
  170. package/dist/schemas/seal-proof.js +8 -0
  171. package/dist/schemas/seal-proof.js.map +1 -0
  172. package/dist/schemas/seal.d.ts +235 -0
  173. package/dist/schemas/seal.d.ts.map +1 -0
  174. package/dist/schemas/seal.js +97 -0
  175. package/dist/schemas/seal.js.map +1 -0
  176. package/dist/schemas/settings-experiments.d.ts.map +1 -1
  177. package/dist/schemas/settings-experiments.js +1 -1
  178. package/dist/schemas/settings-experiments.js.map +1 -1
  179. package/dist/schemas/settings-history.d.ts +2 -2
  180. package/dist/schemas/settings.d.ts +67 -15
  181. package/dist/schemas/settings.d.ts.map +1 -1
  182. package/dist/schemas/settings.js +45 -27
  183. package/dist/schemas/settings.js.map +1 -1
  184. package/dist/schemas/webext.d.ts +9 -0
  185. package/dist/schemas/webext.d.ts.map +1 -1
  186. package/dist/schemas/webext.js +2 -0
  187. package/dist/schemas/webext.js.map +1 -1
  188. package/dist/schemas/workspace/workspace-tree.d.ts +8 -0
  189. package/dist/schemas/workspace/workspace-tree.d.ts.map +1 -1
  190. package/dist/schemas/workspace/workspace-tree.js +16 -0
  191. package/dist/schemas/workspace/workspace-tree.js.map +1 -1
  192. package/dist/state/definition.d.ts +64 -8
  193. package/dist/state/definition.d.ts.map +1 -1
  194. package/dist/text/mentions.d.ts.map +1 -1
  195. package/dist/text/mentions.js +8 -1
  196. package/dist/text/mentions.js.map +1 -1
  197. package/dist/text/pages.d.ts.map +1 -1
  198. package/dist/text/pages.js +5 -2
  199. package/dist/text/pages.js.map +1 -1
  200. package/dist/text/transcript-fold.d.ts.map +1 -1
  201. package/dist/text/transcript-fold.js +1 -0
  202. package/dist/text/transcript-fold.js.map +1 -1
  203. package/package.json +16 -5
  204. package/src/app-routes/app-pages.ts +148 -0
  205. package/src/app-routes/app-routes.test.ts +183 -0
  206. package/src/app-routes/index.ts +6 -0
  207. package/src/app-routes/legacy.ts +144 -0
  208. package/src/app-routes/paths.ts +160 -0
  209. package/src/app-routes/patterns.ts +145 -0
  210. package/src/chores/stack.ts +14 -2
  211. package/src/contracts/agents.contract.ts +15 -1
  212. package/src/contracts/endpoints.contract.ts +12 -0
  213. package/src/contracts/seal.contract.ts +117 -0
  214. package/src/contracts/settings.contract.ts +30 -6
  215. package/src/contracts/system.contract.ts +21 -2
  216. package/src/contracts/workspace.contract.ts +16 -0
  217. package/src/events/agent-events.ts +20 -0
  218. package/src/events/requests.ts +8 -0
  219. package/src/events/system-events.ts +39 -4
  220. package/src/events/transcript.ts +9 -1
  221. package/src/ids/row-ids.test.ts +31 -0
  222. package/src/ids/row-ids.ts +10 -2
  223. package/src/index.ts +65 -5
  224. package/src/models/model-roles.ts +10 -0
  225. package/src/policy/org-locks.ts +9 -1
  226. package/src/policy/request-status.ts +38 -10
  227. package/src/protocol/routes.test.ts +75 -2
  228. package/src/protocol/routes.ts +119 -11
  229. package/src/protocol/sse.ts +6 -1
  230. package/src/schemas/agent-land.ts +98 -0
  231. package/src/schemas/agent.ts +3 -0
  232. package/src/schemas/agents.ts +6 -94
  233. package/src/schemas/capabilities.ts +1 -1
  234. package/src/schemas/commit-attribution.ts +38 -0
  235. package/src/schemas/composer-drafts.ts +17 -0
  236. package/src/schemas/environment.ts +4 -0
  237. package/src/schemas/git/git-history.ts +10 -0
  238. package/src/schemas/gpu-settings.ts +31 -0
  239. package/src/schemas/metrics.ts +83 -4
  240. package/src/schemas/night-hours.test.ts +54 -0
  241. package/src/schemas/night-hours.ts +70 -0
  242. package/src/schemas/organisation.ts +15 -0
  243. package/src/schemas/privacy.test.ts +8 -1
  244. package/src/schemas/privacy.ts +10 -1
  245. package/src/schemas/providers/plan-limits.ts +5 -0
  246. package/src/schemas/sandbox-mode.test.ts +68 -0
  247. package/src/schemas/sandbox-mode.ts +93 -0
  248. package/src/schemas/seal-proof.ts +12 -0
  249. package/src/schemas/seal.ts +175 -0
  250. package/src/schemas/settings-experiments.ts +3 -1
  251. package/src/schemas/settings.test.ts +16 -0
  252. package/src/schemas/settings.ts +97 -48
  253. package/src/schemas/webext.ts +8 -0
  254. package/src/schemas/workspace/workspace-tree.ts +23 -0
  255. package/src/state/daemon-floor.test.ts +1 -0
  256. package/src/text/mentions.ts +10 -1
  257. package/src/text/pages.test.ts +1 -0
  258. package/src/text/pages.ts +10 -2
  259. package/src/text/transcript-fold.ts +1 -0
@@ -6,10 +6,14 @@ import { MODEL_ROLES, ModelRoleSchema } from "../models/model-roles.js";
6
6
  import { MODEL_SETUP_ID, ModelSetupSchema } from "../models/model-setups.js";
7
7
  import { AdmissionPolicySchema, AdmissionRuleSchema } from "./command-admission.js";
8
8
  import { KeepWarmSettingsSchema } from "./keep-warm.js";
9
+ import { commitAttributionSetting } from "./commit-attribution.js";
10
+ import { GpuSettingsSchema } from "./gpu-settings.js";
11
+ import { NightHoursSchema } from "./night-hours.js";
9
12
  import { LimitHandoffSchema } from "./providers/handoff.js";
10
13
  import { SessionsPlacementSchema } from "./offload.js";
11
14
  import { LimitPolicySchema, RetryPolicySchema, RoomPolicySchema } from "./turn-break.js";
12
15
  import { ZoneSchema } from "../time/zone.js";
16
+ import { DEFAULT_SANDBOX_MODE, SandboxModeSchema } from "./sandbox-mode.js";
13
17
  import { VoiceSettingsSchema } from "./voice.js";
14
18
  import {
15
19
  AiNoticeSchema,
@@ -60,7 +64,10 @@ export type RuleMoment = z.infer<typeof RuleMomentSchema>;
60
64
  // version-landed: commits what a land brought, in the main tree, under the subject drafted for it, and the tree's own
61
65
  // remainder before the next isolated turn starts; the only way a person who never commits keeps every agent seeing
62
66
  // the latest tree, since worktrees are cut from HEAD.
63
- export const RuleBuiltinSchema = z.enum(["verify-ui-edits", "version-landed"]);
67
+ // push-landed: sends what version-landed just committed to each repository's remote, the way Back up does (its pre-push
68
+ // hook, its terminal, its refusal told to the owner), so a sandbox set to land and save on its own can also publish on
69
+ // its own. Opt-in, and inert without version-landed: it pushes only a commit a land made (2026-11-04).
70
+ export const RuleBuiltinSchema = z.enum(["verify-ui-edits", "version-landed", "push-landed"]);
64
71
  export type RuleBuiltin = z.infer<typeof RuleBuiltinSchema>;
65
72
  export const RuleActionSchema = z.discriminatedUnion("kind", [
66
73
  z.object({
@@ -102,7 +109,7 @@ const MOMENT_ACTIONS: Record<RuleMoment, readonly RuleAction["kind"][]> = {
102
109
  // A built-in reads a record only one moment keeps, so it stands at that moment alone.
103
110
  const MOMENT_BUILTINS: Partial<Record<RuleMoment, readonly RuleBuiltin[]>> = {
104
111
  "turn.ending": ["verify-ui-edits"],
105
- "agent.landed": ["version-landed"],
112
+ "agent.landed": ["version-landed", "push-landed"],
106
113
  };
107
114
  export const RuleSchema = z
108
115
  .object({
@@ -225,50 +232,44 @@ export type SkillSwitch = z.infer<typeof SkillSwitchSchema>;
225
232
 
226
233
  // keep-warm's knobs live with its clock (keep-warm.ts); re-exported, as every settings reader imports them from here.
227
234
  export { type KeepWarmSettings, KeepWarmSettingsSchema } from "./keep-warm.js";
235
+ export {
236
+ type CommitAttribution,
237
+ CommitAttributionSchema,
238
+ type CommitIdentityAnswer,
239
+ CommitIdentityAnswerSchema,
240
+ type CommitIdentityState,
241
+ CommitIdentityStateSchema,
242
+ type GitPerson,
243
+ GitPersonSchema,
244
+ } from "./commit-attribution.js";
245
+ export { type GpuSettings, GpuSettingsSchema, GpuShellsSchema } from "./gpu-settings.js";
228
246
 
229
247
  // Who the editor's screens are written for: `developer` reads git's own words (branch, land, commit), `maker` plain ones
230
- // (draft, accept, save) over the same mechanisms. The editor's vocabulary, never anything an agent does. A person's own
231
- // answer, kept by the sandbox per member rather than in each browser, so the desktop app and a browser tab name one
232
- // button one way while two people on one sandbox can still read it in their own words.
248
+ // (draft, accept, save) over the same mechanisms. The editor's vocabulary, never anything an agent does. Decided by the
249
+ // sandbox's mode for everyone (sandbox-mode.ts audienceOfMode), unless a person chose their own here: that choice is
250
+ // kept by the sandbox per member rather than in each browser, so the desktop app and a browser tab name one button one
251
+ // way while two people on one sandbox can still read it in their own words.
233
252
  export const AudienceSchema = z.enum(["developer", "maker"]);
234
253
  export type Audience = z.infer<typeof AudienceSchema>;
235
254
 
236
- // The caller's own answer as the sandbox keeps it; absent until they have given one here.
255
+ // The caller's words here and where they come from. A daemon from before the mode answered only `audience`, and only
256
+ // once the person had chosen; a reader that finds no `mode` reads `audience` as that choice.
237
257
  export const MemberAudienceSchema = z.object({
238
- audience: AudienceSchema.optional().describe("developer for git's own words, maker for plain ones. Absent until this person has chosen here."),
239
- });
240
- export type MemberAudience = z.infer<typeof MemberAudienceSchema>;
241
-
242
- /* THE HOST GPU, FOR A SANDBOX WHOSE GPU SWITCH IS ON (2026-11-03). On a Windows PC that GPU is the owner's display GPU,
243
- shared through WSL (/dev/dxg). Until 2026-11-03 the engine put its driver libraries on every process's library path,
244
- so 65 conversations' browsers and shells rendered on it unasked, and one GPU hang powered rog off. Now nothing uses it
245
- unless asked: `gpu-run <command>` runs one command with it (bin/gpu-run), and `shells: "all"` gives it to every
246
- command an agent runs. Read by the daemon (gpu/gpu-state.ts), which hands gpu-run what it needs in a state file. */
247
- export const GpuShellsSchema = z.enum(["on-request", "all"]);
248
- export const GpuSettingsSchema = z.object({
249
- shells: GpuShellsSchema.default("on-request").describe(
250
- "Which of an agent's commands may use this sandbox's GPU. `on-request` (the default): only a command run through `gpu-run`, so a browser, a test run or a build never lands on your display GPU by accident. `all`: every command an agent runs, as if each one went through gpu-run.",
258
+ audience: AudienceSchema.optional().describe(
259
+ "The words your editor uses here: developer for git's own, maker for plain ones. Your own choice when you made one, otherwise what this sandbox's mode speaks.",
251
260
  ),
252
- timeoutMinutes: z
253
- .number()
254
- .int()
255
- .min(0)
256
- .max(24 * 60)
257
- .default(0)
258
- .describe("How long one gpu-run command may run before it is stopped, in minutes. Zero (the default) never stops it; `gpu-run --timeout` sets it for one command."),
259
- // Written by the daemon when the computer this sandbox runs on reported a GPU reset (hosts/host-crashes.ts); cleared
260
- // by the owner, which is the "resume" press. A sentence, so whoever reads the file sees why.
261
- pausedFor: z
262
- .string()
263
- .max(400)
264
- .optional()
265
- .describe(
266
- "Set by the sandbox when the computer it runs on reported that its GPU was reset or hung, naming the event: while it is set, gpu-run refuses, and every command runs without the GPU. Clear it once you have looked, to let agents use the GPU again.",
267
- ),
261
+ override: AudienceSchema.optional().describe("Your own choice of words on this sandbox. Absent means you follow the sandbox's mode."),
262
+ mode: SandboxModeSchema.optional().describe("How this sandbox runs, which decides the words for everyone who has not chosen their own."),
268
263
  });
269
- export type GpuSettings = z.infer<typeof GpuSettingsSchema>;
264
+ export type MemberAudience = z.infer<typeof MemberAudienceSchema>;
270
265
 
271
266
  export const SandboxSettingsSchema = z.object({
267
+ // How this sandbox runs (sandbox-mode.ts): first, since it decides what several of the settings below are. Hands-off
268
+ // owns the land, version and back-up rules in `rules`, which the daemon's settings store keeps standing on every
269
+ // read and write while it says so; the editor's words follow it for everyone who has not chosen their own.
270
+ mode: SandboxModeSchema.default(DEFAULT_SANDBOX_MODE).describe(
271
+ "How this sandbox runs. hands-on: you review and ship the work, and every setting here is yours. hands-off: the sandbox lands finished work by itself, saves each landing as a version and backs that version up wherever a branch tracks a remote; those three rules stay on for as long as it runs this way, and everyone who has not chosen otherwise for themselves reads plain words instead of git's. Switching back to hands-on keeps the rules as they stand, yours to change from then on.",
272
+ ),
272
273
  // The zone every WALL-CLOCK RULE in this sandbox is meant in — an automation's cron, and anything else that says
273
274
  // "at 09:00" instead of naming an instant. It is not a display preference: nothing formats through it, and an
274
275
  // instant on screen is still drawn in the reader's own clock.
@@ -345,12 +346,13 @@ export const SandboxSettingsSchema = z.object({
345
346
  ...iqSearchSettings,
346
347
  ...claudeExperimentSettings,
347
348
  // Rooted at the run's own starting folder (a persona's, an isolated conversation's worktree), not the workspace
348
- // root — it maps the project containing that folder.
349
+ // root — it maps the project containing that folder. On for new sandboxes from 2026-11-04, kept off for older ones
350
+ // as iqSearch is (settings-experiments.ts).
349
351
  workspaceMap: z
350
352
  .boolean()
351
- .default(false)
353
+ .default(true)
352
354
  .describe(
353
- "Open every conversation with a map of the project it starts in: what is in it, what each part is for, and where the agent is standing. Worked out fresh each time rather than written down anywhere, because a written layout is wrong within a fortnight. Off by default, since it spends tokens on the first message of every conversation.",
355
+ "Open every conversation with a map of the project it starts in: what is in it, what each part is for, and where the agent is standing. Worked out fresh each time rather than written down anywhere, because a written layout is wrong within a fortnight. It spends tokens on the first message of every conversation. On for new sandboxes; one made before November 2026 keeps it off until you switch it on.",
354
356
  ),
355
357
  // Judged on the opening turn's own directory listings, not averaged across the conversation, or a twelve-turn
356
358
  // conversation would divide the effect by twelve. From 2026-10-06 to 10-12 the held-out share got the full map
@@ -440,6 +442,44 @@ export const SandboxSettingsSchema = z.object({
440
442
  ),
441
443
  agentRetentionDays: AgentRetentionDaysSchema,
442
444
  heldCheckoutDays: HeldCheckoutDaysSchema,
445
+ // The build-output sweep's clock (conversations/registry/archive.ts). Hours, not days: a Rust `target/` is 10-30 GB,
446
+ // so the window is about how long a follow-up should find a warm build, not about keeping anybody's work.
447
+ buildOutputIdleHours: z
448
+ .number()
449
+ .int()
450
+ .min(1)
451
+ .max(168)
452
+ .default(6)
453
+ .describe(
454
+ "How many hours a conversation sits idle before the build output in its checkout (a Rust `target/`, Gradle and Flutter output) is removed. The checkout and its work stay; the next build makes the output again. A landed conversation's goes after an hour whatever this says, and Cargo's incremental cache, half of a Rust target, goes after an hour too.",
455
+ ),
456
+ // disk-pressure.ts's reaping threshold. Under 10% and 5% the owner is told whatever this says.
457
+ diskReapBelowPercent: z
458
+ .number()
459
+ .int()
460
+ .min(5)
461
+ .max(50)
462
+ .default(15)
463
+ .describe(
464
+ "Under how much free space, as a percentage of the disk, build output is removed from every conversation that has nothing running, the longest idle first, until the disk is back over it.",
465
+ ),
466
+ // Read live into every turn's shell (agent/run/harness/turn-env.ts); off by default, since it overrides what a
467
+ // repository's own Cargo.toml asks of its debug info.
468
+ leanRustBuilds: z
469
+ .boolean()
470
+ .default(false)
471
+ .describe(
472
+ "Build Rust with line tables only for debug info (CARGO_PROFILE_DEV_DEBUG and CARGO_PROFILE_TEST_DEBUG set to `line-tables-only` in agents' shells). A debug target takes less disk and backtraces keep their file and line, but a debugger sees no local variables. It overrides what a repository's own Cargo.toml says about debug info.",
473
+ ),
474
+ commitAttribution: commitAttributionSetting,
475
+ // A prototype, off by default (2026-11-04): an isolated checkout's Cargo `target/` laid over a frozen copy of the main
476
+ // checkout's, so each checkout keeps only what it compiled differently (conversations/worktrees/cargo-warm.ts).
477
+ sharedCargoTargets: z
478
+ .boolean()
479
+ .default(false)
480
+ .describe(
481
+ "Share compiled Rust dependencies between conversations' checkouts. The main checkout's last finished build is copied once into a frozen layer, without Cargo's incremental cache, and each checkout's `target/` reads through it, keeping only what that checkout compiles itself. Needs the main checkout built at least once, and isolated turns (a sandbox with CAP_SYS_ADMIN); without them every checkout builds its own `target/` as before. Fenced conversations and the unprivileged agent domain are not covered yet.",
482
+ ),
443
483
  // One answer per ending, never a set of switches over the same event: the chat's own question and these rows are
444
484
  // the same question at two scopes. Every ending defaults to `wait`, because a re-run spends the reader's allowance
445
485
  // on a turn they sent once.
@@ -520,7 +560,7 @@ export const SandboxSettingsSchema = z.object({
520
560
  .boolean()
521
561
  .default(true)
522
562
  .describe(
523
- "Whether each workspace repo keeps up with the remote branch it tracks. Every couple of minutes it is fetched, and what arrived is brought into the main tree: a fast-forward when you have no commits of your own, else a merge commit. Only while it is quiet (no turn working in the main tree, no merge or rebase of yours open), and never half-way: a conflict, or an uncommitted file in the way, leaves the repo exactly as it was until the next try. Nothing is ever pushed. Off, nothing is fetched.",
563
+ "Whether each workspace repo keeps up with the remote branch it tracks. Every couple of minutes it is fetched, and what arrived is brought into the main tree: a fast-forward when you have no commits of your own, else a merge commit. Only while it is quiet (no turn working in the main tree, no merge or rebase of yours open), and never half-way: a conflict, or an uncommitted file in the way, leaves the repo exactly as it was until the next try. Following never pushes; the back-up rule does that, when you switch it on. Off, nothing is fetched.",
524
564
  ),
525
565
  // Where heavy work runs: a runner (the same image, on one of the owner's machines) instead of this sandbox. Keyed by
526
566
  // the heavy-command rule an agent's command matched (workload/heavy-commands.ts), each naming a runner id. A
@@ -552,6 +592,12 @@ export const SandboxSettingsSchema = z.object({
552
592
  .describe(
553
593
  "Whether a turn killed by the sandbox restarting is re-run once it comes back. A switch rather than one of the policies above, because a restart is the one ending with nobody watching it, so there is no in-chat question to answer. Off to begin with: it would spend your allowance on work you are not watching and edit files while you are still waiting for the sandbox to return. Either way the interruption is recorded rather than silently lost.",
554
594
  ),
595
+ // The owner's night (night-hours.ts): with nobody at the editor inside it, an agent's own question is answered by the
596
+ // sandbox rather than parking the turn until morning. Off until the owner sets the hours: a sleep window guessed for
597
+ // them would decide things in their name at an hour they never chose.
598
+ nightHours: NightHoursSchema.prefault({}).describe(
599
+ "The hours you sleep, on this sandbox's clock. While they last and nobody is at the editor, a question an agent asks no longer stops its turn until morning: it is answered with the agent's own recommendation, or kept for the morning while the agent finishes everything else, as `questions` says. A plan an agent chose to make is approved the same way under `decide`; permissions, held commands and anything asked of a named person still wait for you.",
600
+ ),
555
601
  // Which repositories' own declarations (`<repo>/.intentic/checks.json`) the owner has switched on, each against the
556
602
  // fingerprint of what was declared when they did. A declaration that has since changed no longer matches its
557
603
  // fingerprint: the daemon finds the version that did in the repository's history, keeps running each check that is
@@ -574,7 +620,7 @@ export const SandboxSettingsSchema = z.object({
574
620
  message: "a command belongs in the repository's own .intentic/checks.json, not in settings",
575
621
  })
576
622
  .describe(
577
- "Standing decisions about the sandbox's own work: land or hold finished work, save a version of what landed. Empty is the default and is exactly the behaviour of a fresh sandbox, because each of those defaults is what no rule matched means at its own moment. A command to run is a repository's own check, declared in its .intentic/checks.json.",
623
+ "Standing decisions about the sandbox's own work: land or hold finished work, save a version of what landed, back that version up to the remote. Empty is the default and is exactly the behaviour of a fresh hands-on sandbox, because each of those defaults is what no rule matched means at its own moment. A hands-off sandbox keeps auto-land, auto-version and auto-push standing here whatever is written, so change those by switching `mode` to hands-on first. A command to run is a repository's own check, declared in its .intentic/checks.json.",
578
624
  ),
579
625
  automationFailureLimit: z
580
626
  .number()
@@ -675,21 +721,24 @@ export const SandboxSettingsWriteSchema = SandboxSettingsSchema.refine((settings
675
721
  path: ["rules"],
676
722
  });
677
723
 
678
- // A browser's answer to who the screens are written for, for the person signed in to it. `offer` is the one that must
679
- // not overwrite: a browser handing over the answer it kept on its own, taken only while the sandbox keeps none for them.
724
+ // A person's own choice of words on this sandbox, or null to follow its mode again. `offer` is what a browser from before
725
+ // the mode sends: the answer it kept on its own, handed to every sandbox it opened. The sandbox declines every offer now
726
+ // and answers the words it speaks, which that browser then adopts, so one browser's answer no longer travels to
727
+ // sandboxes it was never given for.
680
728
  export const AudienceAnswerSchema = z.object({
681
- audience: AudienceSchema.describe("developer for git's own words, maker for plain ones."),
729
+ audience: AudienceSchema.nullable().describe("developer for git's own words, maker for plain ones, null to follow this sandbox's mode again."),
682
730
  offer: z
683
731
  .boolean()
684
732
  .optional()
685
- .describe("Take it only while this person has no answer kept here yet. Absent or false replaces whatever is kept."),
733
+ .describe("A browser handing over an answer it kept on its own. Always declined: the words come back as this sandbox speaks them to you."),
686
734
  });
687
735
  export type AudienceAnswer = z.infer<typeof AudienceAnswerSchema>;
688
736
 
689
- // What the sandbox keeps for this person after the answer, and whether this call set it: false is an offer it declined.
737
+ // The words this person reads after the call, and whether the call changed their choice: false is a declined offer.
690
738
  export const AudienceStateSchema = z.object({
691
- audience: AudienceSchema.describe("The words this sandbox's editor now uses."),
692
- adopted: z.boolean().describe("Whether this call set it. False means an offer met an answer already kept, which stands."),
739
+ audience: AudienceSchema.describe("The words this sandbox's editor now uses for you."),
740
+ adopted: z.boolean().describe("Whether this call set your choice. False means an offer, which is never taken."),
741
+ override: AudienceSchema.optional().describe("Your own choice, as it now stands. Absent means you follow the sandbox's mode."),
693
742
  });
694
743
  export type AudienceState = z.infer<typeof AudienceStateSchema>;
695
744
 
@@ -19,6 +19,10 @@ export const WebExtScopesSchema = object({
19
19
  screenshot: webextScope.default("off"),
20
20
  // Off by default: the only switch here that copies a credential rather than borrowing the browser holding it.
21
21
  cookies: webextScope.default("off"),
22
+ // Off by default: the one switch whose effect outlives the turn. A script the person installs runs on every visit to
23
+ // its sites, with the sandbox offline too, so it is a standing grant rather than an action (webext userscripts/).
24
+ // Each install still needs the person's click in the extension, and the browser's own "Allow User Scripts".
25
+ scripts: webextScope.default("off"),
22
26
  // "sensitive" (default) prompts only for a password, payment or delete action; "always" prompts every action,
23
27
  // "never" trusts the owner to watch.
24
28
  confirm: zEnum(["sensitive", "always", "never"]).default("sensitive"),
@@ -49,6 +53,10 @@ export const WebExtFactsSchema = object({
49
53
  features: array(string()).optional(),
50
54
  });
51
55
  export type WebExtFacts = z.infer<typeof WebExtFactsSchema>;
56
+ // In `features` when this browser can run scripts the agent writes: the extension holds the optional `userScripts`
57
+ // permission and the person turned on the browser's own "Allow User Scripts" for it. Absent, the script tools refuse
58
+ // with what the person has to turn on.
59
+ export const WEBEXT_USER_SCRIPTS_FEATURE = "user-scripts";
52
60
  export const WebExtSummarySchema = object({
53
61
  // id is the capability id and the prefix of its tools (mcp__<id>__click).
54
62
  id: string(),
@@ -158,6 +158,29 @@ export const WorkspaceMediaTicketSchema = z.object({
158
158
  export const PICTURE_EDGES = [384, 512, 768, 1024, 1536, 2048] as const;
159
159
  export type PictureEdge = (typeof PICTURE_EDGES)[number];
160
160
 
161
+ // A file someone is looking at in a conversation's own copy, followed while they look: the shared tree's watcher never
162
+ // sees a checkout, so the daemon watches the folders these files sit in, one folder deep, for as long as the lease the
163
+ // answer names, and says what changed there as `checkoutChanged` on /events. A reader renews before the lease runs
164
+ // out; one that stops asking is let go when it does.
165
+ export const WORKSPACE_FOLLOW_MAX = 32;
166
+ export const WorkspaceFollowCheckoutSchema = z.object({
167
+ agent: ConversationIdSchema.describe("The conversation whose own copy holds the files."),
168
+ paths: z
169
+ .array(z.string().min(1))
170
+ .min(1)
171
+ .max(WORKSPACE_FOLLOW_MAX)
172
+ .describe("The files being looked at, as workspace paths. Their folders are watched, so a file not written yet is followed too."),
173
+ });
174
+ export const WorkspaceFollowLeaseSchema = z.object({
175
+ leaseMs: z
176
+ .number()
177
+ .int()
178
+ .positive()
179
+ .describe(
180
+ "How long the watch holds without another ask, in milliseconds. Ask again well before it runs out to keep following; a conversation working on the shared tree answers it too, since the shared watcher already covers it.",
181
+ ),
182
+ });
183
+
161
184
  // The box each picture or video is drawn in, asked of a folder's worth at once: a gallery lays its rows out from every
162
185
  // picture's shape before any of them has loaded, so a row never reflows under the reader as its pictures arrive.
163
186
  export const WORKSPACE_DIMENSIONS_MAX = 500;
@@ -53,6 +53,7 @@ const REQUIRED_SINCE_FLOOR = {
53
53
  derivedChanged: [`kind`, `paths`],
54
54
  reposChanged: [`kind`, `repos`],
55
55
  refsChanged: [`kind`, `repos`],
56
+ checkoutChanged: [`agent`, `kind`, `paths`],
56
57
  runtimeChanged: [`domains`, `kind`],
57
58
  presence: [`kind`, `users`],
58
59
  agents: [`agents`, `kind`, `rev`],
@@ -4,10 +4,19 @@
4
4
 
5
5
  // Broad on purpose, including invalid mentions: old turns persisted these candidates in the attachment field, and the
6
6
  // fold needs the same broad set to hide them.
7
+ // A loop rather than `/[.,;:!?)]+$/`, which rescans a long run of punctuation from every one of them.
8
+ const withoutTrailingPunctuation = (token: string): string => {
9
+ let end = token.length;
10
+ while (end > 0 && `.,;:!?)`.includes(token.charAt(end - 1))) {
11
+ end -= 1;
12
+ }
13
+ return token.slice(0, end);
14
+ };
15
+
7
16
  export const mentionedPathTokens = (text: string): string[] => {
8
17
  const paths = new Set<string>();
9
18
  for (const match of text.matchAll(/(?:^|\s)@([^\s@]+)/g)) {
10
- const token = (match[1] as string).replace(/[.,;:!?)]+$/, ``);
19
+ const token = withoutTrailingPunctuation(match[1] as string);
11
20
  if (token.includes(`/`) || token.includes(`.`)) {
12
21
  paths.add(token);
13
22
  }
@@ -115,6 +115,7 @@ describe("pages in the fold", () => {
115
115
 
116
116
  it("draws nothing for a draft: it is live state, never transcript", () => {
117
117
  expect(fold([{ kind: "page_draft", callId: "t1", at: 0, text: "<p>" }])).toEqual([]);
118
+ expect(fold([{ kind: "file_draft", callId: "t2", path: "a.md", op: "write", at: 0, text: "# A" }])).toEqual([]);
118
119
  });
119
120
 
120
121
  it("reads a dismissal, or a turn that died, as cancelled with no value", () => {
package/src/text/pages.ts CHANGED
@@ -15,7 +15,9 @@ export const SEALED_PAGE_POLICY = [
15
15
  `img-src data: blob:`,
16
16
  `font-src data:`,
17
17
  `media-src data: blob:`,
18
- `connect-src 'none'`,
18
+ // Reading back what the page already holds: `fetch()` on a data: or blob: URL (audio to decode, a file it built),
19
+ // which reaches no network. Every other address stays refused.
20
+ `connect-src data: blob:`,
19
21
  `frame-src 'none'`,
20
22
  `worker-src 'none'`,
21
23
  `object-src 'none'`,
@@ -49,6 +51,10 @@ export const PAGE_BRIDGE = {
49
51
  export const PAGE_ERRORS_MAX = 10;
50
52
  export const PAGE_ERROR_CHARS = 600;
51
53
 
54
+ // A request the page's policy refused is told after the error it causes (a fetch rejects first), so an error waits this
55
+ // long and names any refusal this close to it: "Failed to fetch" alone does not say the policy stopped it.
56
+ const REFUSAL_NEAR_MS = 100;
57
+
52
58
  // The width the chat's reply column usually is, which the check lays a page out at and measures it by.
53
59
  export const PAGE_COLUMN_WIDTH = 720;
54
60
 
@@ -198,7 +204,9 @@ var names=${JSON.stringify(PAGE_THEME_VARIABLES)};
198
204
  function apply(t){if(!t||typeof t!=="object"||!t.variables)return;var c=":root{color-scheme:"+(t.appearance==="light"?"light":"dark")+";";for(var i=0;i<names.length;i++){var v=t.variables[names[i]];if(typeof v==="string")c+=names[i]+":"+v.replace(/[;{}<>]/g,"")+";";}c+="}";if(style)style.textContent=c+${JSON.stringify(baseCss(false))}.replace("background:transparent;",canvas?"background:var(--background);":"background:transparent;");theme={appearance:t.appearance==="light"?"light":"dark",variables:t.variables};document.dispatchEvent(new CustomEvent("intentic:theme",{detail:theme}));}
199
205
  var framed=window.parent!==window;
200
206
  function post(m){if(framed)window.parent.postMessage(m,"*");}
201
- var told={},faults=0;function fault(t){t=String(t).slice(0,${PAGE_ERROR_CHARS});if(told[t]||faults>=${PAGE_ERRORS_MAX})return;told[t]=1;faults++;post({jsonrpc:"2.0",method:${JSON.stringify(PAGE_BRIDGE.error)},params:{message:t}});}
207
+ var told={},faults=0,refused=[];
208
+ document.addEventListener("securitypolicyviolation",function(e){refused.push({at:Date.now(),what:e.effectiveDirective+" refused "+String(e.blockedURI||"inline").slice(0,80)});if(refused.length>20)refused.shift();});
209
+ function fault(t){var at=Date.now();setTimeout(function(){var seen=[];for(var i=0;i<refused.length;i++){var r=refused[i];if(Math.abs(r.at-at)<=${REFUSAL_NEAR_MS}&&seen.indexOf(r.what)<0)seen.push(r.what);}t=String(t);if(seen.length)t+=" (the page's policy refused: "+seen.join("; ")+")";t=t.slice(0,${PAGE_ERROR_CHARS});if(told[t]||faults>=${PAGE_ERRORS_MAX})return;told[t]=1;faults++;post({jsonrpc:"2.0",method:${JSON.stringify(PAGE_BRIDGE.error)},params:{message:t}});},${REFUSAL_NEAR_MS});}
202
210
  function said(x,fallback){return x&&typeof x.stack==="string"?x.stack.split("\\n").slice(0,2).map(function(l){return l.trim();}).join(" "):fallback;}
203
211
  window.addEventListener("error",function(e){if(e instanceof ErrorEvent)fault(said(e.error,(e.message||"Script error")+(e.lineno?" (line "+e.lineno+")":"")));});
204
212
  window.addEventListener("unhandledrejection",function(e){fault("Unhandled rejection: "+said(e.reason,String(e.reason)));});
@@ -369,6 +369,7 @@ export class TranscriptFold {
369
369
  case "mode":
370
370
  case "agent_status":
371
371
  case "page_draft":
372
+ case "file_draft":
372
373
  case "done":
373
374
  return [];
374
375
  }