@botiverse/oar 0.100.0 → 0.101.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 +2 -2
- package/dist/contracts/session-options.d.ts +1 -1
- package/dist/runtimes/claude/list-models.d.ts +4 -2
- package/dist/runtimes/claude/list-models.d.ts.map +1 -1
- package/dist/runtimes/claude/list-models.js +4 -2
- package/dist/runtimes/claude/list-models.js.map +1 -1
- package/dist/runtimes/codex/installation-candidates.d.ts +32 -0
- package/dist/runtimes/codex/installation-candidates.d.ts.map +1 -0
- package/dist/runtimes/codex/installation-candidates.js +107 -0
- package/dist/runtimes/codex/installation-candidates.js.map +1 -0
- package/dist/runtimes/codex/installation.d.ts +1 -30
- package/dist/runtimes/codex/installation.d.ts.map +1 -1
- package/dist/runtimes/codex/installation.js +2 -82
- package/dist/runtimes/codex/installation.js.map +1 -1
- package/dist/runtimes/cursor/access.d.ts +68 -0
- package/dist/runtimes/cursor/access.d.ts.map +1 -0
- package/dist/runtimes/cursor/access.js +77 -0
- package/dist/runtimes/cursor/access.js.map +1 -0
- package/dist/runtimes/cursor/auth-status.d.ts +4 -3
- package/dist/runtimes/cursor/auth-status.d.ts.map +1 -1
- package/dist/runtimes/cursor/auth-status.js +20 -18
- package/dist/runtimes/cursor/auth-status.js.map +1 -1
- package/dist/runtimes/cursor/index.d.ts +50 -10
- package/dist/runtimes/cursor/index.d.ts.map +1 -1
- package/dist/runtimes/cursor/index.js +40 -21
- package/dist/runtimes/cursor/index.js.map +1 -1
- package/dist/runtimes/cursor/installation.d.ts +1 -1
- package/dist/runtimes/cursor/installation.d.ts.map +1 -1
- package/dist/runtimes/cursor/installation.js +5 -2
- package/dist/runtimes/cursor/installation.js.map +1 -1
- package/dist/runtimes/cursor/list-models.d.ts +4 -2
- package/dist/runtimes/cursor/list-models.d.ts.map +1 -1
- package/dist/runtimes/cursor/list-models.js +31 -14
- package/dist/runtimes/cursor/list-models.js.map +1 -1
- package/dist/runtimes/cursor/login.d.ts +8 -3
- package/dist/runtimes/cursor/login.d.ts.map +1 -1
- package/dist/runtimes/cursor/login.js +29 -22
- package/dist/runtimes/cursor/login.js.map +1 -1
- package/dist/runtimes/cursor/logout.d.ts +3 -3
- package/dist/runtimes/cursor/logout.d.ts.map +1 -1
- package/dist/runtimes/cursor/logout.js +19 -18
- package/dist/runtimes/cursor/logout.js.map +1 -1
- package/dist/runtimes/cursor/model.d.ts +5 -0
- package/dist/runtimes/cursor/model.d.ts.map +1 -1
- package/dist/runtimes/cursor/model.js +10 -1
- package/dist/runtimes/cursor/model.js.map +1 -1
- package/dist/runtimes/cursor/sdk.d.ts +0 -4
- package/dist/runtimes/cursor/sdk.d.ts.map +1 -1
- package/dist/runtimes/cursor/sdk.js +5 -11
- package/dist/runtimes/cursor/sdk.js.map +1 -1
- package/dist/runtimes/cursor/session-process.d.ts +31 -0
- package/dist/runtimes/cursor/session-process.d.ts.map +1 -0
- package/dist/runtimes/cursor/session-process.js +80 -0
- package/dist/runtimes/cursor/session-process.js.map +1 -0
- package/dist/runtimes/cursor/session.d.ts +2 -2
- package/dist/runtimes/cursor/session.d.ts.map +1 -1
- package/dist/runtimes/cursor/session.js +10 -10
- package/dist/runtimes/cursor/session.js.map +1 -1
- package/dist/runtimes/cursor/subprocess/channel.d.ts +37 -0
- package/dist/runtimes/cursor/subprocess/channel.d.ts.map +1 -0
- package/dist/runtimes/cursor/subprocess/channel.js +170 -0
- package/dist/runtimes/cursor/subprocess/channel.js.map +1 -0
- package/dist/runtimes/cursor/subprocess/child-script.d.ts +12 -0
- package/dist/runtimes/cursor/subprocess/child-script.d.ts.map +1 -0
- package/dist/runtimes/cursor/subprocess/child-script.js +257 -0
- package/dist/runtimes/cursor/subprocess/child-script.js.map +1 -0
- package/dist/runtimes/cursor/subprocess/proxy.d.ts +11 -0
- package/dist/runtimes/cursor/subprocess/proxy.d.ts.map +1 -0
- package/dist/runtimes/cursor/subprocess/proxy.js +242 -0
- package/dist/runtimes/cursor/subprocess/proxy.js.map +1 -0
- package/dist/shared/executable/environment-marker.d.ts +21 -0
- package/dist/shared/executable/environment-marker.d.ts.map +1 -0
- package/dist/shared/executable/environment-marker.js +137 -0
- package/dist/shared/executable/environment-marker.js.map +1 -0
- package/dist/shared/executable/node-script.d.ts +53 -0
- package/dist/shared/executable/node-script.d.ts.map +1 -0
- package/dist/shared/executable/node-script.js +131 -0
- package/dist/shared/executable/node-script.js.map +1 -0
- package/package.json +5 -1
|
@@ -3,7 +3,8 @@ import { UnsupportedOptionError } from "../../contracts/errors.js";
|
|
|
3
3
|
import { utcInstantFromDate } from "../../shared/instant.js";
|
|
4
4
|
import { asNumber, asRecord } from "../../shared/json.js";
|
|
5
5
|
import { errorMessage, LoginSecrets } from "../../shared/login.js";
|
|
6
|
-
import {
|
|
6
|
+
import { environmentValue } from "../../shared/environment.js";
|
|
7
|
+
import { callRedaction, cursorSdkAccess, IN_PROCESS_ENV, withLease } from "./access.js";
|
|
7
8
|
const STATUS_TIMEOUT_MS = 20_000;
|
|
8
9
|
const STATUS_SOURCE = "Cursor.auth.status";
|
|
9
10
|
function text(value) {
|
|
@@ -54,32 +55,33 @@ export async function readCursorAuthStatus(auth, timeoutMs = STATUS_TIMEOUT_MS)
|
|
|
54
55
|
clearTimeout(timer);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
/** Read only: asks the SDK's `Cursor.auth.status`, never a login flow, and returns no key. */
|
|
58
|
-
export function cursorAuthStatusWith(
|
|
58
|
+
/** Read only: asks the SDK's `Cursor.auth.status`, never a login flow, and returns no key. In subprocess mode it asks in a child with `env`. */
|
|
59
|
+
export function cursorAuthStatusWith(source) {
|
|
60
|
+
const access = cursorSdkAccess(source);
|
|
59
61
|
const reader = async (installation, options = {}) => {
|
|
60
|
-
if (options.env !== undefined && Object.keys(options.env).length > 0) {
|
|
61
|
-
throw new UnsupportedOptionError("env",
|
|
62
|
+
if (access.execution === "in_process" && options.env !== undefined && Object.keys(options.env).length > 0) {
|
|
63
|
+
throw new UnsupportedOptionError("env", IN_PROCESS_ENV);
|
|
62
64
|
}
|
|
63
65
|
if (installation.via !== "bundled") {
|
|
64
66
|
return { kind: "unknown", detail: "cursor's sign-in status needs the bundled @cursor/sdk" };
|
|
65
67
|
}
|
|
66
|
-
if (
|
|
68
|
+
if (environmentValue(access.environment(options.env), "CURSOR_API_KEY") !== undefined) {
|
|
67
69
|
return { kind: "unknown", configured: ["environment: CURSOR_API_KEY"], detail: "Sessions use CURSOR_API_KEY from the environment; Cursor.auth.status neither reads nor validates that key.", source: STATUS_SOURCE };
|
|
68
70
|
}
|
|
69
71
|
const result = await withQueryDeadline("Cursor auth status", options.timeoutMs ?? STATUS_TIMEOUT_MS, async (signal) => {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return status;
|
|
72
|
+
const status = await withLease(access, options.env, async (sdk) => {
|
|
73
|
+
signal.throwIfAborted();
|
|
74
|
+
const { auth } = sdk.Cursor;
|
|
75
|
+
if (auth === undefined) {
|
|
76
|
+
return { kind: "unknown", detail: "this @cursor/sdk has no Cursor.auth; OAR needs 1.3.1" };
|
|
77
|
+
}
|
|
78
|
+
const read = await readCursorAuthStatus(auth, options.timeoutMs);
|
|
79
|
+
return read;
|
|
80
|
+
});
|
|
81
|
+
return "failed" in status ? { kind: "unknown", detail: new LoginSecrets().line(status.failed) } : status;
|
|
81
82
|
}, { kind: "unknown", source: STATUS_SOURCE, detail: `Cursor.auth.status did not answer within ${String(options.timeoutMs ?? STATUS_TIMEOUT_MS)} ms` });
|
|
82
|
-
|
|
83
|
+
// Details can carry the SDK's or the child's words: redacted with the call's credentials too.
|
|
84
|
+
return callRedaction(options.env)(result);
|
|
83
85
|
};
|
|
84
86
|
// With no status options, the official SDK uses only its local file store.
|
|
85
87
|
return Object.assign(reader, { localOnly: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-status.js","sources":["../../../src/runtimes/cursor/auth-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"auth-status.js","sources":["../../../src/runtimes/cursor/auth-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAwB,MAAM,aAAa,CAAC;AAG9G,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C,SAAS,IAAI,CAAC,KAAc;IAC1B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACrF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU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E,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,4CAA4C,MAAM,CAAC,OAAO,CAAC,SAAS,IAAI,iBAAiB,CAAC,KAAK,EAAE,CAAC,CAAC;QACxJ,8FAA8F;QAC9F,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC,CAAC;IACF,2EAA2E;IAC3E,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAa,EAAE,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type Runtime } from "../../contracts/runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import type { CursorSdk } from "./sdk.js";
|
|
3
|
+
/** The default mode: the SDK runs in the host process. */
|
|
4
|
+
export interface CursorInProcessOptions {
|
|
5
|
+
readonly execution?: "in_process";
|
|
4
6
|
/**
|
|
5
7
|
* Loads `@cursor/sdk` 1.3.1, which the host installs (an optional peer
|
|
6
8
|
* dependency of OAR): `() => import("@cursor/sdk")`. Written in the host's
|
|
@@ -10,18 +12,56 @@ export interface CursorRuntimeOptions {
|
|
|
10
12
|
* retried by the next call.
|
|
11
13
|
*/
|
|
12
14
|
readonly sdk: () => Promise<CursorSdk>;
|
|
15
|
+
/** Subprocess mode only: in process, the SDK's tools always see the host's environment. */
|
|
16
|
+
readonly envBase?: never;
|
|
13
17
|
}
|
|
18
|
+
/** Each session, and each model listing, login, logout and status call, runs the SDK in a Node child process of its own. */
|
|
19
|
+
export interface CursorSubprocessOptions {
|
|
20
|
+
readonly execution: "subprocess";
|
|
21
|
+
/**
|
|
22
|
+
* What the child passes to `import()` to load `@cursor/sdk` 1.3.1: a file
|
|
23
|
+
* URL, e.g. `import.meta.resolve("@cursor/sdk")` in the host's own code.
|
|
24
|
+
* The host never loads the SDK itself in this mode, so nothing checks the
|
|
25
|
+
* module's types against `CursorSdk` at compile time.
|
|
26
|
+
*/
|
|
27
|
+
readonly sdkModule: string;
|
|
28
|
+
/**
|
|
29
|
+
* What a child's environment starts from before the session's or call's
|
|
30
|
+
* `env` is applied. `inherit` (the default): the host's whole
|
|
31
|
+
* `process.env`, as for process runtimes. `clean`: nothing; the child gets
|
|
32
|
+
* only the string entries of `env`, plus what OAR adds to run the SDK
|
|
33
|
+
* (docs/runtimes/cursor.md#child-environment). A host that wants an
|
|
34
|
+
* allowlist uses `clean` and passes what Node and the SDK need, such as
|
|
35
|
+
* PATH and HOME.
|
|
36
|
+
*/
|
|
37
|
+
readonly envBase?: "inherit" | "clean";
|
|
38
|
+
}
|
|
39
|
+
export type CursorRuntimeOptions = CursorInProcessOptions | CursorSubprocessOptions;
|
|
14
40
|
/** A cursor runtime: its probe, model listing, login, logout, status and refusals are always there. */
|
|
15
41
|
export type CursorRuntime = Runtime & Required<Pick<Runtime, "installation" | "listModels" | "login" | "logout" | "authStatus" | "refusedSessionOptions">>;
|
|
16
42
|
/**
|
|
17
|
-
* Cursor, embedded through its official SDK (`@cursor/sdk`)
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
43
|
+
* Cursor, embedded through its official SDK (`@cursor/sdk`). It is not in
|
|
44
|
+
* `defaultRuntimes`, because the SDK is the host's to install and hand over;
|
|
45
|
+
* a host that wants cursor adds `createCursorRuntime(...)` to its own
|
|
46
|
+
* registry (docs/design/capabilities.md#a-runtimes-own-settings).
|
|
47
|
+
*
|
|
48
|
+
* Two execution modes (docs/runtimes/cursor.md#execution-modes):
|
|
49
|
+
* - `{ sdk }` (the default, `execution: "in_process"`): the agent runs in
|
|
50
|
+
* this process, the way pi does. Its tools inherit the host's whole
|
|
51
|
+
* environment, so `SessionOptions.env` is refused, and an SDK crash is the
|
|
52
|
+
* host's crash.
|
|
53
|
+
* - `{ execution: "subprocess", sdkModule }`: each session runs the SDK in
|
|
54
|
+
* its own Node child (`process.execPath`), whose environment is
|
|
55
|
+
* `SessionOptions.env` over the host's (`envBase: "inherit"`, the default)
|
|
56
|
+
* or over nothing (`envBase: "clean"`); a child that exits is recorded as
|
|
57
|
+
* `exited`, and a child whose host is gone, SIGKILL included, ends itself
|
|
58
|
+
* and what it started, as far as docs/runtimes/cursor.md#execution-modes
|
|
59
|
+
* says per platform. Model listing, login, logout and the status each run in a
|
|
60
|
+
* one-shot child and take `env` the same way.
|
|
61
|
+
*
|
|
62
|
+
* Account usage is absent: the SDK's usage call is not available to every
|
|
63
|
+
* account (`feature_unavailable`, probed 2026-10-03), and each run reports
|
|
64
|
+
* its own tokens anyway. Login, logout and the status are the SDK's own
|
|
25
65
|
* `Cursor.auth`.
|
|
26
66
|
*/
|
|
27
67
|
export declare function createCursorRuntime(options: CursorRuntimeOptions): CursorRuntime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../../src/runtimes/cursor/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAOzE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../../src/runtimes/cursor/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAOzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,0DAA0D;AAC1D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC;IAClC;;;;;;;OAOG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;IACvC,2FAA2F;IAC3F,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;CAC1B;AAED,4HAA4H;AAC5H,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CACxC;AAED,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,GAAG,uBAAuB,CAAC;AAEpF,uGAAuG;AACvG,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,uBAAuB,CAAC,CAAC,CAAC;AAE3J;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAKhF;AAkBD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,38 +1,57 @@
|
|
|
1
1
|
import { runtimeBrands } from "../../brands.js";
|
|
2
2
|
import { defineRuntime } from "../../contracts/runtime.js";
|
|
3
|
+
import { inProcessAccess, subprocessAccess } from "./access.js";
|
|
3
4
|
import { cursorAuthStatusWith } from "./auth-status.js";
|
|
4
|
-
import {
|
|
5
|
+
import { cursorInstallationFor } from "./installation.js";
|
|
5
6
|
import { cursorListModelsWith } from "./list-models.js";
|
|
6
7
|
import { cursorLoginWith } from "./login.js";
|
|
7
8
|
import { cursorLogoutWith } from "./logout.js";
|
|
8
|
-
import { cursorRefusedSessionOptions } from "./model.js";
|
|
9
|
-
import { cursorSdkLoader } from "./sdk.js";
|
|
10
9
|
import { cursorSessionWith } from "./session.js";
|
|
11
10
|
/**
|
|
12
|
-
* Cursor, embedded through its official SDK (`@cursor/sdk`)
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
11
|
+
* Cursor, embedded through its official SDK (`@cursor/sdk`). It is not in
|
|
12
|
+
* `defaultRuntimes`, because the SDK is the host's to install and hand over;
|
|
13
|
+
* a host that wants cursor adds `createCursorRuntime(...)` to its own
|
|
14
|
+
* registry (docs/design/capabilities.md#a-runtimes-own-settings).
|
|
15
|
+
*
|
|
16
|
+
* Two execution modes (docs/runtimes/cursor.md#execution-modes):
|
|
17
|
+
* - `{ sdk }` (the default, `execution: "in_process"`): the agent runs in
|
|
18
|
+
* this process, the way pi does. Its tools inherit the host's whole
|
|
19
|
+
* environment, so `SessionOptions.env` is refused, and an SDK crash is the
|
|
20
|
+
* host's crash.
|
|
21
|
+
* - `{ execution: "subprocess", sdkModule }`: each session runs the SDK in
|
|
22
|
+
* its own Node child (`process.execPath`), whose environment is
|
|
23
|
+
* `SessionOptions.env` over the host's (`envBase: "inherit"`, the default)
|
|
24
|
+
* or over nothing (`envBase: "clean"`); a child that exits is recorded as
|
|
25
|
+
* `exited`, and a child whose host is gone, SIGKILL included, ends itself
|
|
26
|
+
* and what it started, as far as docs/runtimes/cursor.md#execution-modes
|
|
27
|
+
* says per platform. Model listing, login, logout and the status each run in a
|
|
28
|
+
* one-shot child and take `env` the same way.
|
|
29
|
+
*
|
|
30
|
+
* Account usage is absent: the SDK's usage call is not available to every
|
|
31
|
+
* account (`feature_unavailable`, probed 2026-10-03), and each run reports
|
|
32
|
+
* its own tokens anyway. Login, logout and the status are the SDK's own
|
|
20
33
|
* `Cursor.auth`.
|
|
21
34
|
*/
|
|
22
35
|
export function createCursorRuntime(options) {
|
|
23
|
-
|
|
24
|
-
|
|
36
|
+
if (options.execution === "subprocess") {
|
|
37
|
+
return cursorRuntime(subprocessAccess(options.sdkModule, options.envBase));
|
|
38
|
+
}
|
|
39
|
+
return cursorRuntime(inProcessAccess(options.sdk, true));
|
|
40
|
+
}
|
|
41
|
+
function cursorRuntime(access) {
|
|
42
|
+
const definition = {
|
|
25
43
|
id: "cursor",
|
|
44
|
+
refusedSessionOptions: access.refusedSessionOptions,
|
|
26
45
|
brand: runtimeBrands.cursor,
|
|
27
46
|
manualCompaction: { kind: "supported", activeTurn: "reject" },
|
|
28
|
-
installation:
|
|
29
|
-
listModels: cursorListModelsWith(
|
|
30
|
-
login: cursorLoginWith(
|
|
31
|
-
logout: cursorLogoutWith(
|
|
32
|
-
authStatus: cursorAuthStatusWith(
|
|
33
|
-
session: cursorSessionWith(
|
|
34
|
-
|
|
35
|
-
|
|
47
|
+
installation: cursorInstallationFor(process.platform, process.arch, access.execution),
|
|
48
|
+
listModels: cursorListModelsWith(access),
|
|
49
|
+
login: cursorLoginWith(access),
|
|
50
|
+
logout: cursorLogoutWith(access),
|
|
51
|
+
authStatus: cursorAuthStatusWith(access),
|
|
52
|
+
session: cursorSessionWith(access),
|
|
53
|
+
};
|
|
54
|
+
return defineRuntime(definition, access.execution === "subprocess" ? { execution: "process" } : { execution: "in_process" });
|
|
36
55
|
}
|
|
37
56
|
export { projectCursorModels } from "./list-models.js";
|
|
38
57
|
export { cursorNativeEnvironment } from "./native-environment.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/runtimes/cursor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAgB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/runtimes/cursor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAgB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAwB,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAA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AAC,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;AAC/H,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -9,6 +9,6 @@ import type { InstallationProbe } from "../../contracts/installation.js";
|
|
|
9
9
|
* needs its native companion package, which exists only for the platforms in
|
|
10
10
|
* `PLATFORMS`.
|
|
11
11
|
*/
|
|
12
|
-
export declare function cursorInstallationFor(platform: string, arch: string): InstallationProbe;
|
|
12
|
+
export declare function cursorInstallationFor(platform: string, arch: string, execution?: "in_process" | "subprocess"): InstallationProbe;
|
|
13
13
|
export declare const cursorInstallation: InstallationProbe;
|
|
14
14
|
//# sourceMappingURL=installation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation.d.ts","sources":["../../../src/runtimes/cursor/installation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAwB,MAAM,iCAAiC,CAAC;AAK/F;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"installation.d.ts","sources":["../../../src/runtimes/cursor/installation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAwB,MAAM,iCAAiC,CAAC;AAK/F;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,YAAY,GAAG,YAA2B,GAAG,iBAAiB,CAU9I;AAED,eAAO,MAAM,kBAAkB,EAAE,iBAAyE,CAAC"}
|
|
@@ -11,12 +11,15 @@ const PLATFORMS = new Set(["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x
|
|
|
11
11
|
* needs its native companion package, which exists only for the platforms in
|
|
12
12
|
* `PLATFORMS`.
|
|
13
13
|
*/
|
|
14
|
-
export function cursorInstallationFor(platform, arch) {
|
|
14
|
+
export function cursorInstallationFor(platform, arch, execution = "in_process") {
|
|
15
15
|
const snapshot = PLATFORMS.has(`${platform}-${arch}`)
|
|
16
16
|
? { kind: "available", via: "bundled" }
|
|
17
17
|
: { kind: "unsupported", reason: `@cursor/sdk has no native package for ${platform}-${arch}` };
|
|
18
18
|
return async (options = {}) => {
|
|
19
|
-
|
|
19
|
+
// In subprocess mode a session's environment is the child's; this probe reads none either way.
|
|
20
|
+
if (execution === "in_process") {
|
|
21
|
+
refuseReaderEnvironment(options.env, "Cursor installation probes the host SDK");
|
|
22
|
+
}
|
|
20
23
|
await Promise.resolve();
|
|
21
24
|
return snapshot;
|
|
22
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation.js","sources":["../../../src/runtimes/cursor/installation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAG7E,+EAA+E;AAC/E,MAAM,SAAS,GAAwB,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AAExH;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB,EAAE,IAAY;
|
|
1
|
+
{"version":3,"file":"installation.js","sources":["../../../src/runtimes/cursor/installation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAG7E,+EAA+E;AAC/E,MAAM,SAAS,GAAwB,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AAExH;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB,EAAE,IAAY,EAAE,SAAS,GAAgC,YAAY;IACzH,MAAM,QAAQ,GAAyB,SAAS,CAAC,GAAG,CAAC,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC;QACzE,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,SAAS,EAAE;QACvC,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,yCAAyC,QAAQ,IAAI,IAAI,EAAE,EAAE,CAAC;IACjG,OAAO,KAAK,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE;QAC5B,+FAA+F;QAC/F,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;YAAC,uBAAuB,CAAC,OAAO,CAAC,GAAG,EAAE,yCAAyC,CAAC,CAAC;QAAC,CAAC;QACpH,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAsB,qBAAqB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ModelEntry, ModelLister } from "../../contracts/list-models.js";
|
|
2
|
-
import
|
|
2
|
+
import { type CursorSdkSource } from "./access.js";
|
|
3
|
+
import type { ModelListItem } from "./sdk.js";
|
|
3
4
|
/**
|
|
4
5
|
* Project `Cursor.models.list()` (SDK 1.0.35): `id` is the selector the SDK
|
|
5
6
|
* accepts, the effort menu is the model's reasoning parameter
|
|
@@ -7,5 +8,6 @@ import type { CursorSdk, ModelListItem } from "./sdk.js";
|
|
|
7
8
|
* value in the variant the catalog marks `isDefault`.
|
|
8
9
|
*/
|
|
9
10
|
export declare function projectCursorModels(models: readonly ModelListItem[]): ModelEntry[];
|
|
10
|
-
|
|
11
|
+
/** `Cursor.models.list()`; in subprocess mode in a child of its own with `env`, stopped when the call ends. */
|
|
12
|
+
export declare function cursorListModelsWith(source: CursorSdkSource): ModelLister;
|
|
11
13
|
//# sourceMappingURL=list-models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-models.d.ts","sources":["../../../src/runtimes/cursor/list-models.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"list-models.d.ts","sources":["../../../src/runtimes/cursor/list-models.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAO,EAAuD,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACxG,OAAO,KAAK,EAAa,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,UAAU,EAAE,CAalF;AA0BD,+GAA+G;AAC/G,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,CAwBzE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { refuseReaderEnvironment } from "../../shared/refuse-environment.js";
|
|
2
2
|
import { cursorEffortParameter } from "./model.js";
|
|
3
|
+
import { callRedaction, cursorSdkAccess } from "./access.js";
|
|
3
4
|
/**
|
|
4
5
|
* Project `Cursor.models.list()` (SDK 1.0.35): `id` is the selector the SDK
|
|
5
6
|
* accepts, the effort menu is the model's reasoning parameter
|
|
@@ -29,31 +30,47 @@ function unauthenticated(error) {
|
|
|
29
30
|
? error.message
|
|
30
31
|
: null;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
async function listWithin(sdk, timeoutMs) {
|
|
34
|
+
const deadline = Promise.withResolvers();
|
|
35
|
+
const timer = setTimeout(() => {
|
|
36
|
+
deadline.reject(new Error(`Cursor.models.list() did not answer within ${String(timeoutMs)} ms`));
|
|
37
|
+
}, timeoutMs);
|
|
38
|
+
timer.unref();
|
|
39
|
+
try {
|
|
40
|
+
const models = await Promise.race([sdk.Cursor.models.list(), deadline.promise]);
|
|
41
|
+
return models;
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
clearTimeout(timer);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** `Cursor.models.list()`; in subprocess mode in a child of its own with `env`, stopped when the call ends. */
|
|
48
|
+
export function cursorListModelsWith(source) {
|
|
49
|
+
const access = cursorSdkAccess(source);
|
|
33
50
|
return async (installation, options = {}) => {
|
|
34
|
-
|
|
51
|
+
if (access.execution === "in_process") {
|
|
52
|
+
refuseReaderEnvironment(options.env, "cursor model listing runs in the host process");
|
|
53
|
+
}
|
|
35
54
|
if (installation.via !== "bundled") {
|
|
36
55
|
return { kind: "unsupported", reason: "cursor model listing needs the bundled @cursor/sdk" };
|
|
37
56
|
}
|
|
38
|
-
|
|
57
|
+
// Its answer and errors (with their cause, and a child's stderr tail) go through the call's credentials.
|
|
58
|
+
const clean = callRedaction(options.env);
|
|
59
|
+
let lease = null;
|
|
39
60
|
try {
|
|
40
|
-
|
|
41
|
-
const models = await
|
|
42
|
-
sdk.Cursor.models.list(),
|
|
43
|
-
new Promise((_resolve, reject) => {
|
|
44
|
-
setTimeout(() => {
|
|
45
|
-
reject(new Error(`Cursor.models.list() did not answer within ${String(timeoutMs)} ms`));
|
|
46
|
-
}, timeoutMs).unref();
|
|
47
|
-
}),
|
|
48
|
-
]);
|
|
61
|
+
lease = await access.lease(options.env);
|
|
62
|
+
const models = await listWithin(lease.sdk, options.timeoutMs ?? 15_000);
|
|
49
63
|
return { kind: "ok", models: projectCursorModels(models) };
|
|
50
64
|
}
|
|
51
65
|
catch (error) {
|
|
52
66
|
const detail = unauthenticated(error);
|
|
53
67
|
if (detail !== null) {
|
|
54
|
-
return { kind: "unauthenticated", detail };
|
|
68
|
+
return clean({ kind: "unauthenticated", detail });
|
|
55
69
|
}
|
|
56
|
-
throw new Error("Failed to list Cursor models", { cause: error });
|
|
70
|
+
throw clean(new Error("Failed to list Cursor models", { cause: error }));
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
await lease?.release();
|
|
57
74
|
}
|
|
58
75
|
};
|
|
59
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-models.js","sources":["../../../src/runtimes/cursor/list-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"list-models.js","sources":["../../../src/runtimes/cursor/list-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,eAAe,EAA6C,MAAM,aAAa,CAAC;AAGxG;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAgC;IAClE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,MAAM,SAAS,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;QAC/C,MAAM,aAAa,GAAG,SAAS,KAAK,IAAI;YACtC,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,SAAS,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC;QAC5H,OAAO;YACL,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,GAAG,CAAC,KAAK,CAAC,WAAW,KAAK,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,CAAC;YACpD,CAAC;YACD,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3E,CAAC;gBAAS,CAAC;YACT,MAAM,KAAK,EAAE,OAAO,EAAE,CAAC;QACzB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { RuntimeLogin } from "../../contracts/login.js";
|
|
2
|
-
import { type
|
|
3
|
-
/**
|
|
4
|
-
|
|
2
|
+
import { type CursorSdkSource } from "./access.js";
|
|
3
|
+
/**
|
|
4
|
+
* Signs cursor in with the SDK's own `Cursor.auth.login`, relaying its URL;
|
|
5
|
+
* the key goes to the SDK's store only. In subprocess mode the login runs in
|
|
6
|
+
* a child of its own with `env` over the host's environment, and the key
|
|
7
|
+
* never leaves that child (subprocess/child-script.ts).
|
|
8
|
+
*/
|
|
9
|
+
export declare function cursorLoginWith(source: CursorSdkSource): RuntimeLogin;
|
|
5
10
|
//# sourceMappingURL=login.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sources":["../../../src/runtimes/cursor/login.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAI1E,OAAO,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sources":["../../../src/runtimes/cursor/login.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAI1E,OAAO,EAA6D,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAoK9G;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY,CA6BrE"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { UnsupportedOptionError } from "../../contracts/errors.js";
|
|
2
2
|
import { errorMessage, LoginSecrets, loginBounds, stoppedResult } from "../../shared/login.js";
|
|
3
|
+
import { environmentValue } from "../../shared/environment.js";
|
|
4
|
+
import { callRedaction, cursorSdkAccess, IN_PROCESS_ENV, withLease } from "./access.js";
|
|
3
5
|
import { readCursorAuthStatus } from "./auth-status.js";
|
|
4
|
-
import { loadedSdk, } from "./sdk.js";
|
|
5
6
|
/*
|
|
6
7
|
* `Cursor.auth.login()` (@cursor/sdk 1.0.35, read in its bundle,
|
|
7
8
|
* `dist/esm/index.js`: `Ne.auth`, and `./src/agent/auth/login-flow.ts`):
|
|
@@ -55,7 +56,7 @@ async function sdkLogin(auth, options) {
|
|
|
55
56
|
return { kind: "rejected", error };
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
async function runCursorLogin(auth, file, interaction, timeoutMs) {
|
|
59
|
+
async function runCursorLogin(auth, file, interaction, timeoutMs, env) {
|
|
59
60
|
const secrets = new LoginSecrets();
|
|
60
61
|
const flow = { phase: "waiting" };
|
|
61
62
|
const sdkSignal = new AbortController();
|
|
@@ -93,7 +94,7 @@ async function runCursorLogin(auth, file, interaction, timeoutMs) {
|
|
|
93
94
|
try {
|
|
94
95
|
interaction.onEvent({ kind: "auth_url", url, instructions: URL_INSTRUCTIONS });
|
|
95
96
|
// The SDK prefers the variable over the stored login; its value is never read.
|
|
96
|
-
if (
|
|
97
|
+
if (environmentValue(env, "CURSOR_API_KEY") !== undefined) {
|
|
97
98
|
interaction.onEvent({ kind: "info", message: ENV_KEY_NOTE });
|
|
98
99
|
}
|
|
99
100
|
}
|
|
@@ -134,11 +135,17 @@ async function runCursorLogin(auth, file, interaction, timeoutMs) {
|
|
|
134
135
|
bounds.dispose();
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
|
-
/**
|
|
138
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Signs cursor in with the SDK's own `Cursor.auth.login`, relaying its URL;
|
|
140
|
+
* the key goes to the SDK's store only. In subprocess mode the login runs in
|
|
141
|
+
* a child of its own with `env` over the host's environment, and the key
|
|
142
|
+
* never leaves that child (subprocess/child-script.ts).
|
|
143
|
+
*/
|
|
144
|
+
export function cursorLoginWith(source) {
|
|
145
|
+
const access = cursorSdkAccess(source);
|
|
139
146
|
return async (installation, interaction, options = {}) => {
|
|
140
|
-
if (options.env !== undefined && Object.keys(options.env).length > 0) {
|
|
141
|
-
throw new UnsupportedOptionError("env",
|
|
147
|
+
if (access.execution === "in_process" && options.env !== undefined && Object.keys(options.env).length > 0) {
|
|
148
|
+
throw new UnsupportedOptionError("env", IN_PROCESS_ENV);
|
|
142
149
|
}
|
|
143
150
|
if (installation.via !== "bundled") {
|
|
144
151
|
return { kind: "unsupported", reason: "unsupported_installation", detail: "cursor signs in through the bundled @cursor/sdk" };
|
|
@@ -147,21 +154,21 @@ export function cursorLoginWith(load) {
|
|
|
147
154
|
if (aborted()) {
|
|
148
155
|
return { kind: "cancelled" };
|
|
149
156
|
}
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
return result;
|
|
157
|
+
const result = await withLease(access, options.env, async (sdk, lease) => {
|
|
158
|
+
const { auth } = sdk.Cursor;
|
|
159
|
+
const Store = sdk.FileCredentialStore;
|
|
160
|
+
if (auth === undefined || Store === undefined) {
|
|
161
|
+
return { kind: "unsupported", reason: "version_unsupported", detail: "@cursor/sdk 1.3.1 is required; this one has no Cursor.auth" };
|
|
162
|
+
}
|
|
163
|
+
// The caller may have aborted while the SDK loaded.
|
|
164
|
+
if (aborted()) {
|
|
165
|
+
return { kind: "cancelled" };
|
|
166
|
+
}
|
|
167
|
+
const login = await runCursorLogin(auth, new Store(), interaction, options.timeoutMs ?? LOGIN_TIMEOUT_MS, lease.env);
|
|
168
|
+
return login;
|
|
169
|
+
});
|
|
170
|
+
// Details can carry the SDK's or the child's words: redacted with the call's credentials too.
|
|
171
|
+
return callRedaction(options.env)("failed" in result ? { kind: "failed", reason: "process_failed", detail: new LoginSecrets().line(result.failed) } : result);
|
|
165
172
|
};
|
|
166
173
|
}
|
|
167
174
|
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sources":["../../../src/runtimes/cursor/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAkB,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"login.js","sources":["../../../src/runtimes/cursor/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAkB,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAwB,MAAM,aAAa,CAAC;AAC9G,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,kHAAkH;AAClH,MAAM,gBAAgB,GAAG,EAAE,GAAG,MAAM,CAAC;AACrC,MAAM,gBAAgB,GAAG,oFAAoF,CAAC;AAC9G,MAAM,YAAY,GAAG,qGAAqG,CAAC;AAsB3H;;;;GAIG;AACH,KAAK,UAAU,SAAS,CAAC,IAAgB,EAAE,MAA+B;IACxE,IAAI,MAAM,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAC/B,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAA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AAM,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAwB,EAAE;YAC7F,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;YAC5B,MAAM,KAAK,GAAG,GAAG,CAAC,mBAAmB,CAAC;YACtC,IAAI,IAAI,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC9C,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,4DAA4D,EAAE,CAAC;YACtI,CAAC;YACD,oDAAoD;YACpD,IAAI,OAAO,EAAE,EAAE,CAAC;gBACd,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;YAC/B,CAAC;YACD,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,IAAI,EAAE,IAAI,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,SAAS,IAAI,gBAAgB,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;YACrH,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QACH,8FAA8F;QAC9F,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,YAAY,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAChK,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RuntimeLogout } from "../../contracts/login.js";
|
|
2
|
-
import { type
|
|
3
|
-
/** Signs cursor out with the SDK's own `Cursor.auth.logout`; `Cursor.auth.status` decides. */
|
|
4
|
-
export declare function cursorLogoutWith(
|
|
2
|
+
import { type CursorSdkSource } from "./access.js";
|
|
3
|
+
/** Signs cursor out with the SDK's own `Cursor.auth.logout`; `Cursor.auth.status` decides. In subprocess mode both run in a child with `env`. */
|
|
4
|
+
export declare function cursorLogoutWith(source: CursorSdkSource): RuntimeLogout;
|
|
5
5
|
//# sourceMappingURL=logout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout.d.ts","sources":["../../../src/runtimes/cursor/logout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"logout.d.ts","sources":["../../../src/runtimes/cursor/logout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI5E,OAAO,EAA6D,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAmC9G,iJAAiJ;AACjJ,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,aAAa,CAuBvE"}
|