@hasna/recordings 0.2.6 → 0.2.7
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/cli/index.js +53 -12
- package/dist/cli/mcp-config.d.ts +28 -0
- package/dist/cli/mcp-config.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/storage.js +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1515,7 +1515,7 @@ function setAgentFocus(idOrName, projectId, db) {
|
|
|
1515
1515
|
}
|
|
1516
1516
|
|
|
1517
1517
|
// src/version.ts
|
|
1518
|
-
var VERSION = "0.2.
|
|
1518
|
+
var VERSION = "0.2.7";
|
|
1519
1519
|
|
|
1520
1520
|
// src/db/feedback.ts
|
|
1521
1521
|
function saveFeedback(input) {
|
|
@@ -2376,6 +2376,50 @@ function applyEnhancementOptions(config, opts) {
|
|
|
2376
2376
|
return config;
|
|
2377
2377
|
}
|
|
2378
2378
|
|
|
2379
|
+
// src/cli/mcp-config.ts
|
|
2380
|
+
function escapeRegExp(value) {
|
|
2381
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2382
|
+
}
|
|
2383
|
+
function isTableHeader(line) {
|
|
2384
|
+
return /^\s*\[/.test(line);
|
|
2385
|
+
}
|
|
2386
|
+
function removeCodexServerBlock(content, name) {
|
|
2387
|
+
const headerRe = new RegExp(`^\\s*\\[mcp_servers\\.${escapeRegExp(name)}(\\..+)?\\]\\s*$`);
|
|
2388
|
+
const lines = content.split(`
|
|
2389
|
+
`);
|
|
2390
|
+
const out = [];
|
|
2391
|
+
let skipping = false;
|
|
2392
|
+
let removed = false;
|
|
2393
|
+
for (const line of lines) {
|
|
2394
|
+
if (isTableHeader(line)) {
|
|
2395
|
+
skipping = headerRe.test(line);
|
|
2396
|
+
if (skipping) {
|
|
2397
|
+
removed = true;
|
|
2398
|
+
continue;
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
if (skipping)
|
|
2402
|
+
continue;
|
|
2403
|
+
out.push(line);
|
|
2404
|
+
}
|
|
2405
|
+
const normalized = out.join(`
|
|
2406
|
+
`).replace(/\n{3,}/g, `
|
|
2407
|
+
|
|
2408
|
+
`).replace(/^\n+/, "");
|
|
2409
|
+
return { content: normalized, removed };
|
|
2410
|
+
}
|
|
2411
|
+
function upsertCodexStdioBlock(content, name, mcpCmd) {
|
|
2412
|
+
const { content: cleaned } = removeCodexServerBlock(content, name);
|
|
2413
|
+
const trimmed = cleaned.replace(/\s+$/, "");
|
|
2414
|
+
const block = `[mcp_servers.${name}]
|
|
2415
|
+
command = "${mcpCmd}"
|
|
2416
|
+
args = []
|
|
2417
|
+
`;
|
|
2418
|
+
return trimmed.length > 0 ? `${trimmed}
|
|
2419
|
+
|
|
2420
|
+
${block}` : block;
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2379
2423
|
// src/cli/index.ts
|
|
2380
2424
|
var program = new Command;
|
|
2381
2425
|
program.name("recordings").description("Speech-to-text recording tool \u2014 record, transcribe, and enhance with AI").version(VERSION).option("--json", "Output as JSON").option("--agent <name>", "Agent name or ID").option("--project <name>", "Project name or ID").option("--session <id>", "Session ID");
|
|
@@ -3204,19 +3248,16 @@ program.command("mcp").description("Install recordings MCP server into Claude Co
|
|
|
3204
3248
|
if (target === "codex") {
|
|
3205
3249
|
const configPath = pathJoin2(home, ".codex", "config.toml");
|
|
3206
3250
|
if (fileExists(configPath)) {
|
|
3207
|
-
|
|
3251
|
+
const content = readFileSync3(configPath, "utf-8");
|
|
3208
3252
|
if (opts.uninstall) {
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
`;
|
|
3253
|
+
const { content: next, removed } = removeCodexServerBlock(content, "recordings");
|
|
3254
|
+
writeFileSync(configPath, next, "utf-8");
|
|
3255
|
+
console.log(removed ? chalk.green(`Removed from Codex: ${configPath}`) : chalk.yellow(`Codex: no recordings MCP block found in ${configPath}`));
|
|
3256
|
+
} else {
|
|
3257
|
+
const next = upsertCodexStdioBlock(content, "recordings", mcpCmd);
|
|
3258
|
+
writeFileSync(configPath, next, "utf-8");
|
|
3259
|
+
console.log(chalk.green(`Installed into Codex: ${configPath}`));
|
|
3217
3260
|
}
|
|
3218
|
-
writeFileSync(configPath, content, "utf-8");
|
|
3219
|
-
console.log(chalk.green(`${action} Codex: ${configPath}`));
|
|
3220
3261
|
} else {
|
|
3221
3262
|
console.log(chalk.yellow(`Codex config not found: ${configPath}`));
|
|
3222
3263
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for editing an agent's MCP server config.
|
|
3
|
+
*
|
|
4
|
+
* Codex stores MCP servers as TOML tables (`[mcp_servers.<name>]`). A server
|
|
5
|
+
* block can be written in several transport forms — stdio (`command`/`args`)
|
|
6
|
+
* or streamable-HTTP (`url`/`http`, optional `headers`/`env` subtables). The
|
|
7
|
+
* uninstall/upsert logic must treat the whole table (and any of its subtables)
|
|
8
|
+
* as one unit regardless of which keys it holds, instead of matching one
|
|
9
|
+
* hand-written key layout. These functions are exported so the round-trip is
|
|
10
|
+
* unit-tested without touching the real `~/.codex/config.toml`.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Remove the `[mcp_servers.<name>]` table AND any of its subtables
|
|
14
|
+
* (`[mcp_servers.<name>.env]`, `.headers`, …) with their bodies — whatever the
|
|
15
|
+
* transport form. A block runs from its header until the next table header or
|
|
16
|
+
* end of file. Returns the rewritten content and whether anything was removed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function removeCodexServerBlock(content: string, name: string): {
|
|
19
|
+
content: string;
|
|
20
|
+
removed: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Ensure exactly one stdio `[mcp_servers.<name>]` block exists, pointing at
|
|
24
|
+
* `mcpCmd`. Any pre-existing block (in any transport form) is replaced, so the
|
|
25
|
+
* install is authoritative and idempotent rather than a silent no-op.
|
|
26
|
+
*/
|
|
27
|
+
export declare function upsertCodexStdioBlock(content: string, name: string, mcpCmd: string): string;
|
|
28
|
+
//# sourceMappingURL=mcp-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../../src/cli/mcp-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACX;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CA4BvC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,MAAM,CAKR"}
|
package/dist/index.js
CHANGED
package/dist/mcp/index.js
CHANGED
package/dist/server/index.js
CHANGED
package/dist/storage.js
CHANGED
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.2.
|
|
1
|
+
export declare const VERSION = "0.2.7";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED