cc-mirror 1.1.0 → 1.1.2
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 +23 -48
- 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,
|
|
@@ -4847,17 +4826,16 @@ async function handleQuickMode(opts, params) {
|
|
|
4847
4826
|
shellEnv,
|
|
4848
4827
|
skillUpdate,
|
|
4849
4828
|
modelOverrides: resolvedModelOverrides,
|
|
4850
|
-
enableTeamMode: Boolean(opts["enable-team-mode"])
|
|
4829
|
+
enableTeamMode: Boolean(opts["enable-team-mode"]),
|
|
4830
|
+
tweakccStdio: "pipe"
|
|
4851
4831
|
});
|
|
4852
|
-
const shareUrl = buildShareUrl(provider.label || params.providerKey, params.name, result.meta.promptPackMode);
|
|
4853
4832
|
const modelNote = formatModelNote(resolvedModelOverrides);
|
|
4854
4833
|
const notes = [...result.notes || [], ...modelNote ? [modelNote] : []];
|
|
4855
4834
|
printSummary({
|
|
4856
4835
|
action: "Created",
|
|
4857
4836
|
meta: result.meta,
|
|
4858
4837
|
wrapperPath: result.wrapperPath,
|
|
4859
|
-
notes: notes.length > 0 ? notes : void 0
|
|
4860
|
-
shareUrl
|
|
4838
|
+
notes: notes.length > 0 ? notes : void 0
|
|
4861
4839
|
});
|
|
4862
4840
|
}
|
|
4863
4841
|
async function handleInteractiveMode(opts, params) {
|
|
@@ -4908,21 +4886,19 @@ async function handleInteractiveMode(opts, params) {
|
|
|
4908
4886
|
shellEnv,
|
|
4909
4887
|
skillUpdate,
|
|
4910
4888
|
modelOverrides: resolvedModelOverrides,
|
|
4911
|
-
enableTeamMode: Boolean(opts["enable-team-mode"])
|
|
4889
|
+
enableTeamMode: Boolean(opts["enable-team-mode"]),
|
|
4890
|
+
tweakccStdio: "pipe"
|
|
4912
4891
|
});
|
|
4913
|
-
const shareUrl = buildShareUrl(provider.label || params.providerKey, result.meta.name, result.meta.promptPackMode);
|
|
4914
4892
|
const modelNote = formatModelNote(resolvedModelOverrides);
|
|
4915
4893
|
const notes = [...result.notes || [], ...modelNote ? [modelNote] : []];
|
|
4916
4894
|
printSummary({
|
|
4917
4895
|
action: "Created",
|
|
4918
4896
|
meta: result.meta,
|
|
4919
4897
|
wrapperPath: result.wrapperPath,
|
|
4920
|
-
notes: notes.length > 0 ? notes : void 0
|
|
4921
|
-
shareUrl
|
|
4898
|
+
notes: notes.length > 0 ? notes : void 0
|
|
4922
4899
|
});
|
|
4923
4900
|
}
|
|
4924
4901
|
async function handleNonInteractiveMode(opts, params) {
|
|
4925
|
-
const { provider } = params;
|
|
4926
4902
|
const promptPack = opts["no-prompt-pack"] ? false : void 0;
|
|
4927
4903
|
const promptPackMode = parsePromptPackMode(opts["prompt-pack-mode"]);
|
|
4928
4904
|
const skillInstall = opts["no-skill-install"] ? false : void 0;
|
|
@@ -4950,17 +4926,16 @@ async function handleNonInteractiveMode(opts, params) {
|
|
|
4950
4926
|
shellEnv,
|
|
4951
4927
|
skillUpdate,
|
|
4952
4928
|
modelOverrides: resolvedModelOverrides,
|
|
4953
|
-
enableTeamMode: Boolean(opts["enable-team-mode"])
|
|
4929
|
+
enableTeamMode: Boolean(opts["enable-team-mode"]),
|
|
4930
|
+
tweakccStdio: "pipe"
|
|
4954
4931
|
});
|
|
4955
|
-
const shareUrl = buildShareUrl(provider.label || params.providerKey, result.meta.name, result.meta.promptPackMode);
|
|
4956
4932
|
const modelNote = formatModelNote(resolvedModelOverrides);
|
|
4957
4933
|
const notes = [...result.notes || [], ...modelNote ? [modelNote] : []];
|
|
4958
4934
|
printSummary({
|
|
4959
4935
|
action: "Created",
|
|
4960
4936
|
meta: result.meta,
|
|
4961
4937
|
wrapperPath: result.wrapperPath,
|
|
4962
|
-
notes: notes.length > 0 ? notes : void 0
|
|
4963
|
-
shareUrl
|
|
4938
|
+
notes: notes.length > 0 ? notes : void 0
|
|
4964
4939
|
});
|
|
4965
4940
|
}
|
|
4966
4941
|
async function runCreateCommand({ opts, quickMode }) {
|
package/package.json
CHANGED