happy-imou-cloud 1.1.7 → 2.0.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/dist/{setupOfflineReconnection-ndObLZk0.mjs → BaseReasoningProcessor-BKLRCKTU.mjs} +133 -90
- package/dist/{setupOfflineReconnection-obypStdD.cjs → BaseReasoningProcessor-BRCQXCZY.cjs} +134 -90
- package/dist/{types-BXyraW9R.mjs → api-BGXYX0yH.mjs} +198 -170
- package/dist/{types-BSTmyv9d.cjs → api-D7OK-mML.cjs} +219 -192
- package/dist/command-CnLtKtP-.mjs +51 -0
- package/dist/command-G85giEAF.cjs +54 -0
- package/dist/future-Dq4Ha1Dn.cjs +24 -0
- package/dist/future-xRdLl3vf.mjs +22 -0
- package/dist/{index-DVI4b0mv.cjs → index-B_wlQBy2.cjs} +5493 -7142
- package/dist/{index-CUmYqKWt.mjs → index-C7Y0R-MI.mjs} +5482 -7143
- package/dist/index.cjs +19 -21
- package/dist/index.mjs +19 -21
- package/dist/lib.cjs +3 -2
- package/dist/lib.d.cts +17 -0
- package/dist/lib.d.mts +17 -0
- package/dist/lib.mjs +2 -1
- package/dist/{persistence-BGsuPqaO.mjs → persistence-BA_unuca.mjs} +8 -4
- package/dist/{persistence-BRH9F6RS.cjs → persistence-DHgf1CTG.cjs} +10 -6
- package/dist/registerKillSessionHandler-C2-yHm1V.mjs +428 -0
- package/dist/registerKillSessionHandler-CLREXN11.cjs +433 -0
- package/dist/runClaude-CwAitpX-.cjs +3274 -0
- package/dist/runClaude-uNC5Eym4.mjs +3271 -0
- package/dist/runCodex-B-05E-YZ.mjs +1846 -0
- package/dist/runCodex-Cm0VTqw_.cjs +1848 -0
- package/dist/{runGemini-C3dDtGOV.cjs → runGemini-CLWjwDYS.cjs} +25 -1366
- package/dist/{runGemini-B-EK_BJQ.mjs → runGemini-_biXvQAH.mjs} +12 -1353
- package/dist/types-CiliQpqS.mjs +52 -0
- package/dist/types-DVk3crez.cjs +54 -0
- package/package.json +13 -12
- package/scripts/devtools/README.md +9 -0
- package/scripts/devtools/generate-mock-credentials.ts +94 -0
- package/scripts/release-smoke.mjs +62 -0
- package/dist/config-BQNrtwRY.cjs +0 -183
- package/dist/config-Dn99YH37.mjs +0 -173
- package/dist/runCodex-Cez8cuIh.cjs +0 -1143
- package/dist/runCodex-X0BfjcZH.mjs +0 -1140
package/dist/index.cjs
CHANGED
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('chalk');
|
|
4
|
-
require('./
|
|
5
|
-
require('./
|
|
6
|
-
require('./persistence-BRH9F6RS.cjs');
|
|
4
|
+
require('./api-D7OK-mML.cjs');
|
|
5
|
+
require('./persistence-DHgf1CTG.cjs');
|
|
7
6
|
require('zod');
|
|
7
|
+
require('./index-B_wlQBy2.cjs');
|
|
8
8
|
require('node:child_process');
|
|
9
9
|
require('node:fs');
|
|
10
|
-
require('
|
|
10
|
+
require('@agentclientprotocol/sdk');
|
|
11
11
|
require('node:crypto');
|
|
12
|
-
require('
|
|
13
|
-
require('node:readline');
|
|
12
|
+
require('fs');
|
|
14
13
|
require('path');
|
|
15
|
-
require('
|
|
16
|
-
require('
|
|
17
|
-
require('
|
|
18
|
-
require('
|
|
19
|
-
require('react');
|
|
20
|
-
require('node:url');
|
|
14
|
+
require('os');
|
|
15
|
+
require('child_process');
|
|
16
|
+
require('node:os');
|
|
17
|
+
require('node:path');
|
|
21
18
|
require('axios');
|
|
22
19
|
require('node:events');
|
|
23
20
|
require('socket.io-client');
|
|
24
21
|
require('tweetnacl');
|
|
25
|
-
require('
|
|
26
|
-
require('
|
|
22
|
+
require('util');
|
|
23
|
+
require('fs/promises');
|
|
27
24
|
require('crypto');
|
|
28
|
-
require('
|
|
29
|
-
require('fs');
|
|
30
|
-
require('ps-list');
|
|
31
|
-
require('cross-spawn');
|
|
32
|
-
require('os');
|
|
25
|
+
require('expo-server-sdk');
|
|
26
|
+
require('node:fs/promises');
|
|
33
27
|
require('tmp');
|
|
34
28
|
require('qrcode-terminal');
|
|
35
29
|
require('node:module');
|
|
36
30
|
require('open');
|
|
31
|
+
require('react');
|
|
32
|
+
require('ink');
|
|
33
|
+
require('url');
|
|
34
|
+
require('ps-list');
|
|
35
|
+
require('cross-spawn');
|
|
37
36
|
require('fastify');
|
|
38
37
|
require('fastify-type-provider-zod');
|
|
39
|
-
require('node:
|
|
38
|
+
require('node:readline');
|
|
40
39
|
require('http');
|
|
41
|
-
require('util');
|
|
42
40
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
import 'chalk';
|
|
2
|
-
import './
|
|
3
|
-
import './
|
|
4
|
-
import './persistence-BGsuPqaO.mjs';
|
|
2
|
+
import './api-BGXYX0yH.mjs';
|
|
3
|
+
import './persistence-BA_unuca.mjs';
|
|
5
4
|
import 'zod';
|
|
5
|
+
import './index-C7Y0R-MI.mjs';
|
|
6
6
|
import 'node:child_process';
|
|
7
7
|
import 'node:fs';
|
|
8
|
-
import '
|
|
8
|
+
import '@agentclientprotocol/sdk';
|
|
9
9
|
import 'node:crypto';
|
|
10
|
-
import '
|
|
11
|
-
import 'node:readline';
|
|
10
|
+
import 'fs';
|
|
12
11
|
import 'path';
|
|
13
|
-
import '
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
16
|
-
import '
|
|
17
|
-
import 'react';
|
|
18
|
-
import 'node:url';
|
|
12
|
+
import 'os';
|
|
13
|
+
import 'child_process';
|
|
14
|
+
import 'node:os';
|
|
15
|
+
import 'node:path';
|
|
19
16
|
import 'axios';
|
|
20
17
|
import 'node:events';
|
|
21
18
|
import 'socket.io-client';
|
|
22
19
|
import 'tweetnacl';
|
|
23
|
-
import '
|
|
24
|
-
import '
|
|
20
|
+
import 'util';
|
|
21
|
+
import 'fs/promises';
|
|
25
22
|
import 'crypto';
|
|
26
|
-
import '
|
|
27
|
-
import 'fs';
|
|
28
|
-
import 'ps-list';
|
|
29
|
-
import 'cross-spawn';
|
|
30
|
-
import 'os';
|
|
23
|
+
import 'expo-server-sdk';
|
|
24
|
+
import 'node:fs/promises';
|
|
31
25
|
import 'tmp';
|
|
32
26
|
import 'qrcode-terminal';
|
|
33
27
|
import 'node:module';
|
|
34
28
|
import 'open';
|
|
29
|
+
import 'react';
|
|
30
|
+
import 'ink';
|
|
31
|
+
import 'url';
|
|
32
|
+
import 'ps-list';
|
|
33
|
+
import 'cross-spawn';
|
|
35
34
|
import 'fastify';
|
|
36
35
|
import 'fastify-type-provider-zod';
|
|
37
|
-
import 'node:
|
|
36
|
+
import 'node:readline';
|
|
38
37
|
import 'http';
|
|
39
|
-
import 'util';
|
package/dist/lib.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var api = require('./
|
|
3
|
+
var api = require('./api-D7OK-mML.cjs');
|
|
4
|
+
var types = require('./types-DVk3crez.cjs');
|
|
4
5
|
require('axios');
|
|
5
6
|
require('chalk');
|
|
6
7
|
require('fs');
|
|
@@ -23,6 +24,6 @@ require('expo-server-sdk');
|
|
|
23
24
|
|
|
24
25
|
exports.ApiClient = api.ApiClient;
|
|
25
26
|
exports.ApiSessionClient = api.ApiSessionClient;
|
|
26
|
-
exports.RawJSONLinesSchema = api.RawJSONLinesSchema;
|
|
27
27
|
exports.configuration = api.configuration;
|
|
28
28
|
exports.logger = api.logger;
|
|
29
|
+
exports.RawJSONLinesSchema = types.RawJSONLinesSchema;
|
package/dist/lib.d.cts
CHANGED
|
@@ -468,6 +468,7 @@ type Metadata = {
|
|
|
468
468
|
};
|
|
469
469
|
machineId?: string;
|
|
470
470
|
claudeSessionId?: string;
|
|
471
|
+
codexSessionId?: string;
|
|
471
472
|
tools?: string[];
|
|
472
473
|
slashCommands?: string[];
|
|
473
474
|
homeDir: string;
|
|
@@ -490,6 +491,13 @@ type AgentState = {
|
|
|
490
491
|
tool: string;
|
|
491
492
|
arguments: any;
|
|
492
493
|
createdAt: number;
|
|
494
|
+
requestKind?: 'permission' | 'selection';
|
|
495
|
+
options?: Array<{
|
|
496
|
+
optionId: string;
|
|
497
|
+
label: string;
|
|
498
|
+
description?: string;
|
|
499
|
+
}>;
|
|
500
|
+
defaultOptionId?: string;
|
|
493
501
|
};
|
|
494
502
|
};
|
|
495
503
|
completedRequests?: {
|
|
@@ -503,6 +511,8 @@ type AgentState = {
|
|
|
503
511
|
mode?: PermissionMode;
|
|
504
512
|
decision?: 'approved' | 'approved_for_session' | 'denied' | 'abort';
|
|
505
513
|
allowTools?: string[];
|
|
514
|
+
requestKind?: 'permission' | 'selection';
|
|
515
|
+
selectedOptionId?: string;
|
|
506
516
|
};
|
|
507
517
|
};
|
|
508
518
|
};
|
|
@@ -676,8 +686,12 @@ declare class ApiSessionClient extends EventEmitter {
|
|
|
676
686
|
private metadataLock;
|
|
677
687
|
private encryptionKey;
|
|
678
688
|
private encryptionVariant;
|
|
689
|
+
private pendingReliableCodexMessages;
|
|
679
690
|
constructor(credentials: Credentials, session: Session);
|
|
680
691
|
onUserMessage(callback: (data: UserMessage) => void): void;
|
|
692
|
+
getMetadataSnapshot(): Metadata | null;
|
|
693
|
+
getAgentStateSnapshot(): AgentState | null;
|
|
694
|
+
waitForMetadataUpdate(signal?: AbortSignal): Promise<Metadata | null>;
|
|
681
695
|
/**
|
|
682
696
|
* Send message to session
|
|
683
697
|
* @param body - Message body (can be MessageContent or raw content for agent messages)
|
|
@@ -731,6 +745,9 @@ declare class ApiSessionClient extends EventEmitter {
|
|
|
731
745
|
*/
|
|
732
746
|
flush(): Promise<void>;
|
|
733
747
|
close(): Promise<void>;
|
|
748
|
+
private emitEncryptedSessionMessage;
|
|
749
|
+
private flushReliableCodexMessages;
|
|
750
|
+
private shouldBufferReliableCodexMessage;
|
|
734
751
|
}
|
|
735
752
|
|
|
736
753
|
interface SpawnSessionOptions {
|
package/dist/lib.d.mts
CHANGED
|
@@ -468,6 +468,7 @@ type Metadata = {
|
|
|
468
468
|
};
|
|
469
469
|
machineId?: string;
|
|
470
470
|
claudeSessionId?: string;
|
|
471
|
+
codexSessionId?: string;
|
|
471
472
|
tools?: string[];
|
|
472
473
|
slashCommands?: string[];
|
|
473
474
|
homeDir: string;
|
|
@@ -490,6 +491,13 @@ type AgentState = {
|
|
|
490
491
|
tool: string;
|
|
491
492
|
arguments: any;
|
|
492
493
|
createdAt: number;
|
|
494
|
+
requestKind?: 'permission' | 'selection';
|
|
495
|
+
options?: Array<{
|
|
496
|
+
optionId: string;
|
|
497
|
+
label: string;
|
|
498
|
+
description?: string;
|
|
499
|
+
}>;
|
|
500
|
+
defaultOptionId?: string;
|
|
493
501
|
};
|
|
494
502
|
};
|
|
495
503
|
completedRequests?: {
|
|
@@ -503,6 +511,8 @@ type AgentState = {
|
|
|
503
511
|
mode?: PermissionMode;
|
|
504
512
|
decision?: 'approved' | 'approved_for_session' | 'denied' | 'abort';
|
|
505
513
|
allowTools?: string[];
|
|
514
|
+
requestKind?: 'permission' | 'selection';
|
|
515
|
+
selectedOptionId?: string;
|
|
506
516
|
};
|
|
507
517
|
};
|
|
508
518
|
};
|
|
@@ -676,8 +686,12 @@ declare class ApiSessionClient extends EventEmitter {
|
|
|
676
686
|
private metadataLock;
|
|
677
687
|
private encryptionKey;
|
|
678
688
|
private encryptionVariant;
|
|
689
|
+
private pendingReliableCodexMessages;
|
|
679
690
|
constructor(credentials: Credentials, session: Session);
|
|
680
691
|
onUserMessage(callback: (data: UserMessage) => void): void;
|
|
692
|
+
getMetadataSnapshot(): Metadata | null;
|
|
693
|
+
getAgentStateSnapshot(): AgentState | null;
|
|
694
|
+
waitForMetadataUpdate(signal?: AbortSignal): Promise<Metadata | null>;
|
|
681
695
|
/**
|
|
682
696
|
* Send message to session
|
|
683
697
|
* @param body - Message body (can be MessageContent or raw content for agent messages)
|
|
@@ -731,6 +745,9 @@ declare class ApiSessionClient extends EventEmitter {
|
|
|
731
745
|
*/
|
|
732
746
|
flush(): Promise<void>;
|
|
733
747
|
close(): Promise<void>;
|
|
748
|
+
private emitEncryptedSessionMessage;
|
|
749
|
+
private flushReliableCodexMessages;
|
|
750
|
+
private shouldBufferReliableCodexMessage;
|
|
734
751
|
}
|
|
735
752
|
|
|
736
753
|
interface SpawnSessionOptions {
|
package/dist/lib.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { A as ApiClient, a as ApiSessionClient,
|
|
1
|
+
export { A as ApiClient, a as ApiSessionClient, c as configuration, l as logger } from './api-BGXYX0yH.mjs';
|
|
2
|
+
export { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
|
|
2
3
|
import 'axios';
|
|
3
4
|
import 'chalk';
|
|
4
5
|
import 'fs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { readFile, open, stat,
|
|
2
|
-
import { existsSync,
|
|
1
|
+
import { readFile, unlink, open, stat, mkdir, writeFile, rename } from 'node:fs/promises';
|
|
2
|
+
import { existsSync, unlinkSync, writeFileSync, readdirSync, readFileSync, constants } from 'node:fs';
|
|
3
3
|
import { join, dirname } from 'node:path';
|
|
4
|
-
import { c as configuration, l as logger, e as encodeBase64 } from './
|
|
4
|
+
import { c as configuration, l as logger, e as encodeBase64 } from './api-BGXYX0yH.mjs';
|
|
5
5
|
import * as z from 'zod';
|
|
6
6
|
import 'axios';
|
|
7
7
|
import 'chalk';
|
|
@@ -186,7 +186,7 @@ async function updateSettings(updater) {
|
|
|
186
186
|
const MAX_LOCK_ATTEMPTS = 50;
|
|
187
187
|
const STALE_LOCK_TIMEOUT_MS = 1e4;
|
|
188
188
|
const lockFile = configuration.settingsFile + ".lock";
|
|
189
|
-
const tmpFile = configuration.settingsFile
|
|
189
|
+
const tmpFile = `${configuration.settingsFile}.${process.pid}.${Date.now()}.tmp`;
|
|
190
190
|
let fileHandle;
|
|
191
191
|
let attempts = 0;
|
|
192
192
|
while (attempts < MAX_LOCK_ATTEMPTS) {
|
|
@@ -223,6 +223,10 @@ async function updateSettings(updater) {
|
|
|
223
223
|
await rename(tmpFile, configuration.settingsFile);
|
|
224
224
|
return updated;
|
|
225
225
|
} finally {
|
|
226
|
+
if (existsSync(tmpFile)) {
|
|
227
|
+
await unlink(tmpFile).catch(() => {
|
|
228
|
+
});
|
|
229
|
+
}
|
|
226
230
|
await fileHandle.close();
|
|
227
231
|
await unlink(lockFile).catch(() => {
|
|
228
232
|
});
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var promises = require('node:fs/promises');
|
|
4
4
|
var fs = require('node:fs');
|
|
5
|
-
var
|
|
6
|
-
var api = require('./
|
|
5
|
+
var path = require('node:path');
|
|
6
|
+
var api = require('./api-D7OK-mML.cjs');
|
|
7
7
|
var z = require('zod');
|
|
8
8
|
require('axios');
|
|
9
9
|
require('chalk');
|
|
@@ -207,7 +207,7 @@ async function updateSettings(updater) {
|
|
|
207
207
|
const MAX_LOCK_ATTEMPTS = 50;
|
|
208
208
|
const STALE_LOCK_TIMEOUT_MS = 1e4;
|
|
209
209
|
const lockFile = api.configuration.settingsFile + ".lock";
|
|
210
|
-
const tmpFile = api.configuration.settingsFile
|
|
210
|
+
const tmpFile = `${api.configuration.settingsFile}.${process.pid}.${Date.now()}.tmp`;
|
|
211
211
|
let fileHandle;
|
|
212
212
|
let attempts = 0;
|
|
213
213
|
while (attempts < MAX_LOCK_ATTEMPTS) {
|
|
@@ -244,6 +244,10 @@ async function updateSettings(updater) {
|
|
|
244
244
|
await promises.rename(tmpFile, api.configuration.settingsFile);
|
|
245
245
|
return updated;
|
|
246
246
|
} finally {
|
|
247
|
+
if (fs.existsSync(tmpFile)) {
|
|
248
|
+
await promises.unlink(tmpFile).catch(() => {
|
|
249
|
+
});
|
|
250
|
+
}
|
|
247
251
|
await fileHandle.close();
|
|
248
252
|
await promises.unlink(lockFile).catch(() => {
|
|
249
253
|
});
|
|
@@ -355,7 +359,7 @@ async function clearDaemonState() {
|
|
|
355
359
|
}
|
|
356
360
|
async function acquireDaemonLock(maxAttempts = 3, delayIncrementMs = 1e3) {
|
|
357
361
|
const lockFileName = `daemon.lock.${process.pid}.${Date.now()}`;
|
|
358
|
-
const lockFile =
|
|
362
|
+
const lockFile = path.join(path.dirname(api.configuration.daemonLockFile), lockFileName);
|
|
359
363
|
api.logger.debug(`[ACQUIRE LOCK] Attempting to acquire lock: ${lockFile}`);
|
|
360
364
|
api.logger.debug(`[ACQUIRE LOCK] Platform: ${process.platform}, PID: ${process.pid}`);
|
|
361
365
|
const isPidAlive = (pid) => {
|
|
@@ -450,12 +454,12 @@ async function releaseDaemonLock(lockHandle) {
|
|
|
450
454
|
fs.unlinkSync(api.configuration.daemonLockFile);
|
|
451
455
|
api.logger.debug(`[RELEASE LOCK] Released daemon lock`);
|
|
452
456
|
}
|
|
453
|
-
const lockDir =
|
|
457
|
+
const lockDir = path.dirname(api.configuration.daemonLockFile);
|
|
454
458
|
try {
|
|
455
459
|
const files = fs.readdirSync(lockDir);
|
|
456
460
|
for (const file of files) {
|
|
457
461
|
if (file.startsWith("daemon.lock.") && file.includes(`.${process.pid}.`)) {
|
|
458
|
-
const lockPath =
|
|
462
|
+
const lockPath = path.join(lockDir, file);
|
|
459
463
|
fs.unlinkSync(lockPath);
|
|
460
464
|
api.logger.debug(`[RELEASE LOCK] Released lock: ${file}`);
|
|
461
465
|
}
|