@intentic/sandbox-contract 1.238.1 → 1.240.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/dist/contracts/agent.contract.d.ts +49 -30
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.js +1 -1
- package/dist/contracts/agent.contract.js.map +1 -1
- package/dist/contracts/agents.contract.d.ts +474 -0
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +40 -30
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +474 -0
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.d.ts +474 -0
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/events.d.ts +2546 -123
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +122 -61
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +1607 -165
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/engines.d.ts +157 -0
- package/dist/schemas/engines.d.ts.map +1 -0
- package/dist/schemas/engines.js +70 -0
- package/dist/schemas/engines.js.map +1 -0
- package/dist/schemas/plan-limits.d.ts +19 -0
- package/dist/schemas/plan-limits.d.ts.map +1 -1
- package/dist/schemas/plan-limits.js +8 -1
- package/dist/schemas/plan-limits.js.map +1 -1
- package/dist/workspace-state.d.ts +5 -0
- package/dist/workspace-state.d.ts.map +1 -1
- package/dist/workspace-state.js +1 -0
- package/dist/workspace-state.js.map +1 -1
- package/package.json +4 -4
- package/src/contracts/agent.contract.ts +1 -1
- package/src/events.test.ts +14 -0
- package/src/events.ts +250 -104
- package/src/index.ts +1 -0
- package/src/schemas/engines.ts +129 -0
- package/src/schemas/plan-limits.ts +31 -12
- package/src/workspace-state.test.ts +5 -0
- package/src/workspace-state.ts +12 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { EditorContextSchema } from "./agent.js";
|
|
2
|
+
import { AgentHarnessSchema, AgentProviderSchema, EditorContextSchema } from "./agent.js";
|
|
3
3
|
// Declared ABOVE both account shapes because both carry it: headroom is one idea in this product, not a Claude
|
|
4
4
|
// idea that other providers imitate. A native account (OauthAccount) and a routed subscription
|
|
5
5
|
// (TranslatorAccount) differ in who holds the credential and how the reading is taken, never in what a
|
|
@@ -237,19 +237,38 @@ export const SteerSchema = z
|
|
|
237
237
|
// True cancel for the conversation's in-flight turn, aborts the agent daemon-side, unlike closing the
|
|
238
238
|
// /agent fetch (which sends no cancel frame).
|
|
239
239
|
export const StopTurnSchema = z.object({ conversationId: z.string().min(1).describe("Which conversation's running turn to cancel.") });
|
|
240
|
-
/*
|
|
241
|
-
*
|
|
240
|
+
/* WHO SERVES THE RE-RUN, the one part of a held turn a press is allowed to move, and the field that exists
|
|
241
|
+
* because leaving it out made the press useless in exactly the case it was built for.
|
|
242
242
|
*
|
|
243
|
-
* A spent allowance
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* is
|
|
243
|
+
* A spent allowance is a refusal by an ACCOUNT, and the fix a person reaches for is the account switcher in the
|
|
244
|
+
* composer: switch to one with headroom, press Continue. Replaying the turn with everything it carried replayed
|
|
245
|
+
* the refused account too, so the press bounced off the same limit, reported it in the same words, and the user's
|
|
246
|
+
* only way through was to type "Continue" by hand — a send, which reads the composer's current selection, which
|
|
247
|
+
* is the very thing the press was ignoring.
|
|
248
248
|
*
|
|
249
|
-
* So the
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
249
|
+
* So the press carries WHO, and the daemon keeps WHAT. Everything that makes the turn the turn (the prompt, the
|
|
250
|
+
* attachments, the effort, the mode, the worktree, the session holding whatever it managed to do) stays on the
|
|
251
|
+
* daemon's own copy, because a client re-deriving those from its transcript would be re-deriving them from the
|
|
252
|
+
* STRIPPED copy it renders, which is how a re-send comes to run a different turn from the one it claims to
|
|
253
|
+
* repeat. Routing is the exception, and it is the exception on purpose: it is not a property of the request, it
|
|
254
|
+
* is the answer to "who pays for it", and the whole reason the user is pressing is that they have changed it. */
|
|
255
|
+
export const ResumeRoutingSchema = z.object({
|
|
256
|
+
agent: AgentProviderSchema.describe("Which provider serves the re-run."),
|
|
257
|
+
harness: AgentHarnessSchema.describe("Which agentic loop runs it."),
|
|
258
|
+
account: z.string().optional().describe("Which of that provider's accounts pays for it. Leave it out for the first one."),
|
|
259
|
+
// Omitted rather than guessed: a client whose catalog hasn't loaded has no pick to send, and the turn's own
|
|
260
|
+
// model is a better answer than a blank one.
|
|
261
|
+
model: z.string().optional().describe("Which model. Leave it out to keep the one the refused turn named."),
|
|
262
|
+
});
|
|
263
|
+
export type ResumeRouting = z.infer<typeof ResumeRoutingSchema>;
|
|
264
|
+
/* RUN THE HELD TURN AGAIN: which conversation, and who serves it now.
|
|
265
|
+
*
|
|
266
|
+
* What comes back is an ordinary StartedTurn, and the caller then attaches to it exactly as it would to a turn
|
|
267
|
+
* somebody else started (the resume note on the prompt is what tells an attaching window to reuse the bubble that
|
|
268
|
+
* is already there instead of drawing the same message twice). */
|
|
253
269
|
export const ResumeTurnSchema = z.object({
|
|
254
270
|
conversationId: z.string().min(1).describe("Which conversation's held turn to run again."),
|
|
271
|
+
routing: ResumeRoutingSchema.optional().describe(
|
|
272
|
+
"Who serves the re-run, when the conversation has been re-pointed since it was refused. Leave it out to run it on whatever the turn carried.",
|
|
273
|
+
),
|
|
255
274
|
});
|
|
@@ -334,6 +334,11 @@ describe(`VERSIONED_STATE_PATHS`, () => {
|
|
|
334
334
|
* node:fs, and both used to reach that far with no diff anywhere. Kept rather than consumed, one
|
|
335
335
|
* small file at a time, so tracking them yields a record instead of churn. */
|
|
336
336
|
`.intentic/config/drafts/`,
|
|
337
|
+
/* Where each agent engine takes its version from. Tracked for the same reason heavy-commands is:
|
|
338
|
+
* it is a standing decision about what runs for everyone on this workspace — tracking upstream's
|
|
339
|
+
* newest Claude Code, or pinning one while a regression is open — and `git log` is the only thing
|
|
340
|
+
* that answers "since when". */
|
|
341
|
+
`.intentic/config/engines.json`,
|
|
337
342
|
`.intentic/config/environment.Dockerfile`,
|
|
338
343
|
`.intentic/config/environment.custom.Dockerfile`,
|
|
339
344
|
`.intentic/config/environment.d/`,
|
package/src/workspace-state.ts
CHANGED
|
@@ -249,6 +249,18 @@ const STATE_FILES = [
|
|
|
249
249
|
* missing tools, and arriving with the recurrence memory is the whole reason it is kept. The drift snapshot
|
|
250
250
|
* inside is machine-scoped, and self-expires on the move: its bornAt can never match the new container. */
|
|
251
251
|
{ path: ".intentic/records/runtime-installs.json", invalidates: ["environment"], portability: "carry" },
|
|
252
|
+
/* Where each agent ENGINE's version comes from: the blessed list, upstream's newest, a pin, or the image
|
|
253
|
+
* (schemas/engines.ts). The versions themselves are machine state and live on the daemon's volume, because
|
|
254
|
+
* they are architecture-specific binaries; the POLICY is a decision about this workspace's work and travels
|
|
255
|
+
* with it — a team that pins Claude Code while a regression is open wants that pin to survive the move to a
|
|
256
|
+
* fresh sandbox rather than to be rediscovered by hitting the regression again.
|
|
257
|
+
*
|
|
258
|
+
* `versioned` for the config slice's usual reason (personas.json's entry argues it): it changes at human
|
|
259
|
+
* speed, holds no secret, and "since when have we been tracking upstream's newest on this repo" is a
|
|
260
|
+
* question only `git log` answers. Its own key rather than `environment`'s: the engines card is drawn on
|
|
261
|
+
* that page but reads its own route, and a channel change must not cost every open Environment tab a
|
|
262
|
+
* re-read of the overlay it did not touch. */
|
|
263
|
+
{ path: ".intentic/config/engines.json", invalidates: ["engines"], portability: "carry", versioned: true },
|
|
252
264
|
/* Written by the AGENT's file tools (the drafts skill), read by the owner's approval inbox, the one entry
|
|
253
265
|
* here whose whole point is that a change arrives from outside the browser that renders it. `authored`:
|
|
254
266
|
* a draft is text somebody wrote, and "find the reddit draft about X" is an ordinary search.
|