@dudko.dev/agent-web-ui 0.0.1 → 0.0.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/README.md +66 -1
- package/dist/{chunk-4EHUITGU.js → chunk-SVYHDLAZ.js} +7 -1
- package/dist/{chunk-4EHUITGU.js.map → chunk-SVYHDLAZ.js.map} +1 -1
- package/dist/{chunk-A55Q377T.js → chunk-VCR7LU7J.js} +7 -1
- package/dist/{chunk-A55Q377T.js.map → chunk-VCR7LU7J.js.map} +1 -1
- package/dist/{chunk-P2F2P3JC.js → chunk-WFM6B7CL.js} +7 -1
- package/dist/{chunk-P2F2P3JC.js.map → chunk-WFM6B7CL.js.map} +1 -1
- package/dist/{chunk-TPK25QGK.js → chunk-WZ7K7JIP.js} +7 -1
- package/dist/{chunk-TPK25QGK.js.map → chunk-WZ7K7JIP.js.map} +1 -1
- package/dist/chunk-ZBHESK6V.js +1440 -0
- package/dist/chunk-ZBHESK6V.js.map +1 -0
- package/dist/controller.cjs +1891 -0
- package/dist/controller.cjs.map +1 -0
- package/dist/controller.d.cts +253 -0
- package/dist/controller.d.ts +253 -0
- package/dist/controller.js +482 -0
- package/dist/controller.js.map +1 -0
- package/dist/{en-CcNUz2tN.d.cts → en-Dg2MtzcJ.d.cts} +6 -0
- package/dist/{en-CcNUz2tN.d.ts → en-Dg2MtzcJ.d.ts} +6 -0
- package/dist/index.cjs +133 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +82 -4
- package/dist/index.d.ts +82 -4
- package/dist/index.js +142 -1419
- package/dist/index.js.map +1 -1
- package/dist/{labels-UuWI7wPo.d.ts → labels-CmiTBLWD.d.cts} +68 -100
- package/dist/{labels-D5BrHct4.d.cts → labels-DH1ESUtm.d.ts} +68 -100
- package/dist/locales/be.cjs +12 -0
- package/dist/locales/be.cjs.map +1 -1
- package/dist/locales/be.d.cts +4 -2
- package/dist/locales/be.d.ts +4 -2
- package/dist/locales/be.js +7 -1
- package/dist/locales/be.js.map +1 -1
- package/dist/locales/bg.cjs +12 -0
- package/dist/locales/bg.cjs.map +1 -1
- package/dist/locales/bg.d.cts +4 -2
- package/dist/locales/bg.d.ts +4 -2
- package/dist/locales/bg.js +7 -1
- package/dist/locales/bg.js.map +1 -1
- package/dist/locales/ca.cjs +12 -0
- package/dist/locales/ca.cjs.map +1 -1
- package/dist/locales/ca.d.cts +4 -2
- package/dist/locales/ca.d.ts +4 -2
- package/dist/locales/ca.js +7 -1
- package/dist/locales/ca.js.map +1 -1
- package/dist/locales/cs.cjs +12 -0
- package/dist/locales/cs.cjs.map +1 -1
- package/dist/locales/cs.d.cts +4 -2
- package/dist/locales/cs.d.ts +4 -2
- package/dist/locales/cs.js +7 -1
- package/dist/locales/cs.js.map +1 -1
- package/dist/locales/da.cjs +12 -0
- package/dist/locales/da.cjs.map +1 -1
- package/dist/locales/da.d.cts +4 -2
- package/dist/locales/da.d.ts +4 -2
- package/dist/locales/da.js +7 -1
- package/dist/locales/da.js.map +1 -1
- package/dist/locales/de.cjs +12 -0
- package/dist/locales/de.cjs.map +1 -1
- package/dist/locales/de.d.cts +4 -2
- package/dist/locales/de.d.ts +4 -2
- package/dist/locales/de.js +7 -1
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/el.cjs +12 -0
- package/dist/locales/el.cjs.map +1 -1
- package/dist/locales/el.d.cts +4 -2
- package/dist/locales/el.d.ts +4 -2
- package/dist/locales/el.js +7 -1
- package/dist/locales/el.js.map +1 -1
- package/dist/locales/en.cjs +12 -0
- package/dist/locales/en.cjs.map +1 -1
- package/dist/locales/en.d.cts +4 -2
- package/dist/locales/en.d.ts +4 -2
- package/dist/locales/en.js +7 -1
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es-419.cjs +16 -1
- package/dist/locales/es-419.cjs.map +1 -1
- package/dist/locales/es-419.d.cts +4 -2
- package/dist/locales/es-419.d.ts +4 -2
- package/dist/locales/es-419.js +6 -3
- package/dist/locales/es-419.js.map +1 -1
- package/dist/locales/es.cjs +12 -0
- package/dist/locales/es.cjs.map +1 -1
- package/dist/locales/es.d.cts +4 -2
- package/dist/locales/es.d.ts +4 -2
- package/dist/locales/es.js +2 -2
- package/dist/locales/fi.cjs +12 -0
- package/dist/locales/fi.cjs.map +1 -1
- package/dist/locales/fi.d.cts +4 -2
- package/dist/locales/fi.d.ts +4 -2
- package/dist/locales/fi.js +7 -1
- package/dist/locales/fi.js.map +1 -1
- package/dist/locales/fr-CA.cjs +12 -0
- package/dist/locales/fr-CA.cjs.map +1 -1
- package/dist/locales/fr-CA.d.cts +4 -2
- package/dist/locales/fr-CA.d.ts +4 -2
- package/dist/locales/fr-CA.js +2 -2
- package/dist/locales/fr.cjs +12 -0
- package/dist/locales/fr.cjs.map +1 -1
- package/dist/locales/fr.d.cts +4 -2
- package/dist/locales/fr.d.ts +4 -2
- package/dist/locales/fr.js +2 -2
- package/dist/locales/gn.cjs +12 -0
- package/dist/locales/gn.cjs.map +1 -1
- package/dist/locales/gn.d.cts +4 -2
- package/dist/locales/gn.d.ts +4 -2
- package/dist/locales/gn.js +7 -1
- package/dist/locales/gn.js.map +1 -1
- package/dist/locales/hr.cjs +12 -0
- package/dist/locales/hr.cjs.map +1 -1
- package/dist/locales/hr.d.cts +4 -2
- package/dist/locales/hr.d.ts +4 -2
- package/dist/locales/hr.js +7 -1
- package/dist/locales/hr.js.map +1 -1
- package/dist/locales/ht.cjs +12 -0
- package/dist/locales/ht.cjs.map +1 -1
- package/dist/locales/ht.d.cts +4 -2
- package/dist/locales/ht.d.ts +4 -2
- package/dist/locales/ht.js +7 -1
- package/dist/locales/ht.js.map +1 -1
- package/dist/locales/hu.cjs +12 -0
- package/dist/locales/hu.cjs.map +1 -1
- package/dist/locales/hu.d.cts +4 -2
- package/dist/locales/hu.d.ts +4 -2
- package/dist/locales/hu.js +7 -1
- package/dist/locales/hu.js.map +1 -1
- package/dist/locales/index.cjs +6 -0
- package/dist/locales/index.cjs.map +1 -1
- package/dist/locales/index.d.cts +6 -4
- package/dist/locales/index.d.ts +6 -4
- package/dist/locales/index.js +1 -1
- package/dist/locales/it.cjs +12 -0
- package/dist/locales/it.cjs.map +1 -1
- package/dist/locales/it.d.cts +4 -2
- package/dist/locales/it.d.ts +4 -2
- package/dist/locales/it.js +7 -1
- package/dist/locales/it.js.map +1 -1
- package/dist/locales/nb.cjs +12 -0
- package/dist/locales/nb.cjs.map +1 -1
- package/dist/locales/nb.d.cts +4 -2
- package/dist/locales/nb.d.ts +4 -2
- package/dist/locales/nb.js +7 -1
- package/dist/locales/nb.js.map +1 -1
- package/dist/locales/nl.cjs +12 -0
- package/dist/locales/nl.cjs.map +1 -1
- package/dist/locales/nl.d.cts +4 -2
- package/dist/locales/nl.d.ts +4 -2
- package/dist/locales/nl.js +7 -1
- package/dist/locales/nl.js.map +1 -1
- package/dist/locales/pl.cjs +12 -0
- package/dist/locales/pl.cjs.map +1 -1
- package/dist/locales/pl.d.cts +4 -2
- package/dist/locales/pl.d.ts +4 -2
- package/dist/locales/pl.js +7 -1
- package/dist/locales/pl.js.map +1 -1
- package/dist/locales/pt-BR.cjs +12 -0
- package/dist/locales/pt-BR.cjs.map +1 -1
- package/dist/locales/pt-BR.d.cts +4 -2
- package/dist/locales/pt-BR.d.ts +4 -2
- package/dist/locales/pt-BR.js +7 -1
- package/dist/locales/pt-BR.js.map +1 -1
- package/dist/locales/pt.cjs +12 -0
- package/dist/locales/pt.cjs.map +1 -1
- package/dist/locales/pt.d.cts +4 -2
- package/dist/locales/pt.d.ts +4 -2
- package/dist/locales/pt.js +7 -1
- package/dist/locales/pt.js.map +1 -1
- package/dist/locales/qu.cjs +12 -0
- package/dist/locales/qu.cjs.map +1 -1
- package/dist/locales/qu.d.cts +4 -2
- package/dist/locales/qu.d.ts +4 -2
- package/dist/locales/qu.js +7 -1
- package/dist/locales/qu.js.map +1 -1
- package/dist/locales/ro.cjs +12 -0
- package/dist/locales/ro.cjs.map +1 -1
- package/dist/locales/ro.d.cts +4 -2
- package/dist/locales/ro.d.ts +4 -2
- package/dist/locales/ro.js +7 -1
- package/dist/locales/ro.js.map +1 -1
- package/dist/locales/ru.cjs +12 -0
- package/dist/locales/ru.cjs.map +1 -1
- package/dist/locales/ru.d.cts +4 -2
- package/dist/locales/ru.d.ts +4 -2
- package/dist/locales/ru.js +7 -1
- package/dist/locales/ru.js.map +1 -1
- package/dist/locales/sk.cjs +12 -0
- package/dist/locales/sk.cjs.map +1 -1
- package/dist/locales/sk.d.cts +4 -2
- package/dist/locales/sk.d.ts +4 -2
- package/dist/locales/sk.js +7 -1
- package/dist/locales/sk.js.map +1 -1
- package/dist/locales/sq.cjs +12 -0
- package/dist/locales/sq.cjs.map +1 -1
- package/dist/locales/sq.d.cts +4 -2
- package/dist/locales/sq.d.ts +4 -2
- package/dist/locales/sq.js +7 -1
- package/dist/locales/sq.js.map +1 -1
- package/dist/locales/sr-Latn.cjs +12 -0
- package/dist/locales/sr-Latn.cjs.map +1 -1
- package/dist/locales/sr-Latn.d.cts +4 -2
- package/dist/locales/sr-Latn.d.ts +4 -2
- package/dist/locales/sr-Latn.js +2 -2
- package/dist/locales/sr.cjs +12 -0
- package/dist/locales/sr.cjs.map +1 -1
- package/dist/locales/sr.d.cts +4 -2
- package/dist/locales/sr.d.ts +4 -2
- package/dist/locales/sr.js +2 -2
- package/dist/locales/sv.cjs +12 -0
- package/dist/locales/sv.cjs.map +1 -1
- package/dist/locales/sv.d.cts +4 -2
- package/dist/locales/sv.d.ts +4 -2
- package/dist/locales/sv.js +7 -1
- package/dist/locales/sv.js.map +1 -1
- package/dist/locales/tr.cjs +12 -0
- package/dist/locales/tr.cjs.map +1 -1
- package/dist/locales/tr.d.cts +4 -2
- package/dist/locales/tr.d.ts +4 -2
- package/dist/locales/tr.js +7 -1
- package/dist/locales/tr.js.map +1 -1
- package/dist/locales/uk.cjs +12 -0
- package/dist/locales/uk.cjs.map +1 -1
- package/dist/locales/uk.d.cts +4 -2
- package/dist/locales/uk.d.ts +4 -2
- package/dist/locales/uk.js +7 -1
- package/dist/locales/uk.js.map +1 -1
- package/dist/mcp-app.d.cts +491 -3
- package/dist/mcp-app.d.ts +491 -3
- package/dist/questions-Dw--IEjT.d.cts +100 -0
- package/dist/questions-Dw--IEjT.d.ts +100 -0
- package/dist/{types-BmvgYUzF.d.cts → types-CQquuZpl.d.cts} +1 -1
- package/dist/{types-Cr5gmUts.d.ts → types-CXZfZVP5.d.ts} +1 -1
- package/dist/{mcp-app-entry-BA-Ca39z.d.ts → types-DnBCok3z.d.cts} +2 -488
- package/dist/{mcp-app-entry-tybABaHg.d.cts → types-DnBCok3z.d.ts} +2 -488
- package/package.json +13 -3
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { RunFile, RunResult, AskUserAnswer, ToolApprovalMode, AppToolCallRequest, AppSamplingRequest, AppSamplingView, AppSamplingResult, CompactResult, IUsage, BrowserAgentConfig, AgentEventHandler, Agent } from '@dudko.dev/agent-web';
|
|
2
|
+
import { PendingQuestion } from './index.cjs';
|
|
3
|
+
import { ChatAttachment, ChatMessage, AgentUiState, ApprovalView } from './index.cjs';
|
|
4
|
+
|
|
5
|
+
/** How a controller behaves. `useAgent`'s options are these plus `deps`. */
|
|
6
|
+
interface AgentControllerOptions {
|
|
7
|
+
/** Invoked for every raw agent event, after the internal reducer folds it. */
|
|
8
|
+
onEvent?: AgentEventHandler;
|
|
9
|
+
/**
|
|
10
|
+
* Build the agent as soon as the controller is created (default `true`). With `false` it waits
|
|
11
|
+
* for `reload()`.
|
|
12
|
+
*/
|
|
13
|
+
autoStart?: boolean;
|
|
14
|
+
/** Cap the retained raw event log length (default 200; 0 = unbounded). */
|
|
15
|
+
maxEvents?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Where "Always allow" given to an MCP App's tool is kept (the core's `appGrantKey`: the
|
|
18
|
+
* server's identity on its connection, the tool, the app's resource): handed to the core's
|
|
19
|
+
* `approveAppToolCall`, so a new agent - an `update`, a new controller - keeps the grant. A new
|
|
20
|
+
* connection (the server removed and added again, reconnected, another server under the same
|
|
21
|
+
* name) starts with none, and a rule's 'deny' or 'read-only' still refuses. Default: one set for
|
|
22
|
+
* the page's life (this module's, shared by every controller of the page - and so by every
|
|
23
|
+
* `useAgent`); a reload forgets it, as sampling's "Always for this app" is forgotten. Pass your
|
|
24
|
+
* own set to scope it differently.
|
|
25
|
+
*/
|
|
26
|
+
appToolGrants?: Set<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Route tool-consent requests into the controller (`pendingApprovals`, `approve`, `deny`) when
|
|
29
|
+
* the config has no `toolApproval.onRequest` of its own (default true).
|
|
30
|
+
*/
|
|
31
|
+
approvals?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Route the model's questions (`ask_user`) into the controller (`pendingQuestions`,
|
|
34
|
+
* `answerQuestion`) when the config turns `askUser` on without an `onQuestion` of its own
|
|
35
|
+
* (`askUser: true`, or `{ timeoutMs, maxPerRun }`; default true). A host's own `onQuestion` wins;
|
|
36
|
+
* `askUser` off stays off.
|
|
37
|
+
*/
|
|
38
|
+
questions?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* What the run never showed the agent — a message sent while the answer was being
|
|
41
|
+
* written — is sent as the next message, once the run has ended (default true).
|
|
42
|
+
* A run the user stopped never does this: those messages stay in `undelivered`
|
|
43
|
+
* for the UI to offer (`sendUndelivered` / `discardUndelivered`).
|
|
44
|
+
*/
|
|
45
|
+
followUp?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Follow a run of the current conversation that goes on in ANOTHER tab of the site (default
|
|
48
|
+
* true; needs a `memory` the tabs share - `IndexedDBStore` - and `sessionLock` not `'off'`): its
|
|
49
|
+
* steps and answer show here live (`remote`) and `isRunning` is true meanwhile. Writing to it or
|
|
50
|
+
* stopping it is explicit: `sendRemote` / `stopRemote`. Consent requests stay in that tab.
|
|
51
|
+
*/
|
|
52
|
+
watch?: boolean;
|
|
53
|
+
}
|
|
54
|
+
interface ApproveOptions {
|
|
55
|
+
/** Also allow this tool for the rest of the agent's life ("always allow"). */
|
|
56
|
+
remember?: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface RunGoalOptions {
|
|
59
|
+
/**
|
|
60
|
+
* What the transcript shows for this turn when it differs from what the
|
|
61
|
+
* agent receives — e.g. the typed text without the attached files' contents.
|
|
62
|
+
* `''` with `attachments`: a message of attachments only - the transcript shows them, no text.
|
|
63
|
+
*/
|
|
64
|
+
label?: string;
|
|
65
|
+
/** Images sent to the model with the goal (vision models; see `agent.capabilities`). */
|
|
66
|
+
images?: RunFile[];
|
|
67
|
+
/** PDFs / files / URLs sent to the model with the goal. */
|
|
68
|
+
files?: RunFile[];
|
|
69
|
+
/** What the transcript shows as attached to this turn (thumbnails, chips). */
|
|
70
|
+
attachments?: ChatAttachment[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A tool call an MCP App asks for, as `approveAppToolCall` takes it: the core's request, plus
|
|
74
|
+
* `frame` - the host's id of the frame that asked (`AppView.id`), put on the request's `app`.
|
|
75
|
+
*/
|
|
76
|
+
type AppToolCall = AppToolCallRequest & {
|
|
77
|
+
frame?: string;
|
|
78
|
+
};
|
|
79
|
+
/** What `update` does besides taking the new config. */
|
|
80
|
+
interface AgentControllerUpdate {
|
|
81
|
+
/** New options (replace the old ones whole). Omitted: the options stay. */
|
|
82
|
+
options?: AgentControllerOptions;
|
|
83
|
+
/**
|
|
84
|
+
* Build a new agent from the config (default `true`): what a `deps` change does in `useAgent`.
|
|
85
|
+
* `false` only takes the config (and options) as the latest - read by the next build, the next
|
|
86
|
+
* run, `reset` - and applies what is live: a new `toolApproval.mode`, another `memory` /
|
|
87
|
+
* `sessionLock` / `learning.store` to follow other tabs through. A changed `autoStart` rebuilds
|
|
88
|
+
* either way.
|
|
89
|
+
*/
|
|
90
|
+
rebuild?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/** Everything a view renders, at one moment. Immutable: a new object on every change. */
|
|
93
|
+
interface AgentControllerSnapshot extends AgentUiState {
|
|
94
|
+
/** The memory session runs use (config.sessionId until switched). */
|
|
95
|
+
sessionId: string;
|
|
96
|
+
/** This tab's run, or the conversation's run in another tab followed here. */
|
|
97
|
+
isRunning: boolean;
|
|
98
|
+
/** The agent is built and nothing runs (here or, for this conversation, in another tab). */
|
|
99
|
+
isReady: boolean;
|
|
100
|
+
/** Tool calls waiting for the user's consent (another tab's are answered there, never here). */
|
|
101
|
+
pendingApprovals: ApprovalView[];
|
|
102
|
+
/**
|
|
103
|
+
* The model's questions waiting for the person in THIS tab (`ask_user`, when the controller
|
|
104
|
+
* answers them - see `AgentControllerOptions.questions`), oldest first, each with `expiresAt`
|
|
105
|
+
* when the core stops waiting. Another tab's questions are in `questions` (marked `remote`),
|
|
106
|
+
* never here.
|
|
107
|
+
*/
|
|
108
|
+
pendingQuestions: PendingQuestion[];
|
|
109
|
+
/** The consent policy in effect. */
|
|
110
|
+
approvalMode: ToolApprovalMode;
|
|
111
|
+
}
|
|
112
|
+
/** What a view calls. Each keeps its identity for the controller's life. */
|
|
113
|
+
interface AgentControllerActions {
|
|
114
|
+
/**
|
|
115
|
+
* Run a goal. Resolves with the RunResult, or `undefined` if it couldn't start. When the
|
|
116
|
+
* conversation is running in another tab, the run waits for it (`sessionBusy`; the core's
|
|
117
|
+
* `sessionLock`) and then goes, with that run's turn in its memory.
|
|
118
|
+
*/
|
|
119
|
+
run: (goal: string, options?: RunGoalOptions) => Promise<RunResult | undefined>;
|
|
120
|
+
/**
|
|
121
|
+
* Abort the in-flight run of THIS tab (observed between phases and mid-stream), going or waiting
|
|
122
|
+
* for the session. A run followed from another tab is stopped only by `stopRemote`.
|
|
123
|
+
*/
|
|
124
|
+
stop: () => void;
|
|
125
|
+
/**
|
|
126
|
+
* Stop the conversation's run in another tab (`remote`), when that tab allows it (the core's
|
|
127
|
+
* `sessionRelay`). A no-op when none is followed.
|
|
128
|
+
*/
|
|
129
|
+
stopRemote: () => void;
|
|
130
|
+
/**
|
|
131
|
+
* Say something to the conversation's run in another tab (`remote`): it reaches that run's
|
|
132
|
+
* model at its next boundary, marked as from another tab. `false` when no such run is followed
|
|
133
|
+
* or the text is empty. Until that tab answers, the text is in `queued` marked
|
|
134
|
+
* `sentTo: 'another-tab'` (shown "waiting for the other tab to pick it up") - with no time
|
|
135
|
+
* limit: a tab the browser froze answers when it wakes. Taken, that run's own entry takes its
|
|
136
|
+
* place; refused, or that run ended without it, it comes back in `undelivered`.
|
|
137
|
+
*/
|
|
138
|
+
sendRemote: (text: string) => boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Say something to the agent while it works. It is shown to the model at the next
|
|
141
|
+
* boundary (between tool calls, or when the step ends — where the replanner then
|
|
142
|
+
* re-checks the plan), never cutting a tool call short. `false` when no run is in
|
|
143
|
+
* flight or the text is empty — then use `run`. Watch `queued` / `notes`. Only this tab's run:
|
|
144
|
+
* for the conversation's run in another tab, `sendRemote`.
|
|
145
|
+
*/
|
|
146
|
+
send: (text: string) => boolean;
|
|
147
|
+
/** Stop ONE running subagent (`SubagentView.id`); the run and its siblings go on. */
|
|
148
|
+
stopSubagent: (id: string) => boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Delete one of the agent's own lessons (`learned`), e.g. one gone stale. Resolves false when
|
|
151
|
+
* there is no such lesson (or no agent yet). Needs `config.learning`.
|
|
152
|
+
*/
|
|
153
|
+
forgetSkill: (name: string) => Promise<boolean>;
|
|
154
|
+
/** Send the `undelivered` messages (a stopped run's leftovers) as a new message. */
|
|
155
|
+
sendUndelivered: () => void;
|
|
156
|
+
/** Drop the `undelivered` messages. */
|
|
157
|
+
discardUndelivered: () => void;
|
|
158
|
+
/** Clear the whole conversation — transcript, current run, and the agent's memory. */
|
|
159
|
+
reset: () => void;
|
|
160
|
+
/** Rebuild the agent now (e.g. after the user stores a new API key). */
|
|
161
|
+
reload: () => void;
|
|
162
|
+
/** Let a pending call run (`remember` → never ask for this tool again). */
|
|
163
|
+
approve: (id: string, options?: ApproveOptions) => void;
|
|
164
|
+
/** Refuse a pending call; the model is told and works around it. */
|
|
165
|
+
deny: (id: string, reason?: string) => void;
|
|
166
|
+
/**
|
|
167
|
+
* Answer one of `pendingQuestions`: `{ choice: [label] }` (labels as offered; several only when
|
|
168
|
+
* `multiple`), `{ other: text }` (only when `allowOther`) or `{ declined: true }`. False when no
|
|
169
|
+
* such question is waiting (answered, expired, stopped). The answer goes to the core and is not
|
|
170
|
+
* kept here.
|
|
171
|
+
*/
|
|
172
|
+
answerQuestion: (id: string, answer: AskUserAnswer) => boolean;
|
|
173
|
+
/** Switch the consent policy live — the "autopilot" toggle. */
|
|
174
|
+
setApprovalMode: (mode: ToolApprovalMode) => void;
|
|
175
|
+
/**
|
|
176
|
+
* Ask the agent's consent gate about a tool call an MCP App wants to make (the core's
|
|
177
|
+
* `Agent.approveAppToolCall`: the same rules and modes as the model's calls - 'autopilot' asks
|
|
178
|
+
* nothing -, "always allow" kept apart from the model's and for the page's life, not the
|
|
179
|
+
* agent's: `appToolGrants`). The request joins `pendingApprovals` with `app` set,
|
|
180
|
+
* and waits across runs - a run ending or `stop()` does not answer it; `signal` does (the
|
|
181
|
+
* app's frame going away). `call.frame` (the frame's `AppView.id`) is put on the request's
|
|
182
|
+
* `app`, so it is drawn with THAT frame; `call.serverId` (`McpAppTool.serverId`) scopes the
|
|
183
|
+
* grant to the server's connection. Resolves when the call may go; throws when it may not.
|
|
184
|
+
*/
|
|
185
|
+
approveAppToolCall: (call: AppToolCall, signal?: AbortSignal) => Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Answer a completion an MCP App asks for (its `sampling/createMessage`) with the agent's model:
|
|
188
|
+
* the core's `Agent.sampleForApp` - checked, rate-limited per app, put to `approve` (shown
|
|
189
|
+
* exactly what the model gets), then sent with no tools and none of the conversation. The
|
|
190
|
+
* tokens count in `totalUsage` (a `usage` event of phase `'app'`, never the run's); the answer
|
|
191
|
+
* is returned to the caller and never reaches the transcript, the memory or the model's context.
|
|
192
|
+
* Throws the core's `AppSamplingError` (its `rpcCode` is what the app is told).
|
|
193
|
+
*/
|
|
194
|
+
sampleForApp: (request: AppSamplingRequest, approve: (view: AppSamplingView) => Promise<boolean>, signal?: AbortSignal) => Promise<AppSamplingResult>;
|
|
195
|
+
/** Summarise the stored transcript now (needs `config.memory`). */
|
|
196
|
+
compact: () => Promise<CompactResult | undefined>;
|
|
197
|
+
/**
|
|
198
|
+
* Switch to another conversation: its id becomes the memory session of the
|
|
199
|
+
* next runs, and its saved transcript (chat history) is shown.
|
|
200
|
+
*/
|
|
201
|
+
loadChat: (chat: {
|
|
202
|
+
sessionId: string;
|
|
203
|
+
messages?: ChatMessage[];
|
|
204
|
+
totalUsage?: IUsage;
|
|
205
|
+
}) => void;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* The agent as a store: `getSnapshot` + `subscribe` (React's `useSyncExternalStore` contract),
|
|
209
|
+
* the methods a view calls, `update` and `dispose`.
|
|
210
|
+
*/
|
|
211
|
+
interface AgentController extends AgentControllerActions {
|
|
212
|
+
/** The current snapshot: the same object until something changes, then a new one. */
|
|
213
|
+
getSnapshot: () => AgentControllerSnapshot;
|
|
214
|
+
/**
|
|
215
|
+
* Call `listener` after every change (never at once on subscribing). Returns the unsubscribe.
|
|
216
|
+
* After `dispose` nothing is called and subscribing does nothing.
|
|
217
|
+
*/
|
|
218
|
+
subscribe: (listener: () => void) => () => void;
|
|
219
|
+
/** Take a new config (and options): see {@link AgentControllerUpdate}. */
|
|
220
|
+
update: (config: BrowserAgentConfig, how?: AgentControllerUpdate) => void;
|
|
221
|
+
/**
|
|
222
|
+
* Tear everything down: the in-flight run aborted, its consent requests and questions answered
|
|
223
|
+
* (denied / declined: "the view was closed"), the build in progress dropped, the other-tab
|
|
224
|
+
* channels closed, pending timers cleared, every listener dropped. The snapshot stays as it was;
|
|
225
|
+
* every method is then a no-op (`run` resolves `undefined`). Idempotent.
|
|
226
|
+
*/
|
|
227
|
+
dispose: () => void;
|
|
228
|
+
/** The built agent, once ready (`undefined` while building, after a failure or `dispose`). */
|
|
229
|
+
readonly agent: Agent | undefined;
|
|
230
|
+
/** Whether `dispose` was called. */
|
|
231
|
+
readonly disposed: boolean;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* What a controller's snapshot is before anything happened: what a view renders before it has a
|
|
235
|
+
* controller (React's first render, which must not create one; a server render).
|
|
236
|
+
*/
|
|
237
|
+
declare const createInitialAgentSnapshot: (config: BrowserAgentConfig) => AgentControllerSnapshot;
|
|
238
|
+
/**
|
|
239
|
+
* Build the agent from `config` and keep its UI state: see {@link AgentController}. The agent is
|
|
240
|
+
* built at once (unless `autoStart: false` or the config has no `model` yet), and other tabs are
|
|
241
|
+
* followed from now on - so create it when the view appears and `dispose` it when the view goes.
|
|
242
|
+
*
|
|
243
|
+
* ```js
|
|
244
|
+
* const chat = createAgentController({ model, credentials, toolApproval: { mode: 'ask-writes' } })
|
|
245
|
+
* const off = chat.subscribe(() => render(chat.getSnapshot()))
|
|
246
|
+
* button.onclick = () => chat.run(input.value)
|
|
247
|
+
* // later: off(); chat.dispose()
|
|
248
|
+
* ```
|
|
249
|
+
*/
|
|
250
|
+
declare const createAgentController: (initialConfig: BrowserAgentConfig, initialOptions?: AgentControllerOptions) => AgentController;
|
|
251
|
+
|
|
252
|
+
export { createAgentController, createInitialAgentSnapshot };
|
|
253
|
+
export type { AgentController, AgentControllerActions, AgentControllerOptions, AgentControllerSnapshot, AgentControllerUpdate, AppToolCall, ApproveOptions, RunGoalOptions };
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { RunFile, RunResult, AskUserAnswer, ToolApprovalMode, AppToolCallRequest, AppSamplingRequest, AppSamplingView, AppSamplingResult, CompactResult, IUsage, BrowserAgentConfig, AgentEventHandler, Agent } from '@dudko.dev/agent-web';
|
|
2
|
+
import { PendingQuestion } from './index.js';
|
|
3
|
+
import { ChatAttachment, ChatMessage, AgentUiState, ApprovalView } from './index.js';
|
|
4
|
+
|
|
5
|
+
/** How a controller behaves. `useAgent`'s options are these plus `deps`. */
|
|
6
|
+
interface AgentControllerOptions {
|
|
7
|
+
/** Invoked for every raw agent event, after the internal reducer folds it. */
|
|
8
|
+
onEvent?: AgentEventHandler;
|
|
9
|
+
/**
|
|
10
|
+
* Build the agent as soon as the controller is created (default `true`). With `false` it waits
|
|
11
|
+
* for `reload()`.
|
|
12
|
+
*/
|
|
13
|
+
autoStart?: boolean;
|
|
14
|
+
/** Cap the retained raw event log length (default 200; 0 = unbounded). */
|
|
15
|
+
maxEvents?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Where "Always allow" given to an MCP App's tool is kept (the core's `appGrantKey`: the
|
|
18
|
+
* server's identity on its connection, the tool, the app's resource): handed to the core's
|
|
19
|
+
* `approveAppToolCall`, so a new agent - an `update`, a new controller - keeps the grant. A new
|
|
20
|
+
* connection (the server removed and added again, reconnected, another server under the same
|
|
21
|
+
* name) starts with none, and a rule's 'deny' or 'read-only' still refuses. Default: one set for
|
|
22
|
+
* the page's life (this module's, shared by every controller of the page - and so by every
|
|
23
|
+
* `useAgent`); a reload forgets it, as sampling's "Always for this app" is forgotten. Pass your
|
|
24
|
+
* own set to scope it differently.
|
|
25
|
+
*/
|
|
26
|
+
appToolGrants?: Set<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Route tool-consent requests into the controller (`pendingApprovals`, `approve`, `deny`) when
|
|
29
|
+
* the config has no `toolApproval.onRequest` of its own (default true).
|
|
30
|
+
*/
|
|
31
|
+
approvals?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Route the model's questions (`ask_user`) into the controller (`pendingQuestions`,
|
|
34
|
+
* `answerQuestion`) when the config turns `askUser` on without an `onQuestion` of its own
|
|
35
|
+
* (`askUser: true`, or `{ timeoutMs, maxPerRun }`; default true). A host's own `onQuestion` wins;
|
|
36
|
+
* `askUser` off stays off.
|
|
37
|
+
*/
|
|
38
|
+
questions?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* What the run never showed the agent — a message sent while the answer was being
|
|
41
|
+
* written — is sent as the next message, once the run has ended (default true).
|
|
42
|
+
* A run the user stopped never does this: those messages stay in `undelivered`
|
|
43
|
+
* for the UI to offer (`sendUndelivered` / `discardUndelivered`).
|
|
44
|
+
*/
|
|
45
|
+
followUp?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Follow a run of the current conversation that goes on in ANOTHER tab of the site (default
|
|
48
|
+
* true; needs a `memory` the tabs share - `IndexedDBStore` - and `sessionLock` not `'off'`): its
|
|
49
|
+
* steps and answer show here live (`remote`) and `isRunning` is true meanwhile. Writing to it or
|
|
50
|
+
* stopping it is explicit: `sendRemote` / `stopRemote`. Consent requests stay in that tab.
|
|
51
|
+
*/
|
|
52
|
+
watch?: boolean;
|
|
53
|
+
}
|
|
54
|
+
interface ApproveOptions {
|
|
55
|
+
/** Also allow this tool for the rest of the agent's life ("always allow"). */
|
|
56
|
+
remember?: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface RunGoalOptions {
|
|
59
|
+
/**
|
|
60
|
+
* What the transcript shows for this turn when it differs from what the
|
|
61
|
+
* agent receives — e.g. the typed text without the attached files' contents.
|
|
62
|
+
* `''` with `attachments`: a message of attachments only - the transcript shows them, no text.
|
|
63
|
+
*/
|
|
64
|
+
label?: string;
|
|
65
|
+
/** Images sent to the model with the goal (vision models; see `agent.capabilities`). */
|
|
66
|
+
images?: RunFile[];
|
|
67
|
+
/** PDFs / files / URLs sent to the model with the goal. */
|
|
68
|
+
files?: RunFile[];
|
|
69
|
+
/** What the transcript shows as attached to this turn (thumbnails, chips). */
|
|
70
|
+
attachments?: ChatAttachment[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A tool call an MCP App asks for, as `approveAppToolCall` takes it: the core's request, plus
|
|
74
|
+
* `frame` - the host's id of the frame that asked (`AppView.id`), put on the request's `app`.
|
|
75
|
+
*/
|
|
76
|
+
type AppToolCall = AppToolCallRequest & {
|
|
77
|
+
frame?: string;
|
|
78
|
+
};
|
|
79
|
+
/** What `update` does besides taking the new config. */
|
|
80
|
+
interface AgentControllerUpdate {
|
|
81
|
+
/** New options (replace the old ones whole). Omitted: the options stay. */
|
|
82
|
+
options?: AgentControllerOptions;
|
|
83
|
+
/**
|
|
84
|
+
* Build a new agent from the config (default `true`): what a `deps` change does in `useAgent`.
|
|
85
|
+
* `false` only takes the config (and options) as the latest - read by the next build, the next
|
|
86
|
+
* run, `reset` - and applies what is live: a new `toolApproval.mode`, another `memory` /
|
|
87
|
+
* `sessionLock` / `learning.store` to follow other tabs through. A changed `autoStart` rebuilds
|
|
88
|
+
* either way.
|
|
89
|
+
*/
|
|
90
|
+
rebuild?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/** Everything a view renders, at one moment. Immutable: a new object on every change. */
|
|
93
|
+
interface AgentControllerSnapshot extends AgentUiState {
|
|
94
|
+
/** The memory session runs use (config.sessionId until switched). */
|
|
95
|
+
sessionId: string;
|
|
96
|
+
/** This tab's run, or the conversation's run in another tab followed here. */
|
|
97
|
+
isRunning: boolean;
|
|
98
|
+
/** The agent is built and nothing runs (here or, for this conversation, in another tab). */
|
|
99
|
+
isReady: boolean;
|
|
100
|
+
/** Tool calls waiting for the user's consent (another tab's are answered there, never here). */
|
|
101
|
+
pendingApprovals: ApprovalView[];
|
|
102
|
+
/**
|
|
103
|
+
* The model's questions waiting for the person in THIS tab (`ask_user`, when the controller
|
|
104
|
+
* answers them - see `AgentControllerOptions.questions`), oldest first, each with `expiresAt`
|
|
105
|
+
* when the core stops waiting. Another tab's questions are in `questions` (marked `remote`),
|
|
106
|
+
* never here.
|
|
107
|
+
*/
|
|
108
|
+
pendingQuestions: PendingQuestion[];
|
|
109
|
+
/** The consent policy in effect. */
|
|
110
|
+
approvalMode: ToolApprovalMode;
|
|
111
|
+
}
|
|
112
|
+
/** What a view calls. Each keeps its identity for the controller's life. */
|
|
113
|
+
interface AgentControllerActions {
|
|
114
|
+
/**
|
|
115
|
+
* Run a goal. Resolves with the RunResult, or `undefined` if it couldn't start. When the
|
|
116
|
+
* conversation is running in another tab, the run waits for it (`sessionBusy`; the core's
|
|
117
|
+
* `sessionLock`) and then goes, with that run's turn in its memory.
|
|
118
|
+
*/
|
|
119
|
+
run: (goal: string, options?: RunGoalOptions) => Promise<RunResult | undefined>;
|
|
120
|
+
/**
|
|
121
|
+
* Abort the in-flight run of THIS tab (observed between phases and mid-stream), going or waiting
|
|
122
|
+
* for the session. A run followed from another tab is stopped only by `stopRemote`.
|
|
123
|
+
*/
|
|
124
|
+
stop: () => void;
|
|
125
|
+
/**
|
|
126
|
+
* Stop the conversation's run in another tab (`remote`), when that tab allows it (the core's
|
|
127
|
+
* `sessionRelay`). A no-op when none is followed.
|
|
128
|
+
*/
|
|
129
|
+
stopRemote: () => void;
|
|
130
|
+
/**
|
|
131
|
+
* Say something to the conversation's run in another tab (`remote`): it reaches that run's
|
|
132
|
+
* model at its next boundary, marked as from another tab. `false` when no such run is followed
|
|
133
|
+
* or the text is empty. Until that tab answers, the text is in `queued` marked
|
|
134
|
+
* `sentTo: 'another-tab'` (shown "waiting for the other tab to pick it up") - with no time
|
|
135
|
+
* limit: a tab the browser froze answers when it wakes. Taken, that run's own entry takes its
|
|
136
|
+
* place; refused, or that run ended without it, it comes back in `undelivered`.
|
|
137
|
+
*/
|
|
138
|
+
sendRemote: (text: string) => boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Say something to the agent while it works. It is shown to the model at the next
|
|
141
|
+
* boundary (between tool calls, or when the step ends — where the replanner then
|
|
142
|
+
* re-checks the plan), never cutting a tool call short. `false` when no run is in
|
|
143
|
+
* flight or the text is empty — then use `run`. Watch `queued` / `notes`. Only this tab's run:
|
|
144
|
+
* for the conversation's run in another tab, `sendRemote`.
|
|
145
|
+
*/
|
|
146
|
+
send: (text: string) => boolean;
|
|
147
|
+
/** Stop ONE running subagent (`SubagentView.id`); the run and its siblings go on. */
|
|
148
|
+
stopSubagent: (id: string) => boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Delete one of the agent's own lessons (`learned`), e.g. one gone stale. Resolves false when
|
|
151
|
+
* there is no such lesson (or no agent yet). Needs `config.learning`.
|
|
152
|
+
*/
|
|
153
|
+
forgetSkill: (name: string) => Promise<boolean>;
|
|
154
|
+
/** Send the `undelivered` messages (a stopped run's leftovers) as a new message. */
|
|
155
|
+
sendUndelivered: () => void;
|
|
156
|
+
/** Drop the `undelivered` messages. */
|
|
157
|
+
discardUndelivered: () => void;
|
|
158
|
+
/** Clear the whole conversation — transcript, current run, and the agent's memory. */
|
|
159
|
+
reset: () => void;
|
|
160
|
+
/** Rebuild the agent now (e.g. after the user stores a new API key). */
|
|
161
|
+
reload: () => void;
|
|
162
|
+
/** Let a pending call run (`remember` → never ask for this tool again). */
|
|
163
|
+
approve: (id: string, options?: ApproveOptions) => void;
|
|
164
|
+
/** Refuse a pending call; the model is told and works around it. */
|
|
165
|
+
deny: (id: string, reason?: string) => void;
|
|
166
|
+
/**
|
|
167
|
+
* Answer one of `pendingQuestions`: `{ choice: [label] }` (labels as offered; several only when
|
|
168
|
+
* `multiple`), `{ other: text }` (only when `allowOther`) or `{ declined: true }`. False when no
|
|
169
|
+
* such question is waiting (answered, expired, stopped). The answer goes to the core and is not
|
|
170
|
+
* kept here.
|
|
171
|
+
*/
|
|
172
|
+
answerQuestion: (id: string, answer: AskUserAnswer) => boolean;
|
|
173
|
+
/** Switch the consent policy live — the "autopilot" toggle. */
|
|
174
|
+
setApprovalMode: (mode: ToolApprovalMode) => void;
|
|
175
|
+
/**
|
|
176
|
+
* Ask the agent's consent gate about a tool call an MCP App wants to make (the core's
|
|
177
|
+
* `Agent.approveAppToolCall`: the same rules and modes as the model's calls - 'autopilot' asks
|
|
178
|
+
* nothing -, "always allow" kept apart from the model's and for the page's life, not the
|
|
179
|
+
* agent's: `appToolGrants`). The request joins `pendingApprovals` with `app` set,
|
|
180
|
+
* and waits across runs - a run ending or `stop()` does not answer it; `signal` does (the
|
|
181
|
+
* app's frame going away). `call.frame` (the frame's `AppView.id`) is put on the request's
|
|
182
|
+
* `app`, so it is drawn with THAT frame; `call.serverId` (`McpAppTool.serverId`) scopes the
|
|
183
|
+
* grant to the server's connection. Resolves when the call may go; throws when it may not.
|
|
184
|
+
*/
|
|
185
|
+
approveAppToolCall: (call: AppToolCall, signal?: AbortSignal) => Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Answer a completion an MCP App asks for (its `sampling/createMessage`) with the agent's model:
|
|
188
|
+
* the core's `Agent.sampleForApp` - checked, rate-limited per app, put to `approve` (shown
|
|
189
|
+
* exactly what the model gets), then sent with no tools and none of the conversation. The
|
|
190
|
+
* tokens count in `totalUsage` (a `usage` event of phase `'app'`, never the run's); the answer
|
|
191
|
+
* is returned to the caller and never reaches the transcript, the memory or the model's context.
|
|
192
|
+
* Throws the core's `AppSamplingError` (its `rpcCode` is what the app is told).
|
|
193
|
+
*/
|
|
194
|
+
sampleForApp: (request: AppSamplingRequest, approve: (view: AppSamplingView) => Promise<boolean>, signal?: AbortSignal) => Promise<AppSamplingResult>;
|
|
195
|
+
/** Summarise the stored transcript now (needs `config.memory`). */
|
|
196
|
+
compact: () => Promise<CompactResult | undefined>;
|
|
197
|
+
/**
|
|
198
|
+
* Switch to another conversation: its id becomes the memory session of the
|
|
199
|
+
* next runs, and its saved transcript (chat history) is shown.
|
|
200
|
+
*/
|
|
201
|
+
loadChat: (chat: {
|
|
202
|
+
sessionId: string;
|
|
203
|
+
messages?: ChatMessage[];
|
|
204
|
+
totalUsage?: IUsage;
|
|
205
|
+
}) => void;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* The agent as a store: `getSnapshot` + `subscribe` (React's `useSyncExternalStore` contract),
|
|
209
|
+
* the methods a view calls, `update` and `dispose`.
|
|
210
|
+
*/
|
|
211
|
+
interface AgentController extends AgentControllerActions {
|
|
212
|
+
/** The current snapshot: the same object until something changes, then a new one. */
|
|
213
|
+
getSnapshot: () => AgentControllerSnapshot;
|
|
214
|
+
/**
|
|
215
|
+
* Call `listener` after every change (never at once on subscribing). Returns the unsubscribe.
|
|
216
|
+
* After `dispose` nothing is called and subscribing does nothing.
|
|
217
|
+
*/
|
|
218
|
+
subscribe: (listener: () => void) => () => void;
|
|
219
|
+
/** Take a new config (and options): see {@link AgentControllerUpdate}. */
|
|
220
|
+
update: (config: BrowserAgentConfig, how?: AgentControllerUpdate) => void;
|
|
221
|
+
/**
|
|
222
|
+
* Tear everything down: the in-flight run aborted, its consent requests and questions answered
|
|
223
|
+
* (denied / declined: "the view was closed"), the build in progress dropped, the other-tab
|
|
224
|
+
* channels closed, pending timers cleared, every listener dropped. The snapshot stays as it was;
|
|
225
|
+
* every method is then a no-op (`run` resolves `undefined`). Idempotent.
|
|
226
|
+
*/
|
|
227
|
+
dispose: () => void;
|
|
228
|
+
/** The built agent, once ready (`undefined` while building, after a failure or `dispose`). */
|
|
229
|
+
readonly agent: Agent | undefined;
|
|
230
|
+
/** Whether `dispose` was called. */
|
|
231
|
+
readonly disposed: boolean;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* What a controller's snapshot is before anything happened: what a view renders before it has a
|
|
235
|
+
* controller (React's first render, which must not create one; a server render).
|
|
236
|
+
*/
|
|
237
|
+
declare const createInitialAgentSnapshot: (config: BrowserAgentConfig) => AgentControllerSnapshot;
|
|
238
|
+
/**
|
|
239
|
+
* Build the agent from `config` and keep its UI state: see {@link AgentController}. The agent is
|
|
240
|
+
* built at once (unless `autoStart: false` or the config has no `model` yet), and other tabs are
|
|
241
|
+
* followed from now on - so create it when the view appears and `dispose` it when the view goes.
|
|
242
|
+
*
|
|
243
|
+
* ```js
|
|
244
|
+
* const chat = createAgentController({ model, credentials, toolApproval: { mode: 'ask-writes' } })
|
|
245
|
+
* const off = chat.subscribe(() => render(chat.getSnapshot()))
|
|
246
|
+
* button.onclick = () => chat.run(input.value)
|
|
247
|
+
* // later: off(); chat.dispose()
|
|
248
|
+
* ```
|
|
249
|
+
*/
|
|
250
|
+
declare const createAgentController: (initialConfig: BrowserAgentConfig, initialOptions?: AgentControllerOptions) => AgentController;
|
|
251
|
+
|
|
252
|
+
export { createAgentController, createInitialAgentSnapshot };
|
|
253
|
+
export type { AgentController, AgentControllerActions, AgentControllerOptions, AgentControllerSnapshot, AgentControllerUpdate, AppToolCall, ApproveOptions, RunGoalOptions };
|