@wenrwa/marketplace-cli 0.7.4 → 0.7.5

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ /**
37
+ * cvt-09 — the managed region tells agents WHEN to call `show_in_browser`.
38
+ * Both lanes: hosted (contextWriter → fenced region of CLAUDE.md) and local
39
+ * (localContextWriter → bridge-owned .hiveop/context.md). Asserts on runtime
40
+ * output, never source text.
41
+ */
42
+ const fs = __importStar(require("fs"));
43
+ const os = __importStar(require("os"));
44
+ const path = __importStar(require("path"));
45
+ const contextWriter_1 = require("../bridge/contextWriter");
46
+ const localContextWriter_1 = require("../bridge/localContextWriter");
47
+ const workGraphPointer_1 = require("../bridge/workGraphPointer");
48
+ const LINE = 'Your pilot watches a Browser pane on their HiveOp canvas. After you start a dev server or finish a deploy, confirm the URL is live (fetch it), then call `show_in_browser` with that URL. It reloads their tab if open, otherwise opens it in a background tab — it never touches their other tabs.';
49
+ const count = (hay, needle) => hay.split(needle).length - 1;
50
+ describe('BROWSER_POINTER (cvt-09)', () => {
51
+ it('is the heading plus the exact line, ≤3 lines', () => {
52
+ expect(workGraphPointer_1.BROWSER_POINTER).toBe(`## Browser\n${LINE}`);
53
+ expect(workGraphPointer_1.BROWSER_POINTER.split('\n').length).toBeLessThanOrEqual(3);
54
+ });
55
+ it('is silent when the MCP tools are not registered', () => {
56
+ expect((0, workGraphPointer_1.browserSection)({ workGraphAvailable: false })).toBeNull();
57
+ expect((0, workGraphPointer_1.browserSection)({})).toBeNull();
58
+ expect((0, workGraphPointer_1.browserSection)({ workGraphAvailable: true })).toBe(workGraphPointer_1.BROWSER_POINTER);
59
+ });
60
+ });
61
+ describe('hosted lane — CLAUDE.md fenced region', () => {
62
+ const CLAUDE = '/data/repos/ws-7/CLAUDE.md';
63
+ const makeFs = (seed) => {
64
+ const files = new Map(Object.entries(seed));
65
+ return {
66
+ files,
67
+ deps: {
68
+ reposBaseDir: '/data/repos',
69
+ exists: (p) => files.has(p),
70
+ readFile: (p) => files.get(p) ?? '',
71
+ writeFile: (p, c) => { files.set(p, c); },
72
+ mkdirp: () => { },
73
+ },
74
+ };
75
+ };
76
+ it('carries the line exactly once inside the pointer markers after two writes; user content untouched', () => {
77
+ const userTop = '# My project\n\nHand-written rules.\n\n';
78
+ const userBottom = '\n\n## Mine\nkeep me\n';
79
+ const { files, deps } = makeFs({ [CLAUDE]: userTop + userBottom });
80
+ (0, contextWriter_1.writeContext)({ workspaceId: 'ws-7', content: 'pushed', workGraphAvailable: true, memoryAvailable: true }, deps);
81
+ const first = files.get(CLAUDE);
82
+ (0, contextWriter_1.writeContext)({ workspaceId: 'ws-7', pointersOnly: true, workGraphAvailable: true, memoryAvailable: true }, deps);
83
+ const out = files.get(CLAUDE);
84
+ expect(out).toBe(first);
85
+ expect(count(out, LINE)).toBe(1);
86
+ expect(count(out, '## Browser')).toBe(1);
87
+ const ps = out.indexOf(contextWriter_1.POINTERS_START_MARKER);
88
+ const pe = out.indexOf(contextWriter_1.POINTERS_END_MARKER);
89
+ const at = out.indexOf(LINE);
90
+ expect(ps).toBeGreaterThan(-1);
91
+ expect(at).toBeGreaterThan(ps);
92
+ expect(at).toBeLessThan(pe);
93
+ const rs = out.indexOf(contextWriter_1.CONTEXT_START_MARKER);
94
+ const re = out.indexOf(contextWriter_1.CONTEXT_END_MARKER) + contextWriter_1.CONTEXT_END_MARKER.length;
95
+ const outside = out.slice(0, rs) + out.slice(re);
96
+ expect(outside).toContain('# My project\n\nHand-written rules.');
97
+ expect(outside).toContain('## Mine\nkeep me');
98
+ expect(outside).not.toContain('show_in_browser');
99
+ });
100
+ it('carries the line in a match workspace too', () => {
101
+ const { files, deps } = makeFs({});
102
+ (0, contextWriter_1.writeContext)({ workspaceId: 'ws-7', content: '', workGraphAvailable: true, match: true }, deps);
103
+ expect(count(files.get(CLAUDE), LINE)).toBe(1);
104
+ });
105
+ it('omits it when the MCP tools are not registered', () => {
106
+ const { files, deps } = makeFs({});
107
+ (0, contextWriter_1.writeContext)({ workspaceId: 'ws-7', content: 'pushed' }, deps);
108
+ expect(files.get(CLAUDE)).not.toContain('show_in_browser');
109
+ });
110
+ });
111
+ describe('local lane — .hiveop/context.md', () => {
112
+ let projectRoot;
113
+ beforeEach(() => { projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'cvt09-')); });
114
+ afterEach(() => { fs.rmSync(projectRoot, { recursive: true, force: true }); });
115
+ const deps = () => ({
116
+ exists: (p) => fs.existsSync(p),
117
+ readFile: (p) => fs.readFileSync(p, 'utf-8'),
118
+ mkdirp: (d) => fs.mkdirSync(d, { recursive: true }),
119
+ writeFileAtomic: (p, c) => fs.writeFileSync(p, c, 'utf-8'),
120
+ remove: (p) => fs.rmSync(p, { force: true }),
121
+ });
122
+ it('carries the line exactly once inside the pointer markers after two writes; CLAUDE.md untouched', () => {
123
+ const claudeMd = path.join(projectRoot, 'CLAUDE.md');
124
+ fs.writeFileSync(claudeMd, '# user rules\n');
125
+ (0, localContextWriter_1.writeLocalContext)({ projectRoot, content: '## files\n- a.ts', workGraphAvailable: true, memoryAvailable: true }, deps());
126
+ (0, localContextWriter_1.writeLocalContext)({ projectRoot, pointersOnly: true, workGraphAvailable: true, memoryAvailable: true }, deps());
127
+ const out = fs.readFileSync(path.join(projectRoot, localContextWriter_1.LOCAL_CONTEXT_RELATIVE_PATH), 'utf-8');
128
+ expect(count(out, LINE)).toBe(1);
129
+ const at = out.indexOf(LINE);
130
+ expect(at).toBeGreaterThan(out.indexOf(contextWriter_1.POINTERS_START_MARKER));
131
+ expect(at).toBeLessThan(out.indexOf(contextWriter_1.POINTERS_END_MARKER));
132
+ expect(out).toContain('## files\n- a.ts');
133
+ expect(fs.readFileSync(claudeMd, 'utf-8')).toBe('# user rules\n');
134
+ });
135
+ });
@@ -153,6 +153,9 @@ function writeContext(input, deps) {
153
153
  pointers.push(work);
154
154
  if (input.memoryAvailable)
155
155
  pointers.push((0, memoryPointer_1.memorySection)(input.memoryBrief));
156
+ const browser = (0, workGraphPointer_1.browserSection)(input);
157
+ if (browser)
158
+ pointers.push(browser);
156
159
  // wmr-07: a pointers-only refresh keeps the region's existing file content
157
160
  // rather than replacing it with the (absent) `content` argument.
158
161
  const fileContent = input.pointersOnly
@@ -94,6 +94,9 @@ function writeLocalContext(input, deps) {
94
94
  pointers.push(work);
95
95
  if (input.memoryAvailable)
96
96
  pointers.push((0, memoryPointer_1.memorySection)(input.memoryBrief));
97
+ const browser = (0, workGraphPointer_1.browserSection)(input);
98
+ if (browser)
99
+ pointers.push(browser);
97
100
  // wmr-07 — the whole local file is bridge-owned, so "preserve the pushed
98
101
  // content" means keeping what is already on disk below the pointer fence.
99
102
  const existingBody = existed ? deps.readFile(contextPath) : '';
@@ -51,3 +51,19 @@ export declare function workSection(input: {
51
51
  workGraphAvailable?: boolean;
52
52
  match?: boolean;
53
53
  }): string | null;
54
+ /**
55
+ * cvt-09 (amended by the 2026-10-04 show-in-browser-tabs change) — tells the
56
+ * agent its pilot watches a Browser pane and WHEN to call `show_in_browser`:
57
+ * after starting a dev server or finishing a deploy, once the URL is confirmed
58
+ * live. Without this, agents only showed a site when asked.
59
+ *
60
+ * Gated on the same signal as the work-queue pointer (`workGraphAvailable` =
61
+ * the HiveOp MCP tools are registered for this process) — `show_in_browser`
62
+ * rides that same registration, and a pointer to an unregistered tool is
63
+ * worse than silence. Carried in matches too: a match agent runs dev servers.
64
+ */
65
+ export declare const BROWSER_POINTER: string;
66
+ /** cvt-09 — the browser section, one function so the hosted and local writers cannot diverge. */
67
+ export declare function browserSection(input: {
68
+ workGraphAvailable?: boolean;
69
+ }): string | null;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MATCH_POINTER = exports.WORK_GRAPH_POINTER = void 0;
3
+ exports.BROWSER_POINTER = exports.MATCH_POINTER = exports.WORK_GRAPH_POINTER = void 0;
4
4
  exports.workSection = workSection;
5
+ exports.browserSection = browserSection;
5
6
  /**
6
7
  * wgcp-01 — the one piece of guidance that tells an agent the workspace work
7
8
  * graph exists at all. Nothing today does: the MCP tools (`list_ready_issues`,
@@ -64,3 +65,22 @@ function workSection(input) {
64
65
  return exports.MATCH_POINTER;
65
66
  return input.workGraphAvailable ? exports.WORK_GRAPH_POINTER : null;
66
67
  }
68
+ /**
69
+ * cvt-09 (amended by the 2026-10-04 show-in-browser-tabs change) — tells the
70
+ * agent its pilot watches a Browser pane and WHEN to call `show_in_browser`:
71
+ * after starting a dev server or finishing a deploy, once the URL is confirmed
72
+ * live. Without this, agents only showed a site when asked.
73
+ *
74
+ * Gated on the same signal as the work-queue pointer (`workGraphAvailable` =
75
+ * the HiveOp MCP tools are registered for this process) — `show_in_browser`
76
+ * rides that same registration, and a pointer to an unregistered tool is
77
+ * worse than silence. Carried in matches too: a match agent runs dev servers.
78
+ */
79
+ exports.BROWSER_POINTER = [
80
+ '## Browser',
81
+ 'Your pilot watches a Browser pane on their HiveOp canvas. After you start a dev server or finish a deploy, confirm the URL is live (fetch it), then call `show_in_browser` with that URL. It reloads their tab if open, otherwise opens it in a background tab — it never touches their other tabs.',
82
+ ].join('\n');
83
+ /** cvt-09 — the browser section, one function so the hosted and local writers cannot diverge. */
84
+ function browserSection(input) {
85
+ return input.workGraphAvailable ? exports.BROWSER_POINTER : null;
86
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenrwa/marketplace-cli",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "CLI tool for the Wenrwa Agent Marketplace \u2014 monitor bounties, agents, workspaces, and treasury from your terminal",
5
5
  "author": "Wenrwa <dev@wenrwa.com>",
6
6
  "license": "MIT",