@intentic/sandbox-contract 1.245.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/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 +80 -30
- 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} +154 -60
- 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 +8 -0
- package/dist/workspace-state.d.ts.map +1 -1
- package/dist/workspace-state.js +13 -5
- package/dist/workspace-state.js.map +1 -1
- package/package.json +37 -4
- package/src/agent-catalog.ts +1 -1
- package/src/arrival.ts +3 -3
- 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} +190 -107
- 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 +48 -1
- package/src/workspace-state.ts +48 -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 -135
- 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
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { AccountIdSchema, AccountListQuerySchema, AccountRenameSchema, AuthorizeChallengeSchema, OauthAccountListSchema, OauthAccountSchema, OauthExchangeSchema, } from "../schemas/provider-oauth.js";
|
|
3
|
-
import { OkSchema } from "../schemas/shared.js";
|
|
4
|
-
export const claudeContract = {
|
|
5
|
-
start: oc
|
|
6
|
-
.route({
|
|
7
|
-
method: "POST",
|
|
8
|
-
path: "/claude/oauth/start",
|
|
9
|
-
summary: "Begin connecting a Claude account",
|
|
10
|
-
description: "Hands back the address to send somebody to, and the proof this sandbox will need to finish the exchange. The sandbox holds the credential afterwards, not the browser.",
|
|
11
|
-
})
|
|
12
|
-
.output(AuthorizeChallengeSchema),
|
|
13
|
-
exchange: oc
|
|
14
|
-
.route({
|
|
15
|
-
method: "POST",
|
|
16
|
-
path: "/claude/oauth/exchange",
|
|
17
|
-
summary: "Finish connecting a Claude account",
|
|
18
|
-
description: "Trades the code from the sign-in for stored tokens and answers with the account it just connected. A sandbox can hold several Claude accounts side by side.",
|
|
19
|
-
})
|
|
20
|
-
.input(OauthExchangeSchema)
|
|
21
|
-
.output(OauthAccountSchema),
|
|
22
|
-
accounts: oc
|
|
23
|
-
.route({
|
|
24
|
-
method: "GET",
|
|
25
|
-
path: "/claude/accounts",
|
|
26
|
-
summary: "Connected Claude accounts",
|
|
27
|
-
description: "Each connected account with how full its plan limits were when last measured. Ask for a fresh measurement and it takes one before answering, which is slower.",
|
|
28
|
-
})
|
|
29
|
-
.input(AccountListQuerySchema)
|
|
30
|
-
.output(OauthAccountListSchema),
|
|
31
|
-
rename: oc
|
|
32
|
-
.route({
|
|
33
|
-
method: "POST",
|
|
34
|
-
path: "/claude/account/rename",
|
|
35
|
-
summary: "Rename a Claude account",
|
|
36
|
-
description: "Changes the label one account shows under, so several are tellable apart.",
|
|
37
|
-
})
|
|
38
|
-
.input(AccountRenameSchema)
|
|
39
|
-
.output(OauthAccountSchema),
|
|
40
|
-
disconnect: oc
|
|
41
|
-
.route({
|
|
42
|
-
method: "POST",
|
|
43
|
-
path: "/claude/account/disconnect",
|
|
44
|
-
summary: "Disconnect a Claude account",
|
|
45
|
-
description: "Clears the stored tokens for one account. The others stay connected.",
|
|
46
|
-
})
|
|
47
|
-
.input(AccountIdSchema)
|
|
48
|
-
.output(OkSchema),
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=claude.contract.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude.contract.js","sourceRoot":"","sources":["../../src/contracts/claude.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EACH,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,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ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,cAAc;IACvB,KAAK;;;;;IASL,MAAM;;;;;IAYN,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;IAUR,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;IASN,UAAU;;;;;CASb,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { AccountIdSchema, AccountListQuerySchema, AccountRenameSchema, CursorLoginCancelSchema, CursorLoginStartSchema, OauthAccountListSchema, OauthAccountSchema, } from "../schemas/provider-oauth.js";
|
|
3
|
-
import { OkSchema } from "../schemas/shared.js";
|
|
4
|
-
export const cursorContract = {
|
|
5
|
-
start: oc
|
|
6
|
-
.route({
|
|
7
|
-
method: "POST",
|
|
8
|
-
path: "/cursor/login/start",
|
|
9
|
-
summary: "Begin connecting a Cursor account",
|
|
10
|
-
description: "Hands back the page to sign in on. The sandbox finishes the handshake itself and stores the credential, so nothing has to be pasted back: watch the account list instead.",
|
|
11
|
-
})
|
|
12
|
-
.output(CursorLoginStartSchema),
|
|
13
|
-
cancel: oc
|
|
14
|
-
.route({
|
|
15
|
-
method: "POST",
|
|
16
|
-
path: "/cursor/login/cancel",
|
|
17
|
-
summary: "Abandon a Cursor sign-in",
|
|
18
|
-
description: "Stops waiting on a sign-in nobody completed. An abandoned attempt also expires on its own.",
|
|
19
|
-
})
|
|
20
|
-
.input(CursorLoginCancelSchema)
|
|
21
|
-
.output(OkSchema),
|
|
22
|
-
accounts: oc
|
|
23
|
-
.route({
|
|
24
|
-
method: "GET",
|
|
25
|
-
path: "/cursor/accounts",
|
|
26
|
-
summary: "Connected Cursor accounts",
|
|
27
|
-
description: "Each connected account, and whether its stored key is still good. Cursor publishes no plan-wide allowance, so these rows carry no usage reading.",
|
|
28
|
-
})
|
|
29
|
-
.input(AccountListQuerySchema)
|
|
30
|
-
.output(OauthAccountListSchema),
|
|
31
|
-
rename: oc
|
|
32
|
-
.route({
|
|
33
|
-
method: "POST",
|
|
34
|
-
path: "/cursor/account/rename",
|
|
35
|
-
summary: "Rename a Cursor account",
|
|
36
|
-
description: "Changes the label one account shows under, so several are tellable apart.",
|
|
37
|
-
})
|
|
38
|
-
.input(AccountRenameSchema)
|
|
39
|
-
.output(OauthAccountSchema),
|
|
40
|
-
disconnect: oc
|
|
41
|
-
.route({
|
|
42
|
-
method: "POST",
|
|
43
|
-
path: "/cursor/account/disconnect",
|
|
44
|
-
summary: "Disconnect a Cursor account",
|
|
45
|
-
description: "Clears the stored key for one account. The others stay connected.",
|
|
46
|
-
})
|
|
47
|
-
.input(AccountIdSchema)
|
|
48
|
-
.output(OkSchema),
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=cursor.contract.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.contract.js","sourceRoot":"","sources":["../../src/contracts/cursor.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EACH,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAahD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,KAAK,EAAE,EAAE;SACJ,KAAK,CAAC;QACH,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,mCAAmC;QAC5C,WAAW,EACP,2KAA2K;KAClL,CAAC;SACD,MAAM,CAAC,sBAAsB,CAAC;IACnC,MAAM,EAAE,EAAE;SACL,KAAK,CAAC;QACH,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,0BAA0B;QACnC,WAAW,EAAE,4FAA4F;KAC5G,CAAC;SACD,KAAK,CAAC,uBAAuB,CAAC;SAC9B,MAAM,CAAC,QAAQ,CAAC;IAIrB,QAAQ,EAAE,EAAE;SACP,KAAK,CAAC;QACH,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,2BAA2B;QACpC,WAAW,EACP,kJAAkJ;KACzJ,CAAC;SACD,KAAK,CAAC,sBAAsB,CAAC;SAC7B,MAAM,CAAC,sBAAsB,CAAC;IACnC,MAAM,EAAE,EAAE;SACL,KAAK,CAAC;QACH,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,wBAAwB;QAC9B,OAAO,EAAE,yBAAyB;QAClC,WAAW,EAAE,2EAA2E;KAC3F,CAAC;SACD,KAAK,CAAC,mBAAmB,CAAC;SAC1B,MAAM,CAAC,kBAAkB,CAAC;IAC/B,UAAU,EAAE,EAAE;SACT,KAAK,CAAC;QACH,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,6BAA6B;QACtC,WAAW,EAAE,mEAAmE;KACnF,CAAC;SACD,KAAK,CAAC,eAAe,CAAC;SACtB,MAAM,CAAC,QAAQ,CAAC;CACxB,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export declare const grokContract: {
|
|
2
|
-
start: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodObject<{
|
|
3
|
-
url: import("zod").ZodString;
|
|
4
|
-
code: import("zod").ZodString;
|
|
5
|
-
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
6
|
-
accounts: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodObject<{
|
|
7
|
-
accounts: import("zod").ZodArray<import("zod").ZodObject<{
|
|
8
|
-
id: import("zod").ZodString;
|
|
9
|
-
label: import("zod").ZodString;
|
|
10
|
-
email: import("zod").ZodOptional<import("zod").ZodString>;
|
|
11
|
-
organization: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12
|
-
scope: import("zod").ZodOptional<import("zod").ZodString>;
|
|
13
|
-
connectedAt: import("zod").ZodNumber;
|
|
14
|
-
needsReauth: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
15
|
-
detail: import("zod").ZodOptional<import("zod").ZodString>;
|
|
16
|
-
usage: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
17
|
-
windows: import("zod").ZodArray<import("zod").ZodObject<{
|
|
18
|
-
kind: import("zod").ZodString;
|
|
19
|
-
label: import("zod").ZodOptional<import("zod").ZodString>;
|
|
20
|
-
utilization: import("zod").ZodNumber;
|
|
21
|
-
resetsAt: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
22
|
-
gates: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"all">, import("zod").ZodLiteral<"none">, import("zod").ZodObject<{
|
|
23
|
-
models: import("zod").ZodArray<import("zod").ZodString>;
|
|
24
|
-
}, import("zod/v4/core").$strip>]>;
|
|
25
|
-
}, import("zod/v4/core").$strip>>;
|
|
26
|
-
measuredAt: import("zod").ZodNumber;
|
|
27
|
-
}, import("zod/v4/core").$strip>>;
|
|
28
|
-
}, import("zod/v4/core").$strip>>;
|
|
29
|
-
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
30
|
-
disconnect: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
31
|
-
id: import("zod").ZodString;
|
|
32
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
33
|
-
ok: import("zod").ZodLiteral<true>;
|
|
34
|
-
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=grok.contract.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grok.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/grok.contract.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY;IACrB,KAAK;;;;IASL,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;IAQR,UAAU;;;;;CASb,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { AccountIdSchema, DeviceStartSchema, OauthAccountListSchema } from "../schemas/provider-oauth.js";
|
|
3
|
-
import { OkSchema } from "../schemas/shared.js";
|
|
4
|
-
export const grokContract = {
|
|
5
|
-
start: oc
|
|
6
|
-
.route({
|
|
7
|
-
method: "POST",
|
|
8
|
-
path: "/grok/oauth/start",
|
|
9
|
-
summary: "Begin connecting a Grok account",
|
|
10
|
-
description: "Hands back the page to open and the one-time code to type there. Nothing is pasted back afterwards: the sandbox waits for the sign-in to complete on its own, so poll the accounts call until it appears.",
|
|
11
|
-
})
|
|
12
|
-
.output(DeviceStartSchema),
|
|
13
|
-
accounts: oc
|
|
14
|
-
.route({
|
|
15
|
-
method: "GET",
|
|
16
|
-
path: "/grok/accounts",
|
|
17
|
-
summary: "Connected Grok account",
|
|
18
|
-
description: "What is signed in. A list for consistency with the other providers, though there is at most one.",
|
|
19
|
-
})
|
|
20
|
-
.output(OauthAccountListSchema),
|
|
21
|
-
disconnect: oc
|
|
22
|
-
.route({
|
|
23
|
-
method: "POST",
|
|
24
|
-
path: "/grok/account/disconnect",
|
|
25
|
-
summary: "Disconnect the Grok account",
|
|
26
|
-
description: "Clears the stored tokens.",
|
|
27
|
-
})
|
|
28
|
-
.input(AccountIdSchema)
|
|
29
|
-
.output(OkSchema),
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=grok.contract.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grok.contract.js","sourceRoot":"","sources":["../../src/contracts/grok.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC1G,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAWhD,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,KAAK,EAAE,EAAE;SACJ,KAAK,CAAC;QACH,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,iCAAiC;QAC1C,WAAW,EACP,2MAA2M;KAClN,CAAC;SACD,MAAM,CAAC,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,EAAE;SACP,KAAK,CAAC;QACH,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,wBAAwB;QACjC,WAAW,EAAE,kGAAkG;KAClH,CAAC;SACD,MAAM,CAAC,sBAAsB,CAAC;IACnC,UAAU,EAAE,EAAE;SACT,KAAK,CAAC;QACH,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,6BAA6B;QACtC,WAAW,EAAE,2BAA2B;KAC3C,CAAC;SACD,KAAK,CAAC,eAAe,CAAC;SACtB,MAAM,CAAC,QAAQ,CAAC;CACxB,CAAC"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const keysContract: {
|
|
3
|
-
accounts: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
4
|
-
provider: z.ZodEnum<{
|
|
5
|
-
meta: "meta";
|
|
6
|
-
zai: "zai";
|
|
7
|
-
}>;
|
|
8
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
-
accounts: z.ZodArray<z.ZodObject<{
|
|
10
|
-
id: z.ZodString;
|
|
11
|
-
label: z.ZodString;
|
|
12
|
-
email: z.ZodOptional<z.ZodString>;
|
|
13
|
-
organization: z.ZodOptional<z.ZodString>;
|
|
14
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
15
|
-
connectedAt: z.ZodNumber;
|
|
16
|
-
needsReauth: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
-
detail: z.ZodOptional<z.ZodString>;
|
|
18
|
-
usage: z.ZodOptional<z.ZodObject<{
|
|
19
|
-
windows: z.ZodArray<z.ZodObject<{
|
|
20
|
-
kind: z.ZodString;
|
|
21
|
-
label: z.ZodOptional<z.ZodString>;
|
|
22
|
-
utilization: z.ZodNumber;
|
|
23
|
-
resetsAt: z.ZodOptional<z.ZodNumber>;
|
|
24
|
-
gates: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"none">, z.ZodObject<{
|
|
25
|
-
models: z.ZodArray<z.ZodString>;
|
|
26
|
-
}, z.core.$strip>]>;
|
|
27
|
-
}, z.core.$strip>>;
|
|
28
|
-
measuredAt: z.ZodNumber;
|
|
29
|
-
}, z.core.$strip>>;
|
|
30
|
-
}, z.core.$strip>>;
|
|
31
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
32
|
-
connect: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
33
|
-
provider: z.ZodEnum<{
|
|
34
|
-
meta: "meta";
|
|
35
|
-
zai: "zai";
|
|
36
|
-
}>;
|
|
37
|
-
apiKey: z.ZodString;
|
|
38
|
-
label: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
-
id: z.ZodString;
|
|
41
|
-
label: z.ZodString;
|
|
42
|
-
email: z.ZodOptional<z.ZodString>;
|
|
43
|
-
organization: z.ZodOptional<z.ZodString>;
|
|
44
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
45
|
-
connectedAt: z.ZodNumber;
|
|
46
|
-
needsReauth: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
-
detail: z.ZodOptional<z.ZodString>;
|
|
48
|
-
usage: z.ZodOptional<z.ZodObject<{
|
|
49
|
-
windows: z.ZodArray<z.ZodObject<{
|
|
50
|
-
kind: z.ZodString;
|
|
51
|
-
label: z.ZodOptional<z.ZodString>;
|
|
52
|
-
utilization: z.ZodNumber;
|
|
53
|
-
resetsAt: z.ZodOptional<z.ZodNumber>;
|
|
54
|
-
gates: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"none">, z.ZodObject<{
|
|
55
|
-
models: z.ZodArray<z.ZodString>;
|
|
56
|
-
}, z.core.$strip>]>;
|
|
57
|
-
}, z.core.$strip>>;
|
|
58
|
-
measuredAt: z.ZodNumber;
|
|
59
|
-
}, z.core.$strip>>;
|
|
60
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
61
|
-
rename: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
62
|
-
provider: z.ZodEnum<{
|
|
63
|
-
meta: "meta";
|
|
64
|
-
zai: "zai";
|
|
65
|
-
}>;
|
|
66
|
-
id: z.ZodString;
|
|
67
|
-
label: z.ZodString;
|
|
68
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
-
ok: z.ZodLiteral<true>;
|
|
70
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
71
|
-
disconnect: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
72
|
-
provider: z.ZodEnum<{
|
|
73
|
-
meta: "meta";
|
|
74
|
-
zai: "zai";
|
|
75
|
-
}>;
|
|
76
|
-
id: z.ZodString;
|
|
77
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
-
ok: z.ZodLiteral<true>;
|
|
79
|
-
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
80
|
-
};
|
|
81
|
-
//# sourceMappingURL=keys.contract.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keys.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/keys.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8BxB,eAAO,MAAM,YAAY;IACrB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASR,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmBP,MAAM;;;;;;;;;;IASN,UAAU;;;;;;;;;CASb,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { KeyProviderParamSchema } from "../schemas/agent.js";
|
|
4
|
-
import { AccountIdSchema, AccountRenameSchema, OauthAccountListSchema, OauthAccountSchema } from "../schemas/provider-oauth.js";
|
|
5
|
-
import { OkSchema } from "../schemas/shared.js";
|
|
6
|
-
export const keysContract = {
|
|
7
|
-
accounts: oc
|
|
8
|
-
.route({
|
|
9
|
-
method: "GET",
|
|
10
|
-
path: "/keys/{provider}/accounts",
|
|
11
|
-
summary: "Connected accounts for a key-based provider",
|
|
12
|
-
description: "Which keys are connected for this provider. The keys themselves never travel: being in this list is what connected means.",
|
|
13
|
-
})
|
|
14
|
-
.input(KeyProviderParamSchema)
|
|
15
|
-
.output(OauthAccountListSchema),
|
|
16
|
-
connect: oc
|
|
17
|
-
.route({
|
|
18
|
-
method: "POST",
|
|
19
|
-
path: "/keys/{provider}/connect",
|
|
20
|
-
summary: "Connect an API key",
|
|
21
|
-
description: "Stores an API key for this provider and answers with the account it became. A sandbox can hold several keys for one provider side by side.",
|
|
22
|
-
})
|
|
23
|
-
.input(KeyProviderParamSchema.extend({
|
|
24
|
-
apiKey: z.string().min(1).describe("The key, as the provider issued it. Stored in this sandbox and never sent back out."),
|
|
25
|
-
label: z
|
|
26
|
-
.string()
|
|
27
|
-
.max(80)
|
|
28
|
-
.optional()
|
|
29
|
-
.describe("What to call it. Blank falls back to the provider's own name, which is all a pasted key can say about itself."),
|
|
30
|
-
}))
|
|
31
|
-
.output(OauthAccountSchema),
|
|
32
|
-
rename: oc
|
|
33
|
-
.route({
|
|
34
|
-
method: "POST",
|
|
35
|
-
path: "/keys/{provider}/account/rename",
|
|
36
|
-
summary: "Rename one connected key",
|
|
37
|
-
description: "Nothing in a pasted key says whose it is, so naming it is the only way to tell two of them apart.",
|
|
38
|
-
})
|
|
39
|
-
.input(KeyProviderParamSchema.extend(AccountRenameSchema.shape))
|
|
40
|
-
.output(OkSchema),
|
|
41
|
-
disconnect: oc
|
|
42
|
-
.route({
|
|
43
|
-
method: "POST",
|
|
44
|
-
path: "/keys/{provider}/account/disconnect",
|
|
45
|
-
summary: "Disconnect one key",
|
|
46
|
-
description: "Removes a single stored key. Any others under the same provider stay connected.",
|
|
47
|
-
})
|
|
48
|
-
.input(KeyProviderParamSchema.extend(AccountIdSchema.shape))
|
|
49
|
-
.output(OkSchema),
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=keys.contract.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keys.contract.js","sourceRoot":"","sources":["../../src/contracts/keys.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAChI,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AA2BhD,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,QAAQ,EAAE,EAAE;SACP,KAAK,CAAC;QACH,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,2BAA2B;QACjC,OAAO,EAAE,6CAA6C;QACtD,WAAW,EAAE,2HAA2H;KAC3I,CAAC;SACD,KAAK,CAAC,sBAAsB,CAAC;SAC7B,MAAM,CAAC,sBAAsB,CAAC;IACnC,OAAO,EAAE,EAAE;SACN,KAAK,CAAC;QACH,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,oBAAoB;QAC7B,WAAW,EACP,4IAA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AAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { HostFactsSchema } from "./hosts.js";
|
|
3
|
-
import { DEV_VERSION } from "../versions.js";
|
|
4
|
-
export const MachineSandboxSchema = z.object({
|
|
5
|
-
slug: z.string(),
|
|
6
|
-
container: z.string(),
|
|
7
|
-
name: z.string().optional(),
|
|
8
|
-
running: z.boolean(),
|
|
9
|
-
image: z.string(),
|
|
10
|
-
tunnelRunning: z.boolean().optional(),
|
|
11
|
-
});
|
|
12
|
-
export const MachineSandboxOpSchema = z.enum([
|
|
13
|
-
"start",
|
|
14
|
-
"stop",
|
|
15
|
-
"restart",
|
|
16
|
-
"prepare",
|
|
17
|
-
"update",
|
|
18
|
-
"rebuild",
|
|
19
|
-
"rollback",
|
|
20
|
-
"remove",
|
|
21
|
-
"logs",
|
|
22
|
-
"runner-up",
|
|
23
|
-
"runner-remove",
|
|
24
|
-
]);
|
|
25
|
-
export const MachineSandboxFlowSchema = z.object({
|
|
26
|
-
op: MachineSandboxOpSchema,
|
|
27
|
-
slug: z.string().min(1),
|
|
28
|
-
hash: z.string().optional(),
|
|
29
|
-
parentUrl: z.string().optional(),
|
|
30
|
-
pair: z.string().optional().meta({ secret: true }),
|
|
31
|
-
definition: z.string().optional(),
|
|
32
|
-
overlay: z.string().optional(),
|
|
33
|
-
overlayHash: z.string().optional(),
|
|
34
|
-
});
|
|
35
|
-
export const MachineSandboxFlowInputSchema = MachineSandboxFlowSchema.extend({ id: z.string().min(1) });
|
|
36
|
-
export const MachineFlowLineSchema = z.discriminatedUnion("kind", [
|
|
37
|
-
z.object({ kind: z.literal("line"), text: z.string() }),
|
|
38
|
-
z.object({ kind: z.literal("result"), message: z.string() }),
|
|
39
|
-
z.object({ kind: z.literal("error"), message: z.string() }),
|
|
40
|
-
]);
|
|
41
|
-
export const MachineCommandSchema = z.enum(["mirror-off", "mirror-on", "sync-pause", "sync-resume", "sync-unpair"]);
|
|
42
|
-
export const MachineSandboxIdSchema = z
|
|
43
|
-
.string()
|
|
44
|
-
.max(200)
|
|
45
|
-
.regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/);
|
|
46
|
-
export const MachineCommandInputSchema = z.object({
|
|
47
|
-
id: z.string().min(1),
|
|
48
|
-
command: MachineCommandSchema,
|
|
49
|
-
sandboxId: MachineSandboxIdSchema.optional(),
|
|
50
|
-
});
|
|
51
|
-
export const MachineCommandResultSchema = z.object({
|
|
52
|
-
ok: z.boolean(),
|
|
53
|
-
message: z.string(),
|
|
54
|
-
output: z.string().optional(),
|
|
55
|
-
});
|
|
56
|
-
export const MachinePairingSchema = z.object({
|
|
57
|
-
sandboxId: z.string(),
|
|
58
|
-
mode: z.enum(["sync", "mirror"]),
|
|
59
|
-
localDir: z.string().optional(),
|
|
60
|
-
mirroring: z.enum(["on", "off"]).optional(),
|
|
61
|
-
mutagenStatus: z.string().optional(),
|
|
62
|
-
conflicts: z.number().int().nonnegative().optional(),
|
|
63
|
-
paused: z.boolean().optional(),
|
|
64
|
-
backupStatus: z.string().optional(),
|
|
65
|
-
});
|
|
66
|
-
export const MachinePortStateSchema = z.enum([
|
|
67
|
-
"mirrored",
|
|
68
|
-
"held-by-sandbox",
|
|
69
|
-
"busy",
|
|
70
|
-
]);
|
|
71
|
-
export const MachinePortSchema = z.object({
|
|
72
|
-
port: z.number().int().min(1).max(65535),
|
|
73
|
-
host: z.enum(["127.0.0.1", "::1"]),
|
|
74
|
-
sandboxId: z.string(),
|
|
75
|
-
state: MachinePortStateSchema,
|
|
76
|
-
heldBy: z.string().optional(),
|
|
77
|
-
command: z.string().optional(),
|
|
78
|
-
});
|
|
79
|
-
export const MachineWatcherSchema = z.object({
|
|
80
|
-
running: z.boolean(),
|
|
81
|
-
pid: z.number().int().optional(),
|
|
82
|
-
build: z.string().optional(),
|
|
83
|
-
lastTickAt: z.number().optional(),
|
|
84
|
-
});
|
|
85
|
-
export const WATCHER_STALL_AFTER_MS = 60_000;
|
|
86
|
-
export const watcherStalled = (watcher, now) => watcher.running && watcher.lastTickAt !== undefined && now - watcher.lastTickAt > WATCHER_STALL_AFTER_MS;
|
|
87
|
-
export const MachineReportSchema = z.object({
|
|
88
|
-
hostname: z.string(),
|
|
89
|
-
os: z.string(),
|
|
90
|
-
agents: z.object({ sync: z.string().optional(), host: z.string().optional() }),
|
|
91
|
-
sandboxes: z.array(MachineSandboxSchema),
|
|
92
|
-
pairings: z.array(MachinePairingSchema),
|
|
93
|
-
ports: z.array(MachinePortSchema),
|
|
94
|
-
watcher: MachineWatcherSchema,
|
|
95
|
-
capturedAt: z.number(),
|
|
96
|
-
});
|
|
97
|
-
export const watcherBuildSkew = (report) => {
|
|
98
|
-
const running = report.watcher.build;
|
|
99
|
-
const installed = report.agents.sync;
|
|
100
|
-
if (!report.watcher.running || installed === undefined || installed === DEV_VERSION || running === installed) {
|
|
101
|
-
return undefined;
|
|
102
|
-
}
|
|
103
|
-
return { running, installed };
|
|
104
|
-
};
|
|
105
|
-
export const ComputerGapSchema = z.enum([
|
|
106
|
-
"offline",
|
|
107
|
-
"scope-off",
|
|
108
|
-
"no-agent",
|
|
109
|
-
"unreported",
|
|
110
|
-
]);
|
|
111
|
-
export const ComputerSyncSchema = z.object({
|
|
112
|
-
machine: z.string(),
|
|
113
|
-
mode: z.enum(["sync", "mirror"]),
|
|
114
|
-
seenAt: z.number().optional(),
|
|
115
|
-
});
|
|
116
|
-
export const ComputerSchema = z.object({
|
|
117
|
-
key: z.string(),
|
|
118
|
-
label: z.string(),
|
|
119
|
-
sync: ComputerSyncSchema.optional(),
|
|
120
|
-
hostId: z.string().optional(),
|
|
121
|
-
online: z.boolean().optional(),
|
|
122
|
-
platform: z.string().optional(),
|
|
123
|
-
facts: HostFactsSchema.optional(),
|
|
124
|
-
hostAgent: z.string().optional(),
|
|
125
|
-
lastSeen: z.number().optional(),
|
|
126
|
-
report: MachineReportSchema.optional(),
|
|
127
|
-
gap: ComputerGapSchema.optional(),
|
|
128
|
-
});
|
|
129
|
-
export const ComputersListSchema = z.object({ computers: z.array(ComputerSchema) });
|
|
130
|
-
export const SyncStatusSchema = z.object({
|
|
131
|
-
enrolled: z.boolean(),
|
|
132
|
-
available: z.boolean().optional(),
|
|
133
|
-
machines: z.array(MachineReportSchema).optional(),
|
|
134
|
-
});
|
|
135
|
-
//# sourceMappingURL=computers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"computers.js","sourceRoot":"","sources":["../../src/schemas/computers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAyB7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IAErB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IAGjB,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AA2BH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC;IACzC,OAAO;IACP,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,SAAS;IACT,UAAU;IACV,QAAQ;IACR,MAAM;IACN,WAAW;IACX,eAAe;CAClB,CAAC,CAAC;AAEH,MAAM,CAAC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Q,EAAE;IACjC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import {
|
|
3
|
-
AccountIdSchema,
|
|
4
|
-
AccountListQuerySchema,
|
|
5
|
-
AccountRenameSchema,
|
|
6
|
-
AuthorizeChallengeSchema,
|
|
7
|
-
OauthAccountListSchema,
|
|
8
|
-
OauthAccountSchema,
|
|
9
|
-
OauthExchangeSchema,
|
|
10
|
-
} from "../schemas/provider-oauth.js";
|
|
11
|
-
import { OkSchema } from "../schemas/shared.js";
|
|
12
|
-
|
|
13
|
-
// Claude subscription OAuth, the sandbox owns the credential. `start` hands the browser the authorize URL +
|
|
14
|
-
// PKCE material; `exchange` stores the resulting tokens as a new account and returns it; `accounts` lists the
|
|
15
|
-
// connected accounts; `rename` renames one; `disconnect` clears the one named by id. A sandbox can hold several
|
|
16
|
-
// Claude accounts.
|
|
17
|
-
//
|
|
18
|
-
// The model catalog is NOT here: it is the one thing every provider answers identically, so it lives on the
|
|
19
|
-
// shared /providers/{provider}/models route (providers.contract.ts). What is left is what is genuinely Claude's
|
|
20
|
-
//, an account handshake no other provider has.
|
|
21
|
-
export const claudeContract = {
|
|
22
|
-
start: oc
|
|
23
|
-
.route({
|
|
24
|
-
method: "POST",
|
|
25
|
-
path: "/claude/oauth/start",
|
|
26
|
-
summary: "Begin connecting a Claude account",
|
|
27
|
-
description:
|
|
28
|
-
"Hands back the address to send somebody to, and the proof this sandbox will need to finish the exchange. The sandbox holds the credential afterwards, not the browser.",
|
|
29
|
-
})
|
|
30
|
-
.output(AuthorizeChallengeSchema),
|
|
31
|
-
exchange: oc
|
|
32
|
-
.route({
|
|
33
|
-
method: "POST",
|
|
34
|
-
path: "/claude/oauth/exchange",
|
|
35
|
-
summary: "Finish connecting a Claude account",
|
|
36
|
-
description:
|
|
37
|
-
"Trades the code from the sign-in for stored tokens and answers with the account it just connected. A sandbox can hold several Claude accounts side by side.",
|
|
38
|
-
})
|
|
39
|
-
.input(OauthExchangeSchema)
|
|
40
|
-
.output(OauthAccountSchema),
|
|
41
|
-
// Each account carries its plan-limit reading. `force` re-measures before answering, see
|
|
42
|
-
// AccountListQuerySchema, and USAGE_WAIT_MS in claude.routes.ts for what an ordinary read waits.
|
|
43
|
-
accounts: oc
|
|
44
|
-
.route({
|
|
45
|
-
method: "GET",
|
|
46
|
-
path: "/claude/accounts",
|
|
47
|
-
summary: "Connected Claude accounts",
|
|
48
|
-
description:
|
|
49
|
-
"Each connected account with how full its plan limits were when last measured. Ask for a fresh measurement and it takes one before answering, which is slower.",
|
|
50
|
-
})
|
|
51
|
-
.input(AccountListQuerySchema)
|
|
52
|
-
.output(OauthAccountListSchema),
|
|
53
|
-
rename: oc
|
|
54
|
-
.route({
|
|
55
|
-
method: "POST",
|
|
56
|
-
path: "/claude/account/rename",
|
|
57
|
-
summary: "Rename a Claude account",
|
|
58
|
-
description: "Changes the label one account shows under, so several are tellable apart.",
|
|
59
|
-
})
|
|
60
|
-
.input(AccountRenameSchema)
|
|
61
|
-
.output(OauthAccountSchema),
|
|
62
|
-
disconnect: oc
|
|
63
|
-
.route({
|
|
64
|
-
method: "POST",
|
|
65
|
-
path: "/claude/account/disconnect",
|
|
66
|
-
summary: "Disconnect a Claude account",
|
|
67
|
-
description: "Clears the stored tokens for one account. The others stay connected.",
|
|
68
|
-
})
|
|
69
|
-
.input(AccountIdSchema)
|
|
70
|
-
.output(OkSchema),
|
|
71
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { oc } from "@orpc/contract";
|
|
2
|
-
import {
|
|
3
|
-
AccountIdSchema,
|
|
4
|
-
AccountListQuerySchema,
|
|
5
|
-
AccountRenameSchema,
|
|
6
|
-
CursorLoginCancelSchema,
|
|
7
|
-
CursorLoginStartSchema,
|
|
8
|
-
OauthAccountListSchema,
|
|
9
|
-
OauthAccountSchema,
|
|
10
|
-
} from "../schemas/provider-oauth.js";
|
|
11
|
-
import { OkSchema } from "../schemas/shared.js";
|
|
12
|
-
|
|
13
|
-
/* Cursor subscription sign-in, the sandbox owns the credential and the platform never sees it, the same bargain
|
|
14
|
-
* claude.contract.ts strikes. What differs is who finishes the handshake.
|
|
15
|
-
*
|
|
16
|
-
* Claude's flow is start → the browser gets a code → `exchange` hands it back. Cursor's PKCE verifier is
|
|
17
|
-
* redeemable on its own, so it never leaves the daemon: `start` begins the flow, keeps the verifier in memory,
|
|
18
|
-
* polls Cursor until the browser completes the sign-in, mints a 90-day user key and writes it as an account.
|
|
19
|
-
* The caller opens the URL and then watches `accounts`, exactly as it does for a device login, which is why
|
|
20
|
-
* there is no `exchange` route here and a `cancel` one instead.
|
|
21
|
-
*
|
|
22
|
-
* The model catalog is deliberately absent, as it is for every provider: it is the one question they all answer
|
|
23
|
-
* identically, so it lives on the shared /providers/{provider}/models route (providers.contract.ts). */
|
|
24
|
-
export const cursorContract = {
|
|
25
|
-
start: oc
|
|
26
|
-
.route({
|
|
27
|
-
method: "POST",
|
|
28
|
-
path: "/cursor/login/start",
|
|
29
|
-
summary: "Begin connecting a Cursor account",
|
|
30
|
-
description:
|
|
31
|
-
"Hands back the page to sign in on. The sandbox finishes the handshake itself and stores the credential, so nothing has to be pasted back: watch the account list instead.",
|
|
32
|
-
})
|
|
33
|
-
.output(CursorLoginStartSchema),
|
|
34
|
-
cancel: oc
|
|
35
|
-
.route({
|
|
36
|
-
method: "POST",
|
|
37
|
-
path: "/cursor/login/cancel",
|
|
38
|
-
summary: "Abandon a Cursor sign-in",
|
|
39
|
-
description: "Stops waiting on a sign-in nobody completed. An abandoned attempt also expires on its own.",
|
|
40
|
-
})
|
|
41
|
-
.input(CursorLoginCancelSchema)
|
|
42
|
-
.output(OkSchema),
|
|
43
|
-
// Shaped like Claude's, including `force`, so the two account lists render through one component. Cursor
|
|
44
|
-
// publishes no account-wide headroom today, so `usage` stays absent on these rows and they draw a dot rather
|
|
45
|
-
// than a ring, which is what an unmeasured account has always meant here.
|
|
46
|
-
accounts: oc
|
|
47
|
-
.route({
|
|
48
|
-
method: "GET",
|
|
49
|
-
path: "/cursor/accounts",
|
|
50
|
-
summary: "Connected Cursor accounts",
|
|
51
|
-
description:
|
|
52
|
-
"Each connected account, and whether its stored key is still good. Cursor publishes no plan-wide allowance, so these rows carry no usage reading.",
|
|
53
|
-
})
|
|
54
|
-
.input(AccountListQuerySchema)
|
|
55
|
-
.output(OauthAccountListSchema),
|
|
56
|
-
rename: oc
|
|
57
|
-
.route({
|
|
58
|
-
method: "POST",
|
|
59
|
-
path: "/cursor/account/rename",
|
|
60
|
-
summary: "Rename a Cursor account",
|
|
61
|
-
description: "Changes the label one account shows under, so several are tellable apart.",
|
|
62
|
-
})
|
|
63
|
-
.input(AccountRenameSchema)
|
|
64
|
-
.output(OauthAccountSchema),
|
|
65
|
-
disconnect: oc
|
|
66
|
-
.route({
|
|
67
|
-
method: "POST",
|
|
68
|
-
path: "/cursor/account/disconnect",
|
|
69
|
-
summary: "Disconnect a Cursor account",
|
|
70
|
-
description: "Clears the stored key for one account. The others stay connected.",
|
|
71
|
-
})
|
|
72
|
-
.input(AccountIdSchema)
|
|
73
|
-
.output(OkSchema),
|
|
74
|
-
};
|