@percher/core 0.2.6 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-files-manifest.d.ts +28 -0
- package/dist/ai-files-manifest.d.ts.map +1 -0
- package/dist/ai-files-manifest.js +96 -0
- package/dist/ai-files-manifest.js.map +1 -0
- package/dist/commands/account.d.ts +51 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +88 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/ai-files.d.ts +73 -0
- package/dist/commands/ai-files.d.ts.map +1 -0
- package/dist/commands/ai-files.js +179 -0
- package/dist/commands/ai-files.js.map +1 -0
- package/dist/commands/billing.d.ts +1 -1
- package/dist/commands/billing.d.ts.map +1 -1
- package/dist/commands/billing.js +1 -1
- package/dist/commands/billing.js.map +1 -1
- package/dist/commands/continue.d.ts +48 -0
- package/dist/commands/continue.d.ts.map +1 -0
- package/dist/commands/continue.js +121 -0
- package/dist/commands/continue.js.map +1 -0
- package/dist/commands/create.d.ts +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +1 -1
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dashboard.d.ts +15 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +33 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/data-export.d.ts +21 -0
- package/dist/commands/data-export.d.ts.map +1 -0
- package/dist/commands/data-export.js +36 -0
- package/dist/commands/data-export.js.map +1 -0
- package/dist/commands/data.d.ts +3 -3
- package/dist/commands/data.d.ts.map +1 -1
- package/dist/commands/data.js +1 -1
- package/dist/commands/data.js.map +1 -1
- package/dist/commands/delete.d.ts +1 -1
- package/dist/commands/delete.d.ts.map +1 -1
- package/dist/commands/delete.js +1 -1
- package/dist/commands/delete.js.map +1 -1
- package/dist/commands/deploys.d.ts +2 -2
- package/dist/commands/deploys.d.ts.map +1 -1
- package/dist/commands/deploys.js +21 -5
- package/dist/commands/deploys.js.map +1 -1
- package/dist/commands/dev.d.ts +1 -9
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +79 -24
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/diagnose.d.ts +1 -1
- package/dist/commands/diagnose.d.ts.map +1 -1
- package/dist/commands/diagnose.js +1 -1
- package/dist/commands/diagnose.js.map +1 -1
- package/dist/commands/doctor.d.ts +75 -3
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +822 -10
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/domains.d.ts +1 -1
- package/dist/commands/domains.d.ts.map +1 -1
- package/dist/commands/domains.js +1 -1
- package/dist/commands/domains.js.map +1 -1
- package/dist/commands/env-scan.d.ts +2 -0
- package/dist/commands/env-scan.d.ts.map +1 -0
- package/dist/commands/env-scan.js +92 -0
- package/dist/commands/env-scan.js.map +1 -0
- package/dist/commands/env.d.ts +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +1 -1
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/export.d.ts +1 -1
- package/dist/commands/export.js +1 -1
- package/dist/commands/generate.d.ts +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +14 -9
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/github.d.ts +60 -0
- package/dist/commands/github.d.ts.map +1 -0
- package/dist/commands/github.js +112 -0
- package/dist/commands/github.js.map +1 -0
- package/dist/commands/import-project.d.ts +1 -1
- package/dist/commands/import-project.d.ts.map +1 -1
- package/dist/commands/import-project.js +1 -1
- package/dist/commands/import-project.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/insights.d.ts +1 -1
- package/dist/commands/insights.d.ts.map +1 -1
- package/dist/commands/insights.js +1 -1
- package/dist/commands/insights.js.map +1 -1
- package/dist/commands/login.d.ts +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +1 -1
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logs.d.ts +1 -1
- package/dist/commands/logs.d.ts.map +1 -1
- package/dist/commands/logs.js +1 -1
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/mcp.d.ts +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +1 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/open.d.ts +1 -1
- package/dist/commands/open.d.ts.map +1 -1
- package/dist/commands/open.js +1 -1
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/publish-failure.d.ts +31 -0
- package/dist/commands/publish-failure.d.ts.map +1 -0
- package/dist/commands/publish-failure.js +150 -0
- package/dist/commands/publish-failure.js.map +1 -0
- package/dist/commands/publish-node.d.ts +16 -0
- package/dist/commands/publish-node.d.ts.map +1 -0
- package/dist/commands/publish-node.js +42 -0
- package/dist/commands/publish-node.js.map +1 -0
- package/dist/commands/publish.d.ts +105 -3
- package/dist/commands/publish.d.ts.map +1 -1
- package/dist/commands/publish.js +746 -158
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/push.d.ts +45 -8
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +233 -22
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/redeploy.d.ts +28 -0
- package/dist/commands/redeploy.d.ts.map +1 -0
- package/dist/commands/redeploy.js +421 -0
- package/dist/commands/redeploy.js.map +1 -0
- package/dist/commands/rename.d.ts +1 -1
- package/dist/commands/rename.d.ts.map +1 -1
- package/dist/commands/rename.js +1 -1
- package/dist/commands/rename.js.map +1 -1
- package/dist/commands/reproduce.d.ts +64 -0
- package/dist/commands/reproduce.d.ts.map +1 -0
- package/dist/commands/reproduce.js +211 -0
- package/dist/commands/reproduce.js.map +1 -0
- package/dist/commands/reset-superuser.d.ts +1 -1
- package/dist/commands/reset-superuser.d.ts.map +1 -1
- package/dist/commands/reset-superuser.js +1 -1
- package/dist/commands/reset-superuser.js.map +1 -1
- package/dist/commands/restore.d.ts +79 -0
- package/dist/commands/restore.d.ts.map +1 -0
- package/dist/commands/restore.js +164 -0
- package/dist/commands/restore.js.map +1 -0
- package/dist/commands/resume.d.ts +1 -1
- package/dist/commands/resume.d.ts.map +1 -1
- package/dist/commands/resume.js +1 -1
- package/dist/commands/resume.js.map +1 -1
- package/dist/commands/rollback.d.ts +21 -8
- package/dist/commands/rollback.d.ts.map +1 -1
- package/dist/commands/rollback.js +12 -6
- package/dist/commands/rollback.js.map +1 -1
- package/dist/commands/status.d.ts +33 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +48 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/unsuspend.d.ts +35 -0
- package/dist/commands/unsuspend.d.ts.map +1 -0
- package/dist/commands/unsuspend.js +27 -0
- package/dist/commands/unsuspend.js.map +1 -0
- package/dist/commands/versions.d.ts +1 -1
- package/dist/commands/versions.d.ts.map +1 -1
- package/dist/commands/versions.js +1 -1
- package/dist/commands/versions.js.map +1 -1
- package/dist/commands/wait-deploy.d.ts +92 -0
- package/dist/commands/wait-deploy.d.ts.map +1 -0
- package/dist/commands/wait-deploy.js +226 -0
- package/dist/commands/wait-deploy.js.map +1 -0
- package/dist/env-scan-source.d.ts +39 -0
- package/dist/env-scan-source.d.ts.map +1 -0
- package/dist/env-scan-source.js +332 -0
- package/dist/env-scan-source.js.map +1 -0
- package/dist/error-classifier.d.ts.map +1 -1
- package/dist/error-classifier.js +67 -4
- package/dist/error-classifier.js.map +1 -1
- package/dist/errors.d.ts +8 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +2 -0
- package/dist/errors.js.map +1 -1
- package/dist/event-renderer.d.ts +17 -0
- package/dist/event-renderer.d.ts.map +1 -0
- package/dist/event-renderer.js +130 -0
- package/dist/event-renderer.js.map +1 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/plans.d.ts +20 -0
- package/dist/plans.d.ts.map +1 -1
- package/dist/plans.js +15 -0
- package/dist/plans.js.map +1 -1
- package/dist/poll-deployment.d.ts +59 -0
- package/dist/poll-deployment.d.ts.map +1 -0
- package/dist/poll-deployment.js +93 -0
- package/dist/poll-deployment.js.map +1 -0
- package/dist/publish-retry.d.ts +29 -0
- package/dist/publish-retry.d.ts.map +1 -0
- package/dist/publish-retry.js +224 -0
- package/dist/publish-retry.js.map +1 -0
- package/dist/recovery.d.ts +356 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +300 -0
- package/dist/recovery.js.map +1 -0
- package/dist/stream-utils.d.ts +21 -0
- package/dist/stream-utils.d.ts.map +1 -0
- package/dist/stream-utils.js +41 -0
- package/dist/stream-utils.js.map +1 -0
- package/dist/structured-error-codes.d.ts +30 -0
- package/dist/structured-error-codes.d.ts.map +1 -0
- package/dist/structured-error-codes.js +86 -0
- package/dist/structured-error-codes.js.map +1 -0
- package/dist/tarball.d.ts +11 -0
- package/dist/tarball.d.ts.map +1 -1
- package/dist/tarball.js +30 -9
- package/dist/tarball.js.map +1 -1
- package/dist/templates/ai-files/claude-md.d.ts +7 -0
- package/dist/templates/ai-files/claude-md.d.ts.map +1 -0
- package/dist/templates/ai-files/claude-md.js +78 -0
- package/dist/templates/ai-files/claude-md.js.map +1 -0
- package/dist/templates/ai-files/cursor-percher-mdc.d.ts +7 -0
- package/dist/templates/ai-files/cursor-percher-mdc.d.ts.map +1 -0
- package/dist/templates/ai-files/cursor-percher-mdc.js +111 -0
- package/dist/templates/ai-files/cursor-percher-mdc.js.map +1 -0
- package/dist/templates/ai-files/index.d.ts +8 -0
- package/dist/templates/ai-files/index.d.ts.map +1 -0
- package/dist/templates/ai-files/index.js +4 -0
- package/dist/templates/ai-files/index.js.map +1 -0
- package/package.json +6 -5
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a DeployEvent row into a single line of CLI/MCP progress
|
|
3
|
+
* output. Returns `null` for rows that are intentionally hidden (e.g.
|
|
4
|
+
* `done/ok`, where the caller prints the final "live at <url>" line
|
|
5
|
+
* with full URL context the events table doesn't carry).
|
|
6
|
+
*
|
|
7
|
+
* The mapping is deliberately conservative: every line is short,
|
|
8
|
+
* past-tense for terminal `ok` rows, present-continuous for
|
|
9
|
+
* `started` rows. Sub-stage durations are appended in parens when
|
|
10
|
+
* available so the user sees real timings (`Image built (8.1s)`)
|
|
11
|
+
* instead of guessing whether the build is making progress.
|
|
12
|
+
*
|
|
13
|
+
* Phase 6.1 of the publish-resilience plan.
|
|
14
|
+
*/
|
|
15
|
+
export function renderDeployEvent(event) {
|
|
16
|
+
if (event.stage === "queue") {
|
|
17
|
+
// Phase 7.6 follow-up — only emitted when builds are ahead of this
|
|
18
|
+
// deploy (pending + slot-saturated). The API sends the raw count
|
|
19
|
+
// (e.g. `"2 builds"`); the renderer wraps with the verb-phrase so
|
|
20
|
+
// CLI/dashboard read `Queued behind 2 builds — your turn shortly`.
|
|
21
|
+
// Codex P3 follow-up: the prior wording double-printed "ahead"
|
|
22
|
+
// because the API used to send `"2 builds ahead"`.
|
|
23
|
+
if (event.status === "started") {
|
|
24
|
+
return `Queued behind ${event.message ?? "other builds"} — your turn shortly`;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
if (event.stage === "build")
|
|
29
|
+
return renderBuildEvent(event);
|
|
30
|
+
if (event.stage === "start") {
|
|
31
|
+
if (event.status === "started")
|
|
32
|
+
return "Starting container";
|
|
33
|
+
if (event.status === "ok")
|
|
34
|
+
return "Container started";
|
|
35
|
+
if (event.status === "failed")
|
|
36
|
+
return "Container failed to start";
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
if (event.stage === "health") {
|
|
40
|
+
if (event.status === "started")
|
|
41
|
+
return "Checking health";
|
|
42
|
+
if (event.status === "ok")
|
|
43
|
+
return "Health check passed";
|
|
44
|
+
if (event.status === "failed")
|
|
45
|
+
return "Health check failed";
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
if (event.stage === "swap") {
|
|
49
|
+
if (event.status === "ok")
|
|
50
|
+
return "Traffic swapped to new version";
|
|
51
|
+
if (event.status === "failed")
|
|
52
|
+
return "Traffic swap failed";
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
if (event.stage === "canary") {
|
|
56
|
+
if (event.status === "started")
|
|
57
|
+
return "Canary monitor running";
|
|
58
|
+
if (event.status === "ok")
|
|
59
|
+
return "Canary monitor passed";
|
|
60
|
+
if (event.status === "failed")
|
|
61
|
+
return "Canary failed — rolling back";
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (event.stage === "rollback") {
|
|
65
|
+
if (event.status === "ok")
|
|
66
|
+
return "Rolled back to previous version";
|
|
67
|
+
if (event.status === "failed")
|
|
68
|
+
return "Rollback failed";
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
// `done` rows are owned by the caller, which has the live URL.
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
function renderBuildEvent(event) {
|
|
75
|
+
if (event.subStage === "cache_hit" && event.status === "ok") {
|
|
76
|
+
return "Build cache hit (reused image)";
|
|
77
|
+
}
|
|
78
|
+
if (event.subStage === "deps_install" && event.status === "ok") {
|
|
79
|
+
return withDuration("Dependencies installed", event.durationMs);
|
|
80
|
+
}
|
|
81
|
+
if (event.subStage === "build_command" && event.status === "ok") {
|
|
82
|
+
return withDuration("Build command finished", event.durationMs);
|
|
83
|
+
}
|
|
84
|
+
if (event.subStage === "image_finalize" && event.status === "ok") {
|
|
85
|
+
return withDuration("Image built", event.durationMs);
|
|
86
|
+
}
|
|
87
|
+
if (event.subStage === "docker_layers" && event.status === "ok") {
|
|
88
|
+
return withDuration("Docker layers built", event.durationMs);
|
|
89
|
+
}
|
|
90
|
+
if (event.subStage !== null) {
|
|
91
|
+
// Non-`ok` sub-stage events: show the started / failed state for
|
|
92
|
+
// visibility but skip the duration (it's only meaningful on the
|
|
93
|
+
// terminal row).
|
|
94
|
+
if (event.status === "started")
|
|
95
|
+
return `${labelForSubStage(event.subStage)}…`;
|
|
96
|
+
if (event.status === "failed")
|
|
97
|
+
return `${labelForSubStage(event.subStage)} failed`;
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
// Coarse stage transitions (no sub-stage): only render started + failed,
|
|
101
|
+
// since the per-sub-stage rows already cover the success path.
|
|
102
|
+
if (event.status === "started")
|
|
103
|
+
return "Build started";
|
|
104
|
+
if (event.status === "failed")
|
|
105
|
+
return "Build failed";
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
function labelForSubStage(subStage) {
|
|
109
|
+
switch (subStage) {
|
|
110
|
+
case "deps_install":
|
|
111
|
+
return "Installing dependencies";
|
|
112
|
+
case "build_command":
|
|
113
|
+
return "Running build command";
|
|
114
|
+
case "image_finalize":
|
|
115
|
+
return "Finalizing image";
|
|
116
|
+
case "docker_layers":
|
|
117
|
+
return "Building Docker layers";
|
|
118
|
+
case "cache_hit":
|
|
119
|
+
return "Reusing cached image";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function withDuration(label, durationMs) {
|
|
123
|
+
if (durationMs === null || durationMs <= 0)
|
|
124
|
+
return label;
|
|
125
|
+
if (durationMs < 1000)
|
|
126
|
+
return `${label} (${durationMs}ms)`;
|
|
127
|
+
const seconds = (durationMs / 1000).toFixed(1);
|
|
128
|
+
return `${label} (${seconds}s)`;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=event-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-renderer.js","sourceRoot":"","sources":["../src/event-renderer.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAkB;IAClD,IAAI,KAAK,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AC;IAC3D,MAAM,OAAO,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/C,OAAO,GAAG,KAAK,KAAK,OAAO,IAAI,CAAC;AAClC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,25 +2,37 @@ export type { Context, PromptOptions } from "./context";
|
|
|
2
2
|
export { PercherCoreError, type PercherCoreErrorCode, type PercherCoreErrorOptions, } from "./errors";
|
|
3
3
|
export { detectFramework, type DetectedFramework } from "./detect";
|
|
4
4
|
export { createTarball, type TarballOptions, type TarballResult } from "./tarball";
|
|
5
|
+
export { scanSourceForEnvRefs, type EnvReference, type ScanOptions as EnvScanSourceOptions, } from "./env-scan-source";
|
|
5
6
|
export { readPercherTomlAppName } from "./app-name";
|
|
7
|
+
export { renderDeployEvent } from "./event-renderer";
|
|
6
8
|
export { whoami, type WhoAmI } from "./commands/whoami";
|
|
9
|
+
export { status, statusInputSchema, type StatusInput, type StatusResult, type StatusVerdict, deriveVerdict, } from "./commands/status";
|
|
10
|
+
export { accountExport, accountDelete, accountExportInputSchema, accountDeleteInputSchema, type AccountExportInput, type AccountExportResult, type AccountDeleteInput, } from "./commands/account";
|
|
7
11
|
export { login, loginInputSchema, type LoginInput } from "./commands/login";
|
|
8
12
|
export { init, initInputSchema, type InitInput, type InitResult } from "./commands/init";
|
|
9
13
|
export { envSet, envUnset, envList, envSetInputSchema, envUnsetInputSchema, envListInputSchema, } from "./commands/env";
|
|
10
14
|
export { open, openInputSchema, type OpenInput } from "./commands/open";
|
|
15
|
+
export { dashboard, dashboardInputSchema, type DashboardInput } from "./commands/dashboard";
|
|
11
16
|
export { logs, logsInputSchema, type LogsInput } from "./commands/logs";
|
|
17
|
+
export { unsuspend, unsuspendInputSchema, type UnsuspendInput, type UnsuspendResult, } from "./commands/unsuspend";
|
|
12
18
|
export { push, pushInputSchema, type PushInput, type PushResult } from "./commands/push";
|
|
13
19
|
export { publish, publishInputSchema, type PublishInput, type PublishResult, type PublishTiming, type PublishError, } from "./commands/publish";
|
|
20
|
+
export { waitForDeploy, waitForDeployInputSchema, type WaitForDeployInput, type WaitForDeployResult, } from "./commands/wait-deploy";
|
|
21
|
+
export { redeploy, redeployInputSchema, type RedeployInput, } from "./commands/redeploy";
|
|
22
|
+
export { reproduce, reproduceInputSchema, type ReproduceInput, type ReproduceResult, } from "./commands/reproduce";
|
|
14
23
|
export { classifyError, type ClassifiedError, type ErrorClass, type DeployPhase, } from "./error-classifier";
|
|
24
|
+
export { type PublishRecovery, type RecoveryAction, type SuggestedTool, type ReasonCode, type DoctorMode, type PublishStatus, type RecoveryProblem, type RecoveryAlternative, type ToolRecovery, type UserRecovery, type NoneRecovery, type AskUserRecovery, RECOVERY_NONE, RECOVERY_NEEDS_LOGIN, recoveryAsk, recoveryDoctor, recoveryEnv, recoveryFixConfig, recoveryFixProblems, recoveryFromErrorClass, recoveryInspectBuildLog, recoveryLogin, recoveryNone, recoveryRetry, recoveryWait, } from "./recovery";
|
|
15
25
|
export { resetSuperuser, resetSuperuserInputSchema, type ResetSuperuserInput, type ResetSuperuserResult, } from "./commands/reset-superuser";
|
|
16
26
|
export { rename, renameInputSchema, type RenameInput, type RenameResult, } from "./commands/rename";
|
|
17
27
|
export { versions, versionsInputSchema, type VersionsInput, type AppVersion, } from "./commands/versions";
|
|
18
28
|
export { rollback, rollbackInputSchema, type RollbackInput, } from "./commands/rollback";
|
|
29
|
+
export { listBackups, listBackupsInputSchema, type ListBackupsInput, restore, restoreInputSchema, type RestoreInput, type RestoreInternals, type DryRunResult, } from "./commands/restore";
|
|
19
30
|
export { deploysList, deploysListInputSchema, type DeploysListInput, deploysInspect, deploysInspectInputSchema, type DeploysInspectInput, type DeploysInspectResult, } from "./commands/deploys";
|
|
20
31
|
export { mcp, mcpInputSchema, type McpInput, type McpConfigResult, } from "./commands/mcp";
|
|
21
|
-
export { doctor, doctorInputSchema, type DoctorInput, type DoctorResult, type DoctorCheck, } from "./commands/doctor";
|
|
32
|
+
export { doctor, doctorInputSchema, type DoctorInput, type DoctorResult, type DoctorCheck, type DoctorStatus, type DoctorPhase, type DoctorDiagnosis, } from "./commands/doctor";
|
|
22
33
|
export { dev, devInputSchema, type DevInput, type DevCallbacks } from "./commands/dev";
|
|
23
34
|
export { data, dataInputSchema, type DataInput, type DataResult } from "./commands/data";
|
|
35
|
+
export { dataExport, dataExportInputSchema, type DataExportInput, type DataExportResult, } from "./commands/data-export";
|
|
24
36
|
export { diagnose, diagnoseInputSchema, type DiagnoseInput, type DiagnoseResult, } from "./commands/diagnose";
|
|
25
37
|
export { insights, insightsInputSchema, type InsightsInput, type InsightsResult, type InsightSuggestion, } from "./commands/insights";
|
|
26
38
|
export { billingUpgrade, billingUpgradeInputSchema, billingPortal, billingPortalInputSchema, type BillingUpgradeInput, type BillingUpgradeResult, type BillingPortalInput, type BillingPortalResult, } from "./commands/billing";
|
|
@@ -29,6 +41,7 @@ export { domainAdd, domainVerify, domainList, domainRemove, domainAddInputSchema
|
|
|
29
41
|
export { resume, resumeInputSchema, type ResumeInput, } from "./commands/resume";
|
|
30
42
|
export { deleteApp, deleteInputSchema, type DeleteInput, } from "./commands/delete";
|
|
31
43
|
export { importProject, importInputSchema, type ImportInput, type ImportResult, } from "./commands/import-project";
|
|
44
|
+
export { githubConnect, githubConnectInputSchema, type GithubConnectInput, type GithubConnectResult, githubSetupWebhook, githubSetupWebhookInputSchema, type GithubSetupWebhookInput, type GithubSetupWebhookResult, } from "./commands/github";
|
|
32
45
|
export { generate, generateInputSchema, type GenerateInput, type GenerateResult, } from "./commands/generate";
|
|
33
46
|
export { createWatcher, type WatcherOptions, type Watcher } from "./watcher";
|
|
34
47
|
export { isBlockedName, BLOCKED_APP_NAMES } from "./validation/blocked-names";
|
|
@@ -36,4 +49,6 @@ export { qrToTerminal, qrToDataUri } from "./qr";
|
|
|
36
49
|
export { listTemplates, listTemplateMetadata, getTemplateMetadata, scaffoldTemplate, TEMPLATE_CATALOG, type ScaffoldInput, type ScaffoldResult, type TemplateCategory, type TemplateDataMode, type TemplateMetadata, type TemplateRuntime, } from "./templates";
|
|
37
50
|
export { INTEGRATIONS, getIntegration, listIntegrationsByCategory, type IntegrationGuide, } from "./integrations";
|
|
38
51
|
export { PLAN_CATALOG, PLAN_IDS, getPlanLimits, getEffectivePlanLimits, getPlanInfo, type PlanId, type PlanLimits, type PlanInfo, } from "./plans";
|
|
52
|
+
export { aiFilesInstall, aiFilesUpdate, aiFilesStatus, aiFilesRemove, aiFilesInstallInputSchema, aiFilesUpdateInputSchema, aiFilesStatusInputSchema, aiFilesRemoveInputSchema, type InstallResult as AiFilesInstallResult, type UpdateResult as AiFilesUpdateResult, type StatusResult as AiFilesStatusResult, type RemoveResult as AiFilesRemoveResult, } from "./commands/ai-files";
|
|
53
|
+
export { AI_FILE_TEMPLATES } from "./templates/ai-files";
|
|
39
54
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EACL,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EACL,gBAAgB,EAChB,KAAK,oBAAoB,EACz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pB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACjD,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,0BAA0B,EAC1B,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,QAAQ,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,aAAa,IAAI,oBAAoB,EAC1C,KAAK,YAAY,IAAI,mBAAmB,EACxC,KAAK,YAAY,IAAI,mBAAmB,EACxC,KAAK,YAAY,IAAI,mBAAmB,GACzC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
export { PercherCoreError, } from "./errors";
|
|
2
2
|
export { detectFramework } from "./detect";
|
|
3
3
|
export { createTarball } from "./tarball";
|
|
4
|
+
export { scanSourceForEnvRefs, } from "./env-scan-source";
|
|
4
5
|
export { readPercherTomlAppName } from "./app-name";
|
|
6
|
+
export { renderDeployEvent } from "./event-renderer";
|
|
5
7
|
export { whoami } from "./commands/whoami";
|
|
8
|
+
export { status, statusInputSchema, deriveVerdict, } from "./commands/status";
|
|
9
|
+
export { accountExport, accountDelete, accountExportInputSchema, accountDeleteInputSchema, } from "./commands/account";
|
|
6
10
|
export { login, loginInputSchema } from "./commands/login";
|
|
7
11
|
export { init, initInputSchema } from "./commands/init";
|
|
8
12
|
export { envSet, envUnset, envList, envSetInputSchema, envUnsetInputSchema, envListInputSchema, } from "./commands/env";
|
|
9
13
|
export { open, openInputSchema } from "./commands/open";
|
|
14
|
+
export { dashboard, dashboardInputSchema } from "./commands/dashboard";
|
|
10
15
|
export { logs, logsInputSchema } from "./commands/logs";
|
|
16
|
+
export { unsuspend, unsuspendInputSchema, } from "./commands/unsuspend";
|
|
11
17
|
export { push, pushInputSchema } from "./commands/push";
|
|
12
18
|
export { publish, publishInputSchema, } from "./commands/publish";
|
|
19
|
+
export { waitForDeploy, waitForDeployInputSchema, } from "./commands/wait-deploy";
|
|
20
|
+
export { redeploy, redeployInputSchema, } from "./commands/redeploy";
|
|
21
|
+
export { reproduce, reproduceInputSchema, } from "./commands/reproduce";
|
|
13
22
|
export { classifyError, } from "./error-classifier";
|
|
23
|
+
export { RECOVERY_NONE, RECOVERY_NEEDS_LOGIN, recoveryAsk, recoveryDoctor, recoveryEnv, recoveryFixConfig, recoveryFixProblems, recoveryFromErrorClass, recoveryInspectBuildLog, recoveryLogin, recoveryNone, recoveryRetry, recoveryWait, } from "./recovery";
|
|
14
24
|
export { resetSuperuser, resetSuperuserInputSchema, } from "./commands/reset-superuser";
|
|
15
25
|
export { rename, renameInputSchema, } from "./commands/rename";
|
|
16
26
|
export { versions, versionsInputSchema, } from "./commands/versions";
|
|
17
27
|
export { rollback, rollbackInputSchema, } from "./commands/rollback";
|
|
28
|
+
export { listBackups, listBackupsInputSchema, restore, restoreInputSchema, } from "./commands/restore";
|
|
18
29
|
export { deploysList, deploysListInputSchema, deploysInspect, deploysInspectInputSchema, } from "./commands/deploys";
|
|
19
30
|
export { mcp, mcpInputSchema, } from "./commands/mcp";
|
|
20
31
|
export { doctor, doctorInputSchema, } from "./commands/doctor";
|
|
21
32
|
export { dev, devInputSchema } from "./commands/dev";
|
|
22
33
|
export { data, dataInputSchema } from "./commands/data";
|
|
34
|
+
export { dataExport, dataExportInputSchema, } from "./commands/data-export";
|
|
23
35
|
export { diagnose, diagnoseInputSchema, } from "./commands/diagnose";
|
|
24
36
|
export { insights, insightsInputSchema, } from "./commands/insights";
|
|
25
37
|
export { billingUpgrade, billingUpgradeInputSchema, billingPortal, billingPortalInputSchema, } from "./commands/billing";
|
|
@@ -28,6 +40,7 @@ export { domainAdd, domainVerify, domainList, domainRemove, domainAddInputSchema
|
|
|
28
40
|
export { resume, resumeInputSchema, } from "./commands/resume";
|
|
29
41
|
export { deleteApp, deleteInputSchema, } from "./commands/delete";
|
|
30
42
|
export { importProject, importInputSchema, } from "./commands/import-project";
|
|
43
|
+
export { githubConnect, githubConnectInputSchema, githubSetupWebhook, githubSetupWebhookInputSchema, } from "./commands/github";
|
|
31
44
|
export { generate, generateInputSchema, } from "./commands/generate";
|
|
32
45
|
export { createWatcher } from "./watcher";
|
|
33
46
|
export { isBlockedName, BLOCKED_APP_NAMES } from "./validation/blocked-names";
|
|
@@ -35,4 +48,6 @@ export { qrToTerminal, qrToDataUri } from "./qr";
|
|
|
35
48
|
export { listTemplates, listTemplateMetadata, getTemplateMetadata, scaffoldTemplate, TEMPLATE_CATALOG, } from "./templates";
|
|
36
49
|
export { INTEGRATIONS, getIntegration, listIntegrationsByCategory, } from "./integrations";
|
|
37
50
|
export { PLAN_CATALOG, PLAN_IDS, getPlanLimits, getEffectivePlanLimits, getPlanInfo, } from "./plans";
|
|
51
|
+
export { aiFilesInstall, aiFilesUpdate, aiFilesStatus, aiFilesRemove, aiFilesInstallInputSchema, aiFilesUpdateInputSchema, aiFilesStatusInputSchema, aiFilesRemoveInputSchema, } from "./commands/ai-files";
|
|
52
|
+
export { AI_FILE_TEMPLATES } from "./templates/ai-files";
|
|
38
53
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,GAGjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,eAAe,EAA0B,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,aAAa,EAA2C,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,GAGjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,eAAe,EAA0B,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,aAAa,EAA2C,MAAM,WAAW,CAAC;AACnF,OAAO,EACL,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,MAAM,EAAe,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,MAAM,EACN,iBAAiB,EAIjB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,wBAAwB,GAIzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAmB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,eAAe,EAAmC,MAAM,iBAAiB,CAAC;AACzF,OAAO,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,GACnB,M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,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACjD,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GAOjB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,0BAA0B,GAE3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,sBAAsB,EACtB,WAAW,GAIZ,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,GAKzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/plans.d.ts
CHANGED
|
@@ -37,6 +37,26 @@ export interface PlanLimits {
|
|
|
37
37
|
* outside the cluster and records the result for the Health tab.
|
|
38
38
|
*/
|
|
39
39
|
uptimeIntervalSec: number;
|
|
40
|
+
/**
|
|
41
|
+
* Fas 4 abuse-mitigation: per-day cap on live deploys per account.
|
|
42
|
+
* Resets at 00:00 UTC. Independent from the per-app sliding-window
|
|
43
|
+
* `deploysPerHour` (Fas 2) — quota is account-wide and daily, rate
|
|
44
|
+
* limit is per-app and short-burst. Quota fires first.
|
|
45
|
+
*/
|
|
46
|
+
dailyLiveDeploys: number;
|
|
47
|
+
/** Fas 4: per-day cap on preview deploys (separate counter from live
|
|
48
|
+
* so a paid review cycle cannot eat the live budget, and a runaway
|
|
49
|
+
* agent cannot loop previews to bypass the live cap). */
|
|
50
|
+
dailyPreviewDeploys: number;
|
|
51
|
+
/**
|
|
52
|
+
* Phase 8.2 — max concurrent (queued + building + deploying) deploys
|
|
53
|
+
* across every app the user owns. Distinct from `deploysPerHour`
|
|
54
|
+
* (per-app sliding-window) and `dailyLiveDeploys` (account-wide
|
|
55
|
+
* daily): this is the *instantaneous* parallelism cap, the only one
|
|
56
|
+
* that protects the BuildQueue from a single account filling every
|
|
57
|
+
* concurrent slot. `Infinity` = no cap (enterprise tier).
|
|
58
|
+
*/
|
|
59
|
+
userConcurrentDeploys: number;
|
|
40
60
|
}
|
|
41
61
|
export interface PlanInfo {
|
|
42
62
|
label: string;
|
package/dist/plans.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,GAAG,WAAW,CAAC;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,eAAe,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,8BAA8B;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0EAA0E;IAC1E,mBA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ACzB;;8DAE0D;IAC1D,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;;;;OAOG;IACH,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CA6HjD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAgC,MAAM,EAAE,CAAC;AAE9D,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAEtD;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAElD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,UAAU,CA0BhF"}
|
package/dist/plans.js
CHANGED
|
@@ -25,6 +25,9 @@ export const PLAN_CATALOG = {
|
|
|
25
25
|
supportResponseTime: null,
|
|
26
26
|
kvStorageMb: 10,
|
|
27
27
|
uptimeIntervalSec: 0,
|
|
28
|
+
dailyLiveDeploys: 50,
|
|
29
|
+
dailyPreviewDeploys: 25,
|
|
30
|
+
userConcurrentDeploys: 2,
|
|
28
31
|
},
|
|
29
32
|
},
|
|
30
33
|
starter: {
|
|
@@ -53,6 +56,9 @@ export const PLAN_CATALOG = {
|
|
|
53
56
|
supportResponseTime: "72h email",
|
|
54
57
|
kvStorageMb: 50,
|
|
55
58
|
uptimeIntervalSec: 300,
|
|
59
|
+
dailyLiveDeploys: 100,
|
|
60
|
+
dailyPreviewDeploys: 50,
|
|
61
|
+
userConcurrentDeploys: 3,
|
|
56
62
|
},
|
|
57
63
|
},
|
|
58
64
|
maker: {
|
|
@@ -81,6 +87,9 @@ export const PLAN_CATALOG = {
|
|
|
81
87
|
supportResponseTime: "24h email",
|
|
82
88
|
kvStorageMb: 200,
|
|
83
89
|
uptimeIntervalSec: 60,
|
|
90
|
+
dailyLiveDeploys: 200,
|
|
91
|
+
dailyPreviewDeploys: 100,
|
|
92
|
+
userConcurrentDeploys: 5,
|
|
84
93
|
},
|
|
85
94
|
},
|
|
86
95
|
pro: {
|
|
@@ -109,6 +118,9 @@ export const PLAN_CATALOG = {
|
|
|
109
118
|
supportResponseTime: "8h email + priority Discord",
|
|
110
119
|
kvStorageMb: 1000,
|
|
111
120
|
uptimeIntervalSec: 30,
|
|
121
|
+
dailyLiveDeploys: 1000,
|
|
122
|
+
dailyPreviewDeploys: 500,
|
|
123
|
+
userConcurrentDeploys: 20,
|
|
112
124
|
},
|
|
113
125
|
},
|
|
114
126
|
};
|
|
@@ -148,6 +160,9 @@ export function getEffectivePlanLimits(plan, isAdmin = false) {
|
|
|
148
160
|
apps: INF,
|
|
149
161
|
deploysPerMonth: "unlimited",
|
|
150
162
|
deploysPerHour: INF,
|
|
163
|
+
dailyLiveDeploys: INF,
|
|
164
|
+
dailyPreviewDeploys: INF,
|
|
165
|
+
userConcurrentDeploys: INF,
|
|
151
166
|
activePreviewsPerApp: INF,
|
|
152
167
|
customDomainsPerApp: INF,
|
|
153
168
|
autoSleep: false,
|
package/dist/plans.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":"AAoEA,MAAM,CAAC,MAAM,YAAY,GAA6B;IACpD,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE;YACN,IAAI,EAAE,CAAC;YACP,eAAe,EAAE,EAAE;YACnB,cAAc,EAAE,EAAE;YAClB,MAAM,EAAE,OAAO;YACf,GAAG,EAAE,IAAI;YACT,IA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AC1B,QAAQ,EAAE,GAAG;QACb,WAAW,EAAE,GAAG;QAChB,mEAAmE;QACnE,gEAAgE;QAChE,2DAA2D;KAC5D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { DeployEvent } from "@percher/client";
|
|
2
|
+
import type { Context } from "./context";
|
|
3
|
+
export interface DeploymentLike {
|
|
4
|
+
id: string;
|
|
5
|
+
status: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PollDeploymentOptions<D extends DeploymentLike> {
|
|
8
|
+
ctx: Context;
|
|
9
|
+
appId: string;
|
|
10
|
+
initial: D;
|
|
11
|
+
/** Status values that end the loop. Defaults to ["live", "failed"]. */
|
|
12
|
+
terminal?: readonly string[];
|
|
13
|
+
/** Polling interval in ms (default 2000). */
|
|
14
|
+
intervalMs?: number;
|
|
15
|
+
/** Total wall-clock budget in ms. Defaults to the shared
|
|
16
|
+
* `clientPublishPoll` budget so every CLI poll site stays aligned
|
|
17
|
+
* with the API → worker fetch timeout (Phase 7.1). */
|
|
18
|
+
timeoutMs?: number;
|
|
19
|
+
/** Callback fired on each successful poll — for status emission. */
|
|
20
|
+
onTick?: (deployment: D) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Phase 6.1 — fires for each newly-recorded deploy event observed
|
|
23
|
+
* since the last poll. The poll loop fetches events alongside the
|
|
24
|
+
* deployment row, diffs against an internal seen-IDs set, and
|
|
25
|
+
* invokes this for each new row in chronological order. Any
|
|
26
|
+
* exception in the events-fetch path is swallowed so a failing
|
|
27
|
+
* events endpoint never crashes the deployment poll itself.
|
|
28
|
+
*/
|
|
29
|
+
onEvent?: (event: DeployEvent) => void;
|
|
30
|
+
/** Hook called when wall-clock timeout is hit. Should throw. */
|
|
31
|
+
onTimeout: (deployment: D) => never;
|
|
32
|
+
/** App display name, used in the network-error hint message. */
|
|
33
|
+
appName: string;
|
|
34
|
+
/** Maximum consecutive transient failures before giving up (default 5). */
|
|
35
|
+
maxRetries?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Backoff (ms) before retry attempt N (1-indexed). Default doubles
|
|
38
|
+
* from 1s: 1000, 2000, 4000, 8000. Tests inject `() => 0` to skip
|
|
39
|
+
* the wait.
|
|
40
|
+
*/
|
|
41
|
+
backoffMs?: (attempt: number) => number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Poll `getDeployment` until the deployment reaches a terminal status.
|
|
45
|
+
*
|
|
46
|
+
* Tolerates transient `network error: …` failures (Http.request wraps
|
|
47
|
+
* fetch failures with that prefix) by retrying with exponential
|
|
48
|
+
* backoff. Live-incident 2026-04-28 dep_lioyh9suzjx9ialtwm5e: a single
|
|
49
|
+
* fetch-failed mid-poll crashed `percher publish`, while the deploy
|
|
50
|
+
* itself completed successfully on the server — the user paid for an
|
|
51
|
+
* entire duplicate build cycle. Same race existed in `percher push`
|
|
52
|
+
* (the agent-facing command) until this helper landed.
|
|
53
|
+
*
|
|
54
|
+
* Caller threads `getDeployment` through ctx.client; we keep this
|
|
55
|
+
* helper free of resource-typing so it can be called for both live
|
|
56
|
+
* and preview deploys without leaking type details.
|
|
57
|
+
*/
|
|
58
|
+
export declare function pollDeployment<D extends DeploymentLike>(opts: PollDeploymentOptions<D>): Promise<D>;
|
|
59
|
+
//# sourceMappingURL=poll-deployment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll-deployment.d.ts","sourceRoot":"","sources":["../src/poll-deployment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,cAAc;IAC7D,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,CAAC;IACX,uEAAuE;IACvE,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;2DAEuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,IAAI,CAAC;IACjC;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,gEAAgE;IAChE,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,KAAK,CAAC;IACpC,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAAC,CAAC,SAAS,cAAc,EAC3D,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,CAAC,CAAC,CA+DZ"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { TIMEOUTS } from "@percher/shared/timeouts";
|
|
2
|
+
/**
|
|
3
|
+
* Poll `getDeployment` until the deployment reaches a terminal status.
|
|
4
|
+
*
|
|
5
|
+
* Tolerates transient `network error: …` failures (Http.request wraps
|
|
6
|
+
* fetch failures with that prefix) by retrying with exponential
|
|
7
|
+
* backoff. Live-incident 2026-04-28 dep_lioyh9suzjx9ialtwm5e: a single
|
|
8
|
+
* fetch-failed mid-poll crashed `percher publish`, while the deploy
|
|
9
|
+
* itself completed successfully on the server — the user paid for an
|
|
10
|
+
* entire duplicate build cycle. Same race existed in `percher push`
|
|
11
|
+
* (the agent-facing command) until this helper landed.
|
|
12
|
+
*
|
|
13
|
+
* Caller threads `getDeployment` through ctx.client; we keep this
|
|
14
|
+
* helper free of resource-typing so it can be called for both live
|
|
15
|
+
* and preview deploys without leaking type details.
|
|
16
|
+
*/
|
|
17
|
+
export async function pollDeployment(opts) {
|
|
18
|
+
const terminal = opts.terminal ?? ["live", "failed"];
|
|
19
|
+
const intervalMs = opts.intervalMs ?? 2000;
|
|
20
|
+
const timeoutMs = opts.timeoutMs ?? TIMEOUTS.clientPublishPoll;
|
|
21
|
+
const maxRetries = opts.maxRetries ?? 5;
|
|
22
|
+
let deployment = opts.initial;
|
|
23
|
+
const startedAt = Date.now();
|
|
24
|
+
const seenEventIds = new Set();
|
|
25
|
+
// Drain any pre-existing events for this deploy on the first tick so
|
|
26
|
+
// a long-running poll doesn't replay rows that landed before the
|
|
27
|
+
// caller started watching. The events between initial and first poll
|
|
28
|
+
// are still surfaced — see the post-poll fetch below.
|
|
29
|
+
if (opts.onEvent) {
|
|
30
|
+
await drainNewEvents(opts, deployment.id, seenEventIds);
|
|
31
|
+
}
|
|
32
|
+
while (!terminal.includes(deployment.status)) {
|
|
33
|
+
if (Date.now() - startedAt > timeoutMs) {
|
|
34
|
+
opts.onTimeout(deployment);
|
|
35
|
+
}
|
|
36
|
+
opts.onTick?.(deployment);
|
|
37
|
+
await new Promise((r) => setTimeout(r, intervalMs));
|
|
38
|
+
let attempt = 0;
|
|
39
|
+
let polled = false;
|
|
40
|
+
while (!polled) {
|
|
41
|
+
try {
|
|
42
|
+
deployment = (await opts.ctx.client.apps.getDeployment(opts.appId, deployment.id));
|
|
43
|
+
polled = true;
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
attempt++;
|
|
47
|
+
const msg = err.message ?? String(err);
|
|
48
|
+
const isNetwork = msg.startsWith("network error:");
|
|
49
|
+
if (!isNetwork || attempt >= maxRetries) {
|
|
50
|
+
if (isNetwork) {
|
|
51
|
+
// Surface a more helpful message than the bare network
|
|
52
|
+
// error: the deploy may have completed server-side
|
|
53
|
+
// already, and a direct check is one CLI invocation away.
|
|
54
|
+
throw new Error(`${msg}\n\nThe deploy may already be live — your network connection dropped mid-poll. Check with: percher deploys list ${opts.appName}`, { cause: err });
|
|
55
|
+
}
|
|
56
|
+
throw err;
|
|
57
|
+
}
|
|
58
|
+
// Backoff: 1s, 2s, 4s, 8s before next retry by default.
|
|
59
|
+
const backoff = (opts.backoffMs ?? ((n) => 1000 * 2 ** (n - 1)))(attempt);
|
|
60
|
+
await new Promise((r) => setTimeout(r, backoff));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (opts.onEvent) {
|
|
64
|
+
await drainNewEvents(opts, deployment.id, seenEventIds);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return deployment;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Fetch events for the active deploy and emit any rows whose ID
|
|
71
|
+
* hasn't been seen before. Errors from the events endpoint are
|
|
72
|
+
* intentionally swallowed: the deployment-status poll is the
|
|
73
|
+
* load-bearing primitive, and a transient events-fetch failure
|
|
74
|
+
* should never propagate up to the publish caller (which would
|
|
75
|
+
* surface as "publish crashed" while the deploy is running fine).
|
|
76
|
+
*/
|
|
77
|
+
async function drainNewEvents(opts, deployId, seenEventIds) {
|
|
78
|
+
if (!opts.onEvent)
|
|
79
|
+
return;
|
|
80
|
+
try {
|
|
81
|
+
const { events } = await opts.ctx.client.apps.getDeployEvents(opts.appId, deployId);
|
|
82
|
+
for (const event of events) {
|
|
83
|
+
if (seenEventIds.has(event.id))
|
|
84
|
+
continue;
|
|
85
|
+
seenEventIds.add(event.id);
|
|
86
|
+
opts.onEvent(event);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// Events fetch is best-effort. Status poll still drives the loop.
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=poll-deployment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll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C,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;;;GAOG;AACH,KAAK,UAAU,cAAc,CAC3B,IAA8B,EAC9B,QAAgB,EAChB,YAAyB;IAEzB,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO;IAC1B,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACpF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBAAE,SAAS;YACzC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC3B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,kEAAkE;IACpE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface RetryDecision {
|
|
2
|
+
retryable: boolean;
|
|
3
|
+
delayMs: number;
|
|
4
|
+
/** Short reason for the decision — surfaces to the CLI status line. */
|
|
5
|
+
reason: string;
|
|
6
|
+
/** Canonical category used in retry telemetry / logs. */
|
|
7
|
+
category: "worker_unavailable" | "rate_limited" | "network" | "http_5xx" | "non_retryable" | "persistent";
|
|
8
|
+
}
|
|
9
|
+
export declare function classifyDeployRetry(err: unknown, attempt: number): RetryDecision;
|
|
10
|
+
export interface RetryAttemptInfo {
|
|
11
|
+
attempt: number;
|
|
12
|
+
decision: RetryDecision;
|
|
13
|
+
err: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface RunWithRetryOptions<T> {
|
|
16
|
+
call: (attempt: number) => Promise<T>;
|
|
17
|
+
/** Called before the next attempt's wait. Use to surface progress. */
|
|
18
|
+
onRetry?: (info: RetryAttemptInfo) => void;
|
|
19
|
+
/** Override the sleep impl in tests so the backoff is instant. */
|
|
20
|
+
sleep?: (ms: number) => Promise<void>;
|
|
21
|
+
/** Hard cap; defaults to 4 (1 initial + 3 retries). */
|
|
22
|
+
maxAttempts?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface RunWithRetryResult<T> {
|
|
25
|
+
result: T;
|
|
26
|
+
attempts: number;
|
|
27
|
+
}
|
|
28
|
+
export declare function runDeployWithRetry<T>(opts: RunWithRetryOptions<T>): Promise<RunWithRetryResult<T>>;
|
|
29
|
+
//# sourceMappingURL=publish-retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-retry.d.ts","sourceRoot":"","sources":["../src/publish-retry.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,QAAQ,EACJ,oBAAoB,GACpB,cAAc,GACd,SAAS,GACT,UAAU,GACV,eAAe,GACf,YAAY,CAAC;CAClB;AA2BD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CA2JhF;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,aAAa,CAAC;IACxB,GAAG,EAAE,OAAO,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IACtC,sEAAsE;IACtE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC3C,kEAAkE;IAClE,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,MAAM,EAAE,CAAC,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,kBAAkB,CAAC,CAAC,EACxC,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAqBhC"}
|