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/CHANGELOG.md +22 -0
- package/_www/mcp-test.html +18 -0
- package/css/joe-styles.css +2 -1
- package/css/joe.css +4 -2
- package/css/joe.min.css +1 -1
- package/docs/Thought_Concept_for_JOE.md +137 -0
- package/docs/joe_agent_custom_gpt_instructions_v_3.md +57 -3
- package/img/joe-sprite.ai +1155 -758
- package/js/JsonObjectEditor.jquery.craydent.js +185 -5
- package/js/joe-ai.js +57 -0
- package/js/joe.js +186 -6
- package/js/joe.min.js +1 -1
- package/package.json +1 -1
- package/readme.md +19 -0
- package/server/apps/aihub.js +2 -0
- package/server/fields/core.js +49 -0
- package/server/modules/MCP.js +1237 -847
- package/server/modules/ThoughtPipeline.js +599 -0
- package/server/plugins/chatgpt.js +76 -7
- package/server/schemas/ai_pipeline.js +90 -0
- package/server/schemas/ai_response.js +165 -16
- package/server/schemas/task.js +4 -1
- package/server/schemas/thought.js +332 -0
- package/server/webconfig.js +1 -1
package/package.json
CHANGED
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
|
package/server/apps/aihub.js
CHANGED
package/server/fields/core.js
CHANGED
|
@@ -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
|
|