@jobshimo/browser-link 0.21.0 → 0.23.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/README.md +5 -0
- package/dist/agent-instructions/content.js +11 -0
- package/dist/agent-instructions/content.js.map +1 -1
- package/dist/bridge/events.d.ts +1 -1
- package/dist/bridge/events.js +6 -1
- package/dist/bridge/events.js.map +1 -1
- package/dist/bridge/ipc-client.d.ts +6 -7
- package/dist/bridge/ipc-client.js +4 -3
- package/dist/bridge/ipc-client.js.map +1 -1
- package/dist/bridge/protocol.d.ts +28 -16
- package/dist/bridge/protocol.js +23 -7
- package/dist/bridge/protocol.js.map +1 -1
- package/dist/bridge/server.d.ts +8 -10
- package/dist/bridge/server.js.map +1 -1
- package/dist/bridge/ws-bridge.d.ts +53 -18
- package/dist/bridge/ws-bridge.js +129 -21
- package/dist/bridge/ws-bridge.js.map +1 -1
- package/dist/cdp/client.d.ts +35 -0
- package/dist/cdp/client.js +149 -0
- package/dist/cdp/client.js.map +1 -0
- package/dist/cdp/flow.d.ts +178 -0
- package/dist/cdp/flow.js +217 -0
- package/dist/cdp/flow.js.map +1 -0
- package/dist/cdp/gate.d.ts +31 -0
- package/dist/cdp/gate.js +35 -0
- package/dist/cdp/gate.js.map +1 -0
- package/dist/cdp/grant.d.ts +45 -0
- package/dist/cdp/grant.js +81 -0
- package/dist/cdp/grant.js.map +1 -0
- package/dist/cdp/inpage/builders.d.ts +165 -0
- package/dist/cdp/inpage/builders.js +501 -0
- package/dist/cdp/inpage/builders.js.map +1 -0
- package/dist/cdp/inpage/deep-query.d.ts +57 -0
- package/dist/cdp/inpage/deep-query.js +325 -0
- package/dist/cdp/inpage/deep-query.js.map +1 -0
- package/dist/cdp/inpage/dom-helpers.d.ts +27 -0
- package/dist/cdp/inpage/dom-helpers.js +147 -0
- package/dist/cdp/inpage/dom-helpers.js.map +1 -0
- package/dist/cdp/keymap.d.ts +83 -0
- package/dist/cdp/keymap.js +205 -0
- package/dist/cdp/keymap.js.map +1 -0
- package/dist/cdp/settle.d.ts +38 -0
- package/dist/cdp/settle.js +76 -0
- package/dist/cdp/settle.js.map +1 -0
- package/dist/cdp/support.d.ts +26 -0
- package/dist/cdp/support.js +58 -0
- package/dist/cdp/support.js.map +1 -0
- package/dist/cdp/targets.d.ts +54 -0
- package/dist/cdp/targets.js +176 -0
- package/dist/cdp/targets.js.map +1 -0
- package/dist/cdp/transport.d.ts +31 -0
- package/dist/cdp/transport.js +531 -0
- package/dist/cdp/transport.js.map +1 -0
- package/dist/cli.js +64 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/about.js +13 -0
- package/dist/commands/about.js.map +1 -1
- package/dist/commands/cdp.d.ts +28 -0
- package/dist/commands/cdp.js +172 -0
- package/dist/commands/cdp.js.map +1 -0
- package/dist/commands/config.d.ts +97 -0
- package/dist/commands/config.js +228 -13
- package/dist/commands/config.js.map +1 -1
- package/dist/config.d.ts +89 -0
- package/dist/config.js +94 -1
- package/dist/config.js.map +1 -1
- package/dist/extension/background.js +424 -1
- package/dist/extension/background.js.map +1 -1
- package/dist/extension/flow-recording-policy.d.ts +47 -0
- package/dist/extension/flow-recording-policy.js +54 -0
- package/dist/extension/flow-recording-policy.js.map +1 -0
- package/dist/extension/inpage/recorder.d.ts +35 -0
- package/dist/extension/inpage/recorder.js +333 -0
- package/dist/extension/inpage/recorder.js.map +1 -0
- package/dist/extension/manifest.json +1 -1
- package/dist/extension/popup.html +56 -0
- package/dist/extension/popup.js +195 -4
- package/dist/extension/popup.js.map +1 -1
- package/dist/extension/recording.d.ts +158 -0
- package/dist/extension/recording.js +214 -0
- package/dist/extension/recording.js.map +1 -0
- package/dist/messages.d.ts +53 -12
- package/dist/server.js +9 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/browser-definitions.js +4 -3
- package/dist/tools/browser-definitions.js.map +1 -1
- package/dist/tools/browser-dispatch.d.ts +31 -0
- package/dist/tools/browser-dispatch.js +88 -40
- package/dist/tools/browser-dispatch.js.map +1 -1
- package/dist/tools/server-instructions.js +19 -0
- package/dist/tools/server-instructions.js.map +1 -1
- package/package.json +1 -1
package/dist/commands/config.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { MAX_IDLE_TTL_MINUTES, MIN_IDLE_TTL_MINUTES, clampIdleTtlMinutes, loadConfig, saveConfig, } from '../config.js';
|
|
1
|
+
import { MAX_CDP_DIRECT_PORT, MAX_GRANT_TTL_MINUTES, MAX_IDLE_TTL_MINUTES, MIN_CDP_DIRECT_PORT, MIN_GRANT_TTL_MINUTES, MIN_IDLE_TTL_MINUTES, clampCdpDirectPort, clampGrantTtlMinutes, clampIdleTtlMinutes, loadConfig, saveConfig, } from '../config.js';
|
|
2
2
|
import { HandshakeError, IpcClient } from '../bridge/ipc-client.js';
|
|
3
3
|
import { readToken } from '../bridge/token.js';
|
|
4
|
-
|
|
4
|
+
/** Exported so `commands/cdp.ts` can reuse `parseGrantTtlArg`'s exact
|
|
5
|
+
* localized wording for `cdp allow --minutes`'s per-call override — same
|
|
6
|
+
* error/clamp messages `config set cdp-direct.grant-ttl` produces. */
|
|
7
|
+
export const CFG_I18N = {
|
|
5
8
|
en: {
|
|
6
9
|
header: 'browser-link config',
|
|
7
10
|
idleTtlLabel: 'idle-ttl',
|
|
@@ -15,9 +18,27 @@ const CFG_I18N = {
|
|
|
15
18
|
pushedNone: ' No tabs are currently connected — it will apply the next time one connects.',
|
|
16
19
|
pushUnavailable: ' Could not reach a running browser-link primary (not running, or multi-agent mode is off) — it will apply the next time a tab connects.',
|
|
17
20
|
pushRejected: ' A running primary rejected the push (stale or mismatched multi-agent token — it may have just restarted). The value is saved and applies the next time a tab connects.',
|
|
18
|
-
usage: 'Usage: browser-link config get [idle-ttl] | browser-link config set idle-ttl <minutes|never>',
|
|
19
|
-
unknownKey: (key) => `Unknown config key: ${key}. Known keys: idle-ttl.`,
|
|
21
|
+
usage: 'Usage: browser-link config get [idle-ttl|flow-recording|cdp-direct.enabled|cdp-direct.port|cdp-direct.grant-ttl] | browser-link config set idle-ttl <minutes|never> | browser-link config set flow-recording <on|off> | browser-link config set cdp-direct.enabled <true|false> | browser-link config set cdp-direct.port <port> | browser-link config set cdp-direct.grant-ttl <minutes|never>',
|
|
22
|
+
unknownKey: (key) => `Unknown config key: ${key}. Known keys: idle-ttl, flow-recording, cdp-direct.enabled, cdp-direct.port, cdp-direct.grant-ttl.`,
|
|
20
23
|
unknownAction: (action) => `Unknown config action: ${action}. Use get or set.`,
|
|
24
|
+
flowRecordingLabel: 'flow-recording',
|
|
25
|
+
flowRecordingEnabled: 'enabled',
|
|
26
|
+
flowRecordingDisabled: 'disabled',
|
|
27
|
+
flowRecordingNotSetViaCli: "not set via CLI — the extension's own default/popup choice applies (off unless enabled in the popup)",
|
|
28
|
+
invalidFlowRecordingValue: (raw) => `Invalid flow-recording value: "${raw}". Use "on" or "off".`,
|
|
29
|
+
flowRecordingSetSaved: (label) => `Flow recording set to ${label}.`,
|
|
30
|
+
cdpDirectEnabledLabel: 'cdp-direct.enabled',
|
|
31
|
+
cdpDirectPortLabel: 'cdp-direct.port',
|
|
32
|
+
cdpDirectGrantTtlLabel: 'cdp-direct.grant-ttl',
|
|
33
|
+
cdpDirectOn: 'on',
|
|
34
|
+
cdpDirectOff: 'off (default)',
|
|
35
|
+
invalidCdpDirectEnabledValue: (raw) => `Invalid cdp-direct.enabled value: "${raw}". Use "true" or "false".`,
|
|
36
|
+
cdpDirectEnabledSetSaved: (label) => `cdp-direct.enabled set to ${label}. This alone does not let an agent use a cdp: tab — run \`browser-link cdp allow\` to also grant it.`,
|
|
37
|
+
invalidCdpDirectPortValue: (raw) => `Invalid cdp-direct.port value: "${raw}". Use a whole number (${MIN_CDP_DIRECT_PORT}-${MAX_CDP_DIRECT_PORT}).`,
|
|
38
|
+
cdpDirectPortSetSaved: (port) => `cdp-direct.port set to ${port}.`,
|
|
39
|
+
invalidGrantTtlValue: (raw) => `Invalid cdp-direct.grant-ttl value: "${raw}". Use a whole number of minutes (${MIN_GRANT_TTL_MINUTES}-${MAX_GRANT_TTL_MINUTES}) or "never".`,
|
|
40
|
+
grantTtlNever: 'never (grants never expire until revoked — reduces the security posture)',
|
|
41
|
+
cdpDirectGrantTtlSetSaved: (label) => `cdp-direct.grant-ttl (default for \`cdp allow\`) set to ${label}.`,
|
|
21
42
|
},
|
|
22
43
|
es: {
|
|
23
44
|
header: 'Configuración de browser-link',
|
|
@@ -32,9 +53,27 @@ const CFG_I18N = {
|
|
|
32
53
|
pushedNone: ' No hay pestañas conectadas actualmente — se aplicará la próxima vez que una se conecte.',
|
|
33
54
|
pushUnavailable: ' No se pudo contactar a un browser-link primary en ejecución (no está corriendo, o el modo multi-agente está apagado) — se aplicará la próxima vez que una pestaña se conecte.',
|
|
34
55
|
pushRejected: ' Un primary en ejecución rechazó el push (token multi-agente obsoleto o no coincidente — puede haberse reiniciado recién). El valor quedó guardado y se aplicará la próxima vez que una pestaña se conecte.',
|
|
35
|
-
usage: 'Uso: browser-link config get [idle-ttl] | browser-link config set idle-ttl <minutos|never>',
|
|
36
|
-
unknownKey: (key) => `Clave de configuración desconocida: ${key}. Claves conocidas: idle-ttl.`,
|
|
56
|
+
usage: 'Uso: browser-link config get [idle-ttl|flow-recording|cdp-direct.enabled|cdp-direct.port|cdp-direct.grant-ttl] | browser-link config set idle-ttl <minutos|never> | browser-link config set flow-recording <on|off> | browser-link config set cdp-direct.enabled <true|false> | browser-link config set cdp-direct.port <puerto> | browser-link config set cdp-direct.grant-ttl <minutos|never>',
|
|
57
|
+
unknownKey: (key) => `Clave de configuración desconocida: ${key}. Claves conocidas: idle-ttl, flow-recording, cdp-direct.enabled, cdp-direct.port, cdp-direct.grant-ttl.`,
|
|
37
58
|
unknownAction: (action) => `Acción de config desconocida: ${action}. Usá get o set.`,
|
|
59
|
+
flowRecordingLabel: 'flow-recording',
|
|
60
|
+
flowRecordingEnabled: 'habilitado',
|
|
61
|
+
flowRecordingDisabled: 'deshabilitado',
|
|
62
|
+
flowRecordingNotSetViaCli: 'no configurado por CLI — se aplica el valor por defecto o el elegido en el popup de la extensión (deshabilitado salvo que se haya habilitado en el popup)',
|
|
63
|
+
invalidFlowRecordingValue: (raw) => `Valor de flow-recording inválido: "${raw}". Usá "on" u "off".`,
|
|
64
|
+
flowRecordingSetSaved: (label) => `Grabación de flows configurada a ${label}.`,
|
|
65
|
+
cdpDirectEnabledLabel: 'cdp-direct.enabled',
|
|
66
|
+
cdpDirectPortLabel: 'cdp-direct.port',
|
|
67
|
+
cdpDirectGrantTtlLabel: 'cdp-direct.grant-ttl',
|
|
68
|
+
cdpDirectOn: 'activado',
|
|
69
|
+
cdpDirectOff: 'desactivado (por defecto)',
|
|
70
|
+
invalidCdpDirectEnabledValue: (raw) => `Valor de cdp-direct.enabled inválido: "${raw}". Usá "true" o "false".`,
|
|
71
|
+
cdpDirectEnabledSetSaved: (label) => `cdp-direct.enabled configurado a ${label}. Esto solo no permite que un agente use una pestaña cdp: — corré \`browser-link cdp allow\` para además otorgar el permiso.`,
|
|
72
|
+
invalidCdpDirectPortValue: (raw) => `Valor de cdp-direct.port inválido: "${raw}". Usá un número entero (${MIN_CDP_DIRECT_PORT}-${MAX_CDP_DIRECT_PORT}).`,
|
|
73
|
+
cdpDirectPortSetSaved: (port) => `cdp-direct.port configurado a ${port}.`,
|
|
74
|
+
invalidGrantTtlValue: (raw) => `Valor de cdp-direct.grant-ttl inválido: "${raw}". Usá un número entero de minutos (${MIN_GRANT_TTL_MINUTES}-${MAX_GRANT_TTL_MINUTES}) o "never".`,
|
|
75
|
+
grantTtlNever: 'nunca (los permisos no expiran hasta revocarlos — reduce la postura de seguridad)',
|
|
76
|
+
cdpDirectGrantTtlSetSaved: (label) => `cdp-direct.grant-ttl (valor por defecto para \`cdp allow\`) configurado a ${label}.`,
|
|
38
77
|
},
|
|
39
78
|
};
|
|
40
79
|
/** One formatted line describing the current `idleTtlMinutes` state, shared
|
|
@@ -50,9 +89,55 @@ export function getIdleTtlLine(language = 'en') {
|
|
|
50
89
|
: t.minutes(cfg.idleTtlMinutes);
|
|
51
90
|
return ` ${t.idleTtlLabel} ${value}`;
|
|
52
91
|
}
|
|
92
|
+
/** One formatted line describing the current `flowRecordingEnabled` state —
|
|
93
|
+
* mirrors `getIdleTtlLine` exactly, shared by `config get` (no key) and
|
|
94
|
+
* `config get flow-recording`. */
|
|
95
|
+
export function getFlowRecordingLine(language = 'en') {
|
|
96
|
+
const t = CFG_I18N[language];
|
|
97
|
+
const cfg = loadConfig();
|
|
98
|
+
const value = cfg.flowRecordingEnabled === undefined
|
|
99
|
+
? t.flowRecordingNotSetViaCli
|
|
100
|
+
: cfg.flowRecordingEnabled
|
|
101
|
+
? t.flowRecordingEnabled
|
|
102
|
+
: t.flowRecordingDisabled;
|
|
103
|
+
return ` ${t.flowRecordingLabel} ${value}`;
|
|
104
|
+
}
|
|
105
|
+
/** One formatted line describing the current `cdpDirectEnabled` state. */
|
|
106
|
+
export function getCdpDirectEnabledLine(language = 'en') {
|
|
107
|
+
const t = CFG_I18N[language];
|
|
108
|
+
const cfg = loadConfig();
|
|
109
|
+
const value = cfg.cdpDirectEnabled === true ? t.cdpDirectOn : t.cdpDirectOff;
|
|
110
|
+
return ` ${t.cdpDirectEnabledLabel} ${value}`;
|
|
111
|
+
}
|
|
112
|
+
/** One formatted line describing the current `cdpDirectPort` state. */
|
|
113
|
+
export function getCdpDirectPortLine(language = 'en') {
|
|
114
|
+
const t = CFG_I18N[language];
|
|
115
|
+
const cfg = loadConfig();
|
|
116
|
+
return ` ${t.cdpDirectPortLabel} ${cfg.cdpDirectPort}`;
|
|
117
|
+
}
|
|
118
|
+
/** One formatted line describing the current `cdpDirectGrantTtlMinutes`
|
|
119
|
+
* state — the DEFAULT lifetime `browser-link cdp allow` applies when no
|
|
120
|
+
* `--minutes` override is passed, not the state of any grant itself (see
|
|
121
|
+
* `browser-link cdp status` for that). */
|
|
122
|
+
export function getCdpDirectGrantTtlLine(language = 'en') {
|
|
123
|
+
const t = CFG_I18N[language];
|
|
124
|
+
const cfg = loadConfig();
|
|
125
|
+
const value = cfg.cdpDirectGrantTtlMinutes === 0
|
|
126
|
+
? t.grantTtlNever
|
|
127
|
+
: t.minutes(cfg.cdpDirectGrantTtlMinutes ?? 60);
|
|
128
|
+
return ` ${t.cdpDirectGrantTtlLabel} ${value}`;
|
|
129
|
+
}
|
|
53
130
|
export function listConfig(language = 'en') {
|
|
54
131
|
const t = CFG_I18N[language];
|
|
55
|
-
return [
|
|
132
|
+
return [
|
|
133
|
+
t.header,
|
|
134
|
+
'',
|
|
135
|
+
getIdleTtlLine(language),
|
|
136
|
+
getFlowRecordingLine(language),
|
|
137
|
+
getCdpDirectEnabledLine(language),
|
|
138
|
+
getCdpDirectPortLine(language),
|
|
139
|
+
getCdpDirectGrantTtlLine(language),
|
|
140
|
+
].join('\n');
|
|
56
141
|
}
|
|
57
142
|
/**
|
|
58
143
|
* Parse the CLI's raw `<minutes|never>` argument.
|
|
@@ -87,7 +172,11 @@ function parseIdleTtlArg(raw, t) {
|
|
|
87
172
|
* hello-reject (stale/mismatched token, version mismatch) proves a primary
|
|
88
173
|
* IS running and gets `pushRejected`, while connection-refused / timeout /
|
|
89
174
|
* missing-token-file — where "no primary, or multi-agent off" is the
|
|
90
|
-
* honest reading — get `pushUnavailable`.
|
|
175
|
+
* honest reading — get `pushUnavailable`.
|
|
176
|
+
*
|
|
177
|
+
* `settings` accepts the same partial shape `SettingsPushPayload` does — an
|
|
178
|
+
* idle-ttl pair, a flow-recording pair, or both — so both `setIdleTtl` and
|
|
179
|
+
* `setFlowRecording` share this one push path instead of two near-copies. */
|
|
91
180
|
async function tryPushLive(settings, t, ipcOptions = {}) {
|
|
92
181
|
const token = readToken();
|
|
93
182
|
if (!token)
|
|
@@ -132,6 +221,122 @@ export async function setIdleTtl(rawValue, language = 'en', ipcOptions = {}) {
|
|
|
132
221
|
const pushMessage = await tryPushLive({ idleTtlMinutes: minutes, updatedAt }, t, ipcOptions);
|
|
133
222
|
return t.setSaved(label) + pushMessage;
|
|
134
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* Parse the CLI's raw `<on|off>` argument for `config set flow-recording`.
|
|
226
|
+
* Mirrors `parseIdleTtlArg`'s "tell the user, don't guess" philosophy: a
|
|
227
|
+
* handful of common truthy/falsy spellings are accepted, anything else is a
|
|
228
|
+
* clear error instead of a silent default.
|
|
229
|
+
*/
|
|
230
|
+
function parseFlowRecordingArg(raw, t) {
|
|
231
|
+
const normalized = raw.trim().toLowerCase();
|
|
232
|
+
if (['on', 'true', 'enabled', 'enable', '1'].includes(normalized))
|
|
233
|
+
return true;
|
|
234
|
+
if (['off', 'false', 'disabled', 'disable', '0'].includes(normalized))
|
|
235
|
+
return false;
|
|
236
|
+
throw new Error(t.invalidFlowRecordingValue(raw));
|
|
237
|
+
}
|
|
238
|
+
export async function setFlowRecording(rawValue, language = 'en', ipcOptions = {}) {
|
|
239
|
+
const t = CFG_I18N[language];
|
|
240
|
+
const enabled = parseFlowRecordingArg(rawValue, t);
|
|
241
|
+
const updatedAt = Date.now();
|
|
242
|
+
saveConfig({ flowRecordingEnabled: enabled, flowRecordingUpdatedAt: updatedAt });
|
|
243
|
+
const label = enabled ? t.flowRecordingEnabled : t.flowRecordingDisabled;
|
|
244
|
+
const pushMessage = await tryPushLive({ flowRecordingEnabled: enabled, flowRecordingUpdatedAt: updatedAt }, t, ipcOptions);
|
|
245
|
+
return t.flowRecordingSetSaved(label) + pushMessage;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Parse the CLI's raw `<true|false>` argument for
|
|
249
|
+
* `config set cdp-direct.enabled`. No IPC live-push counterpart — unlike
|
|
250
|
+
* idle-ttl/flow-recording, cdp-direct has no popup-side value to race
|
|
251
|
+
* against, so this only ever writes config.json.
|
|
252
|
+
*/
|
|
253
|
+
function parseCdpDirectEnabledArg(raw, t) {
|
|
254
|
+
const normalized = raw.trim().toLowerCase();
|
|
255
|
+
if (['true', 'on', '1'].includes(normalized))
|
|
256
|
+
return true;
|
|
257
|
+
if (['false', 'off', '0'].includes(normalized))
|
|
258
|
+
return false;
|
|
259
|
+
throw new Error(t.invalidCdpDirectEnabledValue(raw));
|
|
260
|
+
}
|
|
261
|
+
export function setCdpDirectEnabled(rawValue, language = 'en') {
|
|
262
|
+
const t = CFG_I18N[language];
|
|
263
|
+
const enabled = parseCdpDirectEnabledArg(rawValue, t);
|
|
264
|
+
saveConfig({ cdpDirectEnabled: enabled });
|
|
265
|
+
return t.cdpDirectEnabledSetSaved(enabled ? t.cdpDirectOn : t.cdpDirectOff);
|
|
266
|
+
}
|
|
267
|
+
/** Parse the CLI's raw `<port>` argument for `config set cdp-direct.port`.
|
|
268
|
+
* Same "tell the user, don't guess" philosophy as `parseIdleTtlArg`: a
|
|
269
|
+
* genuinely unparsable value is rejected outright, an out-of-range integer
|
|
270
|
+
* is clamped to the boundary with a note. */
|
|
271
|
+
function parseCdpDirectPortArg(raw, t) {
|
|
272
|
+
const parsed = Number(raw.trim());
|
|
273
|
+
if (!Number.isFinite(parsed) || !Number.isInteger(parsed)) {
|
|
274
|
+
throw new Error(t.invalidCdpDirectPortValue(raw));
|
|
275
|
+
}
|
|
276
|
+
if (parsed < MIN_CDP_DIRECT_PORT || parsed > MAX_CDP_DIRECT_PORT) {
|
|
277
|
+
const clamped = Math.min(Math.max(parsed, MIN_CDP_DIRECT_PORT), MAX_CDP_DIRECT_PORT);
|
|
278
|
+
return { port: clamped, note: t.clampedNote(parsed, clamped) };
|
|
279
|
+
}
|
|
280
|
+
return { port: parsed, note: '' };
|
|
281
|
+
}
|
|
282
|
+
export function setCdpDirectPort(rawValue, language = 'en') {
|
|
283
|
+
const t = CFG_I18N[language];
|
|
284
|
+
const { port: parsedPort, note } = parseCdpDirectPortArg(rawValue, t);
|
|
285
|
+
const port = clampCdpDirectPort(parsedPort);
|
|
286
|
+
saveConfig({ cdpDirectPort: port });
|
|
287
|
+
return t.cdpDirectPortSetSaved(port) + note;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Parse the CLI's raw `<minutes|never>` argument for
|
|
291
|
+
* `config set cdp-direct.grant-ttl` — mirrors `parseIdleTtlArg` exactly,
|
|
292
|
+
* with the grant's own bounds/wording. Exported so `commands/cdp.ts` can
|
|
293
|
+
* reuse the SAME parsing for `cdp allow --minutes`'s per-call override —
|
|
294
|
+
* one implementation of "what counts as a valid TTL argument", not two
|
|
295
|
+
* that could drift.
|
|
296
|
+
*/
|
|
297
|
+
export function parseGrantTtlArg(raw, t) {
|
|
298
|
+
const normalized = raw.trim().toLowerCase();
|
|
299
|
+
if (normalized === 'never' || normalized === '0')
|
|
300
|
+
return { minutes: 0, note: '' };
|
|
301
|
+
const parsed = Number(normalized);
|
|
302
|
+
if (!Number.isFinite(parsed) || !Number.isInteger(parsed)) {
|
|
303
|
+
throw new Error(t.invalidGrantTtlValue(raw));
|
|
304
|
+
}
|
|
305
|
+
if (parsed < MIN_GRANT_TTL_MINUTES || parsed > MAX_GRANT_TTL_MINUTES) {
|
|
306
|
+
const clamped = Math.min(Math.max(parsed, MIN_GRANT_TTL_MINUTES), MAX_GRANT_TTL_MINUTES);
|
|
307
|
+
return { minutes: clamped, note: t.clampedNote(parsed, clamped) };
|
|
308
|
+
}
|
|
309
|
+
return { minutes: parsed, note: '' };
|
|
310
|
+
}
|
|
311
|
+
export function setCdpDirectGrantTtl(rawValue, language = 'en') {
|
|
312
|
+
const t = CFG_I18N[language];
|
|
313
|
+
const { minutes: parsedMinutes, note } = parseGrantTtlArg(rawValue, t);
|
|
314
|
+
const minutes = clampGrantTtlMinutes(parsedMinutes);
|
|
315
|
+
saveConfig({ cdpDirectGrantTtlMinutes: minutes });
|
|
316
|
+
const label = (minutes === 0 ? t.grantTtlNever : t.minutes(minutes)) + note;
|
|
317
|
+
return t.cdpDirectGrantTtlSetSaved(label);
|
|
318
|
+
}
|
|
319
|
+
/** Config keys `cdp-direct.*` this module knows — shared by `get`/`set`
|
|
320
|
+
* dispatch below so the branching stays a lookup, not repeated equality
|
|
321
|
+
* chains. */
|
|
322
|
+
const CDP_DIRECT_KEYS = ['cdp-direct.enabled', 'cdp-direct.port', 'cdp-direct.grant-ttl'];
|
|
323
|
+
function isCdpDirectKey(key) {
|
|
324
|
+
return CDP_DIRECT_KEYS.includes(key);
|
|
325
|
+
}
|
|
326
|
+
function getCdpDirectLine(key, language) {
|
|
327
|
+
if (key === 'cdp-direct.enabled')
|
|
328
|
+
return getCdpDirectEnabledLine(language);
|
|
329
|
+
if (key === 'cdp-direct.port')
|
|
330
|
+
return getCdpDirectPortLine(language);
|
|
331
|
+
return getCdpDirectGrantTtlLine(language);
|
|
332
|
+
}
|
|
333
|
+
function setCdpDirectKey(key, value, language) {
|
|
334
|
+
if (key === 'cdp-direct.enabled')
|
|
335
|
+
return setCdpDirectEnabled(value, language);
|
|
336
|
+
if (key === 'cdp-direct.port')
|
|
337
|
+
return setCdpDirectPort(value, language);
|
|
338
|
+
return setCdpDirectGrantTtl(value, language);
|
|
339
|
+
}
|
|
135
340
|
export async function runConfigCommand(argv, language = 'en') {
|
|
136
341
|
const t = CFG_I18N[language];
|
|
137
342
|
const action = argv.at(0);
|
|
@@ -142,16 +347,26 @@ export async function runConfigCommand(argv, language = 'en') {
|
|
|
142
347
|
return listConfig(language);
|
|
143
348
|
if (key === 'idle-ttl')
|
|
144
349
|
return getIdleTtlLine(language);
|
|
350
|
+
if (key === 'flow-recording')
|
|
351
|
+
return getFlowRecordingLine(language);
|
|
352
|
+
if (isCdpDirectKey(key))
|
|
353
|
+
return getCdpDirectLine(key, language);
|
|
145
354
|
throw new Error(t.unknownKey(key));
|
|
146
355
|
}
|
|
147
356
|
if (action === 'set') {
|
|
148
357
|
if (key === undefined)
|
|
149
358
|
throw new Error(t.usage);
|
|
150
|
-
if (key
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
359
|
+
if (key === 'idle-ttl' || key === 'flow-recording') {
|
|
360
|
+
if (value === undefined)
|
|
361
|
+
throw new Error(t.usage);
|
|
362
|
+
return key === 'idle-ttl' ? setIdleTtl(value, language) : setFlowRecording(value, language);
|
|
363
|
+
}
|
|
364
|
+
if (isCdpDirectKey(key)) {
|
|
365
|
+
if (value === undefined)
|
|
366
|
+
throw new Error(t.usage);
|
|
367
|
+
return setCdpDirectKey(key, value, language);
|
|
368
|
+
}
|
|
369
|
+
throw new Error(t.unknownKey(key));
|
|
155
370
|
}
|
|
156
371
|
throw new Error(t.unknownAction(action));
|
|
157
372
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA+C/C,MAAM,QAAQ,GAAiC;IAC7C,EAAE,EAAE;QACF,MAAM,EAAE,qBAAqB;QAC7B,YAAY,EAAE,UAAU;QACxB,KAAK,EAAE,kCAAkC;QACzC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM;QAC1B,YAAY,EACV,yGAAyG;QAC3G,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CACpB,4BAA4B,GAAG,qCAAqC,oBAAoB,IAAI,oBAAoB,eAAe;QACjI,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,kBAAkB,QAAQ,OAAO,OAAO,GAAG;QAC/E,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,8BAA8B,KAAK,GAAG;QAC3D,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,0BAA0B,CAAC,oBAAoB;QAClE,UAAU,EAAE,8EAA8E;QAC1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GAAG,EAAE,QAAQ,CAAC,CAAC;QAChE,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACrB,IAAI,GAAG,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,gBAAgB,EAAE,CAAC;YACnD,IAAI,KAAK,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAClD,OAAO,GAAG,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC9F,CAAC;QACD,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,KAAK,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAClD,OAAO,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC/C,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3C,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -51,6 +51,49 @@ export interface BrowserLinkConfig {
|
|
|
51
51
|
* Always set together with `idleTtlMinutes` — never one without the other.
|
|
52
52
|
*/
|
|
53
53
|
idleTtlUpdatedAt?: number;
|
|
54
|
+
/**
|
|
55
|
+
* CLI-side mirror of the extension's opt-in flow-recording toggle (see
|
|
56
|
+
* `packages/extension/src/flow-recording-policy.ts`). Set via
|
|
57
|
+
* `browser-link config set flow-recording <on|off>`. Deliberately left
|
|
58
|
+
* `undefined` — NOT defaulted to `false` here — when the CLI has never
|
|
59
|
+
* touched it, mirroring `idleTtlMinutes`'s rationale exactly: the WS
|
|
60
|
+
* bridge only pushes a `settings.update` for this field when it is
|
|
61
|
+
* explicitly set, so a popup-only user never sees a spurious overwrite of
|
|
62
|
+
* their own choice. The extension's OWN default (recording OFF until the
|
|
63
|
+
* user opts in) applies regardless of whether the CLI has ever run.
|
|
64
|
+
*/
|
|
65
|
+
flowRecordingEnabled?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Epoch-ms timestamp of the last `flowRecordingEnabled` write from the
|
|
68
|
+
* CLI. Sent alongside `flowRecordingEnabled` in every `settings.update`
|
|
69
|
+
* push, same last-write-wins contract as `idleTtlUpdatedAt` — always set
|
|
70
|
+
* together, independent of the idle-TTL pair.
|
|
71
|
+
*/
|
|
72
|
+
flowRecordingUpdatedAt?: number;
|
|
73
|
+
/**
|
|
74
|
+
* cdp-direct mode: let the server drive Chrome tabs DIRECTLY over a
|
|
75
|
+
* user-launched `--remote-debugging-port`, bypassing the extension
|
|
76
|
+
* entirely. Off by default and — even when on — gated behind a separate,
|
|
77
|
+
* explicit, time-boxed human grant (see `cdp/grant.ts`, `cdp/gate.ts`):
|
|
78
|
+
* an agent can never enable this itself, and enabling it here alone is
|
|
79
|
+
* NOT enough to let a tool touch a `cdp:` tab. Set via
|
|
80
|
+
* `browser-link config set cdp-direct.enabled <true|false>`.
|
|
81
|
+
*/
|
|
82
|
+
cdpDirectEnabled?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Loopback port the server dials for cdp-direct discovery/connections.
|
|
85
|
+
* The HOST is never configurable — always `127.0.0.1` — only the port
|
|
86
|
+
* is. Set via `browser-link config set cdp-direct.port <port>`.
|
|
87
|
+
*/
|
|
88
|
+
cdpDirectPort?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Default lifetime, in minutes, of a `browser-link cdp allow` grant when
|
|
91
|
+
* no `--minutes` override is passed on that command. `0` ("never") is
|
|
92
|
+
* allowed but reduces the security posture — documented as such in the
|
|
93
|
+
* CLI help and the README. Set via
|
|
94
|
+
* `browser-link config set cdp-direct.grant-ttl <minutes|never>`.
|
|
95
|
+
*/
|
|
96
|
+
cdpDirectGrantTtlMinutes?: number;
|
|
54
97
|
}
|
|
55
98
|
/** Safety-rail bounds mirrored from the extension's `idle-policy.ts` — kept
|
|
56
99
|
* as an independent copy (not a shared import) for the same reason
|
|
@@ -60,6 +103,52 @@ export interface BrowserLinkConfig {
|
|
|
60
103
|
export declare const MIN_IDLE_TTL_MINUTES = 1;
|
|
61
104
|
export declare const MAX_IDLE_TTL_MINUTES = 1440;
|
|
62
105
|
export declare const DEFAULT_IDLE_TTL_MINUTES = 30;
|
|
106
|
+
/** cdp-direct bounds — same clamp-at-the-boundary philosophy as the
|
|
107
|
+
* idle-TTL constants above, independent copies since the two settings are
|
|
108
|
+
* unrelated. */
|
|
109
|
+
export declare const DEFAULT_CDP_DIRECT_PORT = 9222;
|
|
110
|
+
export declare const MIN_CDP_DIRECT_PORT = 1;
|
|
111
|
+
export declare const MAX_CDP_DIRECT_PORT = 65535;
|
|
112
|
+
export declare const MIN_GRANT_TTL_MINUTES = 1;
|
|
113
|
+
export declare const MAX_GRANT_TTL_MINUTES = 1440;
|
|
114
|
+
export declare const DEFAULT_GRANT_TTL_MINUTES = 60;
|
|
115
|
+
/** Defensive safety net for a `cdp-direct.grant-ttl` value THE USER NEVER
|
|
116
|
+
* TYPED (a corrupted config.json, a hand-edited file) — mirrors
|
|
117
|
+
* `clampIdleTtlMinutes` exactly: `0` ("never expires") passes through
|
|
118
|
+
* untouched, anything else malformed or out of range falls back to
|
|
119
|
+
* `DEFAULT_GRANT_TTL_MINUTES` rather than being snapped to the nearest
|
|
120
|
+
* boundary. `commands/cdp.ts` applies its own user-facing clamp-with-note
|
|
121
|
+
* for values typed at the CLI right now, the same split idle-ttl uses
|
|
122
|
+
* between this module and `commands/config.ts`. */
|
|
123
|
+
export declare function clampGrantTtlMinutes(value: number): number;
|
|
124
|
+
/** Same defensive-fallback philosophy as `clampGrantTtlMinutes`, for the
|
|
125
|
+
* cdp-direct port. No "never" sentinel here — a port is always a port.
|
|
126
|
+
* Used by the CLI `config set cdp-direct.port` path, where the value has
|
|
127
|
+
* already been parsed from a terminal argument. For the READ path — where
|
|
128
|
+
* the value comes straight from an untrusted config.json and is about to be
|
|
129
|
+
* interpolated into a URL — use `sanitizeCdpPort` instead. */
|
|
130
|
+
export declare function clampCdpDirectPort(value: number): number;
|
|
131
|
+
/**
|
|
132
|
+
* Trust-boundary sanitizer for the cdp-direct port. config.json is UNTRUSTED
|
|
133
|
+
* (hand-edited or corrupted), and the port is interpolated into
|
|
134
|
+
* `http://127.0.0.1:<port>/...` and `ws://127.0.0.1:<port>/...` discovery /
|
|
135
|
+
* connection URLs. A value like the STRING `"9222@attacker.com"` would, by
|
|
136
|
+
* URL userinfo syntax, resolve to host `attacker.com` — an off-host SSRF
|
|
137
|
+
* breakout despite the hardcoded loopback literal (the plain `?? 9222`
|
|
138
|
+
* fallback only ever caught null/undefined, never a malformed string).
|
|
139
|
+
*
|
|
140
|
+
* This coerces the raw value with `Number()` — NOT `parseInt`, which would
|
|
141
|
+
* read `"9222@attacker.com"` as `9222` and quietly accept it — and returns
|
|
142
|
+
* it ONLY when it is a whole port in `[1, 65535]`. Anything else (a string
|
|
143
|
+
* with trailing garbage, a float, `NaN`, out of range, a non-number) falls
|
|
144
|
+
* back to the default. The return is ALWAYS a fresh validated integer, never
|
|
145
|
+
* the raw value, so no attacker-controlled text can ever reach URL
|
|
146
|
+
* construction — this is also the numeric barrier that breaks CodeQL's
|
|
147
|
+
* `js/file-access-to-http` taint flow. Applied on every read (via
|
|
148
|
+
* `withDefaults`, so `cfg.cdpDirectPort` is valid by construction) AND again
|
|
149
|
+
* at each URL construction site as defense in depth.
|
|
150
|
+
*/
|
|
151
|
+
export declare function sanitizeCdpPort(raw: unknown): number;
|
|
63
152
|
/**
|
|
64
153
|
* Clamp a CLI-provided idle-TTL value the same way the extension clamps a
|
|
65
154
|
* stored one: `0` ("never") passes through untouched; a non-integer, an
|
package/dist/config.js
CHANGED
|
@@ -10,6 +10,72 @@ import { sanitizeDisabledTools } from './permissions.js';
|
|
|
10
10
|
export const MIN_IDLE_TTL_MINUTES = 1;
|
|
11
11
|
export const MAX_IDLE_TTL_MINUTES = 1440;
|
|
12
12
|
export const DEFAULT_IDLE_TTL_MINUTES = 30;
|
|
13
|
+
/** cdp-direct bounds — same clamp-at-the-boundary philosophy as the
|
|
14
|
+
* idle-TTL constants above, independent copies since the two settings are
|
|
15
|
+
* unrelated. */
|
|
16
|
+
export const DEFAULT_CDP_DIRECT_PORT = 9222;
|
|
17
|
+
export const MIN_CDP_DIRECT_PORT = 1;
|
|
18
|
+
export const MAX_CDP_DIRECT_PORT = 65535;
|
|
19
|
+
export const MIN_GRANT_TTL_MINUTES = 1;
|
|
20
|
+
export const MAX_GRANT_TTL_MINUTES = 1440;
|
|
21
|
+
export const DEFAULT_GRANT_TTL_MINUTES = 60;
|
|
22
|
+
/** Defensive safety net for a `cdp-direct.grant-ttl` value THE USER NEVER
|
|
23
|
+
* TYPED (a corrupted config.json, a hand-edited file) — mirrors
|
|
24
|
+
* `clampIdleTtlMinutes` exactly: `0` ("never expires") passes through
|
|
25
|
+
* untouched, anything else malformed or out of range falls back to
|
|
26
|
+
* `DEFAULT_GRANT_TTL_MINUTES` rather than being snapped to the nearest
|
|
27
|
+
* boundary. `commands/cdp.ts` applies its own user-facing clamp-with-note
|
|
28
|
+
* for values typed at the CLI right now, the same split idle-ttl uses
|
|
29
|
+
* between this module and `commands/config.ts`. */
|
|
30
|
+
export function clampGrantTtlMinutes(value) {
|
|
31
|
+
if (value === 0)
|
|
32
|
+
return 0;
|
|
33
|
+
if (!Number.isFinite(value) || !Number.isInteger(value))
|
|
34
|
+
return DEFAULT_GRANT_TTL_MINUTES;
|
|
35
|
+
if (value < MIN_GRANT_TTL_MINUTES || value > MAX_GRANT_TTL_MINUTES)
|
|
36
|
+
return DEFAULT_GRANT_TTL_MINUTES;
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
/** Same defensive-fallback philosophy as `clampGrantTtlMinutes`, for the
|
|
40
|
+
* cdp-direct port. No "never" sentinel here — a port is always a port.
|
|
41
|
+
* Used by the CLI `config set cdp-direct.port` path, where the value has
|
|
42
|
+
* already been parsed from a terminal argument. For the READ path — where
|
|
43
|
+
* the value comes straight from an untrusted config.json and is about to be
|
|
44
|
+
* interpolated into a URL — use `sanitizeCdpPort` instead. */
|
|
45
|
+
export function clampCdpDirectPort(value) {
|
|
46
|
+
if (!Number.isFinite(value) || !Number.isInteger(value))
|
|
47
|
+
return DEFAULT_CDP_DIRECT_PORT;
|
|
48
|
+
if (value < MIN_CDP_DIRECT_PORT || value > MAX_CDP_DIRECT_PORT)
|
|
49
|
+
return DEFAULT_CDP_DIRECT_PORT;
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Trust-boundary sanitizer for the cdp-direct port. config.json is UNTRUSTED
|
|
54
|
+
* (hand-edited or corrupted), and the port is interpolated into
|
|
55
|
+
* `http://127.0.0.1:<port>/...` and `ws://127.0.0.1:<port>/...` discovery /
|
|
56
|
+
* connection URLs. A value like the STRING `"9222@attacker.com"` would, by
|
|
57
|
+
* URL userinfo syntax, resolve to host `attacker.com` — an off-host SSRF
|
|
58
|
+
* breakout despite the hardcoded loopback literal (the plain `?? 9222`
|
|
59
|
+
* fallback only ever caught null/undefined, never a malformed string).
|
|
60
|
+
*
|
|
61
|
+
* This coerces the raw value with `Number()` — NOT `parseInt`, which would
|
|
62
|
+
* read `"9222@attacker.com"` as `9222` and quietly accept it — and returns
|
|
63
|
+
* it ONLY when it is a whole port in `[1, 65535]`. Anything else (a string
|
|
64
|
+
* with trailing garbage, a float, `NaN`, out of range, a non-number) falls
|
|
65
|
+
* back to the default. The return is ALWAYS a fresh validated integer, never
|
|
66
|
+
* the raw value, so no attacker-controlled text can ever reach URL
|
|
67
|
+
* construction — this is also the numeric barrier that breaks CodeQL's
|
|
68
|
+
* `js/file-access-to-http` taint flow. Applied on every read (via
|
|
69
|
+
* `withDefaults`, so `cfg.cdpDirectPort` is valid by construction) AND again
|
|
70
|
+
* at each URL construction site as defense in depth.
|
|
71
|
+
*/
|
|
72
|
+
export function sanitizeCdpPort(raw) {
|
|
73
|
+
const n = Number(raw);
|
|
74
|
+
if (Number.isInteger(n) && n >= MIN_CDP_DIRECT_PORT && n <= MAX_CDP_DIRECT_PORT) {
|
|
75
|
+
return n;
|
|
76
|
+
}
|
|
77
|
+
return DEFAULT_CDP_DIRECT_PORT;
|
|
78
|
+
}
|
|
13
79
|
/**
|
|
14
80
|
* Clamp a CLI-provided idle-TTL value the same way the extension clamps a
|
|
15
81
|
* stored one: `0` ("never") passes through untouched; a non-integer, an
|
|
@@ -32,6 +98,7 @@ export function clampIdleTtlMinutes(value) {
|
|
|
32
98
|
* when the user overrides the default, keeping the on-disk config minimal. */
|
|
33
99
|
const DEFAULT_MULTI_AGENT = true;
|
|
34
100
|
const DEFAULT_AUTO_REELECT = true;
|
|
101
|
+
const DEFAULT_CDP_DIRECT_ENABLED = false;
|
|
35
102
|
function configFile() {
|
|
36
103
|
return join(getDataDir(), 'config.json');
|
|
37
104
|
}
|
|
@@ -43,7 +110,21 @@ function withDefaults(cfg) {
|
|
|
43
110
|
// has no effect, so the effective value is forced to false to avoid any
|
|
44
111
|
// ambiguity for the consumer.
|
|
45
112
|
const autoReelect = multiAgent ? (cfg.autoReelect ?? DEFAULT_AUTO_REELECT) : false;
|
|
46
|
-
|
|
113
|
+
const cdpDirectEnabled = cfg.cdpDirectEnabled ?? DEFAULT_CDP_DIRECT_ENABLED;
|
|
114
|
+
// sanitizeCdpPort (not `?? DEFAULT`) so cfg.cdpDirectPort is ALWAYS a valid
|
|
115
|
+
// integer by construction — an untrusted config.json string that would
|
|
116
|
+
// otherwise reach a discovery URL is neutralized here, at the read
|
|
117
|
+
// boundary, for every consumer. See sanitizeCdpPort's doc.
|
|
118
|
+
const cdpDirectPort = sanitizeCdpPort(cfg.cdpDirectPort);
|
|
119
|
+
const cdpDirectGrantTtlMinutes = cfg.cdpDirectGrantTtlMinutes ?? DEFAULT_GRANT_TTL_MINUTES;
|
|
120
|
+
return {
|
|
121
|
+
...cfg,
|
|
122
|
+
multiAgent,
|
|
123
|
+
autoReelect,
|
|
124
|
+
cdpDirectEnabled,
|
|
125
|
+
cdpDirectPort,
|
|
126
|
+
cdpDirectGrantTtlMinutes,
|
|
127
|
+
};
|
|
47
128
|
}
|
|
48
129
|
/** Strip fields that hold their default value before writing — the on-disk
|
|
49
130
|
* config only carries explicit overrides. Keeps the file diff-friendly and
|
|
@@ -78,6 +159,18 @@ function normaliseForWrite(cfg) {
|
|
|
78
159
|
const { autoReelect: _omit4, ...rest4 } = next;
|
|
79
160
|
next = rest4;
|
|
80
161
|
}
|
|
162
|
+
if (next.cdpDirectEnabled === DEFAULT_CDP_DIRECT_ENABLED) {
|
|
163
|
+
const { cdpDirectEnabled: _omit5, ...rest5 } = next;
|
|
164
|
+
next = rest5;
|
|
165
|
+
}
|
|
166
|
+
if (next.cdpDirectPort === DEFAULT_CDP_DIRECT_PORT) {
|
|
167
|
+
const { cdpDirectPort: _omit6, ...rest6 } = next;
|
|
168
|
+
next = rest6;
|
|
169
|
+
}
|
|
170
|
+
if (next.cdpDirectGrantTtlMinutes === DEFAULT_GRANT_TTL_MINUTES) {
|
|
171
|
+
const { cdpDirectGrantTtlMinutes: _omit7, ...rest7 } = next;
|
|
172
|
+
next = rest7;
|
|
173
|
+
}
|
|
81
174
|
return next;
|
|
82
175
|
}
|
|
83
176
|
export function loadConfig() {
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"A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