@prisma/cli-engine 0.6.0 → 0.6.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.
@@ -3829,10 +3829,8 @@ function makePromptSurface(invocation) {
3829
3829
  },
3830
3830
  consent: async (question, opts) => {
3831
3831
  const token = opts?.token;
3832
- if (state.yes || !state.interactive) {
3833
- if (token !== void 0 && consumeConfirmValue(state, token)) return true;
3834
- throw consentUnavailable(question, state, token);
3835
- }
3832
+ if (token !== void 0 && consumeConfirmValue(state, token)) return true;
3833
+ if (state.yes || !state.interactive) throw consentUnavailable(question, state, token);
3836
3834
  if (token !== void 0) return confirmByTyping(question, token);
3837
3835
  if (useClack()) return renderWithClack(question, (r) => r.consent(question));
3838
3836
  return isExplicitYes(await ask(question, `? ${question} (y/n) `));
@@ -5228,6 +5226,16 @@ function unknownCommandActions(spec, state) {
5228
5226
  function buildEngine(spec, options) {
5229
5227
  return new EngineImpl(spec, options?.now, options?.delay);
5230
5228
  }
5229
+ /** Returning the iterator is how the engine tells the host it has
5230
+ * stopped reading. On a real terminal the host's iterator may be
5231
+ * awaiting a keystroke that never comes, and its return cannot settle
5232
+ * before the host stops reading, so the run does not wait for it. */
5233
+ function releaseStdin(state) {
5234
+ const iterator = state.stdinIterator;
5235
+ if (iterator === void 0) return;
5236
+ state.stdinIterator = void 0;
5237
+ iterator.return?.()?.catch(() => {});
5238
+ }
5231
5239
  /** Resolves on the timer OR on the signal, whichever comes first — the
5232
5240
  * caller decides what an abort means, and no timer outlives the run. */
5233
5241
  function waitFor(ms, signal) {
@@ -5375,7 +5383,7 @@ var EngineImpl = class {
5375
5383
  });
5376
5384
  } finally {
5377
5385
  unsubscribe();
5378
- await state.stdinIterator?.return?.();
5386
+ releaseStdin(state);
5379
5387
  }
5380
5388
  const exitCode = state.settledExitCode !== void 0 ? state.settledExitCode : this.settleRouting(invocation, stricliProcess.exitCode);
5381
5389
  this.fireOnSettled(invocation, exitCode, startedAtMs);
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as SectionProvenance, A as Format, At as FlagSpec, B as Ui, Bt as SERVICE_TOKEN_ENV_VAR, C as defineSessionCommand, Ct as PackageManagerRunResult, D as OpenUrlRequest, Dt as ArgsSpec, E as OpenUrlOutcome, Et as Args, F as Span, Ft as ActiveCredential, G as ConfigSection, Gt as ManagementApiClient, H as Severity, Ht as StoredSessions, I as Status, It as Credential, J as ConfigSchema, K as SectionValidation, Kt as ManagementApiClientConfig, L as Text, Lt as CredentialIdentity, M as PRESENTED, Mt as flag, N as Presentations, Nt as positional, O as PromptSurface, Ot as Char, P as PresentedResult, Pt as ActiveAccessTokenOptions, Q as ResolvedSection, R as Tone, Rt as CredentialManager, S as defineServerCommand, St as PackageManagerRunRequest, T as CommandContext, Tt as PackageOperations, U as StreamEvent, Ut as CredentialRefreshResult, V as EngineEvent, Vt as Session, W as StreamMeta, Wt as CredentialRefresher, X as configSchema, Y as ConfigSchemaValue, Z as validateSectionWithSchema, _ as ServerCommandDefinition, _t as SpawnOptions, a as RedirectSpec, at as LoadedConfig, b as WorkflowStep, bt as exitWithChildStatus, c as CommandDefinition, ct as PRISMA_CONFIG_VERSION, d as CommandNeeds, dt as EngineCommandSnapshot, et as resolveSectionOverChain, f as CompletedEnvelope, ft as RunSummary, g as NeedsSpec, gt as SpawnChild, h as HelpSpec, ht as ExitWithChildStatusOptions, i as MountedTree, it as InputStream, j as Outcome, jt as PositionalSpec, k as Block, kt as CommandArgs, l as CommandHandler, lt as Runtime, m as Handler, mt as ChildStatusSettlement, n as CommandFamily, nt as Host, o as defineCommandFamily, ot as LoadedConfigFile, p as ErroredEnvelope, pt as ChildResult, q as defineConfigSection, qt as TokenStorage, r as CommandRedirect, rt as HostProcess, s as AnyCommand, st as OutputStream, t as TelemetryDeclaration, tt as resolveSectionPath, u as CommandHelp, ut as TelemetryPayload, v as SessionCommandDefinition, vt as SpawnRequest, w as BrowserWaitRequest, wt as PackageManagerRunner, x as defineCommand, xt as PackageManagerId, y as SpawnDeclarations, yt as SpawnedChild, z as TreeNode, zt as CredentialOrigin } from "./report-BWFp3piG.js";
1
+ import { $ as ResolvedSection, A as Format, At as CommandArgs, B as Ui, Bt as CredentialOrigin, C as defineSessionCommand, Ct as PackageManagerRunRequest, D as OpenUrlRequest, Dt as Args, E as OpenUrlOutcome, Et as PackageOperations, F as Span, Ft as ActiveAccessTokenOptions, G as ConfigSection, Gt as CredentialRefresher, H as Severity, Ht as Session, I as Status, It as ActiveCredential, J as ConfigSchema, Jt as TokenStorage, K as SectionValidation, Kt as ManagementApiClient, L as Text, Lt as Credential, M as PRESENTED, Mt as PositionalSpec, N as Presentations, Nt as flag, O as PromptSurface, Ot as ArgsSpec, P as PresentedResult, Pt as positional, Q as validateSectionWithSchema, R as Tone, Rt as CredentialIdentity, S as defineServerCommand, St as PackageManagerId, T as CommandContext, Tt as PackageManagerRunner, U as StreamEvent, Ut as StoredSessions, V as EngineEvent, Vt as SERVICE_TOKEN_ENV_VAR, W as StreamMeta, Wt as CredentialRefreshResult, X as configSchema, Y as ConfigSchemaValue, Z as reference, _ as ServerCommandDefinition, _t as SpawnChild, a as RedirectSpec, at as InputStream, b as WorkflowStep, bt as SpawnedChild, c as CommandDefinition, ct as OutputStream, d as CommandNeeds, dt as TelemetryPayload, et as SectionProvenance, f as CompletedEnvelope, ft as EngineCommandSnapshot, g as NeedsSpec, gt as ExitWithChildStatusOptions, h as HelpSpec, ht as ChildStatusSettlement, i as MountedTree, it as HostProcess, j as Outcome, jt as FlagSpec, k as Block, kt as Char, l as CommandHandler, lt as PRISMA_CONFIG_VERSION, m as Handler, mt as ChildResult, n as CommandFamily, nt as resolveSectionPath, o as defineCommandFamily, ot as LoadedConfig, p as ErroredEnvelope, pt as RunSummary, q as defineConfigSection, qt as ManagementApiClientConfig, r as CommandRedirect, rt as Host, s as AnyCommand, st as LoadedConfigFile, t as TelemetryDeclaration, tt as resolveSectionOverChain, u as CommandHelp, ut as Runtime, v as SessionCommandDefinition, vt as SpawnOptions, w as BrowserWaitRequest, wt as PackageManagerRunResult, x as defineCommand, xt as exitWithChildStatus, y as SpawnDeclarations, yt as SpawnRequest, z as TreeNode, zt as CredentialManager } from "./report-B_8n69OY.js";
2
2
  import { n as CliStructuredError } from "./protocol-YjqPCCOG.js";
