happy-imou-cloud 2.1.12 → 2.1.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.
- package/dist/{BaseReasoningProcessor-yYne8hbQ.cjs → BaseReasoningProcessor-CM_72G79.cjs} +2 -2
- package/dist/{BaseReasoningProcessor-DgKkEyg_.mjs → BaseReasoningProcessor-CVlTn4bz.mjs} +2 -2
- package/dist/{ProviderSelectionHandler-CARO_dnJ.cjs → ProviderSelectionHandler-8KqyCR1t.cjs} +2 -2
- package/dist/{ProviderSelectionHandler-CxLijFCe.mjs → ProviderSelectionHandler-CRMANxaw.mjs} +2 -2
- package/dist/{api-CwRFeZQw.cjs → api-BPXrSITF.cjs} +86 -9
- package/dist/{api-0mR8QJK2.mjs → api-Cgyrs44K.mjs} +86 -10
- package/dist/{command-0ypdkfyo.cjs → command-BlMDPyNv.cjs} +3 -3
- package/dist/{command-Dh_oQxDu.mjs → command-ykLmhw9O.mjs} +3 -3
- package/dist/{index-IkNv7MfY.cjs → index-BHLqfbDm.cjs} +364 -13
- package/dist/{index-zIZBoE62.mjs → index-BKd56kbE.mjs} +361 -10
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.cts +268 -159
- package/dist/lib.d.mts +268 -159
- package/dist/lib.mjs +1 -1
- package/dist/{persistence-CZEdRTGx.mjs → persistence-D1rI_096.mjs} +1 -1
- package/dist/{persistence-BlqXzujW.cjs → persistence-DgaStaev.cjs} +1 -1
- package/dist/{registerKillSessionHandler-B0an4vUf.cjs → registerKillSessionHandler-Bc-f3xFV.cjs} +39 -4
- package/dist/{registerKillSessionHandler-DYg4cQCz.mjs → registerKillSessionHandler-BqFm3Yvi.mjs} +39 -4
- package/dist/{runClaude-DWeTS-VL.mjs → runClaude-BYVqYLc6.mjs} +5 -5
- package/dist/{runClaude-C6PA0-0n.cjs → runClaude-Da0YUY3E.cjs} +5 -5
- package/dist/{runCodex-B_TM-cqA.cjs → runCodex-CZZNiXT5.cjs} +9 -9
- package/dist/{runCodex-DUXczsJP.mjs → runCodex-x0k9hJyI.mjs} +9 -9
- package/dist/{runGemini-CBpN6a9w.mjs → runGemini-B_bJyd4j.mjs} +5 -5
- package/dist/{runGemini-0-mnECiy.cjs → runGemini-C6_EpYe9.cjs} +5 -5
- package/package.json +1 -1
- package/scripts/release-notes-utils.mjs +91 -0
- package/scripts/release-smoke-utils.mjs +11 -0
- package/scripts/release-smoke.mjs +270 -264
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var api = require('./api-
|
|
3
|
+
var index = require('./index-BHLqfbDm.cjs');
|
|
4
|
+
var api = require('./api-BPXrSITF.cjs');
|
|
5
5
|
var node_events = require('node:events');
|
|
6
6
|
var node_crypto = require('node:crypto');
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as createSessionMetadata, p as publishSessionRegistration } from './index-
|
|
2
|
-
import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-
|
|
1
|
+
import { a as createSessionMetadata, p as publishSessionRegistration } from './index-BKd56kbE.mjs';
|
|
2
|
+
import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-Cgyrs44K.mjs';
|
|
3
3
|
import { EventEmitter } from 'node:events';
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
5
|
|
package/dist/{ProviderSelectionHandler-CARO_dnJ.cjs → ProviderSelectionHandler-8KqyCR1t.cjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var api = require('./api-
|
|
4
|
-
var registerKillSessionHandler = require('./registerKillSessionHandler-
|
|
3
|
+
var api = require('./api-BPXrSITF.cjs');
|
|
4
|
+
var registerKillSessionHandler = require('./registerKillSessionHandler-Bc-f3xFV.cjs');
|
|
5
5
|
|
|
6
6
|
async function runModeLoop(opts) {
|
|
7
7
|
let currentMode = opts.startingMode;
|
package/dist/{ProviderSelectionHandler-CxLijFCe.mjs → ProviderSelectionHandler-CRMANxaw.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as logger } from './api-
|
|
2
|
-
import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-
|
|
1
|
+
import { l as logger } from './api-Cgyrs44K.mjs';
|
|
2
|
+
import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-BqFm3Yvi.mjs';
|
|
3
3
|
|
|
4
4
|
async function runModeLoop(opts) {
|
|
5
5
|
let currentMode = opts.startingMode;
|
|
@@ -18,7 +18,7 @@ var node_child_process = require('node:child_process');
|
|
|
18
18
|
var expoServerSdk = require('expo-server-sdk');
|
|
19
19
|
|
|
20
20
|
var name = "happy-imou-cloud";
|
|
21
|
-
var version = "2.1.
|
|
21
|
+
var version = "2.1.15";
|
|
22
22
|
var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
|
|
23
23
|
var author = "long.zhu";
|
|
24
24
|
var license = "MIT";
|
|
@@ -433,7 +433,7 @@ async function listDaemonLogFiles(limit = 50) {
|
|
|
433
433
|
return { file, path: fullPath, modified: stats.mtime };
|
|
434
434
|
}).sort((a, b) => b.modified.getTime() - a.modified.getTime());
|
|
435
435
|
try {
|
|
436
|
-
const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-
|
|
436
|
+
const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-DgaStaev.cjs'); });
|
|
437
437
|
const state = await readDaemonState();
|
|
438
438
|
if (!state) {
|
|
439
439
|
return logs;
|
|
@@ -948,6 +948,22 @@ function buildSessionRuntimeIndex(metadata) {
|
|
|
948
948
|
};
|
|
949
949
|
}
|
|
950
950
|
|
|
951
|
+
function preserveSessionRuntimeMetadata(current, next) {
|
|
952
|
+
if (!current) {
|
|
953
|
+
return next;
|
|
954
|
+
}
|
|
955
|
+
return {
|
|
956
|
+
...next,
|
|
957
|
+
...next.machineId ? {} : current.machineId ? { machineId: current.machineId } : {},
|
|
958
|
+
...typeof next.hostPid === "number" ? {} : typeof current.hostPid === "number" ? { hostPid: current.hostPid } : {},
|
|
959
|
+
...typeof next.startedFromDaemon === "boolean" ? {} : typeof current.startedFromDaemon === "boolean" ? { startedFromDaemon: current.startedFromDaemon } : {},
|
|
960
|
+
...next.startedBy ? {} : current.startedBy ? { startedBy: current.startedBy } : {},
|
|
961
|
+
...next.lifecycleState ? {} : current.lifecycleState ? { lifecycleState: current.lifecycleState } : {},
|
|
962
|
+
...typeof next.lifecycleStateSince === "number" ? {} : typeof current.lifecycleStateSince === "number" ? { lifecycleStateSince: current.lifecycleStateSince } : {},
|
|
963
|
+
...next.flavor ? {} : current.flavor ? { flavor: current.flavor } : {}
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
|
|
951
967
|
async function delay(ms) {
|
|
952
968
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
953
969
|
}
|
|
@@ -1933,6 +1949,12 @@ class ApiSessionClient extends node_events.EventEmitter {
|
|
|
1933
1949
|
getAgentStateSnapshot() {
|
|
1934
1950
|
return this.agentState;
|
|
1935
1951
|
}
|
|
1952
|
+
mergeRuntimeMetadata(next) {
|
|
1953
|
+
if (!next) {
|
|
1954
|
+
return next;
|
|
1955
|
+
}
|
|
1956
|
+
return preserveSessionRuntimeMetadata(this.metadata, next);
|
|
1957
|
+
}
|
|
1936
1958
|
async waitForMetadataUpdate(signal) {
|
|
1937
1959
|
if (signal?.aborted) {
|
|
1938
1960
|
throw createAbortError();
|
|
@@ -2176,7 +2198,7 @@ class ApiSessionClient extends node_events.EventEmitter {
|
|
|
2176
2198
|
updateMetadata(handler) {
|
|
2177
2199
|
void this.metadataLock.inLock(async () => {
|
|
2178
2200
|
await backoff(async () => {
|
|
2179
|
-
let updated = handler(this.metadata);
|
|
2201
|
+
let updated = this.mergeRuntimeMetadata(handler(this.metadata));
|
|
2180
2202
|
const sessionIndex = buildSessionRuntimeIndex(updated);
|
|
2181
2203
|
const answer = await this.socket.emitWithAck("update-metadata", {
|
|
2182
2204
|
sid: this.sessionId,
|
|
@@ -2185,13 +2207,17 @@ class ApiSessionClient extends node_events.EventEmitter {
|
|
|
2185
2207
|
...sessionIndex ? { sessionIndex } : {}
|
|
2186
2208
|
});
|
|
2187
2209
|
if (answer.result === "success") {
|
|
2188
|
-
this.metadata =
|
|
2210
|
+
this.metadata = this.mergeRuntimeMetadata(
|
|
2211
|
+
decrypt(this.encryptionKey, this.encryptionVariant, decodeBase64(answer.metadata))
|
|
2212
|
+
);
|
|
2189
2213
|
this.metadataVersion = answer.version;
|
|
2190
2214
|
this.emit("metadata-updated", this.metadata);
|
|
2191
2215
|
} else if (answer.result === "version-mismatch") {
|
|
2192
2216
|
if (answer.version > this.metadataVersion) {
|
|
2193
2217
|
this.metadataVersion = answer.version;
|
|
2194
|
-
this.metadata =
|
|
2218
|
+
this.metadata = this.mergeRuntimeMetadata(
|
|
2219
|
+
decrypt(this.encryptionKey, this.encryptionVariant, decodeBase64(answer.metadata))
|
|
2220
|
+
);
|
|
2195
2221
|
this.emit("metadata-updated", this.metadata);
|
|
2196
2222
|
}
|
|
2197
2223
|
throw new Error("Metadata version mismatch");
|
|
@@ -2278,7 +2304,9 @@ class ApiSessionClient extends node_events.EventEmitter {
|
|
|
2278
2304
|
return;
|
|
2279
2305
|
}
|
|
2280
2306
|
if (sessionBody.metadata && sessionBody.metadata.version > this.metadataVersion) {
|
|
2281
|
-
this.metadata =
|
|
2307
|
+
this.metadata = this.mergeRuntimeMetadata(
|
|
2308
|
+
decrypt(this.encryptionKey, this.encryptionVariant, decodeBase64(sessionBody.metadata.value))
|
|
2309
|
+
);
|
|
2282
2310
|
this.metadataVersion = sessionBody.metadata.version;
|
|
2283
2311
|
this.emit("metadata-updated", this.metadata);
|
|
2284
2312
|
}
|
|
@@ -2440,7 +2468,9 @@ class ApiSessionClient extends node_events.EventEmitter {
|
|
|
2440
2468
|
}
|
|
2441
2469
|
applyProtocolV3SessionOverlay(session) {
|
|
2442
2470
|
if (typeof session.metadataVersion === "number" && typeof session.metadata === "string" && session.metadataVersion > this.metadataVersion) {
|
|
2443
|
-
this.metadata =
|
|
2471
|
+
this.metadata = this.mergeRuntimeMetadata(
|
|
2472
|
+
decrypt(this.encryptionKey, this.encryptionVariant, decodeBase64(session.metadata))
|
|
2473
|
+
);
|
|
2444
2474
|
this.metadataVersion = session.metadataVersion;
|
|
2445
2475
|
this.emit("metadata-updated", this.metadata);
|
|
2446
2476
|
}
|
|
@@ -2473,11 +2503,12 @@ class ApiSessionClient extends node_events.EventEmitter {
|
|
|
2473
2503
|
if (version <= this.metadataVersion) {
|
|
2474
2504
|
break;
|
|
2475
2505
|
}
|
|
2476
|
-
|
|
2506
|
+
const nextMetadata = decrypt(
|
|
2477
2507
|
this.encryptionKey,
|
|
2478
2508
|
this.encryptionVariant,
|
|
2479
2509
|
decodeBase64(metadataUpdate.value)
|
|
2480
2510
|
);
|
|
2511
|
+
this.metadata = this.mergeRuntimeMetadata(nextMetadata);
|
|
2481
2512
|
this.metadataVersion = version;
|
|
2482
2513
|
this.emit("metadata-updated", this.metadata);
|
|
2483
2514
|
}
|
|
@@ -3596,13 +3627,58 @@ class ApiClient {
|
|
|
3596
3627
|
url: opts.url,
|
|
3597
3628
|
body: opts.data,
|
|
3598
3629
|
headers: {
|
|
3599
|
-
"Content-Type": "application/json"
|
|
3630
|
+
"Content-Type": "application/json",
|
|
3631
|
+
...opts.headers ?? {}
|
|
3600
3632
|
},
|
|
3601
3633
|
signRequest: opts.signRequest ?? true
|
|
3602
3634
|
}),
|
|
3603
3635
|
timeout: opts.timeout
|
|
3604
3636
|
});
|
|
3605
3637
|
}
|
|
3638
|
+
async getOrganizationFrontDoor() {
|
|
3639
|
+
const response = await this.request({
|
|
3640
|
+
method: "GET",
|
|
3641
|
+
url: `${configuration.serverUrl}/control/v1/views/organization-front-door`,
|
|
3642
|
+
timeout: 5e3
|
|
3643
|
+
});
|
|
3644
|
+
return response.data.frontDoor;
|
|
3645
|
+
}
|
|
3646
|
+
async listOrganizationAgents(opts = {}) {
|
|
3647
|
+
const response = await this.request({
|
|
3648
|
+
method: "GET",
|
|
3649
|
+
url: `${configuration.serverUrl}/control/v1/agents`,
|
|
3650
|
+
headers: opts.organizationId ? { "x-happy-organization-id": opts.organizationId } : void 0,
|
|
3651
|
+
timeout: 5e3
|
|
3652
|
+
});
|
|
3653
|
+
return response.data.agents;
|
|
3654
|
+
}
|
|
3655
|
+
async createOrganizationDispatchNotice(opts) {
|
|
3656
|
+
const response = await this.request({
|
|
3657
|
+
method: "POST",
|
|
3658
|
+
url: `${configuration.serverUrl}/control/v1/dispatches`,
|
|
3659
|
+
data: {
|
|
3660
|
+
memberAgentId: opts.memberAgentId,
|
|
3661
|
+
task_id: opts.taskId,
|
|
3662
|
+
scope: opts.scope,
|
|
3663
|
+
allowed_paths: opts.allowedPaths,
|
|
3664
|
+
forbidden_paths: opts.forbiddenPaths ?? [],
|
|
3665
|
+
cross_scope_policy: "ask-first",
|
|
3666
|
+
note: opts.note ?? null
|
|
3667
|
+
},
|
|
3668
|
+
headers: { "x-happy-organization-id": opts.organizationId },
|
|
3669
|
+
timeout: 1e4
|
|
3670
|
+
});
|
|
3671
|
+
return response.data.receipt;
|
|
3672
|
+
}
|
|
3673
|
+
async getOrganizationDispatchReceipt(opts) {
|
|
3674
|
+
const response = await this.request({
|
|
3675
|
+
method: "GET",
|
|
3676
|
+
url: `${configuration.serverUrl}/control/v1/views/dispatches/${encodeURIComponent(opts.dispatchId)}`,
|
|
3677
|
+
headers: { "x-happy-organization-id": opts.organizationId },
|
|
3678
|
+
timeout: 5e3
|
|
3679
|
+
});
|
|
3680
|
+
return response.data.receipt;
|
|
3681
|
+
}
|
|
3606
3682
|
async getProtocolV3Descriptor() {
|
|
3607
3683
|
const url = `${configuration.serverUrl}/v3/capabilities`;
|
|
3608
3684
|
const payload = await this.requestProtocolV3Resource({
|
|
@@ -4014,4 +4090,5 @@ exports.getLatestDaemonLog = getLatestDaemonLog;
|
|
|
4014
4090
|
exports.isAuthenticationRequiredError = isAuthenticationRequiredError;
|
|
4015
4091
|
exports.logger = logger;
|
|
4016
4092
|
exports.packageJson = packageJson;
|
|
4093
|
+
exports.preserveSessionRuntimeMetadata = preserveSessionRuntimeMetadata;
|
|
4017
4094
|
exports.startOfflineReconnection = startOfflineReconnection;
|
|
@@ -16,7 +16,7 @@ import { spawn } from 'node:child_process';
|
|
|
16
16
|
import { Expo } from 'expo-server-sdk';
|
|
17
17
|
|
|
18
18
|
var name = "happy-imou-cloud";
|
|
19
|
-
var version = "2.1.
|
|
19
|
+
var version = "2.1.15";
|
|
20
20
|
var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
|
|
21
21
|
var author = "long.zhu";
|
|
22
22
|
var license = "MIT";
|
|
@@ -431,7 +431,7 @@ async function listDaemonLogFiles(limit = 50) {
|
|
|
431
431
|
return { file, path: fullPath, modified: stats.mtime };
|
|
432
432
|
}).sort((a, b) => b.modified.getTime() - a.modified.getTime());
|
|
433
433
|
try {
|
|
434
|
-
const { readDaemonState } = await import('./persistence-
|
|
434
|
+
const { readDaemonState } = await import('./persistence-D1rI_096.mjs');
|
|
435
435
|
const state = await readDaemonState();
|
|
436
436
|
if (!state) {
|
|
437
437
|
return logs;
|
|
@@ -946,6 +946,22 @@ function buildSessionRuntimeIndex(metadata) {
|
|
|
946
946
|
};
|
|
947
947
|
}
|
|
948
948
|
|
|
949
|
+
function preserveSessionRuntimeMetadata(current, next) {
|
|
950
|
+
if (!current) {
|
|
951
|
+
return next;
|
|
952
|
+
}
|
|
953
|
+
return {
|
|
954
|
+
...next,
|
|
955
|
+
...next.machineId ? {} : current.machineId ? { machineId: current.machineId } : {},
|
|
956
|
+
...typeof next.hostPid === "number" ? {} : typeof current.hostPid === "number" ? { hostPid: current.hostPid } : {},
|
|
957
|
+
...typeof next.startedFromDaemon === "boolean" ? {} : typeof current.startedFromDaemon === "boolean" ? { startedFromDaemon: current.startedFromDaemon } : {},
|
|
958
|
+
...next.startedBy ? {} : current.startedBy ? { startedBy: current.startedBy } : {},
|
|
959
|
+
...next.lifecycleState ? {} : current.lifecycleState ? { lifecycleState: current.lifecycleState } : {},
|
|
960
|
+
...typeof next.lifecycleStateSince === "number" ? {} : typeof current.lifecycleStateSince === "number" ? { lifecycleStateSince: current.lifecycleStateSince } : {},
|
|
961
|
+
...next.flavor ? {} : current.flavor ? { flavor: current.flavor } : {}
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
|
|
949
965
|
async function delay(ms) {
|
|
950
966
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
951
967
|
}
|
|
@@ -1931,6 +1947,12 @@ class ApiSessionClient extends EventEmitter {
|
|
|
1931
1947
|
getAgentStateSnapshot() {
|
|
1932
1948
|
return this.agentState;
|
|
1933
1949
|
}
|
|
1950
|
+
mergeRuntimeMetadata(next) {
|
|
1951
|
+
if (!next) {
|
|
1952
|
+
return next;
|
|
1953
|
+
}
|
|
1954
|
+
return preserveSessionRuntimeMetadata(this.metadata, next);
|
|
1955
|
+
}
|
|
1934
1956
|
async waitForMetadataUpdate(signal) {
|
|
1935
1957
|
if (signal?.aborted) {
|
|
1936
1958
|
throw createAbortError();
|
|
@@ -2174,7 +2196,7 @@ class ApiSessionClient extends EventEmitter {
|
|
|
2174
2196
|
updateMetadata(handler) {
|
|
2175
2197
|
void this.metadataLock.inLock(async () => {
|
|
2176
2198
|
await backoff(async () => {
|
|
2177
|
-
let updated = handler(this.metadata);
|
|
2199
|
+
let updated = this.mergeRuntimeMetadata(handler(this.metadata));
|
|
2178
2200
|
const sessionIndex = buildSessionRuntimeIndex(updated);
|
|
2179
2201
|
const answer = await this.socket.emitWithAck("update-metadata", {
|
|
2180
2202
|
sid: this.sessionId,
|
|
@@ -2183,13 +2205,17 @@ class ApiSessionClient extends EventEmitter {
|
|
|
2183
2205
|
...sessionIndex ? { sessionIndex } : {}
|
|
2184
2206
|
});
|
|
2185
2207
|
if (answer.result === "success") {
|
|
2186
|
-
this.metadata =
|
|
2208
|
+
this.metadata = this.mergeRuntimeMetadata(
|
|
2209
|
+
decrypt(this.encryptionKey, this.encryptionVariant, decodeBase64(answer.metadata))
|
|
2210
|
+
);
|
|
2187
2211
|
this.metadataVersion = answer.version;
|
|
2188
2212
|
this.emit("metadata-updated", this.metadata);
|
|
2189
2213
|
} else if (answer.result === "version-mismatch") {
|
|
2190
2214
|
if (answer.version > this.metadataVersion) {
|
|
2191
2215
|
this.metadataVersion = answer.version;
|
|
2192
|
-
this.metadata =
|
|
2216
|
+
this.metadata = this.mergeRuntimeMetadata(
|
|
2217
|
+
decrypt(this.encryptionKey, this.encryptionVariant, decodeBase64(answer.metadata))
|
|
2218
|
+
);
|
|
2193
2219
|
this.emit("metadata-updated", this.metadata);
|
|
2194
2220
|
}
|
|
2195
2221
|
throw new Error("Metadata version mismatch");
|
|
@@ -2276,7 +2302,9 @@ class ApiSessionClient extends EventEmitter {
|
|
|
2276
2302
|
return;
|
|
2277
2303
|
}
|
|
2278
2304
|
if (sessionBody.metadata && sessionBody.metadata.version > this.metadataVersion) {
|
|
2279
|
-
this.metadata =
|
|
2305
|
+
this.metadata = this.mergeRuntimeMetadata(
|
|
2306
|
+
decrypt(this.encryptionKey, this.encryptionVariant, decodeBase64(sessionBody.metadata.value))
|
|
2307
|
+
);
|
|
2280
2308
|
this.metadataVersion = sessionBody.metadata.version;
|
|
2281
2309
|
this.emit("metadata-updated", this.metadata);
|
|
2282
2310
|
}
|
|
@@ -2438,7 +2466,9 @@ class ApiSessionClient extends EventEmitter {
|
|
|
2438
2466
|
}
|
|
2439
2467
|
applyProtocolV3SessionOverlay(session) {
|
|
2440
2468
|
if (typeof session.metadataVersion === "number" && typeof session.metadata === "string" && session.metadataVersion > this.metadataVersion) {
|
|
2441
|
-
this.metadata =
|
|
2469
|
+
this.metadata = this.mergeRuntimeMetadata(
|
|
2470
|
+
decrypt(this.encryptionKey, this.encryptionVariant, decodeBase64(session.metadata))
|
|
2471
|
+
);
|
|
2442
2472
|
this.metadataVersion = session.metadataVersion;
|
|
2443
2473
|
this.emit("metadata-updated", this.metadata);
|
|
2444
2474
|
}
|
|
@@ -2471,11 +2501,12 @@ class ApiSessionClient extends EventEmitter {
|
|
|
2471
2501
|
if (version <= this.metadataVersion) {
|
|
2472
2502
|
break;
|
|
2473
2503
|
}
|
|
2474
|
-
|
|
2504
|
+
const nextMetadata = decrypt(
|
|
2475
2505
|
this.encryptionKey,
|
|
2476
2506
|
this.encryptionVariant,
|
|
2477
2507
|
decodeBase64(metadataUpdate.value)
|
|
2478
2508
|
);
|
|
2509
|
+
this.metadata = this.mergeRuntimeMetadata(nextMetadata);
|
|
2479
2510
|
this.metadataVersion = version;
|
|
2480
2511
|
this.emit("metadata-updated", this.metadata);
|
|
2481
2512
|
}
|
|
@@ -3594,13 +3625,58 @@ class ApiClient {
|
|
|
3594
3625
|
url: opts.url,
|
|
3595
3626
|
body: opts.data,
|
|
3596
3627
|
headers: {
|
|
3597
|
-
"Content-Type": "application/json"
|
|
3628
|
+
"Content-Type": "application/json",
|
|
3629
|
+
...opts.headers ?? {}
|
|
3598
3630
|
},
|
|
3599
3631
|
signRequest: opts.signRequest ?? true
|
|
3600
3632
|
}),
|
|
3601
3633
|
timeout: opts.timeout
|
|
3602
3634
|
});
|
|
3603
3635
|
}
|
|
3636
|
+
async getOrganizationFrontDoor() {
|
|
3637
|
+
const response = await this.request({
|
|
3638
|
+
method: "GET",
|
|
3639
|
+
url: `${configuration.serverUrl}/control/v1/views/organization-front-door`,
|
|
3640
|
+
timeout: 5e3
|
|
3641
|
+
});
|
|
3642
|
+
return response.data.frontDoor;
|
|
3643
|
+
}
|
|
3644
|
+
async listOrganizationAgents(opts = {}) {
|
|
3645
|
+
const response = await this.request({
|
|
3646
|
+
method: "GET",
|
|
3647
|
+
url: `${configuration.serverUrl}/control/v1/agents`,
|
|
3648
|
+
headers: opts.organizationId ? { "x-happy-organization-id": opts.organizationId } : void 0,
|
|
3649
|
+
timeout: 5e3
|
|
3650
|
+
});
|
|
3651
|
+
return response.data.agents;
|
|
3652
|
+
}
|
|
3653
|
+
async createOrganizationDispatchNotice(opts) {
|
|
3654
|
+
const response = await this.request({
|
|
3655
|
+
method: "POST",
|
|
3656
|
+
url: `${configuration.serverUrl}/control/v1/dispatches`,
|
|
3657
|
+
data: {
|
|
3658
|
+
memberAgentId: opts.memberAgentId,
|
|
3659
|
+
task_id: opts.taskId,
|
|
3660
|
+
scope: opts.scope,
|
|
3661
|
+
allowed_paths: opts.allowedPaths,
|
|
3662
|
+
forbidden_paths: opts.forbiddenPaths ?? [],
|
|
3663
|
+
cross_scope_policy: "ask-first",
|
|
3664
|
+
note: opts.note ?? null
|
|
3665
|
+
},
|
|
3666
|
+
headers: { "x-happy-organization-id": opts.organizationId },
|
|
3667
|
+
timeout: 1e4
|
|
3668
|
+
});
|
|
3669
|
+
return response.data.receipt;
|
|
3670
|
+
}
|
|
3671
|
+
async getOrganizationDispatchReceipt(opts) {
|
|
3672
|
+
const response = await this.request({
|
|
3673
|
+
method: "GET",
|
|
3674
|
+
url: `${configuration.serverUrl}/control/v1/views/dispatches/${encodeURIComponent(opts.dispatchId)}`,
|
|
3675
|
+
headers: { "x-happy-organization-id": opts.organizationId },
|
|
3676
|
+
timeout: 5e3
|
|
3677
|
+
});
|
|
3678
|
+
return response.data.receipt;
|
|
3679
|
+
}
|
|
3604
3680
|
async getProtocolV3Descriptor() {
|
|
3605
3681
|
const url = `${configuration.serverUrl}/v3/capabilities`;
|
|
3606
3682
|
const payload = await this.requestProtocolV3Resource({
|
|
@@ -3988,4 +4064,4 @@ var api = /*#__PURE__*/Object.freeze({
|
|
|
3988
4064
|
ApiClient: ApiClient
|
|
3989
4065
|
});
|
|
3990
4066
|
|
|
3991
|
-
export { ApiClient as A, HAPPY_ORG_TURN_REPORT_TAG as H, SigningBootstrapRequiredError as S, ApiSessionClient as a, connectionState as b, configuration as c, HAPPY_ORG_SUMMARY_MAX_LENGTH as d, encodeBase64 as e, HAPPY_ORG_REPEAT_THRESHOLD as f, backoff as g, delay as h, isAuthenticationRequiredError as i, AsyncLock as j, buildAuthenticatedHeaders as k, logger as l, SIGNING_BOOTSTRAP_REQUIRED_MESSAGE as m, encodeBase64Url as n, buildClientHeaders as o,
|
|
4067
|
+
export { ApiClient as A, HAPPY_ORG_TURN_REPORT_TAG as H, SigningBootstrapRequiredError as S, ApiSessionClient as a, connectionState as b, configuration as c, HAPPY_ORG_SUMMARY_MAX_LENGTH as d, encodeBase64 as e, HAPPY_ORG_REPEAT_THRESHOLD as f, backoff as g, delay as h, isAuthenticationRequiredError as i, AsyncLock as j, buildAuthenticatedHeaders as k, logger as l, SIGNING_BOOTSTRAP_REQUIRED_MESSAGE as m, encodeBase64Url as n, buildClientHeaders as o, preserveSessionRuntimeMetadata as p, decodeBase64 as q, HAPPY_CLOUD_DAEMON_PORT as r, startOfflineReconnection as s, packageJson as t, HeadTailPreviewBuffer as u, getLatestDaemonLog as v, api as w };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BHLqfbDm.cjs');
|
|
4
4
|
require('chalk');
|
|
5
|
-
require('./api-
|
|
5
|
+
require('./api-BPXrSITF.cjs');
|
|
6
6
|
require('axios');
|
|
7
7
|
require('fs');
|
|
8
8
|
require('node:fs');
|
|
@@ -18,7 +18,7 @@ require('crypto');
|
|
|
18
18
|
require('path');
|
|
19
19
|
require('node:child_process');
|
|
20
20
|
require('expo-server-sdk');
|
|
21
|
-
require('./persistence-
|
|
21
|
+
require('./persistence-DgaStaev.cjs');
|
|
22
22
|
require('node:fs/promises');
|
|
23
23
|
require('os');
|
|
24
24
|
require('tmp');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as createDefaultRuntimeShell } from './index-
|
|
1
|
+
import { c as createDefaultRuntimeShell } from './index-BKd56kbE.mjs';
|
|
2
2
|
import 'chalk';
|
|
3
|
-
import './api-
|
|
3
|
+
import './api-Cgyrs44K.mjs';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'node:fs';
|
|
@@ -16,7 +16,7 @@ import 'crypto';
|
|
|
16
16
|
import 'path';
|
|
17
17
|
import 'node:child_process';
|
|
18
18
|
import 'expo-server-sdk';
|
|
19
|
-
import './persistence-
|
|
19
|
+
import './persistence-D1rI_096.mjs';
|
|
20
20
|
import 'node:fs/promises';
|
|
21
21
|
import 'os';
|
|
22
22
|
import 'tmp';
|