@supacloud/cli 0.121.9 → 0.123.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.
@@ -15,5 +15,5 @@ export declare const STARTER_DATABASE_MODEL = "datasource db {\n provider = \"p
15
15
  export declare const STARTER_DATABASE_SCHEMA = "export type { Review as ReviewRow, Attachment as AttachmentRow, AttachmentRetry as AttachmentRetryRow } from \"../zenstack/generated/models\";\nimport type { Review } from \"../zenstack/generated/models\";\nexport type NewReview = Review;\n";
16
16
  export declare const STARTER_DATABASE_MODULES = "import { defineDatabaseModule } from \"@supacloud/db\";\n\nconst backendPolicies = [\n [\"starter_backend_binding_read\", \"public.starter_application\", \"select\", [\"starter_review_http\", \"starter_review_worker\"]],\n [\"starter_backend_binding_lock\", \"public.starter_application\", \"update\", [\"starter_review_http\", \"starter_review_worker\"]],\n [\"starter_backend_binding_immutable\", \"public.starter_application\", \"update\", [\"starter_review_http\", \"starter_review_worker\"]],\n [\"starter_backend_member_read\", \"public.starter_members\", \"select\", [\"starter_review_http\", \"starter_review_worker\"]],\n [\"starter_backend_member_lock\", \"public.starter_members\", \"update\", [\"starter_review_http\", \"starter_review_worker\"]],\n [\"starter_backend_member_immutable\", \"public.starter_members\", \"update\", [\"starter_review_http\", \"starter_review_worker\"]],\n [\"starter_backend_review_read\", \"public.starter_reviews\", \"select\", [\"starter_review_http\", \"starter_review_worker\"]],\n [\"starter_backend_review_update\", \"public.starter_reviews\", \"update\", [\"starter_review_http\"]],\n [\"starter_worker_review_immutable\", \"public.starter_reviews\", \"update\", [\"starter_review_worker\"]],\n [\"starter_backend_attachment_read\", \"public.starter_attachments\", \"select\", [\"starter_review_http\", \"starter_review_worker\"]],\n [\"starter_backend_attachment_lock\", \"public.starter_attachments\", \"update\", [\"starter_review_http\", \"starter_review_worker\"]],\n [\"starter_backend_attachment_immutable\", \"public.starter_attachments\", \"update\", [\"starter_review_http\", \"starter_review_worker\"]],\n [\"starter_http_attachment_insert\", \"public.starter_attachments\", \"insert\", [\"starter_review_http\"]],\n [\"starter_worker_result_read\", \"public.starter_attachment_results\", \"select\", [\"starter_review_worker\"]],\n [\"starter_worker_result_insert\", \"public.starter_attachment_results\", \"insert\", [\"starter_review_worker\"]],\n] as const;\n\n// The module is the single live-Catalog ownership contract for starter tables.\nexport default defineDatabaseModule({\n name: \"starter\",\n tables: [\"public.starter_application\", \"public.starter_reviews\", \"public.starter_members\", \"public.starter_attachments\", \"public.starter_attachment_results\", \"public.starter_attachment_retries\"],\n policies: [\n ...([\n [\"starter_http_retry_read\", \"select\", \"starter_review_http\"],\n [\"starter_http_retry_insert\", \"insert\", \"starter_review_http\"],\n [\"starter_worker_retry_read\", \"select\", \"starter_review_worker\"],\n ] as const).map(([name, operation, role]) => ({\n name, table: \"public.starter_attachment_retries\", operation, roles: [role],\n source: \"migrations/005-review-task-recovery.sql\", tests: [\"tests/database-governance.sql\"],\n })),\n ...backendPolicies.map(([name, table, operation, roles]) => ({\n name, table, operation, roles: [...roles], source: \"migrations/004-review-runtime-roles.sql\",\n tests: [\"tests/database-governance.sql\"],\n })),\n {\n name: \"starter_member_read\", table: \"public.starter_members\", operation: \"select\",\n roles: [\"authenticated\"], source: \"migrations/003-review-uploads.sql\",\n tests: [\"tests/database-governance.sql\"],\n },\n {\n name: \"starter_review_read\", table: \"public.starter_reviews\", operation: \"select\",\n roles: [\"authenticated\"], source: \"migrations/003-review-uploads.sql\",\n tests: [\"tests/database-governance.sql\"],\n },\n ],\n});\n";
