@theokit/agents 13.0.0-next.10 → 13.0.0-next.2
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/CHANGELOG.md +0 -203
- package/dist/{agent-compiler-CvYfM-0t.d.ts → agent-compiler-uhleFZj_.d.ts} +2 -63
- package/dist/{bridge-entry-B3BRB3e_.d.ts → bridge-entry--4VYlECy.d.ts} +3 -20
- package/dist/bridge.d.ts +4 -5
- package/dist/bridge.js +3 -5
- package/dist/{chunk-FXQF7LS3.js → chunk-GHRHJPJS.js} +130 -178
- package/dist/chunk-GHRHJPJS.js.map +1 -0
- package/dist/{chunk-6YJIXBMA.js → chunk-LTPL32XW.js} +3 -7
- package/dist/chunk-LTPL32XW.js.map +1 -0
- package/dist/{chunk-43O2CCZR.js → chunk-OAQEWLQJ.js} +1 -19
- package/dist/chunk-OAQEWLQJ.js.map +1 -0
- package/dist/config.d.ts +1 -12
- package/dist/config.js +1 -5
- package/dist/config.js.map +1 -1
- package/dist/{define-agent-Dp6e7chT.d.ts → define-agent-BL3jMyJi.d.ts} +152 -12
- package/dist/{delegation-scoring-BZdtCdMN.d.ts → delegation-scoring--OiOTcAW.d.ts} +1 -1
- package/dist/index.d.ts +9 -19
- package/dist/index.js +3 -13
- package/dist/index.js.map +1 -1
- package/dist/session.d.ts +33 -113
- package/dist/session.js +47 -98
- package/dist/session.js.map +1 -1
- package/dist/testing.d.ts +2 -3
- package/dist/testing.js +1 -1
- package/dist/tools.d.ts +2 -3
- package/dist/tools.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-43O2CCZR.js.map +0 -1
- package/dist/chunk-6YJIXBMA.js.map +0 -1
- package/dist/chunk-FXQF7LS3.js.map +0 -1
- package/dist/setting-sources-gate-tadmHT0c.d.ts +0 -181
package/CHANGELOG.md
CHANGED
|
@@ -1,208 +1,5 @@
|
|
|
1
1
|
# @theokit/agents
|
|
2
2
|
|
|
3
|
-
## 13.0.0-next.10
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- ca44ee7: A narrowed foreign root can name `commands`
|
|
8
|
-
|
|
9
|
-
`settingSources.claudeCode.import` narrows the foreign root to named surfaces, and `CompatSurface`
|
|
10
|
-
listed four of them — `hooks`, `plugins`, `skills`, `subagents`. It fed a fifth: this package loads
|
|
11
|
-
`<projectDir>/.claude/commands/*.md` itself, outside the SDK's `compatSources` path. The name was
|
|
12
|
-
missing from the vocabulary, so a consumer could neither ask for that directory nor be told it had
|
|
13
|
-
gone unread, and `loadCustomCommands` tested `sources.includes('claude-code')` — string equality
|
|
14
|
-
against a union whose narrowed member is an object, so every narrowed list read as _not declared_.
|
|
15
|
-
|
|
16
|
-
`CompatSurface` now includes `'commands'`, and the loader understands both shapes: the bare source
|
|
17
|
-
name grants every surface the root feeds, the narrowed form grants the ones it names.
|
|
18
|
-
|
|
19
|
-
Purely additive — before this, no narrowed list reached the directory at all, so nothing that works
|
|
20
|
-
today stops working. A narrowed list that wants foreign commands adds `'commands'` to `import`.
|
|
21
|
-
|
|
22
|
-
An enumeration used to narrow a root must cover every surface that root feeds; otherwise it is not
|
|
23
|
-
a narrowing but an undeclared drop. Reported as usetheokit/theokit#704, found by measuring a claim
|
|
24
|
-
in a consumer's adoption report rather than by any test here — the fifth time a gap in this
|
|
25
|
-
package's public surface was invisible from inside it.
|
|
26
|
-
|
|
27
|
-
## 13.0.0-next.9
|
|
28
|
-
|
|
29
|
-
### Minor Changes
|
|
30
|
-
|
|
31
|
-
- c59abf6: A foreign configuration root can be imported in part
|
|
32
|
-
|
|
33
|
-
`resolveCompatSources` returned the bare literal `'claude-code'`, which the SDK reads as "import
|
|
34
|
-
every surface" — hooks, plugins, skills, subagents. `settingSources.claudeCode.import` now names the
|
|
35
|
-
surfaces, and the resolved value carries them.
|
|
36
|
-
|
|
37
|
-
The distinction is the reason the grant exists: `.claude/` usually arrives with the clone and its
|
|
38
|
-
`hooks.json` executes shell, so "take the skills, refuse the hooks" is the ordinary thing to want,
|
|
39
|
-
and the only choices were all of it or none of it.
|
|
40
|
-
|
|
41
|
-
Absent `import` still means the whole root, so nothing existing changes. An EMPTY list is refused
|
|
42
|
-
rather than guessed: "no surfaces" and "unset, so all of them" are both defensible readings of `[]`,
|
|
43
|
-
they differ by whether shell executes, and picking one would settle a security question by
|
|
44
|
-
convention.
|
|
45
|
-
|
|
46
|
-
`CompatSurface` and `ResolvedCompatSource` are declared here rather than imported from the SDK, for
|
|
47
|
-
the reason already recorded beside the literal: they do not exist in `@theokit/sdk@4.52.1`, this
|
|
48
|
-
package's declared floor.
|
|
49
|
-
|
|
50
|
-
Closes usetheokit/theokit#686.
|
|
51
|
-
|
|
52
|
-
## 13.0.0-next.8
|
|
53
|
-
|
|
54
|
-
### Minor Changes
|
|
55
|
-
|
|
56
|
-
- feb5781: `AgentBuilder.create().hookApproval()` — the fluent twin of `defineAgent({ hookApproval })`
|
|
57
|
-
|
|
58
|
-
`13.0.0-next.7` shipped the hook approval gate reachable through `defineAgent` and capabilities, and
|
|
59
|
-
not through the fluent builder. A consumer that authors with `AgentBuilder.create()` had no way to
|
|
60
|
-
reach it: `.use()` composes presets rather than sinking capabilities, and the definition reaches
|
|
61
|
-
`streamAgentTurnInProcess` with `local` already assembled, so there was no downstream place to inject
|
|
62
|
-
`local.hooks` by hand either.
|
|
63
|
-
|
|
64
|
-
Fifth instance of one family and a NEW variant. The first four were "the symbol exists and the barrel
|
|
65
|
-
omits it", which the emitted-export guard now catches. This one is the opposite: the symbol is
|
|
66
|
-
exported, on the compiled waist, and reachable through one authoring door — the other door simply
|
|
67
|
-
does not offer it, and an export check is green on that.
|
|
68
|
-
|
|
69
|
-
So the guard for this variant builds the SAME agent through BOTH doors and asserts they arrive at the
|
|
70
|
-
same compiled waist. It catches the worst case too: an interface that declares the method while the
|
|
71
|
-
factory never wires it compiles, does nothing, and fails this test.
|
|
72
|
-
|
|
73
|
-
## 13.0.0-next.7
|
|
74
|
-
|
|
75
|
-
### Patch Changes
|
|
76
|
-
|
|
77
|
-
- a2b0a59: The hook gate's vocabulary crosses with the capability that takes it
|
|
78
|
-
|
|
79
|
-
`13.0.0-next.6` exported `HookApprovalCapability` and withheld `HookApprovalGate`,
|
|
80
|
-
`HookApprovalRequest` and `HookGateUnsupportedError`. A consumer could build the gate, and could
|
|
81
|
-
neither type the object it takes nor catch its refusal by class — which matters more here than
|
|
82
|
-
usual, because refusing loudly is the whole design.
|
|
83
|
-
|
|
84
|
-
Fourth instance of the same shape (#663 `AgentModule`, #668 `transcriptOf`, #675 `RegistryOutcome`),
|
|
85
|
-
and the first three were each found by installing the published package. The source is correct every
|
|
86
|
-
time: the type IS exported from its own module, and only the barrel omits it.
|
|
87
|
-
|
|
88
|
-
A guard now reads the EMITTED `dist/index.d.ts` export list rather than the source, and it was
|
|
89
|
-
proved able to fail by removing one export and watching it name that one.
|
|
90
|
-
|
|
91
|
-
## 13.0.0-next.6
|
|
92
|
-
|
|
93
|
-
### Minor Changes
|
|
94
|
-
|
|
95
|
-
- 462bb62: The pre-spawn hook approval gate crosses the layer, or refuses to pretend it did
|
|
96
|
-
|
|
97
|
-
`@theokit/sdk@5.4.0` added `local.hooks.approve` — a consumer's decision point before the runtime
|
|
98
|
-
spawns a hook. This layer never forwarded it, so a hook declared in a config root, including a
|
|
99
|
-
foreign dialect imported through `compatSources`, ran shell without passing the consumer's approval.
|
|
100
|
-
|
|
101
|
-
Measured in a consumer against 5.4.0, with a control arm proving the zero was not an empty turn:
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
control_nothing fires=0 tool_ran=yes
|
|
105
|
-
claude_project_unapproved fires=1 tool_ran=yes
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
`defineAgent({ hookApproval })` and the new `HookApprovalCapability` now carry it to
|
|
109
|
-
`Agent.create({ local: { hooks } })`. Named `hookApproval` rather than `hooks` because
|
|
110
|
-
`defineAgent({ hooks })` is already the LIFECYCLE seam, and two security-relevant things under one
|
|
111
|
-
name is how a consumer configures the wrong one.
|
|
112
|
-
|
|
113
|
-
**Declaring it against an SDK older than 5.4.0 is REFUSED, not forwarded.** The option is 5.4.0-only
|
|
114
|
-
while this package's floor is `^4.52.1`, so a pass-through would compile and do nothing on most
|
|
115
|
-
admitted versions — a gate that silently does not gate, which is worse than offering none, because
|
|
116
|
-
whoever configured it stops looking. An unreadable SDK version is refused for the same reason:
|
|
117
|
-
"cannot tell" and "is gated" must not collapse.
|
|
118
|
-
|
|
119
|
-
The floor is unchanged, so no consumer is pinned to a newer SDK for a feature they did not ask for.
|
|
120
|
-
|
|
121
|
-
Closes usetheokit/theokit#686 (the `hooks` half; `resolveCompatSources` widening is tracked there).
|
|
122
|
-
|
|
123
|
-
## 13.0.0-next.5
|
|
124
|
-
|
|
125
|
-
### Patch Changes
|
|
126
|
-
|
|
127
|
-
- 9915c19: `RegistryOutcome` is exported alongside the field that uses it
|
|
128
|
-
|
|
129
|
-
`registryOutcome` shipped in `13.0.0-next.4` and its type did not, so a consumer could read the
|
|
130
|
-
value and not name it — `function handle(o: RegistryOutcome)` did not compile. A union whose members
|
|
131
|
-
cannot be named is read as `string`, which loses every distinction it exists to make.
|
|
132
|
-
|
|
133
|
-
Third instance of the same omission (`AgentModule` in #663, `transcriptOf` in #668), and the third
|
|
134
|
-
found by installing the published package into an empty project rather than by reading the source.
|
|
135
|
-
|
|
136
|
-
## 13.0.0-next.4
|
|
137
|
-
|
|
138
|
-
### Minor Changes
|
|
139
|
-
|
|
140
|
-
- a7f4d3d: `deleteSession` stops reporting a registry removal it cannot confirm
|
|
141
|
-
|
|
142
|
-
`registryRemoved` was computed as `outcome !== false`, so a remover that resolved saying **nothing**
|
|
143
|
-
was reported as a removal. That is the shape `Agent.delete` has — `Promise<void>` — and below
|
|
144
|
-
`@theokit/sdk@5.3.1` it is what a no-op returns: measured in `4.52.1`, `removeRegisteredAgent`
|
|
145
|
-
mutates an in-memory map and schedules a save only when the entry was in it, while `delete` — unlike
|
|
146
|
-
`list` — never hydrates from disk. In any freshly started process the entry is not in memory, so the
|
|
147
|
-
call resolves having left `registry.json` untouched and throws nothing.
|
|
148
|
-
|
|
149
|
-
Breaking, inside the unreleased 13.0.0 line:
|
|
150
|
-
|
|
151
|
-
- `DeleteSessionResult.registryRemoved: boolean` is replaced by
|
|
152
|
-
`registryOutcome: 'removed' | 'nothing-to-remove' | 'unconfirmed' | 'failed' | 'not-attempted'`.
|
|
153
|
-
Renamed rather than retyped: `if (result.registryRemoved)` would have kept compiling while
|
|
154
|
-
silently changing which branch it took.
|
|
155
|
-
- `SessionInUseError.registryRemoved` becomes `registryOutcome`, and the refusal no longer advertises
|
|
156
|
-
"the registry entry was already removed" for a half it cannot confirm — it tells the caller to
|
|
157
|
-
verify instead.
|
|
158
|
-
|
|
159
|
-
`not-attempted` and `unconfirmed` are distinct on purpose: "nobody asked" and "we asked and got
|
|
160
|
-
silence" lead a caller to opposite actions, and the old boolean said `false` to both.
|
|
161
|
-
|
|
162
|
-
The declared SDK range is unchanged. `5.3.1` fixes the behaviour and not the signature — `delete`
|
|
163
|
-
still returns `Promise<void>` — so `unconfirmed` remains the honest answer on every admitted version,
|
|
164
|
-
and raising the floor is a separate decision that would make the removal happen without making it
|
|
165
|
-
reportable.
|
|
166
|
-
|
|
167
|
-
Closes usetheokit/theokit#675.
|
|
168
|
-
|
|
169
|
-
## 13.0.0-next.3
|
|
170
|
-
|
|
171
|
-
### Minor Changes
|
|
172
|
-
|
|
173
|
-
- 59d6dcc: A transcript nobody can read is listed without an id, and keeps its protection
|
|
174
|
-
|
|
175
|
-
`listSessions` fell back to the filename stem whenever the first record could not be read. Under
|
|
176
|
-
`@theokit/sdk` 5.x that stem is a one-way hash of the id, so the fallback did not return a degraded
|
|
177
|
-
id — it returned an identifier belonging to no session. Session GC keyed protection on it, so a
|
|
178
|
-
session someone had DECLARED protected lost its protection and was planned for deletion, while the
|
|
179
|
-
registry removal was called with the hash and left the real entry behind.
|
|
180
|
-
|
|
181
|
-
Protection now runs in the direction that has a function. `transcriptPath(root, cwd, id)` is total on
|
|
182
|
-
both majors and its inverse is not, so protection is keyed by transcript PATH and caller-supplied ids
|
|
183
|
-
are mapped forward onto paths. Whether a transcript can be read stops mattering to whether it is
|
|
184
|
-
protected.
|
|
185
|
-
|
|
186
|
-
Breaking, inside the unreleased 13.0.0 line:
|
|
187
|
-
|
|
188
|
-
- `SessionSummary.id` is `string | undefined`, alongside a new `idSource: 'transcript' | 'unavailable'`.
|
|
189
|
-
It is never derived from the filename.
|
|
190
|
-
- **`protectedTranscripts` is RENAMED to `protectedTranscriptPaths`, and the rename is the fix.** Its
|
|
191
|
-
keys changed from session ids to transcript paths while the signature stayed `Map<string, string>`,
|
|
192
|
-
so a consumer that mapped the keys forward through `transcriptPath` — correct when they were ids —
|
|
193
|
-
kept compiling and started double-mapping, leaving its protection array matching nothing. Measured
|
|
194
|
-
on a real consumer against this build: `deleteSession` collected a session holding a LIVE writer
|
|
195
|
-
lease. The old name is gone rather than aliased; a silent break that loses data is worse than a
|
|
196
|
-
loud one, and an alias would have preserved the silence. `transcriptOf(id, cwd, root)` maps forward
|
|
197
|
-
for callers that hold an id.
|
|
198
|
-
- `GCCandidate.id`, `GCKept.id` and `GCError.id` admit `undefined` for the same reason.
|
|
199
|
-
- `RunTranscriptGCResult` gains `orphaned` — transcripts collected whose session id could not be
|
|
200
|
-
read, by path. A separate list rather than a second meaning inside `removed`, which answers "which
|
|
201
|
-
sessions did I collect"; `theo sessions gc` reports both, and never prints a filename where an id
|
|
202
|
-
belongs.
|
|
203
|
-
|
|
204
|
-
Closes usetheokit/theokit#668.
|
|
205
|
-
|
|
206
3
|
## 13.0.0-next.2
|
|
207
4
|
|
|
208
5
|
### Minor Changes
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { InlineSkill, SystemPromptResolver, SettingSource, MemorySettings, SkillsSettings, ContextSettings } from '@theokit/sdk';
|
|
2
2
|
import { TheokitAgentError } from '@theokit/sdk/errors';
|
|
3
3
|
import { R as ReasoningEffort, a as MemoryOptions, P as ProjectContextOptions, M as McpServersMap, H as HumanInTheLoopOptions, C as CheckpointOptions, T as ToolOptions, A as ApprovalOptions, B as BudgetOptions } from './types-C16Wuh9E.js';
|
|
4
|
-
import { R as ResolvedCompatSource } from './setting-sources-gate-tadmHT0c.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* M9 (theokit-ai-first) — guardrail contract + typed errors.
|
|
@@ -98,58 +97,6 @@ type SkillsSelection = readonly (string | InlineSkill)[] | ((ctx: SkillsRequestC
|
|
|
98
97
|
*/
|
|
99
98
|
declare function resolveEnabledSkills(selection: SkillsSelection | undefined, ctx: SkillsRequestContext): Promise<string[] | undefined>;
|
|
100
99
|
|
|
101
|
-
/**
|
|
102
|
-
* Project the M8 fields from `CompiledAgentOptions` into `Agent.create()` arguments. Only the async
|
|
103
|
-
* `@ProjectContext` resolver is built here (it does I/O, so the compiler keeps it raw). `applied`
|
|
104
|
-
* lists which decorators contributed, for the observability log (wiring triad — runtime metric).
|
|
105
|
-
*/
|
|
106
|
-
/**
|
|
107
|
-
* #686 — a consumer's decision point before the SDK spawns a hook, forwarded to
|
|
108
|
-
* `Agent.create({ local: { hooks } })`.
|
|
109
|
-
*
|
|
110
|
-
* Declared here rather than imported: the SDK's `HookApprovalGate` landed in `5.4.0` and this
|
|
111
|
-
* package's floor is `^4.52.1`, so importing the type would refuse to build on every version below
|
|
112
|
-
* it. The shape is structural and small, which is the same reasoning `compatSources` already
|
|
113
|
-
* records — "a string union is declarable here".
|
|
114
|
-
*
|
|
115
|
-
* The SDK calls the option `hooks`. On this layer's authoring surface it is `hookApproval`, because
|
|
116
|
-
* `defineAgent({ hooks })` is already the LIFECYCLE seam and two different security-relevant things
|
|
117
|
-
* under one name is how a consumer configures the wrong one.
|
|
118
|
-
*/
|
|
119
|
-
interface HookApprovalGate {
|
|
120
|
-
readonly approve?: (request: HookApprovalRequest) => boolean | Promise<boolean>;
|
|
121
|
-
}
|
|
122
|
-
/** What the consumer is shown when asked to approve a hook. Mirrors the SDK's shape (5.4.0). */
|
|
123
|
-
interface HookApprovalRequest {
|
|
124
|
-
readonly command: string;
|
|
125
|
-
readonly event: string;
|
|
126
|
-
readonly sourcePath?: string;
|
|
127
|
-
readonly matcher?: string;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Refuses when the installed SDK cannot honour a declared hook gate.
|
|
131
|
-
*
|
|
132
|
-
* ## Why this THROWS where its `compatSources` sibling only warns
|
|
133
|
-
*
|
|
134
|
-
* That one guards a configuration source: ignored, the foreign root is not read, and the agent runs
|
|
135
|
-
* with less than was asked for. This one guards a SECURITY decision. Ignored, the agent runs with
|
|
136
|
-
* MORE than was asked for — every hook spawns unreviewed — while the consumer believes it is gated
|
|
137
|
-
* and stops looking. The consumer that reported #686 asked for the refusal in those words: they
|
|
138
|
-
* would rather have no gate than a silent one, because their `doctor` would otherwise publish a
|
|
139
|
-
* guarantee that is false on `@theokit/sdk@5.0.0`.
|
|
140
|
-
*
|
|
141
|
-
* ## Why an unreadable version is a refusal and not a shrug
|
|
142
|
-
*
|
|
143
|
-
* The sibling stays silent when it cannot read the version, and that is right for a diagnostic. Here
|
|
144
|
-
* "cannot tell" and "is gated" must not collapse: unproven is not proven, and this whole issue is
|
|
145
|
-
* one instance of that confusion. A bundled SDK that hides `package.json` gets an explicit refusal
|
|
146
|
-
* naming what it could not read, which is recoverable; a silent pass is not.
|
|
147
|
-
*/
|
|
148
|
-
declare class HookGateUnsupportedError extends TheokitAgentError {
|
|
149
|
-
readonly name = "HookGateUnsupportedError";
|
|
150
|
-
constructor(version: string | undefined);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
100
|
/**
|
|
154
101
|
* Agent compiler — transforms decorator metadata into SDK calls.
|
|
155
102
|
*
|
|
@@ -246,15 +193,7 @@ interface CompiledAgentOptions {
|
|
|
246
193
|
* Resolved at compile time by `resolveCompatSources`, exactly like `settingSources`: a value here
|
|
247
194
|
* can only hold a source some posture granted, so the adapter projects rather than decides.
|
|
248
195
|
*/
|
|
249
|
-
compatSources?: readonly
|
|
250
|
-
/**
|
|
251
|
-
* #686 — the consumer's pre-spawn approval gate, forwarded to `Agent.create({ local: { hooks } })`.
|
|
252
|
-
*
|
|
253
|
-
* Distinct from `hitl` (which gates TOOLS at run time) and from the lifecycle `plugins` below
|
|
254
|
-
* (which react to events). This one decides whether a hook declared in a config root — including
|
|
255
|
-
* a foreign dialect imported through `compatSources` — is spawned at all.
|
|
256
|
-
*/
|
|
257
|
-
hookApproval?: HookApprovalGate;
|
|
196
|
+
compatSources?: readonly string[];
|
|
258
197
|
/** Code `Plugin` objects forwarded to `Agent.create({ plugins })` (lifecycle-hook seam). */
|
|
259
198
|
plugins?: readonly unknown[];
|
|
260
199
|
tools: CompiledTool[];
|
|
@@ -299,4 +238,4 @@ interface CompiledAgentOptions {
|
|
|
299
238
|
skillsResolver?: SkillsSelection;
|
|
300
239
|
}
|
|
301
240
|
|
|
302
|
-
export { type CompiledAgentOptions as C, type Guardrail as G, type
|
|
241
|
+
export { type CompiledAgentOptions as C, type Guardrail as G, type SkillsSelection as S, type ToolWalkResult as T, type CompiledTool as a, CostBudgetExceededError as b, type GuardrailAction as c, type GuardrailPhase as d, type GuardrailResult as e, GuardrailViolationError as f, type SkillsRequestContext as g, type ToolboxWalkResult as h, compileTools as i, resolveEnabledSkills as r };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ExecutionContext } from '@theokit/http';
|
|
2
2
|
import { c as AgentOptions, T as ToolOptions, P as ProjectContextOptions, H as HumanInTheLoopOptions, R as ReasoningEffort, M as McpServersMap } from './types-C16Wuh9E.js';
|
|
3
|
-
import { C as CompiledAgentOptions, a as CompiledTool, G as Guardrail, S as SkillsSelection
|
|
3
|
+
import { C as CompiledAgentOptions, a as CompiledTool, G as Guardrail, S as SkillsSelection } from './agent-compiler-uhleFZj_.js';
|
|
4
4
|
import { SkillsSettings, ContextSettings, SystemPromptResolver, ModelSelection, PluginsSettings, Plugin, ProviderRoutingSettings, AgentDefinition as AgentDefinition$1, BudgetTracker, CustomTool, RunEventSink, MemorySettings } from '@theokit/sdk';
|
|
5
|
-
import { S as StreamEvent, f as ApprovalRequiredEvent, a4 as MaskError } from './delegation-scoring
|
|
5
|
+
import { S as StreamEvent, f as ApprovalRequiredEvent, a4 as MaskError } from './delegation-scoring--OiOTcAW.js';
|
|
6
6
|
import { RetryOptions } from '@theokit/sdk/retry';
|
|
7
7
|
import { SandboxPosture } from '@theokit/sdk/sandbox';
|
|
8
|
-
import { A as AgentDefinition } from './define-agent-
|
|
8
|
+
import { A as AgentDefinition, S as SettingSourcesSelection } from './define-agent-BL3jMyJi.js';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { H as HookHandlers } from './hook-handlers-Cw2FsnE5.js';
|
|
11
|
-
import { S as SettingSourcesSelection } from './setting-sources-gate-tadmHT0c.js';
|
|
12
11
|
import { WireChunk } from '@theokit/presenter/wire';
|
|
13
12
|
import { TheokitAgentError } from '@theokit/sdk/errors';
|
|
14
13
|
|
|
@@ -913,22 +912,6 @@ interface AgentBuilder<TInput extends z.ZodType | UnsetMarker = UnsetMarker, TMo
|
|
|
913
912
|
* whose `cwd` is its own deploy, false for an agent pointed at a repository someone else wrote.
|
|
914
913
|
*/
|
|
915
914
|
settingSources(selection: SettingSourcesSelection): AgentBuilder<TInput, TModel, TContext, TTools>;
|
|
916
|
-
/**
|
|
917
|
-
* #686 — decide whether a hook declared in a config root is spawned AT ALL, before it runs.
|
|
918
|
-
*
|
|
919
|
-
* The fluent twin of `defineAgent({ hookApproval })`. It exists because a consumer that builds
|
|
920
|
-
* through this chain had no way to reach the gate: `.use()` composes presets rather than sinking
|
|
921
|
-
* capabilities, and the definition reaches `streamAgentTurnInProcess` with `local` already
|
|
922
|
-
* assembled, so there was no downstream place to inject it either.
|
|
923
|
-
*
|
|
924
|
-
* Distinct from {@link AgentBuilder.hooks} below, which ATTACHES lifecycle hooks. This one decides
|
|
925
|
-
* whether hooks somebody ELSE declared — in `.theokit/`, or in a foreign dialect imported through
|
|
926
|
-
* `settingSources` — are allowed to run.
|
|
927
|
-
*
|
|
928
|
-
* Requires `@theokit/sdk >= 5.4.0`. Declaring it against an older SDK is refused at assembly
|
|
929
|
-
* rather than forwarded: a gate that silently does not gate is worse than none.
|
|
930
|
-
*/
|
|
931
|
-
hookApproval(gate: HookApprovalGate): AgentBuilder<TInput, TModel, TContext, TTools>;
|
|
932
915
|
/**
|
|
933
916
|
* M49 — enable the SDK's durable memory for this agent (`.theokit/memory/` in the run cwd:
|
|
934
917
|
* `Remember:` capture with secret redaction, auto-injected recall, memory tools). Takes the SDK's
|
package/dist/bridge.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export { c as APPROVAL_MODES, d as AfterToolCallContext, e as AgentBuilder, f as AgentDefinitionError, g as AgentExecutionContext, h as AgentManifest, A as AgentManifestEntry, i as AgentManifestSource, j as AgentManifestTool, b as AgentModule, k as AgentRoute, l as AgentRouteContext, m as AgentRunInfo, n as AgentsPluginOptions, o as ApiErrorContext, p as ApiErrorDecision, q as ApiErrorPolicy, r as ApprovalMode, a as ApprovalPosture, B as BeforeToolCallContext, u as CompiledContextWindow, v as ContextualTool, D as DefinitionOrThunk, w as DelegationTimeoutError, E as EphemeralAgent, L as LLMCallContext, M as McpApprovalSpec, x as McpFileError, y as McpRegistryConfig, z as McpRequestContext, F as McpSelection, P as ProcessInputContext, G as SdkAgentHandle, I as SdkMessage, J as SdkSendOptions, K as SdkTurnHandle, N as Segment, O as ShouldAutoApproveOptions, T as ToolCallVeto, Q as ToolHooks, R as ToolHooksPlugin, W as WRITE_SCOPED_TOOLS, U as agentsPlugin, V as applyPosture, X as buildModelSelection, Y as compileAgentModule, Z as compileContextWindow, _ as compileLoadedAgentModule, $ as compileProjectContext, a0 as compileSkills, a1 as createAgentExecutionContext, a2 as createApiErrorHandler, a3 as createSdkAgentStream, a4 as createThinkTagExtractor, a5 as createToolHooksPlugin, a6 as extractThinkTagStream, a7 as generateAgentManifest, a8 as generateAgentRoutes, a9 as isAgentContext, aa as loadMcpJson, ab as mcpRegistry, ac as mcpToolApprovals, ad as projectContextMetadataOnlyKnobs, ae as reasoningEffortOf, af as resolveMcpServers, ag as runWithApiErrorHandling, ah as shouldAutoApprove, s as streamAgentUIMessages, ai as toAgentFactory, aj as translateSdkEvent, ak as withClockCap, al as withEphemeralAgent } from './bridge-entry
|
|
2
|
-
export { C as CompiledAgentOptions, a as CompiledTool,
|
|
3
|
-
export { A as AgentStopReason, d as AgentStreamEvent, e as AgentTurnMetadata, f as ApprovalRequiredEvent, g as ArtifactChunkEvent, h as ArtifactStartEvent, B as BackgroundDelegation, i as BudgetExceededError, C as CheckpointSavedEvent, k as DelegateFn, a as DelegateOptions, l as DelegationBudgetExceededError, m as DelegationError, n as DelegationPort, c as DelegationResult, D as DelegationTarget, o as DoneEvent, E as ErrorEvent, F as FileEditEvent, I as IterationEvent, P as PartialToolCallEvent, v as RunStartedEvent, w as ScoreVerdict, x as ScoredDelegation, y as Scorer, z as StateUpdateEvent, S as StreamEvent, T as TextDeltaEvent, G as ThinkingEvent, H as ToolCallEvent, J as ToolResultEvent, K as delegate, M as delegateBackground, N as delegateWithScoring, O as isApprovalRequired, Q as isDone, U as isError, V as isPartialToolCall, W as isTextDelta, X as isToolCall, Y as isToolResult, a0 as presentUIMessageStream, a3 as streamAgentResponse } from './delegation-scoring
|
|
4
|
-
export { a as AGENT_BRAND, A as AgentDefinition, D as DefineAgentConfig, I as InferAgentInput, b as InferAgentToolNames, c as compileAgentDefinition, i as isAgentDefinition } from './define-agent-
|
|
5
|
-
export { C as CompatSurface, P as ProjectSettingsGrant, R as ResolvedCompatSource, a as SettingSourceCapability, S as SettingSourcesSelection, U as UntrustedSettingSourceError, r as resolveCompatSources, b as resolveSettingSources } from './setting-sources-gate-tadmHT0c.js';
|
|
1
|
+
export { c as APPROVAL_MODES, d as AfterToolCallContext, e as AgentBuilder, f as AgentDefinitionError, g as AgentExecutionContext, h as AgentManifest, A as AgentManifestEntry, i as AgentManifestSource, j as AgentManifestTool, b as AgentModule, k as AgentRoute, l as AgentRouteContext, m as AgentRunInfo, n as AgentsPluginOptions, o as ApiErrorContext, p as ApiErrorDecision, q as ApiErrorPolicy, r as ApprovalMode, a as ApprovalPosture, B as BeforeToolCallContext, u as CompiledContextWindow, v as ContextualTool, D as DefinitionOrThunk, w as DelegationTimeoutError, E as EphemeralAgent, L as LLMCallContext, M as McpApprovalSpec, x as McpFileError, y as McpRegistryConfig, z as McpRequestContext, F as McpSelection, P as ProcessInputContext, G as SdkAgentHandle, I as SdkMessage, J as SdkSendOptions, K as SdkTurnHandle, N as Segment, O as ShouldAutoApproveOptions, T as ToolCallVeto, Q as ToolHooks, R as ToolHooksPlugin, W as WRITE_SCOPED_TOOLS, U as agentsPlugin, V as applyPosture, X as buildModelSelection, Y as compileAgentModule, Z as compileContextWindow, _ as compileLoadedAgentModule, $ as compileProjectContext, a0 as compileSkills, a1 as createAgentExecutionContext, a2 as createApiErrorHandler, a3 as createSdkAgentStream, a4 as createThinkTagExtractor, a5 as createToolHooksPlugin, a6 as extractThinkTagStream, a7 as generateAgentManifest, a8 as generateAgentRoutes, a9 as isAgentContext, aa as loadMcpJson, ab as mcpRegistry, ac as mcpToolApprovals, ad as projectContextMetadataOnlyKnobs, ae as reasoningEffortOf, af as resolveMcpServers, ag as runWithApiErrorHandling, ah as shouldAutoApprove, s as streamAgentUIMessages, ai as toAgentFactory, aj as translateSdkEvent, ak as withClockCap, al as withEphemeralAgent } from './bridge-entry--4VYlECy.js';
|
|
2
|
+
export { C as CompiledAgentOptions, a as CompiledTool, T as ToolWalkResult, h as ToolboxWalkResult, i as compileTools } from './agent-compiler-uhleFZj_.js';
|
|
3
|
+
export { A as AgentStopReason, d as AgentStreamEvent, e as AgentTurnMetadata, f as ApprovalRequiredEvent, g as ArtifactChunkEvent, h as ArtifactStartEvent, B as BackgroundDelegation, i as BudgetExceededError, C as CheckpointSavedEvent, k as DelegateFn, a as DelegateOptions, l as DelegationBudgetExceededError, m as DelegationError, n as DelegationPort, c as DelegationResult, D as DelegationTarget, o as DoneEvent, E as ErrorEvent, F as FileEditEvent, I as IterationEvent, P as PartialToolCallEvent, v as RunStartedEvent, w as ScoreVerdict, x as ScoredDelegation, y as Scorer, z as StateUpdateEvent, S as StreamEvent, T as TextDeltaEvent, G as ThinkingEvent, H as ToolCallEvent, J as ToolResultEvent, K as delegate, M as delegateBackground, N as delegateWithScoring, O as isApprovalRequired, Q as isDone, U as isError, V as isPartialToolCall, W as isTextDelta, X as isToolCall, Y as isToolResult, a0 as presentUIMessageStream, a3 as streamAgentResponse } from './delegation-scoring--OiOTcAW.js';
|
|
4
|
+
export { a as AGENT_BRAND, A as AgentDefinition, D as DefineAgentConfig, I as InferAgentInput, b as InferAgentToolNames, P as ProjectSettingsGrant, c as SettingSourceCapability, S as SettingSourcesSelection, U as UntrustedSettingSourceError, d as compileAgentDefinition, i as isAgentDefinition, r as resolveCompatSources, e as resolveSettingSources } from './define-agent-BL3jMyJi.js';
|
|
6
5
|
import '@theokit/http';
|
|
7
6
|
import './types-C16Wuh9E.js';
|
|
8
7
|
import '@theokit/sdk';
|
package/dist/bridge.js
CHANGED
|
@@ -29,14 +29,13 @@ import {
|
|
|
29
29
|
runWithApiErrorHandling,
|
|
30
30
|
streamAgentResponse,
|
|
31
31
|
streamAgentUIMessages
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-LTPL32XW.js";
|
|
33
33
|
import {
|
|
34
34
|
APPROVAL_MODES,
|
|
35
35
|
BudgetExceededError,
|
|
36
36
|
DelegationBudgetExceededError,
|
|
37
37
|
DelegationError,
|
|
38
38
|
DelegationTimeoutError,
|
|
39
|
-
HookGateUnsupportedError,
|
|
40
39
|
WRITE_SCOPED_TOOLS,
|
|
41
40
|
applyPosture,
|
|
42
41
|
buildModelSelection,
|
|
@@ -55,7 +54,7 @@ import {
|
|
|
55
54
|
translateSdkEvent,
|
|
56
55
|
withClockCap,
|
|
57
56
|
withEphemeralAgent
|
|
58
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-GHRHJPJS.js";
|
|
59
58
|
import "./chunk-RKWCXVYG.js";
|
|
60
59
|
import {
|
|
61
60
|
AGENT_BRAND,
|
|
@@ -64,7 +63,7 @@ import {
|
|
|
64
63
|
isAgentDefinition,
|
|
65
64
|
resolveCompatSources,
|
|
66
65
|
resolveSettingSources
|
|
67
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-OAQEWLQJ.js";
|
|
68
67
|
import "./chunk-OXNDJSAJ.js";
|
|
69
68
|
import "./chunk-Z4QWC7IK.js";
|
|
70
69
|
export {
|
|
@@ -77,7 +76,6 @@ export {
|
|
|
77
76
|
DelegationBudgetExceededError,
|
|
78
77
|
DelegationError,
|
|
79
78
|
DelegationTimeoutError,
|
|
80
|
-
HookGateUnsupportedError,
|
|
81
79
|
McpFileError,
|
|
82
80
|
UntrustedSettingSourceError,
|
|
83
81
|
WRITE_SCOPED_TOOLS,
|