@cursor/july 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/agent-serve.d.ts +1 -1
- package/dist/bin/agent-serve.js +40 -16
- package/dist/channels/slack/log.d.ts +1 -1
- package/dist/channels/slack/log.d.ts.map +1 -1
- package/dist/channels/slack/log.js +4 -5
- package/dist/channels/slack/setup.js +1 -1
- package/dist/channels/slack/socket-mode.d.ts.map +1 -1
- package/dist/channels/slack/socket-mode.js +10 -9
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +3 -3
- package/dist/docs/assets/{app.BR0RbIdx.js → app.DF-Yx4OP.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.0XrheBv2.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.qjsVTneI.js → VPLocalSearchBox.DSeJSudL.js} +1 -1
- package/dist/docs/assets/chunks/{theme.2Kg8jIp_.js → theme.DZVLTXOC.js} +2 -2
- package/dist/docs/assets/{index.md.m81y7TY7.js → index.md.Cylk70gg.js} +1 -1
- package/dist/docs/building-with-agents.html +3 -3
- package/dist/docs/concepts.html +3 -3
- package/dist/docs/deployment.html +3 -3
- package/dist/docs/evals.html +3 -3
- package/dist/docs/guides/agent-to-agent.html +3 -3
- package/dist/docs/guides/cloud-runtime.html +3 -3
- package/dist/docs/guides/github.html +3 -3
- package/dist/docs/guides/human-in-the-loop.html +3 -3
- package/dist/docs/guides/slack.html +3 -3
- package/dist/docs/guides/webhooks.html +3 -3
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +3 -3
- package/dist/docs/index.html +5 -5
- package/dist/docs/quickstart.html +3 -3
- package/dist/docs/reference/agent-config.html +3 -3
- package/dist/docs/reference/channels.html +3 -3
- package/dist/docs/reference/cli.html +3 -3
- package/dist/docs/reference/connections.html +3 -3
- package/dist/docs/reference/hooks.html +3 -3
- package/dist/docs/reference/http-api.html +3 -3
- package/dist/docs/reference/instructions.html +3 -3
- package/dist/docs/reference/playground.html +3 -3
- package/dist/docs/reference/project-layout.html +3 -3
- package/dist/docs/reference/schedules.html +3 -3
- package/dist/docs/reference/sessions.html +3 -3
- package/dist/docs/reference/skills.html +3 -3
- package/dist/docs/reference/subagents.html +3 -3
- package/dist/docs/reference/tools.html +3 -3
- package/dist/docs/scaffolding-agents.html +3 -3
- package/dist/docs/storage.html +3 -3
- package/dist/docs/troubleshooting.html +3 -3
- package/dist/internal/ab-collector.js +3 -3
- package/dist/internal/ab-fold.js +1 -1
- package/dist/internal/cli-ax.d.ts +13 -5
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +41 -15
- package/dist/internal/cli-github.js +13 -13
- package/dist/internal/cursor/account-mcp.js +3 -3
- package/dist/internal/cursor/backend-client.js +1 -1
- package/dist/internal/cursor/credentials.d.ts +5 -3
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +9 -6
- package/dist/internal/cursor/github-credentials.js +3 -3
- package/dist/internal/cursor-event-relay.js +1 -1
- package/dist/internal/cursor-relay-core.d.ts +1 -1
- package/dist/internal/cursor-relay-core.d.ts.map +1 -1
- package/dist/internal/cursor-relay-core.js +2 -1
- package/dist/internal/cursor-slack-relay.js +1 -1
- package/dist/internal/distribution.d.ts +7 -0
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +7 -0
- package/dist/internal/docs-site.js +3 -3
- package/dist/internal/eval-run-store.d.ts.map +1 -1
- package/dist/internal/eval-run-store.js +8 -8
- package/dist/internal/github-fanout.js +2 -2
- package/dist/internal/host-platforms.js +5 -5
- package/dist/internal/mcp-endpoint.d.ts.map +1 -1
- package/dist/internal/mcp-endpoint.js +1 -1
- package/dist/internal/playground/toolchain.js +6 -6
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +11 -11
- package/dist/internal/resolve-prod-target.d.ts +2 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -1
- package/dist/internal/resolve-prod-target.js +44 -21
- package/dist/internal/resolved-connections.js +5 -5
- package/dist/internal/schedule-runner.js +1 -1
- package/dist/internal/server.js +14 -14
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +13 -13
- package/dist/internal/sessions-client.d.ts +13 -0
- package/dist/internal/sessions-client.d.ts.map +1 -1
- package/dist/internal/sessions-client.js +25 -0
- package/dist/internal/storage-coordinator.js +6 -6
- package/dist/internal/update-check.d.ts +93 -0
- package/dist/internal/update-check.d.ts.map +1 -0
- package/dist/internal/update-check.js +431 -0
- package/dist/playground/assets/{index-D-vo2lV_.css → index-Ct_Usdm8.css} +1 -1
- package/dist/playground/assets/index-Dsyb-Vaj.js +319 -0
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +0 -1
- package/package.json +2 -1
- package/skills/setup-slack/SKILL.md +1 -1
- package/src/bin/agent-serve.ts +42 -16
- package/src/channels/slack/log.ts +5 -5
- package/src/channels/slack/setup.ts +1 -1
- package/src/channels/slack/socket-mode.ts +11 -9
- package/src/internal/ab-collector.ts +3 -3
- package/src/internal/ab-fold.ts +1 -1
- package/src/internal/cli-ax.ts +55 -16
- package/src/internal/cli-github.ts +13 -15
- package/src/internal/cursor/account-mcp.ts +3 -3
- package/src/internal/cursor/backend-client.ts +1 -1
- package/src/internal/cursor/credentials.ts +12 -7
- package/src/internal/cursor/github-credentials.ts +3 -3
- package/src/internal/cursor-event-relay.ts +1 -1
- package/src/internal/cursor-relay-core.ts +4 -2
- package/src/internal/cursor-slack-relay.ts +1 -1
- package/src/internal/distribution.ts +8 -0
- package/src/internal/docs-site.ts +3 -3
- package/src/internal/eval-run-store.ts +8 -10
- package/src/internal/github-fanout.ts +2 -2
- package/src/internal/host-platforms.ts +5 -5
- package/src/internal/mcp-endpoint.ts +1 -3
- package/src/internal/playground/toolchain.ts +6 -6
- package/src/internal/reminder-runner.ts +11 -17
- package/src/internal/resolve-prod-target.ts +55 -23
- package/src/internal/resolved-connections.ts +5 -5
- package/src/internal/schedule-runner.ts +1 -1
- package/src/internal/server.ts +14 -14
- package/src/internal/session-engine.ts +13 -15
- package/src/internal/sessions-client.ts +34 -0
- package/src/internal/storage-coordinator.ts +6 -6
- package/src/internal/update-check.ts +552 -0
- package/src/types.ts +3 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DtIOQzGj.js +0 -1
- package/dist/playground/assets/index-x60b9q2j.js +0 -312
- /package/dist/docs/assets/{index.md.m81y7TY7.lean.js → index.md.Cylk70gg.lean.js} +0 -0
|
@@ -109,7 +109,7 @@ export function runPlaygroundBuild() {
|
|
|
109
109
|
if (toolchain === undefined) {
|
|
110
110
|
throw new Error("playground vite toolchain unavailable (need playground/ sources and the vite package)");
|
|
111
111
|
}
|
|
112
|
-
logger("[
|
|
112
|
+
logger("[agentkit] building playground (vite)...");
|
|
113
113
|
const code = yield spawnVite(toolchain, ["build", "--config", VITE_CONFIG], {
|
|
114
114
|
env: process.env,
|
|
115
115
|
});
|
|
@@ -119,7 +119,7 @@ export function runPlaygroundBuild() {
|
|
|
119
119
|
if (!playgroundBundleExists()) {
|
|
120
120
|
throw new Error("playground vite build finished but dist/playground/index.html is missing");
|
|
121
121
|
}
|
|
122
|
-
logger("[
|
|
122
|
+
logger("[agentkit] playground build complete");
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
@@ -133,7 +133,7 @@ export function ensurePlaygroundBundle() {
|
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
if (resolvePlaygroundToolchain() === undefined) {
|
|
136
|
-
logger("[
|
|
136
|
+
logger("[agentkit] playground bundle missing and vite toolchain unavailable; /playground will show a build hint");
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
139
|
yield runPlaygroundBuild(logger);
|
|
@@ -180,7 +180,7 @@ export function startPlaygroundDevServer(options) {
|
|
|
180
180
|
(_a = child.stderr) === null || _a === void 0 ? void 0 : _a.on("data", (chunk) => {
|
|
181
181
|
const text = chunk.toString().trimEnd();
|
|
182
182
|
if (text !== "") {
|
|
183
|
-
logger(`[
|
|
183
|
+
logger(`[agentkit] playground: ${text}`);
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
186
|
let stopped = false;
|
|
@@ -188,14 +188,14 @@ export function startPlaygroundDevServer(options) {
|
|
|
188
188
|
if (stopped) {
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
|
-
logger(`[
|
|
191
|
+
logger(`[agentkit] playground spawn failed: ${err.message} — static /playground still served when built`);
|
|
192
192
|
});
|
|
193
193
|
child.on("exit", (code, signal) => {
|
|
194
194
|
if (stopped) {
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
197
|
if (code !== 0 && code !== null) {
|
|
198
|
-
logger(`[
|
|
198
|
+
logger(`[agentkit] playground exited (code ${code}${signal ? `, signal ${signal}` : ""}) — static /playground still served when built`);
|
|
199
199
|
}
|
|
200
200
|
});
|
|
201
201
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reminder-runner.d.ts","sourceRoot":"","sources":["../../src/internal/reminder-runner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAEV,mBAAmB,EAGnB,YAAY,EAEb,MAAM,aAAa,CAAC;AASrB,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,qBAAa,oBAAqB,SAAQ,KAAK;IAG3C,QAAQ,CAAC,oBAAoB,EAAE,MAAM,EAAE;IAFzC,YACE,UAAU,EAAE,MAAM,EACT,oBAAoB,EAAE,MAAM,EAAE,EAIxC;CACF;AAyDD,qBAAa,cAAc;IAUvB,OAAO,CAAC,QAAQ,CAA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YA6GJ,aAAa;IAY3B,OAAO,CAAC,eAAe;IAsBvB;;;OAGG;YACW,mBAAmB;YAcnB,aAAa;YAcb,YAAY;IA0C1B,OAAO,CAAC,gBAAgB;IAyDxB,OAAO,CAAC,iBAAiB;YAeX,MAAM;YAYN,SAAS;CAoFxB;AAGD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -110,7 +110,7 @@ export class ReminderRunner {
|
|
|
110
110
|
restored += 1;
|
|
111
111
|
}
|
|
112
112
|
if (restored > 0 || disarmedOrphan > 0) {
|
|
113
|
-
this.logger(`[
|
|
113
|
+
this.logger(`[agentkit] reminders: restored ${restored} armed reminder(s)` +
|
|
114
114
|
(disarmedOrphan > 0
|
|
115
115
|
? `; disarmed ${disarmedOrphan} without live handlers`
|
|
116
116
|
: ""));
|
|
@@ -142,11 +142,11 @@ export class ReminderRunner {
|
|
|
142
142
|
}
|
|
143
143
|
catch (error) {
|
|
144
144
|
const message = error instanceof Error ? error.message : String(error);
|
|
145
|
-
this.logger(`[
|
|
145
|
+
this.logger(`[agentkit] reminders: storage hydrate failed: ${message}`);
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
if (hydrated > 0) {
|
|
149
|
-
this.logger(`[
|
|
149
|
+
this.logger(`[agentkit] reminders: hydrated ${hydrated} reminder(s) from storage`);
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
}
|
|
@@ -302,7 +302,7 @@ export class ReminderRunner {
|
|
|
302
302
|
const delay = Math.min(MAX_TIMER_MS, Math.max(0, nextFireAtMs - Date.now()));
|
|
303
303
|
const timer = setTimeout(() => {
|
|
304
304
|
void this.fire(record.id).catch((error) => __awaiter(this, void 0, void 0, function* () {
|
|
305
|
-
this.logger(`[
|
|
305
|
+
this.logger(`[agentkit] reminder "${record.id}" fire failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
306
306
|
// Keep recurring reminders alive after unexpected throws.
|
|
307
307
|
// One-shots stay armed so a failed wake can be retried / dispatched.
|
|
308
308
|
try {
|
|
@@ -317,7 +317,7 @@ export class ReminderRunner {
|
|
|
317
317
|
yield this.afterFire(current, "skip");
|
|
318
318
|
}
|
|
319
319
|
catch (rescheduleError) {
|
|
320
|
-
this.logger(`[
|
|
320
|
+
this.logger(`[agentkit] reminder "${record.id}" reschedule after failure failed: ${rescheduleError instanceof Error
|
|
321
321
|
? rescheduleError.message
|
|
322
322
|
: String(rescheduleError)}`);
|
|
323
323
|
}
|
|
@@ -368,13 +368,13 @@ export class ReminderRunner {
|
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
catch (error) {
|
|
371
|
-
this.logger(`[
|
|
371
|
+
this.logger(`[agentkit] reminder "${id}" until() failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
if (yield this.isSessionBusy(record.channelId, record.continuationToken)) {
|
|
375
375
|
if (record.busyPolicy === "skipIfBusy") {
|
|
376
376
|
yield this.afterFire(record, "skip");
|
|
377
|
-
this.logger(`[
|
|
377
|
+
this.logger(`[agentkit] reminder "${id}" (${record.purpose}) skipped: session busy`);
|
|
378
378
|
return { outcome: "fired", reason: "skipped_busy" };
|
|
379
379
|
}
|
|
380
380
|
yield this.whenSessionIdle(record.channelId, record.continuationToken);
|
|
@@ -400,7 +400,7 @@ export class ReminderRunner {
|
|
|
400
400
|
if (result.action === "stop") {
|
|
401
401
|
if (latest !== undefined && latest.status === "armed") {
|
|
402
402
|
yield this.disarm(latest, "run_stop");
|
|
403
|
-
this.logger(`[
|
|
403
|
+
this.logger(`[agentkit] reminder "${id}" (${record.purpose}) disarmed: run_stop`);
|
|
404
404
|
return { outcome: "fired", reason: "run_stop" };
|
|
405
405
|
}
|
|
406
406
|
return {
|
|
@@ -413,11 +413,11 @@ export class ReminderRunner {
|
|
|
413
413
|
}
|
|
414
414
|
if (result.action === "skip") {
|
|
415
415
|
yield this.afterFire(latest, "skip", result.reschedule);
|
|
416
|
-
this.logger(`[
|
|
416
|
+
this.logger(`[agentkit] reminder "${id}" (${record.purpose}) skipped`);
|
|
417
417
|
return { outcome: "fired", reason: "skipped" };
|
|
418
418
|
}
|
|
419
419
|
yield this.afterFire(latest, "delivered", result.reschedule);
|
|
420
|
-
this.logger(`[
|
|
420
|
+
this.logger(`[agentkit] reminder "${id}" (${record.purpose}) delivered`);
|
|
421
421
|
return { outcome: "fired", reason: "delivered" };
|
|
422
422
|
}
|
|
423
423
|
finally {
|
|
@@ -497,7 +497,7 @@ export class ReminderRunner {
|
|
|
497
497
|
return { action: "delivered" };
|
|
498
498
|
}
|
|
499
499
|
catch (retryError) {
|
|
500
|
-
this.logger(`[
|
|
500
|
+
this.logger(`[agentkit] reminder "${record.id}" followup failed after wait: ${retryError instanceof Error
|
|
501
501
|
? retryError.message
|
|
502
502
|
: String(retryError)}`);
|
|
503
503
|
return { action: "skip" };
|
|
@@ -21,6 +21,8 @@ export interface ResolveProdTargetOptions {
|
|
|
21
21
|
apiKey?: string;
|
|
22
22
|
fetchImpl?: typeof fetch;
|
|
23
23
|
err?: (text: string) => void;
|
|
24
|
+
/** Test seam for reachability-retry backoff. */
|
|
25
|
+
sleep?: (ms: number) => Promise<void>;
|
|
24
26
|
}
|
|
25
27
|
export interface ResolvedProdTarget {
|
|
26
28
|
agentUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-prod-target.d.ts","sourceRoot":"","sources":["../../src/internal/resolve-prod-target.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGrE,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,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,CAAC;CACf,GAAG,MAAM,CAgBT"}
|
|
@@ -35,7 +35,7 @@ export const PROD_ENGINE_WAKE_HEADERS = {
|
|
|
35
35
|
*/
|
|
36
36
|
export function resolveProdTarget(options) {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
var _a;
|
|
38
|
+
var _a, _b;
|
|
39
39
|
const err = (_a = options.err) !== null && _a !== void 0 ? _a : ((text) => void process.stderr.write(text));
|
|
40
40
|
const slug = resolveProdSlug(options);
|
|
41
41
|
const auth = yield resolveDeployAuth({
|
|
@@ -47,30 +47,48 @@ export function resolveProdTarget(options) {
|
|
|
47
47
|
if (typeof auth === "number") {
|
|
48
48
|
throw new Error(`Could not resolve Cursor credentials/team for --prod (see above).`);
|
|
49
49
|
}
|
|
50
|
+
// A hibernated engine can briefly omit engineAccess while getPod fails
|
|
51
|
+
// during wake. Retry a few times before surfacing "not reachable yet".
|
|
52
|
+
const maxReachabilityAttempts = 5;
|
|
53
|
+
const sleep = (_b = options.sleep) !== null && _b !== void 0 ? _b : sleepMs;
|
|
50
54
|
let detail;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
for (let attempt = 0; attempt < maxReachabilityAttempts; attempt++) {
|
|
56
|
+
try {
|
|
57
|
+
detail = yield auth.client.getDeployment({
|
|
58
|
+
teamId: auth.teamId,
|
|
59
|
+
slug,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (error instanceof DeployApiError) {
|
|
64
|
+
throw new Error(`Deployment "${slug}" (team ${auth.teamId}): ${error.message}`);
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
// `degraded` still serves the previous ACTIVE engine; allow runtime access
|
|
69
|
+
// when the control plane minted engineAccess for it.
|
|
70
|
+
const statusOk = detail.status === "running" || detail.status === "degraded";
|
|
71
|
+
if (!statusOk) {
|
|
72
|
+
const lastError = detail.lastError === null || detail.lastError === undefined
|
|
73
|
+
? ""
|
|
74
|
+
: ` ${sanitizeCustomerFacingDetail(detail.lastError)}`;
|
|
75
|
+
throw new Error(`Deployment "${slug}" is ${detail.status}, not running.${lastError}\n` +
|
|
76
|
+
`Deploy or wait: \`${CLI} deploy --slug ${slug}\` / \`${CLI} deployment ${slug}\``);
|
|
77
|
+
}
|
|
78
|
+
if (detail.engineAccess !== null && detail.engineAccess !== undefined) {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
if (attempt + 1 < maxReachabilityAttempts) {
|
|
82
|
+
if (attempt === 0) {
|
|
83
|
+
err(`${stderrPalette().dim(`Deployment "${slug}" is waking; waiting for engine access…`)}\n`);
|
|
84
|
+
}
|
|
85
|
+
yield sleep(1000 * (attempt + 1));
|
|
60
86
|
}
|
|
61
|
-
throw error;
|
|
62
87
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const access = detail.engineAccess;
|
|
66
|
-
const statusOk = detail.status === "running" || detail.status === "degraded";
|
|
67
|
-
if (!statusOk) {
|
|
68
|
-
const lastError = detail.lastError === null || detail.lastError === undefined
|
|
69
|
-
? ""
|
|
70
|
-
: ` ${sanitizeCustomerFacingDetail(detail.lastError)}`;
|
|
71
|
-
throw new Error(`Deployment "${slug}" is ${detail.status}, not running.${lastError}\n` +
|
|
72
|
-
`Deploy or wait: \`${CLI} deploy --slug ${slug}\` / \`${CLI} deployment ${slug}\``);
|
|
88
|
+
if (detail === undefined) {
|
|
89
|
+
throw new Error(`Deployment "${slug}" lookup failed.`);
|
|
73
90
|
}
|
|
91
|
+
const access = detail.engineAccess;
|
|
74
92
|
if (access === null || access === undefined) {
|
|
75
93
|
throw new Error(`Deployment "${slug}" is ${detail.status} but is not reachable yet. ` +
|
|
76
94
|
`Try \`${CLI} deployment ${slug}\` or redeploy.`);
|
|
@@ -92,6 +110,11 @@ function sanitizeCustomerFacingDetail(message) {
|
|
|
92
110
|
.replace(/\banyrun\b/gi, "runtime")
|
|
93
111
|
.replace(/\bcursorvm\.com\b/gi, "host");
|
|
94
112
|
}
|
|
113
|
+
function sleepMs(ms) {
|
|
114
|
+
return new Promise((resolve) => {
|
|
115
|
+
setTimeout(resolve, ms);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
95
118
|
/** Resolve the deployment slug the same way `deploy` does for a single dir. */
|
|
96
119
|
export function resolveProdSlug(options) {
|
|
97
120
|
var _a;
|
|
@@ -23,7 +23,7 @@ export function validateMountConnectionsConfig(args) {
|
|
|
23
23
|
if (filteredRefs.length === 0) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
throw new Error(`[
|
|
26
|
+
throw new Error(`[agentkit] agent "${label}" has Cursor account MCP connections with \`servers\` filters (${filteredRefs
|
|
27
27
|
.map((ref) => ref.name)
|
|
28
28
|
.join(", ")}) but no --public-url; cloud-runtime turns cannot honor those filters without a public bridge URL. Set --public-url or remove the \`servers\` filter.`);
|
|
29
29
|
}
|
|
@@ -37,14 +37,14 @@ export function assertCloudCanHonorAccountServersFilters(args) {
|
|
|
37
37
|
if (blocked.length === 0) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
throw new Error(`[
|
|
40
|
+
throw new Error(`[agentkit] cloud turn cannot honor Cursor account \`servers\` filters (${blocked
|
|
41
41
|
.map((connection) => connection.name)
|
|
42
42
|
.join(", ")}) without --public-url; set --public-url so cloud turns reach the filtered account bridge instead of falling back to native connectors.`);
|
|
43
43
|
}
|
|
44
44
|
/** Fail closed when anonymous HTTP admission would expose account connectors. */
|
|
45
45
|
export function assertAccountConnectionsNotAnonymous(args) {
|
|
46
46
|
if (args.allowAnonymous === true && args.hasAccountConnections) {
|
|
47
|
-
throw new Error("[
|
|
47
|
+
throw new Error("[agentkit] --allow-anonymous cannot be used with Cursor account MCP connections (defineConnection({ cursorAccount: true })); use --bearer-token or remove the account MCP connections.");
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
export function resolveMountConnections(args) {
|
|
@@ -56,7 +56,7 @@ export function resolveMountConnections(args) {
|
|
|
56
56
|
const peers = resolvePeerConnections(Object.assign(Object.assign({ refs: args.peerRefs, serverUrl: args.serverUrl }, (args.publicUrl === undefined ? {} : { publicUrl: args.publicUrl })), (args.authToken === undefined ? {} : { authToken: args.authToken })));
|
|
57
57
|
resolved.push(...peers);
|
|
58
58
|
if (cloudCapable && args.publicUrl === undefined) {
|
|
59
|
-
args.logger(`[
|
|
59
|
+
args.logger(`[agentkit] warning: agent "${label}" has peer MCP connections (${peers
|
|
60
60
|
.map((peer) => peer.name)
|
|
61
61
|
.join(", ")}) but no --public-url; cloud-runtime turns cannot reach this host's loopback address, so peers are omitted from cloud turns.`);
|
|
62
62
|
}
|
|
@@ -66,7 +66,7 @@ export function resolveMountConnections(args) {
|
|
|
66
66
|
// Non-blocking startup DX: connector statuses land in the serve log.
|
|
67
67
|
args.accountBridge.logPreflight(args.accountRefs);
|
|
68
68
|
if (cloudCapable && args.publicUrl === undefined) {
|
|
69
|
-
args.logger(`[
|
|
69
|
+
args.logger(`[agentkit] agent "${label}": cloud-runtime turns omit the account bridge without --public-url (cloud agents fall back to the account's native connectors).`);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
return resolved;
|
|
@@ -68,7 +68,7 @@ export class ScheduleRunner {
|
|
|
68
68
|
for (const schedule of this.schedules) {
|
|
69
69
|
if (schedule.cron.matches(now)) {
|
|
70
70
|
void this.dispatch(schedule.name).catch((error) => {
|
|
71
|
-
this.logger(`[
|
|
71
|
+
this.logger(`[agentkit] schedule "${schedule.name}" dispatch failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
}
|
package/dist/internal/server.js
CHANGED
|
@@ -123,10 +123,10 @@ export function startServer(mounts_1) {
|
|
|
123
123
|
if (options.allowAnonymousCursorGithub !== true) {
|
|
124
124
|
throw new Error("githubChannel({ cursorAccount: true }) cannot be served with --allow-anonymous because admitted callers could use the signed-in account's GitHub access. If every admitted caller is trusted (e.g. behind an SSO proxy), opt in with --allow-anonymous-cursor-github.");
|
|
125
125
|
}
|
|
126
|
-
logger("[
|
|
126
|
+
logger("[agentkit] warning: --allow-anonymous-cursor-github — every admitted HTTP caller can drive sessions holding the signed-in account's repo-scoped GitHub credential; serve this only behind a trusted boundary (e.g. an SSO proxy)");
|
|
127
127
|
}
|
|
128
128
|
if (cursorGithubConfig.scope.permissions === "contents-write") {
|
|
129
|
-
logger('[
|
|
129
|
+
logger('[agentkit] warning: Cursor GitHub credentials include contents:write — the host holds a push-capable token shared with model-driven tools and untrusted webhook content; prefer permissions: "pr-write" unless this agent must push code');
|
|
130
130
|
}
|
|
131
131
|
const provider = new CursorGithubCredentialProvider({
|
|
132
132
|
client: new CursorBackendClient({
|
|
@@ -161,7 +161,7 @@ export function startServer(mounts_1) {
|
|
|
161
161
|
yield ensureDocsSiteBundle(logger);
|
|
162
162
|
}
|
|
163
163
|
if (options.allowAnonymous === true) {
|
|
164
|
-
logger("[
|
|
164
|
+
logger("[agentkit] warning: --allow-anonymous admits every HTTP caller as the same principal; use only on a trusted network (e.g. Tailscale) and prefer --bearer-token for shared hosts");
|
|
165
165
|
}
|
|
166
166
|
const runner = (_l = options.runner) !== null && _l !== void 0 ? _l : new CursorSdkRunner(accountKey === undefined ? {} : { apiKey: accountKey.apiKey });
|
|
167
167
|
const router = new Router();
|
|
@@ -279,7 +279,7 @@ export function startServer(mounts_1) {
|
|
|
279
279
|
yield definition.onStart(startArgs);
|
|
280
280
|
}
|
|
281
281
|
catch (error) {
|
|
282
|
-
logger(`[
|
|
282
|
+
logger(`[agentkit] channel "${channel.id}" onStart failed: ${error instanceof Error
|
|
283
283
|
? ((_o = error.stack) !== null && _o !== void 0 ? _o : error.message)
|
|
284
284
|
: String(error)}`);
|
|
285
285
|
}
|
|
@@ -567,7 +567,7 @@ export function startServer(mounts_1) {
|
|
|
567
567
|
yield stop();
|
|
568
568
|
}
|
|
569
569
|
catch (error) {
|
|
570
|
-
logger(`[
|
|
570
|
+
logger(`[agentkit] channel onStop failed: ${error instanceof Error
|
|
571
571
|
? ((_a = error.stack) !== null && _a !== void 0 ? _a : error.message)
|
|
572
572
|
: String(error)}`);
|
|
573
573
|
}
|
|
@@ -1043,7 +1043,7 @@ function requireCursorEventsAuth(config, accountKey) {
|
|
|
1043
1043
|
var _a, _b, _c;
|
|
1044
1044
|
const apiKey = ((_b = (_a = config.apiKey) !== null && _a !== void 0 ? _a : accountKey === null || accountKey === void 0 ? void 0 : accountKey.apiKey) !== null && _b !== void 0 ? _b : "").trim();
|
|
1045
1045
|
if (apiKey === "") {
|
|
1046
|
-
throw new Error(`[
|
|
1046
|
+
throw new Error(`[agentkit] --cursor-events (serve({ cursorEvents })) requires a signed-in Cursor account: the SCM event stream is read as the host's user. ${SIGN_IN_HINT}`);
|
|
1047
1047
|
}
|
|
1048
1048
|
return {
|
|
1049
1049
|
apiKey,
|
|
@@ -1067,13 +1067,13 @@ function startCursorEventRelay(input) {
|
|
|
1067
1067
|
}
|
|
1068
1068
|
const repos = [...new Set(config.repos.map((repo) => repo.trim()))].filter((repo) => repo.length > 0);
|
|
1069
1069
|
if (repos.length === 0) {
|
|
1070
|
-
logger("[
|
|
1070
|
+
logger("[agentkit] cursor-events: no repos configured (pass --repo owner/name); relay disabled");
|
|
1071
1071
|
return undefined;
|
|
1072
1072
|
}
|
|
1073
1073
|
const githubTargets = findGitHubChannelTargets(mounts);
|
|
1074
1074
|
const events = [...new Set(githubTargets.flatMap((target) => target.events))];
|
|
1075
1075
|
if (events.length === 0) {
|
|
1076
|
-
logger("[
|
|
1076
|
+
logger("[agentkit] cursor-events: no mounted agent declares a github channel; relay disabled");
|
|
1077
1077
|
return undefined;
|
|
1078
1078
|
}
|
|
1079
1079
|
const baseStateRoot = stateRoot !== null && stateRoot !== void 0 ? stateRoot : join((_b = (_a = mounts[0]) === null || _a === void 0 ? void 0 : _a.project.rootDir) !== null && _b !== void 0 ? _b : process.cwd(), ".agent-serve");
|
|
@@ -1110,11 +1110,11 @@ function startCursorEventRelay(input) {
|
|
|
1110
1110
|
const outcomes = result.targets
|
|
1111
1111
|
.map((target) => `${target.slug || "default"}:${target.status}`)
|
|
1112
1112
|
.join(", ");
|
|
1113
|
-
logger(`[
|
|
1113
|
+
logger(`[agentkit] cursor-events: dispatched ${formatCursorScmEventLog(event)}${outcomes === "" ? "" : ` → ${outcomes}`}`);
|
|
1114
1114
|
}),
|
|
1115
1115
|
});
|
|
1116
1116
|
relay.start();
|
|
1117
|
-
logger(`[
|
|
1117
|
+
logger(`[agentkit] cursor-events: relaying ${events.length} event kind(s) for ${repos.join(", ")} from ${auth.baseUrl}`);
|
|
1118
1118
|
return relay;
|
|
1119
1119
|
}
|
|
1120
1120
|
function collectCursorGithubTargets(mounts) {
|
|
@@ -1244,7 +1244,7 @@ function startCursorSlackRelay(input) {
|
|
|
1244
1244
|
runtime: target.runtime,
|
|
1245
1245
|
channelId: target.channelId,
|
|
1246
1246
|
});
|
|
1247
|
-
logger(`[
|
|
1247
|
+
logger(`[agentkit] cursor-slack: dispatching ${formatCursorSlackEventLog(envelope)} → ${target.runtime.slug || "default"}`);
|
|
1248
1248
|
yield dispatchCursorSlackEnvelope({
|
|
1249
1249
|
runtime: target.accountRuntime,
|
|
1250
1250
|
envelope,
|
|
@@ -1266,7 +1266,7 @@ function startCursorSlackRelay(input) {
|
|
|
1266
1266
|
}));
|
|
1267
1267
|
}
|
|
1268
1268
|
relay.start();
|
|
1269
|
-
logger(`[
|
|
1269
|
+
logger(`[agentkit] cursor-slack: relaying Slack for ${targets
|
|
1270
1270
|
.map((target) => `${target.agentName} (${target.runtime.slug || "default"})`)
|
|
1271
1271
|
.join(", ")} from ${baseUrl} — mention "@Cursor <agent name> …" in the linked workspace`);
|
|
1272
1272
|
return relay;
|
|
@@ -1331,7 +1331,7 @@ function handleRequest(router, req, res, logger) {
|
|
|
1331
1331
|
response = errorResponse(403, "forbidden", error.message);
|
|
1332
1332
|
}
|
|
1333
1333
|
else {
|
|
1334
|
-
logger(`[
|
|
1334
|
+
logger(`[agentkit] request failed: ${error instanceof Error
|
|
1335
1335
|
? ((_c = error.stack) !== null && _c !== void 0 ? _c : error.message)
|
|
1336
1336
|
: String(error)}`);
|
|
1337
1337
|
response = errorResponse(500, "internal_error", "Internal server error.");
|
|
@@ -1341,7 +1341,7 @@ function handleRequest(router, req, res, logger) {
|
|
|
1341
1341
|
yield writeFetchResponse(response, res, method);
|
|
1342
1342
|
}
|
|
1343
1343
|
catch (error) {
|
|
1344
|
-
logger(`[
|
|
1344
|
+
logger(`[agentkit] response write failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
1345
1345
|
res.destroy();
|
|
1346
1346
|
}
|
|
1347
1347
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-engine.d.ts","sourceRoot":"","sources":["../../src/internal/session-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAEtB,KAAK,cAAc,EAInB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAG1B,KAAK,eAAe,EACpB,KAAK,YAAY,EAIjB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAEjB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,EAGpB,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,kBAAkB,CAAC;AAOpE,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAe9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO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,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCzE;IAED,kEAAkE;IAC5D,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,SAAI,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAG3E;IAEK,oBAAoB,CACxB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,OAAO,CAAC,IAAI,CAAC,CAKf;IAED,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAIxC;IAED,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,CAc9C;IAED,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,gBAAgB;IAwBxB,OAAO,CAAC,mBAAmB;IAc3B,sEAAsE;IACtE,OAAO,CAAC,YAAY;IA6BpB;;;;;;;;;;;OAWG;IACG,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAc3C;YAEa,cAAc;IA4F5B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,4BAA4B;YAqBtB,gCAAgC;IAyB9C;;;;;OAKG;YACW,kBAAkB;IAYhC,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAO/C;IAED,yEAAyE;IACnE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAU3B;CACF"}
|
|
@@ -133,7 +133,7 @@ export class SessionEngine {
|
|
|
133
133
|
this.runner = options.runner;
|
|
134
134
|
this.logger = (_c = options.logger) !== null && _c !== void 0 ? _c : (() => { });
|
|
135
135
|
this.sessions = new SessionStore(join(options.stateRoot, "sessions"));
|
|
136
|
-
this.logs = new EventLogStore((sessionId) => this.sessions.eventFilePath(sessionId), (sessionId, error) => this.logger(`[
|
|
136
|
+
this.logs = new EventLogStore((sessionId) => this.sessions.eventFilePath(sessionId), (sessionId, error) => this.logger(`[agentkit] failed to persist events for ${sessionId}: ${describeError(error)}`));
|
|
137
137
|
this.storage =
|
|
138
138
|
options.project.storage === undefined
|
|
139
139
|
? undefined
|
|
@@ -288,7 +288,7 @@ export class SessionEngine {
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
catch (error) {
|
|
291
|
-
this.logger(`[
|
|
291
|
+
this.logger(`[agentkit] ab "${experiment.name}" enrollment failed (sticky skip): ${describeError(error)}`);
|
|
292
292
|
variant = null;
|
|
293
293
|
}
|
|
294
294
|
abs[experiment.name] = variant;
|
|
@@ -511,7 +511,7 @@ export class SessionEngine {
|
|
|
511
511
|
this.queueDispatch(sessionId, event);
|
|
512
512
|
}
|
|
513
513
|
catch (error) {
|
|
514
|
-
this.logger(`[
|
|
514
|
+
this.logger(`[agentkit] failed to record event for ${sessionId}: ${describeError(error)}`);
|
|
515
515
|
}
|
|
516
516
|
};
|
|
517
517
|
const mapper = new TurnEventMapper(emit);
|
|
@@ -1041,7 +1041,7 @@ export class SessionEngine {
|
|
|
1041
1041
|
const next = chain
|
|
1042
1042
|
.then(() => this.dispatchEvent(sessionId, event))
|
|
1043
1043
|
.catch((error) => {
|
|
1044
|
-
this.logger(`[
|
|
1044
|
+
this.logger(`[agentkit] event dispatch failed for ${sessionId}: ${describeError(error)}`);
|
|
1045
1045
|
})
|
|
1046
1046
|
.then(() => {
|
|
1047
1047
|
var _a;
|
|
@@ -1082,7 +1082,7 @@ export class SessionEngine {
|
|
|
1082
1082
|
yield handler(event, channelCtx, sessionCtx);
|
|
1083
1083
|
}
|
|
1084
1084
|
catch (error) {
|
|
1085
|
-
this.logger(`[
|
|
1085
|
+
this.logger(`[agentkit] channel "${record.channelId}" handler for ${event.type} threw: ${describeError(error)}`);
|
|
1086
1086
|
}
|
|
1087
1087
|
}
|
|
1088
1088
|
// Handlers mutate channel state in place; persist after each batch.
|
|
@@ -1108,7 +1108,7 @@ export class SessionEngine {
|
|
|
1108
1108
|
});
|
|
1109
1109
|
}
|
|
1110
1110
|
catch (error) {
|
|
1111
|
-
this.logger(`[
|
|
1111
|
+
this.logger(`[agentkit] hook "${hook.name}" handler for ${event.type} threw: ${describeError(error)}`);
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
@@ -1222,7 +1222,7 @@ export class SessionEngine {
|
|
|
1222
1222
|
});
|
|
1223
1223
|
}
|
|
1224
1224
|
catch (error) {
|
|
1225
|
-
this.logger(`[
|
|
1225
|
+
this.logger(`[agentkit] ab persistSnapshots.save threw: ${describeError(error)}`);
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
1228
|
else {
|
|
@@ -1388,7 +1388,7 @@ export class SessionEngine {
|
|
|
1388
1388
|
yield this.runBulkRestore(storage, policy);
|
|
1389
1389
|
}
|
|
1390
1390
|
catch (error) {
|
|
1391
|
-
this.logger(`[
|
|
1391
|
+
this.logger(`[agentkit] session restore failed: ${describeError(error)}`);
|
|
1392
1392
|
}
|
|
1393
1393
|
});
|
|
1394
1394
|
}
|
|
@@ -1433,7 +1433,7 @@ export class SessionEngine {
|
|
|
1433
1433
|
return { record, events };
|
|
1434
1434
|
}
|
|
1435
1435
|
catch (error) {
|
|
1436
|
-
this.logger(`[
|
|
1436
|
+
this.logger(`[agentkit] failed to restore session ${record.sessionId}: ${describeError(error)}`);
|
|
1437
1437
|
return undefined;
|
|
1438
1438
|
}
|
|
1439
1439
|
})));
|
|
@@ -1448,7 +1448,7 @@ export class SessionEngine {
|
|
|
1448
1448
|
const bytes = Buffer.byteLength(JSON.stringify(item.record), "utf8") +
|
|
1449
1449
|
(ndjson === undefined ? 0 : Buffer.byteLength(ndjson, "utf8"));
|
|
1450
1450
|
if (bytes > budget) {
|
|
1451
|
-
this.logger(`[
|
|
1451
|
+
this.logger(`[agentkit] session restore stopped at the ${policy.maxTotalBytes}-byte budget after ${restored} session(s); remaining sessions restore lazily on resume`);
|
|
1452
1452
|
break outer;
|
|
1453
1453
|
}
|
|
1454
1454
|
try {
|
|
@@ -1457,12 +1457,12 @@ export class SessionEngine {
|
|
|
1457
1457
|
restored += 1;
|
|
1458
1458
|
}
|
|
1459
1459
|
catch (error) {
|
|
1460
|
-
this.logger(`[
|
|
1460
|
+
this.logger(`[agentkit] failed to restore session ${item.record.sessionId}: ${describeError(error)}`);
|
|
1461
1461
|
}
|
|
1462
1462
|
}
|
|
1463
1463
|
}
|
|
1464
1464
|
if (restored > 0) {
|
|
1465
|
-
this.logger(`[
|
|
1465
|
+
this.logger(`[agentkit] restored ${restored} session(s) from storage`);
|
|
1466
1466
|
}
|
|
1467
1467
|
});
|
|
1468
1468
|
}
|
|
@@ -1503,7 +1503,7 @@ export class SessionEngine {
|
|
|
1503
1503
|
}
|
|
1504
1504
|
const events = yield storage.listSessionEvents(record.sessionId);
|
|
1505
1505
|
yield this.materializeSession(record, eventsNdjson(events));
|
|
1506
|
-
this.logger(`[
|
|
1506
|
+
this.logger(`[agentkit] lazily restored session ${record.sessionId} from storage`);
|
|
1507
1507
|
return record;
|
|
1508
1508
|
});
|
|
1509
1509
|
}
|
|
@@ -16,6 +16,19 @@ export declare function fetchSessionEvents(args: {
|
|
|
16
16
|
auth?: RequestAuth;
|
|
17
17
|
fetchImpl?: typeof fetch;
|
|
18
18
|
}): Promise<SessionEvent[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Pick the previous (most recently updated) followable session for
|
|
21
|
+
* `resume` / `chat --resume` when no session id was passed.
|
|
22
|
+
* Followable = has a non-empty continuation token (task sessions without
|
|
23
|
+
* one are skipped).
|
|
24
|
+
*/
|
|
25
|
+
export declare function pickPreviousSession(sessions: readonly SessionSummary[]): SessionSummary | undefined;
|
|
26
|
+
/** Look up the most recently updated followable session id. */
|
|
27
|
+
export declare function resolvePreviousSessionId(args: {
|
|
28
|
+
baseUrl: string;
|
|
29
|
+
auth?: RequestAuth;
|
|
30
|
+
fetchImpl?: typeof fetch;
|
|
31
|
+
}): Promise<string | undefined>;
|
|
19
32
|
/** Format a sessions table (id, channel, mode, turns, running, updated). */
|
|
20
33
|
export declare function formatSessionsTable(sessions: SessionSummary[]): string;
|
|
21
34
|
//# sourceMappingURL=sessions-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions-client.d.ts","sourceRoot":"","sources":["../../src/internal/sessions-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE7E,wBAAsB,YAAY,CAAC,IAAI,EAAE;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CA8B5B;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAuE1B;AAgCD,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,CActE"}
|
|
1
|
+
{"version":3,"file":"sessions-client.d.ts","sourceRoot":"","sources":["../../src/internal/sessions-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE7E,wBAAsB,YAAY,CAAC,IAAI,EAAE;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CA8B5B;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAuE1B;AAgCD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,cAAc,EAAE,GAClC,cAAc,GAAG,SAAS,CAU5B;AAED,+DAA+D;AAC/D,wBAAsB,wBAAwB,CAAC,IAAI,EAAE;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO9B;AAED,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,CActE"}
|
|
@@ -142,6 +142,31 @@ function parseSessionSummary(value) {
|
|
|
142
142
|
externalUrl: typeof row.externalUrl === "string" ? row.externalUrl : undefined,
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Pick the previous (most recently updated) followable session for
|
|
147
|
+
* `resume` / `chat --resume` when no session id was passed.
|
|
148
|
+
* Followable = has a non-empty continuation token (task sessions without
|
|
149
|
+
* one are skipped).
|
|
150
|
+
*/
|
|
151
|
+
export function pickPreviousSession(sessions) {
|
|
152
|
+
const followable = sessions.filter((s) => typeof s.continuationToken === "string" && s.continuationToken !== "");
|
|
153
|
+
if (followable.length === 0) {
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
return [...followable].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt))[0];
|
|
157
|
+
}
|
|
158
|
+
/** Look up the most recently updated followable session id. */
|
|
159
|
+
export function resolvePreviousSessionId(args) {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
var _a;
|
|
162
|
+
const sessions = yield listSessions({
|
|
163
|
+
baseUrl: args.baseUrl,
|
|
164
|
+
auth: args.auth,
|
|
165
|
+
fetchImpl: args.fetchImpl,
|
|
166
|
+
});
|
|
167
|
+
return (_a = pickPreviousSession(sessions)) === null || _a === void 0 ? void 0 : _a.sessionId;
|
|
168
|
+
});
|
|
169
|
+
}
|
|
145
170
|
/** Format a sessions table (id, channel, mode, turns, running, updated). */
|
|
146
171
|
export function formatSessionsTable(sessions) {
|
|
147
172
|
if (sessions.length === 0) {
|