@meltstudio/meltctl 5.0.2 → 5.0.3
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/index.js +129 -106
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7450,7 +7450,7 @@ var CLI_VERSION;
|
|
|
7450
7450
|
var init_version = __esm({
|
|
7451
7451
|
"src/utils/version.ts"() {
|
|
7452
7452
|
"use strict";
|
|
7453
|
-
CLI_VERSION = "5.0.
|
|
7453
|
+
CLI_VERSION = "5.0.3";
|
|
7454
7454
|
}
|
|
7455
7455
|
});
|
|
7456
7456
|
|
|
@@ -26416,47 +26416,78 @@ var {
|
|
|
26416
26416
|
} = import_index.default;
|
|
26417
26417
|
|
|
26418
26418
|
// src/commands/templates.ts
|
|
26419
|
-
init_source();
|
|
26420
|
-
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
26421
|
-
import path2 from "path";
|
|
26422
|
-
import os3 from "os";
|
|
26423
|
-
|
|
26424
|
-
// src/utils/auth.ts
|
|
26425
26419
|
var import_fs_extra = __toESM(require_lib(), 1);
|
|
26420
|
+
init_source();
|
|
26426
26421
|
import path from "path";
|
|
26427
26422
|
import os2 from "os";
|
|
26428
|
-
var
|
|
26429
|
-
|
|
26430
|
-
|
|
26431
|
-
|
|
26432
|
-
|
|
26433
|
-
|
|
26434
|
-
|
|
26435
|
-
|
|
26436
|
-
|
|
26437
|
-
|
|
26438
|
-
|
|
26439
|
-
|
|
26440
|
-
|
|
26441
|
-
|
|
26442
|
-
|
|
26443
|
-
|
|
26444
|
-
|
|
26445
|
-
|
|
26446
|
-
|
|
26447
|
-
|
|
26448
|
-
|
|
26449
|
-
|
|
26450
|
-
|
|
26451
|
-
|
|
26452
|
-
|
|
26453
|
-
|
|
26454
|
-
|
|
26455
|
-
|
|
26423
|
+
var MIGRATION_DOC = `# Migrate this repo to Melt's current model
|
|
26424
|
+
|
|
26425
|
+
You are reading this because \`meltctl project templates\` was run (most likely by the legacy
|
|
26426
|
+
\`/melt-update\` skill). The per-repo Melt skill model has been **retired company-wide** and
|
|
26427
|
+
replaced by org-distributed \`/melt-dev-*\` skills. **This migration is mandatory \u2014 it is not a
|
|
26428
|
+
content refresh.** Perform the steps below now. Do NOT do a file-by-file template sync, and do
|
|
26429
|
+
NOT offer to skip, abort, or keep the old files.
|
|
26430
|
+
|
|
26431
|
+
## 1. Remove the legacy per-repo skill files (the only mandatory deletion)
|
|
26432
|
+
|
|
26433
|
+
These are superseded and non-functional. \`git rm -r\` any of these that exist:
|
|
26434
|
+
- \`.claude/skills/melt-{setup,plan,validate,review,pr,debug,audit,ux-audit,security-audit,update,help,link}/\`
|
|
26435
|
+
- \`.cursor/commands/melt-*.md\` and \`.opencode/commands/melt-*.md\`
|
|
26436
|
+
|
|
26437
|
+
Leave any non-Melt skills/commands the developer authored.
|
|
26438
|
+
|
|
26439
|
+
## 2. Update AGENTS.md \u2014 ADD only, never remove
|
|
26440
|
+
|
|
26441
|
+
AGENTS.md is the developer's living document; it holds project-specific rules, not just Melt
|
|
26442
|
+
boilerplate. **Do not delete or "slim" their content** \u2014 not the inline standards, not their
|
|
26443
|
+
own rules. Only ADD what's missing:
|
|
26444
|
+
- A \`## Stack\` block (languages, frameworks, test runner, package manager, database, deploy)
|
|
26445
|
+
- A \`## Project docs\` index pointing at satellite docs (TECH_DEBT.md, ARCHITECTURE.md, \u2026)
|
|
26446
|
+
- One line noting Melt's universal standards also ship with the \`/melt-dev-*\` skills now
|
|
26447
|
+
|
|
26448
|
+
If you spot a clearly-stale \`## Workflow Skills\` list using old \`/melt-*\` names, point it out
|
|
26449
|
+
as a suggestion for the developer to fix \u2014 do not remove it yourself.
|
|
26450
|
+
|
|
26451
|
+
## 3. Ensure .mcp.json has the servers the project needs
|
|
26452
|
+
|
|
26453
|
+
Propose, and write only on the developer's confirmation (merging \u2014 never clobbering existing
|
|
26454
|
+
servers), a browser server for any web/UI project:
|
|
26455
|
+
\`\`\`json
|
|
26456
|
+
"chrome-devtools": { "command": "npx", "args": ["-y", "chrome-devtools-mcp@latest", "--isolated"] }
|
|
26457
|
+
\`\`\`
|
|
26458
|
+
Add any other clearly-useful, stack-appropriate servers.
|
|
26459
|
+
|
|
26460
|
+
## 4. Never touch these
|
|
26461
|
+
|
|
26462
|
+
\`.claude/settings.json\` and \`.gitignore\` are entirely developer-owned.
|
|
26463
|
+
|
|
26464
|
+
## After migrating
|
|
26465
|
+
|
|
26466
|
+
The \`/melt-dev-*\` skills are distributed via the Anthropic org Skills registry and auto-update
|
|
26467
|
+
in Claude Code. If they are not available in your session, that is an org-enrollment issue \u2014
|
|
26468
|
+
raise it in #dev. It is not a reason to stay on the old model.
|
|
26469
|
+
`;
|
|
26470
|
+
async function templatesCommand() {
|
|
26471
|
+
const tmpDir = path.join(os2.tmpdir(), `melt-migration-${Date.now()}`);
|
|
26472
|
+
await import_fs_extra.default.ensureDir(tmpDir);
|
|
26473
|
+
await import_fs_extra.default.writeFile(path.join(tmpDir, "MIGRATION.md"), MIGRATION_DOC, "utf-8");
|
|
26474
|
+
const notice = [
|
|
26475
|
+
"",
|
|
26476
|
+
source_default.bold.yellow("\u26A0 The per-repo Melt skill model has been retired (company-wide)."),
|
|
26477
|
+
"This command now hands back MIGRATION INSTRUCTIONS, not a template refresh.",
|
|
26478
|
+
`\u2192 Follow ${source_default.cyan("MIGRATION.md")} in the directory printed below to migrate this repo now.`,
|
|
26479
|
+
` (In Claude Code with the org skills, ${source_default.cyan("/melt-dev-update")} does the same migration.)`,
|
|
26480
|
+
""
|
|
26481
|
+
].join("\n");
|
|
26482
|
+
console.error(notice);
|
|
26483
|
+
console.log(tmpDir);
|
|
26456
26484
|
}
|
|
26457
26485
|
|
|
26458
|
-
// src/
|
|
26486
|
+
// src/commands/login.ts
|
|
26459
26487
|
init_source();
|
|
26488
|
+
import http from "http";
|
|
26489
|
+
import { URL as URL2 } from "url";
|
|
26490
|
+
import { exec } from "child_process";
|
|
26460
26491
|
|
|
26461
26492
|
// ../sdk/dist/resources/audits.js
|
|
26462
26493
|
function createAuditsResource(config2) {
|
|
@@ -42051,83 +42082,40 @@ var RULE_BY_ID = new Map(ISSUE_RULES.map((r) => [r.id, r]));
|
|
|
42051
42082
|
// ../sdk/dist/utils/health-issues-derivation.js
|
|
42052
42083
|
var FOURTEEN_DAYS_MS = 14 * 24 * 60 * 60 * 1e3;
|
|
42053
42084
|
|
|
42054
|
-
// src/utils/
|
|
42055
|
-
|
|
42056
|
-
|
|
42057
|
-
|
|
42058
|
-
|
|
42059
|
-
|
|
42060
|
-
|
|
42061
|
-
|
|
42062
|
-
|
|
42063
|
-
|
|
42064
|
-
"Not authenticated. Run `npx @meltstudio/meltctl@latest login` or set MELTCTL_TOKEN for CI."
|
|
42065
|
-
)
|
|
42066
|
-
);
|
|
42067
|
-
process.exit(1);
|
|
42085
|
+
// src/utils/auth.ts
|
|
42086
|
+
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
42087
|
+
import path2 from "path";
|
|
42088
|
+
import os3 from "os";
|
|
42089
|
+
var AUTH_DIR = path2.join(os3.homedir(), ".meltctl");
|
|
42090
|
+
var AUTH_FILE = path2.join(AUTH_DIR, "auth.json");
|
|
42091
|
+
var API_BASE = process.env["MELTCTL_API_URL"] ?? "https://api.meltctl.meltstudio.co";
|
|
42092
|
+
async function getStoredAuth() {
|
|
42093
|
+
if (!await import_fs_extra2.default.pathExists(AUTH_FILE)) {
|
|
42094
|
+
return void 0;
|
|
42068
42095
|
}
|
|
42069
|
-
|
|
42070
|
-
|
|
42071
|
-
|
|
42072
|
-
|
|
42073
|
-
)
|
|
42074
|
-
);
|
|
42075
|
-
process.exit(1);
|
|
42096
|
+
try {
|
|
42097
|
+
return await import_fs_extra2.default.readJson(AUTH_FILE);
|
|
42098
|
+
} catch {
|
|
42099
|
+
return void 0;
|
|
42076
42100
|
}
|
|
42077
|
-
return auth.token;
|
|
42078
|
-
}
|
|
42079
|
-
async function getClient() {
|
|
42080
|
-
const token = await getToken();
|
|
42081
|
-
return createMeltClient({ baseUrl: API_BASE, token });
|
|
42082
42101
|
}
|
|
42083
|
-
|
|
42084
|
-
|
|
42085
|
-
|
|
42086
|
-
const client = await getClient();
|
|
42087
|
-
return client.templates.fetch();
|
|
42102
|
+
async function storeAuth(auth) {
|
|
42103
|
+
await import_fs_extra2.default.ensureDir(AUTH_DIR);
|
|
42104
|
+
await import_fs_extra2.default.writeJson(AUTH_FILE, auth, { spaces: 2 });
|
|
42088
42105
|
}
|
|
42089
|
-
|
|
42090
|
-
|
|
42091
|
-
|
|
42092
|
-
if (!await isAuthenticated()) {
|
|
42093
|
-
console.error(source_default.red("Not authenticated. Run `npx @meltstudio/meltctl@latest login` first."));
|
|
42094
|
-
process.exit(1);
|
|
42095
|
-
}
|
|
42096
|
-
let templates;
|
|
42097
|
-
try {
|
|
42098
|
-
templates = await fetchTemplates();
|
|
42099
|
-
} catch (error48) {
|
|
42100
|
-
if (error48 instanceof Error && error48.message.includes("expired")) {
|
|
42101
|
-
console.error(
|
|
42102
|
-
source_default.red("Session expired. Run `npx @meltstudio/meltctl@latest login` to re-authenticate.")
|
|
42103
|
-
);
|
|
42104
|
-
} else if (error48 instanceof Error && error48.message.includes("fetch")) {
|
|
42105
|
-
console.error(source_default.red("Could not reach Melt API. Check your connection."));
|
|
42106
|
-
} else {
|
|
42107
|
-
console.error(
|
|
42108
|
-
source_default.red(
|
|
42109
|
-
`Failed to fetch templates: ${error48 instanceof Error ? error48.message : "Unknown error"}`
|
|
42110
|
-
)
|
|
42111
|
-
);
|
|
42112
|
-
}
|
|
42113
|
-
process.exit(1);
|
|
42106
|
+
async function clearAuth() {
|
|
42107
|
+
if (await import_fs_extra2.default.pathExists(AUTH_FILE)) {
|
|
42108
|
+
await import_fs_extra2.default.remove(AUTH_FILE);
|
|
42114
42109
|
}
|
|
42115
|
-
|
|
42116
|
-
|
|
42117
|
-
|
|
42118
|
-
|
|
42119
|
-
|
|
42120
|
-
await import_fs_extra2.default.writeFile(fullPath, content, "utf-8");
|
|
42110
|
+
}
|
|
42111
|
+
async function isAuthenticated() {
|
|
42112
|
+
const auth = await getStoredAuth();
|
|
42113
|
+
if (!auth) {
|
|
42114
|
+
return false;
|
|
42121
42115
|
}
|
|
42122
|
-
|
|
42116
|
+
return new Date(auth.expiresAt) > /* @__PURE__ */ new Date();
|
|
42123
42117
|
}
|
|
42124
42118
|
|
|
42125
|
-
// src/commands/login.ts
|
|
42126
|
-
init_source();
|
|
42127
|
-
import http from "http";
|
|
42128
|
-
import { URL as URL2 } from "url";
|
|
42129
|
-
import { exec } from "child_process";
|
|
42130
|
-
|
|
42131
42119
|
// src/utils/banner.ts
|
|
42132
42120
|
init_source();
|
|
42133
42121
|
|
|
@@ -42479,6 +42467,39 @@ async function versionCheckCommand() {
|
|
|
42479
42467
|
// src/commands/standup.ts
|
|
42480
42468
|
init_source();
|
|
42481
42469
|
init_dist11();
|
|
42470
|
+
|
|
42471
|
+
// src/utils/api.ts
|
|
42472
|
+
init_source();
|
|
42473
|
+
async function getToken() {
|
|
42474
|
+
const envToken = process.env["MELTCTL_TOKEN"];
|
|
42475
|
+
if (envToken) {
|
|
42476
|
+
return envToken;
|
|
42477
|
+
}
|
|
42478
|
+
const auth = await getStoredAuth();
|
|
42479
|
+
if (!auth) {
|
|
42480
|
+
console.error(
|
|
42481
|
+
source_default.red(
|
|
42482
|
+
"Not authenticated. Run `npx @meltstudio/meltctl@latest login` or set MELTCTL_TOKEN for CI."
|
|
42483
|
+
)
|
|
42484
|
+
);
|
|
42485
|
+
process.exit(1);
|
|
42486
|
+
}
|
|
42487
|
+
if (new Date(auth.expiresAt) <= /* @__PURE__ */ new Date()) {
|
|
42488
|
+
console.error(
|
|
42489
|
+
source_default.red(
|
|
42490
|
+
"Session expired. Run `npx @meltstudio/meltctl@latest login` to re-authenticate, or set MELTCTL_TOKEN for CI."
|
|
42491
|
+
)
|
|
42492
|
+
);
|
|
42493
|
+
process.exit(1);
|
|
42494
|
+
}
|
|
42495
|
+
return auth.token;
|
|
42496
|
+
}
|
|
42497
|
+
async function getClient() {
|
|
42498
|
+
const token = await getToken();
|
|
42499
|
+
return createMeltClient({ baseUrl: API_BASE, token });
|
|
42500
|
+
}
|
|
42501
|
+
|
|
42502
|
+
// src/commands/standup.ts
|
|
42482
42503
|
var EDITOR_HINT = source_default.dim("(type \\e to open your editor)");
|
|
42483
42504
|
async function promptField(message, required2) {
|
|
42484
42505
|
const value = await dist_default7({ message: `${message} ${EDITOR_HINT}` });
|
|
@@ -55442,7 +55463,9 @@ ${source_default.dim(" /melt-dev-link Connect and verify ticket tracker + br
|
|
|
55442
55463
|
${source_default.dim(" /melt-dev-update Refresh AGENTS.md + MCP config to the latest")}
|
|
55443
55464
|
`
|
|
55444
55465
|
);
|
|
55445
|
-
project.command("templates").description(
|
|
55466
|
+
project.command("templates").description(
|
|
55467
|
+
"write the repo-migration playbook to a temp dir (the /melt-update \u2192 /melt-dev-* path); /melt-dev-update does the same"
|
|
55468
|
+
).action(async () => {
|
|
55446
55469
|
await templatesCommand();
|
|
55447
55470
|
});
|
|
55448
55471
|
program2.command("standup").description("submit your daily standup report").addOption(new Option("--yesterday <text>").hideHelp()).addOption(new Option("--today <text>").hideHelp()).addOption(new Option("--blockers <text>").hideHelp()).action(async (options) => {
|
package/package.json
CHANGED