@cubicecho/agent-core 2.23.0 → 2.24.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/README.md CHANGED
@@ -22,7 +22,7 @@ only, Node >=22.
22
22
 
23
23
  | Module | What it does |
24
24
  | --- | --- |
25
- | `schema-compat` | Makes an MCP tool schema something a strict or grammar-constrained server will accept. `sanitizeTools`, `relaxTools`, `isGrammarError`. |
25
+ | `schema-compat` | Makes an MCP tool schema something a strict or grammar-constrained server will accept. `sanitizeTools`, `relaxTools`, `isGrammarError`, and `sanitizeSchema` and `relaxSchema` for a schema that is not a tool's. |
26
26
  | `tool-loading` | On-demand tool discovery: a name-only catalogue plus a `load_tools` meta-tool, so a run pays for the schemas it asks for instead of all of them. Plus `preselectByKeywords`, which picks from it without a model, and the proxied form of the same thing — `PROXY_TOOLS`, `proxyLoadResult`, `proxiedCall` — for a server whose prompt cache a growing tool array throws away. |
27
27
  | `stream` | Reads one streamed turn back into a message: token callbacks, tool-call reassembly, fenced reasoning taken out of the answer, and the idle watchdog that turns a silent endpoint into `EndpointSilent`. |
28
28
  | `capabilities` | What an endpoint turned out not to support — and, under it, what one model on that endpoint did not — plus the loop that answers either when it says so. `capabilitiesFor`, `modelCapabilitiesFor`, `negotiate`. |
@@ -232,7 +232,9 @@ tasks and model listings, the same way.
232
232
  hold the reply to, so a small model that wraps JSON in prose on its own cannot do so here. The
233
233
  schema is normalised the way a tool's parameters are, and relaxed where the endpoint could not
234
234
  build a grammar, because llama.cpp reads both with the same converter. It also rides on the system
235
- prompt, and the reply goes through `parseJson` either way.
235
+ prompt, and the reply goes through `parseJson` either way — which finds the JSON inside prose or a
236
+ fence and repairs what a local model gets nearly right: single quotes, `True` and `None`, bare keys,
237
+ a trailing comma.
236
238
 
237
239
  ```ts
238
240
  const picked = await askJson<{ tools: string[] }>(config, small, system, request, PRESELECT_SCHEMA, {
@@ -4,10 +4,11 @@ import type { CatalogServer } from "./catalog.ts";
4
4
  import { type CompactionOptions } from "./compaction.ts";
5
5
  import type { Endpoint, ModelParams, RetryPolicy, ToolPolicy } from "./config.ts";
6
6
  import { type RunEventInput, type RunMetrics } from "./events.ts";
7
- import { type HookContext, type HookEvent, type HookNote, type HookRunner } from "./hooks.ts";
7
+ import type { HookEvent } from "./hook-events.ts";
8
+ import { type HookContext, type HookNote, type HookRunner } from "./hooks.ts";
8
9
  import { type TokenLedger } from "./ledger.ts";
9
10
  import { type SideTask, type SideTaskOptions } from "./side-task.ts";
10
- import type { Turn, TurnUsage } from "./stream.ts";
11
+ import { type Turn, type TurnUsage } from "./stream.ts";
11
12
  import { type KeywordPreselectOptions, type ToolOrder } from "./tool-loading.ts";
12
13
  /**
13
14
  * The one place a streamed request's body is decided from a config and what the endpoint and