@elizaos/plugin-form 2.0.0-alpha.3 → 2.0.0-alpha.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/index.d.ts +2 -174
- package/dist/{node/index.node.js → index.js} +463 -373
- package/dist/index.js.map +30 -0
- package/package.json +4 -2
- package/dist/actions/restore.d.ts +0 -62
- package/dist/actions/restore.d.ts.map +0 -1
- package/dist/builder.d.ts +0 -320
- package/dist/builder.d.ts.map +0 -1
- package/dist/builtins.d.ts +0 -128
- package/dist/builtins.d.ts.map +0 -1
- package/dist/defaults.d.ts +0 -95
- package/dist/defaults.d.ts.map +0 -1
- package/dist/evaluators/extractor.d.ts +0 -91
- package/dist/evaluators/extractor.d.ts.map +0 -1
- package/dist/extraction.d.ts +0 -105
- package/dist/extraction.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/intent.d.ts +0 -116
- package/dist/intent.d.ts.map +0 -1
- package/dist/node/index.node.js.map +0 -29
- package/dist/providers/context.d.ts +0 -69
- package/dist/providers/context.d.ts.map +0 -1
- package/dist/service.d.ts +0 -407
- package/dist/service.d.ts.map +0 -1
- package/dist/storage.d.ts +0 -228
- package/dist/storage.d.ts.map +0 -1
- package/dist/tasks/nudge.d.ts +0 -89
- package/dist/tasks/nudge.d.ts.map +0 -1
- package/dist/template.d.ts +0 -10
- package/dist/template.d.ts.map +0 -1
- package/dist/ttl.d.ts +0 -144
- package/dist/ttl.d.ts.map +0 -1
- package/dist/types.d.ts +0 -1186
- package/dist/types.d.ts.map +0 -1
- package/dist/validation.d.ts +0 -177
- package/dist/validation.d.ts.map +0 -1
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module providers/context
|
|
3
|
-
* @description Form context provider for agent awareness
|
|
4
|
-
*
|
|
5
|
-
* ## Purpose
|
|
6
|
-
*
|
|
7
|
-
* This provider injects form state into the agent's context BEFORE
|
|
8
|
-
* the agent generates a response. This allows the agent to:
|
|
9
|
-
*
|
|
10
|
-
* 1. Know if a form is active
|
|
11
|
-
* 2. Know what fields have been filled
|
|
12
|
-
* 3. Know what fields are missing
|
|
13
|
-
* 4. Know what needs confirmation
|
|
14
|
-
* 5. Know what to ask next
|
|
15
|
-
*
|
|
16
|
-
* ## How It Works
|
|
17
|
-
*
|
|
18
|
-
* ```
|
|
19
|
-
* User Message → Provider Runs → Agent Gets Context → Agent Responds
|
|
20
|
-
* ↓
|
|
21
|
-
* FormContextState
|
|
22
|
-
* ↓
|
|
23
|
-
* - hasActiveForm: true
|
|
24
|
-
* - progress: 60%
|
|
25
|
-
* - nextField: "email"
|
|
26
|
-
* - uncertainFields: [...]
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* ## Context Output
|
|
30
|
-
*
|
|
31
|
-
* The provider outputs:
|
|
32
|
-
*
|
|
33
|
-
* - `data`: Full FormContextState object (for programmatic access)
|
|
34
|
-
* - `values`: String values for template substitution
|
|
35
|
-
* - `text`: Human-readable summary for agent
|
|
36
|
-
*
|
|
37
|
-
* The `text` output is structured markdown that the agent can use
|
|
38
|
-
* to understand the form state and craft appropriate responses.
|
|
39
|
-
*
|
|
40
|
-
* ## Agent Guidance
|
|
41
|
-
*
|
|
42
|
-
* The provider includes "Agent Guidance" in the text output, giving
|
|
43
|
-
* the agent explicit suggestions:
|
|
44
|
-
*
|
|
45
|
-
* - "Ask for their email"
|
|
46
|
-
* - "Confirm: 'I understood X as Y. Is that correct?'"
|
|
47
|
-
* - "All fields collected! Nudge user to submit."
|
|
48
|
-
*
|
|
49
|
-
* ## Stashed Forms
|
|
50
|
-
*
|
|
51
|
-
* If the user has stashed forms, the provider mentions this so
|
|
52
|
-
* the agent can remind the user they have unfinished work.
|
|
53
|
-
*/
|
|
54
|
-
import type { Provider } from "@elizaos/core";
|
|
55
|
-
/**
|
|
56
|
-
* Form Context Provider
|
|
57
|
-
*
|
|
58
|
-
* Injects the current form state into the agent's context,
|
|
59
|
-
* allowing the agent to respond naturally about form progress
|
|
60
|
-
* and ask for missing fields.
|
|
61
|
-
*
|
|
62
|
-
* WHY a provider (not evaluator):
|
|
63
|
-
* - Providers run BEFORE response generation
|
|
64
|
-
* - Agent needs context to generate appropriate response
|
|
65
|
-
* - Evaluator runs AFTER, too late for response
|
|
66
|
-
*/
|
|
67
|
-
export declare const formContextProvider: Provider;
|
|
68
|
-
export default formContextProvider;
|
|
69
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/providers/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,KAAK,EAIV,QAAQ,EAIT,MAAM,eAAe,CAAC;AAUvB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,QA4OjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/dist/service.d.ts
DELETED
|
@@ -1,407 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module service
|
|
3
|
-
* @description Central service for managing agent-guided user journeys
|
|
4
|
-
*
|
|
5
|
-
* ## The Core Role
|
|
6
|
-
*
|
|
7
|
-
* The FormService is the **journey controller**. It ensures agents stay on
|
|
8
|
-
* the path defined by form definitions, guiding users reliably to outcomes.
|
|
9
|
-
*
|
|
10
|
-
* Without this service, agents would:
|
|
11
|
-
* - Forget what information they've collected
|
|
12
|
-
* - Miss required fields
|
|
13
|
-
* - Lose progress when users switch topics
|
|
14
|
-
* - Have no way to resume interrupted journeys
|
|
15
|
-
*
|
|
16
|
-
* ## What It Does
|
|
17
|
-
*
|
|
18
|
-
* 1. **Defines Journeys**: Register form definitions (the maps)
|
|
19
|
-
* 2. **Tracks Progress**: Manage sessions (where users are)
|
|
20
|
-
* 3. **Validates Stops**: Ensure collected data meets requirements
|
|
21
|
-
* 4. **Enables Pausing**: Stash journeys for later resumption
|
|
22
|
-
* 5. **Records Completions**: Store submissions (outcomes achieved)
|
|
23
|
-
* 6. **Guides Agents**: Provide context about what to do next
|
|
24
|
-
* 7. **Manages Control Types**: Widget registry for simple, composite, external types
|
|
25
|
-
*
|
|
26
|
-
* ## Widget Registry (ControlType System)
|
|
27
|
-
*
|
|
28
|
-
* The FormService manages a registry of control types:
|
|
29
|
-
*
|
|
30
|
-
* - **Simple types** (text, number, email): Just validate/parse/format
|
|
31
|
-
* - **Composite types** (address, payment setup): Have subcontrols
|
|
32
|
-
* - **External types** (payment, signature): Require async confirmation
|
|
33
|
-
*
|
|
34
|
-
* Built-in types are registered at startup. Plugins can register custom types.
|
|
35
|
-
*
|
|
36
|
-
* WHY a registry:
|
|
37
|
-
* - Decouples type definitions from form definitions
|
|
38
|
-
* - Plugins can add domain-specific types (blockchain addresses, etc.)
|
|
39
|
-
* - Override protection prevents accidental shadowing of built-ins
|
|
40
|
-
*
|
|
41
|
-
* ## Service Lifecycle
|
|
42
|
-
*
|
|
43
|
-
* ```
|
|
44
|
-
* Plugin Init → FormService.start() → Register Builtins → Register Forms → Ready
|
|
45
|
-
*
|
|
46
|
-
* User Message → Evaluator → FormService.updateField() → Session Updated
|
|
47
|
-
* → FormService.updateSubField() → Subfield Updated
|
|
48
|
-
* → FormService.activateExternalField() → External Process Started
|
|
49
|
-
* → FormService.submit() → Submission Created
|
|
50
|
-
* → FormService.stash() → Session Stashed
|
|
51
|
-
*
|
|
52
|
-
* External Event → PaymentService → FormService.confirmExternalField() → Field Filled
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* ## State Management
|
|
56
|
-
*
|
|
57
|
-
* The service maintains two types of state:
|
|
58
|
-
*
|
|
59
|
-
* 1. **In-Memory**: Form definitions, control types (loaded at startup)
|
|
60
|
-
* 2. **Persistent**: Sessions, submissions, autofill (via storage.ts)
|
|
61
|
-
*
|
|
62
|
-
* ## Consuming Plugin Pattern
|
|
63
|
-
*
|
|
64
|
-
* Plugins that use forms typically:
|
|
65
|
-
*
|
|
66
|
-
* ```typescript
|
|
67
|
-
* // 1. Register form at plugin init
|
|
68
|
-
* const formService = runtime.getService('FORM') as FormService;
|
|
69
|
-
* formService.registerForm(myFormDefinition);
|
|
70
|
-
*
|
|
71
|
-
* // 2. Optionally register custom control types
|
|
72
|
-
* formService.registerControlType({
|
|
73
|
-
* id: 'payment',
|
|
74
|
-
* getSubControls: () => [...],
|
|
75
|
-
* activate: async (ctx) => {...},
|
|
76
|
-
* });
|
|
77
|
-
*
|
|
78
|
-
* // 3. Start session when needed
|
|
79
|
-
* await formService.startSession('my-form', entityId, roomId);
|
|
80
|
-
*
|
|
81
|
-
* // 4. Register hook workers for submission handling
|
|
82
|
-
* runtime.registerTaskWorker({
|
|
83
|
-
* name: 'handle_my_form_submission',
|
|
84
|
-
* execute: async (runtime, options) => {
|
|
85
|
-
* const { submission } = options;
|
|
86
|
-
* // Process the submitted data
|
|
87
|
-
* }
|
|
88
|
-
* });
|
|
89
|
-
* ```
|
|
90
|
-
*
|
|
91
|
-
* ## Error Handling
|
|
92
|
-
*
|
|
93
|
-
* Most methods throw on invalid state (e.g., session not found).
|
|
94
|
-
* Callers should handle errors appropriately.
|
|
95
|
-
*/
|
|
96
|
-
import { Service, type IAgentRuntime, type JsonValue, type UUID } from "@elizaos/core";
|
|
97
|
-
import type { FormDefinition, FormSession, FormSubmission, FormControl, FieldState, FormContextState, ControlType, ExternalActivation } from "./types";
|
|
98
|
-
/**
|
|
99
|
-
* FormService - Central service for managing conversational forms.
|
|
100
|
-
*
|
|
101
|
-
* WHY a service:
|
|
102
|
-
* - Services are singletons, one per agent
|
|
103
|
-
* - Persist across conversations
|
|
104
|
-
* - Accessible from actions, evaluators, providers
|
|
105
|
-
*
|
|
106
|
-
* WHY static `start` method:
|
|
107
|
-
* - ElizaOS service lifecycle pattern
|
|
108
|
-
* - Async initialization support
|
|
109
|
-
* - Returns Service interface
|
|
110
|
-
*/
|
|
111
|
-
export declare class FormService extends Service {
|
|
112
|
-
/** Service type identifier for runtime.getService() */
|
|
113
|
-
static serviceType: string;
|
|
114
|
-
/** Description shown in agent capabilities */
|
|
115
|
-
capabilityDescription: string;
|
|
116
|
-
/**
|
|
117
|
-
* In-memory storage of form definitions.
|
|
118
|
-
*
|
|
119
|
-
* WHY Map:
|
|
120
|
-
* - O(1) lookup by ID
|
|
121
|
-
* - Forms are static after registration
|
|
122
|
-
* - No persistence needed (re-registered on startup)
|
|
123
|
-
*/
|
|
124
|
-
private forms;
|
|
125
|
-
/**
|
|
126
|
-
* Control type registry.
|
|
127
|
-
*
|
|
128
|
-
* WHY separate from TypeHandler:
|
|
129
|
-
* - ControlType is the new unified interface
|
|
130
|
-
* - Supports simple, composite, and external types
|
|
131
|
-
* - TypeHandler is legacy but still supported
|
|
132
|
-
*
|
|
133
|
-
* Built-in types are registered on start.
|
|
134
|
-
* Plugins can register custom types.
|
|
135
|
-
*/
|
|
136
|
-
private controlTypes;
|
|
137
|
-
/**
|
|
138
|
-
* Start the FormService
|
|
139
|
-
*/
|
|
140
|
-
static start(runtime: IAgentRuntime): Promise<Service>;
|
|
141
|
-
/**
|
|
142
|
-
* Stop the FormService
|
|
143
|
-
*/
|
|
144
|
-
stop(): Promise<void>;
|
|
145
|
-
/**
|
|
146
|
-
* Register a form definition
|
|
147
|
-
*/
|
|
148
|
-
registerForm(definition: FormDefinition): void;
|
|
149
|
-
/**
|
|
150
|
-
* Get a form definition by ID
|
|
151
|
-
*/
|
|
152
|
-
getForm(formId: string): FormDefinition | undefined;
|
|
153
|
-
/**
|
|
154
|
-
* Get all registered forms
|
|
155
|
-
*/
|
|
156
|
-
listForms(): FormDefinition[];
|
|
157
|
-
/**
|
|
158
|
-
* Register a control type.
|
|
159
|
-
*
|
|
160
|
-
* Control types define how a field type behaves:
|
|
161
|
-
* - Simple types: validate/parse/format
|
|
162
|
-
* - Composite types: have subcontrols
|
|
163
|
-
* - External types: have activate/deactivate for async processes
|
|
164
|
-
*
|
|
165
|
-
* Built-in types (text, number, email, etc.) are registered at startup
|
|
166
|
-
* and protected from override unless explicitly allowed.
|
|
167
|
-
*
|
|
168
|
-
* @param type - The ControlType definition
|
|
169
|
-
* @param options - Registration options
|
|
170
|
-
* @param options.allowOverride - Allow overriding built-in types (default: false)
|
|
171
|
-
*
|
|
172
|
-
* @example
|
|
173
|
-
* ```typescript
|
|
174
|
-
* formService.registerControlType({
|
|
175
|
-
* id: 'payment',
|
|
176
|
-
* getSubControls: () => [
|
|
177
|
-
* { key: 'amount', type: 'number', label: 'Amount', required: true },
|
|
178
|
-
* { key: 'currency', type: 'select', label: 'Currency', required: true },
|
|
179
|
-
* ],
|
|
180
|
-
* activate: async (ctx) => {
|
|
181
|
-
* const paymentService = ctx.runtime.getService('PAYMENT');
|
|
182
|
-
* return paymentService.createPending(ctx.subValues);
|
|
183
|
-
* },
|
|
184
|
-
* });
|
|
185
|
-
* ```
|
|
186
|
-
*/
|
|
187
|
-
registerControlType(type: ControlType, options?: {
|
|
188
|
-
allowOverride?: boolean;
|
|
189
|
-
}): void;
|
|
190
|
-
/**
|
|
191
|
-
* Get a control type by ID.
|
|
192
|
-
*
|
|
193
|
-
* @param typeId - The type ID to look up
|
|
194
|
-
* @returns The ControlType or undefined if not found
|
|
195
|
-
*/
|
|
196
|
-
getControlType(typeId: string): ControlType | undefined;
|
|
197
|
-
/**
|
|
198
|
-
* List all registered control types.
|
|
199
|
-
*
|
|
200
|
-
* @returns Array of all registered ControlTypes
|
|
201
|
-
*/
|
|
202
|
-
listControlTypes(): ControlType[];
|
|
203
|
-
/**
|
|
204
|
-
* Check if a control type has subcontrols.
|
|
205
|
-
*
|
|
206
|
-
* @param typeId - The type ID to check
|
|
207
|
-
* @returns true if the type has getSubControls method
|
|
208
|
-
*/
|
|
209
|
-
isCompositeType(typeId: string): boolean;
|
|
210
|
-
/**
|
|
211
|
-
* Check if a control type is an external type.
|
|
212
|
-
*
|
|
213
|
-
* @param typeId - The type ID to check
|
|
214
|
-
* @returns true if the type has activate method
|
|
215
|
-
*/
|
|
216
|
-
isExternalType(typeId: string): boolean;
|
|
217
|
-
/**
|
|
218
|
-
* Get subcontrols for a composite type.
|
|
219
|
-
*
|
|
220
|
-
* @param control - The parent control
|
|
221
|
-
* @returns Array of subcontrols or empty array if not composite
|
|
222
|
-
*/
|
|
223
|
-
getSubControls(control: FormControl): FormControl[];
|
|
224
|
-
/**
|
|
225
|
-
* Start a new form session
|
|
226
|
-
*/
|
|
227
|
-
startSession(formId: string, entityId: UUID, roomId: UUID, options?: {
|
|
228
|
-
context?: Record<string, JsonValue>;
|
|
229
|
-
initialValues?: Record<string, JsonValue>;
|
|
230
|
-
locale?: string;
|
|
231
|
-
}): Promise<FormSession>;
|
|
232
|
-
/**
|
|
233
|
-
* Get active session for entity in room
|
|
234
|
-
*/
|
|
235
|
-
getActiveSession(entityId: UUID, roomId: UUID): Promise<FormSession | null>;
|
|
236
|
-
/**
|
|
237
|
-
* Get all active sessions for entity (across all rooms)
|
|
238
|
-
*/
|
|
239
|
-
getAllActiveSessions(entityId: UUID): Promise<FormSession[]>;
|
|
240
|
-
/**
|
|
241
|
-
* Get stashed sessions for entity
|
|
242
|
-
*/
|
|
243
|
-
getStashedSessions(entityId: UUID): Promise<FormSession[]>;
|
|
244
|
-
/**
|
|
245
|
-
* Save a session
|
|
246
|
-
*/
|
|
247
|
-
saveSession(session: FormSession): Promise<void>;
|
|
248
|
-
/**
|
|
249
|
-
* Update a field value
|
|
250
|
-
*/
|
|
251
|
-
updateField(sessionId: string, entityId: UUID, field: string, value: JsonValue, confidence: number, source: FieldState["source"], messageId?: string): Promise<void>;
|
|
252
|
-
/**
|
|
253
|
-
* Undo the last field change
|
|
254
|
-
*/
|
|
255
|
-
undoLastChange(sessionId: string, entityId: UUID): Promise<{
|
|
256
|
-
field: string;
|
|
257
|
-
restoredValue: JsonValue;
|
|
258
|
-
} | null>;
|
|
259
|
-
/**
|
|
260
|
-
* Skip an optional field
|
|
261
|
-
*/
|
|
262
|
-
skipField(sessionId: string, entityId: UUID, field: string): Promise<boolean>;
|
|
263
|
-
/**
|
|
264
|
-
* Confirm an uncertain field value
|
|
265
|
-
*/
|
|
266
|
-
confirmField(sessionId: string, entityId: UUID, field: string, accepted: boolean): Promise<void>;
|
|
267
|
-
/**
|
|
268
|
-
* Update a subfield value for a composite control type.
|
|
269
|
-
*
|
|
270
|
-
* Composite types (like payment, address) have subcontrols that must
|
|
271
|
-
* all be filled before the parent field is complete.
|
|
272
|
-
*
|
|
273
|
-
* WHY separate from updateField:
|
|
274
|
-
* - Subfields are stored in fieldState.subFields, not session.fields
|
|
275
|
-
* - Parent field status depends on all subfields being filled
|
|
276
|
-
* - Allows tracking subfield confidence/status independently
|
|
277
|
-
*
|
|
278
|
-
* @param sessionId - The session ID
|
|
279
|
-
* @param entityId - The entity/user ID
|
|
280
|
-
* @param parentField - The parent control key (e.g., "payment")
|
|
281
|
-
* @param subField - The subcontrol key (e.g., "amount")
|
|
282
|
-
* @param value - The extracted value
|
|
283
|
-
* @param confidence - LLM confidence (0-1)
|
|
284
|
-
* @param messageId - Optional message ID for audit
|
|
285
|
-
*/
|
|
286
|
-
updateSubField(sessionId: string, entityId: UUID, parentField: string, subField: string, value: JsonValue, confidence: number, messageId?: string): Promise<void>;
|
|
287
|
-
/**
|
|
288
|
-
* Check if all subfields of a composite field are filled.
|
|
289
|
-
*
|
|
290
|
-
* @param session - The form session
|
|
291
|
-
* @param parentField - The parent control key
|
|
292
|
-
* @returns true if all required subfields are filled
|
|
293
|
-
*/
|
|
294
|
-
areSubFieldsFilled(session: FormSession, parentField: string): boolean;
|
|
295
|
-
/**
|
|
296
|
-
* Get the current subfield values for a composite field.
|
|
297
|
-
*
|
|
298
|
-
* @param session - The form session
|
|
299
|
-
* @param parentField - The parent control key
|
|
300
|
-
* @returns Record of subfield key to value
|
|
301
|
-
*/
|
|
302
|
-
getSubFieldValues(session: FormSession, parentField: string): Record<string, JsonValue>;
|
|
303
|
-
/**
|
|
304
|
-
* Activate an external field.
|
|
305
|
-
*
|
|
306
|
-
* External types (payment, signature) require an async activation process.
|
|
307
|
-
* This is called when all subcontrols are filled and the external process
|
|
308
|
-
* should begin (e.g., generate payment address, show signing instructions).
|
|
309
|
-
*
|
|
310
|
-
* WHY this method:
|
|
311
|
-
* - Decouples activation trigger from the widget itself
|
|
312
|
-
* - Stores activation state in the session
|
|
313
|
-
* - Provides a clear API for the evaluator to call
|
|
314
|
-
*
|
|
315
|
-
* @param sessionId - The session ID
|
|
316
|
-
* @param entityId - The entity/user ID
|
|
317
|
-
* @param field - The field key
|
|
318
|
-
* @returns The activation details (instructions, reference, etc.)
|
|
319
|
-
*/
|
|
320
|
-
activateExternalField(sessionId: string, entityId: UUID, field: string): Promise<ExternalActivation>;
|
|
321
|
-
/**
|
|
322
|
-
* Confirm an external field.
|
|
323
|
-
*
|
|
324
|
-
* Called by external services (payment, blockchain, etc.) when the
|
|
325
|
-
* external process is complete (e.g., payment received, signature verified).
|
|
326
|
-
*
|
|
327
|
-
* WHY separate from confirmField:
|
|
328
|
-
* - External confirmation includes external data (txId, etc.)
|
|
329
|
-
* - Updates externalState, not just field status
|
|
330
|
-
* - Emits events for other systems to react
|
|
331
|
-
*
|
|
332
|
-
* @param sessionId - The session ID
|
|
333
|
-
* @param entityId - The entity/user ID
|
|
334
|
-
* @param field - The field key
|
|
335
|
-
* @param value - The final value to store (usually the confirmed data)
|
|
336
|
-
* @param externalData - Additional data from the external source (txId, etc.)
|
|
337
|
-
*/
|
|
338
|
-
confirmExternalField(sessionId: string, entityId: UUID, field: string, value: JsonValue, externalData?: Record<string, JsonValue>): Promise<void>;
|
|
339
|
-
/**
|
|
340
|
-
* Cancel an external field activation.
|
|
341
|
-
*
|
|
342
|
-
* Called when the external process fails, times out, or user cancels.
|
|
343
|
-
*
|
|
344
|
-
* @param sessionId - The session ID
|
|
345
|
-
* @param entityId - The entity/user ID
|
|
346
|
-
* @param field - The field key
|
|
347
|
-
* @param reason - Reason for cancellation
|
|
348
|
-
*/
|
|
349
|
-
cancelExternalField(sessionId: string, entityId: UUID, field: string, reason: string): Promise<void>;
|
|
350
|
-
/**
|
|
351
|
-
* Submit a form session
|
|
352
|
-
*/
|
|
353
|
-
submit(sessionId: string, entityId: UUID): Promise<FormSubmission>;
|
|
354
|
-
/**
|
|
355
|
-
* Stash a session for later
|
|
356
|
-
*/
|
|
357
|
-
stash(sessionId: string, entityId: UUID): Promise<void>;
|
|
358
|
-
/**
|
|
359
|
-
* Restore a stashed session
|
|
360
|
-
*/
|
|
361
|
-
restore(sessionId: string, entityId: UUID): Promise<FormSession>;
|
|
362
|
-
/**
|
|
363
|
-
* Cancel a session
|
|
364
|
-
*/
|
|
365
|
-
cancel(sessionId: string, entityId: UUID, force?: boolean): Promise<boolean>;
|
|
366
|
-
/**
|
|
367
|
-
* Get submissions for entity, optionally filtered by form ID
|
|
368
|
-
*/
|
|
369
|
-
getSubmissions(entityId: UUID, formId?: string): Promise<FormSubmission[]>;
|
|
370
|
-
/**
|
|
371
|
-
* Get autofill data for a form
|
|
372
|
-
*/
|
|
373
|
-
getAutofill(entityId: UUID, formId: string): Promise<Record<string, JsonValue> | null>;
|
|
374
|
-
/**
|
|
375
|
-
* Apply autofill to a session
|
|
376
|
-
*/
|
|
377
|
-
applyAutofill(session: FormSession): Promise<string[]>;
|
|
378
|
-
/**
|
|
379
|
-
* Get session context for provider
|
|
380
|
-
*/
|
|
381
|
-
getSessionContext(session: FormSession): FormContextState;
|
|
382
|
-
/**
|
|
383
|
-
* Get current values from session
|
|
384
|
-
*/
|
|
385
|
-
getValues(session: FormSession): Record<string, JsonValue>;
|
|
386
|
-
/**
|
|
387
|
-
* Get mapped values (using dbbind)
|
|
388
|
-
*/
|
|
389
|
-
getMappedValues(session: FormSession): Record<string, JsonValue>;
|
|
390
|
-
/**
|
|
391
|
-
* Calculate TTL based on effort
|
|
392
|
-
*/
|
|
393
|
-
calculateTTL(session: FormSession): number;
|
|
394
|
-
/**
|
|
395
|
-
* Check if cancel should require confirmation
|
|
396
|
-
*/
|
|
397
|
-
shouldConfirmCancel(session: FormSession): boolean;
|
|
398
|
-
/**
|
|
399
|
-
* Execute a form hook
|
|
400
|
-
*/
|
|
401
|
-
private executeHook;
|
|
402
|
-
/**
|
|
403
|
-
* Check if all required fields are filled
|
|
404
|
-
*/
|
|
405
|
-
private checkAllRequiredFilled;
|
|
406
|
-
}
|
|
407
|
-
//# sourceMappingURL=service.d.ts.map
|
package/dist/service.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8FG;AAEH,OAAO,EACL,OAAO,EAEP,KAAK,aAAa,EAClB,KAAK,SAAS,EAEd,KAAK,IAAI,EAEV,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,EACV,gBAAgB,EAMhB,WAAW,EAEX,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAqBjB;;;;;;;;;;;;GAYG;AACH,qBAAa,WAAY,SAAQ,OAAO;IACtC,uDAAuD;IACvD,MAAM,CAAC,WAAW,SAAU;IAE5B,8CAA8C;IAC9C,qBAAqB,SAAsD;IAE3E;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK,CAA0C;IAEvD;;;;;;;;;;OAUG;IACH,OAAO,CAAC,YAAY,CAAuC;IAE3D;;OAEG;WACU,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IAY5D;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3B;;OAEG;IACH,YAAY,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI;IAwB9C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