3
3
 
4
4
  //#region src/active-access-token.d.ts
@@ -225,4 +225,4 @@ declare function claimedExpiresAt(token: string): Date | undefined;
225
225
  */
226
226
  declare function claimedIdentity(token: string): CredentialIdentity | undefined;
227
227
  //#endregion
228
- export { type ActiveAccessTokenOptions, type ActiveCredential, type AnyCommand, type Args, type ArgsSpec, type Block, type BrowserWaitRequest, type Char, type ChildResult, type ChildStatusSettlement, type Cli, type CliRunHooks, type CommandArgs, type CommandContext, type CommandDefinition, type CommandFamily, type CommandHandler, type CommandHelp, type CommandNeeds, type CommandRedirect, type CompletedEnvelope, type ConfigSchema, type ConfigSchemaValue, type ConfigSection, type Credential, type CredentialIdentity, type CredentialManager, type CredentialOrigin, type CredentialRefreshResult, type CredentialRefresher, type CredentialsRequiredReason, type EngineCommandSnapshot, type EngineEvent, EnvironmentCredentialManager, type ErroredEnvelope, type ExitWithChildStatusOptions, type FlagSpec, type Format, type Handler, type HelpSpec, type Host, type HostProcess, type InputStream, type LoadedConfig, type LoadedConfigFile, type ManagementApiClient, type ManagementApiClientConfig, type MountedTree, type NeedsSpec, type OpenUrlOutcome, type OpenUrlRequest, type Outcome, type OutputStream, PRESENTED, PRISMA_CONFIG_VERSION, type PackageManagerId, type PackageManagerRunRequest, type PackageManagerRunResult, type PackageManagerRunner, type PackageOperations, type PositionalSpec, type Presentations, type PresentedResult, type PromptSurface, type RedirectSpec, type ResolvedSection, type RunSummary, type Runtime, SERVICE_TOKEN_ENV_VAR, type SectionProvenance, type SectionValidation, type ServerCommandDefinition, type Session, type SessionCommandDefinition, type Severity, type Span, type SpawnChild, type SpawnDeclarations, type SpawnOptions, type SpawnRequest, type SpawnedChild, type Status, type StoredSessions, type StreamEvent, type StreamMeta, type TelemetryDeclaration, type TelemetryPayload, type TelemetryStatus, type TelemetryStatusReason, type Text, type TokenStorage, type Tone, type TreeNode, type Ui, type WorkflowStep, authServiceError, claimedExpiresAt, claimedIdentity, configSchema, createCli, credentialRejectedError, credentialWorkspaceId, credentialWorkspaceMismatchError, credentialsRequiredError, defineCommand, defineCommandFamily, defineConfigSection, definePrismaConfig, defineServerCommand, defineSessionCommand, detectCI, emptyServiceTokenError, exitWithChildStatus, flag, loadConfig, noSessionForWorkspaceError, positional, readActiveAccessToken, realpathOr, resolveSectionOverChain, resolveSectionPath, telemetryCommandGroup, validateSectionWithSchema };
228
+ export { type ActiveAccessTokenOptions, type ActiveCredential, type AnyCommand, type Args, type ArgsSpec, type Block, type BrowserWaitRequest, type Char, type ChildResult, type ChildStatusSettlement, type Cli, type CliRunHooks, type CommandArgs, type CommandContext, type CommandDefinition, type CommandFamily, type CommandHandler, type CommandHelp, type CommandNeeds, type CommandRedirect, type CompletedEnvelope, type ConfigSchema, type ConfigSchemaValue, type ConfigSection, type Credential, type CredentialIdentity, type CredentialManager, type CredentialOrigin, type CredentialRefreshResult, type CredentialRefresher, type CredentialsRequiredReason, type EngineCommandSnapshot, type EngineEvent, EnvironmentCredentialManager, type ErroredEnvelope, type ExitWithChildStatusOptions, type FlagSpec, type Format, type Handler, type HelpSpec, type Host, type HostProcess, type InputStream, type LoadedConfig, type LoadedConfigFile, type ManagementApiClient, type ManagementApiClientConfig, type MountedTree, type NeedsSpec, type OpenUrlOutcome, type OpenUrlRequest, type Outcome, type OutputStream, PRESENTED, PRISMA_CONFIG_VERSION, type PackageManagerId, type PackageManagerRunRequest, type PackageManagerRunResult, type PackageManagerRunner, type PackageOperations, type PositionalSpec, type Presentations, type PresentedResult, type PromptSurface, type RedirectSpec, type ResolvedSection, type RunSummary, type Runtime, SERVICE_TOKEN_ENV_VAR, type SectionProvenance, type SectionValidation, type ServerCommandDefinition, type Session, type SessionCommandDefinition, type Severity, type Span, type SpawnChild, type SpawnDeclarations, type SpawnOptions, type SpawnRequest, type SpawnedChild, type Status, type StoredSessions, type StreamEvent, type StreamMeta, type TelemetryDeclaration, type TelemetryPayload, type TelemetryStatus, type TelemetryStatusReason, type Text, type TokenStorage, type Tone, type TreeNode, type Ui, type WorkflowStep, authServiceError, claimedExpiresAt, claimedIdentity, configSchema, createCli, credentialRejectedError, credentialWorkspaceId, credentialWorkspaceMismatchError, credentialsRequiredError, defineCommand, defineCommandFamily, defineConfigSection, definePrismaConfig, defineServerCommand, defineSessionCommand, detectCI, emptyServiceTokenError, exitWithChildStatus, flag, loadConfig, noSessionForWorkspaceError, positional, readActiveAccessToken, realpathOr, reference, resolveSectionOverChain, resolveSectionPath, telemetryCommandGroup, validateSectionWithSchema };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { i as ok, r as notOk, t as CliStructuredError } from "./protocol-TtNVkeVS.js";
2
- import { C as credentialWorkspaceId, D as credentialsRequiredError, E as credentialWorkspaceMismatchError, O as emptyServiceTokenError, S as claimedIdentity, T as credentialRejectedError, _ as detectCI, a as definePrismaConfig, b as readActiveAccessToken, c as PRISMA_CONFIG_VERSION, d as PRESENTED, f as readUserConfig, g as exitWithChildStatus, h as resolveGating, k as noSessionForWorkspaceError, l as SERVICE_TOKEN_ENV_VAR, m as writeUserConfig, n as resolveSectionOverChain, o as loadConfig, p as userConfigPath, r as resolveSectionPath, s as realpathOr, t as buildEngine, u as WORKSPACE_ID_ENV_VAR, v as flag, w as authServiceError, x as claimedExpiresAt, y as positional } from "./engine-DaES-DtJ.js";
2
+ import { C as credentialWorkspaceId, D as credentialsRequiredError, E as credentialWorkspaceMismatchError, O as emptyServiceTokenError, S as claimedIdentity, T as credentialRejectedError, _ as detectCI, a as definePrismaConfig, b as readActiveAccessToken, c as PRISMA_CONFIG_VERSION, d as PRESENTED, f as readUserConfig, g as exitWithChildStatus, h as resolveGating, k as noSessionForWorkspaceError, l as SERVICE_TOKEN_ENV_VAR, m as writeUserConfig, n as resolveSectionOverChain, o as loadConfig, p as userConfigPath, r as resolveSectionPath, s as realpathOr, t as buildEngine, u as WORKSPACE_ID_ENV_VAR, v as flag, w as authServiceError, x as claimedExpiresAt, y as positional } from "./engine-ChihWB8y.js";
3
3
  import { dirname, isAbsolute, resolve } from "node:path";
