@owlmeans/llm 0.1.18-rc.13 → 0.1.18-rc.15
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 +1 -1
- package/agent-meta/manifest.json +9 -2
- package/agent-meta/skills/inquiry/SKILL.md +199 -0
- package/agent-meta/skills/llm/SKILL.md +39 -11
- package/build/consts.d.ts +4 -0
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +4 -0
- package/build/consts.js.map +1 -1
- package/build/execution/service.d.ts.map +1 -1
- package/build/execution/service.js +25 -10
- package/build/execution/service.js.map +1 -1
- package/build/execution/types.d.ts +40 -13
- package/build/execution/types.d.ts.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/inquiry/bridge.d.ts +22 -0
- package/build/inquiry/bridge.d.ts.map +1 -0
- package/build/inquiry/bridge.js +29 -0
- package/build/inquiry/bridge.js.map +1 -0
- package/build/inquiry/errors.d.ts +29 -0
- package/build/inquiry/errors.d.ts.map +1 -0
- package/build/inquiry/errors.js +40 -0
- package/build/inquiry/errors.js.map +1 -0
- package/build/inquiry/index.d.ts +4 -0
- package/build/inquiry/index.d.ts.map +1 -0
- package/build/inquiry/index.js +4 -0
- package/build/inquiry/index.js.map +1 -0
- package/build/inquiry/transport.d.ts +12 -0
- package/build/inquiry/transport.d.ts.map +1 -0
- package/build/inquiry/transport.js +35 -0
- package/build/inquiry/transport.js.map +1 -0
- package/build/types.d.ts +8 -0
- package/build/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/consts.ts +4 -0
- package/src/execution/service.ts +26 -11
- package/src/execution/types.ts +44 -15
- package/src/index.ts +1 -0
- package/src/inquiry/bridge.ts +33 -0
- package/src/inquiry/errors.ts +46 -0
- package/src/inquiry/index.ts +3 -0
- package/src/inquiry/transport.ts +42 -0
- package/src/types.ts +8 -0
- package/tests/execution.spec.ts +16 -21
- package/tests/inquiry.spec.ts +200 -0
package/README.md
CHANGED
|
@@ -184,7 +184,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
184
184
|
your project's skill store (`.agents/skills/`):
|
|
185
185
|
|
|
186
186
|
```sh
|
|
187
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
187
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.14
|
|
188
188
|
```
|
|
189
189
|
|
|
190
190
|
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",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.15",
|
|
5
|
+
"generatedAt": "2026-09-10T23:10:57.037Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
"file": "skills/llm/SKILL.md",
|
|
13
13
|
"canonicalPath": ".agents/skills/llm/SKILL.md"
|
|
14
14
|
},
|
|
15
|
+
{
|
|
16
|
+
"kind": "skill",
|
|
17
|
+
"name": "inquiry",
|
|
18
|
+
"category": "multi-package",
|
|
19
|
+
"file": "skills/inquiry/SKILL.md",
|
|
20
|
+
"canonicalPath": ".agents/skills/inquiry/SKILL.md"
|
|
21
|
+
},
|
|
15
22
|
{
|
|
16
23
|
"kind": "skill",
|
|
17
24
|
"name": "llm-prompt-caching",
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: inquiry
|
|
3
|
+
description: The human-in-the-loop primitive — one question put to a person while a run is in flight. Covers the llm-common contracts (Inquiry, InquiryAnswer, InquiryPolicy, the one answer ceiling), the llm transport registry and ExecutionService.ask, the executionInquiry bridge, the agent ask_user plugin, and the pipeline Waiting/resume path. Use when a run needs a decision that is not its own, when seating or releasing an inquiry channel, or when a run parked Waiting and nothing answered it.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# Inquiry — asking a person mid-run
|
|
9
|
+
|
|
10
|
+
One question, put to whoever is behind a run, answered in seconds or not at all. It is the only
|
|
11
|
+
supported way for an execution, an agent or a pipeline to obtain a decision that is genuinely not
|
|
12
|
+
its own — a missing sub-project, a choice between two products the code could be, a relocation
|
|
13
|
+
nobody may perform unasked.
|
|
14
|
+
|
|
15
|
+
It is deliberately NOT a form, a chat or a review queue: a question offers a choice, free text or a
|
|
16
|
+
yes/no, and a run that is not being watched must never block on one.
|
|
17
|
+
|
|
18
|
+
## Where each half lives
|
|
19
|
+
|
|
20
|
+
| Layer | Package | What it owns |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| Contracts | `@owlmeans/llm-common` (`src/inquiry/`) | `Inquiry`, `InquiryAnswer`, `InquiryOption`, `InquiryTransport`, `InquiryConfig`, `InquiryKind`, `InquiryPolicy`, the constants, and the pure helpers |
|
|
23
|
+
| Runtime | `@owlmeans/llm` (`src/inquiry/`) | The transport registry, `InquiryError`/`InquiryUnavailable`/`InquiryDeclined`, `executionInquiry`, and `ExecutionService.ask` |
|
|
24
|
+
| Pipeline | `@owlmeans/agent-common` | `PipelineRunStatus.Waiting`, `PipelineRunInquiry`, `INQUIRY_ANSWERS_KEY`, `PipelineNotResumableError` |
|
|
25
|
+
| Runner + tool | `@owlmeans/agent` | `PipelineRunContext.ask`, the `inquiry` stop reason, the answers merge, `inquiryPlugin` / the `ask_user` tool |
|
|
26
|
+
| Wire | `@owlmeans/viable-common` (`src/connect/`) | The connector's own copy — `ConnectInquiryKind`, `InquiryPayload`, `InquiryAnswerPayload` — renamed so both vocabularies can be imported into one file |
|
|
27
|
+
|
|
28
|
+
## The contracts
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
enum InquiryKind { Choice = 'choice', Text = 'text', Confirm = 'confirm' }
|
|
32
|
+
enum InquiryPolicy { Ask = 'ask', Default = 'default', Refuse = 'refuse' }
|
|
33
|
+
|
|
34
|
+
interface Inquiry {
|
|
35
|
+
id: string // chosen by whoever asks; the ONLY thing that routes an answer back
|
|
36
|
+
kind: InquiryKind
|
|
37
|
+
question: string // one question, in plain words
|
|
38
|
+
context?: string // one or two sentences of background — never the whole task
|
|
39
|
+
options?: InquiryOption[] // required for Choice, ignored otherwise
|
|
40
|
+
multiple?: boolean
|
|
41
|
+
allowText?: boolean // a Choice the answerer may answer in their own words instead
|
|
42
|
+
default?: string | string[] // what to assume when nobody answers
|
|
43
|
+
expiresAt?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface InquiryAnswer {
|
|
47
|
+
inquiryId: string
|
|
48
|
+
value?: string | string[]
|
|
49
|
+
text?: string
|
|
50
|
+
declined?: boolean // nobody could decide — an ANSWER, never a failure
|
|
51
|
+
truncated?: boolean // set by capAnswer or stateAnswerOf, never by an answerer
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface InquiryTransport { ask: (inquiry: Inquiry, signal?: AbortSignal) => Promise<InquiryAnswer> }
|
|
55
|
+
interface InquiryConfig { transport?: string; policy: InquiryPolicy }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The pure helpers are the ONE reading of an answer every layer uses — a second reading is a second
|
|
59
|
+
contract: `defaultAnswerFor(inquiry)` (the default, or a decline), `answeredWith(answer)` (the first
|
|
60
|
+
value, else the text, else `null`), `isDeclined(answer)`, `capAnswer(answer, max?)`,
|
|
61
|
+
`stateAnswerOf(answer)`, `renderInquiry(inquiry)` (a one-line label for a note or a run row).
|
|
62
|
+
|
|
63
|
+
## Three policies, and no fourth
|
|
64
|
+
|
|
65
|
+
`InquiryConfig` travels on `ExecutionState.inquiry` — serializable, and deliberately absent from
|
|
66
|
+
`COLLABORATOR_KEYS`, so a run resumed days later asks through the same channel under the same
|
|
67
|
+
policy.
|
|
68
|
+
|
|
69
|
+
| Policy | `ExecutionService.ask` does |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `Ask` | Hands the question to the seated transport and waits for the answer |
|
|
72
|
+
| `Default` | Returns `defaultAnswerFor(inquiry)` and asks nobody. The caller is expected to RECORD the assumption where a user can read it |
|
|
73
|
+
| `Refuse` | Throws `InquiryDeclined` — nobody may be asked at all |
|
|
74
|
+
|
|
75
|
+
**No configuration means `Default`.** A run that was never given a channel must never block on one:
|
|
76
|
+
that is what makes the primitive safe to reach for from code that also runs unattended (a web
|
|
77
|
+
project pipeline, a scheduled job).
|
|
78
|
+
|
|
79
|
+
## One ceiling, referenced rather than restated
|
|
80
|
+
|
|
81
|
+
`DEFAULT_INQUIRY_ANSWER_CHARS` (2 000) is the only ceiling on a stored answer. The connector's
|
|
82
|
+
`CONNECT_INQUIRY_MAX_TEXT` equals it, the connector's answer schema caps `text` at it, and
|
|
83
|
+
`capAnswer` enforces it. Three ceilings for one value is how a user's 3 000-character answer is
|
|
84
|
+
accepted on the wire and silently halved further in — so never introduce a local cap; import this
|
|
85
|
+
one.
|
|
86
|
+
|
|
87
|
+
**Only the prose is ever cut.** A `value` is the decision itself — for a `Choice` it must equal one
|
|
88
|
+
of the question's own option values — so a shortened one is not a degraded answer but a different
|
|
89
|
+
answer, matching no option, which `answeredWith` would hand on as what the person chose. An
|
|
90
|
+
over-long `value` is a defect upstream (the connector's schema refuses one rather than shortening
|
|
91
|
+
it): `capAnswer` passes it through whole and raises `truncated` on it.
|
|
92
|
+
|
|
93
|
+
`capAnswer` **reports** the cut (`truncated: true`). A silent truncation is exactly the class of
|
|
94
|
+
failure the primitive exists to prevent.
|
|
95
|
+
|
|
96
|
+
A resumable pipeline **state** stores less: `stateAnswerOf` keeps the decision whole and cuts the
|
|
97
|
+
prose to `INQUIRY_STATE_TEXT_CHARS` (200), because a state is keys, markers and paths — two
|
|
98
|
+
full-size answers would make it prose. The full answer still goes back to whoever asked; long text
|
|
99
|
+
belongs in whatever document the application keeps for it (the converter writes
|
|
100
|
+
`docs/conversion/inquiries.md`, keyed by inquiry id).
|
|
101
|
+
|
|
102
|
+
## The transport registry, and why an absent channel is fatal
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
registerInquiryTransport(key, transport) // seat on attach
|
|
106
|
+
releaseInquiryTransport(key) // release when the channel goes away
|
|
107
|
+
hasInquiryTransport(key)
|
|
108
|
+
inquiryTransportFor(key | undefined) // throws InquiryUnavailable — never waits
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Module-level and keyed by string, exactly like the delegate-transport and provider-plugin
|
|
112
|
+
registries beside it: a process holds many at once, and an execution names the one its run belongs
|
|
113
|
+
to. It is `inquiryTransportFor`, not `transportFor`, because `@owlmeans/llm` and
|
|
114
|
+
`@owlmeans/llm-delegate` are re-exported into one namespace by `@owlmeans/viable`.
|
|
115
|
+
|
|
116
|
+
**A transport that cannot serve a question THROWS.** A declined answer is a decision; a channel that
|
|
117
|
+
is gone is terminal, and the two must never look alike.
|
|
118
|
+
|
|
119
|
+
`InquiryUnavailable` is registered fatal (`registerFatalError`) **beside the throw**, so no caller
|
|
120
|
+
has to remember: every retry ladder aborts at once instead of spending itself on a channel nobody is
|
|
121
|
+
behind. `InquiryDeclined` is deliberately NOT fatal — the run decides for itself and carries on.
|
|
122
|
+
|
|
123
|
+
## `ExecutionService.ask` and the one bridge
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
const answer = await ctx.executions().ask(exec, inquiry) // policy-driven, may throw
|
|
127
|
+
const ask = executionInquiry(service, exec) // (inquiry, signal?) => answer | null
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`executionInquiry` is the ONE adapter that maps `InquiryUnavailable → null` and rethrows everything
|
|
131
|
+
else. Wire a pipeline's `options.inquiry.ask` and an agent plugin's channel through it rather than
|
|
132
|
+
catching the error again: a consumer that folded a decline into the same `null` would turn "I will
|
|
133
|
+
not decide" into a run that parks forever, and one that folded them the other way would fail a run
|
|
134
|
+
because a browser tab closed.
|
|
135
|
+
|
|
136
|
+
It asks for the one METHOD it calls (`{ ask }`) and infers the execution type from the execution
|
|
137
|
+
handed to it, so a consumer's own service — `@owlmeans/viable`'s, instantiated with its own
|
|
138
|
+
`ViableExecutionShape` — passes with no type argument, and a facade or a test double stands in
|
|
139
|
+
just as well. Never make an adapter generic over the SHAPE instead: `S` appears in
|
|
140
|
+
`ExecutionService<S>` only through indexed accesses, which is not an inference site, so it silently
|
|
141
|
+
falls back to the bare `ExecutionShape` and refuses every real service contravariantly on `root`.
|
|
142
|
+
|
|
143
|
+
## The `ask_user` tool
|
|
144
|
+
|
|
145
|
+
`inquiryPlugin({ ask })` (`@owlmeans/agent`, alias `INQUIRY_PLUGIN`, order 45) adds the `ask_user`
|
|
146
|
+
tool and one Context paragraph. Both appear **only when `ask` is wired** — a tool nobody can serve
|
|
147
|
+
is a tool the model tries once and remembers as broken.
|
|
148
|
+
|
|
149
|
+
The body never throws, with exactly one exception: `InquiryUnavailable` is **rethrown**. No channel
|
|
150
|
+
is an answerable situation (`{ error: 'Nobody can answer …' }`); a channel that WAS there and
|
|
151
|
+
vanished is not. That escape only works if the agent passes `fatal: e => isFatalError(e) != null`
|
|
152
|
+
into `safeInvokeTool` — **an agent installing this plugin must**, or the loop spends its whole turn
|
|
153
|
+
budget on a dead channel.
|
|
154
|
+
|
|
155
|
+
## Parking a pipeline: `Waiting`
|
|
156
|
+
|
|
157
|
+
`PipelineRunContext.ask(inquiry)` has three outcomes, in order:
|
|
158
|
+
|
|
159
|
+
1. An answer already in the state (a resume) is returned at once — a question is never asked twice.
|
|
160
|
+
2. A live channel answers: the answer is recorded in the state (`stateAnswerOf(capAnswer(...))`
|
|
161
|
+
under `state[INQUIRY_ANSWERS_KEY][inquiry.id]`) and the FULL answer is returned.
|
|
162
|
+
3. Nobody is there: the run stops `Waiting` with the inquiry on its row, and the call never returns.
|
|
163
|
+
|
|
164
|
+
**`Inquiry.id` must be stable across re-entries of the same step.** It is the only thing an answer
|
|
165
|
+
is matched by, so derive it from the step and the thing being decided (`${step}:${entity}:tone`) —
|
|
166
|
+
never mint one per call. A fresh id can never match what the state holds, so the run asks again on
|
|
167
|
+
every entry and parks forever, which is the one way to break the asked-once contract from inside.
|
|
168
|
+
|
|
169
|
+
A `Waiting` run is resumable and **not stale** — it has no process, and its heartbeat will not move
|
|
170
|
+
again until somebody answers, so nothing that sweeps stale runs may pick it up. A run with no store
|
|
171
|
+
cannot park at all: it throws `PipelineNotResumableError`, because nothing would be there to resume.
|
|
172
|
+
|
|
173
|
+
Answers are merged **by the runner**, in both `invoke` and `resume` (`resume(runId, { answers })`),
|
|
174
|
+
never by a caller's mapping: the seed overwrites the restored state key by key, so a mapping that
|
|
175
|
+
forwarded the answers map would wipe the child's own recorded answers. The merge applies the same
|
|
176
|
+
`stateAnswerOf(capAnswer(...))` cut the live path does — a resume is how an answer usually arrives,
|
|
177
|
+
so a ceiling enforced on the live path alone is enforced where the least text comes in. Answers are
|
|
178
|
+
also the one state key that ACCUMULATES, so `ctx.ask` re-reads the map at write time: steps with no
|
|
179
|
+
edge between them run in one superstep, and a write built from a pre-await copy loses a sibling's
|
|
180
|
+
answer. When a composed child parks, `asStep` asks the parent's `ctx.ask` and re-invokes the child
|
|
181
|
+
if an answer comes back (bounded); only when the parent's own `ask` parks does the parent park too.
|
|
182
|
+
|
|
183
|
+
## Rules
|
|
184
|
+
|
|
185
|
+
- Ask only for a decision that is genuinely a person's. Anything discoverable by reading is not a
|
|
186
|
+
question.
|
|
187
|
+
- One question at a time, with a `default` wherever one is defensible — most runs answer themselves
|
|
188
|
+
under policy `Default`, and a question with no default costs them a decline.
|
|
189
|
+
- Never widen a `Choice` past `DEFAULT_INQUIRY_OPTIONS` (12); beyond that it is not a question.
|
|
190
|
+
- Never introduce a second answer ceiling, a second reading of "was this answered", or a second
|
|
191
|
+
mapping of `InquiryUnavailable`.
|
|
192
|
+
- A refusal a user can act on must be phrased for them — a raw `inquiry:declined:<id>` reaching a
|
|
193
|
+
screen is a bug in the consumer, not in this primitive.
|
|
194
|
+
|
|
195
|
+
## Related
|
|
196
|
+
|
|
197
|
+
- [[llm-common]] — where the contracts live · [[llm]] — the registry and `ExecutionService`
|
|
198
|
+
- [[llm-delegate]] — the same registry/fatal shape for model calls performed elsewhere
|
|
199
|
+
- [[agent]] — the pipeline runner and the `ask_user` plugin · [[agent-common]] — the run contracts
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/llm
|
|
9
9
|
|
|
10
10
|
**Layer:** Core
|
|
11
|
-
**Install:** `"@owlmeans/llm": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/llm": "^0.1.18-rc.15"` in `dependencies` (plus the `@langchain/*` peers)
|
|
12
12
|
|
|
13
13
|
The inference runtime. Everything provider-specific is a **plugin**; the model itself only owns the
|
|
14
14
|
provider-independent parts (streaming discipline, retries, validation, observability). Serializable
|
|
@@ -23,7 +23,7 @@ symbol "because a test needs it".
|
|
|
23
23
|
|--------|-------------|
|
|
24
24
|
| `makeLlmModel({ model, purpose, prompt?, prompts?, files?, utility?, retries?, … }, spectator)` | The four-method model: `ask` / `talk` / `invoke(input, schema, opts)` / `request`. `model` is an already-resolved `BaseChatModel`. |
|
|
25
25
|
| `makeLlmService(options, alias?)` · `appendLlmService(ctx, options, alias?)` · `llmServiceApi(options, self)` | Model factory/registry — `makeLlmService({ models: () => configs }).getModel(alias, override?)` resolves a `ModelConfig` by alias, memoized per alias+override. The `…Api` half omits `createService`, to compose into your own service (role accessors, domain helpers). |
|
|
26
|
-
| `makeExecutionService(alias?, options?)` · `appendExecutionService(ctx, alias?, options?)` · `executionServiceApi(options, self)` | Frozen 3-level executions + policy resolution + snapshot/restore
|
|
26
|
+
| `makeExecutionService(alias?, options?)` · `appendExecutionService(ctx, alias?, options?)` · `executionServiceApi(options, self)` | Frozen 3-level executions + policy resolution + snapshot/restore + advice, and the same composable half. |
|
|
27
27
|
| `makePromptService(options?, alias?)` · `appendPromptService(ctx, options?, alias?)` · `promptServiceApi(options, self)` | Skill registry + the composition plugin chain. Also at `@owlmeans/llm/prompt`. |
|
|
28
28
|
| `rolePlugin`, `skillsPlugin`, `contextPlugin`, `BUILT_IN_PROMPT_PLUGINS` | The built-in composition plugins. |
|
|
29
29
|
| `PromptContext.claim(key)` · `PromptComposeParams.utility` | Per-composition ownership of a key; a cheap model for one plugin-side call. |
|
|
@@ -33,6 +33,8 @@ symbol "because a test needs it".
|
|
|
33
33
|
| `NO_SAMPLING_PREFIXES` / `rejectsSampling(model)` · `RESPONSES_API_PREFIXES` / `usesResponsesApi(model)` | Which families reject which sampling parameters — see the table below. Consumers pin presets against them. |
|
|
34
34
|
| `withRetry`, `registerFatalError`, `isFatalError`, `spectate`, `normalizeInput`, `parseJsonContent`, `coerceToSchema` | Helpers usable alongside a model. Also at `@owlmeans/llm/helpers`. |
|
|
35
35
|
| `LlmError`, `LlmModelError`, `LlmMissconfiguredError`, `LlmPluginError`, `LlmRetryExceededError` | `ResilientError` family. `LlmModelError` is the RETRYABLE one. |
|
|
36
|
+
| `registerInquiryTransport`, `releaseInquiryTransport`, `hasInquiryTransport`, `inquiryTransportFor` | The inquiry-channel registry — how a question reaches a person. `inquiryTransportFor` throws rather than waits. |
|
|
37
|
+
| `executionInquiry(service, exec)` · `InquiryError`, `InquiryUnavailable`, `InquiryDeclined` | The ONE adapter mapping an absent channel to `null`, and the error family behind it. `InquiryUnavailable` is registered fatal. |
|
|
36
38
|
| `mergePrompt`, `mergePolicy`, `resolveRole`, `effortPatch` | Execution merge helpers; `mergePrompt` unions skills and takes the deepest role. |
|
|
37
39
|
| `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. |
|
|
38
40
|
|
|
@@ -125,15 +127,39 @@ handle comes from the other end — `PromptComposeParams.utility` (and `AgentOpt
|
|
|
125
127
|
OPTIONAL resolver, unset wherever no cheap tier is wired, so a plugin that cannot get one degrades
|
|
126
128
|
rather than fails.
|
|
127
129
|
|
|
128
|
-
###
|
|
130
|
+
### Asking a person: `ask(exec, inquiry, signal?)`
|
|
129
131
|
|
|
130
|
-
|
|
131
|
-
`
|
|
132
|
-
`
|
|
133
|
-
`
|
|
134
|
-
|
|
135
|
-
`
|
|
136
|
-
|
|
132
|
+
A run that needs a decision which is genuinely not its own puts ONE question to whoever is behind
|
|
133
|
+
it, under `ExecutionState.inquiry` — `ask` hands it to the transport seated under
|
|
134
|
+
`inquiry.transport`, `default` returns the question's own default (or a decline) and asks nobody,
|
|
135
|
+
`refuse` throws `InquiryDeclined`. **No configuration means `default`**: a run that was never given
|
|
136
|
+
a channel must never block on one. The answer comes back capped by `capAnswer`, and
|
|
137
|
+
`inquiry` is NOT in `COLLABORATOR_KEYS` — it is state, so a resumed run asks the same way.
|
|
138
|
+
|
|
139
|
+
`inquiryTransportFor` throws `InquiryUnavailable`, registered fatal beside the throw so no retry
|
|
140
|
+
ladder spends itself on a channel nobody is behind. Wire a pipeline or an agent through
|
|
141
|
+
`executionInquiry(service, exec)`, the one place that reads that as "nobody is there" (`null`) while
|
|
142
|
+
letting a decline escape. Everything else about the primitive: [[inquiry]].
|
|
143
|
+
|
|
144
|
+
### The plugin seam is `advise`-only, and `use()` seats by alias
|
|
145
|
+
|
|
146
|
+
`ExecutionPlugin` carries one hook: `advise` — answer a performer's question about the project it
|
|
147
|
+
works in (`ExecutionService.advise(exec, request)`, first usable answer wins, a throwing plugin is
|
|
148
|
+
skipped, `null` when nobody answers). Advice is advisory by contract: a caller appends whatever
|
|
149
|
+
comes back and proceeds unchanged on `null`.
|
|
150
|
+
|
|
151
|
+
**There is no checkpoint pair here, and that is a decision rather than a gap.** An execution is a
|
|
152
|
+
COLLABORATOR — a model policy, a purpose, a file helper — rebuilt per run from durable inputs, not
|
|
153
|
+
an artifact something restores. Resumability belongs to `@owlmeans/agent`'s pipeline runner, where
|
|
154
|
+
the persisted run ROW is the authority on where a run stands. Two half-truths about that would be
|
|
155
|
+
worse than one; `ExecutionService.checkpoint` and `ExecutionPlugin.onCheckpoint|onRestore` were
|
|
156
|
+
deleted for exactly that reason, having never been implemented by anything.
|
|
157
|
+
`TaskExecutionState.{phase, completed, cursor}` survive as **labels** for traces and prompts — a
|
|
158
|
+
human-readable "where am I" for a model to read, never a position anything resumes from.
|
|
159
|
+
|
|
160
|
+
`use(plugin)` seats **by alias**, replacing a plugin already registered under the same one. Mixins
|
|
161
|
+
compose, and a layer wired twice would otherwise answer twice — silently, since the first usable
|
|
162
|
+
answer wins.
|
|
137
163
|
|
|
138
164
|
## Classify a provider error by walking `cause`, never by `instanceof` or a surface read
|
|
139
165
|
|
|
@@ -286,7 +312,8 @@ blank tool results are stubbed to keep their `tool_use` pairing). Details: packa
|
|
|
286
312
|
suite is gated on `ANTHROPIC_SECRET` and self-skips with a printed reason without it, and the OpenRouter
|
|
287
313
|
suite is disabled unconditionally: an aggregator on a separate account serving models no deployment runs,
|
|
288
314
|
whose `402 requires more credits` reads as a failure of the code under test. `plugins.spec.ts` covers the
|
|
289
|
-
`Compatible` provider offline.
|
|
315
|
+
`Compatible` provider offline, and `inquiry.spec.ts` covers the channel registry, the `ask` policy
|
|
316
|
+
matrix and the `executionInquiry` bridge — no provider, no network.
|
|
290
317
|
|
|
291
318
|
## Depends On
|
|
292
319
|
|
|
@@ -298,4 +325,5 @@ whose `402 requires more credits` reads as a failure of the code under test. `pl
|
|
|
298
325
|
|
|
299
326
|
- [[llm-common]] — the serializable contracts · [[llm-prompt-caching]] — prompt composition, block
|
|
300
327
|
order and the cache invariants
|
|
328
|
+
- [[inquiry]] — the human-in-the-loop primitive: contracts, the registry, `ask`, and the pipeline park
|
|
301
329
|
- [[context]] — service registration · [[error]] — the `ResilientError` family
|
package/build/consts.d.ts
CHANGED
|
@@ -102,6 +102,10 @@ export declare const EFFORT_TABLE: Record<ExecutionEffort, ModelConfigPatch>;
|
|
|
102
102
|
*
|
|
103
103
|
* `state` is in the list because a `TaskExecution` carries its own composed state —
|
|
104
104
|
* without excluding it every `derive`/`escalate`/`withPurpose` would nest another copy.
|
|
105
|
+
*
|
|
106
|
+
* `inquiry` is deliberately ABSENT: how a run may put a question to a person is state, and a run
|
|
107
|
+
* resumed from a snapshot must ask through the same channel under the same policy. Listing it
|
|
108
|
+
* here would leave a resumed run silently unable to ask anything.
|
|
105
109
|
*/
|
|
106
110
|
export declare const COLLABORATOR_KEYS: string[];
|
|
107
111
|
//# 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":"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,IAA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AAM,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;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,YAAY,CAAA;AAE3C,8DAA8D;AAC9D,eAAO,MAAM,cAAc,2BAA2B,CAAA;AAEtD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAKlE,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,EAErC,CAAA"}
|
package/build/consts.js
CHANGED
|
@@ -109,6 +109,10 @@ export const EFFORT_TABLE = {
|
|
|
109
109
|
*
|
|
110
110
|
* `state` is in the list because a `TaskExecution` carries its own composed state —
|
|
111
111
|
* without excluding it every `derive`/`escalate`/`withPurpose` would nest another copy.
|
|
112
|
+
*
|
|
113
|
+
* `inquiry` is deliberately ABSENT: how a run may put a question to a person is state, and a run
|
|
114
|
+
* resumed from a snapshot must ask through the same channel under the same policy. Listing it
|
|
115
|
+
* here would leave a resumed run silently unable to ask anything.
|
|
112
116
|
*/
|
|
113
117
|
export const COLLABORATOR_KEYS = [
|
|
114
118
|
'state', 'models', 'model', 'temperatureFactory', 'outputErrors', 'files', 'prompts',
|
package/build/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[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ACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,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;AASlE,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,WAClE,uBAAuB,QAC1B,MAAM,gBAAgB,CAAC,CAAC,CAAC,KAC9B,gBAAgB,CAAC,CAAC,CAiLpB,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,UACrE,MAAM,YACJ,uBAAuB,KAC/B,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,OAEtF,CAAC,UACC,MAAM,YACJ,uBAAuB,KAC/B,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAQ5B,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { createService } from '@owlmeans/context';
|
|
2
|
-
import { ExecutionEffort, ExecutionLevel, UTILITY_ROLE } from '@owlmeans/llm-common';
|
|
2
|
+
import { capAnswer, defaultAnswerFor, ExecutionEffort, ExecutionLevel, InquiryPolicy, UTILITY_ROLE, } from '@owlmeans/llm-common';
|
|
3
3
|
import { COLLABORATOR_KEYS, EXECUTION_SERVICE } from '../consts.js';
|
|
4
|
+
import { InquiryDeclined } from '../inquiry/errors.js';
|
|
5
|
+
import { inquiryTransportFor } from '../inquiry/transport.js';
|
|
4
6
|
import { composeExecState, composeTaskState, effortPatch, freeze, mergeOverride, mergePolicy, mergePrompt, resolveRole, } from './utils.js';
|
|
5
7
|
/**
|
|
6
8
|
* Build the execution service implementation WITHOUT registering it as a context
|
|
@@ -35,6 +37,9 @@ export const executionServiceApi = (options, self) => {
|
|
|
35
37
|
purpose: { ...input.purpose },
|
|
36
38
|
policy: { ...input.policy },
|
|
37
39
|
...(input.prompt != null ? { prompt: { ...input.prompt } } : {}),
|
|
40
|
+
// Copied like every other piece of state, and NOT listed in `COLLABORATOR_KEYS`: a resumed
|
|
41
|
+
// run has to ask through the channel and policy it was started with.
|
|
42
|
+
...(input.inquiry != null ? { inquiry: { ...input.inquiry } } : {}),
|
|
38
43
|
}),
|
|
39
44
|
forTask: (parent, input) => {
|
|
40
45
|
const { effort, phase, data, prompt, ...extras } = input;
|
|
@@ -113,16 +118,17 @@ export const executionServiceApi = (options, self) => {
|
|
|
113
118
|
...(temperature != null && temperature > 0.2 ? { topP: 0.8 } : {}),
|
|
114
119
|
}),
|
|
115
120
|
use: plugin => {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (
|
|
122
|
-
|
|
121
|
+
// Seated by alias when it has one: mixins compose, and a layer wired twice would otherwise
|
|
122
|
+
// answer twice — silently, since the first usable answer wins.
|
|
123
|
+
const at = plugin.alias != null
|
|
124
|
+
? plugins.findIndex(entry => entry.alias === plugin.alias)
|
|
125
|
+
: -1;
|
|
126
|
+
if (at < 0) {
|
|
127
|
+
plugins.push(plugin);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
plugins[at] = plugin;
|
|
123
131
|
}
|
|
124
|
-
const state = self().snapshot(exec);
|
|
125
|
-
await Promise.all(plugins.map(plugin => plugin.onCheckpoint?.(state, exec, key)));
|
|
126
132
|
},
|
|
127
133
|
advise: async (exec, request) => {
|
|
128
134
|
for (const plugin of plugins) {
|
|
@@ -141,6 +147,15 @@ export const executionServiceApi = (options, self) => {
|
|
|
141
147
|
}
|
|
142
148
|
return null;
|
|
143
149
|
},
|
|
150
|
+
ask: async (exec, inquiry, signal) => {
|
|
151
|
+
const policy = exec.inquiry?.policy ?? InquiryPolicy.Default;
|
|
152
|
+
// No channel was ever configured, so there is nobody to wait for: assume and carry on.
|
|
153
|
+
if (policy === InquiryPolicy.Default)
|
|
154
|
+
return defaultAnswerFor(inquiry);
|
|
155
|
+
if (policy === InquiryPolicy.Refuse)
|
|
156
|
+
throw new InquiryDeclined(inquiry.id);
|
|
157
|
+
return capAnswer(await inquiryTransportFor(exec.inquiry?.transport).ask(inquiry, signal));
|
|
158
|
+
},
|
|
144
159
|
snapshot: exec => {
|
|
145
160
|
if (exec.level === ExecutionLevel.Task) {
|
|
146
161
|
return freeze({ ...exec.state });
|
|
@@ -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,eAAe,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/execution/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EACL,SAAS,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,GAC1F,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAM7D,OAAO,EACL,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EACnF,WAAW,EAAE,WAAW,GACzB,MAAM,YAAY,CAAA;AAEnB;;;;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AAE,CAAC;gBACvC,OAAO,MAAM,CAAC,EAAE,GAAI,IAAiC,CAAC,KAAK,EAAE,CAAC,CAAA;YAChE,CAAC;YACD,OAAO,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAA;QACzD,CAAC;QAED,OAAO,EAAE,CAAC,KAAqB,EAAE,aAAa,GAAG,EAAwB,EAAE,EAAE,CAAC,MAAM,CAAC;YACnF,GAAG,KAAK;YACR,GAAG,aAAa;YAChB,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1D,CAAc;KAEO,CAAA;IAExB,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,KAAK,GAAW,iBAAiB,EACjC,OAAO,GAA4B,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,KAAK,GAAW,iBAAiB,EACjC,OAAO,GAA4B,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,6 +1,6 @@
|
|
|
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, FileProviderRef, LlmPurpose, ModelConfigOverride, ModelPolicy, ModelRole, PromptPolicy, TaskExecutionState } from '@owlmeans/llm-common';
|
|
3
|
+
import type { ExecutionEffort, ExecutionLevel, ExecutionState, FileProviderRef, Inquiry, InquiryAnswer, InquiryConfig, LlmPurpose, ModelConfigOverride, ModelPolicy, ModelRole, PromptPolicy, TaskExecutionState } from '@owlmeans/llm-common';
|
|
4
4
|
import type { LlmService, TemperatureFactory } from '../types.js';
|
|
5
5
|
import type { PromptService } from '../prompt/types.js';
|
|
6
6
|
/**
|
|
@@ -45,6 +45,11 @@ export interface ProjectExecutionInput {
|
|
|
45
45
|
purpose: LlmPurpose;
|
|
46
46
|
/** Baseline role and skills for the whole run. */
|
|
47
47
|
prompt?: PromptPolicy;
|
|
48
|
+
/**
|
|
49
|
+
* How this run may put a question to a person (see {@link ExecutionService.ask}). State, not a
|
|
50
|
+
* collaborator — it travels into every snapshot, so a resumed run asks the same way.
|
|
51
|
+
*/
|
|
52
|
+
inquiry?: InquiryConfig;
|
|
48
53
|
outputErrors?: boolean;
|
|
49
54
|
captureNull?: boolean;
|
|
50
55
|
}
|
|
@@ -99,17 +104,22 @@ export interface AdviceRequest {
|
|
|
99
104
|
hints?: Record<string, unknown>;
|
|
100
105
|
}
|
|
101
106
|
/**
|
|
102
|
-
* Extension seam. A plugin
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
+
* Extension seam. A plugin ANSWERS a performer's question about its surroundings.
|
|
108
|
+
*
|
|
109
|
+
* It used to carry a checkpoint pair as well (`onCheckpoint`/`onRestore`), and that is gone: an
|
|
110
|
+
* execution is a bundle of collaborators and domain context, not a workflow position, and the only
|
|
111
|
+
* position it ever carried was three optional fields nothing ever read back. Recoverable work is a
|
|
112
|
+
* PIPELINE — `@owlmeans/agent`'s `makePipeline` — whose steps are named, whose state is scalars and
|
|
113
|
+
* keys, and whose run row is a single authority on where it stands. Two mechanisms answering "where
|
|
114
|
+
* is this run" is two half-truths, which is exactly what this deletion removes.
|
|
107
115
|
*/
|
|
108
116
|
export interface ExecutionPlugin {
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Identity for de-duplication. A plugin registered twice — two `append*` calls composing the
|
|
119
|
+
* same layer — would otherwise answer twice, and the first usable answer wins, so the duplicate
|
|
120
|
+
* is silent rather than loud.
|
|
121
|
+
*/
|
|
122
|
+
alias?: string;
|
|
113
123
|
/**
|
|
114
124
|
* Answer a performer's question about the project it is working in. Return the text to
|
|
115
125
|
* hand the model, or `null` when this plugin does not own the request's `kind` — or
|
|
@@ -162,12 +172,29 @@ export interface ExecutionService<S extends ExecutionShape = ExecutionShape> ext
|
|
|
162
172
|
* `HelperExecutionInput.output`) survives the refinement.
|
|
163
173
|
*/
|
|
164
174
|
temperatureFactory: (exec: S['exec'], role?: ModelRole, baseOverride?: ModelConfigOverride) => TemperatureFactory;
|
|
165
|
-
/** Register an execution plugin (
|
|
175
|
+
/** Register an execution plugin (advice). Seated by `alias` when it carries one. */
|
|
166
176
|
use: (plugin: ExecutionPlugin) => void;
|
|
167
|
-
/**
|
|
168
|
-
|
|
177
|
+
/**
|
|
178
|
+
* The JSON-safe half of an execution — everything that is not a collaborator.
|
|
179
|
+
*
|
|
180
|
+
* A transport-level convenience, not a workflow position: nothing here says where a run has got
|
|
181
|
+
* to, and nothing should. See {@link ExecutionPlugin}.
|
|
182
|
+
*/
|
|
169
183
|
snapshot: (exec: S['exec']) => ExecutionState;
|
|
170
184
|
restore: (state: ExecutionState, collaborators?: S['collaborators']) => S['exec'];
|
|
185
|
+
/**
|
|
186
|
+
* Put a question to whoever is behind this execution, under its own policy.
|
|
187
|
+
*
|
|
188
|
+
* `ask` → the seated transport (and the answer comes back capped to
|
|
189
|
+
* `DEFAULT_INQUIRY_ANSWER_CHARS`); `default` → the question's own default, or a decline, which
|
|
190
|
+
* the caller is expected to RECORD as an assumption; `refuse` → `InquiryDeclined`. No config at
|
|
191
|
+
* all means `default`: a run that was never given a channel must never block on one.
|
|
192
|
+
*
|
|
193
|
+
* Throws `InquiryUnavailable` when the policy is `ask` and nothing is seated under the
|
|
194
|
+
* execution's transport key. Wire it through `executionInquiry` to read that as "nobody is
|
|
195
|
+
* there" instead.
|
|
196
|
+
*/
|
|
197
|
+
ask: (exec: S['exec'], inquiry: Inquiry, signal?: AbortSignal) => Promise<InquiryAnswer>;
|
|
171
198
|
/**
|
|
172
199
|
* Ask the registered plugins about the project this execution runs in. Plugins are
|
|
173
200
|
* consulted in registration order and the FIRST usable answer wins, so one advisor owns
|
|
@@ -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,eAAe,EAAE,UAAU,
|
|
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,OAAO,EAAE,aAAa,EACxF,aAAa,EAAE,UAAU,EAAE,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EACpF,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAA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
|
export * from './execution/index.js';
|
|
8
|
+
export * from './inquiry/index.js';
|
|
8
9
|
export * from './prompt/index.js';
|
|
9
10
|
export type * from './plugins/types.js';
|
|
10
11
|
export { plugins, registerLlmPlugin, pluginOf, pluginFor, resolvePlugin } from './plugins/index.js';
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,mBAAmB,oBAAoB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACnG,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACjH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EACL,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,gBAAgB,GACpF,MAAM,qBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,mBAAmB,oBAAoB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACnG,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACjH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EACL,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,gBAAgB,GACpF,MAAM,qBAAqB,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from './model.js';
|
|
|
4
4
|
export * from './service.js';
|
|
5
5
|
export * from './helpers/index.js';
|
|
6
6
|
export * from './execution/index.js';
|
|
7
|
+
export * from './inquiry/index.js';
|
|
7
8
|
export * from './prompt/index.js';
|
|
8
9
|
export { plugins, registerLlmPlugin, pluginOf, pluginFor, resolvePlugin } from './plugins/index.js';
|
|
9
10
|
export { anthropicPlugin, ANTHROPIC_FAMILY, NO_SAMPLING_PREFIXES, rejectsSampling } from './plugins/anthropic.js';
|