@cursor/july 0.1.8 → 0.1.9
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.js +0 -0
- package/dist/channels/slack/post-update-delivery.d.ts +85 -0
- package/dist/channels/slack/post-update-delivery.d.ts.map +1 -0
- package/dist/channels/slack/post-update-delivery.js +318 -0
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +3 -3
- package/dist/docs/assets/{app.BP8mAVMW.js → app.Ciosf24M.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.D154Detj.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.1FXIZbz8.js → VPLocalSearchBox.BcRDly7n.js} +1 -1
- package/dist/docs/assets/chunks/{theme.Dm1R02v9.js → theme.CMpbjdfx.js} +2 -2
- package/dist/docs/assets/{deployment.md.BtfEsc9S.js → deployment.md.DC5-ImcM.js} +1 -1
- package/dist/docs/assets/{example-agents_approval-buddy.md.8R5phXb5.js → example-agents_approval-buddy.md.DFGBYLcc.js} +2 -2
- package/dist/docs/assets/{example-agents_approval-buddy.md.8R5phXb5.lean.js → example-agents_approval-buddy.md.DFGBYLcc.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_index.md.CwtWu5ix.js → example-agents_index.md.BPXjUtRB.js} +2 -2
- package/dist/docs/assets/{example-agents_index.md.CwtWu5ix.lean.js → example-agents_index.md.BPXjUtRB.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_security-reviewer.md.D2rtwDTO.js → example-agents_security-reviewer.md.CE9v-aKm.js} +2 -2
- package/dist/docs/assets/{example-agents_security-reviewer.md.D2rtwDTO.lean.js → example-agents_security-reviewer.md.CE9v-aKm.lean.js} +1 -1
- package/dist/docs/assets/{storage.md.Cu3MwM2a.js → storage.md.DRTdnFvd.js} +7 -1
- package/dist/docs/assets/{storage.md.Cu3MwM2a.lean.js → storage.md.DRTdnFvd.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 +5 -5
- package/dist/docs/evals.html +3 -3
- package/dist/docs/example-agents/approval-buddy.html +5 -5
- package/dist/docs/example-agents/benny.html +3 -3
- package/dist/docs/example-agents/bugbot.html +3 -3
- package/dist/docs/example-agents/codebase-wiki.html +3 -3
- package/dist/docs/example-agents/codeowners-review.html +3 -3
- package/dist/docs/example-agents/concierge.html +3 -3
- package/dist/docs/example-agents/fsd.html +3 -3
- package/dist/docs/example-agents/index.html +5 -5
- package/dist/docs/example-agents/knowledge-base.html +3 -3
- package/dist/docs/example-agents/oncall.html +3 -3
- package/dist/docs/example-agents/security-reviewer.html +6 -6
- package/dist/docs/example-agents/slack-agent.html +3 -3
- package/dist/docs/example-agents/weather-agent.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 +3 -3
- 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 +11 -5
- package/dist/docs/troubleshooting.html +3 -3
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +45 -18
- package/dist/internal/deploy-client.d.ts +7 -1
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +3 -0
- package/dist/internal/deploy-source.d.ts +3 -0
- package/dist/internal/deploy-source.d.ts.map +1 -1
- package/dist/internal/deploy-source.js +25 -7
- package/dist/internal/discovery.js +1 -1
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +1 -0
- package/dist/internal/hosting.d.ts +12 -2
- package/dist/internal/hosting.d.ts.map +1 -1
- package/dist/internal/hosting.js +21 -4
- package/dist/internal/json-dir-store.d.ts +32 -0
- package/dist/internal/json-dir-store.d.ts.map +1 -0
- package/dist/internal/json-dir-store.js +100 -0
- package/dist/internal/logs-client.d.ts +16 -2
- package/dist/internal/logs-client.d.ts.map +1 -1
- package/dist/internal/logs-client.js +51 -16
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +29 -15
- package/dist/internal/workspace.d.ts +19 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +47 -13
- package/dist/playground/assets/index-C0-QEG4O.js +86 -0
- package/dist/playground/assets/index-z3JY9O2x.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +65 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted.js +203 -0
- package/dist/storage-backends/postgres-kv.d.ts +5 -0
- package/dist/storage-backends/postgres-kv.d.ts.map +1 -1
- package/dist/storage-backends/postgres-kv.js +5 -0
- package/docs/.vitepress/cache/deps/package.json +3 -0
- package/docs/deployment.md +7 -3
- package/docs/example-agents/approval-buddy.md +1 -1
- package/docs/example-agents/index.md +1 -1
- package/docs/example-agents/security-reviewer.md +5 -5
- package/docs/storage.md +18 -4
- package/package.json +8 -1
- package/src/internal/cli-deploy.ts +58 -20
- package/src/internal/deploy-client.ts +11 -0
- package/src/internal/deploy-source.ts +24 -6
- package/src/internal/discovery.ts +1 -1
- package/src/internal/distribution.ts +1 -0
- package/src/internal/hosting.ts +24 -4
- package/src/internal/logs-client.ts +67 -21
- package/src/internal/session-engine.ts +28 -11
- package/src/internal/workspace.ts +48 -11
- package/src/storage-backends/cursor-hosted.ts +246 -0
- package/src/storage-backends/postgres-kv.ts +5 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.DevOabKJ.js +0 -1
- package/dist/playground/assets/index-7GJIUFQj.css +0 -1
- package/dist/playground/assets/index-Bpr4Th4M.js +0 -319
- /package/dist/docs/assets/{deployment.md.BtfEsc9S.lean.js → deployment.md.DC5-ImcM.lean.js} +0 -0
|
@@ -24,7 +24,8 @@ import { AgentServeDeployClient, DeployApiError, slugFromDirectoryName, TERMINAL
|
|
|
24
24
|
import { inferDeployGitSource } from "./deploy-source.js";
|
|
25
25
|
import { isAgentProjectDir, listChildAgentDirs, loadAgentProject, } from "./discovery.js";
|
|
26
26
|
import { CLI_COMMAND_NAME as CLI } from "./distribution.js";
|
|
27
|
-
import { isValidCursorEventRepo, validateSettableSecretName, } from "./hosting.js";
|
|
27
|
+
import { isReservedSecretName, isValidCursorEventRepo, validateSettableSecretName, } from "./hosting.js";
|
|
28
|
+
import { deployProgressLabel, sanitizeCustomerError } from "./logs-client.js";
|
|
28
29
|
import { stderrPalette } from "./terminal-style.js";
|
|
29
30
|
const DEFAULT_POLL_INTERVAL_MS = 3000;
|
|
30
31
|
const DEFAULT_DEPLOY_TIMEOUT_MS = 10 * 60 * 1000;
|
|
@@ -368,6 +369,20 @@ function deployOne(ctx, options, target, extras) {
|
|
|
368
369
|
ctx.err(`Invalid --repo: ${gitRepoUrl} (expected an https:// git repository URL)\n`);
|
|
369
370
|
return 1;
|
|
370
371
|
}
|
|
372
|
+
// Repo-backed fields without a resolvable https origin become a static
|
|
373
|
+
// deploy body the control plane rejects. Fail here with a fix hint —
|
|
374
|
+
// common when origin is an unrecognized SSH shape (pass --repo).
|
|
375
|
+
if (gitRepoUrl === undefined &&
|
|
376
|
+
(gitRef !== undefined ||
|
|
377
|
+
agentPath !== undefined ||
|
|
378
|
+
(options.cursorEventsRepos !== undefined &&
|
|
379
|
+
options.cursorEventsRepos.length > 0) ||
|
|
380
|
+
(options.allowDomains !== undefined && options.allowDomains.length > 0))) {
|
|
381
|
+
ctx.err(`Could not resolve an https:// git repository URL for this deploy.\n` +
|
|
382
|
+
` Pass --repo https://github.com/<owner>/<repo> (inferred from origin when possible).\n` +
|
|
383
|
+
` Or omit --ref/--path/--cursor-events-repo/--allow-domain for a static engine.\n`);
|
|
384
|
+
return 1;
|
|
385
|
+
}
|
|
371
386
|
for (const repo of (_d = options.cursorEventsRepos) !== null && _d !== void 0 ? _d : []) {
|
|
372
387
|
if (!isValidCursorEventRepo(repo)) {
|
|
373
388
|
ctx.err(`Invalid --cursor-events-repo: ${repo} (expected owner/name)\n`);
|
|
@@ -453,9 +468,10 @@ function deployOne(ctx, options, target, extras) {
|
|
|
453
468
|
return detail.status === "running" ? 0 : 1;
|
|
454
469
|
}
|
|
455
470
|
if (detail.status !== "running") {
|
|
456
|
-
|
|
471
|
+
const errorDetail = detail.lastError === null || detail.lastError === undefined
|
|
457
472
|
? ""
|
|
458
|
-
: `: ${detail.lastError}
|
|
473
|
+
: `: ${sanitizeCustomerError(detail.lastError)}`;
|
|
474
|
+
ctx.err(`Deployment ${slug} ended ${detail.status}${errorDetail}\n`);
|
|
459
475
|
return 1;
|
|
460
476
|
}
|
|
461
477
|
ctx.out(`Deployed ${slug} (team ${ctx.teamId})\n` +
|
|
@@ -491,7 +507,9 @@ function warnMissingSecrets(ctx, slug, declared, set) {
|
|
|
491
507
|
return;
|
|
492
508
|
}
|
|
493
509
|
const setNames = new Set(set !== null && set !== void 0 ? set : []);
|
|
494
|
-
|
|
510
|
+
// Platform-managed names (CURSOR_*, hosted storage) are injected by the
|
|
511
|
+
// control plane and never appear in secrets list — do not warn on them.
|
|
512
|
+
const missing = declared.filter((name) => !setNames.has(name) && !isReservedSecretName(name));
|
|
495
513
|
if (missing.length === 0) {
|
|
496
514
|
return;
|
|
497
515
|
}
|
|
@@ -561,11 +579,16 @@ export function cmdDeploymentStatus(slug, options) {
|
|
|
561
579
|
const lines = [
|
|
562
580
|
`${detail.slug} (team ${detail.teamId})`,
|
|
563
581
|
` status: ${detail.status}`,
|
|
564
|
-
` generation: ${detail.generation}`,
|
|
565
|
-
` kind: ${detail.deploymentKind}`,
|
|
566
|
-
` alias: ${aliasUrl}`,
|
|
567
|
-
` playground: ${aliasUrl}/playground`,
|
|
568
582
|
];
|
|
583
|
+
if (detail.progress !== undefined) {
|
|
584
|
+
lines.push(` progress: ${detail.progress}`);
|
|
585
|
+
}
|
|
586
|
+
if (detail.statusMessage !== null &&
|
|
587
|
+
detail.statusMessage !== undefined &&
|
|
588
|
+
detail.statusMessage.trim() !== "") {
|
|
589
|
+
lines.push(` step: ${detail.statusMessage}`);
|
|
590
|
+
}
|
|
591
|
+
lines.push(` generation: ${detail.generation}`, ` kind: ${detail.deploymentKind}`, ` alias: ${aliasUrl}`, ` playground: ${aliasUrl}/playground`);
|
|
569
592
|
if (detail.gitRepoUrl !== null && detail.gitRepoUrl !== undefined) {
|
|
570
593
|
lines.push(` repo: ${detail.gitRepoUrl} @ ${(_b = detail.gitRef) !== null && _b !== void 0 ? _b : ""}`);
|
|
571
594
|
}
|
|
@@ -593,7 +616,7 @@ export function cmdDeploymentStatus(slug, options) {
|
|
|
593
616
|
lines.push(` engine access: ${detail.engineAccess.url} (expires ${detail.engineAccess.expiresAt})`);
|
|
594
617
|
}
|
|
595
618
|
if (detail.lastError !== null && detail.lastError !== undefined) {
|
|
596
|
-
lines.push(` last error: ${detail.lastError}`);
|
|
619
|
+
lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
|
|
597
620
|
}
|
|
598
621
|
if (detail.desiredUpdatedAt !== undefined) {
|
|
599
622
|
lines.push(` updated: ${detail.desiredUpdatedAt}`);
|
|
@@ -935,27 +958,30 @@ function createLineReader(stream) {
|
|
|
935
958
|
/**
|
|
936
959
|
* Poll deployment status every `pollIntervalMs` until it lands in
|
|
937
960
|
* `terminal` (single-line progress on a TTY, one line per transition
|
|
938
|
-
* otherwise).
|
|
961
|
+
* otherwise). Prefers customer `statusMessage` / `progress` over raw
|
|
962
|
+
* status so create → checkout → start is visible. Throws DeployApiError
|
|
963
|
+
* on request failures or timeout.
|
|
939
964
|
*/
|
|
940
965
|
function pollUntil(ctx, slug, terminal) {
|
|
941
966
|
return __awaiter(this, void 0, void 0, function* () {
|
|
942
967
|
const startedAt = Date.now();
|
|
943
968
|
const tty = process.stderr.isTTY === true;
|
|
944
|
-
let
|
|
969
|
+
let lastLabel;
|
|
945
970
|
let sawProgress = false;
|
|
946
|
-
const report = (
|
|
971
|
+
const report = (detail) => {
|
|
947
972
|
if (ctx.json) {
|
|
948
973
|
return;
|
|
949
974
|
}
|
|
975
|
+
const label = deployProgressLabel(detail);
|
|
950
976
|
const elapsed = Math.round((Date.now() - startedAt) / 1000);
|
|
951
977
|
if (tty) {
|
|
952
|
-
ctx.err(`\r\x1b[2K${slug}: ${
|
|
978
|
+
ctx.err(`\r\x1b[2K${slug}: ${label} (${elapsed}s)`);
|
|
953
979
|
sawProgress = true;
|
|
954
980
|
}
|
|
955
|
-
else if (
|
|
956
|
-
ctx.err(`${slug}: ${
|
|
981
|
+
else if (label !== lastLabel) {
|
|
982
|
+
ctx.err(`${slug}: ${label}\n`);
|
|
957
983
|
}
|
|
958
|
-
|
|
984
|
+
lastLabel = label;
|
|
959
985
|
};
|
|
960
986
|
const finishProgressLine = () => {
|
|
961
987
|
if (tty && sawProgress) {
|
|
@@ -969,14 +995,15 @@ function pollUntil(ctx, slug, terminal) {
|
|
|
969
995
|
finishProgressLine();
|
|
970
996
|
throw error;
|
|
971
997
|
});
|
|
972
|
-
report(detail
|
|
998
|
+
report(detail);
|
|
973
999
|
if (terminal.has(detail.status)) {
|
|
974
1000
|
finishProgressLine();
|
|
975
1001
|
return detail;
|
|
976
1002
|
}
|
|
977
1003
|
if (Date.now() - startedAt >= ctx.timeoutMs) {
|
|
978
1004
|
finishProgressLine();
|
|
979
|
-
|
|
1005
|
+
const last = deployProgressLabel(detail);
|
|
1006
|
+
throw new DeployApiError(`Timed out after ${Math.round(ctx.timeoutMs / 1000)}s waiting for ${slug} (last: ${last}). It may still converge — check \`${CLI} deployment ${slug} --team ${ctx.teamId}\`.`, 0);
|
|
980
1007
|
}
|
|
981
1008
|
yield sleep(ctx.pollIntervalMs);
|
|
982
1009
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export type DeploymentStatus = "pending" | "deploying" | "running" | "degraded" | "failed" | "stopping" | "stopped";
|
|
13
13
|
/** Customer-safe deploy progress (no hosting phase / infra names). */
|
|
14
|
-
export type DeploymentProgress = "queued" | "preparing" | "building" | "finalizing" | "running" | "failed" | "stopping" | "stopped" | "degraded";
|
|
14
|
+
export type DeploymentProgress = "queued" | "preparing" | "creating" | "building" | "starting" | "finalizing" | "running" | "failed" | "stopping" | "stopped" | "degraded";
|
|
15
15
|
export declare const TERMINAL_DEPLOY_STATUSES: ReadonlySet<DeploymentStatus>;
|
|
16
16
|
/**
|
|
17
17
|
* What gets deployed. Today the control plane builds the engine itself from
|
|
@@ -73,6 +73,12 @@ export interface Deployment {
|
|
|
73
73
|
* backends; older responses omit it.
|
|
74
74
|
*/
|
|
75
75
|
progress?: DeploymentProgress;
|
|
76
|
+
/**
|
|
77
|
+
* Live step while the deploy converges (e.g. "Checking out source…").
|
|
78
|
+
* Null when running / stopped or when only a failure is on the row.
|
|
79
|
+
* Present on newer backends; older responses omit it.
|
|
80
|
+
*/
|
|
81
|
+
statusMessage?: string | null;
|
|
76
82
|
generation: number;
|
|
77
83
|
observedGeneration?: number | null;
|
|
78
84
|
engineGeneration?: number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,+EAA+E;AAC/E,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;
|
|
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,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,WAAW,GACX,UAAU,GACV,UAAU,GACV,UAAU,GACV,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf,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,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jD,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA0BpB;IAED,gEAAgE;IAC1D,WAAW,CAAC,IAAI,EAAE;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,UAAU,EAAE,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"}
|
|
@@ -92,7 +92,9 @@ const deploymentSchema = z.object({
|
|
|
92
92
|
.enum([
|
|
93
93
|
"queued",
|
|
94
94
|
"preparing",
|
|
95
|
+
"creating",
|
|
95
96
|
"building",
|
|
97
|
+
"starting",
|
|
96
98
|
"finalizing",
|
|
97
99
|
"running",
|
|
98
100
|
"failed",
|
|
@@ -101,6 +103,7 @@ const deploymentSchema = z.object({
|
|
|
101
103
|
"degraded",
|
|
102
104
|
])
|
|
103
105
|
.optional(),
|
|
106
|
+
statusMessage: z.string().nullable().optional(),
|
|
104
107
|
generation: z.number(),
|
|
105
108
|
observedGeneration: z.number().nullable().optional(),
|
|
106
109
|
engineGeneration: z.number().nullable().optional(),
|
|
@@ -17,6 +17,9 @@ export interface InferredDeploySource {
|
|
|
17
17
|
* Normalize a git remote URL to the https form the control plane accepts
|
|
18
18
|
* (`https://host/owner/repo`, no `.git` suffix). Returns undefined for
|
|
19
19
|
* unrecognized shapes.
|
|
20
|
+
*
|
|
21
|
+
* Accepts HTTPS, `git@host:path`, GitHub org-scoped SSH
|
|
22
|
+
* (`org-123@github.com:owner/repo.git`), and `ssh://user@host[:port]/path`.
|
|
20
23
|
*/
|
|
21
24
|
export declare function httpsGitRepoUrlFromRemote(remote: string): string | undefined;
|
|
22
25
|
/**
|
|
@@ -1 +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
|
|
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;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA4C5E;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"}
|
|
@@ -32,18 +32,36 @@ const defaultGitRunner = (args, cwd) => __awaiter(void 0, void 0, void 0, functi
|
|
|
32
32
|
* Normalize a git remote URL to the https form the control plane accepts
|
|
33
33
|
* (`https://host/owner/repo`, no `.git` suffix). Returns undefined for
|
|
34
34
|
* unrecognized shapes.
|
|
35
|
+
*
|
|
36
|
+
* Accepts HTTPS, `git@host:path`, GitHub org-scoped SSH
|
|
37
|
+
* (`org-123@github.com:owner/repo.git`), and `ssh://user@host[:port]/path`.
|
|
35
38
|
*/
|
|
36
39
|
export function httpsGitRepoUrlFromRemote(remote) {
|
|
37
40
|
let url = remote.trim();
|
|
38
41
|
if (url === "") {
|
|
39
42
|
return undefined;
|
|
40
43
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
// SCP-like SSH: user@host:owner/repo(.git) — includes git@ and GitHub
|
|
45
|
+
// org deploy keys (org-NNNN@github.com:…).
|
|
46
|
+
const scpMatch = /^([^@/\s]+)@([^:/\s]+):(.+)$/.exec(url);
|
|
47
|
+
if (scpMatch !== null) {
|
|
48
|
+
const host = scpMatch[2];
|
|
49
|
+
const path = scpMatch[3];
|
|
50
|
+
url = `https://${host}/${path}`;
|
|
44
51
|
}
|
|
45
|
-
else if (
|
|
46
|
-
|
|
52
|
+
else if (/^ssh:\/\//i.test(url)) {
|
|
53
|
+
// ssh://user@host[:port]/owner/repo → https://host/owner/repo
|
|
54
|
+
try {
|
|
55
|
+
const ssh = new URL(url);
|
|
56
|
+
const path = ssh.pathname.replace(/^\/+/, "");
|
|
57
|
+
if (ssh.hostname === "" || path === "") {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
url = `https://${ssh.hostname}/${path}`;
|
|
61
|
+
}
|
|
62
|
+
catch (_a) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
47
65
|
}
|
|
48
66
|
else if (!/^https?:\/\//i.test(url)) {
|
|
49
67
|
return undefined;
|
|
@@ -52,7 +70,7 @@ export function httpsGitRepoUrlFromRemote(remote) {
|
|
|
52
70
|
try {
|
|
53
71
|
parsed = new URL(url);
|
|
54
72
|
}
|
|
55
|
-
catch (
|
|
73
|
+
catch (_b) {
|
|
56
74
|
return undefined;
|
|
57
75
|
}
|
|
58
76
|
const path = parsed.pathname
|
|
@@ -62,7 +80,7 @@ export function httpsGitRepoUrlFromRemote(remote) {
|
|
|
62
80
|
if (path === "" || !path.includes("/")) {
|
|
63
81
|
return undefined;
|
|
64
82
|
}
|
|
65
|
-
// Use hostname (not host) so ssh
|
|
83
|
+
// Use hostname (not host) so ssh://…@github.com:22/… does not keep :22.
|
|
66
84
|
return `https://${parsed.hostname}/${path}`;
|
|
67
85
|
}
|
|
68
86
|
/**
|
|
@@ -341,7 +341,7 @@ function resolveHosting(ctx, agentDir, hosting) {
|
|
|
341
341
|
warn(`hosting.secretNames: ${nameError}`);
|
|
342
342
|
}
|
|
343
343
|
else if (isReservedSecretName(name)) {
|
|
344
|
-
warn(`hosting.secretNames: ${JSON.stringify(name)} is platform-
|
|
344
|
+
warn(`hosting.secretNames: ${JSON.stringify(name)} is platform-managed (CURSOR_* / Cursor-hosted storage) and injected automatically; omit it from secretNames.`);
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
return Object.assign(Object.assign({}, (hosting.egressDomains === undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../src/internal/distribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,qEAAqE;AACrE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,2BAA2B,CAAC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,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAkBzC,CAAC"}
|
|
@@ -16,6 +16,13 @@ export declare const MAX_SECRET_VALUE_BYTES = 4096;
|
|
|
16
16
|
export declare const MAX_SECRET_NAME_LENGTH = 64;
|
|
17
17
|
/** Secret names the platform injects; user writes are rejected. */
|
|
18
18
|
export declare const RESERVED_SECRET_NAME_PREFIX = "CURSOR_";
|
|
19
|
+
/**
|
|
20
|
+
* Additional platform-managed env names for Cursor-hosted durable storage
|
|
21
|
+
* (Bugbot `agent_serve_*`). Mirrored from
|
|
22
|
+
* `@cursor/july/storage/cursor-hosted` so validate/secrets CLI stay in sync
|
|
23
|
+
* without importing the storage backend into the CLI graph.
|
|
24
|
+
*/
|
|
25
|
+
export declare const PLATFORM_HOSTED_STORAGE_SECRET_NAMES: readonly ["BUGBOTDB_URL", "AGENT_SERVE_DEPLOYMENT_ID"];
|
|
19
26
|
/** Returns a human error message, or undefined when the domain is valid. */
|
|
20
27
|
export declare function validateEgressDomain(domain: string): string | undefined;
|
|
21
28
|
/**
|
|
@@ -25,11 +32,14 @@ export declare function validateEgressDomain(domain: string): string | undefined
|
|
|
25
32
|
* diagnostic than the hard write-time rejection.
|
|
26
33
|
*/
|
|
27
34
|
export declare function validateSecretName(name: string): string | undefined;
|
|
28
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* True when the platform manages this name (`CURSOR_*` or hosted-storage
|
|
37
|
+
* env vars); user writes / deletes are rejected.
|
|
38
|
+
*/
|
|
29
39
|
export declare function isReservedSecretName(name: string): boolean;
|
|
30
40
|
/**
|
|
31
41
|
* Human error for a secret name a user is trying to write or delete:
|
|
32
|
-
* grammar plus
|
|
42
|
+
* grammar plus platform-managed names (`CURSOR_*`, hosted storage).
|
|
33
43
|
*/
|
|
34
44
|
export declare function validateSettableSecretName(name: string): string | undefined;
|
|
35
45
|
/** `owner/name` — mirrors the backend's cursor-event repo grammar. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosting.d.ts","sourceRoot":"","sources":["../../src/internal/hosting.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wEAAwE;AACxE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,kCAAkC;AAClC,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,sCAAsC;AACtC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,8BAA8B;AAC9B,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,mEAAmE;AACnE,eAAO,MAAM,2BAA2B,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"hosting.d.ts","sourceRoot":"","sources":["../../src/internal/hosting.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wEAAwE;AACxE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,kCAAkC;AAClC,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,sCAAsC;AACtC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,8BAA8B;AAC9B,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,mEAAmE;AACnE,eAAO,MAAM,2BAA2B,YAAY,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,YAC/C,cAAc,EACd,2BAA2B,CACnB,CAAC;AASX,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKvE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQnE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQ1D;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAS3E;AAID,sEAAsE;AACtE,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5D"}
|
package/dist/internal/hosting.js
CHANGED
|
@@ -16,6 +16,16 @@ export const MAX_SECRET_VALUE_BYTES = 4096;
|
|
|
16
16
|
export const MAX_SECRET_NAME_LENGTH = 64;
|
|
17
17
|
/** Secret names the platform injects; user writes are rejected. */
|
|
18
18
|
export const RESERVED_SECRET_NAME_PREFIX = "CURSOR_";
|
|
19
|
+
/**
|
|
20
|
+
* Additional platform-managed env names for Cursor-hosted durable storage
|
|
21
|
+
* (Bugbot `agent_serve_*`). Mirrored from
|
|
22
|
+
* `@cursor/july/storage/cursor-hosted` so validate/secrets CLI stay in sync
|
|
23
|
+
* without importing the storage backend into the CLI graph.
|
|
24
|
+
*/
|
|
25
|
+
export const PLATFORM_HOSTED_STORAGE_SECRET_NAMES = [
|
|
26
|
+
"BUGBOTDB_URL",
|
|
27
|
+
"AGENT_SERVE_DEPLOYMENT_ID",
|
|
28
|
+
];
|
|
19
29
|
const SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]*$/;
|
|
20
30
|
// Lowercase hostname with >=2 labels, an alphabetic TLD, and at most one
|
|
21
31
|
// leading `*.` wildcard. Labels: alphanumeric with interior hyphens.
|
|
@@ -42,13 +52,20 @@ export function validateSecretName(name) {
|
|
|
42
52
|
}
|
|
43
53
|
return undefined;
|
|
44
54
|
}
|
|
45
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* True when the platform manages this name (`CURSOR_*` or hosted-storage
|
|
57
|
+
* env vars); user writes / deletes are rejected.
|
|
58
|
+
*/
|
|
46
59
|
export function isReservedSecretName(name) {
|
|
47
|
-
|
|
60
|
+
if (name.startsWith(RESERVED_SECRET_NAME_PREFIX)) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
const upper = name.toUpperCase();
|
|
64
|
+
return PLATFORM_HOSTED_STORAGE_SECRET_NAMES.some((managed) => managed === upper);
|
|
48
65
|
}
|
|
49
66
|
/**
|
|
50
67
|
* Human error for a secret name a user is trying to write or delete:
|
|
51
|
-
* grammar plus
|
|
68
|
+
* grammar plus platform-managed names (`CURSOR_*`, hosted storage).
|
|
52
69
|
*/
|
|
53
70
|
export function validateSettableSecretName(name) {
|
|
54
71
|
const nameError = validateSecretName(name);
|
|
@@ -56,7 +73,7 @@ export function validateSettableSecretName(name) {
|
|
|
56
73
|
return nameError;
|
|
57
74
|
}
|
|
58
75
|
if (isReservedSecretName(name)) {
|
|
59
|
-
return `Secret name ${JSON.stringify(name)} is platform-
|
|
76
|
+
return `Secret name ${JSON.stringify(name)} is platform-managed; the platform injects CURSOR_* and Cursor-hosted storage values automatically.`;
|
|
60
77
|
}
|
|
61
78
|
return undefined;
|
|
62
79
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small filesystem helpers for one-JSON-file-per-id persistence under a
|
|
3
|
+
* project-relative directory (eval run snapshots, A/B aggregate snapshots).
|
|
4
|
+
*/
|
|
5
|
+
export declare function assertNonEmptyDir(dir: string, fnName: string): string;
|
|
6
|
+
/** Resolve `dir` against `projectRoot` when relative. */
|
|
7
|
+
export declare function resolveProjectRelativeDir(args: {
|
|
8
|
+
dir: string;
|
|
9
|
+
projectRoot: string;
|
|
10
|
+
}): string;
|
|
11
|
+
/** List `*.json` basenames in `root` (any order). Missing dir → []. */
|
|
12
|
+
export declare function listJsonBasenames(root: string): Promise<string[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Read and JSON.parse every `*.json` file under `root`. Missing dir → [].
|
|
15
|
+
* Unreadable or corrupt files are skipped so one bad snapshot cannot wipe
|
|
16
|
+
* the rest of the history.
|
|
17
|
+
*/
|
|
18
|
+
export declare function readJsonDir<T>(root: string, options?: {
|
|
19
|
+
sortBasenames?: "asc" | "desc";
|
|
20
|
+
}): Promise<T[]>;
|
|
21
|
+
/** Atomically write JSON under `root`/`fileName` (temp file + rename). */
|
|
22
|
+
export declare function writeJsonFile(args: {
|
|
23
|
+
root: string;
|
|
24
|
+
fileName: string;
|
|
25
|
+
value: unknown;
|
|
26
|
+
}): Promise<void>;
|
|
27
|
+
/** Best-effort delete; ignores missing files. */
|
|
28
|
+
export declare function deleteFileInDir(args: {
|
|
29
|
+
root: string;
|
|
30
|
+
fileName: string;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
//# sourceMappingURL=json-dir-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-dir-store.d.ts","sourceRoot":"","sources":["../../src/internal/json-dir-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAKrE;AAED,yDAAyD;AACzD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,CAET;AAWD,uEAAuE;AACvE,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAWvE;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,GAC3C,OAAO,CAAC,CAAC,EAAE,CAAC,CAiBd;AAED,0EAA0E;AAC1E,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhB;AAED,iDAAiD;AACjD,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhB"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small filesystem helpers for one-JSON-file-per-id persistence under a
|
|
3
|
+
* project-relative directory (eval run snapshots, A/B aggregate snapshots).
|
|
4
|
+
*/
|
|
5
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
import { randomBytes } from "node:crypto";
|
|
15
|
+
import { mkdir, readdir, readFile, rename, rm, writeFile, } from "node:fs/promises";
|
|
16
|
+
import { isAbsolute, join } from "node:path";
|
|
17
|
+
export function assertNonEmptyDir(dir, fnName) {
|
|
18
|
+
if (typeof dir !== "string" || dir.trim() === "") {
|
|
19
|
+
throw new Error(`${fnName}: dir must be a non-empty string`);
|
|
20
|
+
}
|
|
21
|
+
return dir;
|
|
22
|
+
}
|
|
23
|
+
/** Resolve `dir` against `projectRoot` when relative. */
|
|
24
|
+
export function resolveProjectRelativeDir(args) {
|
|
25
|
+
return isAbsolute(args.dir) ? args.dir : join(args.projectRoot, args.dir);
|
|
26
|
+
}
|
|
27
|
+
function isEnoent(error) {
|
|
28
|
+
return (error !== null &&
|
|
29
|
+
typeof error === "object" &&
|
|
30
|
+
"code" in error &&
|
|
31
|
+
error.code === "ENOENT");
|
|
32
|
+
}
|
|
33
|
+
/** List `*.json` basenames in `root` (any order). Missing dir → []. */
|
|
34
|
+
export function listJsonBasenames(root) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
let names;
|
|
37
|
+
try {
|
|
38
|
+
names = yield readdir(root);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (isEnoent(error)) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
return names.filter((name) => name.endsWith(".json"));
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Read and JSON.parse every `*.json` file under `root`. Missing dir → [].
|
|
51
|
+
* Unreadable or corrupt files are skipped so one bad snapshot cannot wipe
|
|
52
|
+
* the rest of the history.
|
|
53
|
+
*/
|
|
54
|
+
export function readJsonDir(root, options) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
let names = yield listJsonBasenames(root);
|
|
57
|
+
if ((options === null || options === void 0 ? void 0 : options.sortBasenames) === "asc") {
|
|
58
|
+
names = [...names].sort();
|
|
59
|
+
}
|
|
60
|
+
else if ((options === null || options === void 0 ? void 0 : options.sortBasenames) === "desc") {
|
|
61
|
+
names = [...names].sort().reverse();
|
|
62
|
+
}
|
|
63
|
+
const out = [];
|
|
64
|
+
for (const name of names) {
|
|
65
|
+
try {
|
|
66
|
+
const raw = yield readFile(join(root, name), "utf8");
|
|
67
|
+
out.push(JSON.parse(raw));
|
|
68
|
+
}
|
|
69
|
+
catch (_a) {
|
|
70
|
+
// skip corrupt / unreadable files
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return out;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** Atomically write JSON under `root`/`fileName` (temp file + rename). */
|
|
77
|
+
export function writeJsonFile(args) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const { root, fileName, value } = args;
|
|
80
|
+
// Serialize before any await so callers get a stable snapshot even if they
|
|
81
|
+
// mutate `value` afterward.
|
|
82
|
+
const body = `${JSON.stringify(value, null, 2)}\n`;
|
|
83
|
+
yield mkdir(root, { recursive: true });
|
|
84
|
+
const finalPath = join(root, fileName);
|
|
85
|
+
const tmpPath = `${finalPath}.${randomBytes(4).toString("hex")}.tmp`;
|
|
86
|
+
yield writeFile(tmpPath, body, "utf8");
|
|
87
|
+
yield rename(tmpPath, finalPath);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/** Best-effort delete; ignores missing files. */
|
|
91
|
+
export function deleteFileInDir(args) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
try {
|
|
94
|
+
yield rm(join(args.root, args.fileName), { force: true });
|
|
95
|
+
}
|
|
96
|
+
catch (_a) {
|
|
97
|
+
// ignore
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
@@ -14,10 +14,24 @@ export interface LogsResponse {
|
|
|
14
14
|
entries: LogRingEntry[];
|
|
15
15
|
nextAfter: number;
|
|
16
16
|
}
|
|
17
|
-
export type LogsProgress = DeploymentProgress | "queued" | "preparing" | "building" | "finalizing" | "running" | "failed" | "stopping" | "stopped" | "degraded";
|
|
18
|
-
|
|
17
|
+
export type LogsProgress = DeploymentProgress | "queued" | "preparing" | "creating" | "building" | "starting" | "finalizing" | "running" | "failed" | "stopping" | "stopped" | "degraded";
|
|
18
|
+
/**
|
|
19
|
+
* Customer-facing line for the current deploy step. Prefer the live
|
|
20
|
+
* `statusMessage` from the API when present; otherwise the progress
|
|
21
|
+
* vocabulary. Failed/degraded always append sanitized `lastError`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function progressMessage(progress: LogsProgress, lastError?: string | null, statusMessage?: string | null): string;
|
|
19
24
|
/** Strip obvious hosting internals from error text shown to customers. */
|
|
20
25
|
export declare function sanitizeCustomerError(message: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* One-line label for `agentkit deploy` polling (TTY spinner / non-TTY
|
|
28
|
+
* transitions). Uses statusMessage → progress → raw status.
|
|
29
|
+
*/
|
|
30
|
+
export declare function deployProgressLabel(detail: {
|
|
31
|
+
status: string;
|
|
32
|
+
progress?: DeploymentProgress;
|
|
33
|
+
statusMessage?: string | null;
|
|
34
|
+
}): string;
|
|
21
35
|
export declare function fetchLogs(args: {
|
|
22
36
|
baseUrl: string;
|
|
23
37
|
after?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs-client.d.ts","sourceRoot":"","sources":["../../src/internal/logs-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAW7E,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GACpB,kBAAkB,GAClB,QAAQ,GACR,WAAW,GACX,UAAU,GACV,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"logs-client.d.ts","sourceRoot":"","sources":["../../src/internal/logs-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAW7E,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED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