@wenrwa/marketplace-cli 0.7.6 → 0.7.7
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.
|
@@ -114,3 +114,23 @@ describe('resolveHooksDir', () => {
|
|
|
114
114
|
expect((0, hiveopSettings_1.resolveHooksDir)()).toBe(path.join(__dirname, '..', '..', 'hooks'));
|
|
115
115
|
});
|
|
116
116
|
});
|
|
117
|
+
describe('SessionStart loads .hiveop/context.md (2026-10-04: the local context was written but never read)', () => {
|
|
118
|
+
it('registers the session-start hook alongside the activity hooks', () => {
|
|
119
|
+
const json = JSON.parse((0, hiveopSettings_1.buildHiveOpSettingsContent)('/opt/x/hooks'));
|
|
120
|
+
const cmds = (json.hooks.SessionStart ?? []).flatMap((m) => m.hooks.map(h => h.command));
|
|
121
|
+
expect(cmds).toEqual(['node "/opt/x/hooks/session-start.js"']);
|
|
122
|
+
});
|
|
123
|
+
it('the hook prints the context file for the session cwd, and nothing when absent', () => {
|
|
124
|
+
const fs = require('fs');
|
|
125
|
+
const os = require('os');
|
|
126
|
+
const path = require('path');
|
|
127
|
+
const cp = require('child_process');
|
|
128
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'hiveop-ss-'));
|
|
129
|
+
const hook = path.join(__dirname, '..', '..', 'hooks', 'session-start.js');
|
|
130
|
+
const run = () => cp.execFileSync('node', [hook], { input: JSON.stringify({ cwd: dir }) }).toString();
|
|
131
|
+
expect(run()).toBe('');
|
|
132
|
+
fs.mkdirSync(path.join(dir, '.hiveop'));
|
|
133
|
+
fs.writeFileSync(path.join(dir, '.hiveop', 'context.md'), '## Browser\ncall show_in_browser');
|
|
134
|
+
expect(run()).toContain('call show_in_browser');
|
|
135
|
+
});
|
|
136
|
+
});
|
|
@@ -88,6 +88,9 @@ function buildHiveOpSettingsContent(hooksDir) {
|
|
|
88
88
|
},
|
|
89
89
|
],
|
|
90
90
|
Stop: [{ hooks: [{ type: 'command', command: hookCommand(hooksDir, 'stop.js') }] }],
|
|
91
|
+
// Loads `.hiveop/context.md` (the bridge's managed context) into every
|
|
92
|
+
// local session — without it that file was written but never read.
|
|
93
|
+
SessionStart: [{ hooks: [{ type: 'command', command: hookCommand(hooksDir, 'session-start.js') }] }],
|
|
91
94
|
},
|
|
92
95
|
};
|
|
93
96
|
return JSON.stringify(obj, null, 2) + '\n';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
* HiveOp SessionStart hook — LOCAL bridge lane.
|
|
4
|
+
*
|
|
5
|
+
* The local bridge writes HiveOp's managed context (work-queue pointers, the
|
|
6
|
+
* Browser note, match notes) to `<project>/.hiveop/context.md` and never
|
|
7
|
+
* edits the user's CLAUDE.md. Nothing made Claude READ that file (2026-10-04:
|
|
8
|
+
* the "call show_in_browser after a deploy" note went unread). A SessionStart
|
|
9
|
+
* hook's stdout is added to the session's context, so print the file here.
|
|
10
|
+
* Silent and non-blocking when the file is absent; never fails the session.
|
|
11
|
+
*/
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
|
|
15
|
+
let input = '';
|
|
16
|
+
process.stdin.on('data', (d) => { input += d; });
|
|
17
|
+
process.stdin.on('end', () => {
|
|
18
|
+
try {
|
|
19
|
+
let cwd = process.cwd();
|
|
20
|
+
try { const j = JSON.parse(input || '{}'); if (typeof j.cwd === 'string' && j.cwd) cwd = j.cwd; } catch {}
|
|
21
|
+
const file = path.join(cwd, '.hiveop', 'context.md');
|
|
22
|
+
if (fs.existsSync(file)) {
|
|
23
|
+
const text = fs.readFileSync(file, 'utf8').slice(0, 20000);
|
|
24
|
+
if (text.trim()) process.stdout.write(`HiveOp workspace context (from .hiveop/context.md):\n\n${text}\n`);
|
|
25
|
+
}
|
|
26
|
+
} catch {}
|
|
27
|
+
process.exit(0);
|
|
28
|
+
});
|
|
29
|
+
process.stdin.on('error', () => process.exit(0));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wenrwa/marketplace-cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"description": "CLI tool for the Wenrwa Agent Marketplace — monitor bounties, agents, workspaces, and treasury from your terminal",
|
|
5
5
|
"author": "Wenrwa <dev@wenrwa.com>",
|
|
6
6
|
"license": "MIT",
|