agent-lyceum 0.48.0 → 0.49.1

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.
@@ -30,6 +30,9 @@ export function buildClaudeSettings(project, agent, override) {
30
30
  allow.push("WebSearch");
31
31
  if (agent.allowWeb === "fetch")
32
32
  allow.push("WebFetch");
33
+ // MCP tools are opt-in by exact name: in dontAsk mode a connected server's tools are denied unless listed here.
34
+ if (agent.allowMcp)
35
+ allow.push(...agent.allowMcp);
33
36
  allow.push(rule("Edit", `${repo}/**`));
34
37
  for (const d of pol.allowDirs)
35
38
  allow.push(rule("Edit", `${d}/**`));
package/dist/config.d.ts CHANGED
@@ -28,6 +28,8 @@ export interface ResolvedAgent {
28
28
  canAskUser: boolean;
29
29
  /** Web access for this agent; undefined = not configured, so the runtime keeps its own default. */
30
30
  allowWeb?: WebLevel;
31
+ /** Exact MCP tool names added to the Claude Code allow list (agents run in dontAsk mode, so an unlisted MCP tool is denied). Unset = none. */
32
+ allowMcp?: string[];
31
33
  /** Spec 25 allowances; unset when none is requested (the only switch that keeps output identical). Paths are absolute, `~` expanded, not yet canonical. */
32
34
  sandbox?: SandboxAllowances;
33
35
  /** Ordered failover chain (runtime and model filled in); empty = no fallback. */
@@ -124,6 +126,7 @@ export declare function loadGlobal(home: string): {
124
126
  can_edit_agent_md?: boolean | undefined;
125
127
  can_ask_user?: boolean | undefined;
126
128
  allow_web?: "fetch" | "none" | "search" | undefined;
129
+ allow_mcp?: string[] | undefined;
127
130
  fallback?: {
128
131
  runtime?: "claude-code" | "codex" | "cursor" | undefined;
129
132
  model?: string | undefined;
@@ -191,6 +194,7 @@ export declare function loadProjectRaw(home: string, name: string): {
191
194
  can_edit_agent_md?: boolean | undefined;
192
195
  can_ask_user?: boolean | undefined;
193
196
  allow_web?: "fetch" | "none" | "search" | undefined;
197
+ allow_mcp?: string[] | undefined;
194
198
  fallback?: {
195
199
  runtime?: "claude-code" | "codex" | "cursor" | undefined;
196
200
  model?: string | undefined;
package/dist/config.js CHANGED
@@ -168,6 +168,7 @@ export function resolveProjectFrom(home, name, g, p) {
168
168
  const canEdit = pick("can_edit_agent_md");
169
169
  const canAsk = pick("can_ask_user");
170
170
  const allowWeb = pick("allow_web");
171
+ const allowMcp = pick("allow_mcp");
171
172
  const sandbox = resolveSandbox(agentName, pick("sandbox"));
172
173
  const shipRaw = pick("ship");
173
174
  const ship = shipRaw === true
@@ -180,6 +181,8 @@ export function resolveProjectFrom(home, name, g, p) {
180
181
  : undefined;
181
182
  if (!ship)
182
183
  delete sources.ship;
184
+ if (!allowMcp?.length)
185
+ delete sources.allow_mcp; // an empty list is "off": keep sources ⊆ values
183
186
  // `ship: false` is explicit off (same as unset for resolution): `pick` recorded a source but no
184
187
  // `ship` value is flattened, so drop it to keep "sources ⊆ values". Do not invent a `sources.ship`
185
188
  // default when unset: doctor --resolved fixtures and "sources ⊆ values" assume absent optional keys stay absent.
@@ -204,6 +207,7 @@ export function resolveProjectFrom(home, name, g, p) {
204
207
  canEditAgentMd: canEdit ?? isLead,
205
208
  canAskUser: canAsk ?? isLead,
206
209
  allowWeb,
210
+ ...(allowMcp?.length ? { allowMcp } : {}),
207
211
  ...(sandbox ? { sandbox } : {}),
208
212
  ...(ship ? { ship } : {}),
209
213
  fallback,
@@ -298,7 +302,7 @@ export function findProjectForCwd(home, cwd) {
298
302
  }
299
303
  return best?.name;
300
304
  }
301
- const AGENT_FIELDS = ["runtime", "model", "effort", "agent_md", "memory.global", "memory.project", "resume", "can_message", "can_edit_agent_md", "can_ask_user", "allow_web", "fallback", "sandbox", "ship"];
305
+ const AGENT_FIELDS = ["runtime", "model", "effort", "agent_md", "memory.global", "memory.project", "resume", "can_message", "can_edit_agent_md", "can_ask_user", "allow_web", "allow_mcp", "fallback", "sandbox", "ship"];
302
306
  /** Claude pattern metacharacters and control characters: refused in sandbox paths instead of escaped (spec 25.4.1). */
303
307
  const PATH_CHARS = /[*?[\]{}()!\\]/;
304
308
  const PATH_META = { test: (p) => PATH_CHARS.test(p) || [...p].some((c) => c.charCodeAt(0) < 32 || c.charCodeAt(0) === 127) };
@@ -415,6 +419,8 @@ export function flattenResolved(project) {
415
419
  v[`${p}.can_edit_agent_md`] = a.canEditAgentMd;
416
420
  v[`${p}.can_ask_user`] = a.canAskUser;
417
421
  v[`${p}.allow_web`] = a.allowWeb;
422
+ if (a.allowMcp)
423
+ v[`${p}.allow_mcp`] = a.allowMcp;
418
424
  if (a.ship)
419
425
  v[`${p}.ship`] = a.ship;
420
426
  if (a.fallback.length)
package/dist/schema.d.ts CHANGED
@@ -82,6 +82,7 @@ export declare const AgentPartial: z.ZodObject<{
82
82
  none: "none";
83
83
  search: "search";
84
84
  }>>;
85
+ allow_mcp: z.ZodOptional<z.ZodArray<z.ZodString>>;
85
86
  fallback: z.ZodOptional<z.ZodArray<z.ZodObject<{
86
87
  runtime: z.ZodOptional<z.ZodEnum<{
87
88
  "claude-code": "claude-code";
@@ -185,6 +186,7 @@ export declare const GlobalConfig: z.ZodObject<{
185
186
  none: "none";
186
187
  search: "search";
187
188
  }>>;
189
+ allow_mcp: z.ZodOptional<z.ZodArray<z.ZodString>>;
188
190
  fallback: z.ZodOptional<z.ZodArray<z.ZodObject<{
189
191
  runtime: z.ZodOptional<z.ZodEnum<{
190
192
  "claude-code": "claude-code";
@@ -315,6 +317,7 @@ export declare const ProjectConfig: z.ZodObject<{
315
317
  none: "none";
316
318
  search: "search";
317
319
  }>>;
320
+ allow_mcp: z.ZodOptional<z.ZodArray<z.ZodString>>;
318
321
  fallback: z.ZodOptional<z.ZodArray<z.ZodObject<{
319
322
  runtime: z.ZodOptional<z.ZodEnum<{
320
323
  "claude-code": "claude-code";
package/dist/schema.js CHANGED
@@ -76,6 +76,8 @@ export const AgentPartial = z
76
76
  can_edit_agent_md: z.boolean().optional(),
77
77
  can_ask_user: z.boolean().optional(),
78
78
  allow_web: z.enum(WEB_LEVELS).optional(),
79
+ /** Exact MCP tool names (`mcp__<server>__<tool>`) the agent may call without a prompt (Claude Code only). No wildcards, so write tools stay out unless named. */
80
+ allow_mcp: z.array(z.string().regex(/^mcp__[\w.-]+__[\w.-]+$/, "must be an exact MCP tool name like mcp__<server>__<tool> (no wildcards)")).optional(),
79
81
  fallback: z.array(FallbackEntryPartial).optional(),
80
82
  sandbox: SandboxPartial.optional(),
81
83
  /** Opt-in: wake writes a ship session and documents the `agent-lyceum ship` CLI (Claude Code and Codex). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-lyceum",
3
- "version": "0.48.0",
3
+ "version": "0.49.1",
4
4
  "description": "Config + dispatcher for teams of Claude Code / Codex agents with scoped context and file-based mailboxes",
5
5
  "keywords": [
6
6
  "ai",