17
17
  export declare const STARTER_DATABASE_TEST = "-- Read-only catalog assertions; behavioral authorization tests remain separate.\nBEGIN READ ONLY;\nDO $test$\nDECLARE\n owned text[] := ARRAY['starter_application','starter_reviews','starter_members',\n 'starter_attachments','starter_attachment_results','starter_attachment_retries'];\nBEGIN\n IF (SELECT count(*) FROM pg_class c JOIN pg_namespace n ON n.oid=c.relnamespace\n WHERE n.nspname='public' AND c.relname=ANY(owned) AND c.relrowsecurity) <> 6 THEN\n RAISE EXCEPTION 'All starter tables must exist with RLS enabled';\n END IF;\n IF (SELECT count(*) FROM pg_policy p JOIN pg_class c ON c.oid=p.polrelid\n JOIN pg_namespace n ON n.oid=c.relnamespace\n WHERE n.nspname='public' AND c.relname=ANY(owned)) <> 20 THEN\n RAISE EXCEPTION 'Starter policy inventory changed; reconcile db/modules.ts';\n END IF;\n IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname IN ('starter_review_http','starter_review_worker')\n AND (rolsuper OR rolbypassrls)) THEN\n RAISE EXCEPTION 'Starter roles must not bypass row security';\n END IF;\n IF (SELECT count(*) FROM pg_roles WHERE rolname IN ('starter_review_http','starter_review_worker')) <> 2 THEN\n RAISE EXCEPTION 'Starter runtime roles are missing';\n END IF;\nEND\n$test$;\nROLLBACK;\n";
18
- export declare const STARTER_DATABASE_GUIDE = "\n## Model and migration workflow\n\nMaintain zenstack/schema.zmodel. Run `bun run db:generate` to compile model and RPC\ncontracts; commit generated types with their sources. Do not introduce any/@ts-ignore\nto bypass model or contract diagnostics. `bun run db:check` compares\nfresh generation without writing files or opening a database. This starter sets\n`policyRls` to `deferred` because relation predicates and storage fences are reviewed\nSQL, not the authenticated row-policy projection. Command writes still use the shared\ntransaction, receipt and audit boundary, not unrestricted CRUD. SQL constraints, RPCs\nand RLS remain explicit reviewed migrations when the model language cannot express them.\n\nUse `bun run db:diff -- --candidate output/database-audit/change.sql` with an\nexplicit read-only SUPACLOUD_MODEL_DATABASE_URL. Review the SQL, then promote a new\nforward migration through the existing SupaCloud plan/apply ledger. Never run\nzen migrate deploy or db push against a managed production database.\n`bun run db:pull -- --candidate output/database-audit/schema.zmodel` writes a\nreview candidate only; it never overwrites the maintained model. Add policies\nbefore adopting introspection output. Keep one migration history and preserve RLS.\n\nAdopting a database that has no model yet starts with the same command: pull\nintrospects through a temporary datasource-only model, so no hand-written ZModel\nis required. Review the candidate, add the policy plugin and @@allow rules, move\nit to zenstack/schema.zmodel, then run `bun run db:generate`. Until that file\nexists, `db:diff` and `db:generate` fail closed instead of building from an\nunreviewed introspection result. Keep the host wiring unchanged: one\ncreateZenStackDatabase composition root supplies read-only models and the\ntransactional command store.\n";
18
+ export declare const STARTER_DATABASE_GUIDE = "\n## Model and migration workflow\n\nMaintain zenstack/schema.zmodel. Run `bun run db:generate` to compile model and RPC\ncontracts; commit generated types with their sources. Do not introduce any/@ts-ignore\nto bypass model or contract diagnostics. `bun run db:check` compares\nfresh generation without writing files or opening a database. This starter sets\n`policyRls` to `deferred` because relation predicates and storage fences are reviewed\nSQL, not the authenticated row-policy projection. Command writes still use the shared\ntransaction, receipt and audit boundary, not unrestricted CRUD. SQL constraints, RPCs\nand RLS remain explicit reviewed migrations when the model language cannot express them.\n\nUse `bun run db:plan` to send the reviewed migration directory to the\nManagement API for a remote, read-only plan. Review the returned digest, then run\n`bun run db:apply -- --approved_digest <digest>` to apply the exact same bytes\nthrough the project migration ledger. Neither command needs DATABASE_URL or a\npublic PostgreSQL port. Never run zen migrate deploy or db push against a managed\nproduction database.\n`bun run db:pull -- --candidate output/database-audit/schema.zmodel` uses the\nsame Management API binding and writes a review candidate only; it never\noverwrites the maintained model. Add policies before adopting introspection\noutput. Keep one migration history and preserve RLS.\n\nAdopting a database that has no model yet starts with the same command: pull\nintrospects through a temporary datasource-only model inside the Management API,\nso no hand-written ZModel is required. Review the candidate, add the policy\nplugin and @@allow rules, move it to zenstack/schema.zmodel, then run\n`bun run db:generate`. Until that file exists, `db:plan` and\n`db:generate` fail closed instead of building from an unreviewed\nintrospection result. Keep the host wiring unchanged: one\ncreateZenStackDatabase composition root supplies read-only models and the\ntransactional command store.\n";
19
19
  export declare function starterDatabaseFiles(): Record<string, string>;
