@happyvertical/smrt-cli 0.51.32 → 0.51.34

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 (138) hide show
  1. package/dist/{ApiKey-BZmbOTnL-DrxlAZO2.js → ApiKey-BZmbOTnL-JfLnIQ6j.js} +2 -2
  2. package/dist/ApiKeyCollection-Bfb_nw81-_5gxJejo.js +2 -0
  3. package/dist/AuditLogCollection-B1YonCAP-BFcVltyZ.js +2 -0
  4. package/dist/{NostrIdentity-n70E0vck-5rGYvFIY.js → NostrIdentity-n70E0vck-BzRIy0qp.js} +3 -3
  5. package/dist/NostrIdentityCollection-Ca74dkaL-DPePp9q6.js +2 -0
  6. package/dist/{OidcIdentity-K8V4u0CR-dzykFMgp.js → OidcIdentity-K8V4u0CR-o7KNIeg4.js} +2 -2
  7. package/dist/OidcIdentityCollection-gnrLoF08-DIw8_KSV.js +2 -0
  8. package/dist/ProfileAssetCollection-CmbeSgDi-C7RLxrYM.js +2 -0
  9. package/dist/{ProfileCollection-DTT4KNpQ-C3tIYhbK.js → ProfileCollection-DTT4KNpQ-Dwt508DW.js} +25 -25
  10. package/dist/{ProfileMetadataCollection-DxX_BJKV-B3TOG70O.js → ProfileMetadataCollection-DxX_BJKV-DKnpI2Ar.js} +1 -1
  11. package/dist/{ProfileMetafieldCollection-CMKhVi2I-C6uF97rV.js → ProfileMetafieldCollection-CMKhVi2I-Boh07hX4.js} +1 -1
  12. package/dist/{ProfileRelationshipCollection-DUVgaIqf-DhrHpup7.js → ProfileRelationshipCollection-DUVgaIqf-lOgRKFt1.js} +1 -1
  13. package/dist/{ProfileRelationshipTermCollection-DtA9OM23-aafuXvJi.js → ProfileRelationshipTermCollection-DtA9OM23-mMN1QGom.js} +1 -1
  14. package/dist/{ProfileRelationshipType-BRiRka6t-CiAcDP3Y.js → ProfileRelationshipType-BRiRka6t-CSD43mZV.js} +1 -1
  15. package/dist/{ProfileRelationshipTypeCollection-BdXwd7Kf-Y4bfpu34.js → ProfileRelationshipTypeCollection-BdXwd7Kf-Cwl7qAYl.js} +1 -1
  16. package/dist/cli-generator.d.ts +243 -0
  17. package/dist/cli-generator.d.ts.map +1 -0
  18. package/dist/commands/config-export.d.ts +9 -0
  19. package/dist/commands/config-export.d.ts.map +1 -0
  20. package/dist/commands/db-command-utils.d.ts +24 -0
  21. package/dist/commands/db-command-utils.d.ts.map +1 -0
  22. package/dist/commands/db-diff.d.ts +8 -0
  23. package/dist/commands/db-diff.d.ts.map +1 -0
  24. package/dist/commands/db-drop-framework-base-tables.d.ts +28 -0
  25. package/dist/commands/db-drop-framework-base-tables.d.ts.map +1 -0
  26. package/dist/commands/db-generate.d.ts +9 -0
  27. package/dist/commands/db-generate.d.ts.map +1 -0
  28. package/dist/commands/db-history.d.ts +8 -0
  29. package/dist/commands/db-history.d.ts.map +1 -0
  30. package/dist/commands/db-materialize-tenant-hierarchy.d.ts +12 -0
  31. package/dist/commands/db-materialize-tenant-hierarchy.d.ts.map +1 -0
  32. package/dist/commands/db-migrate-actions.d.ts +338 -0
  33. package/dist/commands/db-migrate-actions.d.ts.map +1 -0
  34. package/dist/commands/db-migrate-agent-schedule-slugs.d.ts +3 -0
  35. package/dist/commands/db-migrate-agent-schedule-slugs.d.ts.map +1 -0
  36. package/dist/commands/db-migrate-int8.d.ts +11 -0
  37. package/dist/commands/db-migrate-int8.d.ts.map +1 -0
  38. package/dist/commands/db-migrate-ledger-accounts.d.ts +8 -0
  39. package/dist/commands/db-migrate-ledger-accounts.d.ts.map +1 -0
  40. package/dist/commands/db-migrate-null-equal-indexes.d.ts +3 -0
  41. package/dist/commands/db-migrate-null-equal-indexes.d.ts.map +1 -0
  42. package/dist/commands/db-migrate-uuid.d.ts +171 -0
  43. package/dist/commands/db-migrate-uuid.d.ts.map +1 -0
  44. package/dist/commands/db-orphans.d.ts +39 -0
  45. package/dist/commands/db-orphans.d.ts.map +1 -0
  46. package/dist/commands/db-parity.d.ts +70 -0
  47. package/dist/commands/db-parity.d.ts.map +1 -0
  48. package/dist/commands/db-permissions.d.ts +19 -0
  49. package/dist/commands/db-permissions.d.ts.map +1 -0
  50. package/dist/commands/db-prune.d.ts +70 -0
  51. package/dist/commands/db-prune.d.ts.map +1 -0
  52. package/dist/commands/db-rollback.d.ts +44 -0
  53. package/dist/commands/db-rollback.d.ts.map +1 -0
  54. package/dist/commands/db-status.d.ts +91 -0
  55. package/dist/commands/db-status.d.ts.map +1 -0
  56. package/dist/commands/dev-knowledge.d.ts +10 -0
  57. package/dist/commands/dev-knowledge.d.ts.map +1 -0
  58. package/dist/commands/dev-runtime.d.ts +14 -0
  59. package/dist/commands/dev-runtime.d.ts.map +1 -0
  60. package/dist/commands/dispatch.d.ts +11 -0
  61. package/dist/commands/dispatch.d.ts.map +1 -0
  62. package/dist/commands/docs-claude.d.ts +44 -0
  63. package/dist/commands/docs-claude.d.ts.map +1 -0
  64. package/dist/commands/export.d.ts +31 -0
  65. package/dist/commands/export.d.ts.map +1 -0
  66. package/dist/commands/generate.d.ts +12 -0
  67. package/dist/commands/generate.d.ts.map +1 -0
  68. package/dist/commands/git.d.ts +41 -0
  69. package/dist/commands/git.d.ts.map +1 -0
  70. package/dist/commands/gnode.d.ts +11 -0
  71. package/dist/commands/gnode.d.ts.map +1 -0
  72. package/dist/commands/index.d.ts +23 -0
  73. package/dist/commands/index.d.ts.map +1 -0
  74. package/dist/commands/init.d.ts +11 -0
  75. package/dist/commands/init.d.ts.map +1 -0
  76. package/dist/commands/json-validator.d.ts +155 -0
  77. package/dist/commands/json-validator.d.ts.map +1 -0
  78. package/dist/commands/migration-failure-analysis.d.ts +12 -0
  79. package/dist/commands/migration-failure-analysis.d.ts.map +1 -0
  80. package/dist/commands/playground.d.ts +8 -0
  81. package/dist/commands/playground.d.ts.map +1 -0
  82. package/dist/commands/postgres-timestamp-migration.d.ts +11 -0
  83. package/dist/commands/postgres-timestamp-migration.d.ts.map +1 -0
  84. package/dist/commands/runtime-check-command.d.ts +5 -0
  85. package/dist/commands/runtime-check-command.d.ts.map +1 -0
  86. package/dist/commands/schema-contract.d.ts +83 -0
  87. package/dist/commands/schema-contract.d.ts.map +1 -0
  88. package/dist/commands/sti-upgrade.d.ts +51 -0
  89. package/dist/commands/sti-upgrade.d.ts.map +1 -0
  90. package/dist/commands/utilities.d.ts +134 -0
  91. package/dist/commands/utilities.d.ts.map +1 -0
  92. package/dist/commands/validation-types.d.ts +119 -0
  93. package/dist/commands/validation-types.d.ts.map +1 -0
  94. package/dist/commands/workbench.d.ts +8 -0
  95. package/dist/commands/workbench.d.ts.map +1 -0
  96. package/dist/{commands-Aw8Wv-GM.js → commands-C7WDl_If.js} +2 -2
  97. package/dist/config.d.ts +70 -0
  98. package/dist/config.d.ts.map +1 -0
  99. package/dist/discovery/index.d.ts +6 -0
  100. package/dist/discovery/index.d.ts.map +1 -0
  101. package/dist/discovery/manifest-discovery.d.ts +67 -0
  102. package/dist/discovery/manifest-discovery.d.ts.map +1 -0
  103. package/dist/discovery/manifest-identity.d.ts +10 -0
  104. package/dist/discovery/manifest-identity.d.ts.map +1 -0
  105. package/dist/{dist-CcLtprDR.js → dist-CNOG5p8Z.js} +25 -25
  106. package/dist/{dist-DC1d_zi0.js → dist-DYD23nTD.js} +4 -4
  107. package/dist/{dist-D4TtU64x.js → dist-DmGJ_5JC.js} +2 -2
  108. package/dist/{dist-DXDf5-e6.js → dist-ZbQpS6Dq.js} +3 -3
  109. package/dist/index.d.ts +9 -1
  110. package/dist/index.d.ts.map +1 -0
  111. package/dist/index.js +9 -9
  112. package/dist/loaders/class-loader.d.ts +53 -0
  113. package/dist/loaders/class-loader.d.ts.map +1 -0
  114. package/dist/loaders/git-loader.d.ts +36 -0
  115. package/dist/loaders/git-loader.d.ts.map +1 -0
  116. package/dist/loaders/index.d.ts +9 -0
  117. package/dist/loaders/index.d.ts.map +1 -0
  118. package/dist/loaders/local-loader.d.ts +23 -0
  119. package/dist/loaders/local-loader.d.ts.map +1 -0
  120. package/dist/loaders/npm-loader.d.ts +40 -0
  121. package/dist/loaders/npm-loader.d.ts.map +1 -0
  122. package/dist/loaders/template-loader.d.ts +62 -0
  123. package/dist/loaders/template-loader.d.ts.map +1 -0
  124. package/dist/{oidcProvisioningPrimitives-0-3n3D6f-D9PpE0-s.js → oidcProvisioningPrimitives-0-3n3D6f-B1oMY_f8.js} +4 -4
  125. package/dist/resolveIdentity-BrJDCjYi-NNHX6Mvn.js +2 -0
  126. package/dist/runtime-check.d.ts +19 -0
  127. package/dist/runtime-check.d.ts.map +1 -0
  128. package/dist/utils/generator.d.ts +48 -0
  129. package/dist/utils/generator.d.ts.map +1 -0
  130. package/dist/utils/index.d.ts +5 -0
  131. package/dist/utils/index.d.ts.map +1 -0
  132. package/package.json +10 -12
  133. package/dist/ApiKeyCollection-Bfb_nw81-DP5f5QpC.js +0 -2
  134. package/dist/AuditLogCollection-B1YonCAP-CZBxKq4A.js +0 -2
  135. package/dist/NostrIdentityCollection-Ca74dkaL-C6qq3z-e.js +0 -2
  136. package/dist/OidcIdentityCollection-gnrLoF08-CtNhKu9y.js +0 -2
  137. package/dist/ProfileAssetCollection-CmbeSgDi-C7T6rlyL.js +0 -2
  138. package/dist/resolveIdentity-BrJDCjYi-BafhqSQm.js +0 -2
