@sechroom/cli 2026.6.207-rc.d880366d → 2026.6.209-rc.175abeb8
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 +45 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1947,15 +1947,25 @@ var SectionType = {
|
|
|
1947
1947
|
* carried a workspaceId and that workspace has agent-setup-bundle memories. */
|
|
1948
1948
|
WorkspaceConventions: "workspace-conventions"
|
|
1949
1949
|
};
|
|
1950
|
-
async function fetchSetup(cfg) {
|
|
1950
|
+
async function fetchSetup(cfg, namespaceSlug) {
|
|
1951
1951
|
const client = await makeClient(cfg);
|
|
1952
|
+
const query = {};
|
|
1953
|
+
if (cfg.workspaceId) query.workspaceId = cfg.workspaceId;
|
|
1954
|
+
if (namespaceSlug) query.namespaceSlug = namespaceSlug;
|
|
1955
|
+
const hasQuery = query.workspaceId !== void 0 || query.namespaceSlug !== void 0;
|
|
1952
1956
|
const { data, error } = await client.GET(
|
|
1953
1957
|
"/operator-surface/setup",
|
|
1954
|
-
|
|
1958
|
+
hasQuery ? { params: { query } } : {}
|
|
1955
1959
|
);
|
|
1956
1960
|
if (error) throw new Error(`GET /operator-surface/setup failed: ${JSON.stringify(error)}`);
|
|
1957
1961
|
return data;
|
|
1958
1962
|
}
|
|
1963
|
+
async function listNamespaces(cfg) {
|
|
1964
|
+
const client = await makeClient(cfg);
|
|
1965
|
+
const { data } = await client.GET("/mcp-aggregator/namespaces", {});
|
|
1966
|
+
const rows = data ?? [];
|
|
1967
|
+
return rows.filter((r) => typeof r.slug === "string").map((r) => ({ slug: r.slug, displayName: r.displayName ?? r.slug }));
|
|
1968
|
+
}
|
|
1959
1969
|
function findSurface(setup, surfaceKey) {
|
|
1960
1970
|
return setup.surfaces.find((s) => s.surfaceKey === surfaceKey);
|
|
1961
1971
|
}
|
|
@@ -3187,8 +3197,28 @@ ${client.label} (${client.key}):
|
|
|
3187
3197
|
`);
|
|
3188
3198
|
}
|
|
3189
3199
|
}
|
|
3200
|
+
var GLOBAL_NAMESPACE = "__global__";
|
|
3201
|
+
async function resolveNamespaceChoice(cfg, flag) {
|
|
3202
|
+
if (flag) return flag;
|
|
3203
|
+
if (!canPrompt()) return null;
|
|
3204
|
+
const namespaces = await listNamespaces(cfg);
|
|
3205
|
+
if (namespaces.length === 0) return null;
|
|
3206
|
+
const picked = await promptSelect(
|
|
3207
|
+
"Which namespace should this connection use?",
|
|
3208
|
+
[
|
|
3209
|
+
{ label: "Global (whole tenant)", value: GLOBAL_NAMESPACE },
|
|
3210
|
+
...namespaces.map((n) => ({
|
|
3211
|
+
label: n.displayName,
|
|
3212
|
+
value: n.slug,
|
|
3213
|
+
hint: n.slug
|
|
3214
|
+
}))
|
|
3215
|
+
],
|
|
3216
|
+
GLOBAL_NAMESPACE
|
|
3217
|
+
);
|
|
3218
|
+
return picked === GLOBAL_NAMESPACE ? null : picked;
|
|
3219
|
+
}
|
|
3190
3220
|
function registerInit(program2) {
|
|
3191
|
-
program2.command("init").description("Wire this project for sechroom: write MCP config + agent instruction files from the server's setup descriptors").option("--client <list>", `comma-separated clients (${ALL_CLIENT_KEYS.join(", ")}) or 'all'`, DEFAULT_CLIENT_KEY).option("--dry-run", "print what would be written without writing", false).option("--mcp-only", "only write MCP config (skip agent files)", false).option("--agent-files-only", "only write agent instruction files (skip MCP config)", false).option("--copy", "make a personal copy of the agent instructions you can edit (default: prompt on a TTY, else skip)").addHelpText(
|
|
3221
|
+
program2.command("init").description("Wire this project for sechroom: write MCP config + agent instruction files from the server's setup descriptors").option("--client <list>", `comma-separated clients (${ALL_CLIENT_KEYS.join(", ")}) or 'all'`, DEFAULT_CLIENT_KEY).option("--dry-run", "print what would be written without writing", false).option("--mcp-only", "only write MCP config (skip agent files)", false).option("--agent-files-only", "only write agent instruction files (skip MCP config)", false).option("--copy", "make a personal copy of the agent instructions you can edit (default: prompt on a TTY, else skip)").option("--namespace <slug>", "MCP namespace for the connection URL (interactive picker if omitted on a TTY; defaults to tenant-global)").addHelpText(
|
|
3192
3222
|
"after",
|
|
3193
3223
|
`
|
|
3194
3224
|
Examples:
|
|
@@ -3199,7 +3229,11 @@ Examples:
|
|
|
3199
3229
|
$ sechroom init --dry-run --json preview the writes, change nothing`
|
|
3200
3230
|
).action(async (opts, cmd) => {
|
|
3201
3231
|
const cfg = resolveConfig(cmd.optsWithGlobals());
|
|
3202
|
-
const
|
|
3232
|
+
const namespaceSlug = await resolveNamespaceChoice(cfg, opts.namespace);
|
|
3233
|
+
const setup = await withSpinner(
|
|
3234
|
+
"Fetching setup descriptors",
|
|
3235
|
+
() => fetchSetup(cfg, namespaceSlug ?? void 0)
|
|
3236
|
+
);
|
|
3203
3237
|
const targets = clientTargets(process.cwd());
|
|
3204
3238
|
const keys = resolveClientKeys(opts.client);
|
|
3205
3239
|
const json = cmd.optsWithGlobals().json;
|
|
@@ -3244,8 +3278,8 @@ Next \u2014 verify: ${verify.description}
|
|
|
3244
3278
|
}
|
|
3245
3279
|
function registerSetup(program2) {
|
|
3246
3280
|
const setup = program2.command("setup").description("Granular onboarding steps (init runs these together)");
|
|
3247
|
-
setup.command("mcp <clients...>").description(`Write only the MCP config for one or more clients (${ALL_CLIENT_KEYS.join(", ")}, or 'all')`).option("--dry-run", "print what would be written without writing", false).addHelpText("after", "\nExamples:\n $ sechroom setup mcp codex\n $ sechroom setup mcp claude-code codex\n $ sechroom setup mcp all").action(async (clients, opts, cmd) => {
|
|
3248
|
-
await runClients(clients, cmd, { dryRun: Boolean(opts.dryRun), mcp: true, agentFiles: false });
|
|
3281
|
+
setup.command("mcp <clients...>").description(`Write only the MCP config for one or more clients (${ALL_CLIENT_KEYS.join(", ")}, or 'all')`).option("--dry-run", "print what would be written without writing", false).option("--namespace <slug>", "MCP namespace for the connection URL (interactive picker if omitted on a TTY; defaults to tenant-global)").addHelpText("after", "\nExamples:\n $ sechroom setup mcp codex\n $ sechroom setup mcp claude-code codex\n $ sechroom setup mcp all").action(async (clients, opts, cmd) => {
|
|
3282
|
+
await runClients(clients, cmd, { dryRun: Boolean(opts.dryRun), mcp: true, agentFiles: false, namespace: opts.namespace });
|
|
3249
3283
|
});
|
|
3250
3284
|
setup.command("agent-files <clients...>").description(`Write only the agent instruction file(s) for one or more clients (${ALL_CLIENT_KEYS.join(", ")}, or 'all')`).option("--dry-run", "print what would be written without writing", false).option("--copy", "make a personal copy you can edit (default: prompt on a TTY, else skip)").addHelpText("after", "\nExamples:\n $ sechroom setup agent-files claude-code CLAUDE.md\n $ sechroom setup agent-files claude-code codex CLAUDE.md + AGENTS.md in one run\n $ sechroom setup agent-files all").action(async (clients, opts, cmd) => {
|
|
3251
3285
|
await runClients(clients, cmd, { dryRun: Boolean(opts.dryRun), mcp: false, agentFiles: true, copy: opts.copy });
|
|
@@ -3255,7 +3289,11 @@ async function runClients(clients, cmd, opts) {
|
|
|
3255
3289
|
const cfg = resolveConfig(cmd.optsWithGlobals());
|
|
3256
3290
|
const targets = clientTargets(process.cwd());
|
|
3257
3291
|
const keys = resolveClientKeys(clients.join(","));
|
|
3258
|
-
const
|
|
3292
|
+
const namespaceSlug = opts.mcp ? await resolveNamespaceChoice(cfg, opts.namespace) : null;
|
|
3293
|
+
const setupData = await withSpinner(
|
|
3294
|
+
"Fetching setup descriptors",
|
|
3295
|
+
() => fetchSetup(cfg, namespaceSlug ?? void 0)
|
|
3296
|
+
);
|
|
3259
3297
|
const personalWorkspaceId = await getPersonalWorkspaceId(cfg);
|
|
3260
3298
|
if (opts.agentFiles && !opts.dryRun) {
|
|
3261
3299
|
await maybeOfferCopies(cfg, setupData, targets, keys, personalWorkspaceId, copyChoice(opts));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sechroom/cli",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.209-rc.175abeb8",
|
|
4
4
|
"description": "Sechroom CLI — a thin, generated client over the Sechroom HTTP API. An agent/human surface alongside MCP.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|