@tangle-network/agent-app 0.1.3 → 0.1.4
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/dist/chunk-5RV6CAHZ.js +137 -0
- package/dist/chunk-5RV6CAHZ.js.map +1 -0
- package/dist/{chunk-7P6VIHI4.js → chunk-AQ2BOPOQ.js} +8 -2
- package/dist/{chunk-7P6VIHI4.js.map → chunk-AQ2BOPOQ.js.map} +1 -1
- package/dist/chunk-EEPJGZJW.js +102 -0
- package/dist/chunk-EEPJGZJW.js.map +1 -0
- package/dist/chunk-EZXN67KE.js +318 -0
- package/dist/chunk-EZXN67KE.js.map +1 -0
- package/dist/config/index.d.ts +367 -0
- package/dist/config/index.js +9 -0
- package/dist/config/index.js.map +1 -0
- package/dist/delegation/index.d.ts +16 -1
- package/dist/delegation/index.js +5 -3
- package/dist/index.d.ts +7 -2
- package/dist/index.js +39 -5
- package/dist/knowledge-loop/index.d.ts +208 -0
- package/dist/knowledge-loop/index.js +11 -0
- package/dist/knowledge-loop/index.js.map +1 -0
- package/dist/model-BOP69mVu.d.ts +35 -0
- package/dist/preset-cloudflare/index.d.ts +244 -0
- package/dist/preset-cloudflare/index.js +23 -0
- package/dist/preset-cloudflare/index.js.map +1 -0
- package/dist/runtime/index.d.ts +2 -35
- package/package.json +31 -5
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { KnowledgeRequirementSpec } from '../knowledge/index.js';
|
|
2
|
+
export { SatisfiedByRule } from '../knowledge/index.js';
|
|
3
|
+
import { T as TangleModelConfig } from '../model-BOP69mVu.js';
|
|
4
|
+
import '@tangle-network/agent-eval';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `@tangle-network/agent-app/config` — the typed `AgentAppConfig` contract.
|
|
8
|
+
*
|
|
9
|
+
* This is the single declarative DATA surface a coding agent fills to stand up a
|
|
10
|
+
* new agent product. Everything an agent product otherwise hand-rolls as
|
|
11
|
+
* imperative wiring — who the agent is, which proposal types exist and which are
|
|
12
|
+
* approval-gated, what knowledge the control loop requires, which integrations
|
|
13
|
+
* are connectable, how the model resolves — is expressed here as plain data the
|
|
14
|
+
* rest of agent-app's modules consume through their typed seams:
|
|
15
|
+
*
|
|
16
|
+
* - `identity` → the system-prompt + disclaimer surface the chat pipeline reads.
|
|
17
|
+
* - `taxonomy` → which `submit_proposal` types the `./tools` side channel
|
|
18
|
+
* accepts, and which the approval queue treats as regulated
|
|
19
|
+
* (certified-human-gated).
|
|
20
|
+
* - `knowledge` → the `./knowledge` requirement specs that gate the loop, plus
|
|
21
|
+
* the acquisition-loop goal/threshold the researcher pursues.
|
|
22
|
+
* - `integrations` → which `@tangle-network/agent-integrations` catalog kinds the
|
|
23
|
+
* product enables.
|
|
24
|
+
* - `ui` → whether the agent may emit generated UI (`render_ui`).
|
|
25
|
+
* - `model` → the `./runtime` `TangleModelConfig` (or null to resolve from env).
|
|
26
|
+
*
|
|
27
|
+
* Layering: this module is the CONTRACT only — pure types + an identity helper.
|
|
28
|
+
* It introduces no behavior and no engine dependency; it REUSES the existing
|
|
29
|
+
* `KnowledgeRequirementSpec`/`SatisfiedByRule` (from `../knowledge`) and
|
|
30
|
+
* `TangleModelConfig` (from `../runtime`) rather than redefining them, so the
|
|
31
|
+
* config a product authors is the exact shape those modules already consume.
|
|
32
|
+
* Steps that build the composer/loader read this file as the schema floor.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Who the agent is, as data. Composed into the chat pipeline's system prompt;
|
|
37
|
+
* never baked into agent-app (a domain value, per the layering contract).
|
|
38
|
+
*/
|
|
39
|
+
interface AgentIdentityConfig {
|
|
40
|
+
/** Product/agent name, e.g. `"WinFinance Ops Partner"`. Shown to the user and
|
|
41
|
+
* available to the system-prompt builder. */
|
|
42
|
+
name: string;
|
|
43
|
+
/** One-paragraph persona statement — the agent's role, voice, and remit. The
|
|
44
|
+
* spine of the system prompt. */
|
|
45
|
+
persona: string;
|
|
46
|
+
/** Additional system-prompt fragments appended verbatim after the persona
|
|
47
|
+
* (standing workflows, hard rules, tone). Order is preserved. Optional. */
|
|
48
|
+
systemPromptFragments?: string[];
|
|
49
|
+
/** Named disclaimers the product surfaces (e.g. a regulatory human-in-the-loop
|
|
50
|
+
* notice). Keyed by a stable id (`compliance`, `not-advice`, …) so the chat
|
|
51
|
+
* pipeline / UI can select one by name. Values are the literal text. Optional. */
|
|
52
|
+
disclaimers?: Record<string, string>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The proposal taxonomy, as data. `proposalTypes` is the closed set of
|
|
56
|
+
* `submit_proposal` types the `./tools` side channel accepts; `regulatedTypes`
|
|
57
|
+
* is the subset that is approval-gated — the executor refuses to run one without
|
|
58
|
+
* a certified human approver. `regulatedTypes` MUST be a subset of
|
|
59
|
+
* `proposalTypes` (validated by the loader step; not enforced at the type level).
|
|
60
|
+
*/
|
|
61
|
+
interface AgentTaxonomyConfig {
|
|
62
|
+
/** Every proposal type this product can emit, e.g.
|
|
63
|
+
* `['propose_swap', 'contact_lead', 'policy_change']`. The closed allow-list
|
|
64
|
+
* the tool layer validates a `submit_proposal` call against. */
|
|
65
|
+
proposalTypes: string[];
|
|
66
|
+
/** The subset of `proposalTypes` that is regulated → cannot execute without a
|
|
67
|
+
* certified-human approver. The approval executor reads this to decide which
|
|
68
|
+
* proposals are fail-loud certified-gated. */
|
|
69
|
+
regulatedTypes: string[];
|
|
70
|
+
}
|
|
71
|
+
/** A knowledge source the acquisition loop / researcher may draw on. */
|
|
72
|
+
interface KnowledgeSourceSpec {
|
|
73
|
+
/** Where the source lives — a URL, a `vault://` path, an integration ref, etc.
|
|
74
|
+
* Opaque to agent-app; the consumer's loader resolves it. */
|
|
75
|
+
uri: string;
|
|
76
|
+
/** Optional source classifier the researcher uses to pick a fetch strategy,
|
|
77
|
+
* e.g. `'web'`, `'vault'`, `'regulation'`, `'integration'`. Free-form. */
|
|
78
|
+
kind?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The knowledge-acquisition loop config — the goal the researcher pursues and
|
|
82
|
+
* the gate it must clear before the loop is considered satisfied. All optional;
|
|
83
|
+
* a product with only static requirement specs omits it.
|
|
84
|
+
*/
|
|
85
|
+
interface KnowledgeLoopConfig {
|
|
86
|
+
/** The acquisition goal in natural language, e.g.
|
|
87
|
+
* `"ground every quoted premium against a real policy record"`. */
|
|
88
|
+
goal?: string;
|
|
89
|
+
/** The minimum aggregate confidence [0, 1] the loop must reach to pass its
|
|
90
|
+
* gate. The runtime control loop blocks below this. Default decided by the
|
|
91
|
+
* consumer's loop wiring when omitted. */
|
|
92
|
+
minConfidence?: number;
|
|
93
|
+
/** How fresh acquired knowledge must be, e.g. `'static'`, `'7d'`, `'session'`.
|
|
94
|
+
* Free-form; the consumer's loop interprets it. */
|
|
95
|
+
freshness?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The knowledge surface, as data. `sources` are what the researcher may read;
|
|
99
|
+
* `requirements` are the declarative `./knowledge` specs that gate the control
|
|
100
|
+
* loop (reused verbatim — the same `KnowledgeRequirementSpec` the gate scores);
|
|
101
|
+
* `loop` configures the acquisition pass.
|
|
102
|
+
*/
|
|
103
|
+
interface AgentKnowledgeConfig {
|
|
104
|
+
/** Sources the acquisition loop / researcher may draw on. */
|
|
105
|
+
sources: KnowledgeSourceSpec[];
|
|
106
|
+
/** The declarative requirement specs that gate the loop. Reuses
|
|
107
|
+
* `KnowledgeRequirementSpec` from `../knowledge` — `buildKnowledgeRequirements`
|
|
108
|
+
* + `deriveSignals` consume these directly. */
|
|
109
|
+
requirements: KnowledgeRequirementSpec[];
|
|
110
|
+
/** Optional acquisition-loop config (goal + confidence gate + freshness). */
|
|
111
|
+
loop?: KnowledgeLoopConfig;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Which integrations the product enables, as data. `enabled` lists
|
|
115
|
+
* `@tangle-network/agent-integrations` catalog kinds the product connects
|
|
116
|
+
* (e.g. `['shurens', 'lead-crm', 'whatsapp']`); the integration hub resolves
|
|
117
|
+
* each to a connector. Strings, not connector objects — agent-app bakes no
|
|
118
|
+
* catalog value.
|
|
119
|
+
*/
|
|
120
|
+
interface AgentIntegrationsConfig {
|
|
121
|
+
/** Catalog kinds this product enables. */
|
|
122
|
+
enabled: string[];
|
|
123
|
+
}
|
|
124
|
+
/** UI capability flags, as data. */
|
|
125
|
+
interface AgentUiConfig {
|
|
126
|
+
/** Whether the agent may emit generated UI (the `render_ui` / OpenUI side
|
|
127
|
+
* channel). When false/omitted, the tool layer can omit/refuse the tool.
|
|
128
|
+
* Default behavior decided by the consumer; omit to leave unset. */
|
|
129
|
+
generatedUi?: boolean;
|
|
130
|
+
}
|
|
131
|
+
/** Background-agent / delegated-loop capability, as data. */
|
|
132
|
+
interface AgentDelegationConfig {
|
|
133
|
+
/** When true, the app's own agent may spawn `delegate_research` /
|
|
134
|
+
* `delegate_code` loops that run to completion in their OWN sandbox and
|
|
135
|
+
* return the artifact (the `../delegation` driven-loop MCP). Sandbox-path
|
|
136
|
+
* ONLY — the browser/edge path ignores it. Wired via the existing
|
|
137
|
+
* `buildDelegationMcpServer`; never reimplemented. */
|
|
138
|
+
enabled?: boolean;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The declarative domain surface of a Tangle agent product.
|
|
142
|
+
*
|
|
143
|
+
* A coding agent fills THIS object and nothing else to define a product's
|
|
144
|
+
* identity, proposal taxonomy, knowledge gate, integrations, UI capability, and
|
|
145
|
+
* model. Every field is DATA consumed by an agent-app module through its typed
|
|
146
|
+
* seam — no field is behavior. Author it through {@link defineAgentApp} for
|
|
147
|
+
* autocomplete and a single import.
|
|
148
|
+
*/
|
|
149
|
+
interface AgentAppConfig {
|
|
150
|
+
/** Who the agent is — name, persona, system-prompt fragments, disclaimers. */
|
|
151
|
+
identity: AgentIdentityConfig;
|
|
152
|
+
/** Proposal types + which are regulated/approval-gated. */
|
|
153
|
+
taxonomy: AgentTaxonomyConfig;
|
|
154
|
+
/** Knowledge sources, requirement specs (the loop gate), and loop config. */
|
|
155
|
+
knowledge: AgentKnowledgeConfig;
|
|
156
|
+
/** Enabled integration catalog kinds. */
|
|
157
|
+
integrations: AgentIntegrationsConfig;
|
|
158
|
+
/** UI capability flags. Optional. */
|
|
159
|
+
ui?: AgentUiConfig;
|
|
160
|
+
/** Background-agent / delegated-loop capability (sandbox path). Optional. */
|
|
161
|
+
delegation?: AgentDelegationConfig;
|
|
162
|
+
/** The resolved model config (`../runtime`'s `TangleModelConfig`). Omit to
|
|
163
|
+
* resolve from env at boot via `resolveTangleModelConfig`. */
|
|
164
|
+
model?: TangleModelConfig;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Identity helper: returns its argument unchanged, but anchors inference so a
|
|
168
|
+
* coding agent authoring a config gets full autocomplete + type-checking from a
|
|
169
|
+
* single import. The canonical way to declare a product config:
|
|
170
|
+
*
|
|
171
|
+
* ```ts
|
|
172
|
+
* import { defineAgentApp } from '@tangle-network/agent-app/config'
|
|
173
|
+
*
|
|
174
|
+
* export const config = defineAgentApp({
|
|
175
|
+
* identity: { name: 'WinFinance', persona: '…' },
|
|
176
|
+
* taxonomy: { proposalTypes: ['propose_swap'], regulatedTypes: ['propose_swap'] },
|
|
177
|
+
* knowledge: { sources: [], requirements: [] },
|
|
178
|
+
* integrations: { enabled: ['shurens'] },
|
|
179
|
+
* })
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
declare function defineAgentApp<const T extends AgentAppConfig>(config: T): T;
|
|
183
|
+
/**
|
|
184
|
+
* Machine-readable JSON Schema (draft 2020-12) for {@link AgentAppConfig}.
|
|
185
|
+
*
|
|
186
|
+
* The schema FLOOR a non-TypeScript coding agent (or a config validator/UI) reads
|
|
187
|
+
* to know the shape without parsing the `.d.ts`. Kept in lockstep with the
|
|
188
|
+
* interfaces above by the config test, which asserts the documented fields are
|
|
189
|
+
* present. `KnowledgeRequirementSpec`'s full sub-shape is intentionally left
|
|
190
|
+
* `additionalProperties: true` here — its authoritative definition lives in
|
|
191
|
+
* `../knowledge`; this floor pins only the fields the config contract owns.
|
|
192
|
+
*/
|
|
193
|
+
declare const agentAppConfigJsonSchema: {
|
|
194
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
195
|
+
readonly $id: "https://tangle.tools/schemas/agent-app-config.json";
|
|
196
|
+
readonly title: "AgentAppConfig";
|
|
197
|
+
readonly description: "The declarative domain surface of a Tangle agent product.";
|
|
198
|
+
readonly type: "object";
|
|
199
|
+
readonly additionalProperties: false;
|
|
200
|
+
readonly required: readonly ["identity", "taxonomy", "knowledge", "integrations"];
|
|
201
|
+
readonly properties: {
|
|
202
|
+
readonly identity: {
|
|
203
|
+
readonly type: "object";
|
|
204
|
+
readonly additionalProperties: false;
|
|
205
|
+
readonly required: readonly ["name", "persona"];
|
|
206
|
+
readonly properties: {
|
|
207
|
+
readonly name: {
|
|
208
|
+
readonly type: "string";
|
|
209
|
+
readonly description: "Product/agent name.";
|
|
210
|
+
};
|
|
211
|
+
readonly persona: {
|
|
212
|
+
readonly type: "string";
|
|
213
|
+
readonly description: "One-paragraph persona — the system-prompt spine.";
|
|
214
|
+
};
|
|
215
|
+
readonly systemPromptFragments: {
|
|
216
|
+
readonly type: "array";
|
|
217
|
+
readonly items: {
|
|
218
|
+
readonly type: "string";
|
|
219
|
+
};
|
|
220
|
+
readonly description: "Verbatim system-prompt fragments appended after the persona, in order.";
|
|
221
|
+
};
|
|
222
|
+
readonly disclaimers: {
|
|
223
|
+
readonly type: "object";
|
|
224
|
+
readonly additionalProperties: {
|
|
225
|
+
readonly type: "string";
|
|
226
|
+
};
|
|
227
|
+
readonly description: "Named disclaimers keyed by stable id; values are literal text.";
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
readonly taxonomy: {
|
|
232
|
+
readonly type: "object";
|
|
233
|
+
readonly additionalProperties: false;
|
|
234
|
+
readonly required: readonly ["proposalTypes", "regulatedTypes"];
|
|
235
|
+
readonly properties: {
|
|
236
|
+
readonly proposalTypes: {
|
|
237
|
+
readonly type: "array";
|
|
238
|
+
readonly items: {
|
|
239
|
+
readonly type: "string";
|
|
240
|
+
};
|
|
241
|
+
readonly description: "Closed allow-list of proposal types the product can emit.";
|
|
242
|
+
};
|
|
243
|
+
readonly regulatedTypes: {
|
|
244
|
+
readonly type: "array";
|
|
245
|
+
readonly items: {
|
|
246
|
+
readonly type: "string";
|
|
247
|
+
};
|
|
248
|
+
readonly description: "Subset of proposalTypes that is approval-gated (certified-human required).";
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
readonly knowledge: {
|
|
253
|
+
readonly type: "object";
|
|
254
|
+
readonly additionalProperties: false;
|
|
255
|
+
readonly required: readonly ["sources", "requirements"];
|
|
256
|
+
readonly properties: {
|
|
257
|
+
readonly sources: {
|
|
258
|
+
readonly type: "array";
|
|
259
|
+
readonly description: "Sources the acquisition loop may draw on.";
|
|
260
|
+
readonly items: {
|
|
261
|
+
readonly type: "object";
|
|
262
|
+
readonly additionalProperties: false;
|
|
263
|
+
readonly required: readonly ["uri"];
|
|
264
|
+
readonly properties: {
|
|
265
|
+
readonly uri: {
|
|
266
|
+
readonly type: "string";
|
|
267
|
+
readonly description: "Where the source lives (opaque to agent-app).";
|
|
268
|
+
};
|
|
269
|
+
readonly kind: {
|
|
270
|
+
readonly type: "string";
|
|
271
|
+
readonly description: "Optional source classifier (web/vault/regulation/…).";
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
readonly requirements: {
|
|
277
|
+
readonly type: "array";
|
|
278
|
+
readonly description: "Declarative KnowledgeRequirementSpec[] (../knowledge) that gate the loop.";
|
|
279
|
+
readonly items: {
|
|
280
|
+
readonly type: "object";
|
|
281
|
+
readonly additionalProperties: true;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
readonly loop: {
|
|
285
|
+
readonly type: "object";
|
|
286
|
+
readonly additionalProperties: false;
|
|
287
|
+
readonly description: "Acquisition-loop config.";
|
|
288
|
+
readonly properties: {
|
|
289
|
+
readonly goal: {
|
|
290
|
+
readonly type: "string";
|
|
291
|
+
readonly description: "Acquisition goal in natural language.";
|
|
292
|
+
};
|
|
293
|
+
readonly minConfidence: {
|
|
294
|
+
readonly type: "number";
|
|
295
|
+
readonly minimum: 0;
|
|
296
|
+
readonly maximum: 1;
|
|
297
|
+
readonly description: "Minimum aggregate confidence the loop must reach.";
|
|
298
|
+
};
|
|
299
|
+
readonly freshness: {
|
|
300
|
+
readonly type: "string";
|
|
301
|
+
readonly description: "How fresh acquired knowledge must be.";
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
readonly integrations: {
|
|
308
|
+
readonly type: "object";
|
|
309
|
+
readonly additionalProperties: false;
|
|
310
|
+
readonly required: readonly ["enabled"];
|
|
311
|
+
readonly properties: {
|
|
312
|
+
readonly enabled: {
|
|
313
|
+
readonly type: "array";
|
|
314
|
+
readonly items: {
|
|
315
|
+
readonly type: "string";
|
|
316
|
+
};
|
|
317
|
+
readonly description: "Enabled agent-integrations catalog kinds.";
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
readonly ui: {
|
|
322
|
+
readonly type: "object";
|
|
323
|
+
readonly additionalProperties: false;
|
|
324
|
+
readonly description: "UI capability flags.";
|
|
325
|
+
readonly properties: {
|
|
326
|
+
readonly generatedUi: {
|
|
327
|
+
readonly type: "boolean";
|
|
328
|
+
readonly description: "Whether the agent may emit generated UI.";
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
readonly delegation: {
|
|
333
|
+
readonly type: "object";
|
|
334
|
+
readonly additionalProperties: false;
|
|
335
|
+
readonly description: "Background-agent / delegated-loop capability (sandbox path).";
|
|
336
|
+
readonly properties: {
|
|
337
|
+
readonly enabled: {
|
|
338
|
+
readonly type: "boolean";
|
|
339
|
+
readonly description: "Whether the agent may spawn delegate_research/delegate_code loops.";
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
readonly model: {
|
|
344
|
+
readonly type: "object";
|
|
345
|
+
readonly additionalProperties: false;
|
|
346
|
+
readonly description: "Resolved TangleModelConfig (../runtime). Omit to resolve from env.";
|
|
347
|
+
readonly required: readonly ["provider", "model", "apiKey", "baseUrl"];
|
|
348
|
+
readonly properties: {
|
|
349
|
+
readonly provider: {
|
|
350
|
+
readonly type: "string";
|
|
351
|
+
readonly enum: readonly ["openai-compat", "anthropic"];
|
|
352
|
+
};
|
|
353
|
+
readonly model: {
|
|
354
|
+
readonly type: "string";
|
|
355
|
+
};
|
|
356
|
+
readonly apiKey: {
|
|
357
|
+
readonly type: "string";
|
|
358
|
+
};
|
|
359
|
+
readonly baseUrl: {
|
|
360
|
+
readonly type: "string";
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
export { type AgentAppConfig, type AgentDelegationConfig, type AgentIdentityConfig, type AgentIntegrationsConfig, type AgentKnowledgeConfig, type AgentTaxonomyConfig, type AgentUiConfig, type KnowledgeLoopConfig, KnowledgeRequirementSpec, type KnowledgeSourceSpec, TangleModelConfig, agentAppConfigJsonSchema, defineAgentApp };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -46,5 +46,20 @@ interface BuildDelegationOptions {
|
|
|
46
46
|
* const mcp = { ...(delegation ? { [DELEGATION_MCP_SERVER_KEY]: delegation } : {}) }
|
|
47
47
|
*/
|
|
48
48
|
declare function buildDelegationMcpServer(opts: BuildDelegationOptions): DelegationMcpServer | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Config-driven wiring: returns the delegation MCP entry keyed under
|
|
51
|
+
* {@link DELEGATION_MCP_SERVER_KEY} when the product's `config.delegation.enabled`
|
|
52
|
+
* is true (and a platform key is available), else an empty object. Spread the
|
|
53
|
+
* result directly into the sandbox profile's `mcp` map — this is the seam
|
|
54
|
+
* `agent.config.delegation` flows through, so a coding agent toggles background
|
|
55
|
+
* agents/loops by flipping one boolean, never by wiring the MCP by hand.
|
|
56
|
+
*
|
|
57
|
+
* const mcp = { ...rest, ...delegationMcpForConfig(config, { apiKey: env.TANGLE_API_KEY, forwardEnv: env }) }
|
|
58
|
+
*/
|
|
59
|
+
declare function delegationMcpForConfig(config: {
|
|
60
|
+
delegation?: {
|
|
61
|
+
enabled?: boolean;
|
|
62
|
+
};
|
|
63
|
+
}, opts: BuildDelegationOptions): Record<string, DelegationMcpServer>;
|
|
49
64
|
|
|
50
|
-
export { type BuildDelegationOptions, DELEGATION_MCP_SERVER_KEY, DELEGATION_TOOLS, type DelegationMcpServer, buildDelegationMcpServer };
|
|
65
|
+
export { type BuildDelegationOptions, DELEGATION_MCP_SERVER_KEY, DELEGATION_TOOLS, type DelegationMcpServer, buildDelegationMcpServer, delegationMcpForConfig };
|
package/dist/delegation/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DELEGATION_MCP_SERVER_KEY,
|
|
3
3
|
DELEGATION_TOOLS,
|
|
4
|
-
buildDelegationMcpServer
|
|
5
|
-
|
|
4
|
+
buildDelegationMcpServer,
|
|
5
|
+
delegationMcpForConfig
|
|
6
|
+
} from "../chunk-AQ2BOPOQ.js";
|
|
6
7
|
export {
|
|
7
8
|
DELEGATION_MCP_SERVER_KEY,
|
|
8
9
|
DELEGATION_TOOLS,
|
|
9
|
-
buildDelegationMcpServer
|
|
10
|
+
buildDelegationMcpServer,
|
|
11
|
+
delegationMcpForConfig
|
|
10
12
|
};
|
|
11
13
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export { APP_TOOL_NAMES, AppToolMcpServer, AppToolName, AppToolRuntimeExecutor, AuthenticateOptions, BuildHttpMcpServerOptions, BuildMcpServerOptions, CapabilityTokenOptions, DEFAULT_APP_TOOL_PATHS, DEFAULT_HEADER_NAMES, DispatchOptions, HandleToolRequestOptions, OpenAIFunctionTool, RuntimeExecutorOptions, ToolAuthResult, ToolHeaderNames, ToolInputError, authenticateToolRequest, buildAppToolMcpServer, buildAppToolOpenAITools, buildHttpMcpServer, createAppToolRuntimeExecutor, createCapabilityToken, dispatchAppTool, handleAppToolRequest, isAppToolName, outcomeStatus, readToolArgs, verifyCapabilityToken } from './tools/index.js';
|
|
2
2
|
export { A as AddCitationArgs, a as AddCitationResult, b as AppToolContext, c as AppToolHandlers, d as AppToolOutcome, e as AppToolProducedEvent, f as AppToolTaxonomy, R as RenderUiArgs, g as RenderUiResult, S as ScheduleFollowupArgs, h as ScheduleFollowupResult, i as SubmitProposalArgs, j as SubmitProposalResult } from './types-CeWor4bQ.js';
|
|
3
|
-
export { BuildDelegationOptions, DELEGATION_MCP_SERVER_KEY, DELEGATION_TOOLS, DelegationMcpServer, buildDelegationMcpServer } from './delegation/index.js';
|
|
3
|
+
export { BuildDelegationOptions, DELEGATION_MCP_SERVER_KEY, DELEGATION_TOOLS, DelegationMcpServer, buildDelegationMcpServer, delegationMcpForConfig } from './delegation/index.js';
|
|
4
4
|
export { BrokerToken, BrokerTokenMinter, BrokerTokenProvider, BrokerTokenProviderOptions, ConsentUrlInput, buildConsentUrl, createBrokerTokenProvider } from './tangle/index.js';
|
|
5
|
-
export { AppToolLoopOptions,
|
|
5
|
+
export { AppToolLoopOptions, LoopEvent, LoopToolCall, OpenAICompatStreamTurnOptions, OpenAIStreamChunk, StreamAppToolLoopOptions, StreamLoopYield, ToolLoopResult, createOpenAICompatStreamTurn, runAppToolLoop, streamAppToolLoop, toLoopEvents } from './runtime/index.js';
|
|
6
6
|
export { createTokenRecallChecker, producedFromToolEvents } from './eval/index.js';
|
|
7
7
|
export { KnowledgeRequirementSpec, KnowledgeSignal, KnowledgeStateAccessor, SatisfiedByRule, buildKnowledgeRequirements, deriveSignals } from './knowledge/index.js';
|
|
8
|
+
export { CreateKnowledgeLoopDeps, KnowledgeCandidate, KnowledgeDecider, KnowledgeDeciderInput, KnowledgeDecision, KnowledgeGateVerdict, KnowledgeLoop, KnowledgeLoopDriver, createKnowledgeLoop, createReviewerDecider, reviewCandidate } from './knowledge-loop/index.js';
|
|
9
|
+
export { AgentAppConfig, AgentDelegationConfig, AgentIdentityConfig, AgentIntegrationsConfig, AgentKnowledgeConfig, AgentTaxonomyConfig, AgentUiConfig, KnowledgeLoopConfig, KnowledgeSourceSpec, agentAppConfigJsonSchema, defineAgentApp } from './config/index.js';
|
|
10
|
+
export { D1Like, D1PreparedLike, DrizzleColumnLike, DrizzleSqliteCoreLike, PRESET_MIGRATION_SQL, PRESET_TABLES, PresetBillingOptions, PresetKnowledgeAccessorOptions, PresetToolHandlerOptions, VaultKv, createD1KnowledgeStateAccessor, createPresetDrizzleSchema, createPresetFieldCrypto, createPresetToolHandlers, createPresetWorkspaceKeyManager, createPresetWorkspaceKeyStore } from './preset-cloudflare/index.js';
|
|
8
11
|
export { KeyCrypto, KeyProvisioner, PlanLimit, PlatformBalanceInfo, PlatformBalanceManager, PlatformBalanceManagerOptions, PlatformBillingClient, PlatformIdentity, PlatformProductUsage, SharedBillingState, WorkspaceKeyManager, WorkspaceKeyManagerOptions, WorkspaceKeyRecord, WorkspaceKeyStore, WorkspaceModelKeyUsage, createPlatformBalanceManager, createWorkspaceKeyManager } from './billing/index.js';
|
|
9
12
|
export { DeriveKeyOptions, createFieldCrypto, decodeHexKey, decryptAesGcm, decryptBytes, decryptWithKey, deriveKey, encryptAesGcm, encryptBytes, encryptWithKey } from './crypto/index.js';
|
|
10
13
|
export { JsonRecord, PersistedChatMessageForTurn, ResolvedChatTurn, StreamEvent, asRecord, asString, buildUserTextParts, encodeEvent, finalizeAssistantParts, getPartKey, mergePersistedPart, messageHasTurnId, normalizeClientTurnId, normalizePersistedPart, normalizeTime, normalizeToolEvent, resolveChatTurn, resolveToolId, resolveToolName } from './stream/index.js';
|
|
@@ -12,3 +15,5 @@ export { HubExecClient, HubExecClientOptions, HubExecErrorCode, HubExecResult, H
|
|
|
12
15
|
export { JsonObject, KvLike, RateLimitResult, RequestContext, SecurityHeaderOptions, addSecurityHeaders, checkRateLimit, extractRequestContext, parseJsonObjectBody, requireString } from './web/index.js';
|
|
13
16
|
export { redactForIngestion } from './redact/index.js';
|
|
14
17
|
export { CompletionRequirement, CompletionVerdict, CorrectnessChecker, ProducedState, RuntimeEventLike, SatisfiedBy, TaskGold, createLlmCorrectnessChecker, extractProducedState, verifyCompletion, weightedComposite } from '@tangle-network/agent-eval';
|
|
18
|
+
export { D as DEFAULT_TANGLE_ROUTER_BASE_URL, R as ResolveModelOptions, T as TangleModelConfig, r as resolveTangleModelConfig } from './model-BOP69mVu.js';
|
|
19
|
+
import '@tangle-network/agent-knowledge';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
agentAppConfigJsonSchema,
|
|
3
|
+
defineAgentApp
|
|
4
|
+
} from "./chunk-5RV6CAHZ.js";
|
|
5
|
+
import {
|
|
6
|
+
PRESET_MIGRATION_SQL,
|
|
7
|
+
PRESET_TABLES,
|
|
8
|
+
createD1KnowledgeStateAccessor,
|
|
9
|
+
createPresetDrizzleSchema,
|
|
10
|
+
createPresetFieldCrypto,
|
|
11
|
+
createPresetToolHandlers,
|
|
12
|
+
createPresetWorkspaceKeyManager,
|
|
13
|
+
createPresetWorkspaceKeyStore
|
|
14
|
+
} from "./chunk-EZXN67KE.js";
|
|
15
|
+
import {
|
|
16
|
+
createPlatformBalanceManager,
|
|
17
|
+
createWorkspaceKeyManager
|
|
18
|
+
} from "./chunk-EAJSWUU5.js";
|
|
1
19
|
import {
|
|
2
20
|
createFieldCrypto,
|
|
3
21
|
decodeHexKey,
|
|
@@ -62,8 +80,9 @@ import {
|
|
|
62
80
|
import {
|
|
63
81
|
DELEGATION_MCP_SERVER_KEY,
|
|
64
82
|
DELEGATION_TOOLS,
|
|
65
|
-
buildDelegationMcpServer
|
|
66
|
-
|
|
83
|
+
buildDelegationMcpServer,
|
|
84
|
+
delegationMcpForConfig
|
|
85
|
+
} from "./chunk-AQ2BOPOQ.js";
|
|
67
86
|
import {
|
|
68
87
|
buildConsentUrl,
|
|
69
88
|
createBrokerTokenProvider
|
|
@@ -89,9 +108,10 @@ import {
|
|
|
89
108
|
deriveSignals
|
|
90
109
|
} from "./chunk-ZXNXAQAH.js";
|
|
91
110
|
import {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
111
|
+
createKnowledgeLoop,
|
|
112
|
+
createReviewerDecider,
|
|
113
|
+
reviewCandidate
|
|
114
|
+
} from "./chunk-EEPJGZJW.js";
|
|
95
115
|
export {
|
|
96
116
|
APP_TOOL_NAMES,
|
|
97
117
|
DEFAULT_APP_TOOL_PATHS,
|
|
@@ -100,8 +120,11 @@ export {
|
|
|
100
120
|
DELEGATION_MCP_SERVER_KEY,
|
|
101
121
|
DELEGATION_TOOLS,
|
|
102
122
|
HubExecClient,
|
|
123
|
+
PRESET_MIGRATION_SQL,
|
|
124
|
+
PRESET_TABLES,
|
|
103
125
|
ToolInputError,
|
|
104
126
|
addSecurityHeaders,
|
|
127
|
+
agentAppConfigJsonSchema,
|
|
105
128
|
asRecord,
|
|
106
129
|
asString,
|
|
107
130
|
authenticateToolRequest,
|
|
@@ -116,16 +139,26 @@ export {
|
|
|
116
139
|
createAppToolRuntimeExecutor,
|
|
117
140
|
createBrokerTokenProvider,
|
|
118
141
|
createCapabilityToken,
|
|
142
|
+
createD1KnowledgeStateAccessor,
|
|
119
143
|
createFieldCrypto,
|
|
144
|
+
createKnowledgeLoop,
|
|
120
145
|
createLlmCorrectnessChecker,
|
|
121
146
|
createOpenAICompatStreamTurn,
|
|
122
147
|
createPlatformBalanceManager,
|
|
148
|
+
createPresetDrizzleSchema,
|
|
149
|
+
createPresetFieldCrypto,
|
|
150
|
+
createPresetToolHandlers,
|
|
151
|
+
createPresetWorkspaceKeyManager,
|
|
152
|
+
createPresetWorkspaceKeyStore,
|
|
153
|
+
createReviewerDecider,
|
|
123
154
|
createTokenRecallChecker,
|
|
124
155
|
createWorkspaceKeyManager,
|
|
125
156
|
decodeHexKey,
|
|
126
157
|
decryptAesGcm,
|
|
127
158
|
decryptBytes,
|
|
128
159
|
decryptWithKey,
|
|
160
|
+
defineAgentApp,
|
|
161
|
+
delegationMcpForConfig,
|
|
129
162
|
deriveKey,
|
|
130
163
|
deriveSignals,
|
|
131
164
|
dispatchAppTool,
|
|
@@ -157,6 +190,7 @@ export {
|
|
|
157
190
|
resolveTangleModelConfig,
|
|
158
191
|
resolveToolId,
|
|
159
192
|
resolveToolName,
|
|
193
|
+
reviewCandidate,
|
|
160
194
|
runAppToolLoop,
|
|
161
195
|
streamAppToolLoop,
|
|
162
196
|
toLoopEvents,
|