@intentic/sandbox-contract 1.259.0 → 1.263.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 (35) hide show
  1. package/dist/contracts/personas.contract.d.ts +26 -0
  2. package/dist/contracts/personas.contract.d.ts.map +1 -1
  3. package/dist/contracts/system.contract.d.ts +30 -30
  4. package/dist/contracts/workspace.contract.d.ts +38 -0
  5. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  6. package/dist/contracts/workspace.contract.js +19 -1
  7. package/dist/contracts/workspace.contract.js.map +1 -1
  8. package/dist/index.d.ts +66 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +2 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/protocol/edge-verdict.d.ts +7 -0
  13. package/dist/protocol/edge-verdict.d.ts.map +1 -0
  14. package/dist/protocol/edge-verdict.js +14 -0
  15. package/dist/protocol/edge-verdict.js.map +1 -0
  16. package/dist/schemas/personas.d.ts +40 -0
  17. package/dist/schemas/personas.d.ts.map +1 -1
  18. package/dist/schemas/personas.js +8 -0
  19. package/dist/schemas/personas.js.map +1 -1
  20. package/dist/schemas/turn-briefing.d.ts +26 -0
  21. package/dist/schemas/turn-briefing.d.ts.map +1 -0
  22. package/dist/schemas/turn-briefing.js +70 -0
  23. package/dist/schemas/turn-briefing.js.map +1 -0
  24. package/dist/schemas/workspace-tree.d.ts +39 -0
  25. package/dist/schemas/workspace-tree.d.ts.map +1 -1
  26. package/dist/schemas/workspace-tree.js +34 -0
  27. package/dist/schemas/workspace-tree.js.map +1 -1
  28. package/package.json +15 -4
  29. package/src/contracts/workspace.contract.ts +24 -0
  30. package/src/index.ts +2 -0
  31. package/src/protocol/edge-verdict.ts +45 -0
  32. package/src/protocol/ingress-contract.ts +2 -1
  33. package/src/schemas/personas.ts +17 -0
  34. package/src/schemas/turn-briefing.ts +103 -0
  35. package/src/schemas/workspace-tree.ts +42 -0
@@ -3,6 +3,7 @@ import { readyChain } from "../models/model-pins.js";
3
3
  import { ModelPinSchema } from "./agent.js";
4
4
  import { entryId } from "./internal.js";
5
5
  import { SkillDraftSchema, SkillNameSchema, SystemPromptModeSchema } from "./settings.js";
