json-object-editor 0.10.642 → 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.642",
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`.
@@ -159,6 +169,13 @@ JOE is software that allows you to manage data models via JSON objects. There ar
159
169
  - If you see a payload like `{ originalURL: "/...", site: "no site found" }`, the request hit the Sites catch-all. Ensure MCP routes are initialized before Sites (handled by default in `server/init.js` via `MCP.init()`), and use the correct URL: `/.well-known/mcp/manifest.json` or `/mcp`.
160
170
  - To update contact email on /privacy and /terms, set Setting `PRIVACY_CONTACT`.
161
171
 
172
+ ## Thoughts & Thought Pipeline
173
+
174
+ - `thought` schema stores AI/human hypotheses, syntheses, and link-thoughts with `about[]` (what it concerns), `because[]` (receipts), `status`, and AI lineage fields like `source_ai_response` / `created_by`.
175
+ - `ThoughtPipeline` module compiles a deterministic context from a `scope_object` (the item you’re thinking about), schema summaries, and accepted Thoughts, and the `runThoughtAgent` MCP tool runs an OpenAI Responses call to propose new Thoughts.
176
+ - Each Thought run persists an `ai_response` with `response_type:'thought_generation'`, `referenced_objects:[scope_id]`, and `generated_thoughts[]` containing the ids of created Thought records.
177
+ - In any schema UI you can include core fields `proposeThought` and `ai_responses` to (a) trigger a Thought run for the current object and (b) list all related `ai_response` records for audit and reuse.
178
+
162
179
  ## File uploads (S3)
163
180
  - Uploader field options:
164
181
  - `allowmultiple: true|false` — allow selecting multiple files.
@@ -296,6 +313,8 @@ Properties for all Fields
296
313
  - sortable(true)
297
314
  - `code` :
298
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.
299
318
 
300
319
  - `boolean`:
301
320
  - label:controls checkbox label
@@ -5,6 +5,8 @@ var App = function () {
5
5
 
6
6
  // Core AI-related schemas in JOE
7
7
  this.collections = [
8
+ 'thought',
9
+ 'ai_pipeline',
8
10
  'ai_assistant',
9
11
  'ai_prompt',
10
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'},
@@ -550,6 +552,53 @@ var fields = {
550
552
  listConversations:{display:'Ai Conversations', type:"content",reloadable:true,run:function(obj){
551
553
  return _joe.schemas.ai_conversation.methods.listConversations(obj,true);
552
554
  }},
555
+ ai_responses:{
556
+ display:'AI Responses',
557
+ type:'content',
558
+ reloadable:true,
559
+ run:function(obj){
560
+ return _joe.schemas.ai_response.methods.listResponses(obj);
561
+ }
562
+ },
563
+ proposeThought:{
564
+ display:'Propose Thought',
565
+ type:'content',
566
+ reloadable:true,
567
+ run:function(obj){
568
+ if (!obj || !obj._id) {
569
+ return '<joe-text>Save this item before proposing Thoughts.</joe-text>';
570
+ }
571
+ var schema = _joe.current && _joe.current.schema || null;
572
+ var itemtype = (obj && obj.itemtype) || (schema && schema.name) || 'item';
573
+ // Allow schemas to override the default prompt/model via
574
+ // extend:'proposeThought', specs:{ prompt:'...', model:'gpt-5-nano' }
575
+ var fieldDef = null;
576
+ if (_joe && typeof _joe.getField === 'function') {
577
+ try { fieldDef = _joe.getField('proposeThought'); } catch(_e) {}
578
+ }
579
+ var overridePrompt = fieldDef && fieldDef.prompt;
580
+ var defaultPrompt = overridePrompt || (
581
+ 'Propose 1–2 concise hypotheses or links about this ' + itemtype +
582
+ ' and its related objects (risks, dependencies, or next steps). ' +
583
+ 'Base them only on the object fields and related records. ' +
584
+ 'Avoid meta-thoughts about prompts or schemas.'
585
+ );
586
+ var taId = 'propose_thought_prompt_' + obj._id;
587
+ var html = '';
588
+ html += '<div class="joe-field-comment">Thought prompt</div>';
589
+ html += '<textarea id="'+taId+'" style="width:100%;min-height:80px;">'+defaultPrompt+'</textarea>';
590
+ // For now, use the generic Thought agent; scope_id is the current object id.
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>';
599
+ return html;
600
+ }
601
+ },
553
602
 
554
603
  };
555
604