@tomflow/chatloop-tools 0.9.18 → 0.9.19
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/package.json +1 -1
- package/providers/form.mjs +9 -3
package/package.json
CHANGED
package/providers/form.mjs
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
import {randomUUID} from 'node:crypto';
|
|
4
4
|
import {readFileSync} from 'node:fs';
|
|
5
5
|
const RESOURCE_URI='ui://chat-loop/form/review-v2';
|
|
6
|
+
// Previously rendered chat messages still reference v1 after an upgrade.
|
|
7
|
+
// Preserve their resource locator; both URIs serve the same audited UI.
|
|
8
|
+
const LEGACY_RESOURCE_URI='ui://chat-loop/form/review-v1';
|
|
6
9
|
const RESOURCE_MIME='text/html;profile=mcp-app';
|
|
7
10
|
const ID=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
|
|
8
11
|
const FORM_ID=/^[A-Za-z0-9_-]{8,80}$/;
|
|
@@ -225,10 +228,13 @@ export const provider=Object.freeze({
|
|
|
225
228
|
};
|
|
226
229
|
return Object.freeze({
|
|
227
230
|
tools:()=>tools,
|
|
228
|
-
resources:()=>[
|
|
229
|
-
|
|
231
|
+
resources:()=>[RESOURCE_URI,LEGACY_RESOURCE_URI].map(uri=>({
|
|
232
|
+
uri,name:'Chat Loop Review',mimeType:RESOURCE_MIME,
|
|
233
|
+
description:'A/B review with one locked submit'
|
|
234
|
+
})),
|
|
230
235
|
async readResource(uri){
|
|
231
|
-
if(uri!==RESOURCE_URI)
|
|
236
|
+
if(uri!==RESOURCE_URI&&uri!==LEGACY_RESOURCE_URI)
|
|
237
|
+
throw fail('MCP_RESOURCE_NOT_FOUND');
|
|
232
238
|
return {contents:[{uri,mimeType:RESOURCE_MIME,
|
|
233
239
|
text:readFileSync(new URL('../ui/form/review.html',import.meta.url),'utf8'),
|
|
234
240
|
_meta:{'openai/ui':{availableDisplayModes:['inline'],
|