@botiverse/oar 0.99.0 → 0.101.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -17
- package/dist/contracts/login.d.ts +7 -1
- package/dist/contracts/login.d.ts.map +1 -1
- package/dist/contracts/provider-auth.d.ts +8 -4
- package/dist/contracts/provider-auth.d.ts.map +1 -1
- package/dist/contracts/session-options.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/runtimes/antigravity/logout.d.ts.map +1 -1
- package/dist/runtimes/antigravity/logout.js +3 -2
- package/dist/runtimes/antigravity/logout.js.map +1 -1
- package/dist/runtimes/claude/logout.d.ts.map +1 -1
- package/dist/runtimes/claude/logout.js +3 -2
- package/dist/runtimes/claude/logout.js.map +1 -1
- package/dist/runtimes/codebuddy/index.d.ts +1 -0
- package/dist/runtimes/codebuddy/index.d.ts.map +1 -1
- package/dist/runtimes/codebuddy/index.js +1 -0
- package/dist/runtimes/codebuddy/index.js.map +1 -1
- package/dist/runtimes/codebuddy/logout.d.ts +5 -0
- package/dist/runtimes/codebuddy/logout.d.ts.map +1 -0
- package/dist/runtimes/codebuddy/logout.js +57 -0
- package/dist/runtimes/codebuddy/logout.js.map +1 -0
- package/dist/runtimes/codex/installation-candidates.d.ts +31 -0
- package/dist/runtimes/codex/installation-candidates.d.ts.map +1 -0
- package/dist/runtimes/codex/installation-candidates.js +92 -0
- package/dist/runtimes/codex/installation-candidates.js.map +1 -0
- package/dist/runtimes/codex/installation.d.ts +1 -19
- package/dist/runtimes/codex/installation.d.ts.map +1 -1
- package/dist/runtimes/codex/installation.js +2 -49
- package/dist/runtimes/codex/installation.js.map +1 -1
- package/dist/runtimes/codex/logout.d.ts.map +1 -1
- package/dist/runtimes/codex/logout.js +3 -2
- package/dist/runtimes/codex/logout.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/runtimes/grok/auth.d.ts.map +1 -1
- package/dist/runtimes/grok/auth.js +3 -2
- package/dist/runtimes/grok/auth.js.map +1 -1
- package/dist/runtimes/kimi/logout.d.ts.map +1 -1
- package/dist/runtimes/kimi/logout.js +3 -2
- package/dist/runtimes/kimi/logout.js.map +1 -1
- package/dist/runtimes/opencode/index.d.ts +2 -0
- package/dist/runtimes/opencode/index.d.ts.map +1 -1
- package/dist/runtimes/opencode/index.js +1 -0
- package/dist/runtimes/opencode/index.js.map +1 -1
- package/dist/runtimes/opencode/provider-auth-error.d.ts +25 -0
- package/dist/runtimes/opencode/provider-auth-error.d.ts.map +1 -0
- package/dist/runtimes/opencode/provider-auth-error.js +13 -0
- package/dist/runtimes/opencode/provider-auth-error.js.map +1 -0
- package/dist/runtimes/opencode/provider-auth-facade.d.ts +28 -0
- package/dist/runtimes/opencode/provider-auth-facade.d.ts.map +1 -0
- package/dist/runtimes/opencode/provider-auth-facade.js +178 -0
- package/dist/runtimes/opencode/provider-auth-facade.js.map +1 -0
- package/dist/runtimes/opencode/provider-auth-oauth.d.ts +24 -0
- package/dist/runtimes/opencode/provider-auth-oauth.d.ts.map +1 -0
- package/dist/runtimes/opencode/provider-auth-oauth.js +189 -0
- package/dist/runtimes/opencode/provider-auth-oauth.js.map +1 -0
- package/dist/runtimes/opencode/provider-auth-prompts.d.ts +16 -0
- package/dist/runtimes/opencode/provider-auth-prompts.d.ts.map +1 -0
- package/dist/runtimes/opencode/provider-auth-prompts.js +91 -0
- package/dist/runtimes/opencode/provider-auth-prompts.js.map +1 -0
- package/dist/runtimes/opencode/provider-auth-registry.d.ts +79 -0
- package/dist/runtimes/opencode/provider-auth-registry.d.ts.map +1 -0
- package/dist/runtimes/opencode/provider-auth-registry.js +146 -0
- package/dist/runtimes/opencode/provider-auth-registry.js.map +1 -0
- package/dist/runtimes/opencode/provider-auth-server.d.ts +38 -0
- package/dist/runtimes/opencode/provider-auth-server.d.ts.map +1 -0
- package/dist/runtimes/opencode/provider-auth-server.js +221 -0
- package/dist/runtimes/opencode/provider-auth-server.js.map +1 -0
- package/dist/runtimes/opencode/provider-auth.d.ts +49 -0
- package/dist/runtimes/opencode/provider-auth.d.ts.map +1 -0
- package/dist/runtimes/opencode/provider-auth.js +39 -0
- package/dist/runtimes/opencode/provider-auth.js.map +1 -0
- package/dist/shared/acp/session.js +4 -1
- package/dist/shared/acp/session.js.map +1 -1
- package/dist/shared/acp/turn-terminals.d.ts +2 -1
- package/dist/shared/acp/turn-terminals.d.ts.map +1 -1
- package/dist/shared/acp/turn-terminals.js +47 -23
- package/dist/shared/acp/turn-terminals.js.map +1 -1
- 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/host-watchdog.d.ts +22 -0
- package/dist/shared/executable/host-watchdog.d.ts.map +1 -0
- package/dist/shared/executable/host-watchdog.js +79 -0
- package/dist/shared/executable/host-watchdog.js.map +1 -0
- package/dist/shared/executable/node-eval.d.ts +10 -0
- package/dist/shared/executable/node-eval.d.ts.map +1 -0
- package/dist/shared/executable/node-eval.js +17 -0
- package/dist/shared/executable/node-eval.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/dist/shared/login.d.ts +9 -4
- package/dist/shared/login.d.ts.map +1 -1
- package/dist/shared/login.js +15 -7
- package/dist/shared/login.js.map +1 -1
- package/dist/shared/logout.d.ts +8 -0
- package/dist/shared/logout.d.ts.map +1 -1
- package/dist/shared/logout.js +13 -0
- package/dist/shared/logout.js.map +1 -1
- package/dist/shared/shell-environment.d.ts.map +1 -1
- package/dist/shared/shell-environment.js +6 -13
- package/dist/shared/shell-environment.js.map +1 -1
- package/package.json +5 -1
|
@@ -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,EAAE,IAAI,KAAK,CAAC,WAAW,KAAK,KAAK,CAAC,EAAE,CAAC,C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BAA8B,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,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,MAAM,CAAC,IAAI,KAAK,YAAY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AE,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"}
|
|
@@ -2,7 +2,7 @@ import { UnsupportedOptionError } from "../../contracts/errors.js";
|
|
|
2
2
|
import { errorMessage, LoginSecrets } from "../../shared/login.js";
|
|
3
3
|
import { confirmedLogout, logoutTimedOut } from "../../shared/logout.js";
|
|
4
4
|
import { readCursorAuthStatus } from "./auth-status.js";
|
|
5
|
-
import {
|
|
5
|
+
import { callRedaction, cursorSdkAccess, IN_PROCESS_ENV, withLease } from "./access.js";
|
|
6
6
|
/*
|
|
7
7
|
* `Cursor.auth.logout(options?: { store? })` (@cursor/sdk 1.0.36, read in
|
|
8
8
|
* its bundle, `dist/esm/index.js`, and `dist/esm/auth/login.d.ts`
|
|
@@ -36,28 +36,29 @@ async function sdkLogout(logout, timeoutMs) {
|
|
|
36
36
|
clearTimeout(timer);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
/** Signs cursor out with the SDK's own `Cursor.auth.logout`; `Cursor.auth.status` decides. */
|
|
40
|
-
export function cursorLogoutWith(
|
|
39
|
+
/** 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`. */
|
|
40
|
+
export function cursorLogoutWith(source) {
|
|
41
|
+
const access = cursorSdkAccess(source);
|
|
41
42
|
return async (installation, options = {}) => {
|
|
42
|
-
if (options.env !== undefined && Object.keys(options.env).length > 0) {
|
|
43
|
-
throw new UnsupportedOptionError("env",
|
|
43
|
+
if (access.execution === "in_process" && options.env !== undefined && Object.keys(options.env).length > 0) {
|
|
44
|
+
throw new UnsupportedOptionError("env", IN_PROCESS_ENV);
|
|
44
45
|
}
|
|
45
46
|
if (installation.via !== "bundled") {
|
|
46
47
|
return { kind: "unsupported", reason: "unsupported_installation", detail: "cursor signs out through the bundled @cursor/sdk" };
|
|
47
48
|
}
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return
|
|
49
|
+
const result = await withLease(access, options.env, async (sdk) => {
|
|
50
|
+
const { auth } = sdk.Cursor;
|
|
51
|
+
if (auth?.logout === undefined) {
|
|
52
|
+
return { kind: "unsupported", reason: "version_unsupported", detail: "@cursor/sdk 1.3.1 is required; this one has no Cursor.auth.logout" };
|
|
53
|
+
}
|
|
54
|
+
// With no store: the SDK's own default, the file `status()` reads.
|
|
55
|
+
const native = await sdkLogout(async () => {
|
|
56
|
+
await auth.logout?.();
|
|
57
|
+
}, options.timeoutMs ?? LOGOUT_TIMEOUT_MS);
|
|
58
|
+
return confirmedLogout(native, await readCursorAuthStatus(auth), LOGOUT_CALL);
|
|
59
|
+
});
|
|
60
|
+
// Details can carry the SDK's or the child's words: redacted with the call's credentials too.
|
|
61
|
+
return callRedaction(options.env)("failed" in result ? { kind: "failed", reason: "process_failed", detail: new LoginSecrets().line(result.failed) } : result);
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
64
|
//# sourceMappingURL=logout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout.js","sources":["../../../src/runtimes/cursor/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AE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,mEAAmE,EAAE,CAAC;YAC7I,CAAC;YACD,mEAAmE;YACnE,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,KAAK,IAAI,EAAE;gBACxC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YACxB,CAAC,EAAE,OAAO,CAAC,SAAS,IAAI,iBAAiB,CAAC,CAAC;YAC3C,OAAO,eAAe,CAAC,MAAM,EAAE,MAAM,oBAAoB,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC;QAChF,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"}
|
|
@@ -15,6 +15,11 @@ export declare function cursorSelectionEffort(selection: ModelSelection | undefi
|
|
|
15
15
|
* '--system-prompt'" (probed 2026-10-03), and there is no append.
|
|
16
16
|
*/
|
|
17
17
|
export declare const cursorRefusedSessionOptions: RefusedSessionOptions;
|
|
18
|
+
/**
|
|
19
|
+
* The subprocess execution mode's refusals: the same, except `env`, which
|
|
20
|
+
* becomes the child's environment (docs/runtimes/cursor.md#execution-modes).
|
|
21
|
+
*/
|
|
22
|
+
export declare const cursorSubprocessRefusedSessionOptions: RefusedSessionOptions;
|
|
18
23
|
/**
|
|
19
24
|
* The selection a session opens with. A local agent always needs one, and a
|
|
20
25
|
* resumed agent does not restore its own, so on resume without a model the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sources":["../../../src/runtimes/cursor/model.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es no verified per-session service-tier setting and readback",
|
|
53
53
|
systemPrompt: "Cursor's SDK runs no system prompt override for a local agent",
|
|
54
54
|
appendSystemPrompt: "Cursor's SDK runs no system prompt override for a local agent",
|
|
55
|
-
env: "Cursor runs in this process and its SDK takes no environment for the agent's tools; SessionOptions.env is unsupported",
|
|
55
|
+
env: "Cursor runs in this process and its SDK takes no environment for the agent's tools; SessionOptions.env is unsupported (the subprocess execution mode takes it)",
|
|
56
56
|
launchArgs: "Cursor runs in this process through its SDK; there is no runtime command line to add arguments to",
|
|
57
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* The subprocess execution mode's refusals: the same, except `env`, which
|
|
60
|
+
* becomes the child's environment (docs/runtimes/cursor.md#execution-modes).
|
|
61
|
+
*/
|
|
62
|
+
export const cursorSubprocessRefusedSessionOptions = {
|
|
63
|
+
...Object.fromEntries(Object.entries(cursorRefusedSessionOptions).filter(([key]) => key !== "env")),
|
|
64
|
+
endTurnProcessesOnAbort: "Cursor's SDK starts its tools inside the session's own child process, and OAR reads no per-turn process tree there; only dispose ends that child's tree",
|
|
65
|
+
launchArgs: "Cursor runs through its SDK in a Node child process OAR starts; there is no Cursor command line to add arguments to",
|
|
66
|
+
};
|
|
58
67
|
/**
|
|
59
68
|
* The selection a session opens with. A local agent always needs one, and a
|
|
60
69
|
* resumed agent does not restore its own, so on resume without a model the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sources":["../../../src/runtimes/cursor/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAEvF,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGtE;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,C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
/** The SDK through the host's loader, or the loader's failure in words. */
|
|
161
|
-
export declare function loadedSdk(load: () => Promise<CursorSdk>): Promise<CursorSdk | {
|
|
162
|
-
readonly failed: string;
|
|
163
|
-
}>;
|
|
164
160
|
/**
|
|
165
161
|
* The host's `sdk` loader, called once, on the first call that needs the
|
|
166
162
|
* SDK: it is a large bundle with a native companion package per platform,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sources":["../../../src/runtimes/cursor/sdk.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sources":["../../../src/runtimes/cursor/sdk.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS;QAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS;YAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KACvF,EAAE,CAAC;IACJ,QAAQ,CAAC,QAAQ,CA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AAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;YAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;YAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG,OAAO,CAAC;YACzH,QAAQ,CAAC,KAAK,EAAE,SAAS;gBAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;gBAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;aAAE,EAAE,CAAC;YAC5F,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;SAC9B,CAAC,CAAC;KACJ,CAAC;IACF,QAAQ,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,MAAM,EAAE;YAAE,IAAI,IAAI,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAA;SAAE,CAAC;QAC/D;;;;;WAKG;QACH,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;KAC5B,CAAC;IACF,QAAQ,CAAC,mBAAmB,CAAC,EAAE,UAAU,yBAAyB,CAAC;CACpE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,CAmBxF"}
|
|
@@ -10,18 +10,12 @@
|
|
|
10
10
|
* must not name a package a host may not have. The host hands the module
|
|
11
11
|
* over (`createCursorRuntime({ sdk: () => import("@cursor/sdk") })`), and
|
|
12
12
|
* its compile checks the real module against `CursorSdk`; in this repo the
|
|
13
|
-
* CLI and the sea trial do, so its typecheck catches drift.
|
|
13
|
+
* CLI and the sea trial do, so its typecheck catches drift. In the
|
|
14
|
+
* subprocess execution mode the host never loads the SDK: a proxy
|
|
15
|
+
* implements this interface over IPC to a child that does
|
|
16
|
+
* (subprocess/proxy.ts), and nothing checks the child's module against it
|
|
17
|
+
* at compile time.
|
|
14
18
|
*/
|
|
15
|
-
/** The SDK through the host's loader, or the loader's failure in words. */
|
|
16
|
-
export async function loadedSdk(load) {
|
|
17
|
-
try {
|
|
18
|
-
const sdk = await load();
|
|
19
|
-
return sdk;
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
return { failed: error instanceof Error ? error.message : String(error) };
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
19
|
/**
|
|
26
20
|
* The host's `sdk` loader, called once, on the first call that needs the
|
|
27
21
|
* SDK: it is a large bundle with a native companion package per platform,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../../../src/runtimes/cursor/sdk.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../../src/runtimes/cursor/sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA0IH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAA8B;IAC5D,IAAI,OAAO,GAA8B,IAAI,CAAC;IAC9C,MAAM,OAAO,GAAG,KAAK,IAAwB,EAAE;QAC7C,IAAI,CAAC;YACH,kEAAkE;YAClE,iEAAiE;YACjE,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;YACxB,MAAM,GAAG,GAAG,MAAM,IAAI,EAAE,CAAC;YACzB,OAAO,GAAG,CAAC;QACb,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,GAAG,IAAI,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,iEAAiE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACvG,CAAC;IACH,CAAC,CAAC;IACF,OAAO,KAAK,IAAI,EAAE;QAChB,OAAO,KAAK,OAAO,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC;QAC1B,OAAO,GAAG,CAAC;IACb,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RequestRecord, SessionOptions } from "../../contracts/session.js";
|
|
2
|
+
import type { SessionKernel } from "../../shared/session-kernel.js";
|
|
3
|
+
import type { CursorSdkAccess, CursorSdkLease } from "./access.js";
|
|
4
|
+
import type { CursorAgent } from "./sdk.js";
|
|
5
|
+
/**
|
|
6
|
+
* The session's SDK and its agent. In subprocess mode the lease is the
|
|
7
|
+
* session's own child, which also answers the model and run lookups the open
|
|
8
|
+
* makes; an open that fails ends it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function openCursorSession(access: CursorSdkAccess, options: SessionOptions): Promise<{
|
|
11
|
+
readonly lease: CursorSdkLease;
|
|
12
|
+
readonly agent: CursorAgent;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* How a cursor session ends. In process there is no process exit to
|
|
16
|
+
* observe, so a dispose is answered `accepted`. In subprocess mode the
|
|
17
|
+
* child's exit is recorded as `exited`, as process runtimes record theirs
|
|
18
|
+
* (shared/process-session.ts): unasked (a crash), once the turn it cut short
|
|
19
|
+
* has ended (`settle`), with the reason and a stderr tail; or as the answer
|
|
20
|
+
* to the dispose that stopped it. An exit that comes after the dispose began
|
|
21
|
+
* answers that dispose, a crash keeping its reason. When the exit was
|
|
22
|
+
* recorded before the dispose began (against no request), the dispose is
|
|
23
|
+
* answered `accepted`, as shared/process-session.ts answers it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function cursorSessionEnd(kernel: SessionKernel, lease: CursorSdkLease, settle: () => Promise<void>): {
|
|
26
|
+
/** As the dispose begins, before it cancels anything. */
|
|
27
|
+
disposing(request: RequestRecord): void;
|
|
28
|
+
/** After the agent was closed: end the child, if any, and answer the dispose. */
|
|
29
|
+
disposed(): Promise<void>;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=session-process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-process.d.ts","sources":["../../../src/runtimes/cursor/session-process.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5C;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAC,CAUlK;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG;IAC3G,yDAAyD;IACzD,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IACxC,iFAAiF;IACjF,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAsCA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { refuseSessionOptions } from "../../shared/session-options.js";
|
|
2
|
+
import { openCursorAgent } from "./model.js";
|
|
3
|
+
/**
|
|
4
|
+
* The session's SDK and its agent. In subprocess mode the lease is the
|
|
5
|
+
* session's own child, which also answers the model and run lookups the open
|
|
6
|
+
* makes; an open that fails ends it.
|
|
7
|
+
*/
|
|
8
|
+
export async function openCursorSession(access, options) {
|
|
9
|
+
refuseSessionOptions(access.refusedSessionOptions, options);
|
|
10
|
+
const lease = await access.lease(options.env, "session");
|
|
11
|
+
try {
|
|
12
|
+
const agent = await openCursorAgent(lease.sdk, options);
|
|
13
|
+
return { lease, agent };
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
await lease.release();
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* How a cursor session ends. In process there is no process exit to
|
|
22
|
+
* observe, so a dispose is answered `accepted`. In subprocess mode the
|
|
23
|
+
* child's exit is recorded as `exited`, as process runtimes record theirs
|
|
24
|
+
* (shared/process-session.ts): unasked (a crash), once the turn it cut short
|
|
25
|
+
* has ended (`settle`), with the reason and a stderr tail; or as the answer
|
|
26
|
+
* to the dispose that stopped it. An exit that comes after the dispose began
|
|
27
|
+
* answers that dispose, a crash keeping its reason. When the exit was
|
|
28
|
+
* recorded before the dispose began (against no request), the dispose is
|
|
29
|
+
* answered `accepted`, as shared/process-session.ts answers it.
|
|
30
|
+
*/
|
|
31
|
+
export function cursorSessionEnd(kernel, lease, settle) {
|
|
32
|
+
let recorded = false;
|
|
33
|
+
let disposeRequest = null;
|
|
34
|
+
// The exit was recorded before the dispose began: the dispose finds nothing to stop.
|
|
35
|
+
let goneBefore = false;
|
|
36
|
+
// An exit nobody asked for, kept for a dispose that comes before it is recorded.
|
|
37
|
+
let unasked = null;
|
|
38
|
+
const record = (exit, reason) => {
|
|
39
|
+
if (recorded) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
recorded = true;
|
|
43
|
+
kernel.respond(disposeRequest?.id ?? "", { kind: "exited", code: exit.code, ...(reason === undefined ? {} : { reason }) });
|
|
44
|
+
};
|
|
45
|
+
lease.child?.onExit((exit) => {
|
|
46
|
+
if (lease.child?.stopping() === true) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
unasked = exit;
|
|
50
|
+
void (async () => {
|
|
51
|
+
await settle();
|
|
52
|
+
record(exit, exit.reason);
|
|
53
|
+
})();
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
disposing(request) {
|
|
57
|
+
// An exit already recorded answered no request: this dispose is then answered `accepted` below.
|
|
58
|
+
goneBefore = recorded;
|
|
59
|
+
disposeRequest = request;
|
|
60
|
+
},
|
|
61
|
+
async disposed() {
|
|
62
|
+
if (disposeRequest === null) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (lease.child === null || goneBefore) {
|
|
66
|
+
// In process, or the child was already gone: nothing is left to stop.
|
|
67
|
+
kernel.respond(disposeRequest.id, { kind: "accepted" });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const exit = await lease.release();
|
|
71
|
+
if (unasked !== null) {
|
|
72
|
+
record(unasked, unasked.reason);
|
|
73
|
+
}
|
|
74
|
+
else if (exit !== null) {
|
|
75
|
+
record(exit);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=session-process.js.map
|