@lunchbox-labs/kilo-tool-inspector 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/tui.js +24 -45
  2. package/package.json +1 -1
package/dist/tui.js CHANGED
@@ -392,7 +392,7 @@ function namedValues(values, name, separator, { distinct = false } = {}) {
392
392
  const rest = values.length - named;
393
393
  return [...names, ...rest > 0 ? [`… ${rest} more`] : []].join(separator);
394
394
  }
395
- function plain$1(text) {
395
+ function plain(text) {
396
396
  return {
397
397
  text,
398
398
  tone: "plain"
@@ -410,7 +410,7 @@ function indentText(depth) {
410
410
  function writeDescription(rendering, description, depth) {
411
411
  if (typeof description !== "string" || description.trim() === "") return;
412
412
  const text = shortened(description.trim(), maximumDescriptionLength);
413
- for (const line of text.split(/\r?\n/)) write(rendering, [plain$1(`${indentText(depth)}${line}`)]);
413
+ for (const line of text.split(/\r?\n/)) write(rendering, [plain(`${indentText(depth)}${line}`)]);
414
414
  }
415
415
  function withoutReference(node) {
416
416
  const { $ref: _reference, ...rest } = node;
@@ -727,7 +727,7 @@ function objectUnion(node, rendering, visiting, nesting = 0) {
727
727
  function writeProperties(rendering, objectSchema, visiting, depth, path) {
728
728
  if (depth > maximumDepth) {
729
729
  rendering.depthCutoffs++;
730
- write(rendering, [plain$1(`${indentText(depth)}…`)]);
730
+ write(rendering, [plain(`${indentText(depth)}…`)]);
731
731
  return;
732
732
  }
733
733
  /**
@@ -736,7 +736,7 @@ function writeProperties(rendering, objectSchema, visiting, depth, path) {
736
736
  */
737
737
  const writeListedAt = (listing) => {
738
738
  if (listing === void 0) return false;
739
- write(rendering, [plain$1(indentText(depth + 1)), muted$2(`Same fields as ${listing.path}.`)]);
739
+ write(rendering, [plain(indentText(depth + 1)), muted$2(`Same fields as ${listing.path}.`)]);
740
740
  return true;
741
741
  };
742
742
  const listingOf = (definition) => definition === void 0 ? void 0 : rendering.listedDefinitions.get(definition);
@@ -775,7 +775,7 @@ function writeProperties(rendering, objectSchema, visiting, depth, path) {
775
775
  ...constraintNotes(resolved)
776
776
  ];
777
777
  write(rendering, [
778
- plain$1(indentText(depth)),
778
+ plain(indentText(depth)),
779
779
  {
780
780
  text: name,
781
781
  tone: "name"
@@ -788,10 +788,10 @@ function writeProperties(rendering, objectSchema, visiting, depth, path) {
788
788
  else if (isObject(property)) writeListedAt(listingOf(recursiveDefinition(property, rendering, visiting)));
789
789
  }
790
790
  }
791
- if (rendering.cutMerges.has(objectSchema)) write(rendering, [plain$1(`${indentText(depth)}…`)]);
792
- if (properties.length > 0 && listedOptions.length > 0) write(rendering, [plain$1(indentText(depth)), muted$2("And one of:")]);
791
+ if (rendering.cutMerges.has(objectSchema)) write(rendering, [plain(`${indentText(depth)}…`)]);
792
+ if (properties.length > 0 && listedOptions.length > 0) write(rendering, [plain(indentText(depth)), muted$2("And one of:")]);
793
793
  listedOptions.forEach((variant, index) => {
794
- const heading = [plain$1(indentText(depth)), {
794
+ const heading = [plain(indentText(depth)), {
795
795
  text: `Option ${index + 1}`,
796
796
  tone: "name"
797
797
  }];
@@ -825,7 +825,7 @@ function rootLines(rendering, schema) {
825
825
  }
826
826
  const type = typeName(schema, rendering, noneVisiting, 0);
827
827
  if (type === "object" || type === "any") return hasCombinators(resolved) ? capped(rawSchemaLines(rendering.hostName, schema)) : [[muted$2("Takes no input.")]];
828
- return [[plain$1("Input is "), {
828
+ return [[plain("Input is "), {
829
829
  text: type,
830
830
  tone: "name"
831
831
  }]];
@@ -860,47 +860,29 @@ function linesText(lines) {
860
860
  }
861
861
 
862
862
  // ../core/src/agent-text.ts
863
- const modeLabels = {
864
- primary: "primary",
865
- subagent: "subagent",
866
- all: "primary or subagent",
867
- unknown: void 0
868
- };
869
863
  function muted$1(text) {
870
864
  return {
871
865
  text,
872
866
  tone: "muted"
873
867
  };
874
868
  }
875
- function plain(text) {
876
- return {
877
- text,
878
- tone: "plain"
879
- };
880
- }
881
- function indent(depth) {
882
- return " ".repeat(depth);
883
- }
884
869
  function decisionSummary(decision, actionLabels) {
885
- if (decision.access === "unknown") return "unknown, permissions couldn't be read";
886
- if (decision.offeredToModel === false) return "not offered to the model";
870
+ if (decision.access === "unknown") return "Unknown";
871
+ if (decision.offeredToModel === false) return actionLabels.deny;
887
872
  return actionLabels[decision.access];
888
873
  }
889
- function exceptionLines(decision, depth, actionLabels) {
874
+ function exceptionLines(decision, actionLabels) {
890
875
  if (decision.offeredToModel === false) return [];
891
- return decision.exceptions.map((exception) => [plain(`${indent(depth)}${actionLabels[exception.access]} for `), {
892
- text: exception.pattern,
876
+ return decision.exceptions.map((exception) => [{
877
+ text: ` ${exception.pattern}`,
893
878
  tone: "name"
894
- }]);
879
+ }, muted$1(`: ${actionLabels[exception.access]}`)]);
895
880
  }
896
881
  function agentLines(agent, actionLabels) {
897
- const notes = [modeLabels[agent.mode], ...agent.hidden ? ["hidden"] : []].filter((note) => note !== void 0);
898
- const lines = [[{
882
+ return [[{
899
883
  text: agent.agent,
900
884
  tone: "name"
901
- }, muted$1(` ${notes.length === 0 ? "" : `${notes.join(", ")}: `}${decisionSummary(agent, actionLabels)}`)], ...exceptionLines(agent, 1, actionLabels)];
902
- if (agent.whenSubagent !== void 0) lines.push([plain(`${indent(1)}as a subagent: ${decisionSummary(agent.whenSubagent, actionLabels)}`)], ...exceptionLines(agent.whenSubagent, 2, actionLabels));
903
- return lines;
885
+ }, muted$1(` ${decisionSummary(agent, actionLabels)}`)], ...exceptionLines(agent, actionLabels)];
904
886
  }
905
887
  /** The host's own hidden agents, such as `compaction` and `title`, never take tool calls. */
906
888
  function listed(agent) {
@@ -925,13 +907,10 @@ function agentAccessLines(access, host) {
925
907
  const { actionLabels } = host;
926
908
  const agents = access.agents.filter(listed).sort(primaryFirst);
927
909
  if (agents.length === 0) return [[muted$1(`${host.name} reported no agents that use tools.`)]];
928
- const permissionNote = access.permission === access.tool ? [] : [[muted$1(`Checked as the ${access.permission} permission.`)]];
929
- const patternNote = agents.some((agent) => exceptionLines(agent, 1, actionLabels).length > 0 || agent.whenSubagent !== void 0 && exceptionLines(agent.whenSubagent, 2, actionLabels).length > 0) ? [[muted$1("Patterns match the call's input, such as a command or path; a later line wins.")]] : [];
930
910
  return [
931
- ...permissionNote,
911
+ ...access.permission === access.tool ? [] : [[muted$1(`Checked as the ${access.permission} permission.`)]],
932
912
  ...accessNoteLines(host.accessNotes, access),
933
- ...agents.flatMap((agent) => agentLines(agent, actionLabels)),
934
- ...patternNote
913
+ ...agents.flatMap((agent) => agentLines(agent, actionLabels))
935
914
  ];
936
915
  }
937
916
 
@@ -1385,15 +1364,15 @@ function createToolInspectorTui(host) {
1385
1364
  // src/host.ts
1386
1365
  const protectedConfigPaths = ["Kilo checks protected config paths separately; broad read grants do not automatically authorize sensitive .env files."];
1387
1366
  /**
1388
- * Kilo applies call-time checks beyond the configured rules, so its labels and notes say that
1389
- * the detail shows configuration rather than a final authorization decision.
1367
+ * Kilo applies call-time checks beyond the configured rules, so its notes distinguish the
1368
+ * configured permissions from a final authorization decision.
1390
1369
  */
1391
1370
  const kiloHost = {
1392
1371
  name: "Kilo",
1393
1372
  actionLabels: {
1394
- allow: "allowed by configured rules",
1395
- ask: "asks first by configured rules",
1396
- deny: "denied by configured rules"
1373
+ allow: "Allow",
1374
+ ask: "Ask",
1375
+ deny: "Deny"
1397
1376
  },
1398
1377
  accessNotes: {
1399
1378
  always: ["Configured rules only. Kilo can still ask or deny at call time; saved approvals, hard limits, skill commands and sandbox escalation are not resolved here."],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunchbox-labs/kilo-tool-inspector",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Inspect the tools available to Kilo agents from the TUI",
5
5
  "license": "MIT",
6
6
  "type": "module",