@owlmeans/llm 0.1.15 → 0.1.16
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 +3 -4
- package/agent-meta/manifest.json +9 -9
- package/agent-meta/skills/llm/SKILL.md +54 -4
- package/agent-meta/skills/llm-prompt-caching/SKILL.md +135 -0
- package/build/consts.d.ts +36 -3
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +37 -4
- package/build/consts.js.map +1 -1
- package/build/execution/service.d.ts.map +1 -1
- package/build/execution/service.js +8 -3
- package/build/execution/service.js.map +1 -1
- package/build/execution/types.d.ts +20 -1
- package/build/execution/types.d.ts.map +1 -1
- package/build/execution/utils.d.ts +12 -1
- package/build/execution/utils.d.ts.map +1 -1
- package/build/execution/utils.js +22 -0
- package/build/execution/utils.js.map +1 -1
- package/build/helpers/cache.d.ts +17 -0
- package/build/helpers/cache.d.ts.map +1 -0
- package/build/helpers/cache.js +22 -0
- package/build/helpers/cache.js.map +1 -0
- package/build/helpers/index.d.ts +1 -0
- package/build/helpers/index.d.ts.map +1 -1
- package/build/helpers/index.js +1 -0
- package/build/helpers/index.js.map +1 -1
- package/build/helpers/spectate.d.ts.map +1 -1
- package/build/helpers/spectate.js +7 -0
- package/build/helpers/spectate.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/model.d.ts +1 -1
- package/build/model.d.ts.map +1 -1
- package/build/model.js +90 -16
- package/build/model.js.map +1 -1
- package/build/plugins/anthropic.d.ts.map +1 -1
- package/build/plugins/anthropic.js +136 -21
- package/build/plugins/anthropic.js.map +1 -1
- package/build/plugins/openai.d.ts +9 -0
- package/build/plugins/openai.d.ts.map +1 -1
- package/build/plugins/openai.js +23 -1
- package/build/plugins/openai.js.map +1 -1
- package/build/plugins/types.d.ts +38 -5
- package/build/plugins/types.d.ts.map +1 -1
- package/build/prompt/index.d.ts +5 -0
- package/build/prompt/index.d.ts.map +1 -0
- package/build/prompt/index.js +4 -0
- package/build/prompt/index.js.map +1 -0
- package/build/prompt/plugins.d.ts +24 -0
- package/build/prompt/plugins.d.ts.map +1 -0
- package/build/prompt/plugins.js +64 -0
- package/build/prompt/plugins.js.map +1 -0
- package/build/prompt/render.d.ts +28 -0
- package/build/prompt/render.d.ts.map +1 -0
- package/build/prompt/render.js +39 -0
- package/build/prompt/render.js.map +1 -0
- package/build/prompt/service.d.ts +16 -0
- package/build/prompt/service.d.ts.map +1 -0
- package/build/prompt/service.js +145 -0
- package/build/prompt/service.js.map +1 -0
- package/build/prompt/types.d.ts +101 -0
- package/build/prompt/types.d.ts.map +1 -0
- package/build/prompt/types.js +2 -0
- package/build/prompt/types.js.map +1 -0
- package/build/service.d.ts.map +1 -1
- package/build/service.js +3 -0
- package/build/service.js.map +1 -1
- package/build/types.d.ts +53 -3
- package/build/types.d.ts.map +1 -1
- package/build/utils/prompt.d.ts +14 -0
- package/build/utils/prompt.d.ts.map +1 -1
- package/build/utils/prompt.js +32 -0
- package/build/utils/prompt.js.map +1 -1
- package/package.json +13 -6
- package/src/consts.ts +43 -5
- package/src/execution/service.ts +9 -3
- package/src/execution/types.ts +21 -2
- package/src/execution/utils.ts +28 -1
- package/src/helpers/cache.ts +33 -0
- package/src/helpers/index.ts +1 -0
- package/src/helpers/spectate.ts +10 -0
- package/src/index.ts +1 -0
- package/src/model.ts +119 -16
- package/src/plugins/anthropic.ts +159 -20
- package/src/plugins/openai.ts +26 -1
- package/src/plugins/types.ts +42 -5
- package/src/prompt/index.ts +5 -0
- package/src/prompt/plugins.ts +69 -0
- package/src/prompt/render.ts +48 -0
- package/src/prompt/service.ts +194 -0
- package/src/prompt/types.ts +114 -0
- package/src/service.ts +3 -0
- package/src/types.ts +54 -3
- package/src/utils/prompt.ts +33 -0
- package/tests/execution.spec.ts +42 -0
- package/tests/plugins.spec.ts +279 -14
- package/tests/prompt.spec.ts +194 -0
- package/agent-meta/instructions/llm.instructions.md +0 -66
package/README.md
CHANGED
|
@@ -178,10 +178,9 @@ root `.env`. With none set they self-skip with a printed reason — never a fail
|
|
|
178
178
|
<!-- owlmeans:agent-guidance:start -->
|
|
179
179
|
## Agent guidance
|
|
180
180
|
|
|
181
|
-
This package ships embedded
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
(`.claude/skills/` and `.github/instructions/`):
|
|
181
|
+
This package ships embedded agent skills under `agent-meta/`. After installing your
|
|
182
|
+
`@owlmeans/*` packages, run the OwlMeans agent-skills installer to place them into
|
|
183
|
+
your project's skill store (`.agents/skills/`):
|
|
185
184
|
|
|
186
185
|
```sh
|
|
187
186
|
npx @owlmeans/agent-skills
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
2
|
+
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/llm",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"generatedAt": "2026-08-
|
|
4
|
+
"version": "0.1.16",
|
|
5
|
+
"generatedAt": "2026-08-14T10:14:48.851Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"name": "llm",
|
|
11
11
|
"category": "package-specific",
|
|
12
12
|
"file": "skills/llm/SKILL.md",
|
|
13
|
-
"canonicalPath": ".
|
|
13
|
+
"canonicalPath": ".agents/skills/llm/SKILL.md"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
"kind": "
|
|
17
|
-
"name": "llm",
|
|
18
|
-
"category": "package
|
|
19
|
-
"file": "
|
|
20
|
-
"canonicalPath": ".
|
|
16
|
+
"kind": "skill",
|
|
17
|
+
"name": "llm-prompt-caching",
|
|
18
|
+
"category": "multi-package",
|
|
19
|
+
"file": "skills/llm-prompt-caching/SKILL.md",
|
|
20
|
+
"canonicalPath": ".agents/skills/llm-prompt-caching/SKILL.md"
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
23
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: llm
|
|
3
|
-
description: How to use @owlmeans/llm — the LLM inference runtime (four-method model, provider plugins, model factory service, policy-driven execution abstraction). Auto-invoked when importing the model, an LlmPlugin, the LlmService, or the
|
|
3
|
+
description: How to use @owlmeans/llm — the LLM inference runtime (four-method model, provider plugins, model factory service, policy-driven execution abstraction, and the prompt/skill composition service). Auto-invoked when importing the model, an LlmPlugin, the LlmService, the execution service, or the prompt service.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
---
|
|
6
6
|
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/llm
|
|
9
9
|
|
|
10
10
|
**Layer:** Core
|
|
11
|
-
**Install:** `"@owlmeans/llm": "^0.1.
|
|
11
|
+
**Install:** `"@owlmeans/llm": "^0.1.16"` in `dependencies` (plus the `@langchain/*` peers)
|
|
12
12
|
|
|
13
13
|
The inference runtime. Everything provider-specific is a **plugin**; the model itself only
|
|
14
14
|
owns the provider-independent parts (streaming discipline, retries, validation,
|
|
@@ -22,12 +22,17 @@ observability). Serializable contracts live in `@owlmeans/llm-common`.
|
|
|
22
22
|
| `makeLlmService(options, alias?)` · `appendLlmService(ctx, options, alias?)` | Model factory/registry — resolves a `ModelConfig` by alias, memoized per alias+override. |
|
|
23
23
|
| `llmServiceApi(options, self)` | The factory half WITHOUT `createService`, to compose into your own service (role accessors, domain helpers). |
|
|
24
24
|
| `makeExecutionService(alias?, options?)` · `appendExecutionService(ctx, alias?, options?)` | Frozen 3-level executions + policy resolution + snapshot/restore/checkpoint. |
|
|
25
|
+
| `makePromptService(options?, alias?)` · `appendPromptService(ctx, options?, alias?)` · `promptServiceApi(options, self)` | Skill registry + the composition plugin chain. Also at `@owlmeans/llm/prompt`. |
|
|
26
|
+
| `rolePlugin`, `skillsPlugin`, `contextPlugin`, `BUILT_IN_PROMPT_PLUGINS` | The built-in composition plugins. |
|
|
27
|
+
| `renderSkill`, `sortSkills`, `joinChunks`, `compareAlias`, `prefixHash` | Deterministic rendering primitives — reuse them, never re-implement. |
|
|
28
|
+
| `readCacheUsage`, `hasCacheActivity` | Normalized prompt-cache accounting from a completion. |
|
|
25
29
|
| `executionServiceApi(options, self)` | The execution half without `createService`, for the same composition pattern. |
|
|
26
30
|
| `plugins`, `registerLlmPlugin`, `resolvePlugin`, `pluginOf`, `pluginFor` | The provider-plugin registry. Also at `@owlmeans/llm/plugins`. |
|
|
27
31
|
| `anthropicPlugin`, `openAiPlugin`, `compatiblePlugin`, `openAiFamily` | Built-in providers; `openAiFamily` is the shared OpenAI-client behaviour to spread into a new plugin. |
|
|
28
32
|
| `withRetry`, `registerFatalError`, `spectate`, `normalizeInput`, `parseJsonContent`, `coerceToSchema` | Helpers usable alongside a model. Also at `@owlmeans/llm/helpers`. |
|
|
29
33
|
| `LlmError`, `LlmModelError`, `LlmMissconfiguredError`, `LlmPluginError`, `LlmRetryExceededError` | `ResilientError` family. `LlmModelError` is the RETRYABLE one. |
|
|
30
|
-
| `
|
|
34
|
+
| `mergePrompt`, `mergePolicy`, `resolveRole`, `effortPatch` | Execution merge helpers; `mergePrompt` unions skills and takes the deepest role. |
|
|
35
|
+
| `DEFAULT_MODEL_RETRIES`, `MODEL_STREAM_TIMEOUT_MS` (3 min idle), `FALLBACK_AFTER_ATTEMPTS`, `DEFAULT_EFFORT`, `EFFORT_TABLE`, `MAX_CACHE_BREAKPOINTS`, `MAX_SYSTEM_BREAKPOINTS`, `MIN_CACHEABLE_TOKENS`, `LLM_SERVICE`, `EXECUTION_SERVICE`, `PROMPT_SERVICE` | Tuning + aliases. |
|
|
31
36
|
|
|
32
37
|
## helpers/ vs utils/ — the rule this package follows
|
|
33
38
|
|
|
@@ -50,7 +55,9 @@ Adding a function? Decide which side it belongs to first, then place it. Do not
|
|
|
50
55
|
| `refine` | the per-provider retry rebuild (budget doubling, reasoning shrink) |
|
|
51
56
|
| `structuredMode` | native `response_format` vs the forced-tool-call hack |
|
|
52
57
|
| `toolChoice` / `responseFormat` | the provider-specific call shapes |
|
|
53
|
-
| `
|
|
58
|
+
| `patchSystem` | how the composed system blocks are rendered and where their cache breakpoints go |
|
|
59
|
+
| `patchCache` | the message-prefix cache marker |
|
|
60
|
+
| `cacheKey` (via `ModelConfig.cacheKey`) | provider cache-routing hints such as OpenAI's `prompt_cache_key` |
|
|
54
61
|
| `isFatal` | "this error can never be retried" |
|
|
55
62
|
|
|
56
63
|
**Registration order is load-bearing.** Instance-based lookup (`pluginFor`) returns the
|
|
@@ -58,6 +65,19 @@ FIRST plugin whose `owns` matches. `compatible` is registered before `openai` be
|
|
|
58
65
|
build a `ChatOpenAI`, and assuming the tool-calling hack for an unlabelled model is safe
|
|
59
66
|
everywhere while assuming native JSON-schema support is not.
|
|
60
67
|
|
|
68
|
+
## System prompts: a role and skills, never a hand-built message
|
|
69
|
+
|
|
70
|
+
`makeLlmModel` takes `prompt` (a `PromptInput`) and a `prompts` resolver. The prompt service
|
|
71
|
+
composes them into an ordered, cacheable system message; a caller's own leading
|
|
72
|
+
`SystemMessage` is folded into the volatile `Context` block, so an unmigrated call site
|
|
73
|
+
still works. **Do not build a persona as a `SystemMessage` in a helper** — declare it as
|
|
74
|
+
`PromptPolicy.role` plus registered skills, or the knowledge duplicates and the cache
|
|
75
|
+
prefix stops being stable.
|
|
76
|
+
|
|
77
|
+
Skills accumulate down the execution chain (project → task → helper) and the deepest
|
|
78
|
+
declared `role` wins — see `mergePrompt`. Full rules, breakpoint budget and the provider
|
|
79
|
+
facts behind them: [[llm-prompt-caching]].
|
|
80
|
+
|
|
61
81
|
## Execution: policy in, model out
|
|
62
82
|
|
|
63
83
|
```
|
|
@@ -66,6 +86,9 @@ ProjectExecution ← root: policy + purpose + models resolver
|
|
|
66
86
|
└─ HelperExecution ← + a RESOLVED model + temperatureFactory, bound to a role
|
|
67
87
|
```
|
|
68
88
|
|
|
89
|
+
`prompt` (role + skills) travels on `ExecutionState`, so it survives snapshot/restore;
|
|
90
|
+
`prompts` and `files` are collaborators and never enter a snapshot.
|
|
91
|
+
|
|
69
92
|
Every method returns a NEW `Object.freeze`d object. Resolution precedence in
|
|
70
93
|
`model(exec, role, override)`: **roleOverride → modelOverride → effort tier →
|
|
71
94
|
`LlmService.getModel`**. `escalate(exec, { effort })` raises the tier once and cascades to
|
|
@@ -79,6 +102,19 @@ inherited method signatures**, which would be a contravariance error.
|
|
|
79
102
|
`snapshot` excludes `state` itself; without that, every `derive`/`escalate`/`withPurpose`
|
|
80
103
|
on a task would nest another copy of the previous state.
|
|
81
104
|
|
|
105
|
+
## Never `instanceof` an error from a provider SDK
|
|
106
|
+
|
|
107
|
+
`@langchain/anthropic` and `@langchain/openai` bundle their OWN nested copies of the
|
|
108
|
+
provider SDKs, so an error they throw is an instance of a DIFFERENT class than the one this
|
|
109
|
+
package imports — `e instanceof BadRequestError` silently returns `false`. `isFatal` used
|
|
110
|
+
that check, so every fatal `400` was classified retryable and burned all eight attempts,
|
|
111
|
+
turning one malformed request into minutes of thrash with the real message buried under the
|
|
112
|
+
retries.
|
|
113
|
+
|
|
114
|
+
Match on the wire shape instead — `(e as { status?: unknown })?.status === 400`. The same
|
|
115
|
+
trap applies to any cross-copy `instanceof`; it is the runtime face of the peer-dependency
|
|
116
|
+
identity rule below.
|
|
117
|
+
|
|
82
118
|
## Peer-dependency rule (langchain identity)
|
|
83
119
|
|
|
84
120
|
`@langchain/core`, `@langchain/openai` and `@langchain/anthropic` are **peer** dependencies:
|
|
@@ -99,6 +135,19 @@ const model = makeLlmModel(
|
|
|
99
135
|
const spec = await model.invoke('Describe the app', SpecSchema, { action: 'spec' })
|
|
100
136
|
```
|
|
101
137
|
|
|
138
|
+
## Hangs are bounded by an IDLE deadline, not a total one
|
|
139
|
+
|
|
140
|
+
A stalled provider is aborted after `MODEL_STREAM_TIMEOUT_MS` (3 min) of SILENCE and
|
|
141
|
+
surfaces as a retryable `LlmModelError`, so the escalator moves on. The timer re-arms on
|
|
142
|
+
every token, so a long-but-productive generation is never cut off — which is why the value
|
|
143
|
+
can be low. Set it for a whole deployment with `LlmServiceOptions.streamTimeout` where the
|
|
144
|
+
application composes its context; a preset that names its own `ModelConfig.streamTimeout`
|
|
145
|
+
keeps it.
|
|
146
|
+
|
|
147
|
+
Note what this does NOT bound: a call that keeps streaming forever, and retries. A fatal
|
|
148
|
+
error misclassified as retryable multiplies its own latency by `DEFAULT_MODEL_RETRIES` —
|
|
149
|
+
see the `instanceof` trap above.
|
|
150
|
+
|
|
102
151
|
## Resilience already handled — do not reimplement
|
|
103
152
|
|
|
104
153
|
Idle stream deadline · duplicate-final-chunk dedup · output-budget escalation · reasoning-cap
|
|
@@ -118,4 +167,5 @@ on `OPENROUTER_SECRET` / `ANTHROPIC_SECRET` in the repo-root `.env` and self-ski
|
|
|
118
167
|
## Related
|
|
119
168
|
|
|
120
169
|
- [[llm-common]] — the serializable contracts
|
|
170
|
+
- [[llm-prompt-caching]] — prompt composition, block order and the cache invariants
|
|
121
171
|
- [[context]] — service registration · [[error]] — the `ResilientError` family
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: llm-prompt-caching
|
|
3
|
+
description: How the OwlMeans LLM layer composes a system prompt from a role and skills, and the prompt-cache rules that layout exists to satisfy — block order, breakpoint budget, determinism invariants, and the provider facts behind them. Auto-invoked when touching prompt composition, skills, LlmPromptPlugin, patchSystem/patchCache, or anything that changes what a request sends before its first per-call byte.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# Prompt composition and caching
|
|
9
|
+
|
|
10
|
+
**Layer:** Core · **Packages:** `@owlmeans/llm` (`./prompt`), `@owlmeans/llm-common`, `@owlmeans/agent-skills` (`./llm`)
|
|
11
|
+
|
|
12
|
+
A prompt cache is an **exact prefix match**. Everything in this document follows from that
|
|
13
|
+
one fact: the bytes every call shares must come first, physically, and must be identical
|
|
14
|
+
down to the whitespace. The block layout, the ordering rules and the determinism
|
|
15
|
+
invariants are not style — they are the cache.
|
|
16
|
+
|
|
17
|
+
## The block layout
|
|
18
|
+
|
|
19
|
+
`PromptService.compose()` renders four ordered blocks (`PromptBlock`, `PROMPT_BLOCK_ORDER`)
|
|
20
|
+
into a single system message:
|
|
21
|
+
|
|
22
|
+
| # | Block | Contributed by | Changes | Breakpoint |
|
|
23
|
+
|---|-------|----------------|---------|-----------|
|
|
24
|
+
| 0 | `Role` | `rolePlugin` ← `PromptPolicy.role` | per role | — |
|
|
25
|
+
| 1 | `Skills` | `skillsPlugin` ← registry + `inline` | per helper | ✅ closes role+skills |
|
|
26
|
+
| 2 | `Packages` | app plugins (e.g. `owlmeansPackagesPlugin`) | per request | ✅ its own |
|
|
27
|
+
| 3 | `Context` | `contextPlugin` ← `context`, `callSkills` | per call | **never** (unless sole block) |
|
|
28
|
+
|
|
29
|
+
A caller's own leading `SystemMessage` is detached by `makeLlmModel` and re-emitted as
|
|
30
|
+
`Context`, so a helper that has not adopted `prompt: { role, skills }` keeps working —
|
|
31
|
+
its text simply travels a different route.
|
|
32
|
+
|
|
33
|
+
## Rules
|
|
34
|
+
|
|
35
|
+
- **Order is the cache key.** `PROMPT_BLOCK_ORDER` is declared explicitly, skills sort by
|
|
36
|
+
`(order, alias)` with a code-unit comparison (`compareAlias`, never `localeCompare` —
|
|
37
|
+
ICU data differs between hosts), and detected packages sort alphabetically.
|
|
38
|
+
- **Skill bodies are pure constants.** No timestamps, no absolute paths, no interpolated
|
|
39
|
+
request data. One varying byte invalidates the prefix for every call that shares it.
|
|
40
|
+
- **A volatile block is never marked.** The trailing `Context` block changes every
|
|
41
|
+
call: a breakpoint there would pay a cache WRITE on every request and never read
|
|
42
|
+
one back. It is marked ONLY when it is the entire prompt (a caller that has not
|
|
43
|
+
adopted role/skills), because there it IS the stable part. Its parts are merged
|
|
44
|
+
into one chunk for the same reason — nothing downstream needs them separable.
|
|
45
|
+
- **Volatile content goes last.** Per-call skills belong in `LlmCallOptions.skills`
|
|
46
|
+
(→ `Context`), not in the execution's `skills` (→ the cached `Skills` block).
|
|
47
|
+
- **Budget: 4 breakpoints per request, total** — across tools, system AND messages.
|
|
48
|
+
Anthropic rejects the fifth outright (`400 A maximum of 4 blocks with cache_control may
|
|
49
|
+
be provided. Found 5.`), and a 400 is fatal, so the whole call fails. The system prompt
|
|
50
|
+
may spend at most `MAX_SYSTEM_BREAKPOINTS` (2) — its only STABLE boundaries are the end
|
|
51
|
+
of role+skills and the end of packages — which always leaves two for the messages.
|
|
52
|
+
- **The last message is never cached.** `patchCache` stops one short of the end: the final
|
|
53
|
+
message is the per-call payload, and `ensureJsonMention` / `applyNoThink` append to it.
|
|
54
|
+
- **Markers are placed in-place, on the caller's objects.** A caller that carries its
|
|
55
|
+
message array across calls (a coder's growing conversation, a fix loop) hands them back
|
|
56
|
+
still marked, and they accumulate. `prepare()` therefore calls `stripCacheMarkers()`
|
|
57
|
+
first, so the per-request count depends on THIS call alone. Anything that places a
|
|
58
|
+
marker outside that pipeline must do the same.
|
|
59
|
+
- **A short prefix is not marked.** Below `MIN_CACHEABLE_TOKENS` (override per alias with
|
|
60
|
+
`ModelConfig.cacheMinTokens`) a marker buys nothing and costs a breakpoint.
|
|
61
|
+
|
|
62
|
+
## Verifying it works
|
|
63
|
+
> **The smoke test cannot catch a caching bug.** It makes no model calls. A breakpoint-budget
|
|
64
|
+
> or marker-accumulation fault only appears under a real multi-call agent run — and it
|
|
65
|
+
> surfaces as a `400`, which the retry loop can bury for minutes. Check the agent's own pod
|
|
66
|
+
> logs for `Prompt cache [` lines and a non-zero `read`.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
`usage_metadata.input_token_details` is the only honest answer. `readCacheUsage(message)`
|
|
70
|
+
(`@owlmeans/llm/helpers`) normalizes it; `spectate` logs a line whenever a provider reports
|
|
71
|
+
any cache activity. **If `read` stays 0 across repeated calls that share a prefix, something
|
|
72
|
+
is invalidating it** — diff `PromptResult.blocks` between two calls to find what.
|
|
73
|
+
|
|
74
|
+
## Adding a plugin
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
ctx.prompts().use({
|
|
78
|
+
alias: 'my-plugin',
|
|
79
|
+
order: 50, // built-ins hold 0 (role), 10 (skills), 90 (context)
|
|
80
|
+
compose: ctx => ctx.add(PromptBlock.Skills, text), // static, runs first
|
|
81
|
+
inspect: ctx => { /* reads ctx.messages */ }, // after every compose pass
|
|
82
|
+
})
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
A plugin MUST be deterministic. Anything it contributes to a cached block and cannot
|
|
86
|
+
reproduce byte-for-byte breaks the prefix for everyone sharing it. Register by alias —
|
|
87
|
+
re-registering the same alias replaces rather than appends, so double-wiring cannot
|
|
88
|
+
double-emit.
|
|
89
|
+
|
|
90
|
+
## Package skills in a prompt (`@owlmeans/agent-skills/llm`)
|
|
91
|
+
|
|
92
|
+
`owlmeansPackagesPlugin(options)` notices which `@owlmeans/*` packages a request mentions
|
|
93
|
+
and loads their published skills into the `Packages` block. Everything a package documents
|
|
94
|
+
is loaded — there is no relevance filtering, by design.
|
|
95
|
+
|
|
96
|
+
Resolution order per package: the host's `LlmFileProvider` (the only path that sees a
|
|
97
|
+
sandbox or remote workspace) → an installed copy under `node_modules` → the canonical
|
|
98
|
+
repository over HTTPS. Every failure is a miss, never a throw. Results, including misses,
|
|
99
|
+
are cached per plugin instance.
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
ctx.prompts().use(owlmeansPackagesPlugin({
|
|
103
|
+
files: () => ctx.files(), // tried first
|
|
104
|
+
exclude: ['@owlmeans/llm'], // already covered by the static Skills block
|
|
105
|
+
fetch: false, // air-gapped: skip the repository fallback
|
|
106
|
+
}))
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The manifest deliberately carries no git ref — version-matching comes from shipping the
|
|
110
|
+
copy inside the tarball, so for a package that is NOT installed the ref is a plugin option
|
|
111
|
+
(`ref`, default `main`).
|
|
112
|
+
|
|
113
|
+
## Provider facts these rules encode
|
|
114
|
+
|
|
115
|
+
**Anthropic** ([prompt-caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching.md)) —
|
|
116
|
+
render order is `tools` → `system` → `messages`; **max 4** `cache_control` breakpoints per
|
|
117
|
+
request; the minimum cacheable prefix is model-dependent and **not monotonic** across
|
|
118
|
+
generations (512 tokens on the newest models, 1024 on most, 4096 on Opus 4.6/4.5 and
|
|
119
|
+
Haiku 4.5); a write costs ~1.25× at the 5-minute TTL and ~2× at `ttl: '1h'`, so the long
|
|
120
|
+
TTL only pays from the third read; changing `system` invalidates system + messages but not
|
|
121
|
+
`tools`; each breakpoint looks back at most 20 content blocks.
|
|
122
|
+
|
|
123
|
+
**OpenAI** ([prompt-caching](https://developers.openai.com/api/docs/guides/prompt-caching)) —
|
|
124
|
+
caching is automatic from 1024 tokens in 128-token increments, with no markers to place.
|
|
125
|
+
Requests are routed by a hash of roughly the first 256 tokens, and `prompt_cache_key` is
|
|
126
|
+
mixed into that hash, so requests sharing a key land on the same backend and can actually
|
|
127
|
+
hit each other's entries. The `openai` plugin sets it from the config alias (one value per
|
|
128
|
+
role); the `compatible` plugin deliberately does not, because aggregators running with
|
|
129
|
+
`provider.require_parameters` can drop every serving provider over an unknown field.
|
|
130
|
+
|
|
131
|
+
## Related
|
|
132
|
+
|
|
133
|
+
- [[llm]] — the runtime and the provider-plugin seam
|
|
134
|
+
- [[llm-common]] — `SkillDefinition`, `PromptPolicy`, `PromptBlock`, `LlmFileProvider`
|
|
135
|
+
- [[agent-skills]] — `@owlmeans/agent-skills/llm`, the package-skills plugin
|
package/build/consts.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ExecutionEffort } from '@owlmeans/llm-common';
|
|
2
|
-
import type { ModelConfigPatch } from '@owlmeans/llm-common';
|
|
2
|
+
import type { CacheTtl, ModelConfigPatch } from '@owlmeans/llm-common';
|
|
3
3
|
/** Context-service alias for the {@link LlmService} (model factory / registry). */
|
|
4
4
|
export declare const LLM_SERVICE = "owlmeans-llm-service";
|
|
5
5
|
/** Context-service alias for the {@link ExecutionService}. */
|
|
6
6
|
export declare const EXECUTION_SERVICE = "owlmeans-llm-execution-service";
|
|
7
|
+
/** Context-service alias for the {@link PromptService} (skill registry + composition). */
|
|
8
|
+
export declare const PROMPT_SERVICE = "owlmeans-llm-prompt-service";
|
|
7
9
|
/** Default number of attempts a single model call makes before giving up. */
|
|
8
10
|
export declare const DEFAULT_MODEL_RETRIES = 8;
|
|
9
11
|
/**
|
|
@@ -13,7 +15,13 @@ export declare const DEFAULT_MODEL_RETRIES = 8;
|
|
|
13
15
|
* against a provider that accepts the request and then never streams anything (observed
|
|
14
16
|
* with throughput-sorted OpenRouter routing), which would otherwise block forever —
|
|
15
17
|
* `maxRetries` never helps there because the request never errors, it just hangs.
|
|
16
|
-
* Overridable per model via `ModelConfig.streamTimeout
|
|
18
|
+
* Overridable per model via `ModelConfig.streamTimeout`, or for every model at once via
|
|
19
|
+
* `LlmServiceOptions.streamTimeout` where the application composes its context.
|
|
20
|
+
*
|
|
21
|
+
* Three minutes, not longer: the timer resets on every token, so a legitimately long
|
|
22
|
+
* generation is never at risk — this only bounds SILENCE. The cost of a high value is
|
|
23
|
+
* paid entirely by hung calls, and a hang that takes five minutes to notice is a hang
|
|
24
|
+
* that can stall an agent run for half an hour once retries multiply it.
|
|
17
25
|
*/
|
|
18
26
|
export declare const MODEL_STREAM_TIMEOUT_MS: number;
|
|
19
27
|
/**
|
|
@@ -30,8 +38,33 @@ export declare const FALLBACK_AFTER_ATTEMPTS = 3;
|
|
|
30
38
|
* issue a 400 "max_tokens exceeds the model's per-request limit".
|
|
31
39
|
*/
|
|
32
40
|
export declare const DEFAULT_MAX_OUTPUT_CAP: number;
|
|
33
|
-
/** Provider hard limit on prompt-cache breakpoints (Anthropic). */
|
|
41
|
+
/** Provider hard limit on prompt-cache breakpoints per REQUEST (Anthropic). */
|
|
34
42
|
export declare const MAX_CACHE_BREAKPOINTS = 4;
|
|
43
|
+
/**
|
|
44
|
+
* Share of {@link MAX_CACHE_BREAKPOINTS} the composed system prompt may spend.
|
|
45
|
+
*
|
|
46
|
+
* Two is all it can use: the only STABLE boundaries are the end of role+skills and the end
|
|
47
|
+
* of the packages block. The trailing context block is volatile and deliberately never
|
|
48
|
+
* marked, so the remaining two breakpoints always stay available to the message prefix.
|
|
49
|
+
*/
|
|
50
|
+
export declare const MAX_SYSTEM_BREAKPOINTS = 2;
|
|
51
|
+
/** Cache lifetime used when neither the call nor the service asks for another. */
|
|
52
|
+
export declare const DEFAULT_CACHE_TTL: CacheTtl;
|
|
53
|
+
/**
|
|
54
|
+
* Smallest prefix worth marking as cacheable, in tokens. Providers silently refuse to
|
|
55
|
+
* create an entry below their own threshold (1024 tokens on most Claude models, 512 on
|
|
56
|
+
* the newest, 4096 on a few older ones — it is NOT monotonic across generations), so a
|
|
57
|
+
* marker on a short prefix costs nothing but wastes a breakpoint and produces a
|
|
58
|
+
* "caching enabled" log for an entry that was never written. Override per model with
|
|
59
|
+
* `ModelConfig.cacheMinTokens`.
|
|
60
|
+
*/
|
|
61
|
+
export declare const MIN_CACHEABLE_TOKENS = 1024;
|
|
62
|
+
/**
|
|
63
|
+
* Characters per token used to size a prefix against {@link MIN_CACHEABLE_TOKENS}. A rough
|
|
64
|
+
* average for English prose and TypeScript; only ever used to decide whether marking is
|
|
65
|
+
* worth a breakpoint, never for billing or budgeting.
|
|
66
|
+
*/
|
|
67
|
+
export declare const CHARS_PER_TOKEN = 4;
|
|
35
68
|
/**
|
|
36
69
|
* Appended to the prompt of `invoke`/`request` when no message already mentions JSON.
|
|
37
70
|
* Some providers refuse or ignore JSON modes unless the word appears in the prompt;
|
package/build/consts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEtE,mFAAmF;AACnF,eAAO,MAAM,WAAW,yBAAyB,CAAA;AAEjD,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,mCAAmC,CAAA;AAEjE,0FAA0F;AAC1F,eAAO,MAAM,cAAc,gCAAgC,CAAA;AAE3D,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,IAAI,CAAA;AAEtC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,uBAAuB,QAAgB,CAAA;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAA;AAExC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,QAAY,CAAA;AAE/C,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,IAAI,CAAA;AAEtC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,EAAE,QAAe,CAAA;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,OAAO,CAAA;AAExC;;;;GAIG;AACH,eAAO,MAAM,eAAe,IAAI,CAAA;AAEhC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,QAGkD,CAAA;AAE/E;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,cAAc,CAAA;AAE7C,uFAAuF;AACvF,eAAO,MAAM,iBAAiB,YAAY,CAAA;AAE1C,8DAA8D;AAC9D,eAAO,MAAM,cAAc,2BAA2B,CAAA;AAEtD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAKlE,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,EAErC,CAAA"}
|
package/build/consts.js
CHANGED
|
@@ -3,6 +3,8 @@ import { ExecutionEffort } from '@owlmeans/llm-common';
|
|
|
3
3
|
export const LLM_SERVICE = 'owlmeans-llm-service';
|
|
4
4
|
/** Context-service alias for the {@link ExecutionService}. */
|
|
5
5
|
export const EXECUTION_SERVICE = 'owlmeans-llm-execution-service';
|
|
6
|
+
/** Context-service alias for the {@link PromptService} (skill registry + composition). */
|
|
7
|
+
export const PROMPT_SERVICE = 'owlmeans-llm-prompt-service';
|
|
6
8
|
/** Default number of attempts a single model call makes before giving up. */
|
|
7
9
|
export const DEFAULT_MODEL_RETRIES = 8;
|
|
8
10
|
/**
|
|
@@ -12,9 +14,15 @@ export const DEFAULT_MODEL_RETRIES = 8;
|
|
|
12
14
|
* against a provider that accepts the request and then never streams anything (observed
|
|
13
15
|
* with throughput-sorted OpenRouter routing), which would otherwise block forever —
|
|
14
16
|
* `maxRetries` never helps there because the request never errors, it just hangs.
|
|
15
|
-
* Overridable per model via `ModelConfig.streamTimeout
|
|
17
|
+
* Overridable per model via `ModelConfig.streamTimeout`, or for every model at once via
|
|
18
|
+
* `LlmServiceOptions.streamTimeout` where the application composes its context.
|
|
19
|
+
*
|
|
20
|
+
* Three minutes, not longer: the timer resets on every token, so a legitimately long
|
|
21
|
+
* generation is never at risk — this only bounds SILENCE. The cost of a high value is
|
|
22
|
+
* paid entirely by hung calls, and a hang that takes five minutes to notice is a hang
|
|
23
|
+
* that can stall an agent run for half an hour once retries multiply it.
|
|
16
24
|
*/
|
|
17
|
-
export const MODEL_STREAM_TIMEOUT_MS =
|
|
25
|
+
export const MODEL_STREAM_TIMEOUT_MS = 3 * 60 * 1000;
|
|
18
26
|
/**
|
|
19
27
|
* Number of failed attempts after which the retry escalator switches from a role's
|
|
20
28
|
* cheap primary model to its configured `fallback` (stronger) model. With
|
|
@@ -29,8 +37,33 @@ export const FALLBACK_AFTER_ATTEMPTS = 3;
|
|
|
29
37
|
* issue a 400 "max_tokens exceeds the model's per-request limit".
|
|
30
38
|
*/
|
|
31
39
|
export const DEFAULT_MAX_OUTPUT_CAP = 3 * 64000;
|
|
32
|
-
/** Provider hard limit on prompt-cache breakpoints (Anthropic). */
|
|
40
|
+
/** Provider hard limit on prompt-cache breakpoints per REQUEST (Anthropic). */
|
|
33
41
|
export const MAX_CACHE_BREAKPOINTS = 4;
|
|
42
|
+
/**
|
|
43
|
+
* Share of {@link MAX_CACHE_BREAKPOINTS} the composed system prompt may spend.
|
|
44
|
+
*
|
|
45
|
+
* Two is all it can use: the only STABLE boundaries are the end of role+skills and the end
|
|
46
|
+
* of the packages block. The trailing context block is volatile and deliberately never
|
|
47
|
+
* marked, so the remaining two breakpoints always stay available to the message prefix.
|
|
48
|
+
*/
|
|
49
|
+
export const MAX_SYSTEM_BREAKPOINTS = 2;
|
|
50
|
+
/** Cache lifetime used when neither the call nor the service asks for another. */
|
|
51
|
+
export const DEFAULT_CACHE_TTL = '5m';
|
|
52
|
+
/**
|
|
53
|
+
* Smallest prefix worth marking as cacheable, in tokens. Providers silently refuse to
|
|
54
|
+
* create an entry below their own threshold (1024 tokens on most Claude models, 512 on
|
|
55
|
+
* the newest, 4096 on a few older ones — it is NOT monotonic across generations), so a
|
|
56
|
+
* marker on a short prefix costs nothing but wastes a breakpoint and produces a
|
|
57
|
+
* "caching enabled" log for an entry that was never written. Override per model with
|
|
58
|
+
* `ModelConfig.cacheMinTokens`.
|
|
59
|
+
*/
|
|
60
|
+
export const MIN_CACHEABLE_TOKENS = 1024;
|
|
61
|
+
/**
|
|
62
|
+
* Characters per token used to size a prefix against {@link MIN_CACHEABLE_TOKENS}. A rough
|
|
63
|
+
* average for English prose and TypeScript; only ever used to decide whether marking is
|
|
64
|
+
* worth a breakpoint, never for billing or budgeting.
|
|
65
|
+
*/
|
|
66
|
+
export const CHARS_PER_TOKEN = 4;
|
|
34
67
|
/**
|
|
35
68
|
* Appended to the prompt of `invoke`/`request` when no message already mentions JSON.
|
|
36
69
|
* Some providers refuse or ignore JSON modes unless the word appears in the prompt;
|
|
@@ -71,6 +104,6 @@ export const EFFORT_TABLE = {
|
|
|
71
104
|
* without excluding it every `derive`/`escalate`/`withPurpose` would nest another copy.
|
|
72
105
|
*/
|
|
73
106
|
export const COLLABORATOR_KEYS = [
|
|
74
|
-
'state', 'models', 'model', 'temperatureFactory', 'outputErrors',
|
|
107
|
+
'state', 'models', 'model', 'temperatureFactory', 'outputErrors', 'files', 'prompts',
|
|
75
108
|
];
|
|
76
109
|
//# 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":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAGtD,mFAAmF;AACnF,MAAM,CAAC,MAAM,WAAW,GAAG,sBAAsB,CAAA;AAEjD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,gCAAgC,CAAA;AAEjE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAA;AAEtC
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAGtD,mFAAmF;AACnF,MAAM,CAAC,MAAM,WAAW,GAAG,sBAAsB,CAAA;AAEjD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,gCAAgC,CAAA;AAEjE,0FAA0F;AAC1F,MAAM,CAAC,MAAM,cAAc,GAAG,6BA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YAAY,EAAE,KAAK,EAAE;IACjE,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE;CACjE,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAa;IACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,OAAO,EAAE,SAAS;CACrF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/execution/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKlE,OAAO,KAAK,EACkB,gBAAgB,EAAE,uBAAuB,EAAE,cAAc,EACrD,oBAAoB,EACrD,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/execution/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKlE,OAAO,KAAK,EACkB,gBAAgB,EAAE,uBAAuB,EAAE,cAAc,EACrD,oBAAoB,EACrD,MAAM,YAAY,CAAA;AAMnB;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,EAC3E,SAAS,uBAAuB,EAChC,MAAM,MAAM,gBAAgB,CAAC,CAAC,CAAC,KAC9B,gBAAgB,CAAC,CAAC,CAkIpB,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,EAC5E,QAAO,MAA0B,EACjC,UAAS,uBAA4B,KACpC,gBAAgB,CAAC,CAAC,CAMpB,CAAA;AAED,eAAO,MAAM,sBAAsB,GACjC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,cAAc,GAAG,cAAc,EAE3F,KAAK,CAAC,EACN,QAAO,MAA0B,EACjC,UAAS,uBAA4B,KACpC,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAQ5B,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createService } from '@owlmeans/context';
|
|
2
2
|
import { ExecutionLevel } from '@owlmeans/llm-common';
|
|
3
3
|
import { COLLABORATOR_KEYS, EXECUTION_SERVICE } from '../consts.js';
|
|
4
|
-
import { composeExecState, composeTaskState, effortPatch, freeze, mergeOverride, mergePolicy, resolveRole, } from './utils.js';
|
|
4
|
+
import { composeExecState, composeTaskState, effortPatch, freeze, mergeOverride, mergePolicy, mergePrompt, resolveRole, } from './utils.js';
|
|
5
5
|
/**
|
|
6
6
|
* Build the execution service implementation WITHOUT registering it as a context
|
|
7
7
|
* service, so a consumer can publish extra methods alongside it (observability
|
|
@@ -34,16 +34,19 @@ export const executionServiceApi = (options, self) => {
|
|
|
34
34
|
level: ExecutionLevel.Project,
|
|
35
35
|
purpose: { ...input.purpose },
|
|
36
36
|
policy: { ...input.policy },
|
|
37
|
+
...(input.prompt != null ? { prompt: { ...input.prompt } } : {}),
|
|
37
38
|
}),
|
|
38
39
|
forTask: (parent, input) => {
|
|
39
|
-
const { effort, phase, data, ...extras } = input;
|
|
40
|
+
const { effort, phase, data, prompt, ...extras } = input;
|
|
40
41
|
const policy = effort != null
|
|
41
42
|
? mergePolicy(parent.policy, { effort })
|
|
42
43
|
: { ...parent.policy };
|
|
44
|
+
const merged = mergePrompt(parent.prompt, prompt);
|
|
43
45
|
// Spreading the parent carries every collaborator and domain field forward; the
|
|
44
46
|
// task's own state is composed afterwards, from the seeded resumable fields.
|
|
45
47
|
const taskExec = {
|
|
46
48
|
...parent, ...extras, level: ExecutionLevel.Task, purpose: { ...parent.purpose }, policy,
|
|
49
|
+
...(merged != null ? { prompt: merged } : {}),
|
|
47
50
|
};
|
|
48
51
|
taskExec.state = composeTaskState({
|
|
49
52
|
...taskExec,
|
|
@@ -58,9 +61,10 @@ export const executionServiceApi = (options, self) => {
|
|
|
58
61
|
return freeze(taskExec);
|
|
59
62
|
},
|
|
60
63
|
forHelper: (parent, input) => {
|
|
61
|
-
const { role, effort, dedication, ...extras } = input;
|
|
64
|
+
const { role, effort, dedication, prompt, ...extras } = input;
|
|
62
65
|
const localPolicy = effort != null ? mergePolicy(parent.policy, { effort }) : parent.policy;
|
|
63
66
|
const scoped = { ...parent, policy: localPolicy };
|
|
67
|
+
const merged = mergePrompt(parent.prompt, prompt);
|
|
64
68
|
const helperExec = {
|
|
65
69
|
...parent,
|
|
66
70
|
...extras,
|
|
@@ -69,6 +73,7 @@ export const executionServiceApi = (options, self) => {
|
|
|
69
73
|
? { ...parent.purpose, dedication }
|
|
70
74
|
: { ...parent.purpose },
|
|
71
75
|
policy: localPolicy,
|
|
76
|
+
...(merged != null ? { prompt: merged } : {}),
|
|
72
77
|
role: resolveRole(localPolicy, role),
|
|
73
78
|
model: self().model(scoped, role),
|
|
74
79
|
temperatureFactory: self().temperatureFactory(scoped, role),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/execution/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAMnE,OAAO,EACL,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/execution/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,OA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iBAAiB,EACjC,UAAmC,EAAE,EAChB,EAAE;IACvB,MAAM,OAAO,GAAwB,aAAa,CAChD,KAAK,EAAE,mBAAmB,CAAI,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAwB,CAC7E,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAGpC,GAAM,EACN,QAAgB,iBAAiB,EACjC,UAAmC,EAAE,EACR,EAAE;IAC/B,MAAM,OAAO,GAAG,GAAkC,CAAA;IAElD,OAAO,CAAC,eAAe,CAAC,oBAAoB,CAAI,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;IAEhE,OAAO,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAsB,KAAK,CAAC,CAAA;IAEtE,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
2
|
import type { InitializedService } from '@owlmeans/context';
|
|
3
|
-
import type { ExecutionEffort, ExecutionLevel, ExecutionState, LlmPurpose, ModelConfigOverride, ModelPolicy, ModelRole, TaskExecutionState } from '@owlmeans/llm-common';
|
|
3
|
+
import type { ExecutionEffort, ExecutionLevel, ExecutionState, FileProviderRef, LlmPurpose, ModelConfigOverride, ModelPolicy, ModelRole, PromptPolicy, TaskExecutionState } from '@owlmeans/llm-common';
|
|
4
4
|
import type { LlmService, TemperatureFactory } from '../types.js';
|
|
5
|
+
import type { PromptService } from '../prompt/types.js';
|
|
5
6
|
/**
|
|
6
7
|
* Runtime execution = serializable {@link ExecutionState} + attached collaborators.
|
|
7
8
|
* A frozen data object with NO behavior of its own — all logic (construct, refine,
|
|
@@ -14,6 +15,10 @@ import type { LlmService, TemperatureFactory } from '../types.js';
|
|
|
14
15
|
export interface Execution extends ExecutionState {
|
|
15
16
|
/** Resolver for the model factory — a function so the service can be swapped/cloned. */
|
|
16
17
|
models: () => LlmService;
|
|
18
|
+
/** Resolver for the skill registry / prompt composer. Same late-binding rationale. */
|
|
19
|
+
prompts?: () => PromptService;
|
|
20
|
+
/** File access offered to prompt plugins. Declared a collaborator, never snapshotted. */
|
|
21
|
+
files?: FileProviderRef;
|
|
17
22
|
outputErrors?: boolean;
|
|
18
23
|
captureNull?: boolean;
|
|
19
24
|
}
|
|
@@ -34,28 +39,42 @@ export interface HelperExecution extends Execution {
|
|
|
34
39
|
}
|
|
35
40
|
export interface ProjectExecutionInput {
|
|
36
41
|
models: () => LlmService;
|
|
42
|
+
prompts?: () => PromptService;
|
|
43
|
+
files?: FileProviderRef;
|
|
37
44
|
policy: ModelPolicy;
|
|
38
45
|
purpose: LlmPurpose;
|
|
46
|
+
/** Baseline role and skills for the whole run. */
|
|
47
|
+
prompt?: PromptPolicy;
|
|
39
48
|
outputErrors?: boolean;
|
|
40
49
|
captureNull?: boolean;
|
|
41
50
|
}
|
|
42
51
|
export interface TaskExecutionInput {
|
|
43
52
|
/** Raise (or lower) the effort tier for this task and everything derived from it. */
|
|
44
53
|
effort?: ExecutionEffort;
|
|
54
|
+
/** Skills (and optionally a role) layered on top of the project's. Skills accumulate. */
|
|
55
|
+
prompt?: PromptPolicy;
|
|
45
56
|
/** Optional seeds for the resumable task state. */
|
|
46
57
|
phase?: string;
|
|
47
58
|
data?: Record<string, unknown>;
|
|
48
59
|
}
|
|
49
60
|
export interface HelperExecutionInput {
|
|
61
|
+
/**
|
|
62
|
+
* Which MODEL to use. Distinct from `prompt.role`, which is the system-prompt text
|
|
63
|
+
* defining the persona — one selects hardware, the other writes the job description.
|
|
64
|
+
*/
|
|
50
65
|
role: ModelRole;
|
|
51
66
|
/** Local effort bump without escalating the whole branch. */
|
|
52
67
|
effort?: ExecutionEffort;
|
|
68
|
+
/** The helper's persona and its own skills, layered on top of the task's. */
|
|
69
|
+
prompt?: PromptPolicy;
|
|
53
70
|
/** Refines `purpose.dedication`. */
|
|
54
71
|
dedication?: string;
|
|
55
72
|
}
|
|
56
73
|
/** Collaborators re-attached to a state that was restored from storage. */
|
|
57
74
|
export interface RestoreCollaborators {
|
|
58
75
|
models?: () => LlmService;
|
|
76
|
+
prompts?: () => PromptService;
|
|
77
|
+
files?: FileProviderRef;
|
|
59
78
|
}
|
|
60
79
|
/**
|
|
61
80
|
* Resilience extension seam. A plugin observes flow boundaries (via
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/execution/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAA;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EACV,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/execution/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAA;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EACV,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAC5E,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,EAC9E,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAU,SAAQ,cAAc;IAC/C,wFAAwF;IACxF,MAAM,EAAE,MAAM,UAAU,CAAA;IACxB,sFAAsF;IACtF,OAAO,CAAC,EAAE,MAAM,aAAa,CAAA;IAC7B,yFAAyF;IACzF,KAAK,CAAC,EAAE,eAAe,CA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