@intentic/sandbox-contract 1.390.0 → 1.391.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 (182) hide show
  1. package/README.md +6 -1
  2. package/dist/contracts/agents.contract.d.ts +69 -0
  3. package/dist/contracts/agents.contract.d.ts.map +1 -1
  4. package/dist/contracts/agents.contract.js +10 -0
  5. package/dist/contracts/agents.contract.js.map +1 -1
  6. package/dist/contracts/device.contract.d.ts +10 -0
  7. package/dist/contracts/device.contract.d.ts.map +1 -1
  8. package/dist/contracts/ports.contract.d.ts +5 -0
  9. package/dist/contracts/ports.contract.d.ts.map +1 -1
  10. package/dist/contracts/ports.contract.js +1 -1
  11. package/dist/contracts/ports.contract.js.map +1 -1
  12. package/dist/contracts/runner.contract.d.ts +12 -4
  13. package/dist/contracts/runner.contract.d.ts.map +1 -1
  14. package/dist/contracts/runs.contract.d.ts +16 -0
  15. package/dist/contracts/runs.contract.d.ts.map +1 -1
  16. package/dist/contracts/settings.contract.d.ts +16 -0
  17. package/dist/contracts/settings.contract.d.ts.map +1 -1
  18. package/dist/contracts/system.contract.d.ts +66 -0
  19. package/dist/contracts/system.contract.d.ts.map +1 -1
  20. package/dist/contracts/system.contract.js +10 -1
  21. package/dist/contracts/system.contract.js.map +1 -1
  22. package/dist/events/agent-events.d.ts +4 -0
  23. package/dist/events/agent-events.d.ts.map +1 -1
  24. package/dist/events/agent-events.js +1 -0
  25. package/dist/events/agent-events.js.map +1 -1
  26. package/dist/events/agent-transcript.d.ts +1 -0
  27. package/dist/events/agent-transcript.d.ts.map +1 -1
  28. package/dist/events/failure-rows.js +1 -1
  29. package/dist/events/failure-rows.js.map +1 -1
  30. package/dist/events/land-conflict.d.ts +1 -0
  31. package/dist/events/land-conflict.d.ts.map +1 -1
  32. package/dist/events/land-conflict.js +4 -3
  33. package/dist/events/land-conflict.js.map +1 -1
  34. package/dist/events/requests.d.ts +1 -0
  35. package/dist/events/requests.d.ts.map +1 -1
  36. package/dist/events/requests.js +1 -1
  37. package/dist/events/requests.js.map +1 -1
  38. package/dist/events/resume.d.ts +2 -0
  39. package/dist/events/resume.d.ts.map +1 -1
  40. package/dist/events/resume.js +2 -0
  41. package/dist/events/resume.js.map +1 -1
  42. package/dist/events/sandbox-notice.d.ts +1 -0
  43. package/dist/events/sandbox-notice.d.ts.map +1 -1
  44. package/dist/events/sandbox-notice.js +1 -0
  45. package/dist/events/sandbox-notice.js.map +1 -1
  46. package/dist/events/system-events.d.ts +12 -0
  47. package/dist/events/system-events.d.ts.map +1 -1
  48. package/dist/events/transcript.d.ts +1 -0
  49. package/dist/events/transcript.d.ts.map +1 -1
  50. package/dist/events/transcript.js +4 -0
  51. package/dist/events/transcript.js.map +1 -1
  52. package/dist/index.d.ts +172 -0
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/models/agent-standing.d.ts +2 -0
  55. package/dist/models/agent-standing.d.ts.map +1 -1
  56. package/dist/models/agent-standing.js.map +1 -1
  57. package/dist/models/model-setups.d.ts.map +1 -1
  58. package/dist/models/model-setups.js +2 -1
  59. package/dist/models/model-setups.js.map +1 -1
  60. package/dist/policy/failure-codes.d.ts +158 -0
  61. package/dist/policy/failure-codes.d.ts.map +1 -0
  62. package/dist/policy/failure-codes.js +50 -0
  63. package/dist/policy/failure-codes.js.map +1 -0
  64. package/dist/protocol/raw/raw-routes.d.ts +12 -0
  65. package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
  66. package/dist/protocol/raw/raw-routes.js +3 -0
  67. package/dist/protocol/raw/raw-routes.js.map +1 -1
  68. package/dist/schemas/agent-press.d.ts +13 -0
  69. package/dist/schemas/agent-press.d.ts.map +1 -0
  70. package/dist/schemas/agent-press.js +14 -0
  71. package/dist/schemas/agent-press.js.map +1 -0
  72. package/dist/schemas/agents-list.d.ts +6 -0
  73. package/dist/schemas/agents-list.d.ts.map +1 -1
  74. package/dist/schemas/agents.d.ts +11 -0
  75. package/dist/schemas/agents.d.ts.map +1 -1
  76. package/dist/schemas/agents.js +5 -6
  77. package/dist/schemas/agents.js.map +1 -1
  78. package/dist/schemas/device-resources.d.ts +54 -0
  79. package/dist/schemas/device-resources.d.ts.map +1 -0
  80. package/dist/schemas/device-resources.js +29 -0
  81. package/dist/schemas/device-resources.js.map +1 -0
  82. package/dist/schemas/devices.d.ts +2 -52
  83. package/dist/schemas/devices.d.ts.map +1 -1
  84. package/dist/schemas/devices.js +2 -27
  85. package/dist/schemas/devices.js.map +1 -1
  86. package/dist/schemas/git/clone.d.ts +12 -0
  87. package/dist/schemas/git/clone.d.ts.map +1 -0
  88. package/dist/schemas/git/clone.js +14 -0
  89. package/dist/schemas/git/clone.js.map +1 -0
  90. package/dist/schemas/hosts.d.ts +23 -0
  91. package/dist/schemas/hosts.d.ts.map +1 -1
  92. package/dist/schemas/hosts.js +14 -1
  93. package/dist/schemas/hosts.js.map +1 -1
  94. package/dist/schemas/metrics.d.ts +59 -0
  95. package/dist/schemas/metrics.d.ts.map +1 -1
  96. package/dist/schemas/metrics.js +19 -0
  97. package/dist/schemas/metrics.js.map +1 -1
  98. package/dist/schemas/ports.d.ts +10 -0
  99. package/dist/schemas/ports.d.ts.map +1 -1
  100. package/dist/schemas/ports.js +8 -0
  101. package/dist/schemas/ports.js.map +1 -1
  102. package/dist/schemas/providers/handoff.d.ts +1 -0
  103. package/dist/schemas/providers/handoff.d.ts.map +1 -1
  104. package/dist/schemas/providers/handoff.js +4 -1
  105. package/dist/schemas/providers/handoff.js.map +1 -1
  106. package/dist/schemas/providers/plan-limits.js +1 -1
  107. package/dist/schemas/providers/plan-limits.js.map +1 -1
  108. package/dist/schemas/run-targets.d.ts +31 -0
  109. package/dist/schemas/run-targets.d.ts.map +1 -1
  110. package/dist/schemas/run-targets.js +9 -0
  111. package/dist/schemas/run-targets.js.map +1 -1
  112. package/dist/schemas/settings.d.ts +29 -0
  113. package/dist/schemas/settings.d.ts.map +1 -1
  114. package/dist/schemas/settings.js +17 -0
  115. package/dist/schemas/settings.js.map +1 -1
  116. package/dist/schemas/stranded-clone.d.ts +9 -0
  117. package/dist/schemas/stranded-clone.d.ts.map +1 -0
  118. package/dist/schemas/stranded-clone.js +12 -0
  119. package/dist/schemas/stranded-clone.js.map +1 -0
  120. package/dist/state/definition.d.ts +20 -0
  121. package/dist/state/definition.d.ts.map +1 -1
  122. package/dist/state/fix-stance.js +1 -1
  123. package/dist/state/fix-stance.js.map +1 -1
  124. package/dist/state/runtime-state.d.ts +3 -0
  125. package/dist/state/runtime-state.d.ts.map +1 -1
  126. package/dist/state/runtime-state.js +1 -0
  127. package/dist/state/runtime-state.js.map +1 -1
  128. package/dist/state/workspace-state.d.ts.map +1 -1
  129. package/dist/state/workspace-state.js +1 -1
  130. package/dist/state/workspace-state.js.map +1 -1
  131. package/dist/text/transcript-fold.d.ts.map +1 -1
  132. package/dist/text/transcript-fold.js +6 -6
  133. package/dist/text/transcript-fold.js.map +1 -1
  134. package/dist/text/transcript-interruption.d.ts +4 -0
  135. package/dist/text/transcript-interruption.d.ts.map +1 -0
  136. package/dist/text/transcript-interruption.js +27 -0
  137. package/dist/text/transcript-interruption.js.map +1 -0
  138. package/package.json +5 -5
  139. package/src/contracts/agents.contract.ts +12 -0
  140. package/src/contracts/ports.contract.ts +3 -2
  141. package/src/contracts/system.contract.ts +12 -1
  142. package/src/events/agent-events.ts +2 -0
  143. package/src/events/failure-rows.ts +1 -1
  144. package/src/events/land-conflict.test.ts +13 -1
  145. package/src/events/land-conflict.ts +8 -4
  146. package/src/events/requests.ts +1 -1
  147. package/src/events/resume.test.ts +7 -1
  148. package/src/events/resume.ts +3 -0
  149. package/src/events/sandbox-notice.ts +1 -0
  150. package/src/events/transcript.ts +6 -0
  151. package/src/models/agent-standing.ts +4 -0
  152. package/src/models/model-setups.test.ts +11 -0
  153. package/src/models/model-setups.ts +4 -1
  154. package/src/policy/failure-codes.ts +157 -0
  155. package/src/policy/tests/failure-codes.test.ts +141 -0
  156. package/src/protocol/raw/raw-routes.ts +5 -0
  157. package/src/schemas/agent-press.test.ts +46 -0
  158. package/src/schemas/agent-press.ts +34 -0
  159. package/src/schemas/agents.ts +8 -8
  160. package/src/schemas/device-resources.ts +58 -0
  161. package/src/schemas/devices.ts +20 -56
  162. package/src/schemas/git/clone.ts +22 -0
  163. package/src/schemas/hosts.ts +34 -3
  164. package/src/schemas/metrics.ts +28 -0
  165. package/src/schemas/ports.ts +12 -0
  166. package/src/schemas/providers/handoff.test.ts +7 -0
  167. package/src/schemas/providers/handoff.ts +4 -1
  168. package/src/schemas/providers/plan-limits.ts +1 -1
  169. package/src/schemas/run-targets.ts +23 -1
  170. package/src/schemas/settings.ts +32 -0
  171. package/src/schemas/stranded-clone.ts +15 -0
  172. package/src/state/fix-stance.ts +1 -1
  173. package/src/state/runtime-state.ts +4 -0
  174. package/src/state/workspace-state.ts +3 -2
  175. package/src/text/transcript-fold.test.ts +21 -7
  176. package/src/text/transcript-fold.ts +5 -6
  177. package/src/text/transcript-interruption.ts +30 -0
  178. package/dist/policy/turned-away.d.ts +0 -3
  179. package/dist/policy/turned-away.d.ts.map +0 -1
  180. package/dist/policy/turned-away.js +0 -33
  181. package/dist/policy/turned-away.js.map +0 -1
  182. package/src/policy/turned-away.ts +0 -52
