@runa-ai/runa-cli 0.5.53 → 0.5.58

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 (41) hide show
  1. package/dist/commands/build/machine.d.ts +6 -4
  2. package/dist/commands/build/machine.d.ts.map +1 -1
  3. package/dist/commands/ci/machine/actors/db/sync-schema.d.ts.map +1 -1
  4. package/dist/commands/ci/utils/app-runtime.d.ts +2 -0
  5. package/dist/commands/ci/utils/app-runtime.d.ts.map +1 -1
  6. package/dist/commands/db/commands/db-drizzle.d.ts.map +1 -1
  7. package/dist/commands/db/commands/db-lifecycle.d.ts.map +1 -1
  8. package/dist/commands/db/commands/db-seed-metadata.d.ts.map +1 -1
  9. package/dist/commands/db/sync/actors.d.ts +1 -0
  10. package/dist/commands/db/sync/actors.d.ts.map +1 -1
  11. package/dist/commands/db/sync/contract.d.ts +4 -1
  12. package/dist/commands/db/sync/contract.d.ts.map +1 -1
  13. package/dist/commands/db/sync/machine.d.ts +1 -0
  14. package/dist/commands/db/sync/machine.d.ts.map +1 -1
  15. package/dist/commands/db/types.d.ts +2 -0
  16. package/dist/commands/db/types.d.ts.map +1 -1
  17. package/dist/commands/db/utils/table-registry.d.ts +4 -0
  18. package/dist/commands/db/utils/table-registry.d.ts.map +1 -1
  19. package/dist/commands/db/utils/table-source-classifier.d.ts +28 -0
  20. package/dist/commands/db/utils/table-source-classifier.d.ts.map +1 -0
  21. package/dist/commands/dev/commands/dev.d.ts +2 -0
  22. package/dist/commands/dev/commands/dev.d.ts.map +1 -1
  23. package/dist/commands/dev/contract.d.ts +5 -0
  24. package/dist/commands/dev/contract.d.ts.map +1 -1
  25. package/dist/commands/dev/machine.d.ts +21 -7
  26. package/dist/commands/dev/machine.d.ts.map +1 -1
  27. package/dist/commands/env/commands/env-pull.d.ts.map +1 -1
  28. package/dist/commands/env/constants/local-supabase.d.ts +4 -2
  29. package/dist/commands/env/constants/local-supabase.d.ts.map +1 -1
  30. package/dist/commands/hotfix/metadata.d.ts.map +1 -1
  31. package/dist/commands/inject-test-attrs/processor-utils.d.ts.map +1 -1
  32. package/dist/commands/inject-test-attrs/processor.d.ts.map +1 -1
  33. package/dist/constants/versions.d.ts +1 -1
  34. package/dist/errors/catalog.d.ts +8 -0
  35. package/dist/errors/catalog.d.ts.map +1 -1
  36. package/dist/index.js +857 -432
  37. package/dist/utils/path-security.d.ts +18 -0
  38. package/dist/utils/path-security.d.ts.map +1 -1
  39. package/dist/utils/port-allocator.d.ts +34 -37
  40. package/dist/utils/port-allocator.d.ts.map +1 -1
  41. package/package.json +8 -8
