json-object-editor 0.10.650 → 0.10.653

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-object-editor",
3
- "version": "0.10.650",
3
+ "version": "0.10.653",
4
4
  "description": "JOE the Json Object Editor | Platform Edition",
5
5
  "main": "app.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -56,6 +56,16 @@ JOE is software that allows you to manage data models via JSON objects. There ar
56
56
  - Params: `{ itemtype?, q, filters?, fields?, threshold?, limit?, offset?, highlight?, minQueryLength? }`
57
57
  - Defaults: `fields` resolved from schema `searchables` (plural) if present; otherwise weights `name:0.6, info:0.3, description:0.1`. `threshold:0.5`, `limit:50`, `minQueryLength:2`.
58
58
  - Returns: `{ items, count }`. Each item may include `_score` (0..1) and `_matches` when `highlight` is true.
59
+ - `findObjectsByTag { tags, itemtype?, limit?, offset?, source?, slim?, withCount?, countOnly?, tagThreshold? }`
60
+ - Find objects that have ALL specified tags (AND logic). Tags can be provided as IDs (CUIDs) or names (strings) - names are resolved via fuzzy search.
61
+ - Returns: `{ items, tags, count?, error? }` where `tags` contains the resolved tag objects used in the search.
62
+ - Use `countOnly: true` to get just the count and matched tags without fetching items.
63
+ - If tags cannot be resolved, returns `{ items: [], tags: [...resolved ones...], error: "message" }` instead of throwing.
64
+ - `findObjectsByStatus { status, itemtype?, limit?, offset?, source?, slim?, withCount?, countOnly?, statusThreshold? }`
65
+ - Find objects by status. Status can be provided as ID (CUID) or name (string) - name is resolved via fuzzy search.
66
+ - Returns: `{ items, status, count?, error? }` where `status` is the resolved status object used in the search.
67
+ - Use `countOnly: true` to get just the count and matched status without fetching items.
68
+ - If status cannot be resolved, returns `{ items: [], status: null, error: "message" }` instead of throwing.
59
69
  - `saveObject({ object })`
60
70
  - `saveObjects({ objects, stopOnError?, concurrency? })`
61
71
  - Batch save with per-item history/events. Defaults: `stopOnError=false`, `concurrency=5`.
@@ -303,6 +313,8 @@ Properties for all Fields
303
313
  - sortable(true)
304
314
  - `code` :
305
315
  - language
316
+ - `json` :
317
+ - edit/store JSON subobjects as objects (not strings) using the code editor in JSON mode; pretty-prints on blur/save and treats whitespace-only reformatting as no-op changes.
306
318
 
307
319
  - `boolean`:
308
320
  - label:controls checkbox label
@@ -6,6 +6,7 @@ var App = function () {
6
6
  // Core AI-related schemas in JOE
7
7
  this.collections = [
8
8
  'thought',
9
+ 'ai_pipeline',
9
10
  'ai_assistant',
10
11
  'ai_prompt',
11
12
  'ai_tool',
@@ -97,6 +97,8 @@ var fields = {
97
97
  }
98
98
  },
99
99
  created:{locked:true,width:'50%'},
100
+ creator_type:{type:'select',values:['','user','agent'],locked:true,comment:'High-level origin of this record: human user or agent.'},
101
+ creator_id:{type:'text',locked:true,comment:'_id of the user or logical agent that created this record.'},
100
102
  itemtype:{locked:true, hidden:true},
101
103
  priority:{type:'select',values:[{name:'',value:1000},{name:1},{name:2},{name:3}]},
102
104
  site:{type:'select',values:'site',goto:'site',idprop:'_id',blank:true,icon:'site'},
@@ -568,7 +570,8 @@ var fields = {
568
570
  }
569
571
  var schema = _joe.current && _joe.current.schema || null;
570
572
  var itemtype = (obj && obj.itemtype) || (schema && schema.name) || 'item';
571
- // Allow schemas to override the default prompt via extend:'proposeThought',specs:{prompt:'...'}
573
+ // Allow schemas to override the default prompt/model via
574
+ // extend:'proposeThought', specs:{ prompt:'...', model:'gpt-5-nano' }
572
575
  var fieldDef = null;
573
576
  if (_joe && typeof _joe.getField === 'function') {
574
577
  try { fieldDef = _joe.getField('proposeThought'); } catch(_e) {}
@@ -582,11 +585,17 @@ var fields = {
582
585
  );
583
586
  var taId = 'propose_thought_prompt_' + obj._id;
584
587
  var html = '';
585
- html += '<joe-text>Thought prompt</joe-text>';
588
+ html += '<div class="joe-field-comment">Thought prompt</div>';
586
589
  html += '<textarea id="'+taId+'" style="width:100%;min-height:80px;">'+defaultPrompt+'</textarea>';
587
590
  // For now, use the generic Thought agent; scope_id is the current object id.
588
- html += "<joe-button class=\"joe-button joe-blue-button\" ";
589
- html += "onclick=\"_joe.Ai.runProposeThought('"+obj._id+"','"+taId+"')\">Run Thought Agent</joe-button>";
591
+ var args = "'" + obj._id + "','" + taId + "'";
592
+ if (fieldDef && fieldDef.model) {
593
+ // escape single quotes in model name for inline JS
594
+ var m = String(fieldDef.model).replace(/'/g, "\\'");
595
+ args += ",'" + m + "'";
596
+ }
597
+ html += '<joe-button class="joe-button joe-ai-button joe-iconed-button" ';
598
+ html += 'onclick="_joe.Ai.runProposeThought('+ args +')">Run Thought Agent</joe-button>';
590
599
  return html;
591
600
  }
592
601
  },