@@ -12,6 +12,7 @@ declare const REMOTE_APP_ACTIONS: {
12
12
  readonly "preview-create": "create_preview";
13
13
  readonly "preview-status": "get_preview";
14
14
  readonly "preview-cleanup": "cleanup_preview";
15
+ readonly "preview-pr": "preview_pull_request";
15
16
  readonly transfer: "transfer_release";
16
17
  readonly configure: "put_configuration";
17
18
  readonly deploy: "deploy_release";
@@ -1,6 +1,6 @@
1
1
  import { Type, type Static } from "typebox";
2
2
  import type { HttpTransport } from "../transports/http";
3
- export declare const APPLICATION_PREVIEW_ACTIONS: readonly ["get_preview_plan", "create_preview", "list_previews", "get_preview", "reconcile_preview", "cleanup_preview"];
3
+ export declare const APPLICATION_PREVIEW_ACTIONS: readonly ["get_preview_plan", "create_preview", "list_previews", "get_preview", "reconcile_preview", "cleanup_preview", "preview_pull_request"];
4
4
  export declare const APPLICATION_PREVIEW_FIELDS: {
5
5
  preview_id: Type.TOptional<Type.TString>;
6
6
  branch_ref: Type.TOptional<Type.TString>;
@@ -9,6 +9,9 @@ export declare const APPLICATION_PREVIEW_FIELDS: {
9
9
  ttl_seconds: Type.TOptional<Type.TInteger>;
10
10
  wait: Type.TOptional<Type.TBoolean>;
11
11
  timeout_seconds: Type.TOptional<Type.TInteger>;
12
+ pull_request_action: Type.TOptional<Type.TEnum<("closed" | "opened")[]>>;
13
+ repository: Type.TOptional<Type.TString>;
14
+ pull_request_number: Type.TOptional<Type.TInteger>;
12
15
  };
13
16
  declare const receiptSchema: Type.TObject<{
14
17
  schema: Type.TLiteral<"supacloud.application-preview.v1">;
@@ -9,7 +9,10 @@ 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<("activate_release" | "cleanup_preview" | "create_preview" | "deploy_application" | "deploy_release" | "get_configuration" | "get_deploy_plan" | "get_deployment_evidence" | "get_history" | "get_preview" | "get_preview_plan" | "get_promotion_plan" | "get_promotion_status" | "get_release" | "get_release_transfer_plan" | "get_rollback_snapshot" | "get_runtime" | "list_previews" | "list_releases" | "logs" | "promote_application" | "put_configuration" | "reconcile_activation" | "reconcile_preview" | "reconcile_promotion" | "retire_activation" | "rollback_release" | "transfer_release" | "upload_release")[]>;
12
+ pull_request_action: Type.TOptional<Type.TEnum<("closed" | "opened")[]>>;
13
+ repository: Type.TOptional<Type.TString>;
14
+ pull_request_number: Type.TOptional<Type.TInteger>;
15
+ action: Type.TEnum<("activate_release" | "cleanup_preview" | "create_preview" | "deploy_application" | "deploy_release" | "get_configuration" | "get_deploy_plan" | "get_deployment_evidence" | "get_history" | "get_preview" | "get_preview_plan" | "get_promotion_plan" | "get_promotion_status" | "get_release" | "get_release_transfer_plan" | "get_rollback_snapshot" | "get_runtime" | "list_previews" | "list_releases" | "logs" | "preview_pull_request" | "promote_application" | "put_configuration" | "reconcile_activation" | "reconcile_preview" | "reconcile_promotion" | "retire_activation" | "rollback_release" | "transfer_release" | "upload_release")[]>;
13
16
  ref: Type.TString;
14
17
  id: Type.TString;
15
18
  environment_id: Type.TOptional<Type.TString>;
@@ -0,0 +1,32 @@
1
+ import type { ToolSchema } from "../schema";
2
+ import { type ToolResult, type ToolServer } from "../tool-server";
3
+ import type { ResolvedContext } from "../context";
4
+ export interface ConfigurationToolOptions {
5
+ cwd?: string;
6
+ activeContext?: ResolvedContext;
7
+ }
8
+ export declare const onboardToolSchema: ToolSchema;
9
+ export declare const configurationToolSchema: ToolSchema;
10
+ export declare const environmentSyncSchema: ToolSchema;
11
+ declare function parseEnvironment(content: string): Record<string, string>;
12
+ declare function derivedValues(values: Record<string, string>): Record<string, string>;
13
+ declare function configurationEntries(values: Record<string, string>): Array<Record<string, unknown>>;
14
+ declare function parseSimpleYaml(content: string): Record<string, unknown>;
15
+ export declare function readBootstrapConfig(path: string): Promise<Record<string, unknown>>;
16
+ declare function onboardingPlan(args: Record<string, unknown>, root: string): Record<string, unknown>;
17
+ export declare function syncEnvironmentProfile(args: Record<string, unknown>, options: ConfigurationToolOptions): Promise<ToolResult>;
18
+ export declare function readSecretGap(root: string, environment: string): Promise<{
19
+ environment: string;
20
+ required: string[];
21
+ present: string[];
22
+ missing: string[];
23
+ }>;
24
+ export declare function registerConfigurationTools(server: ToolServer, options?: ConfigurationToolOptions): void;
25
+ export declare const __internal: {
26
+ derivedValues: typeof derivedValues;
27
+ configurationEntries: typeof configurationEntries;
28
+ onboardingPlan: typeof onboardingPlan;
29
+ parseSimpleYaml: typeof parseSimpleYaml;
30
+ parseEnvironment: typeof parseEnvironment;
31
+ };
32
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { ToolSchema } from "../schema";
2
+ import { type ToolResult, type ToolServer } from "../tool-server";
3
+ export interface PipelineToolOptions {
4
+ cwd?: string;
5
+ }
6
+ export declare const pipelineToolSchema: ToolSchema;
7
+ export declare function connectPipeline(args: Record<string, unknown>, options?: PipelineToolOptions): Promise<ToolResult>;
8
+ export declare function registerPipelineTools(server: ToolServer, options?: PipelineToolOptions): void;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/cli",
3
- "version": "0.121.9",
3
+ "version": "0.123.1",
4
4
  "description": "Project-scoped CLI for SupaCloud users",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -52,26 +52,26 @@
52
52
  "directory": "packages/cli"
53
53
  },
54
54
  "dependencies": {
55
- "@supacloud/compiler": "^0.62.6",
55
+ "@supacloud/compiler": "^0.62.7",
56
56
  "@supacloud/delivery": "0.28.0",
57
- "@supacloud/db": "0.24.2",
57
+ "@supacloud/db": "0.25.1",
58
58
  "typebox": "1.4.3"
59
59
  },
60
60
  "overrides": {
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.6",
65
- "@supacloud/db": "0.24.2",
64
+ "@supacloud/compiler": "^0.62.7",
65
+ "@supacloud/db": "0.25.1",
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.4",
71
+ "@supacloud/elysia": "0.42.5",
72
72
  "@types/bun": "^1.4.4",
73
73
  "effect": "4.0.5",
74
- "elysia": "2.0.0-rc.3",
74
+ "elysia": "2.0.0-rc.4",
75
75
  "typescript": "7.1.0-beta"
76
76
  }
77
77
  }