@skein-code/cli 0.3.17 → 0.3.18

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
@@ -220,7 +220,7 @@ function isSqliteBusy(error) {
220
220
  // package.json
221
221
  var package_default = {
222
222
  name: "@skein-code/cli",
223
- version: "0.3.17",
223
+ version: "0.3.18",
224
224
  description: "A context-first, model-agnostic coding agent with an auditable terminal workspace.",
225
225
  type: "module",
226
226
  license: "MIT",
@@ -236,6 +236,9 @@ var package_default = {
236
236
  },
237
237
  skein: {
238
238
  releaseNotes: [
239
+ "Large MCP catalogs now disclose at most eight request-relevant schemas per run while preserving network permissions",
240
+ "Token Ledger receipts report deferred progressive schemas and selected definitions remain stable across tool turns",
241
+ "A deterministic Token Economy replay benchmark guards evidence, output-firewall, and no-progress invariants",
239
242
  "Calibrated Type-1/2 duplication matches now block completion until reuse or exact audited suppression",
240
243
  "Type-3 duplication remains warning-only and Type-4 semantic equivalence remains explicitly unsupported",
241
244
  "Duplication benchmark fixtures report deterministic recall, precision, false-positive rate, and latency",
@@ -278,6 +281,7 @@ var package_default = {
278
281
  "test:pty": "sh test/pty/run-visual.sh",
279
282
  "benchmark:context": "tsx scripts/benchmark-local-index.ts",
280
283
  "benchmark:duplication": "tsx scripts/benchmark-duplication.ts",
284
+ "benchmark:token-economy": "tsx scripts/benchmark-token-economy.ts",
281
285
  "verify:package": "node scripts/verify-package.mjs",
282
286
  "release:verify": "npm run check && npm run verify:package --",
283
287
  typecheck: "tsc --noEmit",
@@ -10085,6 +10089,7 @@ var AgentRunner = class {
10085
10089
  };
10086
10090
  const changeSequenceAtStart = this.changeSequence;
10087
10091
  const runStartedAt = (/* @__PURE__ */ new Date()).toISOString();
10092
+ const loadedProgressiveTools = /* @__PURE__ */ new Set();
10088
10093
  const runChangedFiles = /* @__PURE__ */ new Set();
10089
10094
  const verificationEvidence = [];
10090
10095
  const toolRecovery = new ToolRecoveryController();
@@ -10248,7 +10253,9 @@ var AgentRunner = class {
10248
10253
  activeDuplicationMatchIds(
10249
10254
  this.session.audit ?? [],
10250
10255
  this.session.duplicationSuppressions ?? []
10251
- ).size > 0
10256
+ ).size > 0,
10257
+ request,
10258
+ loadedProgressiveTools
10252
10259
  );
10253
10260
  const estimatedInputTokens = estimateMessages2(messages) + estimateToolDefinitions(visibleTools);
10254
10261
  if (availableTokens <= 0 || estimatedInputTokens >= availableTokens) {
@@ -10313,7 +10320,10 @@ var AgentRunner = class {
10313
10320
  },
10314
10321
  inputSource: actualInputTokens === void 0 ? "estimated" : "actual",
10315
10322
  outputSource: actualOutputTokens === void 0 ? "estimated" : "actual",
10316
- tools: { loaded: visibleTools.map((tool) => tool.name), deferredCount: 0 },
10323
+ tools: {
10324
+ loaded: visibleTools.map((tool) => tool.name),
10325
+ deferredCount: Math.max(0, this.tools.definitions().filter((tool) => tool.progressive).length - visibleTools.filter((tool) => tool.progressive).length)
10326
+ },
10317
10327
  retrieval: tokenRetrievalReceipt(packed)
10318
10328
  });
10319
10329
  await emit({
@@ -11079,10 +11089,25 @@ ${content}` : content,
11079
11089
  ...failure ? { metadata: { failure } } : {}
11080
11090
  };
11081
11091
  }
11082
- function visibleToolDefinitions(tools, askMode, contractEnabled, artifactReadAvailable, duplicationAvailable) {
11083
- return tools.definitions().filter(
11092
+ function visibleToolDefinitions(tools, askMode, contractEnabled, artifactReadAvailable, duplicationAvailable, request, loadedProgressiveTools) {
11093
+ const eligible = tools.definitions().filter(
11084
11094
  (tool) => (!askMode || tool.category === "read") && (contractEnabled || tool.name !== "task_contract") && (artifactReadAvailable || tool.name !== "read_tool_artifact") && (duplicationAvailable || tool.name !== "duplication_audit")
11085
11095
  );
11096
+ const progressive = eligible.filter((tool) => tool.progressive);
11097
+ if (progressive.length <= 8) return eligible;
11098
+ for (const tool of selectProgressiveTools(progressive, request, 8)) {
11099
+ loadedProgressiveTools.add(tool.name);
11100
+ }
11101
+ return eligible.filter((tool) => !tool.progressive || loadedProgressiveTools.has(tool.name));
11102
+ }
11103
+ function selectProgressiveTools(tools, request, limit) {
11104
+ const terms = new Set(request.toLocaleLowerCase().match(/[\p{L}\p{N}_-]{2,}/gu) ?? []);
11105
+ return tools.map((tool) => {
11106
+ const searchable = `${tool.name.replaceAll("_", " ")} ${tool.description}`.toLocaleLowerCase();
11107
+ let score = 0;
11108
+ for (const term of terms) if (searchable.includes(term)) score += term.length;
11109
+ return { tool, score };
11110
+ }).sort((left, right) => right.score - left.score || left.tool.name.localeCompare(right.tool.name)).slice(0, limit).map(({ tool }) => tool);
11086
11111
  }
11087
11112
  function formatToolError(error) {
11088
11113
  const normalized = toError(error);
@@ -18995,7 +19020,8 @@ function createMcpToolAdapter(options) {
18995
19020
  // MCP servers are an external trust boundary. Read-only annotations are
18996
19021
  // hints from that server and must not lower the local permission level.
18997
19022
  category: "network",
18998
- inputSchema: inputSchema13
19023
+ inputSchema: inputSchema13,
19024
+ progressive: true
18999
19025
  },
19000
19026
  permissionCategories: () => ["network"],
19001
19027
  async execute(arguments_, context) {