What is new in Total.js 5 0.0.20
Total.js 5 0.0.20 is in the official repository (0.0.20-1) and is not published on npm yet. This page lists what it adds and fixes. The recipes marked since 0.0.20 run against that source; the rest of the cookbook is executed against the published total5@0.0.19. When 0.0.20 is published, run npm install total5@0.0.20 and the whole cookbook is checked against it.
What it adds
| Addition | What it does | Recipe |
|---|---|---|
mcp module | Actions with mcp: true become tools of a built-in MCP server at POST /$mcp/ (enabled with CONF.$mcp), with the schema generated from input, query, params and output; Total.mcp.auth checks the caller | mcp-tools-from-actions |
JSONSchema.toAITool(name), JSONSchema.toAIObject(name, description) and action.toAITool() | Describe a function or a structured output for an AI model from a compact schema or from an action | json-schema-for-ai-tools |
QueryBuilder.autoqueryjson($, column, schema, defsort, maxlimit) | Like autoquery() for the properties of a JSON or JSONB column, with an allowlist; the adapter writes the SQL | query-builder-json-columns |
$.content(value, contentType) | Sends a string or a Buffer with the content type you choose | response-content-type |
cache option of NEWACTION() | Keeps the response for the same query, params, input, user or language, and skips the middleware and the action while the entry lives | action-cache-option |
U.validhost(host) and U.tohost(host) | Accept only plain hostnames and canonical IP literals, and return the canonical ASCII form of a host | hostname-validation |
Compact schema types json and ip | The values are validated (a JSON text and an IP address) instead of being plain strings | schema-enums-and-formats |
Total.FsPromises | A link to node:fs/promises | Total.FsPromises.readFile(filename, 'utf8') |
reset event of a FlowStream | Emitted when the FlowStream receives the reset message, which also clears its error list | flow.on('reset', function() {}) |
What it fixes
CRON()with the step form (*/15,5/20) matches the values of the step and not every value.- The
limitargument ofsetTimeout2()works. See debounce-timers. AJAX()settles for answers of typeapplication/xmlandtext/xml. See ajax-requests.IMPORT()gives an error for an answer with the status 400 or more, or for a file that is not a module. See import-remote-module.F.python()without a callback resolves its promise with the output, andF.pipinstall()works without a callback.LOGMAIL()accepts an object as the body. See logmail.$.href()of a controller works. See upload-lifecycle-and-href.QueryBuilder.gridfields()applies the accepted fields. See query-builder-contract.LDAP()gives an error when a bind answers with a status other than 0, even when the server sends no text. See ldap-openldap.- The mail:
attachmentfs()reads the file of the storage as a Buffer and completes the message,attachment()with a Buffer encodes the whole Buffer as one Base64 text, and theserveris normalized (an invalid hostname answersInvalid SMTP server hostname.). - The view engine command
@{hostname()}, the tunnel client messageserrorandabort, and the handling of pending requests. AIPARSER()with tool calling.- Security: the hostnames are normalized and validated in the framework itself because of the Node.js security release of 2026-10-21 (CVE-2026-105482, CVE-2026-105483, CVE-2026-106069 and CVE-2026-106072).
U.resolve()andU.connect()reject an invalid hostname. The framework does not require a specific version of Node.js. The Brotli issue CVE-2026-111497 does not affect it, because onlygzipanddeflateare decompressed, and the keep-alive socket issue CVE-2026-105481 is fixed by updating Node.js.
Pages that describe 0.0.19
Eight recipes document, and test, the behavior of the published total5@0.0.19 where 0.0.20 changed it: ajax-requests, debounce-timers, import-remote-module, ldap-openldap, logmail, query-builder-contract, schema-enums-and-formats and upload-lifecycle-and-href. Their statements are right for 0.0.19. The cache option of NEWACTION() listed in action-options also has an effect only from 0.0.20.