oh-my-magento 0.3.0 → 0.3.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/cli/index.js +318 -100
- package/dist/cli/minimax/index.d.ts +2 -0
- package/dist/cli/minimax/tui.d.ts +1 -0
- package/dist/index.js +13 -28
- package/package.json +12 -23
package/dist/cli/index.js
CHANGED
|
@@ -2145,7 +2145,7 @@ var package_default;
|
|
|
2145
2145
|
var init_package = __esm(() => {
|
|
2146
2146
|
package_default = {
|
|
2147
2147
|
name: "oh-my-magento",
|
|
2148
|
-
version: "
|
|
2148
|
+
version: "0.3.2",
|
|
2149
2149
|
description: "Magento 2 + Hyv\xE4 Enterprise E-Commerce Intelligent Agent Orchestration System - OpenCode Plugin",
|
|
2150
2150
|
main: "dist/index.js",
|
|
2151
2151
|
types: "dist/index.d.ts",
|
|
@@ -2225,28 +2225,17 @@ var init_package = __esm(() => {
|
|
|
2225
2225
|
typescript: "^5.7.3"
|
|
2226
2226
|
},
|
|
2227
2227
|
optionalDependencies: {
|
|
2228
|
-
"oh-my-magento-darwin-arm64": "
|
|
2229
|
-
"oh-my-magento-darwin-x64": "
|
|
2230
|
-
"oh-my-magento-darwin-x64-baseline": "
|
|
2231
|
-
"oh-my-magento-linux-arm64": "
|
|
2232
|
-
"oh-my-magento-linux-arm64-musl": "
|
|
2233
|
-
"oh-my-magento-linux-x64": "
|
|
2234
|
-
"oh-my-magento-linux-x64-baseline": "
|
|
2235
|
-
"oh-my-magento-linux-x64-musl": "
|
|
2236
|
-
"oh-my-magento-linux-x64-musl-baseline": "
|
|
2237
|
-
"oh-my-magento-windows-x64": "
|
|
2238
|
-
"oh-my-magento-windows-x64-baseline": "
|
|
2239
|
-
"oh-my-opencode-darwin-arm64": "v0.3.0",
|
|
2240
|
-
"oh-my-opencode-darwin-x64": "v0.3.0",
|
|
2241
|
-
"oh-my-opencode-darwin-x64-baseline": "v0.3.0",
|
|
2242
|
-
"oh-my-opencode-linux-arm64": "v0.3.0",
|
|
2243
|
-
"oh-my-opencode-linux-arm64-musl": "v0.3.0",
|
|
2244
|
-
"oh-my-opencode-linux-x64": "v0.3.0",
|
|
2245
|
-
"oh-my-opencode-linux-x64-baseline": "v0.3.0",
|
|
2246
|
-
"oh-my-opencode-linux-x64-musl": "v0.3.0",
|
|
2247
|
-
"oh-my-opencode-linux-x64-musl-baseline": "v0.3.0",
|
|
2248
|
-
"oh-my-opencode-windows-x64": "v0.3.0",
|
|
2249
|
-
"oh-my-opencode-windows-x64-baseline": "v0.3.0"
|
|
2228
|
+
"oh-my-magento-darwin-arm64": "0.3.2",
|
|
2229
|
+
"oh-my-magento-darwin-x64": "0.3.2",
|
|
2230
|
+
"oh-my-magento-darwin-x64-baseline": "0.3.2",
|
|
2231
|
+
"oh-my-magento-linux-arm64": "0.3.2",
|
|
2232
|
+
"oh-my-magento-linux-arm64-musl": "0.3.2",
|
|
2233
|
+
"oh-my-magento-linux-x64": "0.3.2",
|
|
2234
|
+
"oh-my-magento-linux-x64-baseline": "0.3.2",
|
|
2235
|
+
"oh-my-magento-linux-x64-musl": "0.3.2",
|
|
2236
|
+
"oh-my-magento-linux-x64-musl-baseline": "0.3.2",
|
|
2237
|
+
"oh-my-magento-windows-x64": "0.3.2",
|
|
2238
|
+
"oh-my-magento-windows-x64-baseline": "0.3.2"
|
|
2250
2239
|
},
|
|
2251
2240
|
overrides: {
|
|
2252
2241
|
"@opencode-ai/sdk": "^1.2.24"
|
|
@@ -6467,7 +6456,6 @@ var init_model_requirements = __esm(() => {
|
|
|
6467
6456
|
variant: "max"
|
|
6468
6457
|
},
|
|
6469
6458
|
{ providers: ["opencode-go"], model: "kimi-k2.5" },
|
|
6470
|
-
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
6471
6459
|
{
|
|
6472
6460
|
providers: [
|
|
6473
6461
|
"opencode",
|
|
@@ -6479,6 +6467,7 @@ var init_model_requirements = __esm(() => {
|
|
|
6479
6467
|
],
|
|
6480
6468
|
model: "kimi-k2.5"
|
|
6481
6469
|
},
|
|
6470
|
+
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
6482
6471
|
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.4", variant: "medium" },
|
|
6483
6472
|
{ providers: ["zai-coding-plan", "opencode"], model: "glm-5" },
|
|
6484
6473
|
{ providers: ["opencode"], model: "big-pickle" }
|
|
@@ -6696,10 +6685,6 @@ var init_model_requirements = __esm(() => {
|
|
|
6696
6685
|
},
|
|
6697
6686
|
quick: {
|
|
6698
6687
|
fallbackChain: [
|
|
6699
|
-
{
|
|
6700
|
-
providers: ["openai", "github-copilot", "opencode"],
|
|
6701
|
-
model: "gpt-5.4-mini"
|
|
6702
|
-
},
|
|
6703
6688
|
{
|
|
6704
6689
|
providers: ["anthropic", "github-copilot", "opencode"],
|
|
6705
6690
|
model: "claude-haiku-4-5"
|
|
@@ -7637,7 +7622,7 @@ var init_openai_only_model_catalog = __esm(() => {
|
|
|
7637
7622
|
};
|
|
7638
7623
|
OPENAI_ONLY_CATEGORY_OVERRIDES = {
|
|
7639
7624
|
artistry: { model: "openai/gpt-5.4", variant: "xhigh" },
|
|
7640
|
-
quick: { model: "openai/gpt-5.
|
|
7625
|
+
quick: { model: "openai/gpt-5.3-codex", variant: "low" },
|
|
7641
7626
|
"visual-engineering": { model: "openai/gpt-5.4", variant: "high" },
|
|
7642
7627
|
writing: { model: "openai/gpt-5.4", variant: "medium" }
|
|
7643
7628
|
};
|
|
@@ -7725,14 +7710,6 @@ function generateModelConfig(config) {
|
|
|
7725
7710
|
const agents = {};
|
|
7726
7711
|
const categories = {};
|
|
7727
7712
|
for (const [role, req] of Object.entries(CLI_AGENT_MODEL_REQUIREMENTS)) {
|
|
7728
|
-
if (role === "librarian") {
|
|
7729
|
-
if (avail.opencodeGo) {
|
|
7730
|
-
agents[role] = { model: "opencode-go/minimax-m2.5" };
|
|
7731
|
-
} else if (avail.zai) {
|
|
7732
|
-
agents[role] = { model: ZAI_MODEL };
|
|
7733
|
-
}
|
|
7734
|
-
continue;
|
|
7735
|
-
}
|
|
7736
7713
|
if (role === "explore") {
|
|
7737
7714
|
if (avail.native.claude) {
|
|
7738
7715
|
agents[role] = { model: "anthropic/claude-haiku-4-5" };
|
|
@@ -7796,7 +7773,7 @@ function generateModelConfig(config) {
|
|
|
7796
7773
|
};
|
|
7797
7774
|
return isOpenAiOnlyAvailability(avail) ? applyOpenAiOnlyModelCatalog(generatedConfig) : generatedConfig;
|
|
7798
7775
|
}
|
|
7799
|
-
var
|
|
7776
|
+
var ULTIMATE_FALLBACK = "opencode/gpt-5-nano", SCHEMA_URL = "https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/dev/assets/oh-my-opencode.schema.json";
|
|
7800
7777
|
var init_model_fallback = __esm(() => {
|
|
7801
7778
|
init_model_fallback_requirements();
|
|
7802
7779
|
init_openai_only_model_catalog();
|
|
@@ -9704,6 +9681,41 @@ class dD extends x {
|
|
|
9704
9681
|
}
|
|
9705
9682
|
var A;
|
|
9706
9683
|
A = new WeakMap;
|
|
9684
|
+
var kD = Object.defineProperty;
|
|
9685
|
+
var $D = (e, u, t) => (u in e) ? kD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
|
|
9686
|
+
var H = (e, u, t) => ($D(e, typeof u != "symbol" ? u + "" : u, t), t);
|
|
9687
|
+
var SD = class extends x {
|
|
9688
|
+
constructor(u) {
|
|
9689
|
+
super(u, false), H(this, "options"), H(this, "cursor", 0), this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: t }) => t === u.cursorAt), 0), this.on("key", (t) => {
|
|
9690
|
+
t === "a" && this.toggleAll();
|
|
9691
|
+
}), this.on("cursor", (t) => {
|
|
9692
|
+
switch (t) {
|
|
9693
|
+
case "left":
|
|
9694
|
+
case "up":
|
|
9695
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
9696
|
+
break;
|
|
9697
|
+
case "down":
|
|
9698
|
+
case "right":
|
|
9699
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
9700
|
+
break;
|
|
9701
|
+
case "space":
|
|
9702
|
+
this.toggleValue();
|
|
9703
|
+
break;
|
|
9704
|
+
}
|
|
9705
|
+
});
|
|
9706
|
+
}
|
|
9707
|
+
get _value() {
|
|
9708
|
+
return this.options[this.cursor].value;
|
|
9709
|
+
}
|
|
9710
|
+
toggleAll() {
|
|
9711
|
+
const u = this.value.length === this.options.length;
|
|
9712
|
+
this.value = u ? [] : this.options.map((t) => t.value);
|
|
9713
|
+
}
|
|
9714
|
+
toggleValue() {
|
|
9715
|
+
const u = this.value.includes(this._value);
|
|
9716
|
+
this.value = u ? this.value.filter((t) => t !== this._value) : [...this.value, this._value];
|
|
9717
|
+
}
|
|
9718
|
+
};
|
|
9707
9719
|
var OD = Object.defineProperty;
|
|
9708
9720
|
var PD = (e, u, t) => (u in e) ? OD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t;
|
|
9709
9721
|
var J = (e, u, t) => (PD(e, typeof u != "symbol" ? u + "" : u, t), t);
|
|
@@ -9875,6 +9887,47 @@ ${import_picocolors4.default.cyan(d2)}
|
|
|
9875
9887
|
}
|
|
9876
9888
|
} }).prompt();
|
|
9877
9889
|
};
|
|
9890
|
+
var fe = (t) => {
|
|
9891
|
+
const n = (r2, i2) => {
|
|
9892
|
+
const s = r2.label ?? String(r2.value);
|
|
9893
|
+
return i2 === "active" ? `${import_picocolors4.default.cyan(A2)} ${s} ${r2.hint ? import_picocolors4.default.dim(`(${r2.hint})`) : ""}` : i2 === "selected" ? `${import_picocolors4.default.green(T)} ${import_picocolors4.default.dim(s)} ${r2.hint ? import_picocolors4.default.dim(`(${r2.hint})`) : ""}` : i2 === "cancelled" ? `${import_picocolors4.default.strikethrough(import_picocolors4.default.dim(s))}` : i2 === "active-selected" ? `${import_picocolors4.default.green(T)} ${s} ${r2.hint ? import_picocolors4.default.dim(`(${r2.hint})`) : ""}` : i2 === "submitted" ? `${import_picocolors4.default.dim(s)}` : `${import_picocolors4.default.dim(F)} ${import_picocolors4.default.dim(s)}`;
|
|
9894
|
+
};
|
|
9895
|
+
return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(r2) {
|
|
9896
|
+
if (this.required && r2.length === 0)
|
|
9897
|
+
return `Please select at least one option.
|
|
9898
|
+
${import_picocolors4.default.reset(import_picocolors4.default.dim(`Press ${import_picocolors4.default.gray(import_picocolors4.default.bgWhite(import_picocolors4.default.inverse(" space ")))} to select, ${import_picocolors4.default.gray(import_picocolors4.default.bgWhite(import_picocolors4.default.inverse(" enter ")))} to submit`))}`;
|
|
9899
|
+
}, render() {
|
|
9900
|
+
const r2 = `${import_picocolors4.default.gray(o)}
|
|
9901
|
+
${b2(this.state)} ${t.message}
|
|
9902
|
+
`, i2 = (s, c) => {
|
|
9903
|
+
const a = this.value.includes(s.value);
|
|
9904
|
+
return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
|
|
9905
|
+
};
|
|
9906
|
+
switch (this.state) {
|
|
9907
|
+
case "submit":
|
|
9908
|
+
return `${r2}${import_picocolors4.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors4.default.dim(", ")) || import_picocolors4.default.dim("none")}`;
|
|
9909
|
+
case "cancel": {
|
|
9910
|
+
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors4.default.dim(", "));
|
|
9911
|
+
return `${r2}${import_picocolors4.default.gray(o)} ${s.trim() ? `${s}
|
|
9912
|
+
${import_picocolors4.default.gray(o)}` : ""}`;
|
|
9913
|
+
}
|
|
9914
|
+
case "error": {
|
|
9915
|
+
const s = this.error.split(`
|
|
9916
|
+
`).map((c, a) => a === 0 ? `${import_picocolors4.default.yellow(d2)} ${import_picocolors4.default.yellow(c)}` : ` ${c}`).join(`
|
|
9917
|
+
`);
|
|
9918
|
+
return `${r2 + import_picocolors4.default.yellow(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i2 }).join(`
|
|
9919
|
+
${import_picocolors4.default.yellow(o)} `)}
|
|
9920
|
+
${s}
|
|
9921
|
+
`;
|
|
9922
|
+
}
|
|
9923
|
+
default:
|
|
9924
|
+
return `${r2}${import_picocolors4.default.cyan(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i2 }).join(`
|
|
9925
|
+
${import_picocolors4.default.cyan(o)} `)}
|
|
9926
|
+
${import_picocolors4.default.cyan(d2)}
|
|
9927
|
+
`;
|
|
9928
|
+
}
|
|
9929
|
+
} }).prompt();
|
|
9930
|
+
};
|
|
9878
9931
|
var Me = (t = "", n = "") => {
|
|
9879
9932
|
const r2 = `
|
|
9880
9933
|
${t}
|
|
@@ -9950,7 +10003,7 @@ var Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
|
9950
10003
|
}, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
|
|
9951
10004
|
const h2 = (performance.now() - m2) / 1000, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
|
|
9952
10005
|
return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
|
|
9953
|
-
},
|
|
10006
|
+
}, H2 = (m2 = "") => {
|
|
9954
10007
|
a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors4.default.gray(o)}
|
|
9955
10008
|
`);
|
|
9956
10009
|
let h2 = 0, w2 = 0;
|
|
@@ -9976,7 +10029,7 @@ var Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
|
9976
10029
|
`) : process.stdout.write(`${w2} ${l2}
|
|
9977
10030
|
`), E(), s();
|
|
9978
10031
|
};
|
|
9979
|
-
return { start:
|
|
10032
|
+
return { start: H2, stop: N2, message: (m2 = "") => {
|
|
9980
10033
|
l2 = R2(m2 ?? l2);
|
|
9981
10034
|
} };
|
|
9982
10035
|
};
|
|
@@ -31094,11 +31147,175 @@ async function copilotXCli() {
|
|
|
31094
31147
|
}
|
|
31095
31148
|
}
|
|
31096
31149
|
|
|
31150
|
+
// src/cli/minimax/tui.ts
|
|
31151
|
+
init_config_context();
|
|
31152
|
+
init_ensure_config_directory_exists();
|
|
31153
|
+
init_shared();
|
|
31154
|
+
var import_picocolors24 = __toESM(require_picocolors(), 1);
|
|
31155
|
+
import { existsSync as existsSync33, readFileSync as readFileSync28, statSync as statSync4, writeFileSync as writeFileSync11 } from "fs";
|
|
31156
|
+
var MINIMAX_PROVIDER = "minimax-cn-coding-plan";
|
|
31157
|
+
var MINIMAX_MODELS = ["MiniMax-M2.7", "MiniMax-M2.7-highspeed"];
|
|
31158
|
+
function buildAssignments(config2) {
|
|
31159
|
+
const map3 = new Map;
|
|
31160
|
+
for (const [agent, cfg] of Object.entries(config2.agents ?? {})) {
|
|
31161
|
+
const model = cfg.model;
|
|
31162
|
+
if (!model)
|
|
31163
|
+
continue;
|
|
31164
|
+
const entry = map3.get(model) ?? { agents: [], categories: [] };
|
|
31165
|
+
entry.agents.push(agent);
|
|
31166
|
+
map3.set(model, entry);
|
|
31167
|
+
}
|
|
31168
|
+
for (const [cat, cfg] of Object.entries(config2.categories ?? {})) {
|
|
31169
|
+
const model = cfg.model;
|
|
31170
|
+
if (!model)
|
|
31171
|
+
continue;
|
|
31172
|
+
const entry = map3.get(model) ?? { agents: [], categories: [] };
|
|
31173
|
+
entry.categories.push(cat);
|
|
31174
|
+
map3.set(model, entry);
|
|
31175
|
+
}
|
|
31176
|
+
return map3;
|
|
31177
|
+
}
|
|
31178
|
+
function isEmptyOrWhitespace3(content) {
|
|
31179
|
+
return content.trim().length === 0;
|
|
31180
|
+
}
|
|
31181
|
+
function hintForModel(_model, assignments) {
|
|
31182
|
+
const parts = [];
|
|
31183
|
+
if (assignments.agents.length)
|
|
31184
|
+
parts.push(`agents: ${assignments.agents.join(", ")}`);
|
|
31185
|
+
if (assignments.categories.length)
|
|
31186
|
+
parts.push(`categories: ${assignments.categories.join(", ")}`);
|
|
31187
|
+
return parts.join(" ");
|
|
31188
|
+
}
|
|
31189
|
+
async function runMinimaxTui() {
|
|
31190
|
+
Ie(import_picocolors24.default.bgMagenta(import_picocolors24.default.black(" Minimax Model Replacement ")));
|
|
31191
|
+
const minimaxModel = await ve({
|
|
31192
|
+
message: "Select Minimax model to replace with:",
|
|
31193
|
+
options: MINIMAX_MODELS.map((m2) => ({
|
|
31194
|
+
value: m2,
|
|
31195
|
+
label: m2,
|
|
31196
|
+
hint: m2 === "MiniMax-M2.7-highspeed" ? "Premium plan required" : "Basic plan"
|
|
31197
|
+
})),
|
|
31198
|
+
initialValue: "MiniMax-M2.7"
|
|
31199
|
+
});
|
|
31200
|
+
if (pD(minimaxModel)) {
|
|
31201
|
+
Se(import_picocolors24.default.dim("Aborted."));
|
|
31202
|
+
return 0;
|
|
31203
|
+
}
|
|
31204
|
+
const qualifiedModel = `${MINIMAX_PROVIDER}/${minimaxModel}`;
|
|
31205
|
+
const configPath = getOmoConfigPath();
|
|
31206
|
+
let config2 = {};
|
|
31207
|
+
if (existsSync33(configPath)) {
|
|
31208
|
+
try {
|
|
31209
|
+
const stat = statSync4(configPath);
|
|
31210
|
+
if (stat.size > 0) {
|
|
31211
|
+
const content = readFileSync28(configPath, "utf-8");
|
|
31212
|
+
if (!isEmptyOrWhitespace3(content)) {
|
|
31213
|
+
const parsed = parseJsonc(content);
|
|
31214
|
+
if (parsed && typeof parsed === "object")
|
|
31215
|
+
config2 = parsed;
|
|
31216
|
+
}
|
|
31217
|
+
}
|
|
31218
|
+
} catch {}
|
|
31219
|
+
}
|
|
31220
|
+
const assignments = buildAssignments(config2);
|
|
31221
|
+
const models = Array.from(assignments.keys()).sort();
|
|
31222
|
+
if (models.length === 0) {
|
|
31223
|
+
M2.warn("No models found in config \u2014 nothing to replace.");
|
|
31224
|
+
Se(import_picocolors24.default.dim("Done."));
|
|
31225
|
+
return 0;
|
|
31226
|
+
}
|
|
31227
|
+
const selected = await fe({
|
|
31228
|
+
message: `Replace with ${import_picocolors24.default.cyan(qualifiedModel)} (select models to swap):`,
|
|
31229
|
+
options: models.map((m2) => ({
|
|
31230
|
+
value: m2,
|
|
31231
|
+
label: m2,
|
|
31232
|
+
hint: hintForModel(m2, assignments.get(m2))
|
|
31233
|
+
})),
|
|
31234
|
+
required: false
|
|
31235
|
+
});
|
|
31236
|
+
if (pD(selected)) {
|
|
31237
|
+
Se(import_picocolors24.default.dim("Aborted."));
|
|
31238
|
+
return 0;
|
|
31239
|
+
}
|
|
31240
|
+
if (!selected || Array.isArray(selected) && selected.length === 0) {
|
|
31241
|
+
Se(import_picocolors24.default.dim("No models selected \u2014 nothing changed."));
|
|
31242
|
+
return 0;
|
|
31243
|
+
}
|
|
31244
|
+
const patch = {};
|
|
31245
|
+
for (const model of selected) {
|
|
31246
|
+
const assign = assignments.get(model);
|
|
31247
|
+
if (!assign)
|
|
31248
|
+
continue;
|
|
31249
|
+
for (const agent of assign.agents) {
|
|
31250
|
+
if (!patch.agents)
|
|
31251
|
+
patch.agents = {};
|
|
31252
|
+
patch.agents[agent] = { model: qualifiedModel };
|
|
31253
|
+
}
|
|
31254
|
+
for (const cat of assign.categories) {
|
|
31255
|
+
if (!patch.categories)
|
|
31256
|
+
patch.categories = {};
|
|
31257
|
+
patch.categories[cat] = { model: qualifiedModel };
|
|
31258
|
+
}
|
|
31259
|
+
}
|
|
31260
|
+
try {
|
|
31261
|
+
ensureConfigDirectoryExists();
|
|
31262
|
+
} catch (err) {
|
|
31263
|
+
console.error(formatErrorWithSuggestion(err, "create config directory"));
|
|
31264
|
+
return 1;
|
|
31265
|
+
}
|
|
31266
|
+
try {
|
|
31267
|
+
if (existsSync33(configPath)) {
|
|
31268
|
+
const stat = statSync4(configPath);
|
|
31269
|
+
const content = readFileSync28(configPath, "utf-8");
|
|
31270
|
+
if (stat.size > 0 && !isEmptyOrWhitespace3(content)) {
|
|
31271
|
+
try {
|
|
31272
|
+
const existing = parseJsonc(content);
|
|
31273
|
+
if (existing && typeof existing === "object" && !Array.isArray(existing)) {
|
|
31274
|
+
const merged = deepMergeRecord(existing, patch);
|
|
31275
|
+
writeFileSync11(configPath, JSON.stringify(merged, null, 2) + `
|
|
31276
|
+
`);
|
|
31277
|
+
} else {
|
|
31278
|
+
writeFileSync11(configPath, JSON.stringify(patch, null, 2) + `
|
|
31279
|
+
`);
|
|
31280
|
+
}
|
|
31281
|
+
} catch {
|
|
31282
|
+
writeFileSync11(configPath, JSON.stringify(patch, null, 2) + `
|
|
31283
|
+
`);
|
|
31284
|
+
}
|
|
31285
|
+
} else {
|
|
31286
|
+
writeFileSync11(configPath, JSON.stringify(patch, null, 2) + `
|
|
31287
|
+
`);
|
|
31288
|
+
}
|
|
31289
|
+
} else {
|
|
31290
|
+
writeFileSync11(configPath, JSON.stringify(patch, null, 2) + `
|
|
31291
|
+
`);
|
|
31292
|
+
}
|
|
31293
|
+
} catch (err) {
|
|
31294
|
+
console.error(formatErrorWithSuggestion(err, "write oh-my-magento config"));
|
|
31295
|
+
return 1;
|
|
31296
|
+
}
|
|
31297
|
+
M2.success(`Replaced ${import_picocolors24.default.yellow(String(selected.length))} model(s) \u2192 ${import_picocolors24.default.cyan(qualifiedModel)} in ${import_picocolors24.default.dim(configPath)}`);
|
|
31298
|
+
Se(import_picocolors24.default.dim("Done."));
|
|
31299
|
+
return 0;
|
|
31300
|
+
}
|
|
31301
|
+
|
|
31302
|
+
// src/cli/minimax/index.ts
|
|
31303
|
+
function createMinimaxCommand() {
|
|
31304
|
+
const minimax = new Command("minimax").description("Replace configured models with Minimax").addHelpText("after", `
|
|
31305
|
+
Examples:
|
|
31306
|
+
$ bunx oh-my-magento minimax
|
|
31307
|
+
`).action(async () => {
|
|
31308
|
+
const exitCode = await runMinimaxTui();
|
|
31309
|
+
process.exit(exitCode);
|
|
31310
|
+
});
|
|
31311
|
+
return minimax;
|
|
31312
|
+
}
|
|
31313
|
+
|
|
31097
31314
|
// src/cli/usage/opencode-db-connection.ts
|
|
31098
31315
|
init_data_path();
|
|
31099
31316
|
import { Database } from "bun:sqlite";
|
|
31100
31317
|
import { join as join32 } from "path";
|
|
31101
|
-
import { existsSync as
|
|
31318
|
+
import { existsSync as existsSync34 } from "fs";
|
|
31102
31319
|
function getDbPath() {
|
|
31103
31320
|
const envPath = process.env.OPENCODE_DB;
|
|
31104
31321
|
if (envPath)
|
|
@@ -31106,7 +31323,7 @@ function getDbPath() {
|
|
|
31106
31323
|
return join32(getDataDir(), "opencode", "opencode.db");
|
|
31107
31324
|
}
|
|
31108
31325
|
function createConnection(dbPath) {
|
|
31109
|
-
if (!
|
|
31326
|
+
if (!existsSync34(dbPath)) {
|
|
31110
31327
|
throw new Error(`OpenCode database not found at ${dbPath}
|
|
31111
31328
|
Set OPENCODE_DB env var to override.`);
|
|
31112
31329
|
}
|
|
@@ -31421,7 +31638,7 @@ class OpenCodeDB {
|
|
|
31421
31638
|
}
|
|
31422
31639
|
|
|
31423
31640
|
// src/cli/usage/render-format.ts
|
|
31424
|
-
var
|
|
31641
|
+
var import_picocolors25 = __toESM(require_picocolors(), 1);
|
|
31425
31642
|
function formatTokens(n) {
|
|
31426
31643
|
if (n >= 1e9)
|
|
31427
31644
|
return `${(n / 1e9).toFixed(1)}B`;
|
|
@@ -31440,10 +31657,10 @@ function formatCost(c) {
|
|
|
31440
31657
|
}
|
|
31441
31658
|
function formatDelta(pct) {
|
|
31442
31659
|
if (pct > 0)
|
|
31443
|
-
return
|
|
31660
|
+
return import_picocolors25.default.red(`+${pct.toFixed(0)}%`);
|
|
31444
31661
|
if (pct < 0)
|
|
31445
|
-
return
|
|
31446
|
-
return
|
|
31662
|
+
return import_picocolors25.default.green(`${pct.toFixed(0)}%`);
|
|
31663
|
+
return import_picocolors25.default.dim("0%");
|
|
31447
31664
|
}
|
|
31448
31665
|
// src/cli/usage/render-helpers.ts
|
|
31449
31666
|
function stripAnsi2(str3) {
|
|
@@ -31497,20 +31714,20 @@ function bottomBorder(widths) {
|
|
|
31497
31714
|
return "\u2514" + widths.map((w2) => "\u2500".repeat(w2 + 2)).join("\u2534") + "\u2518";
|
|
31498
31715
|
}
|
|
31499
31716
|
// src/cli/usage/render-summary.ts
|
|
31500
|
-
var
|
|
31717
|
+
var import_picocolors26 = __toESM(require_picocolors(), 1);
|
|
31501
31718
|
function renderSummary(total, period, prevTotal) {
|
|
31502
31719
|
const parts = [];
|
|
31503
|
-
parts.push(`Calls: ${
|
|
31720
|
+
parts.push(`Calls: ${import_picocolors26.default.bold(import_picocolors26.default.magenta(total.calls.toLocaleString()))}`);
|
|
31504
31721
|
if (prevTotal && prevTotal.calls > 0) {
|
|
31505
31722
|
const pct = (total.calls - prevTotal.calls) / prevTotal.calls * 100;
|
|
31506
31723
|
parts.push(` ${formatDelta(pct)}`);
|
|
31507
31724
|
}
|
|
31508
|
-
parts.push(` \u2502 Tokens: ${
|
|
31725
|
+
parts.push(` \u2502 Tokens: ${import_picocolors26.default.bold(formatTokens(total.tokens.total))}`);
|
|
31509
31726
|
if (prevTotal && prevTotal.tokens.total > 0) {
|
|
31510
31727
|
const pct = (total.tokens.total - prevTotal.tokens.total) / prevTotal.tokens.total * 100;
|
|
31511
31728
|
parts.push(` ${formatDelta(pct)}`);
|
|
31512
31729
|
}
|
|
31513
|
-
parts.push(` \u2502 Cost: ${
|
|
31730
|
+
parts.push(` \u2502 Cost: ${import_picocolors26.default.bold(import_picocolors26.default.red(formatCost(total.cost)))}`);
|
|
31514
31731
|
if (prevTotal && prevTotal.cost > 0) {
|
|
31515
31732
|
const pct = (total.cost - prevTotal.cost) / prevTotal.cost * 100;
|
|
31516
31733
|
parts.push(` ${formatDelta(pct)}`);
|
|
@@ -31520,7 +31737,7 @@ function renderSummary(total, period, prevTotal) {
|
|
|
31520
31737
|
const title = `OpenCode Usage \u2014 ${period}`;
|
|
31521
31738
|
const innerWidth = Math.max(title.length + 6, rawContentLen + 2);
|
|
31522
31739
|
const titlePad = innerWidth - title.length - 5;
|
|
31523
|
-
const titleLine = `\u256D\u2500\u2500\u2500 ${
|
|
31740
|
+
const titleLine = `\u256D\u2500\u2500\u2500 ${import_picocolors26.default.bold(title)} ${"\u2500".repeat(Math.max(1, titlePad))}\u256E`;
|
|
31524
31741
|
const contentLine = `\u2502 ${content}${" ".repeat(Math.max(0, innerWidth - rawContentLen - 2))} \u2502`;
|
|
31525
31742
|
const bottomLine = `\u2570${"\u2500".repeat(innerWidth)}\u256F`;
|
|
31526
31743
|
console.log();
|
|
@@ -31529,16 +31746,16 @@ function renderSummary(total, period, prevTotal) {
|
|
|
31529
31746
|
console.log(bottomLine);
|
|
31530
31747
|
}
|
|
31531
31748
|
// src/cli/usage/render-tables.ts
|
|
31532
|
-
var
|
|
31749
|
+
var import_picocolors27 = __toESM(require_picocolors(), 1);
|
|
31533
31750
|
function renderDaily(rows, period) {
|
|
31534
|
-
const title =
|
|
31751
|
+
const title = import_picocolors27.default.bold(`Daily Usage (${period})`);
|
|
31535
31752
|
console.log();
|
|
31536
31753
|
console.log(` ${title}`);
|
|
31537
31754
|
const widths = [12, 7, 7, 7, 7, 7, 8, 8, 10];
|
|
31538
31755
|
const headers = ["Date", "Calls", "Input", "Output", "Cache R", "Cache W", "Total", "Cost", "Trend"];
|
|
31539
|
-
console.log(
|
|
31540
|
-
console.log(
|
|
31541
|
-
console.log(
|
|
31756
|
+
console.log(import_picocolors27.default.dim(topBorder(widths)));
|
|
31757
|
+
console.log(import_picocolors27.default.cyan(import_picocolors27.default.bold(headerRow(headers, widths))));
|
|
31758
|
+
console.log(import_picocolors27.default.dim(separator(widths)));
|
|
31542
31759
|
const maxTokens = Math.max(...rows.map((r2) => r2.tokens.total), 1);
|
|
31543
31760
|
for (const r2 of rows) {
|
|
31544
31761
|
const cells = [
|
|
@@ -31550,11 +31767,11 @@ function renderDaily(rows, period) {
|
|
|
31550
31767
|
` ${padLeft(formatTokens(r2.tokens.cacheWrite), widths[5])} `,
|
|
31551
31768
|
` ${padLeft(formatTokens(r2.tokens.total), widths[6])} `,
|
|
31552
31769
|
` ${padLeft(formatCost(r2.cost), widths[7])} `,
|
|
31553
|
-
` ${padRight(
|
|
31770
|
+
` ${padRight(import_picocolors27.default.cyan(sparkBar(r2.tokens.total, maxTokens, widths[8])), widths[8])} `
|
|
31554
31771
|
];
|
|
31555
31772
|
console.log("\u2502" + cells.join("\u2502") + "\u2502");
|
|
31556
31773
|
}
|
|
31557
|
-
console.log(
|
|
31774
|
+
console.log(import_picocolors27.default.dim(bottomBorder(widths)));
|
|
31558
31775
|
}
|
|
31559
31776
|
function renderGrouped(rows, groupBy, period, deltas) {
|
|
31560
31777
|
const labelMap = {
|
|
@@ -31566,7 +31783,7 @@ function renderGrouped(rows, groupBy, period, deltas) {
|
|
|
31566
31783
|
const labelHeader = labelMap[groupBy] ?? groupBy;
|
|
31567
31784
|
const showDetail = groupBy === "agent";
|
|
31568
31785
|
const showBreakdown = groupBy !== "session" && groupBy !== "agent";
|
|
31569
|
-
const title =
|
|
31786
|
+
const title = import_picocolors27.default.bold(`Usage by ${labelHeader} (${period})`);
|
|
31570
31787
|
console.log();
|
|
31571
31788
|
console.log(` ${title}`);
|
|
31572
31789
|
const widths = [24];
|
|
@@ -31587,14 +31804,14 @@ function renderGrouped(rows, groupBy, period, deltas) {
|
|
|
31587
31804
|
widths.push(7);
|
|
31588
31805
|
headers.push("Delta");
|
|
31589
31806
|
}
|
|
31590
|
-
console.log(
|
|
31591
|
-
console.log(
|
|
31592
|
-
console.log(
|
|
31807
|
+
console.log(import_picocolors27.default.dim(topBorder(widths)));
|
|
31808
|
+
console.log(import_picocolors27.default.cyan(import_picocolors27.default.bold(headerRow(headers, widths))));
|
|
31809
|
+
console.log(import_picocolors27.default.dim(separator(widths)));
|
|
31593
31810
|
let prevLabel = "";
|
|
31594
31811
|
for (let i2 = 0;i2 < rows.length; i2++) {
|
|
31595
31812
|
const r2 = rows[i2];
|
|
31596
31813
|
if (showDetail && prevLabel && r2.label !== prevLabel) {
|
|
31597
|
-
console.log(
|
|
31814
|
+
console.log(import_picocolors27.default.dim(separator(widths)));
|
|
31598
31815
|
}
|
|
31599
31816
|
const displayLabel = r2.label !== prevLabel ? r2.label : "";
|
|
31600
31817
|
prevLabel = r2.label;
|
|
@@ -31603,89 +31820,89 @@ function renderGrouped(rows, groupBy, period, deltas) {
|
|
|
31603
31820
|
];
|
|
31604
31821
|
let colIdx = 1;
|
|
31605
31822
|
if (showDetail) {
|
|
31606
|
-
cells.push(` ${padRight(
|
|
31823
|
+
cells.push(` ${padRight(import_picocolors27.default.dim(r2.detail ?? ""), widths[colIdx])} `);
|
|
31607
31824
|
colIdx++;
|
|
31608
31825
|
}
|
|
31609
|
-
cells.push(` ${padLeft(
|
|
31826
|
+
cells.push(` ${padLeft(import_picocolors27.default.magenta(String(r2.calls)), widths[colIdx])} `);
|
|
31610
31827
|
colIdx++;
|
|
31611
31828
|
if (showBreakdown) {
|
|
31612
|
-
cells.push(` ${padLeft(
|
|
31829
|
+
cells.push(` ${padLeft(import_picocolors27.default.green(formatTokens(r2.tokens.input)), widths[colIdx])} `);
|
|
31613
31830
|
colIdx++;
|
|
31614
|
-
cells.push(` ${padLeft(
|
|
31831
|
+
cells.push(` ${padLeft(import_picocolors27.default.yellow(formatTokens(r2.tokens.output)), widths[colIdx])} `);
|
|
31615
31832
|
colIdx++;
|
|
31616
|
-
cells.push(` ${padLeft(
|
|
31833
|
+
cells.push(` ${padLeft(import_picocolors27.default.dim(formatTokens(r2.tokens.cacheRead)), widths[colIdx])} `);
|
|
31617
31834
|
colIdx++;
|
|
31618
|
-
cells.push(` ${padLeft(
|
|
31835
|
+
cells.push(` ${padLeft(import_picocolors27.default.dim(formatTokens(r2.tokens.cacheWrite)), widths[colIdx])} `);
|
|
31619
31836
|
colIdx++;
|
|
31620
31837
|
}
|
|
31621
|
-
cells.push(` ${padLeft(
|
|
31838
|
+
cells.push(` ${padLeft(import_picocolors27.default.bold(formatTokens(r2.tokens.total)), widths[colIdx])} `);
|
|
31622
31839
|
colIdx++;
|
|
31623
|
-
cells.push(` ${padLeft(
|
|
31840
|
+
cells.push(` ${padLeft(import_picocolors27.default.red(formatCost(r2.cost)), widths[colIdx])} `);
|
|
31624
31841
|
colIdx++;
|
|
31625
31842
|
if (deltas) {
|
|
31626
31843
|
const d3 = deltas[i2];
|
|
31627
|
-
const deltaStr = d3 !== undefined ? formatDelta(d3) :
|
|
31844
|
+
const deltaStr = d3 !== undefined ? formatDelta(d3) : import_picocolors27.default.dim("-");
|
|
31628
31845
|
cells.push(` ${padLeft(deltaStr, widths[colIdx])} `);
|
|
31629
31846
|
}
|
|
31630
31847
|
console.log("\u2502" + cells.join("\u2502") + "\u2502");
|
|
31631
31848
|
}
|
|
31632
|
-
console.log(
|
|
31849
|
+
console.log(import_picocolors27.default.dim(bottomBorder(widths)));
|
|
31633
31850
|
}
|
|
31634
31851
|
function renderNoData() {
|
|
31635
31852
|
console.log();
|
|
31636
|
-
console.log(
|
|
31637
|
-
console.log(
|
|
31853
|
+
console.log(import_picocolors27.default.yellow("No usage data found for the specified period."));
|
|
31854
|
+
console.log(import_picocolors27.default.dim("Make sure OpenCode has been used and the database exists."));
|
|
31638
31855
|
}
|
|
31639
31856
|
// src/cli/usage/render-report.ts
|
|
31640
|
-
var
|
|
31857
|
+
var import_picocolors28 = __toESM(require_picocolors(), 1);
|
|
31641
31858
|
function renderReportAsTerminal(report, options) {
|
|
31642
|
-
const content = `User: ${
|
|
31859
|
+
const content = `User: ${import_picocolors28.default.cyan(options.user)} \u2502 Period: ${options.date} full day`;
|
|
31643
31860
|
const rawContentLen = stripAnsi2(content).length;
|
|
31644
31861
|
const title = `AI Usage Report \u2014 ${options.date}`;
|
|
31645
31862
|
const innerWidth = Math.max(title.length + 6, rawContentLen + 2);
|
|
31646
31863
|
const titlePad = innerWidth - title.length - 5;
|
|
31647
|
-
const titleLine = `\u256D\u2500\u2500\u2500 ${
|
|
31864
|
+
const titleLine = `\u256D\u2500\u2500\u2500 ${import_picocolors28.default.bold(title)} ${"\u2500".repeat(Math.max(1, titlePad))}\u256E`;
|
|
31648
31865
|
const contentLine = `\u2502 ${content}${" ".repeat(Math.max(0, innerWidth - rawContentLen - 2))} \u2502`;
|
|
31649
31866
|
const bottomLine = `\u2570${"\u2500".repeat(innerWidth)}\u256F`;
|
|
31650
31867
|
console.log();
|
|
31651
31868
|
console.log(titleLine);
|
|
31652
31869
|
console.log(contentLine);
|
|
31653
31870
|
console.log(bottomLine);
|
|
31654
|
-
const investmentTitle =
|
|
31871
|
+
const investmentTitle = import_picocolors28.default.bold("Investment");
|
|
31655
31872
|
console.log();
|
|
31656
31873
|
console.log(` ${investmentTitle}`);
|
|
31657
31874
|
const invW = [16, 12];
|
|
31658
|
-
console.log(
|
|
31875
|
+
console.log(import_picocolors28.default.dim(topBorder(invW)));
|
|
31659
31876
|
console.log("\u2502" + ` ${padRight("Metric", invW[0])} ` + "\u2502" + ` ${padRight("Value", invW[1])} ` + "\u2502");
|
|
31660
|
-
console.log(
|
|
31877
|
+
console.log(import_picocolors28.default.dim(separator(invW)));
|
|
31661
31878
|
console.log("\u2502" + ` ${padRight("Sessions", invW[0])} ` + "\u2502" + ` ${padLeft(String(report.investment.sessions), invW[1])} ` + "\u2502");
|
|
31662
31879
|
console.log("\u2502" + ` ${padRight("Total Tokens", invW[0])} ` + "\u2502" + ` ${padLeft(formatTokens(report.investment.tokens), invW[1])} ` + "\u2502");
|
|
31663
31880
|
console.log("\u2502" + ` ${padRight("Estimated Cost", invW[0])} ` + "\u2502" + ` ${padLeft(formatCost(report.investment.cost), invW[1])} ` + "\u2502");
|
|
31664
31881
|
console.log("\u2502" + ` ${padRight("Models Used", invW[0])} ` + "\u2502" + ` ${padLeft(String(report.investment.models_used.length), invW[1])} ` + "\u2502");
|
|
31665
|
-
console.log(
|
|
31882
|
+
console.log(import_picocolors28.default.dim(bottomBorder(invW)));
|
|
31666
31883
|
if (report.output) {
|
|
31667
|
-
const outputTitle =
|
|
31884
|
+
const outputTitle = import_picocolors28.default.bold("Output");
|
|
31668
31885
|
console.log();
|
|
31669
31886
|
console.log(` ${outputTitle}`);
|
|
31670
31887
|
const outW = [16, 12];
|
|
31671
|
-
console.log(
|
|
31888
|
+
console.log(import_picocolors28.default.dim(topBorder(outW)));
|
|
31672
31889
|
console.log("\u2502" + ` ${padRight("Metric", outW[0])} ` + "\u2502" + ` ${padRight("Value", outW[1])} ` + "\u2502");
|
|
31673
|
-
console.log(
|
|
31890
|
+
console.log(import_picocolors28.default.dim(separator(outW)));
|
|
31674
31891
|
console.log("\u2502" + ` ${padRight("Commits", outW[0])} ` + "\u2502" + ` ${padLeft(String(report.output.commits), outW[1])} ` + "\u2502");
|
|
31675
31892
|
console.log("\u2502" + ` ${padRight("Files Changed", outW[0])} ` + "\u2502" + ` ${padLeft(String(report.output.files_changed), outW[1])} ` + "\u2502");
|
|
31676
31893
|
console.log("\u2502" + ` ${padRight("Lines Added", outW[0])} ` + "\u2502" + ` ${padLeft(report.output.lines_added.toLocaleString(), outW[1])} ` + "\u2502");
|
|
31677
31894
|
console.log("\u2502" + ` ${padRight("Lines Removed", outW[0])} ` + "\u2502" + ` ${padLeft(report.output.lines_removed.toLocaleString(), outW[1])} ` + "\u2502");
|
|
31678
31895
|
console.log("\u2502" + ` ${padRight("Branches", outW[0])} ` + "\u2502" + ` ${padLeft(String(report.output.branches.length), outW[1])} ` + "\u2502");
|
|
31679
|
-
console.log(
|
|
31896
|
+
console.log(import_picocolors28.default.dim(bottomBorder(outW)));
|
|
31680
31897
|
}
|
|
31681
31898
|
if (report.efficiency) {
|
|
31682
|
-
const efficiencyTitle =
|
|
31899
|
+
const efficiencyTitle = import_picocolors28.default.bold("Efficiency");
|
|
31683
31900
|
console.log();
|
|
31684
31901
|
console.log(` ${efficiencyTitle}`);
|
|
31685
31902
|
const effW = [24, 16];
|
|
31686
|
-
console.log(
|
|
31903
|
+
console.log(import_picocolors28.default.dim(topBorder(effW)));
|
|
31687
31904
|
console.log("\u2502" + ` ${padRight("Metric", effW[0])} ` + "\u2502" + ` ${padRight("Value", effW[1])} ` + "\u2502");
|
|
31688
|
-
console.log(
|
|
31905
|
+
console.log(import_picocolors28.default.dim(separator(effW)));
|
|
31689
31906
|
if (report.efficiency.cost_per_commit !== null) {
|
|
31690
31907
|
console.log("\u2502" + ` ${padRight("Cost per Commit", effW[0])} ` + "\u2502" + ` ${padLeft(formatCost(report.efficiency.cost_per_commit), effW[1])} ` + "\u2502");
|
|
31691
31908
|
}
|
|
@@ -31698,7 +31915,7 @@ function renderReportAsTerminal(report, options) {
|
|
|
31698
31915
|
if (report.efficiency.session_productivity_score !== null) {
|
|
31699
31916
|
console.log("\u2502" + ` ${padRight("Session Productivity", effW[0])} ` + "\u2502" + ` ${padLeft(report.efficiency.session_productivity_score.toFixed(2), effW[1])} ` + "\u2502");
|
|
31700
31917
|
}
|
|
31701
|
-
console.log(
|
|
31918
|
+
console.log(import_picocolors28.default.dim(bottomBorder(effW)));
|
|
31702
31919
|
}
|
|
31703
31920
|
if (report.project_breakdown && report.project_breakdown.length > 1) {
|
|
31704
31921
|
renderBreakdownTable("Project Breakdown", report.project_breakdown);
|
|
@@ -31709,26 +31926,26 @@ function renderReportAsTerminal(report, options) {
|
|
|
31709
31926
|
}
|
|
31710
31927
|
function renderBreakdownTable(title, entries) {
|
|
31711
31928
|
console.log();
|
|
31712
|
-
console.log(` ${
|
|
31929
|
+
console.log(` ${import_picocolors28.default.bold(title)}`);
|
|
31713
31930
|
const labelWidth = Math.max(16, ...entries.map((e2) => e2.label.length + 2));
|
|
31714
31931
|
const colWidths = [labelWidth, 8, 10, 7, 8];
|
|
31715
31932
|
const headers = ["Name", "Sessions", "Tokens", "Commits", "+Lines"];
|
|
31716
|
-
console.log(
|
|
31933
|
+
console.log(import_picocolors28.default.dim(topBorder(colWidths)));
|
|
31717
31934
|
console.log(headerRow(headers, colWidths));
|
|
31718
|
-
console.log(
|
|
31935
|
+
console.log(import_picocolors28.default.dim(separator(colWidths)));
|
|
31719
31936
|
for (const entry of entries) {
|
|
31720
31937
|
console.log("\u2502" + ` ${padRight(entry.label, colWidths[0])} ` + "\u2502" + ` ${padLeft(String(entry.sessions), colWidths[1])} ` + "\u2502" + ` ${padLeft(formatTokens(entry.tokens), colWidths[2])} ` + "\u2502" + ` ${padLeft(String(entry.commits), colWidths[3])} ` + "\u2502" + ` ${padLeft(`+${entry.lines_added.toLocaleString()}`, colWidths[4])} ` + "\u2502");
|
|
31721
31938
|
}
|
|
31722
|
-
console.log(
|
|
31939
|
+
console.log(import_picocolors28.default.dim(bottomBorder(colWidths)));
|
|
31723
31940
|
}
|
|
31724
31941
|
// src/cli/usage/report-generator.ts
|
|
31725
31942
|
import { execSync } from "child_process";
|
|
31726
|
-
import { writeFileSync as
|
|
31943
|
+
import { writeFileSync as writeFileSync12 } from "fs";
|
|
31727
31944
|
|
|
31728
31945
|
// src/cli/usage/report-data-aggregator.ts
|
|
31729
31946
|
init_data_path();
|
|
31730
31947
|
import { Database as Database3 } from "bun:sqlite";
|
|
31731
|
-
import { existsSync as
|
|
31948
|
+
import { existsSync as existsSync36 } from "fs";
|
|
31732
31949
|
import { join as join34 } from "path";
|
|
31733
31950
|
|
|
31734
31951
|
// src/cli/usage/efficiency-calculator.ts
|
|
@@ -31767,7 +31984,7 @@ function calculateAllMetrics(params) {
|
|
|
31767
31984
|
init_data_path();
|
|
31768
31985
|
import { Database as Database2 } from "bun:sqlite";
|
|
31769
31986
|
import { join as join33 } from "path";
|
|
31770
|
-
import { existsSync as
|
|
31987
|
+
import { existsSync as existsSync35, mkdirSync as mkdirSync8 } from "fs";
|
|
31771
31988
|
|
|
31772
31989
|
// src/features/dev-metrics/schema.ts
|
|
31773
31990
|
var CREATE_SESSION_CONTEXT_TABLE = `
|
|
@@ -31822,7 +32039,7 @@ class DevMetricsDB {
|
|
|
31822
32039
|
constructor(dbPath) {
|
|
31823
32040
|
this.path = dbPath ?? join33(getDataDir(), "oh-my-opencode", "dev-metrics.db");
|
|
31824
32041
|
const dir = this.path.substring(0, this.path.lastIndexOf("/"));
|
|
31825
|
-
if (!
|
|
32042
|
+
if (!existsSync35(dir)) {
|
|
31826
32043
|
mkdirSync8(dir, { recursive: true });
|
|
31827
32044
|
}
|
|
31828
32045
|
this.db = new Database2(this.path);
|
|
@@ -32167,7 +32384,7 @@ function buildReportData(options) {
|
|
|
32167
32384
|
sessions: investmentSessions
|
|
32168
32385
|
};
|
|
32169
32386
|
const devMetricsPath = options.devMetricsDbPath ?? getDefaultDevMetricsDbPath();
|
|
32170
|
-
if (!
|
|
32387
|
+
if (!existsSync36(devMetricsPath)) {
|
|
32171
32388
|
return { investment, output: null, efficiency: null, project_breakdown: null, branch_breakdown: null };
|
|
32172
32389
|
}
|
|
32173
32390
|
const outputResult = readOutputData(devMetricsPath, dateRange);
|
|
@@ -32394,7 +32611,7 @@ function executeReport(options) {
|
|
|
32394
32611
|
}
|
|
32395
32612
|
if (options.output) {
|
|
32396
32613
|
const markdown = renderReportAsMarkdown(report, { user: userName, date: dateLabel });
|
|
32397
|
-
|
|
32614
|
+
writeFileSync12(options.output, markdown, "utf-8");
|
|
32398
32615
|
console.log(`Report saved to ${options.output}`);
|
|
32399
32616
|
} else {
|
|
32400
32617
|
renderReportAsTerminal(report, { user: userName, date: dateLabel });
|
|
@@ -32892,6 +33109,7 @@ program2.command("version").description("Show version information").action(() =>
|
|
|
32892
33109
|
});
|
|
32893
33110
|
program2.addCommand(createMcpOAuthCommand());
|
|
32894
33111
|
program2.addCommand(createUsageCommand());
|
|
33112
|
+
program2.addCommand(createMinimaxCommand());
|
|
32895
33113
|
program2.command("copilot-x").description("Manage GitHub Copilot accounts: add, switch, check quotas, toggle Loop Safety/Network Retry").addHelpText("after", `
|
|
32896
33114
|
Examples:
|
|
32897
33115
|
$ bunx oh-my-opencode copilot-x
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runMinimaxTui(): Promise<number>;
|
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ var package_default;
|
|
|
51
51
|
var init_package = __esm(() => {
|
|
52
52
|
package_default = {
|
|
53
53
|
name: "oh-my-magento",
|
|
54
|
-
version: "
|
|
54
|
+
version: "0.3.2",
|
|
55
55
|
description: "Magento 2 + Hyv\xE4 Enterprise E-Commerce Intelligent Agent Orchestration System - OpenCode Plugin",
|
|
56
56
|
main: "dist/index.js",
|
|
57
57
|
types: "dist/index.d.ts",
|
|
@@ -131,28 +131,17 @@ var init_package = __esm(() => {
|
|
|
131
131
|
typescript: "^5.7.3"
|
|
132
132
|
},
|
|
133
133
|
optionalDependencies: {
|
|
134
|
-
"oh-my-magento-darwin-arm64": "
|
|
135
|
-
"oh-my-magento-darwin-x64": "
|
|
136
|
-
"oh-my-magento-darwin-x64-baseline": "
|
|
137
|
-
"oh-my-magento-linux-arm64": "
|
|
138
|
-
"oh-my-magento-linux-arm64-musl": "
|
|
139
|
-
"oh-my-magento-linux-x64": "
|
|
140
|
-
"oh-my-magento-linux-x64-baseline": "
|
|
141
|
-
"oh-my-magento-linux-x64-musl": "
|
|
142
|
-
"oh-my-magento-linux-x64-musl-baseline": "
|
|
143
|
-
"oh-my-magento-windows-x64": "
|
|
144
|
-
"oh-my-magento-windows-x64-baseline": "
|
|
145
|
-
"oh-my-opencode-darwin-arm64": "v0.3.0",
|
|
146
|
-
"oh-my-opencode-darwin-x64": "v0.3.0",
|
|
147
|
-
"oh-my-opencode-darwin-x64-baseline": "v0.3.0",
|
|
148
|
-
"oh-my-opencode-linux-arm64": "v0.3.0",
|
|
149
|
-
"oh-my-opencode-linux-arm64-musl": "v0.3.0",
|
|
150
|
-
"oh-my-opencode-linux-x64": "v0.3.0",
|
|
151
|
-
"oh-my-opencode-linux-x64-baseline": "v0.3.0",
|
|
152
|
-
"oh-my-opencode-linux-x64-musl": "v0.3.0",
|
|
153
|
-
"oh-my-opencode-linux-x64-musl-baseline": "v0.3.0",
|
|
154
|
-
"oh-my-opencode-windows-x64": "v0.3.0",
|
|
155
|
-
"oh-my-opencode-windows-x64-baseline": "v0.3.0"
|
|
134
|
+
"oh-my-magento-darwin-arm64": "0.3.2",
|
|
135
|
+
"oh-my-magento-darwin-x64": "0.3.2",
|
|
136
|
+
"oh-my-magento-darwin-x64-baseline": "0.3.2",
|
|
137
|
+
"oh-my-magento-linux-arm64": "0.3.2",
|
|
138
|
+
"oh-my-magento-linux-arm64-musl": "0.3.2",
|
|
139
|
+
"oh-my-magento-linux-x64": "0.3.2",
|
|
140
|
+
"oh-my-magento-linux-x64-baseline": "0.3.2",
|
|
141
|
+
"oh-my-magento-linux-x64-musl": "0.3.2",
|
|
142
|
+
"oh-my-magento-linux-x64-musl-baseline": "0.3.2",
|
|
143
|
+
"oh-my-magento-windows-x64": "0.3.2",
|
|
144
|
+
"oh-my-magento-windows-x64-baseline": "0.3.2"
|
|
156
145
|
},
|
|
157
146
|
overrides: {
|
|
158
147
|
"@opencode-ai/sdk": "^1.2.24"
|
|
@@ -17334,7 +17323,6 @@ var AGENT_MODEL_REQUIREMENTS = {
|
|
|
17334
17323
|
variant: "max"
|
|
17335
17324
|
},
|
|
17336
17325
|
{ providers: ["opencode-go"], model: "kimi-k2.5" },
|
|
17337
|
-
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
17338
17326
|
{
|
|
17339
17327
|
providers: [
|
|
17340
17328
|
"opencode",
|
|
@@ -17346,6 +17334,7 @@ var AGENT_MODEL_REQUIREMENTS = {
|
|
|
17346
17334
|
],
|
|
17347
17335
|
model: "kimi-k2.5"
|
|
17348
17336
|
},
|
|
17337
|
+
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
17349
17338
|
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.4", variant: "medium" },
|
|
17350
17339
|
{ providers: ["zai-coding-plan", "opencode"], model: "glm-5" },
|
|
17351
17340
|
{ providers: ["opencode"], model: "big-pickle" }
|
|
@@ -17563,10 +17552,6 @@ var CATEGORY_MODEL_REQUIREMENTS = {
|
|
|
17563
17552
|
},
|
|
17564
17553
|
quick: {
|
|
17565
17554
|
fallbackChain: [
|
|
17566
|
-
{
|
|
17567
|
-
providers: ["openai", "github-copilot", "opencode"],
|
|
17568
|
-
model: "gpt-5.4-mini"
|
|
17569
|
-
},
|
|
17570
17555
|
{
|
|
17571
17556
|
providers: ["anthropic", "github-copilot", "opencode"],
|
|
17572
17557
|
model: "claude-haiku-4-5"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-magento",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Magento 2 + Hyvä Enterprise E-Commerce Intelligent Agent Orchestration System - OpenCode Plugin",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -80,28 +80,17 @@
|
|
|
80
80
|
"typescript": "^5.7.3"
|
|
81
81
|
},
|
|
82
82
|
"optionalDependencies": {
|
|
83
|
-
"oh-my-magento-darwin-arm64": "
|
|
84
|
-
"oh-my-magento-darwin-x64": "
|
|
85
|
-
"oh-my-magento-darwin-x64-baseline": "
|
|
86
|
-
"oh-my-magento-linux-arm64": "
|
|
87
|
-
"oh-my-magento-linux-arm64-musl": "
|
|
88
|
-
"oh-my-magento-linux-x64": "
|
|
89
|
-
"oh-my-magento-linux-x64-baseline": "
|
|
90
|
-
"oh-my-magento-linux-x64-musl": "
|
|
91
|
-
"oh-my-magento-linux-x64-musl-baseline": "
|
|
92
|
-
"oh-my-magento-windows-x64": "
|
|
93
|
-
"oh-my-magento-windows-x64-baseline": "
|
|
94
|
-
"oh-my-opencode-darwin-arm64": "v0.3.0",
|
|
95
|
-
"oh-my-opencode-darwin-x64": "v0.3.0",
|
|
96
|
-
"oh-my-opencode-darwin-x64-baseline": "v0.3.0",
|
|
97
|
-
"oh-my-opencode-linux-arm64": "v0.3.0",
|
|
98
|
-
"oh-my-opencode-linux-arm64-musl": "v0.3.0",
|
|
99
|
-
"oh-my-opencode-linux-x64": "v0.3.0",
|
|
100
|
-
"oh-my-opencode-linux-x64-baseline": "v0.3.0",
|
|
101
|
-
"oh-my-opencode-linux-x64-musl": "v0.3.0",
|
|
102
|
-
"oh-my-opencode-linux-x64-musl-baseline": "v0.3.0",
|
|
103
|
-
"oh-my-opencode-windows-x64": "v0.3.0",
|
|
104
|
-
"oh-my-opencode-windows-x64-baseline": "v0.3.0"
|
|
83
|
+
"oh-my-magento-darwin-arm64": "0.3.2",
|
|
84
|
+
"oh-my-magento-darwin-x64": "0.3.2",
|
|
85
|
+
"oh-my-magento-darwin-x64-baseline": "0.3.2",
|
|
86
|
+
"oh-my-magento-linux-arm64": "0.3.2",
|
|
87
|
+
"oh-my-magento-linux-arm64-musl": "0.3.2",
|
|
88
|
+
"oh-my-magento-linux-x64": "0.3.2",
|
|
89
|
+
"oh-my-magento-linux-x64-baseline": "0.3.2",
|
|
90
|
+
"oh-my-magento-linux-x64-musl": "0.3.2",
|
|
91
|
+
"oh-my-magento-linux-x64-musl-baseline": "0.3.2",
|
|
92
|
+
"oh-my-magento-windows-x64": "0.3.2",
|
|
93
|
+
"oh-my-magento-windows-x64-baseline": "0.3.2"
|
|
105
94
|
},
|
|
106
95
|
"overrides": {
|
|
107
96
|
"@opencode-ai/sdk": "^1.2.24"
|