json-object-editor 0.10.660 → 0.10.663

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.
@@ -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) {
@@ -353,30 +359,35 @@ var schema = {
353
359
  "itemtype",
354
360
  { section_end: "system" },
355
361
  { sidebar_start: "right", collapsed: false },
356
- "tags",
357
- "status",
358
- {
359
- name: "last_synced",
360
- type: "date",
361
- display: "Last Synced",
362
- locked:true,
363
- comment: "Last time this Assistant was updated at OpenAI."
364
- },
365
- {
366
- name: "sync_button",
367
- type: "button",
368
- display: "Sync to OpenAI",
369
- method: "syncAssistantToOpenAI",
370
- color: "green",
371
- title: "Sync this Assistant with OpenAI"
372
- },
373
- {
374
- name: "set_default_assistant",
375
- type: "button",
376
- display: "Set as Default Assistant",
377
- method: "setAsDefaultAssistant",
378
- color: "orange",
379
- 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){
380
391
  try{
381
392
  var settings = (_joe && _joe.Data && _joe.Data.setting) || [];
382
393
  var existing = settings.where({name:'DEFAULT_AI_ASSISTANT'})[0] || null;
@@ -384,27 +395,15 @@ var schema = {
384
395
  }catch(e){
385
396
  return false;
386
397
  }
387
- },
388
- title: "Mark this assistant as the DEFAULT_AI_ASSISTANT setting.",
389
- locked:function(ai_assistant){
390
- try{
391
- var settings = (_joe && _joe.Data && _joe.Data.setting) || [];
392
- var existing = settings.where({name:'DEFAULT_AI_ASSISTANT'})[0] || null;
393
- return !!(existing && existing.value === ai_assistant._id);
394
- }catch(e){
395
- return false;
396
398
  }
397
- }
398
- },
399
- // {
400
- // name: "test_button",
401
- // type: "button",
402
- // display: "Test Button",
403
- // method: "testButtonClick", // <- the method name you want to call
404
- // color: "orange", // <- Joe color class (joe-orange-button)
405
- // title: "Click to test button functionality",
406
- // schema: "ai_assistant" // <- schema to pull the method from (optional for now, we lock it anyway)
407
- // },
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' },
408
407
  { sidebar_end: "right" },
409
408
 
410
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
 
@@ -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,18 +37,22 @@ 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',
44
45
  'info',
45
46
  {section_start:'content'},
46
- {name:'content',type:'code', label:false,height:'600px',language:function(item){
47
+ {name:'content',type:'code', label:false,height:'600px',relaodable:true,language:function(item){
47
48
  switch(item.filetype){
48
49
  case 'js':
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%'},