donobu 5.51.0 → 5.52.0
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.
|
@@ -145,7 +145,10 @@ class DonobuFlow {
|
|
|
145
145
|
async run() {
|
|
146
146
|
while (true) {
|
|
147
147
|
try {
|
|
148
|
-
this.controlPanel.update({
|
|
148
|
+
this.controlPanel.update({
|
|
149
|
+
state: this.metadata.state,
|
|
150
|
+
availableToolNames: this.toolManager.tools.map((t) => t.name),
|
|
151
|
+
});
|
|
149
152
|
switch (this.metadata.state) {
|
|
150
153
|
case 'UNSTARTED':
|
|
151
154
|
await this.onUnstarted();
|
|
@@ -339,6 +342,14 @@ class DonobuFlow {
|
|
|
339
342
|
});
|
|
340
343
|
this.metadata.state = 'RUNNING_ACTION';
|
|
341
344
|
break;
|
|
345
|
+
case 'RUN_TOOL':
|
|
346
|
+
this.proposedToolCalls.length = 0;
|
|
347
|
+
this.proposedToolCalls.push({
|
|
348
|
+
name: userAction.toolName,
|
|
349
|
+
parameters: userAction.parameters,
|
|
350
|
+
});
|
|
351
|
+
this.metadata.state = 'RUNNING_ACTION';
|
|
352
|
+
break;
|
|
342
353
|
}
|
|
343
354
|
await this.persistence.setFlowMetadata(this.metadata);
|
|
344
355
|
}
|
|
@@ -6,10 +6,17 @@ export type UserAction = {
|
|
|
6
6
|
userInstruction?: string;
|
|
7
7
|
} | {
|
|
8
8
|
type: 'END';
|
|
9
|
+
} | {
|
|
10
|
+
type: 'RUN_TOOL';
|
|
11
|
+
toolName: string;
|
|
12
|
+
parameters: Record<string, unknown>;
|
|
9
13
|
};
|
|
10
14
|
export type ControlPanelDataUpdate = {
|
|
11
15
|
state: State;
|
|
12
16
|
headline?: string;
|
|
17
|
+
/** Names of tools loaded in the flow's ToolManager. Surfaced to the UI so
|
|
18
|
+
* the control panel can offer only tools the flow can actually run. */
|
|
19
|
+
availableToolNames?: string[];
|
|
13
20
|
};
|
|
14
21
|
export interface ControlPanel {
|
|
15
22
|
/** Cheap, idempotent render update. */
|
|
@@ -145,7 +145,10 @@ class DonobuFlow {
|
|
|
145
145
|
async run() {
|
|
146
146
|
while (true) {
|
|
147
147
|
try {
|
|
148
|
-
this.controlPanel.update({
|
|
148
|
+
this.controlPanel.update({
|
|
149
|
+
state: this.metadata.state,
|
|
150
|
+
availableToolNames: this.toolManager.tools.map((t) => t.name),
|
|
151
|
+
});
|
|
149
152
|
switch (this.metadata.state) {
|
|
150
153
|
case 'UNSTARTED':
|
|
151
154
|
await this.onUnstarted();
|
|
@@ -339,6 +342,14 @@ class DonobuFlow {
|
|
|
339
342
|
});
|
|
340
343
|
this.metadata.state = 'RUNNING_ACTION';
|
|
341
344
|
break;
|
|
345
|
+
case 'RUN_TOOL':
|
|
346
|
+
this.proposedToolCalls.length = 0;
|
|
347
|
+
this.proposedToolCalls.push({
|
|
348
|
+
name: userAction.toolName,
|
|
349
|
+
parameters: userAction.parameters,
|
|
350
|
+
});
|
|
351
|
+
this.metadata.state = 'RUNNING_ACTION';
|
|
352
|
+
break;
|
|
342
353
|
}
|
|
343
354
|
await this.persistence.setFlowMetadata(this.metadata);
|
|
344
355
|
}
|
|
@@ -6,10 +6,17 @@ export type UserAction = {
|
|
|
6
6
|
userInstruction?: string;
|
|
7
7
|
} | {
|
|
8
8
|
type: 'END';
|
|
9
|
+
} | {
|
|
10
|
+
type: 'RUN_TOOL';
|
|
11
|
+
toolName: string;
|
|
12
|
+
parameters: Record<string, unknown>;
|
|
9
13
|
};
|
|
10
14
|
export type ControlPanelDataUpdate = {
|
|
11
15
|
state: State;
|
|
12
16
|
headline?: string;
|
|
17
|
+
/** Names of tools loaded in the flow's ToolManager. Surfaced to the UI so
|
|
18
|
+
* the control panel can offer only tools the flow can actually run. */
|
|
19
|
+
availableToolNames?: string[];
|
|
13
20
|
};
|
|
14
21
|
export interface ControlPanel {
|
|
15
22
|
/** Cheap, idempotent render update. */
|