@karmaniverous/jeeves-meta 0.15.2 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/jeeves-meta/index.js +114 -17
- package/dist/index.js +114 -12
- package/package.json +2 -2
|
@@ -15,9 +15,9 @@ import * as commander from 'commander';
|
|
|
15
15
|
import { execSync } from 'node:child_process';
|
|
16
16
|
import { homedir, tmpdir } from 'node:os';
|
|
17
17
|
import { fileURLToPath } from 'node:url';
|
|
18
|
+
import Handlebars from 'handlebars';
|
|
18
19
|
import { readFile, unlink, mkdir, writeFile, copyFile } from 'node:fs/promises';
|
|
19
20
|
import pino from 'pino';
|
|
20
|
-
import Handlebars from 'handlebars';
|
|
21
21
|
import process$1 from 'node:process';
|
|
22
22
|
import { Cron } from 'croner';
|
|
23
23
|
import Fastify from 'fastify';
|
|
@@ -7239,6 +7239,11 @@ const workspaceCoreConfigSchema = z
|
|
|
7239
7239
|
configRoot: z.string().optional().describe('Platform config root path'),
|
|
7240
7240
|
/** OpenClaw gateway URL. */
|
|
7241
7241
|
gatewayUrl: z.string().optional().describe('OpenClaw gateway URL'),
|
|
7242
|
+
/** Dev repo paths keyed by component name. */
|
|
7243
|
+
devRepos: z
|
|
7244
|
+
.record(z.string(), z.string())
|
|
7245
|
+
.optional()
|
|
7246
|
+
.describe('Dev repo paths by component name'),
|
|
7242
7247
|
})
|
|
7243
7248
|
.partial();
|
|
7244
7249
|
/** Memory shared config section. */
|
|
@@ -7253,13 +7258,6 @@ const workspaceMemoryConfigSchema = z
|
|
|
7253
7258
|
.max(1)
|
|
7254
7259
|
.optional()
|
|
7255
7260
|
.describe('Memory warning threshold'),
|
|
7256
|
-
/** Staleness threshold in days. */
|
|
7257
|
-
staleDays: z
|
|
7258
|
-
.number()
|
|
7259
|
-
.int()
|
|
7260
|
-
.positive()
|
|
7261
|
-
.optional()
|
|
7262
|
-
.describe('Memory staleness threshold in days'),
|
|
7263
7261
|
})
|
|
7264
7262
|
.partial();
|
|
7265
7263
|
/** Workspace config Zod schema. */
|
|
@@ -8167,16 +8165,115 @@ function createServiceCli(descriptor) {
|
|
|
8167
8165
|
});
|
|
8168
8166
|
// Apply custom CLI commands if provided
|
|
8169
8167
|
if (descriptor.customCliCommands) {
|
|
8170
|
-
// Cast required: @commander-js/extra-typings Command has generic type
|
|
8171
|
-
// parameters that don't align with the descriptor's base Command type.
|
|
8172
|
-
// The descriptor can't know the parent Command's exact generic parameters
|
|
8173
|
-
// at definition time. The cast is safe — customCliCommands only adds
|
|
8174
|
-
// subcommands and doesn't depend on the parent's generic state.
|
|
8175
8168
|
descriptor.customCliCommands(program);
|
|
8176
8169
|
}
|
|
8177
8170
|
return program;
|
|
8178
8171
|
}
|
|
8179
8172
|
|
|
8173
|
+
var toolsPlatformTemplate = `### Tool Hierarchy
|
|
8174
|
+
|
|
8175
|
+
When searching for information across indexed paths, **always use \`watcher_search\` before filesystem commands** (\`exec\`, \`grep\`, \`find\`). The semantic index covers the full indexed corpus and surfaces related files you may not have considered.
|
|
8176
|
+
|
|
8177
|
+
Use \`watcher_scan\` (no embeddings, no query string) for structural queries: file enumeration, staleness checks, domain listing, counts.
|
|
8178
|
+
|
|
8179
|
+
Direct filesystem access is for **acting on** search results, not bypassing them.
|
|
8180
|
+
|
|
8181
|
+
### Shell Scripting
|
|
8182
|
+
|
|
8183
|
+
Default to \`node -e\` or \`.js\` scripts 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.
|
|
8184
|
+
|
|
8185
|
+
### File Bridge for External Repos
|
|
8186
|
+
|
|
8187
|
+
When editing files outside the workspace, use the bridge pattern: copy in → edit the workspace copy → bridge out. Never write temp patch scripts. The workspace is the authoritative working directory.
|
|
8188
|
+
|
|
8189
|
+
### Gateway Self-Destruction Warning
|
|
8190
|
+
|
|
8191
|
+
⚠️ Any command that stops the gateway **stops the assistant**. Never run \`openclaw gateway stop\` or \`openclaw gateway restart\` without explicit owner approval. When approved, it must be the **absolute last action** — all other work must be complete first, all messages sent, all files saved.
|
|
8192
|
+
|
|
8193
|
+
### Messaging
|
|
8194
|
+
|
|
8195
|
+
**Same-channel replies:** Don't use the \`message\` tool. It fires immediately, jumping ahead of streaming narration. Just write text as your response.
|
|
8196
|
+
|
|
8197
|
+
**Cross-channel sends:** Use the \`message\` tool with an explicit \`target\` to send to a different channel or DM.
|
|
8198
|
+
|
|
8199
|
+
### Plugin Lifecycle
|
|
8200
|
+
|
|
8201
|
+
\`\`\`bash
|
|
8202
|
+
# Platform bootstrap (content seeding)
|
|
8203
|
+
npx @karmaniverous/jeeves install
|
|
8204
|
+
|
|
8205
|
+
# Component plugin install
|
|
8206
|
+
npx @karmaniverous/jeeves-{component}-openclaw install
|
|
8207
|
+
|
|
8208
|
+
# Component plugin uninstall
|
|
8209
|
+
npx @karmaniverous/jeeves-{component}-openclaw uninstall
|
|
8210
|
+
|
|
8211
|
+
# Platform teardown (remove managed sections)
|
|
8212
|
+
npx @karmaniverous/jeeves uninstall
|
|
8213
|
+
\`\`\`
|
|
8214
|
+
|
|
8215
|
+
Never manually edit \`~/.openclaw/extensions/\`. Always use the CLI commands above.
|
|
8216
|
+
|
|
8217
|
+
### Reference Templates
|
|
8218
|
+
|
|
8219
|
+
{{#if templatePath}}
|
|
8220
|
+
Reference templates are available at \`{{templatePath}}\`:
|
|
8221
|
+
|
|
8222
|
+
| Template | Purpose |
|
|
8223
|
+
|----------|---------|
|
|
8224
|
+
| \`spec.md\` | Skeleton for new product specifications — all section headers, decision format, dev plan format |
|
|
8225
|
+
| \`spec-to-code-guide.md\` | The spec-to-code development practice — 7-stage iterative process, convergence loops, release gates |
|
|
8226
|
+
|
|
8227
|
+
Read these templates when creating new specs, onboarding to new projects, or when asked about the development process.
|
|
8228
|
+
{{else}}
|
|
8229
|
+
> Reference templates not yet installed. Run \`npx @karmaniverous/jeeves install\` to seed templates.
|
|
8230
|
+
{{/if}}
|
|
8231
|
+
|
|
8232
|
+
### Post-Upgrade Maintenance
|
|
8233
|
+
|
|
8234
|
+
After updating OpenClaw (\`npm install -g openclaw@latest\` or equivalent), reinstall all Jeeves component plugins to repair install state:
|
|
8235
|
+
|
|
8236
|
+
\`\`\`bash
|
|
8237
|
+
npx @karmaniverous/jeeves install
|
|
8238
|
+
npx @karmaniverous/jeeves-runner-openclaw install
|
|
8239
|
+
npx @karmaniverous/jeeves-watcher-openclaw install
|
|
8240
|
+
npx @karmaniverous/jeeves-server-openclaw install
|
|
8241
|
+
npx @karmaniverous/jeeves-meta-openclaw install
|
|
8242
|
+
\`\`\`
|
|
8243
|
+
|
|
8244
|
+
Then restart the gateway. Plugin installers copy dist files and patch config; reinstalling after an OpenClaw update ensures the extensions directory stays consistent.
|
|
8245
|
+
|
|
8246
|
+
### Source Code Preference
|
|
8247
|
+
|
|
8248
|
+
{{#if devRepos}}
|
|
8249
|
+
When investigating, debugging, or analyzing Jeeves components, always read TypeScript source from dev repos — never compiled \`dist/\` from the global npm install. Dev repos:
|
|
8250
|
+
|
|
8251
|
+
| Component | Dev Repo |
|
|
8252
|
+
|-----------|----------|
|
|
8253
|
+
{{#each devRepos}}
|
|
8254
|
+
| {{@key}} | \`{{this}}\` |
|
|
8255
|
+
{{/each}}
|
|
8256
|
+
|
|
8257
|
+
Built code is minified, harder to reason about, and wastes context. Always \`git pull\` before analysis.
|
|
8258
|
+
{{else}}
|
|
8259
|
+
> Dev repo paths not configured. Add \`core.devRepos\` to \`jeeves.config.json\` to enable source code preference guidance.
|
|
8260
|
+
{{/if}}
|
|
8261
|
+
`;
|
|
8262
|
+
|
|
8263
|
+
/**
|
|
8264
|
+
* Internal function to maintain SOUL.md, AGENTS.md, and TOOLS.md Platform section.
|
|
8265
|
+
*
|
|
8266
|
+
* @remarks
|
|
8267
|
+
* Called by `ComponentWriter` on each cycle. Not directly exposed to components.
|
|
8268
|
+
* Reads content files from the package's `content/` directory, renders the
|
|
8269
|
+
* Platform template with live data, and writes managed sections using
|
|
8270
|
+
* `updateManagedSection`.
|
|
8271
|
+
*/
|
|
8272
|
+
/** Compiled Handlebars template for the Platform section (cached at module level). */
|
|
8273
|
+
Handlebars.compile(toolsPlatformTemplate, {
|
|
8274
|
+
noEscape: true,
|
|
8275
|
+
});
|
|
8276
|
+
|
|
8180
8277
|
/**
|
|
8181
8278
|
* Core configuration schema and resolution.
|
|
8182
8279
|
*
|
|
@@ -8273,10 +8370,10 @@ function getServiceUrl(serviceName, consumerName) {
|
|
|
8273
8370
|
if (coreUrl)
|
|
8274
8371
|
return coreUrl;
|
|
8275
8372
|
// 3. Fall back to port constants
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
return `http://127.0.0.1:${String(port)}`;
|
|
8373
|
+
if (serviceName in DEFAULT_PORTS) {
|
|
8374
|
+
return `http://127.0.0.1:${String(DEFAULT_PORTS[serviceName])}`;
|
|
8279
8375
|
}
|
|
8376
|
+
throw new Error(`jeeves-core: unknown service "${serviceName}" and no config found`);
|
|
8280
8377
|
}
|
|
8281
8378
|
|
|
8282
8379
|
/**
|
|
@@ -9335,7 +9432,7 @@ class GatewayExecutor {
|
|
|
9335
9432
|
'Write your complete output to a file using the Write tool at:\n' +
|
|
9336
9433
|
outputPath +
|
|
9337
9434
|
'\n\n' +
|
|
9338
|
-
'
|
|
9435
|
+
'After writing the file, reply with ONLY: NO_REPLY';
|
|
9339
9436
|
// Step 1: Spawn the sub-agent session (unique label per cycle to avoid
|
|
9340
9437
|
// "label already in use" errors — gateway labels persist after session completion)
|
|
9341
9438
|
const labelBase = options?.label ?? 'jeeves-meta-synthesis';
|
package/dist/index.js
CHANGED
|
@@ -16,8 +16,8 @@ import { z } from 'zod';
|
|
|
16
16
|
import * as commander from 'commander';
|
|
17
17
|
import 'node:child_process';
|
|
18
18
|
import { tmpdir } from 'node:os';
|
|
19
|
-
import pino from 'pino';
|
|
20
19
|
import Handlebars from 'handlebars';
|
|
20
|
+
import pino from 'pino';
|
|
21
21
|
import { Cron } from 'croner';
|
|
22
22
|
import Fastify from 'fastify';
|
|
23
23
|
|
|
@@ -7437,6 +7437,11 @@ const workspaceCoreConfigSchema = z
|
|
|
7437
7437
|
configRoot: z.string().optional().describe('Platform config root path'),
|
|
7438
7438
|
/** OpenClaw gateway URL. */
|
|
7439
7439
|
gatewayUrl: z.string().optional().describe('OpenClaw gateway URL'),
|
|
7440
|
+
/** Dev repo paths keyed by component name. */
|
|
7441
|
+
devRepos: z
|
|
7442
|
+
.record(z.string(), z.string())
|
|
7443
|
+
.optional()
|
|
7444
|
+
.describe('Dev repo paths by component name'),
|
|
7440
7445
|
})
|
|
7441
7446
|
.partial();
|
|
7442
7447
|
/** Memory shared config section. */
|
|
@@ -7451,13 +7456,6 @@ const workspaceMemoryConfigSchema = z
|
|
|
7451
7456
|
.max(1)
|
|
7452
7457
|
.optional()
|
|
7453
7458
|
.describe('Memory warning threshold'),
|
|
7454
|
-
/** Staleness threshold in days. */
|
|
7455
|
-
staleDays: z
|
|
7456
|
-
.number()
|
|
7457
|
-
.int()
|
|
7458
|
-
.positive()
|
|
7459
|
-
.optional()
|
|
7460
|
-
.describe('Memory staleness threshold in days'),
|
|
7461
7459
|
})
|
|
7462
7460
|
.partial();
|
|
7463
7461
|
/** Workspace config Zod schema. */
|
|
@@ -7716,6 +7714,110 @@ async function postJson(url, body) {
|
|
|
7716
7714
|
});
|
|
7717
7715
|
}
|
|
7718
7716
|
|
|
7717
|
+
var toolsPlatformTemplate = `### Tool Hierarchy
|
|
7718
|
+
|
|
7719
|
+
When searching for information across indexed paths, **always use \`watcher_search\` before filesystem commands** (\`exec\`, \`grep\`, \`find\`). The semantic index covers the full indexed corpus and surfaces related files you may not have considered.
|
|
7720
|
+
|
|
7721
|
+
Use \`watcher_scan\` (no embeddings, no query string) for structural queries: file enumeration, staleness checks, domain listing, counts.
|
|
7722
|
+
|
|
7723
|
+
Direct filesystem access is for **acting on** search results, not bypassing them.
|
|
7724
|
+
|
|
7725
|
+
### Shell Scripting
|
|
7726
|
+
|
|
7727
|
+
Default to \`node -e\` or \`.js\` scripts 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.
|
|
7728
|
+
|
|
7729
|
+
### File Bridge for External Repos
|
|
7730
|
+
|
|
7731
|
+
When editing files outside the workspace, use the bridge pattern: copy in → edit the workspace copy → bridge out. Never write temp patch scripts. The workspace is the authoritative working directory.
|
|
7732
|
+
|
|
7733
|
+
### Gateway Self-Destruction Warning
|
|
7734
|
+
|
|
7735
|
+
⚠️ Any command that stops the gateway **stops the assistant**. Never run \`openclaw gateway stop\` or \`openclaw gateway restart\` without explicit owner approval. When approved, it must be the **absolute last action** — all other work must be complete first, all messages sent, all files saved.
|
|
7736
|
+
|
|
7737
|
+
### Messaging
|
|
7738
|
+
|
|
7739
|
+
**Same-channel replies:** Don't use the \`message\` tool. It fires immediately, jumping ahead of streaming narration. Just write text as your response.
|
|
7740
|
+
|
|
7741
|
+
**Cross-channel sends:** Use the \`message\` tool with an explicit \`target\` to send to a different channel or DM.
|
|
7742
|
+
|
|
7743
|
+
### Plugin Lifecycle
|
|
7744
|
+
|
|
7745
|
+
\`\`\`bash
|
|
7746
|
+
# Platform bootstrap (content seeding)
|
|
7747
|
+
npx @karmaniverous/jeeves install
|
|
7748
|
+
|
|
7749
|
+
# Component plugin install
|
|
7750
|
+
npx @karmaniverous/jeeves-{component}-openclaw install
|
|
7751
|
+
|
|
7752
|
+
# Component plugin uninstall
|
|
7753
|
+
npx @karmaniverous/jeeves-{component}-openclaw uninstall
|
|
7754
|
+
|
|
7755
|
+
# Platform teardown (remove managed sections)
|
|
7756
|
+
npx @karmaniverous/jeeves uninstall
|
|
7757
|
+
\`\`\`
|
|
7758
|
+
|
|
7759
|
+
Never manually edit \`~/.openclaw/extensions/\`. Always use the CLI commands above.
|
|
7760
|
+
|
|
7761
|
+
### Reference Templates
|
|
7762
|
+
|
|
7763
|
+
{{#if templatePath}}
|
|
7764
|
+
Reference templates are available at \`{{templatePath}}\`:
|
|
7765
|
+
|
|
7766
|
+
| Template | Purpose |
|
|
7767
|
+
|----------|---------|
|
|
7768
|
+
| \`spec.md\` | Skeleton for new product specifications — all section headers, decision format, dev plan format |
|
|
7769
|
+
| \`spec-to-code-guide.md\` | The spec-to-code development practice — 7-stage iterative process, convergence loops, release gates |
|
|
7770
|
+
|
|
7771
|
+
Read these templates when creating new specs, onboarding to new projects, or when asked about the development process.
|
|
7772
|
+
{{else}}
|
|
7773
|
+
> Reference templates not yet installed. Run \`npx @karmaniverous/jeeves install\` to seed templates.
|
|
7774
|
+
{{/if}}
|
|
7775
|
+
|
|
7776
|
+
### Post-Upgrade Maintenance
|
|
7777
|
+
|
|
7778
|
+
After updating OpenClaw (\`npm install -g openclaw@latest\` or equivalent), reinstall all Jeeves component plugins to repair install state:
|
|
7779
|
+
|
|
7780
|
+
\`\`\`bash
|
|
7781
|
+
npx @karmaniverous/jeeves install
|
|
7782
|
+
npx @karmaniverous/jeeves-runner-openclaw install
|
|
7783
|
+
npx @karmaniverous/jeeves-watcher-openclaw install
|
|
7784
|
+
npx @karmaniverous/jeeves-server-openclaw install
|
|
7785
|
+
npx @karmaniverous/jeeves-meta-openclaw install
|
|
7786
|
+
\`\`\`
|
|
7787
|
+
|
|
7788
|
+
Then restart the gateway. Plugin installers copy dist files and patch config; reinstalling after an OpenClaw update ensures the extensions directory stays consistent.
|
|
7789
|
+
|
|
7790
|
+
### Source Code Preference
|
|
7791
|
+
|
|
7792
|
+
{{#if devRepos}}
|
|
7793
|
+
When investigating, debugging, or analyzing Jeeves components, always read TypeScript source from dev repos — never compiled \`dist/\` from the global npm install. Dev repos:
|
|
7794
|
+
|
|
7795
|
+
| Component | Dev Repo |
|
|
7796
|
+
|-----------|----------|
|
|
7797
|
+
{{#each devRepos}}
|
|
7798
|
+
| {{@key}} | \`{{this}}\` |
|
|
7799
|
+
{{/each}}
|
|
7800
|
+
|
|
7801
|
+
Built code is minified, harder to reason about, and wastes context. Always \`git pull\` before analysis.
|
|
7802
|
+
{{else}}
|
|
7803
|
+
> Dev repo paths not configured. Add \`core.devRepos\` to \`jeeves.config.json\` to enable source code preference guidance.
|
|
7804
|
+
{{/if}}
|
|
7805
|
+
`;
|
|
7806
|
+
|
|
7807
|
+
/**
|
|
7808
|
+
* Internal function to maintain SOUL.md, AGENTS.md, and TOOLS.md Platform section.
|
|
7809
|
+
*
|
|
7810
|
+
* @remarks
|
|
7811
|
+
* Called by `ComponentWriter` on each cycle. Not directly exposed to components.
|
|
7812
|
+
* Reads content files from the package's `content/` directory, renders the
|
|
7813
|
+
* Platform template with live data, and writes managed sections using
|
|
7814
|
+
* `updateManagedSection`.
|
|
7815
|
+
*/
|
|
7816
|
+
/** Compiled Handlebars template for the Platform section (cached at module level). */
|
|
7817
|
+
Handlebars.compile(toolsPlatformTemplate, {
|
|
7818
|
+
noEscape: true,
|
|
7819
|
+
});
|
|
7820
|
+
|
|
7719
7821
|
/**
|
|
7720
7822
|
* Core configuration schema and resolution.
|
|
7721
7823
|
*
|
|
@@ -7812,10 +7914,10 @@ function getServiceUrl(serviceName, consumerName) {
|
|
|
7812
7914
|
if (coreUrl)
|
|
7813
7915
|
return coreUrl;
|
|
7814
7916
|
// 3. Fall back to port constants
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
return `http://127.0.0.1:${String(port)}`;
|
|
7917
|
+
if (serviceName in DEFAULT_PORTS) {
|
|
7918
|
+
return `http://127.0.0.1:${String(DEFAULT_PORTS[serviceName])}`;
|
|
7818
7919
|
}
|
|
7920
|
+
throw new Error(`jeeves-core: unknown service "${serviceName}" and no config found`);
|
|
7819
7921
|
}
|
|
7820
7922
|
|
|
7821
7923
|
/**
|
|
@@ -9069,7 +9171,7 @@ class GatewayExecutor {
|
|
|
9069
9171
|
'Write your complete output to a file using the Write tool at:\n' +
|
|
9070
9172
|
outputPath +
|
|
9071
9173
|
'\n\n' +
|
|
9072
|
-
'
|
|
9174
|
+
'After writing the file, reply with ONLY: NO_REPLY';
|
|
9073
9175
|
// Step 1: Spawn the sub-agent session (unique label per cycle to avoid
|
|
9074
9176
|
// "label already in use" errors — gateway labels persist after session completion)
|
|
9075
9177
|
const labelBase = options?.label ?? 'jeeves-meta-synthesis';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@karmaniverous/jeeves-meta",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"author": "Jason Williscroft",
|
|
5
5
|
"description": "Fastify HTTP service for the Jeeves Meta synthesis engine",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"node": ">=22"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@karmaniverous/jeeves": "^0.5.
|
|
44
|
+
"@karmaniverous/jeeves": "^0.5.9",
|
|
45
45
|
"commander": "^14",
|
|
46
46
|
"croner": "^10",
|
|
47
47
|
"fastify": "^5.8",
|