@skillstate/core 2.0.4 → 2.0.6

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
@@ -6,7 +6,7 @@
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/@skillstate/core)](https://www.npmjs.com/package/@skillstate/core)
8
8
  [![node](https://img.shields.io/node/v/@skillstate/core)](https://www.npmjs.com/package/@skillstate/core)
9
- [![Tests](https://img.shields.io/badge/tests-755%20passing-brightgreen)](https://github.com/vitalykuzyaev/skillstate)
9
+ [![Tests](https://img.shields.io/badge/tests-873%20passing-brightgreen)](https://github.com/vitalykuzyaev/skillstate)
10
10
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/vitalykuzyaev/skillstate/blob/main/LICENSE)
11
11
 
12
12
  </div>
@@ -14,7 +14,7 @@ export interface TokenCounter {
14
14
  count(text: string): number;
15
15
  }
16
16
  /**
17
- * @non-paper legacy heuristic: 1 token ≈ 4 chars, rounded up.
17
+ * @non-paper rough heuristic: 1 token ≈ 4 chars, rounded up.
18
18
  *
19
19
  * Kept for backward compatibility of ad-hoc estimates only. Do NOT use it
20
20
  * for paper §4.3 metrics — those are measured in chars (see `TokenTracker`).
@@ -9,7 +9,7 @@
9
9
  * paper-exact baseline in `./token-tracker.js`.
10
10
  */
11
11
  /**
12
- * @non-paper legacy heuristic: 1 token ≈ 4 chars, rounded up.
12
+ * @non-paper rough heuristic: 1 token ≈ 4 chars, rounded up.
13
13
  *
14
14
  * Kept for backward compatibility of ad-hoc estimates only. Do NOT use it
15
15
  * for paper §4.3 metrics — those are measured in chars (see `TokenTracker`).
@@ -8,10 +8,10 @@
8
8
  * - `LLMProvider.call(prompt, opts?)` resolves `{ text, usage? }` where
9
9
  * `usage.promptChars` / `usage.completionChars` are RAW STRING CHARS
10
10
  * (§4.3) reported by the caller — never tokenizer output;
11
- * - `fromLLMFn(fn)` wraps a legacy `LLMFn` into an `LLMProvider`
11
+ * - `fromLLMFn(fn)` wraps a plain `LLMFn` function into an `LLMProvider`
12
12
  * (backwards compatibility; `LLMFn` itself is NOT removed);
13
13
  * - `isLLMProvider(v)` distinguishes `LLMFn | LLMProvider` at runtime
14
- * (function = legacy fn, object with a `call` function = provider).
14
+ * (plain function = fn form, object with a `call` function = provider).
15
15
  *
16
16
  * The runtime accepts `llm: LLMFn | LLMProvider`: with a provider it
17
17
  * prefers `usage` over measuring strings, otherwise it measures exactly
@@ -27,7 +27,7 @@ export interface LLMCallOptions {
27
27
  /**
28
28
  * @non-paper usage reported by the provider, in raw string CHARS (§4.3).
29
29
  * Both fields are optional: missing values fall back to measuring the
30
- * corresponding string, exactly the legacy `LLMFn` behavior.
30
+ * corresponding string, exactly the plain `LLMFn` behavior.
31
31
  */
32
32
  export interface LLMUsage {
33
33
  /** Raw chars of the prompt as sent (overrides `prompt.length`). */
@@ -49,11 +49,11 @@ export interface LLMProvider {
49
49
  }
50
50
  /**
51
51
  * @non-paper runtime guard: an object with a callable `call` is a
52
- * provider; anything else passed as `llm` is treated as a legacy `LLMFn`.
52
+ * provider; anything else passed as `llm` is treated as a plain `LLMFn`.
53
53
  */
54
54
  export declare function isLLMProvider(value: unknown): value is LLMProvider;
55
55
  /**
56
- * @non-paper backwards-compatibility adapter: wrap a legacy `LLMFn`
56
+ * @non-paper adapter: wrap a plain `LLMFn` function
57
57
  * into an `LLMProvider`. The wrapper honors an already-aborted `signal`
58
58
  * (rejects with `signal.reason`) and otherwise delegates verbatim —
59
59
  * no usage is synthesized, so the runtime measures strings as before.
package/dist/provider.js CHANGED
@@ -8,10 +8,10 @@
8
8
  * - `LLMProvider.call(prompt, opts?)` resolves `{ text, usage? }` where
9
9
  * `usage.promptChars` / `usage.completionChars` are RAW STRING CHARS
10
10
  * (§4.3) reported by the caller — never tokenizer output;
11
- * - `fromLLMFn(fn)` wraps a legacy `LLMFn` into an `LLMProvider`
11
+ * - `fromLLMFn(fn)` wraps a plain `LLMFn` function into an `LLMProvider`
12
12
  * (backwards compatibility; `LLMFn` itself is NOT removed);
13
13
  * - `isLLMProvider(v)` distinguishes `LLMFn | LLMProvider` at runtime
14
- * (function = legacy fn, object with a `call` function = provider).
14
+ * (plain function = fn form, object with a `call` function = provider).
15
15
  *
16
16
  * The runtime accepts `llm: LLMFn | LLMProvider`: with a provider it
17
17
  * prefers `usage` over measuring strings, otherwise it measures exactly
@@ -19,7 +19,7 @@
19
19
  */
20
20
  /**
21
21
  * @non-paper runtime guard: an object with a callable `call` is a
22
- * provider; anything else passed as `llm` is treated as a legacy `LLMFn`.
22
+ * provider; anything else passed as `llm` is treated as a plain `LLMFn`.
23
23
  */
24
24
  export function isLLMProvider(value) {
25
25
  if (typeof value !== 'object' || value === null) {
@@ -28,7 +28,7 @@ export function isLLMProvider(value) {
28
28
  return typeof value.call === 'function';
29
29
  }
30
30
  /**
31
- * @non-paper backwards-compatibility adapter: wrap a legacy `LLMFn`
31
+ * @non-paper adapter: wrap a plain `LLMFn` function
32
32
  * into an `LLMProvider`. The wrapper honors an already-aborted `signal`
33
33
  * (rejects with `signal.reason`) and otherwise delegates verbatim —
34
34
  * no usage is synthesized, so the runtime measures strings as before.
package/dist/runtime.d.ts CHANGED
@@ -183,7 +183,7 @@ export declare class SkillStateRuntime {
183
183
  /**
184
184
  * @non-paper LLM dispatch (Wave 4 DX, additive).
185
185
  *
186
- * Paper path: `llm` is a legacy `LLMFn` — called verbatim with the
186
+ * Paper path: `llm` is a plain `LLMFn` function — called verbatim with the
187
187
  * prompt, exactly as before. Provider path: `llm.call(prompt, opts?)`
188
188
  * is used instead, forwarding the runtime `signal?` so aborts reach
189
189
  * the provider; both paths stay inside `invokeResilient`, so the
package/dist/runtime.js CHANGED
@@ -134,7 +134,7 @@ export class SkillStateRuntime {
134
134
  /**
135
135
  * @non-paper LLM dispatch (Wave 4 DX, additive).
136
136
  *
137
- * Paper path: `llm` is a legacy `LLMFn` — called verbatim with the
137
+ * Paper path: `llm` is a plain `LLMFn` function — called verbatim with the
138
138
  * prompt, exactly as before. Provider path: `llm.call(prompt, opts?)`
139
139
  * is used instead, forwarding the runtime `signal?` so aborts reach
140
140
  * the provider; both paths stay inside `invokeResilient`, so the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillstate/core",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Paper-exact skillstate runtime core (A.4 byte-verbatim formatPaper, §4.3 token tracker).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",