@commonlyai/cli 0.1.355 → 0.1.356
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/package.json +1 -1
- package/src/lib/adapters/dsh.js +13 -3
package/package.json
CHANGED
package/src/lib/adapters/dsh.js
CHANGED
|
@@ -62,6 +62,8 @@ export const DSH_PUBLIC_GUARD_SERVICE = 'commonlyPublicGuard';
|
|
|
62
62
|
/** A public turn's working directory, emptied before each turn, under the seat home. */
|
|
63
63
|
export const PUBLIC_TURN_DIR = 'public-turn';
|
|
64
64
|
const PUBLIC_GUARD_SOURCE = new URL('./dsh-public-guard.mjs', import.meta.url);
|
|
65
|
+
// @commonlyai/mcp's WITHHELD_TOOLS_ENV (commonly-mcp/src/server.js); a test holds the two equal.
|
|
66
|
+
export const WITHHELD_TOOLS_MCP_ENV = 'COMMONLY_MCP_WITHHELD_TOOLS';
|
|
65
67
|
// The one thing a public seat's home keeps between turns (a symlink is not kept).
|
|
66
68
|
const PUBLIC_HOME_KEPT = 'sessions';
|
|
67
69
|
|
|
@@ -230,9 +232,16 @@ export const resolveCommonlyMcp = (declared, ctx) => {
|
|
|
230
232
|
const values = { credentialFile: ctx.credentialFile, instanceUrl: ctx.instanceUrl };
|
|
231
233
|
const env = Object.fromEntries(Object.entries(delivery.env)
|
|
232
234
|
.map(([name, value]) => [name, substitute(value, values)]));
|
|
233
|
-
// A public seat's MCP always carries the public-seat flag, whatever was declared
|
|
234
|
-
|
|
235
|
-
|
|
235
|
+
// A public seat's MCP always carries the public-seat flag, whatever was declared,
|
|
236
|
+
// and the tools it must keep off the list (F468): dsh can't filter one server's
|
|
237
|
+
// tools, so the server does. The guard still refuses them at the call, which also
|
|
238
|
+
// covers a warmed MCP build too old to read the list.
|
|
239
|
+
if (ctx.publicSeat) {
|
|
240
|
+
env[PUBLIC_SEAT_MCP_ENV] = '1';
|
|
241
|
+
env[WITHHELD_TOOLS_MCP_ENV] = [...(ctx.withheldTools || [])].join(',');
|
|
242
|
+
}
|
|
243
|
+
const allowed = ['COMMONLY_API_URL', 'COMMONLY_TOKEN_FILE',
|
|
244
|
+
...(ctx.publicSeat ? [PUBLIC_SEAT_MCP_ENV, WITHHELD_TOOLS_MCP_ENV] : [])];
|
|
236
245
|
if (Object.keys(env).some((name) => !allowed.includes(name))
|
|
237
246
|
|| env.COMMONLY_TOKEN_FILE !== ctx.credentialFile || env.COMMONLY_API_URL !== ctx.instanceUrl) {
|
|
238
247
|
throw new Error('dsh adapter: Commonly MCP must use this spawn\'s credential file');
|
|
@@ -496,6 +505,7 @@ export default {
|
|
|
496
505
|
}
|
|
497
506
|
const mcp = resolveCommonlyMcp(ctx.environment?.mcp, {
|
|
498
507
|
publicSeat: isPublic,
|
|
508
|
+
withheldTools: publicSeat?.withheld,
|
|
499
509
|
credentialFile: credential.path,
|
|
500
510
|
instanceUrl: confined ? relay.url : ctx.instanceUrl,
|
|
501
511
|
...(confined ? {
|