@prisma/orm-toolchain 8.0.0-rc.11-dev.56 → 8.0.0-rc.12-dev.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.
Files changed (32) hide show
  1. package/dist/cli-telemetry.d.mts +1 -1
  2. package/dist/cli-telemetry.mjs +9 -4
  3. package/dist/cli-telemetry.mjs.map +1 -1
  4. package/dist/cli.d.mts +8 -11
  5. package/dist/cli.d.mts.map +1 -1
  6. package/dist/cli.mjs +62 -229
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/cli__control-api.d.mts +8 -12
  9. package/dist/cli__control-api.d.mts.map +1 -1
  10. package/dist/cli__control-api.mjs +1 -1
  11. package/dist/cli__control-api__testing.d.mts +1 -1
  12. package/dist/cli__migration-cli.mjs +1 -1
  13. package/dist/config-loader.d.mts +2 -2
  14. package/dist/config-loader.mjs +2 -2
  15. package/dist/{db-verify-BkwsVjIf-BQHjqQoO.d.mts → db-verify-DyjbIXfH-Bk68qPoB.d.mts} +8 -8
  16. package/dist/{db-verify-BkwsVjIf-BQHjqQoO.d.mts.map → db-verify-DyjbIXfH-Bk68qPoB.d.mts.map} +1 -1
  17. package/dist/exports-BOv2LgXz.mjs +518 -0
  18. package/dist/exports-BOv2LgXz.mjs.map +1 -0
  19. package/dist/{exports-DVWNaJUr.mjs → exports-DpFO5X4j.mjs} +2 -2
  20. package/dist/{exports-DVWNaJUr.mjs.map → exports-DpFO5X4j.mjs.map} +1 -1
  21. package/dist/index-D_KaEMoL.d.mts +195 -0
  22. package/dist/index-D_KaEMoL.d.mts.map +1 -0
  23. package/dist/{ref-CTp4Kvp--3Dgd8LXq.mjs → ref-BK7yr-IT-Dk0sxEcL.mjs} +25 -26
  24. package/dist/ref-BK7yr-IT-Dk0sxEcL.mjs.map +1 -0
  25. package/dist/vite-plugin-contract-emit.mjs +4 -4
  26. package/dist/vite-plugin-contract-emit.mjs.map +1 -1
  27. package/package.json +13 -13
  28. package/dist/exports-8-S4PGn0.mjs +0 -286
  29. package/dist/exports-8-S4PGn0.mjs.map +0 -1
  30. package/dist/index-DFX8XFLx.d.mts +0 -83
  31. package/dist/index-DFX8XFLx.d.mts.map +0 -1
  32. package/dist/ref-CTp4Kvp--3Dgd8LXq.mjs.map +0 -1
@@ -0,0 +1,195 @@
1
+ import { CliStructuredError } from "@prisma/orm-framework/errors/control";
2
+ import { Result } from "@prisma/orm-framework/utils/result";
3
+ import { ConfigSection, SectionProvenance } from "@prisma/cli-engine";
4
+ import { PrismaNextConfig, PrismaNextConfig as PrismaNextConfig$1 } from "@prisma/orm-framework/config/config-types";
5
+ //#region ../../../1-framework/3-tooling/config-loader/dist/exports/index.d.mts
6
+ //#region src/expand-contract-inputs.d.ts
7
+ /**
8
+ * Expands a finalized contract source input list into its member file set:
9
+ * absolute, deduped by canonical path, sorted. `patterns` must already be
10
+ * absolute (the `orm` config schema resolves each entry against the config
11
+ * file that wrote it but does not expand it).
12
+ *
13
+ * A wildcard-free entry (per tinyglobby's own magic-character check) passes
14
+ * through verbatim — no globbing, no existence check, no directory
15
+ * expansion — so a literal file, a nonexistent path (its read error
16
+ * surfaces downstream), and a directory (`contract-prisma7`'s adoption
17
+ * surface) all reach the result unchanged. Only entries containing glob
18
+ * magic run through `tinyglobby`, directories-not-auto-expanded and
19
+ * files-only; a glob matching nothing contributes nothing — no diagnostic
20
+ * here.
21
+ */
22
+ declare function expandContractInputs(patterns: readonly string[] | undefined): Promise<readonly string[]>;
23
+ //#endregion
24
+ //#region src/orm-section.d.ts
25
+ /** The single config section the `orm` command family owns. */
26
+ declare const ORM_CONFIG_SECTION_NAME = "orm";
27
+ /**
28
+ * Top-level subsections of the `orm` section. Diagnostics carry the
29
+ * subsection they concern so commands can fail on the ones they read and
30
+ * ignore the rest.
31
+ */
32
+ type ConfigSection$1 = 'family' | 'target' | 'adapter' | 'driver' | 'extensions' | 'db' | 'contract' | 'migrations' | 'formatter';
33
+ declare function isConfigSection(value: string): value is ConfigSection$1;
34
+ /**
35
+ * The shape of the `orm` section of `prisma.config.ts`, declared once. The
36
+ * CLI engine derives validation, the diagnostics naming a bad field and the
37
+ * file to fix, and the resolution of every `path` field against the config
38
+ * file that wrote it (prisma-cli ADR 0005). Relative paths are resolved
39
+ * before any command sees the value, and the value carries `baseDir`.
40
+ */
41
+ declare const ormConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
42
+ family: {
43
+ emission: object;
44
+ id: string;
45
+ familyId: string;
46
+ version: string;
47
+ create: Function;
48
+ kind: "family";
49
+ };
50
+ target: {
51
+ targetId: string;
52
+ id: string;
53
+ familyId: string;
54
+ version: string;
55
+ create: Function;
56
+ kind: "target";
57
+ };
58
+ adapter: {
59
+ targetId: string;
60
+ id: string;
61
+ familyId: string;
62
+ version: string;
63
+ create: Function;
64
+ kind: "adapter";
65
+ };
66
+ migrations: import("arktype/internal/attributes.ts").Default<{
67
+ dir: (In: import("arktype/internal/attributes.ts").Default<string, string>) => import("arktype").Out<string>;
68
+ }, {}>;
69
+ driver?: {
70
+ targetId: string;
71
+ id: string;
72
+ familyId: string;
73
+ version: string;
74
+ create: Function;
75
+ kind: "driver";
76
+ };
77
+ extensions?: {
78
+ targetId: string;
79
+ id: string;
80
+ familyId: string;
81
+ version: string;
82
+ create: Function;
83
+ kind: "extension";
84
+ }[];
85
+ db?: {
86
+ connection?: unknown;
87
+ };
88
+ contract?: {
89
+ source: {
90
+ load: Function;
91
+ inputs?: ((In: string) => import("arktype").Out<string>)[];
92
+ format?: string;
93
+ };
94
+ output: (In: import("arktype/internal/attributes.ts").Default<string, string>) => import("arktype").Out<string>;
95
+ };
96
+ formatter?: {
97
+ indent?: number | "tab";
98
+ newline?: "LF" | "CRLF";
99
+ };
100
+ }, {
101
+ path: (In: string) => import("arktype").Out<string>;
102
+ }>;
103
+ /**
104
+ * The section token the ORM's commands declare in `needs.config`. The
105
+ * engine validates the merged section with its provenance and hands the
106
+ * handler the value: absolute paths, `migrations.dir` defaulted, `baseDir`
107
+ * recorded.
108
+ */
109
+ declare const ormConfigSection: ConfigSection<PrismaNextConfig>;
110
+ /**
111
+ * Validates a raw `orm` section the way the engine does for a command,
112
+ * for the loaders and tools that read the config outside a command run.
113
+ */
114
+ declare function validateOrmSection(raw: unknown, provenance: SectionProvenance): ReturnType<typeof ormConfigSection.validate>;
115
+ //#endregion
116
+ //#region src/load.d.ts
117
+ /**
118
+ * A successfully evaluated config plus the structural diagnostics found in it.
119
+ * Diagnostics are tagged with the config section they concern
120
+ * (`meta.section`); sections without diagnostics are safe to read. Callers
121
+ * must guard access through {@link requireConfigSections} — a section with a
122
+ * diagnostic may be missing or malformed despite the `PrismaNextConfig` type.
123
+ */
124
+ interface LoadedConfig$1 {
125
+ readonly config: PrismaNextConfig;
126
+ readonly diagnostics: readonly CliStructuredError[];
127
+ }
128
+ declare function findNearestConfigPathForFile(filePath: string): Promise<string | undefined>;
129
+ /**
130
+ * Validates a raw `orm` section and resolves its paths against `configDir`, the way a loaded config
131
+ * file is. A caller that builds the section in memory gets the same diagnostics as one that wrote
132
+ * it to `prisma.config.ts`.
133
+ */
134
+ declare function buildLoadedConfig(rawConfig: Record<string, unknown>, configDir: string): LoadedConfig$1;
135
+ /** One evaluated config file: its path and its top-level sections. */
136
+ interface ConfigFile {
137
+ readonly path: string;
138
+ /** The file's top-level keys minus the ones the file format keeps for itself. */
139
+ readonly sections: Readonly<Record<string, unknown>>;
140
+ }
141
+ /** The evaluated config chain, before any section is validated. */
142
+ interface ConfigFiles {
143
+ /** The requested file first, then the files it extends. */
144
+ readonly files: readonly ConfigFile[];
145
+ /** c12's merge of every file, nearest file winning. */
146
+ readonly merged: Readonly<Record<string, unknown>>;
147
+ }
148
+ /**
149
+ * Evaluates `prisma.config.ts` and hands back each file on the chain with its
150
+ * sections as written, plus c12's merge. Failures that prevent evaluation are
151
+ * the Result failure. Nothing is validated or resolved here: the CLI engine
152
+ * validates each section against its schema with the files' provenance, and
153
+ * {@link loadConfig} does the same for the `orm` section outside a command run.
154
+ */
155
+ declare function loadConfigFiles(configPath?: string, options?: {
156
+ readonly cwd?: string;
157
+ }): Promise<Result<ConfigFiles, CliStructuredError>>;
158
+ /**
159
+ * The raw default export of the module at `configPath`, evaluated exactly as
160
+ * {@link loadConfig} evaluates it and returned without validation or the
161
+ * version-marker check. The caller decides what the export means — a
162
+ * default export without the `$prismaConfig` marker is what an earlier Prisma
163
+ * CLI's config looks like.
164
+ */
165
+ declare function evaluateConfigModule(configPath: string, options?: {
166
+ readonly cwd?: string;
167
+ }): Promise<Result<unknown, CliStructuredError>>;
168
+ /**
169
+ * Loads the Prisma 8 config and validates its `orm` section.
170
+ *
171
+ * Failures that prevent evaluation entirely — missing file, module that does
172
+ * not evaluate (`CONFIG.FILE_NOT_FOUND`, `CONFIG.EVALUATION_FAILED`) — are the
173
+ * `Result` failure. Structural problems inside an evaluated config do not
174
+ * fail the load: they are returned as section-tagged diagnostics so commands
175
+ * fail only on the sections they read (via {@link requireConfigSections}).
176
+ */
177
+ declare function loadConfig(configPath?: string, options?: {
178
+ readonly cwd?: string;
179
+ }): Promise<Result<LoadedConfig$1, CliStructuredError>>;
180
+ /**
181
+ * Narrows a {@link LoadedConfig} to the sections a command reads. Fails with
182
+ * the first diagnostic concerning a required section; diagnostics on other
183
+ * sections are ignored so unrelated commands keep working.
184
+ */
185
+ declare function requireConfigSections(loaded: LoadedConfig$1, sections: readonly ConfigSection$1[]): Result<PrismaNextConfig, CliStructuredError>;
186
+ /**
187
+ * Convenience composition of {@link loadConfig} and
188
+ * {@link requireConfigSections} for commands that read a fixed set of
189
+ * sections and have no use for diagnostics outside them.
190
+ */
191
+ declare function loadConfigForSections(configPath: string | undefined, sections: readonly ConfigSection$1[]): Promise<Result<PrismaNextConfig, CliStructuredError>>;
192
+ declare function loadConfigForFile(filePath: string): Promise<Result<LoadedConfig$1, CliStructuredError>>;
193
+ //#endregion
194
+ export { ormConfigSection as _, ORM_CONFIG_SECTION_NAME as a, evaluateConfigModule as c, isConfigSection as d, loadConfig as f, ormConfigSchema as g, loadConfigForSections as h, LoadedConfig$1 as i, expandContractInputs as l, loadConfigForFile as m, ConfigFiles as n, PrismaNextConfig$1 as o, loadConfigFiles as p, ConfigSection$1 as r, buildLoadedConfig as s, ConfigFile as t, findNearestConfigPathForFile as u, requireConfigSections as v, validateOrmSection as y };
195
+ //# sourceMappingURL=index-D_KaEMoL.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-D_KaEMoL.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/config-loader/dist/exports/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAoBiB,qBAAqB,0CAA0C;;;;cAIlE;;;;;;KAMT;iBACY,gBAAgB,gBAAgB,SAAS;;;;;;;;cAQ5C,+DAA+D;EAC3E;IACE;IACA;IACA;IACA;IACA,QAAQ;IACR;;EAEF;IACE;IACA;IACA;IACA;IACA,QAAQ;IACR;;EAEF;IACE;IACA;IACA;IACA;IACA,QAAQ;IACR;;EAEF,qDAAqD;IACnD,MAAM,6CAA6C,8CAA8C;;EAEnG;IACE;IACA;IACA;IACA;IACA,QAAQ;IACR;;EAEF;IACE;IACA;IACA;IACA;IACA,QAAQ;IACR;;EAEF;IACE;;EAEF;IACE;MACE,MAAM;MACN,WAAW,iCAAiC;MAC5C;;IAEF,SAAS,6CAA6C,8CAA8C;;EAEtG;IACE;IACA;;;EAGF,OAAO,iCAAiC;;;;;;;;cAQ5B,kBAAkB,cAAgB;;;;;iBAK/B,mBAAmB,cAAc,YAAY,oBAAoB,kBAAkB,iBAAiB;;;;;;;;;;UAU3G;WACC,QAAQ;WACR,sBAAsB;;iBAEhB,6BAA6B,mBAAmB;;;;;;iBAMhD,kBAAkB,WAAW,yBAAyB,oBAAoB;;UAEjF;WACC;;WAEA,UAAU,SAAS;;;UAGpB;;WAEC,gBAAgB;;WAEhB,QAAQ,SAAS;;;;;;;;;iBASX,gBAAgB,qBAAqB;WAC3C;IACP,QAAQ,OAAO,aAAa;;;;;;;;iBAQf,qBAAqB,oBAAoB;WAC/C;IACP,QAAQ,gBAAgB;;;;;;;;;;iBAUX,WAAW,qBAAqB;WACtC;IACP,QAAQ,OAAO,gBAAc;;;;;;iBAMhB,sBAAsB,QAAQ,gBAAc,mBAAmB,oBAAkB,OAAO,kBAAoB;;;;;;iBAM5G,sBAAsB,gCAAgC,mBAAmB,oBAAkB,QAAQ,OAAO,kBAAoB;iBAC9H,kBAAkB,mBAAmB,QAAQ,OAAO,gBAAc"}
@@ -1,5 +1,5 @@
1
+ import { i as expandContractInputs } from "./exports-BOv2LgXz.mjs";
1
2
  import { r as getEmittedArtifactPaths, t as emit } from "./exports-DI1kMms6--e9LdT9A.mjs";
