@supacloud/cli 0.123.2 → 0.124.1

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.
@@ -0,0 +1,5 @@
1
+ import type { HttpTransport } from "../transports/http";
2
+ import { type ReleaseControlToolResponse } from "./release-control-response";
3
+ export declare function deployFunctionManifest(http: HttpTransport, args: Record<string, unknown>, options?: {
4
+ readOnly?: boolean;
5
+ }): Promise<ReleaseControlToolResponse>;
@@ -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,99 @@
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 interface WorkspaceBinding {
20
+ project_ref: string;
21
+ application_id: string;
22
+ }
23
+ export interface WorkspacePlanTask {
24
+ kind: "build" | "deploy";
25
+ status: "planned";
26
+ executed: false;
27
+ command: string | null;
28
+ }
29
+ export interface WorkspacePlanApplication {
30
+ id: string;
31
+ root: string;
32
+ impact: "affected" | "unaffected" | "unknown";
33
+ reasons: string[];
34
+ configured_binding: WorkspaceBinding | null;
35
+ target: WorkspaceBinding | null;
36
+ tasks: WorkspacePlanTask[];
37
+ }
38
+ export interface WorkspacePlanUnresolved {
39
+ code: string;
40
+ path: string | null;
41
+ package: string | null;
42
+ specifier: string | null;
43
+ possible_dependents: string[];
44
+ reason: string;
45
+ }
46
+ export interface WorkspacePlanDiagnostic {
47
+ code: string;
48
+ severity: "error";
49
+ application_id: string | null;
50
+ message: string;
51
+ }
52
+ export interface WorkspacePlan {
53
+ schema: typeof WORKSPACE_PLAN_SCHEMA;
54
+ status: "ready" | "unchanged" | "no-impact" | "blocked";
55
+ executable: false;
56
+ effects: "none";
57
+ environment: string | null;
58
+ config_file: typeof WORKSPACE_CONFIG_FILE;
59
+ config_schema: typeof WORKSPACE_CONFIG_SCHEMA;
60
+ completeness: "manifest-dependency-closure";
61
+ deployment_verified: false;
62
+ changed_files: string[];
63
+ execution: {
64
+ mode: "plan-only";
65
+ executes_build: false;
66
+ executes_deploy: false;
67
+ writes_remote_state: false;
68
+ push_webhook: "not-registered";
69
+ deploy_time_enforcement: false;
70
+ };
71
+ repository: string | null;
72
+ applications: WorkspacePlanApplication[];
73
+ unresolved: WorkspacePlanUnresolved[];
74
+ diagnostics: WorkspacePlanDiagnostic[];
75
+ limits: typeof WORKSPACE_PLAN_LIMITS;
76
+ plan_sha256: string;
77
+ }
78
+ export declare const workspaceToolSchema: ToolSchema;
79
+ /** Checked-out commit. This does not accept a caller-supplied revision as its own proof. */
80
+ export declare function readWorkspaceHead(root: string): Promise<string>;
81
+ /** Read a changed-path list only when it is a regular file inside the workspace. */
82
+ export declare function readWorkspaceChangedList(root: string, changed: string): Promise<string[]>;
83
+ /** Same rename/delete input rule as scripts/workspace: both sides are visible, and a missing baseline is explicit. */
84
+ export declare function collectGitChanges(root: string, base: string, head?: string): Promise<{
85
+ files: string[];
86
+ fallback: string | null;
87
+ }>;
88
+ export declare function createWorkspacePlan(input: {
89
+ root: string;
90
+ environment: string;
91
+ changedFiles: readonly string[];
92
+ fallbackReason?: string | null;
93
+ }): Promise<WorkspacePlan>;
94
+ export declare function formatWorkspacePlan(plan: WorkspacePlan): string;
95
+ export declare function runWorkspacePlan(args: Record<string, unknown>, cwd?: string): Promise<ToolResult>;
96
+ export declare function registerWorkspaceTools(server: ToolServer, options?: {
97
+ cwd?: string;
98
+ getHttp?: () => import("../transports/http").HttpTransport | null;
99
+ }): void;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/cli",
3
- "version": "0.123.2",
3
+ "version": "0.124.1",
4
4
  "description": "Project-scoped CLI for SupaCloud users",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -52,7 +52,7 @@
52
52
  "directory": "packages/cli"
53
53
  },
54
54
  "dependencies": {
55
- "@supacloud/compiler": "^0.62.7",
55
+ "@supacloud/compiler": "^0.62.8",
56
56
  "@supacloud/delivery": "0.28.0",
57
57
  "@supacloud/db": "0.25.1",
58
58
  "typebox": "1.4.3"
@@ -61,7 +61,7 @@
61
61
  "@supacloud/contracts": "0.16.2",
62
62
  "@supacloud/delivery": "0.28.0",
63
63
  "@graphql-tools/utils": "^12.0.4",
64
- "@supacloud/compiler": "^0.62.7",
64
+ "@supacloud/compiler": "^0.62.8",
65
65
  "@supacloud/db": "0.25.1",
66
66
  "deepmerge-ts": "8.0.2",
67
67
  "prisma": "6.19.3"