forge-openclaw-plugin 0.2.7 → 0.2.11

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.
Files changed (55) hide show
  1. package/README.md +81 -1
  2. package/dist/assets/{board-CzgvdLO8.js → board-C_m78kvK.js} +2 -2
  3. package/dist/assets/{board-CzgvdLO8.js.map → board-C_m78kvK.js.map} +1 -1
  4. package/dist/assets/index-BWtLtXwb.js +36 -0
  5. package/dist/assets/index-BWtLtXwb.js.map +1 -0
  6. package/dist/assets/index-Dp5GXY_z.css +1 -0
  7. package/dist/assets/{motion-STUd1O46.js → motion-CpZvZumD.js} +2 -2
  8. package/dist/assets/{motion-STUd1O46.js.map → motion-CpZvZumD.js.map} +1 -1
  9. package/dist/assets/{table-CtNlETLc.js → table-DtyXTw03.js} +2 -2
  10. package/dist/assets/{table-CtNlETLc.js.map → table-DtyXTw03.js.map} +1 -1
  11. package/dist/assets/{ui-ThzkR_oW.js → ui-BXbpiKyS.js} +2 -2
  12. package/dist/assets/{ui-ThzkR_oW.js.map → ui-BXbpiKyS.js.map} +1 -1
  13. package/dist/assets/{vendor-DyHAI6nk.js → vendor-QBH6qVEe.js} +84 -74
  14. package/dist/assets/vendor-QBH6qVEe.js.map +1 -0
  15. package/dist/assets/{viz-BJuBCz_G.js → viz-w-IMeueL.js} +2 -2
  16. package/dist/assets/{viz-BJuBCz_G.js.map → viz-w-IMeueL.js.map} +1 -1
  17. package/dist/index.html +8 -8
  18. package/dist/openclaw/api-client.d.ts +1 -0
  19. package/dist/openclaw/local-runtime.d.ts +8 -0
  20. package/dist/openclaw/local-runtime.js +123 -1
  21. package/dist/openclaw/plugin-entry-shared.js +12 -0
  22. package/dist/openclaw/routes.js +4 -0
  23. package/dist/server/app.js +104 -67
  24. package/dist/server/demo-data.js +49 -0
  25. package/dist/server/openapi.js +84 -43
  26. package/dist/server/psyche-types.js +1 -30
  27. package/dist/server/repositories/deleted-entities.js +60 -26
  28. package/dist/server/repositories/goals.js +2 -5
  29. package/dist/server/repositories/notes.js +359 -0
  30. package/dist/server/repositories/projects.js +2 -5
  31. package/dist/server/repositories/psyche.js +11 -14
  32. package/dist/server/repositories/task-runs.js +2 -0
  33. package/dist/server/repositories/tasks.js +21 -10
  34. package/dist/server/seed-demo.js +11 -0
  35. package/dist/server/services/dashboard.js +4 -1
  36. package/dist/server/services/entity-crud.js +27 -30
  37. package/dist/server/services/insights.js +5 -5
  38. package/dist/server/services/projects.js +3 -1
  39. package/dist/server/services/psyche.js +4 -4
  40. package/dist/server/types.js +70 -11
  41. package/openclaw.plugin.json +12 -1
  42. package/package.json +1 -1
  43. package/server/migrations/001_core.sql +78 -0
  44. package/server/migrations/002_psyche.sql +164 -13
  45. package/skills/forge-openclaw/SKILL.md +19 -5
  46. package/dist/assets/index-8d_oM8fL.js +0 -27
  47. package/dist/assets/index-8d_oM8fL.js.map +0 -1
  48. package/dist/assets/index-D4A_bq8m.css +0 -1
  49. package/dist/assets/vendor-DyHAI6nk.js.map +0 -1
  50. package/dist/server/repositories/comments.js +0 -176
  51. package/server/migrations/003_timer_execution.sql +0 -18
  52. package/server/migrations/004_psyche_linked_entities.sql +0 -5
  53. package/server/migrations/005_adaptive_schemas.sql +0 -157
  54. package/server/migrations/006_psyche_auth_setting.sql +0 -4
  55. package/server/migrations/007_deleted_entities.sql +0 -16
@@ -81,18 +81,6 @@ CREATE TABLE IF NOT EXISTS trigger_reports (
81
81
  updated_at TEXT NOT NULL
82
82
  );
83
83
 
