@bli-cockpit/mcp 0.1.18 → 0.1.19
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/verb-census.js +43 -1
- package/package.json +2 -2
package/dist/verb-census.js
CHANGED
|
@@ -88,10 +88,52 @@ function commandVariants() {
|
|
|
88
88
|
if (start < 0)
|
|
89
89
|
continue;
|
|
90
90
|
const end = source.indexOf("\nexport ", start + 10);
|
|
91
|
-
return source
|
|
91
|
+
return source
|
|
92
|
+
.slice(start, end < 0 ? undefined : end)
|
|
93
|
+
.split(/\n\s{2}\|\s/)
|
|
94
|
+
.map((variant) => resolveShapeAlias(variant, source));
|
|
92
95
|
}
|
|
93
96
|
throw new Error("LocalCommand union not found in local-command-shapes.ts or local-args.ts");
|
|
94
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* A union member that is a bare NAME rather than an inline object.
|
|
100
|
+
*
|
|
101
|
+
* BLI-3880 wrote `cockpit search`'s shape as its own exported interface in a
|
|
102
|
+
* sibling file (`local-command-shapes-search.ts`) and put `| SearchCommandShape`
|
|
103
|
+
* in the union — perfectly ordinary TypeScript, and invisible to a census that
|
|
104
|
+
* only looks for an inline `kind: "…"`. That silence was not silent for long:
|
|
105
|
+
* `towerVerbs` throws when a noun has no variant, which is exactly what it did.
|
|
106
|
+
* Rather than teach the union one spelling, this follows the alias: find the
|
|
107
|
+
* import that names it, read that file, and hand back the interface body so
|
|
108
|
+
* every regex below sees the same thing it would have seen inline.
|
|
109
|
+
*
|
|
110
|
+
* A name that cannot be followed is returned unchanged, so it still reaches
|
|
111
|
+
* the "no LocalCommand variant" error rather than disappearing quietly.
|
|
112
|
+
*/
|
|
113
|
+
function resolveShapeAlias(variant, unionSource) {
|
|
114
|
+
// The chunk is the alias NAME plus whatever comment introduces the next
|
|
115
|
+
// union member, because the split is on `\n | `. Only the first line is the
|
|
116
|
+
// member itself.
|
|
117
|
+
const firstLine = variant.split("\n").find((line) => line.trim().length > 0) ?? "";
|
|
118
|
+
const name = /^\s*([A-Z][A-Za-z0-9_]*)\s*$/.exec(firstLine)?.[1];
|
|
119
|
+
if (!name)
|
|
120
|
+
return variant;
|
|
121
|
+
const from = new RegExp(`import type \\{[^}]*\\b${name}\\b[^}]*\\} from "\\.\\/([\\w.-]+)\\.js"`).exec(unionSource)?.[1];
|
|
122
|
+
if (!from)
|
|
123
|
+
return variant;
|
|
124
|
+
let source;
|
|
125
|
+
try {
|
|
126
|
+
source = readFileSync(join(COLLECTOR_COMMANDS_DIR, `${from}.ts`), "utf8");
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return variant;
|
|
130
|
+
}
|
|
131
|
+
const start = source.indexOf(`export interface ${name} {`);
|
|
132
|
+
if (start < 0)
|
|
133
|
+
return variant;
|
|
134
|
+
const end = source.indexOf("\n}", start);
|
|
135
|
+
return source.slice(start, end < 0 ? undefined : end);
|
|
136
|
+
}
|
|
95
137
|
/** Every Tower verb a person may type today. */
|
|
96
138
|
export function towerVerbs() {
|
|
97
139
|
const nouns = new Set(towerNouns());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bli-cockpit/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "bli-tower \u2014 an MCP server over BLI Cockpit's agent doors: JARVIS (jarvis_*), documents (docs_*), channels (msg_*), issues (work_*), the daily page (brief_*), meeting notes (notes_*), the ops board (ops_status/slack_*), settings/team/model, Scout and the workbook, plus the legacy event-stream tools (emit_event, get_ticket_timeline, get_active_tickets).",
|
|
6
6
|
"type": "module",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"readme": "npm run build && node scripts/write-readme-census.mjs"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@bli-cockpit/telemetry-core": "0.1.
|
|
33
|
+
"@bli-cockpit/telemetry-core": "0.1.35",
|
|
34
34
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
35
35
|
"zod": "^4.3.6"
|
|
36
36
|
},
|