@skill-map/cli 0.65.0 → 0.66.0

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.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // cli/entry.ts
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="62413e88-87c9-5ddc-a41c-f64bac9cdf2f")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4ec5542f-63ef-5e2c-ab32-58a6c8be5dec")}catch(e){}}();
4
4
  import { existsSync as existsSync34 } from "fs";
5
5
  import { Builtins, Cli as Cli2 } from "clipanion";
6
6
 
@@ -250,7 +250,7 @@ function bucketByKind(kind, instance, bag) {
250
250
  // package.json
251
251
  var package_default = {
252
252
  name: "@skill-map/cli",
253
- version: "0.65.0",
253
+ version: "0.66.0",
254
254
  description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
255
255
  license: "MIT",
256
256
  type: "module",
@@ -466,6 +466,19 @@ var skill_base_schema_default = {
466
466
  type: "string",
467
467
  enum: ["bash", "powershell"],
468
468
  description: "Shell flavor for any embedded shell snippets. Default: `bash`."
469
+ },
470
+ license: {
471
+ type: "string",
472
+ description: "License applied to the skill: a license name (e.g. `Apache-2.0`) or a reference to a bundled license file. Inherited from the Agent Skills open standard that Claude Code follows. Source: https://agentskills.io/specification."
473
+ },
474
+ compatibility: {
475
+ type: "string",
476
+ description: "Environment requirements (intended product, required system packages, network access, etc.). Open-standard field; Claude Code does not consume it but the format permits it. Source: https://agentskills.io/specification."
477
+ },
478
+ metadata: {
479
+ type: "object",
480
+ additionalProperties: { type: "string" },
481
+ description: "Arbitrary string-keyed, string-valued map for metadata not covered by the standard. This is the canonical home of `version` and `author` (there is NO top-level `version` field). Source: https://agentskills.io/specification."
469
482
  }
470
483
  }
471
484
  };
@@ -481,6 +494,7 @@ var agent_schema_default = {
481
494
  ],
482
495
  type: "object",
483
496
  additionalProperties: true,
