@node9/proxy 1.11.6 → 1.11.7
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/cli.js +15 -8
- package/dist/cli.mjs +15 -8
- package/dist/index.js +15 -8
- package/dist/index.mjs +15 -8
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2927,12 +2927,12 @@ function notifyActivitySocket(data) {
|
|
|
2927
2927
|
const payload = JSON.stringify(data);
|
|
2928
2928
|
const sock = import_net.default.createConnection(ACTIVITY_SOCKET_PATH);
|
|
2929
2929
|
sock.on("connect", () => {
|
|
2930
|
-
sock.on("close", resolve);
|
|
2930
|
+
sock.on("close", () => resolve(true));
|
|
2931
2931
|
sock.end(payload);
|
|
2932
2932
|
});
|
|
2933
|
-
sock.on("error", resolve);
|
|
2933
|
+
sock.on("error", () => resolve(false));
|
|
2934
2934
|
} catch {
|
|
2935
|
-
resolve();
|
|
2935
|
+
resolve(false);
|
|
2936
2936
|
}
|
|
2937
2937
|
});
|
|
2938
2938
|
}
|
|
@@ -3007,7 +3007,7 @@ function isDaemonRunning() {
|
|
|
3007
3007
|
return false;
|
|
3008
3008
|
}
|
|
3009
3009
|
}
|
|
3010
|
-
async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityId, cwd, recoveryCommand, skipBackgroundAuth, viewOnly, localSmartRuleMatched) {
|
|
3010
|
+
async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityId, cwd, recoveryCommand, skipBackgroundAuth, viewOnly, localSmartRuleMatched, socketActivitySent) {
|
|
3011
3011
|
const base = `http://${DAEMON_HOST}:${DAEMON_PORT}`;
|
|
3012
3012
|
const ctrl = new AbortController();
|
|
3013
3013
|
const timer = setTimeout(() => ctrl.abort(), 5e3);
|
|
@@ -3020,7 +3020,10 @@ async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityI
|
|
|
3020
3020
|
args,
|
|
3021
3021
|
agent: meta?.agent,
|
|
3022
3022
|
mcpServer: meta?.mcpServer,
|
|
3023
|
-
fromCLI
|
|
3023
|
+
// fromCLI=true tells the daemon the CLI already sent the activity event via
|
|
3024
|
+
// socket. If the socket send failed (socketActivitySent=false), set fromCLI=false
|
|
3025
|
+
// so the daemon emits the activity event itself — tail never misses an entry.
|
|
3026
|
+
fromCLI: socketActivitySent !== false,
|
|
3024
3027
|
// Pass the flight-recorder ID so the daemon uses the same UUID for
|
|
3025
3028
|
// activity-result as the CLI used for the pending activity event.
|
|
3026
3029
|
activityId,
|
|
@@ -3750,7 +3753,7 @@ async function authorizeHeadless(toolName, args, meta, options) {
|
|
|
3750
3753
|
if (!options?.calledFromDaemon) {
|
|
3751
3754
|
const actId = (0, import_crypto4.randomUUID)();
|
|
3752
3755
|
const actTs = Date.now();
|
|
3753
|
-
await notifyActivity({
|
|
3756
|
+
const socketOk = await notifyActivity({
|
|
3754
3757
|
id: actId,
|
|
3755
3758
|
ts: actTs,
|
|
3756
3759
|
tool: toolName,
|
|
@@ -3762,7 +3765,10 @@ async function authorizeHeadless(toolName, args, meta, options) {
|
|
|
3762
3765
|
});
|
|
3763
3766
|
const result = await _authorizeHeadlessCore(toolName, args, meta, {
|
|
3764
3767
|
...options,
|
|
3765
|
-
activityId: actId
|
|
3768
|
+
activityId: actId,
|
|
3769
|
+
// If socket send failed, tell the daemon NOT to assume we already sent the
|
|
3770
|
+
// activity event — it must emit it itself so tail never misses an entry.
|
|
3771
|
+
socketActivitySent: socketOk
|
|
3766
3772
|
});
|
|
3767
3773
|
if (!result.noApprovalMechanism) {
|
|
3768
3774
|
await notifyActivity({
|
|
@@ -4088,7 +4094,8 @@ async function _authorizeHeadlessCore(toolName, args, meta, options) {
|
|
|
4088
4094
|
statefulRecoveryCommand,
|
|
4089
4095
|
void 0,
|
|
4090
4096
|
void 0,
|
|
4091
|
-
localSmartRuleMatched || options?.localSmartRuleMatched
|
|
4097
|
+
localSmartRuleMatched || options?.localSmartRuleMatched,
|
|
4098
|
+
options?.socketActivitySent
|
|
4092
4099
|
);
|
|
4093
4100
|
daemonEntryId = entry.id;
|
|
4094
4101
|
daemonAllowCount = entry.allowCount;
|
package/dist/cli.mjs
CHANGED
|
@@ -2910,12 +2910,12 @@ function notifyActivitySocket(data) {
|
|
|
2910
2910
|
const payload = JSON.stringify(data);
|
|
2911
2911
|
const sock = net.createConnection(ACTIVITY_SOCKET_PATH);
|
|
2912
2912
|
sock.on("connect", () => {
|
|
2913
|
-
sock.on("close", resolve);
|
|
2913
|
+
sock.on("close", () => resolve(true));
|
|
2914
2914
|
sock.end(payload);
|
|
2915
2915
|
});
|
|
2916
|
-
sock.on("error", resolve);
|
|
2916
|
+
sock.on("error", () => resolve(false));
|
|
2917
2917
|
} catch {
|
|
2918
|
-
resolve();
|
|
2918
|
+
resolve(false);
|
|
2919
2919
|
}
|
|
2920
2920
|
});
|
|
2921
2921
|
}
|
|
@@ -2990,7 +2990,7 @@ function isDaemonRunning() {
|
|
|
2990
2990
|
return false;
|
|
2991
2991
|
}
|
|
2992
2992
|
}
|
|
2993
|
-
async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityId, cwd, recoveryCommand, skipBackgroundAuth, viewOnly, localSmartRuleMatched) {
|
|
2993
|
+
async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityId, cwd, recoveryCommand, skipBackgroundAuth, viewOnly, localSmartRuleMatched, socketActivitySent) {
|
|
2994
2994
|
const base = `http://${DAEMON_HOST}:${DAEMON_PORT}`;
|
|
2995
2995
|
const ctrl = new AbortController();
|
|
2996
2996
|
const timer = setTimeout(() => ctrl.abort(), 5e3);
|
|
@@ -3003,7 +3003,10 @@ async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityI
|
|
|
3003
3003
|
args,
|
|
3004
3004
|
agent: meta?.agent,
|
|
3005
3005
|
mcpServer: meta?.mcpServer,
|
|
3006
|
-
fromCLI
|
|
3006
|
+
// fromCLI=true tells the daemon the CLI already sent the activity event via
|
|
3007
|
+
// socket. If the socket send failed (socketActivitySent=false), set fromCLI=false
|
|
3008
|
+
// so the daemon emits the activity event itself — tail never misses an entry.
|
|
3009
|
+
fromCLI: socketActivitySent !== false,
|
|
3007
3010
|
// Pass the flight-recorder ID so the daemon uses the same UUID for
|
|
3008
3011
|
// activity-result as the CLI used for the pending activity event.
|
|
3009
3012
|
activityId,
|
|
@@ -3728,7 +3731,7 @@ async function authorizeHeadless(toolName, args, meta, options) {
|
|
|
3728
3731
|
if (!options?.calledFromDaemon) {
|
|
3729
3732
|
const actId = randomUUID();
|
|
3730
3733
|
const actTs = Date.now();
|
|
3731
|
-
await notifyActivity({
|
|
3734
|
+
const socketOk = await notifyActivity({
|
|
3732
3735
|
id: actId,
|
|
3733
3736
|
ts: actTs,
|
|
3734
3737
|
tool: toolName,
|
|
@@ -3740,7 +3743,10 @@ async function authorizeHeadless(toolName, args, meta, options) {
|
|
|
3740
3743
|
});
|
|
3741
3744
|
const result = await _authorizeHeadlessCore(toolName, args, meta, {
|
|
3742
3745
|
...options,
|
|
3743
|
-
activityId: actId
|
|
3746
|
+
activityId: actId,
|
|
3747
|
+
// If socket send failed, tell the daemon NOT to assume we already sent the
|
|
3748
|
+
// activity event — it must emit it itself so tail never misses an entry.
|
|
3749
|
+
socketActivitySent: socketOk
|
|
3744
3750
|
});
|
|
3745
3751
|
if (!result.noApprovalMechanism) {
|
|
3746
3752
|
await notifyActivity({
|
|
@@ -4066,7 +4072,8 @@ async function _authorizeHeadlessCore(toolName, args, meta, options) {
|
|
|
4066
4072
|
statefulRecoveryCommand,
|
|
4067
4073
|
void 0,
|
|
4068
4074
|
void 0,
|
|
4069
|
-
localSmartRuleMatched || options?.localSmartRuleMatched
|
|
4075
|
+
localSmartRuleMatched || options?.localSmartRuleMatched,
|
|
4076
|
+
options?.socketActivitySent
|
|
4070
4077
|
);
|
|
4071
4078
|
daemonEntryId = entry.id;
|
|
4072
4079
|
daemonAllowCount = entry.allowCount;
|
package/dist/index.js
CHANGED
|
@@ -2419,12 +2419,12 @@ function notifyActivitySocket(data) {
|
|
|
2419
2419
|
const payload = JSON.stringify(data);
|
|
2420
2420
|
const sock = import_net.default.createConnection(ACTIVITY_SOCKET_PATH);
|
|
2421
2421
|
sock.on("connect", () => {
|
|
2422
|
-
sock.on("close", resolve);
|
|
2422
|
+
sock.on("close", () => resolve(true));
|
|
2423
2423
|
sock.end(payload);
|
|
2424
2424
|
});
|
|
2425
|
-
sock.on("error", resolve);
|
|
2425
|
+
sock.on("error", () => resolve(false));
|
|
2426
2426
|
} catch {
|
|
2427
|
-
resolve();
|
|
2427
|
+
resolve(false);
|
|
2428
2428
|
}
|
|
2429
2429
|
});
|
|
2430
2430
|
}
|
|
@@ -2501,7 +2501,7 @@ function isDaemonRunning() {
|
|
|
2501
2501
|
return false;
|
|
2502
2502
|
}
|
|
2503
2503
|
}
|
|
2504
|
-
async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityId, cwd, recoveryCommand, skipBackgroundAuth, viewOnly, localSmartRuleMatched) {
|
|
2504
|
+
async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityId, cwd, recoveryCommand, skipBackgroundAuth, viewOnly, localSmartRuleMatched, socketActivitySent) {
|
|
2505
2505
|
const base = `http://${DAEMON_HOST}:${DAEMON_PORT}`;
|
|
2506
2506
|
const ctrl = new AbortController();
|
|
2507
2507
|
const timer = setTimeout(() => ctrl.abort(), 5e3);
|
|
@@ -2514,7 +2514,10 @@ async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityI
|
|
|
2514
2514
|
args,
|
|
2515
2515
|
agent: meta?.agent,
|
|
2516
2516
|
mcpServer: meta?.mcpServer,
|
|
2517
|
-
fromCLI
|
|
2517
|
+
// fromCLI=true tells the daemon the CLI already sent the activity event via
|
|
2518
|
+
// socket. If the socket send failed (socketActivitySent=false), set fromCLI=false
|
|
2519
|
+
// so the daemon emits the activity event itself — tail never misses an entry.
|
|
2520
|
+
fromCLI: socketActivitySent !== false,
|
|
2518
2521
|
// Pass the flight-recorder ID so the daemon uses the same UUID for
|
|
2519
2522
|
// activity-result as the CLI used for the pending activity event.
|
|
2520
2523
|
activityId,
|
|
@@ -3195,7 +3198,7 @@ async function authorizeHeadless(toolName, args, meta, options) {
|
|
|
3195
3198
|
if (!options?.calledFromDaemon) {
|
|
3196
3199
|
const actId = (0, import_crypto3.randomUUID)();
|
|
3197
3200
|
const actTs = Date.now();
|
|
3198
|
-
await notifyActivity({
|
|
3201
|
+
const socketOk = await notifyActivity({
|
|
3199
3202
|
id: actId,
|
|
3200
3203
|
ts: actTs,
|
|
3201
3204
|
tool: toolName,
|
|
@@ -3207,7 +3210,10 @@ async function authorizeHeadless(toolName, args, meta, options) {
|
|
|
3207
3210
|
});
|
|
3208
3211
|
const result = await _authorizeHeadlessCore(toolName, args, meta, {
|
|
3209
3212
|
...options,
|
|
3210
|
-
activityId: actId
|
|
3213
|
+
activityId: actId,
|
|
3214
|
+
// If socket send failed, tell the daemon NOT to assume we already sent the
|
|
3215
|
+
// activity event — it must emit it itself so tail never misses an entry.
|
|
3216
|
+
socketActivitySent: socketOk
|
|
3211
3217
|
});
|
|
3212
3218
|
if (!result.noApprovalMechanism) {
|
|
3213
3219
|
await notifyActivity({
|
|
@@ -3533,7 +3539,8 @@ async function _authorizeHeadlessCore(toolName, args, meta, options) {
|
|
|
3533
3539
|
statefulRecoveryCommand,
|
|
3534
3540
|
void 0,
|
|
3535
3541
|
void 0,
|
|
3536
|
-
localSmartRuleMatched || options?.localSmartRuleMatched
|
|
3542
|
+
localSmartRuleMatched || options?.localSmartRuleMatched,
|
|
3543
|
+
options?.socketActivitySent
|
|
3537
3544
|
);
|
|
3538
3545
|
daemonEntryId = entry.id;
|
|
3539
3546
|
daemonAllowCount = entry.allowCount;
|
package/dist/index.mjs
CHANGED
|
@@ -2389,12 +2389,12 @@ function notifyActivitySocket(data) {
|
|
|
2389
2389
|
const payload = JSON.stringify(data);
|
|
2390
2390
|
const sock = net.createConnection(ACTIVITY_SOCKET_PATH);
|
|
2391
2391
|
sock.on("connect", () => {
|
|
2392
|
-
sock.on("close", resolve);
|
|
2392
|
+
sock.on("close", () => resolve(true));
|
|
2393
2393
|
sock.end(payload);
|
|
2394
2394
|
});
|
|
2395
|
-
sock.on("error", resolve);
|
|
2395
|
+
sock.on("error", () => resolve(false));
|
|
2396
2396
|
} catch {
|
|
2397
|
-
resolve();
|
|
2397
|
+
resolve(false);
|
|
2398
2398
|
}
|
|
2399
2399
|
});
|
|
2400
2400
|
}
|
|
@@ -2471,7 +2471,7 @@ function isDaemonRunning() {
|
|
|
2471
2471
|
return false;
|
|
2472
2472
|
}
|
|
2473
2473
|
}
|
|
2474
|
-
async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityId, cwd, recoveryCommand, skipBackgroundAuth, viewOnly, localSmartRuleMatched) {
|
|
2474
|
+
async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityId, cwd, recoveryCommand, skipBackgroundAuth, viewOnly, localSmartRuleMatched, socketActivitySent) {
|
|
2475
2475
|
const base = `http://${DAEMON_HOST}:${DAEMON_PORT}`;
|
|
2476
2476
|
const ctrl = new AbortController();
|
|
2477
2477
|
const timer = setTimeout(() => ctrl.abort(), 5e3);
|
|
@@ -2484,7 +2484,10 @@ async function registerDaemonEntry(toolName, args, meta, riskMetadata, activityI
|
|
|
2484
2484
|
args,
|
|
2485
2485
|
agent: meta?.agent,
|
|
2486
2486
|
mcpServer: meta?.mcpServer,
|
|
2487
|
-
fromCLI
|
|
2487
|
+
// fromCLI=true tells the daemon the CLI already sent the activity event via
|
|
2488
|
+
// socket. If the socket send failed (socketActivitySent=false), set fromCLI=false
|
|
2489
|
+
// so the daemon emits the activity event itself — tail never misses an entry.
|
|
2490
|
+
fromCLI: socketActivitySent !== false,
|
|
2488
2491
|
// Pass the flight-recorder ID so the daemon uses the same UUID for
|
|
2489
2492
|
// activity-result as the CLI used for the pending activity event.
|
|
2490
2493
|
activityId,
|
|
@@ -3165,7 +3168,7 @@ async function authorizeHeadless(toolName, args, meta, options) {
|
|
|
3165
3168
|
if (!options?.calledFromDaemon) {
|
|
3166
3169
|
const actId = randomUUID();
|
|
3167
3170
|
const actTs = Date.now();
|
|
3168
|
-
await notifyActivity({
|
|
3171
|
+
const socketOk = await notifyActivity({
|
|
3169
3172
|
id: actId,
|
|
3170
3173
|
ts: actTs,
|
|
3171
3174
|
tool: toolName,
|
|
@@ -3177,7 +3180,10 @@ async function authorizeHeadless(toolName, args, meta, options) {
|
|
|
3177
3180
|
});
|
|
3178
3181
|
const result = await _authorizeHeadlessCore(toolName, args, meta, {
|
|
3179
3182
|
...options,
|
|
3180
|
-
activityId: actId
|
|
3183
|
+
activityId: actId,
|
|
3184
|
+
// If socket send failed, tell the daemon NOT to assume we already sent the
|
|
3185
|
+
// activity event — it must emit it itself so tail never misses an entry.
|
|
3186
|
+
socketActivitySent: socketOk
|
|
3181
3187
|
});
|
|
3182
3188
|
if (!result.noApprovalMechanism) {
|
|
3183
3189
|
await notifyActivity({
|
|
@@ -3503,7 +3509,8 @@ async function _authorizeHeadlessCore(toolName, args, meta, options) {
|
|
|
3503
3509
|
statefulRecoveryCommand,
|
|
3504
3510
|
void 0,
|
|
3505
3511
|
void 0,
|
|
3506
|
-
localSmartRuleMatched || options?.localSmartRuleMatched
|
|
3512
|
+
localSmartRuleMatched || options?.localSmartRuleMatched,
|
|
3513
|
+
options?.socketActivitySent
|
|
3507
3514
|
);
|
|
3508
3515
|
daemonEntryId = entry.id;
|
|
3509
3516
|
daemonAllowCount = entry.allowCount;
|