@intentic/sandbox-contract 1.244.0 → 1.246.1
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/README.md +17 -1
- package/dist/batch-runs.d.ts +32 -0
- package/dist/batch-runs.d.ts.map +1 -0
- package/dist/batch-runs.js +43 -0
- package/dist/batch-runs.js.map +1 -0
- package/dist/command-classes.d.ts +6 -3
- package/dist/command-classes.d.ts.map +1 -1
- package/dist/command-classes.js +43 -18
- package/dist/command-classes.js.map +1 -1
- package/dist/contracts/{cursor.contract.d.ts → accounts.contract.d.ts} +102 -3
- package/dist/contracts/accounts.contract.d.ts.map +1 -0
- package/dist/contracts/accounts.contract.js +61 -0
- package/dist/contracts/accounts.contract.js.map +1 -0
- package/dist/contracts/agents.contract.d.ts +121 -0
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +4 -4
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/ci.contract.d.ts +2 -0
- package/dist/contracts/ci.contract.d.ts.map +1 -1
- package/dist/contracts/host.contract.d.ts +35 -0
- package/dist/contracts/host.contract.d.ts.map +1 -1
- package/dist/contracts/host.contract.js +3 -2
- package/dist/contracts/host.contract.js.map +1 -1
- package/dist/contracts/personas.contract.d.ts +4 -2
- package/dist/contracts/personas.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +2 -2
- package/dist/contracts/settings.contract.d.ts +2 -51
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.d.ts +52 -2
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +26 -17
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/definition.d.ts +4 -8
- package/dist/definition.d.ts.map +1 -1
- package/dist/documents.d.ts +0 -1
- package/dist/documents.d.ts.map +1 -1
- package/dist/documents.js +1 -2
- package/dist/documents.js.map +1 -1
- package/dist/embed.d.ts +23 -0
- package/dist/embed.d.ts.map +1 -0
- package/dist/embed.js +84 -0
- package/dist/embed.js.map +1 -0
- package/dist/events.d.ts +21 -0
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +5 -2
- package/dist/events.js.map +1 -1
- package/dist/history-state.d.ts.map +1 -1
- package/dist/history-state.js +2 -0
- package/dist/history-state.js.map +1 -1
- package/dist/index.d.ts +354 -335
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -13
- package/dist/index.js.map +1 -1
- package/dist/peer-dial.d.ts +33 -0
- package/dist/peer-dial.d.ts.map +1 -0
- package/dist/peer-dial.js +79 -0
- package/dist/peer-dial.js.map +1 -0
- package/dist/peer-mcp-server.d.ts +36 -0
- package/dist/peer-mcp-server.d.ts.map +1 -0
- package/dist/peer-mcp-server.js +71 -0
- package/dist/peer-mcp-server.js.map +1 -0
- package/dist/provider-specs.d.ts +38 -20
- package/dist/provider-specs.d.ts.map +1 -1
- package/dist/provider-specs.js +39 -13
- package/dist/provider-specs.js.map +1 -1
- package/dist/quick-model.d.ts.map +1 -1
- package/dist/quick-model.js +2 -1
- package/dist/quick-model.js.map +1 -1
- package/dist/runtime-state.d.ts +1 -1
- package/dist/runtime-state.js +1 -1
- package/dist/runtime-state.js.map +1 -1
- package/dist/safety-policy.d.ts +12 -3
- package/dist/safety-policy.d.ts.map +1 -1
- package/dist/safety-policy.js +30 -5
- package/dist/safety-policy.js.map +1 -1
- package/dist/schemas/agent.d.ts +6 -6
- package/dist/schemas/agent.d.ts.map +1 -1
- package/dist/schemas/agent.js +6 -2
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents.d.ts +42 -0
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +25 -4
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/automations.d.ts +11 -2
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/automations.js +1 -1
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/ci.d.ts +6 -0
- package/dist/schemas/ci.d.ts.map +1 -1
- package/dist/schemas/ci.js +3 -2
- package/dist/schemas/ci.js.map +1 -1
- package/dist/schemas/context.d.ts +30 -0
- package/dist/schemas/context.d.ts.map +1 -0
- package/dist/schemas/context.js +34 -0
- package/dist/schemas/context.js.map +1 -0
- package/dist/schemas/{computers.d.ts → devices.d.ts} +155 -61
- package/dist/schemas/devices.d.ts.map +1 -0
- package/dist/schemas/devices.js +157 -0
- package/dist/schemas/devices.js.map +1 -0
- package/dist/schemas/hosts.d.ts +12 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +1 -0
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/issues.d.ts +0 -5
- package/dist/schemas/issues.d.ts.map +1 -1
- package/dist/schemas/issues.js +0 -1
- package/dist/schemas/issues.js.map +1 -1
- package/dist/schemas/personas.d.ts +5 -3
- package/dist/schemas/personas.d.ts.map +1 -1
- package/dist/schemas/personas.js +3 -2
- package/dist/schemas/personas.js.map +1 -1
- package/dist/schemas/provider-oauth.d.ts +48 -16
- package/dist/schemas/provider-oauth.d.ts.map +1 -1
- package/dist/schemas/provider-oauth.js +22 -20
- package/dist/schemas/provider-oauth.js.map +1 -1
- package/dist/schemas/settings.d.ts +1 -52
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +8 -11
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/terminal.js +9 -9
- package/dist/schemas/terminal.js.map +1 -1
- package/dist/schemas/usage.d.ts +0 -2
- package/dist/schemas/usage.d.ts.map +1 -1
- package/dist/schemas/usage.js +0 -2
- package/dist/schemas/usage.js.map +1 -1
- package/dist/shell-regions.d.ts +4 -0
- package/dist/shell-regions.d.ts.map +1 -0
- package/dist/shell-regions.js +156 -0
- package/dist/shell-regions.js.map +1 -0
- package/dist/workspace-state.d.ts +15 -0
- package/dist/workspace-state.d.ts.map +1 -1
- package/dist/workspace-state.js +21 -5
- package/dist/workspace-state.js.map +1 -1
- package/package.json +48 -4
- package/src/agent-catalog.ts +1 -1
- package/src/arrival.ts +3 -3
- package/src/batch-runs.test.ts +167 -0
- package/src/batch-runs.ts +181 -0
- package/src/command-classes.test.ts +195 -71
- package/src/command-classes.ts +148 -46
- package/src/contracts/accounts.contract.ts +94 -0
- package/src/contracts/agents.contract.ts +4 -3
- package/src/contracts/exit.contract.ts +2 -2
- package/src/contracts/host.contract.ts +17 -5
- package/src/contracts/settings.contract.ts +1 -1
- package/src/contracts/system.contract.ts +43 -24
- package/src/contracts/vpn.contract.ts +2 -2
- package/src/documents.test.ts +2 -1
- package/src/documents.ts +7 -11
- package/src/embed.test.ts +68 -0
- package/src/embed.ts +164 -0
- package/src/events.ts +30 -3
- package/src/history-state.ts +12 -3
- package/src/host-protocol.ts +2 -2
- package/src/index.ts +6 -14
- package/src/model-order.ts +1 -1
- package/src/peer-dial.test.ts +203 -0
- package/src/peer-dial.ts +163 -0
- package/src/peer-mcp-server.test.ts +104 -0
- package/src/peer-mcp-server.ts +144 -0
- package/src/provider-specs.test.ts +44 -17
- package/src/provider-specs.ts +147 -67
- package/src/quick-model.ts +10 -3
- package/src/routes.test.ts +6 -3
- package/src/runner-protocol.ts +1 -1
- package/src/runtime-state.ts +2 -2
- package/src/safety-policy.test.ts +88 -0
- package/src/safety-policy.ts +84 -14
- package/src/schemas/agent.ts +41 -13
- package/src/schemas/agents.ts +65 -4
- package/src/schemas/automations.ts +6 -4
- package/src/schemas/capabilities.ts +4 -4
- package/src/schemas/ci.ts +23 -6
- package/src/schemas/context.ts +87 -0
- package/src/schemas/{computers.ts → devices.ts} +201 -109
- package/src/schemas/hosts.ts +5 -1
- package/src/schemas/issues.ts +0 -4
- package/src/schemas/personas.ts +8 -3
- package/src/schemas/provider-oauth.ts +49 -52
- package/src/schemas/settings.ts +30 -54
- package/src/schemas/terminal.ts +12 -12
- package/src/schemas/usage.ts +3 -27
- package/src/schemas/version-seam.test.ts +0 -1
- package/src/shell-regions.ts +289 -0
- package/src/versions.ts +2 -2
- package/src/webext-links.ts +2 -2
- package/src/webext-protocol.ts +2 -2
- package/src/workspace-state.test.ts +55 -1
- package/src/workspace-state.ts +76 -11
- package/dist/contracts/claude.contract.d.ts +0 -91
- package/dist/contracts/claude.contract.d.ts.map +0 -1
- package/dist/contracts/claude.contract.js +0 -50
- package/dist/contracts/claude.contract.js.map +0 -1
- package/dist/contracts/cursor.contract.d.ts.map +0 -1
- package/dist/contracts/cursor.contract.js +0 -50
- package/dist/contracts/cursor.contract.js.map +0 -1
- package/dist/contracts/grok.contract.d.ts +0 -36
- package/dist/contracts/grok.contract.d.ts.map +0 -1
- package/dist/contracts/grok.contract.js +0 -31
- package/dist/contracts/grok.contract.js.map +0 -1
- package/dist/contracts/keys.contract.d.ts +0 -81
- package/dist/contracts/keys.contract.d.ts.map +0 -1
- package/dist/contracts/keys.contract.js +0 -51
- package/dist/contracts/keys.contract.js.map +0 -1
- package/dist/schemas/computers.d.ts.map +0 -1
- package/dist/schemas/computers.js +0 -134
- package/dist/schemas/computers.js.map +0 -1
- package/src/contracts/claude.contract.ts +0 -71
- package/src/contracts/cursor.contract.ts +0 -74
- package/src/contracts/grok.contract.ts +0 -41
- package/src/contracts/keys.contract.ts +0 -79
package/README.md
CHANGED
|
@@ -19,6 +19,15 @@ mismatch is a type error rather than a runtime surprise.
|
|
|
19
19
|
a phone say the same thing about the same push.
|
|
20
20
|
- Define workflow designs and immutable run snapshots, including full model/account/harness pins, per-step spend
|
|
21
21
|
ceilings, pinned repository bases, bounded report previews, and complete-report artifact paths.
|
|
22
|
+
- Hold the embeds' half of the public doors (the daemon's `automations/public-door.ts`): `src/embed.ts`, its
|
|
23
|
+
own entry point and import-free on purpose, is what the Front Desk widget and the bug reporter both do before
|
|
24
|
+
they do anything of their own — the door's three calls, the proof-of-work solver, the localStorage id, the
|
|
25
|
+
script-tag boot.
|
|
26
|
+
- Hold the far end of the peer doors (the daemon's `peers/`): the hello each peer sends (`host-protocol.ts`,
|
|
27
|
+
`webext-protocol.ts`, `runner-protocol.ts`), the one outbound socket loop every peer runs
|
|
28
|
+
(`src/peer-dial.ts`, its own entry point) and the MCP tool server a device or a browser answers over it
|
|
29
|
+
(`src/peer-mcp-server.ts`, its own entry point). Runtime-neutral by construction, since one of those peers is
|
|
30
|
+
an MV3 service worker.
|
|
22
31
|
|
|
23
32
|
## Key files
|
|
24
33
|
|
|
@@ -70,11 +79,18 @@ mismatch is a type error rather than a runtime surprise.
|
|
|
70
79
|
access and vendor tables, the plan-limit list, the routed-provider enum and its accounts schema, the
|
|
71
80
|
daemon's CLIProxyAPI id map, and the web's account tabs and readiness rules. A row carries the two axes it
|
|
72
81
|
deliberately keeps apart: what a turn COSTS (`access`) and what the user CONNECTS (`auth`: an OAuth account
|
|
73
|
-
this daemon stores, a subscription the bundled translator holds, or
|
|
82
|
+
this daemon stores, a subscription the bundled translator holds, or a sign-in that MINTS the vendor's own
|
|
83
|
+
API key, which then carries its estates' base URLs — Z.ai sells one plan through two of them and a key
|
|
84
|
+
minted on one is refused by the other's host).
|
|
74
85
|
`brand` is typed against the marks in `@intentic/constants`, so a provider added without a logo does not
|
|
75
86
|
compile. **Adding a provider is a row here**, its brand path, and (daemon-side) one line in the provider
|
|
76
87
|
registry; `provider-specs.test.ts` walks the table rather than a list, so the guard covers a provider the
|
|
77
88
|
day it is added.
|
|
89
|
+
- [src/contracts/accounts.contract.ts](src/contracts/accounts.contract.ts): the accounts the sandbox holds
|
|
90
|
+
itself, one route family with the provider as a parameter (`/accounts/{provider}`), the lesson the
|
|
91
|
+
catalog route learned applied to sign-ins: start, complete, cancel, list, rename, disconnect are the same
|
|
92
|
+
six verbs for every provider, and `LoginStart` (schemas/provider-oauth.ts) is the one sign-in shape,
|
|
93
|
+
whose `flow` says how an attempt ENDS (device, redirect, paste). Nothing redeemable is on any answer.
|
|
78
94
|
- [src/agent-catalog.ts](src/agent-catalog.ts): the shapes each surface reads that table in, plus the rules
|
|
79
95
|
that are about something other than a provider (the trial, the endpoint namespace, the effort and fast-mode
|
|
80
96
|
gates). Shared because both sides act on it: the daemon composes a turn's instructions and skill discovery
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface BatchRunKind {
|
|
2
|
+
readonly runsDir: string;
|
|
3
|
+
readonly prefix: string;
|
|
4
|
+
readonly scanRuns: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const batchRunIdAt: (epochMs: number) => string;
|
|
7
|
+
export declare const batchConversationId: (kind: BatchRunKind, runId: string, item?: string) => string;
|
|
8
|
+
export declare const batchRunPrefix: (kind: BatchRunKind) => string;
|
|
9
|
+
export declare const batchRunsDir: (kind: BatchRunKind) => string;
|
|
10
|
+
export declare const batchRunDir: (kind: BatchRunKind, runId: string) => string;
|
|
11
|
+
export declare const batchRunManifestPath: (kind: BatchRunKind, runId: string) => string;
|
|
12
|
+
export declare const batchItemDir: (kind: BatchRunKind, runId: string, item?: string) => string;
|
|
13
|
+
export declare const batchResultPath: (kind: BatchRunKind, runId: string, item?: string) => string;
|
|
14
|
+
export declare const parseBatchFile: <T>(text: string, shape: (value: Record<string, unknown>) => T | undefined) => T | undefined;
|
|
15
|
+
export declare const batchReportingClause: (params: {
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly fields: string;
|
|
18
|
+
readonly outcomes?: string | undefined;
|
|
19
|
+
}) => string;
|
|
20
|
+
export interface BatchTurnPick {
|
|
21
|
+
readonly provider: string;
|
|
22
|
+
readonly model?: string | undefined;
|
|
23
|
+
readonly effort?: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
export declare const batchTurnBody: (params: {
|
|
26
|
+
readonly prompt: string;
|
|
27
|
+
readonly title: string;
|
|
28
|
+
readonly conversationId: string;
|
|
29
|
+
readonly pick?: BatchTurnPick | undefined;
|
|
30
|
+
readonly extra?: Readonly<Record<string, unknown>> | undefined;
|
|
31
|
+
}) => Record<string, unknown>;
|
|
32
|
+
//# sourceMappingURL=batch-runs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED,eAAO,MAAM,aAAa,WAAY;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;CAClE,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAcxB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { STATE_DIR } from "@intentic/constants";
|
|
2
|
+
const CONVERSATION_ID_MAX = 64;
|
|
3
|
+
const TIME_DIGITS = 8;
|
|
4
|
+
let sequence = 0;
|
|
5
|
+
export const batchRunIdAt = (epochMs) => `r${epochMs.toString(36).padStart(TIME_DIGITS, `0`)}${(sequence++).toString(36)}`;
|
|
6
|
+
export const batchConversationId = (kind, runId, item) => `${kind.prefix}-${runId}${item === undefined ? `` : `-${item}`}`.slice(0, CONVERSATION_ID_MAX).replace(/[-_]+$/u, ``);
|
|
7
|
+
export const batchRunPrefix = (kind) => `${kind.prefix}-`;
|
|
8
|
+
export const batchRunsDir = (kind) => `${STATE_DIR}/${kind.runsDir}`;
|
|
9
|
+
export const batchRunDir = (kind, runId) => `${batchRunsDir(kind)}/${runId}`;
|
|
10
|
+
export const batchRunManifestPath = (kind, runId) => `${batchRunDir(kind, runId)}/run.json`;
|
|
11
|
+
export const batchItemDir = (kind, runId, item) => item === undefined ? batchRunDir(kind, runId) : `${batchRunDir(kind, runId)}/${item}`;
|
|
12
|
+
export const batchResultPath = (kind, runId, item) => `${batchItemDir(kind, runId, item)}/result.json`;
|
|
13
|
+
export const parseBatchFile = (text, shape) => {
|
|
14
|
+
try {
|
|
15
|
+
const parsed = JSON.parse(text);
|
|
16
|
+
return typeof parsed !== `object` || parsed === null ? undefined : shape(parsed);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export const batchReportingClause = (params) => [
|
|
23
|
+
`When you are finished, write your conclusion to ${params.path} as JSON:`,
|
|
24
|
+
params.fields,
|
|
25
|
+
...(params.outcomes === undefined ? [] : [params.outcomes]),
|
|
26
|
+
`Write that file even if you conclude there was nothing to do.`,
|
|
27
|
+
].join(`\n\n`);
|
|
28
|
+
export const batchTurnBody = (params) => ({
|
|
29
|
+
prompt: params.prompt,
|
|
30
|
+
title: params.title.slice(0, 80),
|
|
31
|
+
conversationId: params.conversationId,
|
|
32
|
+
isolated: true,
|
|
33
|
+
unattended: true,
|
|
34
|
+
...(params.pick === undefined
|
|
35
|
+
? {}
|
|
36
|
+
: {
|
|
37
|
+
agent: params.pick.provider,
|
|
38
|
+
...(params.pick.model === undefined ? {} : { model: params.pick.model }),
|
|
39
|
+
...(params.pick.effort === undefined ? {} : { effort: params.pick.effort }),
|
|
40
|
+
}),
|
|
41
|
+
...params.extra,
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=batch-runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-runs.js","sourceRoot":"","sources":["../src/batch-runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAuDhD,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAe/B,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,IAAI,OAAO,CAAC,QAAQ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AC3B,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACxE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;SAC9E,CAAC;IACR,GAAG,MAAM,CAAC,KAAK;CAClB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CommandClass } from "./schemas/agent.js";
|
|
1
|
+
import { type CommandClass, type CommandLocus } from "./schemas/agent.js";
|
|
2
2
|
export interface CommandSpan {
|
|
3
3
|
readonly start: number;
|
|
4
4
|
readonly end: number;
|
|
@@ -6,12 +6,15 @@ export interface CommandSpan {
|
|
|
6
6
|
export interface CommandMatch {
|
|
7
7
|
readonly commandClass: CommandClass;
|
|
8
8
|
readonly spans: readonly CommandSpan[];
|
|
9
|
+
readonly live: boolean;
|
|
9
10
|
}
|
|
10
11
|
export interface CommandContext {
|
|
12
|
+
readonly locus: CommandLocus;
|
|
11
13
|
readonly holdsSecret?: (path: string) => boolean | undefined;
|
|
12
14
|
}
|
|
13
15
|
export declare const mergeSpans: (spans: readonly CommandSpan[]) => CommandSpan[];
|
|
14
|
-
export declare const matchCommand: (command: string, context
|
|
15
|
-
export declare const classifyCommand: (command: string, context
|
|
16
|
+
export declare const matchCommand: (command: string, context: CommandContext) => CommandMatch[];
|
|
17
|
+
export declare const classifyCommand: (command: string, context: CommandContext) => CommandClass[];
|
|
16
18
|
export declare const COMMAND_CLASS_LABELS: Readonly<Record<CommandClass, string>>;
|
|
19
|
+
export declare const COMMAND_CLASS_PATTERNS: Readonly<Record<CommandClass, readonly string[]>>;
|
|
17
20
|
//# sourceMappingURL=command-classes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-classes.d.ts","sourceRoot":"","sources":["../src/command-classes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-classes.d.ts","sourceRoot":"","sources":["../src/command-classes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAoE9F,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACxB;AAID,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IASvC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CAC1B;AAID,MAAM,WAAW,cAAc;IAK3B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAS7B,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CAAC;CAChE;AAuBD,eAAO,MAAM,UAAU,UAAW,SAAS,WAAW,EAAE,KAAG,WAAW,EAWrE,CAAC;AAwaF,eAAO,MAAM,YAAY,YAAa,MAAM,WAAW,cAAc,KAAG,YAAY,EAMnF,CAAC;AAIF,eAAO,MAAM,eAAe,YAAa,MAAM,WAAW,cAAc,KAAG,YAAY,EAClB,CAAC;AAGtE,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAQvE,CAAC;AAUF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC,CAYpF,CAAC"}
|
package/dist/command-classes.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { HISTORY_ROOT, WORKSPACE_ROOT } from "@intentic/constants";
|
|
1
2
|
import { CommandClassSchema } from "./schemas/agent.js";
|
|
3
|
+
import { inertRegions, isLive } from "./shell-regions.js";
|
|
2
4
|
const globally = (patterns) => patterns.map((pattern) => new RegExp(pattern.source, `${pattern.flags}g`));
|
|
3
5
|
const spansOf = (patterns, command) => patterns.flatMap((pattern) => [...command.matchAll(pattern)].map((match) => ({ start: match.index, end: match.index + match[0].length })));
|
|
4
6
|
export const mergeSpans = (spans) => {
|
|
@@ -71,10 +73,11 @@ const parseRm = (command) => {
|
|
|
71
73
|
}
|
|
72
74
|
return parsed;
|
|
73
75
|
};
|
|
74
|
-
const
|
|
76
|
+
const SANDBOX_ROOTS = new Set(["", HISTORY_ROOT]);
|
|
77
|
+
const DEVICE_ROOTS = new Set([
|
|
75
78
|
"",
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
WORKSPACE_ROOT,
|
|
80
|
+
HISTORY_ROOT,
|
|
78
81
|
"/home",
|
|
79
82
|
"/root",
|
|
80
83
|
"/etc",
|
|
@@ -97,15 +100,16 @@ const ROOT_DIRECTORIES = new Set([
|
|
|
97
100
|
"/System",
|
|
98
101
|
"/Library",
|
|
99
102
|
]);
|
|
103
|
+
const rootsAt = (locus) => (locus === "sandbox" ? SANDBOX_ROOTS : DEVICE_ROOTS);
|
|
100
104
|
const HOME_ALIAS = /^(?:~|\$HOME|\$\{HOME\}|%USERPROFILE%)$/;
|
|
101
105
|
const WINDOWS_DRIVE = /^[A-Za-z]:$/;
|
|
102
106
|
const trimTarget = (operand) => operand.replace(/[/\\]\*+$/, "").replace(/[/\\]+$/, "");
|
|
103
|
-
const isRootTarget = (operand) => {
|
|
107
|
+
const isRootTarget = (operand, locus) => {
|
|
104
108
|
const target = trimTarget(operand);
|
|
105
109
|
if (HOME_ALIAS.test(target) || WINDOWS_DRIVE.test(target)) {
|
|
106
|
-
return
|
|
110
|
+
return locus === "device";
|
|
107
111
|
}
|
|
108
|
-
return target === "" ? operand.startsWith("/") || operand.startsWith("\\") :
|
|
112
|
+
return target === "" ? operand.startsWith("/") || operand.startsWith("\\") : rootsAt(locus).has(target);
|
|
109
113
|
};
|
|
110
114
|
const NODE_RECURSIVE_RM = /\b(?:rm|rmSync|rmdir|rmdirSync)\s*\([^)]*?recursive\s*:\s*true/;
|
|
111
115
|
const NODE_RECURSIVE_RM_PATH = /\b(?:rm|rmSync|rmdir|rmdirSync)\s*\(\s*(['"`])([^'"`]*)\1[^)]*?recursive\s*:\s*true/g;
|
|
@@ -116,7 +120,7 @@ const nodeDeleteTargets = (program) => [...program.matchAll(NODE_RECURSIVE_RM_PA
|
|
|
116
120
|
target: match[2],
|
|
117
121
|
span: { start: match.index, end: match.index + match[0].length },
|
|
118
122
|
}));
|
|
119
|
-
const
|
|
123
|
+
const BLOCK_DEVICE = [
|
|
120
124
|
/\bmkfs(?:\.\w+)?\b/,
|
|
121
125
|
/\bwipefs\b/,
|
|
122
126
|
/\bblkdiscard\b/,
|
|
@@ -124,6 +128,8 @@ const SYSTEM_DESTRUCTIVE = [
|
|
|
124
128
|
/\bdd\b[^|;&]*\bof=(?:\/dev\/|['"`]\/dev\/)/,
|
|
125
129
|
/\bshred\b[^|;&]*\s\/dev\//,
|
|
126
130
|
/>\s*\/dev\/(?:[shv]d[a-z]|nvme\d|disk\d|mmcblk\d)/,
|
|
131
|
+
];
|
|
132
|
+
const CONTAINER_STATE = [
|
|
127
133
|
/\b(?:docker|podman)\s+volume\s+(?:rm|remove|prune)\b/,
|
|
128
134
|
/\b(?:docker|podman)\s+system\s+prune\b/,
|
|
129
135
|
/\b(?:docker(?:\s+compose|-compose)?|podman-compose)\s+down\b[^|;&]*\s(?:-v\b|--volumes\b)/,
|
|
@@ -131,12 +137,12 @@ const SYSTEM_DESTRUCTIVE = [
|
|
|
131
137
|
const recursiveForceRms = (command) => parseRm(command)
|
|
132
138
|
.filter((invocation) => invocation.recursive && invocation.force)
|
|
133
139
|
.map((invocation) => invocation.span);
|
|
134
|
-
const rootDeletes = (program) => [
|
|
140
|
+
const rootDeletes = (program, locus) => [
|
|
135
141
|
...parseRm(program)
|
|
136
|
-
.filter((invocation) => invocation.recursive && invocation.force && invocation.operands.some(isRootTarget))
|
|
142
|
+
.filter((invocation) => invocation.recursive && invocation.force && invocation.operands.some((operand) => isRootTarget(operand, locus)))
|
|
137
143
|
.map((invocation) => invocation.span),
|
|
138
144
|
...nodeDeleteTargets(program)
|
|
139
|
-
.filter((delete_) => isRootTarget(delete_.target))
|
|
145
|
+
.filter((delete_) => isRootTarget(delete_.target, locus))
|
|
140
146
|
.map((delete_) => delete_.span),
|
|
141
147
|
];
|
|
142
148
|
const GIT_DESTRUCTIVE_G = globally(GIT_DESTRUCTIVE);
|
|
@@ -144,7 +150,8 @@ const SECRET_REFERENCES_G = globally(SECRET_REFERENCES);
|
|
|
144
150
|
const CREDENTIAL_PATHS_G = globally(CREDENTIAL_PATHS);
|
|
145
151
|
const PACKAGE_PUBLISH_G = globally(PACKAGE_PUBLISH);
|
|
146
152
|
const NETWORK_OUTBOUND_G = globally(NETWORK_OUTBOUND);
|
|
147
|
-
const
|
|
153
|
+
const BLOCK_DEVICE_G = globally(BLOCK_DEVICE);
|
|
154
|
+
const CONTAINER_STATE_G = globally(CONTAINER_STATE);
|
|
148
155
|
const WORD_EDGE = /[\s'"`;|&()]/;
|
|
149
156
|
const enclosingPath = (command, span) => {
|
|
150
157
|
let start = span.start;
|
|
@@ -169,28 +176,46 @@ const credentialReads = (command, context) => [
|
|
|
169
176
|
...spansOf(SECRET_REFERENCES_G, command),
|
|
170
177
|
...spansOf(CREDENTIAL_PATHS_G, command).filter((span) => {
|
|
171
178
|
const word = enclosingPath(command, span);
|
|
172
|
-
return !namesAPattern(word) && context
|
|
179
|
+
return !namesAPattern(word) && context.holdsSecret?.(word) !== false;
|
|
173
180
|
}),
|
|
174
181
|
];
|
|
175
182
|
const MATCHES = {
|
|
176
183
|
"git.destructive": (command) => spansOf(GIT_DESTRUCTIVE_G, command),
|
|
177
184
|
"files.destructive": (command) => [...recursiveForceRms(command), ...recursiveDeletes(command)],
|
|
178
|
-
"system.destructive": (command) => [...spansOf(
|
|
185
|
+
"system.destructive": (command, context) => [...spansOf(BLOCK_DEVICE_G, command), ...rootDeletes(command, context.locus)],
|
|
186
|
+
"container.state": (command) => spansOf(CONTAINER_STATE_G, command),
|
|
179
187
|
"secrets.access": credentialReads,
|
|
180
188
|
"package.publish": (command) => spansOf(PACKAGE_PUBLISH_G, command),
|
|
181
189
|
"network.outbound": (command) => spansOf(NETWORK_OUTBOUND_G, command),
|
|
182
190
|
};
|
|
183
|
-
export const matchCommand = (command, context) =>
|
|
184
|
-
const
|
|
185
|
-
return
|
|
186
|
-
|
|
191
|
+
export const matchCommand = (command, context) => {
|
|
192
|
+
const regions = inertRegions(command);
|
|
193
|
+
return CommandClassSchema.options.flatMap((commandClass) => {
|
|
194
|
+
const spans = mergeSpans(MATCHES[commandClass](command, context));
|
|
195
|
+
return spans.length === 0 ? [] : [{ commandClass, spans, live: spans.some((span) => isLive(span, regions)) }];
|
|
196
|
+
});
|
|
197
|
+
};
|
|
187
198
|
export const classifyCommand = (command, context) => matchCommand(command, context).map((match) => match.commandClass);
|
|
188
199
|
export const COMMAND_CLASS_LABELS = {
|
|
189
200
|
"git.destructive": "rewrite or discard git history",
|
|
190
201
|
"files.destructive": "delete files recursively",
|
|
191
|
-
"system.destructive": "wipe a disk,
|
|
202
|
+
"system.destructive": "wipe a disk, or delete a whole root directory",
|
|
203
|
+
"container.state": "delete a container volume or the data in it",
|
|
192
204
|
"secrets.access": "read credential material",
|
|
193
205
|
"package.publish": "publish or release a package",
|
|
194
206
|
"network.outbound": "send a request out to the internet",
|
|
195
207
|
};
|
|
208
|
+
export const COMMAND_CLASS_PATTERNS = {
|
|
209
|
+
"git.destructive": ["git push --force / -f / --force-with-lease / --delete", "git reset --hard", "git clean -f", "git branch -D", "git filter-branch"],
|
|
210
|
+
"files.destructive": ["rm -rf <path>", "fs.rm / rmSync / rmdir with recursive: true", "rimraf(<path>)"],
|
|
211
|
+
"system.destructive": [
|
|
212
|
+
"mkfs, wipefs, blkdiscard, sgdisk --zap-all",
|
|
213
|
+
"dd of=/dev/…, shred /dev/…, > /dev/sda",
|
|
214
|
+
"rm -rf aimed at a root directory",
|
|
215
|
+
],
|
|
216
|
+
"container.state": ["docker / podman volume rm, remove, prune", "docker / podman system prune", "docker compose down -v"],
|
|
217
|
+
"secrets.access": ["a {{secret:NAME}} reference in the command", ".env, .ssh/*, id_rsa, .aws/credentials, .npmrc, .git-credentials"],
|
|
218
|
+
"package.publish": ["npm / pnpm / yarn / bun publish", "cargo publish", "gh release create", "docker push", "twine upload"],
|
|
219
|
+
"network.outbound": ["curl / wget to a non-loopback https:// host", 'fetch("https://…") in a script'],
|
|
220
|
+
};
|
|
196
221
|
//# sourceMappingURL=command-classes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-classes.js","sourceRoot":"","sources":["../src/command-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"command-classes.js","sourceRoot":"","sources":["../src/command-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAqB,kBAAkB,EAAqB,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AA+G1D,MAAM,QAAQ,GAAG,CAAC,QAA2B,EAAqB,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAKhJ,MAAM,OAAO,GAAG,CAAC,QAA2B,EAAE,OAAe,EAAiB,EAAE,CAC5E,QAAQ,CAAC,OA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ACxF,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAGtE,MAAM,CAAC,MAAM,oBAAoB,GAA2C;IACxE,iBAAiB,EAAE,gCAAgC;IACnD,mBAAmB,EAAE,0BAA0B;IAC/C,oBAAoB,EAAE,+CAA+C;IACrE,iBAAiB,EAAE,6CAA6C;IAChE,gBAAgB,EAAE,0BAA0B;IAC5C,iBAAiB,EAAE,8BAA8B;IACjD,kBAAkB,EAAE,oCAAoC;CAC3D,CAAC;AAUF,MAAM,CAAC,MAAM,sBAAsB,GAAsD;IACrF,iBAAiB,EAAE,CAAC,uDAAuD,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,mBAAmB,CAAC;IACtJ,mBAAmB,EAAE,CAAC,eAAe,EAAE,6CAA6C,EAAE,gBAAgB,CAAC;IACvG,oBAAoB,EAAE;QAClB,4CAA4C;QAC5C,wCAAwC;QACxC,kCAAkC;KACrC;IACD,iBAAiB,EAAE,CAAC,0CAA0C,EAAE,8BAA8B,EAAE,wBAAwB,CAAC;IACzH,gBAAgB,EAAE,CAAC,4CAA4C,EAAE,kEAAkE,CAAC;IACpI,iBAAiB,EAAE,CAAC,iCAAiC,EAAE,eAAe,EAAE,mBAAmB,EAAE,aAAa,EAAE,cAAc,CAAC;IAC3H,kBAAkB,EAAE,CAAC,6CAA6C,EAAE,gCAAgC,CAAC;CACxG,CAAC"}
|
|
@@ -1,15 +1,94 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
start: import("@orpc/contract").
|
|
1
|
+
export declare const accountsContract: {
|
|
2
|
+
start: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
3
|
+
provider: import("zod").ZodEnum<{
|
|
4
|
+
claude: "claude";
|
|
5
|
+
codex: "codex";
|
|
6
|
+
cursor: "cursor";
|
|
7
|
+
gemini: "gemini";
|
|
8
|
+
grok: "grok";
|
|
9
|
+
kimi: "kimi";
|
|
10
|
+
meta: "meta";
|
|
11
|
+
zai: "zai";
|
|
12
|
+
}>;
|
|
13
|
+
variant: import("zod").ZodOptional<import("zod").ZodString>;
|
|
14
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
3
15
|
url: import("zod").ZodString;
|
|
16
|
+
code: import("zod").ZodString;
|
|
17
|
+
state: import("zod").ZodString;
|
|
18
|
+
flow: import("zod").ZodEnum<{
|
|
19
|
+
device: "device";
|
|
20
|
+
paste: "paste";
|
|
21
|
+
redirect: "redirect";
|
|
22
|
+
}>;
|
|
23
|
+
variant: import("zod").ZodString;
|
|
4
24
|
handshake: import("zod").ZodString;
|
|
5
25
|
expiresAt: import("zod").ZodNumber;
|
|
6
26
|
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
27
|
+
complete: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
28
|
+
provider: import("zod").ZodEnum<{
|
|
29
|
+
claude: "claude";
|
|
30
|
+
codex: "codex";
|
|
31
|
+
cursor: "cursor";
|
|
32
|
+
gemini: "gemini";
|
|
33
|
+
grok: "grok";
|
|
34
|
+
kimi: "kimi";
|
|
35
|
+
meta: "meta";
|
|
36
|
+
zai: "zai";
|
|
37
|
+
}>;
|
|
38
|
+
handshake: import("zod").ZodString;
|
|
39
|
+
code: import("zod").ZodOptional<import("zod").ZodString>;
|
|
40
|
+
redirectUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
41
|
+
label: import("zod").ZodOptional<import("zod").ZodString>;
|
|
42
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
43
|
+
account: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
44
|
+
id: import("zod").ZodString;
|
|
45
|
+
label: import("zod").ZodString;
|
|
46
|
+
email: import("zod").ZodOptional<import("zod").ZodString>;
|
|
47
|
+
organization: import("zod").ZodOptional<import("zod").ZodString>;
|
|
48
|
+
scope: import("zod").ZodOptional<import("zod").ZodString>;
|
|
49
|
+
connectedAt: import("zod").ZodNumber;
|
|
50
|
+
needsReauth: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
51
|
+
detail: import("zod").ZodOptional<import("zod").ZodString>;
|
|
52
|
+
usage: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
53
|
+
windows: import("zod").ZodArray<import("zod").ZodObject<{
|
|
54
|
+
kind: import("zod").ZodString;
|
|
55
|
+
label: import("zod").ZodOptional<import("zod").ZodString>;
|
|
56
|
+
utilization: import("zod").ZodNumber;
|
|
57
|
+
resetsAt: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
58
|
+
gates: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"all">, import("zod").ZodLiteral<"none">, import("zod").ZodObject<{
|
|
59
|
+
models: import("zod").ZodArray<import("zod").ZodString>;
|
|
60
|
+
}, import("zod/v4/core").$strip>]>;
|
|
61
|
+
}, import("zod/v4/core").$strip>>;
|
|
62
|
+
measuredAt: import("zod").ZodNumber;
|
|
63
|
+
}, import("zod/v4/core").$strip>>;
|
|
64
|
+
}, import("zod/v4/core").$strip>>;
|
|
65
|
+
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
7
66
|
cancel: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
67
|
+
provider: import("zod").ZodEnum<{
|
|
68
|
+
claude: "claude";
|
|
69
|
+
codex: "codex";
|
|
70
|
+
cursor: "cursor";
|
|
71
|
+
gemini: "gemini";
|
|
72
|
+
grok: "grok";
|
|
73
|
+
kimi: "kimi";
|
|
74
|
+
meta: "meta";
|
|
75
|
+
zai: "zai";
|
|
76
|
+
}>;
|
|
8
77
|
handshake: import("zod").ZodString;
|
|
9
78
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
10
79
|
ok: import("zod").ZodLiteral<true>;
|
|
11
80
|
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
12
81
|
accounts: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
82
|
+
provider: import("zod").ZodEnum<{
|
|
83
|
+
claude: "claude";
|
|
84
|
+
codex: "codex";
|
|
85
|
+
cursor: "cursor";
|
|
86
|
+
gemini: "gemini";
|
|
87
|
+
grok: "grok";
|
|
88
|
+
kimi: "kimi";
|
|
89
|
+
meta: "meta";
|
|
90
|
+
zai: "zai";
|
|
91
|
+
}>;
|
|
13
92
|
force: import("zod").ZodDefault<import("zod").ZodCodec<import("zod").ZodString, import("zod").ZodBoolean>>;
|
|
14
93
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
15
94
|
accounts: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -36,6 +115,16 @@ export declare const cursorContract: {
|
|
|
36
115
|
}, import("zod/v4/core").$strip>>;
|
|
37
116
|
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
38
117
|
rename: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
118
|
+
provider: import("zod").ZodEnum<{
|
|
119
|
+
claude: "claude";
|
|
120
|
+
codex: "codex";
|
|
121
|
+
cursor: "cursor";
|
|
122
|
+
gemini: "gemini";
|
|
123
|
+
grok: "grok";
|
|
124
|
+
kimi: "kimi";
|
|
125
|
+
meta: "meta";
|
|
126
|
+
zai: "zai";
|
|
127
|
+
}>;
|
|
39
128
|
id: import("zod").ZodString;
|
|
40
129
|
label: import("zod").ZodString;
|
|
41
130
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -61,9 +150,19 @@ export declare const cursorContract: {
|
|
|
61
150
|
}, import("zod/v4/core").$strip>>;
|
|
62
151
|
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
63
152
|
disconnect: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
153
|
+
provider: import("zod").ZodEnum<{
|
|
154
|
+
claude: "claude";
|
|
155
|
+
codex: "codex";
|
|
156
|
+
cursor: "cursor";
|
|
157
|
+
gemini: "gemini";
|
|
158
|
+
grok: "grok";
|
|
159
|
+
kimi: "kimi";
|
|
160
|
+
meta: "meta";
|
|
161
|
+
zai: "zai";
|
|
162
|
+
}>;
|
|
64
163
|
id: import("zod").ZodString;
|
|
65
164
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
66
165
|
ok: import("zod").ZodLiteral<true>;
|
|
67
166
|
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
68
167
|
};
|
|
69
|
-
//# sourceMappingURL=
|
|
168
|
+
//# sourceMappingURL=accounts.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/accounts.contract.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,gBAAgB;IACzB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;IAUL,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUR,MAAM;;;;;;;;;;;;;;;IAWN,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUR,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASN,UAAU;;;;;;;;;;;;;;;CASb,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import { NativeProviderParamSchema } from "../schemas/agent.js";
|
|
3
|
+
import { AccountIdSchema, AccountListQuerySchema, AccountRenameSchema, LoginCancelSchema, LoginCompletedSchema, LoginCompleteSchema, LoginRequestSchema, LoginStartSchema, OauthAccountListSchema, OauthAccountSchema, } from "../schemas/provider-oauth.js";
|
|
4
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
5
|
+
export const accountsContract = {
|
|
6
|
+
start: oc
|
|
7
|
+
.route({
|
|
8
|
+
method: "POST",
|
|
9
|
+
path: "/accounts/{provider}/login/start",
|
|
10
|
+
summary: "Begin connecting an account",
|
|
11
|
+
description: "Hands back the page to sign in on, and the code it will ask for where there is one. The sandbox holds the proof and finishes what it can itself: a device sign-in lands in the account list on its own, a paste or a redirect needs one thing brought back to the finishing call.",
|
|
12
|
+
})
|
|
13
|
+
.input(NativeProviderParamSchema.extend(LoginRequestSchema.shape))
|
|
14
|
+
.output(LoginStartSchema),
|
|
15
|
+
complete: oc
|
|
16
|
+
.route({
|
|
17
|
+
method: "POST",
|
|
18
|
+
path: "/accounts/{provider}/login/complete",
|
|
19
|
+
summary: "Finish a sign-in with what the page handed back",
|
|
20
|
+
description: "Takes the code the page showed, or the address a redirect landed on, and finishes the attempt. Answers with the account where the exchange ends here; otherwise the sandbox still has a mint to do and the row appears in the account list.",
|
|
21
|
+
})
|
|
22
|
+
.input(NativeProviderParamSchema.extend(LoginCompleteSchema.shape))
|
|
23
|
+
.output(LoginCompletedSchema),
|
|
24
|
+
cancel: oc
|
|
25
|
+
.route({
|
|
26
|
+
method: "POST",
|
|
27
|
+
path: "/accounts/{provider}/login/cancel",
|
|
28
|
+
summary: "Abandon a sign-in",
|
|
29
|
+
description: "Stops waiting on a sign-in nobody completed. An abandoned attempt also expires on its own.",
|
|
30
|
+
})
|
|
31
|
+
.input(NativeProviderParamSchema.extend(LoginCancelSchema.shape))
|
|
32
|
+
.output(OkSchema),
|
|
33
|
+
accounts: oc
|
|
34
|
+
.route({
|
|
35
|
+
method: "GET",
|
|
36
|
+
path: "/accounts/{provider}",
|
|
37
|
+
summary: "Connected accounts of a provider",
|
|
38
|
+
description: "Each connected account with how full its plan limits were when last measured, where the provider publishes any. Ask for a fresh measurement and it takes one before answering, which is slower. The credentials themselves never travel: being in this list is what connected means.",
|
|
39
|
+
})
|
|
40
|
+
.input(NativeProviderParamSchema.extend(AccountListQuerySchema.shape))
|
|
41
|
+
.output(OauthAccountListSchema),
|
|
42
|
+
rename: oc
|
|
43
|
+
.route({
|
|
44
|
+
method: "POST",
|
|
45
|
+
path: "/accounts/{provider}/rename",
|
|
46
|
+
summary: "Rename an account",
|
|
47
|
+
description: "Changes the label one account shows under, so several are tellable apart. Blank restores the one derived from the sign-in.",
|
|
48
|
+
})
|
|
49
|
+
.input(NativeProviderParamSchema.extend(AccountRenameSchema.shape))
|
|
50
|
+
.output(OauthAccountSchema),
|
|
51
|
+
disconnect: oc
|
|
52
|
+
.route({
|
|
53
|
+
method: "POST",
|
|
54
|
+
path: "/accounts/{provider}/disconnect",
|
|
55
|
+
summary: "Disconnect an account",
|
|
56
|
+
description: "Clears one stored credential, and stops any sign-in still in flight for this provider. The others stay connected.",
|
|
57
|
+
})
|
|
58
|
+
.input(NativeProviderParamSchema.extend(AccountIdSchema.shape))
|
|
59
|
+
.output(OkSchema),
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=accounts.contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.contract.js","sourceRoot":"","sources":["../../src/contracts/accounts.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACH,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAmBhD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,KAAK,EAAE,EAAE;SACJ,KAAK,CAAC;QACH,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,kCAAkC;QACxC,OAAO,EAAE,6BAA6B;QACtC,WAAW,EACP,mRAAmR;KAC1R,CAAC;SACD,KAAK,C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