@intentic/sandbox-contract 1.393.0 → 1.394.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.
- package/README.md +8 -0
- package/dist/contracts/settings.contract.d.ts +8 -0
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.d.ts +3 -132
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +11 -2
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/index.d.ts +11 -132
- package/dist/index.d.ts.map +1 -1
- package/dist/schemas/metrics.d.ts +39 -2
- package/dist/schemas/metrics.d.ts.map +1 -1
- package/dist/schemas/metrics.js +40 -1
- package/dist/schemas/metrics.js.map +1 -1
- package/dist/schemas/settings.d.ts +8 -0
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +22 -0
- package/dist/schemas/settings.js.map +1 -1
- package/dist/state/definition.d.ts +16 -0
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/text/pages.d.ts.map +1 -1
- package/dist/text/pages.js +5 -2
- package/dist/text/pages.js.map +1 -1
- package/package.json +5 -5
- package/src/contracts/system.contract.ts +21 -2
- package/src/schemas/metrics.ts +83 -4
- package/src/schemas/settings.test.ts +9 -0
- package/src/schemas/settings.ts +37 -0
- package/src/text/pages.ts +10 -2
package/dist/text/pages.js
CHANGED
|
@@ -6,7 +6,7 @@ export const SEALED_PAGE_POLICY = [
|
|
|
6
6
|
`img-src data: blob:`,
|
|
7
7
|
`font-src data:`,
|
|
8
8
|
`media-src data: blob:`,
|
|
9
|
-
`connect-src
|
|
9
|
+
`connect-src data: blob:`,
|
|
10
10
|
`frame-src 'none'`,
|
|
11
11
|
`worker-src 'none'`,
|
|
12
12
|
`object-src 'none'`,
|
|
@@ -31,6 +31,7 @@ export const PAGE_BRIDGE = {
|
|
|
31
31
|
};
|
|
32
32
|
export const PAGE_ERRORS_MAX = 10;
|
|
33
33
|
export const PAGE_ERROR_CHARS = 600;
|
|
34
|
+
const REFUSAL_NEAR_MS = 100;
|
|
34
35
|
export const PAGE_COLUMN_WIDTH = 720;
|
|
35
36
|
export const PAGE_THEME_VARIABLES = [
|
|
36
37
|
`--background`,
|
|
@@ -147,7 +148,9 @@ var names=${JSON.stringify(PAGE_THEME_VARIABLES)};
|
|
|
147
148
|
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}));}
|
|
148
149
|
var framed=window.parent!==window;
|
|
149
150
|
function post(m){if(framed)window.parent.postMessage(m,"*");}
|
|
150
|
-
var told={},faults=0
|
|
151
|
+
var told={},faults=0,refused=[];
|
|
152
|
+
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();});
|
|
153
|
+
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});}
|
|
151
154
|
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;}
|
|
152
155
|
window.addEventListener("error",function(e){if(e instanceof ErrorEvent)fault(said(e.error,(e.message||"Script error")+(e.lineno?" (line "+e.lineno+")":"")));});
|
|
153
156
|
window.addEventListener("unhandledrejection",function(e){fault("Unhandled rejection: "+said(e.reason,String(e.reason)));});
|
package/dist/text/pages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../../src/text/pages.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIlD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,oBAAoB;IAGpB,0CAA0C;IAC1C,2BAA2B;IAC3B,qBAAqB;IACrB,gBAAgB;IAChB,uBAAuB;
|
|
1
|
+
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../../src/text/pages.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIlD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,oBAAoB;IAGpB,0CAA0C;IAC1C,2BAA2B;IAC3B,qBAAqB;IACrB,gBAAgB;IAChB,uBAAuB;IAGvB,yBAAyB;IACzB,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,oBAAoB;IACpB,iBAAiB;IACjB,qBAAqB;CACxB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAKb,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,UAAU,EAAE,eAAe;IAC3B,SAAS,EAAE,YAAY;IACvB,kBAAkB,EAAE,yBAAyB;IAC7C,kBAAkB,EAAE,yBAAyB;IAC7C,WAAW,EAAE,8BAA8B;IAC3C,WAAW,EAAE,+BAA+B;IAC5C,kBAAkB,EAAE,uCAAuC;IAC3D,SAAS,EAAE,6BAA6B;IACxC,UAAU,EAAE,8BAA8B;IAC1C,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE,YAAY;IACrB,MAAM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BAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACrB,CAAC;IAGD,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,SAAS,CAA2C,CAAC;IAC9F,OAAO,OAAO,IAAI,EAAE,MAAM,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5K,CAAC,CAAC;AAGF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentic/sandbox-contract",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.394.0",
|
|
4
4
|
"description": "oRPC wire contract for the intentic sandbox daemon, shared by the daemon and its browser client",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -362,10 +362,10 @@
|
|
|
362
362
|
}
|
|
363
363
|
},
|
|
364
364
|
"dependencies": {
|
|
365
|
-
"@intentic/base": "1.
|
|
366
|
-
"@intentic/constants": "1.
|
|
367
|
-
"@intentic/extension-manifest": "1.
|
|
368
|
-
"@intentic/registry": "1.
|
|
365
|
+
"@intentic/base": "1.394.0",
|
|
366
|
+
"@intentic/constants": "1.394.0",
|
|
367
|
+
"@intentic/extension-manifest": "1.394.0",
|
|
368
|
+
"@intentic/registry": "1.394.0",
|
|
369
369
|
"@orpc/contract": "1.16.1",
|
|
370
370
|
"zod": "4.6.7"
|
|
371
371
|
},
|
|
@@ -12,7 +12,15 @@ import {
|
|
|
12
12
|
} from "../schemas/devices.js";
|
|
13
13
|
import { EgressOwnerKeysReadSchema } from "../schemas/egress.js";
|
|
14
14
|
import { PresenceReportSchema } from "../schemas/logs.js";
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
CheckoutPressInputSchema,
|
|
17
|
+
CheckoutPressResultSchema,
|
|
18
|
+
DiskPressureSchema,
|
|
19
|
+
SandboxMetricsSchema,
|
|
20
|
+
StorageCleanInputSchema,
|
|
21
|
+
StorageCleanResultSchema,
|
|
22
|
+
StorageReportSchema,
|
|
23
|
+
} from "../schemas/metrics.js";
|
|
16
24
|
import { OkSchema } from "../schemas/shared.js";
|
|
17
25
|
import { DaemonSessionSchema, InfoSchema, ManifestProblemsSchema, ManifestRepairSchema } from "../schemas/system.js";
|
|
18
26
|
import { AutoUpdateInputSchema, AutoUpdateSchema, SkipUpdateInputSchema } from "../schemas/updates.js";
|
|
@@ -197,7 +205,7 @@ export const systemContract = {
|
|
|
197
205
|
path: "/system/disk-pressure",
|
|
198
206
|
summary: "How close the disk is to full",
|
|
199
207
|
description:
|
|
200
|
-
"The history volume's free space as the sandbox's disk watch last read it, a minute ago at most, and what it did about it: under 15% free it removes build output from checkouts whose conversation has nothing running, and under 10% and 5% it tells the owner. Also the biggest categories of the last storage scan, so a warning can say what is using the space.",
|
|
208
|
+
"The history volume's free space as the sandbox's disk watch last read it, a minute ago at most, and what it did about it: under the reaping threshold (15% free unless the settings say otherwise) it removes build output from checkouts whose conversation has nothing running, and under 10% and 5% it tells the owner. Also the biggest categories of the last storage scan, so a warning can say what is using the space.",
|
|
201
209
|
})
|
|
202
210
|
.meta({ floor: "maintainer" })
|
|
203
211
|
.output(DiskPressureSchema),
|
|
@@ -212,6 +220,17 @@ export const systemContract = {
|
|
|
212
220
|
})
|
|
213
221
|
.input(StorageCleanInputSchema)
|
|
214
222
|
.output(StorageCleanResultSchema),
|
|
223
|
+
// One conversation's checkout at a time, by the rules the sweeps apply: the Storage card's per-conversation rows.
|
|
224
|
+
pressCheckout: systemRoute
|
|
225
|
+
.route({
|
|
226
|
+
method: "POST",
|
|
227
|
+
path: "/system/storage/checkouts/press",
|
|
228
|
+
summary: "Free the space one conversation's checkout holds",
|
|
229
|
+
description:
|
|
230
|
+
"`cleanBuildOutput` removes the build output in one conversation's checkout, which its next build makes again. `release` commits what the checkout holds onto its branch and removes it and its overlay; the next turn brings them back. `trash` moves a checkout no conversation owns into the trash. Each is refused, with why, while the conversation's state forbids it: anything running in it, or work waiting that needs the checkout.",
|
|
231
|
+
})
|
|
232
|
+
.input(CheckoutPressInputSchema)
|
|
233
|
+
.output(CheckoutPressResultSchema),
|
|
215
234
|
// Control plane only; live I/O is /system/terminal WebSocket, exempt from the Bearer auth these routes take.
|
|
216
235
|
terminals: systemRoute
|
|
217
236
|
.route({
|
package/src/schemas/metrics.ts
CHANGED
|
@@ -261,6 +261,24 @@ export const StorageCategoryUsageSchema = z.object({
|
|
|
261
261
|
});
|
|
262
262
|
export type StorageCategoryUsage = z.infer<typeof StorageCategoryUsageSchema>;
|
|
263
263
|
|
|
264
|
+
// One conversation's directories on the history volume as the scan measured them (2026-11-03): every checkout, not the
|
|
265
|
+
// eight biggest a category lists, so the Storage card can say which conversation holds what.
|
|
266
|
+
// The checkout shapes are named, never inferred, like agent-press.ts's: spelled out inside the two storage routes they
|
|
267
|
+
// took the aggregated contract's type past what the declaration emitter will write (TS7056).
|
|
268
|
+
const CheckoutSizeFields = z.object({
|
|
269
|
+
id: z.string().describe("The directory's name under worktrees/ or overlays/: a conversation id, whether or not a conversation still owns it."),
|
|
270
|
+
bytes: z.number().describe("The checkout without its build output: the repositories' files and anything else its turns wrote there."),
|
|
271
|
+
buildOutputBytes: z.number().describe("Build output inside the checkout (a Rust `target/`, Gradle and Flutter output)."),
|
|
272
|
+
overlayBytes: z.number().describe("What its turns installed over the main tree's dependencies."),
|
|
273
|
+
});
|
|
274
|
+
export interface CheckoutSize {
|
|
275
|
+
readonly id: string;
|
|
276
|
+
readonly bytes: number;
|
|
277
|
+
readonly buildOutputBytes: number;
|
|
278
|
+
readonly overlayBytes: number;
|
|
279
|
+
}
|
|
280
|
+
export const CheckoutSizeSchema: z.ZodType<CheckoutSize, CheckoutSize> = CheckoutSizeFields;
|
|
281
|
+
|
|
264
282
|
export const StorageScanSchema = z.object({
|
|
265
283
|
startedAt: z.number().describe("When the scan began, in milliseconds."),
|
|
266
284
|
finishedAt: z.number().describe("When it ended, in milliseconds: the moment these sizes describe."),
|
|
@@ -275,11 +293,44 @@ export const StorageScanSchema = z.object({
|
|
|
275
293
|
.optional()
|
|
276
294
|
.describe("The volume as a whole. Absent when the volume would not say."),
|
|
277
295
|
categories: z.array(StorageCategoryUsageSchema).describe("Every category that holds anything, largest first."),
|
|
296
|
+
checkouts: z
|
|
297
|
+
.array(CheckoutSizeSchema)
|
|
298
|
+
.optional()
|
|
299
|
+
.describe("Every conversation directory on the history volume, largest first. Absent from a scan made before this was measured."),
|
|
278
300
|
unreadable: z.number().describe("Files and folders the scan could not read, and so did not count."),
|
|
279
301
|
});
|
|
280
302
|
export type StorageScan = z.infer<typeof StorageScanSchema>;
|
|
281
303
|
|
|
282
|
-
|
|
304
|
+
// Where a measured checkout stands now, for what may be done with it: `working` has a turn, a background command or a
|
|
305
|
+
// child at work in it; `held` has work nobody has landed; `archived` is a conversation put away whose checkout is still
|
|
306
|
+
// on disk; `leftover` is a directory no conversation owns.
|
|
307
|
+
export type CheckoutState = "working" | "idle" | "held" | "landed" | "archived" | "leftover";
|
|
308
|
+
export const CheckoutStateSchema: z.ZodType<CheckoutState, CheckoutState> = z.enum(["working", "idle", "held", "landed", "archived", "leftover"]);
|
|
309
|
+
|
|
310
|
+
export interface CheckoutUsage extends CheckoutSize {
|
|
311
|
+
readonly state: CheckoutState;
|
|
312
|
+
readonly title?: string | undefined;
|
|
313
|
+
readonly updatedAt?: number | undefined;
|
|
314
|
+
readonly can: { readonly cleanBuildOutput: boolean; readonly release: boolean; readonly trash: boolean };
|
|
315
|
+
}
|
|
316
|
+
export const CheckoutUsageSchema: z.ZodType<CheckoutUsage, CheckoutUsage> = CheckoutSizeFields.extend({
|
|
317
|
+
state: CheckoutStateSchema,
|
|
318
|
+
title: z.string().optional().describe("The conversation's title, when it has one."),
|
|
319
|
+
updatedAt: z.number().optional().describe("When the conversation last moved, in milliseconds. Absent for a leftover."),
|
|
320
|
+
can: z
|
|
321
|
+
.object({
|
|
322
|
+
cleanBuildOutput: z.boolean().describe("Its build output may be removed now: it has some, and nothing runs in the conversation."),
|
|
323
|
+
release: z
|
|
324
|
+
.boolean()
|
|
325
|
+
.describe(
|
|
326
|
+
"Its checkout may be freed now: what it holds is committed onto its branch, the checkout and overlay go, and its next turn brings them back.",
|
|
327
|
+
),
|
|
328
|
+
trash: z.boolean().describe("A leftover that may be moved to the trash now, where it waits a while before it is emptied."),
|
|
329
|
+
})
|
|
330
|
+
.describe("What may be done with it now, by the same rules the daemon applies when asked."),
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
const StorageReportFields = z.object({
|
|
283
334
|
scan: StorageScanSchema.optional().describe(
|
|
284
335
|
"The last scan that finished, kept across restarts; its `finishedAt` says how old it is. Absent until one has.",
|
|
285
336
|
),
|
|
@@ -303,12 +354,40 @@ export const StorageReportSchema = z.object({
|
|
|
303
354
|
)
|
|
304
355
|
.optional()
|
|
305
356
|
.describe("Live repositories' checkout costs, cached per repository and commit. Repositories without a readable HEAD are omitted."),
|
|
357
|
+
checkouts: z
|
|
358
|
+
.array(CheckoutUsageSchema)
|
|
359
|
+
.optional()
|
|
360
|
+
.describe(
|
|
361
|
+
"The last scan's conversation directories, largest first, each with where its conversation stands now. Sizes are as of the scan; a directory gone since is left out. Absent until a scan has measured them.",
|
|
362
|
+
),
|
|
363
|
+
});
|
|
364
|
+
// An interface, named like the checkout shapes above: the report is the output of two routes, each of which spelled it
|
|
365
|
+
// out whole, and an alias of the inferred type is spelled out all the same.
|
|
366
|
+
export interface StorageReport extends z.infer<typeof StorageReportFields> {}
|
|
367
|
+
export const StorageReportSchema: z.ZodType<StorageReport, StorageReport> = StorageReportFields;
|
|
368
|
+
|
|
369
|
+
export type CheckoutPress = "cleanBuildOutput" | "release" | "trash";
|
|
370
|
+
export interface CheckoutPressInput {
|
|
371
|
+
readonly id: string;
|
|
372
|
+
readonly press: CheckoutPress;
|
|
373
|
+
}
|
|
374
|
+
export const CheckoutPressInputSchema: z.ZodType<CheckoutPressInput, CheckoutPressInput> = z.object({
|
|
375
|
+
id: z.string().describe("The conversation id the directory is named by."),
|
|
376
|
+
press: z.enum(["cleanBuildOutput", "release", "trash"]).describe("What to do with it, as the row's `can` allows."),
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
export interface CheckoutPressResult {
|
|
380
|
+
readonly id: string;
|
|
381
|
+
readonly removed: readonly string[];
|
|
382
|
+
}
|
|
383
|
+
export const CheckoutPressResultSchema: z.ZodType<CheckoutPressResult, CheckoutPressResult> = z.object({
|
|
384
|
+
id: z.string(),
|
|
385
|
+
removed: z.array(z.string()).describe("Build output folders removed, relative to the checkout; empty for a release or a trash."),
|
|
306
386
|
});
|
|
307
|
-
export type StorageReport = z.infer<typeof StorageReportSchema>;
|
|
308
387
|
|
|
309
388
|
// How close the history volume is to full, as the daemon's disk-pressure watch last read it (GET /system/disk-pressure).
|
|
310
|
-
// `reaping`: under 15%
|
|
311
|
-
// 5%, which the owner is told about once each.
|
|
389
|
+
// `reaping`: under the settings' `diskReapBelowPercent` free (15% by default), settled checkouts' build output is being
|
|
390
|
+
// removed; `low` and `critical` are under 10% and 5%, which the owner is told about once each.
|
|
312
391
|
export const DiskPressureLevelSchema = z.enum(["ok", "reaping", "low", "critical"]);
|
|
313
392
|
export type DiskPressureLevel = z.infer<typeof DiskPressureLevelSchema>;
|
|
314
393
|
|
|
@@ -218,6 +218,15 @@ test("disk retention defaults bound checkouts and restore points while preservin
|
|
|
218
218
|
expect(existing.retention.restorePointKeepDays).toBe(0);
|
|
219
219
|
});
|
|
220
220
|
|
|
221
|
+
test("build output defaults: six idle hours, reaping under 15% free, full debug info", () => {
|
|
222
|
+
const defaults = SandboxSettingsSchema.parse({});
|
|
223
|
+
expect(defaults.buildOutputIdleHours).toBe(6);
|
|
224
|
+
expect(defaults.diskReapBelowPercent).toBe(15);
|
|
225
|
+
expect(defaults.leanRustBuilds).toBe(false);
|
|
226
|
+
expect(SandboxSettingsSchema.safeParse({ buildOutputIdleHours: 0 }).success).toBe(false);
|
|
227
|
+
expect(SandboxSettingsSchema.safeParse({ diskReapBelowPercent: 4 }).success).toBe(false);
|
|
228
|
+
});
|
|
229
|
+
|
|
221
230
|
describe(`restore points' retention, renamed so a stored zero is the owner's own (2026-10-18)`, () => {
|
|
222
231
|
const read = (retention: Record<string, unknown>) => {
|
|
223
232
|
const converted = convertDocument(SETTINGS_HISTORY, `object`, { retention: { transcriptDays: 7, ...retention } }, true);
|
package/src/schemas/settings.ts
CHANGED
|
@@ -440,6 +440,43 @@ export const SandboxSettingsSchema = z.object({
|
|
|
440
440
|
),
|
|
441
441
|
agentRetentionDays: AgentRetentionDaysSchema,
|
|
442
442
|
heldCheckoutDays: HeldCheckoutDaysSchema,
|
|
443
|
+
// The build-output sweep's clock (conversations/registry/archive.ts). Hours, not days: a Rust `target/` is 10-30 GB,
|
|
444
|
+
// so the window is about how long a follow-up should find a warm build, not about keeping anybody's work.
|
|
445
|
+
buildOutputIdleHours: z
|
|
446
|
+
.number()
|
|
447
|
+
.int()
|
|
448
|
+
.min(1)
|
|
449
|
+
.max(168)
|
|
450
|
+
.default(6)
|
|
451
|
+
.describe(
|
|
452
|
+
"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.",
|
|
453
|
+
),
|
|
454
|
+
// disk-pressure.ts's reaping threshold. Under 10% and 5% the owner is told whatever this says.
|
|
455
|
+
diskReapBelowPercent: z
|
|
456
|
+
.number()
|
|
457
|
+
.int()
|
|
458
|
+
.min(5)
|
|
459
|
+
.max(50)
|
|
460
|
+
.default(15)
|
|
461
|
+
.describe(
|
|
462
|
+
"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.",
|
|
463
|
+
),
|
|
464
|
+
// Read live into every turn's shell (agent/run/harness/turn-env.ts); off by default, since it overrides what a
|
|
465
|
+
// repository's own Cargo.toml asks of its debug info.
|
|
466
|
+
leanRustBuilds: z
|
|
467
|
+
.boolean()
|
|
468
|
+
.default(false)
|
|
469
|
+
.describe(
|
|
470
|
+
"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.",
|
|
471
|
+
),
|
|
472
|
+
// A prototype, off by default (2026-11-04): an isolated checkout's Cargo `target/` laid over a frozen copy of the main
|
|
473
|
+
// checkout's, so each checkout keeps only what it compiled differently (conversations/worktrees/cargo-warm.ts).
|
|
474
|
+
sharedCargoTargets: z
|
|
475
|
+
.boolean()
|
|
476
|
+
.default(false)
|
|
477
|
+
.describe(
|
|
478
|
+
"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.",
|
|
479
|
+
),
|
|
443
480
|
// One answer per ending, never a set of switches over the same event: the chat's own question and these rows are
|
|
444
481
|
// the same question at two scopes. Every ending defaults to `wait`, because a re-run spends the reader's allowance
|
|
445
482
|
// on a turn they sent once.
|
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
|
-
`
|
|
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
|
|
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)));});
|