@formio/uag 2.0.0-rc.4 → 2.0.0-rc.6

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 CHANGED
@@ -90,7 +90,7 @@ services:
90
90
  retries: 40
91
91
 
92
92
  formio-uag:
93
- image: formio/uag
93
+ image: formio/uag:rc
94
94
  depends_on:
95
95
  formio: { condition: service_healthy }
96
96
  ports: ["3200:3200"]
@@ -267,7 +267,7 @@ app.use(await server.router());
267
267
  app.listen(process.env.PORT || 3200);
268
268
  ```
269
269
 
270
- Run Node 22 or newer with `--no-node-snapshot` (isolated-vm, which runs form logic, needs it), and install the engines you use next to the UAG (`npm install @formio/uag-claude`). See [Node.js API](https://ai.form.io/developers/node-api).
270
+ Run Node 22 or newer with `--no-node-snapshot` (isolated-vm, which runs form logic, needs it), and install the engines you use next to the UAG (`npm install @formio/uag-claude@rc`). See [Node.js API](https://ai.form.io/developers/node-api).
271
271
  - **[`@formio/uag-js`](./packages/uag-js)** connects a formio.js application to the UAG. Register it once with `Formio.use(UAG('https://uag.example.com'))`: submissions of forms tagged `uag` are then saved through the UAG, and Agent Input fills those forms from what the user wrote, through `{form}/agent/extract`, when they leave the input, pause, move to the next page, or press a button. `Formio.createChat(element, formUrl)` renders any of them as a chat instead, templated, translated and themed like a formio.js form. See [JavaScript (formio.js)](https://ai.form.io/developers/renderer) and [Chat widget](https://ai.form.io/developers/chat).
272
272
 
273
273
  ## Deployment
@@ -12,6 +12,7 @@ const express_1 = require("express");
12
12
  const router_1 = require("./router");
13
13
  const template_1 = require("./template");
14
14
  const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
15
+ const version_1 = require("./version");
15
16
  const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
16
17
  const router_2 = require("./agent/router");
17
18
  const tools_1 = require("./agent/tools");
@@ -28,7 +29,7 @@ class UAGProjectInterface extends appserver_1.ProjectInterface {
28
29
  this.uagTemplate = null;
29
30
  /** Engines enabled at startup; empty until UAGServer.router() resolves them. */
30
31
  this.engines = new formflow_1.EngineRegistry();
31
- this.mcpServer = new mcp_js_1.McpServer({ name: 'formio-uag', version: '1.0.0' });
32
+ this.mcpServer = new mcp_js_1.McpServer({ name: 'formio-uag', version: version_1.UAG_VERSION });
32
33
  }
33
34
  async initialize() {
34
35
  await super.initialize();
@@ -40,7 +41,7 @@ class UAGProjectInterface extends appserver_1.ProjectInterface {
40
41
  // A scoped token narrows the tools to its own list, and only ever to tools
41
42
  // annotated read-only: no model may write through /mcp with one.
42
43
  async buildMcpServer(scope) {
43
- const server = new mcp_js_1.McpServer({ name: 'formio-uag', version: '1.0.0' });
44
+ const server = new mcp_js_1.McpServer({ name: 'formio-uag', version: version_1.UAG_VERSION });
44
45
  // The standard UAG tools, plus the custom tools from config.
45
46
  let tools = await (0, tools_1.allTools)(this);
46
47
  if (scope) {
package/lib/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export type UAGModule = ServerModule & {
10
10
  /**
11
11
  * Agentic Formflow keeps its license state inside @formio/appserver-core. The UAG
12
12
  * loads it only through @formio/appserver, so the two always share one copy,
13
- * which must be 2.25.1 or later. An older @formio/appserver, or an old lockfile,
13
+ * which must be 2.25.2 or later. An older @formio/appserver, or an old lockfile,
14
14
  * can still resolve an older one, which would fail in confusing ways; say what
15
15
  * to do instead.
16
16
  */
package/lib/index.js CHANGED
@@ -36,18 +36,19 @@ const runs_1 = require("./runs");
36
36
  const actionLogs_1 = require("./actionLogs");
37
37
  const runner_1 = require("./runner");
38
38
  const runTask_1 = require("./actions/runTask");
39
+ const version_1 = require("./version");
39
40
  const debug = require('debug')('formio:uag');
40
41
  /**
41
42
  * Agentic Formflow keeps its license state inside @formio/appserver-core. The UAG
42
43
  * loads it only through @formio/appserver, so the two always share one copy,
43
- * which must be 2.25.1 or later. An older @formio/appserver, or an old lockfile,
44
+ * which must be 2.25.2 or later. An older @formio/appserver, or an old lockfile,
44
45
  * can still resolve an older one, which would fail in confusing ways; say what
45
46
  * to do instead.
46
47
  */
47
48
  function assertSingleCore(version = appserverCoreVersion()) {
48
49
  const [major, minor, patch] = version.split('.').map((part) => parseInt(part, 10) || 0);
49
- if (major < 2 || (major === 2 && (minor < 25 || (minor === 25 && patch < 1)))) {
50
- throw new Error(`@formio/uag needs @formio/appserver-core 2.25.1 or later, through @formio/appserver; ${version} is installed. Upgrade @formio/appserver.`);
50
+ if (major < 2 || (major === 2 && (minor < 25 || (minor === 25 && patch < 2)))) {
51
+ throw new Error(`@formio/uag needs @formio/appserver-core 2.25.2 or later, through @formio/appserver; ${version} is installed. Upgrade @formio/appserver.`);
51
52
  }
52
53
  }
53
54
  /** The version of the @formio/appserver-core that @formio/appserver loads. */
@@ -129,6 +130,8 @@ class UAGServer extends appserver_1.Server {
129
130
  retryDelay: parseInt((0, lodash_1.get)(process.env, 'PROJECT_RETRY_DELAY', 5000).toString(), 10),
130
131
  submissionProxy: true,
131
132
  processAsClient: true,
133
+ // GET /status names the UAG's version beside the Form.io packages it runs on.
134
+ status: { '@formio/uag': version_1.UAG_VERSION },
132
135
  // Bodies are parsed before authentication, so keep them to what Form.io accepts.
133
136
  maxBodySize: (0, lodash_1.get)(process.env, 'MAX_BODY_SIZE', '16mb').toString(),
134
137
  auth: { pkce: true, mcpOAuth: (0, lodash_1.get)(process.env, 'MCP_OAUTH', '').toString() === 'true' },
@@ -34,7 +34,8 @@ const collectData = async (project) => {
34
34
  const fields = await form.getFields(submission, extra.authInfo, parent?.data_path);
35
35
  if (fields.errors.length > 0) {
36
36
  if (as_json) {
37
- return project.mcpJSONResponse(fields.errors);
37
+ // structuredContent must be an object: an MCP client refuses a bare array.
38
+ return project.mcpJSONResponse({ errors: fields.errors }, true);
38
39
  }
39
40
  return project.mcpResponse(template_1.ResponseTemplate.fieldValidationErrors, { invalidFields: fields.errors });
40
41
  }
@@ -0,0 +1,2 @@
1
+ /** The UAG's own version, from its package.json (src/ and lib/ both sit one level below it). */
2
+ export declare const UAG_VERSION: string;
package/lib/version.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UAG_VERSION = void 0;
4
+ /** The UAG's own version, from its package.json (src/ and lib/ both sit one level below it). */
5
+ exports.UAG_VERSION = require('../package.json').version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/uag",
3
- "version": "2.0.0-rc.4",
3
+ "version": "2.0.0-rc.6",
4
4
  "mcpName": "io.form/formio-uag",
5
5
  "description": "The Form.io Universal Agent Gateway (UAG).",
6
6
  "main": "lib/index.js",
@@ -43,9 +43,9 @@
43
43
  "author": "Form.io Developers",
44
44
  "license": "MIT",
45
45
  "dependencies": {
46
- "@formio/appserver": "^2.25.1",
46
+ "@formio/appserver": "^2.25.2",
47
47
  "@formio/core": "2.9.0",
48
- "@formio/uag-sdk": "^2.0.0-rc.4",
48
+ "@formio/uag-sdk": "^2.0.0-rc.6",
49
49
  "@modelcontextprotocol/sdk": "1.32.2",
50
50
  "cors": "^2.8.6",
51
51
  "debug": "^4.4.3",
@@ -72,7 +72,6 @@
72
72
  "@types/chai": "^5.2.3",
73
73
  "@types/cors": "^2.8.19",
74
74
  "@types/debug": "^4.1.13",
75
- "@types/dotenv": "^8.2.3",
76
75
  "@types/express": "^5.0.6",
77
76
  "@types/jsdom": "^30.0.0",
78
77
  "@types/jsonwebtoken": "^9.0.10",