@loopstack/hitl 0.4.1 → 0.4.3
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 +178 -51
- package/dist/tools/ask-clarification.tool.d.ts +2 -2
- package/dist/tools/ask-clarification.tool.d.ts.map +1 -1
- package/dist/tools/ask-clarification.tool.js +4 -7
- package/dist/tools/ask-clarification.tool.js.map +1 -1
- package/dist/tools/ask-for-approval.tool.d.ts +2 -2
- package/dist/tools/ask-for-approval.tool.d.ts.map +1 -1
- package/dist/tools/ask-for-approval.tool.js +4 -13
- package/dist/tools/ask-for-approval.tool.js.map +1 -1
- package/dist/workflows/ask-user/ask-user.workflow.d.ts +2 -2
- package/dist/workflows/ask-user/ask-user.workflow.d.ts.map +1 -1
- package/dist/workflows/ask-user/ask-user.workflow.js.map +1 -1
- package/dist/workflows/confirm-user/confirm-user.workflow.d.ts +2 -2
- package/dist/workflows/confirm-user/confirm-user.workflow.d.ts.map +1 -1
- package/dist/workflows/confirm-user/confirm-user.workflow.js.map +1 -1
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -1,112 +1,239 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
---
|
|
2
|
+
title: Human-in-the-Loop Module
|
|
3
|
+
description: HITL workflows and tools for Loopstack — AskUserWorkflow (free-text, confirm, multiple-choice), ConfirmUserWorkflow (markdown review + confirm/deny), AskClarificationTool, AskForApprovalTool, document types for UI rendering
|
|
4
|
+
---
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
# @loopstack/hitl
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
> Human-in-the-loop module for the [Loopstack](https://loopstack.ai) automation framework.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
Pause a running workflow or agent loop, ask the user a question or request confirmation, and resume once they answer. Ships with ready-to-use workflows, agent tools, and document types that render prompts in the Studio UI.
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
## When to Use
|
|
12
13
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
- **
|
|
14
|
+
- **Your workflow needs user input** before it can continue — a name, a choice, a yes/no decision. Use `AskUserWorkflow` as a sub-workflow.
|
|
15
|
+
- **Your workflow needs explicit approval** of generated content (e.g. a plan, a summary, a code diff). Use `ConfirmUserWorkflow`.
|
|
16
|
+
- **Your LLM agent needs to ask the user a question** mid-loop without exiting. Use `AskClarificationTool` — it pauses the agent, collects the answer, and resumes.
|
|
17
|
+
- **Your LLM agent needs user approval** before proceeding. Use `AskForApprovalTool` — it shows markdown content and waits for confirm/deny.
|
|
16
18
|
|
|
17
19
|
## Installation
|
|
18
20
|
|
|
19
|
-
```
|
|
21
|
+
```bash
|
|
20
22
|
npm install @loopstack/hitl
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
Register the module:
|
|
24
26
|
|
|
25
|
-
```
|
|
27
|
+
```typescript
|
|
28
|
+
import { Module } from '@nestjs/common';
|
|
26
29
|
import { HitlModule } from '@loopstack/hitl';
|
|
27
30
|
|
|
28
31
|
@Module({
|
|
29
|
-
imports: [HitlModule
|
|
32
|
+
imports: [HitlModule],
|
|
33
|
+
providers: [MyWorkflow],
|
|
30
34
|
})
|
|
31
|
-
export class
|
|
35
|
+
export class MyModule {}
|
|
32
36
|
```
|
|
33
37
|
|
|
34
|
-
##
|
|
38
|
+
## Quick Start
|
|
35
39
|
|
|
36
|
-
###
|
|
40
|
+
### Sub-workflow: Ask a question
|
|
37
41
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
import { BaseWorkflow, Transition, Workflow } from '@loopstack/common';
|
|
42
|
+
```typescript
|
|
43
|
+
import { z } from 'zod';
|
|
44
|
+
import { BaseWorkflow, CallbackSchema, MessageDocument, Transition, Workflow } from '@loopstack/common';
|
|
42
45
|
import { AskUserWorkflow } from '@loopstack/hitl';
|
|
43
46
|
|
|
44
|
-
|
|
47
|
+
const AnswerCallback = CallbackSchema.extend({
|
|
48
|
+
data: z.object({ answer: z.string() }),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
@Workflow({ title: 'My Workflow' })
|
|
45
52
|
export class MyWorkflow extends BaseWorkflow {
|
|
46
53
|
constructor(private readonly askUser: AskUserWorkflow) {
|
|
47
54
|
super();
|
|
48
55
|
}
|
|
49
56
|
|
|
50
|
-
@Transition({
|
|
51
|
-
async
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
@Transition({ to: 'waiting' })
|
|
58
|
+
async start(state: Record<string, unknown>): Promise<Record<string, unknown>> {
|
|
59
|
+
await this.askUser.run(
|
|
60
|
+
{ question: 'What is your name?' },
|
|
61
|
+
{ callback: { transition: 'answerReceived' }, show: 'inline', label: 'Waiting for answer...' },
|
|
62
|
+
);
|
|
63
|
+
return state;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@Transition({ from: 'waiting', to: 'end', wait: true, schema: AnswerCallback })
|
|
67
|
+
async answerReceived(state: Record<string, unknown>, payload: z.infer<typeof AnswerCallback>): Promise<unknown> {
|
|
68
|
+
await this.documentStore.save(MessageDocument, {
|
|
69
|
+
role: 'assistant',
|
|
70
|
+
text: `Hello, ${payload.data.answer}!`,
|
|
71
|
+
});
|
|
72
|
+
return {};
|
|
54
73
|
}
|
|
55
74
|
}
|
|
56
75
|
```
|
|
57
76
|
|
|
58
|
-
###
|
|
77
|
+
### Agent tool: Ask for clarification
|
|
59
78
|
|
|
60
|
-
|
|
79
|
+
Register the tool in your module so an LLM agent can call it mid-loop:
|
|
61
80
|
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
81
|
+
```typescript
|
|
82
|
+
import { Module } from '@nestjs/common';
|
|
83
|
+
import { AgentModule } from '@loopstack/agent';
|
|
84
|
+
import { HitlModule } from '@loopstack/hitl';
|
|
85
|
+
import { AskClarificationTool } from '@loopstack/hitl';
|
|
86
|
+
|
|
87
|
+
@Module({
|
|
88
|
+
imports: [AgentModule, HitlModule],
|
|
89
|
+
providers: [MyWorkflow, AskClarificationTool],
|
|
90
|
+
})
|
|
91
|
+
export class MyModule {}
|
|
92
|
+
```
|
|
69
93
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
94
|
+
Then include it in the agent's tool list:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
await this.agent.run({
|
|
98
|
+
system: 'You are a helpful assistant. Ask the user for clarification when needed.',
|
|
99
|
+
tools: ['search', 'ask_clarification'],
|
|
100
|
+
userMessage: 'Help me plan my project.',
|
|
73
101
|
});
|
|
74
102
|
```
|
|
75
103
|
|
|
76
|
-
|
|
104
|
+
## How It Works
|
|
77
105
|
|
|
78
|
-
|
|
106
|
+
### AskUserWorkflow
|
|
79
107
|
|
|
80
|
-
|
|
108
|
+
A sub-workflow with three modes, selected via the `mode` arg:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
start → show_question → waiting_for_user → end
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The `show_question` state uses guard-based routing to save the correct document type:
|
|
115
|
+
|
|
116
|
+
- **text** (default) — saves `AskUserDocument`, renders a free-text input
|
|
117
|
+
- **options** — saves `AskUserOptionsDocument`, renders a choice list
|
|
118
|
+
- **confirm** — saves `AskUserConfirmDocument`, renders yes/no buttons
|
|
119
|
+
|
|
120
|
+
**Returns:** `{ answer: string }`
|
|
121
|
+
|
|
122
|
+
#### Multiple-choice and confirmation modes
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
// Multiple choice
|
|
126
|
+
await this.askUser.run(
|
|
127
|
+
{
|
|
128
|
+
question: 'Which environment?',
|
|
129
|
+
mode: 'options',
|
|
130
|
+
options: ['staging', 'production'],
|
|
131
|
+
allowCustomAnswer: false,
|
|
132
|
+
},
|
|
133
|
+
{ callback: { transition: 'envSelected' } },
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
// Yes/No confirmation
|
|
137
|
+
await this.askUser.run(
|
|
138
|
+
{
|
|
139
|
+
question: 'Proceed with deletion?',
|
|
140
|
+
mode: 'confirm',
|
|
141
|
+
},
|
|
142
|
+
{ callback: { transition: 'confirmed' } },
|
|
143
|
+
);
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### ConfirmUserWorkflow
|
|
147
|
+
|
|
148
|
+
Shows markdown content and waits for a confirm or deny response:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
start → waiting_for_confirmation → end
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Two wait transitions (`userConfirmed` / `userDenied`) resolve to different results.
|
|
155
|
+
|
|
156
|
+
**Returns:** `{ confirmed: boolean, markdown: string }`
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
81
159
|
import { ConfirmUserWorkflow } from '@loopstack/hitl';
|
|
82
160
|
|
|
83
|
-
const
|
|
84
|
-
markdown: '## About to commit\n\n- 3 files changed',
|
|
85
|
-
}
|
|
161
|
+
const result = await this.confirmUser.run(
|
|
162
|
+
{ markdown: '## About to commit\n\n- 3 files changed' },
|
|
163
|
+
{ callback: { transition: 'decisionReceived' } },
|
|
164
|
+
);
|
|
86
165
|
```
|
|
87
166
|
|
|
88
|
-
###
|
|
167
|
+
### Agent Tools
|
|
168
|
+
|
|
169
|
+
Both tools follow the same pattern: launch the corresponding sub-workflow, return a `pending` result, and complete when the user responds. The agent loop pauses automatically while waiting.
|
|
170
|
+
|
|
171
|
+
## Args Reference
|
|
172
|
+
|
|
173
|
+
### AskUserWorkflow
|
|
174
|
+
|
|
175
|
+
| Arg | Type | Required | Description |
|
|
176
|
+
| ------------------- | ---------------------------------- | -------- | -------------------------------------- |
|
|
177
|
+
| `question` | `string` | yes | The question to display |
|
|
178
|
+
| `mode` | `'text' \| 'options' \| 'confirm'` | no | Presentation mode (default: `'text'`) |
|
|
179
|
+
| `options` | `string[]` | no | Choices when mode is `'options'` |
|
|
180
|
+
| `allowCustomAnswer` | `boolean` | no | Show free-text input alongside options |
|
|
181
|
+
|
|
182
|
+
**Returns:** `{ answer: string }`
|
|
183
|
+
|
|
184
|
+
### ConfirmUserWorkflow
|
|
185
|
+
|
|
186
|
+
| Arg | Type | Required | Description |
|
|
187
|
+
| ---------- | -------- | -------- | ----------------------------------- |
|
|
188
|
+
| `markdown` | `string` | yes | Markdown content to show for review |
|
|
189
|
+
|
|
190
|
+
**Returns:** `{ confirmed: boolean, markdown: string }`
|
|
89
191
|
|
|
90
|
-
|
|
192
|
+
## Tools Reference
|
|
193
|
+
|
|
194
|
+
### `ask_clarification`
|
|
195
|
+
|
|
196
|
+
Ask the user a clarification question mid-agent-loop. Pauses the agent, waits for user input, resumes with the answer.
|
|
197
|
+
|
|
198
|
+
| Arg | Type | Required | Description |
|
|
199
|
+
| ------------------- | ---------------------------------- | -------- | --------------------------------- |
|
|
200
|
+
| `question` | `string` | yes | The clarification question |
|
|
201
|
+
| `mode` | `'text' \| 'options' \| 'confirm'` | no | Presentation mode |
|
|
202
|
+
| `options` | `string[]` | no | Choices when mode is `'options'` |
|
|
203
|
+
| `allowCustomAnswer` | `boolean` | no | Allow free-text alongside options |
|
|
204
|
+
|
|
205
|
+
**Returns:** the user's answer as a string
|
|
206
|
+
|
|
207
|
+
### `ask_for_approval`
|
|
208
|
+
|
|
209
|
+
Present markdown content to the user for approval. Pauses the agent until the user confirms or denies.
|
|
210
|
+
|
|
211
|
+
| Arg | Type | Required | Description |
|
|
212
|
+
| --------- | -------- | -------- | ---------------------------------------- |
|
|
213
|
+
| `concept` | `string` | yes | Markdown content to present for approval |
|
|
214
|
+
|
|
215
|
+
**Returns:** `{ concept: string }` if approved, `{ denied: true }` if denied
|
|
91
216
|
|
|
92
217
|
## Public API
|
|
93
218
|
|
|
94
219
|
- **Module:** `HitlModule`
|
|
95
220
|
- **Workflows:** `AskUserWorkflow`, `ConfirmUserWorkflow`
|
|
221
|
+
- **Tools:** `AskClarificationTool`, `AskForApprovalTool`
|
|
96
222
|
- **Documents:** `AskUserDocument`, `AskUserConfirmDocument`, `AskUserOptionsDocument`, `ConfirmUserDocument`
|
|
97
223
|
|
|
98
224
|
## Dependencies
|
|
99
225
|
|
|
100
|
-
- `@loopstack/common` — `BaseWorkflow`, decorators
|
|
226
|
+
- `@loopstack/common` — `BaseWorkflow`, `BaseTool`, decorators
|
|
101
227
|
- `@loopstack/core` — `LoopCoreModule`
|
|
102
228
|
|
|
229
|
+
## Related
|
|
230
|
+
|
|
231
|
+
- [Human-in-the-Loop Patterns](https://loopstack.ai/docs/build/patterns/human-in-the-loop) — wait transitions, document actions, conditional widgets
|
|
232
|
+
- [hitl-ask-user-example-workflow](https://loopstack.ai/registry/loopstack-hitl-ask-user-example-workflow) — AskUserWorkflow example with callback
|
|
233
|
+
- [hitl-confirm-example-workflow](https://loopstack.ai/registry/loopstack-hitl-confirm-example-workflow) — ConfirmUserWorkflow example with confirm/deny
|
|
234
|
+
|
|
103
235
|
## About
|
|
104
236
|
|
|
105
237
|
Author: [Jakob Klippel](https://www.linkedin.com/in/jakob-klippel/)
|
|
106
238
|
|
|
107
239
|
License: MIT
|
|
108
|
-
|
|
109
|
-
### Additional Resources
|
|
110
|
-
|
|
111
|
-
- [Loopstack Documentation](https://loopstack.ai/docs)
|
|
112
|
-
- Find more Loopstack modules in the [Loopstack Registry](https://loopstack.ai/registry)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { BaseTool, ToolCallOptions, ToolResult } from '@loopstack/common';
|
|
3
|
-
import type {
|
|
3
|
+
import type { RunContext } from '@loopstack/common';
|
|
4
4
|
import { AskUserWorkflow } from '../workflows/ask-user/ask-user.workflow.js';
|
|
5
5
|
declare const AskClarificationInputSchema: z.ZodObject<{
|
|
6
6
|
question: z.ZodString;
|
|
@@ -19,7 +19,7 @@ export type AskClarificationResult = {
|
|
|
19
19
|
export declare class AskClarificationTool extends BaseTool<AskClarificationInput, object, AskClarificationResult> {
|
|
20
20
|
private readonly askUserWorkflow;
|
|
21
21
|
constructor(askUserWorkflow: AskUserWorkflow);
|
|
22
|
-
protected handle(args: AskClarificationInput, ctx:
|
|
22
|
+
protected handle(args: AskClarificationInput, ctx: RunContext, options?: ToolCallOptions): Promise<ToolResult<AskClarificationResult>>;
|
|
23
23
|
complete(result: Record<string, unknown>): Promise<ToolResult<AskClarificationResult>>;
|
|
24
24
|
}
|
|
25
25
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-clarification.tool.d.ts","sourceRoot":"","sources":["../../src/tools/ask-clarification.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"ask-clarification.tool.d.ts","sourceRoot":"","sources":["../../src/tools/ask-clarification.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAQ,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAE7E,QAAA,MAAM,2BAA2B;;;;;;;;;kBAyBtB,CAAC;AAEZ,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEzE,MAAM,MAAM,sBAAsB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/F,qBAQa,oBAAqB,SAAQ,QAAQ,CAAC,qBAAqB,EAAE,MAAM,EAAE,sBAAsB,CAAC;IAC3F,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;cAI7C,MAAM,CACpB,IAAI,EAAE,qBAAqB,EAC3B,GAAG,EAAE,UAAU,EACf,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;IAiBxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;CAI7F"}
|
|
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
-
import { BaseTool,
|
|
11
|
+
import { BaseTool, Tool } from '@loopstack/common';
|
|
12
12
|
import { AskUserWorkflow } from '../workflows/ask-user/ask-user.workflow.js';
|
|
13
13
|
const AskClarificationInputSchema = z
|
|
14
14
|
.object({
|
|
@@ -44,17 +44,14 @@ let AskClarificationTool = class AskClarificationTool extends BaseTool {
|
|
|
44
44
|
mode: args.mode,
|
|
45
45
|
options: args.options,
|
|
46
46
|
allowCustomAnswer: args.allowCustomAnswer,
|
|
47
|
-
}, { callback: options?.callback });
|
|
48
|
-
const workflowId = result.workflowId;
|
|
49
|
-
await this.documentStore.save(LinkDocument, { status: 'pending', label: 'Waiting for user answer...', workflowId, embed: true, expanded: true }, { id: `ask_clarification_link_${workflowId}` });
|
|
47
|
+
}, { callback: options?.callback, show: 'inline', label: 'Waiting for user answer...' });
|
|
50
48
|
return {
|
|
51
|
-
data: { workflowId },
|
|
52
|
-
pending: { workflowId },
|
|
49
|
+
data: { workflowId: result.workflowId },
|
|
50
|
+
pending: { workflowId: result.workflowId },
|
|
53
51
|
};
|
|
54
52
|
}
|
|
55
53
|
async complete(result) {
|
|
56
54
|
const data = result;
|
|
57
|
-
await this.documentStore.save(LinkDocument, { status: 'success', label: 'User answered', workflowId: data.workflowId, embed: true, expanded: false }, { id: `ask_clarification_link_${data.workflowId}` });
|
|
58
55
|
return { data: data.data?.answer ?? result };
|
|
59
56
|
}
|
|
60
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-clarification.tool.js","sourceRoot":"","sources":["../../src/tools/ask-clarification.tool.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"ask-clarification.tool.js","sourceRoot":"","sources":["../../src/tools/ask-clarification.tool.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAA+B,MAAM,mBAAmB,CAAC;AAEhF,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAE7E,MAAM,2BAA2B,GAAG,CAAC;KAClC,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,CAAC,kGAAkG,CAAC;IAC/G,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;SACpC,QAAQ,EAAE;SACV,QAAQ,CACP,2EAA2E;QACzE,+DAA+D;QAC/D,mCAAmC,CACtC;IACH,OAAO,EAAE,CAAC;SACP,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,8EAA8E,CAAC;IAC3F,iBAAiB,EAAE,CAAC;SACjB,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CACP,4EAA4E;QAC1E,0DAA0D,CAC7D;CACJ,CAAC;KACD,MAAM,EAAE,CAAC;AAcL,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,QAA+D;IAC1E;IAA7B,YAA6B,eAAgC;QAC3D,KAAK,EAAE,CAAC;QADmB,oBAAe,GAAf,eAAe,CAAiB;IAE7D,CAAC;IAES,KAAK,CAAC,MAAM,CACpB,IAA2B,EAC3B,GAAe,EACf,OAAyB;QAEzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAC3C;YACE,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,EACD,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,4BAA4B,EAAE,CACrF,CAAC;QAEF,OAAO;YACL,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE;YACvC,OAAO,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE;SAC3C,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAA+B;QAC5C,MAAM,IAAI,GAAG,MAAwC,CAAC;QACtD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,MAAM,EAAE,CAAC;IAC/C,CAAC;CACF,CAAA;AA9BY,oBAAoB;IARhC,IAAI,CAAC;QACJ,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,mEAAmE;YACnE,gFAAgF;YAChF,8DAA8D;QAChE,MAAM,EAAE,2BAA2B;KACpC,CAAC;qCAE8C,eAAe;GADlD,oBAAoB,CA8BhC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { BaseTool, ToolCallOptions, ToolResult } from '@loopstack/common';
|
|
3
|
-
import type {
|
|
3
|
+
import type { RunContext } from '@loopstack/common';
|
|
4
4
|
import { ConfirmUserWorkflow } from '../workflows/confirm-user/confirm-user.workflow.js';
|
|
5
5
|
declare const AskForApprovalInputSchema: z.ZodObject<{
|
|
6
6
|
concept: z.ZodString;
|
|
@@ -16,7 +16,7 @@ export type AskForApprovalResult = {
|
|
|
16
16
|
export declare class AskForApprovalTool extends BaseTool<AskForApprovalInput, object, AskForApprovalResult> {
|
|
17
17
|
private readonly confirmUserWorkflow;
|
|
18
18
|
constructor(confirmUserWorkflow: ConfirmUserWorkflow);
|
|
19
|
-
protected handle(args: AskForApprovalInput, ctx:
|
|
19
|
+
protected handle(args: AskForApprovalInput, ctx: RunContext, options?: ToolCallOptions): Promise<ToolResult<AskForApprovalResult>>;
|
|
20
20
|
complete(result: Record<string, unknown>): Promise<ToolResult<AskForApprovalResult>>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-for-approval.tool.d.ts","sourceRoot":"","sources":["../../src/tools/ask-for-approval.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"ask-for-approval.tool.d.ts","sourceRoot":"","sources":["../../src/tools/ask-for-approval.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAQ,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AAEzF,QAAA,MAAM,yBAAyB;;kBAIpB,CAAC;AAEZ,KAAK,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAErE,MAAM,MAAM,oBAAoB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,CAAC;AAE/G,qBAQa,kBAAmB,SAAQ,QAAQ,CAAC,mBAAmB,EAAE,MAAM,EAAE,oBAAoB,CAAC;IACrF,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,mBAAmB;cAIrD,MAAM,CACpB,IAAI,EAAE,mBAAmB,EACzB,GAAG,EAAE,UAAU,EACf,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAYtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;CAK3F"}
|
|
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
-
import { BaseTool,
|
|
11
|
+
import { BaseTool, Tool } from '@loopstack/common';
|
|
12
12
|
import { ConfirmUserWorkflow } from '../workflows/confirm-user/confirm-user.workflow.js';
|
|
13
13
|
const AskForApprovalInputSchema = z
|
|
14
14
|
.object({
|
|
@@ -22,24 +22,15 @@ let AskForApprovalTool = class AskForApprovalTool extends BaseTool {
|
|
|
22
22
|
this.confirmUserWorkflow = confirmUserWorkflow;
|
|
23
23
|
}
|
|
24
24
|
async handle(args, ctx, options) {
|
|
25
|
-
const result = await this.confirmUserWorkflow.run({ markdown: args.concept }, { callback: options?.callback });
|
|
26
|
-
const workflowId = result.workflowId;
|
|
27
|
-
await this.documentStore.save(LinkDocument, { status: 'pending', label: 'Waiting for approval...', workflowId, embed: true, expanded: true }, { id: `ask_for_approval_link_${workflowId}` });
|
|
25
|
+
const result = await this.confirmUserWorkflow.run({ markdown: args.concept }, { callback: options?.callback, show: 'inline', label: 'Waiting for approval...' });
|
|
28
26
|
return {
|
|
29
|
-
data: { workflowId },
|
|
30
|
-
pending: { workflowId },
|
|
27
|
+
data: { workflowId: result.workflowId },
|
|
28
|
+
pending: { workflowId: result.workflowId },
|
|
31
29
|
};
|
|
32
30
|
}
|
|
33
31
|
async complete(result) {
|
|
34
32
|
const data = result;
|
|
35
33
|
const approved = data.data?.confirmed ?? false;
|
|
36
|
-
await this.documentStore.save(LinkDocument, {
|
|
37
|
-
status: approved ? 'success' : 'failure',
|
|
38
|
-
label: approved ? 'Concept approved' : 'Concept denied',
|
|
39
|
-
workflowId: data.workflowId,
|
|
40
|
-
embed: true,
|
|
41
|
-
expanded: false,
|
|
42
|
-
}, { id: `ask_for_approval_link_${data.workflowId}` });
|
|
43
34
|
return { data: approved ? { concept: data.data?.markdown } : { denied: true } };
|
|
44
35
|
}
|
|
45
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-for-approval.tool.js","sourceRoot":"","sources":["../../src/tools/ask-for-approval.tool.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"ask-for-approval.tool.js","sourceRoot":"","sources":["../../src/tools/ask-for-approval.tool.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAA+B,MAAM,mBAAmB,CAAC;AAEhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AAEzF,MAAM,yBAAyB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sEAAsE,CAAC;CACrG,CAAC;KACD,MAAM,EAAE,CAAC;AAcL,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,QAA2D;IACpE;IAA7B,YAA6B,mBAAwC;QACnE,KAAK,EAAE,CAAC;QADmB,wBAAmB,GAAnB,mBAAmB,CAAqB;IAErE,CAAC;IAES,KAAK,CAAC,MAAM,CACpB,IAAyB,EACzB,GAAe,EACf,OAAyB;QAEzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAC/C,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,EAC1B,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAClF,CAAC;QAEF,OAAO;YACL,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE;YACvC,OAAO,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE;SAC3C,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAA+B;QAC5C,MAAM,IAAI,GAAG,MAA8D,CAAC;QAC5E,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,SAAS,IAAI,KAAK,CAAC;QAC/C,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;IAClF,CAAC;CACF,CAAA;AA1BY,kBAAkB;IAR9B,IAAI,CAAC;QACJ,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,iGAAiG;YACjG,oFAAoF;YACpF,8DAA8D;QAChE,MAAM,EAAE,yBAAyB;KAClC,CAAC;qCAEkD,mBAAmB;GAD1D,kBAAkB,CA0B9B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RunContext } from '@loopstack/common';
|
|
3
3
|
import { BaseWorkflow } from '@loopstack/common';
|
|
4
4
|
declare const AskUserArgsSchema: z.ZodObject<{
|
|
5
5
|
question: z.ZodString;
|
|
@@ -14,7 +14,7 @@ declare const AskUserArgsSchema: z.ZodObject<{
|
|
|
14
14
|
type AskUserArgs = z.infer<typeof AskUserArgsSchema>;
|
|
15
15
|
type AskUserState = AskUserArgs;
|
|
16
16
|
export declare class AskUserWorkflow extends BaseWorkflow<AskUserArgs, AskUserState> {
|
|
17
|
-
start(state: AskUserState, ctx:
|
|
17
|
+
start(state: AskUserState, ctx: RunContext): Promise<AskUserState>;
|
|
18
18
|
showQuestionOptions(state: AskUserState): Promise<AskUserState>;
|
|
19
19
|
showQuestionConfirm(state: AskUserState): Promise<AskUserState>;
|
|
20
20
|
showQuestionText(state: AskUserState): Promise<AskUserState>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user.workflow.d.ts","sourceRoot":"","sources":["../../../src/workflows/ask-user/ask-user.workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ask-user.workflow.d.ts","sourceRoot":"","sources":["../../../src/workflows/ask-user/ask-user.workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAA+B,MAAM,mBAAmB,CAAC;AAK9E,QAAA,MAAM,iBAAiB;;;;;;;;;iBAKrB,CAAC;AAEH,KAAK,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAMrD,KAAK,YAAY,GAAG,WAAW,CAAC;AAEhC,qBAMa,eAAgB,SAAQ,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC;IAEpE,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;IAOlE,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,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AAC;IAC3E,KAAK,CAAC,eAAe,CAAC;;;;0DAItB;AAGK;IADL,UAAU,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,kBAAkB,EAAE,CAAC;;;;uDAI7D;AAGK;IADL,UAAU,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;;;;mDA4B5F;AA3DU,eAAe;IAN3B,QAAQ,CAAC;QACR,KAAK,EAAE,UAAU;QACjB,WAAW,EACT,6QAA6Q;QAC/Q,MAAM,EAAE,iBAAiB;KAC1B,CAAC;GACW,eAAe,CAsE3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RunContext } from '@loopstack/common';
|
|
2
2
|
import { BaseWorkflow } from '@loopstack/common';
|
|
3
3
|
interface ConfirmUserState {
|
|
4
4
|
markdown: string;
|
|
@@ -6,7 +6,7 @@ interface ConfirmUserState {
|
|
|
6
6
|
export declare class ConfirmUserWorkflow extends BaseWorkflow<{
|
|
7
7
|
markdown: string;
|
|
8
8
|
}, ConfirmUserState> {
|
|
9
|
-
showContent(state: ConfirmUserState, ctx:
|
|
9
|
+
showContent(state: ConfirmUserState, ctx: RunContext): Promise<ConfirmUserState>;
|
|
10
10
|
userConfirmed(state: ConfirmUserState): Promise<{
|
|
11
11
|
confirmed: boolean;
|
|
12
12
|
markdown: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-user.workflow.d.ts","sourceRoot":"","sources":["../../../src/workflows/confirm-user/confirm-user.workflow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"confirm-user.workflow.d.ts","sourceRoot":"","sources":["../../../src/workflows/confirm-user/confirm-user.workflow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAwB,MAAM,mBAAmB,CAAC;AAGvE,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qBAQa,mBAAoB,SAAQ,YAAY,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EAAE,gBAAgB,CAAC;IAErF,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAOhF,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAKzF,UAAU,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAG7F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-user.workflow.js","sourceRoot":"","sources":["../../../src/workflows/confirm-user/confirm-user.workflow.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAcxE,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,YAAoD;IAErF,AAAN,KAAK,CAAC,WAAW,CAAC,KAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"confirm-user.workflow.js","sourceRoot":"","sources":["../../../src/workflows/confirm-user/confirm-user.workflow.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;A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EAAE,CAAC,CAAC,MAAM,CAAC;YACf,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;SACrB,CAAC;KACH,CAAC;GACW,mBAAmB,CAiB/B"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"workflow",
|
|
10
10
|
"user-input"
|
|
11
11
|
],
|
|
12
|
-
"version": "0.4.
|
|
12
|
+
"version": "0.4.3",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "Jakob Klippel",
|
|
@@ -31,10 +31,11 @@
|
|
|
31
31
|
"test": "vitest run",
|
|
32
32
|
"watch": "nest build --watch"
|
|
33
33
|
},
|
|
34
|
-
"dependencies": {
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@loopstack/common": "^0.34.0",
|
|
36
|
+
"@loopstack/core": "^0.34.0"
|
|
37
|
+
},
|
|
35
38
|
"devDependencies": {
|
|
36
|
-
"@loopstack/common": "^0.32.3",
|
|
37
|
-
"@loopstack/core": "^0.32.3",
|
|
38
39
|
"@nestjs/common": "^11.1.19",
|
|
39
40
|
"@swc/core": "^1.15.33",
|
|
40
41
|
"unplugin-swc": "^1.5.9",
|
|
@@ -42,8 +43,6 @@
|
|
|
42
43
|
"zod": "^4.3.6"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
|
-
"@loopstack/common": "^0.32.3",
|
|
46
|
-
"@loopstack/core": "^0.32.3",
|
|
47
46
|
"@nestjs/common": "^11.0.0",
|
|
48
47
|
"zod": "^4.0.0"
|
|
49
48
|
},
|