@jobshimo/browser-link 0.7.14 → 0.8.0
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/agent-instructions/claude.d.ts +2 -0
- package/dist/agent-instructions/claude.js +29 -0
- package/dist/agent-instructions/claude.js.map +1 -0
- package/dist/agent-instructions/content.d.ts +34 -0
- package/dist/agent-instructions/content.js +94 -0
- package/dist/agent-instructions/content.js.map +1 -0
- package/dist/agent-instructions/copilot.d.ts +2 -0
- package/dist/agent-instructions/copilot.js +31 -0
- package/dist/agent-instructions/copilot.js.map +1 -0
- package/dist/agent-instructions/file-ops.d.ts +8 -0
- package/dist/agent-instructions/file-ops.js +83 -0
- package/dist/agent-instructions/file-ops.js.map +1 -0
- package/dist/agent-instructions/index.d.ts +8 -0
- package/dist/agent-instructions/index.js +19 -0
- package/dist/agent-instructions/index.js.map +1 -0
- package/dist/agent-instructions/opencode.d.ts +2 -0
- package/dist/agent-instructions/opencode.js +30 -0
- package/dist/agent-instructions/opencode.js.map +1 -0
- package/dist/agent-instructions/types.d.ts +41 -0
- package/dist/agent-instructions/types.js +2 -0
- package/dist/agent-instructions/types.js.map +1 -0
- package/dist/cli.js +63 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.js +35 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/instructions.d.ts +27 -0
- package/dist/commands/instructions.js +94 -0
- package/dist/commands/instructions.js.map +1 -0
- package/dist/commands/self-update.js +7 -1
- package/dist/commands/self-update.js.map +1 -1
- package/dist/extension/manifest.json +1 -1
- package/dist/ui/app.js +5 -1
- package/dist/ui/app.js.map +1 -1
- package/dist/ui/screens/agent-instructions.d.ts +6 -0
- package/dist/ui/screens/agent-instructions.js +92 -0
- package/dist/ui/screens/agent-instructions.js.map +1 -0
- package/dist/ui/screens/index.d.ts +1 -0
- package/dist/ui/screens/index.js +1 -0
- package/dist/ui/screens/index.js.map +1 -1
- package/dist/ui/screens/menu.d.ts +1 -1
- package/dist/ui/screens/menu.js +3 -0
- package/dist/ui/screens/menu.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { detectAt, installAt, uninstallAt } from './file-ops.js';
|
|
4
|
+
/**
|
|
5
|
+
* Claude Code reads `~/.claude/CLAUDE.md` as the user-level global
|
|
6
|
+
* instructions file (applied to every project). That is where the block
|
|
7
|
+
* lives so the trigger list reaches every Claude session, regardless of
|
|
8
|
+
* which repo the user is in.
|
|
9
|
+
*/
|
|
10
|
+
function file() {
|
|
11
|
+
return join(homedir(), '.claude', 'CLAUDE.md');
|
|
12
|
+
}
|
|
13
|
+
export const claudeInstructionsInstaller = {
|
|
14
|
+
id: 'claude',
|
|
15
|
+
displayName: 'Claude Code',
|
|
16
|
+
filePath() {
|
|
17
|
+
return file();
|
|
18
|
+
},
|
|
19
|
+
detect() {
|
|
20
|
+
return detectAt(file());
|
|
21
|
+
},
|
|
22
|
+
install() {
|
|
23
|
+
return installAt(file(), 'Claude Code');
|
|
24
|
+
},
|
|
25
|
+
uninstall() {
|
|
26
|
+
return uninstallAt(file(), 'Claude Code');
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=claude.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/agent-instructions/claude.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjE;;;;;GAKG;AACH,SAAS,IAAI;IACX,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,CAAC,MAAM,2BAA2B,GAA0B;IAChE,EAAE,EAAE,QAAQ;IACZ,WAAW,EAAE,aAAa;IAE1B,QAAQ;QACN,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO;QACL,OAAO,SAAS,CAAC,IAAI,EAAE,EAAE,aAAa,CAAC,CAAC;IAC1C,CAAC;IAED,SAAS;QACP,OAAO,WAAW,CAAC,IAAI,EAAE,EAAE,aAAa,CAAC,CAAC;IAC5C,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The block we drop into each agent's global instructions markdown file.
|
|
3
|
+
* Wrapped in HTML-comment marker fences so:
|
|
4
|
+
* - rendered markdown viewers hide the markers,
|
|
5
|
+
* - the installer can detect / re-find / replace the exact span,
|
|
6
|
+
* - other content in the same .md file is left untouched.
|
|
7
|
+
*
|
|
8
|
+
* The version inside the begin marker lets a newer browser-link tell whether
|
|
9
|
+
* an installed block is current; install() always rewrites to the running
|
|
10
|
+
* version, so reinstalling is the upgrade path.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BEGIN_PREFIX = "<!-- browser-link:instructions:begin";
|
|
13
|
+
export declare const END_MARKER = "<!-- browser-link:instructions:end -->";
|
|
14
|
+
export declare function beginMarker(version?: string): string;
|
|
15
|
+
/** Regex that matches either an explicit version marker or a legacy one
|
|
16
|
+
* with no version. The named `version` group is set when a version is
|
|
17
|
+
* present (a plain capture group is typed as `string` by TS, which would
|
|
18
|
+
* collapse the `undefined` branch we want; the named-group form keeps
|
|
19
|
+
* `version` as `string | undefined`). */
|
|
20
|
+
export declare const BEGIN_RE: RegExp;
|
|
21
|
+
export declare const END_RE: RegExp;
|
|
22
|
+
/** Full fenced block to write into the file, including a trailing newline.
|
|
23
|
+
* The line between markers carries the managed-by stamp so a user reading
|
|
24
|
+
* the file knows it is auto-generated and how to refresh it. */
|
|
25
|
+
export declare function block(version?: string): string;
|
|
26
|
+
/** Locate the block boundaries in the given file text. Returns null when
|
|
27
|
+
* either marker is missing. Used by detect/install/uninstall to act on the
|
|
28
|
+
* exact span the installer owns. */
|
|
29
|
+
export interface BlockSpan {
|
|
30
|
+
startIndex: number;
|
|
31
|
+
endIndex: number;
|
|
32
|
+
installedVersion: string | null;
|
|
33
|
+
}
|
|
34
|
+
export declare function findBlockSpan(text: string): BlockSpan | null;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { VERSION } from '../version.js';
|
|
2
|
+
/**
|
|
3
|
+
* The block we drop into each agent's global instructions markdown file.
|
|
4
|
+
* Wrapped in HTML-comment marker fences so:
|
|
5
|
+
* - rendered markdown viewers hide the markers,
|
|
6
|
+
* - the installer can detect / re-find / replace the exact span,
|
|
7
|
+
* - other content in the same .md file is left untouched.
|
|
8
|
+
*
|
|
9
|
+
* The version inside the begin marker lets a newer browser-link tell whether
|
|
10
|
+
* an installed block is current; install() always rewrites to the running
|
|
11
|
+
* version, so reinstalling is the upgrade path.
|
|
12
|
+
*/
|
|
13
|
+
export const BEGIN_PREFIX = '<!-- browser-link:instructions:begin';
|
|
14
|
+
export const END_MARKER = '<!-- browser-link:instructions:end -->';
|
|
15
|
+
export function beginMarker(version = VERSION) {
|
|
16
|
+
return `${BEGIN_PREFIX} v${version} -->`;
|
|
17
|
+
}
|
|
18
|
+
/** Regex that matches either an explicit version marker or a legacy one
|
|
19
|
+
* with no version. The named `version` group is set when a version is
|
|
20
|
+
* present (a plain capture group is typed as `string` by TS, which would
|
|
21
|
+
* collapse the `undefined` branch we want; the named-group form keeps
|
|
22
|
+
* `version` as `string | undefined`). */
|
|
23
|
+
export const BEGIN_RE = /<!--\s*browser-link:instructions:begin(?:\s+v(?<version>\d+\.\d+\.\d+))?\s*-->/;
|
|
24
|
+
export const END_RE = /<!--\s*browser-link:instructions:end\s*-->/;
|
|
25
|
+
/** Block body. Plain English by design — every LLM understands it, and a
|
|
26
|
+
* mixed-language user is still served. Triggers-first; no marketing copy. */
|
|
27
|
+
function body() {
|
|
28
|
+
return [
|
|
29
|
+
'## browser-link — when to reach for it',
|
|
30
|
+
'',
|
|
31
|
+
'When you have access to `browser.*` MCP tools (the bridge exposed by',
|
|
32
|
+
'@jobshimo/browser-link), reach for them BEFORE speculating about UI',
|
|
33
|
+
'behavior. Tabs the user has not explicitly connected through the',
|
|
34
|
+
'Chrome extension are invisible to you; never reason about state you',
|
|
35
|
+
'cannot see.',
|
|
36
|
+
'',
|
|
37
|
+
'### Triggers — call these reflexively',
|
|
38
|
+
'',
|
|
39
|
+
'- **User reports a UI bug, broken layout, "the button does not fire",',
|
|
40
|
+
' or asks "does X work" in a web app**: call `browser.list_tabs` first.',
|
|
41
|
+
' If one tab is connected, snapshot it. If several, ask which.',
|
|
42
|
+
'- **Before suggesting a code change to a UI component**: verify the',
|
|
43
|
+
' current page state with `browser.snapshot`. Do not guess.',
|
|
44
|
+
'- **Any non-trivial debugging session on a web app the user mentioned**:',
|
|
45
|
+
' call `browser.map.recall` with the tab origin first. Past selectors,',
|
|
46
|
+
' flows and gotchas come back; you save tokens and avoid re-deriving.',
|
|
47
|
+
'- **Tool call fails with "Tab not connected"**: call `browser.events`',
|
|
48
|
+
' and look for `tab-renamed` entries before retrying.',
|
|
49
|
+
'- **After any non-trivial flow you discovered end-to-end** (opened a',
|
|
50
|
+
' dialog, completed a form, found a setting): persist it with',
|
|
51
|
+
' `browser.map.save`. UI structure only — never save domain data',
|
|
52
|
+
' (IDs, names, dates).',
|
|
53
|
+
'',
|
|
54
|
+
'### Multi-agent cooperation',
|
|
55
|
+
'',
|
|
56
|
+
'When several MCP clients share one bridge (multi-agent mode), call',
|
|
57
|
+
'`browser.claim_tab` before operating on a tab so other agents see it',
|
|
58
|
+
'is in use. Release with `browser.release_tab` when done.',
|
|
59
|
+
].join('\n');
|
|
60
|
+
}
|
|
61
|
+
/** Full fenced block to write into the file, including a trailing newline.
|
|
62
|
+
* The line between markers carries the managed-by stamp so a user reading
|
|
63
|
+
* the file knows it is auto-generated and how to refresh it. */
|
|
64
|
+
export function block(version = VERSION) {
|
|
65
|
+
return [
|
|
66
|
+
beginMarker(version),
|
|
67
|
+
`<!-- managed-by: browser-link v${version}; do not edit between markers; run \`browser-link instructions install\` to refresh. -->`,
|
|
68
|
+
'',
|
|
69
|
+
body(),
|
|
70
|
+
'',
|
|
71
|
+
END_MARKER,
|
|
72
|
+
'',
|
|
73
|
+
].join('\n');
|
|
74
|
+
}
|
|
75
|
+
export function findBlockSpan(text) {
|
|
76
|
+
const begin = BEGIN_RE.exec(text);
|
|
77
|
+
if (!begin)
|
|
78
|
+
return null;
|
|
79
|
+
const afterBegin = begin.index + begin[0].length;
|
|
80
|
+
const end = END_RE.exec(text.slice(afterBegin));
|
|
81
|
+
if (!end)
|
|
82
|
+
return null;
|
|
83
|
+
const endMarkerStartAbsolute = afterBegin + end.index;
|
|
84
|
+
const endMarkerEndAbsolute = endMarkerStartAbsolute + end[0].length;
|
|
85
|
+
// Consume the trailing newline after the end marker, if any.
|
|
86
|
+
const nextChar = text[endMarkerEndAbsolute];
|
|
87
|
+
const endIndex = nextChar === '\n' ? endMarkerEndAbsolute + 1 : endMarkerEndAbsolute;
|
|
88
|
+
return {
|
|
89
|
+
startIndex: begin.index,
|
|
90
|
+
endIndex,
|
|
91
|
+
installedVersion: begin.groups?.version ?? null,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/agent-instructions/content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,sCAAsC,CAAC;AACnE,MAAM,CAAC,MAAM,UAAU,GAAG,wC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,MAAM,CAAC;IACjD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAChD,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,sBAAsB,GAAG,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC;IACtD,MAAM,oBAAoB,GAAG,sBAAsB,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACpE,6DAA6D;IAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC;IACrF,OAAO;QACL,UAAU,EAAE,KAAK,CAAC,KAAK;QACvB,QAAQ;QACR,gBAAgB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,IAAI,IAAI;KAChD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { detectAt, installAt, uninstallAt } from './file-ops.js';
|
|
4
|
+
/**
|
|
5
|
+
* GitHub Copilot CLI keeps its config under `~/.copilot/` (overridable via
|
|
6
|
+
* COPILOT_HOME, same env var the rest of our Copilot integration honours).
|
|
7
|
+
* AGENTS.md alongside `mcp-config.json` is the convention recent versions
|
|
8
|
+
* pick up; older releases ignore the file, in which case the block sits
|
|
9
|
+
* there harmlessly until they catch up.
|
|
10
|
+
*/
|
|
11
|
+
function file() {
|
|
12
|
+
const root = process.env.COPILOT_HOME ?? join(homedir(), '.copilot');
|
|
13
|
+
return join(root, 'AGENTS.md');
|
|
14
|
+
}
|
|
15
|
+
export const copilotInstructionsInstaller = {
|
|
16
|
+
id: 'copilot',
|
|
17
|
+
displayName: 'GitHub Copilot CLI',
|
|
18
|
+
filePath() {
|
|
19
|
+
return file();
|
|
20
|
+
},
|
|
21
|
+
detect() {
|
|
22
|
+
return detectAt(file());
|
|
23
|
+
},
|
|
24
|
+
install() {
|
|
25
|
+
return installAt(file(), 'GitHub Copilot CLI');
|
|
26
|
+
},
|
|
27
|
+
uninstall() {
|
|
28
|
+
return uninstallAt(file(), 'GitHub Copilot CLI');
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=copilot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../src/agent-instructions/copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjE;;;;;;GAMG;AACH,SAAS,IAAI;IACX,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,UAAU,CAAC,CAAC;IACrE,OAAO,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,4BAA4B,GAA0B;IACjE,EAAE,EAAE,SAAS;IACb,WAAW,EAAE,oBAAoB;IAEjC,QAAQ;QACN,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO;QACL,OAAO,SAAS,CAAC,IAAI,EAAE,EAAE,oBAAoB,CAAC,CAAC;IACjD,CAAC;IAED,SAAS;QACP,OAAO,WAAW,CAAC,IAAI,EAAE,EAAE,oBAAoB,CAAC,CAAC;IACnD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InstructionsDetect } from './types.js';
|
|
2
|
+
export declare function detectAt(filePath: string): InstructionsDetect;
|
|
3
|
+
/**
|
|
4
|
+
* Insert or refresh the block in `filePath`. Returns a one-line description
|
|
5
|
+
* of what changed, suitable for surfacing to the user.
|
|
6
|
+
*/
|
|
7
|
+
export declare function installAt(filePath: string, displayName: string): string;
|
|
8
|
+
export declare function uninstallAt(filePath: string, displayName: string): string;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
import { VERSION } from '../version.js';
|
|
4
|
+
import { block, findBlockSpan } from './content.js';
|
|
5
|
+
/**
|
|
6
|
+
* Shared file-level operations for the three agent-instructions installers.
|
|
7
|
+
* Per-client modules only know which path their target file lives at; the
|
|
8
|
+
* marker handling and the text splice are the same everywhere.
|
|
9
|
+
*/
|
|
10
|
+
function compareSemver(a, b) {
|
|
11
|
+
const pa = a.split('.').map(Number);
|
|
12
|
+
const pb = b.split('.').map(Number);
|
|
13
|
+
for (let i = 0; i < 3; i++) {
|
|
14
|
+
const da = pa[i] ?? 0;
|
|
15
|
+
const db = pb[i] ?? 0;
|
|
16
|
+
if (da !== db)
|
|
17
|
+
return da - db;
|
|
18
|
+
}
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
21
|
+
export function detectAt(filePath) {
|
|
22
|
+
if (!existsSync(filePath)) {
|
|
23
|
+
return { filePath, state: { kind: 'no-file' } };
|
|
24
|
+
}
|
|
25
|
+
const text = readFileSync(filePath, 'utf8');
|
|
26
|
+
const span = findBlockSpan(text);
|
|
27
|
+
if (!span) {
|
|
28
|
+
return { filePath, state: { kind: 'not-installed' } };
|
|
29
|
+
}
|
|
30
|
+
const installedVersion = span.installedVersion ?? '0.0.0';
|
|
31
|
+
const cmp = compareSemver(installedVersion, VERSION);
|
|
32
|
+
return {
|
|
33
|
+
filePath,
|
|
34
|
+
state: cmp < 0
|
|
35
|
+
? { kind: 'installed-outdated', version: installedVersion }
|
|
36
|
+
: { kind: 'installed', version: installedVersion },
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Insert or refresh the block in `filePath`. Returns a one-line description
|
|
41
|
+
* of what changed, suitable for surfacing to the user.
|
|
42
|
+
*/
|
|
43
|
+
export function installAt(filePath, displayName) {
|
|
44
|
+
const fresh = block();
|
|
45
|
+
if (!existsSync(filePath)) {
|
|
46
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
47
|
+
writeFileSync(filePath, fresh, 'utf8');
|
|
48
|
+
return `Created ${filePath} and inserted the browser-link instructions block for ${displayName}.`;
|
|
49
|
+
}
|
|
50
|
+
const text = readFileSync(filePath, 'utf8');
|
|
51
|
+
const span = findBlockSpan(text);
|
|
52
|
+
if (!span) {
|
|
53
|
+
// Append. Ensure a blank line separator from prior content.
|
|
54
|
+
const separator = text.length === 0 || text.endsWith('\n\n') ? '' : text.endsWith('\n') ? '\n' : '\n\n';
|
|
55
|
+
writeFileSync(filePath, text + separator + fresh, 'utf8');
|
|
56
|
+
return `Appended the browser-link instructions block to ${filePath} (${displayName}).`;
|
|
57
|
+
}
|
|
58
|
+
const before = text.slice(0, span.startIndex);
|
|
59
|
+
const after = text.slice(span.endIndex);
|
|
60
|
+
writeFileSync(filePath, before + fresh + after, 'utf8');
|
|
61
|
+
const prev = span.installedVersion ?? 'unversioned';
|
|
62
|
+
return `Refreshed the browser-link instructions block in ${filePath} (${displayName}, was v${prev}).`;
|
|
63
|
+
}
|
|
64
|
+
export function uninstallAt(filePath, displayName) {
|
|
65
|
+
if (!existsSync(filePath)) {
|
|
66
|
+
return `No ${displayName} instructions file at ${filePath}; nothing to remove.`;
|
|
67
|
+
}
|
|
68
|
+
const text = readFileSync(filePath, 'utf8');
|
|
69
|
+
const span = findBlockSpan(text);
|
|
70
|
+
if (!span) {
|
|
71
|
+
return `browser-link instructions block was not present in ${filePath}; nothing to remove.`;
|
|
72
|
+
}
|
|
73
|
+
const before = text.slice(0, span.startIndex);
|
|
74
|
+
const after = text.slice(span.endIndex);
|
|
75
|
+
// Collapse double blank lines created by removing the block, but keep the
|
|
76
|
+
// user's own content. A single trailing newline at EOF is restored.
|
|
77
|
+
let next = (before + after).replace(/\n{3,}/g, '\n\n');
|
|
78
|
+
if (next.length > 0 && !next.endsWith('\n'))
|
|
79
|
+
next += '\n';
|
|
80
|
+
writeFileSync(filePath, next, 'utf8');
|
|
81
|
+
return `Removed the browser-link instructions block from ${filePath} (${displayName}).`;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=file-ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-ops.js","sourceRoot":"","sources":["../../src/agent-instructions/file-ops.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGpD;;;;GAIG;AAEH,SAAS,aAAa,CAAC,CAAS,EAAE,CAAS;IACzC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACtB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,EAAE,KAAK,E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AC5C,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,sDAAsD,QAAQ,sBAAsB,CAAC;IAC9F,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,0EAA0E;IAC1E,oEAAoE;IACpE,IAAI,IAAI,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACvD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,IAAI,IAAI,IAAI,CAAC;IAC1D,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,oDAAoD,QAAQ,KAAK,WAAW,IAAI,CAAC;AAC1F,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ClientId, InstructionsInstaller } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Order matches the MCP `INSTALLERS` array so the agent-instructions screen
|
|
4
|
+
* and the MCP installers screen list clients in the same sequence.
|
|
5
|
+
*/
|
|
6
|
+
export declare const INSTRUCTIONS_INSTALLERS: InstructionsInstaller[];
|
|
7
|
+
export declare function getInstructionsInstaller(id: ClientId): InstructionsInstaller;
|
|
8
|
+
export type { ClientId, InstructionsDetect, InstructionsInstaller, InstructionsState, } from './types.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { claudeInstructionsInstaller } from './claude.js';
|
|
2
|
+
import { copilotInstructionsInstaller } from './copilot.js';
|
|
3
|
+
import { opencodeInstructionsInstaller } from './opencode.js';
|
|
4
|
+
/**
|
|
5
|
+
* Order matches the MCP `INSTALLERS` array so the agent-instructions screen
|
|
6
|
+
* and the MCP installers screen list clients in the same sequence.
|
|
7
|
+
*/
|
|
8
|
+
export const INSTRUCTIONS_INSTALLERS = [
|
|
9
|
+
claudeInstructionsInstaller,
|
|
10
|
+
opencodeInstructionsInstaller,
|
|
11
|
+
copilotInstructionsInstaller,
|
|
12
|
+
];
|
|
13
|
+
export function getInstructionsInstaller(id) {
|
|
14
|
+
const found = INSTRUCTIONS_INSTALLERS.find((i) => i.id === id);
|
|
15
|
+
if (!found)
|
|
16
|
+
throw new Error(`Unknown or unsupported client: ${id}`);
|
|
17
|
+
return found;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent-instructions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAG9D;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA4B;IAC9D,2BAA2B;IAC3B,6BAA6B;IAC7B,4BAA4B;CAC7B,CAAC;AAEF,MAAM,UAAU,wBAAwB,CAAC,EAAY;IACnD,MAAM,KAAK,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/D,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,EAAE,EAAE,CAAC,CAAC;IACpE,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { detectAt, installAt, uninstallAt } from './file-ops.js';
|
|
4
|
+
/**
|
|
5
|
+
* OpenCode follows the AGENTS.md convention (https://agents.md). Global
|
|
6
|
+
* instructions live next to the MCP config at
|
|
7
|
+
* `~/.config/opencode/AGENTS.md` on every OS — same dir as `opencode.json`.
|
|
8
|
+
* Project-level AGENTS.md still applies in addition; the global file is
|
|
9
|
+
* the one we manage so the agent gets the trigger list everywhere.
|
|
10
|
+
*/
|
|
11
|
+
function file() {
|
|
12
|
+
return join(homedir(), '.config', 'opencode', 'AGENTS.md');
|
|
13
|
+
}
|
|
14
|
+
export const opencodeInstructionsInstaller = {
|
|
15
|
+
id: 'opencode',
|
|
16
|
+
displayName: 'OpenCode',
|
|
17
|
+
filePath() {
|
|
18
|
+
return file();
|
|
19
|
+
},
|
|
20
|
+
detect() {
|
|
21
|
+
return detectAt(file());
|
|
22
|
+
},
|
|
23
|
+
install() {
|
|
24
|
+
return installAt(file(), 'OpenCode');
|
|
25
|
+
},
|
|
26
|
+
uninstall() {
|
|
27
|
+
return uninstallAt(file(), 'OpenCode');
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=opencode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/agent-instructions/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjE;;;;;;GAMG;AACH,SAAS,IAAI;IACX,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAA0B;IAClE,EAAE,EAAE,UAAU;IACd,WAAW,EAAE,UAAU;IAEvB,QAAQ;QACN,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO;QACL,OAAO,SAAS,CAAC,IAAI,EAAE,EAAE,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,SAAS;QACP,OAAO,WAAW,CAAC,IAAI,EAAE,EAAE,UAAU,CAAC,CAAC;IACzC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ClientId } from '../installers/types.js';
|
|
2
|
+
/** Re-export so consumers can stick to one ClientId import. */
|
|
3
|
+
export type { ClientId };
|
|
4
|
+
/** Possible states of the instructions block in the client's markdown file. */
|
|
5
|
+
export type InstructionsState = {
|
|
6
|
+
kind: 'no-file';
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'not-installed';
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'installed';
|
|
11
|
+
version: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'installed-outdated';
|
|
14
|
+
version: string;
|
|
15
|
+
};
|
|
16
|
+
export interface InstructionsDetect {
|
|
17
|
+
/** Absolute path to the markdown file we manage. Returned even when it does not exist. */
|
|
18
|
+
filePath: string;
|
|
19
|
+
/** State of the block in that file. */
|
|
20
|
+
state: InstructionsState;
|
|
21
|
+
}
|
|
22
|
+
export interface InstructionsInstaller {
|
|
23
|
+
id: ClientId;
|
|
24
|
+
displayName: string;
|
|
25
|
+
/** Absolute path to the markdown file we manage for this client. */
|
|
26
|
+
filePath(): string;
|
|
27
|
+
/** Inspect the file and report the state of the browser-link block. */
|
|
28
|
+
detect(): InstructionsDetect;
|
|
29
|
+
/**
|
|
30
|
+
* Insert / refresh the browser-link block in the file. Idempotent: if the
|
|
31
|
+
* block is already present, the body is rewritten in place; the file is
|
|
32
|
+
* created if it does not exist. Returns a one-line description of what
|
|
33
|
+
* changed.
|
|
34
|
+
*/
|
|
35
|
+
install(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Remove the browser-link block from the file. Leaves every other line
|
|
38
|
+
* intact. Idempotent: a missing file or missing block is a no-op.
|
|
39
|
+
*/
|
|
40
|
+
uninstall(): string;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agent-instructions/types.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
CHANGED
|
@@ -8,6 +8,7 @@ import { checkUpdates, formatUpdate } from './commands/updates.js';
|
|
|
8
8
|
import { runToolsCommand } from './commands/tools.js';
|
|
9
9
|
import { runMultiAgentCommand } from './commands/multi-agent.js';
|
|
10
10
|
import { runFreePort } from './commands/free-port.js';
|
|
11
|
+
import { formatStatus as formatInstructionsStatus, installInstructionsAll, installInstructionsFor, statusAll as instructionsStatusAll, statusFor as instructionsStatusFor, uninstallInstructionsAll, uninstallInstructionsFor, } from './commands/instructions.js';
|
|
11
12
|
import { loadConfig } from './config.js';
|
|
12
13
|
import { VERSION } from './version.js';
|
|
13
14
|
function buildHelp(language) {
|
|
@@ -38,6 +39,15 @@ Uso:
|
|
|
38
39
|
browser-link multi-agent Estado del modo multi-agente y re-elección automática.
|
|
39
40
|
browser-link multi-agent enable | disable
|
|
40
41
|
browser-link multi-agent auto-reelect enable | disable
|
|
42
|
+
browser-link instructions Muestra si el bloque de instrucciones de browser-link
|
|
43
|
+
está presente en el .md global de cada cliente
|
|
44
|
+
(Claude, OpenCode, Copilot CLI).
|
|
45
|
+
browser-link instructions install
|
|
46
|
+
browser-link instructions install --client <claude|opencode|copilot>
|
|
47
|
+
Inserta o refresca el bloque en el .md global.
|
|
48
|
+
browser-link instructions uninstall
|
|
49
|
+
browser-link instructions uninstall --client <id>
|
|
50
|
+
Quita el bloque, deja el resto del archivo intacto.
|
|
41
51
|
browser-link stop Mata el proceso browser-link que esté ocupando el
|
|
42
52
|
puerto 17529 (útil si un cliente MCP quedó zombie).
|
|
43
53
|
browser-link about Muestra la explicación completa.
|
|
@@ -76,6 +86,16 @@ Usage:
|
|
|
76
86
|
browser-link multi-agent Show multi-agent mode + auto-reelect status.
|
|
77
87
|
browser-link multi-agent enable | disable
|
|
78
88
|
browser-link multi-agent auto-reelect enable | disable
|
|
89
|
+
browser-link instructions Show whether the browser-link instructions block
|
|
90
|
+
is present in each client's global .md file
|
|
91
|
+
(Claude, OpenCode, Copilot CLI).
|
|
92
|
+
browser-link instructions install
|
|
93
|
+
browser-link instructions install --client <claude|opencode|copilot>
|
|
94
|
+
Insert or refresh the block in the global .md file.
|
|
95
|
+
browser-link instructions uninstall
|
|
96
|
+
browser-link instructions uninstall --client <id>
|
|
97
|
+
Remove the block, leaving the rest of the file
|
|
98
|
+
intact.
|
|
79
99
|
browser-link stop Kill the browser-link process holding port 17529
|
|
80
100
|
(useful when an MCP client left a zombie behind).
|
|
81
101
|
browser-link about Show the full explanation of what this is and how it works.
|
|
@@ -97,6 +117,9 @@ const CLI_I18N = {
|
|
|
97
117
|
toolsRestart: 'Restart your MCP client so it picks up the change.',
|
|
98
118
|
unknownCommand: (cmd) => `Unknown command: ${cmd}`,
|
|
99
119
|
unknownClient: (val) => `Unknown --client value: ${val}. Use claude, opencode or copilot.`,
|
|
120
|
+
unknownInstructionsAction: (val) => `Unknown instructions action: ${val}. Use install, uninstall or no arg for status.`,
|
|
121
|
+
instructionsInstallNext: 'Restart your MCP client so it picks up the new instructions on its next session.',
|
|
122
|
+
instructionsUninstallDone: 'Block removed. The rest of each file was left untouched.',
|
|
100
123
|
},
|
|
101
124
|
es: {
|
|
102
125
|
help: '',
|
|
@@ -105,8 +128,18 @@ const CLI_I18N = {
|
|
|
105
128
|
toolsRestart: 'Reiniciá el cliente MCP para que tome el cambio.',
|
|
106
129
|
unknownCommand: (cmd) => `Comando desconocido: ${cmd}`,
|
|
107
130
|
unknownClient: (val) => `Valor de --client desconocido: ${val}. Usá claude, opencode o copilot.`,
|
|
131
|
+
unknownInstructionsAction: (val) => `Acción de instructions desconocida: ${val}. Usá install, uninstall, o ningún argumento para status.`,
|
|
132
|
+
instructionsInstallNext: 'Reiniciá tu cliente MCP para que tome las nuevas instrucciones en la próxima sesión.',
|
|
133
|
+
instructionsUninstallDone: 'Bloque eliminado. El resto del archivo quedó intacto.',
|
|
108
134
|
},
|
|
109
135
|
};
|
|
136
|
+
function printInstructionsReports(reports) {
|
|
137
|
+
for (const r of reports) {
|
|
138
|
+
const prefix = r.message ? '·' : ' ';
|
|
139
|
+
const msg = r.message ?? r.filePath;
|
|
140
|
+
console.log(`${prefix} ${r.displayName}: ${msg}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
110
143
|
function parseClient(argv, language) {
|
|
111
144
|
const idx = argv.findIndex((a) => a === '--client');
|
|
112
145
|
if (idx === -1 || idx === argv.length - 1)
|
|
@@ -190,6 +223,36 @@ async function dispatch(argv) {
|
|
|
190
223
|
console.log(runMultiAgentCommand(rest, language));
|
|
191
224
|
return;
|
|
192
225
|
}
|
|
226
|
+
case 'instructions': {
|
|
227
|
+
// `rest.at(0)` correctly types the missing-arg case as `undefined`
|
|
228
|
+
// (vs. `rest[0]: string` under the project's loose index access).
|
|
229
|
+
const action = rest.at(0);
|
|
230
|
+
if (action === undefined || action === 'status') {
|
|
231
|
+
const client = parseClient(rest, language);
|
|
232
|
+
const reports = client ? [instructionsStatusFor(client)] : instructionsStatusAll();
|
|
233
|
+
console.log(formatInstructionsStatus(reports, language));
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (action === 'install') {
|
|
237
|
+
const client = parseClient(rest, language);
|
|
238
|
+
const reports = client ? [installInstructionsFor(client)] : installInstructionsAll();
|
|
239
|
+
printInstructionsReports(reports);
|
|
240
|
+
console.log('');
|
|
241
|
+
console.log(t.instructionsInstallNext);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (action === 'uninstall') {
|
|
245
|
+
const client = parseClient(rest, language);
|
|
246
|
+
const reports = client ? [uninstallInstructionsFor(client)] : uninstallInstructionsAll();
|
|
247
|
+
printInstructionsReports(reports);
|
|
248
|
+
console.log('');
|
|
249
|
+
console.log(t.instructionsUninstallDone);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
console.error(t.unknownInstructionsAction(action));
|
|
253
|
+
process.exit(2);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
193
256
|
case 'stop': {
|
|
194
257
|
const result = runFreePort(language);
|
|
195
258
|
console.log(result.message);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAA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C,GAAG,CAAC,OAAO,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;YACrC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAClB,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;YACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,4EAA4E;AAC5E,4DAA4D;AAC5D,kFAAkF;AAClF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACrE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;IAClD,MAAM,OAAO,EAAE,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACpC,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Language } from './welcome.js';
|
|
2
|
+
import { type InstructionsState } from '../agent-instructions/index.js';
|
|
2
3
|
export interface DoctorReport {
|
|
3
4
|
ws: {
|
|
4
5
|
listening: boolean;
|
|
@@ -22,6 +23,10 @@ export interface DoctorReport {
|
|
|
22
23
|
installed: boolean;
|
|
23
24
|
registered: boolean;
|
|
24
25
|
configPath: string;
|
|
26
|
+
instructions: {
|
|
27
|
+
state: InstructionsState;
|
|
28
|
+
filePath: string;
|
|
29
|
+
};
|
|
25
30
|
}[];
|
|
26
31
|
extension: {
|
|
27
32
|
path: string | null;
|
package/dist/commands/doctor.js
CHANGED
|
@@ -7,6 +7,7 @@ import { listApps } from '../map/queries.js';
|
|
|
7
7
|
import { resolveExtensionPath } from './extension.js';
|
|
8
8
|
import { loadConfig } from '../config.js';
|
|
9
9
|
import { IPC_HOST, IPC_PORT } from '../bridge/protocol.js';
|
|
10
|
+
import { getInstructionsInstaller } from '../agent-instructions/index.js';
|
|
10
11
|
const WS_HOST = '127.0.0.1';
|
|
11
12
|
const WS_PORT = 17529;
|
|
12
13
|
function checkPort(host, port, timeoutMs = 500) {
|
|
@@ -38,7 +39,13 @@ export async function runDoctor() {
|
|
|
38
39
|
const ipc = await checkPort(IPC_HOST, IPC_PORT);
|
|
39
40
|
const clients = INSTALLERS.map((i) => {
|
|
40
41
|
const d = i.detect();
|
|
41
|
-
|
|
42
|
+
const instructions = getInstructionsInstaller(i.id).detect();
|
|
43
|
+
return {
|
|
44
|
+
id: i.id,
|
|
45
|
+
displayName: i.displayName,
|
|
46
|
+
...d,
|
|
47
|
+
instructions: { state: instructions.state, filePath: instructions.filePath },
|
|
48
|
+
};
|
|
42
49
|
});
|
|
43
50
|
const extPath = resolveExtensionPath();
|
|
44
51
|
const dbPath = getDbPath();
|
|
@@ -77,6 +84,11 @@ const DOCTOR_I18N = {
|
|
|
77
84
|
clientRegistered: '✓ registered',
|
|
78
85
|
clientNotRegistered: '⚠ installed but not registered',
|
|
79
86
|
clientConfig: 'config:',
|
|
87
|
+
clientInstructions: 'instructions:',
|
|
88
|
+
instructionsInstalled: (v) => `✓ installed (v${v})`,
|
|
89
|
+
instructionsOutdated: (v) => `⚠ outdated (v${v})`,
|
|
90
|
+
instructionsNotInstalled: '· not installed',
|
|
91
|
+
instructionsNoFile: '· file not present',
|
|
80
92
|
extensionHeader: 'Chrome extension assets:',
|
|
81
93
|
extensionNotFound: 'not found (run `browser-link extension` for guidance)',
|
|
82
94
|
mapHeader: 'Map DB:',
|
|
@@ -105,6 +117,11 @@ const DOCTOR_I18N = {
|
|
|
105
117
|
clientRegistered: '✓ registrado',
|
|
106
118
|
clientNotRegistered: '⚠ instalado pero no registrado',
|
|
107
119
|
clientConfig: 'config:',
|
|
120
|
+
clientInstructions: 'instrucciones:',
|
|
121
|
+
instructionsInstalled: (v) => `✓ instaladas (v${v})`,
|
|
122
|
+
instructionsOutdated: (v) => `⚠ desactualizadas (v${v})`,
|
|
123
|
+
instructionsNotInstalled: '· no instaladas',
|
|
124
|
+
instructionsNoFile: '· sin archivo',
|
|
108
125
|
extensionHeader: 'Assets de la extensión de Chrome:',
|
|
109
126
|
extensionNotFound: 'no encontrada (corré `browser-link extension` para la guía)',
|
|
110
127
|
mapHeader: 'Base de datos del mapa:',
|
|
@@ -144,6 +161,23 @@ export function formatDoctor(r, language = 'en') {
|
|
|
144
161
|
: t.clientNotRegistered;
|
|
145
162
|
lines.push(` ${c.displayName.padEnd(20)} ${status}`);
|
|
146
163
|
lines.push(` ${' '.repeat(20)} ${t.clientConfig} ${c.configPath}`);
|
|
164
|
+
const instr = c.instructions.state;
|
|
165
|
+
let instrLabel;
|
|
166
|
+
switch (instr.kind) {
|
|
167
|
+
case 'installed':
|
|
168
|
+
instrLabel = t.instructionsInstalled(instr.version);
|
|
169
|
+
break;
|
|
170
|
+
case 'installed-outdated':
|
|
171
|
+
instrLabel = t.instructionsOutdated(instr.version);
|
|
172
|
+
break;
|
|
173
|
+
case 'not-installed':
|
|
174
|
+
instrLabel = t.instructionsNotInstalled;
|
|
175
|
+
break;
|
|
176
|
+
case 'no-file':
|
|
177
|
+
instrLabel = t.instructionsNoFile;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
lines.push(` ${' '.repeat(20)} ${t.clientInstructions} ${instrLabel} (${c.instructions.filePath})`);
|
|
147
181
|
}
|
|
148
182
|
lines.push('');
|
|
149
183
|
lines.push(t.extensionHeader);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OA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AC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAClH,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC/B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,cAAc,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACxE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACzE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1E,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ClientId, type InstructionsState } from '../agent-instructions/index.js';
|
|
2
|
+
import type { Language } from './welcome.js';
|
|
3
|
+
/**
|
|
4
|
+
* Public API for the `browser-link instructions` subcommand and the
|
|
5
|
+
* matching Ink screen. Mirrors the shape of `commands/install.ts` so the UI
|
|
6
|
+
* and CLI layers can swap them interchangeably.
|
|
7
|
+
*/
|
|
8
|
+
export interface InstructionsReport {
|
|
9
|
+
client: ClientId;
|
|
10
|
+
displayName: string;
|
|
11
|
+
filePath: string;
|
|
12
|
+
state: InstructionsState;
|
|
13
|
+
/** Set after install/uninstall — the one-line description of what changed. */
|
|
14
|
+
message?: string;
|
|
15
|
+
ok: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function statusFor(client: ClientId): InstructionsReport;
|
|
18
|
+
export declare function statusAll(): InstructionsReport[];
|
|
19
|
+
export declare function installInstructionsFor(client: ClientId): InstructionsReport;
|
|
20
|
+
export declare function installInstructionsAll(): InstructionsReport[];
|
|
21
|
+
export declare function uninstallInstructionsFor(client: ClientId): InstructionsReport;
|
|
22
|
+
export declare function uninstallInstructionsAll(): InstructionsReport[];
|
|
23
|
+
/** Render the status of a single report as a one-line label. */
|
|
24
|
+
export declare function describeState(state: InstructionsState, language?: Language): string;
|
|
25
|
+
/** Format a list of reports as the body of `browser-link instructions`
|
|
26
|
+
* (status). Used by the CLI; the UI consumes the raw report shape. */
|
|
27
|
+
export declare function formatStatus(reports: InstructionsReport[], language?: Language): string;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { INSTRUCTIONS_INSTALLERS, getInstructionsInstaller, } from '../agent-instructions/index.js';
|
|
2
|
+
function stateOnly(client) {
|
|
3
|
+
const inst = getInstructionsInstaller(client);
|
|
4
|
+
const d = inst.detect();
|
|
5
|
+
return {
|
|
6
|
+
client,
|
|
7
|
+
displayName: inst.displayName,
|
|
8
|
+
filePath: d.filePath,
|
|
9
|
+
state: d.state,
|
|
10
|
+
ok: true,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export function statusFor(client) {
|
|
14
|
+
return stateOnly(client);
|
|
15
|
+
}
|
|
16
|
+
export function statusAll() {
|
|
17
|
+
return INSTRUCTIONS_INSTALLERS.map((i) => stateOnly(i.id));
|
|
18
|
+
}
|
|
19
|
+
export function installInstructionsFor(client) {
|
|
20
|
+
const inst = getInstructionsInstaller(client);
|
|
21
|
+
const message = inst.install();
|
|
22
|
+
const d = inst.detect();
|
|
23
|
+
return {
|
|
24
|
+
client,
|
|
25
|
+
displayName: inst.displayName,
|
|
26
|
+
filePath: d.filePath,
|
|
27
|
+
state: d.state,
|
|
28
|
+
message,
|
|
29
|
+
ok: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function installInstructionsAll() {
|
|
33
|
+
return INSTRUCTIONS_INSTALLERS.map((i) => installInstructionsFor(i.id));
|
|
34
|
+
}
|
|
35
|
+
export function uninstallInstructionsFor(client) {
|
|
36
|
+
const inst = getInstructionsInstaller(client);
|
|
37
|
+
const message = inst.uninstall();
|
|
38
|
+
const d = inst.detect();
|
|
39
|
+
return {
|
|
40
|
+
client,
|
|
41
|
+
displayName: inst.displayName,
|
|
42
|
+
filePath: d.filePath,
|
|
43
|
+
state: d.state,
|
|
44
|
+
message,
|
|
45
|
+
ok: true,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function uninstallInstructionsAll() {
|
|
49
|
+
return INSTRUCTIONS_INSTALLERS.map((i) => uninstallInstructionsFor(i.id));
|
|
50
|
+
}
|
|
51
|
+
const I18N = {
|
|
52
|
+
en: {
|
|
53
|
+
header: 'Agent instructions — browser-link awareness in global agent .md files',
|
|
54
|
+
installed: (v) => `✓ installed (v${v})`,
|
|
55
|
+
installedOutdated: (v) => `⚠ installed but outdated (v${v}) — run \`browser-link instructions install\` to refresh.`,
|
|
56
|
+
notInstalled: '· not installed (file exists, no browser-link block)',
|
|
57
|
+
noFile: '· file does not exist yet (will be created on install)',
|
|
58
|
+
filePath: ' file:',
|
|
59
|
+
},
|
|
60
|
+
es: {
|
|
61
|
+
header: 'Instrucciones del agente — browser-link en los .md globales de cada cliente',
|
|
62
|
+
installed: (v) => `✓ instalado (v${v})`,
|
|
63
|
+
installedOutdated: (v) => `⚠ instalado pero desactualizado (v${v}) — corré \`browser-link instructions install\` para refrescar.`,
|
|
64
|
+
notInstalled: '· no instalado (el archivo existe, sin bloque de browser-link)',
|
|
65
|
+
noFile: '· el archivo aún no existe (se va a crear al instalar)',
|
|
66
|
+
filePath: ' archivo:',
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
/** Render the status of a single report as a one-line label. */
|
|
70
|
+
export function describeState(state, language = 'en') {
|
|
71
|
+
const t = I18N[language];
|
|
72
|
+
switch (state.kind) {
|
|
73
|
+
case 'installed':
|
|
74
|
+
return t.installed(state.version);
|
|
75
|
+
case 'installed-outdated':
|
|
76
|
+
return t.installedOutdated(state.version);
|
|
77
|
+
case 'not-installed':
|
|
78
|
+
return t.notInstalled;
|
|
79
|
+
case 'no-file':
|
|
80
|
+
return t.noFile;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** Format a list of reports as the body of `browser-link instructions`
|
|
84
|
+
* (status). Used by the CLI; the UI consumes the raw report shape. */
|
|
85
|
+
export function formatStatus(reports, language = 'en') {
|
|
86
|
+
const t = I18N[language];
|
|
87
|
+
const lines = [t.header, ''];
|
|
88
|
+
for (const r of reports) {
|
|
89
|
+
lines.push(` ${r.displayName.padEnd(22)} ${describeState(r.state, language)}`);
|
|
90
|
+
lines.push(`${t.filePath} ${r.filePath}`);
|
|
91
|
+
}
|
|
92
|
+
return lines.join('\n');
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/commands/instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GAGzB,MAAM,gCAAgC,CAAC;AAmBxC,SAAS,SAAS,CAAC,MAAgB;IACjC,MAAM,IAAI,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IACxB,OAAO;QACL,MAAM;QACN,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,EAAE,EAAE,IAAI;KACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAAgB;IACxC,OAAO,SAAS,CAAC,MAAM,CAA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AAM,KAAK,GAAa,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QAChF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -57,7 +57,13 @@ export function restartHint(language = 'en') {
|
|
|
57
57
|
export async function runSelfUpdate(target, language = 'en', onProgress, opts = {}) {
|
|
58
58
|
const t = I18N[language];
|
|
59
59
|
const pkgName = opts.packageName ?? PACKAGE_NAME;
|
|
60
|
-
|
|
60
|
+
// Node's `spawn` does not resolve `.cmd` / `.bat` shims on Windows unless
|
|
61
|
+
// it goes through cmd.exe (shell: true) or you pass the explicit filename.
|
|
62
|
+
// `npm` on Windows is `npm.cmd`, so a bare `spawn('npm', …)` throws
|
|
63
|
+
// ENOENT — the exact error the in-app updater was reporting before this
|
|
64
|
+
// fix. We pick the right name per platform instead of opting into
|
|
65
|
+
// shell:true, which adds an argument-quoting surface we don't need.
|
|
66
|
+
const npmBin = opts.npmBin ?? (process.platform === 'win32' ? 'npm.cmd' : 'npm');
|
|
61
67
|
const doSpawn = opts.spawnImpl ?? spawn;
|
|
62
68
|
const emit = (stage, message) => {
|
|
63
69
|
if (onProgress)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self-update.js","sourceRoot":"","sources":["../../src/commands/self-update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,o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C,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACxB,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACzB,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,QAAQ,GACZ,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,IAAI,aAAa,aAAa,CAAC,IAAI,EAAE,CAAC;QACrF,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACxB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;IACtE,CAAC;IAED,MAAM,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACxB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAClD,CAAC"}
|
package/dist/ui/app.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useApp, useInput } from 'ink';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { AboutView, ClientPicker, DoctorView, ExtensionView, FreePortView, InstallResultView, LanguageView, MainMenu, MultiAgentView, PermissionsView, UpdatesView, WelcomeScreen, } from './screens/index.js';
|
|
4
|
+
import { AboutView, AgentInstructionsView, ClientPicker, DoctorView, ExtensionView, FreePortView, InstallResultView, LanguageView, MainMenu, MultiAgentView, PermissionsView, UpdatesView, WelcomeScreen, } from './screens/index.js';
|
|
5
5
|
import { saveConfig } from '../config.js';
|
|
6
6
|
import { installFor } from '../commands/install.js';
|
|
7
7
|
import { openUrl } from '../utils/open-url.js';
|
|
@@ -34,6 +34,8 @@ export function App({ initialLanguage, skipWelcome }) {
|
|
|
34
34
|
return (_jsx(MainMenu, { language: language, onSelect: (action) => {
|
|
35
35
|
if (action === 'register')
|
|
36
36
|
setScreen({ kind: 'pick-client' });
|
|
37
|
+
else if (action === 'instructions')
|
|
38
|
+
setScreen({ kind: 'agent-instructions' });
|
|
37
39
|
else if (action === 'permissions')
|
|
38
40
|
setScreen({ kind: 'permissions' });
|
|
39
41
|
else if (action === 'multiAgent')
|
|
@@ -82,6 +84,8 @@ export function App({ initialLanguage, skipWelcome }) {
|
|
|
82
84
|
}, onBack: backToMenu }));
|
|
83
85
|
case 'about':
|
|
84
86
|
return _jsx(AboutView, { language: language, onBack: backToMenu });
|
|
87
|
+
case 'agent-instructions':
|
|
88
|
+
return _jsx(AgentInstructionsView, { language: language, onBack: backToMenu });
|
|
85
89
|
}
|
|
86
90
|
}
|
|
87
91
|
//# sourceMappingURL=app.js.map
|
package/dist/ui/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/ui/app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EACL,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,eAAe,EACf,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K,oBAAoB;YACvB,OAAO,KAAC,qBAAqB,IAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAI,CAAC;IAC7E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CommonProps } from './types.js';
|
|
2
|
+
interface AgentInstructionsViewProps extends CommonProps {
|
|
3
|
+
onBack: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function AgentInstructionsView({ language, onBack }: AgentInstructionsViewProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from 'ink';
|
|
3
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
4
|
+
import { Frame } from '../components.js';
|
|
5
|
+
import { INSTRUCTIONS_INSTALLERS, } from '../../agent-instructions/index.js';
|
|
6
|
+
import { describeState, installInstructionsFor, statusAll, uninstallInstructionsFor, } from '../../commands/instructions.js';
|
|
7
|
+
const I18N = {
|
|
8
|
+
en: {
|
|
9
|
+
title: 'Agent instructions — browser-link awareness in global agent .md files',
|
|
10
|
+
intro: [
|
|
11
|
+
"Inserts a fenced block into each agent's global .md (Claude, OpenCode,",
|
|
12
|
+
'Copilot CLI) so the agent reaches for browser.* tools reflexively — no',
|
|
13
|
+
'project CLAUDE.md required. The block lists triggers ("user reports a UI',
|
|
14
|
+
'bug → call browser.snapshot first") and is rewritten in place on update.',
|
|
15
|
+
].join('\n'),
|
|
16
|
+
installPrompt: 'Pick a client to install / refresh the block. Press u to uninstall.',
|
|
17
|
+
installed: '✓ installed',
|
|
18
|
+
outdated: '⚠ outdated',
|
|
19
|
+
notInstalled: '· not installed',
|
|
20
|
+
noFile: '· no file yet',
|
|
21
|
+
footer: '↑↓ navigate · ↵ install/refresh · u uninstall · Esc back',
|
|
22
|
+
doneInstall: '✓ Done. Restart your MCP client to pick up the new instructions.',
|
|
23
|
+
doneUninstall: '✓ Removed. The rest of the file was left untouched.',
|
|
24
|
+
refreshHint: 'On install: the block is refreshed in place if it already exists.',
|
|
25
|
+
},
|
|
26
|
+
es: {
|
|
27
|
+
title: 'Instrucciones del agente — browser-link en los .md globales de cada cliente',
|
|
28
|
+
intro: [
|
|
29
|
+
'Mete un bloque fenced en el .md global de cada agente (Claude, OpenCode,',
|
|
30
|
+
'Copilot CLI) para que el agente alcance reflejamente las tools browser.* —',
|
|
31
|
+
'sin necesidad de un CLAUDE.md por proyecto. El bloque lista triggers',
|
|
32
|
+
'("el usuario reporta un bug de UI → llamá a browser.snapshot primero") y',
|
|
33
|
+
'se rescribe in place al actualizar.',
|
|
34
|
+
].join('\n'),
|
|
35
|
+
installPrompt: 'Elegí un cliente para instalar / refrescar el bloque. Apretá u para desinstalar.',
|
|
36
|
+
installed: '✓ instalado',
|
|
37
|
+
outdated: '⚠ desactualizado',
|
|
38
|
+
notInstalled: '· no instalado',
|
|
39
|
+
noFile: '· sin archivo todavía',
|
|
40
|
+
footer: '↑↓ moverse · ↵ instalar/refrescar · u desinstalar · Esc volver',
|
|
41
|
+
doneInstall: '✓ Listo. Reiniciá tu cliente MCP para tomar las nuevas instrucciones.',
|
|
42
|
+
doneUninstall: '✓ Quitado. El resto del archivo quedó intacto.',
|
|
43
|
+
refreshHint: 'En instalar: si el bloque ya existe, se reescribe en su lugar.',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
function statusBadge(state, t) {
|
|
47
|
+
switch (state.kind) {
|
|
48
|
+
case 'installed':
|
|
49
|
+
return { label: `${t.installed} (v${state.version})`, color: 'green' };
|
|
50
|
+
case 'installed-outdated':
|
|
51
|
+
return { label: `${t.outdated} (v${state.version})`, color: 'yellow' };
|
|
52
|
+
case 'not-installed':
|
|
53
|
+
return { label: t.notInstalled, color: 'gray' };
|
|
54
|
+
case 'no-file':
|
|
55
|
+
return { label: t.noFile, color: 'gray' };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export function AgentInstructionsView({ language, onBack }) {
|
|
59
|
+
const t = I18N[language];
|
|
60
|
+
const [reports, setReports] = useState(() => statusAll());
|
|
61
|
+
const [cursor, setCursor] = useState(0);
|
|
62
|
+
const [lastAction, setLastAction] = useState(null);
|
|
63
|
+
// Refresh status when we come back from an install/uninstall round-trip.
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (lastAction)
|
|
66
|
+
setReports(statusAll());
|
|
67
|
+
}, [lastAction]);
|
|
68
|
+
const items = useMemo(() => INSTRUCTIONS_INSTALLERS, []);
|
|
69
|
+
const runAction = (client, action) => {
|
|
70
|
+
const report = action === 'install' ? installInstructionsFor(client) : uninstallInstructionsFor(client);
|
|
71
|
+
setLastAction({ kind: action, report });
|
|
72
|
+
};
|
|
73
|
+
useInput((input, key) => {
|
|
74
|
+
if (key.upArrow)
|
|
75
|
+
setCursor((i) => (i - 1 + items.length) % items.length);
|
|
76
|
+
else if (key.downArrow)
|
|
77
|
+
setCursor((i) => (i + 1) % items.length);
|
|
78
|
+
else if (key.return)
|
|
79
|
+
runAction(items[cursor].id, 'install');
|
|
80
|
+
else if (input === 'u' || input === 'U')
|
|
81
|
+
runAction(items[cursor].id, 'uninstall');
|
|
82
|
+
else if (key.escape || input === 'q')
|
|
83
|
+
onBack();
|
|
84
|
+
});
|
|
85
|
+
return (_jsxs(Frame, { title: t.title, footer: t.footer, children: [_jsx(Box, { flexDirection: "column", marginBottom: 1, children: _jsx(Text, { children: t.intro }) }), _jsx(Text, { color: "white", bold: true, children: t.installPrompt }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: items.map((inst, i) => {
|
|
86
|
+
const r = reports[i];
|
|
87
|
+
const badge = statusBadge(r.state, t);
|
|
88
|
+
const isCursor = i === cursor;
|
|
89
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: isCursor ? 'cyan' : 'gray', children: isCursor ? '❯ ' : ' ' }), _jsx(Text, { color: isCursor ? 'white' : 'gray', bold: isCursor, children: inst.displayName.padEnd(22) }), _jsx(Text, { color: badge.color, children: badge.label })] }), _jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "gray", dimColor: true, children: r.filePath }) })] }, inst.id));
|
|
90
|
+
}) }), lastAction && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: "green", children: lastAction.kind === 'install' ? t.doneInstall : t.doneUninstall }), lastAction.report.message && (_jsx(Text, { color: "gray", dimColor: true, children: lastAction.report.message }))] })), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "gray", italic: true, dimColor: true, children: [t.refreshHint, " ", describeState(reports[cursor]?.state ?? { kind: 'no-file' }, language)] }) })] }));
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=agent-instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-instructions.js","sourceRoot":"","sources":["../../../src/ui/screens/agent-instructions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EACL,uBAAuB,GAGxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,SAAS,EACT,wBAAwB,GAEzB,MAAM,gCAAgC,CAAC;AAiBxC,MAAM,IAAI,GAA4C;IACpD,EAAE,EAAE;QACF,KAAK,EAAE,uEAAuE;QAC9E,KAAK,EAAE;YACL,wEAAwE;YACxE,wEAAwE;YACxE,0EAA0E;YAC1E,0EAA0E;SAC3E,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,aAAa,EAAE,qEAAqE;QACpF,SAAS,EAAE,aAAa;QACxB,QAAQ,EAAE,YAAY;QACt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|
11
11
|
export { MultiAgentView } from './multi-agent.js';
|
|
12
12
|
export { FreePortView } from './free-port.js';
|
|
13
|
+
export { AgentInstructionsView } from './agent-instructions.js';
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/screens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAmB,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/screens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAmB,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonProps } from './types.js';
|
|
2
|
-
export type MenuAction = 'register' | 'permissions' | 'multiAgent' | 'extension' | 'doctor' | 'updates' | 'freePort' | 'language' | 'welcome' | 'about' | 'repo' | 'quit';
|
|
2
|
+
export type MenuAction = 'register' | 'instructions' | 'permissions' | 'multiAgent' | 'extension' | 'doctor' | 'updates' | 'freePort' | 'language' | 'welcome' | 'about' | 'repo' | 'quit';
|
|
3
3
|
interface MainMenuProps extends CommonProps {
|
|
4
4
|
onSelect: (action: MenuAction) => void;
|
|
5
5
|
onSwapLang: () => void;
|
package/dist/ui/screens/menu.js
CHANGED
|
@@ -9,6 +9,7 @@ const MENU_I18N = {
|
|
|
9
9
|
footer: '↑↓ navigate · ↵ select · l language · q quit',
|
|
10
10
|
options: {
|
|
11
11
|
register: 'Register browser-link with an MCP client',
|
|
12
|
+
instructions: 'Agent instructions — drop a trigger block into Claude/OpenCode/Copilot global .md',
|
|
12
13
|
permissions: 'Permissions — pick which MCP tools to expose',
|
|
13
14
|
multiAgent: 'Multi-agent — let multiple MCP clients share one bridge',
|
|
14
15
|
extension: 'Show Chrome extension install steps',
|
|
@@ -28,6 +29,7 @@ const MENU_I18N = {
|
|
|
28
29
|
footer: '↑↓ moverse · ↵ elegir · l idioma · q salir',
|
|
29
30
|
options: {
|
|
30
31
|
register: 'Registrar browser-link en un cliente MCP',
|
|
32
|
+
instructions: 'Instrucciones del agente — meter un bloque de triggers en el .md global de Claude/OpenCode/Copilot',
|
|
31
33
|
permissions: 'Permisos — elegí qué tools del MCP se exponen',
|
|
32
34
|
multiAgent: 'Multi-agente — varios clientes MCP comparten el mismo puente',
|
|
33
35
|
extension: 'Ver pasos para instalar la extensión de Chrome',
|
|
@@ -46,6 +48,7 @@ export function MainMenu({ language, onSelect, onSwapLang, onQuit }) {
|
|
|
46
48
|
const t = MENU_I18N[language];
|
|
47
49
|
const items = [
|
|
48
50
|
'register',
|
|
51
|
+
'instructions',
|
|
49
52
|
'permissions',
|
|
50
53
|
'multiAgent',
|
|
51
54
|
'extension',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../../src/ui/screens/menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAiB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../../src/ui/screens/menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAiB,MAAM,kBAAkB,CAAC;AA0B9D,MAAM,SAAS,GAA+B;IAC5C,EAAE,EAAE;QACF,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,gBAAgB;QACxB,MAAM,EAAE,8CAA8C;QACtD,OAAO,EAAE;YACP,QAAQ,EAAE,0CAA0C;YACpD,YAAY,EACV,mFAAmF;YACrF,WAAW,EAAE,8CAA8C;YAC3D,UAAU,EAAE,yDAAyD;YACrE,SAA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|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "MCP server that bridges Claude Code, OpenCode, GitHub Copilot CLI and other MCP clients to a Chrome tab. Per-tool permissions, multi-agent mode (multiple MCP clients sharing one bridge), persistent UI map across sessions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"@types/react": "^19.2.0",
|
|
69
69
|
"@types/ws": "^8.5.13",
|
|
70
70
|
"@vitest/coverage-v8": "^4.1.6",
|
|
71
|
+
"ink-testing-library": "^4.0.0",
|
|
71
72
|
"tsx": "^4.19.0",
|
|
72
73
|
"typescript": "^6.0.3",
|
|
73
74
|
"vitest": "^4.1.6"
|