2
- import { r as expandContractInputs } from "./exports-8-S4PGn0.mjs";
3
3
  import { D as errorNoInvariantPath, M as errorUnknownInvariant, b as errorInvalidRefName, r as errorContractDeserializationFailed, t as MigrationToolsError } from "./errors-DD6iLGXk-B4Q4tIha.mjs";
4
4
  import { r as verifyMigrationHash, t as computeMigrationHash } from "./hash-BAZVWU4a-BdynTmar.mjs";
5
5
  import { a as snapshotsImportPathFrom, n as createSnapshotContentVerifier, o as writeContractSnapshot, r as readContractSnapshotJson, t as contractSnapshotDir } from "./contract-snapshot-store-1S_6vaGt-mzFobPtq.mjs";
@@ -34,7 +34,7 @@ import { createHash } from "node:crypto";
34
34
  import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
35
35
  import { abortable } from "@prisma/orm-framework/utils/abortable";
36
36
  import { resolve as resolve$1 } from "node:path";
37
- //#region ../../../1-framework/3-tooling/cli/dist/ref-CTp4Kvp-.mjs
37
+ //#region ../../../1-framework/3-tooling/cli/dist/ref-BK7yr-IT.mjs
38
38
  /**
39
39
  * The typed remediation the CLI attaches to its own errors and findings.
40
40
  * Constructors live here rather than in any library the CLI calls: naming a
@@ -415,7 +415,7 @@ function mapRefResolutionError(error) {
415
415
  *
416
416
  * This validation happens at the CLI composition boundary, before passing components
417
417
  * to typed planner/runner instances. It fills the gap between runtime validation
418
- * (via the config loader's `collectConfigIssues` diagnostics) and compile-time
418
+ * (the `orm` config schema's diagnostics) and compile-time
419
419
  * type enforcement.
420
420
  *
421
421
  * @param expectedFamilyId - The expected family ID (e.g., 'sql')
@@ -552,10 +552,9 @@ function resolveContractPath(config) {
552
552
  * `cwd` is the directory the command was invoked from; every relative path in
553
553
  * the result is computed against it.
554
554
  */