84
- CREATE TABLE IF NOT EXISTS entity_comments (
85
- id TEXT PRIMARY KEY,
86
- entity_type TEXT NOT NULL,
87
- entity_id TEXT NOT NULL,
88
- anchor_key TEXT,
89
- body TEXT NOT NULL,
90
- author TEXT,
91
- source TEXT NOT NULL,
92
- created_at TEXT NOT NULL,
93
- updated_at TEXT NOT NULL
94
- );
95
-
96
84
  CREATE TABLE IF NOT EXISTS schema_catalog (
97
85
  id TEXT PRIMARY KEY,
98
86
  slug TEXT NOT NULL UNIQUE,
@@ -232,10 +220,173 @@ CREATE INDEX IF NOT EXISTS idx_psyche_values_domain ON psyche_values(domain_id,
232
220
  CREATE INDEX IF NOT EXISTS idx_behavior_patterns_domain ON behavior_patterns(domain_id, created_at DESC);
233
221
  CREATE INDEX IF NOT EXISTS idx_trigger_reports_domain ON trigger_reports(domain_id, created_at DESC);
234
222
  CREATE INDEX IF NOT EXISTS idx_trigger_reports_status ON trigger_reports(status, created_at DESC);
235
- CREATE INDEX IF NOT EXISTS idx_entity_comments_target ON entity_comments(entity_type, entity_id, created_at DESC);
236
223
  CREATE INDEX IF NOT EXISTS idx_event_types_domain ON event_types(domain_id, system DESC, label);
237
224
  CREATE INDEX IF NOT EXISTS idx_emotion_definitions_domain ON emotion_definitions(domain_id, system DESC, label);
238
225
  CREATE INDEX IF NOT EXISTS idx_psyche_behaviors_domain ON psyche_behaviors(domain_id, kind, updated_at DESC);
239
226
  CREATE INDEX IF NOT EXISTS idx_belief_entries_domain ON belief_entries(domain_id, updated_at DESC);
240
227
  CREATE INDEX IF NOT EXISTS idx_belief_entries_schema ON belief_entries(schema_id, updated_at DESC);
241
228
  CREATE INDEX IF NOT EXISTS idx_mode_profiles_domain ON mode_profiles(domain_id, family, updated_at DESC);
229
+
230
+ ALTER TABLE behavior_patterns
231
+ ADD COLUMN linked_mode_ids_json TEXT NOT NULL DEFAULT '[]';
232
+
233
+ ALTER TABLE behavior_patterns
234
+ ADD COLUMN linked_belief_ids_json TEXT NOT NULL DEFAULT '[]';
235
+
236
+ ALTER TABLE schema_catalog
237
+ ADD COLUMN schema_type TEXT NOT NULL DEFAULT 'maladaptive';
238
+
239
+ UPDATE schema_catalog
240
+ SET schema_type = 'maladaptive'
241
+ WHERE schema_type IS NULL OR trim(schema_type) = '';
242
+
243
+ INSERT OR IGNORE INTO schema_catalog (
244
+ id,
245
+ slug,
246
+ title,
247
+ family,
248
+ description,
249
+ schema_type,
250
+ created_at,
251
+ updated_at
252
+ ) VALUES
253
+ (
254
+ 'schema_adaptive_stable_attachment',
255
+ 'stable_attachment',
256
+ 'Stable Attachment',
257
+ 'disconnection_rejection',
258
+ 'The belief that your close relationships are stable, loyal, and enduring.',
259
+ 'adaptive',
260
+ CURRENT_TIMESTAMP,
261
+ CURRENT_TIMESTAMP
262
+ ),
263
+ (
264
+ 'schema_adaptive_emotional_fulfilment',
265
+ 'emotional_fulfilment',
266
+ 'Emotional Fulfilment',
267
+ 'disconnection_rejection',
268
+ 'The belief that someone in your life can meet your needs for care, attachment, and emotional safety.',
269
+ 'adaptive',
270
+ CURRENT_TIMESTAMP,
271
+ CURRENT_TIMESTAMP
272
+ ),
273
+ (
274
+ 'schema_adaptive_social_belonging',
275
+ 'social_belonging',
276
+ 'Social Belonging',
277
+ 'disconnection_rejection',
278
+ 'The belief that you belong, fit in, and are accepted in groups and relationships.',
279
+ 'adaptive',
280
+ CURRENT_TIMESTAMP,
281
+ CURRENT_TIMESTAMP
282
+ ),
283
+ (
284
+ 'schema_adaptive_competence',
285
+ 'competence',
286
+ 'Competence',
287
+ 'impaired_autonomy',
288
+ 'The belief that you can handle daily problems, make decisions, and function capably in ordinary life.',
289
+ 'adaptive',
290
+ CURRENT_TIMESTAMP,
291
+ CURRENT_TIMESTAMP
292
+ ),
293
+ (
294
+ 'schema_adaptive_developed_self',
295
+ 'developed_self',
296
+ 'Developed Self',
297
+ 'impaired_autonomy',
298
+ 'The belief that you can live as your own person with mature boundaries and healthy independence from your parents.',
299
+ 'adaptive',
300
+ CURRENT_TIMESTAMP,
301
+ CURRENT_TIMESTAMP
302
+ ),
303
+ (
304
+ 'schema_adaptive_success',
305
+ 'success',
306
+ 'Success',
307
+ 'impaired_autonomy',
308
+ 'The belief that you are capable, effective, and able to do well in work, study, and achievement settings.',
309
+ 'adaptive',
310
+ CURRENT_TIMESTAMP,
311
+ CURRENT_TIMESTAMP
312
+ ),
313
+ (
314
+ 'schema_adaptive_empathic_consideration',
315
+ 'empathic_consideration',
316
+ 'Empathic Consideration',
317
+ 'other_directedness',
318
+ 'The belief that other people matter too and that you can respect different views without losing yourself.',
319
+ 'adaptive',
320
+ CURRENT_TIMESTAMP,
321
+ CURRENT_TIMESTAMP
322
+ ),
323
+ (
324
+ 'schema_adaptive_healthy_self_discipline',
325
+ 'healthy_self_discipline',
326
+ 'Healthy Self-Discipline',
327
+ 'overvigilance_inhibition',
328
+ 'The ability to stay with routines, persist through difficulty, and trade short-term comfort for long-term aims.',
329
+ 'adaptive',
330
+ CURRENT_TIMESTAMP,
331
+ CURRENT_TIMESTAMP
332
+ ),
333
+ (
334
+ 'schema_adaptive_healthy_self_care',
335
+ 'healthy_self_care',
336
+ 'Healthy Self-Care',
337
+ 'other_directedness',
338
+ 'The belief that your own needs matter too and that making room for rest, care, and boundaries is legitimate.',
339
+ 'adaptive',
340
+ CURRENT_TIMESTAMP,
341
+ CURRENT_TIMESTAMP
342
+ ),
343
+ (
344
+ 'schema_adaptive_self_directedness',
345
+ 'self_directedness',
346
+ 'Self-Directedness',
347
+ 'healthy_selfhood',
348
+ 'The belief that your own view of yourself matters more than performing for approval or admiration.',
349
+ 'adaptive',
350
+ CURRENT_TIMESTAMP,
351
+ CURRENT_TIMESTAMP
352
+ ),
353
+ (
354
+ 'schema_adaptive_optimism',
355
+ 'optimism',
356
+ 'Optimism',
357
+ 'healthy_selfhood',
358
+ 'The belief that good outcomes are possible and that life does not need to be ruled by catastrophe.',
359
+ 'adaptive',
360
+ CURRENT_TIMESTAMP,
361
+ CURRENT_TIMESTAMP
362
+ ),
363
+ (
364
+ 'schema_adaptive_emotional_openness',
365
+ 'emotional_openness',
366
+ 'Emotional Openness',
367
+ 'healthy_selfhood',
368
+ 'The willingness to express feelings, affection, and emotional truth with people you trust.',
369
+ 'adaptive',
370
+ CURRENT_TIMESTAMP,
371
+ CURRENT_TIMESTAMP
372
+ ),
373
+ (
374
+ 'schema_adaptive_realistic_expectations',
375
+ 'realistic_expectations',
376
+ 'Realistic Expectations',
377
+ 'overvigilance_inhibition',
378
+ 'The belief that good enough is acceptable, goals can be realistic, and mistakes do not cancel your worth.',
379
+ 'adaptive',
380
+ CURRENT_TIMESTAMP,
381
+ CURRENT_TIMESTAMP
382
+ ),
383
+ (
384
+ 'schema_adaptive_self_compassion',
385
+ 'self_compassion',
386
+ 'Self-Compassion',
387
+ 'overvigilance_inhibition',
388
+ 'The belief that you deserve kindness, forgiveness, and humane self-talk when you struggle or make mistakes.',
389
+ 'adaptive',
390
+ CURRENT_TIMESTAMP,
391
+ CURRENT_TIMESTAMP
392
+ );
@@ -5,10 +5,20 @@ description: use when the user wants to save, search, update, review, start, sto
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.
7
7
 
8
- Forge has two major domains. The planning side covers goals, projects, tasks, live work sessions, and agent-authored insights. The Psyche side covers values, patterns, behaviors, beliefs, modes, guided mode sessions, trigger reports, event types, and reusable emotion definitions. 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”.
8
+ Forge has two major domains. The planning side covers goals, projects, tasks, notes, live work sessions, and agent-authored insights. The Psyche side covers values, patterns, behaviors, beliefs, modes, guided mode sessions, trigger reports, event types, and reusable emotion definitions. 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”.
9
9
 
10
10
  Write to Forge only with clear user consent. If the user is just thinking aloud, helping first is usually better than writing immediately. After helping, you may offer one short Forge prompt if the match is strong. If the user agrees, ask only for the missing fields and only one to three focused questions at a time. Do not offer Forge again after a decline unless the user reopens it.
11
11
 
12
+ Forge data location rule:
13
+
14
+ - by default, Forge stores data under the active runtime root at `data/forge.sqlite`
15
+ - on a normal OpenClaw install, this usually means `~/.openclaw/extensions/forge-openclaw-plugin/data/forge.sqlite`
16
+ - on a linked repo-local install, this usually means `<repo>/openclaw-plugin/data/forge.sqlite`
17
+ - if the user wants the data somewhere else for persistence, backup, or manual control, tell them to set `plugins.entries["forge-openclaw-plugin"].config.dataRoot` and restart the OpenClaw gateway
18
+ - if the user asks where the data is stored or how to move it, explain the current default plainly and show the exact config field
19
+ - if the user wants to stop a plugin-managed local Forge runtime cleanly, tell them to run `forge stop`
20
+ - `forge stop` only shuts down a runtime that the OpenClaw plugin auto-started itself; if Forge was started manually elsewhere, it will say so instead of killing random local processes
21
+
12
22
  Use these exact entity meanings when deciding what the user is describing.
13
23
 
14
24
  `goal` is a meaningful long-horizon direction or outcome. Use it for “be a great father”, “create meaningfully”, or “build a beautiful family”, not for one-off action items.
@@ -19,6 +29,8 @@ Use these exact entity meanings when deciding what the user is describing.
19
29
 
20
30
  `task_run` is one truthful live work session on a task. It is not the same thing as task status.
21
31
 
32
+ `note` is a Markdown evidence record that can link to one or many entities. Use it for work summaries, context, progress logs, handoff explanations, or reflective detail that should stay searchable and attached to the right records.
33
+
22
34
  `insight` is an agent-authored observation, recommendation, or warning grounded in Forge data. It does not replace a requested goal, project, task, pattern, belief, or trigger report.
23
35
 
24
36
  `psyche_value` is a direction the user wants to live toward, such as honesty, courage, steadiness, compassion, or creativity.
@@ -159,7 +171,7 @@ Use the batch entity tools for stored records:
159
171
  `forge_search_entities`, `forge_create_entities`, `forge_update_entities`, `forge_delete_entities`, `forge_restore_entities`
160
172
 
161
173
  These tools operate on:
162
- `goal`, `project`, `task`, `psyche_value`, `behavior_pattern`, `behavior`, `belief_entry`, `mode_profile`, `mode_guide_session`, `trigger_report`, `event_type`, `emotion_definition`
174
+ `goal`, `project`, `task`, `note`, `psyche_value`, `behavior_pattern`, `behavior`, `belief_entry`, `mode_profile`, `mode_guide_session`, `trigger_report`, `event_type`, `emotion_definition`
163
175
 
164
176
  Use live work tools for `task_run`:
165
177
  `forge_log_work`, `forge_start_task_run`, `forge_heartbeat_task_run`, `forge_focus_task_run`, `forge_complete_task_run`, `forge_release_task_run`
@@ -176,6 +188,8 @@ Use these exact payload expectations.
176
188
 
177
189
  For create operations, each item must include `entityType` and `data`.
178
190
 
191
+ When creating `goal`, `project`, or `task`, the create payload may also include `notes: [{ contentMarkdown, author?, links? }]`. Forge will create real linked `note` entities automatically and attach them to the new parent record.
192
+
179
193
  For update operations, each item must include `entityType`, `id`, and `patch`.
180
194
 
181
195
  For delete operations, each item must include `entityType` and `id`. Delete is soft by default unless the user explicitly wants hard delete.
@@ -196,11 +210,11 @@ Use `forge_heartbeat_task_run` to keep an active run alive.
196
210
 
197
211
  Use `forge_focus_task_run` when one active run should become the current visible run.
198
212
 
199
- Use `forge_complete_task_run` to finish live work.
213
+ Use `forge_complete_task_run` to finish live work. When the user or agent wants to preserve what was done, include `closeoutNote` so Forge creates a real linked `note` instead of losing that explanation inside ephemeral run metadata.
200
214
 
201
- Use `forge_release_task_run` to stop live work without completing the task.
215
+ Use `forge_release_task_run` to stop live work without completing the task. `closeoutNote` is also available there for handoff or pause context.
202
216
 
203
- Use `forge_log_work` only for retroactive work that already happened.
217
+ Use `forge_log_work` only for retroactive work that already happened. If the user explains the work in a way that should be preserved, include `closeoutNote`.
204
218
 
205
219
  Use these interaction rules.
206
220