forge-openclaw-plugin 0.3.16 → 0.3.18
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/dist/assets/{action-bar-DgrmzFrI.js → action-bar-BAZevCEA.js} +1 -1
- package/dist/assets/{activity-page-CF451ueg.js → activity-page-CnT_hnCU.js} +1 -1
- package/dist/assets/{ai-surface-workspace-DtwybxJB.js → ai-surface-workspace-GPZzIIut.js} +1 -1
- package/dist/assets/artifacts-page-Bqjp0L-L.js +2 -0
- package/dist/assets/{atlas-panel-CB3uYk_K.js → atlas-panel-B95nrYpZ.js} +1 -1
- package/dist/assets/{board-CuxQRKPJ.js → board-CGgOvBP9.js} +1 -1
- package/dist/assets/{calendar-page-BYsDuLnh.js → calendar-page-mlr94wIS.js} +1 -1
- package/dist/assets/{calendar-rules-DXuOv2J-.js → calendar-rules-DdxPmBZJ.js} +1 -1
- package/dist/assets/{calendar-week-toolbar-8PJmiUE_.js → calendar-week-toolbar-Cu8V6zv1.js} +1 -1
- package/dist/assets/{charts-BzT4pUPg.js → charts-Cdtn55ol.js} +1 -1
- package/dist/assets/{companion-sync-lab-page-DzWNOaBh.js → companion-sync-lab-page-CJI5jf8W.js} +1 -1
- package/dist/assets/{daily-metrics-dashboard-CHcYxDhs.js → daily-metrics-dashboard-CXESx7bU.js} +1 -1
- package/dist/assets/{define-workbench-box-DcI0_QKW.js → define-workbench-box-Dbl9W7oE.js} +1 -1
- package/dist/assets/{entity-link-multiselect-C--AiCMb.js → entity-link-multiselect-DZ_jAjs4.js} +1 -1
- package/dist/assets/{entity-note-count-link-xne6mshj.js → entity-note-count-link-FOK_qhcC.js} +1 -1
- package/dist/assets/{entity-notes-surface-jy6Psist.js → entity-notes-surface-Dq9dFKjD.js} +1 -1
- package/dist/assets/execution-board-D9hkXKC2.js +1 -0
- package/dist/assets/{faceted-token-search-BMQ1Wwzt.js → faceted-token-search-BeShxjkc.js} +1 -1
- package/dist/assets/{flagship-signal-deck-DjcskRwF.js → flagship-signal-deck-DZx_HEH9.js} +1 -1
- package/dist/assets/{floating-action-menu-cGhbJ2tc.js → floating-action-menu-CFrgvQJi.js} +1 -1
- package/dist/assets/{forms-D1qJ3oOP.js → forms-DhEGHkFR.js} +1 -1
- package/dist/assets/{generic-node-view-DNVwfqqq.js → generic-node-view-C1kLClIm.js} +1 -1
- package/dist/assets/{goal-detail-page-dAbyCilO.js → goal-detail-page-BhMrnVQs.js} +1 -1
- package/dist/assets/{goal-dialog-DH50D0tP.js → goal-dialog-BlZHh3dw.js} +1 -1
- package/dist/assets/goals-page-CesC8IkZ.js +1 -0
- package/dist/assets/{graph-BF4IsheG.js → graph-U1J6VkbG.js} +1 -1
- package/dist/assets/habits-page-DHxZSThT.js +1 -0
- package/dist/assets/{health-boxes-BPTgGM6G.js → health-boxes-BZjIqiiG.js} +1 -1
- package/dist/assets/index-CHbe1sy1.css +1 -0
- package/dist/assets/index-Dj8q65se.js +2 -0
- package/dist/assets/{inline-note-fields-D4mCM1gO.js → inline-note-fields-DpmCMAJf.js} +1 -1
- package/dist/assets/{insight-flow-dialog-Btp6bkbV.js → insight-flow-dialog-DNIe0sts.js} +1 -1
- package/dist/assets/{insights-page-1qM4mxjS.js → insights-page-D_N_MWGu.js} +3 -3
- package/dist/assets/{kanban-boxes-u_A-UJG-.js → kanban-boxes-DTDG5UEJ.js} +1 -1
- package/dist/assets/{kanban-page-CKCa_3Qb.js → kanban-page-DEvIY5IW.js} +1 -1
- package/dist/assets/knowledge-graph-page-CvXSnnG5.js +1 -0
- package/dist/assets/{life-force-page-BZlyA144.js → life-force-page-CgvUrqQb.js} +1 -1
- package/dist/assets/{life-force-workspace-CtAWZXNw.js → life-force-workspace-BNeMbRHf.js} +1 -1
- package/dist/assets/{maps-BTVHALP8.js → maps-Dk9tZqTA.js} +1 -1
- package/dist/assets/{metric-tile-Bkx2btO2.js → metric-tile-DAhX60rg.js} +1 -1
- package/dist/assets/{motion-DcgUnXhY.js → motion-DeJZhOSA.js} +1 -1
- package/dist/assets/{movement-boxes-QZ2EIS9q.js → movement-boxes-BOqU18NH.js} +1 -1
- package/dist/assets/{movement-page-B-3ihggI.js → movement-page-DCDeUynh.js} +1 -1
- package/dist/assets/{note-markdown-BWedRE3c.js → note-markdown-Cxj84-0j.js} +1 -1
- package/dist/assets/{note-tags-input-DZkCqI1w.js → note-tags-input-CP0-EPpE.js} +1 -1
- package/dist/assets/{notes-boxes-DGFmt7Dp.js → notes-boxes-C7WPT7mf.js} +1 -1
- package/dist/assets/notes-page-Dll8PIks.js +1 -0
- package/dist/assets/{open-in-graph-button-CjvkEj1P.js → open-in-graph-button-BHl16hJP.js} +1 -1
- package/dist/assets/{orbit-map-CRHSPenk.js → orbit-map-De0qpMpY.js} +1 -1
- package/dist/assets/overview-page-C1RX7dcq.js +1 -0
- package/dist/assets/page-hero-DYmFM6-q.js +1 -0
- package/dist/assets/pill-cluster-ClkmFVFT.js +1 -0
- package/dist/assets/{preference-entity-handoff-button-CfCQl3cW.js → preference-entity-handoff-button-1XXtBsUF.js} +1 -1
- package/dist/assets/{preferences-page-OltGdsQ2.js → preferences-page-OwfPIQwe.js} +1 -1
- package/dist/assets/{project-collections-FfBIVwXu.js → project-collections-DfmkBk9d.js} +1 -1
- package/dist/assets/project-detail-page-BC_MNaca.js +1 -0
- package/dist/assets/{project-dialog-B_J1ESMk.js → project-dialog-BuZdXECa.js} +1 -1
- package/dist/assets/project-management-hierarchy-page-AhEHe60K.js +1 -0
- package/dist/assets/{project-management-section-nav-DBNHt9p5.js → project-management-section-nav-CnaseOqL.js} +1 -1
- package/dist/assets/{projects-boxes-BvlVsO5q.js → projects-boxes-D0zM8PfY.js} +1 -1
- package/dist/assets/projects-page-ltrWfLrA.js +1 -0
- package/dist/assets/psyche-behaviors-page-CPurgDg6.js +5 -0
- package/dist/assets/{psyche-flashcards-page-05606-97.js → psyche-flashcards-page-DnUSe-bb.js} +1 -1
- package/dist/assets/{psyche-goal-map-page-Cw-aqS3Y.js → psyche-goal-map-page-uWocO7kZ.js} +1 -1
- package/dist/assets/{psyche-graph-0E22QHPe.js → psyche-graph-BDszV3UN.js} +1 -1
- package/dist/assets/{psyche-metrics-page-DBFVPeMa.js → psyche-metrics-page-CIJLJTPy.js} +1 -1
- package/dist/assets/psyche-mode-guide-page-uC8L4WvH.js +1 -0
- package/dist/assets/psyche-modes-page-CtBeRA_3.js +1 -0
- package/dist/assets/psyche-page-Ds3QDsin.js +1 -0
- package/dist/assets/psyche-patterns-page-Cvq5WshW.js +5 -0
- package/dist/assets/{psyche-questionnaire-builder-page-DEt0UDsz.js → psyche-questionnaire-builder-page-Cg5Upe6z.js} +1 -1
- package/dist/assets/{psyche-questionnaire-detail-page-BXQbOE6A.js → psyche-questionnaire-detail-page-D4jEnNoh.js} +1 -1
- package/dist/assets/psyche-questionnaire-run-detail-page-CWoZEY31.js +1 -0
- package/dist/assets/{psyche-questionnaire-run-page-D_EokOQm.js → psyche-questionnaire-run-page-Yg_VG2vq.js} +1 -1
- package/dist/assets/{psyche-questionnaires-page-D1Ov2L4n.js → psyche-questionnaires-page-BqeOJRj7.js} +1 -1
- package/dist/assets/{psyche-report-detail-page-9HyPr8BJ.js → psyche-report-detail-page-BtcMQ7mk.js} +3 -3
- package/dist/assets/psyche-reports-page-tagvW0To.js +1 -0
- package/dist/assets/{psyche-schemas-DDol0j-g.js → psyche-schemas-CvRSkI_u.js} +1 -1
- package/dist/assets/psyche-schemas-beliefs-page-4NL3415v.js +9 -0
- package/dist/assets/{psyche-screen-time-page-DJMDR5oo.js → psyche-screen-time-page-Bc5AwZHQ.js} +1 -1
- package/dist/assets/{psyche-self-observation-page-DFKXG1Yv.js → psyche-self-observation-page-CUrUYbQ_.js} +1 -1
- package/dist/assets/{psyche-values-page-TWKth89J.js → psyche-values-page-BshT2sXE.js} +2 -2
- package/dist/assets/{question-flow-dialog-D-_EvoAt.js → question-flow-dialog-CPyXCqA-.js} +2 -2
- package/dist/assets/{report-chain-fields-Dy-jBQDn.js → report-chain-fields-C0UMLpze.js} +1 -1
- package/dist/assets/rewards-page-D9BzsNPW.js +1 -0
- package/dist/assets/{scheduling-rules-editor-CAd290IE.js → scheduling-rules-editor-DiA6KkQ4.js} +1 -1
- package/dist/assets/{schema-badge-BLaVI1D7.js → schema-badge-DURw2eYH.js} +1 -1
- package/dist/assets/{schemas-B0Pa-V-A.js → schemas-D_z2C8l1.js} +1 -1
- package/dist/assets/{select-menu-DcS4Ukjf.js → select-menu-BUB8__Nx.js} +1 -1
- package/dist/assets/{settings-agents-page-Bt38HhEJ.js → settings-agents-page-Kk98Whcf.js} +1 -1
- package/dist/assets/settings-bin-page-BnJ-mgy2.js +1 -0
- package/dist/assets/{settings-calendar-page-DPSSZV3s.js → settings-calendar-page-CdhlUnUW.js} +3 -3
- package/dist/assets/{settings-data-page-BdHsD1C_.js → settings-data-page-BvvuZNbb.js} +1 -1
- package/dist/assets/{settings-logs-page-D9OnWoFq.js → settings-logs-page-CrzkXxtZ.js} +1 -1
- package/dist/assets/{settings-mobile-page-DFpsXA4M.js → settings-mobile-page-Dl582NK6.js} +1 -1
- package/dist/assets/settings-models-page-COoBw28S.js +1 -0
- package/dist/assets/{settings-page-m_3iYPwU.js → settings-page-DqnlOCgo.js} +1 -1
- package/dist/assets/{settings-rewards-page-B2aBm-dA.js → settings-rewards-page-Cw5QSTjy.js} +1 -1
- package/dist/assets/{settings-section-nav-CMeU19Rx.js → settings-section-nav-C1NcWveT.js} +1 -1
- package/dist/assets/{settings-users-page-D8jyewJl.js → settings-users-page-0opvepcM.js} +1 -1
- package/dist/assets/{settings-wiki-page-DjOgQJAh.js → settings-wiki-page-CkpnUkiZ.js} +1 -1
- package/dist/assets/{sleep-page-D8-dA4bE.js → sleep-page-DrS1zs3B.js} +1 -1
- package/dist/assets/{sports-page-CK3PgPKB.js → sports-page-EVnB_zjB.js} +1 -1
- package/dist/assets/{state-Bpe5dF3T.js → state-DWw8Jay_.js} +1 -1
- package/dist/assets/{strategies-page-aFpJath-.js → strategies-page-COhyv_SH.js} +1 -1
- package/dist/assets/{strategy-detail-page-CobF5qLv.js → strategy-detail-page-BaCVkvIu.js} +1 -1
- package/dist/assets/{strategy-dialog-Fgoaoob5.js → strategy-dialog-DvlPo9WV.js} +1 -1
- package/dist/assets/{surface-D0dqgX-k.js → surface-Dg5fauKP.js} +1 -1
- package/dist/assets/{table-U7otr5go.js → table-CWVROEBP.js} +1 -1
- package/dist/assets/task-detail-page-3IeMYIXl.js +1 -0
- package/dist/assets/{task-dialog-eCDTF8xe.js → task-dialog-B7ZT4KE5.js} +5 -5
- package/dist/assets/timebox-planning-dialog-DoZzpEBp.js +1 -0
- package/dist/assets/{today-boxes-CYfskVrM.js → today-boxes-BbUNpb16.js} +1 -1
- package/dist/assets/today-page-adKXN2g1.js +1 -0
- package/dist/assets/training-load-page-DTYbu9f0.js +1 -0
- package/dist/assets/{ui-B9TWEtCx.js → ui-CdEDMtXF.js} +1 -1
- package/dist/assets/{use-anchored-overlay-position-BY4kNzPj.js → use-anchored-overlay-position-Cracjgo6.js} +1 -1
- package/dist/assets/{use-psyche-focus-target-BhNedCZB.js → use-psyche-focus-target-DvRgu-94.js} +1 -1
- package/dist/assets/{user-badge-MEZuJiir.js → user-badge-B8hYK6NU.js} +1 -1
- package/dist/assets/{user-select-field-fx129Uh6.js → user-select-field-akGHK-2t.js} +1 -1
- package/dist/assets/{utility-widgets-h5eG2jvc.js → utility-widgets-D4KsKxLT.js} +2 -2
- package/dist/assets/{vendor-BwL6m4SE.js → vendor-y_uz1Wft.js} +222 -212
- package/dist/assets/{vitals-page-eoFnQ3XL.js → vitals-page-Cjcxh-kO.js} +1 -1
- package/dist/assets/{weekly-review-page-C7BU1gkK.js → weekly-review-page-CR57efzH.js} +1 -1
- package/dist/assets/{weight-loss-page-Cc7Do3XY.js → weight-loss-page-Bk7YkB7b.js} +1 -1
- package/dist/assets/{wiki-article-markdown-CCKoSptz.js → wiki-article-markdown-um6gpmGQ.js} +2 -2
- package/dist/assets/{wiki-editor-page-BpbxZrgz.js → wiki-editor-page-DdP5hvjZ.js} +5 -5
- package/dist/assets/{wiki-ingest-history-page-D5Wfr8pc.js → wiki-ingest-history-page-DSTndduq.js} +1 -1
- package/dist/assets/{wiki-ingest-modal-DhRVsEwC.js → wiki-ingest-modal-PNW3CJ-o.js} +1 -1
- package/dist/assets/wiki-page-CsJlPyQ6.js +1 -0
- package/dist/assets/{workbench-flow-page-y9FxDbKO.js → workbench-flow-page-DFtIKgNe.js} +3 -3
- package/dist/assets/{workbench-page-Da16AZvN.js → workbench-page-DEpKjMEv.js} +1 -1
- package/dist/assets/workout-detail-page-BwfEhxA_.js +2 -0
- package/dist/index.html +8 -8
- package/dist/openclaw/parity.d.ts +1 -1
- package/dist/openclaw/parity.js +10 -0
- package/dist/openclaw/routes.js +78 -0
- package/dist/openclaw/tools.js +42 -0
- package/dist/server/apps/api/migrations/072_artifact_store.sql +106 -0
- package/dist/server/apps/api/migrations/073_artifact_entity_links_repair.sql +24 -0
- package/dist/server/apps/api/src/app.js +364 -3
- package/dist/server/apps/api/src/openapi.js +570 -1
- package/dist/server/apps/api/src/repositories/entity-links.js +66 -0
- package/dist/server/apps/api/src/services/artifacts.js +1059 -0
- package/dist/server/apps/api/src/services/entity-crud.js +22 -0
- package/dist/server/apps/api/src/services/knowledge-graph.js +45 -0
- package/dist/server/apps/api/src/services/psyche-observation-calendar.js +1 -0
- package/dist/server/apps/api/src/types.js +2 -0
- package/dist/server/apps/web/src/lib/api.js +69 -0
- package/dist/server/apps/web/src/lib/entity-visuals.js +10 -1
- package/dist/server/apps/web/src/lib/knowledge-graph-types.js +9 -0
- package/openclaw.plugin.json +2 -1
- package/package.json +1 -1
- package/server/migrations/072_artifact_store.sql +106 -0
- package/server/migrations/073_artifact_entity_links_repair.sql +24 -0
- package/skills/forge-openclaw/SKILL.md +57 -4
- package/skills/forge-openclaw/entity_conversation_playbooks.md +215 -14
- package/skills/forge-openclaw/psyche_entity_playbooks.md +20 -0
- package/dist/assets/execution-board-BSUZCIIx.js +0 -1
- package/dist/assets/goals-page-DkMy9mPD.js +0 -1
- package/dist/assets/habits-page-CCQR8rg6.js +0 -1
- package/dist/assets/index-VzCGTBS_.css +0 -1
- package/dist/assets/index-izRKx6JK.js +0 -2
- package/dist/assets/knowledge-graph-page-BZOxRv19.js +0 -1
- package/dist/assets/notes-page-DYkn04tz.js +0 -1
- package/dist/assets/overview-page-D6LsjPWe.js +0 -1
- package/dist/assets/page-hero-BLhM8FF3.js +0 -1
- package/dist/assets/pill-cluster-B5bYs_e2.js +0 -1
- package/dist/assets/project-detail-page-CCm3iZPQ.js +0 -1
- package/dist/assets/project-management-hierarchy-page-BNzvtNZj.js +0 -1
- package/dist/assets/projects-page-BUf7KV-_.js +0 -1
- package/dist/assets/psyche-behaviors-page-jtyhdpJ1.js +0 -5
- package/dist/assets/psyche-mode-guide-page-DI-LNEDT.js +0 -1
- package/dist/assets/psyche-modes-page-CaMupyfi.js +0 -1
- package/dist/assets/psyche-page-CFBq0YKf.js +0 -1
- package/dist/assets/psyche-patterns-page-sp4ikoef.js +0 -5
- package/dist/assets/psyche-questionnaire-run-detail-page-Cd3ClsSK.js +0 -1
- package/dist/assets/psyche-reports-page-BeyJg5fb.js +0 -1
- package/dist/assets/psyche-schemas-beliefs-page-DNmf-Vma.js +0 -9
- package/dist/assets/rewards-page-D3ymEd2X.js +0 -1
- package/dist/assets/settings-bin-page-DqyVI1i1.js +0 -1
- package/dist/assets/settings-models-page-DaFXLp-O.js +0 -1
- package/dist/assets/task-detail-page-CDK79bzk.js +0 -1
- package/dist/assets/timebox-planning-dialog-CNZIGSpd.js +0 -1
- package/dist/assets/today-page-Bnh8wopq.js +0 -1
- package/dist/assets/training-load-page-C7lq-jqy.js +0 -1
- package/dist/assets/wiki-page-1vf-HErs.js +0 -1
- package/dist/assets/workout-detail-page-Cq0YamXF.js +0 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z, ZodError } from "zod";
|
|
2
2
|
import { getDatabase, runInTransaction } from "../db.js";
|
|
3
3
|
import { createSleepSession, createSleepSessionSchema, createWorkoutSession, createWorkoutSessionSchema, deleteSleepSession, deleteWorkoutSession, getSleepSessionById, getWorkoutSessionById, listSleepSessions, listWorkoutSessions, updateSleepSession, updateSleepSessionSchema, updateWorkoutSession, updateWorkoutSessionSchema } from "../health.js";
|
|
4
|
+
import { artifactMetadataCreateSchema, artifactMetadataPatchSchema, createArtifactMetadata, deleteArtifactMetadata, getArtifactById, listArtifacts, updateArtifactMetadata } from "./artifacts.js";
|
|
4
5
|
import { createInsight, deleteInsight, getInsightById, listInsights, updateInsight } from "../repositories/collaboration.js";
|
|
5
6
|
import { createCalendarEvent, createTaskTimebox, createWorkBlockTemplate, deleteCalendarEvent, deleteTaskTimebox, deleteWorkBlockTemplate, getCalendarEventById, getTaskTimeboxById, getWorkBlockTemplateById, listCalendarEvents, listTaskTimeboxes, listWorkBlockTemplates, updateCalendarEvent, updateTaskTimebox, updateWorkBlockTemplate } from "../repositories/calendar.js";
|
|
6
7
|
import { createNote, deleteNote, getNoteById, listNotes, unlinkNotesForEntity, updateNote } from "../repositories/notes.js";
|
|
@@ -157,6 +158,17 @@ const CRUD_ENTITY_CAPABILITIES = {
|
|
|
157
158
|
update: (id, patch) => updateTaskTimebox(id, patch),
|
|
158
159
|
hardDelete: (id) => deleteTaskTimebox(id)
|
|
159
160
|
},
|
|
161
|
+
artifact: {
|
|
162
|
+
entityType: "artifact",
|
|
163
|
+
routeBase: "/api/v1/artifacts",
|
|
164
|
+
deleteMode: "soft_default",
|
|
165
|
+
inBin: true,
|
|
166
|
+
list: () => listArtifacts(),
|
|
167
|
+
get: (id) => getArtifactById(id),
|
|
168
|
+
create: () => createArtifactMetadata(),
|
|
169
|
+
update: (id, patch, context) => updateArtifactMetadata(id, patch, context),
|
|
170
|
+
hardDelete: (id, context) => deleteArtifactMetadata(id, context)
|
|
171
|
+
},
|
|
160
172
|
sleep_session: {
|
|
161
173
|
entityType: "sleep_session",
|
|
162
174
|
routeBase: "/api/v1/health/sleep",
|
|
@@ -370,6 +382,7 @@ const CREATE_ENTITY_SCHEMAS = {
|
|
|
370
382
|
calendar_event: createCalendarEventSchema,
|
|
371
383
|
work_block_template: createWorkBlockTemplateSchema,
|
|
372
384
|
task_timebox: createTaskTimeboxSchema,
|
|
385
|
+
artifact: artifactMetadataCreateSchema,
|
|
373
386
|
sleep_session: createSleepSessionSchema,
|
|
374
387
|
workout_session: createWorkoutSessionSchema,
|
|
375
388
|
psyche_value: createPsycheValueSchema,
|
|
@@ -400,6 +413,7 @@ const UPDATE_ENTITY_SCHEMAS = {
|
|
|
400
413
|
calendar_event: updateCalendarEventSchema,
|
|
401
414
|
work_block_template: updateWorkBlockTemplateSchema,
|
|
402
415
|
task_timebox: updateTaskTimeboxSchema,
|
|
416
|
+
artifact: artifactMetadataPatchSchema,
|
|
403
417
|
sleep_session: updateSleepSessionSchema,
|
|
404
418
|
workout_session: updateWorkoutSessionSchema,
|
|
405
419
|
psyche_value: updatePsycheValueSchema,
|
|
@@ -702,6 +716,14 @@ function matchesLinkedTo(entityType, entity, linkedTo) {
|
|
|
702
716
|
case "task_timebox":
|
|
703
717
|
return ((linkedTo.entityType === "task" && entity.taskId === linkedTo.id) ||
|
|
704
718
|
(linkedTo.entityType === "project" && entity.projectId === linkedTo.id));
|
|
719
|
+
case "artifact":
|
|
720
|
+
return (Array.isArray(entity.links) &&
|
|
721
|
+
entity.links.some((link) => typeof link === "object" &&
|
|
722
|
+
link !== null &&
|
|
723
|
+
"entityType" in link &&
|
|
724
|
+
"entityId" in link &&
|
|
725
|
+
link.entityType === linkedTo.entityType &&
|
|
726
|
+
link.entityId === linkedTo.id));
|
|
705
727
|
case "psyche_value":
|
|
706
728
|
return ((linkedTo.entityType === "goal" && Array.isArray(entity.linkedGoalIds) && entity.linkedGoalIds.includes(linkedTo.id)) ||
|
|
707
729
|
(linkedTo.entityType === "project" && Array.isArray(entity.linkedProjectIds) && entity.linkedProjectIds.includes(linkedTo.id)) ||
|
|
@@ -14,6 +14,7 @@ import { listProjectSummaries } from "./projects.js";
|
|
|
14
14
|
import { listAiConnectors } from "../repositories/ai-connectors.js";
|
|
15
15
|
import { buildKnowledgeGraphFacets, buildKnowledgeGraphFocusPayload, filterKnowledgeGraphData, selectKnowledgeGraphVisibleNodeIds } from "../../../web/src/lib/knowledge-graph.js";
|
|
16
16
|
import { getEntityVisual } from "../../../web/src/lib/entity-visuals.js";
|
|
17
|
+
import { listArtifacts } from "./artifacts.js";
|
|
17
18
|
import { KNOWLEDGE_GRAPH_RELATION_FAMILY_MAP, buildKnowledgeGraphFocusHref, buildKnowledgeGraphNodeId, getKnowledgeGraphEntityHref } from "../../../web/src/lib/knowledge-graph-types.js";
|
|
18
19
|
const GRAPH_RANGE = {
|
|
19
20
|
from: "2000-01-01T00:00:00.000Z",
|
|
@@ -34,6 +35,7 @@ const BASE_NODE_SIZE = {
|
|
|
34
35
|
calendar_event: 34,
|
|
35
36
|
work_block: 32,
|
|
36
37
|
timebox: 33,
|
|
38
|
+
artifact: 36,
|
|
37
39
|
value: 38,
|
|
38
40
|
pattern: 38,
|
|
39
41
|
behavior: 38,
|
|
@@ -243,6 +245,13 @@ export function buildKnowledgeGraph(userIds, query = {}) {
|
|
|
243
245
|
const calendarEvents = listCalendarEvents({ ...GRAPH_RANGE, userIds });
|
|
244
246
|
const workBlocks = listWorkBlockTemplates({ userIds });
|
|
245
247
|
const timeboxes = listTaskTimeboxes({ ...GRAPH_RANGE, userIds });
|
|
248
|
+
const artifacts = listArtifacts().filter((artifact) => {
|
|
249
|
+
if (selectedUserIds.size === 0) {
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
return Boolean((artifact.uploadedByUserId && selectedUserIds.has(artifact.uploadedByUserId)) ||
|
|
253
|
+
(artifact.actingForUserId && selectedUserIds.has(artifact.actingForUserId)));
|
|
254
|
+
});
|
|
246
255
|
const eventTypes = filterOwnedEntities("event_type", listEventTypes(), userIds);
|
|
247
256
|
const emotions = filterOwnedEntities("emotion_definition", listEmotionDefinitions(), userIds);
|
|
248
257
|
const values = filterOwnedEntities("psyche_value", listPsycheValues(), userIds);
|
|
@@ -808,6 +817,42 @@ export function buildKnowledgeGraph(userIds, query = {}) {
|
|
|
808
817
|
});
|
|
809
818
|
}
|
|
810
819
|
}
|
|
820
|
+
for (const artifact of artifacts) {
|
|
821
|
+
nodes.set(buildKnowledgeGraphNodeId("artifact", artifact.id), makeNode({
|
|
822
|
+
entityType: "artifact",
|
|
823
|
+
entityId: artifact.id,
|
|
824
|
+
entityKind: "artifact",
|
|
825
|
+
title: artifact.title,
|
|
826
|
+
subtitle: `${artifact.detectedExtension.toUpperCase()} · ${artifact.dangerLevel}`,
|
|
827
|
+
description: artifact.shortDescription || artifact.description,
|
|
828
|
+
searchText: JSON.stringify({
|
|
829
|
+
title: artifact.title,
|
|
830
|
+
shortDescription: artifact.shortDescription,
|
|
831
|
+
description: artifact.description,
|
|
832
|
+
originalFileName: artifact.originalFileName,
|
|
833
|
+
sourceLabel: artifact.sourceLabel,
|
|
834
|
+
metadata: artifact.metadata
|
|
835
|
+
}),
|
|
836
|
+
previewStats: [
|
|
837
|
+
{ label: "Format", value: artifact.formatFamily },
|
|
838
|
+
{ label: "Danger", value: `${artifact.dangerScore}/100` },
|
|
839
|
+
{ label: "Links", value: artifact.links.length }
|
|
840
|
+
],
|
|
841
|
+
href: getKnowledgeGraphEntityHref("artifact", artifact.id),
|
|
842
|
+
updatedAt: artifact.updatedAt
|
|
843
|
+
}));
|
|
844
|
+
for (const link of artifact.links) {
|
|
845
|
+
addEdge(edges, {
|
|
846
|
+
source: buildKnowledgeGraphNodeId("artifact", artifact.id),
|
|
847
|
+
target: buildKnowledgeGraphNodeId(link.targetEntityType, link.targetEntityId),
|
|
848
|
+
relationKind: "entity_link",
|
|
849
|
+
label: link.relationship || "Entity link",
|
|
850
|
+
strength: 0.7,
|
|
851
|
+
directional: true,
|
|
852
|
+
structural: false
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
}
|
|
811
856
|
for (const eventType of eventTypes) {
|
|
812
857
|
nodes.set(buildKnowledgeGraphNodeId("event_type", eventType.id), makeNode({
|
|
813
858
|
entityType: "event_type",
|
|
@@ -40,6 +40,7 @@ const ACTIVITY_ENTITY_LABELS = {
|
|
|
40
40
|
work_block: "Work block",
|
|
41
41
|
work_block_template: "Work block template",
|
|
42
42
|
task_timebox: "Task timebox",
|
|
43
|
+
artifact: "Artifact",
|
|
43
44
|
preference_catalog: "Preference catalog",
|
|
44
45
|
preference_catalog_item: "Preference concept",
|
|
45
46
|
preference_context: "Preference context",
|
|
@@ -172,6 +172,7 @@ export const activityEntityTypeSchema = z.enum([
|
|
|
172
172
|
"work_block",
|
|
173
173
|
"work_block_template",
|
|
174
174
|
"task_timebox",
|
|
175
|
+
"artifact",
|
|
175
176
|
"sleep_session",
|
|
176
177
|
"workout_session"
|
|
177
178
|
]);
|
|
@@ -358,6 +359,7 @@ export const crudEntityTypeSchema = z.enum([
|
|
|
358
359
|
"calendar_event",
|
|
359
360
|
"work_block_template",
|
|
360
361
|
"task_timebox",
|
|
362
|
+
"artifact",
|
|
361
363
|
"psyche_value",
|
|
362
364
|
"behavior_pattern",
|
|
363
365
|
"behavior",
|
|
@@ -890,6 +890,75 @@ export function createNote(input) {
|
|
|
890
890
|
body: JSON.stringify(input)
|
|
891
891
|
});
|
|
892
892
|
}
|
|
893
|
+
export async function listArtifacts(options = {}) {
|
|
894
|
+
const search = new URLSearchParams();
|
|
895
|
+
if (options.query?.trim()) {
|
|
896
|
+
search.set("query", options.query.trim());
|
|
897
|
+
}
|
|
898
|
+
if (options.artifactState) {
|
|
899
|
+
search.set("artifactState", options.artifactState);
|
|
900
|
+
}
|
|
901
|
+
if (options.dangerLevel) {
|
|
902
|
+
search.set("dangerLevel", options.dangerLevel);
|
|
903
|
+
}
|
|
904
|
+
if (options.formatFamily) {
|
|
905
|
+
search.set("formatFamily", options.formatFamily);
|
|
906
|
+
}
|
|
907
|
+
if (options.linkedEntityType?.trim() && options.linkedEntityId?.trim()) {
|
|
908
|
+
search.set("linkedEntityType", options.linkedEntityType.trim());
|
|
909
|
+
search.set("linkedEntityId", options.linkedEntityId.trim());
|
|
910
|
+
}
|
|
911
|
+
if (options.limit) {
|
|
912
|
+
search.set("limit", String(options.limit));
|
|
913
|
+
}
|
|
914
|
+
const suffix = search.size > 0 ? `?${search.toString()}` : "";
|
|
915
|
+
return request(`/api/v1/artifacts${suffix}`);
|
|
916
|
+
}
|
|
917
|
+
export function getArtifact(artifactId) {
|
|
918
|
+
return request(`/api/v1/artifacts/${encodeURIComponent(artifactId)}`);
|
|
919
|
+
}
|
|
920
|
+
export function uploadArtifact(input) {
|
|
921
|
+
return request("/api/v1/artifacts", {
|
|
922
|
+
method: "POST",
|
|
923
|
+
body: JSON.stringify(input)
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
export function patchArtifact(artifactId, patch) {
|
|
927
|
+
return request(`/api/v1/artifacts/${encodeURIComponent(artifactId)}`, {
|
|
928
|
+
method: "PATCH",
|
|
929
|
+
body: JSON.stringify(patch)
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
export function downloadArtifact(artifactId) {
|
|
933
|
+
return requestBlob(`/api/v1/artifacts/${encodeURIComponent(artifactId)}/download`);
|
|
934
|
+
}
|
|
935
|
+
export function rescanArtifact(artifactId) {
|
|
936
|
+
return request(`/api/v1/artifacts/${encodeURIComponent(artifactId)}/scan`, { method: "POST" });
|
|
937
|
+
}
|
|
938
|
+
export function enrichArtifact(artifactId, input = {}) {
|
|
939
|
+
return request(`/api/v1/artifacts/${encodeURIComponent(artifactId)}/enrich`, {
|
|
940
|
+
method: "POST",
|
|
941
|
+
body: JSON.stringify(input)
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
export function replaceArtifactEntityLinks(artifactId, links) {
|
|
945
|
+
return request(`/api/v1/artifacts/${encodeURIComponent(artifactId)}/links`, {
|
|
946
|
+
method: "POST",
|
|
947
|
+
body: JSON.stringify({ links })
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
export function patchArtifactTrust(artifactId, input) {
|
|
951
|
+
return request(`/api/v1/artifacts/${encodeURIComponent(artifactId)}/trust`, {
|
|
952
|
+
method: "POST",
|
|
953
|
+
body: JSON.stringify(input)
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
export function listArtifactVersions(artifactId) {
|
|
957
|
+
return request(`/api/v1/artifacts/${encodeURIComponent(artifactId)}/versions`);
|
|
958
|
+
}
|
|
959
|
+
export function listArtifactAuditEvents(artifactId) {
|
|
960
|
+
return request(`/api/v1/artifacts/${encodeURIComponent(artifactId)}/audit`);
|
|
961
|
+
}
|
|
893
962
|
export function getNote(noteId) {
|
|
894
963
|
return request(`/api/v1/notes/${noteId}`);
|
|
895
964
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bot, CalendarDays, Compass, FileText, FolderOpen, GitBranch, Heart, ListTodo, Network, NotebookPen, PanelTop, Quote, RefreshCw, Repeat, Route, Shapes, Sparkles, StickyNote, Target, Timer, Workflow } from "lucide-react";
|
|
1
|
+
import { Archive, Bot, CalendarDays, Compass, FileText, FolderOpen, GitBranch, Heart, ListTodo, Network, NotebookPen, PanelTop, Quote, RefreshCw, Repeat, Route, Shapes, Sparkles, StickyNote, Target, Timer, Workflow } from "lucide-react";
|
|
2
2
|
export const ENTITY_KINDS = [
|
|
3
3
|
"goal",
|
|
4
4
|
"project",
|
|
@@ -14,6 +14,7 @@ export const ENTITY_KINDS = [
|
|
|
14
14
|
"calendar_event",
|
|
15
15
|
"work_block",
|
|
16
16
|
"timebox",
|
|
17
|
+
"artifact",
|
|
17
18
|
"value",
|
|
18
19
|
"pattern",
|
|
19
20
|
"behavior",
|
|
@@ -127,6 +128,13 @@ const ENTITY_VISUAL_SEEDS = [
|
|
|
127
128
|
iconName: "Timer",
|
|
128
129
|
accentRgb: [244, 114, 182]
|
|
129
130
|
},
|
|
131
|
+
{
|
|
132
|
+
kind: "artifact",
|
|
133
|
+
label: "Artifact",
|
|
134
|
+
icon: Archive,
|
|
135
|
+
iconName: "Archive",
|
|
136
|
+
accentRgb: [45, 212, 191]
|
|
137
|
+
},
|
|
130
138
|
{
|
|
131
139
|
kind: "value",
|
|
132
140
|
label: "Value",
|
|
@@ -259,6 +267,7 @@ const CRUD_ENTITY_KIND_MAP = {
|
|
|
259
267
|
calendar_event: "calendar_event",
|
|
260
268
|
work_block_template: "work_block",
|
|
261
269
|
task_timebox: "timebox",
|
|
270
|
+
artifact: "artifact",
|
|
262
271
|
psyche_value: "value",
|
|
263
272
|
behavior_pattern: "pattern",
|
|
264
273
|
behavior: "behavior",
|
|
@@ -39,6 +39,11 @@ export const KNOWLEDGE_GRAPH_HIERARCHY_LANES = [
|
|
|
39
39
|
label: "Calendar",
|
|
40
40
|
kinds: ["calendar_event", "work_block", "timebox"]
|
|
41
41
|
},
|
|
42
|
+
{
|
|
43
|
+
id: "artifacts",
|
|
44
|
+
label: "Artifacts",
|
|
45
|
+
kinds: ["artifact"]
|
|
46
|
+
},
|
|
42
47
|
{
|
|
43
48
|
id: "values",
|
|
44
49
|
label: "Values",
|
|
@@ -95,6 +100,7 @@ export const KNOWLEDGE_GRAPH_RELATION_LABELS = {
|
|
|
95
100
|
strategy_step: "Strategy step",
|
|
96
101
|
strategy_link: "Strategy context",
|
|
97
102
|
habit_link: "Habit link",
|
|
103
|
+
entity_link: "Entity link",
|
|
98
104
|
note_link: "Note link",
|
|
99
105
|
wiki_parent: "Wiki parent",
|
|
100
106
|
wiki_link: "Wiki link",
|
|
@@ -156,6 +162,7 @@ export const KNOWLEDGE_GRAPH_RELATION_FAMILY_MAP = {
|
|
|
156
162
|
strategy_step: "structural",
|
|
157
163
|
strategy_link: "contextual",
|
|
158
164
|
habit_link: "contextual",
|
|
165
|
+
entity_link: "contextual",
|
|
159
166
|
note_link: "contextual",
|
|
160
167
|
wiki_parent: "structural",
|
|
161
168
|
wiki_link: "contextual",
|
|
@@ -236,6 +243,8 @@ export function getKnowledgeGraphEntityHref(entityType, entityId, options) {
|
|
|
236
243
|
case "work_block_template":
|
|
237
244
|
case "task_timebox":
|
|
238
245
|
return `/calendar`;
|
|
246
|
+
case "artifact":
|
|
247
|
+
return `/artifacts/${encodeURIComponent(entityId)}`;
|
|
239
248
|
case "event_type":
|
|
240
249
|
case "emotion_definition":
|
|
241
250
|
return "/psyche/reports";
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "forge-openclaw-plugin",
|
|
3
3
|
"name": "Forge",
|
|
4
4
|
"description": "Curated OpenClaw adapter for the Forge collaboration API, UI entrypoint, and localhost auto-start runtime.",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.18",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"tools": [
|
|
25
25
|
"forge_adjust_work_minutes",
|
|
26
26
|
"forge_apply_doctor_fix",
|
|
27
|
+
"forge_call_artifact_route",
|
|
27
28
|
"forge_call_life_force_route",
|
|
28
29
|
"forge_call_movement_route",
|
|
29
30
|
"forge_call_workbench_route",
|
package/package.json
CHANGED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS artifact_blobs (
|
|
2
|
+
content_sha256 TEXT PRIMARY KEY,
|
|
3
|
+
storage_key TEXT NOT NULL UNIQUE,
|
|
4
|
+
byte_size INTEGER NOT NULL,
|
|
5
|
+
detected_mime_type TEXT NOT NULL DEFAULT '',
|
|
6
|
+
created_at TEXT NOT NULL
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
CREATE TABLE IF NOT EXISTS artifacts (
|
|
10
|
+
id TEXT PRIMARY KEY,
|
|
11
|
+
title TEXT NOT NULL,
|
|
12
|
+
short_description TEXT NOT NULL DEFAULT '',
|
|
13
|
+
description TEXT NOT NULL DEFAULT '',
|
|
14
|
+
original_file_name TEXT NOT NULL,
|
|
15
|
+
storage_key TEXT NOT NULL,
|
|
16
|
+
storage_path TEXT NOT NULL,
|
|
17
|
+
content_sha256 TEXT NOT NULL,
|
|
18
|
+
byte_size INTEGER NOT NULL,
|
|
19
|
+
detected_extension TEXT NOT NULL,
|
|
20
|
+
declared_mime_type TEXT NOT NULL DEFAULT '',
|
|
21
|
+
detected_mime_type TEXT NOT NULL DEFAULT '',
|
|
22
|
+
format_family TEXT NOT NULL,
|
|
23
|
+
source_kind TEXT NOT NULL DEFAULT 'upload',
|
|
24
|
+
source_label TEXT NOT NULL DEFAULT '',
|
|
25
|
+
uploaded_by_user_id TEXT,
|
|
26
|
+
uploaded_by_agent_id TEXT,
|
|
27
|
+
acting_for_user_id TEXT,
|
|
28
|
+
artifact_state TEXT NOT NULL DEFAULT 'active',
|
|
29
|
+
danger_score INTEGER NOT NULL DEFAULT 0,
|
|
30
|
+
danger_level TEXT NOT NULL DEFAULT 'low',
|
|
31
|
+
download_policy TEXT NOT NULL DEFAULT 'human_only',
|
|
32
|
+
scan_results_json TEXT NOT NULL DEFAULT '{}',
|
|
33
|
+
enrichment_results_json TEXT NOT NULL DEFAULT '{}',
|
|
34
|
+
metadata_json TEXT NOT NULL DEFAULT '{}',
|
|
35
|
+
created_at TEXT NOT NULL,
|
|
36
|
+
updated_at TEXT NOT NULL,
|
|
37
|
+
FOREIGN KEY (content_sha256) REFERENCES artifact_blobs(content_sha256)
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
CREATE INDEX IF NOT EXISTS idx_artifacts_updated
|
|
41
|
+
ON artifacts (updated_at DESC);
|
|
42
|
+
|
|
43
|
+
CREATE INDEX IF NOT EXISTS idx_artifacts_state_danger
|
|
44
|
+
ON artifacts (artifact_state, danger_level, updated_at DESC);
|
|
45
|
+
|
|
46
|
+
CREATE INDEX IF NOT EXISTS idx_artifacts_sha
|
|
47
|
+
ON artifacts (content_sha256, updated_at DESC);
|
|
48
|
+
|
|
49
|
+
CREATE TABLE IF NOT EXISTS artifact_versions (
|
|
50
|
+
id TEXT PRIMARY KEY,
|
|
51
|
+
artifact_id TEXT NOT NULL,
|
|
52
|
+
version_number INTEGER NOT NULL,
|
|
53
|
+
content_sha256 TEXT NOT NULL,
|
|
54
|
+
storage_key TEXT NOT NULL,
|
|
55
|
+
byte_size INTEGER NOT NULL,
|
|
56
|
+
original_file_name TEXT NOT NULL,
|
|
57
|
+
scan_results_json TEXT NOT NULL DEFAULT '{}',
|
|
58
|
+
enrichment_results_json TEXT NOT NULL DEFAULT '{}',
|
|
59
|
+
created_by_actor TEXT,
|
|
60
|
+
created_at TEXT NOT NULL,
|
|
61
|
+
FOREIGN KEY (artifact_id) REFERENCES artifacts(id) ON DELETE CASCADE,
|
|
62
|
+
FOREIGN KEY (content_sha256) REFERENCES artifact_blobs(content_sha256),
|
|
63
|
+
UNIQUE (artifact_id, version_number)
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
CREATE INDEX IF NOT EXISTS idx_artifact_versions_artifact
|
|
67
|
+
ON artifact_versions (artifact_id, version_number DESC);
|
|
68
|
+
|
|
69
|
+
CREATE TABLE IF NOT EXISTS entity_links (
|
|
70
|
+
source_entity_type TEXT NOT NULL,
|
|
71
|
+
source_entity_id TEXT NOT NULL,
|
|
72
|
+
target_entity_type TEXT NOT NULL,
|
|
73
|
+
target_entity_id TEXT NOT NULL,
|
|
74
|
+
anchor_key TEXT NOT NULL DEFAULT '',
|
|
75
|
+
relationship TEXT NOT NULL DEFAULT 'related',
|
|
76
|
+
created_by_actor TEXT,
|
|
77
|
+
created_at TEXT NOT NULL,
|
|
78
|
+
PRIMARY KEY (
|
|
79
|
+
source_entity_type,
|
|
80
|
+
source_entity_id,
|
|
81
|
+
target_entity_type,
|
|
82
|
+
target_entity_id,
|
|
83
|
+
anchor_key,
|
|
84
|
+
relationship
|
|
85
|
+
)
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
CREATE INDEX IF NOT EXISTS idx_entity_links_source
|
|
89
|
+
ON entity_links (source_entity_type, source_entity_id, created_at DESC);
|
|
90
|
+
|
|
91
|
+
CREATE INDEX IF NOT EXISTS idx_entity_links_target
|
|
92
|
+
ON entity_links (target_entity_type, target_entity_id, created_at DESC);
|
|
93
|
+
|
|
94
|
+
CREATE TABLE IF NOT EXISTS artifact_audit_events (
|
|
95
|
+
id TEXT PRIMARY KEY,
|
|
96
|
+
artifact_id TEXT NOT NULL,
|
|
97
|
+
event_type TEXT NOT NULL,
|
|
98
|
+
actor TEXT,
|
|
99
|
+
source TEXT NOT NULL,
|
|
100
|
+
metadata_json TEXT NOT NULL DEFAULT '{}',
|
|
101
|
+
created_at TEXT NOT NULL,
|
|
102
|
+
FOREIGN KEY (artifact_id) REFERENCES artifacts(id) ON DELETE CASCADE
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
CREATE INDEX IF NOT EXISTS idx_artifact_audit_events_artifact
|
|
106
|
+
ON artifact_audit_events (artifact_id, created_at DESC);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS entity_links (
|
|
2
|
+
source_entity_type TEXT NOT NULL,
|
|
3
|
+
source_entity_id TEXT NOT NULL,
|
|
4
|
+
target_entity_type TEXT NOT NULL,
|
|
5
|
+
target_entity_id TEXT NOT NULL,
|
|
6
|
+
anchor_key TEXT NOT NULL DEFAULT '',
|
|
7
|
+
relationship TEXT NOT NULL DEFAULT 'related',
|
|
8
|
+
created_by_actor TEXT,
|
|
9
|
+
created_at TEXT NOT NULL,
|
|
10
|
+
PRIMARY KEY (
|
|
11
|
+
source_entity_type,
|
|
12
|
+
source_entity_id,
|
|
13
|
+
target_entity_type,
|
|
14
|
+
target_entity_id,
|
|
15
|
+
anchor_key,
|
|
16
|
+
relationship
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
CREATE INDEX IF NOT EXISTS idx_entity_links_source
|
|
21
|
+
ON entity_links (source_entity_type, source_entity_id, created_at DESC);
|
|
22
|
+
|
|
23
|
+
CREATE INDEX IF NOT EXISTS idx_entity_links_target
|
|
24
|
+
ON entity_links (target_entity_type, target_entity_id, created_at DESC);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: forge-openclaw-plugin
|
|
3
|
-
description: use when the user wants to save, search, update, review, start, stop, reward, explain, compare, or run Forge records, or when the conversation is clearly about a Forge entity or domain surface such as a goal, project, strategy, task, habit, note, wiki_page, calendar_event, calendar_connection, work_block_template, task_timebox, task_run, work_adjustment, insight, preference item, preference context, preference catalog, preference judgment, preference signal, questionnaire instrument, questionnaire run, self observation, operator_overview, operator_context, calendar_overview, sleep_overview, sports_overview, training_load, weight_loss, movement, life_force, workbench, psyche_value, behavior_pattern, behavior, belief_entry, mode_profile, mode_guide_session, flashcard, trigger_report, event_type, emotion_definition, sleep_session, or workout_session. identify the exact Forge object or specialized surface, keep the main conversation natural, guide psyche intake with active listening before storing it, and for psyche issues that need understanding first usually begin with one exploratory question before any formulation or save suggestion.
|
|
3
|
+
description: use when the user wants to save, search, update, review, start, stop, reward, explain, compare, or run Forge records, or when the conversation is clearly about a Forge entity or domain surface such as a goal, project, strategy, task, habit, note, wiki_page, artifact, calendar_event, calendar_connection, work_block_template, task_timebox, task_run, work_adjustment, insight, preference item, preference context, preference catalog, preference judgment, preference signal, questionnaire instrument, questionnaire run, self observation, operator_overview, operator_context, calendar_overview, sleep_overview, sports_overview, training_load, weight_loss, movement, life_force, workbench, psyche_value, behavior_pattern, behavior, belief_entry, mode_profile, mode_guide_session, flashcard, trigger_report, event_type, emotion_definition, sleep_session, or workout_session. identify the exact Forge object or specialized surface, keep the main conversation natural, guide psyche intake with active listening before storing it, and for psyche issues that need understanding first usually begin with one exploratory question before any formulation or save suggestion.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
Forge is the user's structured system for planning work, doing work, reflecting on patterns, and keeping a truthful record of what is happening. Use it when the user is clearly working inside that system, or when they are describing something that naturally belongs there and would benefit from being stored, updated, reviewed, or acted on in Forge. Keep the conversation natural first. Do not turn every message into intake. When a real Forge entity is clearly present, name the exact entity type plainly, help with the substance of the conversation, and then offer Forge once, lightly, if storing it would genuinely help.
|
|
@@ -59,7 +59,7 @@ PM surface rule:
|
|
|
59
59
|
human/bot ownership filters.
|
|
60
60
|
- Guided modal flows handle create, edit, move, link, and closeout actions.
|
|
61
61
|
|
|
62
|
-
Forge has four major stored-entity surfaces, read-model surfaces, and three specialized domain surfaces. The planning side covers goals, projects, strategies, tasks, habits, notes, calendar events, recurring work blocks, task timeboxes, live work sessions, and agent-authored insights. The Health side covers sleep sessions, sports and workout sessions, the read-only training-load surface for cardiovascular load and HR zone review, the weight-loss and nutrition workflow, companion pairing, and habit-generated workout records that should still stay linked to the broader Forge graph. The Preferences side covers contextual taste modeling, pairwise comparisons, direct signals, editable concept libraries, and preference items that can come from Forge entities or seeded concept domains such as food, activities, places, countries, fashion, people, media, and tools. The Psyche side covers values, patterns, behaviors, beliefs, modes, guided mode sessions, flashcards, trigger reports, event types, reusable emotion definitions, questionnaire instruments, questionnaire runs, and the note-backed self-observation calendar. Read-model surfaces include `operator_overview`, `operator_context`, `calendar_overview`, `sleep_overview`, `sports_overview`, `training_load`, `weight_loss`, and the self-observation calendar; ask what practical decision the read should support before adding write-shaped questions. The specialized domain surfaces are Movement, Life Force, and Workbench; agents must use their dedicated route families instead of forcing them through batch CRUD. Forge also has a SQLite-backed Wiki memory layer with explicit spaces, Markdown content in database rows, backlinks, optional embeddings, and structured links back to Forge entities. Forge is also multi-user: every entity can belong to a typed `human` or `bot` user through `userId`, and read routes can scope to one or many users with `userId` or repeated `userIds`. The current access posture is configurable through a directional user graph, but the live default is still permissive: Forge can list users directly, every relationship edge starts open, and a user can read or affect another user's linked records when the route explicitly asks for them. Use `forge_get_user_directory` when owner identity or cross-user access matters. Strategies can also be locked into a contract with `isLocked`; once locked, do not mutate the graph or target structure unless the user explicitly wants the strategy unlocked first. The model should use the real entity names, not vague substitutes. Say `project`, not “initiative”. Say `behavior_pattern`, not “theme”. Say `trigger_report`, not “incident note”.
|
|
62
|
+
Forge has four major stored-entity surfaces, read-model surfaces, specialized CRUD surfaces, and three specialized domain surfaces. The planning side covers goals, projects, strategies, tasks, habits, notes, calendar events, recurring work blocks, task timeboxes, live work sessions, and agent-authored insights. The Health side covers sleep sessions, sports and workout sessions, the read-only training-load surface for cardiovascular load and HR zone review, the weight-loss and nutrition workflow, companion pairing, and habit-generated workout records that should still stay linked to the broader Forge graph. The Preferences side covers contextual taste modeling, pairwise comparisons, direct signals, editable concept libraries, and preference items that can come from Forge entities or seeded concept domains such as food, activities, places, countries, fashion, people, media, and tools. The Psyche side covers values, patterns, behaviors, beliefs, modes, guided mode sessions, flashcards, trigger reports, event types, reusable emotion definitions, questionnaire instruments, questionnaire runs, and the note-backed self-observation calendar. Read-model surfaces include `operator_overview`, `operator_context`, `calendar_overview`, `sleep_overview`, `sports_overview`, `training_load`, `weight_loss`, and the self-observation calendar; ask what practical decision the read should support before adding write-shaped questions. The specialized domain surfaces are Movement, Life Force, and Workbench; agents must use their dedicated route families instead of forcing them through batch CRUD. Forge also has a SQLite-backed Wiki memory layer with explicit spaces, Markdown content in database rows, backlinks, optional embeddings, and structured links back to Forge entities. The Artifact Store is a specialized CRUD surface for trusted stored files such as spreadsheets, documents, PDFs, text, structured text, and images; artifact relationships use the general `entity_links` model, and agents must not download, open, execute, preview, or transform stored file bytes. Forge is also multi-user: every entity can belong to a typed `human` or `bot` user through `userId`, and read routes can scope to one or many users with `userId` or repeated `userIds`. The current access posture is configurable through a directional user graph, but the live default is still permissive: Forge can list users directly, every relationship edge starts open, and a user can read or affect another user's linked records when the route explicitly asks for them. Use `forge_get_user_directory` when owner identity or cross-user access matters. Strategies can also be locked into a contract with `isLocked`; once locked, do not mutate the graph or target structure unless the user explicitly wants the strategy unlocked first. The model should use the real entity names, not vague substitutes. Say `project`, not “initiative”. Say `behavior_pattern`, not “theme”. Say `trigger_report`, not “incident note”.
|
|
63
63
|
Habits are a first-class recurring entity in the planning side.
|
|
64
64
|
NEGATIVE HABIT CHECK-IN RULE: for a `negative` habit, the correct aligned/resisted outcome is `missed`. `missed` means the bad habit was resisted, the user stayed aligned, and the habit should award its XP bonus.
|
|
65
65
|
|
|
@@ -78,12 +78,40 @@ save confirmation. Report product actions such as "saved the belief", "corrected
|
|
|
78
78
|
missing stay", "updated the weekday energy pattern", or "read the failed node" before
|
|
79
79
|
any route-key or endpoint detail.
|
|
80
80
|
|
|
81
|
+
Use the known-target fast path when the user already supplied the object, action, and
|
|
82
|
+
likely lane. For normal entities, ask only for parent, owner, or duplicate-disambiguation that changes the write. For task hierarchy, ask only for the project,
|
|
83
|
+
issue, or parent task that changes placement. For Movement, ask only for the missing
|
|
84
|
+
interval, boundary, saved object, or confirmation. For Life Force, ask only for the
|
|
85
|
+
weekday, profile field, signal intensity, or planning effect. For Workbench, ask only
|
|
86
|
+
for the missing flow, run, node, input, output, or preservation choice. For direct
|
|
87
|
+
Psyche saves, ask one accuracy or consent question instead of restarting exploration.
|
|
88
|
+
|
|
89
|
+
Use the active-listening turn contract before deepening: reflect the specific stake,
|
|
90
|
+
working shape, or product object in one sentence; decide internally whether the next
|
|
91
|
+
answer would change wording, placement, timing, route scope, support action,
|
|
92
|
+
verification read, preservation choice, or consent; then ask one question. For Psyche,
|
|
93
|
+
name the felt stake, protection, prediction, payoff, cost, or value conflict, and when
|
|
94
|
+
a functional loop or belief sentence is already visible, offer one tentative
|
|
95
|
+
hypothesis plus one fit-or-correction question instead of another broad exploration.
|
|
96
|
+
For logistical records, keep the reflection short and ask for the operational detail.
|
|
97
|
+
|
|
98
|
+
Use the route execution handoff before any read, write, run, repair, or publish call:
|
|
99
|
+
freeze the accepted user-facing target, choose exactly one lane, use batch CRUD only
|
|
100
|
+
for catalog entities, use named tools or documented routes for specialized CRUD and
|
|
101
|
+
action workflows, and for Movement, Life Force, Workbench, or Artifact Store verify `routeKey`,
|
|
102
|
+
method, path, and `pathParams` from live onboarding `methodRoutes` before calling.
|
|
103
|
+
Never hide placeholders in `query` or `body`, and never guess a nearby path.
|
|
104
|
+
|
|
81
105
|
- Batch CRUD is the default for normal stored entities, including `goal`, `project`,
|
|
82
106
|
`strategy`, `task`, `habit`, `tag`, `note`, `insight`, `calendar_event`,
|
|
83
107
|
`work_block_template`, `task_timebox`, all main Psyche records, basic Preferences
|
|
84
108
|
CRUD records, `questionnaire_instrument`, `sleep_session`, and `workout_session`.
|
|
85
|
-
- `wiki_page` and `
|
|
86
|
-
tools for wiki pages
|
|
109
|
+
- `wiki_page`, `calendar_connection`, and `artifact` are specialized CRUD surfaces.
|
|
110
|
+
Use the wiki tools for wiki pages, the calendar connection tools for provider setup
|
|
111
|
+
and sync, and the Artifact Store route family for trusted file upload, metadata,
|
|
112
|
+
static scan, LLM metadata enrichment, generic entity links, trust state, versions,
|
|
113
|
+
and audit. Batch CRUD may search, update, delete, and restore artifact metadata, but
|
|
114
|
+
it must not create file artifacts or access file bytes.
|
|
87
115
|
- `task_run`, `work_adjustment`, `questionnaire_run`, `preference_judgment`,
|
|
88
116
|
`preference_signal`, and `self_observation` are action workflows. Use their
|
|
89
117
|
dedicated tools or note-backed write model instead of generic entity create/update
|
|
@@ -97,6 +125,12 @@ any route-key or endpoint detail.
|
|
|
97
125
|
exact `/api/v1/*` route or OpenClaw `/forge/v1/*` mirror published in onboarding.
|
|
98
126
|
Life Force may be keyed as `lifeForce` and as the entity-style alias `life_force`;
|
|
99
127
|
both point to the same `/api/v1/life-force/*` route family.
|
|
128
|
+
- Artifact Store route keys live under
|
|
129
|
+
`forge_get_agent_onboarding.entityRouteModel.specializedCrudEntities.artifact`.
|
|
130
|
+
When the adapter exposes `forge_call_artifact_route`, use it for artifact list,
|
|
131
|
+
trusted upload, metadata update, static rescan, LLM enrichment, generic entity-link
|
|
132
|
+
replacement, trust state, versions, or audit. Do not expose or call the download
|
|
133
|
+
route from agent tools; downloads are human-operator-only.
|
|
100
134
|
- The live onboarding `routeKeys` list, `methodRoutes` map, and specialized
|
|
101
135
|
route-key tool schemas include the exact route-key to method/path map. Use
|
|
102
136
|
`routeKeys` for the allowed names and `methodRoutes` as the
|
|
@@ -186,6 +220,16 @@ Concrete route-key examples for internal use:
|
|
|
186
220
|
`{"routeKey":"runByPayload","body":{"flow":{"title":"One-off digest","nodes":[]},"input":{"topic":"question flow quality"}}}`
|
|
187
221
|
- Workbench flow chat follow-up:
|
|
188
222
|
`{"routeKey":"chatFlow","pathParams":{"id":"flow_research_digest"},"body":{"message":"Refine the summary around API route risks and keep the published output stable."}}`
|
|
223
|
+
- Artifact metadata list:
|
|
224
|
+
`{"routeKey":"list","query":{"query":"thesis budget","formatFamily":"spreadsheet","limit":20}}`
|
|
225
|
+
- Artifact trusted upload:
|
|
226
|
+
`{"routeKey":"createWithBytes","body":{"originalFileName":"budget.xlsx","contentBase64":"<base64>","title":"Thesis budget workbook","sourceLabel":"Uploaded by the operator from local files","useLlmEnrichment":true,"links":[{"entityType":"project","entityId":"project_thesis","relationship":"evidence"}]}}`
|
|
227
|
+
- Artifact generic entity-link replacement:
|
|
228
|
+
`{"routeKey":"replaceGenericLinks","pathParams":{"id":"artifact_123"},"body":{"links":[{"entityType":"wiki_page","entityId":"note_thesis_budget","relationship":"embedded_reference"}]}}`
|
|
229
|
+
- Artifact audit read:
|
|
230
|
+
`{"routeKey":"audit","pathParams":{"id":"artifact_123"}}`
|
|
231
|
+
- Artifact forbidden agent action:
|
|
232
|
+
do not call `/api/v1/artifacts/:id/download`; hand the human to the Forge web app for download.
|
|
189
233
|
|
|
190
234
|
Preferences rule:
|
|
191
235
|
|
|
@@ -289,6 +333,14 @@ Entity conversation rule:
|
|
|
289
333
|
route lane, target object, correction, link, verification read, run/publish/preserve
|
|
290
334
|
action, or consent. If the question would only add warmth, completeness, optional
|
|
291
335
|
metadata, or form polish, skip it, summarize what is clear, and act or close.
|
|
336
|
+
- Use the user-facing wording guard after openings, reads, writes, and confirmations:
|
|
337
|
+
do not say "that sounds important" unless you name the specific stake; do not ask
|
|
338
|
+
"what would you like to do with this?" when the user's verb or the read result
|
|
339
|
+
already makes one next action visible; replace endpoint, payload, mutation, batch
|
|
340
|
+
route, and route key language with product nouns such as missing stay, weekday
|
|
341
|
+
energy curve, saved flow, failed run, node output, belief sentence, pattern,
|
|
342
|
+
flashcard, wiki page, calendar connection, or task run; if no answer-changing
|
|
343
|
+
uncertainty remains, summarize the product result and stop.
|
|
292
344
|
- Treat partial answers as progress. Before another follow-up, identify what is
|
|
293
345
|
already usable: operation, entity or surface, target record or time span, working
|
|
294
346
|
wording, owner or placement, route lane, and consent. Ask only for the first missing
|
|
@@ -915,6 +967,7 @@ When the user asks which Forge tools are available, list exactly these tools:
|
|
|
915
967
|
`forge_call_movement_route`
|
|
916
968
|
`forge_call_life_force_route`
|
|
917
969
|
`forge_call_workbench_route`
|
|
970
|
+
`forge_call_artifact_route`
|
|
918
971
|
`forge_get_user_directory`
|
|
919
972
|
`forge_get_ui_entrypoint`
|
|
920
973
|
`forge_get_psyche_overview`
|