json-object-editor 0.10.657 → 0.10.662

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.
@@ -3,7 +3,7 @@
3
3
 
4
4
  var schema = {
5
5
  title: "Ai Assistant | ${name}",
6
- display: "Ai Assist",
6
+ display: "Ai Assistant",
7
7
  info: "An AI Assistant configuration linked to OpenAI, managed within Joe.",
8
8
  // Curated summary for agents and tools
9
9
  summary:{
@@ -42,6 +42,11 @@ var schema = {
42
42
  { name:'tags', type:'string', isArray:true, isReference:true, targetSchema:'tag' },
43
43
  { name:'status', type:'string', isReference:true, targetSchema:'status' },
44
44
  { name:'last_synced', type:'string', format:'date-time' },
45
+ // MCP configuration for assistants (mirrors ai_prompt / ai_response)
46
+ { name:'mcp_enabled', type:'boolean' },
47
+ { name:'mcp_toolset', type:'string' },
48
+ { name:'mcp_selected_tools', type:'string', isArray:true },
49
+ { name:'mcp_instructions_mode', type:'string' },
45
50
  { name:'joeUpdated', type:'string', format:'date-time' },
46
51
  { name:'created', type:'string', format:'date-time' }
47
52
  ]
@@ -64,6 +69,7 @@ var schema = {
64
69
  (new Set(schemas)).map(function(schema){
65
70
  subs.push({name:schema,filter:{datasets:{$in:[schema]}}})
66
71
  });
72
+ subs = subs.concat({name:'mcp_enabled',filter:{mcp_enabled:true}});
67
73
  return subs;
68
74
  },
69
75
  stripeColor: function(ai_assistant) {
@@ -329,6 +335,20 @@ var schema = {
329
335
  display: "File IDs (auto populated on sync)",
330
336
  comment: "Auto-managed list of OpenAI file_ids attached to this Assistant."
331
337
  },
338
+ {
339
+ name:"assistant_files",
340
+ type:"uploader",
341
+ allowmultiple:true,
342
+ height:"220px",
343
+ display:"Assistant Files (uploaded)",
344
+ comment:"Drag files here to upload. Files will be mirrored to OpenAI (when configured) and attached whenever this assistant is used.",
345
+ onConfirm:_joe.SERVER.Plugins.awsConnect,
346
+ file_roles:[
347
+ { value:"reference", label:"Reference" },
348
+ { value:"instructions",label:"Instructions" },
349
+ { value:"example", label:"Example", default:true }
350
+ ]
351
+ },
332
352
  { section_end: "files" },
333
353
  {section_start:'categorization',collapsed:true},
334
354
  'datasets',
@@ -339,30 +359,35 @@ var schema = {
339
359
  "itemtype",
340
360
  { section_end: "system" },
341
361
  { sidebar_start: "right", collapsed: false },
342
- "tags",
343
- "status",
344
- {
345
- name: "last_synced",
346
- type: "date",
347
- display: "Last Synced",
348
- locked:true,
349
- comment: "Last time this Assistant was updated at OpenAI."
350
- },
351
- {
352
- name: "sync_button",
353
- type: "button",
354
- display: "Sync to OpenAI",
355
- method: "syncAssistantToOpenAI",
356
- color: "green",
357
- title: "Sync this Assistant with OpenAI"
358
- },
359
- {
360
- name: "set_default_assistant",
361
- type: "button",
362
- display: "Set as Default Assistant",
363
- method: "setAsDefaultAssistant",
364
- color: "orange",
365
- hidden:function(ai_assistant){
362
+ { section_start:'workflow' },
363
+ "status",
364
+ "tags",
365
+ "last_synced",
366
+ {
367
+ name: "sync_button",
368
+ type: "button",
369
+ display: "Sync to OpenAI",
370
+ method: "syncAssistantToOpenAI",
371
+ color: "green",
372
+ title: "Sync this Assistant with OpenAI"
373
+ },
374
+ {
375
+ name: "set_default_assistant",
376
+ type: "button",
377
+ display: "Set as Default Assistant",
378
+ method: "setAsDefaultAssistant",
379
+ color: "orange",
380
+ hidden:function(ai_assistant){
381
+ try{
382
+ var settings = (_joe && _joe.Data && _joe.Data.setting) || [];
383
+ var existing = settings.where({name:'DEFAULT_AI_ASSISTANT'})[0] || null;
384
+ return !!(existing && existing.value === ai_assistant._id);
385
+ }catch(e){
386
+ return false;
387
+ }
388
+ },
389
+ title: "Mark this assistant as the DEFAULT_AI_ASSISTANT setting.",
390
+ locked:function(ai_assistant){
366
391
  try{
367
392
  var settings = (_joe && _joe.Data && _joe.Data.setting) || [];
368
393
  var existing = settings.where({name:'DEFAULT_AI_ASSISTANT'})[0] || null;
@@ -370,27 +395,15 @@ var schema = {
370
395
  }catch(e){
371
396
  return false;
372
397
  }
373
- },
374
- title: "Mark this assistant as the DEFAULT_AI_ASSISTANT setting.",
375
- locked:function(ai_assistant){
376
- try{
377
- var settings = (_joe && _joe.Data && _joe.Data.setting) || [];
378
- var existing = settings.where({name:'DEFAULT_AI_ASSISTANT'})[0] || null;
379
- return !!(existing && existing.value === ai_assistant._id);
380
- }catch(e){
381
- return false;
382
398
  }
383
- }
384
- },
385
- // {
386
- // name: "test_button",
387
- // type: "button",
388
- // display: "Test Button",
389
- // method: "testButtonClick", // <- the method name you want to call
390
- // color: "orange", // <- Joe color class (joe-orange-button)
391
- // title: "Click to test button functionality",
392
- // schema: "ai_assistant" // <- schema to pull the method from (optional for now, we lock it anyway)
393
- // },
399
+ },
400
+ { section_end:'workflow' },
401
+ { section_start:'mcp', display:'MCP Tools', collapsed:true },
402
+ 'mcp_enabled',
403
+ 'mcp_toolset',
404
+ 'mcp_selected_tools',
405
+ 'mcp_instructions_mode',
406
+ { section_end:'mcp' },
394
407
  { sidebar_end: "right" },
395
408
 
396
409
  ];
@@ -93,22 +93,6 @@ var schema = {
93
93
  delete item.template_type;
94
94
  }
95
95
  });
96
- // Best-effort: fetch MCP manifest once and cache tool names on this schema
97
- try{
98
- if (!schema._mcpToolNames && typeof fetch === 'function') {
99
- fetch('/.well-known/mcp/manifest.json')
100
- .then(function(r){ if(!r.ok){ throw new Error('HTTP '+r.status); } return r.json(); })
101
- .then(function(man){
102
- try{
103
- var tools = (man && man.tools) || [];
104
- schema._mcpToolNames = tools.map(function(t){ return t && t.name; }).filter(Boolean).sort();
105
- }catch(_e){}
106
- })
107
- .catch(function(e){
108
- console.warn('ai_prompt mcp manifest load failed', e);
109
- });
110
- }
111
- }catch(_e){}
112
96
  },
113
97
  fields:[
114
98
  'name',
@@ -189,48 +173,10 @@ var schema = {
189
173
  {section_end:'openAi'},
190
174
 
191
175
  {section_start:'mcp', display:'MCP Tools', collapsed:true},
192
- {
193
- name:'mcp_enabled',
194
- type:'boolean',
195
- display:'Enable MCP tools',
196
- default:false,
197
- comment:'When true, this prompt may call JOE MCP tools (read-only by default).'
198
- },
199
- {
200
- name:'mcp_toolset',
201
- type:'select',
202
- display:'MCP Toolset',
203
- values:['read-only','minimal','all','custom'],
204
- default:'read-only',
205
- rerender:'mcp_selected_tools',
206
- comment:'Choose which MCP toolset to expose when MCP tools are enabled.'
207
- },
208
- {
209
- name:'mcp_selected_tools',
210
- type:'select',
211
- display:'Custom MCP tools (names)',
212
- isArray:true,
213
- values:function(aip){
214
- try{
215
- var names = (schema && schema._mcpToolNames) || [];
216
- return names;
217
- }catch(e){
218
- return [];
219
- }
220
- },
221
- hidden:function(aip){
222
- return !aip || aip.mcp_toolset !== 'custom';
223
- },
224
- comment:'Multi-select from MCP manifest tool names. Only used when MCP Toolset = custom.'
225
- },
226
- {
227
- name:'mcp_instructions_mode',
228
- type:'select',
229
- display:'MCP Instructions Mode',
230
- values:['auto','full','none'],
231
- default:'auto',
232
- comment:'auto = short per-tool instructions from MCP; full = extended; none = do not add MCP instructions.'
233
- },
176
+ 'mcp_enabled',
177
+ 'mcp_toolset',
178
+ 'mcp_selected_tools',
179
+ 'mcp_instructions_mode',
234
180
  {section_end:'mcp'},
235
181
 
236
182
 
@@ -31,6 +31,12 @@ var schema = {
31
31
  { name:'messages', type:'objectList' },
32
32
  { name:'last_message_at', type:'string', format:'date-time' },
33
33
  { name:'source', type:'string' },
34
+ // Optional scope for object-scoped chats (Start Chat on an object)
35
+ { name:'scope_itemtype', type:'string' },
36
+ { name:'scope_id', type:'string' },
37
+ // Optional attached OpenAI Files (ids + meta) for this conversation
38
+ { name:'attached_openai_file_ids', type:'string', isArray:true },
39
+ { name:'attached_files_meta', type:'objectList' },
34
40
  { name:'user', type:'string', isReference:true, targetSchema:'user' },
35
41
  { name:'user_name', type:'string' },
36
42
  { name:'user_color', type:'string' },
@@ -176,6 +182,31 @@ var schema = {
176
182
 
177
183
  { section_start: "meta", collapsed: true },
178
184
  "source",
185
+ {
186
+ name:"scope_itemtype",
187
+ type:"text",
188
+ display:"Scope Itemtype",
189
+ comment:"When set, this conversation is scoped to a specific object type (e.g., client, task)."
190
+ },
191
+ {
192
+ name:"scope_id",
193
+ type:"text",
194
+ display:"Scope ID",
195
+ comment:"When set, this conversation is scoped to a specific object _id."
196
+ },
197
+ {
198
+ name:"attached_openai_file_ids",
199
+ type:"text",
200
+ display:"Attached OpenAI File IDs",
201
+ locked:true
202
+ },
203
+ {
204
+ name:"attached_files_meta",
205
+ type:"code",
206
+ display:"Attached Files Meta (JSON)",
207
+ height:"160px",
208
+ comment:"Read-only meta for files attached to this conversation (itemtype, field, name, role, openai_file_id)."
209
+ },
179
210
  "tags",
180
211
  { section_end: "meta" },
181
212
 
@@ -24,7 +24,7 @@ var user = function(){return{
24
24
  { name:'name', type:'string', required:true },
25
25
  { name:'info', type:'string' },
26
26
  { name:'content', type:'string' },
27
- { name:'filetype', type:'string', enumValues:['js','css'] },
27
+ { name:'filetype', type:'string', enumValues:['js','css','json'] },
28
28
  { name:'fillTemplate', type:'boolean' },
29
29
  { name:'site', type:'string', isReference:true, targetSchema:'site' },
30
30
  { name:'joeUpdated', type:'string', format:'date-time', required:true },
@@ -37,7 +37,8 @@ var user = function(){return{
37
37
  },
38
38
  subsets:[
39
39
  {name:'Scripts (.js)',filter:{filetype:'js'}},
40
- {name:'Stylesheets (.css)',filter:{filetype:'css'}}
40
+ {name:'Stylesheets (.css)',filter:{filetype:'css'}},
41
+ {name:'JSON (.json)',filter:{filetype:'json'}}
41
42
  ],
42
43
  fields:[
43
44
  'name',
@@ -49,6 +50,9 @@ var user = function(){return{
49
50
  case 'javascript':
50
51
  return 'javascript';
51
52
  break;
53
+ case 'json':
54
+ return 'json';
55
+ break;
52
56
  default:
53
57
  return item.filetype;
54
58
  break;
@@ -73,7 +77,8 @@ var user = function(){return{
73
77
  {name:'filetype',onchange:'_joe.TITLE.set()',type:'select',values:[
74
78
  {name:'',value:''},
75
79
  {name:'stylesheet',value:'css'},
76
- {name:'script',value:'js'}
80
+ {name:'script',value:'js'},
81
+ {name:'JSON',value:'json'}
77
82
  ]},
78
83
  {name:'fillTemplate',type:'boolean', display:'fill template',label:'run fillTemplate on this'},
79
84
  'site',
@@ -29,6 +29,7 @@ var page = {
29
29
  { name:'info', type:'string' },
30
30
  { name:'site', type:'string', isReference:true, targetSchema:'site' },
31
31
  { name:'path', type:'string' },
32
+ { name:'form', type:'string', isReference:true, targetSchema:'form' },
32
33
  { name:'content_type', type:'string', enumValues:['wysiwyg','code','plugin','module'] },
33
34
  { name:'content', type:'string' },
34
35
  { name:'plugin', type:'string' },
@@ -191,6 +192,11 @@ var page = {
191
192
  },
192
193
 
193
194
  {section_end:'Content'},
195
+ {section_start:'Form',collapsed:function(page){
196
+ return !page.form;
197
+ }},
198
+ {name:'form',type:'select',values:'form',blank:true,comment:'Link this page to a form for dynamic form rendering'},
199
+ {section_end:'Form'},
194
200
  {section_label:'Blocks', section_start:'blocks_info'},
195
201
 
196
202
  {name:'syncLayoutBlocks',value:true,type:'boolean',display:'layout sync',label:'automatically keep blocks synced to layout',width:'60%'},