4
4
  import { scope, type } from "arktype";
5
5
  //#region src/cli.ts
@@ -95,9 +95,10 @@ function defineServerCommand(def) {
95
95
  //#endregion
96
96
  //#region src/config-schema.ts
97
97
  /**
98
- * The provenance of the section being validated, published for the
99
- * duration of one synchronous schema run so the `path` keyword can
100
- * resolve each value against the file that declared its top-level key.
98
+ * The section being validated, published for the duration of one
99
+ * synchronous schema run: its provenance, so the `path` keyword can resolve
100
+ * each value against the file that declared its top-level key, and the
101
+ * values the schema declared references, so the clone keeps them.
101
102
  */
102
103
  let current;
103
104
  /** The file that declared the top-level key a value sits under, else the nearest file. */
@@ -147,17 +148,57 @@ const configSchema = scope({
147
148
  * into an absolute path against that file's directory; an absolute value
148
149
  * passes through unchanged.
149
150
  */
150
- path: type("string").pipe((value, ctx) => resolvePathValue(value, ctx.path)) }).type;
151
+ path: type("string").pipe((value, ctx) => resolvePathValue(value, ctx.path)) }, { clone: (original) => copyExceptReferences(original, current?.references, /* @__PURE__ */ new Map()) }).type;
151
152
  function isPlainObject(value) {
152
153
  if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
153
154
  const prototype = Object.getPrototypeOf(value);
154
155
  return prototype === Object.prototype || prototype === null;
155
156
  }
