@formio/uag 1.13.2 → 2.0.0-rc.10
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 +237 -535
- package/bin/uag-eval.js +99 -0
- package/bin/uag.js +116 -0
- package/lib/UAGFormInterface.d.ts +72 -2
- package/lib/UAGFormInterface.js +226 -57
- package/lib/UAGProjectInterface.d.ts +45 -5
- package/lib/UAGProjectInterface.js +187 -36
- package/lib/actionLogs.d.ts +24 -0
- package/lib/actionLogs.js +149 -0
- package/lib/actions/runTask.d.ts +43 -0
- package/lib/actions/runTask.js +324 -0
- package/lib/agent/anonymous.d.ts +34 -0
- package/lib/agent/anonymous.js +99 -0
- package/lib/agent/chat.d.ts +114 -0
- package/lib/agent/chat.js +475 -0
- package/lib/agent/engines.d.ts +17 -0
- package/lib/agent/engines.js +46 -0
- package/lib/agent/errors.d.ts +25 -0
- package/lib/agent/errors.js +132 -0
- package/lib/agent/index.d.ts +4 -0
- package/lib/agent/index.js +19 -0
- package/lib/agent/remote.d.ts +71 -0
- package/lib/agent/remote.js +252 -0
- package/lib/agent/requestId.d.ts +4 -0
- package/lib/agent/requestId.js +19 -0
- package/lib/agent/router.d.ts +61 -0
- package/lib/agent/router.js +307 -0
- package/lib/agent/stubs.d.ts +37 -0
- package/lib/agent/stubs.js +39 -0
- package/lib/agent/tools.d.ts +31 -0
- package/lib/agent/tools.js +76 -0
- package/lib/config.d.ts +97 -3
- package/lib/config.js +19 -0
- package/lib/database.d.ts +70 -0
- package/lib/database.js +212 -0
- package/lib/documents/convert.d.ts +38 -0
- package/lib/documents/convert.js +151 -0
- package/lib/documents/converters.d.ts +28 -0
- package/lib/documents/converters.js +149 -0
- package/lib/documents/detect.d.ts +31 -0
- package/lib/documents/detect.js +169 -0
- package/lib/documents/index.d.ts +9 -0
- package/lib/documents/index.js +43 -0
- package/lib/documents/mime.d.ts +39 -0
- package/lib/documents/mime.js +100 -0
- package/lib/documents/plugins.d.ts +18 -0
- package/lib/documents/plugins.js +65 -0
- package/lib/documents/readers.d.ts +19 -0
- package/lib/documents/readers.js +64 -0
- package/lib/documents/routes.d.ts +52 -0
- package/lib/documents/routes.js +99 -0
- package/lib/documents/types.d.ts +126 -0
- package/lib/documents/types.js +2 -0
- package/lib/documents/uagJs.d.ts +17 -0
- package/lib/documents/uagJs.js +157 -0
- package/lib/formflow.d.ts +47 -0
- package/lib/formflow.js +28 -0
- package/lib/identity.d.ts +53 -0
- package/lib/identity.js +107 -0
- package/lib/index.d.ts +98 -1
- package/lib/index.js +382 -8
- package/lib/markdown.d.ts +1 -0
- package/lib/markdown.js +166 -0
- package/lib/modules/api.d.ts +25 -0
- package/lib/modules/api.js +98 -0
- package/lib/modules/index.d.ts +4 -0
- package/lib/modules/index.js +24 -0
- package/lib/modules/routes.d.ts +14 -0
- package/lib/modules/routes.js +21 -0
- package/lib/modules/types.d.ts +68 -0
- package/lib/modules/types.js +5 -0
- package/lib/pluginFiles.d.ts +28 -0
- package/lib/pluginFiles.js +101 -0
- package/lib/plugins.d.ts +17 -0
- package/lib/plugins.js +93 -0
- package/lib/richText.d.ts +20 -0
- package/lib/richText.js +99 -0
- package/lib/router.d.ts +9 -0
- package/lib/router.js +34 -25
- package/lib/runner.d.ts +149 -0
- package/lib/runner.js +353 -0
- package/lib/runs.d.ts +27 -0
- package/lib/runs.js +13 -0
- package/lib/template.js +7 -9
- package/lib/templates/uagComponentNotFound.md +5 -5
- package/lib/testing.d.ts +74 -0
- package/lib/testing.js +180 -0
- package/lib/tools/SchemaBuilder.d.ts +3 -3
- package/lib/tools/SchemaBuilder.js +4 -4
- package/lib/tools/agentDecide.d.ts +8 -0
- package/lib/tools/agentDecide.js +57 -0
- package/lib/tools/agentProvide.d.ts +8 -0
- package/lib/tools/agentProvide.js +97 -0
- package/lib/tools/collectData.js +3 -2
- package/lib/tools/confirmSubmission.js +1 -1
- package/lib/tools/fetchExternalData.js +8 -17
- package/lib/tools/findSubmission.js +62 -56
- package/lib/tools/getFieldInfo.js +1 -1
- package/lib/tools/getFormFields.js +1 -1
- package/lib/tools/getForms.js +1 -1
- package/lib/tools/index.d.ts +4 -1
- package/lib/tools/index.js +21 -14
- package/lib/tools/readDocument.d.ts +17 -0
- package/lib/tools/readDocument.js +99 -0
- package/lib/tools/submissionUpdate.js +4 -3
- package/lib/tools/submitForm.js +1 -1
- package/lib/tools/utils.d.ts +40 -0
- package/lib/tools/utils.js +16 -1
- package/lib/version.d.ts +2 -0
- package/lib/version.js +5 -0
- package/package.json +49 -19
- package/testing.d.ts +1 -0
- package/testing.js +2 -0
- package/lib/tools/agentProvideData.d.ts +0 -3
- package/lib/tools/agentProvideData.js +0 -62
package/bin/uag-eval.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* uag-eval: measure decision accuracy against automation on labeled examples.
|
|
4
|
+
*
|
|
5
|
+
* uag-eval --form claim.json --examples claim-examples.json [--task triage]
|
|
6
|
+
* [--engine jev] [--json report.json]
|
|
7
|
+
*
|
|
8
|
+
* --form A Form.io form definition (JSON export).
|
|
9
|
+
* --task The task to evaluate (default: the form's first).
|
|
10
|
+
* --examples A JSON array of { "id", "data": { ... }, "expected": { "<path>": <value or null> } }.
|
|
11
|
+
* null means "the input does not say", which expects the field to stay empty.
|
|
12
|
+
* --engine The decision engine to evaluate: an instance named in UAG_ENGINES, or an
|
|
13
|
+
* entry in its syntax (`jev`, `next:jev`). Default: the first in UAG_ENGINES.
|
|
14
|
+
* --json Also write the full report as JSON.
|
|
15
|
+
* --project The project URL the evaluation runs for (default: none). A real engine
|
|
16
|
+
* needs a LICENSE_KEY that includes the UAG for this URL; the stub
|
|
17
|
+
* engines need neither.
|
|
18
|
+
*
|
|
19
|
+
* The engine is loaded as the UAG loads it, so the same UAG_ENGINES and
|
|
20
|
+
* UAG_ENGINE_* variables give the same instance, with the same model. Its type
|
|
21
|
+
* may be built in, or an installed engine package. Resource-backed selects need
|
|
22
|
+
* a live project and are skipped.
|
|
23
|
+
*/
|
|
24
|
+
require('dotenv/config');
|
|
25
|
+
const { readFileSync, writeFileSync } = require('fs');
|
|
26
|
+
const { parseInstances } = require('@formio/uag-sdk');
|
|
27
|
+
const { ProjectInterface, UAGProjectInterface, UAGFormInterface, loadUAGEngines } = require('../lib');
|
|
28
|
+
const { FormflowService, formatReport } = require('../lib/formflow');
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The instance to evaluate: the one UAG_ENGINES names `name`, so a deployed
|
|
32
|
+
* instance is evaluated with its own settings, or else `name` as an entry.
|
|
33
|
+
*/
|
|
34
|
+
function engineEntry(name, env) {
|
|
35
|
+
const deployed = parseInstances(env.UAG_ENGINES);
|
|
36
|
+
if (!name) return deployed[0];
|
|
37
|
+
return deployed.find((instance) => instance.name === name) || parseInstances(name)[0];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function args(argv) {
|
|
41
|
+
const out = {};
|
|
42
|
+
for (let i = 0; i < argv.length; i++) {
|
|
43
|
+
if (argv[i].startsWith('--')) out[argv[i].slice(2)] = argv[i + 1];
|
|
44
|
+
}
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function main() {
|
|
49
|
+
const opts = args(process.argv.slice(2));
|
|
50
|
+
if (!opts.form || !opts.examples) {
|
|
51
|
+
console.error('Usage: uag-eval --form <form.json> --examples <examples.json> [--task <name>] [--engine <name>] [--json <out.json>] [--project <url>]');
|
|
52
|
+
process.exit(2);
|
|
53
|
+
}
|
|
54
|
+
if (opts.persona !== undefined) {
|
|
55
|
+
console.error('uag-eval: --persona was renamed --task in UAG 2.0.');
|
|
56
|
+
process.exit(2);
|
|
57
|
+
}
|
|
58
|
+
const task = opts.task || undefined;
|
|
59
|
+
const formDef = JSON.parse(readFileSync(opts.form, 'utf8'));
|
|
60
|
+
const examples = JSON.parse(readFileSync(opts.examples, 'utf8'));
|
|
61
|
+
const entry = engineEntry(opts.engine, process.env);
|
|
62
|
+
if (!entry) {
|
|
63
|
+
console.error('Name the decision engine with --engine or UAG_ENGINES.');
|
|
64
|
+
process.exit(2);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const registry = await loadUAGEngines({ engines: [entry] }, process.env);
|
|
68
|
+
const engine = registry.decision[0];
|
|
69
|
+
if (!engine) {
|
|
70
|
+
console.error(`"${registry.all[0].name}" is not a decision engine.`);
|
|
71
|
+
process.exit(2);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// The license the evaluation may use, read as a running UAG reads it.
|
|
75
|
+
await ProjectInterface.connect({ config: { license: String(process.env.UAG_LICENSE || ''), licenseType: 'uagServer', licenseFeature: 'uag' } });
|
|
76
|
+
// Build the form offline. Outside a running server the project would create
|
|
77
|
+
// the base form class, so the UAG form interface is constructed directly.
|
|
78
|
+
const project = new UAGProjectInterface(opts.project || 'http://offline.invalid');
|
|
79
|
+
const name = formDef.name || formDef.path || 'form';
|
|
80
|
+
formDef.tags = [...new Set([...(formDef.tags || []), 'uag'])];
|
|
81
|
+
// The constructor sets the form, which derives its UAG registration and tasks.
|
|
82
|
+
const form = new UAGFormInterface(project, formDef);
|
|
83
|
+
project.forms[name] = form;
|
|
84
|
+
|
|
85
|
+
const report = await new FormflowService(project).evaluate(form, task, examples, engine, {}, (done, total) => {
|
|
86
|
+
process.stderr.write(`\r${done}/${total} example(s)`);
|
|
87
|
+
});
|
|
88
|
+
process.stderr.write('\n');
|
|
89
|
+
console.log(formatReport(report));
|
|
90
|
+
if (opts.json) {
|
|
91
|
+
writeFileSync(opts.json, JSON.stringify(report, null, 2));
|
|
92
|
+
console.log(`Report written to ${opts.json}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
main().catch((err) => {
|
|
97
|
+
console.error(err.message || err);
|
|
98
|
+
process.exit(1);
|
|
99
|
+
});
|
package/bin/uag.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* uag: start the Form.io UAG.
|
|
4
|
+
*
|
|
5
|
+
* uag the UAG with no module
|
|
6
|
+
* UAG_MODULE=./my-module uag
|
|
7
|
+
*
|
|
8
|
+
* Configuration comes from the environment (PROJECT, PROJECT_KEY or ADMIN_KEY,
|
|
9
|
+
* JWT_SECRET, UAG_ENGINES, MONGO, ...) and an optional module: a file or
|
|
10
|
+
* folder exporting `{ config, actions, ... }`, named by UAG_MODULE.
|
|
11
|
+
*
|
|
12
|
+
* Engines are found among the installed packages, so a custom image holds only
|
|
13
|
+
* the engines it installs:
|
|
14
|
+
*
|
|
15
|
+
* npm install @formio/uag@rc @formio/uag-claude@rc
|
|
16
|
+
* UAG_ENGINES=claude CLAUDE_API_KEY=... npx uag
|
|
17
|
+
*/
|
|
18
|
+
// Before anything else, so a module that reads the environment sees .env too.
|
|
19
|
+
require('dotenv/config');
|
|
20
|
+
const path = require('path');
|
|
21
|
+
|
|
22
|
+
/** isolated-vm, which runs form logic, needs Node's startup snapshot off. */
|
|
23
|
+
function snapshotDisabled() {
|
|
24
|
+
return process.execArgv.includes('--no-node-snapshot') || /(^|\s)--no-node-snapshot(\s|$)/.test(process.env.NODE_OPTIONS || '');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Run this file again with the flag, passing signals on, and exit as it does. */
|
|
28
|
+
function restartWithoutSnapshot() {
|
|
29
|
+
const { spawn } = require('child_process');
|
|
30
|
+
const child = spawn(process.execPath, ['--no-node-snapshot', ...process.execArgv, __filename, ...process.argv.slice(2)], { stdio: 'inherit' });
|
|
31
|
+
for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
|
|
32
|
+
process.on(signal, () => child.kill(signal));
|
|
33
|
+
}
|
|
34
|
+
child.on('exit', (code, signal) => process.exit(code ?? (signal ? 1 : 0)));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Start the UAG with a module, listening on PORT (default 3200). */
|
|
38
|
+
async function start(uagModule) {
|
|
39
|
+
const Express = require('express');
|
|
40
|
+
const { UAGServer, trustProxySetting, usePluginFiles } = require('../lib');
|
|
41
|
+
const server = new UAGServer();
|
|
42
|
+
// A module may be exported as a promise (an async module).
|
|
43
|
+
const resolved = await uagModule;
|
|
44
|
+
if (resolved) server.use(resolved);
|
|
45
|
+
// Then the plugins files: UAG_PLUGINS, or the image's /app/plugins (its
|
|
46
|
+
// index.mjs, or each add-on's folder under it).
|
|
47
|
+
await usePluginFiles(server);
|
|
48
|
+
const app = Express();
|
|
49
|
+
// Behind a reverse proxy, its forwarded headers give the public URL (TRUST_PROXY).
|
|
50
|
+
const trust = trustProxySetting(process.env.TRUST_PROXY);
|
|
51
|
+
if (trust !== undefined) app.set('trust proxy', trust);
|
|
52
|
+
// Loads the engines the module's `engines` setting, or else UAG_ENGINES,
|
|
53
|
+
// names; a misconfigured engine stops startup with its name in the error.
|
|
54
|
+
app.use(await server.router());
|
|
55
|
+
const port = process.env.PORT || 3200;
|
|
56
|
+
const listener = await new Promise((resolve) => {
|
|
57
|
+
const started = app.listen(port, () => resolve(started));
|
|
58
|
+
});
|
|
59
|
+
stopOnSignals(server, listener);
|
|
60
|
+
console.log(`Form.io UAG server running on port ${port}`);
|
|
61
|
+
console.log(`Visit http://localhost:${port} to access the application`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* On SIGTERM or SIGINT, stop taking connections and destroy the server, which
|
|
66
|
+
* calls each module's `close` and each plugin's, then exit. A shutdown that
|
|
67
|
+
* takes longer than `timeoutMs` exits with 1.
|
|
68
|
+
*/
|
|
69
|
+
function stopOnSignals(server, listener, { signals = ['SIGTERM', 'SIGINT'], exit = (code) => process.exit(code), on = process, timeoutMs = 10000 } = {}) {
|
|
70
|
+
let stopping = false;
|
|
71
|
+
const stop = async (signal) => {
|
|
72
|
+
if (stopping) return;
|
|
73
|
+
stopping = true;
|
|
74
|
+
console.log(`Received ${signal}: stopping the UAG.`);
|
|
75
|
+
const timer = setTimeout(() => {
|
|
76
|
+
console.error(`The UAG did not stop within ${timeoutMs} ms.`);
|
|
77
|
+
exit(1);
|
|
78
|
+
}, timeoutMs);
|
|
79
|
+
if (timer.unref) timer.unref();
|
|
80
|
+
if (listener) listener.close();
|
|
81
|
+
let code = 0;
|
|
82
|
+
try {
|
|
83
|
+
await server.destroy();
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.error('Failed to stop the UAG cleanly:', error);
|
|
87
|
+
code = 1;
|
|
88
|
+
}
|
|
89
|
+
clearTimeout(timer);
|
|
90
|
+
exit(code);
|
|
91
|
+
};
|
|
92
|
+
// Not once: a repeated signal (a terminal's Ctrl-C reaches the restarted
|
|
93
|
+
// process twice, from the terminal and from its parent) must not fall back
|
|
94
|
+
// to Node's default handler and end the shutdown early.
|
|
95
|
+
for (const signal of signals) on.on(signal, () => stop(signal));
|
|
96
|
+
return stop;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function fail(error) {
|
|
100
|
+
console.error('Failed to start server:', error);
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (require.main === module) {
|
|
105
|
+
if (!snapshotDisabled()) {
|
|
106
|
+
restartWithoutSnapshot();
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
Promise.resolve()
|
|
110
|
+
.then(() => (process.env.UAG_MODULE ? require(path.resolve(process.env.UAG_MODULE)) : undefined))
|
|
111
|
+
.then(start)
|
|
112
|
+
.catch(fail);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
module.exports = { start, fail, stopOnSignals };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AppServerForm, AuthRequest, FormInterface, InterpolatedError } from "@formio/appserver";
|
|
2
|
+
import type { FormflowForm, FormflowTask } from "./formflow";
|
|
2
3
|
import { Component, Submission, DataObject, ComponentPaths } from "@formio/core";
|
|
3
4
|
import { UAGForm } from "./config";
|
|
4
5
|
import { ParentInfo } from "./tools";
|
|
6
|
+
import { Router } from "express";
|
|
5
7
|
export type UAGComponentInfo = {
|
|
6
8
|
path: string;
|
|
7
9
|
label: string;
|
|
@@ -49,14 +51,48 @@ export type FormFieldInfo = {
|
|
|
49
51
|
components: UAGComponentInfo[];
|
|
50
52
|
};
|
|
51
53
|
};
|
|
54
|
+
/** A field a chat may collect, with its current value. */
|
|
55
|
+
export type ChatField = UAGComponentInfo & {
|
|
56
|
+
required: boolean;
|
|
57
|
+
empty: boolean;
|
|
58
|
+
value: any;
|
|
59
|
+
};
|
|
60
|
+
/** A component a chat cannot collect yet. */
|
|
61
|
+
export type ChatUnsupportedField = {
|
|
62
|
+
path: string;
|
|
63
|
+
label: string;
|
|
64
|
+
required: boolean;
|
|
65
|
+
empty: boolean;
|
|
66
|
+
};
|
|
67
|
+
export type ChatFields = {
|
|
68
|
+
fields: ChatField[];
|
|
69
|
+
unsupported: ChatUnsupportedField[];
|
|
70
|
+
errors: FormFieldError[];
|
|
71
|
+
};
|
|
52
72
|
export type UAGFields = {
|
|
53
|
-
|
|
73
|
+
task: string;
|
|
54
74
|
criteria: string;
|
|
55
75
|
components: Record<string, UAGComponentInfo>;
|
|
76
|
+
/** Data paths of the components flagged `uagField: "input"`: the source text for extraction and decisions. */
|
|
77
|
+
inputs?: string[];
|
|
78
|
+
/** Task-level settings, read from the custom properties of the task's criteria component (e.g. `uagEngine`, `uagTools`). */
|
|
79
|
+
settings?: Record<string, string>;
|
|
56
80
|
};
|
|
57
|
-
export declare class UAGFormInterface extends FormInterface {
|
|
81
|
+
export declare class UAGFormInterface extends FormInterface implements FormflowForm {
|
|
58
82
|
uag: UAGForm | null;
|
|
59
83
|
uagFields: Record<string, UAGFields>;
|
|
84
|
+
/**
|
|
85
|
+
* The form's routes, with its agent operations (`agent/extract`, `agent/decide`,
|
|
86
|
+
* `agent/generate`, `agent/chat`) beside its submissions: the project's authentication has
|
|
87
|
+
* already run, and the form is the one of the URL.
|
|
88
|
+
*/
|
|
89
|
+
router(): Promise<Router>;
|
|
90
|
+
/**
|
|
91
|
+
* Sets the form, deriving its UAG registration and agent fields from it. The form is set again
|
|
92
|
+
* whenever it loads, and whenever a TTL refresh or a deploy brings a new version, so both are
|
|
93
|
+
* rebuilt from the form each time rather than added to what an earlier version left.
|
|
94
|
+
*/
|
|
95
|
+
setForm(form: AppServerForm): AppServerForm;
|
|
60
96
|
setComponent(form: AppServerForm, component: Component, path: string, components: Component[] | undefined, parent: Component | undefined, paths: ComponentPaths | undefined): void;
|
|
61
97
|
getComponentFormat(component: Component): string;
|
|
62
98
|
getComponentInfo(component: Component, path: string): UAGComponentInfo;
|
|
@@ -111,6 +147,19 @@ export declare class UAGFormInterface extends FormInterface {
|
|
|
111
147
|
* @returns { Promise<FormFieldInfo> } - The extracted form field information.
|
|
112
148
|
*/
|
|
113
149
|
getFields(submission: Submission, authInfo: AuthRequest, within?: string | string[]): Promise<FormFieldInfo>;
|
|
150
|
+
/** Whether the chat cannot collect this component yet, so the person finishes it in the form. */
|
|
151
|
+
isChatUnsupported(component: Component): boolean;
|
|
152
|
+
/** Data paths of the fields a task fills: its decision and value fields, not its inputs. */
|
|
153
|
+
taskOwnedPaths(): Set<string>;
|
|
154
|
+
/**
|
|
155
|
+
* The fields a chat may collect on this data: visible input fields that a
|
|
156
|
+
* person may enter, filled or not, with the rules the MCP tools give
|
|
157
|
+
* agents. Fields a task fills (and `uagAuthoritative` ones), hidden,
|
|
158
|
+
* disabled and calculated fields are left out; components the chat
|
|
159
|
+
* cannot collect yet are listed in `unsupported`, and their children are
|
|
160
|
+
* not visited.
|
|
161
|
+
*/
|
|
162
|
+
chatFields(submission: Submission, authInfo: AuthRequest): Promise<ChatFields>;
|
|
114
163
|
/**
|
|
115
164
|
* Return the component at the specified data path.
|
|
116
165
|
* @param path { string } - The data path of the component to retrieve.
|
|
@@ -133,5 +182,26 @@ export declare class UAGFormInterface extends FormInterface {
|
|
|
133
182
|
convertToSubmission(data?: Record<string, any>): Submission;
|
|
134
183
|
formatData(data?: DataObject): UAGData;
|
|
135
184
|
formatSubmission(submission: Submission): UAGSubmission;
|
|
185
|
+
/** The form's name in Agentic Formflow responses and messages. */
|
|
186
|
+
get formflowName(): string;
|
|
187
|
+
/** The form's tasks, for Agentic Formflow. */
|
|
188
|
+
formflowTasks(): Record<string, FormflowTask>;
|
|
189
|
+
/** The submission's values in form order with their labels, for Agentic Formflow. */
|
|
190
|
+
formflowLabeledData(data?: DataObject): {
|
|
191
|
+
path: string;
|
|
192
|
+
label: string;
|
|
193
|
+
}[];
|
|
194
|
+
/**
|
|
195
|
+
* A value an agent engine generated, before it is checked and written: HTML
|
|
196
|
+
* for a rich text field is reduced to the markup its editor keeps.
|
|
197
|
+
*/
|
|
198
|
+
formflowNormalizeValue(component: Component, value: any): any;
|
|
199
|
+
/**
|
|
200
|
+
* A value an MCP client writes at a data path (collect_field_data,
|
|
201
|
+
* confirm_form_submission, submit_completed_form, submission_update), as
|
|
202
|
+
* an engine's is: HTML for a rich text field is reduced to the markup its
|
|
203
|
+
* editor keeps. Row indices are ignored to find the component.
|
|
204
|
+
*/
|
|
205
|
+
normalizeWrittenValue(path: string, value: any): any;
|
|
136
206
|
htmlToMarkdown(html: string): string;
|
|
137
207
|
}
|