@supacloud/cli 0.124.0 → 0.126.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/index.js +25762 -17865
- package/dist/shared/tools/application-schemas.d.ts +2 -0
- package/dist/shared/tools/application-tools.d.ts +1 -0
- package/dist/shared/tools/deploy-tools.d.ts +10 -0
- package/dist/shared/tools/edge-function-response.d.ts +0 -1
- package/dist/shared/tools/workspace-delivery-http.d.ts +25 -0
- package/dist/shared/tools/workspace-execute.d.ts +183 -0
- package/dist/shared/tools/workspace-execute.test.d.ts +1 -0
- package/dist/shared/tools/workspace-plan.d.ts +105 -0
- package/dist/shared/tools/workspace-plan.test.d.ts +1 -0
- package/dist/shared/tools/workspace-publish.d.ts +4 -0
- package/package.json +10 -10
|
@@ -128,6 +128,7 @@ export declare const ApplicationPromotionPlanSchema: import("typebox").TObject<{
|
|
|
128
128
|
configuration_id: import("typebox").TString;
|
|
129
129
|
created_at: import("typebox").TString;
|
|
130
130
|
bun_version: import("typebox").TString;
|
|
131
|
+
startup_timeout_seconds: import("typebox").TOptional<import("typebox").TInteger>;
|
|
131
132
|
targets: import("typebox").TArray<import("typebox").TObject<{
|
|
132
133
|
name: import("typebox").TString;
|
|
133
134
|
kind: import("typebox").TUnion<[import("typebox").TLiteral<"http">, import("typebox").TLiteral<"worker">]>;
|
|
@@ -162,6 +163,7 @@ export declare const ApplicationDeployRequestSchema: import("typebox").TObject<{
|
|
|
162
163
|
expected_configuration_id: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
163
164
|
configuration: import("typebox").TObject<{
|
|
164
165
|
bun_version: import("typebox").TString;
|
|
166
|
+
startup_timeout_seconds: import("typebox").TOptional<import("typebox").TInteger>;
|
|
165
167
|
targets: import("typebox").TArray<import("typebox").TObject<{
|
|
166
168
|
name: import("typebox").TString;
|
|
167
169
|
kind: import("typebox").TUnion<[import("typebox").TLiteral<"http">, import("typebox").TLiteral<"worker">]>;
|
|
@@ -69,6 +69,7 @@ export declare const APPLICATION_TOOL_SCHEMA: {
|
|
|
69
69
|
configuration_id: Type.TString;
|
|
70
70
|
created_at: Type.TString;
|
|
71
71
|
bun_version: Type.TString;
|
|
72
|
+
startup_timeout_seconds: Type.TOptional<Type.TInteger>;
|
|
72
73
|
targets: Type.TArray<Type.TObject<{
|
|
73
74
|
name: Type.TString;
|
|
74
75
|
kind: Type.TUnion<[Type.TLiteral<"http">, Type.TLiteral<"worker">]>;
|
|
@@ -48,5 +48,15 @@ export declare function createFrontendArchive(outputDirectory: string): Promise<
|
|
|
48
48
|
fileCount: number;
|
|
49
49
|
cleanup(): Promise<void>;
|
|
50
50
|
}>;
|
|
51
|
+
export declare function publishWorkspaceFrontend(http: HttpTransport, input: {
|
|
52
|
+
projectRef: string;
|
|
53
|
+
environment: string;
|
|
54
|
+
deploymentId: string;
|
|
55
|
+
root: string;
|
|
56
|
+
buildCommand: string;
|
|
57
|
+
skipBuild: boolean;
|
|
58
|
+
json: boolean;
|
|
59
|
+
environmentVariables: Readonly<Record<string, string>>;
|
|
60
|
+
}): Promise<ToolResponse>;
|
|
51
61
|
export declare function registerDeployTools(server: ToolServer, http: HttpTransport, options?: DeployToolOptions): void;
|
|
52
62
|
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { HttpTransport } from "../transports/http";
|
|
2
|
+
import type { WorkspaceDeliveryClient } from "./workspace-execute";
|
|
3
|
+
export interface WorkspaceHttp {
|
|
4
|
+
get(path: string): Promise<{
|
|
5
|
+
ok: boolean;
|
|
6
|
+
status: number;
|
|
7
|
+
data: unknown;
|
|
8
|
+
transportError?: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
post(path: string, body: unknown): Promise<{
|
|
11
|
+
ok: boolean;
|
|
12
|
+
status: number;
|
|
13
|
+
data: unknown;
|
|
14
|
+
transportError?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
postMultipart?(path: string, body: FormData): Promise<{
|
|
17
|
+
ok: boolean;
|
|
18
|
+
status: number;
|
|
19
|
+
data: unknown;
|
|
20
|
+
transportError?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
/** Calls the existing application release, transfer, and promotion routes. It does not invent success. */
|
|
24
|
+
export declare function createHttpWorkspaceDeliveryClient(http: WorkspaceHttp, build: WorkspaceDeliveryClient["build"]): WorkspaceDeliveryClient;
|
|
25
|
+
export declare function workspaceHttpFromTransport(http: HttpTransport): WorkspaceHttp;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { ToolResult } from "../tool-server";
|
|
2
|
+
export interface WorkspaceArtifact {
|
|
3
|
+
releaseId: string;
|
|
4
|
+
manifestSha256: string;
|
|
5
|
+
}
|
|
6
|
+
export type WorkspaceTargetStatus = "succeeded" | "failed" | "unknown" | "absent" | "accepted";
|
|
7
|
+
export interface WorkspaceTargetObservation {
|
|
8
|
+
project_ref: string;
|
|
9
|
+
application_id: string;
|
|
10
|
+
environment_id: string;
|
|
11
|
+
release_id: string | null;
|
|
12
|
+
manifest_sha256: string | null;
|
|
13
|
+
status: WorkspaceTargetStatus;
|
|
14
|
+
failure: string | null;
|
|
15
|
+
mutation_id: string | null;
|
|
16
|
+
authoritative: false;
|
|
17
|
+
}
|
|
18
|
+
export type ReleaseList = {
|
|
19
|
+
availability: "available";
|
|
20
|
+
releases: WorkspaceArtifact[];
|
|
21
|
+
} | {
|
|
22
|
+
availability: "unauthorized" | "unavailable";
|
|
23
|
+
};
|
|
24
|
+
export interface ReleaseOutcome {
|
|
25
|
+
mutationId: string;
|
|
26
|
+
status: WorkspaceTargetStatus;
|
|
27
|
+
releaseId: string | null;
|
|
28
|
+
manifestSha256: string | null;
|
|
29
|
+
}
|
|
30
|
+
export interface WorkspaceApprovalView {
|
|
31
|
+
availability: "available";
|
|
32
|
+
releaseId: string;
|
|
33
|
+
manifestSha256: string;
|
|
34
|
+
repository: string;
|
|
35
|
+
applicationId: string;
|
|
36
|
+
environmentId: string;
|
|
37
|
+
projectRef: string;
|
|
38
|
+
configDigest: string;
|
|
39
|
+
sourceRevision: string;
|
|
40
|
+
workspacePlanSha256: string;
|
|
41
|
+
}
|
|
42
|
+
export interface WorkspaceDeliveryClient {
|
|
43
|
+
build(input: {
|
|
44
|
+
workspaceRoot: string;
|
|
45
|
+
applicationId: string;
|
|
46
|
+
root: string;
|
|
47
|
+
sourceRevision: string;
|
|
48
|
+
configDigest: string;
|
|
49
|
+
}): Promise<{
|
|
50
|
+
manifestSha256: string;
|
|
51
|
+
manifestPath?: string;
|
|
52
|
+
}>;
|
|
53
|
+
listReleases(projectRef: string, applicationId: string): Promise<ReleaseList>;
|
|
54
|
+
upload(input: {
|
|
55
|
+
projectRef: string;
|
|
56
|
+
applicationId: string;
|
|
57
|
+
root: string;
|
|
58
|
+
manifestSha256: string;
|
|
59
|
+
}): Promise<WorkspaceArtifact>;
|
|
60
|
+
transfer(input: {
|
|
61
|
+
projectRef: string;
|
|
62
|
+
applicationId: string;
|
|
63
|
+
sourceProjectRef: string;
|
|
64
|
+
sourceReleaseId: string;
|
|
65
|
+
manifestSha256: string;
|
|
66
|
+
}): Promise<WorkspaceArtifact & {
|
|
67
|
+
replayed: boolean;
|
|
68
|
+
}>;
|
|
69
|
+
deploy(input: WorkspaceWrite): Promise<{
|
|
70
|
+
mutationId: string;
|
|
71
|
+
status: WorkspaceTargetStatus;
|
|
72
|
+
replayed: boolean;
|
|
73
|
+
}>;
|
|
74
|
+
readDeploy(input: {
|
|
75
|
+
projectRef: string;
|
|
76
|
+
applicationId: string;
|
|
77
|
+
environmentId: string;
|
|
78
|
+
mutationId: string;
|
|
79
|
+
operation: "activation" | "promotion";
|
|
80
|
+
}): Promise<ReleaseOutcome>;
|
|
81
|
+
reconcileDeploy(input: {
|
|
82
|
+
projectRef: string;
|
|
83
|
+
applicationId: string;
|
|
84
|
+
environmentId: string;
|
|
85
|
+
mutationId: string;
|
|
86
|
+
}): Promise<ReleaseOutcome>;
|
|
87
|
+
promote(input: WorkspacePromotion): Promise<{
|
|
88
|
+
mutationId: string;
|
|
89
|
+
status: WorkspaceTargetStatus;
|
|
90
|
+
replayed: boolean;
|
|
91
|
+
}>;
|
|
92
|
+
reconcilePromotion(input: {
|
|
93
|
+
projectRef: string;
|
|
94
|
+
applicationId: string;
|
|
95
|
+
environmentId: string;
|
|
96
|
+
mutationId: string;
|
|
97
|
+
}): Promise<ReleaseOutcome>;
|
|
98
|
+
readApproval(input: {
|
|
99
|
+
projectRef: string;
|
|
100
|
+
approvalId: string;
|
|
101
|
+
}): Promise<WorkspaceApprovalView | {
|
|
102
|
+
availability: "missing" | "unauthorized" | "unavailable";
|
|
103
|
+
}>;
|
|
104
|
+
observe(input: {
|
|
105
|
+
projectRef: string;
|
|
106
|
+
applicationId: string;
|
|
107
|
+
environmentId: string;
|
|
108
|
+
}): Promise<WorkspaceTargetObservation>;
|
|
109
|
+
}
|
|
110
|
+
export interface WorkspaceWrite {
|
|
111
|
+
projectRef: string;
|
|
112
|
+
applicationId: string;
|
|
113
|
+
environmentId: string;
|
|
114
|
+
releaseId: string;
|
|
115
|
+
manifestSha256: string;
|
|
116
|
+
mutationId: string;
|
|
117
|
+
approvalId: string | null;
|
|
118
|
+
repository: string;
|
|
119
|
+
configDigest: string;
|
|
120
|
+
sourceRevision: string;
|
|
121
|
+
workspacePlanSha256: string;
|
|
122
|
+
configurationId: string | null;
|
|
123
|
+
activationId: string | null;
|
|
124
|
+
expectedActivationId: string | null;
|
|
125
|
+
}
|
|
126
|
+
export interface WorkspacePromotion extends WorkspaceWrite {
|
|
127
|
+
sourceProjectRef: string;
|
|
128
|
+
sourceEnvironmentId: string;
|
|
129
|
+
sourceReleaseId: string;
|
|
130
|
+
}
|
|
131
|
+
export interface WorkspaceExecutionResult {
|
|
132
|
+
schema: "supacloud.workspace-execution.v1";
|
|
133
|
+
operation: "execute" | "retry" | "promote" | "rollback" | "reconcile" | "status";
|
|
134
|
+
status: "ready" | "unchanged" | "blocked" | "completed" | "accepted" | "failed" | "unknown";
|
|
135
|
+
execution_performed: boolean;
|
|
136
|
+
plan_sha256: string | null;
|
|
137
|
+
config_digest: string | null;
|
|
138
|
+
source_revision: string | null;
|
|
139
|
+
repository: string | null;
|
|
140
|
+
builds: Array<{
|
|
141
|
+
application_id: string;
|
|
142
|
+
manifest_sha256: string;
|
|
143
|
+
count: number;
|
|
144
|
+
}>;
|
|
145
|
+
targets: Array<{
|
|
146
|
+
application_id: string;
|
|
147
|
+
environment_id: string;
|
|
148
|
+
project_ref: string;
|
|
149
|
+
release_id: string | null;
|
|
150
|
+
mutation_id: string | null;
|
|
151
|
+
status: WorkspaceTargetStatus | "skipped";
|
|
152
|
+
reused_build: boolean;
|
|
153
|
+
failure: string | null;
|
|
154
|
+
}>;
|
|
155
|
+
observations: WorkspaceTargetObservation[];
|
|
156
|
+
diagnostics: Array<{
|
|
157
|
+
code: string;
|
|
158
|
+
message: string;
|
|
159
|
+
}>;
|
|
160
|
+
}
|
|
161
|
+
export declare function workspaceMutationId(parts: readonly string[]): string;
|
|
162
|
+
export declare function executeWorkspace(input: {
|
|
163
|
+
root: string;
|
|
164
|
+
operation: WorkspaceExecutionResult["operation"];
|
|
165
|
+
environment: string;
|
|
166
|
+
changedFiles: readonly string[];
|
|
167
|
+
execute: boolean;
|
|
168
|
+
planSha256?: string;
|
|
169
|
+
sourceRevision?: string;
|
|
170
|
+
headRevision?: string;
|
|
171
|
+
approvalId?: string;
|
|
172
|
+
mutationId?: string;
|
|
173
|
+
releaseId?: string;
|
|
174
|
+
configurationId?: string;
|
|
175
|
+
activationId?: string;
|
|
176
|
+
expectedActivationId?: string | null;
|
|
177
|
+
sourceEnvironment?: string;
|
|
178
|
+
applicationId?: string;
|
|
179
|
+
configDigest: string;
|
|
180
|
+
client: WorkspaceDeliveryClient;
|
|
181
|
+
}): Promise<WorkspaceExecutionResult>;
|
|
182
|
+
export declare function runWorkspaceCommand(args: Record<string, unknown>, cwd?: string, client?: WorkspaceDeliveryClient): Promise<ToolResult>;
|
|
183
|
+
export declare function formatWorkspaceExecution(result: WorkspaceExecutionResult): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { ToolSchema } from "../schema";
|
|
2
|
+
import { type ToolResult, type ToolServer } from "../tool-server";
|
|
3
|
+
export declare const WORKSPACE_CONFIG_FILE = "supacloud.workspace.json";
|
|
4
|
+
export declare const WORKSPACE_CONFIG_SCHEMA = "supacloud.workspace.v1";
|
|
5
|
+
export declare const WORKSPACE_PLAN_SCHEMA = "supacloud.workspace-plan.v1";
|
|
6
|
+
export declare const WORKSPACE_PLAN_LIMITS: Readonly<{
|
|
7
|
+
applications: 32;
|
|
8
|
+
sharedPaths: 32;
|
|
9
|
+
packages: 128;
|
|
10
|
+
changedFiles: 4096;
|
|
11
|
+
configBytes: number;
|
|
12
|
+
directories: 2000;
|
|
13
|
+
depth: 8;
|
|
14
|
+
}>;
|
|
15
|
+
export declare class WorkspacePlanError extends Error {
|
|
16
|
+
readonly code: string;
|
|
17
|
+
constructor(code: string, message: string);
|
|
18
|
+
}
|
|
19
|
+
export type WorkspaceBinding = {
|
|
20
|
+
project_ref: string;
|
|
21
|
+
application_id: string;
|
|
22
|
+
} | {
|
|
23
|
+
project_ref: string;
|
|
24
|
+
frontend_deployment_id: string;
|
|
25
|
+
};
|
|
26
|
+
export interface WorkspacePlanTask {
|
|
27
|
+
kind: "build" | "deploy";
|
|
28
|
+
status: "planned";
|
|
29
|
+
executed: false;
|
|
30
|
+
command: string | null;
|
|
31
|
+
}
|
|
32
|
+
export interface WorkspacePlanApplication {
|
|
33
|
+
id: string;
|
|
34
|
+
root: string;
|
|
35
|
+
impact: "affected" | "unaffected" | "unknown";
|
|
36
|
+
reasons: string[];
|
|
37
|
+
configured_binding: WorkspaceBinding | null;
|
|
38
|
+
target: WorkspaceBinding | null;
|
|
39
|
+
tasks: WorkspacePlanTask[];
|
|
40
|
+
}
|
|
41
|
+
export interface WorkspacePlanUnresolved {
|
|
42
|
+
code: string;
|
|
43
|
+
path: string | null;
|
|
44
|
+
package: string | null;
|
|
45
|
+
specifier: string | null;
|
|
46
|
+
possible_dependents: string[];
|
|
47
|
+
reason: string;
|
|
48
|
+
}
|
|
49
|
+
export interface WorkspacePlanDiagnostic {
|
|
50
|
+
code: string;
|
|
51
|
+
severity: "error";
|
|
52
|
+
application_id: string | null;
|
|
53
|
+
message: string;
|
|
54
|
+
}
|
|
55
|
+
export interface WorkspacePlan {
|
|
56
|
+
schema: typeof WORKSPACE_PLAN_SCHEMA;
|
|
57
|
+
status: "ready" | "unchanged" | "no-impact" | "blocked";
|
|
58
|
+
executable: false;
|
|
59
|
+
effects: "none";
|
|
60
|
+
environment: string | null;
|
|
61
|
+
config_file: typeof WORKSPACE_CONFIG_FILE;
|
|
62
|
+
config_schema: typeof WORKSPACE_CONFIG_SCHEMA;
|
|
63
|
+
completeness: "manifest-dependency-closure";
|
|
64
|
+
deployment_verified: false;
|
|
65
|
+
changed_files: string[];
|
|
66
|
+
execution: {
|
|
67
|
+
mode: "plan-only";
|
|
68
|
+
executes_build: false;
|
|
69
|
+
executes_deploy: false;
|
|
70
|
+
writes_remote_state: false;
|
|
71
|
+
push_webhook: "not-registered";
|
|
72
|
+
deploy_time_enforcement: false;
|
|
73
|
+
};
|
|
74
|
+
repository: string | null;
|
|
75
|
+
applications: WorkspacePlanApplication[];
|
|
76
|
+
unresolved: WorkspacePlanUnresolved[];
|
|
77
|
+
diagnostics: WorkspacePlanDiagnostic[];
|
|
78
|
+
limits: typeof WORKSPACE_PLAN_LIMITS;
|
|
79
|
+
plan_sha256: string;
|
|
80
|
+
}
|
|
81
|
+
export declare const workspaceToolSchema: ToolSchema;
|
|
82
|
+
/** Checked-out commit. This does not accept a caller-supplied revision as its own proof. */
|
|
83
|
+
export declare function readWorkspaceHead(root: string): Promise<string>;
|
|
84
|
+
export declare function workspaceCheckoutClean(root: string): Promise<boolean>;
|
|
85
|
+
export declare function workspaceTracksFile(root: string, path: string): Promise<boolean>;
|
|
86
|
+
/** Read a changed-path list only when it is a regular file inside the workspace. */
|
|
87
|
+
export declare function readWorkspaceChangedList(root: string, changed: string): Promise<string[]>;
|
|
88
|
+
/** Same rename/delete input rule as scripts/workspace: both sides are visible, and a missing baseline is explicit. */
|
|
89
|
+
export declare function collectGitChanges(root: string, base: string, head?: string): Promise<{
|
|
90
|
+
files: string[];
|
|
91
|
+
fallback: string | null;
|
|
92
|
+
}>;
|
|
93
|
+
export declare function createWorkspacePlan(input: {
|
|
94
|
+
root: string;
|
|
95
|
+
environment: string;
|
|
96
|
+
changedFiles: readonly string[];
|
|
97
|
+
fallbackReason?: string | null;
|
|
98
|
+
}): Promise<WorkspacePlan>;
|
|
99
|
+
export declare function formatWorkspacePlan(plan: WorkspacePlan): string;
|
|
100
|
+
export declare function runWorkspacePlan(args: Record<string, unknown>, cwd?: string): Promise<ToolResult>;
|
|
101
|
+
export declare function registerWorkspaceTools(server: ToolServer, options?: {
|
|
102
|
+
cwd?: string;
|
|
103
|
+
getHttp?: () => import("../transports/http").HttpTransport | null;
|
|
104
|
+
context?: Pick<import("../context").ResolvedContext, "projectRef" | "environment" | "environmentVariables">;
|
|
105
|
+
}): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ResolvedContext } from "../context";
|
|
2
|
+
import type { ToolResult } from "../tool-server";
|
|
3
|
+
import type { HttpTransport } from "../transports/http";
|
|
4
|
+
export declare function runWorkspacePublish(args: Record<string, unknown>, cwd: string, http: HttpTransport | null, context?: Pick<ResolvedContext, "projectRef" | "environment" | "environmentVariables">): Promise<ToolResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.126.0",
|
|
4
4
|
"description": "Project-scoped CLI for SupaCloud users",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,24 +52,24 @@
|
|
|
52
52
|
"directory": "packages/cli"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@supacloud/compiler": "^0.
|
|
56
|
-
"@supacloud/delivery": "0.
|
|
57
|
-
"@supacloud/db": "0.25.
|
|
55
|
+
"@supacloud/compiler": "^0.63.0",
|
|
56
|
+
"@supacloud/delivery": "0.30.0",
|
|
57
|
+
"@supacloud/db": "0.25.2",
|
|
58
58
|
"typebox": "1.4.3"
|
|
59
59
|
},
|
|
60
60
|
"overrides": {
|
|
61
|
-
"@supacloud/contracts": "0.16.
|
|
62
|
-
"@supacloud/delivery": "0.
|
|
61
|
+
"@supacloud/contracts": "0.16.3",
|
|
62
|
+
"@supacloud/delivery": "0.30.0",
|
|
63
63
|
"@graphql-tools/utils": "^12.0.4",
|
|
64
|
-
"@supacloud/compiler": "^0.
|
|
65
|
-
"@supacloud/db": "0.25.
|
|
64
|
+
"@supacloud/compiler": "^0.63.0",
|
|
65
|
+
"@supacloud/db": "0.25.2",
|
|
66
66
|
"deepmerge-ts": "8.0.2",
|
|
67
67
|
"prisma": "6.19.3"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@supabase/supabase-js": "2.118.0",
|
|
71
|
-
"@supacloud/elysia": "0.42.
|
|
72
|
-
"@types/bun": "^1.4.
|
|
71
|
+
"@supacloud/elysia": "0.42.6",
|
|
72
|
+
"@types/bun": "^1.4.5",
|
|
73
73
|
"effect": "4.0.5",
|
|
74
74
|
"elysia": "2.0.0-rc.4",
|
|
75
75
|
"typescript": "7.1.0-beta"
|