@cursor/july 0.1.2 → 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/AGENTS.md +16 -5
- package/README.md +8 -9
- package/dist/bin/agent-serve.d.ts +3 -1
- package/dist/bin/agent-serve.d.ts.map +1 -1
- package/dist/bin/agent-serve.js +416 -155
- 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.Oje4vhlk.js → app.DF-Yx4OP.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.0XrheBv2.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.H5XZ2zCB.js → VPLocalSearchBox.DSeJSudL.js} +1 -1
- package/dist/docs/assets/chunks/{theme.CTR_TuaE.js → theme.DZVLTXOC.js} +2 -2
- package/dist/docs/assets/{index.md.m81y7TY7.js → index.md.Cylk70gg.js} +1 -1
- package/dist/docs/assets/{quickstart.md.CfU8_uTC.js → quickstart.md.BU6Iwi_9.js} +18 -6
- package/dist/docs/assets/{reference_cli.md.DA730zCu.js → reference_cli.md.Bv6pOxcF.js} +11 -6
- package/dist/docs/assets/{reference_cli.md.DA730zCu.lean.js → reference_cli.md.Bv6pOxcF.lean.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 +22 -10
- package/dist/docs/reference/agent-config.html +3 -3
- package/dist/docs/reference/channels.html +3 -3
- package/dist/docs/reference/cli.html +14 -9
- 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/chat-client.d.ts +29 -3
- package/dist/internal/chat-client.d.ts.map +1 -1
- package/dist/internal/chat-client.js +180 -27
- package/dist/internal/cli-ax.d.ts +83 -2
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +626 -52
- package/dist/internal/cli-cursor.d.ts.map +1 -1
- package/dist/internal/cli-cursor.js +8 -36
- package/dist/internal/cli-deploy.d.ts +59 -3
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +316 -38
- 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 +14 -3
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +21 -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/deploy-client.d.ts +9 -1
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +23 -3
- package/dist/internal/deploy-source.d.ts +35 -0
- package/dist/internal/deploy-source.d.ts.map +1 -0
- package/dist/internal/deploy-source.js +118 -0
- package/dist/internal/discovery.d.ts +11 -0
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +43 -14
- 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 +10 -9
- package/dist/internal/eval-runner.d.ts +2 -0
- package/dist/internal/eval-runner.d.ts.map +1 -1
- package/dist/internal/eval-runner.js +2 -0
- package/dist/internal/event-mapper.d.ts +54 -1
- package/dist/internal/event-mapper.d.ts.map +1 -1
- package/dist/internal/event-mapper.js +151 -41
- package/dist/internal/github-fanout.js +2 -2
- package/dist/internal/host-platforms.js +5 -5
- package/dist/internal/init-project.d.ts +88 -1
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +221 -31
- package/dist/internal/install-cursor-skills.d.ts +64 -0
- package/dist/internal/install-cursor-skills.d.ts.map +1 -0
- package/dist/internal/install-cursor-skills.js +274 -0
- package/dist/internal/logs-client.d.ts +60 -0
- package/dist/internal/logs-client.d.ts.map +1 -0
- package/dist/internal/logs-client.js +311 -0
- package/dist/internal/mcp-endpoint.d.ts.map +1 -1
- package/dist/internal/mcp-endpoint.js +1 -1
- package/dist/internal/open-browser.d.ts +5 -0
- package/dist/internal/open-browser.d.ts.map +1 -0
- package/dist/internal/open-browser.js +34 -0
- package/dist/internal/playground/toolchain.d.ts.map +1 -1
- package/dist/internal/playground/toolchain.js +19 -14
- package/dist/internal/playground-proxy.d.ts +69 -0
- package/dist/internal/playground-proxy.d.ts.map +1 -0
- package/dist/internal/playground-proxy.js +468 -0
- package/dist/internal/prompt-context.d.ts +35 -0
- package/dist/internal/prompt-context.d.ts.map +1 -0
- package/dist/internal/prompt-context.js +71 -0
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +11 -11
- package/dist/internal/request-headers.d.ts +11 -0
- package/dist/internal/request-headers.d.ts.map +1 -0
- package/dist/internal/request-headers.js +14 -0
- package/dist/internal/resolve-prod-target.d.ts +44 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -0
- package/dist/internal/resolve-prod-target.js +134 -0
- package/dist/internal/resolved-connections.js +5 -5
- package/dist/internal/run-client.d.ts +2 -2
- package/dist/internal/run-client.d.ts.map +1 -1
- package/dist/internal/run-client.js +38 -23
- package/dist/internal/schedule-runner.js +1 -1
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +23 -17
- package/dist/internal/session-engine.d.ts +1 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +34 -19
- package/dist/internal/sessions-client.d.ts +34 -0
- package/dist/internal/sessions-client.d.ts.map +1 -0
- package/dist/internal/sessions-client.js +193 -0
- package/dist/internal/storage-coordinator.js +6 -6
- package/dist/internal/stream-progress.d.ts.map +1 -1
- package/dist/internal/stream-progress.js +31 -3
- package/dist/internal/terminal-style.d.ts +22 -0
- package/dist/internal/terminal-style.d.ts.map +1 -0
- package/dist/internal/terminal-style.js +49 -0
- package/dist/internal/trajectory.d.ts +10 -5
- package/dist/internal/trajectory.d.ts.map +1 -1
- package/dist/internal/trajectory.js +82 -10
- 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/internal/workspace.d.ts +11 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +38 -4
- package/dist/playground/assets/index-Ct_Usdm8.css +1 -0
- package/dist/playground/assets/index-Dsyb-Vaj.js +319 -0
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +29 -2
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +0 -1
- package/docs/quickstart.md +22 -7
- package/docs/reference/cli.md +51 -3
- package/package.json +4 -1
- package/skills/ab/SKILL.md +8 -8
- package/skills/create-agent/SKILL.md +28 -22
- package/skills/debug/SKILL.md +11 -11
- package/skills/evals/SKILL.md +16 -16
- package/skills/framework-map/SKILL.md +6 -6
- package/skills/github/SKILL.md +13 -13
- package/skills/hillclimb/SKILL.md +10 -10
- package/skills/setup-slack/SKILL.md +14 -14
- package/src/bin/agent-serve.ts +451 -191
- 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/chat-client.ts +252 -37
- package/src/internal/cli-ax.ts +761 -72
- package/src/internal/cli-cursor.ts +14 -42
- package/src/internal/cli-deploy.ts +428 -49
- 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 +26 -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/deploy-client.ts +45 -4
- package/src/internal/deploy-source.ts +133 -0
- package/src/internal/discovery.ts +53 -16
- package/src/internal/distribution.ts +8 -0
- package/src/internal/docs-site.ts +3 -3
- package/src/internal/eval-run-store.ts +10 -11
- package/src/internal/eval-runner.ts +5 -0
- package/src/internal/event-mapper.ts +222 -42
- package/src/internal/github-fanout.ts +2 -2
- package/src/internal/host-platforms.ts +5 -5
- package/src/internal/init-project.ts +333 -51
- package/src/internal/install-cursor-skills.ts +327 -0
- package/src/internal/logs-client.ts +442 -0
- package/src/internal/mcp-endpoint.ts +1 -3
- package/src/internal/open-browser.ts +41 -0
- package/src/internal/playground/toolchain.ts +18 -16
- package/src/internal/playground-proxy.ts +576 -0
- package/src/internal/prompt-context.ts +95 -0
- package/src/internal/reminder-runner.ts +11 -17
- package/src/internal/request-headers.ts +23 -0
- package/src/internal/resolve-prod-target.ts +182 -0
- package/src/internal/resolved-connections.ts +5 -5
- package/src/internal/run-client.ts +39 -36
- package/src/internal/schedule-runner.ts +1 -1
- package/src/internal/server.ts +25 -16
- package/src/internal/session-engine.ts +35 -18
- package/src/internal/sessions-client.ts +216 -0
- package/src/internal/storage-coordinator.ts +6 -6
- package/src/internal/stream-progress.ts +36 -2
- package/src/internal/terminal-style.ts +74 -0
- package/src/internal/trajectory.ts +91 -13
- package/src/internal/update-check.ts +552 -0
- package/src/internal/workspace.ts +42 -4
- package/src/types.ts +45 -7
- package/dist/docs/assets/chunks/@localSearchIndexroot.zwQ9RCQ7.js +0 -1
- package/dist/playground/assets/index-B1Qc9h2u.css +0 -1
- package/dist/playground/assets/index-CpDYCj8W.js +0 -79
- /package/dist/docs/assets/{index.md.m81y7TY7.lean.js → index.md.Cylk70gg.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.CfU8_uTC.lean.js → quickstart.md.BU6Iwi_9.lean.js} +0 -0
|
@@ -128,7 +128,7 @@ function cmdGithubForward(options) {
|
|
|
128
128
|
process.stderr.write("could not infer the repository — pass --repo owner/repo (or --org <org>)\n");
|
|
129
129
|
return 1;
|
|
130
130
|
}
|
|
131
|
-
process.stderr.write(`[
|
|
131
|
+
process.stderr.write(`[agentkit] inferred --repo ${repo}\n`);
|
|
132
132
|
}
|
|
133
133
|
const secret = (_c = options.secret) !== null && _c !== void 0 ? _c : process.env.GITHUB_WEBHOOK_SECRET;
|
|
134
134
|
// `gh webhook forward` targets a single URL, and GitHub allows only one
|
|
@@ -146,21 +146,21 @@ function cmdGithubForward(options) {
|
|
|
146
146
|
org,
|
|
147
147
|
secret,
|
|
148
148
|
});
|
|
149
|
-
process.stderr.write(`[
|
|
149
|
+
process.stderr.write(`[agentkit] forwarding ${org !== undefined ? `org ${org}` : `repo ${repo}`} to ${targets.length} channel${targets.length === 1 ? "" : "s"}:\n`);
|
|
150
150
|
for (const target of targets) {
|
|
151
|
-
process.stderr.write(`[
|
|
151
|
+
process.stderr.write(`[agentkit] → ${targetLabel(target)} ${target.url} (${target.events.join(", ")})\n`);
|
|
152
152
|
}
|
|
153
153
|
if (fanout) {
|
|
154
|
-
process.stderr.write(`[
|
|
154
|
+
process.stderr.write(`[agentkit] fan-out proxy on ${forwardUrl} (union events: ${events.join(", ")})\n`);
|
|
155
155
|
}
|
|
156
156
|
if (secret === undefined || secret === "") {
|
|
157
|
-
process.stderr.write("[
|
|
157
|
+
process.stderr.write("[agentkit] no signing secret — deliveries are unsigned. A `serve --dev` github channel accepts them; set GITHUB_WEBHOOK_SECRET on both sides to verify signatures (required for a non-dev target).\n");
|
|
158
158
|
}
|
|
159
159
|
const envToken = detectGitHubEnvTokenOverride();
|
|
160
160
|
if (envToken !== undefined) {
|
|
161
|
-
process.stderr.write(`[
|
|
161
|
+
process.stderr.write(`[agentkit] warning: ${githubEnvTokenHint(envToken)}\n`);
|
|
162
162
|
}
|
|
163
|
-
process.stderr.write(`[
|
|
163
|
+
process.stderr.write(`[agentkit] running: gh ${redact(args)}\n`);
|
|
164
164
|
try {
|
|
165
165
|
return yield spawnGh(args);
|
|
166
166
|
}
|
|
@@ -228,7 +228,7 @@ function cmdGithubReplay(options) {
|
|
|
228
228
|
const requested = parseEventList(options.events);
|
|
229
229
|
const { events: eventsToReplay, unsupported } = selectReplayEvents(requested, unionForwardEvents(targets));
|
|
230
230
|
if (unsupported.length > 0) {
|
|
231
|
-
process.stderr.write(`[
|
|
231
|
+
process.stderr.write(`[agentkit] cannot synthesize (skipped): ${unsupported.join(", ")}\n`);
|
|
232
232
|
}
|
|
233
233
|
if (eventsToReplay.length === 0) {
|
|
234
234
|
process.stderr.write("no synthesizable events selected\n");
|
|
@@ -263,7 +263,7 @@ function cmdGithubReplay(options) {
|
|
|
263
263
|
check,
|
|
264
264
|
});
|
|
265
265
|
if ("error" in result) {
|
|
266
|
-
process.stderr.write(`[
|
|
266
|
+
process.stderr.write(`[agentkit] skipping ${event}: ${result.error}\n`);
|
|
267
267
|
continue;
|
|
268
268
|
}
|
|
269
269
|
synthesized.push(result);
|
|
@@ -273,7 +273,7 @@ function cmdGithubReplay(options) {
|
|
|
273
273
|
return 1;
|
|
274
274
|
}
|
|
275
275
|
const secret = (_j = options.secret) !== null && _j !== void 0 ? _j : process.env.GITHUB_WEBHOOK_SECRET;
|
|
276
|
-
process.stderr.write(`[
|
|
276
|
+
process.stderr.write(`[agentkit] replaying ${ref.label} (${synthesized
|
|
277
277
|
.map((s) => s.eventName)
|
|
278
278
|
.join(", ")}) → ${targets.length} channel${targets.length === 1 ? "" : "s"}\n`);
|
|
279
279
|
const report = [];
|
|
@@ -291,7 +291,7 @@ function cmdGithubReplay(options) {
|
|
|
291
291
|
}
|
|
292
292
|
if (options.out !== undefined) {
|
|
293
293
|
const file = yield writeReplayFixture(options.out, event);
|
|
294
|
-
process.stderr.write(`[
|
|
294
|
+
process.stderr.write(`[agentkit] wrote ${file}\n`);
|
|
295
295
|
}
|
|
296
296
|
const label = eventLabel(event);
|
|
297
297
|
if (options.dryRun === true) {
|
|
@@ -311,7 +311,7 @@ function cmdGithubReplay(options) {
|
|
|
311
311
|
const summary = deliveries
|
|
312
312
|
.map((delivery) => `${delivery.label} ${delivery.status || "ERR"}${delivery.ok ? "" : " (rejected)"}`)
|
|
313
313
|
.join(", ") || "(no matching channel)";
|
|
314
|
-
process.stderr.write(`[
|
|
314
|
+
process.stderr.write(`[agentkit] ${label} → ${summary}\n`);
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
if (options.json === true) {
|
|
@@ -552,7 +552,7 @@ function ensureWebhookExtension(install) {
|
|
|
552
552
|
: `${GITHUB_WEBHOOK_EXTENSION} is ${(_b = parseGhWebhookExtensionVersion(list)) !== null && _b !== void 0 ? _b : "unknown"} (need ${GITHUB_WEBHOOK_EXTENSION_PIN}) — re-run with --install`,
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
process.stderr.write(`[
|
|
555
|
+
process.stderr.write(`[agentkit] installing ${GITHUB_WEBHOOK_EXTENSION}@${GITHUB_WEBHOOK_EXTENSION_PIN}…\n`);
|
|
556
556
|
if ((yield tryExec({
|
|
557
557
|
command: "gh",
|
|
558
558
|
args: ghWebhookExtensionInstallArgs({ force: installed && !pinOk }),
|
|
@@ -141,18 +141,18 @@ export class CursorAccountMcpBridge {
|
|
|
141
141
|
? `${server.tools.length} tools`
|
|
142
142
|
: server.status})`)
|
|
143
143
|
.join(", ");
|
|
144
|
-
this.logger(`[
|
|
144
|
+
this.logger(`[agentkit] Cursor account MCP connection "${ref.name}": ${catalog.servers.length === 0
|
|
145
145
|
? "no matching connectors on this account — connect servers in Cursor (dashboard → MCP) or fix the `servers` filter"
|
|
146
146
|
: summary}`);
|
|
147
147
|
const needsAuth = catalog.servers.filter((server) => server.status === "needsAuth");
|
|
148
148
|
if (needsAuth.length > 0) {
|
|
149
|
-
this.logger(`[
|
|
149
|
+
this.logger(`[agentkit] Cursor account MCP connection "${ref.name}": ${needsAuth
|
|
150
150
|
.map((server) => server.serverIdentifier)
|
|
151
151
|
.join(", ")} need re-authorization in Cursor before their tools appear`);
|
|
152
152
|
}
|
|
153
153
|
})
|
|
154
154
|
.catch((error) => {
|
|
155
|
-
this.logger(`[
|
|
155
|
+
this.logger(`[agentkit] Cursor account MCP connection "${ref.name}" preflight failed: ${describeError(error)}`);
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -332,7 +332,7 @@ export class CursorBackendClient {
|
|
|
332
332
|
value: body.data.accessToken,
|
|
333
333
|
expiresAtMs: jwtExpiryMs(body.data.accessToken),
|
|
334
334
|
};
|
|
335
|
-
this.logger("[
|
|
335
|
+
this.logger("[agentkit] cursor account: minted a fresh access token");
|
|
336
336
|
return body.data.accessToken;
|
|
337
337
|
});
|
|
338
338
|
}
|
|
@@ -16,8 +16,17 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { z } from "zod";
|
|
18
18
|
export declare const DEFAULT_CURSOR_BACKEND_URL = "https://api2.cursor.sh";
|
|
19
|
+
export declare const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
|
|
19
20
|
/** Backend API base URL (`CURSOR_API_BASE_URL` override for local dev). */
|
|
20
21
|
export declare function cursorBackendUrl(): string;
|
|
22
|
+
/**
|
|
23
|
+
* External API base URL for routes served only by the external-api
|
|
24
|
+
* microlith (`/internal/agent-serve/*`, engine aliases). In production
|
|
25
|
+
* these are mounted on api.cursor.com and 404 on api2.cursor.sh, so the
|
|
26
|
+
* deploy surface needs its own default. `CURSOR_API_BASE_URL` still
|
|
27
|
+
* overrides everything for local dev, where one server mounts all routes.
|
|
28
|
+
*/
|
|
29
|
+
export declare function cursorExternalApiUrl(): string;
|
|
21
30
|
/** Website base URL for the login deep link (`CURSOR_WEBSITE_URL` override). */
|
|
22
31
|
export declare function cursorWebsiteUrl(): string;
|
|
23
32
|
declare const storedCredentialsSchema: z.ZodObject<{
|
|
@@ -26,10 +35,12 @@ declare const storedCredentialsSchema: z.ZodObject<{
|
|
|
26
35
|
}, "strip">;
|
|
27
36
|
export type StoredCredentials = z.infer<typeof storedCredentialsSchema>;
|
|
28
37
|
/**
|
|
29
|
-
* `~/.config/agent-serve
|
|
30
|
-
*
|
|
31
|
-
* (tests, containers).
|
|
38
|
+
* `~/.config/agent-serve/` (honoring `XDG_CONFIG_HOME`), the host-level
|
|
39
|
+
* config directory for credentials and the update-check cache.
|
|
40
|
+
* `AGENT_SERVE_CONFIG_DIR` pins the directory outright (tests, containers).
|
|
32
41
|
*/
|
|
42
|
+
export declare function configDirPath(): string;
|
|
43
|
+
/** `<configDir>/credentials.json` (0600). */
|
|
33
44
|
export declare function credentialsFilePath(): string;
|
|
34
45
|
export declare function readStoredCredentials(): Promise<StoredCredentials | undefined>;
|
|
35
46
|
export declare function writeStoredCredentials(credentials: StoredCredentials): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AACnE,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AAGxE,2EAA2E;AAC3E,wBAAgB,gBAAgB,IAAI,MAAM,CAIzC;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAI7C;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,IAAI,MAAM,CAIzC;AAUD,QAAA,MAAM,uBAAuB,EAAE,CAAC,CAAC,SAAS,CACxC;IAAE,UAAU,EAAE,CAAC,CAAC,SAAS,CAAC;IAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAA;CAAE,EAChD,OAAO,CAKP,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAQtC;AAED,6CAA6C;AAC7C,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CACpD,iBAAiB,GAAG,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C;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,eAAe,CAAC,CAmG3B"}
|
|
@@ -30,12 +30,24 @@ import { dirname, join } from "node:path";
|
|
|
30
30
|
import { z } from "zod";
|
|
31
31
|
import { CLI_COMMAND_NAME } from "../distribution.js";
|
|
32
32
|
export const DEFAULT_CURSOR_BACKEND_URL = "https://api2.cursor.sh";
|
|
33
|
+
export const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
|
|
33
34
|
const DEFAULT_CURSOR_WEBSITE_URL = "https://cursor.com";
|
|
34
35
|
/** Backend API base URL (`CURSOR_API_BASE_URL` override for local dev). */
|
|
35
36
|
export function cursorBackendUrl() {
|
|
36
37
|
var _a;
|
|
37
38
|
return trimTrailingSlash((_a = process.env.CURSOR_API_BASE_URL) !== null && _a !== void 0 ? _a : DEFAULT_CURSOR_BACKEND_URL);
|
|
38
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* External API base URL for routes served only by the external-api
|
|
42
|
+
* microlith (`/internal/agent-serve/*`, engine aliases). In production
|
|
43
|
+
* these are mounted on api.cursor.com and 404 on api2.cursor.sh, so the
|
|
44
|
+
* deploy surface needs its own default. `CURSOR_API_BASE_URL` still
|
|
45
|
+
* overrides everything for local dev, where one server mounts all routes.
|
|
46
|
+
*/
|
|
47
|
+
export function cursorExternalApiUrl() {
|
|
48
|
+
var _a;
|
|
49
|
+
return trimTrailingSlash((_a = process.env.CURSOR_API_BASE_URL) !== null && _a !== void 0 ? _a : DEFAULT_CURSOR_EXTERNAL_API_URL);
|
|
50
|
+
}
|
|
39
51
|
/** Website base URL for the login deep link (`CURSOR_WEBSITE_URL` override). */
|
|
40
52
|
export function cursorWebsiteUrl() {
|
|
41
53
|
var _a;
|
|
@@ -53,14 +65,17 @@ const storedCredentialsSchema = z.object({
|
|
|
53
65
|
apiKey: z.string().min(1),
|
|
54
66
|
});
|
|
55
67
|
/**
|
|
56
|
-
* `~/.config/agent-serve
|
|
57
|
-
*
|
|
58
|
-
* (tests, containers).
|
|
68
|
+
* `~/.config/agent-serve/` (honoring `XDG_CONFIG_HOME`), the host-level
|
|
69
|
+
* config directory for credentials and the update-check cache.
|
|
70
|
+
* `AGENT_SERVE_CONFIG_DIR` pins the directory outright (tests, containers).
|
|
59
71
|
*/
|
|
60
|
-
export function
|
|
72
|
+
export function configDirPath() {
|
|
61
73
|
var _a, _b;
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
return ((_a = process.env.AGENT_SERVE_CONFIG_DIR) !== null && _a !== void 0 ? _a : join((_b = process.env.XDG_CONFIG_HOME) !== null && _b !== void 0 ? _b : join(homedir(), ".config"), "agent-serve"));
|
|
75
|
+
}
|
|
76
|
+
/** `<configDir>/credentials.json` (0600). */
|
|
77
|
+
export function credentialsFilePath() {
|
|
78
|
+
return join(configDirPath(), "credentials.json");
|
|
64
79
|
}
|
|
65
80
|
export function readStoredCredentials() {
|
|
66
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -115,13 +115,13 @@ export class CursorGithubCredentialProvider {
|
|
|
115
115
|
this.installGhToken(result.token);
|
|
116
116
|
this.scheduleRefresh();
|
|
117
117
|
}
|
|
118
|
-
this.logger(`[
|
|
118
|
+
this.logger(`[agentkit] GitHub auth: refreshed Cursor account credential for ${this.repos.length} repo(s)`);
|
|
119
119
|
return result.token;
|
|
120
120
|
}
|
|
121
121
|
catch (error) {
|
|
122
122
|
const message = error instanceof Error ? error.message : String(error);
|
|
123
123
|
if (this.cached !== undefined && this.now() < this.cached.expiresAtMs) {
|
|
124
|
-
this.logger(`[
|
|
124
|
+
this.logger(`[agentkit] GitHub auth: Cursor account credential refresh failed; using the current lease: ${message}`);
|
|
125
125
|
this.cached.refreshAtMs = Math.min(this.cached.expiresAtMs, this.now() + REFRESH_RETRY_MS);
|
|
126
126
|
if (this.started) {
|
|
127
127
|
this.scheduleRetry();
|
|
@@ -164,7 +164,7 @@ export class CursorGithubCredentialProvider {
|
|
|
164
164
|
}
|
|
165
165
|
this.refreshTimer = setTimeout(() => {
|
|
166
166
|
void this.getToken().catch((error) => {
|
|
167
|
-
this.logger(`[
|
|
167
|
+
this.logger(`[agentkit] GitHub auth: Cursor account credential refresh failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
168
168
|
this.scheduleRetry();
|
|
169
169
|
});
|
|
170
170
|
}, delayMs);
|
|
@@ -164,7 +164,7 @@ export class CursorEventRelay {
|
|
|
164
164
|
if (!this.subscribedRepos.has(event.repo)) {
|
|
165
165
|
if (!this.loggedSkippedRepos.has(event.repo)) {
|
|
166
166
|
this.loggedSkippedRepos.add(event.repo);
|
|
167
|
-
this.options.logger(`[
|
|
167
|
+
this.options.logger(`[agentkit] cursor-events: skipping events for ${event.repo}: not in this host's subscription (another consumer of this API key likely subscribed it)`);
|
|
168
168
|
}
|
|
169
169
|
return false;
|
|
170
170
|
}
|
|
@@ -26,7 +26,7 @@ export declare function describeRelayError(error: unknown): string;
|
|
|
26
26
|
export interface RelayAdapter<TEvent extends {
|
|
27
27
|
offset: string;
|
|
28
28
|
}> {
|
|
29
|
-
/** Log fragment, e.g. `cursor-events` → `[
|
|
29
|
+
/** Log fragment, e.g. `cursor-events` → `[agentkit] cursor-events: …`. */
|
|
30
30
|
readonly logPrefix: string;
|
|
31
31
|
/** Subscription registration path, e.g. `/v0/scm-events/subscriptions`. */
|
|
32
32
|
readonly subscribePath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-relay-core.d.ts","sourceRoot":"","sources":["../../src/internal/cursor-relay-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"cursor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Arg, _arguments, P, ge
|
|
|
19
19
|
import { randomUUID } from "node:crypto";
|
|
20
20
|
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
21
21
|
import { join } from "node:path";
|
|
22
|
+
import { LOG_PREFIX } from "./distribution.js";
|
|
22
23
|
const OFFSET_SNAPSHOT_VERSION = 1;
|
|
23
24
|
const DEFAULT_POLL_WAIT_MS = 25000;
|
|
24
25
|
const DEFAULT_POLL_LIMIT = 100;
|
|
@@ -182,7 +183,7 @@ export class CursorRelayCore {
|
|
|
182
183
|
});
|
|
183
184
|
}
|
|
184
185
|
log(line) {
|
|
185
|
-
this.options.logger(
|
|
186
|
+
this.options.logger(`${LOG_PREFIX} ${this.options.adapter.logPrefix}: ${line}`);
|
|
186
187
|
}
|
|
187
188
|
request(method, path, body) {
|
|
188
189
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -68,7 +68,7 @@ export function createCursorSlackApiCaller(args) {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
catch (error) {
|
|
71
|
-
(_a = args.logger) === null || _a === void 0 ? void 0 : _a.call(args, `[
|
|
71
|
+
(_a = args.logger) === null || _a === void 0 ? void 0 : _a.call(args, `[agentkit] cursor-slack: ${method} proxy call failed: ${describeRelayError(error)}`);
|
|
72
72
|
return { ok: false, error: "cursor_backend_unreachable" };
|
|
73
73
|
}
|
|
74
74
|
});
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* when it is off — the error mapping says so instead of "not found".
|
|
11
11
|
*/
|
|
12
12
|
export type DeploymentStatus = "pending" | "deploying" | "running" | "degraded" | "failed" | "stopping" | "stopped";
|
|
13
|
+
/** Customer-safe deploy progress (no hosting phase / infra names). */
|
|
14
|
+
export type DeploymentProgress = "queued" | "preparing" | "building" | "finalizing" | "running" | "failed" | "stopping" | "stopped" | "degraded";
|
|
13
15
|
export declare const TERMINAL_DEPLOY_STATUSES: ReadonlySet<DeploymentStatus>;
|
|
14
16
|
/**
|
|
15
17
|
* What gets deployed. Today the control plane builds the engine itself from
|
|
@@ -66,6 +68,11 @@ export interface Deployment {
|
|
|
66
68
|
agentPath?: string;
|
|
67
69
|
desiredState?: string;
|
|
68
70
|
status: DeploymentStatus;
|
|
71
|
+
/**
|
|
72
|
+
* Customer-safe deploy progress (no hosting internals). Present on newer
|
|
73
|
+
* backends; older responses omit it.
|
|
74
|
+
*/
|
|
75
|
+
progress?: DeploymentProgress;
|
|
69
76
|
generation: number;
|
|
70
77
|
observedGeneration?: number | null;
|
|
71
78
|
engineGeneration?: number | null;
|
|
@@ -79,7 +86,8 @@ export interface Deployment {
|
|
|
79
86
|
cursorEventRepos?: string[];
|
|
80
87
|
/** Normalized egress allowlist for the engine pod. */
|
|
81
88
|
egressAllowedDomains?: string[];
|
|
82
|
-
|
|
89
|
+
/** Service-account id (`sa_…`); null on legacy rows. */
|
|
90
|
+
serviceAccountId?: string | number | null;
|
|
83
91
|
/** Masked pod credential; the raw key is never returned. */
|
|
84
92
|
podCredentialMaskedKey?: string | null;
|
|
85
93
|
/** Names of the secrets set on the deployment (values never returned). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-client.d.ts","sourceRoot":"","sources":["../../src/internal/deploy-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,WAAW,GACX,SAAS,GACT,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,CAAC;AAEd,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,gBAAgB,CAKjE,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,EAAE,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AAE,CAAC,CAOxB;IAED,yDAAyD;IACnD,YAAY,CAAC,IAAI,EAAE;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhB;IAED;;;;OAIG;IACG,mBAAmB,CAAC,IAAI,EAAE;QAC9B,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,MAAM,CAAC,CAOlB;IAED,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpC;YAEa,OAAO;CAyCtB"}
|
|
@@ -88,6 +88,19 @@ const deploymentSchema = z.object({
|
|
|
88
88
|
"stopping",
|
|
89
89
|
"stopped",
|
|
90
90
|
]),
|
|
91
|
+
progress: z
|
|
92
|
+
.enum([
|
|
93
|
+
"queued",
|
|
94
|
+
"preparing",
|
|
95
|
+
"building",
|
|
96
|
+
"finalizing",
|
|
97
|
+
"running",
|
|
98
|
+
"failed",
|
|
99
|
+
"stopping",
|
|
100
|
+
"stopped",
|
|
101
|
+
"degraded",
|
|
102
|
+
])
|
|
103
|
+
.optional(),
|
|
91
104
|
generation: z.number(),
|
|
92
105
|
observedGeneration: z.number().nullable().optional(),
|
|
93
106
|
engineGeneration: z.number().nullable().optional(),
|
|
@@ -99,8 +112,9 @@ const deploymentSchema = z.object({
|
|
|
99
112
|
lastReconciledAt: z.string().nullable().optional(),
|
|
100
113
|
cursorEventRepos: z.array(z.string()).optional(),
|
|
101
114
|
egressAllowedDomains: z.array(z.string()).optional(),
|
|
102
|
-
//
|
|
103
|
-
|
|
115
|
+
// String ids (`sa_…`) in prod; older mocks/fixtures used numbers. Null on
|
|
116
|
+
// legacy rows that predate service-account-backed deploys.
|
|
117
|
+
serviceAccountId: z.union([z.string(), z.number()]).nullable().optional(),
|
|
104
118
|
podCredentialMaskedKey: z.string().nullable().optional(),
|
|
105
119
|
secretNames: z.array(z.string()).optional(),
|
|
106
120
|
});
|
|
@@ -354,10 +368,16 @@ function mapErrorResponse(response, bodyText, context) {
|
|
|
354
368
|
return new DeployApiError("The Cursor API key was rejected. Run `agentkit login` again or update CURSOR_API_KEY.", 401);
|
|
355
369
|
case 403:
|
|
356
370
|
return new DeployApiError(`${serverError !== null && serverError !== void 0 ? serverError : "Not authorized"} — deploying needs team-admin permission and the cloud-agent entitlement on that team.`, 403);
|
|
357
|
-
case 404:
|
|
371
|
+
case 404: {
|
|
372
|
+
// Fastify's route-not-found envelope means we hit the wrong host
|
|
373
|
+
// (api2 vs api.cursor.com), not a missing deployment / closed gate.
|
|
374
|
+
if (/Route \S+ not found/i.test(bodyText)) {
|
|
375
|
+
return new DeployApiError(`Agent Serve deploy API not found on this host — use the default api.cursor.com (unset CURSOR_API_BASE_URL), or point CURSOR_API_BASE_URL at a backend that mounts /internal/agent-serve/*.`, 404);
|
|
376
|
+
}
|
|
358
377
|
return new DeployApiError(context.slug === undefined
|
|
359
378
|
? `Not found — the agent_serve_mvp feature gate may not be enabled for your team.`
|
|
360
379
|
: `Deployment${slugPart} was not found — check the slug and --team, or the agent_serve_mvp feature gate may not be enabled for your team.`, 404);
|
|
380
|
+
}
|
|
361
381
|
case 409:
|
|
362
382
|
return new DeployApiError(`A concurrent deploy or stop is changing deployment${slugPart}; retry in a moment.`, 409);
|
|
363
383
|
case 429: {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infer `agentkit deploy` git source fields from a local checkout.
|
|
3
|
+
*
|
|
4
|
+
* From an agent directory inside a git repo with an `origin` remote, the
|
|
5
|
+
* CLI can fill `--repo` / `--ref` / `--path` so `agentkit deploy` (no
|
|
6
|
+
* flags) is enough. Explicit flags always win.
|
|
7
|
+
*/
|
|
8
|
+
/** Injectable git runner (cwd + args → stdout, or undefined on failure). */
|
|
9
|
+
export type GitRunner = (args: readonly string[], cwd: string) => Promise<string | undefined>;
|
|
10
|
+
export interface InferredDeploySource {
|
|
11
|
+
gitRepoUrl?: string;
|
|
12
|
+
gitRef?: string;
|
|
13
|
+
/** Agent directory relative to the repo root (posix). Omitted at root. */
|
|
14
|
+
agentPath?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Normalize a git remote URL to the https form the control plane accepts
|
|
18
|
+
* (`https://host/owner/repo`, no `.git` suffix). Returns undefined for
|
|
19
|
+
* unrecognized shapes.
|
|
20
|
+
*/
|
|
21
|
+
export declare function httpsGitRepoUrlFromRemote(remote: string): string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Path of `dir` relative to `gitRoot`, using `/` separators. Undefined when
|
|
24
|
+
* `dir` is outside the root; omitted (undefined) when `dir` *is* the root
|
|
25
|
+
* so the control plane treats the agent as living at the repo root.
|
|
26
|
+
*/
|
|
27
|
+
export declare function agentPathRelativeToGitRoot(dir: string, gitRoot: string): string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Probe the git checkout containing `dir` for deploy source fields.
|
|
30
|
+
* Missing pieces stay undefined (static deploy / server defaults).
|
|
31
|
+
*/
|
|
32
|
+
export declare function inferDeployGitSource(dir: string, options?: {
|
|
33
|
+
git?: GitRunner;
|
|
34
|
+
}): Promise<InferredDeploySource>;
|
|
35
|
+
//# sourceMappingURL=deploy-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-source.d.ts","sourceRoot":"","sources":["../../src/internal/deploy-source.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,4EAA4E;AAC5E,MAAM,MAAM,SAAS,GAAG,CACtB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,KACR,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAEjC,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAYD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA6B5E;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAYpB;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,SAAS,CAAA;CAAE,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CA8B/B"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infer `agentkit deploy` git source fields from a local checkout.
|
|
3
|
+
*
|
|
4
|
+
* From an agent directory inside a git repo with an `origin` remote, the
|
|
5
|
+
* CLI can fill `--repo` / `--ref` / `--path` so `agentkit deploy` (no
|
|
6
|
+
* flags) is enough. Explicit flags always win.
|
|
7
|
+
*/
|
|
8
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
import { execFile } from "node:child_process";
|
|
18
|
+
import { relative, resolve, sep } from "node:path";
|
|
19
|
+
import { promisify } from "node:util";
|
|
20
|
+
const execFileAsync = promisify(execFile);
|
|
21
|
+
const defaultGitRunner = (args, cwd) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
try {
|
|
23
|
+
const { stdout } = yield execFileAsync("git", [...args], { cwd });
|
|
24
|
+
const trimmed = stdout.trim();
|
|
25
|
+
return trimmed === "" ? undefined : trimmed;
|
|
26
|
+
}
|
|
27
|
+
catch (_a) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Normalize a git remote URL to the https form the control plane accepts
|
|
33
|
+
* (`https://host/owner/repo`, no `.git` suffix). Returns undefined for
|
|
34
|
+
* unrecognized shapes.
|
|
35
|
+
*/
|
|
36
|
+
export function httpsGitRepoUrlFromRemote(remote) {
|
|
37
|
+
let url = remote.trim();
|
|
38
|
+
if (url === "") {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
if (url.startsWith("git@")) {
|
|
42
|
+
// git@host:owner/repo.git → https://host/owner/repo.git
|
|
43
|
+
url = `https://${url.slice("git@".length).replace(":", "/")}`;
|
|
44
|
+
}
|
|
45
|
+
else if (url.startsWith("ssh://git@")) {
|
|
46
|
+
url = `https://${url.slice("ssh://git@".length)}`;
|
|
47
|
+
}
|
|
48
|
+
else if (!/^https?:\/\//i.test(url)) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
let parsed;
|
|
52
|
+
try {
|
|
53
|
+
parsed = new URL(url);
|
|
54
|
+
}
|
|
55
|
+
catch (_a) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
const path = parsed.pathname
|
|
59
|
+
.replace(/\.git$/i, "")
|
|
60
|
+
.replace(/\/+$/, "")
|
|
61
|
+
.replace(/^\/+/, "");
|
|
62
|
+
if (path === "" || !path.includes("/")) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
// Use hostname (not host) so ssh://git@github.com:22/… does not keep :22.
|
|
66
|
+
return `https://${parsed.hostname}/${path}`;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Path of `dir` relative to `gitRoot`, using `/` separators. Undefined when
|
|
70
|
+
* `dir` is outside the root; omitted (undefined) when `dir` *is* the root
|
|
71
|
+
* so the control plane treats the agent as living at the repo root.
|
|
72
|
+
*/
|
|
73
|
+
export function agentPathRelativeToGitRoot(dir, gitRoot) {
|
|
74
|
+
const absDir = resolve(dir);
|
|
75
|
+
const absRoot = resolve(gitRoot);
|
|
76
|
+
const rel = relative(absRoot, absDir);
|
|
77
|
+
if (rel === "") {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
// Outside the repo (or a Windows drive mismatch) → cannot infer.
|
|
81
|
+
if (rel.startsWith("..") || rel.split(sep).includes("..")) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
return rel.split(sep).join("/");
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Probe the git checkout containing `dir` for deploy source fields.
|
|
88
|
+
* Missing pieces stay undefined (static deploy / server defaults).
|
|
89
|
+
*/
|
|
90
|
+
export function inferDeployGitSource(dir, options) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
var _a;
|
|
93
|
+
const git = (_a = options === null || options === void 0 ? void 0 : options.git) !== null && _a !== void 0 ? _a : defaultGitRunner;
|
|
94
|
+
const absDir = resolve(dir);
|
|
95
|
+
const gitRoot = yield git(["rev-parse", "--show-toplevel"], absDir);
|
|
96
|
+
if (gitRoot === undefined) {
|
|
97
|
+
return {};
|
|
98
|
+
}
|
|
99
|
+
const remote = yield git(["remote", "get-url", "origin"], gitRoot);
|
|
100
|
+
const gitRepoUrl = remote === undefined ? undefined : httpsGitRepoUrlFromRemote(remote);
|
|
101
|
+
const branch = yield git(["rev-parse", "--abbrev-ref", "HEAD"], gitRoot);
|
|
102
|
+
let gitRef;
|
|
103
|
+
if (branch !== undefined && branch !== "HEAD") {
|
|
104
|
+
gitRef = branch;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
// Detached HEAD — pin the exact commit so the control plane still
|
|
108
|
+
// has something concrete to build.
|
|
109
|
+
gitRef = yield git(["rev-parse", "HEAD"], gitRoot);
|
|
110
|
+
}
|
|
111
|
+
const agentPath = agentPathRelativeToGitRoot(absDir, gitRoot);
|
|
112
|
+
return {
|
|
113
|
+
gitRepoUrl,
|
|
114
|
+
gitRef,
|
|
115
|
+
agentPath,
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
}
|
|
@@ -16,6 +16,17 @@ export interface LoadAgentProjectOptions {
|
|
|
16
16
|
* inside it.
|
|
17
17
|
*/
|
|
18
18
|
export declare function isAgentProjectDir(dir: string): Promise<boolean>;
|
|
19
|
+
/** One immediate child agent directory under a multi-agent parent. */
|
|
20
|
+
export interface ChildAgentDir {
|
|
21
|
+
slug: string;
|
|
22
|
+
dir: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* List agent projects directly under `rootDir` (one level deep) without
|
|
26
|
+
* loading them. Empty when the path is missing or has no child agents.
|
|
27
|
+
* Slug rules match {@link loadAgentProjects} / multi-agent serve.
|
|
28
|
+
*/
|
|
29
|
+
export declare function listChildAgentDirs(rootDir: string): Promise<ChildAgentDir[]>;
|
|
19
30
|
/**
|
|
20
31
|
* Discover the agent projects directly under `rootDir` (one level deep):
|
|
21
32
|
* each immediate child directory that is itself an agent project becomes a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/internal/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAKrB,KAAK,UAAU,EAmBhB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/internal/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAKrB,KAAK,UAAU,EAmBhB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