@supacloud/cli 0.92.0 → 0.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -32
- package/dist/index.js +234 -559
- package/dist/shared/deployment-upgrade.d.ts +2 -0
- package/dist/shared/tools/app-tools.d.ts +1 -1
- package/dist/shared/tools/application-schemas.d.ts +2 -8
- package/dist/shared/tools/application-tools.d.ts +2 -5
- package/dist/shared/tools/deploy-tools.d.ts +0 -8
- package/dist/shared/tools/developer-experience-tools.d.ts +1 -1
- package/dist/shared/tools/frontend-release-control.d.ts +1 -0
- package/dist/shared/tools/project-deployment.d.ts +1 -0
- package/dist/shared/tools/remote-dev-tools.d.ts +1 -1
- package/dist/tool-runtime.js +25 -0
- package/package.json +4 -4
- package/skills/supacloud/SKILL.md +9 -0
- package/skills/supacloud/references/command-map.md +3 -5
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const DEPLOYMENT_UPGRADE = "DEPLOYMENT_UPGRADE_REQUIRED: Legacy deployment is no longer supported. Upgrade with `npm install -g @supacloud/cli@latest`, bind application.id and application.environmentId in supacloud.json (or SUPACLOUD_APPLICATION_ID and SUPACLOUD_ENV), then run `supacloud deploy`. SupaCloud owns deployment planning and activation; do not retry with legacy commands.";
|
|
2
|
+
export declare function assertCurrentDeploymentInput(tool: string, input: unknown): void;
|
|
@@ -55,7 +55,7 @@ export interface AppToolArguments {
|
|
|
55
55
|
source_environment_id?: string;
|
|
56
56
|
mutation_id?: string;
|
|
57
57
|
approved_migration_digest?: string;
|
|
58
|
-
|
|
58
|
+
web_release?: ApplicationDeployRequest["web_release"];
|
|
59
59
|
branch_ref?: string;
|
|
60
60
|
branch_name?: string;
|
|
61
61
|
data_mode?: "schema_only" | "full_clone";
|
|
@@ -171,12 +171,9 @@ export declare const ApplicationDeployRequestSchema: import("typebox").TObject<{
|
|
|
171
171
|
}>>;
|
|
172
172
|
expected_plan_sha256: import("typebox").TOptional<import("typebox").TString>;
|
|
173
173
|
approved_migration_digest: import("typebox").TOptional<import("typebox").TString>;
|
|
174
|
-
|
|
174
|
+
web_release: import("typebox").TOptional<import("typebox").TObject<{
|
|
175
175
|
deployment_id: import("typebox").TString;
|
|
176
176
|
release_id: import("typebox").TString;
|
|
177
|
-
expected_active_release_id: import("typebox").TString;
|
|
178
|
-
expected_activation_id: import("typebox").TString;
|
|
179
|
-
mutation_id: import("typebox").TString;
|
|
180
177
|
}>>;
|
|
181
178
|
}>;
|
|
182
179
|
export declare const ApplicationDeployResultSchema: import("typebox").TObject<{
|
|
@@ -216,10 +213,7 @@ export declare const ApplicationDeployResultSchema: import("typebox").TObject<{
|
|
|
216
213
|
replayed: import("typebox").TBoolean;
|
|
217
214
|
}>>;
|
|
218
215
|
}>;
|
|
219
|
-
export declare const
|
|
216
|
+
export declare const ApplicationDeployWebReleaseSchema: import("typebox").TObject<{
|
|
220
217
|
deployment_id: import("typebox").TString;
|
|
221
218
|
release_id: import("typebox").TString;
|
|
222
|
-
expected_active_release_id: import("typebox").TString;
|
|
223
|
-
expected_activation_id: import("typebox").TString;
|
|
224
|
-
mutation_id: import("typebox").TString;
|
|
225
219
|
}>;
|
|
@@ -9,7 +9,7 @@ export declare const APPLICATION_TOOL_SCHEMA: {
|
|
|
9
9
|
ttl_seconds: Type.TOptional<Type.TInteger>;
|
|
10
10
|
wait: Type.TOptional<Type.TBoolean>;
|
|
11
11
|
timeout_seconds: Type.TOptional<Type.TInteger>;
|
|
12
|
-
action: Type.TEnum<("
|
|
12
|
+
action: Type.TEnum<("upload_release" | "activate_release" | "list_releases" | "get_release" | "logs" | "get_runtime" | "get_deployment_evidence" | "get_configuration" | "get_release_transfer_plan" | "get_promotion_plan" | "get_promotion_status" | "get_rollback_snapshot" | "get_history" | "get_deploy_plan" | "get_preview_plan" | "list_previews" | "get_preview" | "put_configuration" | "deploy_application" | "transfer_release" | "promote_application" | "reconcile_promotion" | "create_preview" | "reconcile_preview" | "cleanup_preview" | "deploy_release" | "rollback_release" | "reconcile_activation" | "retire_activation")[]>;
|
|
13
13
|
ref: Type.TString;
|
|
14
14
|
id: Type.TString;
|
|
15
15
|
environment_id: Type.TOptional<Type.TString>;
|
|
@@ -19,12 +19,9 @@ export declare const APPLICATION_TOOL_SCHEMA: {
|
|
|
19
19
|
configuration_path: Type.TOptional<Type.TString>;
|
|
20
20
|
configuration_write: Type.TOptional<Type.TUnknown>;
|
|
21
21
|
manifest_path: Type.TOptional<Type.TString>;
|
|
22
|
-
|
|
22
|
+
web_release: Type.TOptional<Type.TObject<{
|
|
23
23
|
deployment_id: Type.TString;
|
|
24
24
|
release_id: Type.TString;
|
|
25
|
-
expected_active_release_id: Type.TString;
|
|
26
|
-
expected_activation_id: Type.TString;
|
|
27
|
-
mutation_id: Type.TString;
|
|
28
25
|
}>>;
|
|
29
26
|
release_id: Type.TOptional<Type.TString>;
|
|
30
27
|
source_ref: Type.TOptional<Type.TString>;
|
|
@@ -14,7 +14,6 @@ interface DeployToolOptions {
|
|
|
14
14
|
manifestPath?: string;
|
|
15
15
|
};
|
|
16
16
|
applicationRelease?: (args: Record<string, unknown>) => Promise<ToolResponse>;
|
|
17
|
-
edgeFunctionDeploy?: (args: Record<string, unknown>) => Promise<ToolResponse>;
|
|
18
17
|
}
|
|
19
18
|
interface ToolResponse {
|
|
20
19
|
content: Array<{
|
|
@@ -25,15 +24,8 @@ interface ToolResponse {
|
|
|
25
24
|
}
|
|
26
25
|
export declare const deployToolSchema: {
|
|
27
26
|
ref: Type.TOptional<Type.TString>;
|
|
28
|
-
target: Type.TOptional<Type.TString>;
|
|
29
|
-
id: Type.TOptional<Type.TString>;
|
|
30
27
|
cwd: Type.TOptional<Type.TString>;
|
|
31
|
-
build_command: Type.TOptional<Type.TString>;
|
|
32
|
-
output_dir: Type.TOptional<Type.TString>;
|
|
33
28
|
skip_build: Type.TOptional<Type.TBoolean>;
|
|
34
|
-
dry_run: Type.TOptional<Type.TBoolean>;
|
|
35
|
-
plan: Type.TOptional<Type.TBoolean>;
|
|
36
|
-
diff: Type.TOptional<Type.TBoolean>;
|
|
37
29
|
json: Type.TOptional<Type.TBoolean>;
|
|
38
30
|
};
|
|
39
31
|
export declare function findDeployConfigRoot(startDirectory: string, environmentName?: string): Promise<string>;
|
|
@@ -15,7 +15,7 @@ export declare const environmentToolSchema: ToolSchema;
|
|
|
15
15
|
declare function outputDirectoryFor(manifest: PackageManifest): string;
|
|
16
16
|
declare function profileNameFromFile(name: string): string | null;
|
|
17
17
|
declare function statusMissing(context: ResolvedContext): string[];
|
|
18
|
-
declare function deployMissing(context: ResolvedContext): string[];
|
|
18
|
+
declare function deployMissing(context: ResolvedContext, application?: Record<string, unknown> | null): string[];
|
|
19
19
|
export declare function registerDeveloperExperienceTools(server: ToolServer, options?: DeveloperExperienceOptions): void;
|
|
20
20
|
export declare const __internal: {
|
|
21
21
|
outputDirectoryFor: typeof outputDirectoryFor;
|
|
@@ -42,6 +42,7 @@ export interface FrontendReleaseRecord {
|
|
|
42
42
|
export declare function listFrontendReleases(http: FrontendReleaseHttp, projectRef: string, deploymentId: string, cursor?: string, limit?: number): Promise<ToolResponse>;
|
|
43
43
|
export declare function getFrontendRelease(http: FrontendReleaseHttp, projectRef: string, deploymentId: string, releaseId: string): Promise<ToolResponse>;
|
|
44
44
|
export declare function uploadFrontendRelease(http: FrontendReleaseHttp, projectRef: string, deploymentId: string, archivePath: string): Promise<ToolResponse>;
|
|
45
|
+
export declare function uploadProjectWebRelease(http: FrontendReleaseHttp, projectRef: string, environmentId: string, deploymentId: string, archivePath: string): Promise<ToolResponse>;
|
|
45
46
|
export declare function uploadFrontendSource(http: FrontendReleaseHttp, projectRef: string, deploymentId: string, archivePath: string): Promise<ToolResponse>;
|
|
46
47
|
export declare function getActiveFrontendRelease(http: FrontendReleaseHttp, projectRef: string, deploymentId: string): Promise<ToolResponse>;
|
|
47
48
|
export declare function readFrontendReleaseAuthority(http: FrontendReleaseHttp, projectRef: string, deploymentId: string): Promise<ToolResponse>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { ToolResult } from "../tool-server";
|
|
2
2
|
import type { HttpTransport } from "../transports/http";
|
|
3
|
+
export declare function requireProjectDeploymentProtocol(http: Pick<HttpTransport, "get">, projectRef: string, environmentId: string): Promise<void>;
|
|
3
4
|
export declare function runProjectDeployment(http: Pick<HttpTransport, "post" | "get">, args: Record<string, unknown>): Promise<ToolResult>;
|
|
@@ -20,7 +20,7 @@ export interface RemoteDevToolOptions {
|
|
|
20
20
|
}
|
|
21
21
|
export declare const remoteDevToolSchema: {
|
|
22
22
|
action: Type.TEnum<("status" | "migrate" | "watch" | "sync")[]>;
|
|
23
|
-
target: Type.TOptional<Type.TEnum<("
|
|
23
|
+
target: Type.TOptional<Type.TEnum<("frontend" | "project" | "db" | "functions")[]>>;
|
|
24
24
|
project_dir: Type.TOptional<Type.TString>;
|
|
25
25
|
remote_root: Type.TOptional<Type.TString>;
|
|
26
26
|
remote_host: Type.TOptional<Type.TString>;
|
package/dist/tool-runtime.js
CHANGED
|
@@ -129,12 +129,37 @@ function schemaProperties(schema) {
|
|
|
129
129
|
// src/shared/tool-server.ts
|
|
130
130
|
import { Type as Type2 } from "typebox";
|
|
131
131
|
import { Value as Value2 } from "typebox/value";
|
|
132
|
+
|
|
133
|
+
// src/shared/deployment-upgrade.ts
|
|
134
|
+
var DEPLOYMENT_UPGRADE = "DEPLOYMENT_UPGRADE_REQUIRED: Legacy deployment is no longer supported. Upgrade with `npm install -g @supacloud/cli@latest`, bind application.id and application.environmentId in supacloud.json (or SUPACLOUD_APPLICATION_ID and SUPACLOUD_ENV), then run `supacloud deploy`. SupaCloud owns deployment planning and activation; do not retry with legacy commands.";
|
|
135
|
+
var removedFrontendActions = new Set([
|
|
136
|
+
"deploy_git",
|
|
137
|
+
"deploy_upload",
|
|
138
|
+
"redeploy",
|
|
139
|
+
"upload_release",
|
|
140
|
+
"activate_release"
|
|
141
|
+
]);
|
|
142
|
+
var removedDeployFlags = ["target", "id", "build_command", "output_dir", "plan", "diff", "dry_run"];
|
|
143
|
+
function assertCurrentDeploymentInput(tool, input) {
|
|
144
|
+
if (!input || typeof input !== "object" || Array.isArray(input))
|
|
145
|
+
return;
|
|
146
|
+
const args = input;
|
|
147
|
+
if (tool === "frontend" && typeof args["action"] === "string" && removedFrontendActions.has(args["action"])) {
|
|
148
|
+
throw new Error(DEPLOYMENT_UPGRADE);
|
|
149
|
+
}
|
|
150
|
+
if (tool === "deploy" && removedDeployFlags.some((flag) => Object.hasOwn(args, flag))) {
|
|
151
|
+
throw new Error(`${DEPLOYMENT_UPGRADE} Put build settings in the frontend configuration. For read-only review use \`supacloud app deploy-plan\`.`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// src/shared/tool-server.ts
|
|
132
156
|
var resultSchema = Type2.Object({
|
|
133
157
|
content: Type2.Array(Type2.Object({ type: Type2.Literal("text"), text: Type2.String() })),
|
|
134
158
|
isError: Type2.Optional(Type2.Boolean())
|
|
135
159
|
});
|
|
136
160
|
function registerTool(server, name, description, schema, callback) {
|
|
137
161
|
server.tool(name, description, schema, async (input) => {
|
|
162
|
+
assertCurrentDeploymentInput(name, input);
|
|
138
163
|
const args = parseToolArguments(schema, input);
|
|
139
164
|
const result = await callback(args);
|
|
140
165
|
if (!Value2.Check(resultSchema, result))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.94.0",
|
|
4
4
|
"description": "Project-scoped CLI for SupaCloud users",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@supacloud/compiler": "^0.44.1",
|
|
56
|
-
"@supacloud/delivery": "0.
|
|
57
|
-
"@supacloud/db": "0.16.
|
|
56
|
+
"@supacloud/delivery": "0.16.0",
|
|
57
|
+
"@supacloud/db": "0.16.2",
|
|
58
58
|
"typebox": "1.3.36"
|
|
59
59
|
},
|
|
60
60
|
"overrides": {
|
|
61
61
|
"@supacloud/contracts": "0.8.1",
|
|
62
|
-
"@supacloud/delivery": "0.
|
|
62
|
+
"@supacloud/delivery": "0.16.0",
|
|
63
63
|
"@graphql-tools/utils": "^12.0.3"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
@@ -29,6 +29,15 @@ Use `supacloud` as the project-level control surface and keep durable changes re
|
|
|
29
29
|
|
|
30
30
|
## Workflow
|
|
31
31
|
|
|
32
|
+
For normal application deployment, run `supacloud --env <name> deploy`.
|
|
33
|
+
Use the current application delivery configuration and a bound application ID.
|
|
34
|
+
Do not assemble a client-side sequence of scope generation, backup, migration
|
|
35
|
+
apply, PostgREST refresh, Function deployment and Web activation.
|
|
36
|
+
The server owns that sequence. Old `deploy --target` and `frontend` publishing
|
|
37
|
+
actions are removed: upgrade CLI and server together, migrate the configuration,
|
|
38
|
+
and retry the unified command. Do not substitute a legacy endpoint when it fails.
|
|
39
|
+
The inspection and database-maintenance workflow below is not a deployment checklist.
|
|
40
|
+
|
|
32
41
|
1. Classify the request using [references/command-map.md](references/command-map.md).
|
|
33
42
|
2. For database work, load [references/database-workflow.md](references/database-workflow.md) and choose either new-change or historical-drift reconciliation.
|
|
34
43
|
3. For AI-assisted database changes, first request bounded context:
|
|
@@ -6,6 +6,7 @@ Load this reference when selecting a command surface or when a user asks an AI t
|
|
|
6
6
|
|
|
7
7
|
| Intent | Use | Guardrail |
|
|
8
8
|
| --- | --- | --- |
|
|
9
|
+
| Deploy the bound application | `supacloud --env <name> deploy` | Use current CLI/server and application delivery configuration; never fall back to standalone target or direct frontend activation commands |
|
|
9
10
|
| Inspect current project binding | `supacloud status` | Read-only; run first |
|
|
10
11
|
| Inspect selected project API/Auth/Studio origins | `supacloud project endpoints` | Uses the Management API's authoritative projection; do not reconstruct domains locally |
|
|
11
12
|
| Enumerate projects or endpoint projections | `supacloud-admin project list` / `project list_endpoints` | Platform-wide read; never promote a project credential to Admin authority |
|
|
@@ -23,9 +24,6 @@ Load this reference when selecting a command surface or when a user asks an AI t
|
|
|
23
24
|
| Inspect or back up a remote database | `supabase db_pull`, `migration_list`, `db_dump`, `gen_types` | Requires explicit PostgreSQL DSN; redact it |
|
|
24
25
|
| Replay the release-canary fixture stage receipt | `release release_canary_fixture_stage_replay` | Dual-bind Management project context and that project's service-role application origin; accepts only the exact subject/request UUID pair and a strict idempotent receipt |
|
|
25
26
|
| Disable a staged release-canary fixture | `release release_canary_fixture_disable_replay` | Uses the fixed disable RPC once, accepts idempotent false/true receipts, then queries the existing pending RPC with issuer/subject and requires authoritative JSON `false`; fixture binding comes from the strict disable receipt |
|
|
26
|
-
| Rebind release scope manifest to upstream base commit | `release scope_rebind` | Local maintenance action; requires the exact `--environment_id`, updates only scopes bound to that environment, supports `--dry_run`/`--task`, and recalculates `scope_sha256` |
|
|
27
|
-
| Inspect release scope manifest and git alignment | `release scope_inspect` | Local maintenance action; requires the exact `--environment_id`, rejects legacy or cross-environment scopes, returns canonical hash, and checks alignment with HEAD / origin/main |
|
|
28
|
-
| Scaffold a new canonical release scope manifest | `release scope_create` | Local maintenance action; requires `--environment_id` and outputs a current-main-bound scope with sorted functions, migrations, and environment identity |
|
|
29
27
|
| Preview/apply migrations remotely | `supabase push` | Always dry-run first; production needs explicit approval |
|
|
30
28
|
| Mark proven-equivalent historical migrations as applied | `database baseline_migrations` | Dry-run, schema-equivalence proof, backup, explicit approval |
|
|
31
29
|
| Inspect auth users or generate a controlled login link | `auth list_users`, `auth get_user`, `auth generate_link` | User reads are bounded; generation supports only `magiclink`, `recovery`, and `invite`, requires production confirmation, and returns only a validated action URL |
|
|
@@ -47,11 +45,11 @@ until a project-scoped context is resolved.
|
|
|
47
45
|
- `auth`: provider/configuration plus bounded user lookup and production-confirmed `magiclink`, `recovery`, or `invite` generation. Search/email/redirect inputs and returned action URLs are bounded and validated before use.
|
|
48
46
|
- `storage`: buckets and object-management workflows.
|
|
49
47
|
- `edge_functions`: list, atomically read one active or deleted identity with `get_config`, read immutable source, deploy, activate, configure, and delete Edge Functions. For every mutation, pass the `activation_id` read from the same `list` or `get_config` snapshot as `--expected-activation-id`; use `legacy` only for a never-created or listed legacy Function, not for a deleted slug with a tombstone UUID. Deploy and activate actions also require the non-negative observed version as `--expected-active-version`; use `absent` for a never-created slug or a `get_config` tombstone. Version `0` is a legacy version token and cannot be used as a source or activation target.
|
|
50
|
-
- `frontend`:
|
|
48
|
+
- `frontend`: hosting management, release inspection and operator rollback. Publishing uses `supacloud deploy`; `deploy_git`, `deploy_upload`, `redeploy`, `upload_release` and `activate_release` are removed.
|
|
51
49
|
- `secrets`: project secret management; never print values after write.
|
|
52
50
|
- `queue`, `task_events`, `diagnostics`: asynchronous workload operations and bounded diagnostics.
|
|
53
51
|
- `gateway`: project route/config/rebuild operations.
|
|
54
|
-
- `release`:
|
|
52
|
+
- `release`: explicit backup/PostgREST maintenance and release-canary replay diagnostics. Do not run these or generate release scopes as prerequisites for `supacloud --env <name> deploy`; the platform owns deployment orchestration.
|
|
55
53
|
- `ai`: inspect or install this packaged Skill.
|
|
56
54
|
|
|
57
55
|
## Safe inspection pattern
|