pruff-skills 0.6.0 → 0.7.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.
- package/dist/cli.mjs +60 -18
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -6886,6 +6886,8 @@ const WORKSPACE_SETTINGS_JSON = `${JSON.stringify({ permissions: { allow: [
|
|
|
6886
6886
|
] } }, null, 2)}\n`;
|
|
6887
6887
|
const CLAUDE_CODE_PKG = "@anthropic-ai/claude-code";
|
|
6888
6888
|
const INTELLIGENCE_SCHEMA = "prisma/intelligence/schema.prisma";
|
|
6889
|
+
const SERVER_SCHEMA = "prisma/schema";
|
|
6890
|
+
const PRISMA_BIN = join("node_modules", ".bin", "prisma");
|
|
6889
6891
|
const INTELLIGENCE_GLOBAL_SEED = "prisma/intelligence/seeds/seedIntelligenceGlobal.ts";
|
|
6890
6892
|
const INTELLIGENCE_TENANT_SCRIPT = "scripts/intelligence/createIntelligenceTenant.ts";
|
|
6891
6893
|
const KNOWLEDGE_REPO = "https://github.com/Pruff-Tech/pruff-knowledge";
|
|
@@ -6968,7 +6970,8 @@ async function preflight() {
|
|
|
6968
6970
|
}
|
|
6969
6971
|
M.success("git · node · npm present");
|
|
6970
6972
|
if (!ensureGh()) return false;
|
|
6971
|
-
|
|
6973
|
+
if (!await ensureGitHubAuth()) return false;
|
|
6974
|
+
return ensureGitCredentialHelper();
|
|
6972
6975
|
}
|
|
6973
6976
|
function ensureGh() {
|
|
6974
6977
|
if (has("gh")) return true;
|
|
@@ -7012,6 +7015,40 @@ async function ensureGitHubAuth() {
|
|
|
7012
7015
|
M.error(`Still not authenticated.\n ${instruction}`);
|
|
7013
7016
|
return false;
|
|
7014
7017
|
}
|
|
7018
|
+
function githubCredentialSource(helpers) {
|
|
7019
|
+
const configured = helpers.map((h) => h.trim()).filter((h) => h !== "");
|
|
7020
|
+
if (configured.some((h) => h.includes("gh auth git-credential"))) return "gh";
|
|
7021
|
+
return configured.length > 0 ? "other" : "none";
|
|
7022
|
+
}
|
|
7023
|
+
function githubCredentialHelpers() {
|
|
7024
|
+
return ["credential.https://github.com.helper", "credential.helper"].flatMap((key) => {
|
|
7025
|
+
const { ok, out } = capture("git", [
|
|
7026
|
+
"config",
|
|
7027
|
+
"--get-all",
|
|
7028
|
+
key
|
|
7029
|
+
]);
|
|
7030
|
+
return ok ? out.split("\n") : [];
|
|
7031
|
+
});
|
|
7032
|
+
}
|
|
7033
|
+
function ensureGitCredentialHelper() {
|
|
7034
|
+
if (githubCredentialSource(githubCredentialHelpers()) === "gh") {
|
|
7035
|
+
M.success("git credentials wired to gh");
|
|
7036
|
+
return true;
|
|
7037
|
+
}
|
|
7038
|
+
const s = Y();
|
|
7039
|
+
s.start("Wiring git credentials to gh (gh auth setup-git)…");
|
|
7040
|
+
run("gh", ["auth", "setup-git"]);
|
|
7041
|
+
const source = githubCredentialSource(githubCredentialHelpers());
|
|
7042
|
+
s.stop(source === "gh" ? "git credentials wired to gh" : import_picocolors.default.yellow("gh auth setup-git did not stick"));
|
|
7043
|
+
if (source === "gh") return true;
|
|
7044
|
+
if (source === "other") {
|
|
7045
|
+
note("git credentials for github.com are not managed by gh — clones may prompt.");
|
|
7046
|
+
M.warn(`${import_picocolors.default.cyan("gh auth setup-git")} did not take, but another credential helper is configured.\n If a clone below asks for a username, run ${import_picocolors.default.cyan("gh auth setup-git")} and re-run.`);
|
|
7047
|
+
return true;
|
|
7048
|
+
}
|
|
7049
|
+
M.error(`git has no credential helper for github.com, so cloning the private Pruff repos will fail.\n Run ${import_picocolors.default.cyan("gh auth setup-git")} (or ${import_picocolors.default.cyan("gh auth login -h github.com -p https -w")} and answer yes to "Authenticate Git with your GitHub credentials?"), then re-run.`);
|
|
7050
|
+
return false;
|
|
7051
|
+
}
|
|
7015
7052
|
function has(cmd) {
|
|
7016
7053
|
return spawnSync("command", ["-v", cmd], {
|
|
7017
7054
|
shell: true,
|
|
@@ -7111,6 +7148,7 @@ async function resolveWorkspace(args) {
|
|
|
7111
7148
|
}
|
|
7112
7149
|
return expandHome((answer || DEFAULT_WORKSPACE).trim());
|
|
7113
7150
|
}
|
|
7151
|
+
const NO_GIT_PROMPT = { GIT_TERMINAL_PROMPT: "0" };
|
|
7114
7152
|
function cloneKnowledge(workspace) {
|
|
7115
7153
|
const vaultPath = join(workspace, KNOWLEDGE_DIR);
|
|
7116
7154
|
const s = Y();
|
|
@@ -7121,7 +7159,7 @@ function cloneKnowledge(workspace) {
|
|
|
7121
7159
|
vaultPath,
|
|
7122
7160
|
"pull",
|
|
7123
7161
|
"--ff-only"
|
|
7124
|
-
]);
|
|
7162
|
+
], void 0, NO_GIT_PROMPT);
|
|
7125
7163
|
s.stop(ok ? "Pruff knowledge up to date" : import_picocolors.default.yellow("git pull failed (keeping local copy)"));
|
|
7126
7164
|
registerVault(vaultPath);
|
|
7127
7165
|
return;
|
|
@@ -7131,7 +7169,7 @@ function cloneKnowledge(workspace) {
|
|
|
7131
7169
|
"clone",
|
|
7132
7170
|
KNOWLEDGE_REPO,
|
|
7133
7171
|
vaultPath
|
|
7134
|
-
])) {
|
|
7172
|
+
], void 0, NO_GIT_PROMPT)) {
|
|
7135
7173
|
s.stop(`Cloned knowledge to ${import_picocolors.default.dim(vaultPath)}`);
|
|
7136
7174
|
registerVault(vaultPath);
|
|
7137
7175
|
return;
|
|
@@ -7153,7 +7191,7 @@ function cloneRepo(repo, workspace) {
|
|
|
7153
7191
|
"clone",
|
|
7154
7192
|
url,
|
|
7155
7193
|
target
|
|
7156
|
-
], workspace)) s.stop(`Cloned ${import_picocolors.default.cyan(name)}`);
|
|
7194
|
+
], workspace, NO_GIT_PROMPT)) s.stop(`Cloned ${import_picocolors.default.cyan(name)}`);
|
|
7157
7195
|
else {
|
|
7158
7196
|
s.stop(import_picocolors.default.yellow(`${name} clone failed`));
|
|
7159
7197
|
note(`${name} not cloned — every later step for it was skipped.`);
|
|
@@ -7228,6 +7266,11 @@ async function setupLocalEnvironment(serverPath) {
|
|
|
7228
7266
|
M.warn("Pruff-server not cloned — skipping local database setup.");
|
|
7229
7267
|
return;
|
|
7230
7268
|
}
|
|
7269
|
+
if (!prismaInstalled(serverPath)) {
|
|
7270
|
+
note("Local database not set up — Pruff-server dependencies are missing.");
|
|
7271
|
+
M.warn(`${import_picocolors.default.cyan(PRISMA_BIN)} is missing from Pruff-server — its dependency install did not complete.\n Run ${import_picocolors.default.dim("cd Pruff-server && bun install")}, then re-run with ${import_picocolors.default.cyan("--db")}.`);
|
|
7272
|
+
return;
|
|
7273
|
+
}
|
|
7231
7274
|
if (!await ensureMysql()) return;
|
|
7232
7275
|
ensureDbeaver();
|
|
7233
7276
|
const dbPassword = await resolveRootPassword();
|
|
@@ -7462,11 +7505,18 @@ function adminUserExists(conn, db, email) {
|
|
|
7462
7505
|
const { ok, out } = mysqlQuery(conn, `SELECT COUNT(*) FROM \`${db}\`.\`User\` WHERE email = '${email}'`);
|
|
7463
7506
|
return ok && parseInt(out, 10) > 0;
|
|
7464
7507
|
}
|
|
7508
|
+
function prismaBin(serverPath) {
|
|
7509
|
+
return join(serverPath, PRISMA_BIN);
|
|
7510
|
+
}
|
|
7511
|
+
function prismaInstalled(serverPath) {
|
|
7512
|
+
return existsSync(prismaBin(serverPath));
|
|
7513
|
+
}
|
|
7465
7514
|
function migrateDeploy(serverPath, url) {
|
|
7466
|
-
return run(
|
|
7467
|
-
"prisma",
|
|
7515
|
+
return run(prismaBin(serverPath), [
|
|
7468
7516
|
"migrate",
|
|
7469
|
-
"deploy"
|
|
7517
|
+
"deploy",
|
|
7518
|
+
"--schema",
|
|
7519
|
+
SERVER_SCHEMA
|
|
7470
7520
|
], serverPath, { DATABASE_URL: url });
|
|
7471
7521
|
}
|
|
7472
7522
|
function rutConflict(holderSecretId, clientId) {
|
|
@@ -7557,11 +7607,7 @@ function setupLocalDatabase(serverPath, env) {
|
|
|
7557
7607
|
}
|
|
7558
7608
|
const s = Y();
|
|
7559
7609
|
s.start(`Seeding tenant "${clientId}"…`);
|
|
7560
|
-
const seeded = run("
|
|
7561
|
-
"prisma",
|
|
7562
|
-
"db",
|
|
7563
|
-
"seed"
|
|
7564
|
-
], serverPath, {
|
|
7610
|
+
const seeded = run(prismaBin(serverPath), ["db", "seed"], serverPath, {
|
|
7565
7611
|
...env,
|
|
7566
7612
|
DATABASE_URL: tenantUrl
|
|
7567
7613
|
});
|
|
@@ -7604,14 +7650,12 @@ function setupIntelligence(serverPath, env, conn, controlPlaneUrl, adminEmail, a
|
|
|
7604
7650
|
...env,
|
|
7605
7651
|
INTELLIGENCE_DATABASE_URL: intelligenceUrl
|
|
7606
7652
|
};
|
|
7607
|
-
if (!(run(
|
|
7608
|
-
"prisma",
|
|
7653
|
+
if (!(run(prismaBin(serverPath), [
|
|
7609
7654
|
"migrate",
|
|
7610
7655
|
"deploy",
|
|
7611
7656
|
"--schema",
|
|
7612
7657
|
INTELLIGENCE_SCHEMA
|
|
7613
|
-
], serverPath, intelligenceEnv) && run(
|
|
7614
|
-
"prisma",
|
|
7658
|
+
], serverPath, intelligenceEnv) && run(prismaBin(serverPath), [
|
|
7615
7659
|
"generate",
|
|
7616
7660
|
"--schema",
|
|
7617
7661
|
INTELLIGENCE_SCHEMA
|
|
@@ -7767,7 +7811,6 @@ const SKILLS_COMMON = [
|
|
|
7767
7811
|
"create-pr",
|
|
7768
7812
|
"handoff",
|
|
7769
7813
|
"linear",
|
|
7770
|
-
"using-git-worktrees",
|
|
7771
7814
|
"pruff-knowledge"
|
|
7772
7815
|
];
|
|
7773
7816
|
const TEAM_SKILLS = {
|
|
@@ -7794,7 +7837,6 @@ const TEAM_SKILLS = {
|
|
|
7794
7837
|
"pruff-pr-review"
|
|
7795
7838
|
],
|
|
7796
7839
|
shared: [
|
|
7797
|
-
"buzz-cli",
|
|
7798
7840
|
"pruff-logs",
|
|
7799
7841
|
"pruff-sgsi",
|
|
7800
7842
|
"infra-healthcheck",
|