@intentic/sandbox-contract 1.290.0 → 1.291.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/diff.contract.d.ts +49 -0
- package/dist/contracts/diff.contract.d.ts.map +1 -0
- package/dist/contracts/diff.contract.js +14 -0
- package/dist/contracts/diff.contract.js.map +1 -0
- package/dist/contracts/extensions.contract.d.ts +1 -0
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +95 -95
- package/dist/contracts/system.contract.d.ts +45 -30
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/index.d.ts +66 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/models/agent-catalog.d.ts +1 -0
- package/dist/models/agent-catalog.d.ts.map +1 -1
- package/dist/models/agent-catalog.js +1 -0
- package/dist/models/agent-catalog.js.map +1 -1
- package/dist/models/agent-runtimes.d.ts.map +1 -1
- package/dist/models/agent-runtimes.js +2 -2
- package/dist/models/agent-runtimes.js.map +1 -1
- package/dist/models/plan-pools.d.ts +13 -0
- package/dist/models/plan-pools.d.ts.map +1 -1
- package/dist/models/plan-pools.js +43 -0
- package/dist/models/plan-pools.js.map +1 -1
- package/dist/schemas/devices.d.ts +21 -0
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +7 -1
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/diff.d.ts +62 -0
- package/dist/schemas/diff.d.ts.map +1 -0
- package/dist/schemas/diff.js +59 -0
- package/dist/schemas/diff.js.map +1 -0
- package/dist/schemas/extension-updates.d.ts +2 -0
- package/dist/schemas/extension-updates.d.ts.map +1 -1
- package/dist/schemas/terminal.d.ts +22 -0
- package/dist/schemas/terminal.d.ts.map +1 -1
- package/dist/schemas/terminal.js +9 -0
- package/dist/schemas/terminal.js.map +1 -1
- package/dist/state/history-state.d.ts.map +1 -1
- package/dist/state/history-state.js +1 -0
- package/dist/state/history-state.js.map +1 -1
- package/package.json +5 -5
- package/src/contracts/diff.contract.ts +17 -0
- package/src/index.ts +4 -0
- package/src/models/agent-catalog.test.ts +6 -2
- package/src/models/agent-catalog.ts +5 -0
- package/src/models/agent-runtimes.ts +7 -4
- package/src/models/plan-pools.test.ts +40 -1
- package/src/models/plan-pools.ts +69 -0
- package/src/schemas/devices.ts +20 -1
- package/src/schemas/diff.ts +72 -0
- package/src/schemas/terminal.ts +11 -0
- package/src/state/history-state.ts +3 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// diff: one side of a file diff named by its source, for the routes that answer with something other than the text
|
|
2
|
+
// diff itself (bytes on /diff/raw, derived text on /diff/derived).
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { GitDiffSideSchema } from "./git/git.js";
|
|
5
|
+
|
|
6
|
+
const path = z.string().min(1).describe("The file, relative to the repo or scope the diff belongs to.");
|
|
7
|
+
const repo = z.string().min(1).describe('Which repository: "root" for the workspace itself, otherwise a repo id.');
|
|
8
|
+
|
|
9
|
+
// The four pairings a review surface lists a row under; every field is a string, so the same shape rides a query string
|
|
10
|
+
// and the JSON body of a typed call alike.
|
|
11
|
+
export const DiffSourceQuerySchema = z.discriminatedUnion("source", [
|
|
12
|
+
z
|
|
13
|
+
.object({
|
|
14
|
+
source: z.literal("working"),
|
|
15
|
+
repo,
|
|
16
|
+
side: GitDiffSideSchema.describe("Which git side the row came from; a half-staged file is two different diffs."),
|
|
17
|
+
path,
|
|
18
|
+
})
|
|
19
|
+
.describe("Uncommitted work in a workspace repo, what the Changes panel lists."),
|
|
20
|
+
z
|
|
21
|
+
.object({
|
|
22
|
+
source: z.literal("agent"),
|
|
23
|
+
agent: z.string().min(1).describe("The conversation whose work is under review."),
|
|
24
|
+
repo,
|
|
25
|
+
path,
|
|
26
|
+
})
|
|
27
|
+
.describe("One agent's work against the base its review is listed against."),
|
|
28
|
+
z
|
|
29
|
+
.object({
|
|
30
|
+
source: z.literal("commit"),
|
|
31
|
+
repo,
|
|
32
|
+
sha: z
|
|
33
|
+
.string()
|
|
34
|
+
.regex(/^[0-9a-f]{4,64}$/)
|
|
35
|
+
.describe("The commit, compared against its first parent."),
|
|
36
|
+
path,
|
|
37
|
+
})
|
|
38
|
+
.describe("A commit against its first parent."),
|
|
39
|
+
z
|
|
40
|
+
.object({
|
|
41
|
+
source: z.literal("checkpoint"),
|
|
42
|
+
snapshot: z.string().min(1).describe("Which saved point."),
|
|
43
|
+
scope: z.string().min(1).describe("Which part of the workspace the path belongs to."),
|
|
44
|
+
path,
|
|
45
|
+
})
|
|
46
|
+
.describe("A saved point in the timeline, against the visible one before it."),
|
|
47
|
+
]);
|
|
48
|
+
export type DiffSourceQuery = z.infer<typeof DiffSourceQuerySchema>;
|
|
49
|
+
|
|
50
|
+
// One side of a document rendered to text, or why it could not be. The text is fileq's rendering, the same one an
|
|
51
|
+
// agent reads instead of the bytes, so what a reviewer compares here is what the agent worked from.
|
|
52
|
+
export const DerivedSideSchema = z.discriminatedUnion("present", [
|
|
53
|
+
z.object({
|
|
54
|
+
present: z.literal(true),
|
|
55
|
+
content: z.string().describe("The side as markdown."),
|
|
56
|
+
deriver: z.string().describe("Which reader made this text, with its version."),
|
|
57
|
+
notes: z.array(z.string()).describe("Every cap and degradation the conversion hit, one line each."),
|
|
58
|
+
truncated: z.boolean().describe("The rendering was longer than this response carries; only its start is here."),
|
|
59
|
+
}),
|
|
60
|
+
z.object({
|
|
61
|
+
present: z.literal(false),
|
|
62
|
+
reason: z.string().describe("Why this side has no text: a format nothing reads, a broken file, a sandbox with no reader."),
|
|
63
|
+
}),
|
|
64
|
+
]);
|
|
65
|
+
export type DerivedSide = z.infer<typeof DerivedSideSchema>;
|
|
66
|
+
|
|
67
|
+
// Both sides as text; an absent side is a side the diff does not have (an added file has no before).
|
|
68
|
+
export const DerivedDiffSchema = z.object({
|
|
69
|
+
before: DerivedSideSchema.optional().describe("The file as it was, rendered to text. Absent when it did not exist yet."),
|
|
70
|
+
after: DerivedSideSchema.optional().describe("The file as it is now, rendered to text. Absent when it was deleted."),
|
|
71
|
+
});
|
|
72
|
+
export type DerivedDiff = z.infer<typeof DerivedDiffSchema>;
|
package/src/schemas/terminal.ts
CHANGED
|
@@ -106,6 +106,17 @@ export const BrowserSessionSchema = z.object({
|
|
|
106
106
|
.describe(
|
|
107
107
|
"The agent has hit something only a person can clear: a captcha, a password it does not hold, a check on your phone. Present only while it is waiting.",
|
|
108
108
|
),
|
|
109
|
+
// A JavaScript dialog a page has open; held by the daemon for whoever answers first, the owner over the live view
|
|
110
|
+
// or the agent through its tool. Present only while open.
|
|
111
|
+
dialog: z
|
|
112
|
+
.object({
|
|
113
|
+
pageId: z.string().describe("Which page opened it."),
|
|
114
|
+
kind: z.enum(["alert", "confirm", "prompt", "beforeunload"]).describe("What it asks: an alert wants dismissing, a confirm a yes or no, a prompt a text."),
|
|
115
|
+
message: z.string().describe("What the page says."),
|
|
116
|
+
defaultValue: z.string().optional().describe("A prompt's prefilled answer."),
|
|
117
|
+
})
|
|
118
|
+
.optional()
|
|
119
|
+
.describe("A dialog a page has open and is waiting on. You or the agent answers it; present only while it is open."),
|
|
109
120
|
pages: z
|
|
110
121
|
.array(BrowserPageSchema)
|
|
111
122
|
.describe("Every page it has open. A browser holds several at once, which is the reason it is listed apart from the terminals."),
|
|
@@ -26,6 +26,9 @@ export const HISTORY_STATE_FILES: readonly StateFile[] = [
|
|
|
26
26
|
{ path: "activity.jsonl", portability: "carry" },
|
|
27
27
|
{ path: "usage.jsonl", portability: "carry" },
|
|
28
28
|
{ path: "account-usage.json", portability: "carry" },
|
|
29
|
+
// Per-account stay-away for a provider's usage endpoint. Carried, not re-earned: earning one costs the very read it
|
|
30
|
+
// holds off, and is answered with a deadline measured from that moment. Entries past their instant are inert.
|
|
31
|
+
{ path: "usage-parks.json", portability: "carry" },
|
|
29
32
|
{ path: "provider-refusals.json", portability: "carry" },
|
|
30
33
|
// Models refused to this sandbox's credentials; expires daily, same subscriptions apply elsewhere.
|
|
31
34
|
{ path: "model-refusals.json", portability: "carry" },
|