@@ -97,4 +97,22 @@ export declare function buildSafeEnvFilePath(projectRoot: string, envName: strin
97
97
  * @returns true if targetPath is within basePath
98
98
  */
99
99
  export declare function isPathContained(basePath: string, targetPath: string): boolean;
100
+ /**
101
+ * SECURITY (Issue #651): Validate a user-provided file path (absolute or relative).
102
+ * Resolves the path and validates that it stays within the allowed base directory.
103
+ *
104
+ * Unlike validateSafePath(), this accepts absolute paths that are within baseDir.
105
+ * Use this for CLI arguments like --file, --config, --output where users may
106
+ * provide either relative or absolute paths.
107
+ *
108
+ * Security checks:
109
+ * 1. Path doesn't contain dangerous characters (shell metacharacters, control chars)
110
+ * 2. Resolved path (including symlink targets) is within baseDir
111
+ *
112
+ * @param filePath - User-provided file path (can be relative or absolute)
113
+ * @param baseDir - The directory the file must be contained within
114
+ * @returns The validated absolute path
115
+ * @throws Error if validation fails
116
+ */
117
+ export declare function validateUserFilePath(filePath: string, baseDir: string): string;
100
118
  //# sourceMappingURL=path-security.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"path-security.d.ts","sourceRoot":"","sources":["../../src/utils/path-security.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAyCH;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAc7D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ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GAQG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CASzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE;IAAE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GACvC,MAAM,EAAE,CAQV;AAMD;;;GAGG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAQhD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAiBtD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,MAAM,CAehG;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAS7E;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAqB9E"}
@@ -1,50 +1,47 @@
1
1
  /**
2
- * AI HINT: Dynamic port allocation for Supabase local development
2
+ * AI HINT: CLI wrapper for Supabase port allocation
3
3
  *
4
- * Purpose: Prevent port conflicts when running multiple pj-repos simultaneously.
5
- * Since pj-repos cannot share state, we use a deterministic hash-based approach
6
- * where the project path determines the port offset.
4
+ * Purpose: Thin wrapper around SDK's port-offset module.
5
+ * The algorithm lives in @runa-ai/runa (SDK) as the single source of truth.
6
+ * This module provides CLI-specific functions (config.toml update, summary).
7
7
  *
8
- * Port ranges (10 ports per slot, 100 slots):
9
- * Slot 0: 54321-54330
10
- * Slot 1: 54331-54340
11
- * ...
12
- * Slot 99: 55311-55320
13
- *
14
- * Port assignments within a slot:
15
- * +0: API (Kong gateway)
16
- * +1: DB (PostgreSQL)
17
- * +2: Studio
18
- * +3: Inbucket (email testing)
19
- * +4: JWT verification
20
- * +5: Auth
21
- * +6: REST (PostgREST)
22
- * +7: Realtime
23
- * +8: Storage
24
- * +9: Reserved
25
- */
26
- export interface SupabasePorts {
27
- api: number;
28
- db: number;
29
- studio: number;
30
- inbucket: number;
31
- auth: number;
32
- rest: number;
33
- realtime: number;
34
- storage: number;
35
- shadow: number;
36
- }
37
- /**
38
- * Calculate port offset from project path using MD5 hash.
39
- * Same path always produces same offset (deterministic).
8
+ * IMPORTANT: Do NOT add port calculation logic here.
9
+ * All calculation is delegated to SDK's port-offset.ts.
40
10
  */
41
- export declare function calculatePortOffset(projectPath: string): number;
11
+ import { type SupabasePorts } from '@runa-ai/runa';
12
+ export type { SupabasePorts };
42
13
  /**
43
14
  * Get Supabase ports for a project based on its path.
15
+ * Deterministic (hash-based), no runtime check.
44
16
  */
45
17
  export declare function getSupabasePorts(projectPath: string): SupabasePorts;
18
+ /**
19
+ * Get available Supabase ports with runtime conflict detection.
20
+ *
21
+ * 1. Calculate hash-based ports (deterministic)
22
+ * 2. Check if ports are actually free (TCP bind test)
23
+ * 3. If occupied, try adjacent slots as fallback
24
+ *
25
+ * @returns Ports and metadata, or null if no slots available
26
+ */
27
+ export declare function getAvailableSupabasePorts(projectPath: string): Promise<{
28
+ ports: SupabasePorts;
29
+ offset: number;
30
+ slot: number;
31
+ retried: boolean;
32
+ } | null>;
46
33
  /**
47
34
  * Update supabase/config.toml with allocated ports.
35
+ * Uses runtime-safe port resolution (checks availability, falls back on conflict).
36
+ */
37
+ export declare function updateSupabaseConfigPortsSafe(projectPath: string): Promise<{
38
+ updated: boolean;
39
+ ports: SupabasePorts;
40
+ configPath: string;
41
+ retried: boolean;
42
+ }>;
43
+ /**
44
+ * Update supabase/config.toml with allocated ports (deterministic, no runtime check).
48
45
  * Preserves other settings and comments.
49
46
  */
50
47
  export declare function updateSupabaseConfigPorts(projectPath: string): {
@@ -1 +1 @@
1
- {"version":3,"file":"port-allocator.d.ts","sourceRoot":"","sources":["../../src/utils/port-allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAUH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAI/D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CAenE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAwCA;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAYpE"}
1
+ {"version":3,"file":"port-allocator.d.ts","sourceRoot":"","sources":["../../src/utils/port-allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CAGnE;AAED;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5E,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,IAAI,CAAC,CAER;AAED;;;GAGG;AACH,wBAAsB,6BAA6B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAChF,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CAgBD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAUA;AAsCD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAYpE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runa-ai/runa-cli",
3
- "version": "0.5.53",
3
+ "version": "0.5.58",
4
4
  "private": false,
5
5
  "description": "AI-powered DevOps CLI",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "@dotenvx/dotenvx": "1.51.4",
29
+ "@dotenvx/dotenvx": "1.52.0",
30
30
  "@types/node": "22.19.3",
31
31
  "boxen": "7.1.1",
32
32
  "chalk": "5.6.2",
@@ -46,15 +46,15 @@
46
46
  "ora": "8.2.0",
47
47
  "p-queue": "8.1.1",
48
48
  "postgres": "3.4.8",
49
- "react": "19.2.3",
49
+ "react": "19.2.4",
50
50
  "systeminformation": "5.30.2",
51
51
  "ts-morph": "25.0.1",
52
52
  "tsup": "8.5.1",
53
53
  "typescript": "5.9.3",
54
- "xstate": "5.25.0",
55
- "zod": "4.3.5",
56
- "@runa-ai/runa-xstate-test-plugin": "0.5.35",
57
- "@runa-ai/runa": "0.5.44"
54
+ "xstate": "5.28.0",
55
+ "zod": "4.3.6",
56
+ "@runa-ai/runa": "0.5.58",
57
+ "@runa-ai/runa-xstate-test-plugin": "0.5.58"
58
58
  },
59
59
  "engines": {
60
60
  "node": ">=20.0.0"
@@ -62,7 +62,7 @@
62
62
  "devDependencies": {
63
63
  "@types/js-yaml": "4.0.9",
64
64
  "@types/node-notifier": "8.0.5",
65
- "@types/react": "19.2.7"
65
+ "@types/react": "19.2.14"
66
66
  },
67
67
  "scripts": {
68
68
  "build:esm": "tsup",