very-happy-cli 0.2.156 → 0.2.157

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.
Files changed (55) hide show
  1. package/dist/{AcpBackend-BHe1_F1h.cjs → AcpBackend-BymWX-LI.cjs} +2 -2
  2. package/dist/{AcpBackend-C3nc1u-s.mjs → AcpBackend-Cy18U7yw.mjs} +2 -2
  3. package/dist/{AcpSessionManager-BVxkQnNf.cjs → AcpSessionManager-BF7zBGAi.cjs} +1 -1
  4. package/dist/{AcpSessionManager-dN3k1LbI.mjs → AcpSessionManager-Ds8rcp95.mjs} +1 -1
  5. package/dist/{agentGuidance-C604n0Zq.mjs → agentGuidance-CU6YD_Ms.mjs} +560 -29
  6. package/dist/{agentGuidance-C-CmV03f.cjs → agentGuidance-Db76O1kw.cjs} +579 -28
  7. package/dist/{agentHome-CmIJNV7f.cjs → agentHome-B0CLy0Qx.cjs} +2 -2
  8. package/dist/{agentHome-D2XGsoqs.mjs → agentHome-BaJ9xtxB.mjs} +2 -2
  9. package/dist/{auto-B1I6G_Nf.mjs → auto-B1YAwaeU.mjs} +6 -6
  10. package/dist/{auto-CMDq4oIu.cjs → auto-DqKGFq8U.cjs} +6 -6
  11. package/dist/codex/happyMcpStdioBridge.cjs +2 -2
  12. package/dist/codex/happyMcpStdioBridge.mjs +2 -2
  13. package/dist/{config-BYHSRY2E.cjs → config-CzkBjZnV.cjs} +4 -4
  14. package/dist/{config-BkTu25bH.mjs → config-aAbhJllb.mjs} +4 -4
  15. package/dist/{index-B5QbzEga.mjs → index-BVu8Cufk.mjs} +8 -8
  16. package/dist/{index-DAAreiRF.mjs → index-BYU1e81k.mjs} +288 -44
  17. package/dist/{index-BbtR-Qto.cjs → index-C9QzZsUQ.cjs} +291 -47
  18. package/dist/{index-B_-7NpGZ.cjs → index-CTbGqVFY.cjs} +7 -7
  19. package/dist/{index-CB8QnjvS.cjs → index-Cz-uqnJk.cjs} +4 -4
  20. package/dist/{index-PYO8Mdz4.mjs → index-DQcRkI9r.mjs} +4 -4
  21. package/dist/index.cjs +4 -4
  22. package/dist/index.mjs +4 -4
  23. package/dist/{install-CO1ps6Wt.cjs → install-BMlV0Tnr.cjs} +1 -1
  24. package/dist/{install-CNtXzwT_.mjs → install-BuYnqtVa.mjs} +1 -1
  25. package/dist/{installTerminalHooks-BOAnQ1Qe.cjs → installTerminalHooks-BVVOEGhG.cjs} +4 -4
  26. package/dist/{installTerminalHooks-CMpOV3RU.mjs → installTerminalHooks-ELDoqh0A.mjs} +4 -4
  27. package/dist/lib.cjs +2 -2
  28. package/dist/lib.d.cts +77 -1
  29. package/dist/lib.d.mts +77 -1
  30. package/dist/lib.mjs +2 -2
  31. package/dist/{limits-DmMdchTz.mjs → limits-A2c-3M-_.mjs} +162 -11
  32. package/dist/{limits-o29KXBgj.cjs → limits-CyuIt-Vl.cjs} +169 -10
  33. package/dist/{mcp-C_uejotl.mjs → mcp-Bo934Kpy.mjs} +4 -4
  34. package/dist/{mcp-CwK1nI7Y.cjs → mcp-CXkvnztT.cjs} +4 -4
  35. package/dist/{piRuntime-Dj5WnqzJ.cjs → piRuntime-CJjA26oD.cjs} +2 -2
  36. package/dist/{piRuntime-Cu2-8nOT.mjs → piRuntime-DdEY2mE9.mjs} +2 -2
  37. package/dist/{piTerminal-D-BIbov9.cjs → piTerminal-CpU3hzrX.cjs} +6 -6
  38. package/dist/{piTerminal-DanZeBrO.mjs → piTerminal-DwWmgumi.mjs} +6 -6
  39. package/dist/{runGemini-CZ_lhMWY.mjs → runGemini-Cj6oJQ-I.mjs} +6 -6
  40. package/dist/{runGemini--QqK-Ap5.cjs → runGemini-DS-0qm0L.cjs} +6 -6
  41. package/dist/{runOpenClaw-C0xLhTvk.cjs → runOpenClaw-CvSm8oTc.cjs} +5 -5
  42. package/dist/{runOpenClaw-CxgLpm38.mjs → runOpenClaw-DUCQxkI-.mjs} +5 -5
  43. package/dist/{send-CTcGMVuG.cjs → send-CHxobaoI.cjs} +43 -31
  44. package/dist/{send-BaOkDgH0.mjs → send-D5CyRyZ_.mjs} +43 -31
  45. package/dist/{sessions-OmvyJb0n.cjs → sessions-BFlIrKCY.cjs} +133 -49
  46. package/dist/{sessions-Bn304xF1.mjs → sessions-DsE01xKc.mjs} +133 -49
  47. package/dist/{spawn-BKNabutV.mjs → spawn-CdihhwHs.mjs} +4 -4
  48. package/dist/{spawn-CC6V2KiA.cjs → spawn-HV345RN-.cjs} +4 -4
  49. package/dist/{teams-CLbS2_4Q.mjs → teams-BE8nMB6O.mjs} +5 -5
  50. package/dist/{teams-XtrH3_h3.cjs → teams-BahinMnH.cjs} +5 -5
  51. package/dist/{todo-CEDvKNXK.cjs → todo-CMMQ6yhU.cjs} +2 -2
  52. package/dist/{todo-BcPbNKt2.mjs → todo-CuQAkSp2.mjs} +2 -2
  53. package/dist/{types-CphWjqHc.cjs → types-B0sSi6eM.cjs} +77 -4
  54. package/dist/{types-BEVzYSoV.mjs → types-BrGJ7PJz.mjs} +77 -4
  55. package/package.json +7 -7
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import { R as AgentVersionsSchema, l as logger, w as encodeBase64, L as encrypt, N as decrypt, M as decodeBase64, c as configuration, e as createEnvelope, s as streamKeyOf, S as backoff, T as ReleaseDrainNoticeSchema, U as decryptBlob, V as RelayAssignmentResponseSchema, W as notifyDaemonTurnEvent, X as prepareClipboardText, Y as prepareClipboardHistoryText, g as delay, r as readSettings, d as readPersistedSessions, Z as credentialRelayProblem, F as packageJson, _ as RelayCandidatesResponseSchema, $ as readTrackedClaudeSessionIds, a0 as readTrackedCodexThreadIds, a1 as isValidTerminalId, a2 as exponentialBackoffDelay, a3 as libsodiumEncryptForPublicKey, a4 as libsodiumPublicKeyFromSecretKey, a5 as getRandomBytes, a6 as redactLogValue } from './limits-DmMdchTz.mjs';
2
+ import { S as AgentVersionsSchema, l as logger, w as encodeBase64, L as encrypt, N as decrypt, M as decodeBase64, c as configuration, e as createEnvelope, s as streamKeyOf, T as backoff, U as ReleaseDrainNoticeSchema, V as decryptBlob, W as RelayAssignmentResponseSchema, X as notifyDaemonTurnEvent, Y as BackgroundTaskReporter, Z as notifyDaemonBackgroundTasks, _ as prepareClipboardText, $ as prepareClipboardHistoryText, g as delay, r as readSettings, d as readPersistedSessions, a0 as credentialRelayProblem, F as packageJson, a1 as RelayCandidatesResponseSchema, a2 as readTrackedClaudeSessionIds, a3 as readTrackedCodexThreadIds, a4 as isValidTerminalId, a5 as exponentialBackoffDelay, a6 as libsodiumEncryptForPublicKey, a7 as libsodiumPublicKeyFromSecretKey, a8 as getRandomBytes, a9 as redactLogValue } from './limits-A2c-3M-_.mjs';
3
3
  import { EventEmitter } from 'node:events';
