@skill-map/cli 0.65.0 → 0.67.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/tutorial/sm-tutorial/SKILL.md +1 -1
- package/dist/cli/tutorial/sm-tutorial/references/_core.md +4 -4
- package/dist/cli/tutorial/sm-tutorial/references/part-plugins.md +2 -2
- package/dist/cli/tutorial/sm-tutorial/references/part-project-kickoff.md +2 -2
- package/dist/cli/tutorial/sm-tutorial/references/part-settings.md +1 -1
- package/dist/cli.js +533 -385
- package/dist/conformance/index.js +7 -7
- package/dist/index.js +37 -17
- package/dist/kernel/index.d.ts +63 -28
- package/dist/kernel/index.js +37 -17
- package/dist/ui/chunk-444BFYGR.js +3 -0
- package/dist/ui/{chunk-SR2EXRNN.js → chunk-44VNNUSQ.js} +1 -1
- package/dist/ui/{chunk-FYATUDAH.js → chunk-5BJGO7GH.js} +8 -8
- package/dist/ui/chunk-HEK4PH5A.js +2 -0
- package/dist/ui/{chunk-PEBQMYAG.js → chunk-J4J42HJ4.js} +1 -1
- package/dist/ui/{chunk-JEWVC3KW.js → chunk-X6TRIDBI.js} +23 -21
- package/dist/ui/index.html +1 -1
- package/dist/ui/{main-HRIL5W5P.js → main-V77F2KZX.js} +3 -3
- package/package.json +2 -2
- package/dist/ui/chunk-DHF4CP3W.js +0 -3
- package/dist/ui/chunk-WDCUTF3U.js +0 -2
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]="
|
|
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]="8b8b0da7-bdb9-55ed-8dcd-0f983f8be006")}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.
|
|
253
|
+
version: "0.67.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-
|
|
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
|
|
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 = "
|
|
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
|
-
|
|
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,16 @@ 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
|
-
|
|
1011
|
+
// Also authorised under the codex and antigravity lenses, which share the
|
|
1012
|
+
// `/command` grammar. Under codex a sub-agent's prompt body (the TOML
|
|
1013
|
+
// `developer_instructions` field) has its `/command` tokens parsed for
|
|
1014
|
+
// pipeline parity; codex resolves them to its open-standard skills
|
|
1015
|
+
// (`invokes: ['skill']`). Under antigravity a workflow / skill / AGENTS.md
|
|
1016
|
+
// body's `/name` tokens resolve to BOTH skills and workflows
|
|
1017
|
+
// (`invokes: ['skill', 'workflow']`), since Antigravity invokes either by
|
|
1018
|
+
// the same slash. A lens that declares no `invokes` resolution leaves the
|
|
1019
|
+
// signals unresolved (no spurious edges).
|
|
1020
|
+
precondition: { provider: ["claude", "codex", "antigravity"] },
|
|
992
1021
|
extract(ctx) {
|
|
993
1022
|
const seen = /* @__PURE__ */ new Set();
|
|
994
1023
|
const body = stripCodeAndHtml(ctx.body);
|
|
@@ -1068,17 +1097,39 @@ function buildTooltip(names) {
|
|
|
1068
1097
|
return `${joined.slice(0, TOOLTIP_MAX - 1)}\u2026`;
|
|
1069
1098
|
}
|
|
1070
1099
|
|
|
1100
|
+
// plugins/antigravity/providers/antigravity/schemas/workflow.schema.json
|
|
1101
|
+
var workflow_schema_default = {
|
|
1102
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
1103
|
+
$id: "https://skill-map.ai/providers/antigravity/v1/frontmatter/workflow.schema.json",
|
|
1104
|
+
title: "FrontmatterAntigravityWorkflow",
|
|
1105
|
+
description: "Frontmatter shape for nodes classified as `workflow` by the Google Antigravity Provider. Workflows are standalone Markdown files under `.agent/workflows/<name>.md` (note the SINGULAR `.agent`, distinct from the open-standard `.agents/skills/` plural that Antigravity adopted for skills). A workflow file is YAML frontmatter followed by a numbered list of markdown steps; the agent runs it when invoked as the slash command `/<name>`, where the handle is ALWAYS the filename stem. Per the documented Antigravity workflow contract (https://antigravity.google/docs/rules-workflows) `description` is the ONLY frontmatter field: workflows have NO `name` field (unlike skills, where `name` is an optional override), so this schema requires `description` and declares no other property. The step body may carry execution-control comments, the shipped runtime documents `// turbo` (per-step) and `// turbo-all` (file-wide); those are body markup, not frontmatter, so they are not modelled here. `additionalProperties: true` lets any future frontmatter key flow through unchanged.",
|
|
1106
|
+
allOf: [
|
|
1107
|
+
{ $ref: "https://skill-map.ai/spec/v0/frontmatter/base.schema.json" }
|
|
1108
|
+
],
|
|
1109
|
+
type: "object",
|
|
1110
|
+
additionalProperties: true,
|
|
1111
|
+
required: ["description"],
|
|
1112
|
+
properties: {
|
|
1113
|
+
description: {
|
|
1114
|
+
type: "string",
|
|
1115
|
+
maxLength: 1024,
|
|
1116
|
+
description: "What the workflow does and when to run it. Antigravity surfaces it in the slash-command picker and uses it for smart detection; skill-map mirrors it on the node card. Required by the Antigravity workflow contract (the only documented workflow frontmatter field). Max 1024 chars, non-empty (minLength from the spec base)."
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1071
1121
|
// plugins/agent-skills/providers/agent-skills/schemas/skill.schema.json
|
|
1072
1122
|
var skill_schema_default2 = {
|
|
1073
1123
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
1074
1124
|
$id: "https://skill-map.ai/providers/agent-skills/v1/frontmatter/skill.schema.json",
|
|
1075
1125
|
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` (
|
|
1126
|
+
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
1127
|
allOf: [
|
|
1078
1128
|
{ $ref: "https://skill-map.ai/spec/v0/frontmatter/base.schema.json" }
|
|
1079
1129
|
],
|
|
1080
1130
|
type: "object",
|
|
1081
1131
|
additionalProperties: true,
|
|
1132
|
+
required: ["name", "description"],
|
|
1082
1133
|
properties: {
|
|
1083
1134
|
name: {
|
|
1084
1135
|
type: "string",
|
|
@@ -1167,9 +1218,14 @@ var agentSkillsProvider = {
|
|
|
1167
1218
|
// and the per-node provider chip. Neutral slate (this is the
|
|
1168
1219
|
// vendor-agnostic open-standard Provider, not a brand). The reusable
|
|
1169
1220
|
// open-standard pieces it owns use a `COMMONS_*` vocabulary internally;
|
|
1170
|
-
// the user-facing label
|
|
1221
|
+
// the user-facing label is the descriptive "Standard: Agent skills" (the
|
|
1222
|
+
// `Standard:` prefix marks it as the vendor-neutral lens, distinct from
|
|
1223
|
+
// the possessive `<Vendor>'s <product>` form the brand lenses use). This
|
|
1224
|
+
// is the single open lens shown in the selector when no vendor is active; the
|
|
1225
|
+
// non-gated `core/markdown` base sits underneath it and is never offered
|
|
1226
|
+
// as a lens of its own.
|
|
1171
1227
|
presentation: {
|
|
1172
|
-
label: "
|
|
1228
|
+
label: "Standard: Agent skills",
|
|
1173
1229
|
color: "#64748b",
|
|
1174
1230
|
colorDark: "#94a3b8"
|
|
1175
1231
|
},
|
|
@@ -1178,11 +1234,12 @@ var agentSkillsProvider = {
|
|
|
1178
1234
|
// (including `markdown`) it falls through to `core/markdown`, the sole
|
|
1179
1235
|
// universal provider. Keeps the "one active lens" model honest.
|
|
1180
1236
|
gatedByActiveLens: true,
|
|
1181
|
-
//
|
|
1182
|
-
//
|
|
1183
|
-
//
|
|
1184
|
-
//
|
|
1185
|
-
|
|
1237
|
+
// The open-standard lens is the universal default: stable and locked
|
|
1238
|
+
// enabled (`agent-skills/agent-skills` in the host lock-list), so it is
|
|
1239
|
+
// the lens a project falls back to when no vendor marker is present, and
|
|
1240
|
+
// it cannot be disabled out from under that role. Auto-detects `.agents/`
|
|
1241
|
+
// and classifies skills under its own lens.
|
|
1242
|
+
stability: "stable",
|
|
1186
1243
|
// Auto-detect marker: a `.agents/` directory marks an open-standard
|
|
1187
1244
|
// project. This is also the marker a Google/Antigravity project carries
|
|
1188
1245
|
// (Antigravity adopted the open standard). The marker only produces an
|
|
@@ -1195,7 +1252,7 @@ var agentSkillsProvider = {
|
|
|
1195
1252
|
// OpenAI Codex (skills mirror the open standard), so `aka` surfaces both
|
|
1196
1253
|
// names in the destination prompt to orient testers on those agents.
|
|
1197
1254
|
// `aka` is display-only, `--for` still matches the `agent-skills` id.
|
|
1198
|
-
scaffold: { skillDir: ".agents/skills", aka: ["Antigravity", "OpenAI Codex"] },
|
|
1255
|
+
scaffold: { skillDir: ".agents/skills", aka: ["Google's Antigravity", "OpenAI's Codex"] },
|
|
1199
1256
|
read: COMMONS_READ,
|
|
1200
1257
|
kinds: COMMONS_KINDS,
|
|
1201
1258
|
resolution: COMMONS_RESOLUTION,
|
|
@@ -1207,188 +1264,239 @@ var agentSkillsProvider = {
|
|
|
1207
1264
|
};
|
|
1208
1265
|
|
|
1209
1266
|
// plugins/antigravity/providers/antigravity/index.ts
|
|
1267
|
+
var ANTIGRAVITY_RESERVED_SLASH_VERBS = [
|
|
1268
|
+
// Inherited open-standard base (universal cross-agent slash commands).
|
|
1269
|
+
...COMMONS_RESERVED_NAMES["skill"] ?? [],
|
|
1270
|
+
// Antigravity-specific verbs (not part of the open-standard base).
|
|
1271
|
+
"artifact",
|
|
1272
|
+
"branch",
|
|
1273
|
+
"btw",
|
|
1274
|
+
"changelog",
|
|
1275
|
+
"context",
|
|
1276
|
+
"conversation",
|
|
1277
|
+
"copy",
|
|
1278
|
+
"credits",
|
|
1279
|
+
"diff",
|
|
1280
|
+
"fast",
|
|
1281
|
+
"fork",
|
|
1282
|
+
"goal",
|
|
1283
|
+
"grill-me",
|
|
1284
|
+
"keybindings",
|
|
1285
|
+
"new",
|
|
1286
|
+
"open",
|
|
1287
|
+
"planning",
|
|
1288
|
+
"quota",
|
|
1289
|
+
"rename",
|
|
1290
|
+
"rewind",
|
|
1291
|
+
"schedule",
|
|
1292
|
+
"settings",
|
|
1293
|
+
"skills",
|
|
1294
|
+
"switch",
|
|
1295
|
+
"tasks",
|
|
1296
|
+
"title",
|
|
1297
|
+
"undo"
|
|
1298
|
+
];
|
|
1210
1299
|
var antigravityProvider = {
|
|
1211
1300
|
id: "antigravity",
|
|
1212
1301
|
pluginId: ANTIGRAVITY_PLUGIN_ID,
|
|
1213
1302
|
kind: "provider",
|
|
1214
|
-
description: "
|
|
1303
|
+
description: "Classifies `.agent/workflows/*.md` as Antigravity workflows and `.agents/skills/*/SKILL.md` as skills (open standard); declares the Antigravity runtime identity and its reserved built-in names.",
|
|
1215
1304
|
// Provider identity for the active-lens dropdown, the topbar lens chip,
|
|
1216
1305
|
// and the per-node provider chip. Antigravity violet, distinct from the
|
|
1217
1306
|
// other vendor palettes.
|
|
1218
1307
|
presentation: {
|
|
1219
|
-
label: "Antigravity",
|
|
1308
|
+
label: "Google's Antigravity",
|
|
1220
1309
|
color: "#7c3aed",
|
|
1221
1310
|
colorDark: "#a78bfa"
|
|
1222
1311
|
},
|
|
1223
|
-
//
|
|
1224
|
-
// (
|
|
1225
|
-
//
|
|
1226
|
-
//
|
|
1227
|
-
//
|
|
1228
|
-
//
|
|
1229
|
-
|
|
1230
|
-
//
|
|
1231
|
-
//
|
|
1312
|
+
// Auto-detect marker: Antigravity's workflows live under `.agent/workflows/`
|
|
1313
|
+
// (SINGULAR `.agent`), its one vendor-specific on-disk territory. Skills
|
|
1314
|
+
// live under the shared open-standard `.agents/` (owned by `agent-skills`),
|
|
1315
|
+
// so they are deliberately NOT a marker here. Now that antigravity ships
|
|
1316
|
+
// `beta` (enabled by default), this marker is live: a `.agent/workflows/`
|
|
1317
|
+
// project auto-detects the antigravity lens.
|
|
1318
|
+
detect: { markers: [".agent/workflows"] },
|
|
1319
|
+
// Vendor provider: Antigravity declares its own `workflow` kind
|
|
1320
|
+
// (`.agent/workflows/*.md`) on top of the open-standard skills it adopts.
|
|
1321
|
+
// Gating the classifier behind the active lens keeps the walker from
|
|
1322
|
+
// claiming Antigravity workflows under another lens, where the Antigravity
|
|
1323
|
+
// runtime would never resolve them anyway.
|
|
1232
1324
|
gatedByActiveLens: true,
|
|
1233
|
-
//
|
|
1234
|
-
//
|
|
1235
|
-
//
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
// `
|
|
1239
|
-
//
|
|
1240
|
-
//
|
|
1241
|
-
// `
|
|
1242
|
-
// below apply via SELF scope. `agent-skills` itself is gated to its own
|
|
1243
|
-
// lens, so it never competes here (under the antigravity lens it does
|
|
1244
|
-
// not participate). This is why there is no cross-provider lens-scope
|
|
1245
|
-
// rule in the kernel any more.
|
|
1325
|
+
// Beta: ships ENABLED by default (auto-detects `.agent/workflows/`,
|
|
1326
|
+
// selectable as the active lens) with a maturity badge, the same posture
|
|
1327
|
+
// as codex, since the workflow kind + slash wiring are freshly landed.
|
|
1328
|
+
// Promote to `stable` (drop the field) once it has real-world mileage.
|
|
1329
|
+
stability: "beta",
|
|
1330
|
+
// `.md` + YAML frontmatter covers BOTH families (skills and workflows);
|
|
1331
|
+
// a single read rule suffices because the parser/extension are identical,
|
|
1332
|
+
// `classify()` below routes each path to its kind. (Codex needs a
|
|
1333
|
+
// multi-rule `read` only because it mixes `.toml` + `.md`.)
|
|
1246
1334
|
read: COMMONS_READ,
|
|
1247
|
-
kinds:
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
//
|
|
1251
|
-
//
|
|
1252
|
-
// `
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
//
|
|
1273
|
-
//
|
|
1274
|
-
//
|
|
1275
|
-
// `
|
|
1335
|
+
// Two kinds: the open-standard `skill` (inherited from `agent-skills` by
|
|
1336
|
+
// manifest composition, so under the antigravity lens
|
|
1337
|
+
// `.agents/skills/<name>/SKILL.md` classifies as
|
|
1338
|
+
// `{ provider: 'antigravity', kind: 'skill' }` and the reservedNames below
|
|
1339
|
+
// apply via SELF scope) and the OWN `workflow` (`.agent/workflows/*.md`).
|
|
1340
|
+
// `agent-skills` itself is gated to its own lens, so it never competes here.
|
|
1341
|
+
kinds: {
|
|
1342
|
+
...COMMONS_KINDS,
|
|
1343
|
+
workflow: {
|
|
1344
|
+
schema: "./schemas/workflow.schema.json",
|
|
1345
|
+
schemaJson: workflow_schema_default,
|
|
1346
|
+
ui: {
|
|
1347
|
+
label: "Workflows",
|
|
1348
|
+
// Antigravity violet, so a workflow node reads as Antigravity's own
|
|
1349
|
+
// (skills keep the normalised cross-provider green of COMMONS_KINDS).
|
|
1350
|
+
color: "#7c3aed",
|
|
1351
|
+
colorDark: "#a78bfa",
|
|
1352
|
+
icon: { kind: "pi", id: "pi-sitemap" }
|
|
1353
|
+
},
|
|
1354
|
+
// The handle is ALWAYS the filename stem (`/<name>`): Antigravity
|
|
1355
|
+
// workflows have no `name` frontmatter field (unlike skills), so there
|
|
1356
|
+
// is no override source, only `filename-basename`.
|
|
1357
|
+
identifiers: ["filename-basename"]
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1360
|
+
// `/<name>` slash invocations resolve to BOTH skills and workflows: under
|
|
1361
|
+
// the antigravity lens a `/deploy` links to either `.agents/skills/deploy`
|
|
1362
|
+
// or `.agent/workflows/deploy.md`. Overrides the open-standard default
|
|
1363
|
+
// (`invokes: ['skill']`) to add the own `workflow` kind.
|
|
1364
|
+
resolution: { invokes: ["skill", "workflow"] },
|
|
1365
|
+
classify(path) {
|
|
1366
|
+
if (/^\.agent\/workflows\/[^/]+\.md$/.test(path.toLowerCase())) return "workflow";
|
|
1367
|
+
return classifyCommonsPath(path);
|
|
1368
|
+
},
|
|
1369
|
+
// Reserved-name catalog (`ANTIGRAVITY_RESERVED_SLASH_VERBS`, defined above).
|
|
1370
|
+
// Applied to BOTH `skill` and `workflow`: Antigravity invokes either kind
|
|
1371
|
+
// by the same `/<name>` slash, so a user file of either kind named after a
|
|
1372
|
+
// built-in is silently shadowed. `core/name-reserved` tests each node
|
|
1373
|
+
// against `reservedNames[node.kind]`, so both keys must carry the catalog.
|
|
1276
1374
|
reservedNames: {
|
|
1277
|
-
skill:
|
|
1278
|
-
|
|
1279
|
-
...COMMONS_RESERVED_NAMES["skill"] ?? [],
|
|
1280
|
-
// Antigravity-specific verbs (not part of the open-standard base).
|
|
1281
|
-
"artifact",
|
|
1282
|
-
"branch",
|
|
1283
|
-
"btw",
|
|
1284
|
-
"changelog",
|
|
1285
|
-
"context",
|
|
1286
|
-
"conversation",
|
|
1287
|
-
"copy",
|
|
1288
|
-
"credits",
|
|
1289
|
-
"diff",
|
|
1290
|
-
"fast",
|
|
1291
|
-
"fork",
|
|
1292
|
-
"goal",
|
|
1293
|
-
"grill-me",
|
|
1294
|
-
"keybindings",
|
|
1295
|
-
"new",
|
|
1296
|
-
"open",
|
|
1297
|
-
"planning",
|
|
1298
|
-
"quota",
|
|
1299
|
-
"rename",
|
|
1300
|
-
"rewind",
|
|
1301
|
-
"schedule",
|
|
1302
|
-
"settings",
|
|
1303
|
-
"skills",
|
|
1304
|
-
"switch",
|
|
1305
|
-
"tasks",
|
|
1306
|
-
"title",
|
|
1307
|
-
"undo"
|
|
1308
|
-
]
|
|
1375
|
+
skill: ANTIGRAVITY_RESERVED_SLASH_VERBS,
|
|
1376
|
+
workflow: ANTIGRAVITY_RESERVED_SLASH_VERBS
|
|
1309
1377
|
}
|
|
1310
1378
|
};
|
|
1311
1379
|
|
|
1312
|
-
// plugins/
|
|
1380
|
+
// plugins/codex/providers/codex/schemas/agent.schema.json
|
|
1313
1381
|
var agent_schema_default2 = {
|
|
1314
1382
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
1315
|
-
$id: "https://skill-map.ai/providers/
|
|
1383
|
+
$id: "https://skill-map.ai/providers/codex/v1/frontmatter/agent.schema.json",
|
|
1316
1384
|
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.
|
|
1385
|
+
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
1386
|
allOf: [
|
|
1319
1387
|
{ $ref: "https://skill-map.ai/spec/v0/frontmatter/base.schema.json" }
|
|
1320
1388
|
],
|
|
1321
1389
|
type: "object",
|
|
1322
1390
|
additionalProperties: true,
|
|
1391
|
+
required: ["name", "description", "developer_instructions"],
|
|
1323
1392
|
properties: {
|
|
1324
1393
|
name: {
|
|
1325
1394
|
type: "string",
|
|
1326
1395
|
minLength: 1,
|
|
1327
|
-
description: "Sub-agent identifier. Conventionally matches the filename stem."
|
|
1396
|
+
description: "Sub-agent identifier used when spawning the agent. Conventionally matches the filename stem."
|
|
1328
1397
|
},
|
|
1329
1398
|
description: {
|
|
1330
1399
|
type: "string",
|
|
1331
1400
|
description: "Short description of when this sub-agent applies. Codex surfaces this in the agent picker; skill-map mirrors it in the card."
|
|
1332
1401
|
},
|
|
1402
|
+
developer_instructions: {
|
|
1403
|
+
type: "string",
|
|
1404
|
+
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."
|
|
1405
|
+
},
|
|
1333
1406
|
model: {
|
|
1334
1407
|
type: "string",
|
|
1335
|
-
description: "Model identifier (`gpt-
|
|
1408
|
+
description: "Model identifier (`gpt-5-codex`, `gpt-5.4`, ...) the sub-agent runs against. Inherits the parent's model when omitted."
|
|
1336
1409
|
},
|
|
1337
|
-
|
|
1410
|
+
model_reasoning_effort: {
|
|
1338
1411
|
type: "string",
|
|
1339
|
-
|
|
1412
|
+
enum: ["minimal", "low", "medium", "high", "xhigh"],
|
|
1413
|
+
description: "Reasoning effort the sub-agent runs at (`xhigh` is model-dependent). Inherits the parent's setting when omitted."
|
|
1340
1414
|
},
|
|
1341
|
-
|
|
1342
|
-
type: "
|
|
1343
|
-
|
|
1344
|
-
description: "
|
|
1415
|
+
sandbox_mode: {
|
|
1416
|
+
type: "string",
|
|
1417
|
+
enum: ["read-only", "workspace-write", "danger-full-access"],
|
|
1418
|
+
description: "Codex sandbox mode the sub-agent runs under. Inherits the parent's policy when omitted."
|
|
1345
1419
|
},
|
|
1346
|
-
|
|
1420
|
+
nickname_candidates: {
|
|
1347
1421
|
type: "array",
|
|
1348
1422
|
items: { type: "string" },
|
|
1349
|
-
description: "
|
|
1423
|
+
description: "Pool of display names Codex draws from when spawning instances of this sub-agent."
|
|
1350
1424
|
},
|
|
1351
|
-
|
|
1352
|
-
type: "
|
|
1353
|
-
|
|
1354
|
-
description: "
|
|
1425
|
+
mcp_servers: {
|
|
1426
|
+
type: "object",
|
|
1427
|
+
additionalProperties: { type: "object" },
|
|
1428
|
+
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
1429
|
},
|
|
1356
|
-
|
|
1357
|
-
type: "
|
|
1358
|
-
|
|
1359
|
-
description: "
|
|
1430
|
+
skills: {
|
|
1431
|
+
type: "object",
|
|
1432
|
+
additionalProperties: true,
|
|
1433
|
+
description: "Skill overrides for this sub-agent. The `config` array (`[[skills.config]]` in TOML) lists skills by path with an enabled flag.",
|
|
1434
|
+
properties: {
|
|
1435
|
+
config: {
|
|
1436
|
+
type: "array",
|
|
1437
|
+
items: {
|
|
1438
|
+
type: "object",
|
|
1439
|
+
additionalProperties: true,
|
|
1440
|
+
properties: {
|
|
1441
|
+
path: { type: "string", description: "Path to the skill's SKILL.md." },
|
|
1442
|
+
enabled: { type: "boolean", description: "Whether the skill is active for this sub-agent." }
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1360
1447
|
}
|
|
1361
1448
|
}
|
|
1362
1449
|
};
|
|
1363
1450
|
|
|
1364
|
-
// plugins/
|
|
1365
|
-
var
|
|
1366
|
-
id: "
|
|
1451
|
+
// plugins/codex/providers/codex/index.ts
|
|
1452
|
+
var codexProvider = {
|
|
1453
|
+
id: "codex",
|
|
1367
1454
|
pluginId: OPENAI_PLUGIN_ID,
|
|
1368
1455
|
kind: "provider",
|
|
1369
|
-
description: "Classifies
|
|
1456
|
+
description: "Classifies `.codex/agents/*.toml` as OpenAI Codex CLI sub-agents and `.agents/skills/*/SKILL.md` as Codex skills (open standard).",
|
|
1370
1457
|
// Provider identity for the active-lens dropdown, the topbar lens chip,
|
|
1371
1458
|
// and the per-node provider chip. Codex green, distinct from the Claude
|
|
1372
1459
|
// palette so the chip reads at a glance.
|
|
1373
1460
|
presentation: {
|
|
1374
|
-
label: "OpenAI Codex",
|
|
1461
|
+
label: "OpenAI's Codex",
|
|
1375
1462
|
color: "#22c55e",
|
|
1376
1463
|
colorDark: "#4ade80"
|
|
1377
1464
|
},
|
|
1378
|
-
// Auto-detect
|
|
1379
|
-
//
|
|
1380
|
-
//
|
|
1381
|
-
detect
|
|
1382
|
-
//
|
|
1383
|
-
//
|
|
1384
|
-
//
|
|
1385
|
-
//
|
|
1465
|
+
// Auto-detect marker: a `.codex/` directory marks a Codex CLI project.
|
|
1466
|
+
// `AGENTS.md` is intentionally NOT a marker: it is the open agents.md
|
|
1467
|
+
// standard (present in many non-Codex repos, and commonly alongside a
|
|
1468
|
+
// `.claude/` directory), so keying auto-detect off it would mis-route a
|
|
1469
|
+
// plain-markdown repo to the Codex lens and force an ambiguous prompt on
|
|
1470
|
+
// any project that carries both. `.agents/` is likewise NOT a marker: it
|
|
1471
|
+
// is the vendor-neutral open standard (owned by `agent-skills` for
|
|
1472
|
+
// auto-detect), so a project that only carries `.agents/skills/` is an
|
|
1473
|
+
// open-standard project, not necessarily a Codex one. A genuine Codex
|
|
1474
|
+
// project is identified by `.codex/`.
|
|
1475
|
+
detect: { markers: [".codex"] },
|
|
1476
|
+
// Vendor provider: Codex CLI only reads its own territory (its `.codex/`
|
|
1477
|
+
// agents plus the open `.agents/skills/` skills it adopted). Gating the
|
|
1478
|
+
// classifier behind the active lens keeps the walker from claiming Codex
|
|
1479
|
+
// agents under a `claude` (or any other) lens, where the Codex runtime
|
|
1480
|
+
// would never resolve them anyway.
|
|
1386
1481
|
gatedByActiveLens: true,
|
|
1387
|
-
//
|
|
1388
|
-
//
|
|
1389
|
-
//
|
|
1390
|
-
|
|
1391
|
-
|
|
1482
|
+
// Beta: ships enabled by default (auto-detects `.codex/`, selectable as
|
|
1483
|
+
// the active lens) with a maturity badge, since the Codex body extractor
|
|
1484
|
+
// is freshly landed. Promote to `stable` (drop the field) once it has
|
|
1485
|
+
// real-world mileage.
|
|
1486
|
+
stability: "beta",
|
|
1487
|
+
// Multi-rule read: `.toml` sub-agents and `.md` open-standard skills,
|
|
1488
|
+
// each with its own parser. `resolveProviderWalk` runs one walk pass per
|
|
1489
|
+
// rule; the extensions are disjoint.
|
|
1490
|
+
// 1. Codex sub-agents are pure TOML (`parser: 'toml'`); the markdown
|
|
1491
|
+
// prompt is the triple-quoted `developer_instructions` field, fed
|
|
1492
|
+
// to the body pipeline via `bodyField` so the universal body
|
|
1493
|
+
// extractors plus the lens-gated at-directive / slash run over it.
|
|
1494
|
+
// 2. Skills reuse the open-standard `agent-skills` read config
|
|
1495
|
+
// (`COMMONS_READ`: `.md` + `frontmatter-yaml`).
|
|
1496
|
+
read: [
|
|
1497
|
+
{ extensions: [".toml"], parser: "toml", bodyField: "developer_instructions" },
|
|
1498
|
+
COMMONS_READ
|
|
1499
|
+
],
|
|
1392
1500
|
kinds: {
|
|
1393
1501
|
agent: {
|
|
1394
1502
|
schema: "./schemas/agent.schema.json",
|
|
@@ -1405,18 +1513,30 @@ var openaiProvider = {
|
|
|
1405
1513
|
// the TOML structured frontmatter when the author declared it
|
|
1406
1514
|
// explicitly.
|
|
1407
1515
|
identifiers: ["frontmatter.name", "filename-basename"]
|
|
1408
|
-
}
|
|
1516
|
+
},
|
|
1517
|
+
// Open-standard `skill` kind, inherited from `agent-skills` by manifest
|
|
1518
|
+
// composition (same schema + UI every standard adopter shares).
|
|
1519
|
+
// `.agents/skills/<name>/SKILL.md` resolves by dirname or
|
|
1520
|
+
// `frontmatter.name`.
|
|
1521
|
+
...COMMONS_KINDS
|
|
1409
1522
|
},
|
|
1410
|
-
//
|
|
1411
|
-
//
|
|
1412
|
-
// the
|
|
1523
|
+
// Mentions resolve to agents (`@<name>`, the Codex sub-agent handle).
|
|
1524
|
+
// Slash invocations resolve to skills (`invokes: ['skill']`, inherited
|
|
1525
|
+
// from the open standard), so a `/skill-name` in an agent's prompt links
|
|
1526
|
+
// to its `.agents/skills/` skill.
|
|
1413
1527
|
resolution: {
|
|
1414
|
-
mentions: ["agent"]
|
|
1528
|
+
mentions: ["agent"],
|
|
1529
|
+
...COMMONS_RESOLUTION
|
|
1415
1530
|
},
|
|
1531
|
+
// Open-standard reserved-name base (the universal cross-agent slash
|
|
1532
|
+
// verbs an agent CLI ships built-in), inherited from `agent-skills` and
|
|
1533
|
+
// applied under the codex lens via SELF scope: a user skill that shadows
|
|
1534
|
+
// one is flagged by `core/name-reserved`.
|
|
1535
|
+
reservedNames: COMMONS_RESERVED_NAMES,
|
|
1416
1536
|
classify(path) {
|
|
1417
1537
|
const lower = path.toLowerCase();
|
|
1418
1538
|
if (lower.startsWith(".codex/agents/") && lower.endsWith(".toml")) return "agent";
|
|
1419
|
-
return
|
|
1539
|
+
return classifyCommonsPath(path);
|
|
1420
1540
|
}
|
|
1421
1541
|
};
|
|
1422
1542
|
|
|
@@ -1442,17 +1562,23 @@ var coreMarkdownProvider = {
|
|
|
1442
1562
|
// Provider identity. `hideChip: true` suppresses the per-card provider
|
|
1443
1563
|
// chip: this fallback carries the majority of nodes in any project, so
|
|
1444
1564
|
// badging every generic `.md` would be noise and dilute the chip's
|
|
1445
|
-
// purpose (signalling a NON-default platform).
|
|
1446
|
-
//
|
|
1565
|
+
// purpose (signalling a NON-default platform). This Provider is the
|
|
1566
|
+
// non-gated universal BASE, not a lens: `gatedByActiveLens` is false, so
|
|
1567
|
+
// the BFF projects `isLens: false` and the UI never lists it in the
|
|
1568
|
+
// active-lens dropdown nor as the topbar lens chip. The label is retained
|
|
1569
|
+
// only for internal registry lookups (and any legacy node still tagged
|
|
1570
|
+
// `provider: 'markdown'`).
|
|
1447
1571
|
presentation: {
|
|
1448
1572
|
label: "Markdown",
|
|
1449
1573
|
color: "#9ca3af",
|
|
1450
1574
|
colorDark: "#6b7280",
|
|
1451
1575
|
hideChip: true
|
|
1452
1576
|
},
|
|
1453
|
-
// No `detect` block: the universal
|
|
1454
|
-
//
|
|
1455
|
-
//
|
|
1577
|
+
// No `detect` block: the universal base is never auto-suggested, and
|
|
1578
|
+
// since it is non-gated (`gatedByActiveLens` omitted == false) it is not
|
|
1579
|
+
// a selectable lens at all. A no-vendor project resolves to the
|
|
1580
|
+
// open-standard `agent-skills` default lens; this base runs underneath
|
|
1581
|
+
// every lens regardless.
|
|
1456
1582
|
read: { extensions: [".md"], parser: "frontmatter-yaml" },
|
|
1457
1583
|
// Per spec § A.6, defaultRefreshAction values MUST be qualified
|
|
1458
1584
|
// action ids. The summarize-markdown action is not yet implemented
|
|
@@ -3253,13 +3379,6 @@ function existsSyncSafe(path) {
|
|
|
3253
3379
|
}
|
|
3254
3380
|
}
|
|
3255
3381
|
|
|
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
3382
|
// plugins/core/analyzers/schema-violation/text.ts
|
|
3264
3383
|
var SCHEMA_VIOLATION_TEXTS = {
|
|
3265
3384
|
// Diagnosis bodies (`<what>; <why>`). The shared `formatFinding` helper
|
|
@@ -3270,8 +3389,6 @@ var SCHEMA_VIOLATION_TEXTS = {
|
|
|
3270
3389
|
nodeFailure: "Schema validation failed; {{errors}}",
|
|
3271
3390
|
/** `<target>` subject + `Link failed schema validation; <errors>` */
|
|
3272
3391
|
linkFailure: "Link failed schema validation; {{errors}}",
|
|
3273
|
-
/** `Missing required frontmatter; <missing>` */
|
|
3274
|
-
frontmatterBaseFailure: "Missing required frontmatter; {{missing}}",
|
|
3275
3392
|
/** Singular tooltip on the alert / chip when a node has exactly one validation failure. */
|
|
3276
3393
|
alertTooltipSingle: "Frontmatter or schema validation failed.",
|
|
3277
3394
|
/** Plural tooltip; `{{count}}` capped at 99 in the chip badge but the tooltip text shows the raw count. */
|
|
@@ -3302,11 +3419,9 @@ var schemaViolationAnalyzer = {
|
|
|
3302
3419
|
const validators = loadSchemaValidators();
|
|
3303
3420
|
const findings = [];
|
|
3304
3421
|
const perNode = /* @__PURE__ */ new Map();
|
|
3305
|
-
const kernelFlaggedNodes = collectKernelFlaggedNodes(ctx.accumulatedIssues);
|
|
3306
3422
|
for (const node of ctx.nodes) {
|
|
3307
3423
|
const before = findings.length;
|
|
3308
3424
|
collectNodeFindings(validators, node, findings);
|
|
3309
|
-
collectFrontmatterBaseFindings(node, findings, kernelFlaggedNodes);
|
|
3310
3425
|
if (findings.length > before) {
|
|
3311
3426
|
let worst = "warn";
|
|
3312
3427
|
for (let i = before; i < findings.length; i++) {
|
|
@@ -3344,43 +3459,6 @@ function collectNodeFindings(v, node, out) {
|
|
|
3344
3459
|
data: { target: "node", path: node.path }
|
|
3345
3460
|
});
|
|
3346
3461
|
}
|
|
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
3462
|
function collectLinkFindings(v, link, out) {
|
|
3385
3463
|
const result = v.validate("link", toLinkForSchema(link));
|
|
3386
3464
|
if (result.ok) return;
|
|
@@ -4155,12 +4233,13 @@ function writeJsonAtomic(path, content) {
|
|
|
4155
4233
|
}
|
|
4156
4234
|
|
|
4157
4235
|
// core/paths/db-path.ts
|
|
4158
|
-
import { join as join2, resolve as
|
|
4236
|
+
import { join as join2, resolve as resolve6 } from "path";
|
|
4159
4237
|
|
|
4160
4238
|
// kernel/util/skill-map-paths.ts
|
|
4161
|
-
import { join } from "path";
|
|
4239
|
+
import { dirname as dirname5, join, resolve as resolve5 } from "path";
|
|
4162
4240
|
var SKILL_MAP_DIR = ".skill-map";
|
|
4163
4241
|
var KERNEL_SKILL_MAP_DIR = SKILL_MAP_DIR;
|
|
4242
|
+
var BACKUPS_DIRNAME = "backups";
|
|
4164
4243
|
var SETTINGS_FILENAME = "settings.json";
|
|
4165
4244
|
var LOCAL_SETTINGS_FILENAME = "settings.local.json";
|
|
4166
4245
|
function kernelSettingsPath(scopeRoot) {
|
|
@@ -4169,6 +4248,9 @@ function kernelSettingsPath(scopeRoot) {
|
|
|
4169
4248
|
function kernelLocalSettingsPath(scopeRoot) {
|
|
4170
4249
|
return join(scopeRoot, KERNEL_SKILL_MAP_DIR, LOCAL_SETTINGS_FILENAME);
|
|
4171
4250
|
}
|
|
4251
|
+
function kernelBackupsDir(dbPath) {
|
|
4252
|
+
return join(dirname5(resolve5(dbPath)), BACKUPS_DIRNAME);
|
|
4253
|
+
}
|
|
4172
4254
|
|
|
4173
4255
|
// core/paths/db-path.ts
|
|
4174
4256
|
var DB_FILENAME = "skill-map.db";
|
|
@@ -4183,17 +4265,20 @@ var GITIGNORE_ENTRIES = [
|
|
|
4183
4265
|
`${SKILL_MAP_DIR}/${DB_FILENAME}`
|
|
4184
4266
|
];
|
|
4185
4267
|
function resolveDbPath(options) {
|
|
4186
|
-
if (options.db) return
|
|
4187
|
-
return
|
|
4268
|
+
if (options.db) return resolve6(options.db);
|
|
4269
|
+
return resolve6(options.cwd, DEFAULT_DB_REL);
|
|
4188
4270
|
}
|
|
4189
4271
|
function defaultProjectDbPath(ctx) {
|
|
4190
|
-
return
|
|
4272
|
+
return resolve6(ctx.cwd, DEFAULT_DB_REL);
|
|
4191
4273
|
}
|
|
4192
4274
|
function defaultProjectJobsDir(ctx) {
|
|
4193
|
-
return
|
|
4275
|
+
return resolve6(ctx.cwd, SKILL_MAP_DIR, JOBS_DIRNAME);
|
|
4194
4276
|
}
|
|
4195
4277
|
function defaultProjectPluginsDir(ctx) {
|
|
4196
|
-
return
|
|
4278
|
+
return resolve6(ctx.cwd, SKILL_MAP_DIR, PLUGINS_DIRNAME);
|
|
4279
|
+
}
|
|
4280
|
+
function backupsDirForDb(dbPath) {
|
|
4281
|
+
return kernelBackupsDir(dbPath);
|
|
4197
4282
|
}
|
|
4198
4283
|
function defaultDbPath(scopeRoot) {
|
|
4199
4284
|
return join2(scopeRoot, SKILL_MAP_DIR, DB_FILENAME);
|
|
@@ -4430,7 +4515,7 @@ var atDirectiveExtractor2 = { ...atDirectiveExtractor, pluginId: "claude", versi
|
|
|
4430
4515
|
var slashCommandExtractor2 = { ...slashCommandExtractor, pluginId: "claude", version: VERSION };
|
|
4431
4516
|
var toolsCounterExtractor2 = { ...toolsCounterExtractor, pluginId: "claude", version: VERSION };
|
|
4432
4517
|
var antigravityProvider2 = { ...antigravityProvider, pluginId: "antigravity", version: VERSION };
|
|
4433
|
-
var
|
|
4518
|
+
var codexProvider2 = { ...codexProvider, pluginId: "codex", version: VERSION };
|
|
4434
4519
|
var agentSkillsProvider2 = { ...agentSkillsProvider, pluginId: "agent-skills", version: VERSION };
|
|
4435
4520
|
var coreMarkdownProvider2 = { ...coreMarkdownProvider, pluginId: "core", version: VERSION };
|
|
4436
4521
|
var backtickPathExtractor2 = { ...backtickPathExtractor, pluginId: "core", version: VERSION };
|
|
@@ -4471,16 +4556,16 @@ var builtInPlugins = [
|
|
|
4471
4556
|
},
|
|
4472
4557
|
{
|
|
4473
4558
|
id: "antigravity",
|
|
4474
|
-
description: "Google Antigravity CLI platform integration (replaces the retired Gemini CLI). Antigravity
|
|
4559
|
+
description: "Google Antigravity CLI platform integration (replaces the retired Gemini CLI). Classifies Antigravity workflows under `.agent/workflows/*.md` (its own kind) and adopts the open-standard `.agents/skills/` layout for skills; contributes the Antigravity runtime identity and reserved built-in names.",
|
|
4475
4560
|
extensions: [
|
|
4476
4561
|
antigravityProvider2
|
|
4477
4562
|
]
|
|
4478
4563
|
},
|
|
4479
4564
|
{
|
|
4480
|
-
id: "
|
|
4565
|
+
id: "codex",
|
|
4481
4566
|
description: "OpenAI Codex CLI platform integration. Classifies TOML sub-agent definitions under `.codex/agents/*.toml`.",
|
|
4482
4567
|
extensions: [
|
|
4483
|
-
|
|
4568
|
+
codexProvider2
|
|
4484
4569
|
]
|
|
4485
4570
|
},
|
|
4486
4571
|
{
|
|
@@ -5218,7 +5303,7 @@ async function closeSentryCli(timeoutMs = 2e3) {
|
|
|
5218
5303
|
var BUILT_IN_PLUGIN_IDS = /* @__PURE__ */ new Set([
|
|
5219
5304
|
"claude",
|
|
5220
5305
|
"antigravity",
|
|
5221
|
-
"
|
|
5306
|
+
"codex",
|
|
5222
5307
|
"agent-skills",
|
|
5223
5308
|
"core"
|
|
5224
5309
|
]);
|
|
@@ -5408,7 +5493,7 @@ import { Command as Command2, Option as Option2 } from "clipanion";
|
|
|
5408
5493
|
|
|
5409
5494
|
// core/config/helper.ts
|
|
5410
5495
|
import { homedir as osHomedir } from "os";
|
|
5411
|
-
import { isAbsolute, join as join4, resolve as
|
|
5496
|
+
import { isAbsolute, join as join4, resolve as resolve7, sep } from "path";
|
|
5412
5497
|
|
|
5413
5498
|
// kernel/config/loader.ts
|
|
5414
5499
|
import { existsSync as existsSync5, readFileSync as readFileSync6 } from "fs";
|
|
@@ -5828,13 +5913,13 @@ function projectPathExposure(inputs) {
|
|
|
5828
5913
|
return { expandsSurface: true, exposedPaths: exposed };
|
|
5829
5914
|
}
|
|
5830
5915
|
function resolveScanPathForExposure(raw, cwd) {
|
|
5831
|
-
if (raw.startsWith("~/")) return
|
|
5832
|
-
if (raw === "~") return
|
|
5833
|
-
if (isAbsolute(raw)) return
|
|
5834
|
-
return
|
|
5916
|
+
if (raw.startsWith("~/")) return resolve7(join4(osHomedir(), raw.slice(2)));
|
|
5917
|
+
if (raw === "~") return resolve7(osHomedir());
|
|
5918
|
+
if (isAbsolute(raw)) return resolve7(raw);
|
|
5919
|
+
return resolve7(cwd, raw);
|
|
5835
5920
|
}
|
|
5836
5921
|
function isUnderProject(absPath, cwd) {
|
|
5837
|
-
const projectRoot =
|
|
5922
|
+
const projectRoot = resolve7(cwd);
|
|
5838
5923
|
return absPath === projectRoot || absPath.startsWith(`${projectRoot}${sep}`);
|
|
5839
5924
|
}
|
|
5840
5925
|
|
|
@@ -5895,7 +5980,7 @@ function ensureSidecarWritesAllowed(opts) {
|
|
|
5895
5980
|
|
|
5896
5981
|
// kernel/sidecar/store.ts
|
|
5897
5982
|
import { existsSync as existsSync6, readFileSync as readFileSync7 } from "fs";
|
|
5898
|
-
import { dirname as
|
|
5983
|
+
import { dirname as dirname6, resolve as resolve8 } from "path";
|
|
5899
5984
|
import { createRequire as createRequire4 } from "module";
|
|
5900
5985
|
import { Ajv2020 as Ajv20204 } from "ajv/dist/2020.js";
|
|
5901
5986
|
import yaml2 from "js-yaml";
|
|
@@ -6003,10 +6088,10 @@ function getSidecarValidator2() {
|
|
|
6003
6088
|
applyAjvFormats(ajv);
|
|
6004
6089
|
const specRoot = resolveSpecRoot3();
|
|
6005
6090
|
const annotationsSchema = JSON.parse(
|
|
6006
|
-
readFileSync7(
|
|
6091
|
+
readFileSync7(resolve8(specRoot, "schemas/annotations.schema.json"), "utf8")
|
|
6007
6092
|
);
|
|
6008
6093
|
const sidecarSchema = JSON.parse(
|
|
6009
|
-
readFileSync7(
|
|
6094
|
+
readFileSync7(resolve8(specRoot, "schemas/sidecar.schema.json"), "utf8")
|
|
6010
6095
|
);
|
|
6011
6096
|
ajv.addSchema(annotationsSchema);
|
|
6012
6097
|
cachedValidator = ajv.compile(sidecarSchema);
|
|
@@ -6016,7 +6101,7 @@ function resolveSpecRoot3() {
|
|
|
6016
6101
|
const require2 = createRequire4(import.meta.url);
|
|
6017
6102
|
try {
|
|
6018
6103
|
const indexPath = require2.resolve("@skill-map/spec/index.json");
|
|
6019
|
-
return
|
|
6104
|
+
return dirname6(indexPath);
|
|
6020
6105
|
} catch {
|
|
6021
6106
|
throw new Error("@skill-map/spec not resolvable: sidecar store cannot load schemas.");
|
|
6022
6107
|
}
|
|
@@ -6126,12 +6211,12 @@ async function confirm(question, streams, opts) {
|
|
|
6126
6211
|
// cli/util/git.ts
|
|
6127
6212
|
import { spawnSync } from "child_process";
|
|
6128
6213
|
import { existsSync as existsSync7 } from "fs";
|
|
6129
|
-
import { dirname as
|
|
6214
|
+
import { dirname as dirname7, resolve as resolve9 } from "path";
|
|
6130
6215
|
function isInsideGitRepo(cwd) {
|
|
6131
6216
|
let current = cwd;
|
|
6132
6217
|
while (true) {
|
|
6133
|
-
if (existsSync7(
|
|
6134
|
-
const parent =
|
|
6218
|
+
if (existsSync7(resolve9(current, ".git"))) return true;
|
|
6219
|
+
const parent = dirname7(current);
|
|
6135
6220
|
if (parent === current) return false;
|
|
6136
6221
|
current = parent;
|
|
6137
6222
|
}
|
|
@@ -6329,7 +6414,7 @@ import { existsSync as existsSync11 } from "fs";
|
|
|
6329
6414
|
|
|
6330
6415
|
// kernel/adapters/sqlite/storage-adapter.ts
|
|
6331
6416
|
import { mkdirSync as mkdirSync4 } from "fs";
|
|
6332
|
-
import { dirname as
|
|
6417
|
+
import { dirname as dirname9, resolve as resolve12 } from "path";
|
|
6333
6418
|
import { DatabaseSync as DatabaseSync4 } from "node:sqlite";
|
|
6334
6419
|
import { CamelCasePlugin, Kysely, sql as sql4 } from "kysely";
|
|
6335
6420
|
|
|
@@ -6462,7 +6547,7 @@ var AsyncMutex = class {
|
|
|
6462
6547
|
this.#locked = true;
|
|
6463
6548
|
return;
|
|
6464
6549
|
}
|
|
6465
|
-
await new Promise((
|
|
6550
|
+
await new Promise((resolve45) => this.#waiters.push(resolve45));
|
|
6466
6551
|
this.#locked = true;
|
|
6467
6552
|
}
|
|
6468
6553
|
unlock() {
|
|
@@ -6888,7 +6973,7 @@ async function migrateNodeFavorites(trx, fromPath, toPath, report) {
|
|
|
6888
6973
|
}
|
|
6889
6974
|
|
|
6890
6975
|
// kernel/adapters/sqlite/jobs.ts
|
|
6891
|
-
import { resolve as
|
|
6976
|
+
import { resolve as resolve10 } from "path";
|
|
6892
6977
|
async function pruneTerminalJobs(db, status, cutoffMs) {
|
|
6893
6978
|
const rows = await db.selectFrom("state_jobs").select(["id", "filePath"]).where("status", "=", status).where("finishedAt", "is not", null).where("finishedAt", "<", cutoffMs).execute();
|
|
6894
6979
|
if (rows.length === 0) {
|
|
@@ -6903,14 +6988,14 @@ async function selectReferencedJobFilePaths(db) {
|
|
|
6903
6988
|
const rows = await db.selectFrom("state_jobs").select(["filePath"]).where("filePath", "is not", null).execute();
|
|
6904
6989
|
const out = /* @__PURE__ */ new Set();
|
|
6905
6990
|
for (const row of rows) {
|
|
6906
|
-
if (row.filePath !== null) out.add(
|
|
6991
|
+
if (row.filePath !== null) out.add(resolve10(row.filePath));
|
|
6907
6992
|
}
|
|
6908
6993
|
return out;
|
|
6909
6994
|
}
|
|
6910
6995
|
|
|
6911
6996
|
// kernel/adapters/sqlite/migrations.ts
|
|
6912
6997
|
import { copyFileSync, existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync8, readdirSync as readdirSync2 } from "fs";
|
|
6913
|
-
import { dirname as
|
|
6998
|
+
import { dirname as dirname8, join as join5, resolve as resolve11 } from "path";
|
|
6914
6999
|
import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
|
|
6915
7000
|
import { fileURLToPath } from "url";
|
|
6916
7001
|
|
|
@@ -6924,10 +7009,10 @@ var MIGRATIONS_TEXTS = {
|
|
|
6924
7009
|
// kernel/adapters/sqlite/migrations.ts
|
|
6925
7010
|
var FILE_RE = /^(\d{3})_([a-z0-9_]+)\.sql$/;
|
|
6926
7011
|
function defaultMigrationsDir() {
|
|
6927
|
-
const here =
|
|
6928
|
-
const flatLayout =
|
|
7012
|
+
const here = dirname8(fileURLToPath(import.meta.url));
|
|
7013
|
+
const flatLayout = resolve11(here, "migrations");
|
|
6929
7014
|
if (existsSync8(flatLayout)) return flatLayout;
|
|
6930
|
-
return
|
|
7015
|
+
return resolve11(here, "..", "..", "..", "migrations");
|
|
6931
7016
|
}
|
|
6932
7017
|
function discoverMigrations(dir = defaultMigrationsDir()) {
|
|
6933
7018
|
if (!existsSync8(dir)) return [];
|
|
@@ -6997,7 +7082,7 @@ function resolveMigrationTarget(to, files) {
|
|
|
6997
7082
|
function writePreMigrateBackup(dbPath, target) {
|
|
6998
7083
|
return writeBackup(
|
|
6999
7084
|
dbPath,
|
|
7000
|
-
join5(
|
|
7085
|
+
join5(kernelBackupsDir(dbPath), `skill-map-pre-migrate-v${target}.db`)
|
|
7001
7086
|
);
|
|
7002
7087
|
}
|
|
7003
7088
|
function applyOneMigration(db, migration) {
|
|
@@ -7032,9 +7117,9 @@ function applyOneMigration(db, migration) {
|
|
|
7032
7117
|
}
|
|
7033
7118
|
function writeBackup(dbPath, destPath) {
|
|
7034
7119
|
if (dbPath === ":memory:") return null;
|
|
7035
|
-
const absoluteSource =
|
|
7036
|
-
const absoluteDest =
|
|
7037
|
-
mkdirSync3(
|
|
7120
|
+
const absoluteSource = resolve11(dbPath);
|
|
7121
|
+
const absoluteDest = resolve11(destPath);
|
|
7122
|
+
mkdirSync3(dirname8(absoluteDest), { recursive: true });
|
|
7038
7123
|
const db = new DatabaseSync2(absoluteSource);
|
|
7039
7124
|
try {
|
|
7040
7125
|
db.exec("PRAGMA wal_checkpoint(TRUNCATE)");
|
|
@@ -8671,8 +8756,8 @@ var SqliteStorageAdapter = class {
|
|
|
8671
8756
|
if (this.#db) return;
|
|
8672
8757
|
const path = this.#options.databasePath;
|
|
8673
8758
|
if (path !== ":memory:") {
|
|
8674
|
-
const absolute =
|
|
8675
|
-
mkdirSync4(
|
|
8759
|
+
const absolute = resolve12(path);
|
|
8760
|
+
mkdirSync4(dirname9(absolute), { recursive: true });
|
|
8676
8761
|
}
|
|
8677
8762
|
if (this.#options.autoMigrate !== false) {
|
|
8678
8763
|
const files = discoverMigrations();
|
|
@@ -9280,16 +9365,16 @@ async function tryWithSqlite(options, fn) {
|
|
|
9280
9365
|
}
|
|
9281
9366
|
|
|
9282
9367
|
// cli/commands/bump-plan.ts
|
|
9283
|
-
import { resolve as
|
|
9368
|
+
import { resolve as resolve14 } from "path";
|
|
9284
9369
|
|
|
9285
9370
|
// core/paths/path-guard.ts
|
|
9286
9371
|
import { lstatSync } from "fs";
|
|
9287
|
-
import { isAbsolute as isAbsolute2, resolve as
|
|
9372
|
+
import { isAbsolute as isAbsolute2, resolve as resolve13, sep as sep2 } from "path";
|
|
9288
9373
|
function assertContained(cwd, rel) {
|
|
9289
9374
|
if (isAbsolute2(rel)) {
|
|
9290
9375
|
throw new Error(`node path is absolute, refusing to read: ${rel}`);
|
|
9291
9376
|
}
|
|
9292
|
-
const abs =
|
|
9377
|
+
const abs = resolve13(cwd, rel);
|
|
9293
9378
|
if (abs !== cwd && !abs.startsWith(cwd + sep2)) {
|
|
9294
9379
|
throw new Error(`node path escapes repo root: ${rel}`);
|
|
9295
9380
|
}
|
|
@@ -9324,7 +9409,7 @@ function planOne(node, options, invoker) {
|
|
|
9324
9409
|
let absPath;
|
|
9325
9410
|
try {
|
|
9326
9411
|
assertContained(options.cwd, node.path);
|
|
9327
|
-
absPath =
|
|
9412
|
+
absPath = resolve14(options.cwd, node.path);
|
|
9328
9413
|
} catch (err) {
|
|
9329
9414
|
return {
|
|
9330
9415
|
nodePath: node.path,
|
|
@@ -9966,18 +10051,18 @@ var PLUGIN_LOADER_TEXTS = {
|
|
|
9966
10051
|
// kernel/adapters/plugin-loader/index.ts
|
|
9967
10052
|
import { createRequire as createRequire5 } from "module";
|
|
9968
10053
|
import { existsSync as existsSync13, readFileSync as readFileSync13, readdirSync as readdirSync5, statSync as statSync2 } from "fs";
|
|
9969
|
-
import { join as join8, resolve as
|
|
10054
|
+
import { join as join8, resolve as resolve17 } from "path";
|
|
9970
10055
|
import { pathToFileURL } from "url";
|
|
9971
10056
|
import semver from "semver";
|
|
9972
10057
|
|
|
9973
10058
|
// kernel/adapters/plugin-loader/id-utils.ts
|
|
9974
|
-
import { isAbsolute as isAbsolute3, relative, resolve as
|
|
10059
|
+
import { isAbsolute as isAbsolute3, relative, resolve as resolve15 } from "path";
|
|
9975
10060
|
function fail(path, id, status, reason) {
|
|
9976
10061
|
return { path, id, status, reason };
|
|
9977
10062
|
}
|
|
9978
10063
|
function isInsidePlugin(pluginPath, relEntry) {
|
|
9979
10064
|
if (isAbsolute3(relEntry)) return false;
|
|
9980
|
-
const abs =
|
|
10065
|
+
const abs = resolve15(pluginPath, relEntry);
|
|
9981
10066
|
const rel = relative(pluginPath, abs);
|
|
9982
10067
|
if (rel === "") return true;
|
|
9983
10068
|
if (rel.startsWith("..")) return false;
|
|
@@ -10069,7 +10154,7 @@ function stripFunctionsAndPluginId(input) {
|
|
|
10069
10154
|
// kernel/adapters/plugin-loader/validation.ts
|
|
10070
10155
|
import * as nodeFs from "fs";
|
|
10071
10156
|
import { existsSync as existsSync12 } from "fs";
|
|
10072
|
-
import { dirname as
|
|
10157
|
+
import { dirname as dirname10, join as join7 } from "path";
|
|
10073
10158
|
import { Ajv2020 as Ajv20205 } from "ajv/dist/2020.js";
|
|
10074
10159
|
|
|
10075
10160
|
// kernel/extensions/hook.ts
|
|
@@ -10190,7 +10275,7 @@ function validateHookTriggers(pluginPath, pluginId, manifest, relEntry, exported
|
|
|
10190
10275
|
return null;
|
|
10191
10276
|
}
|
|
10192
10277
|
function validateActionFileConventions(pluginPath, pluginId, manifest, relEntry, entryAbsPath, manifestView) {
|
|
10193
|
-
const actionDir =
|
|
10278
|
+
const actionDir = dirname10(entryAbsPath);
|
|
10194
10279
|
const reportSchemaPath = join7(actionDir, "report.schema.json");
|
|
10195
10280
|
const promptPath = join7(actionDir, "prompt.md");
|
|
10196
10281
|
const mode = isRecord(manifestView) && typeof manifestView["mode"] === "string" ? manifestView["mode"] : "deterministic";
|
|
@@ -10318,7 +10403,7 @@ function isDirectorySafe(path, statSync13) {
|
|
|
10318
10403
|
|
|
10319
10404
|
// kernel/adapters/plugin-loader/storage-schemas.ts
|
|
10320
10405
|
import { readFileSync as readFileSync12 } from "fs";
|
|
10321
|
-
import { resolve as
|
|
10406
|
+
import { resolve as resolve16 } from "path";
|
|
10322
10407
|
import { Ajv2020 as Ajv20206 } from "ajv/dist/2020.js";
|
|
10323
10408
|
|
|
10324
10409
|
// kernel/adapters/plugin-store.ts
|
|
@@ -10382,7 +10467,7 @@ function compilePluginSchema(pluginPath, relPath) {
|
|
|
10382
10467
|
errDescription: tx(PLUGIN_LOADER_TEXTS.loadErrorSchemaPathEscapesPlugin, { relPath, pluginPath })
|
|
10383
10468
|
};
|
|
10384
10469
|
}
|
|
10385
|
-
const abs =
|
|
10470
|
+
const abs = resolve16(pluginPath, relPath);
|
|
10386
10471
|
let raw;
|
|
10387
10472
|
try {
|
|
10388
10473
|
raw = JSON.parse(readFileSync12(abs, "utf8"));
|
|
@@ -10424,7 +10509,7 @@ var PluginLoader = class {
|
|
|
10424
10509
|
if (!entry.isDirectory()) continue;
|
|
10425
10510
|
const candidate = join8(root, entry.name);
|
|
10426
10511
|
if (existsSync13(join8(candidate, "plugin.json"))) {
|
|
10427
|
-
out.push(
|
|
10512
|
+
out.push(resolve17(candidate));
|
|
10428
10513
|
}
|
|
10429
10514
|
}
|
|
10430
10515
|
}
|
|
@@ -10583,7 +10668,7 @@ var PluginLoader = class {
|
|
|
10583
10668
|
manifest
|
|
10584
10669
|
} };
|
|
10585
10670
|
}
|
|
10586
|
-
const abs =
|
|
10671
|
+
const abs = resolve17(pluginPath, relEntry);
|
|
10587
10672
|
if (!existsSync13(abs)) {
|
|
10588
10673
|
return { ok: false, failure: {
|
|
10589
10674
|
...fail(
|
|
@@ -10787,7 +10872,7 @@ function discoverExtensionEntries(pluginPath) {
|
|
|
10787
10872
|
return out;
|
|
10788
10873
|
}
|
|
10789
10874
|
function collectKindEntries(pluginPath, kindDir, out) {
|
|
10790
|
-
const kindAbs =
|
|
10875
|
+
const kindAbs = resolve17(pluginPath, kindDir);
|
|
10791
10876
|
if (!existsSync13(kindAbs)) return;
|
|
10792
10877
|
let entries;
|
|
10793
10878
|
try {
|
|
@@ -10798,7 +10883,7 @@ function collectKindEntries(pluginPath, kindDir, out) {
|
|
|
10798
10883
|
entries.sort();
|
|
10799
10884
|
for (const entry of entries) {
|
|
10800
10885
|
if (entry.startsWith(".")) continue;
|
|
10801
|
-
const entryAbs =
|
|
10886
|
+
const entryAbs = resolve17(kindAbs, entry);
|
|
10802
10887
|
if (!isDirectorySafe2(entryAbs)) continue;
|
|
10803
10888
|
const candidate = findIndexCandidate(entryAbs);
|
|
10804
10889
|
if (candidate !== null) {
|
|
@@ -10815,14 +10900,14 @@ function isDirectorySafe2(path) {
|
|
|
10815
10900
|
}
|
|
10816
10901
|
function findIndexCandidate(entryAbs) {
|
|
10817
10902
|
for (const candidate of INDEX_CANDIDATES) {
|
|
10818
|
-
if (existsSync13(
|
|
10903
|
+
if (existsSync13(resolve17(entryAbs, candidate))) return candidate;
|
|
10819
10904
|
}
|
|
10820
10905
|
return null;
|
|
10821
10906
|
}
|
|
10822
10907
|
function installedSpecVersion() {
|
|
10823
10908
|
const require2 = createRequire5(import.meta.url);
|
|
10824
10909
|
const indexPath = require2.resolve("@skill-map/spec/index.json");
|
|
10825
|
-
const pkgPath =
|
|
10910
|
+
const pkgPath = resolve17(indexPath, "..", "package.json");
|
|
10826
10911
|
const pkg = JSON.parse(readFileSync13(pkgPath, "utf8"));
|
|
10827
10912
|
return pkg.version;
|
|
10828
10913
|
}
|
|
@@ -10835,6 +10920,13 @@ var LOCKED_PLUGIN_IDS = /* @__PURE__ */ new Set([
|
|
|
10835
10920
|
// silently invisible, a foot-gun the host product does not want to
|
|
10836
10921
|
// expose. Lock it in the enabled state.
|
|
10837
10922
|
"core/markdown",
|
|
10923
|
+
// `agent-skills/agent-skills` is the open-standard default lens: the lens
|
|
10924
|
+
// a project falls back to when no vendor marker is present (see
|
|
10925
|
+
// spec/architecture.md §Active Provider Lens). Locking it enabled
|
|
10926
|
+
// guarantees the resolver always has a valid floor lens to resolve to;
|
|
10927
|
+
// disabling it would leave a no-vendor project with no selectable lens.
|
|
10928
|
+
// Stable, so the lock is legitimate (nothing experimental is lockable).
|
|
10929
|
+
"agent-skills/agent-skills",
|
|
10838
10930
|
// `core/schema-violation` validates every scanned Node against
|
|
10839
10931
|
// `node.schema.json` and every Link against `link.schema.json` (the
|
|
10840
10932
|
// authoritative @skill-map/spec). Disabling it makes the system
|
|
@@ -10907,11 +10999,11 @@ async function buildEnabledResolver(ctx) {
|
|
|
10907
10999
|
|
|
10908
11000
|
// kernel/scan/walk-content.ts
|
|
10909
11001
|
import { readFile, readdir, lstat } from "fs/promises";
|
|
10910
|
-
import { isAbsolute as isAbsolute4, join as join9, relative as relative2, resolve as
|
|
11002
|
+
import { isAbsolute as isAbsolute4, join as join9, relative as relative2, resolve as resolve19, sep as sep3 } from "path";
|
|
10911
11003
|
|
|
10912
11004
|
// kernel/scan/ignore.ts
|
|
10913
11005
|
import { existsSync as existsSync14, readFileSync as readFileSync14 } from "fs";
|
|
10914
|
-
import { dirname as
|
|
11006
|
+
import { dirname as dirname11, resolve as resolve18 } from "path";
|
|
10915
11007
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
10916
11008
|
import ignoreFactory from "ignore";
|
|
10917
11009
|
function buildIgnoreFilter(opts = {}) {
|
|
@@ -10940,7 +11032,7 @@ function loadBundledIgnoreText() {
|
|
|
10940
11032
|
return loadDefaultsText();
|
|
10941
11033
|
}
|
|
10942
11034
|
function readIgnoreFileText(scopeRoot) {
|
|
10943
|
-
const path =
|
|
11035
|
+
const path = resolve18(scopeRoot, ".skillmapignore");
|
|
10944
11036
|
if (!existsSync14(path)) return void 0;
|
|
10945
11037
|
try {
|
|
10946
11038
|
return readFileSync14(path, "utf8");
|
|
@@ -10967,13 +11059,13 @@ function loadDefaultsText() {
|
|
|
10967
11059
|
return cachedDefaults;
|
|
10968
11060
|
}
|
|
10969
11061
|
function readDefaultsFromDisk() {
|
|
10970
|
-
const here =
|
|
11062
|
+
const here = dirname11(fileURLToPath2(import.meta.url));
|
|
10971
11063
|
const candidates = [
|
|
10972
|
-
|
|
11064
|
+
resolve18(here, "../../config/defaults/skillmapignore"),
|
|
10973
11065
|
// src/kernel/scan/ → src/config/defaults/
|
|
10974
|
-
|
|
11066
|
+
resolve18(here, "../config/defaults/skillmapignore"),
|
|
10975
11067
|
// dist/cli.js → dist/config/defaults/ (siblings)
|
|
10976
|
-
|
|
11068
|
+
resolve18(here, "config/defaults/skillmapignore")
|
|
10977
11069
|
];
|
|
10978
11070
|
for (const candidate of candidates) {
|
|
10979
11071
|
if (existsSync14(candidate)) {
|
|
@@ -11087,24 +11179,31 @@ async function* walkContent(roots, options) {
|
|
|
11087
11179
|
const filter = options.ignoreFilter ?? buildIgnoreFilter();
|
|
11088
11180
|
const extensions = options.extensions;
|
|
11089
11181
|
const sizeLimit = buildSizeLimit(options);
|
|
11182
|
+
const bodyField = options.bodyField;
|
|
11090
11183
|
if (options.scopedPaths !== void 0) {
|
|
11091
|
-
yield* walkScoped(roots, options.scopedPaths, extensions, sizeLimit, parser);
|
|
11184
|
+
yield* walkScoped(roots, options.scopedPaths, extensions, sizeLimit, parser, bodyField);
|
|
11092
11185
|
return;
|
|
11093
11186
|
}
|
|
11094
11187
|
for (const root of roots) {
|
|
11095
11188
|
for await (const entry of walkRoot(root, root, filter, extensions, sizeLimit)) {
|
|
11096
11189
|
const relPath = relative2(root, entry.full).split(sep3).join("/");
|
|
11097
|
-
const rec = await traversedEntryToNode(
|
|
11190
|
+
const rec = await traversedEntryToNode(
|
|
11191
|
+
entry,
|
|
11192
|
+
relPath,
|
|
11193
|
+
options.priorMtimes,
|
|
11194
|
+
parser,
|
|
11195
|
+
bodyField
|
|
11196
|
+
);
|
|
11098
11197
|
if (rec !== null) yield rec;
|
|
11099
11198
|
}
|
|
11100
11199
|
}
|
|
11101
11200
|
}
|
|
11102
|
-
async function traversedEntryToNode(entry, relPath, priorMtimes, parser) {
|
|
11201
|
+
async function traversedEntryToNode(entry, relPath, priorMtimes, parser, bodyField) {
|
|
11103
11202
|
const priorMtime = priorMtimes?.get(relPath);
|
|
11104
11203
|
if (priorMtime !== void 0 && priorMtime === entry.modifiedAtMs) {
|
|
11105
|
-
return buildUnchangedRecord(entry.full, relPath, entry.modifiedAtMs, parser);
|
|
11204
|
+
return buildUnchangedRecord(entry.full, relPath, entry.modifiedAtMs, parser, bodyField);
|
|
11106
11205
|
}
|
|
11107
|
-
const parsed = await readAndParse(entry.full, relPath, parser);
|
|
11206
|
+
const parsed = await readAndParse(entry.full, relPath, parser, bodyField);
|
|
11108
11207
|
if (parsed === null) return null;
|
|
11109
11208
|
return {
|
|
11110
11209
|
path: relPath,
|
|
@@ -11121,7 +11220,7 @@ async function traversedEntryToNode(entry, relPath, priorMtimes, parser) {
|
|
|
11121
11220
|
...parsed.parseIssues ? { parseIssues: parsed.parseIssues } : {}
|
|
11122
11221
|
};
|
|
11123
11222
|
}
|
|
11124
|
-
function buildUnchangedRecord(full, relPath, modifiedAtMs, parser) {
|
|
11223
|
+
function buildUnchangedRecord(full, relPath, modifiedAtMs, parser, bodyField) {
|
|
11125
11224
|
return {
|
|
11126
11225
|
path: relPath,
|
|
11127
11226
|
body: "",
|
|
@@ -11130,26 +11229,26 @@ function buildUnchangedRecord(full, relPath, modifiedAtMs, parser) {
|
|
|
11130
11229
|
modifiedAtMs,
|
|
11131
11230
|
unchanged: true,
|
|
11132
11231
|
reread: async () => {
|
|
11133
|
-
const re = await readAndParse(full, relPath, parser);
|
|
11232
|
+
const re = await readAndParse(full, relPath, parser, bodyField);
|
|
11134
11233
|
return re ?? { body: "", frontmatterRaw: "", frontmatter: {} };
|
|
11135
11234
|
}
|
|
11136
11235
|
};
|
|
11137
11236
|
}
|
|
11138
|
-
async function* walkScoped(roots, scopedPaths, extensions, sizeLimit, parser) {
|
|
11139
|
-
const absRoots = roots.map((r) => isAbsolute4(r) ? r :
|
|
11237
|
+
async function* walkScoped(roots, scopedPaths, extensions, sizeLimit, parser, bodyField) {
|
|
11238
|
+
const absRoots = roots.map((r) => isAbsolute4(r) ? r : resolve19(r));
|
|
11140
11239
|
for (const scoped of scopedPaths) {
|
|
11141
|
-
const rec = await scopedPathToNode(scoped, absRoots, extensions, sizeLimit, parser);
|
|
11240
|
+
const rec = await scopedPathToNode(scoped, absRoots, extensions, sizeLimit, parser, bodyField);
|
|
11142
11241
|
if (rec !== null) yield rec;
|
|
11143
11242
|
}
|
|
11144
11243
|
}
|
|
11145
|
-
async function scopedPathToNode(scoped, absRoots, extensions, sizeLimit, parser) {
|
|
11146
|
-
const full = isAbsolute4(scoped) ? scoped :
|
|
11244
|
+
async function scopedPathToNode(scoped, absRoots, extensions, sizeLimit, parser, bodyField) {
|
|
11245
|
+
const full = isAbsolute4(scoped) ? scoped : resolve19(scoped);
|
|
11147
11246
|
const relPath = relativeFromRoots(full, absRoots);
|
|
11148
11247
|
if (relPath === null) return null;
|
|
11149
11248
|
if (!hasMatchingExtension(full, extensions)) return null;
|
|
11150
11249
|
const s = await statRegularFile(full, relPath, sizeLimit);
|
|
11151
11250
|
if (s === null) return null;
|
|
11152
|
-
const parsed = await readAndParse(full, relPath, parser);
|
|
11251
|
+
const parsed = await readAndParse(full, relPath, parser, bodyField);
|
|
11153
11252
|
if (parsed === null) return null;
|
|
11154
11253
|
return {
|
|
11155
11254
|
path: relPath,
|
|
@@ -11182,7 +11281,7 @@ function relativeFromRoots(full, absRoots) {
|
|
|
11182
11281
|
}
|
|
11183
11282
|
return null;
|
|
11184
11283
|
}
|
|
11185
|
-
async function readAndParse(full, relPath, parser) {
|
|
11284
|
+
async function readAndParse(full, relPath, parser, bodyField) {
|
|
11186
11285
|
let raw;
|
|
11187
11286
|
try {
|
|
11188
11287
|
raw = await readFile(full, "utf8");
|
|
@@ -11191,12 +11290,19 @@ async function readAndParse(full, relPath, parser) {
|
|
|
11191
11290
|
}
|
|
11192
11291
|
const parsed = parser.parse(raw, relPath);
|
|
11193
11292
|
return {
|
|
11194
|
-
body: parsed.body,
|
|
11293
|
+
body: resolveEffectiveBody(parsed.body, parsed.frontmatter, bodyField),
|
|
11195
11294
|
frontmatterRaw: parsed.frontmatterRaw,
|
|
11196
11295
|
frontmatter: parsed.frontmatter,
|
|
11197
11296
|
...parsed.issues && parsed.issues.length > 0 ? { parseIssues: parsed.issues } : {}
|
|
11198
11297
|
};
|
|
11199
11298
|
}
|
|
11299
|
+
function resolveEffectiveBody(parsedBody, frontmatter, bodyField) {
|
|
11300
|
+
if (bodyField !== void 0) {
|
|
11301
|
+
const candidate = frontmatter[bodyField];
|
|
11302
|
+
if (typeof candidate === "string") return candidate;
|
|
11303
|
+
}
|
|
11304
|
+
return parsedBody;
|
|
11305
|
+
}
|
|
11200
11306
|
function buildSizeLimit(options) {
|
|
11201
11307
|
const sizeLimit = {};
|
|
11202
11308
|
if (options.maxFileSizeBytes !== void 0) {
|
|
@@ -11252,13 +11358,19 @@ function resolveProviderWalk(provider) {
|
|
|
11252
11358
|
return walk3;
|
|
11253
11359
|
}
|
|
11254
11360
|
const read = provider.read ?? DEFAULT_READ_CONFIG;
|
|
11255
|
-
|
|
11361
|
+
const rules = Array.isArray(read) ? read : [read];
|
|
11362
|
+
return async function* walkRules(roots, options) {
|
|
11363
|
+
for (const rule of rules) {
|
|
11364
|
+
yield* walkContent(roots, buildWalkContentOptions(rule, options));
|
|
11365
|
+
}
|
|
11366
|
+
};
|
|
11256
11367
|
}
|
|
11257
11368
|
function buildWalkContentOptions(read, options) {
|
|
11258
11369
|
const walkOptions = {
|
|
11259
11370
|
extensions: read.extensions,
|
|
11260
11371
|
parser: read.parser
|
|
11261
11372
|
};
|
|
11373
|
+
if (read.bodyField !== void 0) walkOptions.bodyField = read.bodyField;
|
|
11262
11374
|
if (options) copyOptionalWalkOptions(walkOptions, options);
|
|
11263
11375
|
return walkOptions;
|
|
11264
11376
|
}
|
|
@@ -11359,7 +11471,7 @@ function isExtensionInstance(v) {
|
|
|
11359
11471
|
}
|
|
11360
11472
|
|
|
11361
11473
|
// core/runtime/plugin-runtime/warnings.ts
|
|
11362
|
-
import { resolve as
|
|
11474
|
+
import { resolve as resolve20 } from "path";
|
|
11363
11475
|
|
|
11364
11476
|
// kernel/util/text.ts
|
|
11365
11477
|
function truncateHead(s, max) {
|
|
@@ -11409,7 +11521,7 @@ function resolveRuntimeContext(opts) {
|
|
|
11409
11521
|
return opts.runtimeContext ?? defaultRuntimeContext();
|
|
11410
11522
|
}
|
|
11411
11523
|
function resolveSearchPaths(opts, ctx) {
|
|
11412
|
-
if (opts.pluginDir) return [
|
|
11524
|
+
if (opts.pluginDir) return [resolve20(opts.pluginDir)];
|
|
11413
11525
|
return [defaultProjectPluginsDir(ctx)];
|
|
11414
11526
|
}
|
|
11415
11527
|
|
|
@@ -11947,17 +12059,18 @@ function isDetectableUnderCwd(cwd, provider) {
|
|
|
11947
12059
|
}
|
|
11948
12060
|
|
|
11949
12061
|
// core/config/active-provider.ts
|
|
11950
|
-
var
|
|
12062
|
+
var DEFAULT_LENS_ID = "agent-skills";
|
|
12063
|
+
var MARKDOWN_BASE_ID = "markdown";
|
|
11951
12064
|
function resolveActiveProvider(cwd, providers = []) {
|
|
11952
12065
|
const detected = detectProvidersFromFilesystem(cwd, providers);
|
|
11953
12066
|
const fromConfig = readConfigValue("activeProvider", { cwd });
|
|
11954
|
-
if (typeof fromConfig === "string" && fromConfig.length > 0) {
|
|
12067
|
+
if (typeof fromConfig === "string" && fromConfig.length > 0 && fromConfig !== MARKDOWN_BASE_ID) {
|
|
11955
12068
|
return { resolved: fromConfig, source: "config", detected };
|
|
11956
12069
|
}
|
|
11957
12070
|
if (detected.length > 0) {
|
|
11958
12071
|
return { resolved: detected[0], source: "autodetect", detected };
|
|
11959
12072
|
}
|
|
11960
|
-
return { resolved:
|
|
12073
|
+
return { resolved: DEFAULT_LENS_ID, source: "default", detected };
|
|
11961
12074
|
}
|
|
11962
12075
|
|
|
11963
12076
|
// cli/util/path-display.ts
|
|
@@ -12689,7 +12802,7 @@ var CONFIG_COMMANDS = [
|
|
|
12689
12802
|
|
|
12690
12803
|
// cli/commands/conformance.ts
|
|
12691
12804
|
import { existsSync as existsSync19, readFileSync as readFileSync16 } from "fs";
|
|
12692
|
-
import { dirname as
|
|
12805
|
+
import { dirname as dirname13, resolve as resolve23 } from "path";
|
|
12693
12806
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
12694
12807
|
import { Command as Command5, Option as Option5 } from "clipanion";
|
|
12695
12808
|
|
|
@@ -12697,7 +12810,7 @@ import { Command as Command5, Option as Option5 } from "clipanion";
|
|
|
12697
12810
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
12698
12811
|
import { cpSync, existsSync as existsSync17, mkdtempSync, readdirSync as readdirSync6, readFileSync as readFileSync15, rmSync, statSync as statSync3 } from "fs";
|
|
12699
12812
|
import { tmpdir } from "os";
|
|
12700
|
-
import { isAbsolute as isAbsolute6, join as join11, relative as relative3, resolve as
|
|
12813
|
+
import { isAbsolute as isAbsolute6, join as join11, relative as relative3, resolve as resolve21 } from "path";
|
|
12701
12814
|
|
|
12702
12815
|
// conformance/i18n/runner.texts.ts
|
|
12703
12816
|
var CONFORMANCE_RUNNER_TEXTS = {
|
|
@@ -12864,7 +12977,7 @@ function assertContained2(root, rel, label) {
|
|
|
12864
12977
|
tx(CONFORMANCE_RUNNER_TEXTS.pathMustBeRelative, { label, path: rel, anchor: root })
|
|
12865
12978
|
);
|
|
12866
12979
|
}
|
|
12867
|
-
const abs =
|
|
12980
|
+
const abs = resolve21(root, rel);
|
|
12868
12981
|
const r = relative3(root, abs);
|
|
12869
12982
|
if (r.startsWith("..") || isAbsolute6(r)) {
|
|
12870
12983
|
throw new Error(
|
|
@@ -12891,7 +13004,7 @@ function evaluateAssertion(a, ctx) {
|
|
|
12891
13004
|
} catch (err) {
|
|
12892
13005
|
return { ok: false, type: a.type, reason: formatErrorMessage(err) };
|
|
12893
13006
|
}
|
|
12894
|
-
const abs =
|
|
13007
|
+
const abs = resolve21(ctx.scope, a.path);
|
|
12895
13008
|
return existsSync17(abs) ? { ok: true, type: a.type } : {
|
|
12896
13009
|
ok: false,
|
|
12897
13010
|
type: a.type,
|
|
@@ -12906,7 +13019,7 @@ function evaluateAssertion(a, ctx) {
|
|
|
12906
13019
|
return { ok: false, type: a.type, reason: formatErrorMessage(err) };
|
|
12907
13020
|
}
|
|
12908
13021
|
const fixturePath = join11(ctx.fixturesRoot, a.fixture);
|
|
12909
|
-
const targetPath =
|
|
13022
|
+
const targetPath = resolve21(ctx.scope, a.path);
|
|
12910
13023
|
if (!existsSync17(targetPath)) {
|
|
12911
13024
|
return {
|
|
12912
13025
|
ok: false,
|
|
@@ -13089,14 +13202,14 @@ var CONFORMANCE_TEXTS = {
|
|
|
13089
13202
|
|
|
13090
13203
|
// cli/util/conformance-scopes.ts
|
|
13091
13204
|
import { existsSync as existsSync18, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
13092
|
-
import { dirname as
|
|
13205
|
+
import { dirname as dirname12, resolve as resolve22 } from "path";
|
|
13093
13206
|
import { createRequire as createRequire6 } from "module";
|
|
13094
13207
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
13095
13208
|
function resolveSpecRoot4() {
|
|
13096
13209
|
const require2 = createRequire6(import.meta.url);
|
|
13097
13210
|
try {
|
|
13098
13211
|
const indexPath = require2.resolve("@skill-map/spec/index.json");
|
|
13099
|
-
return
|
|
13212
|
+
return dirname12(indexPath);
|
|
13100
13213
|
} catch {
|
|
13101
13214
|
throw new Error(
|
|
13102
13215
|
"@skill-map/spec not resolvable: ensure the workspace is linked or the package is installed."
|
|
@@ -13104,14 +13217,14 @@ function resolveSpecRoot4() {
|
|
|
13104
13217
|
}
|
|
13105
13218
|
}
|
|
13106
13219
|
function resolveCliWorkspaceRoot() {
|
|
13107
|
-
const here =
|
|
13220
|
+
const here = dirname12(fileURLToPath3(import.meta.url));
|
|
13108
13221
|
let cursor = here;
|
|
13109
13222
|
for (let depth = 0; depth < 6; depth += 1) {
|
|
13110
|
-
const candidate =
|
|
13223
|
+
const candidate = resolve22(cursor, "plugins");
|
|
13111
13224
|
if (existsSync18(candidate) && statSync4(candidate).isDirectory()) {
|
|
13112
13225
|
return cursor;
|
|
13113
13226
|
}
|
|
13114
|
-
const parent =
|
|
13227
|
+
const parent = dirname12(cursor);
|
|
13115
13228
|
if (parent === cursor) break;
|
|
13116
13229
|
cursor = parent;
|
|
13117
13230
|
}
|
|
@@ -13127,12 +13240,12 @@ function collectProviderScopes(specRoot) {
|
|
|
13127
13240
|
} catch {
|
|
13128
13241
|
return out;
|
|
13129
13242
|
}
|
|
13130
|
-
const pluginsRoot =
|
|
13243
|
+
const pluginsRoot = resolve22(workspaceRoot, "plugins");
|
|
13131
13244
|
if (!existsSync18(pluginsRoot)) return out;
|
|
13132
13245
|
for (const pluginEntry of readdirSync7(pluginsRoot)) {
|
|
13133
|
-
const pluginDir =
|
|
13246
|
+
const pluginDir = resolve22(pluginsRoot, pluginEntry);
|
|
13134
13247
|
if (!isDir(pluginDir)) continue;
|
|
13135
|
-
const providersRoot =
|
|
13248
|
+
const providersRoot = resolve22(pluginDir, "providers");
|
|
13136
13249
|
if (!isDir(providersRoot)) continue;
|
|
13137
13250
|
collectPluginProviderScopes(providersRoot, specRoot, out);
|
|
13138
13251
|
}
|
|
@@ -13147,12 +13260,12 @@ function isDir(path) {
|
|
|
13147
13260
|
}
|
|
13148
13261
|
function collectPluginProviderScopes(providersRoot, specRoot, out) {
|
|
13149
13262
|
for (const entry of readdirSync7(providersRoot)) {
|
|
13150
|
-
const providerDir =
|
|
13263
|
+
const providerDir = resolve22(providersRoot, entry);
|
|
13151
13264
|
if (!isDir(providerDir)) continue;
|
|
13152
|
-
const conformanceDir =
|
|
13265
|
+
const conformanceDir = resolve22(providerDir, "conformance");
|
|
13153
13266
|
if (!existsSync18(conformanceDir)) continue;
|
|
13154
|
-
const casesDir =
|
|
13155
|
-
const fixturesDir =
|
|
13267
|
+
const casesDir = resolve22(conformanceDir, "cases");
|
|
13268
|
+
const fixturesDir = resolve22(conformanceDir, "fixtures");
|
|
13156
13269
|
if (!existsSync18(casesDir) || !existsSync18(fixturesDir)) continue;
|
|
13157
13270
|
out.push({
|
|
13158
13271
|
id: `provider:${entry}`,
|
|
@@ -13169,8 +13282,8 @@ function specScope(specRoot) {
|
|
|
13169
13282
|
id: "spec",
|
|
13170
13283
|
kind: "spec",
|
|
13171
13284
|
label: "spec",
|
|
13172
|
-
casesDir:
|
|
13173
|
-
fixturesDir:
|
|
13285
|
+
casesDir: resolve22(specRoot, "conformance", "cases"),
|
|
13286
|
+
fixturesDir: resolve22(specRoot, "conformance", "fixtures"),
|
|
13174
13287
|
specRoot
|
|
13175
13288
|
};
|
|
13176
13289
|
}
|
|
@@ -13192,7 +13305,7 @@ function selectConformanceScopes(scope) {
|
|
|
13192
13305
|
}
|
|
13193
13306
|
function listCaseFiles(scope) {
|
|
13194
13307
|
if (!existsSync18(scope.casesDir)) return [];
|
|
13195
|
-
return readdirSync7(scope.casesDir).filter((entry) => entry.endsWith(".json")).sort().map((entry) =>
|
|
13308
|
+
return readdirSync7(scope.casesDir).filter((entry) => entry.endsWith(".json")).sort().map((entry) => resolve22(scope.casesDir, entry));
|
|
13196
13309
|
}
|
|
13197
13310
|
|
|
13198
13311
|
// cli/commands/conformance.ts
|
|
@@ -13206,16 +13319,16 @@ function formatAssertionFailureDetail(type, reason) {
|
|
|
13206
13319
|
});
|
|
13207
13320
|
}
|
|
13208
13321
|
function resolveBinary() {
|
|
13209
|
-
const here =
|
|
13322
|
+
const here = dirname13(fileURLToPath4(import.meta.url));
|
|
13210
13323
|
let cursor = here;
|
|
13211
13324
|
for (let depth = 0; depth < 6; depth += 1) {
|
|
13212
|
-
const candidate =
|
|
13325
|
+
const candidate = resolve23(cursor, "bin", "sm.js");
|
|
13213
13326
|
if (existsSync19(candidate)) return candidate;
|
|
13214
|
-
const parent =
|
|
13327
|
+
const parent = dirname13(cursor);
|
|
13215
13328
|
if (parent === cursor) break;
|
|
13216
13329
|
cursor = parent;
|
|
13217
13330
|
}
|
|
13218
|
-
return
|
|
13331
|
+
return resolve23(here, "..", "..", "bin", "sm.js");
|
|
13219
13332
|
}
|
|
13220
13333
|
var ConformanceRunCommand = class extends SmCommand {
|
|
13221
13334
|
static paths = [["conformance", "run"]];
|
|
@@ -13468,7 +13581,7 @@ function writeStreamSnippet(stream, header, text) {
|
|
|
13468
13581
|
var CONFORMANCE_COMMANDS = [ConformanceRunCommand];
|
|
13469
13582
|
|
|
13470
13583
|
// cli/commands/db/backup.ts
|
|
13471
|
-
import {
|
|
13584
|
+
import { join as join12, resolve as resolve24 } from "path";
|
|
13472
13585
|
import { Command as Command6, Option as Option6 } from "clipanion";
|
|
13473
13586
|
|
|
13474
13587
|
// cli/i18n/db.texts.ts
|
|
@@ -13581,7 +13694,7 @@ var DbBackupCommand = class extends SmCommand {
|
|
|
13581
13694
|
const exit = requireDbOrExit(path, this.context.stderr);
|
|
13582
13695
|
if (exit !== null) return exit;
|
|
13583
13696
|
const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
13584
|
-
const outPath = this.out ?
|
|
13697
|
+
const outPath = this.out ? resolve24(this.out) : join12(backupsDirForDb(path), `${ts}.db`);
|
|
13585
13698
|
await withSqlite({ databasePath: path, autoMigrate: false }, async (storage) => {
|
|
13586
13699
|
storage.migrations.writeBackup(outPath);
|
|
13587
13700
|
});
|
|
@@ -13598,7 +13711,7 @@ var DbBackupCommand = class extends SmCommand {
|
|
|
13598
13711
|
|
|
13599
13712
|
// cli/commands/db/restore.ts
|
|
13600
13713
|
import { chmod, copyFile, mkdir, rm } from "fs/promises";
|
|
13601
|
-
import { dirname as dirname14, resolve as
|
|
13714
|
+
import { dirname as dirname14, resolve as resolve25 } from "path";
|
|
13602
13715
|
import { Command as Command7, Option as Option7 } from "clipanion";
|
|
13603
13716
|
|
|
13604
13717
|
// cli/util/fs.ts
|
|
@@ -13648,7 +13761,7 @@ var DbRestoreCommand = class extends SmCommand {
|
|
|
13648
13761
|
});
|
|
13649
13762
|
async run() {
|
|
13650
13763
|
const target = resolveDbPath({ db: this.db, ...defaultRuntimeContext() });
|
|
13651
|
-
const sourcePath =
|
|
13764
|
+
const sourcePath = resolve25(this.source);
|
|
13652
13765
|
const stderrAnsi = this.ansiFor("stderr");
|
|
13653
13766
|
const sourceStat = await statOrNull(sourcePath);
|
|
13654
13767
|
if (!sourceStat) {
|
|
@@ -13889,7 +14002,7 @@ var DbShellCommand = class extends SmCommand {
|
|
|
13889
14002
|
|
|
13890
14003
|
// cli/commands/db/browser.ts
|
|
13891
14004
|
import { spawn, spawnSync as spawnSync4 } from "child_process";
|
|
13892
|
-
import { resolve as
|
|
14005
|
+
import { resolve as resolve26 } from "path";
|
|
13893
14006
|
import { Command as Command10, Option as Option9 } from "clipanion";
|
|
13894
14007
|
var DbBrowserCommand = class extends SmCommand {
|
|
13895
14008
|
static paths = [["db", "browser"]];
|
|
@@ -13922,7 +14035,7 @@ var DbBrowserCommand = class extends SmCommand {
|
|
|
13922
14035
|
});
|
|
13923
14036
|
positional = Option9.String({ required: false });
|
|
13924
14037
|
async run() {
|
|
13925
|
-
const path = this.positional ?
|
|
14038
|
+
const path = this.positional ? resolve26(this.positional) : resolveDbPath({ db: this.db, ...defaultRuntimeContext() });
|
|
13926
14039
|
if (!assertDbExists(path, this.context.stderr)) {
|
|
13927
14040
|
this.printer.error(DB_TEXTS.browserRunScanFirstHint);
|
|
13928
14041
|
return ExitCode.NotFound;
|
|
@@ -14323,7 +14436,7 @@ var DB_COMMANDS = [
|
|
|
14323
14436
|
|
|
14324
14437
|
// cli/commands/example.ts
|
|
14325
14438
|
import { cpSync as cpSync2, existsSync as existsSync21, statSync as statSync5 } from "fs";
|
|
14326
|
-
import { dirname as dirname16, relative as relative5, resolve as
|
|
14439
|
+
import { dirname as dirname16, relative as relative5, resolve as resolve27 } from "path";
|
|
14327
14440
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
14328
14441
|
import { Command as Command13, Option as Option12 } from "clipanion";
|
|
14329
14442
|
|
|
@@ -14619,11 +14732,11 @@ function resolveExampleSourceDir() {
|
|
|
14619
14732
|
const here = dirname16(fileURLToPath5(import.meta.url));
|
|
14620
14733
|
const candidates = [
|
|
14621
14734
|
// dev: src/cli/commands/ → repo-root fixtures/demo-scope/
|
|
14622
|
-
|
|
14735
|
+
resolve27(here, "../../..", EXAMPLE_SOURCE_DIR),
|
|
14623
14736
|
// bundled: dist/cli.js → dist/cli/example (sibling)
|
|
14624
|
-
|
|
14737
|
+
resolve27(here, "cli/example"),
|
|
14625
14738
|
// bundled fallback: any-depth → cli/example
|
|
14626
|
-
|
|
14739
|
+
resolve27(here, "../cli/example")
|
|
14627
14740
|
];
|
|
14628
14741
|
for (const candidate of candidates) {
|
|
14629
14742
|
if (existsSync21(candidate) && statSync5(candidate).isDirectory()) {
|
|
@@ -15160,7 +15273,7 @@ var GraphCommand = class extends SmCommand {
|
|
|
15160
15273
|
// cli/commands/help.ts
|
|
15161
15274
|
import { readFileSync as readFileSync17 } from "fs";
|
|
15162
15275
|
import { createRequire as createRequire7 } from "module";
|
|
15163
|
-
import { resolve as
|
|
15276
|
+
import { resolve as resolve28 } from "path";
|
|
15164
15277
|
import { Command as Command16, Option as Option15 } from "clipanion";
|
|
15165
15278
|
|
|
15166
15279
|
// cli/i18n/help.texts.ts
|
|
@@ -15474,7 +15587,7 @@ function resolveSpecVersion() {
|
|
|
15474
15587
|
try {
|
|
15475
15588
|
const req = createRequire7(import.meta.url);
|
|
15476
15589
|
const indexPath = req.resolve("@skill-map/spec/index.json");
|
|
15477
|
-
const pkgPath =
|
|
15590
|
+
const pkgPath = resolve28(indexPath, "..", "package.json");
|
|
15478
15591
|
const pkg = JSON.parse(readFileSync17(pkgPath, "utf8"));
|
|
15479
15592
|
return pkg.version;
|
|
15480
15593
|
} catch {
|
|
@@ -15782,7 +15895,7 @@ function registeredVerbPaths(cli2) {
|
|
|
15782
15895
|
|
|
15783
15896
|
// cli/commands/hooks.ts
|
|
15784
15897
|
import { chmod as chmod2, mkdir as mkdir3, readFile as readFile2, stat as stat2, writeFile } from "fs/promises";
|
|
15785
|
-
import { dirname as dirname17, resolve as
|
|
15898
|
+
import { dirname as dirname17, resolve as resolve29 } from "path";
|
|
15786
15899
|
import { Command as Command17, Option as Option16 } from "clipanion";
|
|
15787
15900
|
|
|
15788
15901
|
// cli/i18n/hooks.texts.ts
|
|
@@ -15885,8 +15998,8 @@ var HooksInstallCommand = class extends SmCommand {
|
|
|
15885
15998
|
);
|
|
15886
15999
|
return ExitCode.NotFound;
|
|
15887
16000
|
}
|
|
15888
|
-
const hooksDir =
|
|
15889
|
-
const hookPath =
|
|
16001
|
+
const hooksDir = resolve29(repoRoot, ".git", "hooks");
|
|
16002
|
+
const hookPath = resolve29(hooksDir, "pre-commit");
|
|
15890
16003
|
const existing = await pathExists(hookPath) ? await readFile2(hookPath, "utf8") : null;
|
|
15891
16004
|
const planned2 = computePlannedHookContent(existing);
|
|
15892
16005
|
if (planned2.kind === "already-installed") {
|
|
@@ -15944,7 +16057,7 @@ var HooksInstallCommand = class extends SmCommand {
|
|
|
15944
16057
|
async function findGitRepoRoot(cwd) {
|
|
15945
16058
|
let current = cwd;
|
|
15946
16059
|
while (true) {
|
|
15947
|
-
if (await pathExists(
|
|
16060
|
+
if (await pathExists(resolve29(current, ".git"))) return current;
|
|
15948
16061
|
const parent = dirname17(current);
|
|
15949
16062
|
if (parent === current) return null;
|
|
15950
16063
|
current = parent;
|
|
@@ -15971,7 +16084,7 @@ import { Command as Command18, Option as Option17 } from "clipanion";
|
|
|
15971
16084
|
|
|
15972
16085
|
// kernel/orchestrator/index.ts
|
|
15973
16086
|
import { existsSync as existsSync24, statSync as statSync7 } from "fs";
|
|
15974
|
-
import { isAbsolute as isAbsolute10, resolve as
|
|
16087
|
+
import { isAbsolute as isAbsolute10, resolve as resolve32 } from "path";
|
|
15975
16088
|
import { Tiktoken as Tiktoken2 } from "js-tiktoken/lite";
|
|
15976
16089
|
|
|
15977
16090
|
// kernel/i18n/orchestrator.texts.ts
|
|
@@ -16659,6 +16772,13 @@ function validateIssue(analyzer, issue, emitter) {
|
|
|
16659
16772
|
return { ...issue, analyzerId: issue.analyzerId || analyzer.id };
|
|
16660
16773
|
}
|
|
16661
16774
|
|
|
16775
|
+
// kernel/orchestrator/frontmatter-issue-ids.ts
|
|
16776
|
+
var FRONTMATTER_ISSUE_ANALYZERS = /* @__PURE__ */ new Set([
|
|
16777
|
+
"frontmatter-invalid",
|
|
16778
|
+
"frontmatter-malformed",
|
|
16779
|
+
"frontmatter-parse-error"
|
|
16780
|
+
]);
|
|
16781
|
+
|
|
16662
16782
|
// kernel/orchestrator/cache.ts
|
|
16663
16783
|
function indexPriorSnapshot(prior) {
|
|
16664
16784
|
const priorNodesByPath = /* @__PURE__ */ new Map();
|
|
@@ -16916,7 +17036,7 @@ function collectBrokenLinks(links, nodes, ctx) {
|
|
|
16916
17036
|
return broken;
|
|
16917
17037
|
}
|
|
16918
17038
|
function applyResolution(link, indexes, ctx) {
|
|
16919
|
-
const resolution =
|
|
17039
|
+
const resolution = resolve30(link, indexes, ctx);
|
|
16920
17040
|
if (resolution === "none") return;
|
|
16921
17041
|
link.resolvedTarget = resolution;
|
|
16922
17042
|
}
|
|
@@ -16931,7 +17051,7 @@ function buildIndexes(nodes, ctx) {
|
|
|
16931
17051
|
}
|
|
16932
17052
|
return { byPath: byPath3, byName, nodeByPath };
|
|
16933
17053
|
}
|
|
16934
|
-
function
|
|
17054
|
+
function resolve30(link, indexes, ctx) {
|
|
16935
17055
|
if (indexes.byPath.has(link.target)) return link.target;
|
|
16936
17056
|
return resolveByName(link, indexes, ctx);
|
|
16937
17057
|
}
|
|
@@ -17320,7 +17440,7 @@ function detectRenamesAndOrphans(prior, current, issues, silenced) {
|
|
|
17320
17440
|
}
|
|
17321
17441
|
|
|
17322
17442
|
// kernel/orchestrator/walk.ts
|
|
17323
|
-
import { isAbsolute as isAbsolute9, resolve as
|
|
17443
|
+
import { isAbsolute as isAbsolute9, resolve as resolve31 } from "path";
|
|
17324
17444
|
|
|
17325
17445
|
// kernel/sidecar/drift.ts
|
|
17326
17446
|
function computeDriftStatus(args2) {
|
|
@@ -17766,8 +17886,8 @@ function expandSidecarPaths(paths, priorNodesByPath) {
|
|
|
17766
17886
|
}
|
|
17767
17887
|
function toAbsolute(relPath, roots) {
|
|
17768
17888
|
const root = roots[0] ?? ".";
|
|
17769
|
-
const absRoot = isAbsolute9(root) ? root :
|
|
17770
|
-
return
|
|
17889
|
+
const absRoot = isAbsolute9(root) ? root : resolve31(root);
|
|
17890
|
+
return resolve31(absRoot, relPath);
|
|
17771
17891
|
}
|
|
17772
17892
|
function resolveEffectiveCaps(opts) {
|
|
17773
17893
|
return {
|
|
@@ -18365,7 +18485,7 @@ function validateRoots(roots) {
|
|
|
18365
18485
|
function resolveActiveProviderOption(optionValue, roots, providers) {
|
|
18366
18486
|
if (optionValue !== void 0) return optionValue;
|
|
18367
18487
|
for (const root of roots) {
|
|
18368
|
-
const absRoot = isAbsolute10(root) ? root :
|
|
18488
|
+
const absRoot = isAbsolute10(root) ? root : resolve32(root);
|
|
18369
18489
|
if (!existsSync24(absRoot)) continue;
|
|
18370
18490
|
const detected = detectProvidersFromFilesystem(absRoot, providers)[0] ?? null;
|
|
18371
18491
|
if (detected !== null) return detected;
|
|
@@ -18374,10 +18494,10 @@ function resolveActiveProviderOption(optionValue, roots, providers) {
|
|
|
18374
18494
|
}
|
|
18375
18495
|
|
|
18376
18496
|
// kernel/scan/watcher.ts
|
|
18377
|
-
import { resolve as
|
|
18497
|
+
import { resolve as resolve33, relative as relative7, sep as sep5 } from "path";
|
|
18378
18498
|
import chokidar from "chokidar";
|
|
18379
18499
|
function createChokidarWatcher(opts) {
|
|
18380
|
-
const absRoots = opts.roots.map((r) =>
|
|
18500
|
+
const absRoots = opts.roots.map((r) => resolve33(opts.cwd, r));
|
|
18381
18501
|
const ignoreFilterOpt = opts.ignoreFilter;
|
|
18382
18502
|
const getFilter = ignoreFilterOpt === void 0 ? void 0 : typeof ignoreFilterOpt === "function" ? ignoreFilterOpt : () => ignoreFilterOpt;
|
|
18383
18503
|
const ignored = getFilter ? (path) => {
|
|
@@ -18883,7 +19003,7 @@ function resolveScanRoots(inputs) {
|
|
|
18883
19003
|
// core/runtime/reference-paths-walker.ts
|
|
18884
19004
|
import { readdirSync as readdirSync9, statSync as statSync8 } from "fs";
|
|
18885
19005
|
import { homedir as osHomedir2 } from "os";
|
|
18886
|
-
import { isAbsolute as isAbsolute11, join as join14, resolve as
|
|
19006
|
+
import { isAbsolute as isAbsolute11, join as join14, resolve as resolve34 } from "path";
|
|
18887
19007
|
var REFERENCE_WALK_MAX_FILES = 5e4;
|
|
18888
19008
|
var SKIPPED_DIR_NAMES = /* @__PURE__ */ new Set([
|
|
18889
19009
|
"node_modules",
|
|
@@ -18891,10 +19011,10 @@ var SKIPPED_DIR_NAMES = /* @__PURE__ */ new Set([
|
|
|
18891
19011
|
SKILL_MAP_DIR
|
|
18892
19012
|
]);
|
|
18893
19013
|
function resolveScanPath(raw, cwd) {
|
|
18894
|
-
if (raw.startsWith("~/")) return
|
|
18895
|
-
if (raw === "~") return
|
|
18896
|
-
if (isAbsolute11(raw)) return
|
|
18897
|
-
return
|
|
19014
|
+
if (raw.startsWith("~/")) return resolve34(join14(osHomedir2(), raw.slice(2)));
|
|
19015
|
+
if (raw === "~") return resolve34(osHomedir2());
|
|
19016
|
+
if (isAbsolute11(raw)) return resolve34(raw);
|
|
19017
|
+
return resolve34(cwd, raw);
|
|
18898
19018
|
}
|
|
18899
19019
|
function walkReferencePaths(rawRoots, cwd) {
|
|
18900
19020
|
const paths = /* @__PURE__ */ new Set();
|
|
@@ -18963,7 +19083,7 @@ async function bootstrapActiveProvider(opts) {
|
|
|
18963
19083
|
opts.providers
|
|
18964
19084
|
);
|
|
18965
19085
|
if (detected.length === 0) {
|
|
18966
|
-
return { kind: "ok", activeProvider:
|
|
19086
|
+
return { kind: "ok", activeProvider: DEFAULT_LENS_ID, source: "default" };
|
|
18967
19087
|
}
|
|
18968
19088
|
if (detected.length === 1) {
|
|
18969
19089
|
const picked2 = detected[0];
|
|
@@ -20358,7 +20478,7 @@ import { Command as Command20, Option as Option19 } from "clipanion";
|
|
|
20358
20478
|
|
|
20359
20479
|
// kernel/jobs/orphan-files.ts
|
|
20360
20480
|
import { readdirSync as readdirSync10, statSync as statSync9 } from "fs";
|
|
20361
|
-
import { join as join17, resolve as
|
|
20481
|
+
import { join as join17, resolve as resolve35 } from "path";
|
|
20362
20482
|
function findOrphanJobFiles(jobsDir, referencedPaths) {
|
|
20363
20483
|
let entries;
|
|
20364
20484
|
try {
|
|
@@ -20376,7 +20496,7 @@ function findOrphanJobFiles(jobsDir, referencedPaths) {
|
|
|
20376
20496
|
if (!entry.isFile()) continue;
|
|
20377
20497
|
const name = entry.name;
|
|
20378
20498
|
if (!name.endsWith(".md")) continue;
|
|
20379
|
-
const abs =
|
|
20499
|
+
const abs = resolve35(join17(jobsDir, name));
|
|
20380
20500
|
if (!referencedPaths.has(abs)) orphans.push(abs);
|
|
20381
20501
|
}
|
|
20382
20502
|
orphans.sort();
|
|
@@ -21586,7 +21706,7 @@ var BUILT_IN_PLUGIN_PRESENTATION_ORDER = [
|
|
|
21586
21706
|
"core",
|
|
21587
21707
|
"claude",
|
|
21588
21708
|
"antigravity",
|
|
21589
|
-
"
|
|
21709
|
+
"codex",
|
|
21590
21710
|
"agent-skills"
|
|
21591
21711
|
];
|
|
21592
21712
|
function sortPluginsForPresentation(plugins) {
|
|
@@ -21603,9 +21723,9 @@ function sortPluginsForPresentation(plugins) {
|
|
|
21603
21723
|
}
|
|
21604
21724
|
|
|
21605
21725
|
// cli/commands/plugins/shared.ts
|
|
21606
|
-
import { resolve as
|
|
21726
|
+
import { resolve as resolve36 } from "path";
|
|
21607
21727
|
function resolveSearchPaths2(opts, cwd) {
|
|
21608
|
-
if (opts.pluginDir) return [
|
|
21728
|
+
if (opts.pluginDir) return [resolve36(opts.pluginDir)];
|
|
21609
21729
|
return [defaultProjectPluginsDir({ cwd })];
|
|
21610
21730
|
}
|
|
21611
21731
|
async function buildResolver() {
|
|
@@ -22849,7 +22969,7 @@ var PluginsEnableCommand = class extends TogglePluginsBase {
|
|
|
22849
22969
|
ids (\`claude\`, which fans the toggle out across every extension
|
|
22850
22970
|
inside the plugin). Multi-extension plugins need --yes (or an
|
|
22851
22971
|
interactive TTY confirm) to avoid flipping 27 core extensions by
|
|
22852
|
-
accident. Single-extension plugins (
|
|
22972
|
+
accident. Single-extension plugins (codex, agent-skills,
|
|
22853
22973
|
antigravity) apply without prompting.
|
|
22854
22974
|
|
|
22855
22975
|
Batches are all-or-nothing: a single unknown id aborts before
|
|
@@ -22876,7 +22996,7 @@ var PluginsDisableCommand = class extends TogglePluginsBase {
|
|
|
22876
22996
|
ids (\`core\`, which fans the toggle out across every extension
|
|
22877
22997
|
inside the plugin). Multi-extension plugins need --yes (or an
|
|
22878
22998
|
interactive TTY confirm) to avoid flipping 27 core extensions by
|
|
22879
|
-
accident. Single-extension plugins (
|
|
22999
|
+
accident. Single-extension plugins (codex, agent-skills,
|
|
22880
23000
|
antigravity) apply without prompting.
|
|
22881
23001
|
|
|
22882
23002
|
Batches are all-or-nothing: a single unknown id aborts before
|
|
@@ -22919,7 +23039,7 @@ function resolveBareToggle(id, catalogue) {
|
|
|
22919
23039
|
|
|
22920
23040
|
// cli/commands/plugins/create.ts
|
|
22921
23041
|
import { existsSync as existsSync26, mkdirSync as mkdirSync5, writeFileSync } from "fs";
|
|
22922
|
-
import { dirname as dirname18, join as join18, resolve as
|
|
23042
|
+
import { dirname as dirname18, join as join18, resolve as resolve37 } from "path";
|
|
22923
23043
|
import { Command as Command27, Option as Option26 } from "clipanion";
|
|
22924
23044
|
|
|
22925
23045
|
// cli/commands/plugins/scaffold/action.ts
|
|
@@ -23369,7 +23489,7 @@ var PluginsCreateCommand = class extends SmCommand {
|
|
|
23369
23489
|
const kind = this.kind;
|
|
23370
23490
|
const ctx = defaultRuntimeContext();
|
|
23371
23491
|
const baseDir = defaultProjectPluginsDir(ctx);
|
|
23372
|
-
const targetDir = this.at ?
|
|
23492
|
+
const targetDir = this.at ? resolve37(this.at) : join18(baseDir, this.pluginId);
|
|
23373
23493
|
if (existsSync26(targetDir) && !this.force) {
|
|
23374
23494
|
this.printer.error(
|
|
23375
23495
|
tx(PLUGINS_TEXTS.createRefuseOverwrite, {
|
|
@@ -23885,7 +24005,7 @@ var PLUGIN_COMMANDS = [
|
|
|
23885
24005
|
|
|
23886
24006
|
// cli/commands/refresh.ts
|
|
23887
24007
|
import { readFile as readFile4 } from "fs/promises";
|
|
23888
|
-
import { resolve as
|
|
24008
|
+
import { resolve as resolve38 } from "path";
|
|
23889
24009
|
import { Command as Command31, Option as Option29 } from "clipanion";
|
|
23890
24010
|
|
|
23891
24011
|
// cli/i18n/refresh.texts.ts
|
|
@@ -24193,7 +24313,7 @@ var RefreshCommand = class extends SmCommand {
|
|
|
24193
24313
|
let body;
|
|
24194
24314
|
try {
|
|
24195
24315
|
assertContained(cwd, node.path);
|
|
24196
|
-
const raw = await readFile4(
|
|
24316
|
+
const raw = await readFile4(resolve38(cwd, node.path), "utf8");
|
|
24197
24317
|
body = stripFrontmatterFence(raw);
|
|
24198
24318
|
} catch (err) {
|
|
24199
24319
|
if (!this.json) {
|
|
@@ -24266,7 +24386,7 @@ var IntentionalFailCommand = class extends SmCommand {
|
|
|
24266
24386
|
setTimeout(() => {
|
|
24267
24387
|
throw new Error(INTENTIONAL_FAIL_TEXTS.errorMessage);
|
|
24268
24388
|
}, 0);
|
|
24269
|
-
await new Promise((
|
|
24389
|
+
await new Promise((resolve45) => setTimeout(resolve45, 5e3));
|
|
24270
24390
|
return ExitCode.Issues;
|
|
24271
24391
|
}
|
|
24272
24392
|
};
|
|
@@ -24434,7 +24554,7 @@ var SCAN_TEXTS = {
|
|
|
24434
24554
|
import { Command as Command32, Option as Option30 } from "clipanion";
|
|
24435
24555
|
|
|
24436
24556
|
// core/watcher/runtime.ts
|
|
24437
|
-
import { dirname as dirname19, isAbsolute as isAbsolute13, relative as relative9, resolve as
|
|
24557
|
+
import { dirname as dirname19, isAbsolute as isAbsolute13, relative as relative9, resolve as resolve39, sep as sep6 } from "path";
|
|
24438
24558
|
|
|
24439
24559
|
// core/runtime/fresh-resolver.ts
|
|
24440
24560
|
async function buildFreshResolver(deps) {
|
|
@@ -24480,7 +24600,7 @@ function applyPriorStateToRunOptions(runOptions, priorState, changedPaths) {
|
|
|
24480
24600
|
}
|
|
24481
24601
|
}
|
|
24482
24602
|
function toIncrementalPaths(events, roots, cwd) {
|
|
24483
|
-
const absRoots = roots.map((r) => isAbsolute13(r) ? r :
|
|
24603
|
+
const absRoots = roots.map((r) => isAbsolute13(r) ? r : resolve39(cwd, r));
|
|
24484
24604
|
const changed = /* @__PURE__ */ new Set();
|
|
24485
24605
|
const removed = /* @__PURE__ */ new Set();
|
|
24486
24606
|
for (const ev of events) {
|
|
@@ -26224,7 +26344,8 @@ var SERVER_TEXTS = {
|
|
|
26224
26344
|
activeProviderBodyMissing: "Request body must include `activeProvider` (a non-empty string).",
|
|
26225
26345
|
activeProviderValueNotString: "`activeProvider` must be a string.",
|
|
26226
26346
|
activeProviderValueEmpty: "`activeProvider` cannot be the empty string. Send the id of an enabled provider.",
|
|
26227
|
-
activeProviderPersistFailed: "Could not persist activeProvider: {{message}}"
|
|
26347
|
+
activeProviderPersistFailed: "Could not persist activeProvider: {{message}}",
|
|
26348
|
+
activeProviderNotSelectable: "`{{id}}` is not a selectable lens. Pick one of: {{selectable}}."
|
|
26228
26349
|
};
|
|
26229
26350
|
|
|
26230
26351
|
// server/loopback-gate.ts
|
|
@@ -27924,10 +28045,10 @@ import { HTTPException as HTTPException12 } from "hono/http-exception";
|
|
|
27924
28045
|
|
|
27925
28046
|
// server/util/skillmapignore-io.ts
|
|
27926
28047
|
import { existsSync as existsSync28, readFileSync as readFileSync18, writeFileSync as writeFileSync2 } from "fs";
|
|
27927
|
-
import { resolve as
|
|
28048
|
+
import { resolve as resolve40 } from "path";
|
|
27928
28049
|
var IGNORE_FILENAME2 = ".skillmapignore";
|
|
27929
28050
|
function readPatterns(cwd) {
|
|
27930
|
-
const path =
|
|
28051
|
+
const path = resolve40(cwd, IGNORE_FILENAME2);
|
|
27931
28052
|
if (!existsSync28(path)) return [];
|
|
27932
28053
|
let raw;
|
|
27933
28054
|
try {
|
|
@@ -27938,7 +28059,7 @@ function readPatterns(cwd) {
|
|
|
27938
28059
|
return raw.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0 && !l.startsWith("#"));
|
|
27939
28060
|
}
|
|
27940
28061
|
function writePatterns(cwd, nextPatterns) {
|
|
27941
|
-
const path =
|
|
28062
|
+
const path = resolve40(cwd, IGNORE_FILENAME2);
|
|
27942
28063
|
const prior = existsSync28(path) ? safeRead(path) : "";
|
|
27943
28064
|
const content = buildContent(prior, nextPatterns);
|
|
27944
28065
|
writeFileSync2(path, content, "utf8");
|
|
@@ -28326,6 +28447,15 @@ function registerActiveProviderRoute(app, deps) {
|
|
|
28326
28447
|
});
|
|
28327
28448
|
app.patch("/api/active-provider", async (c) => {
|
|
28328
28449
|
const body = await parsePatchBody5(c.req.raw);
|
|
28450
|
+
const selectable = await resolveSelectableProviders(deps);
|
|
28451
|
+
if (!selectable.includes(body.activeProvider)) {
|
|
28452
|
+
throw new HTTPException14(400, {
|
|
28453
|
+
message: tx(SERVER_TEXTS.activeProviderNotSelectable, {
|
|
28454
|
+
id: body.activeProvider,
|
|
28455
|
+
selectable: selectable.join(", ")
|
|
28456
|
+
})
|
|
28457
|
+
});
|
|
28458
|
+
}
|
|
28329
28459
|
const result = applyLensSwitch(deps, body.activeProvider);
|
|
28330
28460
|
deps.configService.reload();
|
|
28331
28461
|
return c.json({ ...await buildEnvelope4(deps), switch: result });
|
|
@@ -28348,7 +28478,7 @@ async function resolveSelectableProviders(deps) {
|
|
|
28348
28478
|
});
|
|
28349
28479
|
const selectable = /* @__PURE__ */ new Set();
|
|
28350
28480
|
for (const provider of deps.providers) {
|
|
28351
|
-
if (isPluginExtensionEnabled(provider, resolveEnabled)) {
|
|
28481
|
+
if (provider.gatedByActiveLens === true && isPluginExtensionEnabled(provider, resolveEnabled)) {
|
|
28352
28482
|
selectable.add(provider.id);
|
|
28353
28483
|
}
|
|
28354
28484
|
}
|
|
@@ -28396,7 +28526,7 @@ var parsePatchBody5 = makeBodyValidator(PATCH_BODY_SCHEMA4, {
|
|
|
28396
28526
|
|
|
28397
28527
|
// server/routes/actions.ts
|
|
28398
28528
|
import { HTTPException as HTTPException16 } from "hono/http-exception";
|
|
28399
|
-
import { resolve as
|
|
28529
|
+
import { resolve as resolve41 } from "path";
|
|
28400
28530
|
|
|
28401
28531
|
// server/routes/node-loader.ts
|
|
28402
28532
|
import { HTTPException as HTTPException15 } from "hono/http-exception";
|
|
@@ -28456,7 +28586,7 @@ function registerActionsRoutes(app, deps) {
|
|
|
28456
28586
|
let absPath;
|
|
28457
28587
|
try {
|
|
28458
28588
|
assertContained(deps.runtimeContext.cwd, node.path);
|
|
28459
|
-
absPath =
|
|
28589
|
+
absPath = resolve41(deps.runtimeContext.cwd, node.path);
|
|
28460
28590
|
} catch (err) {
|
|
28461
28591
|
throw new HTTPException16(400, { message: formatErrorMessage(err) });
|
|
28462
28592
|
}
|
|
@@ -28564,14 +28694,14 @@ async function withScanMutex(fn) {
|
|
|
28564
28694
|
if (inFlight !== null) {
|
|
28565
28695
|
throw new ScanBusyError();
|
|
28566
28696
|
}
|
|
28567
|
-
let
|
|
28697
|
+
let resolve45;
|
|
28568
28698
|
inFlight = new Promise((r) => {
|
|
28569
|
-
|
|
28699
|
+
resolve45 = r;
|
|
28570
28700
|
});
|
|
28571
28701
|
try {
|
|
28572
28702
|
return await fn();
|
|
28573
28703
|
} finally {
|
|
28574
|
-
|
|
28704
|
+
resolve45();
|
|
28575
28705
|
inFlight = null;
|
|
28576
28706
|
}
|
|
28577
28707
|
}
|
|
@@ -29678,6 +29808,22 @@ function buildKindRegistry(providers) {
|
|
|
29678
29808
|
}
|
|
29679
29809
|
|
|
29680
29810
|
// server/provider-registry.ts
|
|
29811
|
+
function presentationOptionals(ui) {
|
|
29812
|
+
const out = {};
|
|
29813
|
+
if (ui.colorDark !== void 0) out.colorDark = ui.colorDark;
|
|
29814
|
+
if (ui.emoji !== void 0) out.emoji = ui.emoji;
|
|
29815
|
+
if (ui.icon !== void 0) out.icon = ui.icon;
|
|
29816
|
+
if (ui.hideChip !== void 0) out.hideChip = ui.hideChip;
|
|
29817
|
+
return out;
|
|
29818
|
+
}
|
|
29819
|
+
function resolveProviderBodyField(read) {
|
|
29820
|
+
if (read === void 0) return void 0;
|
|
29821
|
+
const rules = Array.isArray(read) ? read : [read];
|
|
29822
|
+
for (const rule of rules) {
|
|
29823
|
+
if (rule.bodyField !== void 0) return rule.bodyField;
|
|
29824
|
+
}
|
|
29825
|
+
return void 0;
|
|
29826
|
+
}
|
|
29681
29827
|
function buildProviderRegistry(providers) {
|
|
29682
29828
|
const registry = {};
|
|
29683
29829
|
for (const provider of providers) {
|
|
@@ -29685,12 +29831,14 @@ function buildProviderRegistry(providers) {
|
|
|
29685
29831
|
if (!ui) continue;
|
|
29686
29832
|
const entry = {
|
|
29687
29833
|
label: ui.label,
|
|
29688
|
-
color: ui.color
|
|
29834
|
+
color: ui.color,
|
|
29835
|
+
// A Provider is a selectable lens iff it gates on the active lens;
|
|
29836
|
+
// the non-gated `markdown` base projects `isLens: false`.
|
|
29837
|
+
isLens: provider.gatedByActiveLens === true,
|
|
29838
|
+
...presentationOptionals(ui)
|
|
29689
29839
|
};
|
|
29690
|
-
|
|
29691
|
-
if (
|
|
29692
|
-
if (ui.icon !== void 0) entry.icon = ui.icon;
|
|
29693
|
-
if (ui.hideChip !== void 0) entry.hideChip = ui.hideChip;
|
|
29840
|
+
const bodyField = resolveProviderBodyField(provider.read);
|
|
29841
|
+
if (bodyField !== void 0) entry.bodyField = bodyField;
|
|
29694
29842
|
registry[provider.id] = entry;
|
|
29695
29843
|
}
|
|
29696
29844
|
return registry;
|
|
@@ -29869,7 +30017,7 @@ function validateNoUi(noUi, uiDist) {
|
|
|
29869
30017
|
|
|
29870
30018
|
// server/paths.ts
|
|
29871
30019
|
import { existsSync as existsSync31, statSync as statSync11 } from "fs";
|
|
29872
|
-
import { dirname as dirname20, isAbsolute as isAbsolute15, join as join20, resolve as
|
|
30020
|
+
import { dirname as dirname20, isAbsolute as isAbsolute15, join as join20, resolve as resolve42 } from "path";
|
|
29873
30021
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
29874
30022
|
var DEFAULT_UI_REL = join20("ui", "dist", "ui", "browser");
|
|
29875
30023
|
var PACKAGE_UI_REL = "ui";
|
|
@@ -29880,7 +30028,7 @@ function resolveDefaultUiDist(ctx) {
|
|
|
29880
30028
|
return walkUpForUi(ctx.cwd);
|
|
29881
30029
|
}
|
|
29882
30030
|
function resolveExplicitUiDist(ctx, raw) {
|
|
29883
|
-
return isAbsolute15(raw) ? raw :
|
|
30031
|
+
return isAbsolute15(raw) ? raw : resolve42(ctx.cwd, raw);
|
|
29884
30032
|
}
|
|
29885
30033
|
function isUiBundleDir(path) {
|
|
29886
30034
|
if (!existsSync31(path)) return false;
|
|
@@ -29914,7 +30062,7 @@ function resolvePackageBundledUiFrom(here) {
|
|
|
29914
30062
|
return null;
|
|
29915
30063
|
}
|
|
29916
30064
|
function walkUpForUi(startDir) {
|
|
29917
|
-
let current =
|
|
30065
|
+
let current = resolve42(startDir);
|
|
29918
30066
|
for (let i = 0; i < 64; i++) {
|
|
29919
30067
|
const candidate = join20(current, DEFAULT_UI_REL);
|
|
29920
30068
|
if (isUiBundleDir(candidate)) return candidate;
|
|
@@ -30968,7 +31116,7 @@ function rankConfidenceForGrouping(c) {
|
|
|
30968
31116
|
|
|
30969
31117
|
// cli/commands/sidecar.ts
|
|
30970
31118
|
import { unlink as unlink3 } from "fs/promises";
|
|
30971
|
-
import { resolve as
|
|
31119
|
+
import { resolve as resolve43 } from "path";
|
|
30972
31120
|
import { Command as Command37, Option as Option35 } from "clipanion";
|
|
30973
31121
|
|
|
30974
31122
|
// cli/i18n/sidecar.texts.ts
|
|
@@ -31126,7 +31274,7 @@ var SidecarRefreshCommand = class extends SmCommand {
|
|
|
31126
31274
|
let absPath;
|
|
31127
31275
|
try {
|
|
31128
31276
|
assertContained(ctx.cwd, node.path);
|
|
31129
|
-
absPath =
|
|
31277
|
+
absPath = resolve43(ctx.cwd, node.path);
|
|
31130
31278
|
} catch (err) {
|
|
31131
31279
|
this.printer.error(
|
|
31132
31280
|
tx(SIDECAR_TEXTS.refreshFailed, { glyph: errGlyph, message: formatErrorMessage(err) })
|
|
@@ -31410,7 +31558,7 @@ var SidecarAnnotateCommand = class extends SmCommand {
|
|
|
31410
31558
|
let absPath;
|
|
31411
31559
|
try {
|
|
31412
31560
|
assertContained(ctx.cwd, node.path);
|
|
31413
|
-
absPath =
|
|
31561
|
+
absPath = resolve43(ctx.cwd, node.path);
|
|
31414
31562
|
} catch (err) {
|
|
31415
31563
|
this.printer.error(
|
|
31416
31564
|
tx(SIDECAR_TEXTS.annotateFailed, { glyph: errGlyph, message: formatErrorMessage(err) })
|
|
@@ -31662,7 +31810,7 @@ var STUB_COMMANDS = [
|
|
|
31662
31810
|
|
|
31663
31811
|
// cli/commands/tutorial.ts
|
|
31664
31812
|
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
|
|
31813
|
+
import { dirname as dirname21, join as join21, resolve as resolve44 } from "path";
|
|
31666
31814
|
import { createInterface as createInterface6 } from "readline";
|
|
31667
31815
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
31668
31816
|
import { Command as Command39, Option as Option37 } from "clipanion";
|
|
@@ -31741,10 +31889,10 @@ var TutorialCommand = class extends SmCommand {
|
|
|
31741
31889
|
overwrite the target directory unless --force is passed. Takes no
|
|
31742
31890
|
positional argument.
|
|
31743
31891
|
|
|
31744
|
-
By default only
|
|
31745
|
-
|
|
31746
|
-
they ship disabled, so enable the
|
|
31747
|
-
\`sm plugins enable <id>\` before scanning under its lens.
|
|
31892
|
+
By default only stable / beta providers are offered as destinations
|
|
31893
|
+
(today claude and the open-standard agent-skills). Pass --experimental
|
|
31894
|
+
to also offer experimental ones; they ship disabled, so enable the
|
|
31895
|
+
chosen one with \`sm plugins enable <id>\` before scanning under its lens.
|
|
31748
31896
|
`,
|
|
31749
31897
|
examples: [
|
|
31750
31898
|
["Materialize the tutorial skill in the cwd", "$0 tutorial"],
|
|
@@ -31768,7 +31916,7 @@ var TutorialCommand = class extends SmCommand {
|
|
|
31768
31916
|
description: "Overwrite an existing target directory without prompting."
|
|
31769
31917
|
});
|
|
31770
31918
|
experimental = Option37.Boolean("--experimental", false, {
|
|
31771
|
-
description: "Offer experimental providers
|
|
31919
|
+
description: "Offer experimental providers as destinations. They ship disabled; enable the chosen one with `sm plugins enable <id>`."
|
|
31772
31920
|
});
|
|
31773
31921
|
async run() {
|
|
31774
31922
|
const ctx = defaultRuntimeContext();
|
|
@@ -31977,11 +32125,11 @@ function resolveSkillSourceDir() {
|
|
|
31977
32125
|
const here = dirname21(fileURLToPath8(import.meta.url));
|
|
31978
32126
|
const candidates = [
|
|
31979
32127
|
// dev: src/cli/commands/ → repo-root .claude/skills/sm-tutorial/
|
|
31980
|
-
|
|
32128
|
+
resolve44(here, "../../..", SKILL_SOURCE_DIR),
|
|
31981
32129
|
// bundled: dist/cli.js → dist/cli/tutorial/sm-tutorial (sibling)
|
|
31982
|
-
|
|
32130
|
+
resolve44(here, "cli/tutorial", SKILL_SLUG),
|
|
31983
32131
|
// bundled fallback: any-depth → cli/tutorial/sm-tutorial
|
|
31984
|
-
|
|
32132
|
+
resolve44(here, "../cli/tutorial", SKILL_SLUG)
|
|
31985
32133
|
];
|
|
31986
32134
|
for (const candidate of candidates) {
|
|
31987
32135
|
if (existsSync33(candidate) && statSync12(candidate).isDirectory()) {
|
|
@@ -32227,4 +32375,4 @@ function resolveBareDefault() {
|
|
|
32227
32375
|
process.exit(ExitCode.Error);
|
|
32228
32376
|
}
|
|
32229
32377
|
//# sourceMappingURL=cli.js.map
|
|
32230
|
-
//# debugId=
|
|
32378
|
+
//# debugId=8b8b0da7-bdb9-55ed-8dcd-0f983f8be006
|