@okx_ai/okx-trade-cli 1.3.5-beta.1 → 1.3.5
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 +23 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13358,9 +13358,9 @@ var Report = class {
|
|
|
13358
13358
|
/** Write report to a file path, returns true on success. */
|
|
13359
13359
|
writeToFile(filePath) {
|
|
13360
13360
|
try {
|
|
13361
|
-
const sep2 = "
|
|
13361
|
+
const sep2 = "\u2500".repeat(52);
|
|
13362
13362
|
const lines = [
|
|
13363
|
-
|
|
13363
|
+
`\u2500\u2500 Diagnostic Report (copy & share) ${sep2.slice(35)}`
|
|
13364
13364
|
];
|
|
13365
13365
|
for (const { key, value } of this.lines) {
|
|
13366
13366
|
lines.push(`${key.padEnd(14)} ${value}`);
|
|
@@ -13374,10 +13374,10 @@ var Report = class {
|
|
|
13374
13374
|
}
|
|
13375
13375
|
};
|
|
13376
13376
|
function ok(label, detail) {
|
|
13377
|
-
outputLine(`
|
|
13377
|
+
outputLine(` [ok] ${label.padEnd(14)} ${detail}`);
|
|
13378
13378
|
}
|
|
13379
13379
|
function fail(label, detail, hints) {
|
|
13380
|
-
outputLine(`
|
|
13380
|
+
outputLine(` [x] ${label.padEnd(14)} ${detail}`);
|
|
13381
13381
|
for (const hint of hints) {
|
|
13382
13382
|
outputLine(` \u2192 ${hint}`);
|
|
13383
13383
|
}
|
|
@@ -13868,7 +13868,7 @@ async function cmdDiagnoseMcp(options = {}) {
|
|
|
13868
13868
|
|
|
13869
13869
|
// src/commands/diagnose.ts
|
|
13870
13870
|
var CLI_VERSION = readCliVersion();
|
|
13871
|
-
var GIT_HASH = true ? "
|
|
13871
|
+
var GIT_HASH = true ? "c34b282c" : "dev";
|
|
13872
13872
|
function maskKey2(key) {
|
|
13873
13873
|
if (!key) return "(not set)";
|
|
13874
13874
|
if (key.length <= 8) return "****";
|
|
@@ -16504,9 +16504,9 @@ async function cmdMarketIndicator(run, indicator, instId, opts) {
|
|
|
16504
16504
|
const indicators = tfData?.["indicators"];
|
|
16505
16505
|
const values = indicators?.[apiCode];
|
|
16506
16506
|
if (!values?.length) continue;
|
|
16507
|
-
process.stdout.write(`${instId}
|
|
16507
|
+
process.stdout.write(`${instId} | ${apiCode} | ${tf}
|
|
16508
16508
|
`);
|
|
16509
|
-
process.stdout.write("
|
|
16509
|
+
process.stdout.write("-".repeat(40) + "\n");
|
|
16510
16510
|
if (opts.list) {
|
|
16511
16511
|
const tableRows = values.map((entry) => ({
|
|
16512
16512
|
ts: new Date(Number(entry["ts"])).toLocaleString(),
|
|
@@ -19668,6 +19668,9 @@ function resolveNpx() {
|
|
|
19668
19668
|
if (existsSync10(sibling)) return sibling;
|
|
19669
19669
|
return "npx";
|
|
19670
19670
|
}
|
|
19671
|
+
function npxEnv() {
|
|
19672
|
+
return { ...process.env, NO_COLOR: "1", FORCE_COLOR: "0" };
|
|
19673
|
+
}
|
|
19671
19674
|
var THIRD_PARTY_INSTALL_NOTICE = "Note: This skill was created by a third-party developer, not by OKX. Review SKILL.md before use.";
|
|
19672
19675
|
async function cmdSkillSearch(run, opts) {
|
|
19673
19676
|
const args = {};
|
|
@@ -19717,7 +19720,7 @@ async function cmdSkillCategories(run, json) {
|
|
|
19717
19720
|
}
|
|
19718
19721
|
outputLine("");
|
|
19719
19722
|
}
|
|
19720
|
-
async function cmdSkillAdd(name, config, json) {
|
|
19723
|
+
async function cmdSkillAdd(name, config, json, exec = execFileSync2) {
|
|
19721
19724
|
const tmpBase = join15(tmpdir(), `okx-skill-${randomUUID2()}`);
|
|
19722
19725
|
mkdirSync12(tmpBase, { recursive: true });
|
|
19723
19726
|
try {
|
|
@@ -19729,9 +19732,10 @@ async function cmdSkillAdd(name, config, json) {
|
|
|
19729
19732
|
validateSkillMdExists(contentDir);
|
|
19730
19733
|
outputLine("Installing to detected agents...");
|
|
19731
19734
|
try {
|
|
19732
|
-
|
|
19735
|
+
exec(resolveNpx(), ["skills", "add", contentDir, "-y", "-g"], {
|
|
19733
19736
|
stdio: "inherit",
|
|
19734
|
-
timeout: 6e4
|
|
19737
|
+
timeout: 6e4,
|
|
19738
|
+
env: npxEnv()
|
|
19735
19739
|
});
|
|
19736
19740
|
} catch (e) {
|
|
19737
19741
|
const savedZip = join15(process.cwd(), `${name}.zip`);
|
|
@@ -19760,7 +19764,7 @@ async function cmdSkillDownload(name, targetDir, config, json, format = "zip") {
|
|
|
19760
19764
|
outputLine(` Path: ${filePath}`);
|
|
19761
19765
|
}
|
|
19762
19766
|
}
|
|
19763
|
-
function cmdSkillRemove(name, json) {
|
|
19767
|
+
function cmdSkillRemove(name, json, exec = execFileSync2) {
|
|
19764
19768
|
const removed = removeSkillRecord(name);
|
|
19765
19769
|
if (!removed) {
|
|
19766
19770
|
errorLine(`Skill "${name}" is not installed.`);
|
|
@@ -19768,9 +19772,10 @@ function cmdSkillRemove(name, json) {
|
|
|
19768
19772
|
return;
|
|
19769
19773
|
}
|
|
19770
19774
|
try {
|
|
19771
|
-
|
|
19775
|
+
exec(resolveNpx(), ["skills", "remove", name, "-y", "-g"], {
|
|
19772
19776
|
stdio: "inherit",
|
|
19773
|
-
timeout: 6e4
|
|
19777
|
+
timeout: 6e4,
|
|
19778
|
+
env: npxEnv()
|
|
19774
19779
|
});
|
|
19775
19780
|
} catch {
|
|
19776
19781
|
const agentsPath = join15(homedir13(), ".agents", "skills", name);
|
|
@@ -19782,7 +19787,7 @@ function cmdSkillRemove(name, json) {
|
|
|
19782
19787
|
if (json) {
|
|
19783
19788
|
outputLine(JSON.stringify({ name, status: "removed" }, null, 2));
|
|
19784
19789
|
} else {
|
|
19785
|
-
outputLine(
|
|
19790
|
+
outputLine(`[ok] Skill "${name}" removed`);
|
|
19786
19791
|
}
|
|
19787
19792
|
}
|
|
19788
19793
|
async function cmdSkillCheck(run, name, json) {
|
|
@@ -20156,16 +20161,16 @@ async function cmdEventSeries(run, opts) {
|
|
|
20156
20161
|
const updown = mainSeries.filter(isUpDownSeries);
|
|
20157
20162
|
const above = mainSeries.filter((s) => !isUpDownSeries(s));
|
|
20158
20163
|
if (updown.length > 0) {
|
|
20159
|
-
process.stdout.write("\n
|
|
20164
|
+
process.stdout.write("\n-- Up/Down --\n");
|
|
20160
20165
|
printTable(updown.map((s) => toRow(s, isFeatured(s))));
|
|
20161
20166
|
}
|
|
20162
20167
|
if (above.length > 0) {
|
|
20163
|
-
process.stdout.write("\n
|
|
20168
|
+
process.stdout.write("\n-- Price Above --\n");
|
|
20164
20169
|
printTable(above.map((s) => toRow(s, isFeatured(s))));
|
|
20165
20170
|
}
|
|
20166
20171
|
if (testSeries.length > 0) {
|
|
20167
20172
|
if (opts.all) {
|
|
20168
|
-
process.stdout.write("\n
|
|
20173
|
+
process.stdout.write("\n-- Test / Other --\n");
|
|
20169
20174
|
printTable(testSeries.map((s) => toRow(s, false)));
|
|
20170
20175
|
} else {
|
|
20171
20176
|
process.stdout.write(`
|
|
@@ -20457,7 +20462,7 @@ async function cmdEventCancel(run, opts) {
|
|
|
20457
20462
|
// src/index.ts
|
|
20458
20463
|
var _require3 = createRequire3(import.meta.url);
|
|
20459
20464
|
var CLI_VERSION2 = _require3("../package.json").version;
|
|
20460
|
-
var GIT_HASH2 = true ? "
|
|
20465
|
+
var GIT_HASH2 = true ? "c34b282c" : "dev";
|
|
20461
20466
|
function handlePilotCommand(action, json, force, binaryPath) {
|
|
20462
20467
|
if (action === "status") return cmdPilotStatus(json, binaryPath);
|
|
20463
20468
|
if (action === "install") return cmdPilotInstall(json, binaryPath);
|