@@ -0,0 +1,70 @@
1
+ /**
2
+ * CLI Configuration Schema
3
+ *
4
+ * Defines configuration options for the SMRT CLI tool.
5
+ * Uses @happyvertical/smrt-config for loading and merging configuration.
6
+ */
7
+ import type { MigrationsConfig, MigrationsPostgresConfig, PostgresPermissionsConfig, SchemaContractConfig } from '@happyvertical/smrt-config';
8
+ export type { MigrationsConfig, MigrationsPostgresConfig, PostgresPermissionsConfig, SchemaContractConfig, };
9
+ export interface CLIConfig {
10
+ postgresPermissions?: PostgresPermissionsConfig;
11
+ /**
12
+ * Entry point file to load SMRT classes from.
13
+ * If null, auto-detected from package.json (main or exports fields).
14
+ * @default null (auto-detect)
15
+ */
16
+ entryPoint?: string | null;
17
+ /**
18
+ * Database configuration for CLI operations.
19
+ */
20
+ database?: {
21
+ /**
22
+ * Database type
23
+ * @default 'sqlite'
24
+ */
25
+ type?: 'sqlite' | 'postgres';
26
+ /**
27
+ * Database connection URL
28
+ * @default ':memory:' (in-memory SQLite)
29
+ */
30
+ url?: string;
31
+ };
32
+ /**
33
+ * Migration configuration
34
+ */
35
+ migrations?: MigrationsConfig;
36
+ /**
37
+ * Required manifest/object/field/database-shape contract for schema commands.
38
+ */
39
+ schemaContract?: SchemaContractConfig;
40
+ /**
41
+ * Enable verbose output for debugging
42
+ * @default false
43
+ */
44
+ verbose?: boolean;
45
+ /**
46
+ * Default output format for commands
47
+ * @default 'table'
48
+ */
49
+ format?: 'table' | 'json' | 'yaml' | 'plain';
50
+ /**
51
+ * Command timeout in milliseconds
52
+ * @default 30000 (30 seconds)
53
+ */
54
+ timeout?: number;
55
+ /**
56
+ * Enable colored output
57
+ * @default true
58
+ */
59
+ colors?: boolean;
60
+ /**
61
+ * Enable interactive prompts
62
+ * @default true (false in CI environments)
63
+ */
64
+ interactive?: boolean;
65
+ }
66
+ /**
67
+ * Default CLI configuration values
68
+ */
69
+ export declare const DEFAULT_CLI_CONFIG: Required<Omit<CLIConfig, 'postgresPermissions'>> & Pick<CLIConfig, 'postgresPermissions'>;
70
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAGpC,YAAY,EACV,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,GACrB,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,mBAAmB,CAAC,EAAE,yBAAyB,CAAC;IAChD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT;;;WAGG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;QAE7B;;;WAGG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IAEF;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAE9B;;OAEG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;IAEtC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAE7C;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CACvC,IAAI,CAAC,SAAS,EAAE,qBAAqB,CAAC,CACvC,GACC,IAAI,CAAC,SAAS,EAAE,qBAAqB,CAyBtC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Discovery module - Automatic manifest and object discovery
3
+ */
4
+ export { autoDiscoverAndLoad, type DiscoveredManifest, discoverManifests, loadManifest, loadManifestFile, } from './manifest-discovery.js';
5
+ export { resolveManifestEntryPackageName } from './manifest-identity.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/discovery/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Manifest Discovery System
3
+ *
4
+ * Automatically discovers and loads SMRT object manifests from:
5
+ * - Project root (static-manifest.js, manifest.json)
6
+ * - Installed packages in node_modules
7
+ */
8
+ export interface DiscoveredManifest {
9
+ path: string;
10
+ source: 'project' | 'package';
11
+ packageName?: string;
12
+ packageVersion?: string;
13
+ objectCount: number;
14
+ objectNames?: string[];
15
+ /**
16
+ * SMRT packages the manifest declares as consumed dependencies.
17
+ *
18
+ * A pure-consumer project has no objects of its own; this is what tells
19
+ * schema commands that its manifest is a real build output rather than an
20
+ * empty placeholder (issue #2925).
21
+ */
22
+ smrtDependencies?: string[];
23
+ }
24
+ /**
25
+ * Loosely-typed view of a manifest file as loaded from disk. The file is
26
+ * untrusted JSON (or a re-exported module), so `objects` and other members are
27
+ * narrowed/cast by callers. The index signature keeps arbitrary fields readable
28
+ * without falling back to `any`.
29
+ */
30
+ export interface LoadedManifestFile {
31
+ objects?: Record<string, unknown>;
32
+ packageName?: string;
33
+ version?: string;
34
+ smrtDependencies?: unknown;
35
+ [key: string]: unknown;
36
+ }
37
+ /**
38
+ * Error thrown when multiple versions of SMRT packages are detected
39
+ */
40
+ export declare class SmrtVersionConflictError extends Error {
41
+ constructor(conflicts: Map<string, Set<string>>);
42
+ }
43
+ /**
44
+ * Discover manifest files in the project and installed packages
45
+ */
46
+ export declare function discoverManifests(projectRoot?: string): Promise<DiscoveredManifest[]>;
47
+ /**
48
+ * Load a manifest file (handles both .js and .json)
49
+ */
50
+ export declare function loadManifestFile(manifestPath: string): Promise<LoadedManifestFile>;
51
+ /**
52
+ * Load and register objects from a manifest into the ObjectRegistry.
53
+ *
54
+ * This enables db:migrate (and other CLI commands) to discover schema
55
+ * definitions from package manifests — including locally-linked packages.
56
+ */
57
+ export declare function loadManifest(manifestPath: string): Promise<void>;
58
+ /**
59
+ * Auto-discover and load all manifests in the project.
60
+ *
61
+ * @throws {SmrtVersionConflictError} If multiple versions of SMRT packages are detected
62
+ */
63
+ export declare function autoDiscoverAndLoad(projectRoot?: string): Promise<{
64
+ discovered: DiscoveredManifest[];
65
+ totalObjects: number;
66
+ }>;
67
+ //# sourceMappingURL=manifest-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-discovery.d.ts","sourceRoot":"","sources":["../../src/discovery/manifest-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAQD;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CA0ChD;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,GAAE,MAAsB,GAClC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAY/B;AA0LD;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,CAY7B;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBtE;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,GAAE,MAAsB,GAClC,OAAO,CAAC;IACT,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC,CAyBD"}
@@ -0,0 +1,10 @@
1
+ import type { SmartObjectDefinition } from '@happyvertical/smrt-core';
2
+ /**
3
+ * Resolve the package that owns one manifest entry.
4
+ *
5
+ * Aggregate consumer manifests contain dependency entries alongside local
6
+ * objects. Entry-level provenance must win over the containing manifest so
7
+ * those dependencies retain their qualified registry identities.
8
+ */
9
+ export declare function resolveManifestEntryPackageName(name: string, definition: SmartObjectDefinition, fallback?: string): string | undefined;
10
+ //# sourceMappingURL=manifest-identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-identity.d.ts","sourceRoot":"","sources":["../../src/discovery/manifest-identity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGtE;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,qBAAqB,EACjC,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CAapB"}