@intentic/sandbox-contract 1.408.0 → 1.409.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 +54 -0
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.d.ts +12 -0
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/automations.contract.d.ts.map +1 -1
- package/dist/contracts/automations.contract.js +1 -0
- package/dist/contracts/automations.contract.js.map +1 -1
- package/dist/contracts/capabilities.contract.d.ts +508 -0
- package/dist/contracts/capabilities.contract.d.ts.map +1 -1
- package/dist/contracts/capabilities.contract.js +74 -1
- package/dist/contracts/capabilities.contract.js.map +1 -1
- package/dist/contracts/device.contract.d.ts +23 -0
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.d.ts +350 -4
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/needs.contract.d.ts +9 -0
- package/dist/contracts/needs.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +288 -250
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +6 -0
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.d.ts +27 -0
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/events/agent-events.d.ts +26 -0
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-events.js +3 -0
- package/dist/events/agent-events.js.map +1 -1
- package/dist/events/agent-transcript.d.ts +6 -0
- package/dist/events/agent-transcript.d.ts.map +1 -1
- package/dist/events/prompt-origins.d.ts +54 -0
- package/dist/events/prompt-origins.d.ts.map +1 -0
- package/dist/events/prompt-origins.js +44 -0
- package/dist/events/prompt-origins.js.map +1 -0
- package/dist/events/transcript.d.ts +31 -45
- package/dist/events/transcript.d.ts.map +1 -1
- package/dist/events/transcript.js +3 -27
- package/dist/events/transcript.js.map +1 -1
- package/dist/netd/generated/wire.d.ts +4 -0
- package/dist/netd/generated/wire.d.ts.map +1 -1
- package/dist/oauth/google-workspace.d.ts +4 -0
- package/dist/oauth/google-workspace.d.ts.map +1 -0
- package/dist/oauth/google-workspace.js +6 -0
- package/dist/oauth/google-workspace.js.map +1 -0
- package/dist/policy/failure-codes.d.ts +4 -0
- package/dist/policy/failure-codes.d.ts.map +1 -1
- package/dist/policy/failure-codes.js +1 -0
- package/dist/policy/failure-codes.js.map +1 -1
- package/dist/policy/git/git-connections.d.ts +15 -0
- package/dist/policy/git/git-connections.d.ts.map +1 -0
- package/dist/policy/git/git-connections.js +34 -0
- package/dist/policy/git/git-connections.js.map +1 -0
- package/dist/policy/org-locks.d.ts +1 -1
- package/dist/policy/org-locks.d.ts.map +1 -1
- package/dist/policy/org-locks.js +1 -0
- package/dist/policy/org-locks.js.map +1 -1
- package/dist/protocol/doors/runner-protocol.d.ts.map +1 -1
- package/dist/protocol/doors/runner-protocol.js.map +1 -1
- package/dist/protocol/raw/raw-json-routes.d.ts +121 -0
- package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-json-routes.js +6 -1
- package/dist/protocol/raw/raw-json-routes.js.map +1 -1
- package/dist/protocol/raw/raw-routes.d.ts +27 -0
- package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.js +7 -0
- package/dist/protocol/raw/raw-routes.js.map +1 -1
- package/dist/schemas/capabilities.d.ts +8 -16
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +12 -39
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/certificate-request.d.ts +38 -0
- package/dist/schemas/certificate-request.d.ts.map +1 -0
- package/dist/schemas/certificate-request.js +18 -0
- package/dist/schemas/certificate-request.js.map +1 -0
- package/dist/schemas/device-move.d.ts +46 -0
- package/dist/schemas/device-move.d.ts.map +1 -0
- package/dist/schemas/device-move.js +34 -0
- package/dist/schemas/device-move.js.map +1 -0
- package/dist/schemas/device-sign-in.d.ts +25 -0
- package/dist/schemas/device-sign-in.d.ts.map +1 -0
- package/dist/schemas/device-sign-in.js +24 -0
- package/dist/schemas/device-sign-in.js.map +1 -0
- package/dist/schemas/devices.d.ts +50 -0
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +6 -0
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/extension-updates.d.ts +700 -8
- package/dist/schemas/extension-updates.d.ts.map +1 -1
- package/dist/schemas/git/remote-refs.d.ts +1 -0
- package/dist/schemas/git/remote-refs.d.ts.map +1 -1
- package/dist/schemas/git/remote-refs.js +5 -0
- package/dist/schemas/git/remote-refs.js.map +1 -1
- package/dist/schemas/git-installs.d.ts +20 -0
- package/dist/schemas/git-installs.d.ts.map +1 -0
- package/dist/schemas/git-installs.js +46 -0
- package/dist/schemas/git-installs.js.map +1 -0
- package/dist/schemas/hosts.d.ts +2 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +2 -0
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/links.d.ts +89 -0
- package/dist/schemas/links.d.ts.map +1 -1
- package/dist/schemas/links.js +72 -0
- package/dist/schemas/links.js.map +1 -1
- package/dist/schemas/mcp-sign-in.d.ts +46 -0
- package/dist/schemas/mcp-sign-in.d.ts.map +1 -0
- package/dist/schemas/mcp-sign-in.js +54 -0
- package/dist/schemas/mcp-sign-in.js.map +1 -0
- package/dist/schemas/needs.d.ts +8 -0
- package/dist/schemas/needs.d.ts.map +1 -1
- package/dist/schemas/needs.js +5 -1
- package/dist/schemas/needs.js.map +1 -1
- package/dist/schemas/system.d.ts +4 -0
- package/dist/schemas/system.d.ts.map +1 -1
- package/dist/schemas/system.js +4 -0
- package/dist/schemas/system.js.map +1 -1
- package/dist/state/definition.d.ts +6 -0
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/text/mentions.d.ts +5 -0
- package/dist/text/mentions.d.ts.map +1 -1
- package/dist/text/mentions.js +15 -3
- package/dist/text/mentions.js.map +1 -1
- package/dist/text/transcript-fold.d.ts.map +1 -1
- package/dist/text/transcript-fold.js +4 -8
- package/dist/text/transcript-fold.js.map +1 -1
- package/package.json +5 -5
- package/src/contracts/automations.contract.ts +3 -0
- package/src/contracts/capabilities.contract.ts +98 -0
- package/src/events/agent-events.ts +5 -0
- package/src/events/prompt-origins.ts +65 -0
- package/src/events/transcript.ts +4 -40
- package/src/netd/generated/netd-wire.json +24 -0
- package/src/netd/generated/wire.ts +8 -2
- package/src/oauth/google-workspace.ts +16 -0
- package/src/policy/failure-codes.ts +1 -0
- package/src/policy/git/git-connections.test.ts +46 -0
- package/src/policy/git/git-connections.ts +68 -0
- package/src/policy/org-locks.ts +1 -0
- package/src/policy/tests/failure-codes.test.ts +3 -1
- package/src/protocol/doors/runner-protocol.ts +3 -1
- package/src/protocol/raw/raw-json-routes.ts +13 -0
- package/src/protocol/raw/raw-routes.ts +13 -0
- package/src/schemas/capabilities.ts +16 -58
- package/src/schemas/certificate-request.ts +28 -0
- package/src/schemas/device-move.ts +54 -0
- package/src/schemas/device-sign-in.ts +37 -0
- package/src/schemas/devices.ts +11 -0
- package/src/schemas/git/remote-refs.ts +7 -0
- package/src/schemas/git-installs.ts +72 -0
- package/src/schemas/hosts.ts +4 -0
- package/src/schemas/links.ts +106 -1
- package/src/schemas/mcp-sign-in.ts +72 -0
- package/src/schemas/needs.ts +8 -1
- package/src/schemas/system.ts +6 -0
- package/src/text/mentions.test.ts +16 -1
- package/src/text/mentions.ts +18 -4
- package/src/text/transcript-fold.test.ts +8 -0
- package/src/text/transcript-fold.ts +4 -8
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// WHICH GITHUB OR GITLAB CONNECTION READS A REPOSITORY, when a plugin or an extension is installed from one without a
|
|
2
|
+
// token of its own. One rule for the install form, which says which connection it will use, and for the daemon, which
|
|
3
|
+
// clones with it: the two sides read the same list of connections, so they cannot name different ones.
|
|
4
|
+
|
|
5
|
+
// A connection as either side holds it: the daemon a `cli` entry's config, the editor the list's echo of it
|
|
6
|
+
// (CapabilitySummary). Only the non-secret fields are read (`provider`, a GitLab instance's `url`, the `git` switch),
|
|
7
|
+
// which both sides have.
|
|
8
|
+
export interface GitConnectionCandidate {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly kind: string;
|
|
11
|
+
readonly config: Readonly<Record<string, string | number | boolean>>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface GitConnection {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly provider: "github" | "gitlab";
|
|
17
|
+
// The host its token is good for: github.com, or the GitLab instance's host (with a port, when it has one).
|
|
18
|
+
readonly host: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The provider's name as a person reads it. */
|
|
22
|
+
export const gitProviderName = (provider: GitConnection["provider"]): string => (provider === "github" ? "GitHub" : "GitLab");
|
|
23
|
+
|
|
24
|
+
/** The host a GitHub or GitLab card's token answers for, or undefined for any other card or an unreadable instance URL. */
|
|
25
|
+
export const gitConnectionOf = (candidate: GitConnectionCandidate): GitConnection | undefined => {
|
|
26
|
+
const { provider, url, git } = candidate.config;
|
|
27
|
+
// Git access switched off on the card is the owner saying its token is not for git.
|
|
28
|
+
if (candidate.kind !== "cli" || git === "off") {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
if (provider === "github") {
|
|
32
|
+
return { id: candidate.id, provider, host: "github.com" };
|
|
33
|
+
}
|
|
34
|
+
if (provider !== "gitlab") {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
const host = URL.parse(String(url ?? ""))?.host.toLowerCase() ?? "";
|
|
38
|
+
return host === "" ? undefined : { id: candidate.id, provider, host };
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** The repository's host, for an http(s) URL; undefined for anything git would reach another way (ssh, a path). */
|
|
42
|
+
export const gitUrlHost = (url: string): string | undefined => {
|
|
43
|
+
const parsed = URL.parse(url.trim());
|
|
44
|
+
return parsed === null || (parsed.protocol !== "https:" && parsed.protocol !== "http:") || parsed.host === "" ? undefined : parsed.host.toLowerCase();
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// The scheme a card's token may travel over: https, or plain http only for a GitLab instance the owner set up at an
|
|
48
|
+
// http address themselves. An `http://github.com/…` typed on a plugin card must never carry the GitHub token in clear.
|
|
49
|
+
const lendsOver = (candidate: GitConnectionCandidate, connection: GitConnection, protocol: string): boolean =>
|
|
50
|
+
protocol === "https:" || (connection.provider === "gitlab" && URL.parse(String(candidate.config["url"] ?? ""))?.protocol === protocol);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The connections whose token is good for the repository's host, in the order the first of them is chosen: by id, so
|
|
54
|
+
* the pick never depends on which card was connected first or on the list's order.
|
|
55
|
+
*/
|
|
56
|
+
export const gitConnectionsFor = (candidates: readonly GitConnectionCandidate[], url: string): readonly GitConnection[] => {
|
|
57
|
+
const host = gitUrlHost(url);
|
|
58
|
+
const protocol = URL.parse(url.trim())?.protocol;
|
|
59
|
+
if (host === undefined || protocol === undefined) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
return candidates
|
|
63
|
+
.flatMap((candidate) => {
|
|
64
|
+
const connection = gitConnectionOf(candidate);
|
|
65
|
+
return connection !== undefined && connection.host === host && lendsOver(candidate, connection, protocol) ? [connection] : [];
|
|
66
|
+
})
|
|
67
|
+
.toSorted((left, right) => (left.id < right.id ? -1 : left.id > right.id ? 1 : 0));
|
|
68
|
+
};
|
package/src/policy/org-locks.ts
CHANGED
|
@@ -13,7 +13,7 @@ test("every code the wire names has a row, and the table names no code the wire
|
|
|
13
13
|
});
|
|
14
14
|
|
|
15
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 twenty refused before the model saw a word", () => {
|
|
16
|
+
test("the codes turned away at the door are exactly the twenty-one refused before the model saw a word", () => {
|
|
17
17
|
const door = codesWhere((code) => failureCourseOf(code) === "door");
|
|
18
18
|
expect(door).toEqual(
|
|
19
19
|
[
|
|
@@ -37,6 +37,7 @@ test("the codes turned away at the door are exactly the twenty refused before th
|
|
|
37
37
|
"trial-exhausted",
|
|
38
38
|
"model-unavailable",
|
|
39
39
|
"engine-version-floor",
|
|
40
|
+
"standby",
|
|
40
41
|
].toSorted(),
|
|
41
42
|
);
|
|
42
43
|
expect(codesWhere(turnedAwayCode)).toEqual(door);
|
|
@@ -109,6 +110,7 @@ test("every code keeps the kind the board named it by", () => {
|
|
|
109
110
|
"harness-incomplete": "cutShort",
|
|
110
111
|
"privacy-unshielded": "privacy",
|
|
111
112
|
"privacy-instructions": "privacy",
|
|
113
|
+
standby: "held",
|
|
112
114
|
} as const;
|
|
113
115
|
expect(Object.fromEntries(Object.entries(FAILURE_CODES).map(([code, traits]) => [code, traits.kind]))).toEqual(pinned);
|
|
114
116
|
});
|
|
@@ -177,7 +177,9 @@ export const RunnerFactsSchema = z.object({
|
|
|
177
177
|
export type RunnerFacts = z.infer<typeof RunnerFactsSchema>;
|
|
178
178
|
|
|
179
179
|
// Whether a runner matches this sandbox's image, channel and approved overlay: `current`, `outdated` (gets an update
|
|
180
|
-
// button), or `unknown` (never connected, or a parent that can't name its own image). Reported, never enforced
|
|
180
|
+
// button), or `unknown` (never connected, or a parent that can't name its own image). Reported, never enforced; what
|
|
181
|
+
// the parent does act on is a runner on an older release than its own, which it updates while idle (sandbox
|
|
182
|
+
// system/updates/runner-updates.ts).
|
|
181
183
|
export const RunnerParitySchema = z.enum(["current", "outdated", "unknown"]);
|
|
182
184
|
export type RunnerParity = z.infer<typeof RunnerParitySchema>;
|
|
183
185
|
|
|
@@ -61,12 +61,18 @@ import {
|
|
|
61
61
|
InboundLinkSummarySchema,
|
|
62
62
|
InboundLinkTermsUpdateSchema,
|
|
63
63
|
LinkAnswerSchema,
|
|
64
|
+
LinkExecSchema,
|
|
65
|
+
LinkExecStatusSchema,
|
|
64
66
|
LinkHelloSchema,
|
|
65
67
|
LinkMessageReceiptSchema,
|
|
66
68
|
LinkMessageSchema,
|
|
69
|
+
LinkReadAnswerSchema,
|
|
70
|
+
LinkReadSchema,
|
|
67
71
|
LinkRequestDecisionSchema,
|
|
68
72
|
LinkTaskSchema,
|
|
69
73
|
LinkTaskStatusSchema,
|
|
74
|
+
LinkWriteAnswerSchema,
|
|
75
|
+
LinkWriteSchema,
|
|
70
76
|
} from "../../schemas/links.js";
|
|
71
77
|
import { UploadManifestSchema, UploadSkipSchema } from "../../schemas/workspace/workspace-upload.js";
|
|
72
78
|
import {
|
|
@@ -196,6 +202,13 @@ export const RAW_JSON_ROUTES = {
|
|
|
196
202
|
// command's own routes do, which have no shared schema.
|
|
197
203
|
"POST /link/records/diagnostics": { input: DiagnosticsQuerySchema, output: DiagnosticsAnswerSchema },
|
|
198
204
|
"GET /link/records/fleet/{handle}/bundle": { output: ConversationBundleSchema },
|
|
205
|
+
// A link's operating doors: a command started and read again (`?wait=<seconds>` holds a read until it ends), stopped,
|
|
206
|
+
// a file or directory read, and a file written.
|
|
207
|
+
"POST /link/operate/exec": { input: LinkExecSchema, output: LinkExecStatusSchema },
|
|
208
|
+
"GET /link/operate/exec/{id}": { output: LinkExecStatusSchema },
|
|
209
|
+
"POST /link/operate/exec/{id}/stop": { output: LinkExecStatusSchema },
|
|
210
|
+
"POST /link/operate/read": { input: LinkReadSchema, output: LinkReadAnswerSchema },
|
|
211
|
+
"POST /link/operate/write": { input: LinkWriteSchema, output: LinkWriteAnswerSchema },
|
|
199
212
|
"POST /diagnostics": { input: DiagnosticsAskSchema, output: DiagnosticsAnswerSchema },
|
|
200
213
|
"GET /fleet/{handle}/bundle": { output: ConversationBundleSchema },
|
|
201
214
|
// An accounts link: what it may use, one static key's copy, and a lent sign-in's per-turn credential.
|
|
@@ -142,6 +142,7 @@ export const RAW_ROUTES = {
|
|
|
142
142
|
"GET /sandboxes": { agent: true },
|
|
143
143
|
"POST /sandboxes": { agent: true },
|
|
144
144
|
"POST /sandboxes/remove": { agent: true },
|
|
145
|
+
"POST /sandboxes/move": { agent: true },
|
|
145
146
|
// The `wallet` CLI; spend is bounded by the owner's policy and the key never enters the container.
|
|
146
147
|
"GET /wallet/status": { agent: true, control: "never" },
|
|
147
148
|
"POST /wallet/fetch": { agent: true, control: "never" },
|
|
@@ -210,6 +211,9 @@ export const RAW_ROUTES = {
|
|
|
210
211
|
"GET /extension/events": { floor: "maintainer", panel: false, control: "never", stream: true },
|
|
211
212
|
// The CI webhook receiver, gated by the per-sandbox webhook secret.
|
|
212
213
|
"POST /ci/webhook/{host}": { auth: "door" },
|
|
214
|
+
// Where an MCP server's authorization server sends the browser back (capabilities/mcp-oauth/): gated by the state of
|
|
215
|
+
// a sign-in this daemon started, and worth nothing without the PKCE verifier only the daemon holds.
|
|
216
|
+
"GET /oauth/mcp/callback": { auth: "door", control: "never" },
|
|
213
217
|
// Below maintainer a pairing is capped to port-mirror, so a collaborator may mint a preview tunnel.
|
|
214
218
|
"POST /system/sync/pair": { floor: "collaborator", control: "never" },
|
|
215
219
|
// A copy-paste command's short code, redeemed by the install script it was handed to: a device's first contact,
|
|
@@ -301,6 +305,15 @@ export const RAW_ROUTES = {
|
|
|
301
305
|
"GET /link/records/fleet/{handle}": { auth: "door", control: "never" },
|
|
302
306
|
"GET /link/records/fleet/{handle}/bundle": { auth: "door", control: "never" },
|
|
303
307
|
"POST /link/records/diagnostics": { auth: "door", control: "never" },
|
|
308
|
+
// A link's operating doors (schemas/links.ts `operate`): the asking sandbox running commands and reading and writing
|
|
309
|
+
// files here as this sandbox's owner does in their own terminal. Each checks the link token itself and answers only
|
|
310
|
+
// while the link's terms allow operating; a command is followed by reading it again, and only the link that started
|
|
311
|
+
// it reads or stops it.
|
|
312
|
+
"POST /link/operate/exec": { auth: "door", control: "never" },
|
|
313
|
+
"GET /link/operate/exec/{id}": { auth: "door", control: "never" },
|
|
314
|
+
"POST /link/operate/exec/{id}/stop": { auth: "door", control: "never" },
|
|
315
|
+
"POST /link/operate/read": { auth: "door", control: "never" },
|
|
316
|
+
"POST /link/operate/write": { auth: "door", control: "never" },
|
|
304
317
|
// An accounts link's doors (schemas/providers/account-sharing.ts): the accounts its terms name, a static key's copy,
|
|
305
318
|
// and a lent sign-in's access token per turn, re-minted mid-turn. The refresh token never leaves; each door checks the
|
|
306
319
|
// link token itself and answers only for what the terms name.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// them, and what the Capabilities page reads (status, probe, connect/rename/sign-in inputs).
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ExitConfigSchema } from "./exit.js";
|
|
5
|
+
import { ExtensionConfigSchema, PluginConfigSchema } from "./git-installs.js";
|
|
5
6
|
import { entryId } from "./internal.js";
|
|
6
7
|
import { NetdiskConfigSchema } from "./netdisk.js";
|
|
7
8
|
import { VpnConfigSchema } from "./vpn.js";
|
|
@@ -41,7 +42,8 @@ export type CapabilityState = z.infer<typeof CapabilityStateSchema>;
|
|
|
41
42
|
// Per-kind config. Secrets (an mcp token) live here and are denylisted like tools.json.
|
|
42
43
|
export const McpConfigSchema = z.object({
|
|
43
44
|
url: z.url().describe("Where the tool server answers."),
|
|
44
|
-
|
|
45
|
+
// A sign-in's session (schemas/mcp-sign-in.ts) is one JSON value holding both tokens, which the sandbox renews.
|
|
46
|
+
token: z.string().optional().describe("The credential it needs, if any: a pasted token, or a sign-in's session. Stored, never echoed back."),
|
|
45
47
|
});
|
|
46
48
|
// Gives the agent an authenticated CLI tool: credential plus any non-secret URL, injected into the agent's env each
|
|
47
49
|
// turn, taught via an .agents/skills/<id> cheatsheet. Provider fields are data in an extension's
|
|
@@ -56,61 +58,6 @@ export const CliConfigSchema = z
|
|
|
56
58
|
),
|
|
57
59
|
})
|
|
58
60
|
.catchall(z.string());
|
|
59
|
-
// A Claude Code plugin from a git repo; the daemon only owns the checkout, the Agent SDK's plugin loader reads its
|
|
60
|
-
// internals. `path` is a subdirectory for a plugin inside a larger checkout; `token` is https auth for a private repo.
|
|
61
|
-
export const PluginConfigSchema = z.object({
|
|
62
|
-
url: z.url().describe("The repository to take the plugin from."),
|
|
63
|
-
// Branch / tag / commit sha to install from; absent = the default branch's HEAD. Either way `commit` pins it.
|
|
64
|
-
ref: z
|
|
65
|
-
.string()
|
|
66
|
-
.min(1)
|
|
67
|
-
.optional()
|
|
68
|
-
.describe(
|
|
69
|
-
"A branch, tag or commit to install from. Leave it out for the default branch. The install pins the commit it names at that moment.",
|
|
70
|
-
),
|
|
71
|
-
path: z
|
|
72
|
-
.string()
|
|
73
|
-
.min(1)
|
|
74
|
-
.refine((value) => !value.split("/").includes(".."), { message: "path must stay inside the checkout" })
|
|
75
|
-
.optional()
|
|
76
|
-
.describe("Where inside the repository the plugin lives, for one that sits in a larger checkout."),
|
|
77
|
-
token: z.string().min(1).optional().describe("A credential for a private repository. Stored, never echoed back."),
|
|
78
|
-
// Set by the sandbox at install, never by the form: re-applying a stored entry (a rotated token, a migration)
|
|
79
|
-
// checks this out again, and only adding the plugin anew moves it.
|
|
80
|
-
commit: z
|
|
81
|
-
.string()
|
|
82
|
-
.regex(/^[0-9a-f]{40}$/, "commit must be a full 40-character commit sha")
|
|
83
|
-
.optional()
|
|
84
|
-
.describe(
|
|
85
|
-
"The exact commit installed, in full, resolved from the branch, tag or commit when the plugin was added. Its hooks run inside the agent's session, so it stays at this commit until it is added again.",
|
|
86
|
-
),
|
|
87
|
-
});
|
|
88
|
-
// An intentic extension from a git repo (UI bundle + agent contributions + processes). Unlike `plugin`, `ref` must be a
|
|
89
|
-
// full commit sha, since extension code runs trusted in the owner's browser and every update is a deliberate re-add at
|
|
90
|
-
// a new sha.
|
|
91
|
-
export const ExtensionConfigSchema = z.object({
|
|
92
|
-
url: z.url().describe("The repository to take the extension from."),
|
|
93
|
-
ref: z
|
|
94
|
-
.string()
|
|
95
|
-
.regex(/^[0-9a-f]{40}$/, "ref must be a full 40-character commit sha")
|
|
96
|
-
.describe(
|
|
97
|
-
"The exact commit to install, in full. Required rather than optional because extension code runs with your browser's trust: the owner approves precisely the code that runs, and an update is a deliberate re-install at a new commit.",
|
|
98
|
-
),
|
|
99
|
-
path: z
|
|
100
|
-
.string()
|
|
101
|
-
.min(1)
|
|
102
|
-
.refine((value) => !value.split("/").includes(".."), { message: "path must stay inside the checkout" })
|
|
103
|
-
.optional()
|
|
104
|
-
.describe("Where inside the repository the extension lives, for one that sits in a larger checkout."),
|
|
105
|
-
token: z.string().min(1).optional().describe("A credential for a private repository. Stored, never echoed back."),
|
|
106
|
-
// What update checks and advisories are read against; absent falls back to the official registry.
|
|
107
|
-
registry: z
|
|
108
|
-
.url()
|
|
109
|
-
.optional()
|
|
110
|
-
.describe(
|
|
111
|
-
"Which registry this install came from, which is what update checks and security advisories are read against. Absent falls back to the official one.",
|
|
112
|
-
),
|
|
113
|
-
});
|
|
114
61
|
// What lets the agent act as an administrator on the machine, the same for every way of signing in. Optional: most
|
|
115
62
|
// machines are reached as a user who needs no more. The password is vaulted like the login one (it is not echoed), so
|
|
116
63
|
// the agent spends it as `{{secret:<alias>/adminPassword}}` and never reads it; `adminPasswordOf` says whose it is,
|
|
@@ -389,6 +336,14 @@ export type WalletConfig = z.infer<typeof WalletConfigSchema>;
|
|
|
389
336
|
// create is only an approval while the agent cannot mint a claim behind it.
|
|
390
337
|
export const FleetConfigSchema = z.object({
|
|
391
338
|
token: z.string().min(1).describe("A provisioning token from Settings ▸ Tokens. Stored, never echoed back."),
|
|
339
|
+
// (2026-11-11) The platform's id for a token the editor minted for this card (its Allow), which tells it from one
|
|
340
|
+
// pasted in, perhaps shared with another sandbox: only a minted one is revoked when the card goes or its token is replaced.
|
|
341
|
+
tokenId: z
|
|
342
|
+
.string()
|
|
343
|
+
.min(1)
|
|
344
|
+
.max(100)
|
|
345
|
+
.optional()
|
|
346
|
+
.describe("The platform's id for a token minted for this card, revoked when the card is removed or its token replaced."),
|
|
392
347
|
});
|
|
393
348
|
export type FleetConfig = z.infer<typeof FleetConfigSchema>;
|
|
394
349
|
// Another of the owner's sandboxes this one may hand tasks to (schemas/links.ts). The token is an inbound link that
|
|
@@ -409,8 +364,6 @@ export const LinkConfigSchema = z.object({
|
|
|
409
364
|
export type LinkConfig = z.infer<typeof LinkConfigSchema>;
|
|
410
365
|
export type McpConfig = z.infer<typeof McpConfigSchema>;
|
|
411
366
|
export type CliConfig = z.infer<typeof CliConfigSchema>;
|
|
412
|
-
export type PluginConfig = z.infer<typeof PluginConfigSchema>;
|
|
413
|
-
export type ExtensionConfig = z.infer<typeof ExtensionConfigSchema>;
|
|
414
367
|
export type SshConfig = z.infer<typeof SshConfigSchema>;
|
|
415
368
|
export type DockerConfig = z.infer<typeof DockerConfigSchema>;
|
|
416
369
|
export type BrowserConfig = z.infer<typeof BrowserConfigSchema>;
|
|
@@ -554,6 +507,11 @@ export const CapabilityRefreshTokenInputSchema = z.object({
|
|
|
554
507
|
refreshToken: z.string().min(1).max(32768).describe("The new refresh token. Never echoed back."),
|
|
555
508
|
login: z.boolean().optional().describe("A fresh interactive sign-in rather than a rotation: restarts the card's listener."),
|
|
556
509
|
});
|
|
510
|
+
// POST /capabilities/{id}/oauth-access: an hour of access for a card signed in through the platform's own OAuth client.
|
|
511
|
+
export const CapabilityAccessTokenSchema = z.object({
|
|
512
|
+
accessToken: z.string().describe("Bearer for the provider's APIs, good for about an hour. Cache it; never store it on the card."),
|
|
513
|
+
expiresIn: z.number().describe("Seconds until it expires."),
|
|
514
|
+
});
|
|
557
515
|
// POST /capabilities/{id}/rename: a capability's id is the agent's handle for it (skill file, tool prefix, env suffix,
|
|
558
516
|
// ssh alias), so renaming is a migration, not a label edit. Which kinds may be renamed is the handler's own answer, not
|
|
559
517
|
// this schema's.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CapabilityKindSchema } from "./capabilities.js";
|
|
3
|
+
|
|
4
|
+
// A key the sandbox makes for a card whose service issues a certificate from a request (a field declaring `keyRequest`
|
|
5
|
+
// in its manifest): the form gets the request to send the issuer, and a stash marker (`stashedMarker`) for the field the
|
|
6
|
+
// private key goes in, the way a generated SSH key arrives. The key never reaches the browser.
|
|
7
|
+
|
|
8
|
+
// POST /capabilities/certificate-request.
|
|
9
|
+
export const CertificateRequestInputSchema = z.object({
|
|
10
|
+
kind: CapabilityKindSchema.describe("The kind of card the key is for."),
|
|
11
|
+
provider: z.string().min(1).optional().describe("For a kind several cards share, the card: a cli card's provider (`e-doreczenia`)."),
|
|
12
|
+
field: z.string().min(1).describe("The field declaring `keyRequest`, which the private key goes in."),
|
|
13
|
+
values: z
|
|
14
|
+
.record(z.string(), z.string())
|
|
15
|
+
.describe("The form's answers the request's subject is filled from (`keyRequest.subject`). Never a credential: only the fields the subject names are read."),
|
|
16
|
+
});
|
|
17
|
+
export type CertificateRequestInput = z.infer<typeof CertificateRequestInputSchema>;
|
|
18
|
+
|
|
19
|
+
export const CertificateRequestSchema = z.object({
|
|
20
|
+
request: z.string().describe("The PKCS#10 certificate signing request, armored (`-----BEGIN CERTIFICATE REQUEST-----`), to send the issuer."),
|
|
21
|
+
subject: z.string().describe("Its subject as the issuer reads it: `C=PL, O=…, CN=…`."),
|
|
22
|
+
token: z
|
|
23
|
+
.string()
|
|
24
|
+
.describe(
|
|
25
|
+
"Stands for the private key, which never leaves the sandbox. Sent wrapped as a marker in that field, it installs the key once, on the card it was made for; it lapses after thirty minutes.",
|
|
26
|
+
),
|
|
27
|
+
});
|
|
28
|
+
export type CertificateRequest = z.infer<typeof CertificateRequestSchema>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { parseJsonWith } from "@intentic/base/json";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
/* THE STEPS OF A MOVE BETWEEN COMPUTERS (2026-11-11, the `move-prepare`/`move-out`/`move-in` ops): the flow field the daemon
|
|
5
|
+
fills, and the lines both ics print, read by the daemon's move gate (sandboxes/move-gate.ts). */
|
|
6
|
+
|
|
7
|
+
// The plan is ic's own (`ic sandbox move-out --plan-only`), read here only for what the owner's card says: loose, so
|
|
8
|
+
// everything ic put in it reaches the target's ic unchanged, and the target's ic checks it whole.
|
|
9
|
+
export const DeviceMovePlanSchema = z.looseObject({
|
|
10
|
+
v: z.number().int(),
|
|
11
|
+
slug: z.string().min(1),
|
|
12
|
+
// Every byte the copy carries: the volumes, and an image the target cannot pull or build.
|
|
13
|
+
bytes: z.number().nonnegative(),
|
|
14
|
+
running: z.boolean().optional(),
|
|
15
|
+
});
|
|
16
|
+
export type DeviceMovePlan = z.infer<typeof DeviceMovePlanSchema>;
|
|
17
|
+
// One `intentic-move: {json}` line either ic prints during a move: its step, and the fields the daemon reads. Loose,
|
|
18
|
+
// since each step carries fields of its own (a volume's `done`/`total`) that are only relayed.
|
|
19
|
+
export const DeviceMoveStepSchema = z.looseObject({
|
|
20
|
+
step: z.string().min(1),
|
|
21
|
+
plan: DeviceMovePlanSchema.optional(),
|
|
22
|
+
publicKey: z.string().optional(),
|
|
23
|
+
listen: z.array(z.string()).optional(),
|
|
24
|
+
port: z.number().int().positive().optional(),
|
|
25
|
+
reason: z.string().optional(),
|
|
26
|
+
// On the source's `failed`: everything was sent and the connection broke before the target's verdict, so the source
|
|
27
|
+
// stays stopped rather than risk two copies running; the daemon starts it again only if the target failed.
|
|
28
|
+
ambiguous: z.boolean().optional(),
|
|
29
|
+
});
|
|
30
|
+
export type DeviceMoveStep = z.infer<typeof DeviceMoveStepSchema>;
|
|
31
|
+
const DEVICE_MOVE_LINE_PREFIX = "intentic-move: ";
|
|
32
|
+
// The step a printed line carries, or undefined for narration (and for a marker that is not one, printed as it came).
|
|
33
|
+
export const deviceMoveStepOf = (text: string): DeviceMoveStep | undefined => {
|
|
34
|
+
if (!text.startsWith(DEVICE_MOVE_LINE_PREFIX)) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return parseJsonWith(text.slice(DEVICE_MOVE_LINE_PREFIX.length), DeviceMoveStepSchema);
|
|
38
|
+
};
|
|
39
|
+
// The move ops' own fields, daemon-filled and never the caller's. `id` names the move on both computers (ic's journal
|
|
40
|
+
// and the file `move-in` hands the key through). `stage` says which half of `move-out` runs: the read-only `plan`
|
|
41
|
+
// before the owner's card, or the `send`. `plan` is the source ic's own answer, carried verbatim to the target, which
|
|
42
|
+
// checks it again. `peer` is the other side's ephemeral public key, which only the daemon carries between the flows;
|
|
43
|
+
// marked secret so no log or view prints it, though it is no secret (the move's keys never leave either process).
|
|
44
|
+
// `connect` is where the target listens, `listen` lets the source fall back to a loopback port the daemon relays.
|
|
45
|
+
export const DeviceSandboxMoveSchema = z.strictObject({
|
|
46
|
+
id: z.string().regex(/^[0-9a-f]{8,64}$/),
|
|
47
|
+
stage: z.enum(["plan", "send"]).optional(),
|
|
48
|
+
plan: DeviceMovePlanSchema.optional(),
|
|
49
|
+
peer: z.string().min(1).optional().meta({ secret: true }),
|
|
50
|
+
connect: z.array(z.string().min(1)).optional(),
|
|
51
|
+
listen: z.boolean().optional(),
|
|
52
|
+
manager: z.enum(["ic", "compose"]).optional(),
|
|
53
|
+
});
|
|
54
|
+
export type DeviceSandboxMove = z.infer<typeof DeviceSandboxMoveSchema>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
// A connection's form signing in on its own with a device code (RFC 8628), for a card whose field declares `signIn` and
|
|
4
|
+
// whose manifest says how (`refreshToken.deviceCode`): the provider's endpoints answer no browser, so the sandbox asks
|
|
5
|
+
// for the code, and it is the sandbox that asks the provider, while a wait is open, whether the person has finished on
|
|
6
|
+
// its page. The token never reaches the browser: the form gets a stash marker (`stashedMarker`, schemas/capabilities.ts)
|
|
7
|
+
// for the field, the same way a generated SSH key arrives, and the add that saves the form installs it.
|
|
8
|
+
|
|
9
|
+
// POST /capabilities/device-sign-in: starts one; the form shows the code with the page and waits on `flow`.
|
|
10
|
+
export const DeviceSignInStartSchema = z.object({
|
|
11
|
+
flow: z.string().describe("Stands for this sign-in, to wait on. Lapses with the code."),
|
|
12
|
+
userCode: z.string().describe("What the person types on the provider's page."),
|
|
13
|
+
verificationUri: z.string().describe("The provider's own page for it, to open in a new tab."),
|
|
14
|
+
expiresIn: z.number().describe("Seconds until the code lapses."),
|
|
15
|
+
});
|
|
16
|
+
export type DeviceSignInStart = z.infer<typeof DeviceSignInStartSchema>;
|
|
17
|
+
|
|
18
|
+
// POST /capabilities/device-sign-in/wait: answers as soon as the sign-in ends, or `waiting` after a while.
|
|
19
|
+
export const DeviceSignInWaitInputSchema = z.object({ flow: z.string().min(1).describe("The sign-in, as its start answered.") });
|
|
20
|
+
export const DeviceSignInWaitSchema = z.discriminatedUnion("state", [
|
|
21
|
+
z.object({ state: z.literal("waiting").describe("Nobody has finished on the provider's page yet. Ask again.") }),
|
|
22
|
+
z.object({
|
|
23
|
+
state: z.literal("done"),
|
|
24
|
+
token: z
|
|
25
|
+
.string()
|
|
26
|
+
.describe(
|
|
27
|
+
"Stands for the refresh token, which never leaves the sandbox. Sent wrapped as a stash marker in the field that declares `signIn`, it installs that token once, while the fields the sign-in is bound to still hold what they held; it lapses after thirty minutes.",
|
|
28
|
+
),
|
|
29
|
+
who: z.string().optional().describe("Who signed in, as the card's own test or the sign-in itself names them."),
|
|
30
|
+
granted: z.array(z.string()).describe("What the provider granted, each permission by its short name (`Mail.Read`)."),
|
|
31
|
+
bound: z
|
|
32
|
+
.array(z.string())
|
|
33
|
+
.describe("The fields the sign-in is only good for as they are now (`refreshToken.boundTo`): changing one before Save needs a new sign-in."),
|
|
34
|
+
}),
|
|
35
|
+
z.object({ state: z.literal("failed"), message: z.string().describe("Why it did not finish, in words a person can act on.") }),
|
|
36
|
+
]);
|
|
37
|
+
export type DeviceSignInWait = z.infer<typeof DeviceSignInWaitSchema>;
|
package/src/schemas/devices.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
type SandboxShapeWhen,
|
|
10
10
|
} from "./device-resources.js";
|
|
11
11
|
import { PortNumberSchema } from "./device-commands.js";
|
|
12
|
+
import { DeviceSandboxMoveSchema } from "./device-move.js";
|
|
12
13
|
import { DeviceBridgeHoldSchema, DeviceConflictSchema, DeviceCopySchema, DeviceLowDiskSchema } from "./device-folder.js";
|
|
13
14
|
import { parseHostConnection, type DeviceFacts, DeviceFactsSchema, MachineIdentitySchema, MachineIdSchema, userDistrosOf, WslEnvironmentSchema } from "./hosts.js";
|
|
14
15
|
import { EgressOwnerKeysSchema, EgressPolicySchema, EgressProofSchema, EgressStatusSchema } from "./egress.js";
|
|
@@ -117,6 +118,13 @@ export const DeviceSandboxOpSchema = z.enum([
|
|
|
117
118
|
"create",
|
|
118
119
|
"runner-up",
|
|
119
120
|
"runner-remove",
|
|
121
|
+
// (2026-11-11) A sandbox carried to another of the owner's computers (`sandboxes move`, the daemon's move-gate.ts),
|
|
122
|
+
// each through `ic` with the flow's `move` object: `move-out` on the computer that runs it (its plan, then the send),
|
|
123
|
+
// `move-prepare` on the one it goes to (checks, image, then the receive, one long run), and `move-in` there to hand
|
|
124
|
+
// the waiting receive the sender's public key. Sent only to an agent advertising `sandbox-move`.
|
|
125
|
+
"move-prepare",
|
|
126
|
+
"move-out",
|
|
127
|
+
"move-in",
|
|
120
128
|
]);
|
|
121
129
|
export type DeviceSandboxOp = z.infer<typeof DeviceSandboxOpSchema>;
|
|
122
130
|
// STRICT, like every input a device is sent: an agent rejects a field it does not know instead of dropping it and doing
|
|
@@ -162,6 +170,8 @@ export const DeviceSandboxFlowSchema = z.strictObject({
|
|
|
162
170
|
definition: z.string().optional(),
|
|
163
171
|
overlay: z.string().optional(),
|
|
164
172
|
overlayHash: z.string().optional(),
|
|
173
|
+
// The three move ops only, daemon-filled (DeviceSandboxMoveSchema).
|
|
174
|
+
move: DeviceSandboxMoveSchema.optional(),
|
|
165
175
|
});
|
|
166
176
|
export type DeviceSandboxFlow = z.infer<typeof DeviceSandboxFlowSchema>;
|
|
167
177
|
// The `ic` argv for the shape and power ops, the one place any caller spells them: the machine agent runs it and the
|
|
@@ -211,6 +221,7 @@ export type DeviceAgentFlow = z.infer<typeof DeviceAgentFlowSchema>;
|
|
|
211
221
|
export const DeviceAgentFlowInputSchema = DeviceAgentFlowSchema.extend({ id: z.string().min(1) });
|
|
212
222
|
export type DeviceAgentFlowInput = z.infer<typeof DeviceAgentFlowInputSchema>;
|
|
213
223
|
export * from "./device-commands.js";
|
|
224
|
+
export * from "./device-move.js";
|
|
214
225
|
|
|
215
226
|
// What a synced folder reports beyond Mutagen's word, its conflicts and what the device holds back (device-folder.ts).
|
|
216
227
|
export * from "./device-folder.js";
|
|
@@ -17,6 +17,13 @@ export const RemoteRefsRequestSchema = z.object({
|
|
|
17
17
|
.min(1)
|
|
18
18
|
.optional()
|
|
19
19
|
.describe("Which connection a VAULTED token belongs to. Ignored when a real token is sent."),
|
|
20
|
+
gitConnection: z
|
|
21
|
+
.string()
|
|
22
|
+
.min(1)
|
|
23
|
+
.optional()
|
|
24
|
+
.describe(
|
|
25
|
+
"The GitHub or GitLab connection, by its id, whose token reads a private repository on its host, as the install will. Used when no token is sent; left out, the first such connection by id is used.",
|
|
26
|
+
),
|
|
20
27
|
});
|
|
21
28
|
|
|
22
29
|
export const RemoteRefSchema = z.object({
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// The two capability kinds installed from a git repository, a Claude Code plugin and an intentic extension: their
|
|
2
|
+
// config arms of CapabilitySchema (capabilities.ts), with the repository, the version and the credential each reads it
|
|
3
|
+
// with.
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { entryId } from "./internal.js";
|
|
6
|
+
|
|
7
|
+
// (2026-11-11) A plugin's or extension's GitHub or GitLab card, named so a second card for the same host never changes
|
|
8
|
+
// which account an install reads with; absent, policy/git/git-connections.ts picks one.
|
|
9
|
+
const gitConnection = entryId
|
|
10
|
+
.optional()
|
|
11
|
+
.describe(
|
|
12
|
+
"The GitHub or GitLab connection, by its id, whose token reads a private repository on its host. Used when no token is given; left out, the first such connection by id is used, and none means the repository is read without a credential.",
|
|
13
|
+
);
|
|
14
|
+
// A Claude Code plugin from a git repo; the daemon only owns the checkout, the Agent SDK's plugin loader reads its
|
|
15
|
+
// internals. `path` is a subdirectory for a plugin inside a larger checkout; `token` is https auth for a private repo.
|
|
16
|
+
export const PluginConfigSchema = z.object({
|
|
17
|
+
url: z.url().describe("The repository to take the plugin from."),
|
|
18
|
+
// Branch / tag / commit sha to install from; absent = the default branch's HEAD. Either way `commit` pins it.
|
|
19
|
+
ref: z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe(
|
|
24
|
+
"A branch, tag or commit to install from. Leave it out for the default branch. The install pins the commit it names at that moment.",
|
|
25
|
+
),
|
|
26
|
+
path: z
|
|
27
|
+
.string()
|
|
28
|
+
.min(1)
|
|
29
|
+
.refine((value) => !value.split("/").includes(".."), { message: "path must stay inside the checkout" })
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Where inside the repository the plugin lives, for one that sits in a larger checkout."),
|
|
32
|
+
token: z.string().min(1).optional().describe("A credential for a private repository. Stored, never echoed back."),
|
|
33
|
+
gitConnection,
|
|
34
|
+
// Set by the sandbox at install, never by the form: re-applying a stored entry (a rotated token, a migration)
|
|
35
|
+
// checks this out again, and only adding the plugin anew moves it.
|
|
36
|
+
commit: z
|
|
37
|
+
.string()
|
|
38
|
+
.regex(/^[0-9a-f]{40}$/, "commit must be a full 40-character commit sha")
|
|
39
|
+
.optional()
|
|
40
|
+
.describe(
|
|
41
|
+
"The exact commit installed, in full, resolved from the branch, tag or commit when the plugin was added. Its hooks run inside the agent's session, so it stays at this commit until it is added again.",
|
|
42
|
+
),
|
|
43
|
+
});
|
|
44
|
+
export type PluginConfig = z.infer<typeof PluginConfigSchema>;
|
|
45
|
+
// An intentic extension from a git repo (UI bundle + agent contributions + processes). Unlike `plugin`, `ref` must be a
|
|
46
|
+
// full commit sha, since extension code runs trusted in the owner's browser and every update is a deliberate re-add at
|
|
47
|
+
// a new sha.
|
|
48
|
+
export const ExtensionConfigSchema = z.object({
|
|
49
|
+
url: z.url().describe("The repository to take the extension from."),
|
|
50
|
+
ref: z
|
|
51
|
+
.string()
|
|
52
|
+
.regex(/^[0-9a-f]{40}$/, "ref must be a full 40-character commit sha")
|
|
53
|
+
.describe(
|
|
54
|
+
"The exact commit to install, in full. Required rather than optional because extension code runs with your browser's trust: the owner approves precisely the code that runs, and an update is a deliberate re-install at a new commit.",
|
|
55
|
+
),
|
|
56
|
+
path: z
|
|
57
|
+
.string()
|
|
58
|
+
.min(1)
|
|
59
|
+
.refine((value) => !value.split("/").includes(".."), { message: "path must stay inside the checkout" })
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("Where inside the repository the extension lives, for one that sits in a larger checkout."),
|
|
62
|
+
token: z.string().min(1).optional().describe("A credential for a private repository. Stored, never echoed back."),
|
|
63
|
+
gitConnection,
|
|
64
|
+
// What update checks and advisories are read against; absent falls back to the official registry.
|
|
65
|
+
registry: z
|
|
66
|
+
.url()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe(
|
|
69
|
+
"Which registry this install came from, which is what update checks and security advisories are read against. Absent falls back to the official one.",
|
|
70
|
+
),
|
|
71
|
+
});
|
|
72
|
+
export type ExtensionConfig = z.infer<typeof ExtensionConfigSchema>;
|
package/src/schemas/hosts.ts
CHANGED
|
@@ -189,6 +189,9 @@ export const DeviceFeatureSchema = z.enum([
|
|
|
189
189
|
// (2026-11-10) `dialLoopback` with a `host`: the agent dials a host on its own network, not only its loopback
|
|
190
190
|
// (`devices reach <device> <host>:<port>`, a network disk reached through a computer).
|
|
191
191
|
"reach-network",
|
|
192
|
+
// (2026-11-11) The `move-prepare`, `move-out` and `move-in` ops: an agent that has them driving an ic that says
|
|
193
|
+
// `sandbox-move` (`ic sandbox move-out` / `move-in`), so a sandbox can be carried to another of the owner's computers.
|
|
194
|
+
"sandbox-move",
|
|
192
195
|
]);
|
|
193
196
|
export type DeviceFeature = z.infer<typeof DeviceFeatureSchema>;
|
|
194
197
|
export const DEVICE_FEATURE_RESHAPE_LATER: DeviceFeature = "reshape-later";
|
|
@@ -203,6 +206,7 @@ export const DEVICE_FEATURE_SLEEP: DeviceFeature = "sleep";
|
|
|
203
206
|
export const DEVICE_FEATURE_EGRESS: DeviceFeature = "egress";
|
|
204
207
|
export const DEVICE_FEATURE_REACHABLE_WAYS_BACK: DeviceFeature = "reachable-ways-back";
|
|
205
208
|
export const DEVICE_FEATURE_REACH_NETWORK: DeviceFeature = "reach-network";
|
|
209
|
+
export const DEVICE_FEATURE_SANDBOX_MOVE: DeviceFeature = "sandbox-move";
|
|
206
210
|
// What `ic features --json` answers (_sandbox/ic/src/features.rs, golden/ic-features.json): the optional ops that ic
|
|
207
211
|
// implements, as strings, since a newer ic's word means nothing to an older agent.
|
|
208
212
|
export const IcFeaturesAnswerSchema = z.object({ features: z.array(z.string()) });
|