497
+ required: ["name", "description"],
484
498
  properties: {
485
499
  tools: {
486
500
  type: "array",
@@ -494,7 +508,7 @@ var agent_schema_default = {
494
508
  },
495
509
  model: {
496
510
  type: "string",
497
- description: "Model alias (`sonnet`, `opus`, `haiku`), full Claude id (e.g. `claude-3-7-sonnet-latest`), or the literal `inherit` to defer to the parent session's model."
511
+ description: "Model alias (`sonnet`, `opus`, `haiku`, `fable`), a full Claude id (e.g. `claude-opus-4-8`, `claude-sonnet-4-6`), or the literal `inherit` to defer to the parent session's model."
498
512
  },
499
513
  permissionMode: {
500
514
  type: "string",
@@ -513,8 +527,8 @@ var agent_schema_default = {
513
527
  },
514
528
  mcpServers: {
515
529
  type: "array",
516
- description: "MCP servers this agent connects to at startup. Shape is platform-defined; preserved as opaque objects.",
517
- items: { type: "object" }
530
+ description: "MCP servers this agent connects to at startup. Each item is either a bare server name referencing an already-configured server (e.g. `github`) or an inline definition object keyed by server name. Shape is platform-defined; preserved opaque.",
531
+ items: { type: ["string", "object"] }
518
532
  },
519
533
  hooks: {
520
534
  type: "object",
@@ -568,7 +582,7 @@ var command_schema_default = {
568
582
  // plugins/ids.ts
569
583
  var CORE_PLUGIN_ID = "core";
570
584
  var CLAUDE_PLUGIN_ID = "claude";
571
- var OPENAI_PLUGIN_ID = "openai";
585
+ var OPENAI_PLUGIN_ID = "codex";
572
586
  var ANTIGRAVITY_PLUGIN_ID = "antigravity";
573
587
  var AGENT_SKILLS_PLUGIN_ID = "agent-skills";
574
588
 
@@ -618,7 +632,7 @@ var claudeProvider = {
618
632
  // variant lifts luminosity for dark mode. Verbatim from the previous
619
633
  // static UI catalog (`ui/src/services/provider-ui.ts`).
620
634
  presentation: {
621
- label: "Claude",
635
+ label: "Anthropic's Claude",
622
636
  color: "#cc785c",
623
637
  colorDark: "#e89270"
624
638
  },
@@ -900,7 +914,13 @@ var atDirectiveExtractor = {
900
914
  kind: "extractor",
901
915
  description: "Detects `@<token>` directives in a node's body using Claude Code rules, choosing the link kind by token shape. Example: a bare handle `@team` becomes a `mentions` link, while a file-flavoured token `@docs/api.md` becomes a `references` link.",
902
916
  scope: "body",
903
- precondition: { provider: ["claude"] },
917
+ // Authorised under the claude AND codex lenses: OpenAI Codex sub-agents
918
+ // reference each other with the same `@<name>` mention grammar, and their
919
+ // prompt (the TOML `developer_instructions` body, fed in via the codex
920
+ // provider's `read.bodyField`) carries the same `@` tokens. The gate is the active
921
+ // lens, not the node's provider, so under `codex` this parses `@` across
922
+ // the project's markdown surface just as it does under `claude`.
923
+ precondition: { provider: ["claude", "codex"] },
904
924
  // eslint-disable-next-line complexity
905
925
  extract(ctx) {
906
926
  const seenMentions = /* @__PURE__ */ new Set();
@@ -988,7 +1008,12 @@ var slashCommandExtractor = {
988
1008
  kind: "extractor",
989
1009
  description: "Turns `/command` invocations in a node's body into arrows that point at the resolved slash command or skill, using Claude Code routing rules. Example: `/deploy` in the body draws an arrow to the `deploy` command.",
990
1010
  scope: "body",
991
- precondition: { provider: ["claude"] },
1011
+ // Also authorised under the codex lens so a Codex agent's prompt body
1012
+ // (the TOML `developer_instructions` field) has its `/command` tokens parsed for
1013
+ // pipeline parity with the claude body. codex declares no `invokes`
1014
+ // resolution today, so these signals stay unresolved (no spurious edges)
1015
+ // until Codex slash commands land in Phase 6b.
1016
+ precondition: { provider: ["claude", "codex"] },
992
1017
  extract(ctx) {
993
1018
  const seen = /* @__PURE__ */ new Set();
994
1019
  const body = stripCodeAndHtml(ctx.body);
@@ -1073,12 +1098,13 @@ var skill_schema_default2 = {
1073
1098
  $schema: "https://json-schema.org/draft/2020-12/schema",
1074
1099
  $id: "https://skill-map.ai/providers/agent-skills/v1/frontmatter/skill.schema.json",
1075
1100
  title: "FrontmatterAgentSkillsSkill",
1076
- description: "Frontmatter shape for nodes classified as `skill` by the neutral `agent-skills` Provider, Agent Skills delivered as `SKILL.md` files at the open-standard path `.agents/skills/<name>/SKILL.md`. Jointly adopted by Anthropic, OpenAI (Codex), and Google (Gemini); the path is vendor-neutral so no single Provider should own it. Required fields are `name` and `description` (from spec base). The standard's optional frontmatter fields are declared below, mirrored verbatim from https://agentskills.io/specification: `license`, `compatibility`, `metadata`, and the experimental `allowed-tools`. `additionalProperties: true` so any future standard field flows through unchanged until this schema catches up.",
1101
+ description: "Frontmatter shape for nodes classified as `skill` by the neutral `agent-skills` Provider, Agent Skills delivered as `SKILL.md` files at the open-standard path `.agents/skills/<name>/SKILL.md`. Jointly adopted by Anthropic, OpenAI (Codex), and Google (Gemini); the path is vendor-neutral so no single Provider should own it. Required fields are `name` and `description` (defined on the spec base, declared `required` here, the open standard mandates both). The standard's optional frontmatter fields are declared below, mirrored verbatim from https://agentskills.io/specification: `license`, `compatibility`, `metadata`, and the experimental `allowed-tools`. `additionalProperties: true` so any future standard field flows through unchanged until this schema catches up.",
1077
1102
  allOf: [
1078
1103
  { $ref: "https://skill-map.ai/spec/v0/frontmatter/base.schema.json" }
1079
1104
  ],
1080
1105
  type: "object",
1081
1106
  additionalProperties: true,
1107
+ required: ["name", "description"],
1082
1108
  properties: {
1083
1109
  name: {
1084
1110
  type: "string",
@@ -1167,9 +1193,14 @@ var agentSkillsProvider = {
1167
1193
  // and the per-node provider chip. Neutral slate (this is the
1168
1194
  // vendor-agnostic open-standard Provider, not a brand). The reusable
1169
1195
  // open-standard pieces it owns use a `COMMONS_*` vocabulary internally;
1170
- // the user-facing label stays the descriptive "Open Skills".
1196
+ // the user-facing label is the descriptive "Standard: Agent skills" (the
1197
+ // `Standard:` prefix marks it as the vendor-neutral lens, distinct from
1198
+ // the possessive `<Vendor>'s <product>` form the brand lenses use). This
1199
+ // is the single open lens shown in the selector when no vendor is active; the
1200
+ // non-gated `core/markdown` base sits underneath it and is never offered
1201
+ // as a lens of its own.
1171
1202
  presentation: {
1172
- label: "Open Skills",
1203
+ label: "Standard: Agent skills",
1173
1204
  color: "#64748b",
1174
1205
  colorDark: "#94a3b8"
1175
1206
  },
@@ -1178,11 +1209,12 @@ var agentSkillsProvider = {
1178
1209
  // (including `markdown`) it falls through to `core/markdown`, the sole
1179
1210
  // universal provider. Keeps the "one active lens" model honest.
1180
1211
  gatedByActiveLens: true,
1181
- // Not yet ready for end users: ships disabled by default. The operator
1182
- // opts in via `sm plugins enable` / the Settings toggle / the tutorial's
1183
- // `--experimental` flow, so it neither classifies nor auto-detects until
1184
- // enabled.
1185
- stability: "experimental",
1212
+ // The open-standard lens is the universal default: stable and locked
1213
+ // enabled (`agent-skills/agent-skills` in the host lock-list), so it is
1214
+ // the lens a project falls back to when no vendor marker is present, and
1215
+ // it cannot be disabled out from under that role. Auto-detects `.agents/`
1216
+ // and classifies skills under its own lens.
1217
+ stability: "stable",
1186
1218
  // Auto-detect marker: a `.agents/` directory marks an open-standard
1187
1219
  // project. This is also the marker a Google/Antigravity project carries
1188
1220
  // (Antigravity adopted the open standard). The marker only produces an
@@ -1195,7 +1227,7 @@ var agentSkillsProvider = {
1195
1227
  // OpenAI Codex (skills mirror the open standard), so `aka` surfaces both
1196
1228
  // names in the destination prompt to orient testers on those agents.
1197
1229
  // `aka` is display-only, `--for` still matches the `agent-skills` id.
1198
- scaffold: { skillDir: ".agents/skills", aka: ["Antigravity", "OpenAI Codex"] },
1230
+ scaffold: { skillDir: ".agents/skills", aka: ["Google's Antigravity", "OpenAI's Codex"] },
1199
1231
  read: COMMONS_READ,
1200
1232
  kinds: COMMONS_KINDS,
1201
1233
  resolution: COMMONS_RESOLUTION,
@@ -1216,7 +1248,7 @@ var antigravityProvider = {
1216
1248
  // and the per-node provider chip. Antigravity violet, distinct from the
1217
1249
  // other vendor palettes.
1218
1250
  presentation: {
1219
- label: "Antigravity",
1251
+ label: "Google's Antigravity",
1220
1252
  color: "#7c3aed",
1221
1253
  colorDark: "#a78bfa"
1222
1254
  },
@@ -1309,86 +1341,126 @@ var antigravityProvider = {
1309
1341
  }
1310
1342
  };
1311
1343
 
1312
- // plugins/openai/providers/openai/schemas/agent.schema.json
1344
+ // plugins/codex/providers/codex/schemas/agent.schema.json
1313
1345
  var agent_schema_default2 = {
1314
1346
  $schema: "https://json-schema.org/draft/2020-12/schema",
1315
- $id: "https://skill-map.ai/providers/openai/v1/frontmatter/agent.schema.json",
1347
+ $id: "https://skill-map.ai/providers/codex/v1/frontmatter/agent.schema.json",
1316
1348
  title: "FrontmatterCodexAgent",
1317
- description: "Frontmatter shape for nodes classified as `agent` by the OpenAI Codex Provider. Codex sub-agents live as TOML files under `.codex/agents/<name>.toml`; the entire file IS the agent definition (no markdown body). The TOML parser feeds the parsed root object into `frontmatter`, so this schema validates the same shape skill-map's other providers carry on per-kind frontmatter. Mirrors Codex's documented sub-agent fields (https://github.com/openai/codex) with `additionalProperties: true` so future additions flow through unchanged.",
1349
+ description: "Frontmatter shape for nodes classified as `agent` by the OpenAI Codex Provider. Codex sub-agents live as standalone TOML files under `.codex/agents/<name>.toml`; the entire file IS the agent definition (no markdown body, the prompt is the `developer_instructions` field). The TOML parser feeds the parsed root object into `frontmatter`, so this schema validates the same shape skill-map's other providers carry on per-kind frontmatter. Field set mirrors the documented Codex custom-agent contract (https://developers.codex.com/codex/subagents); `additionalProperties: true` lets any other inherited `config.toml` key flow through unchanged.",
1318
1350
  allOf: [
1319
1351
  { $ref: "https://skill-map.ai/spec/v0/frontmatter/base.schema.json" }
1320
1352
  ],
1321
1353
  type: "object",
1322
1354
  additionalProperties: true,
1355
+ required: ["name", "description", "developer_instructions"],
1323
1356
  properties: {
1324
1357
  name: {
1325
1358
  type: "string",
1326
1359
  minLength: 1,
1327
- description: "Sub-agent identifier. Conventionally matches the filename stem."
1360
+ description: "Sub-agent identifier used when spawning the agent. Conventionally matches the filename stem."
1328
1361
  },
1329
1362
  description: {
1330
1363
  type: "string",
1331
1364
  description: "Short description of when this sub-agent applies. Codex surfaces this in the agent picker; skill-map mirrors it in the card."
1332
1365
  },
1366
+ developer_instructions: {
1367
+ type: "string",
1368
+ description: "The sub-agent's core behavioural prompt (TOML triple-quoted string), the Codex equivalent of a system prompt. Required: the Codex CLI refuses to load an agent role file that omits it, so skill-map flags the same gap as a schema violation. Fed through the body pipeline via the provider's `read.bodyField`, so the markdown links / mentions it carries become graph edges."
1369
+ },
1333
1370
  model: {
1334
1371
  type: "string",
1335
- description: "Model identifier (`gpt-4o`, `o3-mini`, etc.) the sub-agent runs against."
1372
+ description: "Model identifier (`gpt-5-codex`, `gpt-5.4`, ...) the sub-agent runs against. Inherits the parent's model when omitted."
1336
1373
  },
1337
- instructions: {
1374
+ model_reasoning_effort: {
1338
1375
  type: "string",
1339
- description: "Multi-line prompt body (TOML triple-quoted string)."
1376
+ enum: ["minimal", "low", "medium", "high", "xhigh"],
1377
+ description: "Reasoning effort the sub-agent runs at (`xhigh` is model-dependent). Inherits the parent's setting when omitted."
1340
1378
  },
1341
- tools: {
1342
- type: "array",
1343
- items: { type: "string" },
1344
- description: "Tool ids this sub-agent is allowed to call."
1379
+ sandbox_mode: {
1380
+ type: "string",
1381
+ enum: ["read-only", "workspace-write", "danger-full-access"],
1382
+ description: "Codex sandbox mode the sub-agent runs under. Inherits the parent's policy when omitted."
1345
1383
  },
1346
- mcp_servers: {
1384
+ nickname_candidates: {
1347
1385
  type: "array",
1348
1386
  items: { type: "string" },
1349
- description: "MCP server ids attached to this sub-agent (`tools: [mcp__<server>__*]` follows the same pattern as Claude)."
1387
+ description: "Pool of display names Codex draws from when spawning instances of this sub-agent."
1350
1388
  },
1351
- approval_policy: {
1352
- type: "string",
1353
- enum: ["never", "on-request", "untrusted"],
1354
- description: "Codex approval policy for this sub-agent's destructive operations."
1389
+ mcp_servers: {
1390
+ type: "object",
1391
+ additionalProperties: { type: "object" },
1392
+ description: "Agent-specific MCP server bindings: a TOML table keyed by server name (`[mcp_servers.<name>]`), each value a server config (`command` + `args`, or `url`). This is NOT the Claude `tools: [mcp__<server>__*]` array convention, which is claude-only."
1355
1393
  },
1356
- sandbox_mode: {
1357
- type: "string",
1358
- enum: ["read-only", "workspace-write", "danger-full-access"],
1359
- description: "Codex sandbox mode the sub-agent runs under."
1394
+ skills: {
1395
+ type: "object",
1396
+ additionalProperties: true,
1397
+ description: "Skill overrides for this sub-agent. The `config` array (`[[skills.config]]` in TOML) lists skills by path with an enabled flag.",
1398
+ properties: {
1399
+ config: {
1400
+ type: "array",
1401
+ items: {
1402
+ type: "object",
1403
+ additionalProperties: true,
1404
+ properties: {
1405
+ path: { type: "string", description: "Path to the skill's SKILL.md." },
1406
+ enabled: { type: "boolean", description: "Whether the skill is active for this sub-agent." }
1407
+ }
1408
+ }
1409
+ }
1410
+ }
1360
1411
  }
1361
1412
  }
1362
1413
  };
1363
1414
 
1364
- // plugins/openai/providers/openai/index.ts
1365
- var openaiProvider = {
1366
- id: "openai",
1415
+ // plugins/codex/providers/codex/index.ts
1416
+ var codexProvider = {
1417
+ id: "codex",
1367
1418
  pluginId: OPENAI_PLUGIN_ID,
1368
1419
  kind: "provider",
1369
- description: "Classifies files under `.codex/agents/*.toml` as OpenAI Codex CLI sub-agents.",
1420
+ description: "Classifies `.codex/agents/*.toml` as OpenAI Codex CLI sub-agents and `.agents/skills/*/SKILL.md` as Codex skills (open standard).",
1370
1421
  // Provider identity for the active-lens dropdown, the topbar lens chip,
1371
1422
  // and the per-node provider chip. Codex green, distinct from the Claude
1372
1423
  // palette so the chip reads at a glance.
1373
1424
  presentation: {
1374
- label: "OpenAI Codex",
1425
+ label: "OpenAI's Codex",
1375
1426
  color: "#22c55e",
1376
1427
  colorDark: "#4ade80"
1377
1428
  },
1378
- // Auto-detect markers: a `.codex/` directory or a root `AGENTS.md` marks
1379
- // a Codex CLI project. Provider-owned (replaces the old central
1380
- // detection table in `src/core/config/active-provider.ts`).
1381
- detect: { markers: [".codex", "AGENTS.md"] },
1382
- // Vendor provider: Codex CLI only reads its own `.codex/` territory.
1383
- // Gating the classifier behind the active lens keeps the walker from
1384
- // claiming Codex agents under a `claude` (or any other) lens, where
1385
- // the Codex runtime would never resolve them anyway.
1429
+ // Auto-detect marker: a `.codex/` directory marks a Codex CLI project.
1430
+ // `AGENTS.md` is intentionally NOT a marker: it is the open agents.md
1431
+ // standard (present in many non-Codex repos, and commonly alongside a
1432
+ // `.claude/` directory), so keying auto-detect off it would mis-route a
1433
+ // plain-markdown repo to the Codex lens and force an ambiguous prompt on
1434
+ // any project that carries both. `.agents/` is likewise NOT a marker: it
1435
+ // is the vendor-neutral open standard (owned by `agent-skills` for
1436
+ // auto-detect), so a project that only carries `.agents/skills/` is an
1437
+ // open-standard project, not necessarily a Codex one. A genuine Codex
1438
+ // project is identified by `.codex/`.
1439
+ detect: { markers: [".codex"] },
1440
+ // Vendor provider: Codex CLI only reads its own territory (its `.codex/`
1441
+ // agents plus the open `.agents/skills/` skills it adopted). Gating the
1442
+ // classifier behind the active lens keeps the walker from claiming Codex
1443
+ // agents under a `claude` (or any other) lens, where the Codex runtime
1444
+ // would never resolve them anyway.
1386
1445
  gatedByActiveLens: true,
1387
- // Not yet ready for end users: ships disabled by default (the operator
1388
- // opts in via `sm plugins enable` / Settings / the tutorial's
1389
- // `--experimental` flow). Replaces the retired `comingSoon` flag.
1390
- stability: "experimental",
1391
- read: { extensions: [".toml"], parser: "toml" },
1446
+ // Beta: ships enabled by default (auto-detects `.codex/`, selectable as
1447
+ // the active lens) with a maturity badge, since the Codex body extractor
1448
+ // is freshly landed. Promote to `stable` (drop the field) once it has
1449
+ // real-world mileage.
1450
+ stability: "beta",
1451
+ // Multi-rule read: `.toml` sub-agents and `.md` open-standard skills,
1452
+ // each with its own parser. `resolveProviderWalk` runs one walk pass per
1453
+ // rule; the extensions are disjoint.
1454
+ // 1. Codex sub-agents are pure TOML (`parser: 'toml'`); the markdown
1455
+ // prompt is the triple-quoted `developer_instructions` field, fed
1456
+ // to the body pipeline via `bodyField` so the universal body
1457
+ // extractors plus the lens-gated at-directive / slash run over it.
1458
+ // 2. Skills reuse the open-standard `agent-skills` read config
1459
+ // (`COMMONS_READ`: `.md` + `frontmatter-yaml`).
1460
+ read: [
1461
+ { extensions: [".toml"], parser: "toml", bodyField: "developer_instructions" },
1462
+ COMMONS_READ
1463
+ ],
1392
1464
  kinds: {
1393
1465
  agent: {
1394
1466
  schema: "./schemas/agent.schema.json",
@@ -1405,18 +1477,30 @@ var openaiProvider = {
1405
1477
  // the TOML structured frontmatter when the author declared it
1406
1478
  // explicitly.
1407
1479
  identifiers: ["frontmatter.name", "filename-basename"]
1408
- }
1480
+ },
1481
+ // Open-standard `skill` kind, inherited from `agent-skills` by manifest
1482
+ // composition (same schema + UI every standard adopter shares).
1483
+ // `.agents/skills/<name>/SKILL.md` resolves by dirname or
1484
+ // `frontmatter.name`.
1485
+ ...COMMONS_KINDS
1409
1486
  },
1410
- // Codex's invocation surface is mention-style today (`@<name>`); slash
1411
- // invocation and skill nodes land in Phase 6b. Empty `invokes` keeps
1412
- // the contract narrow until skills arrive.
1487
+ // Mentions resolve to agents (`@<name>`, the Codex sub-agent handle).
1488
+ // Slash invocations resolve to skills (`invokes: ['skill']`, inherited
1489
+ // from the open standard), so a `/skill-name` in an agent's prompt links
1490
+ // to its `.agents/skills/` skill.
1413
1491
  resolution: {
1414
- mentions: ["agent"]
1492
+ mentions: ["agent"],
1493
+ ...COMMONS_RESOLUTION
1415
1494
  },
1495
+ // Open-standard reserved-name base (the universal cross-agent slash
1496
+ // verbs an agent CLI ships built-in), inherited from `agent-skills` and
1497
+ // applied under the codex lens via SELF scope: a user skill that shadows
1498
+ // one is flagged by `core/name-reserved`.
1499
+ reservedNames: COMMONS_RESERVED_NAMES,
1416
1500
  classify(path) {
1417
1501
  const lower = path.toLowerCase();
1418
1502
  if (lower.startsWith(".codex/agents/") && lower.endsWith(".toml")) return "agent";
1419
- return null;
1503
+ return classifyCommonsPath(path);
1420
1504
  }
1421
1505
  };
1422
1506
 
@@ -1442,17 +1526,23 @@ var coreMarkdownProvider = {
1442
1526
  // Provider identity. `hideChip: true` suppresses the per-card provider
1443
1527
  // chip: this fallback carries the majority of nodes in any project, so
1444
1528
  // badging every generic `.md` would be noise and dilute the chip's
1445
- // purpose (signalling a NON-default platform). The Provider still shows
1446
- // in the active-lens dropdown and the topbar lens chip with this label.
1529
+ // purpose (signalling a NON-default platform). This Provider is the
1530
+ // non-gated universal BASE, not a lens: `gatedByActiveLens` is false, so
1531
+ // the BFF projects `isLens: false` and the UI never lists it in the
1532
+ // active-lens dropdown nor as the topbar lens chip. The label is retained
1533
+ // only for internal registry lookups (and any legacy node still tagged
1534
+ // `provider: 'markdown'`).
1447
1535
  presentation: {
1448
1536
  label: "Markdown",
1449
1537
  color: "#9ca3af",
1450
1538
  colorDark: "#6b7280",
1451
1539
  hideChip: true
1452
1540
  },
1453
- // No `detect` block: the universal fallback is never auto-suggested as a
1454
- // lens (selecting it would gate out every vendor Provider). Operators
1455
- // pick it manually if they want an open-standard-only view.
1541
+ // No `detect` block: the universal base is never auto-suggested, and
1542
+ // since it is non-gated (`gatedByActiveLens` omitted == false) it is not
1543
+ // a selectable lens at all. A no-vendor project resolves to the
1544
+ // open-standard `agent-skills` default lens; this base runs underneath
1545
+ // every lens regardless.
1456
1546
  read: { extensions: [".md"], parser: "frontmatter-yaml" },
1457
1547
  // Per spec § A.6, defaultRefreshAction values MUST be qualified
1458
1548
  // action ids. The summarize-markdown action is not yet implemented
@@ -3253,13 +3343,6 @@ function existsSyncSafe(path) {
3253
3343
  }
3254
3344
  }
3255
3345
 
3256
- // kernel/orchestrator/frontmatter-issue-ids.ts
3257
- var FRONTMATTER_ISSUE_ANALYZERS = /* @__PURE__ */ new Set([
3258
- "frontmatter-invalid",
3259
- "frontmatter-malformed",
3260
- "frontmatter-parse-error"
3261
- ]);
3262
-
3263
3346
  // plugins/core/analyzers/schema-violation/text.ts
3264
3347
  var SCHEMA_VIOLATION_TEXTS = {
3265
3348
  // Diagnosis bodies (`<what>; <why>`). The shared `formatFinding` helper
@@ -3270,8 +3353,6 @@ var SCHEMA_VIOLATION_TEXTS = {
3270
3353
  nodeFailure: "Schema validation failed; {{errors}}",
3271
3354
  /** `<target>` subject + `Link failed schema validation; <errors>` */
3272
3355
  linkFailure: "Link failed schema validation; {{errors}}",
3273
- /** `Missing required frontmatter; <missing>` */
3274
- frontmatterBaseFailure: "Missing required frontmatter; {{missing}}",
3275
3356
  /** Singular tooltip on the alert / chip when a node has exactly one validation failure. */
3276
3357
  alertTooltipSingle: "Frontmatter or schema validation failed.",
3277
3358
  /** Plural tooltip; `{{count}}` capped at 99 in the chip badge but the tooltip text shows the raw count. */
@@ -3302,11 +3383,9 @@ var schemaViolationAnalyzer = {
3302
3383
  const validators = loadSchemaValidators();
3303
3384
  const findings = [];
3304
3385
  const perNode = /* @__PURE__ */ new Map();
3305
- const kernelFlaggedNodes = collectKernelFlaggedNodes(ctx.accumulatedIssues);
3306
3386
  for (const node of ctx.nodes) {
3307
3387
  const before = findings.length;
3308
3388
  collectNodeFindings(validators, node, findings);
3309
- collectFrontmatterBaseFindings(node, findings, kernelFlaggedNodes);
3310
3389
  if (findings.length > before) {
3311
3390
  let worst = "warn";
3312
3391
  for (let i = before; i < findings.length; i++) {
@@ -3344,43 +3423,6 @@ function collectNodeFindings(v, node, out) {
3344
3423
  data: { target: "node", path: node.path }
3345
3424
  });
3346
3425
  }
3347
- function collectKernelFlaggedNodes(accumulated) {
3348
- const flagged = /* @__PURE__ */ new Set();
3349
- for (const issue of accumulated ?? []) {
3350
- if (!FRONTMATTER_ISSUE_ANALYZERS.has(issue.analyzerId)) continue;
3351
- for (const id of issue.nodeIds) flagged.add(id);
3352
- }
3353
- return flagged;
3354
- }
3355
- function collectFrontmatterBaseFindings(node, out, kernelFlagged) {
3356
- if (kernelFlagged.has(node.path)) return;
3357
- if (node.provider === "markdown") return;
3358
- if (node.bytes.frontmatter === 0) return;
3359
- const fm = node.frontmatter ?? {};
3360
- const missing = [];
3361
- if (isMissingStringField(fm, "name")) missing.push("name");
3362
- if (isMissingStringField(fm, "description")) missing.push("description");
3363
- if (missing.length === 0) return;
3364
- out.push({
3365
- analyzerId: ID22,
3366
- // `warn` (not `error`) so the default `sm scan` exit code stays
3367
- // 0 even when nodes are missing frontmatter base fields. Strict
3368
- // mode (`sm scan --strict`) still escalates to exit 1. Matches
3369
- // the `frontmatter-invalid` severity policy of the orchestrator.
3370
- severity: "warn",
3371
- nodeIds: [node.path],
3372
- message: formatFinding({
3373
- body: tx(SCHEMA_VIOLATION_TEXTS.frontmatterBaseFailure, {
3374
- missing: missing.join(", ")
3375
- })
3376
- }),
3377
- data: { target: "frontmatter", path: node.path, missing }
3378
- });
3379
- }
3380
- function isMissingStringField(fm, field) {
3381
- const v = fm[field];
3382
- return typeof v !== "string" || v.length === 0;
3383
- }
3384
3426
  function collectLinkFindings(v, link, out) {
3385
3427
  const result = v.validate("link", toLinkForSchema(link));
3386
3428
  if (result.ok) return;
@@ -4155,12 +4197,13 @@ function writeJsonAtomic(path, content) {
4155
4197
  }
4156
4198
 
4157
4199
  // core/paths/db-path.ts
4158
- import { join as join2, resolve as resolve5 } from "path";
4200
+ import { join as join2, resolve as resolve6 } from "path";
4159
4201
 
4160
4202
  // kernel/util/skill-map-paths.ts
4161
- import { join } from "path";
4203
+ import { dirname as dirname5, join, resolve as resolve5 } from "path";
4162
4204
  var SKILL_MAP_DIR = ".skill-map";
4163
4205
  var KERNEL_SKILL_MAP_DIR = SKILL_MAP_DIR;
4206
+ var BACKUPS_DIRNAME = "backups";
4164
4207
  var SETTINGS_FILENAME = "settings.json";
4165
4208
  var LOCAL_SETTINGS_FILENAME = "settings.local.json";
4166
4209
  function kernelSettingsPath(scopeRoot) {
@@ -4169,6 +4212,9 @@ function kernelSettingsPath(scopeRoot) {
4169
4212
  function kernelLocalSettingsPath(scopeRoot) {
4170
4213
  return join(scopeRoot, KERNEL_SKILL_MAP_DIR, LOCAL_SETTINGS_FILENAME);
4171
4214
  }
4215
+ function kernelBackupsDir(dbPath) {
4216
+ return join(dirname5(resolve5(dbPath)), BACKUPS_DIRNAME);
4217
+ }
4172
4218
 
4173
4219
  // core/paths/db-path.ts
4174
4220
  var DB_FILENAME = "skill-map.db";
@@ -4183,17 +4229,20 @@ var GITIGNORE_ENTRIES = [
4183
4229
  `${SKILL_MAP_DIR}/${DB_FILENAME}`
4184
4230
  ];
4185
4231
  function resolveDbPath(options) {
4186
- if (options.db) return resolve5(options.db);
4187
- return resolve5(options.cwd, DEFAULT_DB_REL);
4232
+ if (options.db) return resolve6(options.db);
4233
+ return resolve6(options.cwd, DEFAULT_DB_REL);
4188
4234
  }
4189
4235
  function defaultProjectDbPath(ctx) {
4190
- return resolve5(ctx.cwd, DEFAULT_DB_REL);
4236
+ return resolve6(ctx.cwd, DEFAULT_DB_REL);
4191
4237
  }
4192
4238
  function defaultProjectJobsDir(ctx) {
4193
- return resolve5(ctx.cwd, SKILL_MAP_DIR, JOBS_DIRNAME);
4239
+ return resolve6(ctx.cwd, SKILL_MAP_DIR, JOBS_DIRNAME);
4194
4240
  }
4195
4241
  function defaultProjectPluginsDir(ctx) {
4196
- return resolve5(ctx.cwd, SKILL_MAP_DIR, PLUGINS_DIRNAME);
4242
+ return resolve6(ctx.cwd, SKILL_MAP_DIR, PLUGINS_DIRNAME);
4243
+ }
4244
+ function backupsDirForDb(dbPath) {
4245
+ return kernelBackupsDir(dbPath);
4197
4246
  }
4198
4247
  function defaultDbPath(scopeRoot) {
4199
4248
  return join2(scopeRoot, SKILL_MAP_DIR, DB_FILENAME);
@@ -4430,7 +4479,7 @@ var atDirectiveExtractor2 = { ...atDirectiveExtractor, pluginId: "claude", versi
4430
4479
  var slashCommandExtractor2 = { ...slashCommandExtractor, pluginId: "claude", version: VERSION };
4431
4480
  var toolsCounterExtractor2 = { ...toolsCounterExtractor, pluginId: "claude", version: VERSION };
4432
4481
  var antigravityProvider2 = { ...antigravityProvider, pluginId: "antigravity", version: VERSION };
4433
- var openaiProvider2 = { ...openaiProvider, pluginId: "openai", version: VERSION };
4482
+ var codexProvider2 = { ...codexProvider, pluginId: "codex", version: VERSION };
4434
4483
  var agentSkillsProvider2 = { ...agentSkillsProvider, pluginId: "agent-skills", version: VERSION };
4435
4484
  var coreMarkdownProvider2 = { ...coreMarkdownProvider, pluginId: "core", version: VERSION };
4436
4485
  var backtickPathExtractor2 = { ...backtickPathExtractor, pluginId: "core", version: VERSION };
@@ -4477,10 +4526,10 @@ var builtInPlugins = [
4477
4526
  ]
4478
4527
  },
4479
4528
  {
4480
- id: "openai",
4529
+ id: "codex",
4481
4530
  description: "OpenAI Codex CLI platform integration. Classifies TOML sub-agent definitions under `.codex/agents/*.toml`.",
4482
4531
  extensions: [
4483
- openaiProvider2
4532
+ codexProvider2
4484
4533
  ]
4485
4534
  },
4486
4535
  {
@@ -5218,7 +5267,7 @@ async function closeSentryCli(timeoutMs = 2e3) {
5218
5267
  var BUILT_IN_PLUGIN_IDS = /* @__PURE__ */ new Set([
5219
5268
  "claude",
5220
5269
  "antigravity",
5221
- "openai",
5270
+ "codex",
5222
5271
  "agent-skills",
5223
5272
  "core"
5224
5273
  ]);
@@ -5408,7 +5457,7 @@ import { Command as Command2, Option as Option2 } from "clipanion";
5408
5457
 
5409
5458
  // core/config/helper.ts
5410
5459
  import { homedir as osHomedir } from "os";
5411
- import { isAbsolute, join as join4, resolve as resolve6, sep } from "path";
5460
+ import { isAbsolute, join as join4, resolve as resolve7, sep } from "path";
5412
5461
 
5413
5462
  // kernel/config/loader.ts
5414
5463
  import { existsSync as existsSync5, readFileSync as readFileSync6 } from "fs";
@@ -5828,13 +5877,13 @@ function projectPathExposure(inputs) {
5828
5877
  return { expandsSurface: true, exposedPaths: exposed };
5829
5878
  }
5830
5879
  function resolveScanPathForExposure(raw, cwd) {
5831
- if (raw.startsWith("~/")) return resolve6(join4(osHomedir(), raw.slice(2)));
5832
- if (raw === "~") return resolve6(osHomedir());
5833
- if (isAbsolute(raw)) return resolve6(raw);
5834
- return resolve6(cwd, raw);
5880
+ if (raw.startsWith("~/")) return resolve7(join4(osHomedir(), raw.slice(2)));
5881
+ if (raw === "~") return resolve7(osHomedir());
5882
+ if (isAbsolute(raw)) return resolve7(raw);
5883
+ return resolve7(cwd, raw);
5835
5884
  }
5836
5885
  function isUnderProject(absPath, cwd) {
5837
- const projectRoot = resolve6(cwd);
5886
+ const projectRoot = resolve7(cwd);
5838
5887
  return absPath === projectRoot || absPath.startsWith(`${projectRoot}${sep}`);
5839
5888
  }
5840
5889
 
@@ -5895,7 +5944,7 @@ function ensureSidecarWritesAllowed(opts) {
5895
5944
 
5896
5945
  // kernel/sidecar/store.ts
5897
5946
  import { existsSync as existsSync6, readFileSync as readFileSync7 } from "fs";
5898
- import { dirname as dirname5, resolve as resolve7 } from "path";
5947
+ import { dirname as dirname6, resolve as resolve8 } from "path";
5899
5948
  import { createRequire as createRequire4 } from "module";
5900
5949
  import { Ajv2020 as Ajv20204 } from "ajv/dist/2020.js";
5901
5950
  import yaml2 from "js-yaml";
@@ -6003,10 +6052,10 @@ function getSidecarValidator2() {
6003
6052
  applyAjvFormats(ajv);
6004
6053
  const specRoot = resolveSpecRoot3();
6005
6054
  const annotationsSchema = JSON.parse(
6006
- readFileSync7(resolve7(specRoot, "schemas/annotations.schema.json"), "utf8")
6055
+ readFileSync7(resolve8(specRoot, "schemas/annotations.schema.json"), "utf8")
6007
6056
  );
6008
6057
  const sidecarSchema = JSON.parse(
6009
- readFileSync7(resolve7(specRoot, "schemas/sidecar.schema.json"), "utf8")
6058
+ readFileSync7(resolve8(specRoot, "schemas/sidecar.schema.json"), "utf8")
6010
6059
  );
6011
6060
  ajv.addSchema(annotationsSchema);
6012
6061
  cachedValidator = ajv.compile(sidecarSchema);
@@ -6016,7 +6065,7 @@ function resolveSpecRoot3() {
6016
6065
  const require2 = createRequire4(import.meta.url);
6017
6066
  try {
6018
6067
  const indexPath = require2.resolve("@skill-map/spec/index.json");
6019
- return dirname5(indexPath);
6068
+ return dirname6(indexPath);
6020
6069
  } catch {
6021
6070
  throw new Error("@skill-map/spec not resolvable: sidecar store cannot load schemas.");
6022
6071
  }
@@ -6126,12 +6175,12 @@ async function confirm(question, streams, opts) {
6126
6175
  // cli/util/git.ts
6127
6176
  import { spawnSync } from "child_process";
6128
6177
  import { existsSync as existsSync7 } from "fs";
6129
- import { dirname as dirname6, resolve as resolve8 } from "path";
6178
+ import { dirname as dirname7, resolve as resolve9 } from "path";
6130
6179
  function isInsideGitRepo(cwd) {
6131
6180
  let current = cwd;
6132
6181
  while (true) {
6133
- if (existsSync7(resolve8(current, ".git"))) return true;
6134
- const parent = dirname6(current);
6182
+ if (existsSync7(resolve9(current, ".git"))) return true;
6183
+ const parent = dirname7(current);
6135
6184
  if (parent === current) return false;
6136
6185
  current = parent;
6137
6186
  }
@@ -6329,7 +6378,7 @@ import { existsSync as existsSync11 } from "fs";
6329
6378
 
6330
6379
  // kernel/adapters/sqlite/storage-adapter.ts
6331
6380
  import { mkdirSync as mkdirSync4 } from "fs";
6332
- import { dirname as dirname8, resolve as resolve11 } from "path";
6381
+ import { dirname as dirname9, resolve as resolve12 } from "path";
6333
6382
  import { DatabaseSync as DatabaseSync4 } from "node:sqlite";
6334
6383
  import { CamelCasePlugin, Kysely, sql as sql4 } from "kysely";
6335
6384
 
@@ -6462,7 +6511,7 @@ var AsyncMutex = class {
6462
6511
  this.#locked = true;
6463
6512
  return;
6464
6513
  }
6465
- await new Promise((resolve44) => this.#waiters.push(resolve44));
6514
+ await new Promise((resolve45) => this.#waiters.push(resolve45));
6466
6515
  this.#locked = true;
6467
6516
  }
6468
6517
  unlock() {
@@ -6888,7 +6937,7 @@ async function migrateNodeFavorites(trx, fromPath, toPath, report) {
6888
6937
  }
6889
6938
 
6890
6939
  // kernel/adapters/sqlite/jobs.ts
6891
- import { resolve as resolve9 } from "path";
6940
+ import { resolve as resolve10 } from "path";
6892
6941
  async function pruneTerminalJobs(db, status, cutoffMs) {
6893
6942
  const rows = await db.selectFrom("state_jobs").select(["id", "filePath"]).where("status", "=", status).where("finishedAt", "is not", null).where("finishedAt", "<", cutoffMs).execute();
6894
6943
  if (rows.length === 0) {
@@ -6903,14 +6952,14 @@ async function selectReferencedJobFilePaths(db) {
6903
6952
  const rows = await db.selectFrom("state_jobs").select(["filePath"]).where("filePath", "is not", null).execute();
6904
6953
  const out = /* @__PURE__ */ new Set();
6905
6954
  for (const row of rows) {
6906
- if (row.filePath !== null) out.add(resolve9(row.filePath));
6955
+ if (row.filePath !== null) out.add(resolve10(row.filePath));
6907
6956
  }
6908
6957
  return out;
6909
6958
  }
6910
6959
 
6911
6960
  // kernel/adapters/sqlite/migrations.ts
6912
6961
  import { copyFileSync, existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync8, readdirSync as readdirSync2 } from "fs";
6913
- import { dirname as dirname7, join as join5, resolve as resolve10 } from "path";
6962
+ import { dirname as dirname8, join as join5, resolve as resolve11 } from "path";
6914
6963
  import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
6915
6964
  import { fileURLToPath } from "url";
6916
6965
 
@@ -6924,10 +6973,10 @@ var MIGRATIONS_TEXTS = {
6924
6973
  // kernel/adapters/sqlite/migrations.ts
6925
6974
  var FILE_RE = /^(\d{3})_([a-z0-9_]+)\.sql$/;
6926
6975
  function defaultMigrationsDir() {
6927
- const here = dirname7(fileURLToPath(import.meta.url));
6928
- const flatLayout = resolve10(here, "migrations");
6976
+ const here = dirname8(fileURLToPath(import.meta.url));
6977
+ const flatLayout = resolve11(here, "migrations");
6929
6978
  if (existsSync8(flatLayout)) return flatLayout;
6930
- return resolve10(here, "..", "..", "..", "migrations");
6979
+ return resolve11(here, "..", "..", "..", "migrations");
6931
6980
  }
6932
6981
  function discoverMigrations(dir = defaultMigrationsDir()) {
6933
6982
  if (!existsSync8(dir)) return [];
@@ -6997,7 +7046,7 @@ function resolveMigrationTarget(to, files) {
6997
7046
  function writePreMigrateBackup(dbPath, target) {
6998
7047
  return writeBackup(
6999
7048
  dbPath,
7000
- join5(dirname7(resolve10(dbPath)), "backups", `skill-map-pre-migrate-v${target}.db`)
7049
+ join5(kernelBackupsDir(dbPath), `skill-map-pre-migrate-v${target}.db`)
7001
7050
  );
7002
7051
  }
7003
7052
  function applyOneMigration(db, migration) {
@@ -7032,9 +7081,9 @@ function applyOneMigration(db, migration) {
7032
7081
  }
7033
7082
  function writeBackup(dbPath, destPath) {
7034
7083
  if (dbPath === ":memory:") return null;
7035
- const absoluteSource = resolve10(dbPath);
7036
- const absoluteDest = resolve10(destPath);
7037
- mkdirSync3(dirname7(absoluteDest), { recursive: true });
7084
+ const absoluteSource = resolve11(dbPath);
7085
+ const absoluteDest = resolve11(destPath);
7086
+ mkdirSync3(dirname8(absoluteDest), { recursive: true });
7038
7087
  const db = new DatabaseSync2(absoluteSource);
7039
7088
  try {
7040
7089
  db.exec("PRAGMA wal_checkpoint(TRUNCATE)");
@@ -8671,8 +8720,8 @@ var SqliteStorageAdapter = class {
8671
8720
  if (this.#db) return;
8672
8721
  const path = this.#options.databasePath;
8673
8722
  if (path !== ":memory:") {
8674
- const absolute = resolve11(path);
8675
- mkdirSync4(dirname8(absolute), { recursive: true });
8723
+ const absolute = resolve12(path);
8724
+ mkdirSync4(dirname9(absolute), { recursive: true });
8676
8725
  }
8677
8726
  if (this.#options.autoMigrate !== false) {
8678
8727
  const files = discoverMigrations();
@@ -9280,16 +9329,16 @@ async function tryWithSqlite(options, fn) {
9280
9329
  }
9281
9330
 
9282
9331
  // cli/commands/bump-plan.ts
9283
- import { resolve as resolve13 } from "path";
9332
+ import { resolve as resolve14 } from "path";
9284
9333
 
9285
9334
  // core/paths/path-guard.ts
9286
9335
  import { lstatSync } from "fs";
9287
- import { isAbsolute as isAbsolute2, resolve as resolve12, sep as sep2 } from "path";
9336
+ import { isAbsolute as isAbsolute2, resolve as resolve13, sep as sep2 } from "path";
9288
9337
  function assertContained(cwd, rel) {
9289
9338
  if (isAbsolute2(rel)) {
9290
9339
  throw new Error(`node path is absolute, refusing to read: ${rel}`);
9291
9340
  }
9292
- const abs = resolve12(cwd, rel);
9341
+ const abs = resolve13(cwd, rel);
9293
9342
  if (abs !== cwd && !abs.startsWith(cwd + sep2)) {
9294
9343
  throw new Error(`node path escapes repo root: ${rel}`);
9295
9344
  }
@@ -9324,7 +9373,7 @@ function planOne(node, options, invoker) {
9324
9373
  let absPath;
9325
9374
  try {
9326
9375
  assertContained(options.cwd, node.path);
9327
- absPath = resolve13(options.cwd, node.path);
9376
+ absPath = resolve14(options.cwd, node.path);
9328
9377
  } catch (err) {
9329
9378
  return {
9330
9379
  nodePath: node.path,
@@ -9966,18 +10015,18 @@ var PLUGIN_LOADER_TEXTS = {
9966
10015
  // kernel/adapters/plugin-loader/index.ts
9967
10016
  import { createRequire as createRequire5 } from "module";
9968
10017
  import { existsSync as existsSync13, readFileSync as readFileSync13, readdirSync as readdirSync5, statSync as statSync2 } from "fs";
9969
- import { join as join8, resolve as resolve16 } from "path";
10018
+ import { join as join8, resolve as resolve17 } from "path";
9970
10019
  import { pathToFileURL } from "url";
9971
10020
  import semver from "semver";
9972
10021
 
9973
10022
  // kernel/adapters/plugin-loader/id-utils.ts
9974
- import { isAbsolute as isAbsolute3, relative, resolve as resolve14 } from "path";
10023
+ import { isAbsolute as isAbsolute3, relative, resolve as resolve15 } from "path";
9975
10024
  function fail(path, id, status, reason) {
9976
10025
  return { path, id, status, reason };
9977
10026
  }
9978
10027
  function isInsidePlugin(pluginPath, relEntry) {
9979
10028
  if (isAbsolute3(relEntry)) return false;
9980
- const abs = resolve14(pluginPath, relEntry);
10029
+ const abs = resolve15(pluginPath, relEntry);
9981
10030
  const rel = relative(pluginPath, abs);
9982
10031
  if (rel === "") return true;
9983
10032
  if (rel.startsWith("..")) return false;
@@ -10069,7 +10118,7 @@ function stripFunctionsAndPluginId(input) {
10069
10118
  // kernel/adapters/plugin-loader/validation.ts
10070
10119
  import * as nodeFs from "fs";
10071
10120
  import { existsSync as existsSync12 } from "fs";
10072
- import { dirname as dirname9, join as join7 } from "path";
10121
+ import { dirname as dirname10, join as join7 } from "path";
10073
10122
  import { Ajv2020 as Ajv20205 } from "ajv/dist/2020.js";
10074
10123
 
10075
10124
  // kernel/extensions/hook.ts
@@ -10190,7 +10239,7 @@ function validateHookTriggers(pluginPath, pluginId, manifest, relEntry, exported
10190
10239
  return null;
10191
10240
  }
10192
10241
  function validateActionFileConventions(pluginPath, pluginId, manifest, relEntry, entryAbsPath, manifestView) {
10193
- const actionDir = dirname9(entryAbsPath);
10242
+ const actionDir = dirname10(entryAbsPath);
10194
10243
  const reportSchemaPath = join7(actionDir, "report.schema.json");
10195
10244
  const promptPath = join7(actionDir, "prompt.md");
10196
10245
  const mode = isRecord(manifestView) && typeof manifestView["mode"] === "string" ? manifestView["mode"] : "deterministic";
@@ -10318,7 +10367,7 @@ function isDirectorySafe(path, statSync13) {
10318
10367
 
10319
10368
  // kernel/adapters/plugin-loader/storage-schemas.ts
10320
10369
  import { readFileSync as readFileSync12 } from "fs";
10321
- import { resolve as resolve15 } from "path";
10370
+ import { resolve as resolve16 } from "path";
10322
10371
  import { Ajv2020 as Ajv20206 } from "ajv/dist/2020.js";
10323
10372
 
10324
10373
  // kernel/adapters/plugin-store.ts
@@ -10382,7 +10431,7 @@ function compilePluginSchema(pluginPath, relPath) {
10382
10431
  errDescription: tx(PLUGIN_LOADER_TEXTS.loadErrorSchemaPathEscapesPlugin, { relPath, pluginPath })
10383
10432
  };
10384
10433
  }
10385
- const abs = resolve15(pluginPath, relPath);
10434
+ const abs = resolve16(pluginPath, relPath);
10386
10435
  let raw;
10387
10436
  try {
10388
10437
  raw = JSON.parse(readFileSync12(abs, "utf8"));
@@ -10424,7 +10473,7 @@ var PluginLoader = class {
10424
10473
  if (!entry.isDirectory()) continue;
10425
10474
  const candidate = join8(root, entry.name);
10426
10475
  if (existsSync13(join8(candidate, "plugin.json"))) {
10427
- out.push(resolve16(candidate));
10476
+ out.push(resolve17(candidate));
10428
10477
  }
10429
10478
  }
10430
10479
  }
@@ -10583,7 +10632,7 @@ var PluginLoader = class {
10583
10632
  manifest
10584
10633
  } };
10585
10634
  }
10586
- const abs = resolve16(pluginPath, relEntry);
10635
+ const abs = resolve17(pluginPath, relEntry);
10587
10636
  if (!existsSync13(abs)) {
10588
10637
  return { ok: false, failure: {
10589
10638
  ...fail(
@@ -10787,7 +10836,7 @@ function discoverExtensionEntries(pluginPath) {
10787
10836
  return out;
10788
10837
  }
10789
10838
  function collectKindEntries(pluginPath, kindDir, out) {
10790
- const kindAbs = resolve16(pluginPath, kindDir);
10839
+ const kindAbs = resolve17(pluginPath, kindDir);
10791
10840
  if (!existsSync13(kindAbs)) return;
10792
10841
  let entries;
10793
10842
  try {
@@ -10798,7 +10847,7 @@ function collectKindEntries(pluginPath, kindDir, out) {
10798
10847
  entries.sort();
10799
10848
  for (const entry of entries) {
10800
10849
  if (entry.startsWith(".")) continue;
10801
- const entryAbs = resolve16(kindAbs, entry);
10850
+ const entryAbs = resolve17(kindAbs, entry);
10802
10851
  if (!isDirectorySafe2(entryAbs)) continue;
10803
10852
  const candidate = findIndexCandidate(entryAbs);
10804
10853
  if (candidate !== null) {
@@ -10815,14 +10864,14 @@ function isDirectorySafe2(path) {
10815
10864
  }
10816
10865
  function findIndexCandidate(entryAbs) {
10817
10866
  for (const candidate of INDEX_CANDIDATES) {
10818
- if (existsSync13(resolve16(entryAbs, candidate))) return candidate;
10867
+ if (existsSync13(resolve17(entryAbs, candidate))) return candidate;
10819
10868
  }
10820
10869
  return null;
10821
10870
  }
10822
10871
  function installedSpecVersion() {
10823
10872
  const require2 = createRequire5(import.meta.url);
10824
10873
  const indexPath = require2.resolve("@skill-map/spec/index.json");
10825
- const pkgPath = resolve16(indexPath, "..", "package.json");
10874
+ const pkgPath = resolve17(indexPath, "..", "package.json");
10826
10875
  const pkg = JSON.parse(readFileSync13(pkgPath, "utf8"));
10827
10876
  return pkg.version;
10828
10877
  }
@@ -10835,6 +10884,13 @@ var LOCKED_PLUGIN_IDS = /* @__PURE__ */ new Set([
10835
10884
  // silently invisible, a foot-gun the host product does not want to
10836
10885
  // expose. Lock it in the enabled state.
10837
10886
  "core/markdown",
10887
+ // `agent-skills/agent-skills` is the open-standard default lens: the lens
10888
+ // a project falls back to when no vendor marker is present (see
10889
+ // spec/architecture.md §Active Provider Lens). Locking it enabled
10890
+ // guarantees the resolver always has a valid floor lens to resolve to;
10891
+ // disabling it would leave a no-vendor project with no selectable lens.
10892
+ // Stable, so the lock is legitimate (nothing experimental is lockable).
10893
+ "agent-skills/agent-skills",
10838
10894
  // `core/schema-violation` validates every scanned Node against
10839
10895
  // `node.schema.json` and every Link against `link.schema.json` (the
10840
10896
  // authoritative @skill-map/spec). Disabling it makes the system
@@ -10907,11 +10963,11 @@ async function buildEnabledResolver(ctx) {
10907
10963
 
10908
10964
  // kernel/scan/walk-content.ts
10909
10965
  import { readFile, readdir, lstat } from "fs/promises";
10910
- import { isAbsolute as isAbsolute4, join as join9, relative as relative2, resolve as resolve18, sep as sep3 } from "path";
10966
+ import { isAbsolute as isAbsolute4, join as join9, relative as relative2, resolve as resolve19, sep as sep3 } from "path";
10911
10967
 
10912
10968
  // kernel/scan/ignore.ts
10913
10969
  import { existsSync as existsSync14, readFileSync as readFileSync14 } from "fs";
10914
- import { dirname as dirname10, resolve as resolve17 } from "path";
10970
+ import { dirname as dirname11, resolve as resolve18 } from "path";
10915
10971
  import { fileURLToPath as fileURLToPath2 } from "url";
10916
10972
  import ignoreFactory from "ignore";
10917
10973
  function buildIgnoreFilter(opts = {}) {
@@ -10940,7 +10996,7 @@ function loadBundledIgnoreText() {
10940
10996
  return loadDefaultsText();
10941
10997
  }
10942
10998
  function readIgnoreFileText(scopeRoot) {
10943
- const path = resolve17(scopeRoot, ".skillmapignore");
10999
+ const path = resolve18(scopeRoot, ".skillmapignore");
10944
11000
  if (!existsSync14(path)) return void 0;
10945
11001
  try {
10946
11002
  return readFileSync14(path, "utf8");
@@ -10967,13 +11023,13 @@ function loadDefaultsText() {
10967
11023
  return cachedDefaults;
10968
11024
  }
10969
11025
  function readDefaultsFromDisk() {
10970
- const here = dirname10(fileURLToPath2(import.meta.url));
11026
+ const here = dirname11(fileURLToPath2(import.meta.url));
10971
11027
  const candidates = [
10972
- resolve17(here, "../../config/defaults/skillmapignore"),
11028
+ resolve18(here, "../../config/defaults/skillmapignore"),
10973
11029
  // src/kernel/scan/ → src/config/defaults/
10974
- resolve17(here, "../config/defaults/skillmapignore"),
11030
+ resolve18(here, "../config/defaults/skillmapignore"),
10975
11031
  // dist/cli.js → dist/config/defaults/ (siblings)
10976
- resolve17(here, "config/defaults/skillmapignore")
11032
+ resolve18(here, "config/defaults/skillmapignore")
10977
11033
  ];
10978
11034
  for (const candidate of candidates) {
10979
11035
  if (existsSync14(candidate)) {
@@ -11087,24 +11143,31 @@ async function* walkContent(roots, options) {
11087
11143
  const filter = options.ignoreFilter ?? buildIgnoreFilter();
11088
11144
  const extensions = options.extensions;
11089
11145
  const sizeLimit = buildSizeLimit(options);
11146
+ const bodyField = options.bodyField;
11090
11147
  if (options.scopedPaths !== void 0) {
11091
- yield* walkScoped(roots, options.scopedPaths, extensions, sizeLimit, parser);
11148
+ yield* walkScoped(roots, options.scopedPaths, extensions, sizeLimit, parser, bodyField);
11092
11149
  return;
11093
11150
  }
11094
11151
  for (const root of roots) {
11095
11152
  for await (const entry of walkRoot(root, root, filter, extensions, sizeLimit)) {
11096
11153
  const relPath = relative2(root, entry.full).split(sep3).join("/");
11097
- const rec = await traversedEntryToNode(entry, relPath, options.priorMtimes, parser);
11154
+ const rec = await traversedEntryToNode(
11155
+ entry,
11156
+ relPath,
11157
+ options.priorMtimes,
11158
+ parser,
11159
+ bodyField
11160
+ );
11098
11161
  if (rec !== null) yield rec;
11099
11162
  }
11100
11163
  }
11101
11164
  }
11102
- async function traversedEntryToNode(entry, relPath, priorMtimes, parser) {
11165
+ async function traversedEntryToNode(entry, relPath, priorMtimes, parser, bodyField) {
11103
11166
  const priorMtime = priorMtimes?.get(relPath);
11104
11167
  if (priorMtime !== void 0 && priorMtime === entry.modifiedAtMs) {
11105
- return buildUnchangedRecord(entry.full, relPath, entry.modifiedAtMs, parser);
11168
+ return buildUnchangedRecord(entry.full, relPath, entry.modifiedAtMs, parser, bodyField);
11106
11169
  }
11107
- const parsed = await readAndParse(entry.full, relPath, parser);
11170
+ const parsed = await readAndParse(entry.full, relPath, parser, bodyField);
11108
11171
  if (parsed === null) return null;
11109
11172
  return {
11110
11173
  path: relPath,
@@ -11121,7 +11184,7 @@ async function traversedEntryToNode(entry, relPath, priorMtimes, parser) {
11121
11184
  ...parsed.parseIssues ? { parseIssues: parsed.parseIssues } : {}
11122
11185
  };
11123
11186
  }
11124
- function buildUnchangedRecord(full, relPath, modifiedAtMs, parser) {
11187
+ function buildUnchangedRecord(full, relPath, modifiedAtMs, parser, bodyField) {
11125
11188
  return {
11126
11189
  path: relPath,
11127
11190
  body: "",
@@ -11130,26 +11193,26 @@ function buildUnchangedRecord(full, relPath, modifiedAtMs, parser) {
11130
11193
  modifiedAtMs,
11131
11194
  unchanged: true,
11132
11195
  reread: async () => {
11133
- const re = await readAndParse(full, relPath, parser);
11196
+ const re = await readAndParse(full, relPath, parser, bodyField);
11134
11197
  return re ?? { body: "", frontmatterRaw: "", frontmatter: {} };
11135
11198
  }
11136
11199
  };
11137
11200
  }
11138
- async function* walkScoped(roots, scopedPaths, extensions, sizeLimit, parser) {
11139
- const absRoots = roots.map((r) => isAbsolute4(r) ? r : resolve18(r));
11201
+ async function* walkScoped(roots, scopedPaths, extensions, sizeLimit, parser, bodyField) {
11202
+ const absRoots = roots.map((r) => isAbsolute4(r) ? r : resolve19(r));
11140
11203
  for (const scoped of scopedPaths) {
11141
- const rec = await scopedPathToNode(scoped, absRoots, extensions, sizeLimit, parser);
11204
+ const rec = await scopedPathToNode(scoped, absRoots, extensions, sizeLimit, parser, bodyField);
11142
11205
  if (rec !== null) yield rec;
11143
11206
  }
11144
11207
  }
11145
- async function scopedPathToNode(scoped, absRoots, extensions, sizeLimit, parser) {
11146
- const full = isAbsolute4(scoped) ? scoped : resolve18(scoped);
11208
+ async function scopedPathToNode(scoped, absRoots, extensions, sizeLimit, parser, bodyField) {
11209
+ const full = isAbsolute4(scoped) ? scoped : resolve19(scoped);
11147
11210
  const relPath = relativeFromRoots(full, absRoots);
11148
11211
  if (relPath === null) return null;
11149
11212
  if (!hasMatchingExtension(full, extensions)) return null;
11150
11213
  const s = await statRegularFile(full, relPath, sizeLimit);
11151
11214
  if (s === null) return null;
11152
- const parsed = await readAndParse(full, relPath, parser);
11215
+ const parsed = await readAndParse(full, relPath, parser, bodyField);
11153
11216
  if (parsed === null) return null;
11154
11217
  return {
11155
11218
  path: relPath,
@@ -11182,7 +11245,7 @@ function relativeFromRoots(full, absRoots) {
11182
11245
  }
11183
11246
  return null;
11184
11247
  }
11185
- async function readAndParse(full, relPath, parser) {
11248
+ async function readAndParse(full, relPath, parser, bodyField) {
11186
11249
  let raw;
11187
11250
  try {
11188
11251
  raw = await readFile(full, "utf8");
@@ -11191,12 +11254,19 @@ async function readAndParse(full, relPath, parser) {
11191
11254
  }
11192
11255
  const parsed = parser.parse(raw, relPath);
11193
11256
  return {
11194
- body: parsed.body,
11257
+ body: resolveEffectiveBody(parsed.body, parsed.frontmatter, bodyField),
11195
11258
  frontmatterRaw: parsed.frontmatterRaw,
11196
11259
  frontmatter: parsed.frontmatter,
11197
11260
  ...parsed.issues && parsed.issues.length > 0 ? { parseIssues: parsed.issues } : {}
11198
11261
  };
11199
11262
  }
11263
+ function resolveEffectiveBody(parsedBody, frontmatter, bodyField) {
11264
+ if (bodyField !== void 0) {
11265
+ const candidate = frontmatter[bodyField];
11266
+ if (typeof candidate === "string") return candidate;
11267
+ }
11268
+ return parsedBody;
11269
+ }
11200
11270
  function buildSizeLimit(options) {
11201
11271
  const sizeLimit = {};
11202
11272
  if (options.maxFileSizeBytes !== void 0) {
@@ -11252,13 +11322,19 @@ function resolveProviderWalk(provider) {
11252
11322
  return walk3;
11253
11323
  }
11254
11324
  const read = provider.read ?? DEFAULT_READ_CONFIG;
11255
- return (roots, options) => walkContent(roots, buildWalkContentOptions(read, options));
11325
+ const rules = Array.isArray(read) ? read : [read];
11326
+ return async function* walkRules(roots, options) {
11327
+ for (const rule of rules) {
11328
+ yield* walkContent(roots, buildWalkContentOptions(rule, options));
11329
+ }
11330
+ };
11256
11331
  }
11257
11332
  function buildWalkContentOptions(read, options) {
11258
11333
  const walkOptions = {
11259
11334
  extensions: read.extensions,
11260
11335
  parser: read.parser
11261
11336
  };
11337
+ if (read.bodyField !== void 0) walkOptions.bodyField = read.bodyField;
11262
11338
  if (options) copyOptionalWalkOptions(walkOptions, options);
11263
11339
  return walkOptions;
11264
11340
  }
@@ -11359,7 +11435,7 @@ function isExtensionInstance(v) {
11359
11435
  }
11360
11436
 
11361
11437
  // core/runtime/plugin-runtime/warnings.ts
11362
- import { resolve as resolve19 } from "path";
11438
+ import { resolve as resolve20 } from "path";
11363
11439
 
11364
11440
  // kernel/util/text.ts
11365
11441
  function truncateHead(s, max) {
@@ -11409,7 +11485,7 @@ function resolveRuntimeContext(opts) {
11409
11485
  return opts.runtimeContext ?? defaultRuntimeContext();
11410
11486
  }
11411
11487
  function resolveSearchPaths(opts, ctx) {
11412
- if (opts.pluginDir) return [resolve19(opts.pluginDir)];
11488
+ if (opts.pluginDir) return [resolve20(opts.pluginDir)];
11413
11489
  return [defaultProjectPluginsDir(ctx)];
11414
11490
  }
11415
11491
 
@@ -11947,17 +12023,18 @@ function isDetectableUnderCwd(cwd, provider) {
11947
12023
  }
11948
12024
 
11949
12025
  // core/config/active-provider.ts
11950
- var MARKDOWN_LENS_ID = "markdown";
12026
+ var DEFAULT_LENS_ID = "agent-skills";
12027
+ var MARKDOWN_BASE_ID = "markdown";
11951
12028
  function resolveActiveProvider(cwd, providers = []) {
11952
12029
  const detected = detectProvidersFromFilesystem(cwd, providers);
11953
12030
  const fromConfig = readConfigValue("activeProvider", { cwd });
11954
- if (typeof fromConfig === "string" && fromConfig.length > 0) {
12031
+ if (typeof fromConfig === "string" && fromConfig.length > 0 && fromConfig !== MARKDOWN_BASE_ID) {
11955
12032
  return { resolved: fromConfig, source: "config", detected };
11956
12033
  }
11957
12034
  if (detected.length > 0) {
11958
12035
  return { resolved: detected[0], source: "autodetect", detected };
11959
12036
  }
11960
- return { resolved: MARKDOWN_LENS_ID, source: "default", detected };
12037
+ return { resolved: DEFAULT_LENS_ID, source: "default", detected };
11961
12038
  }
11962
12039
 
11963
12040
  // cli/util/path-display.ts
@@ -12689,7 +12766,7 @@ var CONFIG_COMMANDS = [
12689
12766
 
12690
12767
  // cli/commands/conformance.ts
12691
12768
  import { existsSync as existsSync19, readFileSync as readFileSync16 } from "fs";
12692
- import { dirname as dirname12, resolve as resolve22 } from "path";
12769
+ import { dirname as dirname13, resolve as resolve23 } from "path";
12693
12770
  import { fileURLToPath as fileURLToPath4 } from "url";
12694
12771
  import { Command as Command5, Option as Option5 } from "clipanion";
12695
12772
 
@@ -12697,7 +12774,7 @@ import { Command as Command5, Option as Option5 } from "clipanion";
12697
12774
  import { spawnSync as spawnSync2 } from "child_process";
12698
12775
  import { cpSync, existsSync as existsSync17, mkdtempSync, readdirSync as readdirSync6, readFileSync as readFileSync15, rmSync, statSync as statSync3 } from "fs";
12699
12776
  import { tmpdir } from "os";
12700
- import { isAbsolute as isAbsolute6, join as join11, relative as relative3, resolve as resolve20 } from "path";
12777
+ import { isAbsolute as isAbsolute6, join as join11, relative as relative3, resolve as resolve21 } from "path";
12701
12778
 
12702
12779
  // conformance/i18n/runner.texts.ts
12703
12780
  var CONFORMANCE_RUNNER_TEXTS = {
@@ -12864,7 +12941,7 @@ function assertContained2(root, rel, label) {
12864
12941
  tx(CONFORMANCE_RUNNER_TEXTS.pathMustBeRelative, { label, path: rel, anchor: root })
12865
12942
  );
12866
12943
  }
12867
- const abs = resolve20(root, rel);
12944
+ const abs = resolve21(root, rel);
12868
12945
  const r = relative3(root, abs);
12869
12946
  if (r.startsWith("..") || isAbsolute6(r)) {
12870
12947
  throw new Error(
@@ -12891,7 +12968,7 @@ function evaluateAssertion(a, ctx) {
12891
12968
  } catch (err) {
12892
12969
  return { ok: false, type: a.type, reason: formatErrorMessage(err) };
12893
12970
  }
12894
- const abs = resolve20(ctx.scope, a.path);
12971
+ const abs = resolve21(ctx.scope, a.path);
12895
12972
  return existsSync17(abs) ? { ok: true, type: a.type } : {
12896
12973
  ok: false,
12897
12974
  type: a.type,
@@ -12906,7 +12983,7 @@ function evaluateAssertion(a, ctx) {
12906
12983
  return { ok: false, type: a.type, reason: formatErrorMessage(err) };
12907
12984
  }
12908
12985
  const fixturePath = join11(ctx.fixturesRoot, a.fixture);
12909
- const targetPath = resolve20(ctx.scope, a.path);
12986
+ const targetPath = resolve21(ctx.scope, a.path);
12910
12987
  if (!existsSync17(targetPath)) {
12911
12988
  return {
12912
12989
  ok: false,
@@ -13089,14 +13166,14 @@ var CONFORMANCE_TEXTS = {
13089
13166
 
13090
13167
  // cli/util/conformance-scopes.ts
13091
13168
  import { existsSync as existsSync18, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
13092
- import { dirname as dirname11, resolve as resolve21 } from "path";
13169
+ import { dirname as dirname12, resolve as resolve22 } from "path";
13093
13170
  import { createRequire as createRequire6 } from "module";
13094
13171
  import { fileURLToPath as fileURLToPath3 } from "url";
13095
13172
  function resolveSpecRoot4() {
13096
13173
  const require2 = createRequire6(import.meta.url);
13097
13174
  try {
13098
13175
  const indexPath = require2.resolve("@skill-map/spec/index.json");
13099
- return dirname11(indexPath);
13176
+ return dirname12(indexPath);
13100
13177
  } catch {
13101
13178
  throw new Error(
13102
13179
  "@skill-map/spec not resolvable: ensure the workspace is linked or the package is installed."
@@ -13104,14 +13181,14 @@ function resolveSpecRoot4() {
13104
13181
  }
13105
13182
  }
13106
13183
  function resolveCliWorkspaceRoot() {
13107
- const here = dirname11(fileURLToPath3(import.meta.url));
13184
+ const here = dirname12(fileURLToPath3(import.meta.url));
13108
13185
  let cursor = here;
13109
13186
  for (let depth = 0; depth < 6; depth += 1) {
13110
- const candidate = resolve21(cursor, "plugins");
13187
+ const candidate = resolve22(cursor, "plugins");
13111
13188
  if (existsSync18(candidate) && statSync4(candidate).isDirectory()) {
13112
13189
  return cursor;
13113
13190
  }
13114
- const parent = dirname11(cursor);
13191
+ const parent = dirname12(cursor);
13115
13192
  if (parent === cursor) break;
13116
13193
  cursor = parent;
13117
13194
  }
@@ -13127,12 +13204,12 @@ function collectProviderScopes(specRoot) {
13127
13204
  } catch {
13128
13205
  return out;
13129
13206
  }
13130
- const pluginsRoot = resolve21(workspaceRoot, "plugins");
13207
+ const pluginsRoot = resolve22(workspaceRoot, "plugins");
13131
13208
  if (!existsSync18(pluginsRoot)) return out;
13132
13209
  for (const pluginEntry of readdirSync7(pluginsRoot)) {
13133
- const pluginDir = resolve21(pluginsRoot, pluginEntry);
13210
+ const pluginDir = resolve22(pluginsRoot, pluginEntry);
13134
13211
  if (!isDir(pluginDir)) continue;
13135
- const providersRoot = resolve21(pluginDir, "providers");
13212
+ const providersRoot = resolve22(pluginDir, "providers");
13136
13213
  if (!isDir(providersRoot)) continue;
13137
13214
  collectPluginProviderScopes(providersRoot, specRoot, out);
13138
13215
  }
@@ -13147,12 +13224,12 @@ function isDir(path) {
13147
13224
  }
13148
13225
  function collectPluginProviderScopes(providersRoot, specRoot, out) {
13149
13226
  for (const entry of readdirSync7(providersRoot)) {
13150
- const providerDir = resolve21(providersRoot, entry);
13227
+ const providerDir = resolve22(providersRoot, entry);
13151
13228
  if (!isDir(providerDir)) continue;
13152
- const conformanceDir = resolve21(providerDir, "conformance");
13229
+ const conformanceDir = resolve22(providerDir, "conformance");
13153
13230
  if (!existsSync18(conformanceDir)) continue;
13154
- const casesDir = resolve21(conformanceDir, "cases");
13155
- const fixturesDir = resolve21(conformanceDir, "fixtures");
13231
+ const casesDir = resolve22(conformanceDir, "cases");
13232
+ const fixturesDir = resolve22(conformanceDir, "fixtures");
13156
13233
  if (!existsSync18(casesDir) || !existsSync18(fixturesDir)) continue;
13157
13234
  out.push({
13158
13235
  id: `provider:${entry}`,
@@ -13169,8 +13246,8 @@ function specScope(specRoot) {
13169
13246
  id: "spec",
13170
13247
  kind: "spec",
13171
13248
  label: "spec",
13172
- casesDir: resolve21(specRoot, "conformance", "cases"),
13173
- fixturesDir: resolve21(specRoot, "conformance", "fixtures"),
13249
+ casesDir: resolve22(specRoot, "conformance", "cases"),
13250
+ fixturesDir: resolve22(specRoot, "conformance", "fixtures"),
13174
13251
  specRoot
13175
13252
  };
13176
13253
  }
@@ -13192,7 +13269,7 @@ function selectConformanceScopes(scope) {
13192
13269
  }
13193
13270
  function listCaseFiles(scope) {
13194
13271
  if (!existsSync18(scope.casesDir)) return [];
13195
- return readdirSync7(scope.casesDir).filter((entry) => entry.endsWith(".json")).sort().map((entry) => resolve21(scope.casesDir, entry));
13272
+ return readdirSync7(scope.casesDir).filter((entry) => entry.endsWith(".json")).sort().map((entry) => resolve22(scope.casesDir, entry));
13196
13273
  }
13197
13274
 
13198
13275
  // cli/commands/conformance.ts
@@ -13206,16 +13283,16 @@ function formatAssertionFailureDetail(type, reason) {
13206
13283
  });
13207
13284
  }
13208
13285
  function resolveBinary() {
13209
- const here = dirname12(fileURLToPath4(import.meta.url));
13286
+ const here = dirname13(fileURLToPath4(import.meta.url));
13210
13287
  let cursor = here;
13211
13288
  for (let depth = 0; depth < 6; depth += 1) {
13212
- const candidate = resolve22(cursor, "bin", "sm.js");
13289
+ const candidate = resolve23(cursor, "bin", "sm.js");
13213
13290
  if (existsSync19(candidate)) return candidate;
13214
- const parent = dirname12(cursor);
13291
+ const parent = dirname13(cursor);
13215
13292
  if (parent === cursor) break;
13216
13293
  cursor = parent;
13217
13294
  }
13218
- return resolve22(here, "..", "..", "bin", "sm.js");
13295
+ return resolve23(here, "..", "..", "bin", "sm.js");
13219
13296
  }
13220
13297
  var ConformanceRunCommand = class extends SmCommand {
13221
13298
  static paths = [["conformance", "run"]];
@@ -13468,7 +13545,7 @@ function writeStreamSnippet(stream, header, text) {
13468
13545
  var CONFORMANCE_COMMANDS = [ConformanceRunCommand];
13469
13546
 
13470
13547
  // cli/commands/db/backup.ts
13471
- import { dirname as dirname13, join as join12, resolve as resolve23 } from "path";
13548
+ import { join as join12, resolve as resolve24 } from "path";
13472
13549
  import { Command as Command6, Option as Option6 } from "clipanion";
13473
13550
 
13474
13551
  // cli/i18n/db.texts.ts
@@ -13581,7 +13658,7 @@ var DbBackupCommand = class extends SmCommand {
13581
13658
  const exit = requireDbOrExit(path, this.context.stderr);
13582
13659
  if (exit !== null) return exit;
13583
13660
  const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
13584
- const outPath = this.out ? resolve23(this.out) : join12(dirname13(path), "backups", `${ts}.db`);
13661
+ const outPath = this.out ? resolve24(this.out) : join12(backupsDirForDb(path), `${ts}.db`);
13585
13662
  await withSqlite({ databasePath: path, autoMigrate: false }, async (storage) => {
13586
13663
  storage.migrations.writeBackup(outPath);
13587
13664
  });
@@ -13598,7 +13675,7 @@ var DbBackupCommand = class extends SmCommand {
13598
13675
 
13599
13676
  // cli/commands/db/restore.ts
13600
13677
  import { chmod, copyFile, mkdir, rm } from "fs/promises";
13601
- import { dirname as dirname14, resolve as resolve24 } from "path";
13678
+ import { dirname as dirname14, resolve as resolve25 } from "path";
13602
13679
  import { Command as Command7, Option as Option7 } from "clipanion";
13603
13680
 
13604
13681
  // cli/util/fs.ts
@@ -13648,7 +13725,7 @@ var DbRestoreCommand = class extends SmCommand {
13648
13725
  });
13649
13726
  async run() {
13650
13727
  const target = resolveDbPath({ db: this.db, ...defaultRuntimeContext() });
13651
- const sourcePath = resolve24(this.source);
13728
+ const sourcePath = resolve25(this.source);
13652
13729
  const stderrAnsi = this.ansiFor("stderr");
13653
13730
  const sourceStat = await statOrNull(sourcePath);
13654
13731
  if (!sourceStat) {
@@ -13889,7 +13966,7 @@ var DbShellCommand = class extends SmCommand {
13889
13966
 
13890
13967
  // cli/commands/db/browser.ts
13891
13968
  import { spawn, spawnSync as spawnSync4 } from "child_process";
13892
- import { resolve as resolve25 } from "path";
13969
+ import { resolve as resolve26 } from "path";
13893
13970
  import { Command as Command10, Option as Option9 } from "clipanion";
13894
13971
  var DbBrowserCommand = class extends SmCommand {
13895
13972
  static paths = [["db", "browser"]];
@@ -13922,7 +13999,7 @@ var DbBrowserCommand = class extends SmCommand {
13922
13999
  });
13923
14000
  positional = Option9.String({ required: false });
13924
14001
  async run() {
13925
- const path = this.positional ? resolve25(this.positional) : resolveDbPath({ db: this.db, ...defaultRuntimeContext() });
14002
+ const path = this.positional ? resolve26(this.positional) : resolveDbPath({ db: this.db, ...defaultRuntimeContext() });
13926
14003
  if (!assertDbExists(path, this.context.stderr)) {
13927
14004
  this.printer.error(DB_TEXTS.browserRunScanFirstHint);
13928
14005
  return ExitCode.NotFound;
@@ -14323,7 +14400,7 @@ var DB_COMMANDS = [
14323
14400
 
14324
14401
  // cli/commands/example.ts
14325
14402
  import { cpSync as cpSync2, existsSync as existsSync21, statSync as statSync5 } from "fs";
14326
- import { dirname as dirname16, relative as relative5, resolve as resolve26 } from "path";
14403
+ import { dirname as dirname16, relative as relative5, resolve as resolve27 } from "path";
14327
14404
  import { fileURLToPath as fileURLToPath5 } from "url";
14328
14405
  import { Command as Command13, Option as Option12 } from "clipanion";
14329
14406
 
@@ -14619,11 +14696,11 @@ function resolveExampleSourceDir() {
14619
14696
  const here = dirname16(fileURLToPath5(import.meta.url));
14620
14697
  const candidates = [
14621
14698
  // dev: src/cli/commands/ → repo-root fixtures/demo-scope/
14622
- resolve26(here, "../../..", EXAMPLE_SOURCE_DIR),
14699
+ resolve27(here, "../../..", EXAMPLE_SOURCE_DIR),
14623
14700
  // bundled: dist/cli.js → dist/cli/example (sibling)
14624
- resolve26(here, "cli/example"),
14701
+ resolve27(here, "cli/example"),
14625
14702
  // bundled fallback: any-depth → cli/example
14626
- resolve26(here, "../cli/example")
14703
+ resolve27(here, "../cli/example")
14627
14704
  ];
14628
14705
  for (const candidate of candidates) {
14629
14706
  if (existsSync21(candidate) && statSync5(candidate).isDirectory()) {
@@ -15160,7 +15237,7 @@ var GraphCommand = class extends SmCommand {
15160
15237
  // cli/commands/help.ts
15161
15238
  import { readFileSync as readFileSync17 } from "fs";
15162
15239
  import { createRequire as createRequire7 } from "module";
15163
- import { resolve as resolve27 } from "path";
15240
+ import { resolve as resolve28 } from "path";
15164
15241
  import { Command as Command16, Option as Option15 } from "clipanion";
15165
15242
 
15166
15243
  // cli/i18n/help.texts.ts
@@ -15474,7 +15551,7 @@ function resolveSpecVersion() {
15474
15551
  try {
15475
15552
  const req = createRequire7(import.meta.url);
15476
15553
  const indexPath = req.resolve("@skill-map/spec/index.json");
15477
- const pkgPath = resolve27(indexPath, "..", "package.json");
15554
+ const pkgPath = resolve28(indexPath, "..", "package.json");
15478
15555
  const pkg = JSON.parse(readFileSync17(pkgPath, "utf8"));
15479
15556
  return pkg.version;
15480
15557
  } catch {
@@ -15782,7 +15859,7 @@ function registeredVerbPaths(cli2) {
15782
15859
 
15783
15860
  // cli/commands/hooks.ts
15784
15861
  import { chmod as chmod2, mkdir as mkdir3, readFile as readFile2, stat as stat2, writeFile } from "fs/promises";
15785
- import { dirname as dirname17, resolve as resolve28 } from "path";
15862
+ import { dirname as dirname17, resolve as resolve29 } from "path";
15786
15863
  import { Command as Command17, Option as Option16 } from "clipanion";
15787
15864
 
15788
15865
  // cli/i18n/hooks.texts.ts
@@ -15885,8 +15962,8 @@ var HooksInstallCommand = class extends SmCommand {
15885
15962
  );
15886
15963
  return ExitCode.NotFound;
15887
15964
  }
15888
- const hooksDir = resolve28(repoRoot, ".git", "hooks");
15889
- const hookPath = resolve28(hooksDir, "pre-commit");
15965
+ const hooksDir = resolve29(repoRoot, ".git", "hooks");
15966
+ const hookPath = resolve29(hooksDir, "pre-commit");
15890
15967
  const existing = await pathExists(hookPath) ? await readFile2(hookPath, "utf8") : null;
15891
15968
  const planned2 = computePlannedHookContent(existing);
15892
15969
  if (planned2.kind === "already-installed") {
@@ -15944,7 +16021,7 @@ var HooksInstallCommand = class extends SmCommand {
15944
16021
  async function findGitRepoRoot(cwd) {
15945
16022
  let current = cwd;
15946
16023
  while (true) {
15947
- if (await pathExists(resolve28(current, ".git"))) return current;
16024
+ if (await pathExists(resolve29(current, ".git"))) return current;
15948
16025
  const parent = dirname17(current);
15949
16026
  if (parent === current) return null;
15950
16027
  current = parent;
@@ -15971,7 +16048,7 @@ import { Command as Command18, Option as Option17 } from "clipanion";
15971
16048
 
15972
16049
  // kernel/orchestrator/index.ts
15973
16050
  import { existsSync as existsSync24, statSync as statSync7 } from "fs";
15974
- import { isAbsolute as isAbsolute10, resolve as resolve31 } from "path";
16051
+ import { isAbsolute as isAbsolute10, resolve as resolve32 } from "path";
15975
16052
  import { Tiktoken as Tiktoken2 } from "js-tiktoken/lite";
15976
16053
 
15977
16054
  // kernel/i18n/orchestrator.texts.ts
@@ -16659,6 +16736,13 @@ function validateIssue(analyzer, issue, emitter) {
16659
16736
  return { ...issue, analyzerId: issue.analyzerId || analyzer.id };
16660
16737
  }
16661
16738
 
16739
+ // kernel/orchestrator/frontmatter-issue-ids.ts
16740
+ var FRONTMATTER_ISSUE_ANALYZERS = /* @__PURE__ */ new Set([
16741
+ "frontmatter-invalid",
16742
+ "frontmatter-malformed",
16743
+ "frontmatter-parse-error"
16744
+ ]);
16745
+
16662
16746
  // kernel/orchestrator/cache.ts
16663
16747
  function indexPriorSnapshot(prior) {
16664
16748
  const priorNodesByPath = /* @__PURE__ */ new Map();
@@ -16916,7 +17000,7 @@ function collectBrokenLinks(links, nodes, ctx) {
16916
17000
  return broken;
16917
17001
  }
16918
17002
  function applyResolution(link, indexes, ctx) {
16919
- const resolution = resolve29(link, indexes, ctx);
17003
+ const resolution = resolve30(link, indexes, ctx);
16920
17004
  if (resolution === "none") return;
16921
17005
  link.resolvedTarget = resolution;
16922
17006
  }
@@ -16931,7 +17015,7 @@ function buildIndexes(nodes, ctx) {
16931
17015
  }
16932
17016
  return { byPath: byPath3, byName, nodeByPath };
16933
17017
  }
16934
- function resolve29(link, indexes, ctx) {
17018
+ function resolve30(link, indexes, ctx) {
16935
17019
  if (indexes.byPath.has(link.target)) return link.target;
16936
17020
  return resolveByName(link, indexes, ctx);
16937
17021
  }
@@ -17320,7 +17404,7 @@ function detectRenamesAndOrphans(prior, current, issues, silenced) {
17320
17404
  }
17321
17405
 
17322
17406
  // kernel/orchestrator/walk.ts
17323
- import { isAbsolute as isAbsolute9, resolve as resolve30 } from "path";
17407
+ import { isAbsolute as isAbsolute9, resolve as resolve31 } from "path";
17324
17408
 
17325
17409
  // kernel/sidecar/drift.ts
17326
17410
  function computeDriftStatus(args2) {
@@ -17766,8 +17850,8 @@ function expandSidecarPaths(paths, priorNodesByPath) {
17766
17850
  }
17767
17851
  function toAbsolute(relPath, roots) {
17768
17852
  const root = roots[0] ?? ".";
17769
- const absRoot = isAbsolute9(root) ? root : resolve30(root);
17770
- return resolve30(absRoot, relPath);
17853
+ const absRoot = isAbsolute9(root) ? root : resolve31(root);
17854
+ return resolve31(absRoot, relPath);
17771
17855
  }
17772
17856
  function resolveEffectiveCaps(opts) {
17773
17857
  return {
@@ -18365,7 +18449,7 @@ function validateRoots(roots) {
18365
18449
  function resolveActiveProviderOption(optionValue, roots, providers) {
18366
18450
  if (optionValue !== void 0) return optionValue;
18367
18451
  for (const root of roots) {
18368
- const absRoot = isAbsolute10(root) ? root : resolve31(root);
18452
+ const absRoot = isAbsolute10(root) ? root : resolve32(root);
18369
18453
  if (!existsSync24(absRoot)) continue;
18370
18454
  const detected = detectProvidersFromFilesystem(absRoot, providers)[0] ?? null;
18371
18455
  if (detected !== null) return detected;
@@ -18374,10 +18458,10 @@ function resolveActiveProviderOption(optionValue, roots, providers) {
18374
18458
  }
18375
18459
 
18376
18460
  // kernel/scan/watcher.ts
18377
- import { resolve as resolve32, relative as relative7, sep as sep5 } from "path";
18461
+ import { resolve as resolve33, relative as relative7, sep as sep5 } from "path";
18378
18462
  import chokidar from "chokidar";
18379
18463
  function createChokidarWatcher(opts) {
18380
- const absRoots = opts.roots.map((r) => resolve32(opts.cwd, r));
18464
+ const absRoots = opts.roots.map((r) => resolve33(opts.cwd, r));
18381
18465
  const ignoreFilterOpt = opts.ignoreFilter;
18382
18466
  const getFilter = ignoreFilterOpt === void 0 ? void 0 : typeof ignoreFilterOpt === "function" ? ignoreFilterOpt : () => ignoreFilterOpt;
18383
18467
  const ignored = getFilter ? (path) => {
@@ -18883,7 +18967,7 @@ function resolveScanRoots(inputs) {
18883
18967
  // core/runtime/reference-paths-walker.ts
18884
18968
  import { readdirSync as readdirSync9, statSync as statSync8 } from "fs";
18885
18969
  import { homedir as osHomedir2 } from "os";
18886
- import { isAbsolute as isAbsolute11, join as join14, resolve as resolve33 } from "path";
18970
+ import { isAbsolute as isAbsolute11, join as join14, resolve as resolve34 } from "path";
18887
18971
  var REFERENCE_WALK_MAX_FILES = 5e4;
18888
18972
  var SKIPPED_DIR_NAMES = /* @__PURE__ */ new Set([
18889
18973
  "node_modules",
@@ -18891,10 +18975,10 @@ var SKIPPED_DIR_NAMES = /* @__PURE__ */ new Set([
18891
18975
  SKILL_MAP_DIR
18892
18976
  ]);
18893
18977
  function resolveScanPath(raw, cwd) {
18894
- if (raw.startsWith("~/")) return resolve33(join14(osHomedir2(), raw.slice(2)));
18895
- if (raw === "~") return resolve33(osHomedir2());
18896
- if (isAbsolute11(raw)) return resolve33(raw);
18897
- return resolve33(cwd, raw);
18978
+ if (raw.startsWith("~/")) return resolve34(join14(osHomedir2(), raw.slice(2)));
18979
+ if (raw === "~") return resolve34(osHomedir2());
18980
+ if (isAbsolute11(raw)) return resolve34(raw);
18981
+ return resolve34(cwd, raw);
18898
18982
  }
18899
18983
  function walkReferencePaths(rawRoots, cwd) {
18900
18984
  const paths = /* @__PURE__ */ new Set();
@@ -18963,7 +19047,7 @@ async function bootstrapActiveProvider(opts) {
18963
19047
  opts.providers
18964
19048
  );
18965
19049
  if (detected.length === 0) {
18966
- return { kind: "ok", activeProvider: MARKDOWN_LENS_ID, source: "default" };
19050
+ return { kind: "ok", activeProvider: DEFAULT_LENS_ID, source: "default" };
18967
19051
  }
18968
19052
  if (detected.length === 1) {
18969
19053
  const picked2 = detected[0];
@@ -20358,7 +20442,7 @@ import { Command as Command20, Option as Option19 } from "clipanion";
20358
20442
 
20359
20443
  // kernel/jobs/orphan-files.ts
20360
20444
  import { readdirSync as readdirSync10, statSync as statSync9 } from "fs";
20361
- import { join as join17, resolve as resolve34 } from "path";
20445
+ import { join as join17, resolve as resolve35 } from "path";
20362
20446
  function findOrphanJobFiles(jobsDir, referencedPaths) {
20363
20447
  let entries;
20364
20448
  try {
@@ -20376,7 +20460,7 @@ function findOrphanJobFiles(jobsDir, referencedPaths) {
20376
20460
  if (!entry.isFile()) continue;
20377
20461
  const name = entry.name;
20378
20462
  if (!name.endsWith(".md")) continue;
20379
- const abs = resolve34(join17(jobsDir, name));
20463
+ const abs = resolve35(join17(jobsDir, name));
20380
20464
  if (!referencedPaths.has(abs)) orphans.push(abs);
20381
20465
  }
20382
20466
  orphans.sort();
@@ -21586,7 +21670,7 @@ var BUILT_IN_PLUGIN_PRESENTATION_ORDER = [
21586
21670
  "core",
21587
21671
  "claude",
21588
21672
  "antigravity",
21589
- "openai",
21673
+ "codex",
21590
21674
  "agent-skills"
21591
21675
  ];
21592
21676
  function sortPluginsForPresentation(plugins) {
@@ -21603,9 +21687,9 @@ function sortPluginsForPresentation(plugins) {
21603
21687
  }
21604
21688
 
21605
21689
  // cli/commands/plugins/shared.ts
21606
- import { resolve as resolve35 } from "path";
21690
+ import { resolve as resolve36 } from "path";
21607
21691
  function resolveSearchPaths2(opts, cwd) {
21608
- if (opts.pluginDir) return [resolve35(opts.pluginDir)];
21692
+ if (opts.pluginDir) return [resolve36(opts.pluginDir)];
21609
21693
  return [defaultProjectPluginsDir({ cwd })];
21610
21694
  }
21611
21695
  async function buildResolver() {
@@ -22849,7 +22933,7 @@ var PluginsEnableCommand = class extends TogglePluginsBase {
22849
22933
  ids (\`claude\`, which fans the toggle out across every extension
22850
22934
  inside the plugin). Multi-extension plugins need --yes (or an
22851
22935
  interactive TTY confirm) to avoid flipping 27 core extensions by
22852
- accident. Single-extension plugins (openai, agent-skills,
22936
+ accident. Single-extension plugins (codex, agent-skills,
22853
22937
  antigravity) apply without prompting.
22854
22938
 
22855
22939
  Batches are all-or-nothing: a single unknown id aborts before
@@ -22876,7 +22960,7 @@ var PluginsDisableCommand = class extends TogglePluginsBase {
22876
22960
  ids (\`core\`, which fans the toggle out across every extension
22877
22961
  inside the plugin). Multi-extension plugins need --yes (or an
22878
22962
  interactive TTY confirm) to avoid flipping 27 core extensions by
22879
- accident. Single-extension plugins (openai, agent-skills,
22963
+ accident. Single-extension plugins (codex, agent-skills,
22880
22964
  antigravity) apply without prompting.
22881
22965
 
22882
22966
  Batches are all-or-nothing: a single unknown id aborts before
@@ -22919,7 +23003,7 @@ function resolveBareToggle(id, catalogue) {
22919
23003
 
22920
23004
  // cli/commands/plugins/create.ts
22921
23005
  import { existsSync as existsSync26, mkdirSync as mkdirSync5, writeFileSync } from "fs";
22922
- import { dirname as dirname18, join as join18, resolve as resolve36 } from "path";
23006
+ import { dirname as dirname18, join as join18, resolve as resolve37 } from "path";
22923
23007
  import { Command as Command27, Option as Option26 } from "clipanion";
22924
23008
 
22925
23009
  // cli/commands/plugins/scaffold/action.ts
@@ -23369,7 +23453,7 @@ var PluginsCreateCommand = class extends SmCommand {
23369
23453
  const kind = this.kind;
23370
23454
  const ctx = defaultRuntimeContext();
23371
23455
  const baseDir = defaultProjectPluginsDir(ctx);
23372
- const targetDir = this.at ? resolve36(this.at) : join18(baseDir, this.pluginId);
23456
+ const targetDir = this.at ? resolve37(this.at) : join18(baseDir, this.pluginId);
23373
23457
  if (existsSync26(targetDir) && !this.force) {
23374
23458
  this.printer.error(
23375
23459
  tx(PLUGINS_TEXTS.createRefuseOverwrite, {
@@ -23885,7 +23969,7 @@ var PLUGIN_COMMANDS = [
23885
23969
 
23886
23970
  // cli/commands/refresh.ts
23887
23971
  import { readFile as readFile4 } from "fs/promises";
23888
- import { resolve as resolve37 } from "path";
23972
+ import { resolve as resolve38 } from "path";
23889
23973
  import { Command as Command31, Option as Option29 } from "clipanion";
23890
23974
 
23891
23975
  // cli/i18n/refresh.texts.ts
@@ -24193,7 +24277,7 @@ var RefreshCommand = class extends SmCommand {
24193
24277
  let body;
24194
24278
  try {
24195
24279
  assertContained(cwd, node.path);
24196
- const raw = await readFile4(resolve37(cwd, node.path), "utf8");
24280
+ const raw = await readFile4(resolve38(cwd, node.path), "utf8");
24197
24281
  body = stripFrontmatterFence(raw);
24198
24282
  } catch (err) {
24199
24283
  if (!this.json) {
@@ -24266,7 +24350,7 @@ var IntentionalFailCommand = class extends SmCommand {
24266
24350
  setTimeout(() => {
24267
24351
  throw new Error(INTENTIONAL_FAIL_TEXTS.errorMessage);
24268
24352
  }, 0);
24269
- await new Promise((resolve44) => setTimeout(resolve44, 5e3));
24353
+ await new Promise((resolve45) => setTimeout(resolve45, 5e3));
24270
24354
  return ExitCode.Issues;
24271
24355
  }
24272
24356
  };
@@ -24434,7 +24518,7 @@ var SCAN_TEXTS = {
24434
24518
  import { Command as Command32, Option as Option30 } from "clipanion";
24435
24519
 
24436
24520
  // core/watcher/runtime.ts
24437
- import { dirname as dirname19, isAbsolute as isAbsolute13, relative as relative9, resolve as resolve38, sep as sep6 } from "path";
24521
+ import { dirname as dirname19, isAbsolute as isAbsolute13, relative as relative9, resolve as resolve39, sep as sep6 } from "path";
24438
24522
 
24439
24523
  // core/runtime/fresh-resolver.ts
24440
24524
  async function buildFreshResolver(deps) {
@@ -24480,7 +24564,7 @@ function applyPriorStateToRunOptions(runOptions, priorState, changedPaths) {
24480
24564
  }
24481
24565
  }
24482
24566
  function toIncrementalPaths(events, roots, cwd) {
24483
- const absRoots = roots.map((r) => isAbsolute13(r) ? r : resolve38(cwd, r));
24567
+ const absRoots = roots.map((r) => isAbsolute13(r) ? r : resolve39(cwd, r));
24484
24568
  const changed = /* @__PURE__ */ new Set();
24485
24569
  const removed = /* @__PURE__ */ new Set();
24486
24570
  for (const ev of events) {
@@ -26224,7 +26308,8 @@ var SERVER_TEXTS = {
26224
26308
  activeProviderBodyMissing: "Request body must include `activeProvider` (a non-empty string).",
26225
26309
  activeProviderValueNotString: "`activeProvider` must be a string.",
26226
26310
  activeProviderValueEmpty: "`activeProvider` cannot be the empty string. Send the id of an enabled provider.",
26227
- activeProviderPersistFailed: "Could not persist activeProvider: {{message}}"
26311
+ activeProviderPersistFailed: "Could not persist activeProvider: {{message}}",
26312
+ activeProviderNotSelectable: "`{{id}}` is not a selectable lens. Pick one of: {{selectable}}."
26228
26313
  };
26229
26314
 
26230
26315
  // server/loopback-gate.ts
@@ -27924,10 +28009,10 @@ import { HTTPException as HTTPException12 } from "hono/http-exception";
27924
28009
 
27925
28010
  // server/util/skillmapignore-io.ts
27926
28011
  import { existsSync as existsSync28, readFileSync as readFileSync18, writeFileSync as writeFileSync2 } from "fs";
27927
- import { resolve as resolve39 } from "path";
28012
+ import { resolve as resolve40 } from "path";
27928
28013
  var IGNORE_FILENAME2 = ".skillmapignore";
27929
28014
  function readPatterns(cwd) {
27930
- const path = resolve39(cwd, IGNORE_FILENAME2);
28015
+ const path = resolve40(cwd, IGNORE_FILENAME2);
27931
28016
  if (!existsSync28(path)) return [];
27932
28017
  let raw;
27933
28018
  try {
@@ -27938,7 +28023,7 @@ function readPatterns(cwd) {
27938
28023
  return raw.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0 && !l.startsWith("#"));
27939
28024
  }
27940
28025
  function writePatterns(cwd, nextPatterns) {
27941
- const path = resolve39(cwd, IGNORE_FILENAME2);
28026
+ const path = resolve40(cwd, IGNORE_FILENAME2);
27942
28027
  const prior = existsSync28(path) ? safeRead(path) : "";
27943
28028
  const content = buildContent(prior, nextPatterns);
27944
28029
  writeFileSync2(path, content, "utf8");
@@ -28326,6 +28411,15 @@ function registerActiveProviderRoute(app, deps) {
28326
28411
  });
28327
28412
  app.patch("/api/active-provider", async (c) => {
28328
28413
  const body = await parsePatchBody5(c.req.raw);
28414
+ const selectable = await resolveSelectableProviders(deps);
28415
+ if (!selectable.includes(body.activeProvider)) {
28416
+ throw new HTTPException14(400, {
28417
+ message: tx(SERVER_TEXTS.activeProviderNotSelectable, {
28418
+ id: body.activeProvider,
28419
+ selectable: selectable.join(", ")
28420
+ })
28421
+ });
28422
+ }
28329
28423
  const result = applyLensSwitch(deps, body.activeProvider);
28330
28424
  deps.configService.reload();
28331
28425
  return c.json({ ...await buildEnvelope4(deps), switch: result });
@@ -28348,7 +28442,7 @@ async function resolveSelectableProviders(deps) {
28348
28442
  });
28349
28443
  const selectable = /* @__PURE__ */ new Set();
28350
28444
  for (const provider of deps.providers) {
28351
- if (isPluginExtensionEnabled(provider, resolveEnabled)) {
28445
+ if (provider.gatedByActiveLens === true && isPluginExtensionEnabled(provider, resolveEnabled)) {
28352
28446
  selectable.add(provider.id);
28353
28447
  }
28354
28448
  }
@@ -28396,7 +28490,7 @@ var parsePatchBody5 = makeBodyValidator(PATCH_BODY_SCHEMA4, {
28396
28490
 
28397
28491
  // server/routes/actions.ts
28398
28492
  import { HTTPException as HTTPException16 } from "hono/http-exception";
28399
- import { resolve as resolve40 } from "path";
28493
+ import { resolve as resolve41 } from "path";
28400
28494
 
28401
28495
  // server/routes/node-loader.ts
28402
28496
  import { HTTPException as HTTPException15 } from "hono/http-exception";
@@ -28456,7 +28550,7 @@ function registerActionsRoutes(app, deps) {
28456
28550
  let absPath;
28457
28551
  try {
28458
28552
  assertContained(deps.runtimeContext.cwd, node.path);
28459
- absPath = resolve40(deps.runtimeContext.cwd, node.path);
28553
+ absPath = resolve41(deps.runtimeContext.cwd, node.path);
28460
28554
  } catch (err) {
28461
28555
  throw new HTTPException16(400, { message: formatErrorMessage(err) });
28462
28556
  }
@@ -28564,14 +28658,14 @@ async function withScanMutex(fn) {
28564
28658
  if (inFlight !== null) {
28565
28659
  throw new ScanBusyError();
28566
28660
  }
28567
- let resolve44;
28661
+ let resolve45;
28568
28662
  inFlight = new Promise((r) => {
28569
- resolve44 = r;
28663
+ resolve45 = r;
28570
28664
  });
28571
28665
  try {
28572
28666
  return await fn();
28573
28667
  } finally {
28574
- resolve44();
28668
+ resolve45();
28575
28669
  inFlight = null;
28576
28670
  }
28577
28671
  }
@@ -29678,6 +29772,22 @@ function buildKindRegistry(providers) {
29678
29772
  }
29679
29773
 
29680
29774
  // server/provider-registry.ts
29775
+ function presentationOptionals(ui) {
29776
+ const out = {};
29777
+ if (ui.colorDark !== void 0) out.colorDark = ui.colorDark;
29778
+ if (ui.emoji !== void 0) out.emoji = ui.emoji;
29779
+ if (ui.icon !== void 0) out.icon = ui.icon;
29780
+ if (ui.hideChip !== void 0) out.hideChip = ui.hideChip;
29781
+ return out;
29782
+ }
29783
+ function resolveProviderBodyField(read) {
29784
+ if (read === void 0) return void 0;
29785
+ const rules = Array.isArray(read) ? read : [read];
29786
+ for (const rule of rules) {
29787
+ if (rule.bodyField !== void 0) return rule.bodyField;
29788
+ }
29789
+ return void 0;
29790
+ }
29681
29791
  function buildProviderRegistry(providers) {
29682
29792
  const registry = {};
29683
29793
  for (const provider of providers) {
@@ -29685,12 +29795,14 @@ function buildProviderRegistry(providers) {
29685
29795
  if (!ui) continue;
29686
29796
  const entry = {
29687
29797
  label: ui.label,
29688
- color: ui.color
29798
+ color: ui.color,
29799
+ // A Provider is a selectable lens iff it gates on the active lens;
29800
+ // the non-gated `markdown` base projects `isLens: false`.
29801
+ isLens: provider.gatedByActiveLens === true,
29802
+ ...presentationOptionals(ui)
29689
29803
  };
29690
- if (ui.colorDark !== void 0) entry.colorDark = ui.colorDark;
29691
- if (ui.emoji !== void 0) entry.emoji = ui.emoji;
29692
- if (ui.icon !== void 0) entry.icon = ui.icon;
29693
- if (ui.hideChip !== void 0) entry.hideChip = ui.hideChip;
29804
+ const bodyField = resolveProviderBodyField(provider.read);
29805
+ if (bodyField !== void 0) entry.bodyField = bodyField;
29694
29806
  registry[provider.id] = entry;
29695
29807
  }
29696
29808
  return registry;
@@ -29869,7 +29981,7 @@ function validateNoUi(noUi, uiDist) {
29869
29981
 
29870
29982
  // server/paths.ts
29871
29983
  import { existsSync as existsSync31, statSync as statSync11 } from "fs";
29872
- import { dirname as dirname20, isAbsolute as isAbsolute15, join as join20, resolve as resolve41 } from "path";
29984
+ import { dirname as dirname20, isAbsolute as isAbsolute15, join as join20, resolve as resolve42 } from "path";
29873
29985
  import { fileURLToPath as fileURLToPath7 } from "url";
29874
29986
  var DEFAULT_UI_REL = join20("ui", "dist", "ui", "browser");
29875
29987
  var PACKAGE_UI_REL = "ui";
@@ -29880,7 +29992,7 @@ function resolveDefaultUiDist(ctx) {
29880
29992
  return walkUpForUi(ctx.cwd);
29881
29993
  }
29882
29994
  function resolveExplicitUiDist(ctx, raw) {
29883
- return isAbsolute15(raw) ? raw : resolve41(ctx.cwd, raw);
29995
+ return isAbsolute15(raw) ? raw : resolve42(ctx.cwd, raw);
29884
29996
  }
29885
29997
  function isUiBundleDir(path) {
29886
29998
  if (!existsSync31(path)) return false;
@@ -29914,7 +30026,7 @@ function resolvePackageBundledUiFrom(here) {
29914
30026
  return null;
29915
30027
  }
29916
30028
  function walkUpForUi(startDir) {
29917
- let current = resolve41(startDir);
30029
+ let current = resolve42(startDir);
29918
30030
  for (let i = 0; i < 64; i++) {
29919
30031
  const candidate = join20(current, DEFAULT_UI_REL);
29920
30032
  if (isUiBundleDir(candidate)) return candidate;
@@ -30968,7 +31080,7 @@ function rankConfidenceForGrouping(c) {
30968
31080
 
30969
31081
  // cli/commands/sidecar.ts
30970
31082
  import { unlink as unlink3 } from "fs/promises";
30971
- import { resolve as resolve42 } from "path";
31083
+ import { resolve as resolve43 } from "path";
30972
31084
  import { Command as Command37, Option as Option35 } from "clipanion";
30973
31085
 
30974
31086
  // cli/i18n/sidecar.texts.ts
@@ -31126,7 +31238,7 @@ var SidecarRefreshCommand = class extends SmCommand {
31126
31238
  let absPath;
31127
31239
  try {
31128
31240
  assertContained(ctx.cwd, node.path);
31129
- absPath = resolve42(ctx.cwd, node.path);
31241
+ absPath = resolve43(ctx.cwd, node.path);
31130
31242
  } catch (err) {
31131
31243
  this.printer.error(
31132
31244
  tx(SIDECAR_TEXTS.refreshFailed, { glyph: errGlyph, message: formatErrorMessage(err) })
@@ -31410,7 +31522,7 @@ var SidecarAnnotateCommand = class extends SmCommand {
31410
31522
  let absPath;
31411
31523
  try {
31412
31524
  assertContained(ctx.cwd, node.path);
31413
- absPath = resolve42(ctx.cwd, node.path);
31525
+ absPath = resolve43(ctx.cwd, node.path);
31414
31526
  } catch (err) {
31415
31527
  this.printer.error(
31416
31528
  tx(SIDECAR_TEXTS.annotateFailed, { glyph: errGlyph, message: formatErrorMessage(err) })
@@ -31662,7 +31774,7 @@ var STUB_COMMANDS = [
31662
31774
 
31663
31775
  // cli/commands/tutorial.ts
31664
31776
  import { cpSync as cpSync3, existsSync as existsSync33, mkdirSync as mkdirSync6, rmSync as rmSync2, statSync as statSync12 } from "fs";
31665
- import { dirname as dirname21, join as join21, resolve as resolve43 } from "path";
31777
+ import { dirname as dirname21, join as join21, resolve as resolve44 } from "path";
31666
31778
  import { createInterface as createInterface6 } from "readline";
31667
31779
  import { fileURLToPath as fileURLToPath8 } from "url";
31668
31780
  import { Command as Command39, Option as Option37 } from "clipanion";
@@ -31741,10 +31853,10 @@ var TutorialCommand = class extends SmCommand {
31741
31853
  overwrite the target directory unless --force is passed. Takes no
31742
31854
  positional argument.
31743
31855
 
31744
- By default only ready providers are offered as destinations. Pass
31745
- --experimental to also offer experimental ones (e.g. agent-skills);
31746
- they ship disabled, so enable the chosen one with
31747
- \`sm plugins enable <id>\` before scanning under its lens.
31856
+ By default only stable / beta providers are offered as destinations
31857
+ (today claude and the open-standard agent-skills). Pass --experimental
31858
+ to also offer experimental ones; they ship disabled, so enable the
31859
+ chosen one with \`sm plugins enable <id>\` before scanning under its lens.
31748
31860
  `,
31749
31861
  examples: [
31750
31862
  ["Materialize the tutorial skill in the cwd", "$0 tutorial"],
@@ -31768,7 +31880,7 @@ var TutorialCommand = class extends SmCommand {
31768
31880
  description: "Overwrite an existing target directory without prompting."
31769
31881
  });
31770
31882
  experimental = Option37.Boolean("--experimental", false, {
31771
- description: "Offer experimental providers (e.g. agent-skills) as destinations. They ship disabled; enable the chosen one with `sm plugins enable <id>`."
31883
+ description: "Offer experimental providers as destinations. They ship disabled; enable the chosen one with `sm plugins enable <id>`."
31772
31884
  });
31773
31885
  async run() {
31774
31886
  const ctx = defaultRuntimeContext();
@@ -31977,11 +32089,11 @@ function resolveSkillSourceDir() {
31977
32089
  const here = dirname21(fileURLToPath8(import.meta.url));
31978
32090
  const candidates = [
31979
32091
  // dev: src/cli/commands/ → repo-root .claude/skills/sm-tutorial/
31980
- resolve43(here, "../../..", SKILL_SOURCE_DIR),
32092
+ resolve44(here, "../../..", SKILL_SOURCE_DIR),
31981
32093
  // bundled: dist/cli.js → dist/cli/tutorial/sm-tutorial (sibling)
31982
- resolve43(here, "cli/tutorial", SKILL_SLUG),
32094
+ resolve44(here, "cli/tutorial", SKILL_SLUG),
31983
32095
  // bundled fallback: any-depth → cli/tutorial/sm-tutorial
31984
- resolve43(here, "../cli/tutorial", SKILL_SLUG)
32096
+ resolve44(here, "../cli/tutorial", SKILL_SLUG)
31985
32097
  ];
31986
32098
  for (const candidate of candidates) {
31987
32099
  if (existsSync33(candidate) && statSync12(candidate).isDirectory()) {
@@ -32227,4 +32339,4 @@ function resolveBareDefault() {
32227
32339
  process.exit(ExitCode.Error);
32228
32340
  }
32229
32341
  //# sourceMappingURL=cli.js.map
32230
- //# debugId=62413e88-87c9-5ddc-a41c-f64bac9cdf2f
32342
+ //# debugId=4ec5542f-63ef-5e2c-ab32-58a6c8be5dec