@jobshimo/browser-link 0.8.1 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-instructions/content.js +42 -27
- package/dist/agent-instructions/content.js.map +1 -1
- package/dist/agent-instructions/errors.d.ts +13 -0
- package/dist/agent-instructions/errors.js +20 -0
- package/dist/agent-instructions/errors.js.map +1 -1
- package/dist/agent-instructions/file-ops.d.ts +8 -2
- package/dist/agent-instructions/file-ops.js +31 -21
- package/dist/agent-instructions/file-ops.js.map +1 -1
- package/dist/agent-instructions/index.d.ts +28 -1
- package/dist/agent-instructions/index.js +69 -4
- package/dist/agent-instructions/index.js.map +1 -1
- package/dist/bridge/server.js +30 -28
- package/dist/bridge/server.js.map +1 -1
- package/dist/commands/doctor.js +30 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/instructions.d.ts +5 -0
- package/dist/commands/instructions.js +10 -1
- package/dist/commands/instructions.js.map +1 -1
- package/dist/commands/update-check.d.ts +25 -0
- package/dist/commands/update-check.js +108 -0
- package/dist/commands/update-check.js.map +1 -0
- package/dist/commands/updates.js +5 -12
- package/dist/commands/updates.js.map +1 -1
- package/dist/extension/manifest.json +1 -1
- package/dist/map/tools.d.ts +1 -5
- package/dist/map/tools.js +45 -0
- package/dist/map/tools.js.map +1 -1
- package/dist/tools/browser-definitions.d.ts +6 -0
- package/dist/tools/browser-definitions.js +134 -0
- package/dist/tools/browser-definitions.js.map +1 -1
- package/dist/tools/server-instructions.d.ts +16 -2
- package/dist/tools/server-instructions.js +87 -68
- package/dist/tools/server-instructions.js.map +1 -1
- package/dist/tools/types.d.ts +26 -1
- package/dist/ui/app.js +13 -3
- package/dist/ui/app.js.map +1 -1
- package/dist/ui/hooks/use-update-check.d.ts +16 -0
- package/dist/ui/hooks/use-update-check.js +48 -0
- package/dist/ui/hooks/use-update-check.js.map +1 -0
- package/dist/ui/screens/agent-instructions.d.ts +7 -1
- package/dist/ui/screens/agent-instructions.js +18 -5
- package/dist/ui/screens/agent-instructions.js.map +1 -1
- package/dist/ui/screens/menu.d.ts +10 -1
- package/dist/ui/screens/menu.js +37 -5
- package/dist/ui/screens/menu.js.map +1 -1
- package/dist/utils/semver.d.ts +14 -0
- package/dist/utils/semver.js +32 -0
- package/dist/utils/semver.js.map +1 -0
- package/package.json +1 -1
- package/dist/agent-instructions/claude.d.ts +0 -2
- package/dist/agent-instructions/claude.js +0 -29
- package/dist/agent-instructions/claude.js.map +0 -1
- package/dist/agent-instructions/copilot.d.ts +0 -2
- package/dist/agent-instructions/copilot.js +0 -31
- package/dist/agent-instructions/copilot.js.map +0 -1
- package/dist/agent-instructions/opencode.d.ts +0 -2
- package/dist/agent-instructions/opencode.js +0 -30
- package/dist/agent-instructions/opencode.js.map +0 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { type ClientId } from '../../agent-instructions/index.js';
|
|
1
2
|
import type { CommonProps } from './types.js';
|
|
2
3
|
interface AgentInstructionsViewProps extends CommonProps {
|
|
3
4
|
onBack: () => void;
|
|
5
|
+
/** Optional initial cursor target. When the user lands on this screen via
|
|
6
|
+
* the `i` hotkey from the main menu, the cursor is auto-positioned on
|
|
7
|
+
* the first outdated client so the next Enter refreshes it. Falls back
|
|
8
|
+
* to row 0 when omitted or when the requested client is not present. */
|
|
9
|
+
initialCursorClient?: ClientId;
|
|
4
10
|
}
|
|
5
|
-
export declare function AgentInstructionsView({ language, onBack }: AgentInstructionsViewProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function AgentInstructionsView({ language, onBack, initialCursorClient, }: AgentInstructionsViewProps): import("react/jsx-runtime").JSX.Element;
|
|
6
12
|
export {};
|
|
@@ -3,7 +3,7 @@ import { Box, Text, useInput } from 'ink';
|
|
|
3
3
|
import { useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { Frame } from '../components.js';
|
|
5
5
|
import { INSTRUCTIONS_INSTALLERS, } from '../../agent-instructions/index.js';
|
|
6
|
-
import { describeState, installInstructionsFor, statusAll, uninstallInstructionsFor, } from '../../commands/instructions.js';
|
|
6
|
+
import { describeState, displayNameColumnWidth, installInstructionsFor, statusAll, uninstallInstructionsFor, } from '../../commands/instructions.js';
|
|
7
7
|
const I18N = {
|
|
8
8
|
en: {
|
|
9
9
|
title: 'Agent instructions — browser-link awareness in global agent .md files',
|
|
@@ -71,17 +71,30 @@ function statusBadge(state, t) {
|
|
|
71
71
|
return { label: t.corrupt, color: 'yellow' };
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
export function AgentInstructionsView({ language, onBack }) {
|
|
74
|
+
export function AgentInstructionsView({ language, onBack, initialCursorClient, }) {
|
|
75
75
|
const t = I18N[language];
|
|
76
76
|
const [reports, setReports] = useState(() => statusAll());
|
|
77
|
-
const
|
|
77
|
+
const items = useMemo(() => INSTRUCTIONS_INSTALLERS, []);
|
|
78
|
+
// If the caller asked us to focus a specific client, place the cursor on
|
|
79
|
+
// it; otherwise default to the first row. The lookup is done once on
|
|
80
|
+
// mount because the prop is the user's deliberate landing instruction —
|
|
81
|
+
// we should not pull the cursor away from where they navigated to next.
|
|
82
|
+
const initialIndex = useMemo(() => {
|
|
83
|
+
if (!initialCursorClient)
|
|
84
|
+
return 0;
|
|
85
|
+
const i = items.findIndex((it) => it.id === initialCursorClient);
|
|
86
|
+
return i >= 0 ? i : 0;
|
|
87
|
+
}, [initialCursorClient, items]);
|
|
88
|
+
const [cursor, setCursor] = useState(initialIndex);
|
|
78
89
|
const [lastAction, setLastAction] = useState(null);
|
|
79
90
|
// Refresh status when we come back from an install/uninstall round-trip.
|
|
80
91
|
useEffect(() => {
|
|
81
92
|
if (lastAction)
|
|
82
93
|
setReports(statusAll());
|
|
83
94
|
}, [lastAction]);
|
|
84
|
-
|
|
95
|
+
// Column width is driven by the longest displayName so adding a fourth
|
|
96
|
+
// client never requires hand-tuning a magic padEnd value in two places.
|
|
97
|
+
const nameColumnWidth = useMemo(() => displayNameColumnWidth(items.map((i) => i.displayName)), [items]);
|
|
85
98
|
const runAction = (client, action) => {
|
|
86
99
|
const report = action === 'install' ? installInstructionsFor(client) : uninstallInstructionsFor(client);
|
|
87
100
|
setLastAction({ kind: action, report });
|
|
@@ -102,7 +115,7 @@ export function AgentInstructionsView({ language, onBack }) {
|
|
|
102
115
|
const r = reports[i];
|
|
103
116
|
const badge = statusBadge(r.state, t);
|
|
104
117
|
const isCursor = i === cursor;
|
|
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(
|
|
118
|
+
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(nameColumnWidth) }), _jsx(Text, { color: badge.color, children: badge.label })] }), _jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "gray", dimColor: true, children: r.filePath }) })] }, inst.id));
|
|
106
119
|
}) }), 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)] }) })] }));
|
|
107
120
|
}
|
|
108
121
|
//# 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;AAqBxC,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;QACtB,YAAY,EAAE,iBAAiB;QAC/B,MAAM,EAAE,eAAe;QACvB,OAAO,EAAE,6BAA6B;QACtC,YAAY,EAAE,QAAQ;QACtB,MAAM,EAAE,0DAA0D;QAClE,WAAW,EAAE,kEAAkE;QAC/E,aAAa,EAAE,qDAAqD;QACpE,WAAW,EAAE,mBAAmB;QAChC,aAAa,EAAE,qBAAqB;QACpC,WAAW,EAAE,mEAAmE;KACjF;IACD,EAAE,EAAE;QACF,KAAK,EAAE,6EAA6E;QACpF,KAAK,EAAE;YACL,0EAA0E;YAC1E,4EAA4E;YAC5E,sEAAsE;YACtE,0EAA0E;YAC1E,qCAAqC;SACtC,CAAC,IAAI,CA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,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"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import { type UpdateCheckState } from '../hooks/use-update-check.js';
|
|
1
2
|
import type { CommonProps } from './types.js';
|
|
2
3
|
export type MenuAction = 'register' | 'instructions' | 'permissions' | 'multiAgent' | 'extension' | 'doctor' | 'updates' | 'freePort' | 'language' | 'welcome' | 'about' | 'repo' | 'quit';
|
|
3
4
|
interface MainMenuProps extends CommonProps {
|
|
4
5
|
onSelect: (action: MenuAction) => void;
|
|
5
6
|
onSwapLang: () => void;
|
|
6
7
|
onQuit: () => void;
|
|
8
|
+
/** Override the outdated-clients lookup. Tests inject a stub so we can
|
|
9
|
+
* assert banner behaviour without depending on the real filesystem. The
|
|
10
|
+
* runtime default uses `statusAll()` from commands/instructions. */
|
|
11
|
+
outdatedClientNames?: () => string[];
|
|
12
|
+
/** Override the background update-check hook result. Tests pass a fixed
|
|
13
|
+
* value to assert the update banner renders only when isNewer is true.
|
|
14
|
+
* In production this is undefined and the menu calls the real hook. */
|
|
15
|
+
updateState?: UpdateCheckState;
|
|
7
16
|
}
|
|
8
|
-
export declare function MainMenu({ language, onSelect, onSwapLang, onQuit }: MainMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function MainMenu({ language, onSelect, onSwapLang, onQuit, outdatedClientNames, updateState, }: MainMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
9
18
|
export {};
|
package/dist/ui/screens/menu.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text, useInput } from 'ink';
|
|
3
|
-
import { useState } from 'react';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
4
|
import { Frame, Menu } from '../components.js';
|
|
5
|
+
import { statusAll } from '../../commands/instructions.js';
|
|
6
|
+
import { useBackgroundUpdateCheck } from '../hooks/use-update-check.js';
|
|
5
7
|
const MENU_I18N = {
|
|
6
8
|
en: {
|
|
7
9
|
title: 'browser-link — setup',
|
|
8
10
|
prompt: 'Pick an action',
|
|
9
|
-
footer: '↑↓ navigate · ↵ select · l language · q quit',
|
|
11
|
+
footer: '↑↓ navigate · ↵ select · i instructions · l language · q quit',
|
|
12
|
+
outdatedBanner: (clients) => `⚠ Outdated browser-link block in ${clients}. Press \`i\` to refresh in place.`,
|
|
13
|
+
updateBanner: (latest) => `⬆ v${latest} available — run \`npm install -g @jobshimo/browser-link@latest\``,
|
|
10
14
|
options: {
|
|
11
15
|
register: 'Register browser-link with an MCP client',
|
|
12
16
|
instructions: 'Agent instructions — drop a trigger block into Claude/OpenCode/Copilot global .md',
|
|
@@ -26,7 +30,9 @@ const MENU_I18N = {
|
|
|
26
30
|
es: {
|
|
27
31
|
title: 'browser-link — configuración',
|
|
28
32
|
prompt: 'Elegí una acción',
|
|
29
|
-
footer: '↑↓ moverse · ↵ elegir · l idioma · q salir',
|
|
33
|
+
footer: '↑↓ moverse · ↵ elegir · i instrucciones · l idioma · q salir',
|
|
34
|
+
outdatedBanner: (clients) => `⚠ Bloque de browser-link desactualizado en ${clients}. Apretá \`i\` para refrescar.`,
|
|
35
|
+
updateBanner: (latest) => `⬆ v${latest} disponible — corré \`npm install -g @jobshimo/browser-link@latest\``,
|
|
30
36
|
options: {
|
|
31
37
|
register: 'Registrar browser-link en un cliente MCP',
|
|
32
38
|
instructions: 'Instrucciones del agente — meter un bloque de triggers en el .md global de Claude/OpenCode/Copilot',
|
|
@@ -44,8 +50,22 @@ const MENU_I18N = {
|
|
|
44
50
|
},
|
|
45
51
|
},
|
|
46
52
|
};
|
|
47
|
-
|
|
53
|
+
/** Default implementation — read live status from the installer registry
|
|
54
|
+
* and project the outdated ones to their display names. Pulled out so the
|
|
55
|
+
* test seam (`outdatedClientNames` prop) has a clean default. */
|
|
56
|
+
function defaultOutdatedClientNames() {
|
|
57
|
+
return statusAll()
|
|
58
|
+
.filter((r) => r.state.kind === 'installed-outdated')
|
|
59
|
+
.map((r) => r.displayName);
|
|
60
|
+
}
|
|
61
|
+
export function MainMenu({ language, onSelect, onSwapLang, onQuit, outdatedClientNames = defaultOutdatedClientNames, updateState, }) {
|
|
48
62
|
const t = MENU_I18N[language];
|
|
63
|
+
// The real hook drives a 6-hourly background check; tests inject a fixed
|
|
64
|
+
// `updateState` instead. We call the hook unconditionally so the React
|
|
65
|
+
// rules-of-hooks are satisfied (no conditional invocation), then ignore
|
|
66
|
+
// its result when the prop override is present.
|
|
67
|
+
const hookState = useBackgroundUpdateCheck();
|
|
68
|
+
const effectiveUpdate = updateState ?? hookState;
|
|
49
69
|
const items = [
|
|
50
70
|
'register',
|
|
51
71
|
'instructions',
|
|
@@ -62,6 +82,16 @@ export function MainMenu({ language, onSelect, onSwapLang, onQuit }) {
|
|
|
62
82
|
'quit',
|
|
63
83
|
].map((a) => ({ value: a, label: t.options[a] }));
|
|
64
84
|
const [idx, setIdx] = useState(0);
|
|
85
|
+
// Banner state is computed on mount. The screen unmounts when the user
|
|
86
|
+
// navigates away (AgentInstructionsView is a different screen), so the
|
|
87
|
+
// next mount re-runs the lookup — after a successful refresh the banner
|
|
88
|
+
// disappears automatically without any explicit invalidation.
|
|
89
|
+
const [outdated, setOutdated] = useState(() => outdatedClientNames());
|
|
90
|
+
// Refresh the banner if the prop function changes between renders (the
|
|
91
|
+
// App may re-create it across language switches or theme changes).
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
setOutdated(outdatedClientNames());
|
|
94
|
+
}, [outdatedClientNames]);
|
|
65
95
|
useInput((input, key) => {
|
|
66
96
|
if (key.upArrow)
|
|
67
97
|
setIdx((i) => (i - 1 + items.length) % items.length);
|
|
@@ -78,7 +108,9 @@ export function MainMenu({ language, onSelect, onSwapLang, onQuit }) {
|
|
|
78
108
|
onQuit();
|
|
79
109
|
else if (input === 'l')
|
|
80
110
|
onSwapLang();
|
|
111
|
+
else if (input === 'i' || input === 'I')
|
|
112
|
+
onSelect('instructions');
|
|
81
113
|
});
|
|
82
|
-
return (_jsxs(Frame, { title: t.title, footer: t.footer, children: [_jsx(Text, { color: "white", bold: true, children: t.prompt }), _jsx(Box, { marginTop: 1, children: _jsx(Menu, { items: items, selectedIndex: idx }) })] }));
|
|
114
|
+
return (_jsxs(Frame, { title: t.title, footer: t.footer, children: [outdated.length > 0 && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "yellow", children: t.outdatedBanner(outdated.join(', ')) }) })), effectiveUpdate.isNewer && effectiveUpdate.latest !== null && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "cyan", children: t.updateBanner(effectiveUpdate.latest) }) })), _jsx(Text, { color: "white", bold: true, children: t.prompt }), _jsx(Box, { marginTop: 1, children: _jsx(Menu, { items: items, selectedIndex: idx }) })] }));
|
|
83
115
|
}
|
|
84
116
|
//# sourceMappingURL=menu.js.map
|
|
@@ -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;
|
|
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,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;A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,MAAM,GAAG,CAAC,IAAI,CACtB,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YAClB,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,YAAE,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAQ,GAC/D,CACP,EACA,eAAe,CAAC,OAAO,IAAI,eAAe,CAAC,MAAM,KAAK,IAAI,IAAI,CAC7D,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YAClB,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,MAAM,CAAC,GAAQ,GAC9D,CACP,EACD,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,kBACrB,CAAC,CAAC,MAAM,GACJ,EACP,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,GAAI,GACtC,IACA,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single semver-ish comparator used by both `agent-instructions/file-ops`
|
|
3
|
+
* (deciding whether an installed block is outdated) and `commands/updates`
|
|
4
|
+
* (deciding whether the npm registry has a newer version). Pre-release
|
|
5
|
+
* suffixes like `0.3.0-beta.1` are NOT handled — both call sites only ever
|
|
6
|
+
* compare plain MAJOR.MINOR.PATCH strings. Anything that does not parse
|
|
7
|
+
* cleanly is treated as the segment integer `0`, which yields a stable
|
|
8
|
+
* (if not semver-correct) ordering rather than throwing.
|
|
9
|
+
*
|
|
10
|
+
* The `null` branch represents the legacy unversioned marker the agent-
|
|
11
|
+
* instructions installer used to write. By construction it predates any
|
|
12
|
+
* real VERSION, so it always compares less than a real string.
|
|
13
|
+
*/
|
|
14
|
+
export declare function compareSemver(a: string | null, b: string | null): number;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single semver-ish comparator used by both `agent-instructions/file-ops`
|
|
3
|
+
* (deciding whether an installed block is outdated) and `commands/updates`
|
|
4
|
+
* (deciding whether the npm registry has a newer version). Pre-release
|
|
5
|
+
* suffixes like `0.3.0-beta.1` are NOT handled — both call sites only ever
|
|
6
|
+
* compare plain MAJOR.MINOR.PATCH strings. Anything that does not parse
|
|
7
|
+
* cleanly is treated as the segment integer `0`, which yields a stable
|
|
8
|
+
* (if not semver-correct) ordering rather than throwing.
|
|
9
|
+
*
|
|
10
|
+
* The `null` branch represents the legacy unversioned marker the agent-
|
|
11
|
+
* instructions installer used to write. By construction it predates any
|
|
12
|
+
* real VERSION, so it always compares less than a real string.
|
|
13
|
+
*/
|
|
14
|
+
export function compareSemver(a, b) {
|
|
15
|
+
if (a === null && b === null)
|
|
16
|
+
return 0;
|
|
17
|
+
if (a === null)
|
|
18
|
+
return -1;
|
|
19
|
+
if (b === null)
|
|
20
|
+
return 1;
|
|
21
|
+
const pa = a.split('.').map((s) => parseInt(s, 10) || 0);
|
|
22
|
+
const pb = b.split('.').map((s) => parseInt(s, 10) || 0);
|
|
23
|
+
const n = Math.max(pa.length, pb.length, 3);
|
|
24
|
+
for (let i = 0; i < n; i++) {
|
|
25
|
+
const da = pa[i] ?? 0;
|
|
26
|
+
const db = pb[i] ?? 0;
|
|
27
|
+
if (da !== db)
|
|
28
|
+
return da - db;
|
|
29
|
+
}
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=semver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semver.js","sourceRoot":"","sources":["../../src/utils/semver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,UAAU,aAAa,CAAC,CAAgB,EAAE,CAAgB;IAC9D,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC,CAAC;IAC1B,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IACzB,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACzD,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACzD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5C,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,EAAE;YAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAChC,CAAC;IACD,OAAO,CAAC,CAAC;AACX,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.5",
|
|
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",
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|