@supacloud/cli 0.75.1 → 0.77.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 +24 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18766 -73279
- package/dist/index.test.d.ts +1 -0
- package/dist/migration-inventory.integration.test.d.ts +1 -0
- package/dist/project-read-process.test.d.ts +1 -0
- package/dist/shared/cli.d.ts +18 -0
- package/dist/shared/context.d.ts +26 -0
- package/dist/shared/context.test.d.ts +1 -0
- package/dist/shared/execution-policy.d.ts +14 -0
- package/dist/shared/execution-policy.test.d.ts +1 -0
- package/dist/shared/global-options.d.ts +8 -0
- package/dist/shared/global-options.test.d.ts +1 -0
- package/dist/shared/mutation-protocol.d.ts +45 -0
- package/dist/shared/mutation-protocol.test.d.ts +1 -0
- package/dist/shared/outcome-guidance.d.ts +1 -0
- package/dist/shared/project-ref.d.ts +1 -0
- package/dist/shared/schema.d.ts +13 -0
- package/dist/shared/schema.test.d.ts +1 -0
- package/dist/shared/tool-server.d.ts +15 -0
- package/dist/shared/tool-server.test.d.ts +1 -0
- package/dist/shared/tools/advanced-tools.d.ts +5 -0
- package/dist/shared/tools/advanced-tools.test.d.ts +1 -0
- package/dist/shared/tools/ai-tools.d.ts +28 -0
- package/dist/shared/tools/ai-tools.test.d.ts +1 -0
- package/dist/shared/tools/app-database-check.d.ts +7 -0
- package/dist/shared/tools/app-database-check.test.d.ts +1 -0
- package/dist/shared/tools/app-delivery.test.d.ts +1 -0
- package/dist/shared/tools/app-dev-regressions.test.d.ts +1 -0
- package/dist/shared/tools/app-dev.test.d.ts +1 -0
- package/dist/shared/tools/app-local-dev.d.ts +15 -0
- package/dist/shared/tools/app-local-dev.test.d.ts +1 -0
- package/dist/shared/tools/app-minimal-starter.test.d.ts +1 -0
- package/dist/shared/tools/app-resource-generation.test.d.ts +1 -0
- package/dist/shared/tools/app-resource.d.ts +5 -0
- package/dist/shared/tools/app-scaffold-writes.d.ts +33 -0
- package/dist/shared/tools/app-scaffold-writes.test.d.ts +1 -0
- package/dist/shared/tools/app-starter-attachment-worker.d.ts +2 -0
- package/dist/shared/tools/app-starter-attachments.d.ts +2 -0
- package/dist/shared/tools/app-starter-composition.test.d.ts +1 -0
- package/dist/shared/tools/app-starter-database.d.ts +14 -0
- package/dist/shared/tools/app-starter-environment.d.ts +2 -0
- package/dist/shared/tools/app-starter-postgres.d.ts +4 -0
- package/dist/shared/tools/app-starter-reactive.d.ts +4 -0
- package/dist/shared/tools/app-starter-reactive.test.d.ts +1 -0
- package/dist/shared/tools/app-starter-review-job.d.ts +2 -0
- package/dist/shared/tools/app-starter-roles.d.ts +2 -0
- package/dist/shared/tools/app-starter-roles.test.d.ts +1 -0
- package/dist/shared/tools/app-starter-templates.d.ts +7 -0
- package/dist/shared/tools/app-starter-upload.d.ts +3 -0
- package/dist/shared/tools/app-starter.d.ts +12 -0
- package/dist/shared/tools/app-starter.test.d.ts +1 -0
- package/dist/shared/tools/app-tool-export.d.ts +42 -0
- package/dist/shared/tools/app-tools.d.ts +93 -0
- package/dist/shared/tools/app-tools.test.d.ts +1 -0
- package/dist/shared/tools/app-verification-plan.d.ts +14 -0
- package/dist/shared/tools/app-verification-plan.test.d.ts +1 -0
- package/dist/shared/tools/application-schemas.d.ts +75 -0
- package/dist/shared/tools/application-tools.d.ts +23 -0
- package/dist/shared/tools/application-tools.test.d.ts +1 -0
- package/dist/shared/tools/auth-tools.d.ts +3 -0
- package/dist/shared/tools/auth-tools.test.d.ts +1 -0
- package/dist/shared/tools/branch-tools.d.ts +6 -0
- package/dist/shared/tools/branch-tools.test.d.ts +1 -0
- package/dist/shared/tools/database-tools.d.ts +13 -0
- package/dist/shared/tools/database-tools.test.d.ts +1 -0
- package/dist/shared/tools/db-governance-tools.d.ts +80 -0
- package/dist/shared/tools/db-governance-tools.test.d.ts +1 -0
- package/dist/shared/tools/db-workflow.d.ts +37 -0
- package/dist/shared/tools/db-workflow.test.d.ts +1 -0
- package/dist/shared/tools/deploy-tools.d.ts +36 -0
- package/dist/shared/tools/deploy-tools.test.d.ts +1 -0
- package/dist/shared/tools/edge-function-response.d.ts +55 -0
- package/dist/shared/tools/edge-function-response.test.d.ts +1 -0
- package/dist/shared/tools/frontend-release-control.d.ts +54 -0
- package/dist/shared/tools/frontend-release-control.test.d.ts +1 -0
- package/dist/shared/tools/frontend-tools.d.ts +3 -0
- package/dist/shared/tools/gateway-tools.d.ts +6 -0
- package/dist/shared/tools/gateway-tools.test.d.ts +1 -0
- package/dist/shared/tools/lite-cli-command.d.ts +2 -0
- package/dist/shared/tools/lite-cli-tools.d.ts +46 -0
- package/dist/shared/tools/lite-cli-tools.test.d.ts +1 -0
- package/dist/shared/tools/migration-import.d.ts +22 -0
- package/dist/shared/tools/migration-import.test.d.ts +1 -0
- package/dist/shared/tools/migration-risk.d.ts +36 -0
- package/dist/shared/tools/migration-risk.test.d.ts +1 -0
- package/dist/shared/tools/mutation-tools.d.ts +3 -0
- package/dist/shared/tools/mutation-tools.test.d.ts +1 -0
- package/dist/shared/tools/oauth-client-tools.d.ts +3 -0
- package/dist/shared/tools/oauth-client-tools.test.d.ts +1 -0
- package/dist/shared/tools/project-cli-tools.d.ts +6 -0
- package/dist/shared/tools/project-cli-tools.test.d.ts +1 -0
- package/dist/shared/tools/project-endpoint-read.d.ts +10 -0
- package/dist/shared/tools/project-endpoint-tools.test.d.ts +1 -0
- package/dist/shared/tools/project-read-projection.d.ts +8 -0
- package/dist/shared/tools/project-read-projection.test.d.ts +1 -0
- package/dist/shared/tools/queue-tools.d.ts +6 -0
- package/dist/shared/tools/queue-tools.test.d.ts +1 -0
- package/dist/shared/tools/release-control-response.d.ts +12 -0
- package/dist/shared/tools/release-control-response.test.d.ts +1 -0
- package/dist/shared/tools/release-tools.d.ts +8 -0
- package/dist/shared/tools/release-tools.test.d.ts +1 -0
- package/dist/shared/tools/remote-dev-tools.d.ts +41 -0
- package/dist/shared/tools/remote-dev-tools.test.d.ts +1 -0
- package/dist/shared/tools/scheduled-function-tools.d.ts +7 -0
- package/dist/shared/tools/scheduled-function-tools.test.d.ts +1 -0
- package/dist/shared/tools/storage-tools.d.ts +3 -0
- package/dist/shared/tools/storage-tools.test.d.ts +1 -0
- package/dist/shared/tools/supabase-cli-tools.d.ts +49 -0
- package/dist/shared/tools/supabase-cli-tools.test.d.ts +1 -0
- package/dist/shared/transports/http.d.ts +64 -0
- package/dist/shared/transports/http.test.d.ts +1 -0
- package/dist/supabase-cli.integration.test.d.ts +1 -0
- package/dist/test-helpers.d.ts +1 -0
- package/dist/tool-runtime.d.ts +2 -0
- package/dist/tool-runtime.js +154 -0
- package/dist/tool-runtime.test.d.ts +1 -0
- package/package.json +19 -4
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type ToolServer } from "../tool-server";
|
|
2
|
+
import { type AppManifest } from "./app-tool-export";
|
|
3
|
+
declare const REMOTE_APP_ACTIONS: {
|
|
4
|
+
readonly upload: "upload_release";
|
|
5
|
+
readonly configure: "put_configuration";
|
|
6
|
+
readonly deploy: "activate_release";
|
|
7
|
+
readonly status: "get_runtime";
|
|
8
|
+
readonly rollback: "activate_release";
|
|
9
|
+
readonly reconcile: "reconcile_activation";
|
|
10
|
+
readonly retire: "retire_activation";
|
|
11
|
+
readonly logs: "logs";
|
|
12
|
+
};
|
|
13
|
+
export interface AppToolOptions {
|
|
14
|
+
getApplications?: () => ((args: Record<string, unknown>) => Promise<ToolResult>) | undefined;
|
|
15
|
+
projectRef?: string;
|
|
16
|
+
/** Abort signal for long-running local actions (`app dev` watch), used for cancellation and tests. */
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
/** Watch progress only. The caller owns its transport; the final result is returned separately. */
|
|
19
|
+
onDevProgress?: (result: ToolResult) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface AppToolArguments {
|
|
22
|
+
action: "init" | "generate" | "dev" | "watch" | "verify-plan" | "compile" | "check" | "graph" | "explain" | "export-tools" | "context" | "doctor" | "fix" | "plan" | "build" | keyof typeof REMOTE_APP_ACTIONS;
|
|
23
|
+
ref?: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
environment_id?: string;
|
|
26
|
+
configuration_id?: string;
|
|
27
|
+
activation_id?: string;
|
|
28
|
+
expected_activation_id?: string | null;
|
|
29
|
+
configuration_path?: string;
|
|
30
|
+
manifest_path?: string;
|
|
31
|
+
release_id?: string;
|
|
32
|
+
kind?: "module" | "command" | "query" | "controller" | "job" | "contract" | "resource";
|
|
33
|
+
template?: "minimal" | "http" | "command" | "edge";
|
|
34
|
+
name?: string;
|
|
35
|
+
module?: string;
|
|
36
|
+
dir?: string;
|
|
37
|
+
force?: boolean;
|
|
38
|
+
dry_run?: boolean;
|
|
39
|
+
register_in?: string;
|
|
40
|
+
"dry-run"?: boolean;
|
|
41
|
+
"register-in"?: string;
|
|
42
|
+
root?: string;
|
|
43
|
+
include?: string;
|
|
44
|
+
out_dir?: string;
|
|
45
|
+
strict?: boolean;
|
|
46
|
+
format?: "text" | "json";
|
|
47
|
+
target?: string;
|
|
48
|
+
fix?: string;
|
|
49
|
+
write?: boolean;
|
|
50
|
+
/** `app dev` local profile. `fast` is local/ephemeral; `integration` requires an explicit database URL. */
|
|
51
|
+
profile?: "fast" | "integration";
|
|
52
|
+
/** `app dev`: validate and report once without watching. */
|
|
53
|
+
once?: boolean;
|
|
54
|
+
/** `app dev`: watch for changes (default true; `--once` disables). */
|
|
55
|
+
watch?: boolean;
|
|
56
|
+
/** Integration dev verifies an explicit loopback database before running dev:integration. */
|
|
57
|
+
database_url?: string;
|
|
58
|
+
"database-url"?: string;
|
|
59
|
+
offset?: number;
|
|
60
|
+
service?: string;
|
|
61
|
+
search?: string;
|
|
62
|
+
start?: string;
|
|
63
|
+
end?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface ToolResult {
|
|
66
|
+
isError?: boolean;
|
|
67
|
+
content: Array<{
|
|
68
|
+
type: "text";
|
|
69
|
+
text: string;
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
72
|
+
/** kebab/snake/space-separated name -> PascalCase (class name for generate). */
|
|
73
|
+
declare function pascalName(name: string): string;
|
|
74
|
+
/** kebab-case -> camelCase (semantic name suffix for command/query). */
|
|
75
|
+
declare function camelName(name: string): string;
|
|
76
|
+
declare function formatGraphText(manifest: AppManifest): string;
|
|
77
|
+
/** token -> dependent provider/controller module and name (reverse index). */
|
|
78
|
+
declare function reverseDependencies(manifest: AppManifest, token: string): string[];
|
|
79
|
+
export declare function runAppTool(request: AppToolArguments, options?: AppToolOptions): Promise<ToolResult>;
|
|
80
|
+
export declare function registerAppTools(server: ToolServer, options?: AppToolOptions): void;
|
|
81
|
+
/**
|
|
82
|
+
* Promotes the single-entry development verbs to top-level commands so an AI or
|
|
83
|
+
* developer does not need to remember the `app` namespace. The `app` tool and
|
|
84
|
+
* these aliases share one implementation and one execution-policy classification.
|
|
85
|
+
*/
|
|
86
|
+
export declare function registerAppAliases(server: ToolServer): void;
|
|
87
|
+
export declare const __internal: {
|
|
88
|
+
pascalName: typeof pascalName;
|
|
89
|
+
camelName: typeof camelName;
|
|
90
|
+
formatGraphText: typeof formatGraphText;
|
|
91
|
+
reverseDependencies: typeof reverseDependencies;
|
|
92
|
+
};
|
|
93
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ApplicationGraph } from "@supacloud/compiler";
|
|
2
|
+
/** Read only the selected owner's immediate source directories, never the whole repository. */
|
|
3
|
+
export declare function createVerificationPlan(root: string, graph: ApplicationGraph, target: string, sourceRoot?: string): Promise<{
|
|
4
|
+
version: number;
|
|
5
|
+
source: string;
|
|
6
|
+
target: string;
|
|
7
|
+
ready: boolean;
|
|
8
|
+
files: string[];
|
|
9
|
+
tests: string[];
|
|
10
|
+
commands: string[][];
|
|
11
|
+
manual: string[];
|
|
12
|
+
releaseOnly: string[];
|
|
13
|
+
executed: boolean;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export declare const ApplicationIdSchema: import("typebox").TString;
|
|
2
|
+
export declare const ApplicationReleaseIdSchema: import("typebox").TString;
|
|
3
|
+
export declare const ApplicationReleaseRecordSchema: import("typebox").TObject<{
|
|
4
|
+
schema: import("typebox").TLiteral<"supacloud.application-release.v1">;
|
|
5
|
+
project_ref: import("typebox").TString;
|
|
6
|
+
application_id: import("typebox").TString;
|
|
7
|
+
release_id: import("typebox").TString;
|
|
8
|
+
manifest_sha256: import("typebox").TString;
|
|
9
|
+
created_at: import("typebox").TString;
|
|
10
|
+
targets: import("typebox").TArray<import("typebox").TObject<{
|
|
11
|
+
name: import("typebox").TString;
|
|
12
|
+
object_id: import("typebox").TString;
|
|
13
|
+
kind: import("typebox").TUnion<[import("typebox").TLiteral<"http">, import("typebox").TLiteral<"worker">]>;
|
|
14
|
+
entrypoint: import("typebox").TLiteral<"bundle/index.js">;
|
|
15
|
+
execution: import("typebox").TOptional<import("typebox").TObject<{
|
|
16
|
+
name: import("typebox").TString;
|
|
17
|
+
target: import("typebox").TString;
|
|
18
|
+
workloadClass: import("typebox").TUnion<[import("typebox").TLiteral<"interactive">, import("typebox").TLiteral<"batch">]>;
|
|
19
|
+
executor: import("typebox").TLiteral<"pgflow-queue">;
|
|
20
|
+
runtime: import("typebox").TLiteral<"bun">;
|
|
21
|
+
queue: import("typebox").TString;
|
|
22
|
+
taskKey: import("typebox").TString;
|
|
23
|
+
definitionVersion: import("typebox").TString;
|
|
24
|
+
replicas: import("typebox").TInteger;
|
|
25
|
+
maxReplicas: import("typebox").TInteger;
|
|
26
|
+
concurrencyPerReplica: import("typebox").TInteger;
|
|
27
|
+
resources: import("typebox").TObject<{
|
|
28
|
+
cpuLimit: import("typebox").TNumber;
|
|
29
|
+
memoryLimitMiB: import("typebox").TInteger;
|
|
30
|
+
}>;
|
|
31
|
+
database: import("typebox").TObject<{
|
|
32
|
+
engineConnectionsPerReplica: import("typebox").TInteger;
|
|
33
|
+
handlerConnectionsPerReplica: import("typebox").TInteger;
|
|
34
|
+
}>;
|
|
35
|
+
lifecycle: import("typebox").TObject<{
|
|
36
|
+
executionTimeoutSeconds: import("typebox").TInteger;
|
|
37
|
+
visibilityTimeoutSeconds: import("typebox").TInteger;
|
|
38
|
+
shutdownGraceSeconds: import("typebox").TInteger;
|
|
39
|
+
}>;
|
|
40
|
+
retry: import("typebox").TObject<{
|
|
41
|
+
maxAttempts: import("typebox").TInteger;
|
|
42
|
+
}>;
|
|
43
|
+
admission: import("typebox").TObject<{
|
|
44
|
+
maxOutstandingOperations: import("typebox").TInteger;
|
|
45
|
+
}>;
|
|
46
|
+
}>>;
|
|
47
|
+
compute: import("typebox").TOptional<import("typebox").TObject<{
|
|
48
|
+
cpuLimit: import("typebox").TNumber;
|
|
49
|
+
memoryLimitMiB: import("typebox").TInteger;
|
|
50
|
+
}>>;
|
|
51
|
+
}>>;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const ApplicationConfigurationIdSchema: import("typebox").TString;
|
|
54
|
+
export declare const ApplicationActivationIdSchema: import("typebox").TString;
|
|
55
|
+
export declare const ApplicationActivationWriteSchema: import("typebox").TObject<{
|
|
56
|
+
activation_id: import("typebox").TString;
|
|
57
|
+
release_id: import("typebox").TString;
|
|
58
|
+
configuration_id: import("typebox").TString;
|
|
59
|
+
expected_activation_id: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const ApplicationActivationResultSchema: import("typebox").TObject<{
|
|
62
|
+
project_ref: import("typebox").TString;
|
|
63
|
+
application_id: import("typebox").TString;
|
|
64
|
+
environment_id: import("typebox").TString;
|
|
65
|
+
release_id: import("typebox").TString;
|
|
66
|
+
activation_id: import("typebox").TString;
|
|
67
|
+
replayed: import("typebox").TBoolean;
|
|
68
|
+
}>;
|
|
69
|
+
export declare const ApplicationActivationRetirementResultSchema: import("typebox").TObject<{
|
|
70
|
+
project_ref: import("typebox").TString;
|
|
71
|
+
application_id: import("typebox").TString;
|
|
72
|
+
environment_id: import("typebox").TString;
|
|
73
|
+
activation_id: import("typebox").TString;
|
|
74
|
+
retired_at: import("typebox").TString;
|
|
75
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
import type { HttpTransport } from "../transports/http";
|
|
3
|
+
import { type ToolServer } from "../tool-server";
|
|
4
|
+
export declare const APPLICATION_TOOL_SCHEMA: {
|
|
5
|
+
action: Type.TEnum<("list_releases" | "get_release" | "upload_release" | "activate_release" | "logs" | "get_runtime" | "get_deployment_evidence" | "get_configuration" | "put_configuration" | "reconcile_activation" | "retire_activation")[]>;
|
|
6
|
+
ref: Type.TString;
|
|
7
|
+
id: Type.TString;
|
|
8
|
+
environment_id: Type.TOptional<Type.TString>;
|
|
9
|
+
configuration_id: Type.TOptional<Type.TString>;
|
|
10
|
+
activation_id: Type.TOptional<Type.TString>;
|
|
11
|
+
expected_activation_id: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull, Type.TLiteral<"absent">]>>;
|
|
12
|
+
configuration_path: Type.TOptional<Type.TString>;
|
|
13
|
+
manifest_path: Type.TOptional<Type.TString>;
|
|
14
|
+
release_id: Type.TOptional<Type.TString>;
|
|
15
|
+
cursor: Type.TOptional<Type.TString>;
|
|
16
|
+
limit: Type.TOptional<Type.TInteger>;
|
|
17
|
+
offset: Type.TOptional<Type.TInteger>;
|
|
18
|
+
service: Type.TOptional<Type.TString>;
|
|
19
|
+
search: Type.TOptional<Type.TString>;
|
|
20
|
+
start: Type.TOptional<Type.TString>;
|
|
21
|
+
end: Type.TOptional<Type.TString>;
|
|
22
|
+
};
|
|
23
|
+
export declare function registerApplicationTools(server: ToolServer, http: HttpTransport): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HttpTransport } from "../transports/http";
|
|
2
|
+
import { type ToolServer } from "../tool-server";
|
|
3
|
+
export interface DatabaseToolsConfig {
|
|
4
|
+
localOnly?: boolean;
|
|
5
|
+
readOnly?: boolean;
|
|
6
|
+
projectRef?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function migrationVersionFromFilename(file: string): string;
|
|
9
|
+
export declare function vectorWarningsForPendingMigrations(migrations: Array<{
|
|
10
|
+
file: string;
|
|
11
|
+
sql: string;
|
|
12
|
+
}>, vectorEnabled: boolean | null): string[];
|
|
13
|
+
export declare function registerDatabaseTools(server: ToolServer, http: HttpTransport | undefined, config?: DatabaseToolsConfig): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type DatabaseModule, type QueryExecutor, type ReconcileReport } from "@supacloud/db";
|
|
2
|
+
import { type DbWorkflowAction } from "./db-workflow";
|
|
3
|
+
import { type ToolServer, type ToolResult } from "../tool-server";
|
|
4
|
+
export interface DbToolArguments {
|
|
5
|
+
action: "context" | "lint" | "explain" | "module_check" | DbWorkflowAction;
|
|
6
|
+
module?: string;
|
|
7
|
+
root?: string;
|
|
8
|
+
module_file?: string;
|
|
9
|
+
target?: string;
|
|
10
|
+
database_url?: string;
|
|
11
|
+
schema?: string;
|
|
12
|
+
lite?: boolean;
|
|
13
|
+
project_dir?: string;
|
|
14
|
+
schema_dir?: string;
|
|
15
|
+
db_major_version?: number;
|
|
16
|
+
out?: string;
|
|
17
|
+
dir?: string;
|
|
18
|
+
ref?: string;
|
|
19
|
+
approved_digest?: string;
|
|
20
|
+
application_role?: string;
|
|
21
|
+
migration_role?: string;
|
|
22
|
+
database?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface DatabaseAiContextObject {
|
|
25
|
+
kind: "table" | "policy" | "function" | "trigger" | "grant";
|
|
26
|
+
name: string;
|
|
27
|
+
module: string;
|
|
28
|
+
table?: string;
|
|
29
|
+
source: string | null;
|
|
30
|
+
tests: string[];
|
|
31
|
+
security?: string;
|
|
32
|
+
permission?: string;
|
|
33
|
+
transaction?: string;
|
|
34
|
+
audit?: string;
|
|
35
|
+
idempotency?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface DatabaseAiContext {
|
|
38
|
+
version: 1;
|
|
39
|
+
scope: "database-ai-context";
|
|
40
|
+
root: string;
|
|
41
|
+
selectedModules: string[];
|
|
42
|
+
target: string | null;
|
|
43
|
+
objects: DatabaseAiContextObject[];
|
|
44
|
+
maintenance: {
|
|
45
|
+
structureSource: "drizzle" | "declarative-sql";
|
|
46
|
+
behaviorSource: "sql";
|
|
47
|
+
generatedPaths: string[];
|
|
48
|
+
protectedPaths: string[];
|
|
49
|
+
forwardMigrationPath: string;
|
|
50
|
+
rules: string[];
|
|
51
|
+
};
|
|
52
|
+
verification: string[];
|
|
53
|
+
}
|
|
54
|
+
export interface DbGovernanceToolOptions {
|
|
55
|
+
environment?: NodeJS.ProcessEnv;
|
|
56
|
+
currentWorkingDirectory?: string;
|
|
57
|
+
liteSpawn?: LiteSpawn;
|
|
58
|
+
/** Overrides the supacloud-lite binary lookup; null simulates a missing binary (tests). */
|
|
59
|
+
liteBinary?: string | null;
|
|
60
|
+
projectRef?: string;
|
|
61
|
+
apiUrl?: string;
|
|
62
|
+
runDatabase?: () => ((args: Record<string, unknown>) => Promise<ToolResult>) | undefined;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Load database governance module declarations:
|
|
66
|
+
* --module_file points to a file exporting `default defineDatabaseModule(...)` (or an array);
|
|
67
|
+
* defaults to <root>/db/modules.ts (default or named "modules" export, single or array).
|
|
68
|
+
*/
|
|
69
|
+
export declare function loadDatabaseModules(root: string, moduleFile?: string): Promise<DatabaseModule[]>;
|
|
70
|
+
export declare function buildDatabaseAiContext(modules: readonly DatabaseModule[], root: string, moduleName?: string, target?: string): DatabaseAiContext;
|
|
71
|
+
/** Testable orchestration point: inject executor, read catalog, and reconcile against declared modules. */
|
|
72
|
+
export declare function runModuleCheck(module: DatabaseModule, executor: QueryExecutor, schemas?: string[]): Promise<ReconcileReport>;
|
|
73
|
+
interface LiteSubprocessResult {
|
|
74
|
+
exitCode: number;
|
|
75
|
+
stdout: string;
|
|
76
|
+
stderr: string;
|
|
77
|
+
}
|
|
78
|
+
type LiteSpawn = (command: string[], cwd: string) => Promise<LiteSubprocessResult>;
|
|
79
|
+
export declare function registerDbGovernanceTools(server: ToolServer, options?: DbGovernanceToolOptions): void;
|
|
80
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type QueryExecutor } from "@supacloud/db";
|
|
2
|
+
export type DbWorkflowAction = "reverse" | "diff" | "plan" | "apply" | "role_check" | "role_sql";
|
|
3
|
+
export interface DbWorkflowArguments {
|
|
4
|
+
action: DbWorkflowAction;
|
|
5
|
+
root?: string;
|
|
6
|
+
schema?: string;
|
|
7
|
+
database_url?: string;
|
|
8
|
+
schema_dir?: string;
|
|
9
|
+
db_major_version?: number;
|
|
10
|
+
out?: string;
|
|
11
|
+
dir?: string;
|
|
12
|
+
ref?: string;
|
|
13
|
+
approved_digest?: string;
|
|
14
|
+
application_role?: string;
|
|
15
|
+
migration_role?: string;
|
|
16
|
+
database?: string;
|
|
17
|
+
}
|
|
18
|
+
interface ToolResult {
|
|
19
|
+
content: Array<{
|
|
20
|
+
type: "text";
|
|
21
|
+
text: string;
|
|
22
|
+
}>;
|
|
23
|
+
isError?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface DbWorkflowOptions {
|
|
26
|
+
environment?: NodeJS.ProcessEnv;
|
|
27
|
+
projectRef?: string;
|
|
28
|
+
apiUrl?: string;
|
|
29
|
+
runDatabase?: () => ((args: Record<string, unknown>) => Promise<ToolResult>) | undefined;
|
|
30
|
+
spawn?: (args: string[], root: string, environment: NodeJS.ProcessEnv) => Promise<number>;
|
|
31
|
+
connect?: (url: string) => {
|
|
32
|
+
executor: QueryExecutor;
|
|
33
|
+
close(): Promise<void>;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export declare function runDbWorkflow(args: DbWorkflowArguments, projectRoot: string, options?: DbWorkflowOptions): Promise<ToolResult>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
import type { HttpTransport } from "../transports/http";
|
|
3
|
+
import { type ToolServer } from "../tool-server";
|
|
4
|
+
interface DeployToolOptions {
|
|
5
|
+
projectRef?: string;
|
|
6
|
+
cwd?: string;
|
|
7
|
+
edgeFunctionDeploy?: (args: Record<string, unknown>) => Promise<ToolResponse>;
|
|
8
|
+
}
|
|
9
|
+
interface ToolResponse {
|
|
10
|
+
content: Array<{
|
|
11
|
+
type: "text";
|
|
12
|
+
text: string;
|
|
13
|
+
}>;
|
|
14
|
+
isError?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const deployToolSchema: {
|
|
17
|
+
ref: Type.TOptional<Type.TString>;
|
|
18
|
+
target: Type.TOptional<Type.TString>;
|
|
19
|
+
id: Type.TOptional<Type.TString>;
|
|
20
|
+
cwd: Type.TOptional<Type.TString>;
|
|
21
|
+
build_command: Type.TOptional<Type.TString>;
|
|
22
|
+
output_dir: Type.TOptional<Type.TString>;
|
|
23
|
+
skip_build: Type.TOptional<Type.TBoolean>;
|
|
24
|
+
dry_run: Type.TOptional<Type.TBoolean>;
|
|
25
|
+
json: Type.TOptional<Type.TBoolean>;
|
|
26
|
+
};
|
|
27
|
+
export declare function findDeployConfigRoot(startDirectory: string): Promise<string>;
|
|
28
|
+
export declare function createFrontendArchive(outputDirectory: string): Promise<{
|
|
29
|
+
archivePath: string;
|
|
30
|
+
sha256: string;
|
|
31
|
+
sourceBytes: number;
|
|
32
|
+
fileCount: number;
|
|
33
|
+
cleanup(): Promise<void>;
|
|
34
|
+
}>;
|
|
35
|
+
export declare function registerDeployTools(server: ToolServer, http: HttpTransport, options?: DeployToolOptions): void;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
declare const FUNCTION_FRAMEWORKS: readonly ["fetch", "elysia", "hono", "sveltekit-function"];
|
|
2
|
+
type FunctionFramework = typeof FUNCTION_FRAMEWORKS[number];
|
|
3
|
+
type FunctionCapabilities = {
|
|
4
|
+
secrets?: string[];
|
|
5
|
+
outbound_hosts?: string[];
|
|
6
|
+
bindings?: string[];
|
|
7
|
+
background?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type FunctionLimits = {
|
|
10
|
+
timeout_ms?: number;
|
|
11
|
+
max_request_body_bytes?: number;
|
|
12
|
+
max_response_body_bytes?: number;
|
|
13
|
+
wait_until_timeout_ms?: number;
|
|
14
|
+
};
|
|
15
|
+
export type FunctionConfigInput = {
|
|
16
|
+
verify_jwt?: boolean;
|
|
17
|
+
background_routes?: string[];
|
|
18
|
+
framework?: FunctionFramework;
|
|
19
|
+
capabilities?: FunctionCapabilities;
|
|
20
|
+
limits?: FunctionLimits;
|
|
21
|
+
};
|
|
22
|
+
export type FunctionIdentityResponse = {
|
|
23
|
+
project_ref: string;
|
|
24
|
+
slug: string;
|
|
25
|
+
active_version: string;
|
|
26
|
+
activation_id: string;
|
|
27
|
+
verify_jwt: boolean;
|
|
28
|
+
background_routes: string[];
|
|
29
|
+
framework?: FunctionFramework;
|
|
30
|
+
version?: string;
|
|
31
|
+
import_map?: string;
|
|
32
|
+
entrypoint?: string;
|
|
33
|
+
capabilities?: FunctionCapabilities;
|
|
34
|
+
limits?: FunctionLimits;
|
|
35
|
+
};
|
|
36
|
+
export type FunctionConfigMutationExpectation = {
|
|
37
|
+
projectRef: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
expectedActivationId: string;
|
|
40
|
+
config: FunctionConfigInput;
|
|
41
|
+
};
|
|
42
|
+
export type FunctionDeleteExpectation = {
|
|
43
|
+
projectRef: string;
|
|
44
|
+
slug: string;
|
|
45
|
+
expectedActivationId: string;
|
|
46
|
+
};
|
|
47
|
+
export declare function projectedFunctionCapabilities(candidate: unknown): FunctionCapabilities | null;
|
|
48
|
+
export declare function projectedFunctionLimits(candidate: unknown): FunctionLimits | null;
|
|
49
|
+
export declare function validObservedFunctionActivationId(candidate: unknown): candidate is string;
|
|
50
|
+
export declare function validCommittedFunctionActivationId(candidate: unknown): candidate is string;
|
|
51
|
+
export declare function projectedFunctionList(payload: unknown): Array<Record<string, unknown>> | null;
|
|
52
|
+
export declare function projectedFunctionIdentity(payload: unknown, expectedProjectRef: string, expectedSlug: string): FunctionIdentityResponse | null;
|
|
53
|
+
export declare function confirmedFunctionConfigMutation(payload: unknown, expectation: FunctionConfigMutationExpectation): Record<string, unknown> | null;
|
|
54
|
+
export declare function confirmedFunctionDeletion(payload: unknown, expectation: FunctionDeleteExpectation): Record<string, unknown> | null;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { HttpResult } from "../transports/http";
|
|
2
|
+
type ToolResponse = {
|
|
3
|
+
content: Array<{
|
|
4
|
+
type: "text";
|
|
5
|
+
text: string;
|
|
6
|
+
}>;
|
|
7
|
+
isError?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export interface FrontendReleaseHttp {
|
|
10
|
+
get<T = unknown>(path: string, options?: {
|
|
11
|
+
maxJsonBytes?: number;
|
|
12
|
+
}): Promise<HttpResult<T>>;
|
|
13
|
+
post<T = unknown>(path: string, body?: unknown, options?: {
|
|
14
|
+
maxJsonBytes?: number;
|
|
15
|
+
responseTimeoutMs?: number;
|
|
16
|
+
}): Promise<HttpResult<T>>;
|
|
17
|
+
postBinary<T = unknown>(path: string, body: {
|
|
18
|
+
stream: ReadableStream<Uint8Array>;
|
|
19
|
+
byteLength: number;
|
|
20
|
+
}, options: {
|
|
21
|
+
contentType: string;
|
|
22
|
+
contentLength: number;
|
|
23
|
+
contentSha256: string;
|
|
24
|
+
maxJsonBytes: number;
|
|
25
|
+
timeoutMs?: number;
|
|
26
|
+
responseTimeoutMs?: number;
|
|
27
|
+
}): Promise<HttpResult<T>>;
|
|
28
|
+
}
|
|
29
|
+
export interface FrontendReleaseRecord {
|
|
30
|
+
project_ref: string;
|
|
31
|
+
deployment_id: string;
|
|
32
|
+
release_id: string;
|
|
33
|
+
sha256: string;
|
|
34
|
+
tree_sha256: string;
|
|
35
|
+
size_bytes: number;
|
|
36
|
+
file_count: number;
|
|
37
|
+
created_at: string;
|
|
38
|
+
kind: "prebuilt_static";
|
|
39
|
+
}
|
|
40
|
+
export declare function listFrontendReleases(http: FrontendReleaseHttp, projectRef: string, deploymentId: string, cursor?: string, limit?: number): Promise<ToolResponse>;
|
|
41
|
+
export declare function getFrontendRelease(http: FrontendReleaseHttp, projectRef: string, deploymentId: string, releaseId: string): Promise<ToolResponse>;
|
|
42
|
+
export declare function uploadFrontendRelease(http: FrontendReleaseHttp, projectRef: string, deploymentId: string, archivePath: string): Promise<ToolResponse>;
|
|
43
|
+
export declare function getActiveFrontendRelease(http: FrontendReleaseHttp, projectRef: string, deploymentId: string): Promise<ToolResponse>;
|
|
44
|
+
export declare function readFrontendReleaseAuthority(http: FrontendReleaseHttp, projectRef: string, deploymentId: string): Promise<ToolResponse>;
|
|
45
|
+
export declare function rollbackFrontendRelease(http: FrontendReleaseHttp, projectRef: string, deploymentId: string, releaseId?: string): Promise<ToolResponse>;
|
|
46
|
+
export declare function activateFrontendRelease(http: FrontendReleaseHttp, input: {
|
|
47
|
+
projectRef: string;
|
|
48
|
+
deploymentId: string;
|
|
49
|
+
releaseId: string;
|
|
50
|
+
expectedActiveReleaseId: string;
|
|
51
|
+
expectedActivationId: string;
|
|
52
|
+
mutationId: string;
|
|
53
|
+
}): Promise<ToolResponse>;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HttpTransport } from "../transports/http";
|
|
2
|
+
import { type ToolServer } from "../tool-server";
|
|
3
|
+
export declare function registerGatewayTools(server: ToolServer, http: Pick<HttpTransport, "get" | "post" | "put" | "delete">, options?: {
|
|
4
|
+
projectRef?: string;
|
|
5
|
+
refPriority?: "argument" | "project";
|
|
6
|
+
}): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export { resolveLiteCommand } from "./lite-cli-command";
|
|
2
|
+
import { type ToolServer } from "../tool-server";
|
|
3
|
+
export type LiteCliAction = "version" | "start" | "migrate" | "status" | "keys" | "gen_types" | "db_reset" | "db_diff" | "db_pull" | "snapshot_create" | "snapshot_restore" | "upgrade" | "inspect" | "doctor";
|
|
4
|
+
export interface LiteCliArgs {
|
|
5
|
+
action: LiteCliAction;
|
|
6
|
+
workdir?: string;
|
|
7
|
+
project_dir?: string;
|
|
8
|
+
state_dir?: string;
|
|
9
|
+
data_dir?: string;
|
|
10
|
+
storage_dir?: string;
|
|
11
|
+
storage_backend?: "fs" | "memory" | "s3";
|
|
12
|
+
s3_prefix?: string;
|
|
13
|
+
engine?: "pglite" | "native";
|
|
14
|
+
host?: string;
|
|
15
|
+
port?: number;
|
|
16
|
+
api_url?: string;
|
|
17
|
+
site_url?: string;
|
|
18
|
+
replication_profile?: "powersync";
|
|
19
|
+
replication_host?: string;
|
|
20
|
+
replication_port?: number;
|
|
21
|
+
replication_allow_cidrs?: string;
|
|
22
|
+
powersync_tables?: string;
|
|
23
|
+
replication_tls_cert?: string;
|
|
24
|
+
replication_tls_key?: string;
|
|
25
|
+
output?: string;
|
|
26
|
+
file?: string;
|
|
27
|
+
snapshot_file?: string;
|
|
28
|
+
service_role?: boolean;
|
|
29
|
+
force?: boolean;
|
|
30
|
+
memory?: boolean;
|
|
31
|
+
json?: boolean;
|
|
32
|
+
baseline?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface LiteCliExecutionResult {
|
|
35
|
+
exitCode: number;
|
|
36
|
+
stdout: string;
|
|
37
|
+
stderr: string;
|
|
38
|
+
}
|
|
39
|
+
type LiteCliExecutor = (request: LiteCliArgs) => Promise<LiteCliExecutionResult>;
|
|
40
|
+
export interface LiteCliToolOptions {
|
|
41
|
+
executeLiteCli?: LiteCliExecutor;
|
|
42
|
+
environment?: NodeJS.ProcessEnv;
|
|
43
|
+
currentWorkingDirectory?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare function buildLiteArgs(request: LiteCliArgs): string[];
|
|
46
|
+
export declare function registerLiteCliTools(server: ToolServer, options?: LiteCliToolOptions): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface MigrationImportFile {
|
|
2
|
+
file: string;
|
|
3
|
+
name: string;
|
|
4
|
+
sql: string;
|
|
5
|
+
source: "sql" | "hasura-metadata" | "hasura-application-review" | "nhost";
|
|
6
|
+
}
|
|
7
|
+
export interface MigrationImportPlan {
|
|
8
|
+
source: "hasura" | "nhost";
|
|
9
|
+
files: MigrationImportFile[];
|
|
10
|
+
warnings: string[];
|
|
11
|
+
compatibility: {
|
|
12
|
+
supabase_migrations: true;
|
|
13
|
+
pg_graphql: "preserved";
|
|
14
|
+
rls: "manual_review";
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare function writeMigrationImportPlan(plan: MigrationImportPlan, outputDirectory: string): Promise<string[]>;
|
|
18
|
+
export declare function createMigrationImportPlan(input: {
|
|
19
|
+
source: "hasura" | "nhost";
|
|
20
|
+
directory?: string;
|
|
21
|
+
metadata?: unknown;
|
|
22
|
+
}): MigrationImportPlan;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|