cc-mirror 1.1.0 → 1.1.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/cc-mirror.mjs +17 -45
- package/package.json +1 -1
package/dist/cc-mirror.mjs
CHANGED
|
@@ -4587,52 +4587,31 @@ function runTweakCommand({ opts }) {
|
|
|
4587
4587
|
// src/cli/commands/update.ts
|
|
4588
4588
|
import path23 from "node:path";
|
|
4589
4589
|
|
|
4590
|
-
// src/cli/utils/buildShareUrl.ts
|
|
4591
|
-
function buildShareUrl(providerLabel, variant, mode) {
|
|
4592
|
-
const lines = [
|
|
4593
|
-
`Just set up ${providerLabel} with cc-mirror`,
|
|
4594
|
-
mode ? `Prompt pack: ${mode}` : "Prompt pack: enabled",
|
|
4595
|
-
`CLI: ${variant}`,
|
|
4596
|
-
"Get yours: npx cc-mirror",
|
|
4597
|
-
"(Attach your TUI screenshot)"
|
|
4598
|
-
];
|
|
4599
|
-
const url = new URL("https://x.com/intent/tweet");
|
|
4600
|
-
url.searchParams.set("text", lines.join("\n"));
|
|
4601
|
-
return url.toString();
|
|
4602
|
-
}
|
|
4603
|
-
|
|
4604
4590
|
// src/cli/utils/printSummary.ts
|
|
4605
4591
|
function printSummary(opts) {
|
|
4606
|
-
const { action, meta, wrapperPath, notes
|
|
4607
|
-
console.log(
|
|
4608
|
-
${action}: ${meta.name}`);
|
|
4609
|
-
console.log(`Provider: ${meta.provider}`);
|
|
4592
|
+
const { action, meta, wrapperPath, notes } = opts;
|
|
4593
|
+
console.log("");
|
|
4594
|
+
console.log(`\u2713 ${action}: ${meta.name}`);
|
|
4595
|
+
console.log(` Provider: ${meta.provider}`);
|
|
4610
4596
|
if (meta.promptPack !== void 0) {
|
|
4611
4597
|
const mode = meta.promptPackMode || "maximal";
|
|
4612
|
-
console.log(`Prompt pack: ${meta.promptPack ? `on (${mode})` : "off"}`);
|
|
4598
|
+
console.log(` Prompt pack: ${meta.promptPack ? `on (${mode})` : "off"}`);
|
|
4613
4599
|
}
|
|
4614
4600
|
if (meta.skillInstall !== void 0) {
|
|
4615
|
-
console.log(`dev-browser skill: ${meta.skillInstall ? "on" : "off"}`);
|
|
4601
|
+
console.log(` dev-browser skill: ${meta.skillInstall ? "on" : "off"}`);
|
|
4616
4602
|
}
|
|
4617
4603
|
if (meta.shellEnv !== void 0 && meta.provider === "zai") {
|
|
4618
|
-
console.log(`Shell env: ${meta.shellEnv ? "write Z_AI_API_KEY" : "manual"}`);
|
|
4604
|
+
console.log(` Shell env: ${meta.shellEnv ? "write Z_AI_API_KEY" : "manual"}`);
|
|
4619
4605
|
}
|
|
4620
|
-
if (wrapperPath) console.log(`Wrapper: ${wrapperPath}`);
|
|
4621
|
-
if (meta.configDir) console.log(`Config: ${meta.configDir}`);
|
|
4606
|
+
if (wrapperPath) console.log(` Wrapper: ${wrapperPath}`);
|
|
4607
|
+
if (meta.configDir) console.log(` Config: ${meta.configDir}`);
|
|
4622
4608
|
if (notes && notes.length > 0) {
|
|
4623
|
-
console.log("
|
|
4624
|
-
for (const note of notes) console.log(
|
|
4625
|
-
}
|
|
4626
|
-
console.log("Next steps:");
|
|
4627
|
-
console.log(`- Run: ${meta.name}`);
|
|
4628
|
-
console.log(`- Update: cc-mirror update ${meta.name}`);
|
|
4629
|
-
console.log(`- Tweak: cc-mirror tweak ${meta.name}`);
|
|
4630
|
-
console.log("Help: cc-mirror help");
|
|
4631
|
-
if (shareUrl) {
|
|
4632
|
-
console.log("Share:");
|
|
4633
|
-
console.log(shareUrl);
|
|
4609
|
+
console.log("");
|
|
4610
|
+
for (const note of notes) console.log(` \u2022 ${note}`);
|
|
4634
4611
|
}
|
|
4635
4612
|
console.log("");
|
|
4613
|
+
console.log(` Run: ${meta.name}`);
|
|
4614
|
+
console.log("");
|
|
4636
4615
|
}
|
|
4637
4616
|
|
|
4638
4617
|
// src/cli/prompt.ts
|
|
@@ -4786,7 +4765,7 @@ async function prepareCreateParams(opts) {
|
|
|
4786
4765
|
const npmPackage = opts["npm-package"] || DEFAULT_NPM_PACKAGE;
|
|
4787
4766
|
const extraEnv = buildExtraEnv(opts);
|
|
4788
4767
|
const requiresCredential = !provider.credentialOptional;
|
|
4789
|
-
const shouldPromptApiKey = !opts.yes && !hasApiKeyFlag && (providerKey === "zai" ? !hasZaiEnv : !apiKey);
|
|
4768
|
+
const shouldPromptApiKey = !provider.credentialOptional && !opts.yes && !hasApiKeyFlag && (providerKey === "zai" ? !hasZaiEnv : !apiKey);
|
|
4790
4769
|
return {
|
|
4791
4770
|
provider,
|
|
4792
4771
|
providerKey,
|
|
@@ -4849,15 +4828,13 @@ async function handleQuickMode(opts, params) {
|
|
|
4849
4828
|
modelOverrides: resolvedModelOverrides,
|
|
4850
4829
|
enableTeamMode: Boolean(opts["enable-team-mode"])
|
|
4851
4830
|
});
|
|
4852
|
-
const shareUrl = buildShareUrl(provider.label || params.providerKey, params.name, result.meta.promptPackMode);
|
|
4853
4831
|
const modelNote = formatModelNote(resolvedModelOverrides);
|
|
4854
4832
|
const notes = [...result.notes || [], ...modelNote ? [modelNote] : []];
|
|
4855
4833
|
printSummary({
|
|
4856
4834
|
action: "Created",
|
|
4857
4835
|
meta: result.meta,
|
|
4858
4836
|
wrapperPath: result.wrapperPath,
|
|
4859
|
-
notes: notes.length > 0 ? notes : void 0
|
|
4860
|
-
shareUrl
|
|
4837
|
+
notes: notes.length > 0 ? notes : void 0
|
|
4861
4838
|
});
|
|
4862
4839
|
}
|
|
4863
4840
|
async function handleInteractiveMode(opts, params) {
|
|
@@ -4910,19 +4887,16 @@ async function handleInteractiveMode(opts, params) {
|
|
|
4910
4887
|
modelOverrides: resolvedModelOverrides,
|
|
4911
4888
|
enableTeamMode: Boolean(opts["enable-team-mode"])
|
|
4912
4889
|
});
|
|
4913
|
-
const shareUrl = buildShareUrl(provider.label || params.providerKey, result.meta.name, result.meta.promptPackMode);
|
|
4914
4890
|
const modelNote = formatModelNote(resolvedModelOverrides);
|
|
4915
4891
|
const notes = [...result.notes || [], ...modelNote ? [modelNote] : []];
|
|
4916
4892
|
printSummary({
|
|
4917
4893
|
action: "Created",
|
|
4918
4894
|
meta: result.meta,
|
|
4919
4895
|
wrapperPath: result.wrapperPath,
|
|
4920
|
-
notes: notes.length > 0 ? notes : void 0
|
|
4921
|
-
shareUrl
|
|
4896
|
+
notes: notes.length > 0 ? notes : void 0
|
|
4922
4897
|
});
|
|
4923
4898
|
}
|
|
4924
4899
|
async function handleNonInteractiveMode(opts, params) {
|
|
4925
|
-
const { provider } = params;
|
|
4926
4900
|
const promptPack = opts["no-prompt-pack"] ? false : void 0;
|
|
4927
4901
|
const promptPackMode = parsePromptPackMode(opts["prompt-pack-mode"]);
|
|
4928
4902
|
const skillInstall = opts["no-skill-install"] ? false : void 0;
|
|
@@ -4952,15 +4926,13 @@ async function handleNonInteractiveMode(opts, params) {
|
|
|
4952
4926
|
modelOverrides: resolvedModelOverrides,
|
|
4953
4927
|
enableTeamMode: Boolean(opts["enable-team-mode"])
|
|
4954
4928
|
});
|
|
4955
|
-
const shareUrl = buildShareUrl(provider.label || params.providerKey, result.meta.name, result.meta.promptPackMode);
|
|
4956
4929
|
const modelNote = formatModelNote(resolvedModelOverrides);
|
|
4957
4930
|
const notes = [...result.notes || [], ...modelNote ? [modelNote] : []];
|
|
4958
4931
|
printSummary({
|
|
4959
4932
|
action: "Created",
|
|
4960
4933
|
meta: result.meta,
|
|
4961
4934
|
wrapperPath: result.wrapperPath,
|
|
4962
|
-
notes: notes.length > 0 ? notes : void 0
|
|
4963
|
-
shareUrl
|
|
4935
|
+
notes: notes.length > 0 ? notes : void 0
|
|
4964
4936
|
});
|
|
4965
4937
|
}
|
|
4966
4938
|
async function runCreateCommand({ opts, quickMode }) {
|
package/package.json
CHANGED