@great-arrow/cli 0.1.33 → 0.1.35
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 +47 -8
- package/package.json +1 -1
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.35";
|
|
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";
|
|
@@ -11170,9 +11170,29 @@ var switchCommand = new Command("switch").description("Set the active workspace
|
|
|
11170
11170
|
previousName && previousId && previousName !== resolvedName ? `Switched workspace: ${previousName} \u2192 ${resolvedName} (use '${previousId}' to switch back)` : `Working in workspace: ${resolvedName}`
|
|
11171
11171
|
);
|
|
11172
11172
|
});
|
|
11173
|
+
function flattenWorkspaceInfo(payload) {
|
|
11174
|
+
const root = typeof payload === "object" && payload !== null ? payload : {};
|
|
11175
|
+
if (typeof root.name === "string") return root;
|
|
11176
|
+
const ws = typeof root.workspace === "object" && root.workspace !== null ? root.workspace : {};
|
|
11177
|
+
const integrations = Array.isArray(root.integrations) ? root.integrations.map(
|
|
11178
|
+
(entry) => typeof entry === "string" ? entry : typeof entry === "object" && entry !== null ? String(
|
|
11179
|
+
entry.kind ?? entry.provider ?? entry.name ?? ""
|
|
11180
|
+
) : ""
|
|
11181
|
+
) : root.integrations;
|
|
11182
|
+
return {
|
|
11183
|
+
...root,
|
|
11184
|
+
name: ws.name,
|
|
11185
|
+
kind: ws.kind,
|
|
11186
|
+
slug: ws.slug,
|
|
11187
|
+
role: ws.role,
|
|
11188
|
+
integrations
|
|
11189
|
+
};
|
|
11190
|
+
}
|
|
11173
11191
|
var infoColumns = [
|
|
11174
11192
|
{ key: "name", header: "Name" },
|
|
11175
11193
|
{ key: "kind", header: "Kind" },
|
|
11194
|
+
{ key: "slug", header: "Slug" },
|
|
11195
|
+
{ key: "role", header: "Your role" },
|
|
11176
11196
|
{ key: "description", header: "Description" },
|
|
11177
11197
|
{
|
|
11178
11198
|
key: "memberCount",
|
|
@@ -11220,9 +11240,7 @@ var infoCommand = new Command("info").description("Show active workspace setting
|
|
|
11220
11240
|
});
|
|
11221
11241
|
const client = await createClient();
|
|
11222
11242
|
const result = await client.mcpCall("workspace_settings_get", {});
|
|
11223
|
-
|
|
11224
|
-
const workspace = typeof data === "object" && data !== null ? data : {};
|
|
11225
|
-
fmt.detail(workspace, infoColumns);
|
|
11243
|
+
fmt.detail(flattenWorkspaceInfo(result), infoColumns);
|
|
11226
11244
|
});
|
|
11227
11245
|
var membersCommand = new Command("members").description("List workspace members with roles and last-active timestamps").option("--json", "Output as JSON").action(async (options) => {
|
|
11228
11246
|
const jsonFlag = Boolean(
|
|
@@ -12742,7 +12760,25 @@ import { dirname as dirname4, join as join5 } from "node:path";
|
|
|
12742
12760
|
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
12743
12761
|
var CODEX_SERVER_NAME = "great-arrow";
|
|
12744
12762
|
var CODEX_CLIENT_ID = "codex-cli";
|
|
12745
|
-
var
|
|
12763
|
+
var CODEX_APPROVAL_POLICIES = [
|
|
12764
|
+
"never",
|
|
12765
|
+
"on-request",
|
|
12766
|
+
"on-failure",
|
|
12767
|
+
"untrusted"
|
|
12768
|
+
];
|
|
12769
|
+
function resolveCodexApprovalPolicy(raw = process.env.GAD_CODEX_APPROVAL_POLICY) {
|
|
12770
|
+
if (raw === void 0 || raw === "") return "never";
|
|
12771
|
+
if (raw === "none") return "none";
|
|
12772
|
+
if (CODEX_APPROVAL_POLICIES.includes(raw))
|
|
12773
|
+
return raw;
|
|
12774
|
+
throw new Error(
|
|
12775
|
+
`GAD_CODEX_APPROVAL_POLICY="${raw}" is not a Codex approval policy. Valid: none (leave Codex alone) | ${CODEX_APPROVAL_POLICIES.join(" | ")}`
|
|
12776
|
+
);
|
|
12777
|
+
}
|
|
12778
|
+
function codexApprovalPolicyLine() {
|
|
12779
|
+
const policy = resolveCodexApprovalPolicy();
|
|
12780
|
+
return policy === "none" ? "" : `approval_policy = "${policy}"`;
|
|
12781
|
+
}
|
|
12746
12782
|
var SAFE_GLOBAL_MCP_SERVERS = /* @__PURE__ */ new Set([
|
|
12747
12783
|
CODEX_SERVER_NAME,
|
|
12748
12784
|
"great-arrow-kiro-terminal",
|
|
@@ -12819,7 +12855,7 @@ function repoKey(repoUrl) {
|
|
|
12819
12855
|
}
|
|
12820
12856
|
}
|
|
12821
12857
|
function generateCodexConfigToml(apiUrl, _repoUrl) {
|
|
12822
|
-
return `${
|
|
12858
|
+
return `${codexApprovalPolicyLine()}
|
|
12823
12859
|
|
|
12824
12860
|
[mcp_servers.${CODEX_SERVER_NAME}]
|
|
12825
12861
|
command = "npx"
|
|
@@ -12830,6 +12866,9 @@ env_vars = ["GREAT_ARROW_TOKEN"]
|
|
|
12830
12866
|
GAD_API_URL = "${tomlEscape(normalizeApiUrl(apiUrl))}"
|
|
12831
12867
|
GAD_MCP_CLIENT = "${CODEX_CLIENT_ID}"
|
|
12832
12868
|
${GAD_INSTALL_HEADER} = "${GAD_INSTALL_VERSION}"
|
|
12869
|
+
|
|
12870
|
+
[mcp_servers.${CODEX_SERVER_NAME}.tools."*"]
|
|
12871
|
+
approval_mode = "approve"
|
|
12833
12872
|
`;
|
|
12834
12873
|
}
|
|
12835
12874
|
function generateCodexEnv(token) {
|
|
@@ -12900,12 +12939,12 @@ function upsertCodexServerBlock(existingContent, apiUrl, repoUrl) {
|
|
|
12900
12939
|
/* @__PURE__ */ new Set([CODEX_SERVER_NAME])
|
|
12901
12940
|
).replace(/^\s*approval_policy\s*=.*(?:\n|$)/gm, "").replace(/^\s+/, "").replace(/\s*$/, "");
|
|
12902
12941
|
if (!withoutGreatArrow) {
|
|
12903
|
-
return `${
|
|
12942
|
+
return `${codexApprovalPolicyLine()}
|
|
12904
12943
|
|
|
12905
12944
|
${block}
|
|
12906
12945
|
`;
|
|
12907
12946
|
}
|
|
12908
|
-
return `${
|
|
12947
|
+
return `${codexApprovalPolicyLine()}
|
|
12909
12948
|
|
|
12910
12949
|
${withoutGreatArrow}
|
|
12911
12950
|
|