@@ -104,7 +104,10 @@ export const presetPins = (preset: PresetSetup, sources: readonly ModelSource[])
104
104
  sources
105
105
  .filter((source) => source.ready && !isEndpointProvider(source.provider))
106
106
  .flatMap((source) => {
107
- const newest = newestOnRung(source.models, PRESET_RUNG[preset]);
107
+ // Cheap jobs are on the interaction path (titles, commits, summaries); an explicitly slow model is
108
+ // unsuitable for the automatic Low preset. An owner's written pins remain authoritative.
109
+ const models = preset === "low" ? source.models.filter((model) => !/(?:^|[-_])slow(?:$|[-_])/i.test(model)) : source.models;
110
+ const newest = newestOnRung(models, PRESET_RUNG[preset]);
108
111
  return newest === undefined ? [] : [{ provider: source.provider, model: newest }];
109
112
  })
110
113
  .slice(0, PRESET_LENGTH);
@@ -0,0 +1,157 @@
1
+ import type { AgentErrorCode } from "../events/agent-events.js";
2
+
3
+ /* WHAT EACH FAILURE CODE IS, ONCE: the kind a reader names it by and what becomes of the turn it ended. Five places used
4
+ to classify the codes by hand (the door set here, the board's kinds, the chat's switch, the daemon's hold, the record's
5
+ ending) and they disagreed: the board called a refusal "Held" that the chat drew as a crash, and a turn that hit its
6
+ own ceiling was held by nobody, so no window offered to carry it on and people typed "Continue" by hand (2026-11).
7
+ Every one of them now reads this table, and a code added to the wire fails the build here until it has a row. */
8
+
9
+ // What kind of failure ended a turn, as the reader acts on it: the board's corner names the kind, and the chat's notice
10
+ // leads a provider's words with the kind's own line. Grouped by what the reader does next, not by provider; a failure
11
+ // nothing coded has no kind, and each surface says so in its own words.
12
+ export type FailureKind =
13
+ // The account signs in but is refused service: an organization or plan that switched it off.
14
+ | "access"
15
+ // The account's credential is dead or missing; a reconnect fixes it.
16
+ | "signedOut"
17
+ // The provider failed and kept failing past the retries.
18
+ | "outage"
19
+ // The model the turn named is not served to this account, or cannot run this kind of turn.
20
+ | "model"
21
+ // The turn is bigger than the model's window.
22
+ | "contextFull"
23
+ // The installed engine is older than the model requires.
24
+ | "update"
25
+ // The provider's safety classifier stopped the turn.
26
+ | "flagged"
27
+ // A spent allowance the `rate_limit` code does not cover (the free trial's day).
28
+ | "limit"
29
+ // The privacy shield held the words back before anything was read.
30
+ | "privacy"
31
+ // Held at the door for want of room, as a memory hold is.
32
+ | "held"
33
+ // The runtime stopped partway without failing outright; the work may be half done.
34
+ | "cutShort"
35
+ // The harness read the message as a slash command it does not have; the model never saw it.
36
+ | "command"
37
+ // The runtime warned about a turn it went on with: a note, not an ending.
38
+ | "advisory";
39
+
40
+ // What becomes of the turn a failure ended, which the daemon's hold and every window's offer both read.
41
+ export type FailureCourse =
42
+ // Refused before the model saw a word: nothing ran, and the words wait in the conversation's queue (or with the
43
+ // sandbox that started the turn) for whatever lets them through.
44
+ | "door"
45
+ // A spent allowance: held for its reopen, or for another account.
46
+ | "limit"
47
+ // The provider failing transiently: held for the breaker's next retry.
48
+ | "outage"
49
+ // A Claude token refused mid-turn: held while the daemon re-mints it, then re-run.
50
+ | "remint"
51
+ // The session outgrew the model's window: re-run once in a fresh session.
52
+ | "overflow"
53
+ // The provider's safety classifier stopped it: held for a person to choose the way on each time.
54
+ | "flagged"
55
+ // Stopped partway with nothing to repair: held whole for a person's press (Continue), since the next move is theirs.
56
+ | "carry"
57
+ // Nothing is held: what is left is the person's next message, or a fix outside the conversation.
58
+ | "bare"
59
+ // A warning about a turn that went on, not an ending.
60
+ | "note";
61
+
62
+ export interface FailureTraits {
63
+ readonly kind: FailureKind;
64
+ readonly course: FailureCourse;
65
+ // A refusal about the model itself (its allowance, its account, its catalogue, its window), which another model gets
66
+ // past: a turn one of these stops partway offers to carry on elsewhere rather than to wait.
67
+ readonly anotherModelClears?: true;
68
+ }
69
+
70
+ // Every code the wire names, with its kind and its course. The privacy shield's own refusals (privacy-egress.ts
71
+ // isPrivacyRefusal) are all the privacy kind and all turned away at the door.
72
+ export const FAILURE_CODES = {
73
+ // The session vanished mid-turn: the next send starts fresh.
74
+ "session-not-found": { kind: "cutShort", course: "bare" },
75
+ rate_limit: { kind: "limit", course: "limit" },
76
+ "codex-advisory": { kind: "advisory", course: "note" },
77
+ "codex-reauth": { kind: "signedOut", course: "bare" },
78
+ // Only the agent's own login command signs it in: nothing a press could re-run would get past it.
79
+ "acp-auth-required": { kind: "signedOut", course: "bare" },
80
+ "claude-reauth": { kind: "signedOut", course: "door" },
81
+ "claude-token-refused": { kind: "signedOut", course: "remint" },
82
+ // An organisation turned the account's Claude Code access off, or no account of the provider can serve: the next
83
+ // turn is routed off it (the daemon's blocked-account route), so the words wait for it rather than being spent.
84
+ "claude-not-entitled": { kind: "access", course: "door", anotherModelClears: true },
85
+ "account-not-entitled": { kind: "access", course: "bare" },
86
+ // The people this conversation works for may not spend the account the turn would run on.
87
+ "account-not-allowed": { kind: "access", course: "door", anotherModelClears: true },
88
+ "provider-outage": { kind: "outage", course: "outage" },
89
+ "trial-unavailable": { kind: "outage", course: "door", anotherModelClears: true },
90
+ "trial-model-unavailable": { kind: "model", course: "door", anotherModelClears: true },
91
+ "trial-exhausted": { kind: "limit", course: "door", anotherModelClears: true },
92
+ "unknown-command": { kind: "command", course: "door" },
93
+ "grok-model-invalid": { kind: "model", course: "bare" },
94
+ "codex-model-invalid": { kind: "model", course: "bare" },
95
+ "model-unavailable": { kind: "model", course: "door", anotherModelClears: true },
96
+ "context-window-too-small": { kind: "contextFull", course: "door", anotherModelClears: true },
97
+ "model-helper-only": { kind: "model", course: "door", anotherModelClears: true },
98
+ // The privacy shield refused an untrusted provider on a runtime it cannot read by content at all.
99
+ "privacy-unshielded": { kind: "privacy", course: "door" },
100
+ // The turn carries a tool list its runtime cannot keep.
101
+ "tools-unenforced": { kind: "held", course: "door" },
102
+ // The protected execution boundary refused admission, not an executed provider/runtime failure.
103
+ "agent-domain-refused": { kind: "held", course: "door" },
104
+ // The privacy shield found personal data in instructions a runtime loads itself, where it could not mask them.
105
+ "privacy-instructions": { kind: "privacy", course: "door" },
106
+ "context-overflow": { kind: "contextFull", course: "overflow" },
107
+ "subscription-required": { kind: "access", course: "bare" },
108
+ "agent-busy": { kind: "held", course: "bare" },
109
+ "sandbox-memory-low": { kind: "held", course: "door" },
110
+ // The conversation's own view of the workspace could not be set up in time: nothing was started in it.
111
+ "workspace-setup": { kind: "held", course: "door" },
112
+ "sandbox-disk-low": { kind: "held", course: "door" },
113
+ // The turn reached its own iteration or time ceiling, its work perhaps half done: carried on by a press, never by a
114
+ // clock, since a re-run on a timer is the runaway the ceiling exists to stop.
115
+ "turn-cap": { kind: "cutShort", course: "carry" },
116
+ "harness-incomplete": { kind: "cutShort", course: "carry" },
117
+ "engine-version-floor": { kind: "update", course: "door" },
118
+ "safeguard-flagged": { kind: "flagged", course: "flagged" },
119
+ } as const satisfies Record<AgentErrorCode, FailureTraits>;
120
+
121
+ // Looked up by a bare string, since a roster row and a stored ending carry the code as one: a newer sandbox's code this
122
+ // build has no row for reads as unknown, never as a wrong one, and never as an object prototype's own member.
123
+ const TRAITS_OF_CODE: ReadonlyMap<string, FailureTraits> = new Map(Object.entries(FAILURE_CODES));
124
+
125
+ /** What a failure code is; undefined for no code, and for a code this build does not know. */
126
+ export const failureTraitsOf = (code: string | undefined): FailureTraits | undefined => (code === undefined ? undefined : TRAITS_OF_CODE.get(code));
127
+
128
+ /**
129
+ * What becomes of the turn a failure ended. A failure nothing coded is a turn that stopped short with nothing named to
130
+ * repair, so it is carried on; a code this build does not know holds nothing, since nothing here knows what it would take.
131
+ */
132
+ export const failureCourseOf = (code: string | undefined): FailureCourse => {
133
+ if (code === undefined) {
134
+ return "carry";
135
+ }
136
+ return failureTraitsOf(code)?.course ?? "bare";
137
+ };
138
+
139
+ /* THE REFUSALS THAT TURN A WHOLE TURN AWAY AT THE DOOR: refused before the model saw a word, so nothing ran and the
140
+ message is still owed to somebody — the conversation's queue, held, for words a person sent, or the sandbox that
141
+ started the turn itself. Which codes those are is the failure table's to say (failure-codes.ts, the `door` course). */
142
+
143
+ // The codes whose traits say `test`, as a set: what they share is a fact about the turn, not a shape.
144
+ const codesWhere = (test: (traits: FailureTraits) => boolean): ReadonlySet<string> =>
145
+ new Set(Object.entries(FAILURE_CODES).flatMap(([code, traits]: [string, FailureTraits]) => (test(traits) ? [code] : [])));
146
+
147
+ const TURNED_AWAY = codesWhere((traits) => traits.course === "door");
148
+
149
+ // The refusals about the model itself (its allowance, its account, its catalogue, its window), which another model
150
+ // gets past: a turn one of these stops partway offers to carry on elsewhere rather than to wait.
151
+ const ANOTHER_MODEL_CLEARS = codesWhere((traits) => traits.anotherModelClears === true);
152
+
153
+ /** Whether another model would get past a refusal: the trial's, the model's, or the account's on it. */
154
+ export const anotherModelClears = (code: string | undefined): boolean => code !== undefined && ANOTHER_MODEL_CLEARS.has(code);
155
+
156
+ /** Whether a failure code refuses a turn before the model sees any of it. */
157
+ export const turnedAwayCode = (code: string | undefined): boolean => code !== undefined && TURNED_AWAY.has(code);
@@ -0,0 +1,141 @@
1
+ import { AgentErrorCodeSchema } from "../../events/agent-events.js";
2
+ import { isPrivacyRefusal } from "../../schemas/privacy-egress.js";
3
+ import { FAILURE_CODES, failureCourseOf, failureTraitsOf,anotherModelClears,turnedAwayCode } from "../failure-codes.js";
4
+
5
+ // The codes whose row says `test`, sorted, so a pin reads as a list.
6
+ const codesWhere = (test: (code: string) => boolean): string[] => AgentErrorCodeSchema.options.filter(test).toSorted();
7
+
8
+ test("every code the wire names has a row, and the table names no code the wire does not", () => {
9
+ expect(Object.keys(FAILURE_CODES).toSorted()).toEqual(AgentErrorCodeSchema.options.toSorted());
10
+ for (const code of AgentErrorCodeSchema.options) {
11
+ expect([code, failureTraitsOf(code)]).toEqual([code, FAILURE_CODES[code]]);
12
+ }
13
+ });
14
+
15
+ // The door course names the codes refused before the model saw a word.
16
+ test("the codes turned away at the door are exactly the eighteen refused before the model saw a word", () => {
17
+ const door = codesWhere((code) => failureCourseOf(code) === "door");
18
+ expect(door).toEqual(
19
+ [
20
+ "claude-reauth",
21
+ "claude-not-entitled",
22
+ "account-not-allowed",
23
+ "unknown-command",
24
+ "context-window-too-small",
25
+ "model-helper-only",
26
+ "privacy-unshielded",
27
+ "tools-unenforced",
28
+ "agent-domain-refused",
29
+ "privacy-instructions",
30
+ "sandbox-memory-low",
31
+ "workspace-setup",
32
+ "sandbox-disk-low",
33
+ "trial-unavailable",
34
+ "trial-model-unavailable",
35
+ "trial-exhausted",
36
+ "model-unavailable",
37
+ "engine-version-floor",
38
+ ].toSorted(),
39
+ );
40
+ expect(codesWhere(turnedAwayCode)).toEqual(door);
41
+ expect(turnedAwayCode(undefined)).toBe(false);
42
+ });
43
+
44
+ test("another model clears exactly the refusals about the model, its trial or its account", () => {
45
+ const cleared = [
46
+ "claude-not-entitled",
47
+ "account-not-allowed",
48
+ "context-window-too-small",
49
+ "model-helper-only",
50
+ "trial-unavailable",
51
+ "trial-model-unavailable",
52
+ "trial-exhausted",
53
+ "model-unavailable",
54
+ ].toSorted();
55
+ expect(codesWhere((code) => failureTraitsOf(code)?.anotherModelClears === true)).toEqual(cleared);
56
+ expect(codesWhere(anotherModelClears)).toEqual(cleared);
57
+ expect(anotherModelClears(undefined)).toBe(false);
58
+ });
59
+
60
+ test("every refusal the privacy shield names is the privacy kind, turned away at the door", () => {
61
+ const privacy = codesWhere(isPrivacyRefusal);
62
+ expect(privacy.length).toBeGreaterThan(0);
63
+ for (const code of privacy) {
64
+ expect([code, failureTraitsOf(code)?.kind, failureCourseOf(code)]).toEqual([code, "privacy", "door"]);
65
+ }
66
+ expect(codesWhere((code) => failureTraitsOf(code)?.kind === "privacy")).toEqual(privacy);
67
+ });
68
+
69
+ // The board's kinds as agentStatus-failure.ts kept them by hand until the table (KINDS_BY_CODE), the privacy shield's
70
+ // refusals added as it added them: pinned, so moving them here changed no word on a card.
71
+ test("every code keeps the kind the board named it by", () => {
72
+ const pinned = {
73
+ rate_limit: "limit",
74
+ "session-not-found": "cutShort",
75
+ "codex-advisory": "advisory",
76
+ "unknown-command": "command",
77
+ "agent-busy": "held",
78
+ "sandbox-memory-low": "held",
79
+ "sandbox-disk-low": "held",
80
+ "tools-unenforced": "held",
81
+ "agent-domain-refused": "held",
82
+ "claude-not-entitled": "access",
83
+ "account-not-entitled": "access",
84
+ "account-not-allowed": "access",
85
+ "subscription-required": "access",
86
+ "claude-reauth": "signedOut",
87
+ "codex-reauth": "signedOut",
88
+ "claude-token-refused": "signedOut",
89
+ "acp-auth-required": "signedOut",
90
+ "provider-outage": "outage",
91
+ "trial-unavailable": "outage",
92
+ "grok-model-invalid": "model",
93
+ "codex-model-invalid": "model",
94
+ "model-unavailable": "model",
95
+ "trial-model-unavailable": "model",
96
+ "model-helper-only": "model",
97
+ "context-window-too-small": "contextFull",
98
+ "context-overflow": "contextFull",
99
+ "engine-version-floor": "update",
100
+ "safeguard-flagged": "flagged",
101
+ "trial-exhausted": "limit",
102
+ "workspace-setup": "held",
103
+ "turn-cap": "cutShort",
104
+ "harness-incomplete": "cutShort",
105
+ "privacy-unshielded": "privacy",
106
+ "privacy-instructions": "privacy",
107
+ } as const;
108
+ expect(Object.fromEntries(Object.entries(FAILURE_CODES).map(([code, traits]) => [code, traits.kind]))).toEqual(pinned);
109
+ });
110
+
111
+ test("each wall's own code takes its course, and a turn that stopped at its own ceiling is carried on by a press", () => {
112
+ expect(failureCourseOf("rate_limit")).toBe("limit");
113
+ expect(failureCourseOf("provider-outage")).toBe("outage");
114
+ expect(failureCourseOf("claude-token-refused")).toBe("remint");
115
+ expect(failureCourseOf("context-overflow")).toBe("overflow");
116
+ expect(failureCourseOf("safeguard-flagged")).toBe("flagged");
117
+ expect(failureCourseOf("codex-advisory")).toBe("note");
118
+ expect(codesWhere((code) => failureCourseOf(code) === "carry")).toEqual(["harness-incomplete", "turn-cap"]);
119
+ expect(codesWhere((code) => failureCourseOf(code) === "bare")).toEqual(
120
+ [
121
+ "session-not-found",
122
+ "codex-reauth",
123
+ "acp-auth-required",
124
+ "account-not-entitled",
125
+ "subscription-required",
126
+ "grok-model-invalid",
127
+ "codex-model-invalid",
128
+ "agent-busy",
129
+ ].toSorted(),
130
+ );
131
+ });
132
+
133
+ test("a failure nothing coded is carried on, and a code this build does not know holds nothing", () => {
134
+ expect(failureCourseOf(undefined)).toBe("carry");
135
+ expect(failureTraitsOf(undefined)).toBeUndefined();
136
+ expect(failureTraitsOf("a-newer-sandbox-code")).toBeUndefined();
137
+ expect(failureCourseOf("a-newer-sandbox-code")).toBe("bare");
138
+ // A plain record lookup would answer these with Object.prototype's own members.
139
+ expect(failureTraitsOf("constructor")).toBeUndefined();
140
+ expect(failureTraitsOf("toString")).toBeUndefined();
141
+ });
@@ -179,6 +179,11 @@ export const RAW_ROUTES = {
179
179
  "POST /devices/{name}/apps/stop": { agent: true, control: "never" },
180
180
  "GET /devices/{name}/apps/{id}/output": { agent: true, control: "never" },
181
181
  "GET /devices/runs": { agent: true },
182
+ // A `devices run` building in the owner's tree holds lands into that repository until its build ends
183
+ // (hosts/runs/run-builds.ts): any shell's, since the run grant and the conversation each say whose build it is.
184
+ "POST /devices/builds": { agent: true, control: "never" },
185
+ "POST /devices/builds/{id}/renew": { agent: true, control: "never" },
186
+ "DELETE /devices/builds/{id}": { agent: true, control: "never" },
182
187
  "POST /devices/{name}/tunnels": { agent: true, control: "never" },
183
188
  "DELETE /devices/{name}/tunnels/{port}": { agent: true, control: "never" },
184
189
  "GET /devices/tunnels": { agent: true },
@@ -0,0 +1,46 @@
1
+ import { AgentEventSchema } from "../events/agent-events.js";
2
+ import { TurnEndingSchema } from "../events/transcript.js";
3
+ import { AgentPressSchema, NO_PRESS } from "./agent-press.js";
4
+ import { AgentSummarySchema } from "./agents.js";
5
+
6
+ // The card's press (AgentSummary.press) is what every chat window's strip follows over its own reading, so both of its
7
+ // kinds, and a hold only a press sends again (`pressOnly`), must survive the wire whole: a key the schema strips is a
8
+ // press the window never offers.
9
+
10
+ describe("AgentPress", () => {
11
+ test("carries nothing to press as itself, not as an absent field", () => {
12
+ expect(AgentPressSchema.parse(NO_PRESS)).toEqual({ kind: "none" });
13
+ const card = AgentSummarySchema.pick({ press: true });
14
+ expect(card.parse({ press: NO_PRESS })).toEqual({ press: { kind: "none" } });
15
+ // An older sandbox says nothing, which is not `none`.
16
+ expect(card.parse({})).toEqual({});
17
+ });
18
+
19
+ test.each([
20
+ { reason: "stopped" },
21
+ { reason: "stopped", held: { ran: true, contextTokens: 9_000, pressOnly: true } },
22
+ { reason: "limit", resetsAt: 2_000_000_000, held: { ran: false, handoffTokens: 1_200, moving: "acct-2" }, scheduled: true, nextAt: 2_000_000_100 },
23
+ { reason: "outage" },
24
+ { reason: "flagged", held: { ran: true } },
25
+ { reason: "stopped", held: { ran: true }, retries: { made: 1, max: 3 } },
26
+ ] as const)("round-trips a continue on %o", (ending) => {
27
+ const press = { kind: "continue", ending } as const;
28
+ expect(AgentPressSchema.parse(JSON.parse(JSON.stringify(press)))).toEqual(press);
29
+ });
30
+
31
+ test("refuses a kind it does not know, and a continue with no ending", () => {
32
+ expect(AgentPressSchema.safeParse({ kind: "later" }).success).toBe(false);
33
+ expect(AgentPressSchema.safeParse({ kind: "continue" }).success).toBe(false);
34
+ });
35
+ });
36
+
37
+ describe("a hold only a press sends again", () => {
38
+ test("is stated on the record's ending", () => {
39
+ expect(TurnEndingSchema.parse({ reason: "stopped", held: { ran: true, pressOnly: true } }).held).toEqual({ ran: true, pressOnly: true });
40
+ });
41
+
42
+ test("is stated on the error frame's held turn", () => {
43
+ const frame = { kind: "error", code: "turn-cap", message: "Reached the maximum number of turns.", autoResume: "available", held: { ran: true, pressOnly: true } };
44
+ expect(AgentEventSchema.parse(frame)).toMatchObject({ kind: "error", held: { ran: true, pressOnly: true } });
45
+ });
46
+ });
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ import { type TurnEnding, TurnEndingSchema } from "../events/transcript.js";
3
+
4
+ // WHAT A PERSON'S CONTINUE DOES NOW: the daemon's one reading of it (AgentSummary.press), derived every time the card is
5
+ // read from what the conversation holds (turn-ending.ts turnEndingOf), the very value its record states as the transcript's
6
+ // `ending`. Every chat window used to build its own from the live error frame it happened to watch, patched from the
7
+ // record and the card, and they disagreed: a card in Finished beside a composer still saying "Limit reached, work kept"
8
+ // (2026-11-01), a composer counting down to a reopen while the daemon re-ran the turn at once (2026-10-19), a reloaded
9
+ // window with no strip at all, or one that never went away.
10
+ const AgentPressMembers = z
11
+ .discriminatedUnion("kind", [
12
+ z.object({ kind: z.literal("none") }).describe("Nothing to continue: the last turn finished, runs now, or ended on something to repair first."),
13
+ z.object({
14
+ kind: z.literal("continue"),
15
+ ending: TurnEndingSchema.describe(
16
+ "How the last turn ended, which says what the press does: re-run the turn the daemon holds, or carry the session on.",
17
+ ),
18
+ }),
19
+ ])
20
+ .describe("What a person's Continue does for this conversation now, as the daemon reads it.");
21
+ // Named, never inferred: the card's schema then names this type instead of spelling the whole ending out inside every route
22
+ // that carries a card, which took the aggregated contract's type past what the declaration emitter will write (TS7056).
23
+ export interface NoPress {
24
+ readonly kind: "none";
25
+ }
26
+ export interface ContinuePress {
27
+ readonly kind: "continue";
28
+ readonly ending: TurnEnding;
29
+ }
30
+ export type AgentPress = NoPress | ContinuePress;
31
+ export const AgentPressSchema: z.ZodType<AgentPress> = AgentPressMembers;
32
+
33
+ /** The one `none`, shared by every writer that has nothing to offer. */
34
+ export const NO_PRESS: AgentPress = { kind: "none" };
@@ -1,6 +1,7 @@
1
1
  // agents: the conversation fleet
2
2
  import { LandingDeliverySchema } from "./project-delivery.js";
3
3
  import { AgentNextSchema } from "./agent-next.js";
4
+ import { AgentPressSchema } from "./agent-press.js";
4
5
  import { z } from "zod";
5
6
  import { AgentHarnessSchema, AgentOriginSchema, AgentProviderSchema, ConversationQueueSchema, ForkedFromSchema, FreshSessionSchema } from "./agent.js";
6
7
  import { FROM_BRANCHES_DESCRIPTION } from "./conversation-links.js";
@@ -9,6 +10,7 @@ import { LoopStateSchema } from "./loops.js";
9
10
  import { LimitPolicySchema, RetryPolicySchema, RoomPolicySchema, TurnBreakPolicySchema, TurnBreakSchema } from "./turn-break.js";
10
11
  import { KeepWarmSchema } from "./keep-warm.js";
11
12
  import { AgentNeedSchema } from "./needs.js";
13
+ import { StrandedCloneSchema } from "./stranded-clone.js";
12
14
  import { EMOJI_MAX_LENGTH, isSingleEmoji } from "../text/emoji.js";
13
15
  import { ProgramAskSchema } from "../events/requests.js";
14
16
  import { ReviewTallySchema, TurnProofSchema } from "./work-assurance.js";
@@ -137,13 +139,7 @@ export const TurnReachSchema = z.object({
137
139
  ),
138
140
  liveMore: z.number().optional().describe("How many more such files there were beyond the ones listed. Absent when all are listed."),
139
141
  stranded: z
140
- .array(
141
- z.object({
142
- dir: z.string().describe("The clone, as a folder relative to its own copy of the workspace."),
143
- uncommitted: z.number().describe("Files changed in it and never committed."),
144
- unpushed: z.number().describe("Commits in it its upstream does not have, or that no remote has when it follows none."),
145
- }),
146
- )
142
+ .array(StrandedCloneSchema)
147
143
  .max(TURN_REACH_LIST_MAX)
148
144
  .optional()
149
145
  .describe(
@@ -304,6 +300,10 @@ export const AgentSummarySchema = z.object({
304
300
  next: AgentNextSchema.optional().describe(
305
301
  "What carries it on next with nobody pressing anything, and when: a held turn re-run, a message held for memory, or messages booked for later. Absent when only a press moves it.",
306
302
  ),
303
+ // And what a press does instead (agent-press.ts): the daemon's one reading, which every chat window's strip follows.
304
+ press: AgentPressSchema.optional().describe(
305
+ "The daemon's one reading of what a person's Continue does now: carry on from how the last turn ended, or nothing. Every summary a sandbox that knows it writes carries it, `none` included, so its absence means a sandbox older than it.",
306
+ ),
307
307
  provider: AgentProviderSchema.describe("Which model provider it runs on."),
308
308
  harness: AgentHarnessSchema.describe("Which agentic loop it runs on."),
309
309
  // Latched with the conversation, so the card can say where work runs without asking anything else.
@@ -537,7 +537,7 @@ export const AgentSummarySchema = z.object({
537
537
  .string()
538
538
  .optional()
539
539
  .describe(
540
- "Which kind of failure it was, when the sandbox could tell: unlinked when its copy lost its link to the workspace, off_main_line when the shared workspace was moved off its main line and the work waits until it is back. Absent otherwise.",
540
+ "Which kind of failure it was, when the sandbox could tell: unlinked when its copy lost its link to the workspace, off_main_line when the shared workspace was moved off its main line and the work waits until it is back, repo_corrupt when the repository's own git storage is damaged (the sandbox checks and repairs it by itself). Absent otherwise.",
541
541
  ),
542
542
  at: z.number().describe("When it failed, in milliseconds."),
543
543
  })
@@ -0,0 +1,58 @@
1
+ import { z } from "zod";
2
+
3
+ // One sandbox's resource share as docker currently enforces it, read off the container by the machine agent.
4
+ // `overlayRuntime` is the environment's locked demand; `hostRuntime` is the owner's addition; `privileged`/`gpu` are
5
+ // docker's enforced truth.
6
+ // A delta against what runs: absent means leave it, `null` on the two caps means back to the default; at least one key
7
+ // must be set. What the old `reshape` op carries, which the machine agent carries out as `ic sandbox shape --set` (its
8
+ // `olderResizePlan`); `set-shape` carries a whole shape instead.
9
+ export const SandboxResourcesAskFieldsSchema = z.object({
10
+ memoryGib: z.int().positive().nullable().optional(),
11
+ cpus: z.int().positive().nullable().optional(),
12
+ privileged: z.boolean().optional(),
13
+ gpu: z.boolean().optional(),
14
+ });
15
+ // A sandbox's shape, WHOLE: the owner's own ask for its share of the machine, every field a value. `null` on a cap is
16
+ // the contract's default (the share derived from the engine, or every core). The switches are the owner's ask, not
17
+ // docker's answer: a directive the approved environment demands rides beside it (`overlayRuntime`), and a host
18
+ // without the NVIDIA runtime drops the GPU. `ic` stores it, validates it against the image's run contract when it is
19
+ // saved, and prints it in `ic sandbox list --json`; nobody else merges anything into it.
20
+ export const SandboxShapeSchema = z.object({
21
+ memoryGib: z.int().positive().nullable(),
22
+ cpus: z.int().positive().nullable(),
23
+ privileged: z.boolean(),
24
+ gpu: z.boolean(),
25
+ });
26
+ export type SandboxShape = z.infer<typeof SandboxShapeSchema>;
27
+ // When a `set-shape` takes effect: `now` restarts the sandbox onto it; `nextRestart` saves it in ic's record and
28
+ // restarts nothing, and the next restart through ic applies it — Restart or Start from any door, an update, a rollback
29
+ // or a rebuild. Docker restarting the container by itself (after a crash or a reboot) does not: only ic recreates one.
30
+ export const SandboxShapeWhenSchema = z.enum(["now", "nextRestart"]);
31
+ export type SandboxShapeWhen = z.infer<typeof SandboxShapeWhenSchema>;
32
+
33
+ export const SandboxResourcesSchema = z.object({
34
+ // The cgroup memory ceiling in bytes; absent when docker imposes none (the hosted shape).
35
+ memoryBytes: z.number().optional(),
36
+ // The CFS quota as whole cores; absent when the container may use every core (the default).
37
+ cpus: z.number().optional(),
38
+ privileged: z.boolean(),
39
+ gpu: z.boolean(),
40
+ hostRuntime: z.array(z.string()),
41
+ overlayRuntime: z.array(z.string()),
42
+ // The shape the container runs with (the owner's ask it carries). Absent from an agent older than `set-shape`.
43
+ shape: SandboxShapeSchema.optional(),
44
+ // The shape saved for the sandbox's next restart through ic, and not yet in force. Absent when nothing is saved.
45
+ desired: SandboxShapeSchema.optional(),
46
+ // READ-ONLY, from agents older than `set-shape`: their saved share, a delta against what runs. Nothing new writes
47
+ // it; kept one release so a newer page can still show what an older agent saved. Remove with `later`.
48
+ saved: SandboxResourcesAskFieldsSchema.optional(),
49
+ });
50
+ export type SandboxResources = z.infer<typeof SandboxResourcesSchema>;
51
+
52
+ // Fields also exported separately for callers that compose them and enforce the at-least-one rule themselves.
53
+ // Strict like every device input (DeviceSandboxFlowSchema says why): it is only ever sent to a device.
54
+ export const SandboxResourcesAskSchema = SandboxResourcesAskFieldsSchema.strict().refine((ask) => Object.values(ask).some((value) => value !== undefined), {
55
+ message: "a reshape must change at least one thing",
56
+ });
57
+ export type SandboxResourcesAsk = z.infer<typeof SandboxResourcesAskSchema>;
58
+
@@ -1,71 +1,35 @@
1
1
  // What one of the user's own machines is running.
2
2
  import { z } from "zod";
3
+ import {
4
+ SandboxResourcesAskSchema,
5
+ SandboxResourcesSchema,
6
+ SandboxShapeSchema,
7
+ SandboxShapeWhenSchema,
8
+ type SandboxShape,
9
+ type SandboxShapeWhen,
10
+ } from "./device-resources.js";
3
11
  import { PortNumberSchema } from "./device-commands.js";
4
12
  import { DeviceBridgeHoldSchema, DeviceConflictSchema, DeviceCopySchema, DeviceLowDiskSchema } from "./device-folder.js";
5
13
  import { parseHostConnection, type DeviceFacts, DeviceFactsSchema, MachineIdentitySchema, MachineIdSchema, userDistrosOf, WslEnvironmentSchema } from "./hosts.js";
6
14
  import { EgressOwnerKeysSchema, EgressPolicySchema, EgressProofSchema, EgressStatusSchema } from "./egress.js";
7
15
  import { RollbackTargetSchema, UpdateOutcomeSchema } from "./updates.js";
8
16
  import { DEV_VERSION } from "../state/versions.js";
17
+
18
+ export {
19
+ SandboxResourcesAskFieldsSchema,
20
+ SandboxResourcesAskSchema,
21
+ SandboxResourcesSchema,
22
+ SandboxShapeSchema,
23
+ SandboxShapeWhenSchema,
24
+ type SandboxResources,
25
+ type SandboxResourcesAsk,
26
+ type SandboxShape,
27
+ type SandboxShapeWhen,
28
+ } from "./device-resources.js";
9
29
  // Desktop-sync report shape shared by the agent, daemon and browser, produced only by the agent's own `deviceReport`.
10
30
  // The agent never reports `sandboxes`; the docker half is filled in by whoever reads the report, scoped to the reader's
11
31
  // own pairing.
12
32
 
13
- // One sandbox's resource share as docker currently enforces it, read off the container by the machine agent.
14
- // `overlayRuntime` is the environment's locked demand; `hostRuntime` is the owner's addition; `privileged`/`gpu` are
15
- // docker's enforced truth.
16
- // A delta against what runs: absent means leave it, `null` on the two caps means back to the default; at least one key
17
- // must be set. What the old `reshape` op carries, which the machine agent carries out as `ic sandbox shape --set` (its
18
- // `olderResizePlan`); `set-shape` carries a whole shape instead.
19
- export const SandboxResourcesAskFieldsSchema = z.object({
20
- memoryGib: z.int().positive().nullable().optional(),
21
- cpus: z.int().positive().nullable().optional(),
22
- privileged: z.boolean().optional(),
23
- gpu: z.boolean().optional(),
24
- });
25
- // A sandbox's shape, WHOLE: the owner's own ask for its share of the machine, every field a value. `null` on a cap is
26
- // the contract's default (the share derived from the engine, or every core). The switches are the owner's ask, not
27
- // docker's answer: a directive the approved environment demands rides beside it (`overlayRuntime`), and a host
28
- // without the NVIDIA runtime drops the GPU. `ic` stores it, validates it against the image's run contract when it is
29
- // saved, and prints it in `ic sandbox list --json`; nobody else merges anything into it.
30
- export const SandboxShapeSchema = z.object({
31
- memoryGib: z.int().positive().nullable(),
32
- cpus: z.int().positive().nullable(),
33
- privileged: z.boolean(),
34
- gpu: z.boolean(),
35
- });
36
- export type SandboxShape = z.infer<typeof SandboxShapeSchema>;
37
- // When a `set-shape` takes effect: `now` restarts the sandbox onto it; `nextRestart` saves it in ic's record and
38
- // restarts nothing, and the next restart through ic applies it — Restart or Start from any door, an update, a rollback
39
- // or a rebuild. Docker restarting the container by itself (after a crash or a reboot) does not: only ic recreates one.
40
- export const SandboxShapeWhenSchema = z.enum(["now", "nextRestart"]);
41
- export type SandboxShapeWhen = z.infer<typeof SandboxShapeWhenSchema>;
42
-
43
- export const SandboxResourcesSchema = z.object({
44
- // The cgroup memory ceiling in bytes; absent when docker imposes none (the hosted shape).
45
- memoryBytes: z.number().optional(),
46
- // The CFS quota as whole cores; absent when the container may use every core (the default).
47
- cpus: z.number().optional(),
48
- privileged: z.boolean(),
49
- gpu: z.boolean(),
50
- hostRuntime: z.array(z.string()),
51
- overlayRuntime: z.array(z.string()),
52
- // The shape the container runs with (the owner's ask it carries). Absent from an agent older than `set-shape`.
53
- shape: SandboxShapeSchema.optional(),
54
- // The shape saved for the sandbox's next restart through ic, and not yet in force. Absent when nothing is saved.
55
- desired: SandboxShapeSchema.optional(),
56
- // READ-ONLY, from agents older than `set-shape`: their saved share, a delta against what runs. Nothing new writes
57
- // it; kept one release so a newer page can still show what an older agent saved. Remove with `later`.
58
- saved: SandboxResourcesAskFieldsSchema.optional(),
59
- });
60
- export type SandboxResources = z.infer<typeof SandboxResourcesSchema>;
61
-
62
- // Fields also exported separately for callers that compose them and enforce the at-least-one rule themselves.
63
- // Strict like every device input (DeviceSandboxFlowSchema says why): it is only ever sent to a device.
64
- export const SandboxResourcesAskSchema = SandboxResourcesAskFieldsSchema.strict().refine((ask) => Object.values(ask).some((value) => value !== undefined), {
65
- message: "a reshape must change at least one thing",
66
- });
67
- export type SandboxResourcesAsk = z.infer<typeof SandboxResourcesAskSchema>;
68
-
69
33
  // One sandbox container on the machine, the docker half, filled in by the reader, never by the sync agent.
70
34
  export const DeviceSandboxSchema = z.object({
71
35
  slug: z.string(),
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+
3
+ // A clone of its own a turn left inside its copy (TurnReach.stranded), settled one of two ways: folded into the
4
+ // repository it sits in, its own `.git` removed so its files land with the rest, or moved into the workspace as a
5
+ // repository of its own.
6
+ export const AgentCloneSchema = z.object({
7
+ id: z.string().min(1).describe("Which conversation."),
8
+ dir: z.string().min(1).describe("The clone, exactly as the card's reach names it: a folder relative to the conversation's copy of the workspace."),
9
+ action: z
10
+ .enum(["fold", "adopt"])
11
+ .describe(
12
+ "`fold`: remove the clone's own `.git`, so its files are ordinary work of the repository it sits in and land with it. `adopt`: move it into your workspace at the same folder, `.git` and all, as a repository of its own.",
13
+ ),
14
+ dropCommits: z
15
+ .number()
16
+ .int()
17
+ .optional()
18
+ .describe(
19
+ "For `fold` of a clone that holds commits: how many the caller was shown and agreed to drop. The files stay; only that history goes. Refused when absent or not the clone's count now.",
20
+ ),
21
+ });
22
+ export type AgentClone = z.infer<typeof AgentCloneSchema>;