forge-openclaw-plugin 0.2.47 → 0.2.49
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/README.md +6 -5
- package/dist/assets/index-2_tuemtU.css +1 -0
- package/dist/assets/index-BAmEvOXb.js +91 -0
- package/dist/assets/index-BAmEvOXb.js.map +1 -0
- package/dist/index.html +2 -2
- package/dist/openclaw/api-client.js +15 -1
- package/dist/openclaw/session-registry.js +17 -0
- package/dist/openclaw/tools.js +1 -1
- package/dist/server/server/migrations/052_agent_identity_tightening.sql +307 -0
- package/dist/server/server/migrations/053_agent_runtime_session_canonical_labels.sql +9 -0
- package/dist/server/server/src/app.js +42 -12
- package/dist/server/server/src/health-workout-adapters.js +465 -0
- package/dist/server/server/src/health.js +134 -9
- package/dist/server/server/src/openapi.js +33 -0
- package/dist/server/server/src/repositories/agent-runtime-sessions.js +122 -16
- package/dist/server/server/src/repositories/habits.js +62 -25
- package/dist/server/server/src/repositories/model-settings.js +5 -0
- package/dist/server/server/src/repositories/settings.js +101 -13
- package/dist/server/server/src/repositories/users.js +23 -0
- package/dist/server/server/src/types.js +22 -6
- package/dist/server/server/src/watch-mobile.js +33 -21
- package/dist/server/src/lib/date-keys.js +21 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +5 -2
- package/server/migrations/052_agent_identity_tightening.sql +307 -0
- package/server/migrations/053_agent_runtime_session_canonical_labels.sql +9 -0
- package/skills/forge-openclaw/SKILL.md +3 -1
- package/skills/forge-openclaw/entity_conversation_playbooks.md +45 -8
- package/skills/forge-openclaw/psyche_entity_playbooks.md +14 -0
- package/dist/assets/index-BejDHw1R.js +0 -91
- package/dist/assets/index-BejDHw1R.js.map +0 -1
- package/dist/assets/index-DtEvFzXp.css +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forge-openclaw-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.49",
|
|
4
4
|
"description": "Curated OpenClaw adapter for the Forge collaboration API, UI entrypoint, and localhost auto-start runtime.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -95,10 +95,13 @@
|
|
|
95
95
|
"zustand": "^5.0.5"
|
|
96
96
|
},
|
|
97
97
|
"overrides": {
|
|
98
|
+
"@aws-sdk/xml-builder": "^3.972.19",
|
|
98
99
|
"basic-ftp": "^5.3.0",
|
|
99
100
|
"axios": "^1.15.0",
|
|
101
|
+
"fast-xml-parser": "^5.7.1",
|
|
100
102
|
"follow-redirects": "^1.16.0",
|
|
101
|
-
"hono": "4.12.14"
|
|
103
|
+
"hono": "4.12.14",
|
|
104
|
+
"uuid": "^14.0.0"
|
|
102
105
|
},
|
|
103
106
|
"scripts": {
|
|
104
107
|
"build": "node ./scripts/build.mjs"
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
ALTER TABLE agent_identities ADD COLUMN identity_key TEXT;
|
|
2
|
+
ALTER TABLE agent_identities ADD COLUMN provider TEXT;
|
|
3
|
+
ALTER TABLE agent_identities ADD COLUMN machine_key TEXT;
|
|
4
|
+
ALTER TABLE agent_identities ADD COLUMN persona_key TEXT;
|
|
5
|
+
|
|
6
|
+
CREATE TABLE IF NOT EXISTS agent_identity_users (
|
|
7
|
+
agent_id TEXT NOT NULL REFERENCES agent_identities(id) ON DELETE CASCADE,
|
|
8
|
+
user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
9
|
+
role TEXT NOT NULL DEFAULT 'linked',
|
|
10
|
+
created_at TEXT NOT NULL,
|
|
11
|
+
updated_at TEXT NOT NULL,
|
|
12
|
+
PRIMARY KEY (agent_id, user_id)
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
CREATE INDEX IF NOT EXISTS idx_agent_identity_users_user
|
|
16
|
+
ON agent_identity_users(user_id, role);
|
|
17
|
+
|
|
18
|
+
INSERT OR IGNORE INTO users (
|
|
19
|
+
id, kind, handle, display_name, description, accent_color, created_at, updated_at
|
|
20
|
+
) VALUES
|
|
21
|
+
('user_agent_openclaw', 'bot', 'openclaw', 'OpenClaw', 'OpenClaw runtime actor linked to Forge agent identity and Kanban ownership.', '#38bdf8', datetime('now'), datetime('now')),
|
|
22
|
+
('user_agent_hermes', 'bot', 'hermes', 'Hermes', 'Hermes runtime actor linked to Forge agent identity and Kanban ownership.', '#a78bfa', datetime('now'), datetime('now')),
|
|
23
|
+
('user_agent_codex', 'bot', 'codex', 'Codex', 'Codex runtime actor linked to Forge agent identity and Kanban ownership.', '#22c55e', datetime('now'), datetime('now'));
|
|
24
|
+
|
|
25
|
+
UPDATE agent_tokens
|
|
26
|
+
SET agent_id = (
|
|
27
|
+
SELECT id FROM agent_identities
|
|
28
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')
|
|
29
|
+
ORDER BY CASE WHEN lower(label) = 'forge openclaw' THEN 0 ELSE 1 END, created_at ASC
|
|
30
|
+
LIMIT 1
|
|
31
|
+
)
|
|
32
|
+
WHERE agent_id IN (
|
|
33
|
+
SELECT id FROM agent_identities
|
|
34
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')
|
|
35
|
+
)
|
|
36
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')) > 0;
|
|
37
|
+
|
|
38
|
+
UPDATE agent_actions
|
|
39
|
+
SET agent_id = (
|
|
40
|
+
SELECT id FROM agent_identities
|
|
41
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')
|
|
42
|
+
ORDER BY CASE WHEN lower(label) = 'forge openclaw' THEN 0 ELSE 1 END, created_at ASC
|
|
43
|
+
LIMIT 1
|
|
44
|
+
)
|
|
45
|
+
WHERE agent_id IN (
|
|
46
|
+
SELECT id FROM agent_identities
|
|
47
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')
|
|
48
|
+
)
|
|
49
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')) > 0;
|
|
50
|
+
|
|
51
|
+
UPDATE approval_requests
|
|
52
|
+
SET requested_by_agent_id = (
|
|
53
|
+
SELECT id FROM agent_identities
|
|
54
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')
|
|
55
|
+
ORDER BY CASE WHEN lower(label) = 'forge openclaw' THEN 0 ELSE 1 END, created_at ASC
|
|
56
|
+
LIMIT 1
|
|
57
|
+
)
|
|
58
|
+
WHERE requested_by_agent_id IN (
|
|
59
|
+
SELECT id FROM agent_identities
|
|
60
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')
|
|
61
|
+
)
|
|
62
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')) > 0;
|
|
63
|
+
|
|
64
|
+
UPDATE insights
|
|
65
|
+
SET origin_agent_id = (
|
|
66
|
+
SELECT id FROM agent_identities
|
|
67
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')
|
|
68
|
+
ORDER BY CASE WHEN lower(label) = 'forge openclaw' THEN 0 ELSE 1 END, created_at ASC
|
|
69
|
+
LIMIT 1
|
|
70
|
+
)
|
|
71
|
+
WHERE origin_agent_id IN (
|
|
72
|
+
SELECT id FROM agent_identities
|
|
73
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')
|
|
74
|
+
)
|
|
75
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')) > 0;
|
|
76
|
+
|
|
77
|
+
UPDATE agent_runtime_sessions
|
|
78
|
+
SET agent_id = (
|
|
79
|
+
SELECT id FROM agent_identities
|
|
80
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')
|
|
81
|
+
ORDER BY CASE WHEN lower(label) = 'forge openclaw' THEN 0 ELSE 1 END, created_at ASC
|
|
82
|
+
LIMIT 1
|
|
83
|
+
)
|
|
84
|
+
WHERE agent_id IN (
|
|
85
|
+
SELECT id FROM agent_identities
|
|
86
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')
|
|
87
|
+
)
|
|
88
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')) > 0;
|
|
89
|
+
|
|
90
|
+
DELETE FROM agent_identities
|
|
91
|
+
WHERE (lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel'))
|
|
92
|
+
AND id <> (
|
|
93
|
+
SELECT id FROM agent_identities
|
|
94
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) IN ('forge openclaw', 'openclaw', 'aurel')
|
|
95
|
+
ORDER BY CASE WHEN lower(label) = 'forge openclaw' THEN 0 ELSE 1 END, created_at ASC
|
|
96
|
+
LIMIT 1
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
UPDATE agent_identities
|
|
100
|
+
SET label = 'Forge OpenClaw',
|
|
101
|
+
agent_type = 'openclaw',
|
|
102
|
+
provider = 'openclaw',
|
|
103
|
+
identity_key = 'runtime:openclaw:legacy:default',
|
|
104
|
+
machine_key = 'legacy',
|
|
105
|
+
persona_key = 'default',
|
|
106
|
+
description = 'OpenClaw runtime agent with stable Forge identity and linked Kanban user.',
|
|
107
|
+
updated_at = datetime('now')
|
|
108
|
+
WHERE lower(agent_type) = 'openclaw' OR lower(label) = 'forge openclaw';
|
|
109
|
+
|
|
110
|
+
UPDATE agent_tokens
|
|
111
|
+
SET agent_id = (
|
|
112
|
+
SELECT id FROM agent_identities
|
|
113
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%'
|
|
114
|
+
ORDER BY CASE WHEN lower(label) = 'forge hermes' THEN 0 ELSE 1 END, created_at ASC
|
|
115
|
+
LIMIT 1
|
|
116
|
+
)
|
|
117
|
+
WHERE agent_id IN (
|
|
118
|
+
SELECT id FROM agent_identities
|
|
119
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%'
|
|
120
|
+
)
|
|
121
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%') > 0;
|
|
122
|
+
|
|
123
|
+
UPDATE agent_actions
|
|
124
|
+
SET agent_id = (
|
|
125
|
+
SELECT id FROM agent_identities
|
|
126
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%'
|
|
127
|
+
ORDER BY CASE WHEN lower(label) = 'forge hermes' THEN 0 ELSE 1 END, created_at ASC
|
|
128
|
+
LIMIT 1
|
|
129
|
+
)
|
|
130
|
+
WHERE agent_id IN (
|
|
131
|
+
SELECT id FROM agent_identities
|
|
132
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%'
|
|
133
|
+
)
|
|
134
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%') > 0;
|
|
135
|
+
|
|
136
|
+
UPDATE approval_requests
|
|
137
|
+
SET requested_by_agent_id = (
|
|
138
|
+
SELECT id FROM agent_identities
|
|
139
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%'
|
|
140
|
+
ORDER BY CASE WHEN lower(label) = 'forge hermes' THEN 0 ELSE 1 END, created_at ASC
|
|
141
|
+
LIMIT 1
|
|
142
|
+
)
|
|
143
|
+
WHERE requested_by_agent_id IN (
|
|
144
|
+
SELECT id FROM agent_identities
|
|
145
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%'
|
|
146
|
+
)
|
|
147
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%') > 0;
|
|
148
|
+
|
|
149
|
+
UPDATE insights
|
|
150
|
+
SET origin_agent_id = (
|
|
151
|
+
SELECT id FROM agent_identities
|
|
152
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%'
|
|
153
|
+
ORDER BY CASE WHEN lower(label) = 'forge hermes' THEN 0 ELSE 1 END, created_at ASC
|
|
154
|
+
LIMIT 1
|
|
155
|
+
)
|
|
156
|
+
WHERE origin_agent_id IN (
|
|
157
|
+
SELECT id FROM agent_identities
|
|
158
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%'
|
|
159
|
+
)
|
|
160
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%') > 0;
|
|
161
|
+
|
|
162
|
+
UPDATE agent_runtime_sessions
|
|
163
|
+
SET agent_id = (
|
|
164
|
+
SELECT id FROM agent_identities
|
|
165
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%'
|
|
166
|
+
ORDER BY CASE WHEN lower(label) = 'forge hermes' THEN 0 ELSE 1 END, created_at ASC
|
|
167
|
+
LIMIT 1
|
|
168
|
+
)
|
|
169
|
+
WHERE agent_id IN (
|
|
170
|
+
SELECT id FROM agent_identities
|
|
171
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%'
|
|
172
|
+
)
|
|
173
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%') > 0;
|
|
174
|
+
|
|
175
|
+
DELETE FROM agent_identities
|
|
176
|
+
WHERE (lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%')
|
|
177
|
+
AND id <> (
|
|
178
|
+
SELECT id FROM agent_identities
|
|
179
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) LIKE 'forge hermes%'
|
|
180
|
+
ORDER BY CASE WHEN lower(label) = 'forge hermes' THEN 0 ELSE 1 END, created_at ASC
|
|
181
|
+
LIMIT 1
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
UPDATE agent_identities
|
|
185
|
+
SET label = 'Forge Hermes',
|
|
186
|
+
agent_type = 'hermes',
|
|
187
|
+
provider = 'hermes',
|
|
188
|
+
identity_key = 'runtime:hermes:legacy:default',
|
|
189
|
+
machine_key = 'legacy',
|
|
190
|
+
persona_key = 'default',
|
|
191
|
+
description = 'Hermes runtime agent with stable Forge identity and linked Kanban user.',
|
|
192
|
+
updated_at = datetime('now')
|
|
193
|
+
WHERE lower(agent_type) = 'hermes' OR lower(label) = 'forge hermes';
|
|
194
|
+
|
|
195
|
+
UPDATE agent_tokens
|
|
196
|
+
SET agent_id = (
|
|
197
|
+
SELECT id FROM agent_identities
|
|
198
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')
|
|
199
|
+
ORDER BY CASE WHEN lower(label) = 'forge codex' THEN 0 ELSE 1 END, created_at ASC
|
|
200
|
+
LIMIT 1
|
|
201
|
+
)
|
|
202
|
+
WHERE agent_id IN (
|
|
203
|
+
SELECT id FROM agent_identities
|
|
204
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')
|
|
205
|
+
)
|
|
206
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')) > 0;
|
|
207
|
+
|
|
208
|
+
UPDATE agent_actions
|
|
209
|
+
SET agent_id = (
|
|
210
|
+
SELECT id FROM agent_identities
|
|
211
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')
|
|
212
|
+
ORDER BY CASE WHEN lower(label) = 'forge codex' THEN 0 ELSE 1 END, created_at ASC
|
|
213
|
+
LIMIT 1
|
|
214
|
+
)
|
|
215
|
+
WHERE agent_id IN (
|
|
216
|
+
SELECT id FROM agent_identities
|
|
217
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')
|
|
218
|
+
)
|
|
219
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')) > 0;
|
|
220
|
+
|
|
221
|
+
UPDATE approval_requests
|
|
222
|
+
SET requested_by_agent_id = (
|
|
223
|
+
SELECT id FROM agent_identities
|
|
224
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')
|
|
225
|
+
ORDER BY CASE WHEN lower(label) = 'forge codex' THEN 0 ELSE 1 END, created_at ASC
|
|
226
|
+
LIMIT 1
|
|
227
|
+
)
|
|
228
|
+
WHERE requested_by_agent_id IN (
|
|
229
|
+
SELECT id FROM agent_identities
|
|
230
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')
|
|
231
|
+
)
|
|
232
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')) > 0;
|
|
233
|
+
|
|
234
|
+
UPDATE insights
|
|
235
|
+
SET origin_agent_id = (
|
|
236
|
+
SELECT id FROM agent_identities
|
|
237
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')
|
|
238
|
+
ORDER BY CASE WHEN lower(label) = 'forge codex' THEN 0 ELSE 1 END, created_at ASC
|
|
239
|
+
LIMIT 1
|
|
240
|
+
)
|
|
241
|
+
WHERE origin_agent_id IN (
|
|
242
|
+
SELECT id FROM agent_identities
|
|
243
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')
|
|
244
|
+
)
|
|
245
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')) > 0;
|
|
246
|
+
|
|
247
|
+
UPDATE agent_runtime_sessions
|
|
248
|
+
SET agent_id = (
|
|
249
|
+
SELECT id FROM agent_identities
|
|
250
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')
|
|
251
|
+
ORDER BY CASE WHEN lower(label) = 'forge codex' THEN 0 ELSE 1 END, created_at ASC
|
|
252
|
+
LIMIT 1
|
|
253
|
+
)
|
|
254
|
+
WHERE agent_id IN (
|
|
255
|
+
SELECT id FROM agent_identities
|
|
256
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')
|
|
257
|
+
)
|
|
258
|
+
AND (SELECT COUNT(*) FROM agent_identities WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')) > 0;
|
|
259
|
+
|
|
260
|
+
DELETE FROM agent_identities
|
|
261
|
+
WHERE (lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)'))
|
|
262
|
+
AND id <> (
|
|
263
|
+
SELECT id FROM agent_identities
|
|
264
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) IN ('forge codex', 'codex', 'albert (codex)')
|
|
265
|
+
ORDER BY CASE WHEN lower(label) = 'forge codex' THEN 0 ELSE 1 END, created_at ASC
|
|
266
|
+
LIMIT 1
|
|
267
|
+
);
|
|
268
|
+
|
|
269
|
+
UPDATE agent_identities
|
|
270
|
+
SET label = 'Forge Codex',
|
|
271
|
+
agent_type = 'codex',
|
|
272
|
+
provider = 'codex',
|
|
273
|
+
identity_key = 'runtime:codex:legacy:default',
|
|
274
|
+
machine_key = 'legacy',
|
|
275
|
+
persona_key = 'default',
|
|
276
|
+
description = 'Codex runtime agent with stable Forge identity and linked Kanban user.',
|
|
277
|
+
updated_at = datetime('now')
|
|
278
|
+
WHERE lower(agent_type) = 'codex' OR lower(label) = 'forge codex';
|
|
279
|
+
|
|
280
|
+
INSERT OR IGNORE INTO agent_identity_users (agent_id, user_id, role, created_at, updated_at)
|
|
281
|
+
SELECT id, 'user_agent_openclaw', 'primary', datetime('now'), datetime('now')
|
|
282
|
+
FROM agent_identities
|
|
283
|
+
WHERE provider = 'openclaw';
|
|
284
|
+
|
|
285
|
+
INSERT OR IGNORE INTO agent_identity_users (agent_id, user_id, role, created_at, updated_at)
|
|
286
|
+
SELECT id, 'user_agent_hermes', 'primary', datetime('now'), datetime('now')
|
|
287
|
+
FROM agent_identities
|
|
288
|
+
WHERE provider = 'hermes';
|
|
289
|
+
|
|
290
|
+
INSERT OR IGNORE INTO agent_identity_users (agent_id, user_id, role, created_at, updated_at)
|
|
291
|
+
SELECT id, 'user_agent_codex', 'primary', datetime('now'), datetime('now')
|
|
292
|
+
FROM agent_identities
|
|
293
|
+
WHERE provider = 'codex';
|
|
294
|
+
|
|
295
|
+
UPDATE agent_runtime_sessions
|
|
296
|
+
SET agent_label = (
|
|
297
|
+
SELECT label FROM agent_identities WHERE agent_identities.id = agent_runtime_sessions.agent_id
|
|
298
|
+
),
|
|
299
|
+
agent_type = (
|
|
300
|
+
SELECT agent_type FROM agent_identities WHERE agent_identities.id = agent_runtime_sessions.agent_id
|
|
301
|
+
),
|
|
302
|
+
updated_at = datetime('now')
|
|
303
|
+
WHERE agent_id IN (SELECT id FROM agent_identities WHERE provider IN ('openclaw', 'hermes', 'codex'));
|
|
304
|
+
|
|
305
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_agent_identities_identity_key
|
|
306
|
+
ON agent_identities(identity_key)
|
|
307
|
+
WHERE identity_key IS NOT NULL;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
UPDATE agent_runtime_sessions
|
|
2
|
+
SET agent_label = (
|
|
3
|
+
SELECT label FROM agent_identities WHERE agent_identities.id = agent_runtime_sessions.agent_id
|
|
4
|
+
),
|
|
5
|
+
agent_type = (
|
|
6
|
+
SELECT agent_type FROM agent_identities WHERE agent_identities.id = agent_runtime_sessions.agent_id
|
|
7
|
+
),
|
|
8
|
+
updated_at = datetime('now')
|
|
9
|
+
WHERE agent_id IN (SELECT id FROM agent_identities WHERE provider IN ('openclaw', 'hermes', 'codex'));
|
|
@@ -239,7 +239,8 @@ CRITICAL NEGATIVE-HABIT CHECK-IN RULE:
|
|
|
239
239
|
- For a `negative` habit, the correct check-in outcome is `missed`.
|
|
240
240
|
- On a `negative` habit, `missed` means the habit was resisted, the user stayed aligned, and the habit earns its XP bonus.
|
|
241
241
|
- Do not treat `missed` on a `negative` habit as failure. In this case, `missed` is the successful outcome.
|
|
242
|
-
-
|
|
242
|
+
- In OpenClaw, official habit outcome logging should go through `forge_update_entities` on `entityType: "habit"` with `patch: { checkIn: { status, dateKey?, note?, description? } }`.
|
|
243
|
+
- Do not bypass the shared tool model with raw habit routes when the batch entity update already covers the write cleanly.
|
|
243
244
|
Ask:
|
|
244
245
|
|
|
245
246
|
1. What is the recurring behavior in one concrete sentence?
|
|
@@ -387,6 +388,7 @@ Use the dedicated domain routes for specialized surfaces that are not simple bat
|
|
|
387
388
|
`/api/v1/workbench/flows/:id/output` for published outputs, and the run/node routes
|
|
388
389
|
under `/api/v1/workbench/flows/:id` for run history and node-level inspection.
|
|
389
390
|
- If you are unsure which specialized route family applies, check `forge_get_agent_onboarding` and use its `entityRouteModel.specializedDomainSurfaces` section before guessing.
|
|
391
|
+
- If the truth of the current Movement, Life Force, or Workbench state is still unclear, prefer the dedicated read before the mutation so the correction stays truthful.
|
|
390
392
|
- After a concrete Movement, Life Force, or Workbench correction, read the relevant specialized view back when the user is trying to understand the result rather than only store it.
|
|
391
393
|
|
|
392
394
|
Use live work tools for `task_run`:
|
|
@@ -56,6 +56,8 @@ Forge correctly, and gather only the structure that still matters.
|
|
|
56
56
|
- For specialized surfaces, start from the user's real job in plain language, then
|
|
57
57
|
narrow to the route family. Do not open with a route menu unless the user already
|
|
58
58
|
named the exact object and action.
|
|
59
|
+
- For specialized surfaces, if the truth of the current state is still uncertain, read
|
|
60
|
+
the relevant dedicated view before you mutate it.
|
|
59
61
|
- When the user has already named a precise correction or review target, do not widen
|
|
60
62
|
back out into a meta lane question. Confirm only the missing route-selecting detail
|
|
61
63
|
and then act.
|
|
@@ -337,8 +339,10 @@ Connect:
|
|
|
337
339
|
move to the save.
|
|
338
340
|
- Prefer "what I have now is..." or "what seems clear now is..." over a cold final
|
|
339
341
|
field check.
|
|
342
|
+
- If the user already gave usable wording, do not ask them to rename it for style.
|
|
340
343
|
- If the user gives a correction, revise the working formulation once and close again
|
|
341
344
|
instead of reopening the whole intake.
|
|
345
|
+
- If the next answer would not change the entity type, route, wording, timing, or useful links, stop asking and act.
|
|
342
346
|
|
|
343
347
|
## Question design rules
|
|
344
348
|
|
|
@@ -387,6 +391,15 @@ Connect:
|
|
|
387
391
|
saved object, timeframe, or route family, not reopen the whole meaning-making arc.
|
|
388
392
|
- When the user already gave the correction in usable language, prefer "what still
|
|
389
393
|
needs deciding is..." over asking them to restate the whole situation.
|
|
394
|
+
- The opening question should help the user understand what they are actually trying
|
|
395
|
+
to save, decide, review, or change, not make them perform the schema out loud.
|
|
396
|
+
- For review or correction work, do not slip back into a create-style opener once the
|
|
397
|
+
saved object is already known.
|
|
398
|
+
- Once a specialized-surface lane is clear, speak in route-relevant nouns such as
|
|
399
|
+
timeline, overlay, weekday template, published output, run detail, or node result
|
|
400
|
+
instead of generic "record" language.
|
|
401
|
+
- If the user is emotionally loaded but the record is still non-Psyche, reflect the
|
|
402
|
+
lived stake once and then return to the one operational question that still matters.
|
|
390
403
|
|
|
391
404
|
## Ready-to-save check
|
|
392
405
|
|
|
@@ -411,7 +424,7 @@ about linking only after the main record already feels named and steady.
|
|
|
411
424
|
|
|
412
425
|
Use this when the user is updating an existing record rather than creating a new one.
|
|
413
426
|
|
|
414
|
-
1. Ask what feels newly true, newly
|
|
427
|
+
1. Ask what feels newly true, newly inaccurate, or newly clear.
|
|
415
428
|
2. Ask what should stay true so the record keeps its core meaning.
|
|
416
429
|
3. Ask what prompted the update now if that changes the shape of the record.
|
|
417
430
|
4. Then ask only for the missing structural detail required by the change.
|
|
@@ -419,6 +432,10 @@ Use this when the user is updating an existing record rather than creating a new
|
|
|
419
432
|
If the current title or shape may no longer fit, offer one revised formulation yourself
|
|
420
433
|
before asking the user to rewrite it from scratch.
|
|
421
434
|
|
|
435
|
+
If the user already named the exact correction in usable language, do not ask a broad
|
|
436
|
+
review question again. Confirm only the missing scope, timing, or route-selecting
|
|
437
|
+
detail, then act.
|
|
438
|
+
|
|
422
439
|
## Update-first openers
|
|
423
440
|
|
|
424
441
|
Use these when the user is correcting or revising something that already exists.
|
|
@@ -1017,9 +1034,11 @@ Arc:
|
|
|
1017
1034
|
5. Ask what they are trying to notice, preserve, or answer through that movement context.
|
|
1018
1035
|
6. Choose the dedicated day, month, all-time, timeline, places, trip-detail, or
|
|
1019
1036
|
selection route once the question shape is clear.
|
|
1020
|
-
7.
|
|
1037
|
+
7. If the truth of one uncertain span is still unclear, read the timeline or saved-box
|
|
1038
|
+
detail before you mutate it.
|
|
1039
|
+
8. Skip the meta lane question when the user already named the exact correction or
|
|
1021
1040
|
review target and only one ambiguity remains.
|
|
1022
|
-
|
|
1041
|
+
9. Route to the dedicated movement read or write path once the surface is clear.
|
|
1023
1042
|
|
|
1024
1043
|
Direct action rules:
|
|
1025
1044
|
|
|
@@ -1036,6 +1055,8 @@ Direct action rules:
|
|
|
1036
1055
|
- If the user wants to inspect one already-saved movement correction before editing
|
|
1037
1056
|
it, read the box detail first so the follow-up write stays grounded in the saved
|
|
1038
1057
|
object.
|
|
1058
|
+
- If the user is asking where they were during one uncertain window, prefer a timeline
|
|
1059
|
+
read before you create a correction. Mutate only after the lived truth is clear.
|
|
1039
1060
|
- When the user has already given the real answer, for example "I stayed home during
|
|
1040
1061
|
that missing block", do not ask a broad review question again. Confirm only the
|
|
1041
1062
|
interval or place if that is still ambiguous, then act.
|
|
@@ -1105,11 +1126,14 @@ Arc:
|
|
|
1105
1126
|
4. Ask what should stay true if they are changing profile or template assumptions.
|
|
1106
1127
|
5. Ask whether the user is describing a stable weekly shape or just how today feels
|
|
1107
1128
|
when the lane is still blurred.
|
|
1108
|
-
6. If the user
|
|
1129
|
+
6. If the user describes a repeatable day-shape such as "Mondays crash after lunch",
|
|
1130
|
+
treat that as a weekday-template question before you reach for profile or
|
|
1131
|
+
fatigue-signal routes.
|
|
1132
|
+
7. If the user already named the life-force lane clearly, skip the meta lane question
|
|
1109
1133
|
and ask only for the specific weekday, profile field, or signal that still matters.
|
|
1110
|
-
|
|
1134
|
+
8. If the user wants to see what changed after a write, read the overview back instead
|
|
1111
1135
|
of leaving the result implicit.
|
|
1112
|
-
|
|
1136
|
+
9. Route to the dedicated life-force path once the lane is clear.
|
|
1113
1137
|
|
|
1114
1138
|
Helpful follow-up lanes:
|
|
1115
1139
|
|
|
@@ -1133,8 +1157,12 @@ Direct action rules:
|
|
|
1133
1157
|
|
|
1134
1158
|
- If the user is describing a durable baseline such as work capacity, recovery style,
|
|
1135
1159
|
or action-point assumptions, patch the profile instead of logging a fatigue signal.
|
|
1160
|
+
- If the user is describing a repeatable weekday rhythm, update that weekday template
|
|
1161
|
+
instead of treating it as a one-off right-now feeling.
|
|
1136
1162
|
- If the user is describing how one weekday should usually feel, update that weekday
|
|
1137
1163
|
template instead of editing the profile.
|
|
1164
|
+
- If the user says something like "I always dip on Tuesdays after lunch", treat that
|
|
1165
|
+
as a weekday-template edit, not as a one-off fatigue signal.
|
|
1138
1166
|
- If the user is describing right-now depletion or recovery, post a fatigue signal and
|
|
1139
1167
|
then read the overview back if they want to see the updated picture.
|
|
1140
1168
|
- After a profile or weekday-template change, read the overview back when the user is
|
|
@@ -1161,12 +1189,16 @@ Arc:
|
|
|
1161
1189
|
before you narrow to flow discovery, editing, execution, or results.
|
|
1162
1190
|
2. Ask whether the job is flow discovery, one flow edit, execution, run history, published output, node-level inspection, or latest-node-output lookup.
|
|
1163
1191
|
3. Ask which flow, slug, run, or node the request is about.
|
|
1164
|
-
4. Ask whether they need the flow contract,
|
|
1192
|
+
4. Ask whether they need the stable flow contract, one run result, one published
|
|
1193
|
+
output, one node result, or the latest node output.
|
|
1165
1194
|
5. If the user already named the flow and action clearly, skip the meta lane
|
|
1166
1195
|
question and ask only for the missing run, node, or output scope.
|
|
1167
1196
|
6. If the user wants a stable public input contract or published output, prefer those
|
|
1168
1197
|
dedicated reads instead of detouring through run history first.
|
|
1169
|
-
7.
|
|
1198
|
+
7. If the user is debugging one failed run, ask whether the useful artifact is the run
|
|
1199
|
+
summary, one node result, the latest node output, or the published output before
|
|
1200
|
+
you start asking for edits.
|
|
1201
|
+
8. Route to the dedicated workbench route family once the execution lane is clear.
|
|
1170
1202
|
|
|
1171
1203
|
Helpful follow-up lanes:
|
|
1172
1204
|
|
|
@@ -1205,6 +1237,11 @@ Direct action rules:
|
|
|
1205
1237
|
- If the user wants to execute a known saved flow, use `/api/v1/workbench/flows/:id/run`.
|
|
1206
1238
|
- If the user wants payload-first execution without depending on a saved flow id, use
|
|
1207
1239
|
`/api/v1/workbench/run`.
|
|
1240
|
+
- If the user wants to debug one failed execution, narrow whether they need the run
|
|
1241
|
+
detail, one node result, the latest node output, or the published output before you
|
|
1242
|
+
ask for flow changes.
|
|
1243
|
+
- If the user only wants a published output, latest node output, or run detail, do not
|
|
1244
|
+
reopen a flow-edit intake before reading that artifact.
|
|
1208
1245
|
- If the user wants one node's latest successful output, do not browse old runs first
|
|
1209
1246
|
unless they explicitly want historical debugging.
|
|
1210
1247
|
- If the user wants to understand what inputs a flow can accept before editing or
|
|
@@ -53,6 +53,8 @@ Forge without turning the conversation into a worksheet.
|
|
|
53
53
|
naming, challenging, or solution-finding.
|
|
54
54
|
- Your first job is not interpretation. It is to make the moment feel graspable enough
|
|
55
55
|
that the user can stay with it and describe it.
|
|
56
|
+
- The next question should help the user feel less alone with the experience and more
|
|
57
|
+
able to name it, not more examined.
|
|
56
58
|
- Before you ask for change, naming, or repair, usually ask what the experience is
|
|
57
59
|
trying to protect, prevent, or hold onto.
|
|
58
60
|
- The warmth should come from accuracy and steadiness, not from extra softness,
|
|
@@ -302,6 +304,9 @@ Another strong shape when the user is getting abstract:
|
|
|
302
304
|
- "So the painful part seems to be less the event itself and more what it starts to
|
|
303
305
|
mean about you. What does it seem to prove in that moment?"
|
|
304
306
|
|
|
307
|
+
Use that rhythm to contain before you interpret. The user should be able to feel what
|
|
308
|
+
you understood before they have to answer the next deeper question.
|
|
309
|
+
|
|
305
310
|
## Formulation rules
|
|
306
311
|
|
|
307
312
|
- Do not front-load a finished case formulation.
|
|
@@ -309,6 +314,8 @@ Another strong shape when the user is getting abstract:
|
|
|
309
314
|
the user has answered at least one real exploratory question.
|
|
310
315
|
- Do not ask for evidence, alternative beliefs, or repair plans before the user has had
|
|
311
316
|
a fair chance to feel that the original experience was captured accurately.
|
|
317
|
+
- If the moment is still hot, name what feels most painful, dangerous, or protective
|
|
318
|
+
before you ask for belief, mode, or pattern labels.
|
|
312
319
|
- Do not make the user prove the experience before you have helped them feel that you
|
|
313
320
|
understood it.
|
|
314
321
|
- Help the user recognize the experience before you help them improve it.
|
|
@@ -383,6 +390,13 @@ If the entity is not yet clear:
|
|
|
383
390
|
hold and what the new episode or evidence changes.
|
|
384
391
|
- If a recent charged episode is what made the update visible, anchor in that episode
|
|
385
392
|
before you rename the durable belief, pattern, mode, or value.
|
|
393
|
+
- If the user already gives the new sentence in usable language, revise the wording
|
|
394
|
+
once and save instead of reopening evidence, origin, or repair just because those
|
|
395
|
+
lanes are available.
|
|
396
|
+
- Do not open a second broad origin story just because the update touched old pain.
|
|
397
|
+
If the wording is already clear enough, refine it once and save.
|
|
398
|
+
- If the formulation already lands and the next answer would not change the wording,
|
|
399
|
+
links, or immediate write, stop asking and save.
|
|
386
400
|
- If another belief, value, pattern, mode, or note becomes visible, name it gently but
|
|
387
401
|
do not switch containers unless the user wants to.
|
|
388
402
|
|