@skill-map/cli 0.51.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // cli/entry.ts
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1a42a4ca-6765-5a66-abc9-6b57464bc9c6")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="91ef81c7-e785-5818-839a-1f18ea093b57")}catch(e){}}();
4
4
  import { existsSync as existsSync33 } from "fs";
5
5
  import { Builtins, Cli as Cli2 } from "clipanion";
6
6
 
@@ -246,7 +246,7 @@ function bucketByKind(kind, instance, bag) {
246
246
  // package.json
247
247
  var package_default = {
248
248
  name: "@skill-map/cli",
249
- version: "0.51.0",
249
+ version: "0.52.0",
250
250
  description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
251
251
  license: "MIT",
252
252
  type: "module",
@@ -1968,14 +1968,13 @@ var annotationStaleAnalyzer = {
1968
1968
  const message = status === "stale-body" ? tx(ANNOTATION_STALE_TEXTS.bodyDrift, { path: node.path }) : status === "stale-frontmatter" ? tx(ANNOTATION_STALE_TEXTS.frontmatterDrift, { path: node.path }) : tx(ANNOTATION_STALE_TEXTS.bothDrift, { path: node.path });
1969
1969
  issues.push({
1970
1970
  analyzerId: ID10,
1971
- severity: "warn",
1971
+ severity: "info",
1972
1972
  nodeIds: [node.path],
1973
1973
  message,
1974
1974
  data: { status }
1975
1975
  });
1976
1976
  ctx.emitContribution(node.path, "staleIcon", {
1977
1977
  value: 0,
1978
- severity: "warn",
1979
1978
  tooltip: tooltipFor(status)
1980
1979
  });
1981
1980
  }
@@ -6069,6 +6068,17 @@ function ensureGitForStaged(cwd) {
6069
6068
  }
6070
6069
  return "ok";
6071
6070
  }
6071
+ function resolveGitAuthorName(cwd) {
6072
+ if (!isInsideGitRepo(cwd)) return null;
6073
+ const result = spawnSync("git", ["config", "user.name"], {
6074
+ cwd,
6075
+ stdio: ["ignore", "pipe", "pipe"],
6076
+ encoding: "utf8"
6077
+ });
6078
+ if (result.error !== void 0 || result.status !== 0) return null;
6079
+ const name = (result.stdout ?? "").trim();
6080
+ return name.length > 0 ? name : null;
6081
+ }
6072
6082
  function stageSidecar(cwd, sidecarAbsPath) {
6073
6083
  const result = spawnSync("git", ["add", "--", sidecarAbsPath], {
6074
6084
  cwd,
@@ -8990,13 +9000,14 @@ function isAllowedLstatError(err) {
8990
9000
 
8991
9001
  // cli/commands/bump-plan.ts
8992
9002
  function computeBumpPlan(nodes, options) {
9003
+ const invoker = resolveGitAuthorName(options.cwd) ?? "cli";
8993
9004
  const items = [];
8994
9005
  for (const node of nodes) {
8995
- items.push(planOne(node, options));
9006
+ items.push(planOne(node, options, invoker));
8996
9007
  }
8997
9008
  return { items };
8998
9009
  }
8999
- function planOne(node, options) {
9010
+ function planOne(node, options, invoker) {
9000
9011
  let absPath;
9001
9012
  try {
9002
9013
  assertContained(options.cwd, node.path);
@@ -9010,7 +9021,7 @@ function planOne(node, options) {
9010
9021
  }
9011
9022
  let result;
9012
9023
  try {
9013
- result = invokeBumpFor(node, absPath, options.force);
9024
+ result = invokeBumpFor(node, absPath, options.force, invoker);
9014
9025
  } catch (err) {
9015
9026
  return {
9016
9027
  nodePath: node.path,
@@ -9032,7 +9043,7 @@ function planOne(node, options) {
9032
9043
  report: result.report
9033
9044
  };
9034
9045
  }
9035
- function invokeBumpFor(node, absPath, force) {
9046
+ function invokeBumpFor(node, absPath, force, invoker) {
9036
9047
  if (!nodeBumpAction.invoke) {
9037
9048
  throw new Error("built-in bump action is missing its invoke()");
9038
9049
  }
@@ -9041,7 +9052,7 @@ function invokeBumpFor(node, absPath, force) {
9041
9052
  return nodeBumpAction.invoke(input, {
9042
9053
  node,
9043
9054
  nodeAbsolutePath: absPath,
9044
- invoker: "cli",
9055
+ invoker,
9045
9056
  now: () => /* @__PURE__ */ new Date(),
9046
9057
  settings: {}
9047
9058
  });
@@ -16340,7 +16351,7 @@ function resolveSidecarOverlay(relativePath2, nodePathForIssue, roots, liveBodyH
16340
16351
  for (const parseIssue of result.issues) {
16341
16352
  issues.push({
16342
16353
  analyzerId: "invalid-sidecar",
16343
- severity: "warn",
16354
+ severity: "error",
16344
16355
  nodeIds: [nodePathForIssue],
16345
16356
  message: parseIssue.message,
16346
16357
  data: { sidecarPath: relativePathFromRoots(mdAbs, roots) }
@@ -25808,24 +25819,39 @@ var parsePatchBody4 = makeBodyValidator(PATCH_BODY_SCHEMA3, {
25808
25819
  import { existsSync as existsSync28 } from "fs";
25809
25820
  import { HTTPException as HTTPException13 } from "hono/http-exception";
25810
25821
  function registerActiveProviderRoute(app, deps) {
25811
- app.get("/api/active-provider", (c) => {
25812
- return c.json(buildEnvelope4(deps));
25822
+ app.get("/api/active-provider", async (c) => {
25823
+ return c.json(await buildEnvelope4(deps));
25813
25824
  });
25814
25825
  app.patch("/api/active-provider", async (c) => {
25815
25826
  const body = await parsePatchBody5(c.req.raw);
25816
25827
  const result = applyLensSwitch(deps, body.activeProvider);
25817
25828
  deps.configService.reload();
25818
- return c.json({ ...buildEnvelope4(deps), switch: result });
25829
+ return c.json({ ...await buildEnvelope4(deps), switch: result });
25819
25830
  });
25820
25831
  }
25821
- function buildEnvelope4(deps) {
25832
+ async function buildEnvelope4(deps) {
25822
25833
  const r = resolveActiveProvider(deps.runtimeContext.cwd, deps.providers);
25823
25834
  return {
25824
25835
  activeProvider: r.resolved,
25825
25836
  detected: r.detected,
25826
- source: r.source
25837
+ source: r.source,
25838
+ selectable: await resolveSelectableProviders(deps)
25827
25839
  };
25828
25840
  }
25841
+ async function resolveSelectableProviders(deps) {
25842
+ const resolveEnabled = await buildFreshResolver({
25843
+ databasePath: deps.options.dbPath,
25844
+ effectiveConfig: () => deps.configService.effective(),
25845
+ fallbackResolver: deps.pluginRuntime.resolveEnabled
25846
+ });
25847
+ const selectable = /* @__PURE__ */ new Set();
25848
+ for (const provider of deps.providers) {
25849
+ if (isPluginExtensionEnabled(provider, resolveEnabled)) {
25850
+ selectable.add(provider.id);
25851
+ }
25852
+ }
25853
+ return [...selectable];
25854
+ }
25829
25855
  function applyLensSwitch(deps, newValue) {
25830
25856
  const cwd = deps.runtimeContext.cwd;
25831
25857
  try {
@@ -26282,7 +26308,7 @@ function registerSidecarRoutes(app, deps) {
26282
26308
  } catch (err) {
26283
26309
  throw new HTTPException15(400, { message: formatErrorMessage(err) });
26284
26310
  }
26285
- const result = invokeBump2(node, absPath, body);
26311
+ const result = invokeBump2(node, absPath, body, deps.runtimeContext.cwd);
26286
26312
  if (result.report.ok === false && result.report.reason === "fresh") {
26287
26313
  throw new ConflictError({ code: "sidecar-fresh", message: SERVER_TEXTS.sidecarFreshRefusal });
26288
26314
  }
@@ -26354,7 +26380,7 @@ async function loadNode(deps, nodePath) {
26354
26380
  }
26355
26381
  return node;
26356
26382
  }
26357
- function invokeBump2(node, absPath, body) {
26383
+ function invokeBump2(node, absPath, body, cwd) {
26358
26384
  if (!nodeBumpAction.invoke) {
26359
26385
  throw new HTTPException15(500, { message: SERVER_TEXTS.sidecarBumpInvokeMissing });
26360
26386
  }
@@ -26363,7 +26389,7 @@ function invokeBump2(node, absPath, body) {
26363
26389
  return nodeBumpAction.invoke(input, {
26364
26390
  node,
26365
26391
  nodeAbsolutePath: absPath,
26366
- invoker: "ui",
26392
+ invoker: resolveGitAuthorName(cwd) ?? "ui",
26367
26393
  now: () => /* @__PURE__ */ new Date(),
26368
26394
  settings: {}
26369
26395
  });
@@ -29566,4 +29592,4 @@ function resolveBareDefault() {
29566
29592
  process.exit(ExitCode.Error);
29567
29593
  }
29568
29594
  //# sourceMappingURL=cli.js.map
29569
- //# debugId=1a42a4ca-6765-5a66-abc9-6b57464bc9c6
29595
+ //# debugId=91ef81c7-e785-5818-839a-1f18ea093b57
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // kernel/i18n/registry.texts.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]="288e9967-d85a-5d42-a797-ad529b0945a7")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e78e8b63-f577-5c6a-9522-9187b69e1ed7")}catch(e){}}();
4
4
  var REGISTRY_TEXTS = {
5
5
  duplicateExtension: "Extension already registered: {{kind}}:{{qualifiedId}}",
6
6
  unknownKind: "Unknown extension kind: {{kind}}",
@@ -102,7 +102,7 @@ import { Tiktoken as Tiktoken2 } from "js-tiktoken/lite";
102
102
  // package.json
103
103
  var package_default = {
104
104
  name: "@skill-map/cli",
105
- version: "0.51.0",
105
+ version: "0.52.0",
106
106
  description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
107
107
  license: "MIT",
108
108
  type: "module",
@@ -2423,7 +2423,7 @@ function resolveSidecarOverlay(relativePath, nodePathForIssue, roots, liveBodyHa
2423
2423
  for (const parseIssue of result.issues) {
2424
2424
  issues.push({
2425
2425
  analyzerId: "invalid-sidecar",
2426
- severity: "warn",
2426
+ severity: "error",
2427
2427
  nodeIds: [nodePathForIssue],
2428
2428
  message: parseIssue.message,
2429
2429
  data: { sidecarPath: relativePathFromRoots(mdAbs, roots) }
@@ -3505,4 +3505,4 @@ export {
3505
3505
  runScanWithRenames
3506
3506
  };
3507
3507
  //# sourceMappingURL=index.js.map
3508
- //# debugId=288e9967-d85a-5d42-a797-ad529b0945a7
3508
+ //# debugId=e78e8b63-f577-5c6a-9522-9187b69e1ed7
@@ -1,6 +1,6 @@
1
1
  // kernel/i18n/registry.texts.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]="77a22e54-0917-5b5e-a29d-af0ad20bed19")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="72ca2d8b-bb14-5c87-b049-717e396842bd")}catch(e){}}();
4
4
  var REGISTRY_TEXTS = {
5
5
  duplicateExtension: "Extension already registered: {{kind}}:{{qualifiedId}}",
6
6
  unknownKind: "Unknown extension kind: {{kind}}",
@@ -102,7 +102,7 @@ import { Tiktoken as Tiktoken2 } from "js-tiktoken/lite";
102
102
  // package.json
103
103
  var package_default = {
104
104
  name: "@skill-map/cli",
105
- version: "0.51.0",
105
+ version: "0.52.0",
106
106
  description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
107
107
  license: "MIT",
108
108
  type: "module",
@@ -2423,7 +2423,7 @@ function resolveSidecarOverlay(relativePath, nodePathForIssue, roots, liveBodyHa
2423
2423
  for (const parseIssue of result.issues) {
2424
2424
  issues.push({
2425
2425
  analyzerId: "invalid-sidecar",
2426
- severity: "warn",
2426
+ severity: "error",
2427
2427
  nodeIds: [nodePathForIssue],
2428
2428
  message: parseIssue.message,
2429
2429
  data: { sidecarPath: relativePathFromRoots(mdAbs, roots) }
@@ -3505,4 +3505,4 @@ export {
3505
3505
  runScanWithRenames
3506
3506
  };
3507
3507
  //# sourceMappingURL=index.js.map
3508
- //# debugId=77a22e54-0917-5b5e-a29d-af0ad20bed19
3508
+ //# debugId=72ca2d8b-bb14-5c87-b049-717e396842bd