@prisma/migrate 7.9.0-dev.3 → 7.9.0-dev.30
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.
- package/dist/bin.js +16 -16
- package/dist/{chunk-QVMYNWAN.js → chunk-5JVYZEWJ.js} +7 -6
- package/dist/{chunk-2UHNNEP4.js → chunk-6EQA63NM.js} +4 -4
- package/dist/chunk-6TSRRBNA.js +40 -0
- package/dist/{chunk-TEUL2TU3.js → chunk-CQTYRADU.js} +5 -5
- package/dist/{chunk-6UO6YJTU.js → chunk-DL2W77GY.js} +6 -6
- package/dist/chunk-DPRQXN36.js +34 -0
- package/dist/{chunk-KRQEFTDT.js → chunk-G222ME3D.js} +4 -4
- package/dist/chunk-GBUW4I6U.js +33 -0
- package/dist/chunk-HWBQGGZH.js +50 -0
- package/dist/chunk-INC5VUX4.js +33 -0
- package/dist/chunk-NGEWTXY6.js +33 -0
- package/dist/chunk-PHX6STZ3.js +147 -0
- package/dist/chunk-PPE4XDUL.js +63 -0
- package/dist/chunk-TEOIOJ7P.js +34 -0
- package/dist/chunk-THJ7K72W.js +33 -0
- package/dist/{chunk-WVAPMHNT.js → chunk-TW5MYPTK.js} +7 -7
- package/dist/{chunk-53R5LH65.js → chunk-UA3FFRRV.js} +5 -5
- package/dist/chunk-VEBRKA5H.js +33 -0
- package/dist/chunk-WA2SOLDQ.js +35 -0
- package/dist/{chunk-KPQKIXQM.js → chunk-WP5M3D4N.js} +8 -5
- package/dist/chunk-YNB3IN6Q.js +40 -0
- package/dist/commands/DbDrop.js +3 -3
- package/dist/commands/DbPull.js +3 -3
- package/dist/commands/DbPush.js +3 -3
- package/dist/commands/MigrateDeploy.js +4 -4
- package/dist/commands/MigrateDev.js +4 -4
- package/dist/commands/MigrateReset.js +5 -5
- package/dist/commands/db-command-completion.js +25 -0
- package/dist/commands/db-execute-completion.js +25 -0
- package/dist/commands/db-pull-completion.js +25 -0
- package/dist/commands/db-push-completion.js +25 -0
- package/dist/commands/db-seed-completion.js +25 -0
- package/dist/commands/migrate-command-completion.js +25 -0
- package/dist/commands/migrate-deploy-completion.js +25 -0
- package/dist/commands/migrate-dev-completion.js +25 -0
- package/dist/commands/migrate-diff-completion.js +25 -0
- package/dist/commands/migrate-reset-completion.js +25 -0
- package/dist/commands/migrate-resolve-completion.js +25 -0
- package/dist/commands/migrate-status-completion.js +25 -0
- package/dist/index.js +42 -18
- package/dist/src/commands/db-command-completion.d.ts +2 -0
- package/dist/src/commands/db-execute-completion.d.ts +2 -0
- package/dist/src/commands/db-pull-completion.d.ts +2 -0
- package/dist/src/commands/db-push-completion.d.ts +2 -0
- package/dist/src/commands/db-seed-completion.d.ts +2 -0
- package/dist/src/commands/migrate-command-completion.d.ts +2 -0
- package/dist/src/commands/migrate-deploy-completion.d.ts +2 -0
- package/dist/src/commands/migrate-dev-completion.d.ts +2 -0
- package/dist/src/commands/migrate-diff-completion.d.ts +2 -0
- package/dist/src/commands/migrate-reset-completion.d.ts +2 -0
- package/dist/src/commands/migrate-resolve-completion.d.ts +2 -0
- package/dist/src/commands/migrate-status-completion.d.ts +2 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/utils/ai-safety.d.ts +19 -1
- package/dist/utils/ai-safety.js +3 -2
- package/dist/utils/printFiles.js +4 -4
- package/dist/utils/setupCockroach.js +2 -2
- package/dist/utils/setupMSSQL.js +24 -24
- package/dist/utils/setupPostgres.js +2 -2
- package/package.json +10 -10
- package/dist/chunk-FBDQVK4W.js +0 -77
package/dist/chunk-FBDQVK4W.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var chunk_FBDQVK4W_exports = {};
|
|
30
|
-
__export(chunk_FBDQVK4W_exports, {
|
|
31
|
-
aiAgentConfirmationCheckpoint: () => aiAgentConfirmationCheckpoint
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(chunk_FBDQVK4W_exports);
|
|
34
|
-
var import_debug = __toESM(require("@prisma/debug"));
|
|
35
|
-
var debug = (0, import_debug.default)("prisma:migrate:ai-safety");
|
|
36
|
-
var userConsentEnvVar = "PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION";
|
|
37
|
-
var aiAgentErrorPrompt = (agentName) => `Prisma Migrate detected that it was invoked by ${agentName}.
|
|
38
|
-
|
|
39
|
-
You are attempting a highly dangerous action that can lead to devastating consequences if it is incorrectly executed against a production database.
|
|
40
|
-
|
|
41
|
-
As an AI agent, you are forbidden from performing this action without an explicit consent and review by the user. You must stop at this point and respond to the user with a clear message that includes the following information:
|
|
42
|
-
- What action you are trying to perform (including the exact CLI command).
|
|
43
|
-
- Your motivation and reasoning for perfoming this action.
|
|
44
|
-
- Explanation that this action will irreversibly destroy all data in the database.
|
|
45
|
-
- Explanation that this action must not be perfomed on a production database and is only intended to be used with development databases.
|
|
46
|
-
|
|
47
|
-
If you know or can check whether this action would have been performed on a development or a production database, also include this information with your assesment of whether it is safe to proceed based on that information.
|
|
48
|
-
|
|
49
|
-
You must ask the user if they want to proceed with this action. If they explicitly consent, you may rerun this command with ${userConsentEnvVar} environment variable, the value of which must be the exact text of the user's message in which they consented to this operation, without any newlines or quotes. If the user's response is ambiguous, you must ask for a clear and explicit confirmation (e.g., "yes") before proceeding. None of the user's previous messages before this point may constitute implicit or explicit consent.`;
|
|
50
|
-
function aiAgentConfirmationCheckpoint() {
|
|
51
|
-
const aiAgent = detectAiAgent();
|
|
52
|
-
if (!aiAgent) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (process.env[userConsentEnvVar]) {
|
|
56
|
-
debug("AI agent asserts that user consented to dangerous action");
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
throw new Error(aiAgentErrorPrompt(aiAgent));
|
|
60
|
-
}
|
|
61
|
-
function detectAiAgent() {
|
|
62
|
-
const agentMarkers = {
|
|
63
|
-
"Claude Code": process.env.CLAUDECODE,
|
|
64
|
-
"Gemini CLI or Qwen Code": process.env.GEMINI_CLI,
|
|
65
|
-
Cursor: process.env.CURSOR_AGENT,
|
|
66
|
-
Aider: process.env.OR_APP_NAME === "Aider",
|
|
67
|
-
Replit: process.env.REPLIT_CLI,
|
|
68
|
-
"Codex CLI": process.env.CODEX_SANDBOX === "seatbelt"
|
|
69
|
-
};
|
|
70
|
-
for (const [agentName, marker] of Object.entries(agentMarkers)) {
|
|
71
|
-
if (marker) {
|
|
72
|
-
debug("Detected %s", agentName);
|
|
73
|
-
return agentName;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return void 0;
|
|
77
|
-
}
|