@great-arrow/cli 0.1.40 → 0.1.42
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 +94 -16
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9399,7 +9399,7 @@ function isNodeError(value) {
|
|
|
9399
9399
|
|
|
9400
9400
|
// src/lib/version.ts
|
|
9401
9401
|
var CLI_PACKAGE_NAME = "@great-arrow/cli";
|
|
9402
|
-
var CLI_VERSION = "0.1.
|
|
9402
|
+
var CLI_VERSION = "0.1.42";
|
|
9403
9403
|
var GAD_INSTALL_VERSION = "2026.08.08";
|
|
9404
9404
|
var GAD_INSTALL_MIN_VERSION = "2026.06.22";
|
|
9405
9405
|
var GAD_INSTALL_HEADER = "X-GAD-Install-Version";
|
|
@@ -13607,6 +13607,53 @@ function inspectConfiguredHooks(hooks, deps) {
|
|
|
13607
13607
|
|
|
13608
13608
|
// src/lib/mcp-doctor.ts
|
|
13609
13609
|
import { createHash as createHash2 } from "node:crypto";
|
|
13610
|
+
|
|
13611
|
+
// src/lib/mcp-target.ts
|
|
13612
|
+
var GREAT_ARROW_HOSTS = /* @__PURE__ */ new Set([
|
|
13613
|
+
"greatarrow.ai",
|
|
13614
|
+
"www.greatarrow.ai",
|
|
13615
|
+
"greatarrowdigital.com",
|
|
13616
|
+
"www.greatarrowdigital.com"
|
|
13617
|
+
]);
|
|
13618
|
+
function isGreatArrowEndpoint(value) {
|
|
13619
|
+
if (typeof value !== "string") return false;
|
|
13620
|
+
try {
|
|
13621
|
+
const url = new URL(value);
|
|
13622
|
+
return (url.protocol === "https:" || url.protocol === "http:") && GREAT_ARROW_HOSTS.has(url.hostname) && /^\/api\/mcp\/?$/.test(url.pathname);
|
|
13623
|
+
} catch {
|
|
13624
|
+
return false;
|
|
13625
|
+
}
|
|
13626
|
+
}
|
|
13627
|
+
function isGreatArrowExecutable(value) {
|
|
13628
|
+
if (typeof value !== "string") return false;
|
|
13629
|
+
return /^@great-arrow\/(?:cli|mcp-server)(?:@[^\s]+)?$/.test(value) || /(?:^|[/\\])(?:\.great-arrow|great-arrow-digital[/\\]scripts)[/\\]mcp-server\.mjs$/.test(
|
|
13630
|
+
value
|
|
13631
|
+
);
|
|
13632
|
+
}
|
|
13633
|
+
function tomlString(raw) {
|
|
13634
|
+
if (raw.startsWith("'")) return raw.slice(1, -1);
|
|
13635
|
+
try {
|
|
13636
|
+
const value = JSON.parse(raw);
|
|
13637
|
+
return typeof value === "string" ? value : void 0;
|
|
13638
|
+
} catch {
|
|
13639
|
+
return void 0;
|
|
13640
|
+
}
|
|
13641
|
+
}
|
|
13642
|
+
function codexTransportFields(body) {
|
|
13643
|
+
const entry = {};
|
|
13644
|
+
for (const match of body.matchAll(
|
|
13645
|
+
/^\s*(url|command)\s*=\s*("(?:\\.|[^"\\\r\n])*"|'[^'\r\n]*')/gm
|
|
13646
|
+
)) {
|
|
13647
|
+
entry[match[1]] = tomlString(match[2]);
|
|
13648
|
+
}
|
|
13649
|
+
const args = body.match(/^\s*args\s*=\s*\[([\s\S]*?)\]/m)?.[1];
|
|
13650
|
+
if (args !== void 0) {
|
|
13651
|
+
entry.args = [...args.matchAll(/"(?:\\.|[^"\\])*"|'[^']*'|#[^\r\n]*/g)].filter((match) => !match[0].startsWith("#")).map((match) => tomlString(match[0]));
|
|
13652
|
+
}
|
|
13653
|
+
return entry;
|
|
13654
|
+
}
|
|
13655
|
+
|
|
13656
|
+
// src/lib/mcp-doctor.ts
|
|
13610
13657
|
var MCP_FAILURE_MESSAGE = {
|
|
13611
13658
|
auth: "MCP rejected this machine's credential (401/403)",
|
|
13612
13659
|
network: "Could not reach the MCP endpoint",
|
|
@@ -13729,21 +13776,17 @@ function knownConfigLocations(home, cwd, platform = process.platform, appData) {
|
|
|
13729
13776
|
];
|
|
13730
13777
|
}
|
|
13731
13778
|
var GREAT_ARROW_NAME = /great[-_ ]?arrow|ai[-_]memory/i;
|
|
13732
|
-
var GREAT_ARROW_REF = /great[-_ ]?arrow|greatarrow|greatarrowdigital/i;
|
|
13733
13779
|
function asObject2(value) {
|
|
13734
13780
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
13735
13781
|
}
|
|
13736
13782
|
function isGreatArrowServer(name, entry) {
|
|
13737
13783
|
if (GREAT_ARROW_NAME.test(name)) return true;
|
|
13738
|
-
|
|
13739
|
-
|
|
13740
|
-
|
|
13741
|
-
|
|
13742
|
-
|
|
13743
|
-
|
|
13744
|
-
entry.env
|
|
13745
|
-
]);
|
|
13746
|
-
return GREAT_ARROW_REF.test(target);
|
|
13784
|
+
if ([entry.url, entry.httpUrl, entry.serverUrl].some(isGreatArrowEndpoint)) {
|
|
13785
|
+
return true;
|
|
13786
|
+
}
|
|
13787
|
+
return [entry.command, ...Array.isArray(entry.args) ? entry.args : []].some(
|
|
13788
|
+
isGreatArrowExecutable
|
|
13789
|
+
);
|
|
13747
13790
|
}
|
|
13748
13791
|
function classifySurface(entry, clientId, hooksInstalled) {
|
|
13749
13792
|
if (typeof entry.command === "string" && entry.command.length > 0) {
|
|
@@ -13770,15 +13813,18 @@ function serverMapsFromJson(parsed, serversKey) {
|
|
|
13770
13813
|
}
|
|
13771
13814
|
function findCodexEntries(location, content) {
|
|
13772
13815
|
const entries = [];
|
|
13773
|
-
const sections = content.split(/^\s*\[
|
|
13816
|
+
const sections = content.split(/^\s*\[/m).slice(1);
|
|
13774
13817
|
const seen = /* @__PURE__ */ new Set();
|
|
13775
13818
|
for (const raw of sections) {
|
|
13776
13819
|
const header = raw.slice(0, raw.indexOf("]"));
|
|
13777
|
-
const match = header.match(
|
|
13778
|
-
|
|
13820
|
+
const match = header.match(
|
|
13821
|
+
/^mcp_servers\.(?:"([^"]+)"|'([^']+)'|([^.\s\]]+))$/
|
|
13822
|
+
);
|
|
13823
|
+
const name = match?.[1] ?? match?.[2] ?? match?.[3];
|
|
13779
13824
|
if (!name || seen.has(name)) continue;
|
|
13780
13825
|
const body = raw.slice(raw.indexOf("]") + 1);
|
|
13781
|
-
|
|
13826
|
+
const transport = codexTransportFields(body);
|
|
13827
|
+
if (!isGreatArrowServer(name, transport)) continue;
|
|
13782
13828
|
seen.add(name);
|
|
13783
13829
|
entries.push({
|
|
13784
13830
|
clientId: location.clientId,
|
|
@@ -13786,7 +13832,7 @@ function findCodexEntries(location, content) {
|
|
|
13786
13832
|
scope: location.scope,
|
|
13787
13833
|
path: location.path,
|
|
13788
13834
|
serverName: name,
|
|
13789
|
-
surface:
|
|
13835
|
+
surface: typeof transport.command === "string" ? "stdio" : "http"
|
|
13790
13836
|
});
|
|
13791
13837
|
}
|
|
13792
13838
|
return entries;
|
|
@@ -16641,10 +16687,42 @@ function normalizeGlance(raw) {
|
|
|
16641
16687
|
const sp = raw2;
|
|
16642
16688
|
return typeof sp.line === "string" && sp.line !== "" && typeof sp.totalCostUsd === "number" && Number.isFinite(sp.totalCostUsd) ? { line: sp.line, totalCostUsd: sp.totalCostUsd } : null;
|
|
16643
16689
|
})(),
|
|
16690
|
+
...Array.isArray(obj.sections) ? { sections: normalizeTodaySections(obj.sections) } : {},
|
|
16691
|
+
...Array.isArray(obj.degradedSections) ? {
|
|
16692
|
+
degradedSections: obj.degradedSections.filter(
|
|
16693
|
+
(k) => typeof k === "string"
|
|
16694
|
+
)
|
|
16695
|
+
} : {},
|
|
16644
16696
|
urgency: typeof obj.urgency === "number" ? obj.urgency : null,
|
|
16645
16697
|
generatedAt: typeof obj.generatedAt === "string" ? obj.generatedAt : (/* @__PURE__ */ new Date()).toISOString()
|
|
16646
16698
|
};
|
|
16647
16699
|
}
|
|
16700
|
+
function asNullableString(value) {
|
|
16701
|
+
return typeof value === "string" && value !== "" ? value : null;
|
|
16702
|
+
}
|
|
16703
|
+
function normalizeTodaySections(raw) {
|
|
16704
|
+
return raw.flatMap((section) => {
|
|
16705
|
+
if (typeof section !== "object" || section === null) return [];
|
|
16706
|
+
const s = section;
|
|
16707
|
+
if (typeof s.key !== "string" || typeof s.title !== "string") return [];
|
|
16708
|
+
const rows = asArray2(s.rows).flatMap((row) => {
|
|
16709
|
+
if (typeof row !== "object" || row === null) return [];
|
|
16710
|
+
const r = row;
|
|
16711
|
+
if (typeof r.id !== "string" || typeof r.title !== "string") return [];
|
|
16712
|
+
return [
|
|
16713
|
+
{
|
|
16714
|
+
id: r.id,
|
|
16715
|
+
title: r.title,
|
|
16716
|
+
meta: asNullableString(r.meta),
|
|
16717
|
+
href: asNullableString(r.href),
|
|
16718
|
+
tone: typeof r.tone === "string" ? r.tone : "normal",
|
|
16719
|
+
at: asNullableString(r.at)
|
|
16720
|
+
}
|
|
16721
|
+
];
|
|
16722
|
+
});
|
|
16723
|
+
return rows.length > 0 ? [{ key: s.key, title: s.title, rows }] : [];
|
|
16724
|
+
});
|
|
16725
|
+
}
|
|
16648
16726
|
function asArray2(value) {
|
|
16649
16727
|
return Array.isArray(value) ? value : [];
|
|
16650
16728
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@great-arrow/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.42",
|
|
4
4
|
"description": "GreatArrow.ai CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"typecheck": "tsc --noEmit"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@napi-rs/keyring": "2.
|
|
20
|
+
"@napi-rs/keyring": "2.1.0",
|
|
21
21
|
"commander": "^15.0.0",
|
|
22
22
|
"update-notifier": "^7.3.1",
|
|
23
23
|
"nanoid": "^3.3.18"
|