156
- /** Plain objects and arrays copied; anything else, functions included, by reference. */
157
- function copyPlainData(value) {
158
- if (Array.isArray(value)) return value.map(copyPlainData);
159
- if (isPlainObject(value)) return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, copyPlainData(entry)]));
160
- return value;
157
+ /**
158
+ * Before arktype applies a morph it clones the value, so resolving a path or
159
+ * applying a default never writes into what the caller passed in. The scope
160
+ * above supplies the clone through arktype's `clone` option: it copies every
161
+ * value except the ones the schema declared with {@link reference}, which
162
+ * reach the command as the config file built them. `seen` carries the copies
163
+ * made so far, so a value that refers back to itself is copied once.
164
+ */
165
+ function copyExceptReferences(value, references, seen) {
166
+ if (typeof value !== "object" || value === null || references?.has(value)) return value;
167
+ const copied = seen.get(value);
168
+ if (copied !== void 0) return copied;
169
+ if (Array.isArray(value)) {
170
+ const elements = [];
171
+ seen.set(value, elements);
172
+ for (const element of value) elements.push(copyExceptReferences(element, references, seen));
173
+ return elements;
174
+ }
175
+ const copy = Object.create(Object.getPrototypeOf(value));
176
+ seen.set(value, copy);
177
+ for (const key of Reflect.ownKeys(value)) copy[key] = copyExceptReferences(value[key], references, seen);
178
+ return copy;
179
+ }
180
+ /**
181
+ * Declares a value the config file constructs, such as a descriptor, a
182
+ * client or any class instance: validation checks it against `schema`, and
183
+ * the command receives the file's own object, never a copy. Every value not
184
+ * declared this way is copied before arktype writes into the section.
185
+ *
186
+ * ```ts
187
+ * const toySchema = configSchema({
188
+ * target: reference(configSchema({ kind: "'target'", id: "string" })),
189
+ * "out?": "path",
190
+ * });
191
+ * ```
192
+ *
193
+ * `schema` cannot contain a `path` or a default: resolving one would write
194
+ * into the config file's own object, so such a schema is refused here.
195
+ */
196
+ function reference(schema) {
197
+ if (schema.in.expression !== schema.expression) throw new Error(`@prisma/cli-engine: a reference cannot contain a path or a default, because resolving it would write into the config file's own object: ${schema.expression}`);
198
+ return schema.narrow((value) => {
199
+ if (typeof value === "object" && value !== null || typeof value === "function") current?.references.add(value);
200
+ return true;
201
+ });
161
202
  }
