@owlmeans/llm-common 0.1.18-rc.10 → 0.1.18-rc.12
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 +2 -2
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/llm-common/SKILL.md +28 -5
- package/build/consts.d.ts +7 -0
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +7 -0
- package/build/consts.js.map +1 -1
- package/build/files/types.d.ts +10 -0
- package/build/files/types.d.ts.map +1 -1
- package/build/files/utils.d.ts.map +1 -1
- package/build/types.d.ts +13 -0
- package/build/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/consts.ts +8 -0
- package/src/files/types.ts +11 -0
- package/src/types.ts +13 -0
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ extends these; `@owlmeans/llm` implements against them.
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
bun add @owlmeans/llm-common
|
|
23
|
+
bun add @owlmeans/llm-common@^0.1.18-rc.11
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
## Usage
|
|
@@ -96,7 +96,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
96
96
|
your project's skill store (`.agents/skills/`):
|
|
97
97
|
|
|
98
98
|
```sh
|
|
99
|
-
npx @owlmeans/agent-skills
|
|
99
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.12
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/llm-common",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.12",
|
|
5
|
+
"generatedAt": "2026-09-04T22:43:25.447Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/llm-common
|
|
9
9
|
|
|
10
10
|
**Layer:** Core
|
|
11
|
-
**Install:** `"@owlmeans/llm-common": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/llm-common": "^0.1.18-rc.12"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
The contracts half of the LLM stack. **No `@langchain/*` runtime dependency** — importable
|
|
14
14
|
from a browser bundle, a queue worker, or any package that must not pull an inference SDK.
|
|
@@ -26,28 +26,51 @@ The dependency direction is one-way: a domain contracts package extends these;
|
|
|
26
26
|
| `SpectatorContentType`, `SPECTATOR_GENERAL` | Observability record enums/defaults. |
|
|
27
27
|
| `ModelRole` | Open `string` — declare your own enum, its values stay assignable. |
|
|
28
28
|
| `ModelConfigPatch` / `ModelConfigOverride` | The JSON-safe config subset; never credentials. Carries the model-capability fields (`contextWindow`, `maxOutput`, `combinedWindow`) alongside the budget ones — see the `llm` skill for what each means. |
|
|
29
|
-
| `ModelPolicy` | `{ effort, roleOverrides?, modelOverrides? }` — inherited by every refinement. |
|
|
29
|
+
| `ModelPolicy` | `{ effort, roleOverrides?, modelOverrides?, utilityRole? }` — inherited by every refinement. |
|
|
30
|
+
| `UTILITY_ROLE` | `'utility'` — the conventional cheap tier for side calls (a relevance pick, a classification). `ModelPolicy.utilityRole` points it at another alias; `ExecutionService.utility` resolves it. |
|
|
30
31
|
| `ExecutionState` / `TaskExecutionState` | The persistable core (`level`/`purpose`/`policy`, plus `phase`/`completed`/`cursor`/`data`). |
|
|
31
32
|
| `LlmPurpose` | `{ type?, dedication? }` — metadata carried on every model call. |
|
|
32
33
|
| `PromptBlock`, `PROMPT_BLOCK_ORDER`, `DEFAULT_SKILL_ORDER` | The ordered sections of a composed system prompt — the order IS the cache key. |
|
|
33
34
|
| `SkillDefinition` | One named block of reusable prompt knowledge. `body` must be a pure constant. |
|
|
34
35
|
| `PromptPolicy` | `{ role?, skills?, cacheSystem?, cacheTtl? }` — carried on `ExecutionState`, merged downward. |
|
|
35
36
|
| `CacheTtl`, `CacheUsage` | `'5m' \| '1h'`; normalized prompt-cache accounting. |
|
|
36
|
-
| `LlmFileProvider`, `FileProviderRef`, `resolveFileProvider` | The
|
|
37
|
+
| `LlmFileProvider`, `FileProviderRef`, `resolveFileProvider` | The file contract prompt plugins work against — four members, every path relative to the host's project root. `FileProviderRef` accepts the provider or a thunk returning one; `resolveFileProvider` unwraps whichever form arrived, or `undefined`. |
|
|
37
38
|
| `NullCapture`, `NullKind` | Full diagnostics of a call that returned nothing usable. |
|
|
38
39
|
| `SpectatorArgument`, `SpectatorEntry`, `SpectatorEntryLogged`, `SpectatorEntryMessage` | What an observability sink stores. |
|
|
39
40
|
|
|
41
|
+
## `LlmFileProvider` — what a host must supply
|
|
42
|
+
|
|
43
|
+
A consumer's own file helper satisfies it structurally (`interface FileHelper extends
|
|
44
|
+
LlmFileProvider`); implementing it from scratch means all four:
|
|
45
|
+
|
|
46
|
+
| Member | Contract |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `readFile(path, noThrow?)` | Read a file relative to the root. With `noThrow`, a missing file yields `''`. |
|
|
49
|
+
| `getSourceList(pattern?)` | Glob for files relative to the root. Project-skill discovery in `@owlmeans/agent-skills` is built on it, so a provider that stubs it indexes nothing. |
|
|
50
|
+
| `writeFile(path, content)` | Write relative to the root, creating parent directories. |
|
|
51
|
+
| `deleteFile(path, noThrow?)` | Delete relative to the root. With `noThrow`, a missing file is a no-op. |
|
|
52
|
+
| `key?` | Optional. The provider's stable identity (project root, sandbox id) — the only thing a plugin caching per-project reads can key on, since providers are rebuilt per request. A provider without one is treated as uncacheable. |
|
|
53
|
+
|
|
54
|
+
Resolving the project root is deliberately NOT part of the contract, and an implementation must not
|
|
55
|
+
narrow an inherited signature — that is what stops a rich helper from satisfying this one.
|
|
56
|
+
|
|
40
57
|
## Extension rules
|
|
41
58
|
|
|
42
59
|
Open types are open **on purpose** — extend, do not fork:
|
|
43
60
|
|
|
44
61
|
```typescript
|
|
62
|
+
import type {
|
|
63
|
+
ExecutionState as LlmExecutionState, LlmPurpose,
|
|
64
|
+
TaskExecutionState as LlmTaskExecutionState,
|
|
65
|
+
} from '@owlmeans/llm-common'
|
|
66
|
+
|
|
45
67
|
// Your roles: an enum whose values satisfy the open `ModelRole` string.
|
|
46
68
|
export enum MyRole { Analyst = 'analyst', Coder = 'coder' }
|
|
47
69
|
|
|
48
|
-
// Your purpose and state: extend, never redeclare.
|
|
70
|
+
// Your purpose and state: extend, never redeclare. Aliasing the imports keeps your own
|
|
71
|
+
// `ExecutionState` the name the rest of your domain uses.
|
|
49
72
|
export interface MyPurpose extends LlmPurpose { agent?: string }
|
|
50
|
-
export interface MyExecutionState extends
|
|
73
|
+
export interface MyExecutionState extends LlmExecutionState {
|
|
51
74
|
purpose: MyPurpose
|
|
52
75
|
projectId?: string
|
|
53
76
|
}
|
package/build/consts.d.ts
CHANGED
|
@@ -82,4 +82,11 @@ export declare enum PromptBlock {
|
|
|
82
82
|
export declare const PROMPT_BLOCK_ORDER: readonly PromptBlock[];
|
|
83
83
|
/** Sort weight of a skill that declares none — see `SkillDefinition.order`. */
|
|
84
84
|
export declare const DEFAULT_SKILL_ORDER = 100;
|
|
85
|
+
/**
|
|
86
|
+
* Conventional {@link ModelRole} for the cheap side calls the layer makes on its own
|
|
87
|
+
* behalf — a relevance pick, a classification, a one-line judgement — rather than for the
|
|
88
|
+
* work a caller asked for. A deployment that names its cheap tier differently points
|
|
89
|
+
* `ModelPolicy.utilityRole` at its own alias; nothing else has to change.
|
|
90
|
+
*/
|
|
91
|
+
export declare const UTILITY_ROLE = "utility";
|
|
85
92
|
//# sourceMappingURL=consts.d.ts.map
|
package/build/consts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,oBAAY,aAAa;IACvB,yFAAyF;IACzF,MAAM,WAAW;IACjB,8BAA8B;IAC9B,SAAS,cAAc;IACvB,yFAAyF;IACzF,UAAU,eAAe;CAC1B;AAED;;;GAGG;AACH,oBAAY,cAAc;IACxB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED;;;;;;;;;GASG;AACH,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,0DAA0D;AAC1D,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,QAAQ,cAAc;CACvB;AAED,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,YAAY,CAAA;AAE1C;;;;;;;;;;;;;;GAcG;AACH,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,WAAW,EAK3C,CAAA;AAEV,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB,MAAM,CAAA"}
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,oBAAY,aAAa;IACvB,yFAAyF;IACzF,MAAM,WAAW;IACjB,8BAA8B;IAC9B,SAAS,cAAc;IACvB,yFAAyF;IACzF,UAAU,eAAe;CAC1B;AAED;;;GAGG;AACH,oBAAY,cAAc;IACxB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED;;;;;;;;;GASG;AACH,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,0DAA0D;AAC1D,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,QAAQ,cAAc;CACvB;AAED,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,YAAY,CAAA;AAE1C;;;;;;;;;;;;;;GAcG;AACH,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,WAAW,EAK3C,CAAA;AAEV,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB,MAAM,CAAA;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,YAAY,YAAY,CAAA"}
|
package/build/consts.js
CHANGED
|
@@ -93,4 +93,11 @@ export const PROMPT_BLOCK_ORDER = [
|
|
|
93
93
|
];
|
|
94
94
|
/** Sort weight of a skill that declares none — see `SkillDefinition.order`. */
|
|
95
95
|
export const DEFAULT_SKILL_ORDER = 100;
|
|
96
|
+
/**
|
|
97
|
+
* Conventional {@link ModelRole} for the cheap side calls the layer makes on its own
|
|
98
|
+
* behalf — a relevance pick, a classification, a one-line judgement — rather than for the
|
|
99
|
+
* work a caller asked for. A deployment that names its cheap tier differently points
|
|
100
|
+
* `ModelPolicy.utilityRole` at its own alias; nothing else has to change.
|
|
101
|
+
*/
|
|
102
|
+
export const UTILITY_ROLE = 'utility';
|
|
96
103
|
//# sourceMappingURL=consts.js.map
|
package/build/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,yFAAyF;IACzF,kCAAiB,CAAA;IACjB,8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AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA2B;IACxD,WAAW,CAAC,IAAI;IAChB,WAAW,CAAC,MAAM;IAClB,WAAW,CAAC,QAAQ;IACpB,WAAW,CAAC,OAAO;CACX,CAAA;AAEV,+EAA+E;AAC/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAA;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAA"}
|
package/build/files/types.d.ts
CHANGED
|
@@ -17,6 +17,16 @@
|
|
|
17
17
|
* that stops a rich helper from satisfying this one.
|
|
18
18
|
*/
|
|
19
19
|
export interface LlmFileProvider {
|
|
20
|
+
/**
|
|
21
|
+
* Stable identity of WHAT this provider reads — a project root, a sandbox id.
|
|
22
|
+
*
|
|
23
|
+
* A prompt plugin that caches resolved reads across calls has nothing else to key on:
|
|
24
|
+
* providers are late-bound and often rebuilt per request, so object identity says
|
|
25
|
+
* nothing, and a cache shared between two projects serves the first one's files to the
|
|
26
|
+
* second. A provider that supplies no key is treated as uncacheable rather than as one
|
|
27
|
+
* more anonymous member of a shared bucket.
|
|
28
|
+
*/
|
|
29
|
+
key?: string;
|
|
20
30
|
/** Read a file relative to the root. With `noThrow`, a missing file yields `''`. */
|
|
21
31
|
readFile: (filePath: string, noThrow?: boolean) => Promise<string>;
|
|
22
32
|
/** Glob for files relative to the root. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/files/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,eAAe;IAC9B,oFAAoF;IACpF,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAElE,2CAA2C;IAC3C,aAAa,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAEtD,gFAAgF;IAChF,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/D,qFAAqF;IACrF,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACnE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,CAAC,MAAM,eAAe,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/files/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;OAQG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,oFAAoF;IACpF,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAElE,2CAA2C;IAC3C,aAAa,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAEtD,gFAAgF;IAChF,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/D,qFAAqF;IACrF,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACnE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,CAAC,MAAM,eAAe,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/files/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAElE,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/files/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAElE,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,QACzB,eAAe,GAAG,SAAS,KAC/B,eAAe,GAAG,SAAoD,CAAA"}
|
package/build/types.d.ts
CHANGED
|
@@ -50,6 +50,12 @@ export interface ModelPolicy {
|
|
|
50
50
|
roleOverrides?: Partial<Record<ModelRole, ModelRole>>;
|
|
51
51
|
/** "Pin a role to a specific model/config" — alias or partial config override. */
|
|
52
52
|
modelOverrides?: Partial<Record<ModelRole, ModelConfigOverride>>;
|
|
53
|
+
/**
|
|
54
|
+
* Role resolved by `ExecutionService.utility` for cheap side calls. Defaults to
|
|
55
|
+
* `UTILITY_ROLE`; name another alias when the deployment calls its cheap tier
|
|
56
|
+
* something else. `roleOverrides` still applies on top of whichever one is used.
|
|
57
|
+
*/
|
|
58
|
+
utilityRole?: ModelRole;
|
|
53
59
|
}
|
|
54
60
|
/**
|
|
55
61
|
* Lifetime of a provider-side prompt cache entry. `'1h'` costs roughly twice as much to
|
|
@@ -177,11 +183,18 @@ export interface NullCapture {
|
|
|
177
183
|
tool_calls?: unknown;
|
|
178
184
|
} | null;
|
|
179
185
|
diagnostics: {
|
|
186
|
+
/** Whatever the provider called it — OpenAI's `finish_reason` or Anthropic's `stop_reason`. */
|
|
180
187
|
finishReason?: string;
|
|
181
188
|
inputTokens?: number;
|
|
182
189
|
outputTokens?: number;
|
|
183
190
|
reasoningTokens?: number;
|
|
184
191
|
contentEmpty: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Content arrived, but none of it was text — the shape of an answer that was all reasoning.
|
|
194
|
+
* Distinguishes "spent the budget thinking" from "returned nothing at all", which
|
|
195
|
+
* `contentEmpty` alone cannot.
|
|
196
|
+
*/
|
|
197
|
+
thinkingOnly?: boolean;
|
|
185
198
|
hadToolCall: boolean;
|
|
186
199
|
};
|
|
187
200
|
}
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE/E;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,gBAAgB,CAAA;AAE3D;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,MAAM,EAAE,eAAe,CAAA;IACvB,oFAAoF;IACpF,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAA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Ac,CAAC,EAAE,OAAO,CAAA;QACxB,UAAU,CAAC,EAAE,OAAO,CAAA;KACrB,GAAG,IAAI,CAAA;IACR,WAAW,EAAE;QACX,+FAA+F;QAC/F,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,YAAY,EAAE,OAAO,CAAA;QACrB;;;;WAIG;QACH,YAAY,CAAC,EAAE,OAAO,CAAA;QACtB,WAAW,EAAE,OAAO,CAAA;KACrB,CAAA;CACF"}
|
package/package.json
CHANGED
package/src/consts.ts
CHANGED
|
@@ -96,3 +96,11 @@ export const PROMPT_BLOCK_ORDER: readonly PromptBlock[] = [
|
|
|
96
96
|
|
|
97
97
|
/** Sort weight of a skill that declares none — see `SkillDefinition.order`. */
|
|
98
98
|
export const DEFAULT_SKILL_ORDER = 100
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Conventional {@link ModelRole} for the cheap side calls the layer makes on its own
|
|
102
|
+
* behalf — a relevance pick, a classification, a one-line judgement — rather than for the
|
|
103
|
+
* work a caller asked for. A deployment that names its cheap tier differently points
|
|
104
|
+
* `ModelPolicy.utilityRole` at its own alias; nothing else has to change.
|
|
105
|
+
*/
|
|
106
|
+
export const UTILITY_ROLE = 'utility'
|
package/src/files/types.ts
CHANGED
|
@@ -17,6 +17,17 @@
|
|
|
17
17
|
* that stops a rich helper from satisfying this one.
|
|
18
18
|
*/
|
|
19
19
|
export interface LlmFileProvider {
|
|
20
|
+
/**
|
|
21
|
+
* Stable identity of WHAT this provider reads — a project root, a sandbox id.
|
|
22
|
+
*
|
|
23
|
+
* A prompt plugin that caches resolved reads across calls has nothing else to key on:
|
|
24
|
+
* providers are late-bound and often rebuilt per request, so object identity says
|
|
25
|
+
* nothing, and a cache shared between two projects serves the first one's files to the
|
|
26
|
+
* second. A provider that supplies no key is treated as uncacheable rather than as one
|
|
27
|
+
* more anonymous member of a shared bucket.
|
|
28
|
+
*/
|
|
29
|
+
key?: string
|
|
30
|
+
|
|
20
31
|
/** Read a file relative to the root. With `noThrow`, a missing file yields `''`. */
|
|
21
32
|
readFile: (filePath: string, noThrow?: boolean) => Promise<string>
|
|
22
33
|
|
package/src/types.ts
CHANGED
|
@@ -55,6 +55,12 @@ export interface ModelPolicy {
|
|
|
55
55
|
roleOverrides?: Partial<Record<ModelRole, ModelRole>>
|
|
56
56
|
/** "Pin a role to a specific model/config" — alias or partial config override. */
|
|
57
57
|
modelOverrides?: Partial<Record<ModelRole, ModelConfigOverride>>
|
|
58
|
+
/**
|
|
59
|
+
* Role resolved by `ExecutionService.utility` for cheap side calls. Defaults to
|
|
60
|
+
* `UTILITY_ROLE`; name another alias when the deployment calls its cheap tier
|
|
61
|
+
* something else. `roleOverrides` still applies on top of whichever one is used.
|
|
62
|
+
*/
|
|
63
|
+
utilityRole?: ModelRole
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
/**
|
|
@@ -187,11 +193,18 @@ export interface NullCapture {
|
|
|
187
193
|
tool_calls?: unknown
|
|
188
194
|
} | null
|
|
189
195
|
diagnostics: {
|
|
196
|
+
/** Whatever the provider called it — OpenAI's `finish_reason` or Anthropic's `stop_reason`. */
|
|
190
197
|
finishReason?: string
|
|
191
198
|
inputTokens?: number
|
|
192
199
|
outputTokens?: number
|
|
193
200
|
reasoningTokens?: number
|
|
194
201
|
contentEmpty: boolean
|
|
202
|
+
/**
|
|
203
|
+
* Content arrived, but none of it was text — the shape of an answer that was all reasoning.
|
|
204
|
+
* Distinguishes "spent the budget thinking" from "returned nothing at all", which
|
|
205
|
+
* `contentEmpty` alone cannot.
|
|
206
|
+
*/
|
|
207
|
+
thinkingOnly?: boolean
|
|
195
208
|
hadToolCall: boolean
|
|
196
209
|
}
|
|
197
210
|
}
|