555
- function resolveMigrationPaths(configOption, config, cwd) {
556
- const resolvedConfigPath = configOption ? resolve(cwd, configOption) : void 0;
557
- const configPath = resolvedConfigPath ? relative(cwd, resolvedConfigPath) : "prisma.config.ts";
558
- const migrationsDir = resolve(resolvedConfigPath ? resolve(resolvedConfigPath, "..") : cwd, config.migrations?.dir ?? "migrations");
555
+ function resolveMigrationPaths(config, cwd) {
556
+ const configPath = "prisma.config.ts";
557
+ const migrationsDir = resolve(config.baseDir ?? cwd, config.migrations?.dir ?? "migrations");
559
558
  const migrationsRelative = relative(cwd, migrationsDir);
560
559
  const appMigrationsDir = spaceMigrationDirectory(migrationsDir, APP_SPACE_ID$1);
561
560
  return {
@@ -2728,15 +2727,15 @@ function declaredDependencies(manifest) {
2728
2727
  });
2729
2728
  }
2730
2729
  /**
2731
- * The import root for the project that owns `configPath`, or for the working
2732
- * directory when the config was discovered rather than named.
2730
+ * The import root for the project at `projectDir`, or for the working
2731
+ * directory when no project directory is known.
2733
2732
  *
2734
2733
  * A project with no manifest, or one that names no published package, is on
2735
2734
  * the internal root — which emits every specifier exactly as authored, so a
2736
2735
  * project that has not moved to published names is unaffected.
2737
2736
  */
2738
- function projectImportRoot(configPath) {
2739
- const nearest = nearestManifest(configPath === void 0 ? resolve(".") : dirname(resolve(configPath)));
2737
+ function projectImportRoot(projectDir) {
2738
+ const nearest = nearestManifest(projectDir === void 0 ? resolve(".") : resolve(projectDir));
2740
2739
  if (nearest === void 0) return internalImportRoot;
2741
2740
  try {
2742
2741
  return importRootForDependencies(declaredDependencies(nearest.manifest));
@@ -2750,9 +2749,9 @@ function projectImportRoot(configPath) {
2750
2749
  });
2751
2750
  }
2752
2751
  }
2753
- /** The specifier resolver emission should use for the project owning `configPath`. */
2754
- function createProjectSpecifierResolver(configPath) {
2755
- return createImportSpecifierResolver(projectImportRoot(configPath));
2752
+ /** The specifier resolver emission should use for the project at `projectDir`. */
2753
+ function createProjectSpecifierResolver(projectDir) {
2754
+ return createImportSpecifierResolver(projectImportRoot(projectDir));
2756
2755
  }
2757
2756
  function isRecord$1(value) {
2758
2757
  return typeof value === "object" && value !== null;
@@ -3074,7 +3073,7 @@ async function loadContractSource(config, options = {}) {
3074
3073
  * @throws {DOMException} `AbortError` if cancelled via `signal`
3075
3074
  */
3076
3075
  async function executeContractEmit(options, dependencies = defaultContractEmitDependencies) {
3077
- const { config, configPath, outputPath, signal = new AbortController().signal, onProgress } = options;
3076
+ const { config, projectDir, outputPath, signal = new AbortController().signal, onProgress } = options;
3078
3077
  const unlessAborted = abortable(signal);
3079
3078
  const contractConfig = requireContractConfig(config);
3080
3079
  const effectiveOutput = outputPath !== void 0 ? join(outputPath, "contract.json") : contractConfig.output;
@@ -3121,7 +3120,7 @@ async function executeContractEmit(options, dependencies = defaultContractEmitDe
3121
3120
  outputJsonPath,
3122
3121
  serializeContract,
3123
3122
  deserializeContract: (json) => familyInstance.deserializeContract(json),
3124
- resolveImportSpecifier: createProjectSpecifierResolver(configPath ?? outputJsonPath),
3123
+ resolveImportSpecifier: createProjectSpecifierResolver(projectDir ?? dirname(outputJsonPath)),
3125
3124
  ...ifDefined("shouldPreserveEmpty", contractSerializer.shouldPreserveEmpty),
3126
3125
  ...ifDefined("sortStorage", contractSerializer.sortStorage),
3127
3126
  ...ifDefined("supportsNamespaces", config.target.supportsNamespaces)
@@ -3200,7 +3199,7 @@ async function preflightRefAdvancement(args) {
3200
3199
  if (!validateRefName(args.name)) return notOk(errorInvalidRefName(args.name));
3201
3200
  let resolveImportSpecifier;
3202
3201
  try {
3203
- resolveImportSpecifier = createProjectSpecifierResolver(args.configPath);
3202
+ resolveImportSpecifier = createProjectSpecifierResolver(args.projectDir);
3204
3203
  } catch (error) {
3205
3204
  if (CliStructuredError$1.is(error)) return notOk(error);
3206
3205
  throw error;
@@ -3437,7 +3436,7 @@ function refuseMissingInvariantPath(args) {
3437
3436
  */
3438
3437
  async function executeMigrateShowPlan(options) {
3439
3438
  const config = options.config;
3440
- const { configPath, migrationsDir, migrationsRelative, refsDir } = resolveMigrationPaths(options.configPath, config, options.cwd);
3439
+ const { configPath, migrationsDir, migrationsRelative, refsDir } = resolveMigrationPaths(config, options.cwd);
3441
3440
  const dbConnection = options.db ?? config.db?.connection;
3442
3441
  const hasDriver = !!config.driver;
3443
3442
  const hasExplicitFrom = options.from !== void 0;
@@ -4318,7 +4317,7 @@ async function resolveToForPlan(optionsTo, input) {
4318
4317
  async function executeMigrationNewCommand(options) {
4319
4318
  const config = options.config;
4320
4319
  const cwd = options.cwd;
4321
- const { migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(options.configPath, config, cwd);
4320
+ const { migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(config, cwd);
4322
4321
  const stack = createControlStack(config);
4323
4322
  const familyInstance = config.family.create(stack);
4324
4323
  const controlAdapter = config.adapter.create(stack);
@@ -4417,7 +4416,7 @@ async function executeMigrationNewCommand(options) {
4417
4416
  config.adapter,
4418
4417
  ...config.extensions ?? []
4419
4418
  ]);
4420
- const resolveSpecifier = createProjectSpecifierResolver(options.configPath);
4419
+ const resolveSpecifier = createProjectSpecifierResolver(options.projectDir);
4421
4420
  const declarations = await renderSnapshotDeclarations({
4422
4421
  client: options.client,
4423
4422
  contractJson: parsedContract,
@@ -4655,7 +4654,7 @@ async function executeMigrationPlanCommand(options, startTime, callbacks) {
4655
4654
  async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4656
4655
  const config = options.config;
4657
4656
  const cwd = options.cwd;
4658
- const { configPath, migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(options.configPath, config, cwd);
4657
+ const { configPath, migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(config, cwd);
4659
4658
  const contractPathAbsolute = resolveContractPath(config);
4660
4659
  const contractPath = relative(cwd, contractPathAbsolute);
4661
4660
  callbacks?.onContextResolved?.({
@@ -4742,7 +4741,7 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
4742
4741
  toStorageHash = toResolution.value.hash;
4743
4742
  destinationInStore = true;
4744
4743
  }
4745
- const resolveImportSpecifier = createProjectSpecifierResolver(options.configPath);
4744
+ const resolveImportSpecifier = createProjectSpecifierResolver(options.projectDir);
4746
4745
  let destinationDeclarations = null;
4747
4746
  if (!destinationInStore && fromHash !== toStorageHash) {
4748
4747
  const rendered = await renderSnapshotDeclarations({
@@ -5019,7 +5018,7 @@ async function executeRefSetCommand(name, contractInput, options) {
5019
5018
  if (!validateRefName(name)) return notOk(cliErrorInvalidRefName(name));
5020
5019
  const config = options.config;
5021
5020
  try {
5022
- const { migrationsDir, refsDir } = resolveMigrationPaths(options.configPath, config, options.cwd);
5021
+ const { migrationsDir, refsDir } = resolveMigrationPaths(config, options.cwd);
5023
5022
  const loaded = await buildReadAggregate(config, { migrationsDir });
5024
5023
  if (!loaded.ok) return notOk(loaded.failure);
5025
5024
  const graph = loaded.value.aggregate.app.graph();
@@ -5065,7 +5064,7 @@ async function executeRefSetCommand(name, contractInput, options) {
5065
5064
  }
5066
5065
  async function executeRefDeleteCommand(name, options) {
5067
5066
  try {
5068
- const { refsDir } = resolveMigrationPaths(options.configPath, options.config, options.cwd);
5067
+ const { refsDir } = resolveMigrationPaths(options.config, options.cwd);
5069
5068
  await deleteRef(refsDir, name);
5070
5069
  return ok({
5071
5070
  ok: true,
@@ -5079,7 +5078,7 @@ async function executeRefDeleteCommand(name, options) {
5079
5078
  }
5080
5079
  async function executeRefListCommand(options) {
5081
5080
  try {
5082
- const { refsDir } = resolveMigrationPaths(options.configPath, options.config, options.cwd);
5081
+ const { refsDir } = resolveMigrationPaths(options.config, options.cwd);
5083
5082
  return ok({
5084
5083
  ok: true,
5085
5084
  refs: await readRefs(refsDir)
@@ -5092,4 +5091,4 @@ async function executeRefListCommand(options) {
5092
5091
  //#endregion
5093
5092
  export { formatSourceDiagnostic as $, errorLegendHumanOnly as A, runContractSpaceSeedPhase as At, errorUnexpected as B, errorContractArgConflict as C, resolveAppTargetPath as Ct, errorDriverRequired as D, resolveMigrationRef as Dt, errorDestructiveChanges as E, resolveFromForPlan as Et, errorPathUnreachable as F, statusForMigrationHash as Ft, executeMigrateShowPlan as G, executeDbInit as H, errorRunnerFailed as I, targetSupportsMigrations as It, executeRefAdvancement as J, executeMigrationNewCommand as K, errorRuntime as L, toDeclaredExtensionsFromRaw as Lt, errorMigrationPackageNotFound as M, runMigrationList as Mt, errorMigrationPlanningFailed as N, sanitizeErrorMessage as Nt, errorFileNotFound as O, resolveToForPlan as Ot, errorNoMigrations as P, snapshotVerifierFor as Pt, findPackageByDirPath as Q, errorTargetMigrationNotSupported as R, errorConsentPlanMismatch as S, requireLiveDatabase as St, errorDatabaseConnectionRequired as T, resolveContractRefToSnapshot as Tt, executeDbUpdate as U, executeContractEmit as V, executeDbVerify as W, executeRefListCommand as X, executeRefDeleteCommand as Y, executeRefSetCommand as Z, disposeEmitQueue as _, refuseDeclaredExtensionTargetMismatch as _t, appContractStandInFromIdentity as a, loadContractSpaceAggregateForCli as at, errorAdvanceRefArgConflict as b, refusePackageCorruptionOnAggregate as bt, buildMigrationSpaceGraphEntries as c, mapContractAtError as ct, checkSingleTarget as d, migrationSpaceListEntriesFromAggregate as dt, hasMigrationPath as et, chooseAction as f, originHashForStatus as ft, deriveStatusEdgeAnnotations as g, refuseContractSpaceIntegrity as gt, createControlClient as h, readMigrationRefs as ht, advanceRefSafely as i, loadContractSource as it, errorMarkerMissing as j, runMigrationCheck as jt, errorHashMismatch as k, runCommandAction as kt, buildReadAggregate as l, mapIntegrityViolations as lt, computeRefAdvancementName as m, readContractEnvelope as mt, ERROR_CODE_DESTRUCTIVE_CHANGES as n, loadAggregateIntegrityViolations as nt, appliedHashesFromLedger as o, looksLikePath as ot, closeQuietly as p, preflightRefAdvancement as pt, executeMigrationPlanCommand as q, NO_REF_ADVANCEMENT as r, loadContractRawSafely as rt, buildContractSpaceAggregate as s, mapCaughtMigrationError as st, CliStructuredError$1 as t, listRefsByContractHash as tt, buildRefAdvancementFields as u, maskConnectionUrl as ut, enrichContract as v, refuseMarkerOutsideGraph as vt, errorContractValidationFailed as w, resolveContractRef$1 as wt, errorConfigValidation$1 as x, refuseUnknownInvariants as xt, enumerateCheckSpaces as y, refuseMissingInvariantPath as yt, errorTargetMismatch as z };
5094
5093
 
5095
- //# sourceMappingURL=ref-CTp4Kvp--3Dgd8LXq.mjs.map
5094
+ //# sourceMappingURL=ref-BK7yr-IT-Dk0sxEcL.mjs.map