@jobshimo/browser-link 0.8.0 → 0.8.1
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/content.d.ts +15 -2
- package/dist/agent-instructions/content.js +29 -4
- package/dist/agent-instructions/content.js.map +1 -1
- package/dist/agent-instructions/errors.d.ts +25 -0
- package/dist/agent-instructions/errors.js +39 -0
- package/dist/agent-instructions/errors.js.map +1 -0
- package/dist/agent-instructions/file-ops.js +103 -15
- package/dist/agent-instructions/file-ops.js.map +1 -1
- package/dist/agent-instructions/index.d.ts +1 -0
- package/dist/agent-instructions/index.js +1 -0
- package/dist/agent-instructions/index.js.map +1 -1
- package/dist/agent-instructions/types.d.ts +5 -2
- package/dist/commands/doctor.js +9 -4
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/instructions.d.ts +2 -1
- package/dist/commands/instructions.js +42 -26
- package/dist/commands/instructions.js.map +1 -1
- package/dist/extension/manifest.json +1 -1
- package/dist/ui/screens/agent-instructions.js +20 -4
- package/dist/ui/screens/agent-instructions.js.map +1 -1
- package/package.json +1 -1
|
@@ -21,8 +21,21 @@ export declare const BEGIN_RE: RegExp;
|
|
|
21
21
|
export declare const END_RE: RegExp;
|
|
22
22
|
/** Full fenced block to write into the file, including a trailing newline.
|
|
23
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
|
-
|
|
24
|
+
* the file knows it is auto-generated and how to refresh it.
|
|
25
|
+
*
|
|
26
|
+
* `eol` controls the line separator. Default is LF; pass CRLF to match a
|
|
27
|
+
* Windows-edited file's dominant line ending. The body() helper composes
|
|
28
|
+
* its own lines with `\n`; we replace them when joining so the produced
|
|
29
|
+
* block is uniformly LF or CRLF — never mixed. */
|
|
30
|
+
export declare function block(version?: string, eol?: '\n' | '\r\n'): string;
|
|
31
|
+
/** Count occurrences of the BEGIN marker in `text`. The base BEGIN_RE has
|
|
32
|
+
* no `g` flag (it's used for single-span detection); this helper compiles
|
|
33
|
+
* the same pattern with `g` so duplicates can be diagnosed. */
|
|
34
|
+
export declare function countBeginMarkers(text: string): number;
|
|
35
|
+
/** Pick the dominant line ending of `text`. CRLF wins only when it is the
|
|
36
|
+
* majority of newline sequences; otherwise LF. Used by installAt to keep
|
|
37
|
+
* Windows-edited files from acquiring a mixed-EOL block. */
|
|
38
|
+
export declare function detectEol(text: string): '\n' | '\r\n';
|
|
26
39
|
/** Locate the block boundaries in the given file text. Returns null when
|
|
27
40
|
* either marker is missing. Used by detect/install/uninstall to act on the
|
|
28
41
|
* exact span the installer owns. */
|
|
@@ -60,9 +60,14 @@ function body() {
|
|
|
60
60
|
}
|
|
61
61
|
/** Full fenced block to write into the file, including a trailing newline.
|
|
62
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
|
-
|
|
65
|
-
|
|
63
|
+
* the file knows it is auto-generated and how to refresh it.
|
|
64
|
+
*
|
|
65
|
+
* `eol` controls the line separator. Default is LF; pass CRLF to match a
|
|
66
|
+
* Windows-edited file's dominant line ending. The body() helper composes
|
|
67
|
+
* its own lines with `\n`; we replace them when joining so the produced
|
|
68
|
+
* block is uniformly LF or CRLF — never mixed. */
|
|
69
|
+
export function block(version = VERSION, eol = '\n') {
|
|
70
|
+
const parts = [
|
|
66
71
|
beginMarker(version),
|
|
67
72
|
`<!-- managed-by: browser-link v${version}; do not edit between markers; run \`browser-link instructions install\` to refresh. -->`,
|
|
68
73
|
'',
|
|
@@ -70,7 +75,27 @@ export function block(version = VERSION) {
|
|
|
70
75
|
'',
|
|
71
76
|
END_MARKER,
|
|
72
77
|
'',
|
|
73
|
-
]
|
|
78
|
+
];
|
|
79
|
+
if (eol === '\n')
|
|
80
|
+
return parts.join('\n');
|
|
81
|
+
// body() returned a multi-line string joined with \n; flip each \n to \r\n.
|
|
82
|
+
return parts.map((p) => p.replace(/\n/g, '\r\n')).join('\r\n');
|
|
83
|
+
}
|
|
84
|
+
/** Count occurrences of the BEGIN marker in `text`. The base BEGIN_RE has
|
|
85
|
+
* no `g` flag (it's used for single-span detection); this helper compiles
|
|
86
|
+
* the same pattern with `g` so duplicates can be diagnosed. */
|
|
87
|
+
export function countBeginMarkers(text) {
|
|
88
|
+
return (text.match(/<!--\s*browser-link:instructions:begin(?:\s+v\d+\.\d+\.\d+)?\s*-->/g) ?? [])
|
|
89
|
+
.length;
|
|
90
|
+
}
|
|
91
|
+
/** Pick the dominant line ending of `text`. CRLF wins only when it is the
|
|
92
|
+
* majority of newline sequences; otherwise LF. Used by installAt to keep
|
|
93
|
+
* Windows-edited files from acquiring a mixed-EOL block. */
|
|
94
|
+
export function detectEol(text) {
|
|
95
|
+
const crlf = (text.match(/\r\n/g) ?? []).length;
|
|
96
|
+
const lfTotal = (text.match(/\n/g) ?? []).length;
|
|
97
|
+
const loneLf = lfTotal - crlf;
|
|
98
|
+
return crlf > loneLf && crlf > 0 ? '\r\n' : '\n';
|
|
74
99
|
}
|
|
75
100
|
export function findBlockSpan(text) {
|
|
76
101
|
const begin = BEGIN_RE.exec(text);
|
|
@@ -1 +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,wCAAwC,CAAC;AAEnE,MAAM,UAAU,WAAW,CAAC,OAAO,GAAG,OAAO;IAC3C,OAAO,GAAG,YAAY,KAAK,OAAO,MAAM,CAAC;AAC3C,CAAC;AAED;;;;yCAIyC;AACzC,MAAM,CAAC,MAAM,QAAQ,GACnB,gFAAgF,CAAC;AACnF,MAAM,CAAC,MAAM,MAAM,GAAG,4CAA4C,CAAC;AAEnE;6EAC6E;AAC7E,SAAS,IAAI;IACX,OAAO;QACL,wCAAwC;QACxC,EAAE;QACF,sEAAsE;QACtE,qEAAqE;QACrE,kEAAkE;QAClE,qEAAqE;QACrE,aAAa;QACb,EAAE;QACF,uCAAuC;QACvC,EAAE;QACF,uEAAuE;QACvE,yEAAyE;QACzE,gEAAgE;QAChE,qEAAqE;QACrE,6DAA6D;QAC7D,0EAA0E;QAC1E,wEAAwE;QACxE,uEAAuE;QACvE,uEAAuE;QACvE,uDAAuD;QACvD,sEAAsE;QACtE,+DAA+D;QAC/D,kEAAkE;QAClE,wBAAwB;QACxB,EAAE;QACF,6BAA6B;QAC7B,EAAE;QACF,oEAAoE;QACpE,sEAAsE;QACtE,0DAA0D;KAC3D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED
|
|
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,wCAAwC,CAAC;AAEnE,MAAM,UAAU,WAAW,CAAC,OAAO,GAAG,OAAO;IAC3C,OAAO,GAAG,YAAY,KAAK,OAAO,MAAM,CAAC;AAC3C,CAAC;AAED;;;;yCAIyC;AACzC,MAAM,CAAC,MAAM,QAAQ,GACnB,gFAAgF,CAAC;AACnF,MAAM,CAAC,MAAM,MAAM,GAAG,4CAA4C,CAAC;AAEnE;6EAC6E;AAC7E,SAAS,IAAI;IACX,OAAO;QACL,wCAAwC;QACxC,EAAE;QACF,sEAAsE;QACtE,qEAAqE;QACrE,kEAAkE;QAClE,qEAAqE;QACrE,aAAa;QACb,EAAE;QACF,uCAAuC;QACvC,EAAE;QACF,uEAAuE;QACvE,yEAAyE;QACzE,gEAAgE;QAChE,qEAAqE;QACrE,6DAA6D;QAC7D,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CAAC;IAC9B,OAAO,IAAI,GAAG,MAAM,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC;AAWD,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,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,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed errors thrown by the agent-instructions file operations. Surfaced
|
|
3
|
+
* in the Ink screen as red banners; the CLI prints them straight to stderr.
|
|
4
|
+
* Keeping them in their own module avoids cycles between file-ops and the
|
|
5
|
+
* UI / command layers that catch them.
|
|
6
|
+
*/
|
|
7
|
+
/** Thrown when the target file is a symlink. We refuse to write through
|
|
8
|
+
* symlinks because the user's intent is ambiguous: editing the target
|
|
9
|
+
* may not be what they meant when they installed the symlink. The error
|
|
10
|
+
* message embeds a paste-ready block so the user can install it manually
|
|
11
|
+
* in the resolved target. */
|
|
12
|
+
export declare class SymlinkRefusedError extends Error {
|
|
13
|
+
readonly source: string;
|
|
14
|
+
readonly target: string;
|
|
15
|
+
readonly blockContent: string;
|
|
16
|
+
constructor(source: string, target: string, blockContent: string);
|
|
17
|
+
}
|
|
18
|
+
/** Thrown when the target file contains more than one BEGIN marker. The
|
|
19
|
+
* installer cannot know which span to refresh; the user must resolve the
|
|
20
|
+
* duplication by hand before install/uninstall can proceed. */
|
|
21
|
+
export declare class CorruptBlockError extends Error {
|
|
22
|
+
readonly filePath: string;
|
|
23
|
+
readonly reason: 'multiple-begin-markers';
|
|
24
|
+
constructor(filePath: string, reason: 'multiple-begin-markers');
|
|
25
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed errors thrown by the agent-instructions file operations. Surfaced
|
|
3
|
+
* in the Ink screen as red banners; the CLI prints them straight to stderr.
|
|
4
|
+
* Keeping them in their own module avoids cycles between file-ops and the
|
|
5
|
+
* UI / command layers that catch them.
|
|
6
|
+
*/
|
|
7
|
+
/** Thrown when the target file is a symlink. We refuse to write through
|
|
8
|
+
* symlinks because the user's intent is ambiguous: editing the target
|
|
9
|
+
* may not be what they meant when they installed the symlink. The error
|
|
10
|
+
* message embeds a paste-ready block so the user can install it manually
|
|
11
|
+
* in the resolved target. */
|
|
12
|
+
export class SymlinkRefusedError extends Error {
|
|
13
|
+
source;
|
|
14
|
+
target;
|
|
15
|
+
blockContent;
|
|
16
|
+
constructor(source, target, blockContent) {
|
|
17
|
+
super(`${source} is a symlink to ${target}. Refusing to write through it. ` +
|
|
18
|
+
`Paste the block below into ${target} manually:\n\n${blockContent}`);
|
|
19
|
+
this.source = source;
|
|
20
|
+
this.target = target;
|
|
21
|
+
this.blockContent = blockContent;
|
|
22
|
+
this.name = 'SymlinkRefusedError';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Thrown when the target file contains more than one BEGIN marker. The
|
|
26
|
+
* installer cannot know which span to refresh; the user must resolve the
|
|
27
|
+
* duplication by hand before install/uninstall can proceed. */
|
|
28
|
+
export class CorruptBlockError extends Error {
|
|
29
|
+
filePath;
|
|
30
|
+
reason;
|
|
31
|
+
constructor(filePath, reason) {
|
|
32
|
+
super(`${filePath} contains multiple browser-link instruction blocks ` +
|
|
33
|
+
`(${reason}). Refusing to touch it — please resolve the duplication manually.`);
|
|
34
|
+
this.filePath = filePath;
|
|
35
|
+
this.reason = reason;
|
|
36
|
+
this.name = 'CorruptBlockError';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/agent-instructions/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;6BAI6B;AAC7B,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAE1B;IACA;IACA;IAHlB,YACkB,MAAc,EACd,MAAc,EACd,YAAoB;QAEpC,KAAK,CACH,GAAG,MAAM,oBAAoB,MAAM,kCAAkC;YACnE,8BAA8B,MAAM,iBAAiB,YAAY,EAAE,CACtE,CAAC;QAPc,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;QACd,iBAAY,GAAZ,YAAY,CAAQ;QAMpC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;+DAE+D;AAC/D,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAExB;IACA;IAFlB,YACkB,QAAgB,EAChB,MAAgC;QAEhD,KAAK,CACH,GAAG,QAAQ,qDAAqD;YAC9D,IAAI,MAAM,oEAAoE,CACjF,CAAC;QANc,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAA0B;QAMhD,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -1,13 +1,54 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync,
|
|
2
|
-
import { dirname } from 'node:path';
|
|
1
|
+
import { closeSync, existsSync, fsyncSync, lstatSync, mkdirSync, openSync, readFileSync, readlinkSync, realpathSync, renameSync, unlinkSync, writeSync, } from 'node:fs';
|
|
2
|
+
import { basename, dirname, join } from 'node:path';
|
|
3
3
|
import { VERSION } from '../version.js';
|
|
4
|
-
import { block, findBlockSpan } from './content.js';
|
|
4
|
+
import { block, countBeginMarkers, detectEol, findBlockSpan } from './content.js';
|
|
5
|
+
import { CorruptBlockError, SymlinkRefusedError } from './errors.js';
|
|
5
6
|
/**
|
|
6
7
|
* Shared file-level operations for the three agent-instructions installers.
|
|
7
8
|
* Per-client modules only know which path their target file lives at; the
|
|
8
9
|
* marker handling and the text splice are the same everywhere.
|
|
9
10
|
*/
|
|
11
|
+
/** Atomic write via a sibling temp file + fsync + rename. Closes the
|
|
12
|
+
* TOCTOU window between existsSync()/stat and writeFileSync() that
|
|
13
|
+
* CodeQL flagged as js/file-system-race. Cleans up the temp file if
|
|
14
|
+
* the rename fails (or any earlier step throws). The 0o600 create-mode
|
|
15
|
+
* keeps the temp file private while it lives. */
|
|
16
|
+
function atomicWrite(filePath, content) {
|
|
17
|
+
const dir = dirname(filePath);
|
|
18
|
+
const tmp = join(dir, `.${basename(filePath)}.${process.pid}-${Date.now()}.tmp`);
|
|
19
|
+
let fd = null;
|
|
20
|
+
try {
|
|
21
|
+
fd = openSync(tmp, 'w', 0o600);
|
|
22
|
+
writeSync(fd, content, null, 'utf8');
|
|
23
|
+
fsyncSync(fd);
|
|
24
|
+
closeSync(fd);
|
|
25
|
+
fd = null;
|
|
26
|
+
renameSync(tmp, filePath);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
if (fd !== null) {
|
|
30
|
+
try {
|
|
31
|
+
closeSync(fd);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
/* swallow — we're already on the error path */
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
unlinkSync(tmp);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
/* swallow — the tmp may never have been created */
|
|
42
|
+
}
|
|
43
|
+
throw err;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** Compare two semver triplets numerically. `null` represents the legacy
|
|
47
|
+
* unversioned marker — the block existed before we added versioning, so
|
|
48
|
+
* it is older than any real VERSION. Returns negative when `a < b`. */
|
|
10
49
|
function compareSemver(a, b) {
|
|
50
|
+
if (a === null)
|
|
51
|
+
return -1;
|
|
11
52
|
const pa = a.split('.').map(Number);
|
|
12
53
|
const pb = b.split('.').map(Number);
|
|
13
54
|
for (let i = 0; i < 3; i++) {
|
|
@@ -18,16 +59,44 @@ function compareSemver(a, b) {
|
|
|
18
59
|
}
|
|
19
60
|
return 0;
|
|
20
61
|
}
|
|
62
|
+
/** Throw SymlinkRefusedError if `filePath` is a symlink. existsSync follows
|
|
63
|
+
* symlinks, so callers must use this lstat-based check separately. */
|
|
64
|
+
function guardSymlink(filePath) {
|
|
65
|
+
let st;
|
|
66
|
+
try {
|
|
67
|
+
st = lstatSync(filePath);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return; // file does not exist — not our problem here
|
|
71
|
+
}
|
|
72
|
+
if (!st.isSymbolicLink())
|
|
73
|
+
return;
|
|
74
|
+
const rawTarget = readlinkSync(filePath);
|
|
75
|
+
// realpath gives us the absolute resolved path even when readlink returns
|
|
76
|
+
// something relative. Fall back to the raw readlink output if realpath
|
|
77
|
+
// throws (broken symlink) so the error message still names a target.
|
|
78
|
+
let resolved;
|
|
79
|
+
try {
|
|
80
|
+
resolved = realpathSync(filePath);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
resolved = rawTarget;
|
|
84
|
+
}
|
|
85
|
+
throw new SymlinkRefusedError(filePath, resolved, block());
|
|
86
|
+
}
|
|
21
87
|
export function detectAt(filePath) {
|
|
22
88
|
if (!existsSync(filePath)) {
|
|
23
89
|
return { filePath, state: { kind: 'no-file' } };
|
|
24
90
|
}
|
|
25
91
|
const text = readFileSync(filePath, 'utf8');
|
|
92
|
+
if (countBeginMarkers(text) > 1) {
|
|
93
|
+
return { filePath, state: { kind: 'corrupt', reason: 'multiple-begin-markers' } };
|
|
94
|
+
}
|
|
26
95
|
const span = findBlockSpan(text);
|
|
27
96
|
if (!span) {
|
|
28
97
|
return { filePath, state: { kind: 'not-installed' } };
|
|
29
98
|
}
|
|
30
|
-
const installedVersion = span.installedVersion
|
|
99
|
+
const installedVersion = span.installedVersion;
|
|
31
100
|
const cmp = compareSemver(installedVersion, VERSION);
|
|
32
101
|
return {
|
|
33
102
|
filePath,
|
|
@@ -41,23 +110,33 @@ export function detectAt(filePath) {
|
|
|
41
110
|
* of what changed, suitable for surfacing to the user.
|
|
42
111
|
*/
|
|
43
112
|
export function installAt(filePath, displayName) {
|
|
44
|
-
|
|
113
|
+
guardSymlink(filePath);
|
|
45
114
|
if (!existsSync(filePath)) {
|
|
46
115
|
mkdirSync(dirname(filePath), { recursive: true });
|
|
47
|
-
|
|
116
|
+
// New file: portable markdown — LF by default. We do NOT pick CRLF on
|
|
117
|
+
// Windows because the content is going into a tool-managed .md file
|
|
118
|
+
// that may be synced to other OSes.
|
|
119
|
+
atomicWrite(filePath, block());
|
|
48
120
|
return `Created ${filePath} and inserted the browser-link instructions block for ${displayName}.`;
|
|
49
121
|
}
|
|
50
122
|
const text = readFileSync(filePath, 'utf8');
|
|
123
|
+
if (countBeginMarkers(text) > 1) {
|
|
124
|
+
throw new CorruptBlockError(filePath, 'multiple-begin-markers');
|
|
125
|
+
}
|
|
126
|
+
const eol = detectEol(text);
|
|
127
|
+
const fresh = block(VERSION, eol);
|
|
51
128
|
const span = findBlockSpan(text);
|
|
52
129
|
if (!span) {
|
|
53
|
-
// Append. Ensure a blank line separator from prior content
|
|
54
|
-
|
|
55
|
-
|
|
130
|
+
// Append. Ensure a blank line separator from prior content, matching
|
|
131
|
+
// the file's dominant line ending.
|
|
132
|
+
const doubleEol = `${eol}${eol}`;
|
|
133
|
+
const separator = text.length === 0 || text.endsWith(doubleEol) ? '' : text.endsWith(eol) ? eol : doubleEol;
|
|
134
|
+
atomicWrite(filePath, text + separator + fresh);
|
|
56
135
|
return `Appended the browser-link instructions block to ${filePath} (${displayName}).`;
|
|
57
136
|
}
|
|
58
137
|
const before = text.slice(0, span.startIndex);
|
|
59
138
|
const after = text.slice(span.endIndex);
|
|
60
|
-
|
|
139
|
+
atomicWrite(filePath, before + fresh + after);
|
|
61
140
|
const prev = span.installedVersion ?? 'unversioned';
|
|
62
141
|
return `Refreshed the browser-link instructions block in ${filePath} (${displayName}, was v${prev}).`;
|
|
63
142
|
}
|
|
@@ -65,7 +144,11 @@ export function uninstallAt(filePath, displayName) {
|
|
|
65
144
|
if (!existsSync(filePath)) {
|
|
66
145
|
return `No ${displayName} instructions file at ${filePath}; nothing to remove.`;
|
|
67
146
|
}
|
|
147
|
+
guardSymlink(filePath);
|
|
68
148
|
const text = readFileSync(filePath, 'utf8');
|
|
149
|
+
if (countBeginMarkers(text) > 1) {
|
|
150
|
+
throw new CorruptBlockError(filePath, 'multiple-begin-markers');
|
|
151
|
+
}
|
|
69
152
|
const span = findBlockSpan(text);
|
|
70
153
|
if (!span) {
|
|
71
154
|
return `browser-link instructions block was not present in ${filePath}; nothing to remove.`;
|
|
@@ -73,11 +156,16 @@ export function uninstallAt(filePath, displayName) {
|
|
|
73
156
|
const before = text.slice(0, span.startIndex);
|
|
74
157
|
const after = text.slice(span.endIndex);
|
|
75
158
|
// 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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
159
|
+
// user's own content. A single trailing newline at EOF is restored,
|
|
160
|
+
// matching whatever EOL the remaining content uses.
|
|
161
|
+
const remaining = before + after;
|
|
162
|
+
const eol = detectEol(remaining);
|
|
163
|
+
const collapsePattern = eol === '\r\n' ? /(?:\r\n){3,}/g : /\n{3,}/g;
|
|
164
|
+
const doubleEol = `${eol}${eol}`;
|
|
165
|
+
let next = remaining.replace(collapsePattern, doubleEol);
|
|
166
|
+
if (next.length > 0 && !next.endsWith(eol))
|
|
167
|
+
next += eol;
|
|
168
|
+
atomicWrite(filePath, next);
|
|
81
169
|
return `Removed the browser-link instructions block from ${filePath} (${displayName}).`;
|
|
82
170
|
}
|
|
83
171
|
//# sourceMappingURL=file-ops.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-ops.js","sourceRoot":"","sources":["../../src/agent-instructions/file-ops.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"file-ops.js","sourceRoot":"","sources":["../../src/agent-instructions/file-ops.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGrE;;;;GAIG;AAEH;;;;iDAIiD;AACjD,SAAS,WAAW,CAAC,QAAgB,EAAE,OAAe;IACpD,MAAM,GAAG,GAAG,OAAO,CAAC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-6,3 +6,4 @@ import type { ClientId, InstructionsInstaller } from './types.js';
|
|
|
6
6
|
export declare const INSTRUCTIONS_INSTALLERS: InstructionsInstaller[];
|
|
7
7
|
export declare function getInstructionsInstaller(id: ClientId): InstructionsInstaller;
|
|
8
8
|
export type { ClientId, InstructionsDetect, InstructionsInstaller, InstructionsState, } from './types.js';
|
|
9
|
+
export { CorruptBlockError, SymlinkRefusedError } from './errors.js';
|
|
@@ -1 +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"}
|
|
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;AASD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -8,10 +8,13 @@ export type InstructionsState = {
|
|
|
8
8
|
kind: 'not-installed';
|
|
9
9
|
} | {
|
|
10
10
|
kind: 'installed';
|
|
11
|
-
version: string;
|
|
11
|
+
version: string | null;
|
|
12
12
|
} | {
|
|
13
13
|
kind: 'installed-outdated';
|
|
14
|
-
version: string;
|
|
14
|
+
version: string | null;
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'corrupt';
|
|
17
|
+
reason: 'multiple-begin-markers';
|
|
15
18
|
};
|
|
16
19
|
export interface InstructionsDetect {
|
|
17
20
|
/** Absolute path to the markdown file we manage. Returned even when it does not exist. */
|
package/dist/commands/doctor.js
CHANGED
|
@@ -85,10 +85,11 @@ const DOCTOR_I18N = {
|
|
|
85
85
|
clientNotRegistered: '⚠ installed but not registered',
|
|
86
86
|
clientConfig: 'config:',
|
|
87
87
|
clientInstructions: 'instructions:',
|
|
88
|
-
instructionsInstalled: (v) => `✓ installed (v${v})
|
|
89
|
-
instructionsOutdated: (v) => `⚠ outdated (v${v})
|
|
88
|
+
instructionsInstalled: (v) => (v === null ? `✓ installed (legacy)` : `✓ installed (v${v})`),
|
|
89
|
+
instructionsOutdated: (v) => (v === null ? `⚠ outdated (legacy)` : `⚠ outdated (v${v})`),
|
|
90
90
|
instructionsNotInstalled: '· not installed',
|
|
91
91
|
instructionsNoFile: '· file not present',
|
|
92
|
+
instructionsCorrupt: '⚠ multiple blocks — resolve manually',
|
|
92
93
|
extensionHeader: 'Chrome extension assets:',
|
|
93
94
|
extensionNotFound: 'not found (run `browser-link extension` for guidance)',
|
|
94
95
|
mapHeader: 'Map DB:',
|
|
@@ -118,10 +119,11 @@ const DOCTOR_I18N = {
|
|
|
118
119
|
clientNotRegistered: '⚠ instalado pero no registrado',
|
|
119
120
|
clientConfig: 'config:',
|
|
120
121
|
clientInstructions: 'instrucciones:',
|
|
121
|
-
instructionsInstalled: (v) => `✓ instaladas (v${v})
|
|
122
|
-
instructionsOutdated: (v) => `⚠ desactualizadas (v${v})`,
|
|
122
|
+
instructionsInstalled: (v) => (v === null ? `✓ instaladas (legacy)` : `✓ instaladas (v${v})`),
|
|
123
|
+
instructionsOutdated: (v) => v === null ? `⚠ desactualizadas (legacy)` : `⚠ desactualizadas (v${v})`,
|
|
123
124
|
instructionsNotInstalled: '· no instaladas',
|
|
124
125
|
instructionsNoFile: '· sin archivo',
|
|
126
|
+
instructionsCorrupt: '⚠ múltiples bloques — resolvé a mano',
|
|
125
127
|
extensionHeader: 'Assets de la extensión de Chrome:',
|
|
126
128
|
extensionNotFound: 'no encontrada (corré `browser-link extension` para la guía)',
|
|
127
129
|
mapHeader: 'Base de datos del mapa:',
|
|
@@ -176,6 +178,9 @@ export function formatDoctor(r, language = 'en') {
|
|
|
176
178
|
case 'no-file':
|
|
177
179
|
instrLabel = t.instructionsNoFile;
|
|
178
180
|
break;
|
|
181
|
+
case 'corrupt':
|
|
182
|
+
instrLabel = t.instructionsCorrupt;
|
|
183
|
+
break;
|
|
179
184
|
}
|
|
180
185
|
lines.push(` ${' '.repeat(20)} ${t.clientInstructions} ${instrLabel} (${c.instructions.filePath})`);
|
|
181
186
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EA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,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"}
|
|
@@ -10,7 +10,8 @@ export interface InstructionsReport {
|
|
|
10
10
|
displayName: string;
|
|
11
11
|
filePath: string;
|
|
12
12
|
state: InstructionsState;
|
|
13
|
-
/** Set after install/uninstall — the one-line description of what changed
|
|
13
|
+
/** Set after install/uninstall — the one-line description of what changed,
|
|
14
|
+
* or the error message when `ok === false`. */
|
|
14
15
|
message?: string;
|
|
15
16
|
ok: boolean;
|
|
16
17
|
}
|
|
@@ -16,34 +16,42 @@ export function statusFor(client) {
|
|
|
16
16
|
export function statusAll() {
|
|
17
17
|
return INSTRUCTIONS_INSTALLERS.map((i) => stateOnly(i.id));
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
function runAction(client, action) {
|
|
20
20
|
const inst = getInstructionsInstaller(client);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
// Capture the pre-call state so a thrown error before/instead of detect()
|
|
22
|
+
// does not leave the UI with a stale or undefined state field.
|
|
23
|
+
const initial = inst.detect();
|
|
24
|
+
try {
|
|
25
|
+
const message = action(inst);
|
|
26
|
+
const after = inst.detect();
|
|
27
|
+
return {
|
|
28
|
+
client,
|
|
29
|
+
displayName: inst.displayName,
|
|
30
|
+
filePath: after.filePath,
|
|
31
|
+
state: after.state,
|
|
32
|
+
message,
|
|
33
|
+
ok: true,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
return {
|
|
38
|
+
client,
|
|
39
|
+
displayName: inst.displayName,
|
|
40
|
+
filePath: initial.filePath,
|
|
41
|
+
state: initial.state,
|
|
42
|
+
message: err instanceof Error ? err.message : String(err),
|
|
43
|
+
ok: false,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function installInstructionsFor(client) {
|
|
48
|
+
return runAction(client, (i) => i.install());
|
|
31
49
|
}
|
|
32
50
|
export function installInstructionsAll() {
|
|
33
51
|
return INSTRUCTIONS_INSTALLERS.map((i) => installInstructionsFor(i.id));
|
|
34
52
|
}
|
|
35
53
|
export function uninstallInstructionsFor(client) {
|
|
36
|
-
|
|
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
|
-
};
|
|
54
|
+
return runAction(client, (i) => i.uninstall());
|
|
47
55
|
}
|
|
48
56
|
export function uninstallInstructionsAll() {
|
|
49
57
|
return INSTRUCTIONS_INSTALLERS.map((i) => uninstallInstructionsFor(i.id));
|
|
@@ -51,18 +59,24 @@ export function uninstallInstructionsAll() {
|
|
|
51
59
|
const I18N = {
|
|
52
60
|
en: {
|
|
53
61
|
header: 'Agent instructions — browser-link awareness in global agent .md files',
|
|
54
|
-
installed: (v) => `✓ installed (v${v})
|
|
55
|
-
installedOutdated: (v) =>
|
|
62
|
+
installed: (v) => (v === null ? `✓ installed (legacy)` : `✓ installed (v${v})`),
|
|
63
|
+
installedOutdated: (v) => v === null
|
|
64
|
+
? `⚠ installed but outdated (legacy) — run \`browser-link instructions install\` to refresh.`
|
|
65
|
+
: `⚠ installed but outdated (v${v}) — run \`browser-link instructions install\` to refresh.`,
|
|
56
66
|
notInstalled: '· not installed (file exists, no browser-link block)',
|
|
57
67
|
noFile: '· file does not exist yet (will be created on install)',
|
|
68
|
+
corrupt: '⚠ multiple browser-link blocks present — please resolve manually',
|
|
58
69
|
filePath: ' file:',
|
|
59
70
|
},
|
|
60
71
|
es: {
|
|
61
72
|
header: 'Instrucciones del agente — browser-link en los .md globales de cada cliente',
|
|
62
|
-
installed: (v) => `✓ instalado (v${v})
|
|
63
|
-
installedOutdated: (v) =>
|
|
73
|
+
installed: (v) => (v === null ? `✓ instalado (legacy)` : `✓ instalado (v${v})`),
|
|
74
|
+
installedOutdated: (v) => v === null
|
|
75
|
+
? `⚠ instalado pero desactualizado (legacy) — corré \`browser-link instructions install\` para refrescar.`
|
|
76
|
+
: `⚠ instalado pero desactualizado (v${v}) — corré \`browser-link instructions install\` para refrescar.`,
|
|
64
77
|
notInstalled: '· no instalado (el archivo existe, sin bloque de browser-link)',
|
|
65
78
|
noFile: '· el archivo aún no existe (se va a crear al instalar)',
|
|
79
|
+
corrupt: '⚠ múltiples bloques browser-link en el archivo — resolvé a mano',
|
|
66
80
|
filePath: ' archivo:',
|
|
67
81
|
},
|
|
68
82
|
};
|
|
@@ -78,6 +92,8 @@ export function describeState(state, language = 'en') {
|
|
|
78
92
|
return t.notInstalled;
|
|
79
93
|
case 'no-file':
|
|
80
94
|
return t.noFile;
|
|
95
|
+
case 'corrupt':
|
|
96
|
+
return t.corrupt;
|
|
81
97
|
}
|
|
82
98
|
}
|
|
83
99
|
/** Format a list of reports as the body of `browser-link instructions`
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/commands/instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GAGzB,MAAM,gCAAgC,CAAC;AAoBxC,SAAS,SAAS,C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ACxB,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text, useInput } from 'ink';
|
|
3
3
|
import { useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { Frame } from '../components.js';
|
|
@@ -18,9 +18,13 @@ const I18N = {
|
|
|
18
18
|
outdated: '⚠ outdated',
|
|
19
19
|
notInstalled: '· not installed',
|
|
20
20
|
noFile: '· no file yet',
|
|
21
|
+
corrupt: '⚠ corrupt (multiple blocks)',
|
|
22
|
+
legacySuffix: 'legacy',
|
|
21
23
|
footer: '↑↓ navigate · ↵ install/refresh · u uninstall · Esc back',
|
|
22
24
|
doneInstall: '✓ Done. Restart your MCP client to pick up the new instructions.',
|
|
23
25
|
doneUninstall: '✓ Removed. The rest of the file was left untouched.',
|
|
26
|
+
failInstall: '✗ Install failed.',
|
|
27
|
+
failUninstall: '✗ Uninstall failed.',
|
|
24
28
|
refreshHint: 'On install: the block is refreshed in place if it already exists.',
|
|
25
29
|
},
|
|
26
30
|
es: {
|
|
@@ -37,22 +41,34 @@ const I18N = {
|
|
|
37
41
|
outdated: '⚠ desactualizado',
|
|
38
42
|
notInstalled: '· no instalado',
|
|
39
43
|
noFile: '· sin archivo todavía',
|
|
44
|
+
corrupt: '⚠ corrupto (múltiples bloques)',
|
|
45
|
+
legacySuffix: 'legacy',
|
|
40
46
|
footer: '↑↓ moverse · ↵ instalar/refrescar · u desinstalar · Esc volver',
|
|
41
47
|
doneInstall: '✓ Listo. Reiniciá tu cliente MCP para tomar las nuevas instrucciones.',
|
|
42
48
|
doneUninstall: '✓ Quitado. El resto del archivo quedó intacto.',
|
|
49
|
+
failInstall: '✗ Falló la instalación.',
|
|
50
|
+
failUninstall: '✗ Falló la desinstalación.',
|
|
43
51
|
refreshHint: 'En instalar: si el bloque ya existe, se reescribe en su lugar.',
|
|
44
52
|
},
|
|
45
53
|
};
|
|
46
54
|
function statusBadge(state, t) {
|
|
47
55
|
switch (state.kind) {
|
|
48
56
|
case 'installed':
|
|
49
|
-
return {
|
|
57
|
+
return {
|
|
58
|
+
label: `${t.installed} (${state.version === null ? t.legacySuffix : `v${state.version}`})`,
|
|
59
|
+
color: 'green',
|
|
60
|
+
};
|
|
50
61
|
case 'installed-outdated':
|
|
51
|
-
return {
|
|
62
|
+
return {
|
|
63
|
+
label: `${t.outdated} (${state.version === null ? t.legacySuffix : `v${state.version}`})`,
|
|
64
|
+
color: 'yellow',
|
|
65
|
+
};
|
|
52
66
|
case 'not-installed':
|
|
53
67
|
return { label: t.notInstalled, color: 'gray' };
|
|
54
68
|
case 'no-file':
|
|
55
69
|
return { label: t.noFile, color: 'gray' };
|
|
70
|
+
case 'corrupt':
|
|
71
|
+
return { label: t.corrupt, color: 'yellow' };
|
|
56
72
|
}
|
|
57
73
|
}
|
|
58
74
|
export function AgentInstructionsView({ language, onBack }) {
|
|
@@ -87,6 +103,6 @@ export function AgentInstructionsView({ language, onBack }) {
|
|
|
87
103
|
const badge = statusBadge(r.state, t);
|
|
88
104
|
const isCursor = i === cursor;
|
|
89
105
|
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 && (
|
|
106
|
+
}) }), lastAction && (_jsx(Box, { flexDirection: "column", marginTop: 1, children: lastAction.report.ok ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: "green", children: lastAction.kind === 'install' ? t.doneInstall : t.doneUninstall }), lastAction.report.message !== undefined && lastAction.report.message !== '' && (_jsx(Text, { color: "gray", dimColor: true, children: lastAction.report.message }))] })) : (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "red", children: lastAction.kind === 'install' ? t.failInstall : t.failUninstall }), lastAction.report.message !== undefined && lastAction.report.message !== '' && (_jsx(Box, { children: _jsx(Text, { color: "red", wrap: "wrap", 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
107
|
}
|
|
92
108
|
//# sourceMappingURL=agent-instructions.js.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"agent-instructions.js","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AAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,YAC1B,UAAU,CAAC,MAAM,CAAC,OAAO,GACrB,GACH,CACP,IACG,CACP,GACG,CACP,EACD,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,QAAC,QAAQ,mBAC/B,CAAC,CAAC,WAAW,OAAG,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,IAClF,GACH,IACA,CACT,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobshimo/browser-link",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
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",
|