4
4
  import { io } from 'socket.io-client';
5
5
  import { z } from 'zod';
@@ -417,6 +417,15 @@ async function deriveKey$1(master, usage, path) {
417
417
 
418
418
  class RpcHandlerManager {
419
419
  handlers = /* @__PURE__ */ new Map();
420
+ /**
421
+ * B-506: methods whose params/result are PLAINTEXT JSON strings instead of
422
+ * machine-key ciphertext. The caller is a CLI on another machine of the
423
+ * same account, which holds neither this machine's key nor the account
424
+ * content key; the trusted relay sees the payload either way (this fork
425
+ * is server-trusted, not e2e). Only `registerPlainHandler` puts a method
426
+ * here; everything else keeps decrypting.
427
+ */
428
+ plainMethods = /* @__PURE__ */ new Set();
420
429
  scopePrefix;
421
430
  encryptionKey;
422
431
  encryptionVariant;
@@ -441,14 +450,31 @@ class RpcHandlerManager {
441
450
  unregisterHandler(method) {
442
451
  const prefixedMethod = this.getPrefixedMethod(method);
443
452
  this.handlers.delete(prefixedMethod);
453
+ this.plainMethods.delete(prefixedMethod);
444
454
  for (const socket of this.sockets) socket.emit("rpc-unregister", { method: prefixedMethod });
445
455
  }
456
+ /**
457
+ * B-506: register a method whose request is a plaintext JSON string and
458
+ * whose response is returned as a plaintext JSON string (see
459
+ * `plainMethods`). The handler receives the parsed params; a throw is
460
+ * answered with `{ error }` like the encrypted path.
461
+ */
462
+ registerPlainHandler(method, handler) {
463
+ this.plainMethods.add(this.getPrefixedMethod(method));
464
+ this.registerHandler(method, handler);
465
+ }
466
+ isPlainMethod(prefixedMethod) {
467
+ return this.plainMethods.has(prefixedMethod);
468
+ }
446
469
  /**
447
470
  * Handle an incoming RPC request
448
471
  * @param request - The RPC request data
449
472
  * @param callback - The response callback
450
473
  */
451
474
  async handleRequest(request) {
475
+ if (this.plainMethods.has(request.method)) {
476
+ return this.handlePlainRequest(request);
477
+ }
452
478
  try {
453
479
  const handler = this.handlers.get(request.method);
454
480
  if (!handler) {
@@ -472,6 +498,25 @@ class RpcHandlerManager {
472
498
  return encodeBase64(encrypt(this.encryptionKey, this.encryptionVariant, errorResponse));
473
499
  }
474
500
  }
501
+ /** Plaintext variant of handleRequest (B-506). Never throws; never encrypts. */
502
+ async handlePlainRequest(request) {
503
+ const handler = this.handlers.get(request.method);
504
+ if (!handler) return JSON.stringify({ error: "Method not found" });
505
+ let params;
506
+ try {
507
+ params = typeof request.params === "string" && request.params.length > 0 ? JSON.parse(request.params) : {};
508
+ } catch {
509
+ return JSON.stringify({ error: "Invalid JSON params" });
510
+ }
511
+ try {
512
+ this.logger("[RPC] Calling plain handler", { method: request.method });
513
+ const result = await handler(params);
514
+ return JSON.stringify(result === void 0 ? null : result);
515
+ } catch (error) {
516
+ this.logger("[RPC] [ERROR] Error handling plain request", { error });
517
+ return JSON.stringify({ error: error instanceof Error ? error.message : "Unknown error" });
518
+ }
519
+ }
475
520
  onSocketConnect(socket) {
476
521
  this.sockets.add(socket);
477
522
  for (const [prefixedMethod] of this.handlers) {
@@ -2979,16 +3024,29 @@ class ApiSessionClient extends EventEmitter {
2979
3024
  /** B-466: turn edges (and a periodic lease) reported to the local daemon so
2980
3025
  * auto-update waits for "no turn in flight" instead of "no sessions". */
2981
3026
  turnReporter = new TurnReporter((event) => void notifyDaemonTurnEvent(this.sessionId, event).catch((error) => logger.debug("[API] Failed to report turn event to daemon:", error)));
2982
- keepAlive(thinking, mode) {
3027
+ /** B-507: background tasks in flight, published on change and renewed every
3028
+ * 60s to the daemon (`/session-event background_tasks`) and into agentState
3029
+ * (`backgroundTasks: { updatedAt, tasks }`) — the two readers that outlive a
3030
+ * single heartbeat. The heartbeat itself carries only the count. */
3031
+ backgroundTaskReporter = new BackgroundTaskReporter((tasks, now) => {
3032
+ void notifyDaemonBackgroundTasks(this.sessionId, tasks).catch((error) => logger.debug("[API] Failed to report background tasks to daemon:", error));
3033
+ this.updateAgentState((state) => ({
3034
+ ...state,
3035
+ backgroundTasks: tasks.length > 0 ? { updatedAt: now, tasks } : void 0
3036
+ }));
3037
+ });
3038
+ keepAlive(thinking, mode, backgroundTasks) {
2983
3039
  if (process.env.DEBUG) {
2984
3040
  logger.debug(`[API] Sending keep alive message: ${thinking}`);
2985
3041
  }
2986
3042
  this.turnReporter.observe(thinking);
3043
+ if (backgroundTasks) this.backgroundTaskReporter.observe(backgroundTasks);
2987
3044
  this.socket.volatile.emit("session-alive", {
2988
3045
  sid: this.sessionId,
2989
3046
  time: Date.now(),
2990
3047
  thinking,
2991
- mode
3048
+ mode,
3049
+ ...backgroundTasks ? { backgroundTasks: backgroundTasks.length } : {}
2992
3050
  });
2993
3051
  }
2994
3052
  /**
@@ -14335,6 +14393,17 @@ class ApiMachineClient {
14335
14393
  return { claudeAuth };
14336
14394
  });
14337
14395
  }
14396
+ /**
14397
+ * B-506: the five `sessions.*` methods a CLI on ANOTHER machine of this
14398
+ * account calls to read / message sessions this daemon spawned. Plaintext
14399
+ * on purpose (no shared key with the caller); see
14400
+ * `api/rpc/RpcHandlerManager.ts` `registerPlainHandler`.
14401
+ */
14402
+ setRemoteSessionOpsHandlers(handlers) {
14403
+ for (const [method, handler] of Object.entries(handlers)) {
14404
+ this.rpcHandlerManager.registerPlainHandler(method, handler);
14405
+ }
14406
+ }
14338
14407
  setRPCHandlers({
14339
14408
  spawnSession,
14340
14409
  resumeSession,
@@ -15163,7 +15232,11 @@ class ApiMachineClient {
15163
15232
  }
15164
15233
  bindRpcRequestHandler(socket, transport) {
15165
15234
  socket.on("rpc-request", async (data, callback) => {
15166
- logger.debugLargeJson(`[API MACHINE] Received RPC request via ${transport}:`, data);
15235
+ if (typeof data?.method === "string" && this.rpcHandlerManager.isPlainMethod(data.method)) {
15236
+ logger.debug(`[API MACHINE] Received plain RPC request via ${transport}: ${data.method}`);
15237
+ } else {
15238
+ logger.debugLargeJson(`[API MACHINE] Received RPC request via ${transport}:`, data);
15239
+ }
15167
15240
  await answerSocketRequest(
15168
15241
  callback,
15169
15242
  () => this.rpcHandlerManager.handleRequest(data),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "very-happy-cli",
3
- "version": "0.2.156",
3
+ "version": "0.2.157",
4
4
  "description": "Remote multi-agent workspace CLI with deep Claude integration, native terminal streaming, and self-hosting.",
5
5
  "author": "Kirill Dubovitskiy",
6
6
  "contributors": [
@@ -117,12 +117,12 @@
117
117
  "zod": "^4.0.0"
118
118
  },
119
119
  "optionalDependencies": {
120
- "very-happy-tools-arm64-darwin": "0.2.156",
121
- "very-happy-tools-x64-darwin": "0.2.156",
122
- "very-happy-tools-arm64-linux": "0.2.156",
123
- "very-happy-tools-x64-linux": "0.2.156",
124
- "very-happy-tools-arm64-win32": "0.2.156",
125
- "very-happy-tools-x64-win32": "0.2.156"
120
+ "very-happy-tools-arm64-darwin": "0.2.157",
121
+ "very-happy-tools-x64-darwin": "0.2.157",
122
+ "very-happy-tools-arm64-linux": "0.2.157",
123
+ "very-happy-tools-x64-linux": "0.2.157",
124
+ "very-happy-tools-arm64-win32": "0.2.157",
125
+ "very-happy-tools-x64-win32": "0.2.157"
126
126
  },
127
127
  "devDependencies": {
128
128
  "@slopus/happy-wire": "workspace:*",