6
+ import { TurnBriefingNoteIdSchema } from "./turn-briefing.js";
6
7
  export const PersonaPowersSchema = z.object({
7
8
  files: z
8
9
  .enum(["none", "read", "write"])
@@ -34,6 +35,12 @@ export const PersonaContextSchema = z.object({
34
35
  .max(50)
35
36
  .describe("Which nested repositories a conversation wearing this card carries, by workspace-relative path. The workspace itself is always carried; empty means the workspace alone."),
36
37
  });
38
+ export const PersonaBriefingSchema = z.object({
39
+ omit: z
40
+ .array(TurnBriefingNoteIdSchema)
41
+ .max(20)
42
+ .describe("Which of the notes the sandbox prepends to each message a conversation wearing this card does NOT get. Everything not named here is sent as usual; the notes that keep a turn inside its own branch or explain a missing account cannot be named at all."),
43
+ });
37
44
  export const PersonaSchema = z.object({
38
45
  id: entryId.describe("The persona's id."),
39
46
  label: z.string().max(60).optional().describe("What to call it on screen. Absent falls back to the id, which somebody chose anyway."),
@@ -49,6 +56,7 @@ export const PersonaSchema = z.object({
49
56
  powers: PersonaPowersSchema.optional().describe("What a conversation wearing it may do. Absent means the full toolbox, so a card written before this existed behaves exactly as it did."),
50
57
  workspace: PersonaWorkspaceSchema.optional().describe("Where it works. Absent means the whole workspace."),
51
58
  context: PersonaContextSchema.optional().describe("Which part of the workspace a conversation wearing it carries: the repositories its checkout holds. Absent means every repository."),
59
+ briefing: PersonaBriefingSchema.optional().describe("Which of the notes the sandbox prepends to every message this card's conversations do without. Absent means all of them, which is what a card written before this existed keeps."),
52
60
  models: z
53
61
  .array(ModelPinSchema)
54
62
  .max(10)
@@ -1 +1 @@
1
- {"version":3,"file":"personas.js","sourceRoot":"","sources":["../../src/schemas/personas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,UAAU,EAAE,MAAM,yB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QAAQ,CAAC,4BAA4B,CAAC;CAC1D,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+ export declare const TurnBriefingNoteIdSchema: z.ZodEnum<{
3
+ checks: "checks";
4
+ context: "context";
5
+ delegation: "delegation";
6
+ dependencies: "dependencies";
7
+ handoff: "handoff";
8
+ map: "map";
9
+ repoSync: "repoSync";
10
+ search: "search";
11
+ skills: "skills";
12
+ }>;
13
+ export type TurnBriefingNoteId = z.infer<typeof TurnBriefingNoteIdSchema>;
14
+ export interface TurnBriefingNote {
15
+ readonly id: TurnBriefingNoteId;
16
+ readonly label: string;
17
+ readonly when: string;
18
+ readonly cost: string;
19
+ }
20
+ export declare const TURN_BRIEFING_NOTES: readonly TurnBriefingNote[];
21
+ export interface TurnBriefingFixture {
22
+ readonly label: string;
23
+ readonly why: string;
24
+ }
25
+ export declare const TURN_BRIEFING_FIXTURES: readonly TurnBriefingFixture[];
26
+ //# sourceMappingURL=turn-briefing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-briefing.d.ts","sourceRoot":"","sources":["../../src/schemas/turn-briefing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,wBAAwB;;;;;;;;;;EAAgH,CAAC;AACtJ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,EAAE,EAAE,kBAAkB,CAAC;IAGhC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAGvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAGtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AAID,eAAO,MAAM,mBAAmB,EAAE,SAAS,gBAAgB,EAuD1D,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACxB;AAKD,eAAO,MAAM,sBAAsB,EAAE,SAAS,mBAAmB,EAUhE,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { z } from "zod";
2
+ export const TurnBriefingNoteIdSchema = z.enum(["map", "context", "skills", "search", "delegation", "checks", "dependencies", "repoSync", "handoff"]);
3
+ export const TURN_BRIEFING_NOTES = [
4
+ {
5
+ id: "map",
6
+ label: "Map of this project",
7
+ when: "First message of a conversation, when the sandbox's own map setting is on.",
8
+ cost: "The agent finds the layout by listing directories instead, which costs tool calls on the first task.",
9
+ },
10
+ {
11
+ id: "context",
12
+ label: "Context of this session",
13
+ when: "First message, and again after a compaction, for a card that carries only some repositories.",
14
+ cost: "A repository this card leaves out of the checkout reads as deleted rather than absent, so the agent may try to restore it.",
15
+ },
16
+ {
17
+ id: "skills",
18
+ label: "Skills available in this workspace",
19
+ when: "First message, on a runtime that cannot read the skills folder for itself.",
20
+ cost: "On those runtimes the agent never learns its skills exist, so it will not load one.",
21
+ },
22
+ {
23
+ id: "search",
24
+ label: "Using iq for workspace search",
25
+ when: "First message, when the workspace search setting is on and the runtime has no plugin seam.",
26
+ cost: "The agent falls back to grep-style searching, which it can already do.",
27
+ },
28
+ {
29
+ id: "delegation",
30
+ label: "Spawning child agents",
31
+ when: "First message, on a shell-only runtime, for a card that may delegate.",
32
+ cost: "The agent does the work itself rather than handing parts of it to other conversations.",
33
+ },
34
+ {
35
+ id: "checks",
36
+ label: "Automatic end-of-turn checks",
37
+ when: "First message, and again after a compaction, when you have rules that run at the end of a turn.",
38
+ cost: "Your checks still run; the agent just does not know they are coming, so a failure arrives as a surprise it has to re-read the turn to understand.",
39
+ },
40
+ {
41
+ id: "dependencies",
42
+ label: "Dependencies aren't installed yet",
43
+ when: 'Any turn where a project under the workspace has dependencies missing, or behind what it pins — the second reads "Dependencies are behind" and this covers both.',
44
+ cost: "An unresolved import reads as broken code, and the agent may edit working source to satisfy it.",
45
+ },
46
+ {
47
+ id: "repoSync",
48
+ label: "Repos synced with their remotes",
49
+ when: "A turn on the shared tree where a repository actually moved.",
50
+ cost: "Files changed under the agent between turns with nothing saying so.",
51
+ },
52
+ {
53
+ id: "handoff",
54
+ label: "Where the work stands",
55
+ when: "A turn that starts a fresh session on an existing conversation: a runtime change, or a context limit.",
56
+ cost: "The largest of these. Without it a re-seeded session has the transcript but none of the sandbox's own readings of the tree, the proof and the checklist, so it re-derives them.",
57
+ },
58
+ ];
59
+ export const TURN_BRIEFING_FIXTURES = [
60
+ { label: "Where this turn's files live", why: "Without it a runtime that is only cwd'd into its branch writes into the shared checkout." },
61
+ { label: "Who this turn is acting as", why: "The card's own identity, on the runtimes that have nowhere else to put it." },
62
+ { label: "Standing instructions for this workspace", why: "Your own AGENTS.md rules. Replace them by giving this card its own system prompt." },
63
+ {
64
+ label: "Some connected accounts need a person's approval",
65
+ why: "Names who to ask; without it a withheld account reads as simply not connected.",
66
+ },
67
+ { label: "This turn reaches no signed-in account", why: "The other reason an account can be missing, which nothing else says out loud." },
68
+ { label: "How to read this message", why: "Keeps a message that opens with a slash from being eaten by the runtime's own command parser." },
69
+ ];
70
+ //# sourceMappingURL=turn-briefing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-briefing.js","sourceRoot":"","sources":["../../src/schemas/turn-briefing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;AAkBtJ,MAAM,CAAC,MAAM,mBAAmB,GAAgC;IAC5D;QACI,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,qBAAqB;QAC5B,IAAI,EAAE,4EAA4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AkD;QACzD,GAAG,EAAE,gFAAgF;KACxF;IACD,EAAE,KAAK,EAAE,wCAAwC,EAAE,GAAG,EAAE,+EAA+E,EAAE;IACzI,EAAE,KAAK,EAAE,0BAA0B,EAAE,GAAG,EAAE,+FAA+F,EAAE;CAC9I,CAAC"}
@@ -83,6 +83,45 @@ export declare const WorkspaceFileSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
83
83
  present: z.ZodLiteral<false>;
84
84
  path: z.ZodString;
85
85
  }, z.core.$strip>], "present">;
86
+ export declare const WorkspaceDerivedQuerySchema: z.ZodObject<{
87
+ path: z.ZodString;
88
+ }, z.core.$strip>;
89
+ export declare const WorkspaceDerivedPresentSchema: z.ZodObject<{
90
+ present: z.ZodLiteral<true>;
91
+ path: z.ZodString;
92
+ content: z.ZodString;
93
+ deriver: z.ZodString;
94
+ derivedAt: z.ZodOptional<z.ZodString>;
95
+ title: z.ZodOptional<z.ZodString>;
96
+ notes: z.ZodArray<z.ZodString>;
97
+ tokens: z.ZodNumber;
98
+ truncated: z.ZodBoolean;
99
+ stale: z.ZodBoolean;
100
+ }, z.core.$strip>;
101
+ export declare const WorkspaceDerivedAbsentSchema: z.ZodObject<{
102
+ present: z.ZodLiteral<false>;
103
+ path: z.ZodString;
104
+ derivable: z.ZodBoolean;
105
+ reason: z.ZodOptional<z.ZodString>;
106
+ }, z.core.$strip>;
107
+ export declare const WorkspaceDerivedSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
108
+ present: z.ZodLiteral<true>;
109
+ path: z.ZodString;
110
+ content: z.ZodString;
111
+ deriver: z.ZodString;
112
+ derivedAt: z.ZodOptional<z.ZodString>;
113
+ title: z.ZodOptional<z.ZodString>;
114
+ notes: z.ZodArray<z.ZodString>;
115
+ tokens: z.ZodNumber;
116
+ truncated: z.ZodBoolean;
117
+ stale: z.ZodBoolean;
118
+ }, z.core.$strip>, z.ZodObject<{
119
+ present: z.ZodLiteral<false>;
120
+ path: z.ZodString;
121
+ derivable: z.ZodBoolean;
122
+ reason: z.ZodOptional<z.ZodString>;
123
+ }, z.core.$strip>], "present">;
124
+ export type WorkspaceDerived = z.infer<typeof WorkspaceDerivedSchema>;
86
125
  export declare const WorkspaceResolveQuerySchema: z.ZodObject<{
87
126
  agent: z.ZodOptional<z.ZodString>;
88
127
  path: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-tree.d.ts","sourceRoot":"","sources":["../../src/schemas/workspace-tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB;;iBAI/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAOlE,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;CACrD;AACD,eAAO,MAAM,mBAAmB;;;;;;iBAU9B,CAAC;AACH,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEvC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAE1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,kBAAkB,EAAE,GAAG,SAAS,CAAC;CACjE;AACD,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAkBjE,CAAC;AACH,eAAO,MAAM,mBAAmB;;;;;iBAW9B,CAAC;AACH,M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;;;;;iBAarC,CAAC;AAGH,eAAO,MAAM,yBAAyB;;;iBAOpC,CAAC;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;8BAA2F,CAAC;AAI5H,eAAO,MAAM,2BAA2B;;iBAKtC,CAAC;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;iBAmBxC,CAAC;AACH,eAAO,MAAM,4BAA4B;;;;;iBAUvC,CAAC;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;8BAAiG,CAAC;AACrI,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGtE,eAAO,MAAM,2BAA2B;;;iBAQtC,CAAC;AACH,eAAO,MAAM,sBAAsB;;iBAEjC,CAAC;AAGH,eAAO,MAAM,kBAAkB;;iBAAoH,CAAC;AACpJ,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAC;AAGH,eAAO,MAAM,qBAAqB;;;;;;EAAsE,CAAC;AACzG,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;iBAYxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
@@ -93,6 +93,40 @@ export const WorkspaceFileAbsentSchema = z.object({
93
93
  path: z.string().describe("The path, as asked for."),
94
94
  });
95
95
  export const WorkspaceFileSchema = z.discriminatedUnion("present", [WorkspaceFilePresentSchema, WorkspaceFileAbsentSchema]);
96
+ export const WorkspaceDerivedQuerySchema = z.object({
97
+ path: z
98
+ .string()
99
+ .min(1)
100
+ .describe("The file you want the text of, as a workspace path. The real file, not its shadow: where the text is kept is this route's business."),
101
+ });
102
+ export const WorkspaceDerivedPresentSchema = z.object({
103
+ present: z.literal(true).describe("There is derived text for that file."),
104
+ path: z.string().describe("The file it was derived from, as asked for."),
105
+ content: z.string().describe("The text itself, as markdown."),
106
+ deriver: z.string().describe("Which reader wrote it, and at which version, such as `pdf+ocr v1`. A file re-derives when this changes."),
107
+ derivedAt: z.string().optional().describe("When it was written, as an ISO timestamp. Absent only for a shadow whose front matter was edited by hand."),
108
+ title: z.string().optional().describe("The title the format carried, where it carried one."),
109
+ notes: z
110
+ .array(z.string())
111
+ .describe("Every cap and degradation the derivation hit: a sheet cut to 200 rows, a book cut at 2 MB, a scan recognised rather than read. Show these with the text, since text that was cut reading as complete is the one failure this whole feature cannot afford."),
112
+ tokens: z.number().describe("Roughly what an agent spends reading it, by the same four-chars-a-token estimate every budget here uses."),
113
+ truncated: z.boolean().describe("Whether this is only the start of the shadow, cut to keep the response sendable. The file on disk holds the rest."),
114
+ stale: z
115
+ .boolean()
116
+ .describe("Whether the file has changed since this text was derived, compared by content rather than by clock. True means you are reading a rendering of an older version of the file, and deriving it again catches it up."),
117
+ });
118
+ export const WorkspaceDerivedAbsentSchema = z.object({
119
+ present: z.literal(false).describe("There is no derived text for that file, which is the ordinary answer while background derivation is switched off."),
120
+ path: z.string().describe("The file, as asked for."),
121
+ derivable: z
122
+ .boolean()
123
+ .describe("Whether this format can be turned into text at all. True means asking for it to be derived is worth offering; false means nothing here reads this format."),
124
+ reason: z
125
+ .string()
126
+ .optional()
127
+ .describe("Why there is none, when deriving was just attempted and produced nothing: the file is too large, corrupt, or of a format no reader claims."),
128
+ });
129
+ export const WorkspaceDerivedSchema = z.discriminatedUnion("present", [WorkspaceDerivedPresentSchema, WorkspaceDerivedAbsentSchema]);
96
130
  export const WorkspaceResolveQuerySchema = WorkspaceScopeSchema.extend({
97
131
  path: z
98
132
  .string()
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-tree.js","sourceRoot":"","sources":["../../src/schemas/workspace-tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGlD,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,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iEAAiE,CAAC,EAAE,CAAC,CAAC;AACpJ,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IAC9E,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kFAAkF,CAAC;CACrH,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAEzG,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,eAAe,EAAE,CAAC;SACb,KAAK,CACF,CAAC,CAAC,MAAM,CAAC;QACL,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;QAChD,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QAC1E,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qFAAqF,CAAC;KACrH,CAAC,CACL;SACA,QAAQ,CACL,qIAAqI,CACxI;CACR,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentic/sandbox-contract",
3
- "version": "1.259.0",
3
+ "version": "1.263.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",
@@ -95,6 +95,17 @@
95
95
  "default": "./dist/ids/tunnel-ids.js"
96
96
  }
97
97
  },
98
+ "./edge-verdict": {
99
+ "types": "./dist/protocol/edge-verdict.d.ts",
100
+ "import": {
101
+ "@intentic/src": "./src/protocol/edge-verdict.ts",
102
+ "default": "./dist/protocol/edge-verdict.js"
103
+ },
104
+ "require": {
105
+ "@intentic/src": "./src/protocol/edge-verdict.ts",
106
+ "default": "./dist/protocol/edge-verdict.js"
107
+ }
108
+ },
98
109
  "./ingress-contract": {
99
110
  "types": "./dist/protocol/ingress-contract.d.ts",
100
111
  "import": {
@@ -185,9 +196,9 @@
185
196
  }
186
197
  },
187
198
  "dependencies": {
188
- "@intentic/constants": "1.259.0",
189
- "@intentic/extension-manifest": "1.259.0",
190
- "@intentic/registry": "1.259.0",
199
+ "@intentic/constants": "1.263.0",
200
+ "@intentic/extension-manifest": "1.263.0",
201
+ "@intentic/registry": "1.263.0",
191
202
  "@orpc/contract": "1.14.13",
192
203
  "tslib": "2.8.1",
193
204
  "zod": "4.5.4"
@@ -21,6 +21,8 @@ import {
21
21
  WorkspaceChildrenQuerySchema,
22
22
  WorkspaceChildrenSchema,
23
23
  WorkspaceClassificationSchema,
24
+ WorkspaceDerivedQuerySchema,
25
+ WorkspaceDerivedSchema,
24
26
  WorkspaceDirSchema,
25
27
  WorkspaceFileQuerySchema,
26
28
  WorkspaceFileReadQuerySchema,
@@ -71,6 +73,28 @@ export const workspaceContract = {
71
73
  })
72
74
  .input(WorkspaceFileReadQuerySchema)
73
75
  .output(WorkspaceFileSchema),
76
+ // The markdown shadow fileq keeps of a binary file; the read is a plain file read, no derivation triggered.
77
+ derived: oc
78
+ .route({
79
+ method: "GET",
80
+ path: "/workspace/derived",
81
+ summary: "Read a file's derived text",
82
+ description:
83
+ "What a document, picture, recording or archive says, as text, from the shadow the sandbox keeps beside it. This is the same rendering an agent reads instead of the bytes, so it is also the way to check what one is working from. Nothing is derived here: a file with no shadow yet answers that it has none, and whether it could have one.",
84
+ })
85
+ .input(WorkspaceDerivedQuerySchema)
86
+ .output(WorkspaceDerivedSchema),
87
+ // The lazy path, on demand: same convergence the background sweep runs, for one file someone is looking at.
88
+ derive: oc
89
+ .route({
90
+ method: "POST",
91
+ path: "/workspace/derive",
92
+ summary: "Derive a file's text now",
93
+ description:
94
+ "Renders one file to text and answers with the result, for when its shadow is missing or you want it rebuilt. The same work the background pass does when that setting is on, so this is how a reader gets the text without turning it on for the whole workspace. Costs a parse of exactly one file; a format nothing can read says so rather than failing.",
95
+ })
96
+ .input(WorkspaceDerivedQuerySchema)
97
+ .output(WorkspaceDerivedSchema),
74
98
  // Mints the ticket GET /workspace/media (a plain Hono byte-range route, no oRPC shape) requires to stream.
75
99
  mediaTicket: oc
76
100
  .route({
package/src/index.ts CHANGED
@@ -65,6 +65,7 @@ export { inventoryContract } from "./contracts/inventory.contract.js";
65
65
  export { issuesContract } from "./contracts/issues.contract.js";
66
66
  export { logsContract } from "./contracts/logs.contract.js";
67
67
  export { REQUEST_ID_EVIDENCE_ROUTE, REQUEST_ID_HEADER } from "./protocol/request-id.js";
68
+ export * from "./protocol/edge-verdict.js";
68
69
  export { loopsContract } from "./contracts/loops.contract.js";
69
70
  export { panelsContract } from "./contracts/panels.contract.js";
70
71
  export { portsContract } from "./contracts/ports.contract.js";
@@ -175,6 +176,7 @@ export * from "./schemas/share.js";
175
176
  export * from "./schemas/shared.js";
176
177
  export * from "./schemas/system.js";
177
178
  export * from "./schemas/terminal.js";
179
+ export * from "./schemas/turn-briefing.js";
178
180
  export * from "./schemas/usage.js";
179
181
  export * from "./schemas/vpn.js";
180
182
  export * from "./schemas/webext.js";
@@ -0,0 +1,45 @@
1
+ // Why the edge could not carry a request to a sandbox, in words a browser may read. The edge is the only party that
2
+ // can tell "this box is not dialled in" from "your network is down", and a cross-origin error is invisible to
3
+ // JavaScript unless the responder allows it — so the verdict rides an exposed header and the edge CORS-allows its own
4
+ // errors. Ingress writes it, the editor's connection machine reads it; both sides import this file so they cannot drift.
5
+
6
+ export const EDGE_VERDICT_HEADER = "x-intentic-edge";
7
+
8
+ export type EdgeVerdict =
9
+ // No tunnel is registered for this sandbox: its container is not running, or the machine it runs on is off.
10
+ // Retrying is right — a container that comes back redials within seconds.
11
+ | "no-tunnel"
12
+ // The platform has no such sandbox. The row is deleted, no tunnel for this id will ever be accepted again, and
13
+ // nothing the reader waits for can change that.
14
+ | "unknown-sandbox"
15
+ // A tunnel was held and the forward failed mid-flight: the box went away between being routed to and answering.
16
+ | "dropped";
17
+
18
+ const VERDICTS: ReadonlySet<string> = new Set(["no-tunnel", "unknown-sandbox", "dropped"]);
19
+
20
+ // A header value only counts when it is one of ours: a 502 from anything else on the path (a corporate proxy, a CDN)
21
+ // carries no verdict and must not be read as one.
22
+ export const edgeVerdictOf = (value: string | null | undefined): EdgeVerdict | undefined =>
23
+ typeof value === "string" && VERDICTS.has(value) ? (value as EdgeVerdict) : undefined;
24
+
25
+ // Whether a sandbox can still come back on its own, which decides whether the reader is told to wait or told to act.
26
+ export const edgeVerdictIsFinal = (verdict: EdgeVerdict): boolean => verdict === "unknown-sandbox";
27
+
28
+ // The edge's own error responses, and only those, are readable by any origin: each carries one constant sentence, no
29
+ // credential is ever accepted on them, and nothing in them is per-reader — so `*` discloses nothing a stranger could
30
+ // not get by dialling the hostname itself. A live sandbox's CORS still comes from the daemon, proxied untouched.
31
+ export const edgeErrorHeaders = (verdict: EdgeVerdict): Readonly<Record<string, string>> => ({
32
+ [EDGE_VERDICT_HEADER]: verdict,
33
+ "access-control-allow-origin": "*",
34
+ "access-control-allow-methods": "*",
35
+ "access-control-allow-headers": "*",
36
+ // Without this the header above exists on the wire and is unreadable in the browser, which is the whole bug.
37
+ "access-control-expose-headers": EDGE_VERDICT_HEADER,
38
+ // A preflight is not an answer a browser may cache long: the sandbox this refuses is expected back.
39
+ "access-control-max-age": "60",
40
+ });
41
+
42
+ // Whether this request is a CORS preflight, which must be answered 2xx or the real request is never sent — and the real
43
+ // request is the one that can carry the verdict to JavaScript.
44
+ export const isCorsPreflight = (method: string | undefined, requestMethodHeader: string | string[] | undefined): boolean =>
45
+ method === "OPTIONS" && requestMethodHeader !== undefined;
@@ -99,5 +99,6 @@ export type StartIngressTunnel = (options: IngressTunnelOptions) => IngressTunne
99
99
  // and cache the answer, failing open if the platform doesn't respond. A 404 refuses the tunnel.
100
100
  // - Displacement: a new tunnel for an id closes the old session (code 4001) and takes the registration.
101
101
  // - Liveness: WebSocket ping every 15s; a peer silent for 45s is unregistered.
102
- // - Routing: host maps via hostOwnerId to a registered tunnel; no tunnel answers 502 naming the sandbox label.
102
+ // - Routing: host maps via hostOwnerId to a registered tunnel; no tunnel answers 502 naming the sandbox label, with
103
+ // the verdict header and CORS of edge-verdict.ts, and admits the preflight of the request it is about to refuse.
103
104
  // - The tunnel door and any host without a sandbox id are served directly by the ingress, never routed.
@@ -5,6 +5,7 @@ import { type ModelSource, readyChain } from "../models/model-pins.js";
5
5
  import { type ModelPin, ModelPinSchema } from "./agent.js";
6
6
  import { entryId } from "./internal.js";
7
7
  import { SkillDraftSchema, SkillNameSchema, SystemPromptModeSchema } from "./settings.js";
8
+ import { TurnBriefingNoteIdSchema } from "./turn-briefing.js";
8
9
  // A named face the sandbox shows outward: who it speaks as, what it may do, where it works, what it's told, what it
9
10
  // runs on. No credential lives on the card; accounts stay private, per-sandbox. Not a security boundary for a watched
10
11
  // chat — a real fence only for an unattended turn, whose resolver defaults to nothing.
@@ -65,6 +66,18 @@ export const PersonaContextSchema = z.object({
65
66
  ),
66
67
  });
67
68
  export type PersonaContext = z.infer<typeof PersonaContextSchema>;
69
+ // What the sandbox tells a turn before the user's own words (schemas/turn-briefing.ts). A deny list, not a pick list:
70
+ // an id absent from `omit` is sent, so a note added later rides every card that never said otherwise. An object, like
71
+ // `context`, for future sibling fields.
72
+ export const PersonaBriefingSchema = z.object({
73
+ omit: z
74
+ .array(TurnBriefingNoteIdSchema)
75
+ .max(20)
76
+ .describe(
77
+ "Which of the notes the sandbox prepends to each message a conversation wearing this card does NOT get. Everything not named here is sent as usual; the notes that keep a turn inside its own branch or explain a missing account cannot be named at all.",
78
+ ),
79
+ });
80
+ export type PersonaBriefing = z.infer<typeof PersonaBriefingSchema>;
68
81
  export const PersonaSchema = z.object({
69
82
  id: entryId.describe("The persona's id."),
70
83
  label: z.string().max(60).optional().describe("What to call it on screen. Absent falls back to the id, which somebody chose anyway."),
@@ -88,6 +101,10 @@ export const PersonaSchema = z.object({
88
101
  context: PersonaContextSchema.optional().describe(
89
102
  "Which part of the workspace a conversation wearing it carries: the repositories its checkout holds. Absent means every repository.",
90
103
  ),
104
+ // Sits beside `context` on purpose: one says what the tree holds, the other what the turn is handed about it.
105
+ briefing: PersonaBriefingSchema.optional().describe(
106
+ "Which of the notes the sandbox prepends to every message this card's conversations do without. Absent means all of them, which is what a card written before this existed keeps.",
107
+ ),
91
108
  // Ladder shape (a single pin is a single point of failure); picking the card moves the composer's model pill to its
92
109
  // head, and it fills an unattended turn's silence before the run role's list.
93
110
  models: z
@@ -0,0 +1,103 @@
1
+ // What the sandbox puts in front of a user's message before the model reads it — the rows the chat shows under "Sent
2
+ // with your message" — and which of them a persona card may drop. The vocabulary lives here rather than in the daemon
3
+ // because the card editor has to name the same rows the transcript does, and two lists would drift into two
4
+ // vocabularies for one thing.
5
+ import { z } from "zod";
6
+
7
+ // Ids, not titles, are what a card stores: a title is display text and gets reworded, and a reworded title must not
8
+ // silently switch a note back on. The daemon maps each id to the titles it covers (agent/prompt/turn-briefing.ts).
9
+ export const TurnBriefingNoteIdSchema = z.enum(["map", "context", "skills", "search", "delegation", "checks", "dependencies", "repoSync", "handoff"]);
10
+ export type TurnBriefingNoteId = z.infer<typeof TurnBriefingNoteIdSchema>;
11
+
12
+ export interface TurnBriefingNote {
13
+ readonly id: TurnBriefingNoteId;
14
+ // Verbatim the row's own title in the chat's "Sent with your message" fold, so a card turns off the line its reader
15
+ // actually saw. A daemon-side test holds the two in step.
16
+ readonly label: string;
17
+ // When it rides at all. Most are once per conversation, and one whose condition never comes up costs nothing
18
+ // whether it is switched on or off.
19
+ readonly when: string;
20
+ // What the turn loses without it, as the consequence rather than the feature — the only thing that makes this a
21
+ // decision rather than a guess.
22
+ readonly cost: string;
23
+ }
24
+
25
+ // Ordered as a turn meets them: where it is, what it holds, what it can reach, what happens at the end, then the two
26
+ // that report on state rather than teach.
27
+ export const TURN_BRIEFING_NOTES: readonly TurnBriefingNote[] = [
28
+ {
29
+ id: "map",
30
+ label: "Map of this project",
31
+ when: "First message of a conversation, when the sandbox's own map setting is on.",
32
+ cost: "The agent finds the layout by listing directories instead, which costs tool calls on the first task.",
33
+ },
34
+ {
35
+ id: "context",
36
+ label: "Context of this session",
37
+ when: "First message, and again after a compaction, for a card that carries only some repositories.",
38
+ cost: "A repository this card leaves out of the checkout reads as deleted rather than absent, so the agent may try to restore it.",
39
+ },
40
+ {
41
+ id: "skills",
42
+ label: "Skills available in this workspace",
43
+ when: "First message, on a runtime that cannot read the skills folder for itself.",
44
+ cost: "On those runtimes the agent never learns its skills exist, so it will not load one.",
45
+ },
46
+ {
47
+ id: "search",
48
+ label: "Using iq for workspace search",
49
+ when: "First message, when the workspace search setting is on and the runtime has no plugin seam.",
50
+ cost: "The agent falls back to grep-style searching, which it can already do.",
51
+ },
52
+ {
53
+ id: "delegation",
54
+ label: "Spawning child agents",
55
+ when: "First message, on a shell-only runtime, for a card that may delegate.",
56
+ cost: "The agent does the work itself rather than handing parts of it to other conversations.",
57
+ },
58
+ {
59
+ id: "checks",
60
+ label: "Automatic end-of-turn checks",
61
+ when: "First message, and again after a compaction, when you have rules that run at the end of a turn.",
62
+ cost: "Your checks still run; the agent just does not know they are coming, so a failure arrives as a surprise it has to re-read the turn to understand.",
63
+ },
64
+ {
65
+ id: "dependencies",
66
+ label: "Dependencies aren't installed yet",
67
+ when: 'Any turn where a project under the workspace has dependencies missing, or behind what it pins — the second reads "Dependencies are behind" and this covers both.',
68
+ cost: "An unresolved import reads as broken code, and the agent may edit working source to satisfy it.",
69
+ },
70
+ {
71
+ id: "repoSync",
72
+ label: "Repos synced with their remotes",
73
+ when: "A turn on the shared tree where a repository actually moved.",
74
+ cost: "Files changed under the agent between turns with nothing saying so.",
75
+ },
76
+ {
77
+ id: "handoff",
78
+ label: "Where the work stands",
79
+ when: "A turn that starts a fresh session on an existing conversation: a runtime change, or a context limit.",
80
+ cost: "The largest of these. Without it a re-seeded session has the transcript but none of the sandbox's own readings of the tree, the proof and the checklist, so it re-derives them.",
81
+ },
82
+ ];
83
+
84
+ export interface TurnBriefingFixture {
85
+ readonly label: string;
86
+ // Why it cannot be switched off, in the one line the card editor shows beside it.
87
+ readonly why: string;
88
+ }
89
+
90
+ // Deliberately not switchable, and listed so the checklist above reads as complete rather than arbitrary. Each of these
91
+ // either keeps a turn from writing outside its own branch or explains why something the agent expected is missing —
92
+ // saving a few hundred tokens is never worth either.
93
+ export const TURN_BRIEFING_FIXTURES: readonly TurnBriefingFixture[] = [
94
+ { label: "Where this turn's files live", why: "Without it a runtime that is only cwd'd into its branch writes into the shared checkout." },
95
+ { label: "Who this turn is acting as", why: "The card's own identity, on the runtimes that have nowhere else to put it." },
96
+ { label: "Standing instructions for this workspace", why: "Your own AGENTS.md rules. Replace them by giving this card its own system prompt." },
97
+ {
98
+ label: "Some connected accounts need a person's approval",
99
+ why: "Names who to ask; without it a withheld account reads as simply not connected.",
100
+ },
101
+ { label: "This turn reaches no signed-in account", why: "The other reason an account can be missing, which nothing else says out loud." },
102
+ { label: "How to read this message", why: "Keeps a message that opens with a slash from being eaten by the runtime's own command parser." },
103
+ ];