@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 +4 -2
- package/dist/agent-loop.d.ts +3 -2
- package/dist/agent-loop.js +385 -303
- package/dist/calibration.js +2 -1
- package/dist/capabilities.d.ts +36 -0
- package/dist/capabilities.js +106 -56
- package/dist/client.js +11 -10
- package/dist/compaction.js +5 -9
- package/dist/continuation.d.ts +4 -4
- package/dist/continuation.js +1 -4
- package/dist/events.d.ts +13 -0
- package/dist/events.js +28 -21
- package/dist/guards.d.ts +22 -0
- package/dist/guards.js +22 -0
- package/dist/hook-events.d.ts +22 -0
- package/dist/hook-events.js +22 -0
- package/dist/hooks.d.ts +13 -14
- package/dist/hooks.js +35 -36
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/retry.d.ts +13 -7
- package/dist/retry.js +14 -7
- package/dist/run-turn.d.ts +8 -1
- package/dist/schema-compat.d.ts +23 -0
- package/dist/schema-compat.js +76 -59
- package/dist/side-task.d.ts +5 -0
- package/dist/side-task.js +18 -47
- package/dist/snapshot.d.ts +2 -2
- package/dist/snapshot.js +27 -48
- package/dist/spec.d.ts +11 -12
- package/dist/spec.js +36 -66
- package/dist/stream.d.ts +7 -0
- package/dist/stream.js +8 -1
- package/dist/thinking.js +6 -4
- package/dist/tokens.d.ts +9 -2
- package/dist/tokens.js +10 -3
- package/dist/tool-calls.d.ts +9 -0
- package/dist/tool-calls.js +11 -6
- package/dist/tool-loading.d.ts +10 -0
- package/dist/tool-loading.js +15 -7
- package/llms.txt +12 -5
- package/package.json +1 -1
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, {
|
package/dist/agent-loop.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|