@zhigang1992/happy-cli 0.12.14 → 0.12.15

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.
@@ -3,7 +3,7 @@
3
3
  var chalk = require('chalk');
4
4
  var os = require('node:os');
5
5
  var node_crypto = require('node:crypto');
6
- var types = require('./types-Cxw1JC-9.cjs');
6
+ var types = require('./types-CYn1BLoj.cjs');
7
7
  var node_child_process = require('node:child_process');
8
8
  var node_path = require('node:path');
9
9
  var node_readline = require('node:readline');
@@ -1184,7 +1184,7 @@ class AbortError extends Error {
1184
1184
  }
1185
1185
  }
1186
1186
 
1187
- const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-DGfkEaE6.cjs', document.baseURI).href)));
1187
+ const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-BXhnIvhV.cjs', document.baseURI).href)));
1188
1188
  const __dirname$1 = node_path.join(__filename$1, "..");
1189
1189
  function getGlobalClaudeVersion() {
1190
1190
  try {
@@ -5145,7 +5145,9 @@ async function startDaemon() {
5145
5145
  "--happy-starting-mode",
5146
5146
  "remote",
5147
5147
  "--started-by",
5148
- "daemon"
5148
+ "daemon",
5149
+ // Add --resume flag if resuming from a previous Claude session
5150
+ ...options.resumeClaudeSessionId ? ["--resume", options.resumeClaudeSessionId] : []
5149
5151
  ];
5150
5152
  const happyProcess = spawnHappyCLI(args, {
5151
5153
  cwd: directory,
@@ -7028,7 +7030,7 @@ async function handleConnectVendor(vendor, displayName) {
7028
7030
  return;
7029
7031
  } else if (subcommand === "codex") {
7030
7032
  try {
7031
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-DJSRJ2Pg.cjs'); });
7033
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-CDA2a_3g.cjs'); });
7032
7034
  let startedBy = void 0;
7033
7035
  for (let i = 1; i < args.length; i++) {
7034
7036
  if (args[i] === "--started-by") {
@@ -7073,7 +7075,7 @@ async function handleConnectVendor(vendor, displayName) {
7073
7075
  } else if (subcommand === "list") {
7074
7076
  try {
7075
7077
  const { credentials } = await authAndSetupMachineIfNeeded();
7076
- const { listSessions } = await Promise.resolve().then(function () { return require('./list-S3T6MByP.cjs'); });
7078
+ const { listSessions } = await Promise.resolve().then(function () { return require('./list-DnyoGVs0.cjs'); });
7077
7079
  let sessionId;
7078
7080
  let titleFilter;
7079
7081
  let recentMsgs;
@@ -7175,7 +7177,7 @@ Examples:
7175
7177
  process.exit(1);
7176
7178
  }
7177
7179
  const { credentials } = await authAndSetupMachineIfNeeded();
7178
- const { promptSession } = await Promise.resolve().then(function () { return require('./prompt-5iJXZPz1.cjs'); });
7180
+ const { promptSession } = await Promise.resolve().then(function () { return require('./prompt-1J3xTRvg.cjs'); });
7179
7181
  await promptSession(credentials, sessionId, promptText, timeoutMinutes ?? void 0);
7180
7182
  } catch (error) {
7181
7183
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -1,7 +1,7 @@
1
1
  import chalk from 'chalk';
2
2
  import os$1, { homedir } from 'node:os';
3
3
  import { randomUUID, randomBytes, createHmac } from 'node:crypto';
4
- import { l as logger, p as projectPath, j as backoff, k as delay, R as RawJSONLinesSchema, m as AsyncLock, c as configuration, n as readDaemonState, o as clearDaemonState, i as packageJson, r as readSettings, q as readCredentials, g as encodeBase64, u as updateSettings, s as encodeBase64Url, d as decodeBase64, w as writeCredentialsLegacy, t as writeCredentialsDataKey, v as acquireDaemonLock, x as writeDaemonState, A as ApiClient, y as releaseDaemonLock, z as authChallenge, B as clearCredentials, C as clearMachineId, D as getLatestDaemonLog } from './types-HBw6XZbv.mjs';
4
+ import { l as logger, p as projectPath, j as backoff, k as delay, R as RawJSONLinesSchema, m as AsyncLock, c as configuration, n as readDaemonState, o as clearDaemonState, i as packageJson, r as readSettings, q as readCredentials, g as encodeBase64, u as updateSettings, s as encodeBase64Url, d as decodeBase64, w as writeCredentialsLegacy, t as writeCredentialsDataKey, v as acquireDaemonLock, x as writeDaemonState, A as ApiClient, y as releaseDaemonLock, z as authChallenge, B as clearCredentials, C as clearMachineId, D as getLatestDaemonLog } from './types-Do0vU1JP.mjs';
5
5
  import { spawn, execSync, exec as exec$1, execFileSync } from 'node:child_process';
6
6
  import { resolve, join, extname, basename as basename$1 } from 'node:path';
7
7
  import { createInterface } from 'node:readline';
@@ -5122,7 +5122,9 @@ async function startDaemon() {
5122
5122
  "--happy-starting-mode",
5123
5123
  "remote",
5124
5124
  "--started-by",
5125
- "daemon"
5125
+ "daemon",
5126
+ // Add --resume flag if resuming from a previous Claude session
5127
+ ...options.resumeClaudeSessionId ? ["--resume", options.resumeClaudeSessionId] : []
5126
5128
  ];
5127
5129
  const happyProcess = spawnHappyCLI(args, {
5128
5130
  cwd: directory,
@@ -7005,7 +7007,7 @@ async function handleConnectVendor(vendor, displayName) {
7005
7007
  return;
7006
7008
  } else if (subcommand === "codex") {
7007
7009
  try {
7008
- const { runCodex } = await import('./runCodex-DcdBh2dO.mjs');
7010
+ const { runCodex } = await import('./runCodex-CWaOl3u2.mjs');
7009
7011
  let startedBy = void 0;
7010
7012
  for (let i = 1; i < args.length; i++) {
7011
7013
  if (args[i] === "--started-by") {
@@ -7050,7 +7052,7 @@ async function handleConnectVendor(vendor, displayName) {
7050
7052
  } else if (subcommand === "list") {
7051
7053
  try {
7052
7054
  const { credentials } = await authAndSetupMachineIfNeeded();
7053
- const { listSessions } = await import('./list-Bwy2qrWu.mjs');
7055
+ const { listSessions } = await import('./list-CXZgsrb3.mjs');
7054
7056
  let sessionId;
7055
7057
  let titleFilter;
7056
7058
  let recentMsgs;
@@ -7152,7 +7154,7 @@ Examples:
7152
7154
  process.exit(1);
7153
7155
  }
7154
7156
  const { credentials } = await authAndSetupMachineIfNeeded();
7155
- const { promptSession } = await import('./prompt-Bfs9-NO9.mjs');
7157
+ const { promptSession } = await import('./prompt-CvpPWx4v.mjs');
7156
7158
  await promptSession(credentials, sessionId, promptText, timeoutMinutes ?? void 0);
7157
7159
  } catch (error) {
7158
7160
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./index-DGfkEaE6.cjs');
5
- require('./types-Cxw1JC-9.cjs');
4
+ require('./index-BXhnIvhV.cjs');
5
+ require('./types-CYn1BLoj.cjs');
6
6
  require('zod');
7
7
  require('node:child_process');
8
8
  require('node:os');
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'chalk';
2
- import './index-DVKGbEA2.mjs';
3
- import './types-HBw6XZbv.mjs';
2
+ import './index-C1S8W6hS.mjs';
3
+ import './types-Do0vU1JP.mjs';
4
4
  import 'zod';
5
5
  import 'node:child_process';
6
6
  import 'node:os';
package/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var types = require('./types-Cxw1JC-9.cjs');
3
+ var types = require('./types-CYn1BLoj.cjs');
4
4
  require('axios');
5
5
  require('chalk');
6
6
  require('fs');
package/dist/lib.d.cts CHANGED
@@ -767,6 +767,7 @@ interface SpawnSessionOptions {
767
767
  approvedNewDirectoryCreation?: boolean;
768
768
  agent?: 'claude' | 'codex';
769
769
  token?: string;
770
+ resumeClaudeSessionId?: string;
770
771
  }
771
772
  type SpawnSessionResult = {
772
773
  type: 'success';
package/dist/lib.d.mts CHANGED
@@ -767,6 +767,7 @@ interface SpawnSessionOptions {
767
767
  approvedNewDirectoryCreation?: boolean;
768
768
  agent?: 'claude' | 'codex';
769
769
  token?: string;
770
+ resumeClaudeSessionId?: string;
770
771
  }
771
772
  type SpawnSessionResult = {
772
773
  type: 'success';
package/dist/lib.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ApiClient, a as ApiSessionClient, R as RawJSONLinesSchema, c as configuration, l as logger } from './types-HBw6XZbv.mjs';
1
+ export { A as ApiClient, a as ApiSessionClient, R as RawJSONLinesSchema, c as configuration, l as logger } from './types-Do0vU1JP.mjs';
2
2
  import 'axios';
3
3
  import 'chalk';
4
4
  import 'fs';
@@ -1,4 +1,4 @@
1
- import { c as configuration, l as logger, d as decodeBase64, b as decrypt, f as formatTimeAgo, e as libsodiumDecryptFromPublicKey } from './types-HBw6XZbv.mjs';
1
+ import { c as configuration, l as logger, d as decodeBase64, b as decrypt, f as formatTimeAgo, e as libsodiumDecryptFromPublicKey } from './types-Do0vU1JP.mjs';
2
2
  import axios from 'axios';
3
3
  import { existsSync, readdirSync, statSync, readFileSync } from 'fs';
4
4
  import { join } from 'path';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var types = require('./types-Cxw1JC-9.cjs');
3
+ var types = require('./types-CYn1BLoj.cjs');
4
4
  var axios = require('axios');
5
5
  var fs = require('fs');
6
6
  var path = require('path');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var types = require('./types-Cxw1JC-9.cjs');
3
+ var types = require('./types-CYn1BLoj.cjs');
4
4
  var axios = require('axios');
5
5
  var socket_ioClient = require('socket.io-client');
6
6
  require('chalk');
@@ -1,4 +1,4 @@
1
- import { c as configuration, b as decrypt, d as decodeBase64, l as logger, g as encodeBase64, h as encrypt } from './types-HBw6XZbv.mjs';
1
+ import { c as configuration, b as decrypt, d as decodeBase64, l as logger, g as encodeBase64, h as encrypt } from './types-Do0vU1JP.mjs';
2
2
  import axios from 'axios';
3
3
  import { io } from 'socket.io-client';
4
4
  import 'chalk';
@@ -2,14 +2,14 @@
2
2
 
3
3
  var ink = require('ink');
4
4
  var React = require('react');
5
- var types = require('./types-Cxw1JC-9.cjs');
5
+ var types = require('./types-CYn1BLoj.cjs');
6
6
  var index_js = require('@modelcontextprotocol/sdk/client/index.js');
7
7
  var stdio_js = require('@modelcontextprotocol/sdk/client/stdio.js');
8
8
  var z = require('zod');
9
9
  var types_js = require('@modelcontextprotocol/sdk/types.js');
10
10
  var child_process = require('child_process');
11
11
  var node_crypto = require('node:crypto');
12
- var index = require('./index-DGfkEaE6.cjs');
12
+ var index = require('./index-BXhnIvhV.cjs');
13
13
  var os = require('node:os');
14
14
  var node_path = require('node:path');
15
15
  var fs = require('node:fs');
@@ -1,13 +1,13 @@
1
1
  import { useStdout, useInput, Box, Text, render } from 'ink';
2
2
  import React, { useState, useRef, useEffect, useCallback } from 'react';
3
- import { l as logger, A as ApiClient, r as readSettings, p as projectPath, c as configuration, i as packageJson } from './types-HBw6XZbv.mjs';
3
+ import { l as logger, A as ApiClient, r as readSettings, p as projectPath, c as configuration, i as packageJson } from './types-Do0vU1JP.mjs';
4
4
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
5
5
  import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
6
6
  import { z } from 'zod';
7
7
  import { ElicitRequestSchema } from '@modelcontextprotocol/sdk/types.js';
8
8
  import { execSync } from 'child_process';
9
9
  import { randomUUID } from 'node:crypto';
10
- import { i as initialMachineMetadata, n as notifyDaemonSessionStarted, M as MessageQueue2, h as hashObject, r as registerKillSessionHandler, a as MessageBuffer, s as startHappyServer, t as trimIdent, b as stopCaffeinate } from './index-DVKGbEA2.mjs';
10
+ import { i as initialMachineMetadata, n as notifyDaemonSessionStarted, M as MessageQueue2, h as hashObject, r as registerKillSessionHandler, a as MessageBuffer, s as startHappyServer, t as trimIdent, b as stopCaffeinate } from './index-C1S8W6hS.mjs';
11
11
  import os from 'node:os';
12
12
  import { resolve, join } from 'node:path';
13
13
  import fs from 'node:fs';
@@ -41,7 +41,7 @@ function _interopNamespaceDefault(e) {
41
41
  var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
42
42
 
43
43
  var name = "@zhigang1992/happy-cli";
44
- var version = "0.12.14";
44
+ var version = "0.12.15";
45
45
  var description = "Mobile and Web client for Claude Code and Codex";
46
46
  var author = "Kirill Dubovitskiy";
47
47
  var license = "MIT";
@@ -1150,7 +1150,7 @@ class RpcHandlerManager {
1150
1150
  }
1151
1151
  }
1152
1152
 
1153
- const __dirname$1 = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('types-Cxw1JC-9.cjs', document.baseURI).href))));
1153
+ const __dirname$1 = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('types-CYn1BLoj.cjs', document.baseURI).href))));
1154
1154
  function projectPath() {
1155
1155
  const path$1 = path.resolve(__dirname$1, "..");
1156
1156
  return path$1;
@@ -1914,12 +1914,12 @@ class ApiMachineClient {
1914
1914
  requestShutdown
1915
1915
  }) {
1916
1916
  this.rpcHandlerManager.registerHandler("spawn-happy-session", async (params) => {
1917
- const { directory, sessionId, machineId, approvedNewDirectoryCreation, agent, token } = params || {};
1917
+ const { directory, sessionId, machineId, approvedNewDirectoryCreation, agent, token, resumeClaudeSessionId } = params || {};
1918
1918
  logger.debug(`[API MACHINE] Spawning session with params: ${JSON.stringify(params)}`);
1919
1919
  if (!directory) {
1920
1920
  throw new Error("Directory is required");
1921
1921
  }
1922
- const result = await spawnSession({ directory, sessionId, machineId, approvedNewDirectoryCreation, agent, token });
1922
+ const result = await spawnSession({ directory, sessionId, machineId, approvedNewDirectoryCreation, agent, token, resumeClaudeSessionId });
1923
1923
  switch (result.type) {
1924
1924
  case "success":
1925
1925
  logger.debug(`[API MACHINE] Spawned session ${result.sessionId}`);
@@ -20,7 +20,7 @@ import { fileURLToPath } from 'url';
20
20
  import { Expo } from 'expo-server-sdk';
21
21
 
22
22
  var name = "@zhigang1992/happy-cli";
23
- var version = "0.12.14";
23
+ var version = "0.12.15";
24
24
  var description = "Mobile and Web client for Claude Code and Codex";
25
25
  var author = "Kirill Dubovitskiy";
26
26
  var license = "MIT";
@@ -1893,12 +1893,12 @@ class ApiMachineClient {
1893
1893
  requestShutdown
1894
1894
  }) {
1895
1895
  this.rpcHandlerManager.registerHandler("spawn-happy-session", async (params) => {
1896
- const { directory, sessionId, machineId, approvedNewDirectoryCreation, agent, token } = params || {};
1896
+ const { directory, sessionId, machineId, approvedNewDirectoryCreation, agent, token, resumeClaudeSessionId } = params || {};
1897
1897
  logger.debug(`[API MACHINE] Spawning session with params: ${JSON.stringify(params)}`);
1898
1898
  if (!directory) {
1899
1899
  throw new Error("Directory is required");
1900
1900
  }
1901
- const result = await spawnSession({ directory, sessionId, machineId, approvedNewDirectoryCreation, agent, token });
1901
+ const result = await spawnSession({ directory, sessionId, machineId, approvedNewDirectoryCreation, agent, token, resumeClaudeSessionId });
1902
1902
  switch (result.type) {
1903
1903
  case "success":
1904
1904
  logger.debug(`[API MACHINE] Spawned session ${result.sessionId}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhigang1992/happy-cli",
3
- "version": "0.12.14",
3
+ "version": "0.12.15",
4
4
  "description": "Mobile and Web client for Claude Code and Codex",
5
5
  "author": "Kirill Dubovitskiy",
6
6
  "license": "MIT",