very-happy-cli 0.2.154 → 0.2.155
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/{AcpBackend-Ckyadhf4.mjs → AcpBackend-DVB0nzgR.mjs} +2 -2
- package/dist/{AcpBackend-B14xNj5L.cjs → AcpBackend-DmFcRh54.cjs} +3 -3
- package/dist/{AcpSessionManager-CCHmPdrR.cjs → AcpSessionManager-CWaSYTnT.cjs} +1 -1
- package/dist/{AcpSessionManager-H8t4P-IW.mjs → AcpSessionManager-dGDgNb-p.mjs} +1 -1
- package/dist/agentGuidance-BWxFC6UL.mjs +1613 -0
- package/dist/agentGuidance-un7YPryB.cjs +1665 -0
- package/dist/{agentHome-B20RWdgE.mjs → agentHome-ByLb2HFg.mjs} +5 -5
- package/dist/{agentHome-BUsLTZnz.cjs → agentHome-aucT8BHw.cjs} +5 -5
- package/dist/{auto-BQnncDcs.mjs → auto-BQnD6gVx.mjs} +21 -21
- package/dist/{auto-IeldARBS.cjs → auto-P9RoJaY0.cjs} +24 -24
- package/dist/codex/happyMcpStdioBridge.cjs +6 -3
- package/dist/codex/happyMcpStdioBridge.mjs +6 -3
- package/dist/{config-B-ocQh5V.mjs → config-BPZ2Y6o8.mjs} +8 -8
- package/dist/{config-DM_xI9M6.cjs → config-BoePh9PX.cjs} +8 -8
- package/dist/{index-okLyUzeD.cjs → index--KCpVs1c.cjs} +7 -7
- package/dist/{index-BELV05ko.mjs → index-B4oXnbYw.mjs} +463 -889
- package/dist/{index-ZKuBjvHi.mjs → index-BjzdXb9x.mjs} +21 -13
- package/dist/{index-BUxBxSxJ.cjs → index-DRrLaljt.cjs} +21 -13
- package/dist/{index-CIx3248o.mjs → index-DVVRqaVG.mjs} +7 -7
- package/dist/{index-eCjkm8Y2.cjs → index-D_fYUxVg.cjs} +521 -960
- package/dist/index.cjs +6 -6
- package/dist/index.mjs +6 -6
- package/dist/{install-BZOdxfPd.cjs → install-CGigiocs.cjs} +1 -1
- package/dist/{install-CoLN3whR.mjs → install-DP5aPNEX.mjs} +1 -1
- package/dist/{installTerminalHooks-CA4OcAS7.cjs → installTerminalHooks-XrcPvfBs.cjs} +5 -5
- package/dist/{installTerminalHooks-Dde_8t36.mjs → installTerminalHooks-tIg7mANc.mjs} +5 -5
- package/dist/lib.cjs +2 -2
- package/dist/lib.mjs +2 -2
- package/dist/{limits-Dt7_unH4.mjs → limits-C_DW0M0q.mjs} +309 -13
- package/dist/{limits-CmzISka2.cjs → limits-DkfHJ3nS.cjs} +329 -12
- package/dist/{mcp-7iDHlyCI.cjs → mcp-BqlXl10F.cjs} +23 -23
- package/dist/{mcp-9Ui4nQZL.mjs → mcp-o7QglAQM.mjs} +17 -17
- package/dist/{piRuntime-BesGGPME.cjs → piRuntime-BxP4B_zY.cjs} +2 -2
- package/dist/{piRuntime-C4E4pgye.mjs → piRuntime-MjiJI-nV.mjs} +2 -2
- package/dist/{piTerminal-fUogwxYr.cjs → piTerminal-DYzRcwgb.cjs} +6 -6
- package/dist/{piTerminal-CCEGCQOY.mjs → piTerminal-Dpq6yqKU.mjs} +6 -6
- package/dist/{runGemini-CNPGSsSK.cjs → runGemini-8Pxh94Fm.cjs} +7 -7
- package/dist/{runGemini-BW-pEklU.mjs → runGemini-CDlcQ-OA.mjs} +6 -6
- package/dist/{runOpenClaw-Bsodkg_s.cjs → runOpenClaw-B5FSZIbK.cjs} +6 -6
- package/dist/{runOpenClaw-NRB6-_jU.mjs → runOpenClaw-YkhsgPs0.mjs} +5 -5
- package/dist/{send-Bd00QcHC.cjs → send-CwrYXTPr.cjs} +8 -42
- package/dist/{send-DYeSFg8s.mjs → send-DJStmLBv.mjs} +5 -39
- package/dist/{sessions-DlPOYKLU.mjs → sessions-JaVXlSqj.mjs} +88 -45
- package/dist/{sessions-RIFUoy_g.cjs → sessions-MX21NJXd.cjs} +99 -56
- package/dist/{spawn-D1bhyHbH.mjs → spawn-BaPnjClT.mjs} +22 -22
- package/dist/{spawn-DxrfHTF4.cjs → spawn-cIoglKVf.cjs} +30 -30
- package/dist/{teams-pfKHpkgL.mjs → teams-DXV5Pwwt.mjs} +8 -8
- package/dist/{teams-Cfy0VMCo.cjs → teams-Dqk7F3D-.cjs} +8 -8
- package/dist/{todo-B2CjDg_V.mjs → todo-2Z1REhfx.mjs} +8 -6
- package/dist/{todo-B4cBFzHB.cjs → todo-Buuqn9gm.cjs} +8 -6
- package/dist/{types-D5RWyBE5.mjs → types-CkbfdRzq.mjs} +4 -282
- package/dist/{types-Bd_TGr0F.cjs → types-a2xsH2UI.cjs} +16 -311
- package/package.json +7 -7
- package/dist/agentGuidance-DUBXppv-.cjs +0 -554
- package/dist/agentGuidance-TLYQxsm2.mjs +0 -530
|
@@ -3,21 +3,21 @@ import { randomUUID } from 'node:crypto';
|
|
|
3
3
|
import { createServer } from 'node:http';
|
|
4
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
5
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
6
|
-
import { p as preparePiTeamsRuntime } from './piRuntime-
|
|
7
|
-
import { registerMcpTools, registerTerminalTitleSuggest } from './mcp-
|
|
8
|
-
import './agentGuidance-
|
|
6
|
+
import { p as preparePiTeamsRuntime } from './piRuntime-MjiJI-nV.mjs';
|
|
7
|
+
import { registerMcpTools, registerTerminalTitleSuggest } from './mcp-o7QglAQM.mjs';
|
|
8
|
+
import './agentGuidance-BWxFC6UL.mjs';
|
|
9
9
|
import 'node:fs/promises';
|
|
10
10
|
import 'node:os';
|
|
11
11
|
import 'zod';
|
|
12
|
-
import './limits-
|
|
12
|
+
import './limits-C_DW0M0q.mjs';
|
|
13
13
|
import 'axios';
|
|
14
14
|
import 'tweetnacl';
|
|
15
15
|
import 'socket.io-client';
|
|
16
|
-
import './types-
|
|
16
|
+
import './types-CkbfdRzq.mjs';
|
|
17
17
|
import 'node:fs';
|
|
18
18
|
import 'node:path';
|
|
19
19
|
import { r as resolveMcpTerminalId } from './terminalToolContext-CFeGeaNm.mjs';
|
|
20
|
-
import './index-
|
|
20
|
+
import './index-B4oXnbYw.mjs';
|
|
21
21
|
import 'chalk';
|
|
22
22
|
import 'cross-spawn';
|
|
23
23
|
import 'node:readline';
|
|
@@ -4,12 +4,12 @@ var ink = require('ink');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var node_crypto = require('node:crypto');
|
|
6
6
|
var path = require('node:path');
|
|
7
|
-
var index$1 = require('./types-
|
|
8
|
-
var persistence = require('./limits-
|
|
9
|
-
var index = require('./index-
|
|
7
|
+
var index$1 = require('./types-a2xsH2UI.cjs');
|
|
8
|
+
var persistence = require('./limits-DkfHJ3nS.cjs');
|
|
9
|
+
var index = require('./index-D_fYUxVg.cjs');
|
|
10
10
|
var terminalTitleSuggest = require('./terminalTitleSuggest-Dji8I0Jy.cjs');
|
|
11
|
-
var AcpBackend = require('./AcpBackend-
|
|
12
|
-
var config = require('./config-
|
|
11
|
+
var AcpBackend = require('./AcpBackend-DmFcRh54.cjs');
|
|
12
|
+
var config = require('./config-BoePh9PX.cjs');
|
|
13
13
|
require('axios');
|
|
14
14
|
require('node:events');
|
|
15
15
|
require('socket.io-client');
|
|
@@ -34,7 +34,7 @@ require('@anthropic-ai/sandbox-runtime');
|
|
|
34
34
|
require('expo-server-sdk');
|
|
35
35
|
require('chalk');
|
|
36
36
|
require('node:util');
|
|
37
|
-
require('./agentGuidance-
|
|
37
|
+
require('./agentGuidance-un7YPryB.cjs');
|
|
38
38
|
require('@anthropic-ai/claude-agent-sdk');
|
|
39
39
|
require('ps-list');
|
|
40
40
|
require('tmp');
|
|
@@ -943,7 +943,7 @@ async function runGemini(opts) {
|
|
|
943
943
|
if (response) {
|
|
944
944
|
try {
|
|
945
945
|
persistence.logger.debug(`[START] Reporting session ${response.id} to daemon`);
|
|
946
|
-
const result = await
|
|
946
|
+
const result = await persistence.notifyDaemonSessionStarted(response.id, metadata, {
|
|
947
947
|
encryptionKey: persistence.encodeBase64(response.encryptionKey),
|
|
948
948
|
encryptionVariant: response.encryptionVariant,
|
|
949
949
|
seq: response.seq,
|
|
@@ -2,12 +2,12 @@ import { useStdout, useInput, Box, Text, render } from 'ink';
|
|
|
2
2
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
3
3
|
import { randomUUID } from 'node:crypto';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
|
-
import {
|
|
6
|
-
import { l as logger, r as readSettings,
|
|
7
|
-
import {
|
|
5
|
+
import { h as connectionState, A as ApiClient, i as errorLogMetadata, j as contentLogMetadata } from './types-CkbfdRzq.mjs';
|
|
6
|
+
import { l as logger, r as readSettings, v as notifyDaemonSessionStarted, w as encodeBase64 } from './limits-C_DW0M0q.mjs';
|
|
7
|
+
import { I as GEMINI_API_KEY_ENV, J as GOOGLE_API_KEY_ENV, G as GEMINI_MODEL_ENV, B as BasePermissionHandler, K as BaseReasoningProcessor, h as initialMachineMetadata, j as createSessionMetadata, k as setupOfflineReconnection, M as MessageQueue2, m as hashObject, L as MessageBuffer, N as CHANGE_TITLE_INSTRUCTION, v as registerKillSessionHandler, n as startHappyServer } from './index-B4oXnbYw.mjs';
|
|
8
8
|
import { p as projectPath } from './terminalTitleSuggest-DKgX3osW.mjs';
|
|
9
|
-
import { A as AcpBackend } from './AcpBackend-
|
|
10
|
-
import { readGeminiLocalConfig, determineGeminiModel, getGeminiModelSource, getInitialGeminiModel, saveGeminiModelToConfig } from './config-
|
|
9
|
+
import { A as AcpBackend } from './AcpBackend-DVB0nzgR.mjs';
|
|
10
|
+
import { readGeminiLocalConfig, determineGeminiModel, getGeminiModelSource, getInitialGeminiModel, saveGeminiModelToConfig } from './config-BPZ2Y6o8.mjs';
|
|
11
11
|
import 'axios';
|
|
12
12
|
import 'node:events';
|
|
13
13
|
import 'socket.io-client';
|
|
@@ -32,7 +32,7 @@ import '@anthropic-ai/sandbox-runtime';
|
|
|
32
32
|
import 'expo-server-sdk';
|
|
33
33
|
import 'chalk';
|
|
34
34
|
import 'node:util';
|
|
35
|
-
import './agentGuidance-
|
|
35
|
+
import './agentGuidance-BWxFC6UL.mjs';
|
|
36
36
|
import '@anthropic-ai/claude-agent-sdk';
|
|
37
37
|
import 'ps-list';
|
|
38
38
|
import 'tmp';
|
|
@@ -5,10 +5,10 @@ var node_child_process = require('node:child_process');
|
|
|
5
5
|
var os = require('node:os');
|
|
6
6
|
var node_fs = require('node:fs');
|
|
7
7
|
var path = require('node:path');
|
|
8
|
-
var index = require('./types-
|
|
9
|
-
var AcpSessionManager = require('./AcpSessionManager-
|
|
10
|
-
var persistence = require('./limits-
|
|
11
|
-
var index$1 = require('./index-
|
|
8
|
+
var index = require('./types-a2xsH2UI.cjs');
|
|
9
|
+
var AcpSessionManager = require('./AcpSessionManager-CWaSYTnT.cjs');
|
|
10
|
+
var persistence = require('./limits-DkfHJ3nS.cjs');
|
|
11
|
+
var index$1 = require('./index-D_fYUxVg.cjs');
|
|
12
12
|
var WebSocket = require('ws');
|
|
13
13
|
var ed = require('@noble/ed25519');
|
|
14
14
|
var sha2_js = require('@noble/hashes/sha2.js');
|
|
@@ -35,7 +35,7 @@ require('@anthropic-ai/sandbox-runtime');
|
|
|
35
35
|
require('expo-server-sdk');
|
|
36
36
|
require('chalk');
|
|
37
37
|
require('node:util');
|
|
38
|
-
require('./agentGuidance-
|
|
38
|
+
require('./agentGuidance-un7YPryB.cjs');
|
|
39
39
|
require('ink');
|
|
40
40
|
require('react');
|
|
41
41
|
require('@anthropic-ai/claude-agent-sdk');
|
|
@@ -865,7 +865,7 @@ async function runOpenClaw(opts) {
|
|
|
865
865
|
session = initialSession;
|
|
866
866
|
if (response) {
|
|
867
867
|
try {
|
|
868
|
-
await
|
|
868
|
+
await persistence.notifyDaemonSessionStarted(response.id, metadata, {
|
|
869
869
|
encryptionKey: persistence.encodeBase64(response.encryptionKey),
|
|
870
870
|
encryptionVariant: response.encryptionVariant,
|
|
871
871
|
seq: response.seq,
|
|
@@ -3,10 +3,10 @@ import { execFileSync } from 'node:child_process';
|
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import { existsSync, readFileSync } from 'node:fs';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
|
-
import {
|
|
7
|
-
import { A as AcpSessionManager } from './AcpSessionManager-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { i as errorLogMetadata, j as contentLogMetadata, h as connectionState, A as ApiClient } from './types-CkbfdRzq.mjs';
|
|
7
|
+
import { A as AcpSessionManager } from './AcpSessionManager-dGDgNb-p.mjs';
|
|
8
|
+
import { z as ensurePrivateDirectorySync, D as hardenPrivateFileSync, E as writePrivateFileSync, r as readSettings, v as notifyDaemonSessionStarted, w as encodeBase64, l as logger, c as configuration } from './limits-C_DW0M0q.mjs';
|
|
9
|
+
import { h as initialMachineMetadata, j as createSessionMetadata, k as setupOfflineReconnection, M as MessageQueue2, v as registerKillSessionHandler } from './index-B4oXnbYw.mjs';
|
|
10
10
|
import WebSocket from 'ws';
|
|
11
11
|
import * as ed from '@noble/ed25519';
|
|
12
12
|
import { sha512 } from '@noble/hashes/sha2.js';
|
|
@@ -33,7 +33,7 @@ import '@anthropic-ai/sandbox-runtime';
|
|
|
33
33
|
import 'expo-server-sdk';
|
|
34
34
|
import 'chalk';
|
|
35
35
|
import 'node:util';
|
|
36
|
-
import './agentGuidance-
|
|
36
|
+
import './agentGuidance-BWxFC6UL.mjs';
|
|
37
37
|
import 'ink';
|
|
38
38
|
import 'react';
|
|
39
39
|
import '@anthropic-ai/claude-agent-sdk';
|
|
@@ -3,51 +3,17 @@
|
|
|
3
3
|
var chalk = require('chalk');
|
|
4
4
|
var node_fs = require('node:fs');
|
|
5
5
|
var path = require('node:path');
|
|
6
|
-
var persistence = require('./limits-
|
|
7
|
-
var
|
|
8
|
-
require('node:fs/promises');
|
|
9
|
-
require('node:os');
|
|
6
|
+
var persistence = require('./limits-DkfHJ3nS.cjs');
|
|
7
|
+
var agentGuidance = require('./agentGuidance-un7YPryB.cjs');
|
|
10
8
|
require('zod');
|
|
9
|
+
require('@paralleldrive/cuid2');
|
|
10
|
+
require('node:fs/promises');
|
|
11
11
|
require('node:crypto');
|
|
12
12
|
require('tweetnacl');
|
|
13
13
|
require('node:util');
|
|
14
|
-
require('
|
|
15
|
-
require('./types-Bd_TGr0F.cjs');
|
|
14
|
+
require('node:os');
|
|
16
15
|
require('axios');
|
|
17
|
-
require('node:events');
|
|
18
16
|
require('socket.io-client');
|
|
19
|
-
require('child_process');
|
|
20
|
-
require('util');
|
|
21
|
-
require('fs/promises');
|
|
22
|
-
require('crypto');
|
|
23
|
-
require('path');
|
|
24
|
-
require('cross-spawn');
|
|
25
|
-
require('./terminalTitleSuggest-Dji8I0Jy.cjs');
|
|
26
|
-
require('url');
|
|
27
|
-
require('os');
|
|
28
|
-
require('node:child_process');
|
|
29
|
-
require('node-pty');
|
|
30
|
-
require('fs');
|
|
31
|
-
require('node:readline');
|
|
32
|
-
require('@anthropic-ai/sandbox-runtime');
|
|
33
|
-
require('expo-server-sdk');
|
|
34
|
-
require('./agentGuidance-DUBXppv-.cjs');
|
|
35
|
-
require('ink');
|
|
36
|
-
require('react');
|
|
37
|
-
require('@anthropic-ai/claude-agent-sdk');
|
|
38
|
-
require('ps-list');
|
|
39
|
-
require('tmp');
|
|
40
|
-
require('open');
|
|
41
|
-
require('fastify');
|
|
42
|
-
require('fastify-type-provider-zod');
|
|
43
|
-
require('node:module');
|
|
44
|
-
require('@modelcontextprotocol/sdk/server/mcp.js');
|
|
45
|
-
require('node:http');
|
|
46
|
-
require('@modelcontextprotocol/sdk/server/streamableHttp.js');
|
|
47
|
-
require('http');
|
|
48
|
-
require('inquirer');
|
|
49
|
-
require('node:url');
|
|
50
|
-
require('node:readline/promises');
|
|
51
17
|
|
|
52
18
|
const EXIT_SESSION_NOT_LIVE = 3;
|
|
53
19
|
function parseSendArgs(args) {
|
|
@@ -135,7 +101,7 @@ function fail(options, sessionId, message) {
|
|
|
135
101
|
const payload = { delivered: false, error: message };
|
|
136
102
|
if (sessionId) {
|
|
137
103
|
payload.sessionId = sessionId;
|
|
138
|
-
payload.url =
|
|
104
|
+
payload.url = agentGuidance.sessionWebUrl(sessionId);
|
|
139
105
|
}
|
|
140
106
|
console.log(JSON.stringify(payload));
|
|
141
107
|
} else {
|
|
@@ -188,14 +154,14 @@ async function handleSendCommand(args) {
|
|
|
188
154
|
}
|
|
189
155
|
let result;
|
|
190
156
|
try {
|
|
191
|
-
result = await
|
|
157
|
+
result = await agentGuidance.deliverToSession(sessionId, persisted, prompt, "cli-send", {
|
|
192
158
|
resume: options.resume,
|
|
193
159
|
...options.model !== void 0 ? { model: options.model === "default" ? null : options.model } : {}
|
|
194
160
|
});
|
|
195
161
|
} catch (error) {
|
|
196
162
|
fail(options, sessionId, `Failed to send message: ${error instanceof Error ? error.message : String(error)}`);
|
|
197
163
|
}
|
|
198
|
-
const url =
|
|
164
|
+
const url = agentGuidance.sessionWebUrl(sessionId);
|
|
199
165
|
if (!result.delivered) {
|
|
200
166
|
if (options.json) {
|
|
201
167
|
console.log(JSON.stringify({
|
|
@@ -1,51 +1,17 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { readFileSync } from 'node:fs';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
|
-
import { d as readPersistedSessions, c as configuration } from './limits-
|
|
5
|
-
import {
|
|
6
|
-
import 'node:fs/promises';
|
|
7
|
-
import 'node:os';
|
|
4
|
+
import { d as readPersistedSessions, c as configuration } from './limits-C_DW0M0q.mjs';
|
|
5
|
+
import { n as deliverToSession, o as sessionWebUrl } from './agentGuidance-BWxFC6UL.mjs';
|
|
8
6
|
import 'zod';
|
|
7
|
+
import '@paralleldrive/cuid2';
|
|
8
|
+
import 'node:fs/promises';
|
|
9
9
|
import 'node:crypto';
|
|
10
10
|
import 'tweetnacl';
|
|
11
11
|
import 'node:util';
|
|
12
|
-
import '
|
|
13
|
-
import './types-D5RWyBE5.mjs';
|
|
12
|
+
import 'node:os';
|
|
14
13
|
import 'axios';
|
|
15
|
-
import 'node:events';
|
|
16
14
|
import 'socket.io-client';
|
|
17
|
-
import 'child_process';
|
|
18
|
-
import 'util';
|
|
19
|
-
import 'fs/promises';
|
|
20
|
-
import 'crypto';
|
|
21
|
-
import 'path';
|
|
22
|
-
import 'cross-spawn';
|
|
23
|
-
import './terminalTitleSuggest-DKgX3osW.mjs';
|
|
24
|
-
import 'url';
|
|
25
|
-
import 'os';
|
|
26
|
-
import 'node:child_process';
|
|
27
|
-
import 'node-pty';
|
|
28
|
-
import 'fs';
|
|
29
|
-
import 'node:readline';
|
|
30
|
-
import '@anthropic-ai/sandbox-runtime';
|
|
31
|
-
import 'expo-server-sdk';
|
|
32
|
-
import './agentGuidance-TLYQxsm2.mjs';
|
|
33
|
-
import 'ink';
|
|
34
|
-
import 'react';
|
|
35
|
-
import '@anthropic-ai/claude-agent-sdk';
|
|
36
|
-
import 'ps-list';
|
|
37
|
-
import 'tmp';
|
|
38
|
-
import 'open';
|
|
39
|
-
import 'fastify';
|
|
40
|
-
import 'fastify-type-provider-zod';
|
|
41
|
-
import 'node:module';
|
|
42
|
-
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
43
|
-
import 'node:http';
|
|
44
|
-
import '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
45
|
-
import 'http';
|
|
46
|
-
import 'inquirer';
|
|
47
|
-
import 'node:url';
|
|
48
|
-
import 'node:readline/promises';
|
|
49
15
|
|
|
50
16
|
const EXIT_SESSION_NOT_LIVE = 3;
|
|
51
17
|
function parseSendArgs(args) {
|
|
@@ -1,54 +1,20 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { D as DEFAULT_RECENT_LIMIT, M as MAX_READ_LIMIT, l as listAccountSessions,
|
|
3
|
-
import { i as isValidSessionId } from './
|
|
4
|
-
import 'node:
|
|
2
|
+
import { D as DEFAULT_RECENT_LIMIT, M as MAX_READ_LIMIT, l as listAccountSessions, e as listSessions, f as cliPeerSelf, g as listPeerSessions, s as sendPeerMessage, w as waitForTurnEnd, T as TurnWaitTimeoutError, h as readSessionTranscript, i as stopSession, j as resolvePermissionRequest, k as archiveSession, m as PEER_SCOPES } from './agentGuidance-BWxFC6UL.mjs';
|
|
3
|
+
import { d as readPersistedSessions, i as isValidSessionId } from './limits-C_DW0M0q.mjs';
|
|
4
|
+
import { resolve } from 'node:path';
|
|
5
|
+
import 'zod';
|
|
5
6
|
import 'node:crypto';
|
|
6
|
-
import './limits-Dt7_unH4.mjs';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:fs';
|
|
9
|
-
import 'node:
|
|
10
|
-
import 'zod';
|
|
11
|
-
import 'tweetnacl';
|
|
12
|
-
import 'node:util';
|
|
13
|
-
import '@paralleldrive/cuid2';
|
|
14
|
-
import 'cross-spawn';
|
|
15
|
-
import 'node:readline';
|
|
16
|
-
import './terminalTitleSuggest-DKgX3osW.mjs';
|
|
17
|
-
import 'path';
|
|
18
|
-
import 'url';
|
|
19
|
-
import './agentGuidance-TLYQxsm2.mjs';
|
|
20
|
-
import 'fs/promises';
|
|
21
|
-
import 'ink';
|
|
22
|
-
import 'react';
|
|
23
|
-
import '@anthropic-ai/claude-agent-sdk';
|
|
9
|
+
import 'node:os';
|
|
24
10
|
import 'axios';
|
|
25
|
-
import 'node:events';
|
|
26
11
|
import 'socket.io-client';
|
|
27
|
-
import '
|
|
28
|
-
import '
|
|
29
|
-
import 'node:
|
|
30
|
-
import 'fs';
|
|
31
|
-
import '@anthropic-ai/sandbox-runtime';
|
|
32
|
-
import 'expo-server-sdk';
|
|
33
|
-
import 'crypto';
|
|
34
|
-
import 'ps-list';
|
|
35
|
-
import 'tmp';
|
|
36
|
-
import 'open';
|
|
37
|
-
import 'fastify';
|
|
38
|
-
import 'fastify-type-provider-zod';
|
|
39
|
-
import 'node:module';
|
|
40
|
-
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
41
|
-
import 'node:http';
|
|
42
|
-
import '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
43
|
-
import 'http';
|
|
44
|
-
import 'util';
|
|
45
|
-
import 'inquirer';
|
|
46
|
-
import 'node:url';
|
|
47
|
-
import 'node:readline/promises';
|
|
48
|
-
import 'node-pty';
|
|
12
|
+
import '@paralleldrive/cuid2';
|
|
13
|
+
import 'tweetnacl';
|
|
14
|
+
import 'node:util';
|
|
49
15
|
|
|
50
|
-
const ACTIONS = ["list", "read", "stop", "archive", "approve", "deny"];
|
|
51
|
-
const ACTIONS_NEEDING_ID = /* @__PURE__ */ new Set(["read", "stop", "archive", "approve", "deny"]);
|
|
16
|
+
const ACTIONS = ["list", "read", "stop", "archive", "approve", "deny", "peers", "message"];
|
|
17
|
+
const ACTIONS_NEEDING_ID = /* @__PURE__ */ new Set(["read", "stop", "archive", "approve", "deny", "message"]);
|
|
52
18
|
const ACTIONS_NEEDING_REQUEST_ID = /* @__PURE__ */ new Set(["approve", "deny"]);
|
|
53
19
|
const REQUEST_ID_RE = /^[a-zA-Z0-9_.:-]{1,128}$/;
|
|
54
20
|
function defaultOptions() {
|
|
@@ -86,6 +52,19 @@ function parseSessionsArgs(args) {
|
|
|
86
52
|
const value = args[++i];
|
|
87
53
|
if (value === void 0) throw new Error("--reason requires a value");
|
|
88
54
|
options.reason = value;
|
|
55
|
+
} else if (arg === "--scope") {
|
|
56
|
+
const value = args[++i];
|
|
57
|
+
if (value === void 0) throw new Error("--scope requires a value");
|
|
58
|
+
if (!PEER_SCOPES.includes(value)) throw new Error(`--scope must be one of ${PEER_SCOPES.join(", ")}`);
|
|
59
|
+
options.scope = value;
|
|
60
|
+
} else if (arg === "--cwd") {
|
|
61
|
+
const value = args[++i];
|
|
62
|
+
if (value === void 0) throw new Error("--cwd requires a value");
|
|
63
|
+
options.cwd = value;
|
|
64
|
+
} else if (arg === "--reply-to") {
|
|
65
|
+
const value = args[++i];
|
|
66
|
+
if (value === void 0 || value.trim() === "") throw new Error("--reply-to requires a value");
|
|
67
|
+
options.replyTo = value;
|
|
89
68
|
} else if (arg === "--tag") {
|
|
90
69
|
const value = args[++i];
|
|
91
70
|
if (value === void 0) throw new Error("--tag requires a value");
|
|
@@ -109,7 +88,7 @@ function parseSessionsArgs(args) {
|
|
|
109
88
|
}
|
|
110
89
|
}
|
|
111
90
|
if (!actionSeen) return defaultOptions();
|
|
112
|
-
const expectedPositionals = ACTIONS_NEEDING_REQUEST_ID.has(options.action) ? 2 : ACTIONS_NEEDING_ID.has(options.action) ? 1 : 0;
|
|
91
|
+
const expectedPositionals = ACTIONS_NEEDING_REQUEST_ID.has(options.action) || options.action === "message" ? 2 : ACTIONS_NEEDING_ID.has(options.action) ? 1 : 0;
|
|
113
92
|
if (positionals.length > expectedPositionals) {
|
|
114
93
|
throw new Error(`Unexpected ${expectedPositionals > 0 ? "extra " : ""}argument: ${positionals[expectedPositionals]}`);
|
|
115
94
|
}
|
|
@@ -119,6 +98,12 @@ function parseSessionsArgs(args) {
|
|
|
119
98
|
if (!isValidSessionId(id)) throw new Error(`Invalid session id: ${id}`);
|
|
120
99
|
options.sessionId = id;
|
|
121
100
|
}
|
|
101
|
+
if (options.action === "message") {
|
|
102
|
+
const text = positionals[1];
|
|
103
|
+
if (text === void 0) throw new Error("message requires a session id and the text to send");
|
|
104
|
+
if (text.trim() === "") throw new Error("message text is empty");
|
|
105
|
+
options.text = text;
|
|
106
|
+
}
|
|
122
107
|
if (ACTIONS_NEEDING_REQUEST_ID.has(options.action)) {
|
|
123
108
|
const requestId = positionals[1];
|
|
124
109
|
if (requestId === void 0) throw new Error(`${options.action} requires a session id and a request id`);
|
|
@@ -140,6 +125,11 @@ function parseSessionsArgs(args) {
|
|
|
140
125
|
if (options.wait) throw new Error("--wait only applies to `sessions read`");
|
|
141
126
|
}
|
|
142
127
|
if (options.timeoutSec !== void 0 && !options.wait) throw new Error("--timeout only applies to `sessions read --wait`");
|
|
128
|
+
if (options.action !== "peers") {
|
|
129
|
+
if (options.scope !== void 0) throw new Error("--scope only applies to `sessions peers`");
|
|
130
|
+
if (options.cwd !== void 0) throw new Error("--cwd only applies to `sessions peers`");
|
|
131
|
+
}
|
|
132
|
+
if (options.replyTo !== void 0 && options.action !== "message") throw new Error("--reply-to only applies to `sessions message`");
|
|
143
133
|
return options;
|
|
144
134
|
}
|
|
145
135
|
const SESSIONS_HELP = `
|
|
@@ -153,6 +143,8 @@ ${chalk.bold("Usage:")}
|
|
|
153
143
|
very-happy sessions archive <id> [--json]
|
|
154
144
|
very-happy sessions approve <id> <requestId> [--for-session] [--json]
|
|
155
145
|
very-happy sessions deny <id> <requestId> [--reason <text>] [--json]
|
|
146
|
+
very-happy sessions peers [--scope repo|cwd|machine] [--cwd <dir>] [--json]
|
|
147
|
+
very-happy sessions message <id> <text> [--reply-to <msgId>] [--json]
|
|
156
148
|
|
|
157
149
|
${chalk.bold("Actions:")}
|
|
158
150
|
list Running sessions plus recently seen ones, newest first.
|
|
@@ -169,6 +161,17 @@ ${chalk.bold("Actions:")}
|
|
|
169
161
|
the same RPC the web permission card sends. --for-session makes
|
|
170
162
|
it \`approved_for_session\` (the card's "allow for this session").
|
|
171
163
|
deny Answer it with deny (optional --reason is shown to the agent).
|
|
164
|
+
peers Other live sessions on this machine and the files each edited in
|
|
165
|
+
the last 30 minutes. Default scope \`repo\`: same git repository,
|
|
166
|
+
including its other worktrees (\`sameWorktree\` says which share
|
|
167
|
+
your checkout); \`cwd\`: same directory; \`machine\`: everything.
|
|
168
|
+
message Send <text> into a running session here. It arrives tagged with
|
|
169
|
+
the sender (the session named by HAPPY_SESSION_ID when run from a
|
|
170
|
+
managed session's shell, else this CLI) and tells the peer how to
|
|
171
|
+
reply. Refused for sessions that are not running here, not
|
|
172
|
+
spawned by this machine, or terminal mirrors. \`delivered\`
|
|
173
|
+
follows \`very-happy send\`: true only when a wrapper was attached
|
|
174
|
+
before and after the POST (\`stored\` = it is on the server anyway).
|
|
172
175
|
|
|
173
176
|
${chalk.bold("Options:")}
|
|
174
177
|
--all list only: account-wide over REST instead of this
|
|
@@ -190,6 +193,10 @@ ${chalk.bold("Options:")}
|
|
|
190
193
|
--timeout <s> read --wait only: give up after <s> seconds (default 600).
|
|
191
194
|
--for-session approve only: approved_for_session instead of approved.
|
|
192
195
|
--reason <text> deny only: reason forwarded to the wrapper.
|
|
196
|
+
--scope <s> peers only: repo (default) | cwd | machine.
|
|
197
|
+
--cwd <dir> peers only: directory the scope is computed from
|
|
198
|
+
(default: the process cwd, or HAPPY_SESSION_ID's cwd).
|
|
199
|
+
--reply-to <id> message only: the peer message id being answered.
|
|
193
200
|
--json Machine-readable output.
|
|
194
201
|
-h, --help Show this help
|
|
195
202
|
|
|
@@ -290,6 +297,42 @@ async function handleSessionsCommand(args) {
|
|
|
290
297
|
}
|
|
291
298
|
process.exit(0);
|
|
292
299
|
}
|
|
300
|
+
if (options.action === "peers" || options.action === "message") {
|
|
301
|
+
const cwd = options.cwd ? resolve(options.cwd) : process.cwd();
|
|
302
|
+
const persisted = readPersistedSessions();
|
|
303
|
+
const context = { self: () => cliPeerSelf(process.env, cwd, persisted), readPersisted: () => persisted };
|
|
304
|
+
if (options.action === "peers") {
|
|
305
|
+
const listing = await listPeerSessions(context, options.scope ?? "repo");
|
|
306
|
+
if (options.json) {
|
|
307
|
+
console.log(JSON.stringify(listing));
|
|
308
|
+
} else if (listing.peers.length === 0) {
|
|
309
|
+
console.log(`No other live sessions in scope "${listing.scope}"${listing.self.repoRoot ? ` (repo ${listing.self.repoRoot})` : ""}.`);
|
|
310
|
+
} else {
|
|
311
|
+
for (const peer of listing.peers) {
|
|
312
|
+
const parts = [peer.sessionId, `[${peer.kind === "mirror" ? "terminal" : "running"}]`];
|
|
313
|
+
if (peer.title) parts.push(`title="${peer.title}"`);
|
|
314
|
+
if (peer.flavor) parts.push(`agent=${peer.flavor}`);
|
|
315
|
+
if (peer.cwd) parts.push(`cwd=${peer.cwd}${peer.sameWorktree ? "" : " (other worktree)"}`);
|
|
316
|
+
parts.push(peer.url);
|
|
317
|
+
console.log(parts.join(" "));
|
|
318
|
+
for (const edit of peer.edits) console.log(chalk.dim(` ${edit.tool} ${edit.path} (${Math.round((Date.now() - edit.at) / 6e4)}m ago)`));
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
process.exit(0);
|
|
322
|
+
}
|
|
323
|
+
const target = options.sessionId;
|
|
324
|
+
try {
|
|
325
|
+
const result = await sendPeerMessage(context, { to: target, body: options.text, replyTo: options.replyTo });
|
|
326
|
+
if (options.json) console.log(JSON.stringify(result));
|
|
327
|
+
else if (result.delivered) console.log(`Message ${result.messageId} delivered to ${target}
|
|
328
|
+
${result.url}`);
|
|
329
|
+
else console.error(chalk.yellow("Not delivered:"), result.error ?? `session is ${result.status}`, result.stored ? "(stored server-side, unread)" : "");
|
|
330
|
+
process.exit(result.delivered ? 0 : 1);
|
|
331
|
+
} catch (error) {
|
|
332
|
+
if (options.json) console.log(JSON.stringify({ delivered: false, to: target, error: error instanceof Error ? error.message : String(error) }));
|
|
333
|
+
throw error;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
293
336
|
const sessionId = options.sessionId;
|
|
294
337
|
if (options.action === "read") {
|
|
295
338
|
let timedOut = false;
|