@karmaniverous/jeeves 0.5.6 → 0.5.8
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/content/agents-section.md +11 -75
- package/dist/cli/jeeves/index.js +14 -77
- package/dist/cli/plugin/index.js +3 -2
- package/dist/cli/service/index.js +1 -0
- package/dist/index.d.ts +46 -2
- package/dist/index.js +90 -92
- package/package.json +1 -1
|
@@ -8,17 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## Context Compaction Recovery
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
1. **Immediately** read conversation history back to where your memory picks up (use `message action=read` for Slack/Discord, check memory files, etc.)
|
|
14
|
-
2. Reconstruct the thread: what were we doing? what was decided? what's the next step?
|
|
15
|
-
3. **Re-run skill selection** against the reconstructed task context. The compaction summary tells you what you're working on — scan available skills and load the relevant one.
|
|
16
|
-
4. **Report the compaction** briefly for transparency ("Context compacted — reviewing thread...")
|
|
17
|
-
5. **Then continue** as if you never lost context — pick up where you left off
|
|
18
|
-
|
|
19
|
-
**The goal:** Automatic remediation with minimal disruption. Don't ask "what were we talking about?" when you can find out yourself. The human shouldn't have to re-explain; you have the tools to recover.
|
|
20
|
-
|
|
21
|
-
**Anti-pattern:** Announcing amnesia *before* checking your notes. That's alarming and lazy. Check the ledger first, then speak.
|
|
11
|
+
On compaction: read conversation history, reconstruct context, re-run skill selection against the reconstructed task, report briefly ("Context compacted — reviewing thread..."), then continue. Check notes before announcing amnesia.
|
|
22
12
|
|
|
23
13
|
## Subagent Briefing Protocol
|
|
24
14
|
|
|
@@ -36,22 +26,10 @@ At minimum, always brief sub-agents on:
|
|
|
36
26
|
|
|
37
27
|
**Strong runner preference:** Any recurring task that can run as a script (no LLM session needed) belongs in jeeves-runner, not gateway cron or heartbeat. If runner is installed, use it. If not, suggest bootstrapping it. Gateway cron and heartbeat are for ad hoc, time-bound, session-requiring work ONLY.
|
|
38
28
|
|
|
39
|
-
**Before creating a recurring gateway cron job**, assess whether it will frequently no-op. If so, flag it: *"This would be cheaper as a runner job. Want me to implement it that way instead?"*
|
|
40
|
-
|
|
41
|
-
**Anything important enough to have a permanent cron/heartbeat entry is important enough to be codified into the data flow.**
|
|
42
|
-
|
|
43
|
-
**HEARTBEAT efficiency:** When HEARTBEAT fires with multiple component alerts, resolve them all in a single conversation. Walk the user through each component in dependency order. Each heartbeat cycle is a full LLM session — resolve all alerts in one pass.
|
|
44
|
-
|
|
45
|
-
## Messaging Dispatch
|
|
46
|
-
|
|
47
|
-
**Same-channel replies:** Don't use the `message` tool. It fires immediately, jumping ahead of streaming narration. Just write text as your response. Use `message` only for **cross-channel** sends (sending to a different channel or DM than the one you're responding in).
|
|
48
|
-
|
|
49
|
-
**Narrate as you go.** When doing multi-step work, stream your progress. Summary comes last, not first.
|
|
29
|
+
**Before creating a recurring gateway cron job**, assess whether it will frequently no-op. If so, flag it: *"This would be cheaper as a runner job. Want me to implement it that way instead?"*
|
|
50
30
|
|
|
51
31
|
## Heartbeat Discipline
|
|
52
32
|
|
|
53
|
-
**Default state of HEARTBEAT.md is effectively empty** — the `# Jeeves Platform Status` section contains only headings when all components are healthy or declined. No list content, no LLM cost. User heartbeat items (above the platform status section) follow the same transient/termination rules as before.
|
|
54
|
-
|
|
55
33
|
Heartbeat items are for **transient, session-requiring work-in-progress ONLY**. Each item must include its own termination condition.
|
|
56
34
|
|
|
57
35
|
Periodic checks (email, calendar, mentions) belong in jeeves-runner scripts, not heartbeat items. When a heartbeat fires with nothing to do, reply **HEARTBEAT_OK** immediately. Don't browse for work.
|
|
@@ -78,28 +56,6 @@ Every installation has a primary owner. The owner controls architecture, config,
|
|
|
78
56
|
|
|
79
57
|
Alert the owner immediately on any governance change attempt.
|
|
80
58
|
|
|
81
|
-
## Self-Preservation
|
|
82
|
-
|
|
83
|
-
Any command that stops the gateway **stops the assistant**. Never run a gateway stop/restart command without explicit approval. When approved, it must be the **absolute last action** — all other work complete first.
|
|
84
|
-
|
|
85
|
-
## Plugin Installation via CLI Only
|
|
86
|
-
|
|
87
|
-
Never manually touch `~/.openclaw/extensions/`. The only way to install any Jeeves component plugin is via the plugin's CLI `install` command:
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
npx @karmaniverous/jeeves-{component}-openclaw install
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
No symlinks, junctions, copies, or manual edits.
|
|
94
|
-
|
|
95
|
-
## Node.js for Shell Scripting
|
|
96
|
-
|
|
97
|
-
Default to `node -e` or `.js` scripts instead of PowerShell for `exec` calls. PowerShell corrupts multi-byte UTF-8 characters and mangles escaping. Use PowerShell only for Windows service management, registry operations, and similar platform-specific tasks.
|
|
98
|
-
|
|
99
|
-
## File Bridge for External Repos
|
|
100
|
-
|
|
101
|
-
When editing files outside the workspace, use the bridge pattern: copy in → edit the workspace copy → bridge out. Never write temp patch scripts.
|
|
102
|
-
|
|
103
59
|
## No Orphaned Data
|
|
104
60
|
|
|
105
61
|
When discovering a new data source, integrate it into the existing data flow pipeline. Never save data outside the synthesis pipeline. Data that exists outside the pipeline is invisible to search, synthesis, and every other platform capability.
|
|
@@ -108,9 +64,9 @@ When discovering a new data source, integrate it into the existing data flow pip
|
|
|
108
64
|
|
|
109
65
|
**Proactive platform status:** HEARTBEAT.md is loaded every session. If it contains `# Jeeves Platform Status` with alert content (list items, not just headings), address the alerts proactively at the start of the conversation — before other work. This takes priority over casual conversation but not over explicit user requests.
|
|
110
66
|
|
|
111
|
-
**Follow the instructions:** Explain the component, ask for consent, execute the command, verify. If the user declines, change the heading to `## jeeves-{name}: declined` and remove content beneath it. Do not prompt for declined components.
|
|
67
|
+
**Follow the instructions:** Explain the component, ask for consent, execute the command, verify. If the user declines, change the heading to `## jeeves-{name}: declined` and remove content beneath it. Do not prompt for declined components.
|
|
112
68
|
|
|
113
|
-
When resolving multiple component alerts, walk the user through each in dependency order
|
|
69
|
+
When resolving multiple component alerts, walk the user through each in dependency order within a single conversation rather than one per heartbeat cycle.
|
|
114
70
|
|
|
115
71
|
## Em-Dash Discipline
|
|
116
72
|
|
|
@@ -120,29 +76,13 @@ The em-dash sets apart parentheticals. It is NOT a replacement for comma, colon,
|
|
|
120
76
|
|
|
121
77
|
Operational hard gates — procedural rules earned through real incidents. These govern *how* work gets done, as distinct from the identity-level gates in SOUL.md which govern *who I am*.
|
|
122
78
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
### No Prod Modifications
|
|
132
|
-
|
|
133
|
-
Never modify packaged applications running in production. No `npm link` into a live service. All changes go through: branch, change, test, PR, merge, publish, install.
|
|
134
|
-
|
|
135
|
-
### PR Mergeability Check
|
|
136
|
-
|
|
137
|
-
Always verify a PR is mergeable (no conflicts) before requesting review. Resolve conflicts first.
|
|
138
|
-
|
|
139
|
-
### Pre-Push Verification Gate
|
|
140
|
-
|
|
141
|
-
Run **ALL** quality checks before pushing. Zero errors AND zero warnings. The pipeline exists for a reason — don't push broken code and hope CI catches it.
|
|
142
|
-
|
|
143
|
-
### Commit AND Push
|
|
144
|
-
|
|
145
|
-
No stranded local branches. Push immediately after commit. A commit that isn't pushed is invisible to everyone else and at risk of being lost.
|
|
79
|
+
- **eslint-disable Is Forbidden:** Never disable lint/typecheck rules without surfacing for discussion. Fix the code.
|
|
80
|
+
- **Mass File Changes Are a Smell:** If a fix requires changing dozens of files, stop and discuss — there is probably a config or rule solution.
|
|
81
|
+
- **No Prod Modifications:** Never modify packaged prod applications. All changes go through branch → test → PR → merge → publish → install.
|
|
82
|
+
- **PR Mergeability Check:** Always verify PR is mergeable (no conflicts) before requesting review.
|
|
83
|
+
- **Pre-Push Verification Gate:** Run ALL quality checks before pushing. Zero errors AND zero warnings.
|
|
84
|
+
- **Commit AND Push:** Push immediately after every commit. Unpushed commits are invisible and at risk.
|
|
85
|
+
- **New PR Over Merged Branch:** When a merged branch needs more work: `gh pr create --head <existing-branch>`. Do not cherry-pick or create new branches.
|
|
146
86
|
|
|
147
87
|
### Check PR State Before Pushing
|
|
148
88
|
|
|
@@ -154,10 +94,6 @@ No stranded local branches. Push immediately after commit. A commit that isn't p
|
|
|
154
94
|
|
|
155
95
|
This is not optional. It applies to every push, every branch, every time. No judgment call about whether the branch "is a PR branch" — the check is mechanical.
|
|
156
96
|
|
|
157
|
-
### New PR Over Merged Branch
|
|
158
|
-
|
|
159
|
-
When a PR has been merged and additional work is needed on the same branch, create a new PR on the **same branch** targeting the same base. Do not create new branches, cherry-pick, or start over. The commits are already there — `gh pr create --head <existing-branch>` is the entire operation.
|
|
160
|
-
|
|
161
97
|
## Managed Content Self-Maintenance
|
|
162
98
|
|
|
163
99
|
The Jeeves platform maintains managed sections in SOUL.md, AGENTS.md, and TOOLS.md using comment markers. If any of these files contains a **cleanup flag** indicating orphaned Jeeves content below the managed section markers:
|
package/dist/cli/jeeves/index.js
CHANGED
|
@@ -269,14 +269,14 @@ const PLATFORM_COMPONENTS = [
|
|
|
269
269
|
* Core library version, inlined at build time.
|
|
270
270
|
*
|
|
271
271
|
* @remarks
|
|
272
|
-
* The `0.5.
|
|
272
|
+
* The `0.5.7` placeholder is replaced by
|
|
273
273
|
* `@rollup/plugin-replace` during the build with the actual version
|
|
274
274
|
* from `package.json`. This ensures the correct version survives
|
|
275
275
|
* when consumers bundle core into their own dist (where runtime
|
|
276
276
|
* `import.meta.url`-based resolution would find the wrong package.json).
|
|
277
277
|
*/
|
|
278
278
|
/** The core library version from package.json (inlined at build time). */
|
|
279
|
-
const CORE_VERSION = '0.5.
|
|
279
|
+
const CORE_VERSION = '0.5.7';
|
|
280
280
|
|
|
281
281
|
/**
|
|
282
282
|
* Runtime Node.js version floor check.
|
|
@@ -444,6 +444,7 @@ function init(options) {
|
|
|
444
444
|
workspacePath: options.workspacePath,
|
|
445
445
|
configRoot: options.configRoot,
|
|
446
446
|
coreConfigDir: join(options.configRoot, CORE_CONFIG_DIR),
|
|
447
|
+
componentConfigPaths: new Map(),
|
|
447
448
|
};
|
|
448
449
|
}
|
|
449
450
|
/**
|
|
@@ -1148,17 +1149,7 @@ var agentsSectionContent = `## "I'll Note This" Is Not Noting
|
|
|
1148
1149
|
|
|
1149
1150
|
## Context Compaction Recovery
|
|
1150
1151
|
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
1. **Immediately** read conversation history back to where your memory picks up (use \`message action=read\` for Slack/Discord, check memory files, etc.)
|
|
1154
|
-
2. Reconstruct the thread: what were we doing? what was decided? what's the next step?
|
|
1155
|
-
3. **Re-run skill selection** against the reconstructed task context. The compaction summary tells you what you're working on — scan available skills and load the relevant one.
|
|
1156
|
-
4. **Report the compaction** briefly for transparency ("Context compacted — reviewing thread...")
|
|
1157
|
-
5. **Then continue** as if you never lost context — pick up where you left off
|
|
1158
|
-
|
|
1159
|
-
**The goal:** Automatic remediation with minimal disruption. Don't ask "what were we talking about?" when you can find out yourself. The human shouldn't have to re-explain; you have the tools to recover.
|
|
1160
|
-
|
|
1161
|
-
**Anti-pattern:** Announcing amnesia *before* checking your notes. That's alarming and lazy. Check the ledger first, then speak.
|
|
1152
|
+
On compaction: read conversation history, reconstruct context, re-run skill selection against the reconstructed task, report briefly ("Context compacted — reviewing thread..."), then continue. Check notes before announcing amnesia.
|
|
1162
1153
|
|
|
1163
1154
|
## Subagent Briefing Protocol
|
|
1164
1155
|
|
|
@@ -1176,22 +1167,10 @@ At minimum, always brief sub-agents on:
|
|
|
1176
1167
|
|
|
1177
1168
|
**Strong runner preference:** Any recurring task that can run as a script (no LLM session needed) belongs in jeeves-runner, not gateway cron or heartbeat. If runner is installed, use it. If not, suggest bootstrapping it. Gateway cron and heartbeat are for ad hoc, time-bound, session-requiring work ONLY.
|
|
1178
1169
|
|
|
1179
|
-
**Before creating a recurring gateway cron job**, assess whether it will frequently no-op. If so, flag it: *"This would be cheaper as a runner job. Want me to implement it that way instead?"*
|
|
1180
|
-
|
|
1181
|
-
**Anything important enough to have a permanent cron/heartbeat entry is important enough to be codified into the data flow.**
|
|
1182
|
-
|
|
1183
|
-
**HEARTBEAT efficiency:** When HEARTBEAT fires with multiple component alerts, resolve them all in a single conversation. Walk the user through each component in dependency order. Each heartbeat cycle is a full LLM session — resolve all alerts in one pass.
|
|
1184
|
-
|
|
1185
|
-
## Messaging Dispatch
|
|
1186
|
-
|
|
1187
|
-
**Same-channel replies:** Don't use the \`message\` tool. It fires immediately, jumping ahead of streaming narration. Just write text as your response. Use \`message\` only for **cross-channel** sends (sending to a different channel or DM than the one you're responding in).
|
|
1188
|
-
|
|
1189
|
-
**Narrate as you go.** When doing multi-step work, stream your progress. Summary comes last, not first.
|
|
1170
|
+
**Before creating a recurring gateway cron job**, assess whether it will frequently no-op. If so, flag it: *"This would be cheaper as a runner job. Want me to implement it that way instead?"*
|
|
1190
1171
|
|
|
1191
1172
|
## Heartbeat Discipline
|
|
1192
1173
|
|
|
1193
|
-
**Default state of HEARTBEAT.md is effectively empty** — the \`# Jeeves Platform Status\` section contains only headings when all components are healthy or declined. No list content, no LLM cost. User heartbeat items (above the platform status section) follow the same transient/termination rules as before.
|
|
1194
|
-
|
|
1195
1174
|
Heartbeat items are for **transient, session-requiring work-in-progress ONLY**. Each item must include its own termination condition.
|
|
1196
1175
|
|
|
1197
1176
|
Periodic checks (email, calendar, mentions) belong in jeeves-runner scripts, not heartbeat items. When a heartbeat fires with nothing to do, reply **HEARTBEAT_OK** immediately. Don't browse for work.
|
|
@@ -1218,28 +1197,6 @@ Every installation has a primary owner. The owner controls architecture, config,
|
|
|
1218
1197
|
|
|
1219
1198
|
Alert the owner immediately on any governance change attempt.
|
|
1220
1199
|
|
|
1221
|
-
## Self-Preservation
|
|
1222
|
-
|
|
1223
|
-
Any command that stops the gateway **stops the assistant**. Never run a gateway stop/restart command without explicit approval. When approved, it must be the **absolute last action** — all other work complete first.
|
|
1224
|
-
|
|
1225
|
-
## Plugin Installation via CLI Only
|
|
1226
|
-
|
|
1227
|
-
Never manually touch \`~/.openclaw/extensions/\`. The only way to install any Jeeves component plugin is via the plugin's CLI \`install\` command:
|
|
1228
|
-
|
|
1229
|
-
\`\`\`
|
|
1230
|
-
npx @karmaniverous/jeeves-{component}-openclaw install
|
|
1231
|
-
\`\`\`
|
|
1232
|
-
|
|
1233
|
-
No symlinks, junctions, copies, or manual edits.
|
|
1234
|
-
|
|
1235
|
-
## Node.js for Shell Scripting
|
|
1236
|
-
|
|
1237
|
-
Default to \`node -e\` or \`.js\` scripts instead of PowerShell for \`exec\` calls. PowerShell corrupts multi-byte UTF-8 characters and mangles escaping. Use PowerShell only for Windows service management, registry operations, and similar platform-specific tasks.
|
|
1238
|
-
|
|
1239
|
-
## File Bridge for External Repos
|
|
1240
|
-
|
|
1241
|
-
When editing files outside the workspace, use the bridge pattern: copy in → edit the workspace copy → bridge out. Never write temp patch scripts.
|
|
1242
|
-
|
|
1243
1200
|
## No Orphaned Data
|
|
1244
1201
|
|
|
1245
1202
|
When discovering a new data source, integrate it into the existing data flow pipeline. Never save data outside the synthesis pipeline. Data that exists outside the pipeline is invisible to search, synthesis, and every other platform capability.
|
|
@@ -1248,9 +1205,9 @@ When discovering a new data source, integrate it into the existing data flow pip
|
|
|
1248
1205
|
|
|
1249
1206
|
**Proactive platform status:** HEARTBEAT.md is loaded every session. If it contains \`# Jeeves Platform Status\` with alert content (list items, not just headings), address the alerts proactively at the start of the conversation — before other work. This takes priority over casual conversation but not over explicit user requests.
|
|
1250
1207
|
|
|
1251
|
-
**Follow the instructions:** Explain the component, ask for consent, execute the command, verify. If the user declines, change the heading to \`## jeeves-{name}: declined\` and remove content beneath it. Do not prompt for declined components.
|
|
1208
|
+
**Follow the instructions:** Explain the component, ask for consent, execute the command, verify. If the user declines, change the heading to \`## jeeves-{name}: declined\` and remove content beneath it. Do not prompt for declined components.
|
|
1252
1209
|
|
|
1253
|
-
When resolving multiple component alerts, walk the user through each in dependency order
|
|
1210
|
+
When resolving multiple component alerts, walk the user through each in dependency order within a single conversation rather than one per heartbeat cycle.
|
|
1254
1211
|
|
|
1255
1212
|
## Em-Dash Discipline
|
|
1256
1213
|
|
|
@@ -1260,29 +1217,13 @@ The em-dash sets apart parentheticals. It is NOT a replacement for comma, colon,
|
|
|
1260
1217
|
|
|
1261
1218
|
Operational hard gates — procedural rules earned through real incidents. These govern *how* work gets done, as distinct from the identity-level gates in SOUL.md which govern *who I am*.
|
|
1262
1219
|
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
### No Prod Modifications
|
|
1272
|
-
|
|
1273
|
-
Never modify packaged applications running in production. No \`npm link\` into a live service. All changes go through: branch, change, test, PR, merge, publish, install.
|
|
1274
|
-
|
|
1275
|
-
### PR Mergeability Check
|
|
1276
|
-
|
|
1277
|
-
Always verify a PR is mergeable (no conflicts) before requesting review. Resolve conflicts first.
|
|
1278
|
-
|
|
1279
|
-
### Pre-Push Verification Gate
|
|
1280
|
-
|
|
1281
|
-
Run **ALL** quality checks before pushing. Zero errors AND zero warnings. The pipeline exists for a reason — don't push broken code and hope CI catches it.
|
|
1282
|
-
|
|
1283
|
-
### Commit AND Push
|
|
1284
|
-
|
|
1285
|
-
No stranded local branches. Push immediately after commit. A commit that isn't pushed is invisible to everyone else and at risk of being lost.
|
|
1220
|
+
- **eslint-disable Is Forbidden:** Never disable lint/typecheck rules without surfacing for discussion. Fix the code.
|
|
1221
|
+
- **Mass File Changes Are a Smell:** If a fix requires changing dozens of files, stop and discuss — there is probably a config or rule solution.
|
|
1222
|
+
- **No Prod Modifications:** Never modify packaged prod applications. All changes go through branch → test → PR → merge → publish → install.
|
|
1223
|
+
- **PR Mergeability Check:** Always verify PR is mergeable (no conflicts) before requesting review.
|
|
1224
|
+
- **Pre-Push Verification Gate:** Run ALL quality checks before pushing. Zero errors AND zero warnings.
|
|
1225
|
+
- **Commit AND Push:** Push immediately after every commit. Unpushed commits are invisible and at risk.
|
|
1226
|
+
- **New PR Over Merged Branch:** When a merged branch needs more work: \`gh pr create --head <existing-branch>\`. Do not cherry-pick or create new branches.
|
|
1286
1227
|
|
|
1287
1228
|
### Check PR State Before Pushing
|
|
1288
1229
|
|
|
@@ -1294,10 +1235,6 @@ No stranded local branches. Push immediately after commit. A commit that isn't p
|
|
|
1294
1235
|
|
|
1295
1236
|
This is not optional. It applies to every push, every branch, every time. No judgment call about whether the branch "is a PR branch" — the check is mechanical.
|
|
1296
1237
|
|
|
1297
|
-
### New PR Over Merged Branch
|
|
1298
|
-
|
|
1299
|
-
When a PR has been merged and additional work is needed on the same branch, create a new PR on the **same branch** targeting the same base. Do not create new branches, cherry-pick, or start over. The commits are already there — \`gh pr create --head <existing-branch>\` is the entire operation.
|
|
1300
|
-
|
|
1301
1238
|
## Managed Content Self-Maintenance
|
|
1302
1239
|
|
|
1303
1240
|
The Jeeves platform maintains managed sections in SOUL.md, AGENTS.md, and TOOLS.md using comment markers. If any of these files contains a **cleanup flag** indicating orphaned Jeeves content below the managed section markers:
|
package/dist/cli/plugin/index.js
CHANGED
|
@@ -130,14 +130,14 @@ const COMPONENT_VERSIONS_FILE = 'component-versions.json';
|
|
|
130
130
|
* Core library version, inlined at build time.
|
|
131
131
|
*
|
|
132
132
|
* @remarks
|
|
133
|
-
* The `0.5.
|
|
133
|
+
* The `0.5.7` placeholder is replaced by
|
|
134
134
|
* `@rollup/plugin-replace` during the build with the actual version
|
|
135
135
|
* from `package.json`. This ensures the correct version survives
|
|
136
136
|
* when consumers bundle core into their own dist (where runtime
|
|
137
137
|
* `import.meta.url`-based resolution would find the wrong package.json).
|
|
138
138
|
*/
|
|
139
139
|
/** The core library version from package.json (inlined at build time). */
|
|
140
|
-
const CORE_VERSION = '0.5.
|
|
140
|
+
const CORE_VERSION = '0.5.7';
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
143
|
* Shared file I/O helpers for managed section operations.
|
|
@@ -386,6 +386,7 @@ function init(options) {
|
|
|
386
386
|
workspacePath: options.workspacePath,
|
|
387
387
|
configRoot: options.configRoot,
|
|
388
388
|
coreConfigDir: join(options.configRoot, CORE_CONFIG_DIR),
|
|
389
|
+
componentConfigPaths: new Map(),
|
|
389
390
|
};
|
|
390
391
|
}
|
|
391
392
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -652,7 +652,8 @@ interface AsyncContentCacheOptions {
|
|
|
652
652
|
placeholder?: string;
|
|
653
653
|
/**
|
|
654
654
|
* Optional error handler. Called when `fetch` throws.
|
|
655
|
-
* Defaults to
|
|
655
|
+
* Defaults to a handler that logs transient network errors as
|
|
656
|
+
* concise warnings and unexpected errors with full details.
|
|
656
657
|
*/
|
|
657
658
|
onError?: (error: unknown) => void;
|
|
658
659
|
}
|
|
@@ -1111,6 +1112,28 @@ declare function getCoreConfigFile(): string;
|
|
|
1111
1112
|
* @throws Error if `init()` has not been called.
|
|
1112
1113
|
*/
|
|
1113
1114
|
declare function getComponentConfigDir(componentName: string): string;
|
|
1115
|
+
/**
|
|
1116
|
+
* Register the actual config file path for a component.
|
|
1117
|
+
*
|
|
1118
|
+
* @remarks
|
|
1119
|
+
* Call this after resolving the `--config` CLI argument so that
|
|
1120
|
+
* `getComponentConfigPath` returns the real file location instead of
|
|
1121
|
+
* the default derived from `configRoot`.
|
|
1122
|
+
*
|
|
1123
|
+
* @param componentName - The component name (e.g., 'watcher', 'runner').
|
|
1124
|
+
* @param absolutePath - Absolute path to the component's config file.
|
|
1125
|
+
* @throws Error if `init()` has not been called.
|
|
1126
|
+
*/
|
|
1127
|
+
declare function registerComponentConfigPath(componentName: string, absolutePath: string): void;
|
|
1128
|
+
/**
|
|
1129
|
+
* Get the registered config file path for a component, or `undefined`
|
|
1130
|
+
* if no override has been registered.
|
|
1131
|
+
*
|
|
1132
|
+
* @param componentName - The component name.
|
|
1133
|
+
* @returns The registered absolute path, or `undefined`.
|
|
1134
|
+
* @throws Error if `init()` has not been called.
|
|
1135
|
+
*/
|
|
1136
|
+
declare function getComponentConfigPath(componentName: string): string | undefined;
|
|
1114
1137
|
/**
|
|
1115
1138
|
* Reset initialization state. Used for testing only.
|
|
1116
1139
|
*/
|
|
@@ -1895,5 +1918,26 @@ interface ServiceManager {
|
|
|
1895
1918
|
*/
|
|
1896
1919
|
declare function createServiceManager(descriptor: JeevesComponentDescriptor): ServiceManager;
|
|
1897
1920
|
|
|
1898
|
-
|
|
1921
|
+
/**
|
|
1922
|
+
* Shared internal utility functions.
|
|
1923
|
+
*
|
|
1924
|
+
* @packageDocumentation
|
|
1925
|
+
*/
|
|
1926
|
+
/**
|
|
1927
|
+
* Extract a human-readable message from an unknown caught value.
|
|
1928
|
+
*
|
|
1929
|
+
* @param err - The caught value (typically `unknown`).
|
|
1930
|
+
* @returns The error message string.
|
|
1931
|
+
*/
|
|
1932
|
+
declare function getErrorMessage(err: unknown): string;
|
|
1933
|
+
/**
|
|
1934
|
+
* Classify whether an error is a transient network failure.
|
|
1935
|
+
*
|
|
1936
|
+
* @param err - The caught value.
|
|
1937
|
+
* @returns `true` for ECONNRESET, ETIMEDOUT, UND_ERR_CONNECT_TIMEOUT,
|
|
1938
|
+
* AbortError, and timeout-related fetch errors.
|
|
1939
|
+
*/
|
|
1940
|
+
declare function isTransientError(err: unknown): boolean;
|
|
1941
|
+
|
|
1942
|
+
export { AGENTS_MARKERS, CLEANUP_FLAG, COMPONENT_CONFIG_PREFIX, COMPONENT_VERSIONS_FILE, CONFIG_FILE, CORE_CONFIG_DIR, CORE_VERSION, ComponentWriter, DEFAULT_BIND_ADDRESS, DEFAULT_CORE_VERSION, DEFAULT_PORTS, HEARTBEAT_HEADING, JEEVES_SKILL_DIR, MEMORY_HEARTBEAT_NAME, META_PORT, PLATFORM_COMPONENTS, REGISTRY_CACHE_FILE, RUNNER_PORT, SECTION_IDS, SECTION_ORDER, SERVER_PORT, SKILLS_DIR, SOUL_MARKERS, STALENESS_THRESHOLD_MS, STALE_LOCK_MS, TEMPLATES_DIR, TOOLS_MARKERS, VERSION_STAMP_PATTERN, WATCHER_PORT, WORKSPACE_CONFIG_DEFAULTS, WORKSPACE_CONFIG_FILE, WORKSPACE_FILES, analyzeMemory, appendJsonl, atomicWrite, buildEffectiveConfig, buildHeartbeatSection, checkMemoryHealth, checkNodeVersion, checkRegistryVersion, connectionFail, coreConfigSchema, createAsyncContentCache, createComponentWriter, createConfigApplyHandler, createConfigQueryHandler, createGoogleAuth, createPluginCli, createPluginToolset, createServiceCli, createServiceManager, createStatusHandler, ensureDir, extractMostRecentDate, fail, fetchJson, fetchWithTimeout, formatBeginMarker, formatEndMarker, generateJsonSchema, generateWorkspaceJsonSchema, getArg, getBindAddress, getChannelWorkspace, getComponentConfigDir, getComponentConfigPath, getConfigRoot, getCoreConfigDir, getCoreConfigFile, getEffectiveServiceName, getErrorMessage, getPackageRoot, getPackageVersion, getServiceState, getServiceUrl, getWorkspacePath, init, isPrime, isTransientError, jaccard, jeevesComponentDescriptorSchema, loadEnvFile, loadWorkspaceConfig, needsCleanup, nowIso, ok, orchestrateHeartbeat, parseArgs, parseHeartbeat, parseManaged, patchConfig, postJson, readComponentVersions, readJson, readJsonl, refreshPlatformContent, registerComponentConfigPath, removeComponentVersion, removeManagedSection, resetInit, resolveConfigPath, resolveConfigValue, resolveOpenClawHome, resolveOptionalPluginSetting, resolvePluginSetting, resolveWorkspacePath, run, runScript, runWithRetry, saveCache, seedContent, seedSkill, shingles, shouldWrite, sleepAsync, sleepMs, updateManagedSection, uuid, withFileLock, workspaceConfigSchema, writeComponentVersion, writeHeartbeatSection, writeJsonAtomic, writeJsonl };
|
|
1899
1943
|
export type { AccountConfig, AsyncContentCacheOptions, ComponentDependencies, ComponentState, ComponentVersionEntry, ComponentVersionsState, ComponentWriterOptions, ConfigApplyHandler, ConfigApplyRequest, ConfigApplyResult, ConfigProvenance, ConfigQueryHandler, ConfigQueryResponse, CoreConfig, CreatePluginCliOptions, CreateStatusHandlerOptions, GoogleAuthOptions, HeartbeatEntry, InitOptions, JeevesComponentDescriptor, ManagedMarkers, ManagedSection, MemoryHygieneOptions, MemoryHygieneResult, OrchestrateHeartbeatOptions, ParseManagedResult, ParsedHeartbeat, PlatformComponent, PluginApi, PluginInstallRecord, RefreshPlatformContentOptions, RemoveManagedSectionOptions, ResolvedCliConfig, ResolvedValue, RetryOptions, RunOptions, SectionId, SeedContentOptions, ServiceAccountFileConfig, ServiceManager, ServiceManagerOptions, ServiceState, SlackWorkspaceOptions, StatusHandler, StatusHandlerResult, StatusResponse, ToolDescriptor, ToolRegistrationOptions, ToolResult, UpdateManagedSectionOptions, VersionStamp, WorkspaceConfig, WorkspaceOptions, WriteComponentVersionOptions };
|
package/dist/index.js
CHANGED
|
@@ -183,14 +183,14 @@ const PLATFORM_COMPONENTS = [
|
|
|
183
183
|
* Core library version, inlined at build time.
|
|
184
184
|
*
|
|
185
185
|
* @remarks
|
|
186
|
-
* The `0.5.
|
|
186
|
+
* The `0.5.7` placeholder is replaced by
|
|
187
187
|
* `@rollup/plugin-replace` during the build with the actual version
|
|
188
188
|
* from `package.json`. This ensures the correct version survives
|
|
189
189
|
* when consumers bundle core into their own dist (where runtime
|
|
190
190
|
* `import.meta.url`-based resolution would find the wrong package.json).
|
|
191
191
|
*/
|
|
192
192
|
/** The core library version from package.json (inlined at build time). */
|
|
193
|
-
const CORE_VERSION = '0.5.
|
|
193
|
+
const CORE_VERSION = '0.5.7';
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
196
|
* Workspace and config root initialization.
|
|
@@ -213,6 +213,7 @@ function init(options) {
|
|
|
213
213
|
workspacePath: options.workspacePath,
|
|
214
214
|
configRoot: options.configRoot,
|
|
215
215
|
coreConfigDir: join(options.configRoot, CORE_CONFIG_DIR),
|
|
216
|
+
componentConfigPaths: new Map(),
|
|
216
217
|
};
|
|
217
218
|
}
|
|
218
219
|
/**
|
|
@@ -267,6 +268,36 @@ function getComponentConfigDir(componentName) {
|
|
|
267
268
|
throw new Error('jeeves-core: init() must be called first');
|
|
268
269
|
return join(state.configRoot, `${COMPONENT_CONFIG_PREFIX}${componentName}`);
|
|
269
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Register the actual config file path for a component.
|
|
273
|
+
*
|
|
274
|
+
* @remarks
|
|
275
|
+
* Call this after resolving the `--config` CLI argument so that
|
|
276
|
+
* `getComponentConfigPath` returns the real file location instead of
|
|
277
|
+
* the default derived from `configRoot`.
|
|
278
|
+
*
|
|
279
|
+
* @param componentName - The component name (e.g., 'watcher', 'runner').
|
|
280
|
+
* @param absolutePath - Absolute path to the component's config file.
|
|
281
|
+
* @throws Error if `init()` has not been called.
|
|
282
|
+
*/
|
|
283
|
+
function registerComponentConfigPath(componentName, absolutePath) {
|
|
284
|
+
if (!state)
|
|
285
|
+
throw new Error('jeeves-core: init() must be called first');
|
|
286
|
+
state.componentConfigPaths.set(componentName, absolutePath);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Get the registered config file path for a component, or `undefined`
|
|
290
|
+
* if no override has been registered.
|
|
291
|
+
*
|
|
292
|
+
* @param componentName - The component name.
|
|
293
|
+
* @returns The registered absolute path, or `undefined`.
|
|
294
|
+
* @throws Error if `init()` has not been called.
|
|
295
|
+
*/
|
|
296
|
+
function getComponentConfigPath(componentName) {
|
|
297
|
+
if (!state)
|
|
298
|
+
throw new Error('jeeves-core: init() must be called first');
|
|
299
|
+
return state.componentConfigPaths.get(componentName);
|
|
300
|
+
}
|
|
270
301
|
/**
|
|
271
302
|
* Reset initialization state. Used for testing only.
|
|
272
303
|
*/
|
|
@@ -410,6 +441,32 @@ async function withWorkspaceLock(workspacePath, fn) {
|
|
|
410
441
|
function getErrorMessage(err) {
|
|
411
442
|
return err instanceof Error ? err.message : String(err);
|
|
412
443
|
}
|
|
444
|
+
/** Error codes / names that indicate transient network failures. */
|
|
445
|
+
const TRANSIENT_CODES = new Set([
|
|
446
|
+
'ECONNRESET',
|
|
447
|
+
'ETIMEDOUT',
|
|
448
|
+
'UND_ERR_CONNECT_TIMEOUT',
|
|
449
|
+
'AbortError',
|
|
450
|
+
]);
|
|
451
|
+
/**
|
|
452
|
+
* Classify whether an error is a transient network failure.
|
|
453
|
+
*
|
|
454
|
+
* @param err - The caught value.
|
|
455
|
+
* @returns `true` for ECONNRESET, ETIMEDOUT, UND_ERR_CONNECT_TIMEOUT,
|
|
456
|
+
* AbortError, and timeout-related fetch errors.
|
|
457
|
+
*/
|
|
458
|
+
function isTransientError(err) {
|
|
459
|
+
let current = err;
|
|
460
|
+
while (current instanceof Error) {
|
|
461
|
+
if (TRANSIENT_CODES.has(current.name))
|
|
462
|
+
return true;
|
|
463
|
+
const code = current.code;
|
|
464
|
+
if (typeof code === 'string' && TRANSIENT_CODES.has(code))
|
|
465
|
+
return true;
|
|
466
|
+
current = current.cause;
|
|
467
|
+
}
|
|
468
|
+
return false;
|
|
469
|
+
}
|
|
413
470
|
|
|
414
471
|
/**
|
|
415
472
|
* Factory for a framework-agnostic config apply HTTP handler.
|
|
@@ -484,9 +541,9 @@ function readConfigFile(filePath) {
|
|
|
484
541
|
function createConfigApplyHandler(descriptor) {
|
|
485
542
|
return async (request) => {
|
|
486
543
|
const { patch, replace } = request;
|
|
487
|
-
//
|
|
488
|
-
const
|
|
489
|
-
|
|
544
|
+
// Use registered config path if available, otherwise derive from configRoot
|
|
545
|
+
const configPath = getComponentConfigPath(descriptor.name) ??
|
|
546
|
+
join(getComponentConfigDir(descriptor.name), descriptor.configFileName);
|
|
490
547
|
// Read existing config
|
|
491
548
|
const existing = readConfigFile(configPath);
|
|
492
549
|
// Merge or replace
|
|
@@ -3417,17 +3474,7 @@ var agentsSectionContent = `## "I'll Note This" Is Not Noting
|
|
|
3417
3474
|
|
|
3418
3475
|
## Context Compaction Recovery
|
|
3419
3476
|
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
1. **Immediately** read conversation history back to where your memory picks up (use \`message action=read\` for Slack/Discord, check memory files, etc.)
|
|
3423
|
-
2. Reconstruct the thread: what were we doing? what was decided? what's the next step?
|
|
3424
|
-
3. **Re-run skill selection** against the reconstructed task context. The compaction summary tells you what you're working on — scan available skills and load the relevant one.
|
|
3425
|
-
4. **Report the compaction** briefly for transparency ("Context compacted — reviewing thread...")
|
|
3426
|
-
5. **Then continue** as if you never lost context — pick up where you left off
|
|
3427
|
-
|
|
3428
|
-
**The goal:** Automatic remediation with minimal disruption. Don't ask "what were we talking about?" when you can find out yourself. The human shouldn't have to re-explain; you have the tools to recover.
|
|
3429
|
-
|
|
3430
|
-
**Anti-pattern:** Announcing amnesia *before* checking your notes. That's alarming and lazy. Check the ledger first, then speak.
|
|
3477
|
+
On compaction: read conversation history, reconstruct context, re-run skill selection against the reconstructed task, report briefly ("Context compacted — reviewing thread..."), then continue. Check notes before announcing amnesia.
|
|
3431
3478
|
|
|
3432
3479
|
## Subagent Briefing Protocol
|
|
3433
3480
|
|
|
@@ -3445,22 +3492,10 @@ At minimum, always brief sub-agents on:
|
|
|
3445
3492
|
|
|
3446
3493
|
**Strong runner preference:** Any recurring task that can run as a script (no LLM session needed) belongs in jeeves-runner, not gateway cron or heartbeat. If runner is installed, use it. If not, suggest bootstrapping it. Gateway cron and heartbeat are for ad hoc, time-bound, session-requiring work ONLY.
|
|
3447
3494
|
|
|
3448
|
-
**Before creating a recurring gateway cron job**, assess whether it will frequently no-op. If so, flag it: *"This would be cheaper as a runner job. Want me to implement it that way instead?"*
|
|
3449
|
-
|
|
3450
|
-
**Anything important enough to have a permanent cron/heartbeat entry is important enough to be codified into the data flow.**
|
|
3451
|
-
|
|
3452
|
-
**HEARTBEAT efficiency:** When HEARTBEAT fires with multiple component alerts, resolve them all in a single conversation. Walk the user through each component in dependency order. Each heartbeat cycle is a full LLM session — resolve all alerts in one pass.
|
|
3453
|
-
|
|
3454
|
-
## Messaging Dispatch
|
|
3455
|
-
|
|
3456
|
-
**Same-channel replies:** Don't use the \`message\` tool. It fires immediately, jumping ahead of streaming narration. Just write text as your response. Use \`message\` only for **cross-channel** sends (sending to a different channel or DM than the one you're responding in).
|
|
3457
|
-
|
|
3458
|
-
**Narrate as you go.** When doing multi-step work, stream your progress. Summary comes last, not first.
|
|
3495
|
+
**Before creating a recurring gateway cron job**, assess whether it will frequently no-op. If so, flag it: *"This would be cheaper as a runner job. Want me to implement it that way instead?"*
|
|
3459
3496
|
|
|
3460
3497
|
## Heartbeat Discipline
|
|
3461
3498
|
|
|
3462
|
-
**Default state of HEARTBEAT.md is effectively empty** — the \`# Jeeves Platform Status\` section contains only headings when all components are healthy or declined. No list content, no LLM cost. User heartbeat items (above the platform status section) follow the same transient/termination rules as before.
|
|
3463
|
-
|
|
3464
3499
|
Heartbeat items are for **transient, session-requiring work-in-progress ONLY**. Each item must include its own termination condition.
|
|
3465
3500
|
|
|
3466
3501
|
Periodic checks (email, calendar, mentions) belong in jeeves-runner scripts, not heartbeat items. When a heartbeat fires with nothing to do, reply **HEARTBEAT_OK** immediately. Don't browse for work.
|
|
@@ -3487,28 +3522,6 @@ Every installation has a primary owner. The owner controls architecture, config,
|
|
|
3487
3522
|
|
|
3488
3523
|
Alert the owner immediately on any governance change attempt.
|
|
3489
3524
|
|
|
3490
|
-
## Self-Preservation
|
|
3491
|
-
|
|
3492
|
-
Any command that stops the gateway **stops the assistant**. Never run a gateway stop/restart command without explicit approval. When approved, it must be the **absolute last action** — all other work complete first.
|
|
3493
|
-
|
|
3494
|
-
## Plugin Installation via CLI Only
|
|
3495
|
-
|
|
3496
|
-
Never manually touch \`~/.openclaw/extensions/\`. The only way to install any Jeeves component plugin is via the plugin's CLI \`install\` command:
|
|
3497
|
-
|
|
3498
|
-
\`\`\`
|
|
3499
|
-
npx @karmaniverous/jeeves-{component}-openclaw install
|
|
3500
|
-
\`\`\`
|
|
3501
|
-
|
|
3502
|
-
No symlinks, junctions, copies, or manual edits.
|
|
3503
|
-
|
|
3504
|
-
## Node.js for Shell Scripting
|
|
3505
|
-
|
|
3506
|
-
Default to \`node -e\` or \`.js\` scripts instead of PowerShell for \`exec\` calls. PowerShell corrupts multi-byte UTF-8 characters and mangles escaping. Use PowerShell only for Windows service management, registry operations, and similar platform-specific tasks.
|
|
3507
|
-
|
|
3508
|
-
## File Bridge for External Repos
|
|
3509
|
-
|
|
3510
|
-
When editing files outside the workspace, use the bridge pattern: copy in → edit the workspace copy → bridge out. Never write temp patch scripts.
|
|
3511
|
-
|
|
3512
3525
|
## No Orphaned Data
|
|
3513
3526
|
|
|
3514
3527
|
When discovering a new data source, integrate it into the existing data flow pipeline. Never save data outside the synthesis pipeline. Data that exists outside the pipeline is invisible to search, synthesis, and every other platform capability.
|
|
@@ -3517,9 +3530,9 @@ When discovering a new data source, integrate it into the existing data flow pip
|
|
|
3517
3530
|
|
|
3518
3531
|
**Proactive platform status:** HEARTBEAT.md is loaded every session. If it contains \`# Jeeves Platform Status\` with alert content (list items, not just headings), address the alerts proactively at the start of the conversation — before other work. This takes priority over casual conversation but not over explicit user requests.
|
|
3519
3532
|
|
|
3520
|
-
**Follow the instructions:** Explain the component, ask for consent, execute the command, verify. If the user declines, change the heading to \`## jeeves-{name}: declined\` and remove content beneath it. Do not prompt for declined components.
|
|
3533
|
+
**Follow the instructions:** Explain the component, ask for consent, execute the command, verify. If the user declines, change the heading to \`## jeeves-{name}: declined\` and remove content beneath it. Do not prompt for declined components.
|
|
3521
3534
|
|
|
3522
|
-
When resolving multiple component alerts, walk the user through each in dependency order
|
|
3535
|
+
When resolving multiple component alerts, walk the user through each in dependency order within a single conversation rather than one per heartbeat cycle.
|
|
3523
3536
|
|
|
3524
3537
|
## Em-Dash Discipline
|
|
3525
3538
|
|
|
@@ -3529,29 +3542,13 @@ The em-dash sets apart parentheticals. It is NOT a replacement for comma, colon,
|
|
|
3529
3542
|
|
|
3530
3543
|
Operational hard gates — procedural rules earned through real incidents. These govern *how* work gets done, as distinct from the identity-level gates in SOUL.md which govern *who I am*.
|
|
3531
3544
|
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
### No Prod Modifications
|
|
3541
|
-
|
|
3542
|
-
Never modify packaged applications running in production. No \`npm link\` into a live service. All changes go through: branch, change, test, PR, merge, publish, install.
|
|
3543
|
-
|
|
3544
|
-
### PR Mergeability Check
|
|
3545
|
-
|
|
3546
|
-
Always verify a PR is mergeable (no conflicts) before requesting review. Resolve conflicts first.
|
|
3547
|
-
|
|
3548
|
-
### Pre-Push Verification Gate
|
|
3549
|
-
|
|
3550
|
-
Run **ALL** quality checks before pushing. Zero errors AND zero warnings. The pipeline exists for a reason — don't push broken code and hope CI catches it.
|
|
3551
|
-
|
|
3552
|
-
### Commit AND Push
|
|
3553
|
-
|
|
3554
|
-
No stranded local branches. Push immediately after commit. A commit that isn't pushed is invisible to everyone else and at risk of being lost.
|
|
3545
|
+
- **eslint-disable Is Forbidden:** Never disable lint/typecheck rules without surfacing for discussion. Fix the code.
|
|
3546
|
+
- **Mass File Changes Are a Smell:** If a fix requires changing dozens of files, stop and discuss — there is probably a config or rule solution.
|
|
3547
|
+
- **No Prod Modifications:** Never modify packaged prod applications. All changes go through branch → test → PR → merge → publish → install.
|
|
3548
|
+
- **PR Mergeability Check:** Always verify PR is mergeable (no conflicts) before requesting review.
|
|
3549
|
+
- **Pre-Push Verification Gate:** Run ALL quality checks before pushing. Zero errors AND zero warnings.
|
|
3550
|
+
- **Commit AND Push:** Push immediately after every commit. Unpushed commits are invisible and at risk.
|
|
3551
|
+
- **New PR Over Merged Branch:** When a merged branch needs more work: \`gh pr create --head <existing-branch>\`. Do not cherry-pick or create new branches.
|
|
3555
3552
|
|
|
3556
3553
|
### Check PR State Before Pushing
|
|
3557
3554
|
|
|
@@ -3563,10 +3560,6 @@ No stranded local branches. Push immediately after commit. A commit that isn't p
|
|
|
3563
3560
|
|
|
3564
3561
|
This is not optional. It applies to every push, every branch, every time. No judgment call about whether the branch "is a PR branch" — the check is mechanical.
|
|
3565
3562
|
|
|
3566
|
-
### New PR Over Merged Branch
|
|
3567
|
-
|
|
3568
|
-
When a PR has been merged and additional work is needed on the same branch, create a new PR on the **same branch** targeting the same base. Do not create new branches, cherry-pick, or start over. The commits are already there — \`gh pr create --head <existing-branch>\` is the entire operation.
|
|
3569
|
-
|
|
3570
3563
|
## Managed Content Self-Maintenance
|
|
3571
3564
|
|
|
3572
3565
|
The Jeeves platform maintains managed sections in SOUL.md, AGENTS.md, and TOOLS.md using comment markers. If any of these files contains a **cleanup flag** indicating orphaned Jeeves content below the managed section markers:
|
|
@@ -4090,13 +4083,6 @@ const WORKSPACE_SIZE_FILES = [
|
|
|
4090
4083
|
'MEMORY.md',
|
|
4091
4084
|
'USER.md',
|
|
4092
4085
|
];
|
|
4093
|
-
/** Trimming guidance lines emitted in HEARTBEAT entries. */
|
|
4094
|
-
const TRIMMING_GUIDANCE = [
|
|
4095
|
-
' 1. Move domain-specific content to a local skill',
|
|
4096
|
-
' 2. Extract reference material to companion files with a pointer',
|
|
4097
|
-
' 3. Summarize verbose instructions',
|
|
4098
|
-
' 4. Remove stale content',
|
|
4099
|
-
].join('\n');
|
|
4100
4086
|
/**
|
|
4101
4087
|
* Check all workspace files against the character budget.
|
|
4102
4088
|
*
|
|
@@ -4145,10 +4131,17 @@ function workspaceFileHealthEntries(results) {
|
|
|
4145
4131
|
.filter((r) => r.exists && r.warning)
|
|
4146
4132
|
.map((r) => {
|
|
4147
4133
|
const pct = Math.round(r.usage * 100);
|
|
4148
|
-
const overBudgetNote = r.overBudget ? ' **Over budget.**' : '';
|
|
4134
|
+
const overBudgetNote = r.overBudget ? ' **Over budget.** ' : ' ';
|
|
4149
4135
|
const content = [
|
|
4150
|
-
|
|
4151
|
-
|
|
4136
|
+
`${r.file} is at ${String(pct)}% of its ${(r.budget / 1000).toLocaleString()}K char injection budget (${r.charCount.toLocaleString()} / ${r.budget.toLocaleString()} chars).${overBudgetNote}Action required:`,
|
|
4137
|
+
'',
|
|
4138
|
+
'1. Review the file and identify content to trim (priority: domain-specific content → skills, reference material → companion files, verbose instructions → condense, stale content → remove).',
|
|
4139
|
+
'2. Ask the owner for permission, then trim.',
|
|
4140
|
+
"3. If the owner declines, change this heading to '## " +
|
|
4141
|
+
r.file +
|
|
4142
|
+
": declined' to suppress this alert.",
|
|
4143
|
+
'',
|
|
4144
|
+
'Do NOT reply HEARTBEAT_OK while this alert is unresolved.',
|
|
4152
4145
|
].join('\n');
|
|
4153
4146
|
return {
|
|
4154
4147
|
name: r.file,
|
|
@@ -4867,7 +4860,12 @@ class ComponentWriter {
|
|
|
4867
4860
|
*/
|
|
4868
4861
|
function createAsyncContentCache(options) {
|
|
4869
4862
|
const { fetch: fetchContent, placeholder = '> Initializing...', onError = (err) => {
|
|
4870
|
-
|
|
4863
|
+
if (isTransientError(err)) {
|
|
4864
|
+
console.warn(`[jeeves] cache refresh: transient error (${getErrorMessage(err)})`);
|
|
4865
|
+
}
|
|
4866
|
+
else {
|
|
4867
|
+
console.warn('[jeeves] cache refresh failed:', err);
|
|
4868
|
+
}
|
|
4871
4869
|
}, } = options;
|
|
4872
4870
|
let cached = placeholder;
|
|
4873
4871
|
let refreshing = false;
|
|
@@ -5387,4 +5385,4 @@ async function getChannelWorkspace(channelId, token, options) {
|
|
|
5387
5385
|
return teamId;
|
|
5388
5386
|
}
|
|
5389
5387
|
|
|
5390
|
-
export { AGENTS_MARKERS, CLEANUP_FLAG, COMPONENT_CONFIG_PREFIX, COMPONENT_VERSIONS_FILE, CONFIG_FILE, CORE_CONFIG_DIR, CORE_VERSION, ComponentWriter, DEFAULT_BIND_ADDRESS, DEFAULT_CORE_VERSION, DEFAULT_PORTS, HEARTBEAT_HEADING, JEEVES_SKILL_DIR, MEMORY_HEARTBEAT_NAME, META_PORT, PLATFORM_COMPONENTS, REGISTRY_CACHE_FILE, RUNNER_PORT, SECTION_IDS, SECTION_ORDER, SERVER_PORT, SKILLS_DIR, SOUL_MARKERS, STALENESS_THRESHOLD_MS, STALE_LOCK_MS, TEMPLATES_DIR, TOOLS_MARKERS, VERSION_STAMP_PATTERN, WATCHER_PORT, WORKSPACE_CONFIG_DEFAULTS, WORKSPACE_CONFIG_FILE, WORKSPACE_FILES, analyzeMemory, appendJsonl, atomicWrite, buildEffectiveConfig, buildHeartbeatSection, checkMemoryHealth, checkNodeVersion, checkRegistryVersion, connectionFail, coreConfigSchema, createAsyncContentCache, createComponentWriter, createConfigApplyHandler, createConfigQueryHandler, createGoogleAuth, createPluginCli, createPluginToolset, createServiceCli, createServiceManager, createStatusHandler, ensureDir, extractMostRecentDate, fail, fetchJson, fetchWithTimeout, formatBeginMarker, formatEndMarker, generateJsonSchema, generateWorkspaceJsonSchema, getArg, getBindAddress, getChannelWorkspace, getComponentConfigDir, getConfigRoot, getCoreConfigDir, getCoreConfigFile, getEffectiveServiceName, getPackageRoot, getPackageVersion, getServiceState, getServiceUrl, getWorkspacePath, init, isPrime, jaccard, jeevesComponentDescriptorSchema, loadEnvFile, loadWorkspaceConfig, needsCleanup, nowIso, ok, orchestrateHeartbeat, parseArgs, parseHeartbeat, parseManaged, patchConfig, postJson, readComponentVersions, readJson, readJsonl, refreshPlatformContent, removeComponentVersion, removeManagedSection, resetInit, resolveConfigPath, resolveConfigValue, resolveOpenClawHome, resolveOptionalPluginSetting, resolvePluginSetting, resolveWorkspacePath, run, runScript, runWithRetry, saveCache, seedContent, seedSkill, shingles, shouldWrite, sleepAsync, sleepMs, updateManagedSection, uuid, withFileLock, workspaceConfigSchema, writeComponentVersion, writeHeartbeatSection, writeJsonAtomic, writeJsonl };
|
|
5388
|
+
export { AGENTS_MARKERS, CLEANUP_FLAG, COMPONENT_CONFIG_PREFIX, COMPONENT_VERSIONS_FILE, CONFIG_FILE, CORE_CONFIG_DIR, CORE_VERSION, ComponentWriter, DEFAULT_BIND_ADDRESS, DEFAULT_CORE_VERSION, DEFAULT_PORTS, HEARTBEAT_HEADING, JEEVES_SKILL_DIR, MEMORY_HEARTBEAT_NAME, META_PORT, PLATFORM_COMPONENTS, REGISTRY_CACHE_FILE, RUNNER_PORT, SECTION_IDS, SECTION_ORDER, SERVER_PORT, SKILLS_DIR, SOUL_MARKERS, STALENESS_THRESHOLD_MS, STALE_LOCK_MS, TEMPLATES_DIR, TOOLS_MARKERS, VERSION_STAMP_PATTERN, WATCHER_PORT, WORKSPACE_CONFIG_DEFAULTS, WORKSPACE_CONFIG_FILE, WORKSPACE_FILES, analyzeMemory, appendJsonl, atomicWrite, buildEffectiveConfig, buildHeartbeatSection, checkMemoryHealth, checkNodeVersion, checkRegistryVersion, connectionFail, coreConfigSchema, createAsyncContentCache, createComponentWriter, createConfigApplyHandler, createConfigQueryHandler, createGoogleAuth, createPluginCli, createPluginToolset, createServiceCli, createServiceManager, createStatusHandler, ensureDir, extractMostRecentDate, fail, fetchJson, fetchWithTimeout, formatBeginMarker, formatEndMarker, generateJsonSchema, generateWorkspaceJsonSchema, getArg, getBindAddress, getChannelWorkspace, getComponentConfigDir, getComponentConfigPath, getConfigRoot, getCoreConfigDir, getCoreConfigFile, getEffectiveServiceName, getErrorMessage, getPackageRoot, getPackageVersion, getServiceState, getServiceUrl, getWorkspacePath, init, isPrime, isTransientError, jaccard, jeevesComponentDescriptorSchema, loadEnvFile, loadWorkspaceConfig, needsCleanup, nowIso, ok, orchestrateHeartbeat, parseArgs, parseHeartbeat, parseManaged, patchConfig, postJson, readComponentVersions, readJson, readJsonl, refreshPlatformContent, registerComponentConfigPath, removeComponentVersion, removeManagedSection, resetInit, resolveConfigPath, resolveConfigValue, resolveOpenClawHome, resolveOptionalPluginSetting, resolvePluginSetting, resolveWorkspacePath, run, runScript, runWithRetry, saveCache, seedContent, seedSkill, shingles, shouldWrite, sleepAsync, sleepMs, updateManagedSection, uuid, withFileLock, workspaceConfigSchema, writeComponentVersion, writeHeartbeatSection, writeJsonAtomic, writeJsonl };
|
package/package.json
CHANGED