@supacloud/cli 0.34.1 → 0.35.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.
Files changed (2) hide show
  1. package/dist/index.js +255 -169
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -17,22 +17,22 @@ var __export = (target, all) => {
17
17
  // node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
18
18
  var exports_value = {};
19
19
  __export(exports_value, {
20
- IsUndefined: () => IsUndefined,
21
- IsUint8Array: () => IsUint8Array,
22
- IsSymbol: () => IsSymbol,
23
- IsString: () => IsString,
24
- IsRegExp: () => IsRegExp,
25
- IsObject: () => IsObject,
26
- IsNumber: () => IsNumber,
27
- IsNull: () => IsNull,
28
- IsIterator: () => IsIterator,
29
- IsFunction: () => IsFunction,
30
- IsDate: () => IsDate,
31
- IsBoolean: () => IsBoolean,
32
- IsBigInt: () => IsBigInt,
33
- IsAsyncIterator: () => IsAsyncIterator,
20
+ HasPropertyKey: () => HasPropertyKey,
34
21
  IsArray: () => IsArray,
35
- HasPropertyKey: () => HasPropertyKey
22
+ IsAsyncIterator: () => IsAsyncIterator,
23
+ IsBigInt: () => IsBigInt,
24
+ IsBoolean: () => IsBoolean,
25
+ IsDate: () => IsDate,
26
+ IsFunction: () => IsFunction,
27
+ IsIterator: () => IsIterator,
28
+ IsNull: () => IsNull,
29
+ IsNumber: () => IsNumber,
30
+ IsObject: () => IsObject,
31
+ IsRegExp: () => IsRegExp,
32
+ IsString: () => IsString,
33
+ IsSymbol: () => IsSymbol,
34
+ IsUint8Array: () => IsUint8Array,
35
+ IsUndefined: () => IsUndefined
36
36
  });
37
37
  function HasPropertyKey(value, key) {
38
38
  return key in value;
@@ -405,57 +405,57 @@ function IsSchema(value) {
405
405
  // node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
406
406
  var exports_type = {};
407
407
  __export(exports_type, {
408
- TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError,
409
- IsVoid: () => IsVoid2,
410
- IsUnsafe: () => IsUnsafe2,
411
- IsUnknown: () => IsUnknown2,
412
- IsUnionLiteral: () => IsUnionLiteral,
413
- IsUnion: () => IsUnion2,
414
- IsUndefined: () => IsUndefined4,
415
- IsUint8Array: () => IsUint8Array4,
416
- IsTuple: () => IsTuple2,
417
- IsTransform: () => IsTransform2,
418
- IsThis: () => IsThis2,
419
- IsTemplateLiteral: () => IsTemplateLiteral2,
420
- IsSymbol: () => IsSymbol4,
421
- IsString: () => IsString4,
422
- IsSchema: () => IsSchema2,
423
- IsRegExp: () => IsRegExp3,
424
- IsRef: () => IsRef2,
425
- IsRecursive: () => IsRecursive,
426
- IsRecord: () => IsRecord2,
427
- IsReadonly: () => IsReadonly2,
428
- IsProperties: () => IsProperties,
429
- IsPromise: () => IsPromise3,
430
- IsOptional: () => IsOptional2,
431
- IsObject: () => IsObject4,
432
- IsNumber: () => IsNumber4,
433
- IsNull: () => IsNull4,
434
- IsNot: () => IsNot2,
435
- IsNever: () => IsNever2,
436
- IsMappedResult: () => IsMappedResult2,
437
- IsMappedKey: () => IsMappedKey2,
438
- IsLiteralValue: () => IsLiteralValue2,
439
- IsLiteralString: () => IsLiteralString,
440
- IsLiteralNumber: () => IsLiteralNumber,
441
- IsLiteralBoolean: () => IsLiteralBoolean,
442
- IsLiteral: () => IsLiteral2,
443
- IsKindOf: () => IsKindOf2,
444
- IsKind: () => IsKind2,
445
- IsIterator: () => IsIterator4,
446
- IsIntersect: () => IsIntersect2,
447
- IsInteger: () => IsInteger3,
448
- IsImport: () => IsImport,
449
- IsFunction: () => IsFunction4,
450
- IsDate: () => IsDate4,
451
- IsConstructor: () => IsConstructor2,
452
- IsComputed: () => IsComputed2,
453
- IsBoolean: () => IsBoolean4,
454
- IsBigInt: () => IsBigInt4,
455
- IsAsyncIterator: () => IsAsyncIterator4,
456
- IsArray: () => IsArray4,
408
+ IsAny: () => IsAny2,
457
409
  IsArgument: () => IsArgument2,
458
- IsAny: () => IsAny2
410
+ IsArray: () => IsArray4,
411
+ IsAsyncIterator: () => IsAsyncIterator4,
412
+ IsBigInt: () => IsBigInt4,
413
+ IsBoolean: () => IsBoolean4,
414
+ IsComputed: () => IsComputed2,
415
+ IsConstructor: () => IsConstructor2,
416
+ IsDate: () => IsDate4,
417
+ IsFunction: () => IsFunction4,
418
+ IsImport: () => IsImport,
419
+ IsInteger: () => IsInteger3,
420
+ IsIntersect: () => IsIntersect2,
421
+ IsIterator: () => IsIterator4,
422
+ IsKind: () => IsKind2,
423
+ IsKindOf: () => IsKindOf2,
424
+ IsLiteral: () => IsLiteral2,
425
+ IsLiteralBoolean: () => IsLiteralBoolean,
426
+ IsLiteralNumber: () => IsLiteralNumber,
427
+ IsLiteralString: () => IsLiteralString,
428
+ IsLiteralValue: () => IsLiteralValue2,
429
+ IsMappedKey: () => IsMappedKey2,
430
+ IsMappedResult: () => IsMappedResult2,
431
+ IsNever: () => IsNever2,
432
+ IsNot: () => IsNot2,
433
+ IsNull: () => IsNull4,
434
+ IsNumber: () => IsNumber4,
435
+ IsObject: () => IsObject4,
436
+ IsOptional: () => IsOptional2,
437
+ IsPromise: () => IsPromise3,
438
+ IsProperties: () => IsProperties,
439
+ IsReadonly: () => IsReadonly2,
440
+ IsRecord: () => IsRecord2,
441
+ IsRecursive: () => IsRecursive,
442
+ IsRef: () => IsRef2,
443
+ IsRegExp: () => IsRegExp3,
444
+ IsSchema: () => IsSchema2,
445
+ IsString: () => IsString4,
446
+ IsSymbol: () => IsSymbol4,
447
+ IsTemplateLiteral: () => IsTemplateLiteral2,
448
+ IsThis: () => IsThis2,
449
+ IsTransform: () => IsTransform2,
450
+ IsTuple: () => IsTuple2,
451
+ IsUint8Array: () => IsUint8Array4,
452
+ IsUndefined: () => IsUndefined4,
453
+ IsUnion: () => IsUnion2,
454
+ IsUnionLiteral: () => IsUnionLiteral,
455
+ IsUnknown: () => IsUnknown2,
456
+ IsUnsafe: () => IsUnsafe2,
457
+ IsVoid: () => IsVoid2,
458
+ TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
459
459
  });
460
460
  class TypeGuardUnknownTypeError extends TypeBoxError {
461
461
  }
@@ -705,12 +705,12 @@ var PatternNeverExact = `^${PatternNever}$`;
705
705
  // node_modules/@sinclair/typebox/build/esm/type/registry/format.mjs
706
706
  var exports_format = {};
707
707
  __export(exports_format, {
708
- Set: () => Set2,
709
- Has: () => Has,
710
- Get: () => Get,
711
- Entries: () => Entries,
708
+ Clear: () => Clear,
712
709
  Delete: () => Delete,
713
- Clear: () => Clear
710
+ Entries: () => Entries,
711
+ Get: () => Get,
712
+ Has: () => Has,
713
+ Set: () => Set2
714
714
  });
715
715
  var map = new Map;
716
716
  function Entries() {
@@ -734,12 +734,12 @@ function Get(format) {
734
734
  // node_modules/@sinclair/typebox/build/esm/type/registry/type.mjs
735
735
  var exports_type2 = {};
736
736
  __export(exports_type2, {
737
- Set: () => Set3,
738
- Has: () => Has2,
739
- Get: () => Get2,
740
- Entries: () => Entries2,
737
+ Clear: () => Clear2,
741
738
  Delete: () => Delete2,
742
- Clear: () => Clear2
739
+ Entries: () => Entries2,
740
+ Get: () => Get2,
741
+ Has: () => Has2,
742
+ Set: () => Set3
743
743
  });
744
744
  var map2 = new Map;
745
745
  function Entries2() {
@@ -2638,68 +2638,68 @@ function Void(options) {
2638
2638
  // node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
2639
2639
  var exports_type3 = {};
2640
2640
  __export(exports_type3, {
2641
- Void: () => Void,
2642
- Uppercase: () => Uppercase,
2643
- Unsafe: () => Unsafe,
2644
- Unknown: () => Unknown,
2645
- Union: () => Union,
2646
- Undefined: () => Undefined,
2647
- Uncapitalize: () => Uncapitalize,
2648
- Uint8Array: () => Uint8Array2,
2649
- Tuple: () => Tuple,
2650
- Transform: () => Transform,
2651
- TemplateLiteral: () => TemplateLiteral,
2652
- Symbol: () => Symbol2,
2653
- String: () => String2,
2654
- ReturnType: () => ReturnType,
2655
- Rest: () => Rest,
2656
- Required: () => Required,
2657
- RegExp: () => RegExp2,
2658
- Ref: () => Ref,
2659
- Recursive: () => Recursive,
2660
- Record: () => Record,
2661
- ReadonlyOptional: () => ReadonlyOptional,
2662
- Readonly: () => Readonly,
2663
- Promise: () => Promise2,
2664
- Pick: () => Pick,
2665
- Partial: () => Partial,
2666
- Parameters: () => Parameters,
2667
- Optional: () => Optional,
2668
- Omit: () => Omit,
2669
- Object: () => Object2,
2670
- Number: () => Number2,
2671
- Null: () => Null,
2672
- Not: () => Not2,
2673
- Never: () => Never,
2674
- Module: () => Module,
2675
- Mapped: () => Mapped,
2676
- Lowercase: () => Lowercase,
2677
- Literal: () => Literal,
2678
- KeyOf: () => KeyOf,
2679
- Iterator: () => Iterator,
2680
- Intersect: () => Intersect,
2681
- Integer: () => Integer,
2682
- Instantiate: () => Instantiate,
2683
- InstanceType: () => InstanceType,
2684
- Index: () => Index,
2685
- Function: () => Function,
2686
- Extract: () => Extract,
2687
- Extends: () => Extends,
2688
- Exclude: () => Exclude,
2689
- Enum: () => Enum,
2690
- Date: () => Date2,
2691
- ConstructorParameters: () => ConstructorParameters,
2692
- Constructor: () => Constructor,
2693
- Const: () => Const,
2694
- Composite: () => Composite,
2695
- Capitalize: () => Capitalize,
2696
- Boolean: () => Boolean2,
2697
- BigInt: () => BigInt2,
2698
- Awaited: () => Awaited,
2699
- AsyncIterator: () => AsyncIterator,
2700
- Array: () => Array2,
2641
+ Any: () => Any,
2701
2642
  Argument: () => Argument,
2702
- Any: () => Any
2643
+ Array: () => Array2,
2644
+ AsyncIterator: () => AsyncIterator,
2645
+ Awaited: () => Awaited,
2646
+ BigInt: () => BigInt2,
2647
+ Boolean: () => Boolean2,
2648
+ Capitalize: () => Capitalize,
2649
+ Composite: () => Composite,
2650
+ Const: () => Const,
2651
+ Constructor: () => Constructor,
2652
+ ConstructorParameters: () => ConstructorParameters,
2653
+ Date: () => Date2,
2654
+ Enum: () => Enum,
2655
+ Exclude: () => Exclude,
2656
+ Extends: () => Extends,
2657
+ Extract: () => Extract,
2658
+ Function: () => Function,
2659
+ Index: () => Index,
2660
+ InstanceType: () => InstanceType,
2661
+ Instantiate: () => Instantiate,
2662
+ Integer: () => Integer,
2663
+ Intersect: () => Intersect,
2664
+ Iterator: () => Iterator,
2665
+ KeyOf: () => KeyOf,
2666
+ Literal: () => Literal,
2667
+ Lowercase: () => Lowercase,
2668
+ Mapped: () => Mapped,
2669
+ Module: () => Module,
2670
+ Never: () => Never,
2671
+ Not: () => Not2,
2672
+ Null: () => Null,
2673
+ Number: () => Number2,
2674
+ Object: () => Object2,
2675
+ Omit: () => Omit,
2676
+ Optional: () => Optional,
2677
+ Parameters: () => Parameters,
2678
+ Partial: () => Partial,
2679
+ Pick: () => Pick,
2680
+ Promise: () => Promise2,
2681
+ Readonly: () => Readonly,
2682
+ ReadonlyOptional: () => ReadonlyOptional,
2683
+ Record: () => Record,
2684
+ Recursive: () => Recursive,
2685
+ Ref: () => Ref,
2686
+ RegExp: () => RegExp2,
2687
+ Required: () => Required,
2688
+ Rest: () => Rest,
2689
+ ReturnType: () => ReturnType,
2690
+ String: () => String2,
2691
+ Symbol: () => Symbol2,
2692
+ TemplateLiteral: () => TemplateLiteral,
2693
+ Transform: () => Transform,
2694
+ Tuple: () => Tuple,
2695
+ Uint8Array: () => Uint8Array2,
2696
+ Uncapitalize: () => Uncapitalize,
2697
+ Undefined: () => Undefined,
2698
+ Union: () => Union,
2699
+ Unknown: () => Unknown,
2700
+ Unsafe: () => Unsafe,
2701
+ Uppercase: () => Uppercase,
2702
+ Void: () => Void
2703
2703
  });
2704
2704
 
2705
2705
  // node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
@@ -5576,13 +5576,13 @@ function Default5(...args) {
5576
5576
  // node_modules/@sinclair/typebox/build/esm/value/pointer/pointer.mjs
5577
5577
  var exports_pointer = {};
5578
5578
  __export(exports_pointer, {
5579
- ValuePointerRootSetError: () => ValuePointerRootSetError,
5580
- ValuePointerRootDeleteError: () => ValuePointerRootDeleteError,
5581
- Set: () => Set4,
5582
- Has: () => Has3,
5583
- Get: () => Get3,
5579
+ Delete: () => Delete3,
5584
5580
  Format: () => Format,
5585
- Delete: () => Delete3
5581
+ Get: () => Get3,
5582
+ Has: () => Has3,
5583
+ Set: () => Set4,
5584
+ ValuePointerRootDeleteError: () => ValuePointerRootDeleteError,
5585
+ ValuePointerRootSetError: () => ValuePointerRootSetError
5586
5586
  });
5587
5587
  class ValuePointerRootSetError extends TypeBoxError {
5588
5588
  constructor(value, path, update) {
@@ -5999,25 +5999,25 @@ function Parse(...args) {
5999
5999
  // node_modules/@sinclair/typebox/build/esm/value/value/value.mjs
6000
6000
  var exports_value2 = {};
6001
6001
  __export(exports_value2, {
6002
- ValueErrorIterator: () => ValueErrorIterator,
6003
- Patch: () => Patch,
6004
- Parse: () => Parse,
6005
- Mutate: () => Mutate,
6006
- Hash: () => Hash,
6007
- Errors: () => Errors,
6008
- Equal: () => Equal,
6009
- Encode: () => Encode,
6010
- Edit: () => Edit,
6011
- Diff: () => Diff,
6012
- Default: () => Default5,
6013
- Decode: () => Decode,
6014
- Create: () => Create2,
6015
- Convert: () => Convert,
6016
- Clone: () => Clone2,
6017
- Clean: () => Clean,
6018
- Check: () => Check,
6002
+ Assert: () => Assert,
6019
6003
  Cast: () => Cast,
6020
- Assert: () => Assert
6004
+ Check: () => Check,
6005
+ Clean: () => Clean,
6006
+ Clone: () => Clone2,
6007
+ Convert: () => Convert,
6008
+ Create: () => Create2,
6009
+ Decode: () => Decode,
6010
+ Default: () => Default5,
6011
+ Diff: () => Diff,
6012
+ Edit: () => Edit,
6013
+ Encode: () => Encode,
6014
+ Equal: () => Equal,
6015
+ Errors: () => Errors,
6016
+ Hash: () => Hash,
6017
+ Mutate: () => Mutate,
6018
+ Parse: () => Parse,
6019
+ Patch: () => Patch,
6020
+ ValueErrorIterator: () => ValueErrorIterator
6021
6021
  });
6022
6022
  // src/shared/schema.ts
6023
6023
  function schemaErrorPath(path) {
@@ -6463,7 +6463,7 @@ var ACTION_POLICY = {
6463
6463
  local: ["list"]
6464
6464
  },
6465
6465
  database: {
6466
- read: ["list_tables", "describe_columns", "list_indexes", "list_constraints", "list_extensions", "rls_status", "rls_policies", "list_auth_users", "get_auth_user", "connections", "stats", "slow_queries", "list_migrations", "migration_inventory", "project_url", "generate_types"],
6466
+ read: ["list_tables", "describe_columns", "list_indexes", "list_constraints", "list_extensions", "rls_status", "rls_policies", "list_auth_users", "get_auth_user", "connections", "stats", "slow_queries", "list_migrations", "migration_inventory", "project_url", "generate_types", "database_lint", "db_lint", "rpc_catalog", "list_rpcs"],
6467
6467
  local: ["lint_migrations", "lint"],
6468
6468
  write: ["query", "apply_migration", "push_migrations", "baseline_migrations", "create_table_rls"]
6469
6469
  },
@@ -8090,7 +8090,11 @@ function registerDatabaseTools(server, http, config = {}) {
8090
8090
  "list_migrations",
8091
8091
  "migration_inventory",
8092
8092
  "project_url",
8093
- "generate_types"
8093
+ "generate_types",
8094
+ "database_lint",
8095
+ "db_lint",
8096
+ "rpc_catalog",
8097
+ "list_rpcs"
8094
8098
  ];
8095
8099
  const writeActions = ["apply_migration", "push_migrations", "baseline_migrations", "create_table_rls"];
8096
8100
  const remoteActions = [...readActions, ...localActions];
@@ -8103,13 +8107,13 @@ Actions: ${allActions.join(", ")}${localOnly ? " (local-only mode)" : readOnly ?
8103
8107
  file: optional(Type.String(), "[query/apply_migration/lint_migrations/lint] Read SQL from local file path (avoids shell escaping issues with $$ and multi-statement DDL)"),
8104
8108
  dir: optional(Type.String(), "[push_migrations/baseline_migrations/lint_migrations/lint] Directory containing .sql migration files (default: supabase/migrations)"),
8105
8109
  dry_run: optional(Type.Boolean(), "[push_migrations/baseline_migrations] Preview changes without applying them"),
8106
- strict: optional(Type.Boolean(), "[push_migrations/lint_migrations/lint] Exit with error if high-risk destructive migrations are detected"),
8107
- fail_on_high: optional(Type.Boolean(), "[push_migrations/lint_migrations/lint] Alias for --strict"),
8110
+ strict: optional(Type.Boolean(), "[push_migrations/lint_migrations/lint/database_lint] Exit with error if high-risk issues or migrations are detected"),
8111
+ fail_on_high: optional(Type.Boolean(), "[push_migrations/lint_migrations/lint/database_lint] Alias for --strict"),
8108
8112
  fail_on_medium: optional(Type.Boolean(), "[push_migrations/lint_migrations/lint] Exit with error if medium-risk or high-risk migrations are detected"),
8109
- json: optional(Type.Boolean(), "[lint_migrations/lint] Output structured JSON analysis"),
8110
- schema: optional(Type.String(), "[describe_columns/list_indexes/list_constraints/rls_status/rls_policies/create_table_rls] Schema name (default: public)"),
8113
+ json: optional(Type.Boolean(), "[lint_migrations/lint/database_lint/rpc_catalog] Output structured JSON analysis"),
8114
+ schema: optional(Type.String(), "[describe_columns/list_indexes/list_constraints/rls_status/rls_policies/create_table_rls/database_lint] Schema name (default: public)"),
8111
8115
  table: optional(Type.String(), "[describe_columns/indexes/constraints/rls_*] Table name"),
8112
- schemas: optional(Type.Array(Type.String()), "[list_tables/generate_types] Schemas array"),
8116
+ schemas: optional(Type.Array(Type.String()), "[list_tables/generate_types/rpc_catalog] Schemas array"),
8113
8117
  user_id: optional(Type.String(), "[get_auth_user] User UUID"),
8114
8118
  limit: optional(Type.Number(), "[list_auth_users] Max users (default: 20)"),
8115
8119
  name: optional(Type.String(), "[apply_migration] Migration name"),
@@ -8510,6 +8514,41 @@ ${riskReport}`
8510
8514
  text = `✅ Table '${schema}.${args.table}' created with RLS (${policyMode === "owner" ? "auth.uid() owner policy" : "deny-all by default"})`;
8511
8515
  break;
8512
8516
  }
8517
+ case "database_lint":
8518
+ case "db_lint": {
8519
+ const targetSchema = args.schema || "public";
8520
+ const safeRef = projectRefPathSegment(ref, "database_lint");
8521
+ const r = await managementHttp().get(`/v1/projects/${safeRef}/database/linter?schema=${encodeURIComponent(targetSchema)}`);
8522
+ if (!r.ok) {
8523
+ return { content: [{ type: "text", text: `❌ Database lint request failed (${r.status})` }], isError: true };
8524
+ }
8525
+ if (args.json) {
8526
+ text = JSON.stringify(r.data, null, 2);
8527
+ } else {
8528
+ text = formatDatabaseLintReport(r.data);
8529
+ }
8530
+ const strict = args.strict === true || args.fail_on_high === true;
8531
+ const dangerCount = r.data?.danger_count || 0;
8532
+ if (strict && dangerCount > 0) {
8533
+ return { content: [{ type: "text", text }], isError: true };
8534
+ }
8535
+ break;
8536
+ }
8537
+ case "rpc_catalog":
8538
+ case "list_rpcs": {
8539
+ const schemasList = args.schemas && args.schemas.length > 0 ? args.schemas : args.schema ? [args.schema] : ["public", "api"];
8540
+ const safeRef = projectRefPathSegment(ref, "rpc_catalog");
8541
+ const r = await managementHttp().get(`/v1/projects/${safeRef}/database/rpc-catalog?schemas=${encodeURIComponent(schemasList.join(","))}`);
8542
+ if (!r.ok) {
8543
+ return { content: [{ type: "text", text: `❌ RPC catalog request failed (${r.status})` }], isError: true };
8544
+ }
8545
+ if (args.json) {
8546
+ text = JSON.stringify(r.data, null, 2);
8547
+ } else {
8548
+ text = formatRpcCatalog(r.data);
8549
+ }
8550
+ break;
8551
+ }
8513
8552
  default:
8514
8553
  text = `❌ Unknown action: ${action}`;
8515
8554
  }
@@ -8552,6 +8591,53 @@ function buildRlsPolicySql(qualifiedTable, policyMode, ownerColumnValue) {
8552
8591
  CREATE POLICY "SupaCloud owner update" ON ${qualifiedTable} FOR UPDATE TO authenticated USING (${predicate}) WITH CHECK (${predicate});
8553
8592
  CREATE POLICY "SupaCloud owner delete" ON ${qualifiedTable} FOR DELETE TO authenticated USING (${predicate});`;
8554
8593
  }
8594
+ function formatDatabaseLintReport(data) {
8595
+ if (!data || typeof data !== "object")
8596
+ return JSON.stringify(data, null, 2);
8597
+ const d = data;
8598
+ if (!d.issues || d.issues.length === 0) {
8599
+ return "✅ Database Lint: No issues found! Schema follows best practices for RLS, primary keys, and function security.";
8600
+ }
8601
+ const lines = [];
8602
+ const icon = (d.danger_count || 0) > 0 ? "\uD83D\uDD34" : (d.warning_count || 0) > 0 ? "\uD83D\uDFE1" : "ℹ️";
8603
+ lines.push(`${icon} Database Lint (${d.schema || "public"}): ${d.total_issues} issue(s) detected [${d.danger_count || 0} Danger, ${d.warning_count || 0} Warning, ${d.info_count || 0} Info]`);
8604
+ lines.push("");
8605
+ for (const issue of d.issues) {
8606
+ const itemIcon = issue.severity === "danger" ? "\uD83D\uDD34" : issue.severity === "warning" ? "\uD83D\uDFE1" : "ℹ️";
8607
+ lines.push(` ${itemIcon} [${issue.severity.toUpperCase()}] ${issue.schema_name}.${issue.object_name} (${issue.type})`);
8608
+ lines.push(` Detail: ${issue.detail}`);
8609
+ lines.push(` Recommendation: ${issue.recommendation}`);
8610
+ if (issue.fix_sql) {
8611
+ lines.push(` Fix SQL: ${issue.fix_sql}`);
8612
+ }
8613
+ lines.push("");
8614
+ }
8615
+ return lines.join(`
8616
+ `).trimEnd();
8617
+ }
8618
+ function formatRpcCatalog(data) {
8619
+ if (!data || typeof data !== "object")
8620
+ return JSON.stringify(data, null, 2);
8621
+ const d = data;
8622
+ if (!d.rpcs || d.rpcs.length === 0) {
8623
+ return `No RPC functions found in schema(s): ${(d.schemas || []).join(", ")}`;
8624
+ }
8625
+ const lines = [];
8626
+ lines.push(`\uD83D\uDCCB RPC Catalog (${d.total_rpcs || d.rpcs.length} total: ${d.commands || 0} commands, ${d.queries || 0} queries, ${d.internal || 0} internal)`);
8627
+ lines.push("");
8628
+ for (const rpc of d.rpcs) {
8629
+ const kindBadge = rpc.inferred_kind === "command" ? "⚡ [COMMAND]" : rpc.inferred_kind === "query" ? "\uD83D\uDD0D [QUERY]" : "\uD83D\uDD12 [INTERNAL]";
8630
+ const secBadge = rpc.security === "DEFINER" ? "\uD83D\uDEE1️ DEFINER" : "\uD83D\uDC64 INVOKER";
8631
+ lines.push(` ${kindBadge} ${rpc.schema_name}.${rpc.function_name}(${rpc.identity_args}) -> ${rpc.return_type}`);
8632
+ lines.push(` Security: ${secBadge} | Volatility: ${rpc.volatility}${rpc.search_path ? ` | search_path: ${rpc.search_path}` : ""}`);
8633
+ const tagEntries = Object.entries(rpc.smart_tags || {});
8634
+ if (tagEntries.length > 0) {
8635
+ lines.push(` Tags: ${tagEntries.map(([k, v]) => `@${k}${v === true ? "" : ` ${v}`}`).join(", ")}`);
8636
+ }
8637
+ }
8638
+ return lines.join(`
8639
+ `);
8640
+ }
8555
8641
  function formatSqlResult(data) {
8556
8642
  if (!data || typeof data !== "object")
8557
8643
  return JSON.stringify(data, null, 2);
@@ -14869,7 +14955,7 @@ function registerReleaseTools(server, http, options = {}) {
14869
14955
  // package.json
14870
14956
  var package_default = {
14871
14957
  name: "@supacloud/cli",
14872
- version: "0.34.1",
14958
+ version: "0.35.0",
14873
14959
  description: "Project-scoped CLI for SupaCloud users",
14874
14960
  type: "module",
14875
14961
  main: "./dist/index.js",
@@ -14903,7 +14989,7 @@ var package_default = {
14903
14989
  "@sinclair/typebox": "^0.34.52"
14904
14990
  },
14905
14991
  devDependencies: {
14906
- "@types/bun": "^1.3.14",
14992
+ "@types/bun": "^1.4.0",
14907
14993
  typescript: "^7.0.2"
14908
14994
  }
14909
14995
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/cli",
3
- "version": "0.34.1",
3
+ "version": "0.35.0",
4
4
  "description": "Project-scoped CLI for SupaCloud users",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,7 +34,7 @@
34
34
  "@sinclair/typebox": "^0.34.52"
35
35
  },
36
36
  "devDependencies": {
37
- "@types/bun": "^1.3.14",
37
+ "@types/bun": "^1.4.0",
38
38
  "typescript": "^7.0.2"
39
39
  }
40
40
  }