162
203
  function fieldDiagnostic(name, error, provenance) {
163
204
  const field = error.path.map(String).join(".");
@@ -182,7 +223,9 @@ function fieldDiagnostic(name, error, provenance) {
182
223
  * section is validated as an empty object, so a schema whose fields are
183
224
  * all optional accepts it and a required field is reported by name. A
184
225
  * plain-object value comes back frozen and carrying `baseDir`, the
185
- * directory of the nearest file declaring the section. Never throws for
226
+ * directory of the nearest file declaring the section, unless the whole
227
+ * section is a reference, which comes back as the file's own object. Never
228
+ * throws for
186
229
  * any input: arktype reports problems as errors, and a `path` value is
187
230
  * only ever resolved here.
188
231
  */
@@ -192,12 +235,14 @@ function validateSectionWithSchema(name, schema, raw, provenance) {
192
235
  diagnostics: [reservedKeyDiagnostic(name, "baseDir", provenance)]
193
236
  };
194
237
  const previous = current;
238
+ const references = /* @__PURE__ */ new WeakSet();
195
239
  current = {
196
240
  name,
197
- provenance
241
+ provenance,
242
+ references
198
243
  };
199
244
  try {
200
- const out = schema(raw === void 0 ? {} : copyPlainData(raw));
245
+ const out = schema(raw === void 0 ? {} : raw);
201
246
  if (out instanceof type.errors) return {
202
247
  ok: false,
203
248
  diagnostics: [...out].map((error) => fieldDiagnostic(name, error, provenance))
@@ -205,7 +250,7 @@ function validateSectionWithSchema(name, schema, raw, provenance) {
205
250
  const nearest = provenance.files[0];
206
251
  return {
207
252
  ok: true,
208
- value: isPlainObject(out) && nearest !== void 0 ? Object.freeze({
253
+ value: isPlainObject(out) && nearest !== void 0 && !references.has(out) ? Object.freeze({
209
254
  ...out,
210
255
  baseDir: dirname(nearest)
211
256
  }) : out,
@@ -547,4 +592,4 @@ Telemetry is on by default (opt-out); see ${options.docsUrl}\nfor what is collec
547
592
  };
548
593
  }
549
594
  //#endregion
550
- export { EnvironmentCredentialManager, PRESENTED, PRISMA_CONFIG_VERSION, SERVICE_TOKEN_ENV_VAR, authServiceError, claimedExpiresAt, claimedIdentity, configSchema, createCli, credentialRejectedError, credentialWorkspaceId, credentialWorkspaceMismatchError, credentialsRequiredError, defineCommand, defineCommandFamily, defineConfigSection, definePrismaConfig, defineServerCommand, defineSessionCommand, detectCI, emptyServiceTokenError, exitWithChildStatus, flag, loadConfig, noSessionForWorkspaceError, positional, readActiveAccessToken, realpathOr, resolveSectionOverChain, resolveSectionPath, telemetryCommandGroup, validateSectionWithSchema };
595
+ export { EnvironmentCredentialManager, PRESENTED, PRISMA_CONFIG_VERSION, SERVICE_TOKEN_ENV_VAR, authServiceError, claimedExpiresAt, claimedIdentity, configSchema, createCli, credentialRejectedError, credentialWorkspaceId, credentialWorkspaceMismatchError, credentialsRequiredError, defineCommand, defineCommandFamily, defineConfigSection, definePrismaConfig, defineServerCommand, defineSessionCommand, detectCI, emptyServiceTokenError, exitWithChildStatus, flag, loadConfig, noSessionForWorkspaceError, positional, readActiveAccessToken, realpathOr, reference, resolveSectionOverChain, resolveSectionPath, telemetryCommandGroup, validateSectionWithSchema };
@@ -702,6 +702,12 @@ interface HostProcess {
702
702
  readonly stdin: {
703
703
  isTTY?: boolean;
704
704
  setRawMode?(enabled: boolean): unknown;
705
+ /** Whether a stdin still being read keeps the process alive. The
706
+ * engine reads through the bin's adapter, which unrefs stdin once
707
+ * a run has finished prompting so an idle process can exit, and
708
+ * refs it again when the next run starts reading. */
709
+ ref?(): unknown;
710
+ unref?(): unknown;
705
711
  [Symbol.asyncIterator](): AsyncIterator<Uint8Array>;
706
712
  };
707
713
  on(event: "SIGINT" | "SIGTERM", listener: () => void): unknown;
@@ -826,18 +832,38 @@ type ConfigSchema<T = unknown> = Type<T, typeof configScope.t>;
826
832
  /**
827
833
  * The validated value a schema produces: its output type plus `baseDir`,
828
834
  * the directory of the nearest file declaring the section, which the engine
829
- * adds to a plain-object value. `baseDir` is reserved: a schema may not
830
- * declare it and a config file may not write it.
835
+ * adds to a plain-object value that is not a {@link reference}. `baseDir`
836
+ * is reserved: a schema may not declare it and a config file may not write
837
+ * it.
831
838
  */
832
839
  type ConfigSchemaValue<S extends ConfigSchema> = S["infer"] & {
833
840
  readonly baseDir?: string;
834
841
  };
842
+ /**
843
+ * Declares a value the config file constructs, such as a descriptor, a
844
+ * client or any class instance: validation checks it against `schema`, and
845
+ * the command receives the file's own object, never a copy. Every value not
846
+ * declared this way is copied before arktype writes into the section.
847
+ *
848
+ * ```ts
849
+ * const toySchema = configSchema({
850
+ * target: reference(configSchema({ kind: "'target'", id: "string" })),
851
+ * "out?": "path",
852
+ * });
853
+ * ```
854
+ *
855
+ * `schema` cannot contain a `path` or a default: resolving one would write
856
+ * into the config file's own object, so such a schema is refused here.
857
+ */
858
+ declare function reference<S extends ConfigSchema>(schema: S): S;
835
859
  /**
836
860
  * Validates one section's resolved value against its schema. An absent
837
861
  * section is validated as an empty object, so a schema whose fields are
838
862
  * all optional accepts it and a required field is reported by name. A
839
863
  * plain-object value comes back frozen and carrying `baseDir`, the
840
- * directory of the nearest file declaring the section. Never throws for
864
+ * directory of the nearest file declaring the section, unless the whole
865
+ * section is a reference, which comes back as the file's own object. Never
866
+ * throws for
841
867
  * any input: arktype reports problems as errors, and a `path` value is
842
868
  * only ever resolved here.
843
869
  */
@@ -1333,10 +1359,10 @@ interface PromptSurface {
1333
1359
  * `token` is the natural noun of what is being consented to — an app
1334
1360
  * name, a hostname. Supplying one changes both halves of the prompt:
1335
1361
  * interactively the user must type the token exactly instead of
1336
- * answering yes/no, and non-interactively the consent is granted by
1337
- * `--confirm <token>` on the command line (one `--confirm` value per
1338
- * consent). Without a token there is no non-interactive way to
1339
- * consent at all.
1362
+ * answering yes/no, and `--confirm <token>` on the command line grants
1363
+ * the consent up front in any session, so no prompt is shown (one
1364
+ * `--confirm` value per consent). Without a token there is no
1365
+ * non-interactive way to consent at all.
1340
1366
  */
1341
1367
  readonly consent: (question: string, opts?: {
1342
1368
  readonly token?: string;
@@ -1703,4 +1729,4 @@ interface TelemetryDeclaration {
1703
1729
  readonly docsUrl: string;
1704
1730
  }
1705
1731
  //#endregion
1706
- export { SectionProvenance as $, Format as A, FlagSpec as At, Ui as B, SERVICE_TOKEN_ENV_VAR as Bt, defineSessionCommand as C, PackageManagerRunResult as Ct, OpenUrlRequest as D, ArgsSpec as Dt, OpenUrlOutcome as E, Args as Et, Span as F, ActiveCredential as Ft, ConfigSection as G, ManagementApiClient$1 as Gt, Severity as H, StoredSessions as Ht, Status as I, Credential as It, ConfigSchema as J, SectionValidation as K, ManagementApiClientConfig as Kt, Text as L, CredentialIdentity as Lt, PRESENTED as M, flag as Mt, Presentations as N, positional as Nt, PromptSurface as O, Char as Ot, PresentedResult as P, ActiveAccessTokenOptions as Pt, ResolvedSection as Q, Tone as R, CredentialManager as Rt, defineServerCommand as S, PackageManagerRunRequest as St, CommandContext as T, PackageOperations as Tt, StreamEvent as U, CredentialRefreshResult as Ut, EngineEvent as V, Session as Vt, StreamMeta as W, CredentialRefresher as Wt, configSchema as X, ConfigSchemaValue as Y, validateSectionWithSchema as Z, ServerCommandDefinition as _, SpawnOptions as _t, RedirectSpec as a, LoadedConfig as at, WorkflowStep as b, exitWithChildStatus as bt, CommandDefinition as c, PRISMA_CONFIG_VERSION as ct, CommandNeeds as d, EngineCommandSnapshot as dt, resolveSectionOverChain as et, CompletedEnvelope as f, RunSummary as ft, NeedsSpec as g, SpawnChild as gt, HelpSpec as h, ExitWithChildStatusOptions as ht, MountedTree as i, InputStream as it, Outcome as j, PositionalSpec as jt, Block as k, CommandArgs as kt, CommandHandler as l, Runtime as lt, Handler as m, ChildStatusSettlement as mt, CommandFamily as n, Host as nt, defineCommandFamily as o, LoadedConfigFile as ot, ErroredEnvelope as p, ChildResult as pt, defineConfigSection as q, TokenStorage$1 as qt, CommandRedirect as r, HostProcess as rt, AnyCommand as s, OutputStream as st, TelemetryDeclaration as t, resolveSectionPath as tt, CommandHelp as u, TelemetryPayload as ut, SessionCommandDefinition as v, SpawnRequest as vt, BrowserWaitRequest as w, PackageManagerRunner as wt, defineCommand as x, PackageManagerId as xt, SpawnDeclarations as y, SpawnedChild as yt, TreeNode as z, CredentialOrigin as zt };
1732
+ export { ResolvedSection as $, Format as A, CommandArgs as At, Ui as B, CredentialOrigin as Bt, defineSessionCommand as C, PackageManagerRunRequest as Ct, OpenUrlRequest as D, Args as Dt, OpenUrlOutcome as E, PackageOperations as Et, Span as F, ActiveAccessTokenOptions as Ft, ConfigSection as G, CredentialRefresher as Gt, Severity as H, Session as Ht, Status as I, ActiveCredential as It, ConfigSchema as J, TokenStorage$1 as Jt, SectionValidation as K, ManagementApiClient$1 as Kt, Text as L, Credential as Lt, PRESENTED as M, PositionalSpec as Mt, Presentations as N, flag as Nt, PromptSurface as O, ArgsSpec as Ot, PresentedResult as P, positional as Pt, validateSectionWithSchema as Q, Tone as R, CredentialIdentity as Rt, defineServerCommand as S, PackageManagerId as St, CommandContext as T, PackageManagerRunner as Tt, StreamEvent as U, StoredSessions as Ut, EngineEvent as V, SERVICE_TOKEN_ENV_VAR as Vt, StreamMeta as W, CredentialRefreshResult as Wt, configSchema as X, ConfigSchemaValue as Y, reference as Z, ServerCommandDefinition as _, SpawnChild as _t, RedirectSpec as a, InputStream as at, WorkflowStep as b, SpawnedChild as bt, CommandDefinition as c, OutputStream as ct, CommandNeeds as d, TelemetryPayload as dt, SectionProvenance as et, CompletedEnvelope as f, EngineCommandSnapshot as ft, NeedsSpec as g, ExitWithChildStatusOptions as gt, HelpSpec as h, ChildStatusSettlement as ht, MountedTree as i, HostProcess as it, Outcome as j, FlagSpec as jt, Block as k, Char as kt, CommandHandler as l, PRISMA_CONFIG_VERSION as lt, Handler as m, ChildResult as mt, CommandFamily as n, resolveSectionPath as nt, defineCommandFamily as o, LoadedConfig as ot, ErroredEnvelope as p, RunSummary as pt, defineConfigSection as q, ManagementApiClientConfig as qt, CommandRedirect as r, Host as rt, AnyCommand as s, LoadedConfigFile as st, TelemetryDeclaration as t, resolveSectionOverChain as tt, CommandHelp as u, Runtime as ut, SessionCommandDefinition as v, SpawnOptions as vt, BrowserWaitRequest as w, PackageManagerRunResult as wt, defineCommand as x, exitWithChildStatus as xt, SpawnDeclarations as y, SpawnRequest as yt, TreeNode as z, CredentialManager as zt };
package/dist/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Ft as ActiveCredential, Gt as ManagementApiClient, Ht as StoredSessions, It as Credential, Kt as ManagementApiClientConfig, P as PresentedResult, Pt as ActiveAccessTokenOptions, Rt as CredentialManager, U as StreamEvent, V as EngineEvent, Vt as Session, Wt as CredentialRefresher, b as WorkflowStep, ft as RunSummary, gt as SpawnChild, i as MountedTree, lt as Runtime, n as CommandFamily, nt as Host, pt as ChildResult, qt as TokenStorage, t as TelemetryDeclaration, ut as TelemetryPayload, vt as SpawnRequest, wt as PackageManagerRunner, xt as PackageManagerId } from "./report-BWFp3piG.js";
1
+ import { Ft as ActiveAccessTokenOptions, Gt as CredentialRefresher, Ht as Session, It as ActiveCredential, Jt as TokenStorage, Kt as ManagementApiClient, Lt as Credential, P as PresentedResult, St as PackageManagerId, Tt as PackageManagerRunner, U as StreamEvent, Ut as StoredSessions, V as EngineEvent, _t as SpawnChild, b as WorkflowStep, dt as TelemetryPayload, i as MountedTree, mt as ChildResult, n as CommandFamily, pt as RunSummary, qt as ManagementApiClientConfig, rt as Host, t as TelemetryDeclaration, ut as Runtime, yt as SpawnRequest, zt as CredentialManager } from "./report-B_8n69OY.js";
2
2
 
3
3
  //#region src/in-memory-credential-manager.d.ts
4
4
  /** A stored session with its credential material — what the manager
package/dist/testing.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as credentialWorkspaceId, D as credentialsRequiredError, E as credentialWorkspaceMismatchError, S as claimedIdentity, b as readActiveAccessToken, k as noSessionForWorkspaceError, t as buildEngine, x as claimedExpiresAt } from "./engine-DaES-DtJ.js";
1
+ import { C as credentialWorkspaceId, D as credentialsRequiredError, E as credentialWorkspaceMismatchError, S as claimedIdentity, b as readActiveAccessToken, k as noSessionForWorkspaceError, t as buildEngine, x as claimedExpiresAt } from "./engine-ChihWB8y.js";
2
2
  import { Buffer } from "node:buffer";
3
3
  import { resolve } from "node:path";
4
4
  //#region src/in-memory-credential-manager.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/cli-engine",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "The execution engine of the unified Prisma CLI.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -53,8 +53,8 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@prisma/management-api-sdk": "1.69.0",
56
- "@repo/cli-conformance": "8.0.0-rc.15-dev.114",
57
- "@repo/tsconfig": "8.0.0-rc.15-dev.114",
56
+ "@repo/cli-conformance": "8.0.0-rc.16-dev.119",
57
+ "@repo/tsconfig": "8.0.0-rc.16-dev.119",
58
58
  "@types/node": "^22.19.19",
59
59
  "ci-info": "^4.3.1",
60
60
  "tsdown": "^0.21.10",