@datalayer/agent-runtimes 1.6.38 → 1.6.39
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-embed/chunks/DatalayerAgentBridge-BuGt8vDu.js +1 -0
- package/dist-embed/datalayer-app-main.js +148 -148
- package/lib/apps/plugins/agents/DatalayerAgentBridge.js +10 -3
- package/lib/apps/plugins/agents/SandboxSelector.js +1 -1
- package/lib/apps/plugins/agents/handoffRuntime.d.ts +36 -0
- package/lib/apps/plugins/agents/handoffRuntime.js +50 -0
- package/lib/apps/plugins/agents/plugin.d.ts +20 -6
- package/lib/apps/plugins/agents/plugin.js +1 -0
- package/lib/apps/plugins/agents/switchable.d.ts +14 -2
- package/lib/apps/plugins/agents/switchable.js +13 -3
- package/lib/loop-main.js +27 -25
- package/lib/portable/hosts/agentClient.d.ts +9 -9
- package/lib/portable/hosts/agentClient.js +34 -8
- package/lib/portable/hosts/contracts.json +3 -28
- package/lib/portable/hosts/index.d.ts +0 -1
- package/lib/portable/hosts/index.js +0 -1
- package/package.json +1 -1
- package/dist-embed/chunks/DatalayerAgentBridge-BmoysA2b.js +0 -1
- package/lib/portable/hosts/sessionUid.d.ts +0 -9
- package/lib/portable/hosts/sessionUid.js +0 -29
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
-
* Distributed under the terms of the Modified BSD License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* One host thread is one Datalayer session: its uid, derived from where the
|
|
7
|
-
* thread is, so that a retry names it again. Moved from the Slack service (DC-004).
|
|
8
|
-
*
|
|
9
|
-
* @module portable/hosts/sessionUid
|
|
10
|
-
*/
|
|
11
|
-
import { createHash } from 'node:crypto';
|
|
12
|
-
/**
|
|
13
|
-
* `<kind>-<40 hex>`: the SHA-256 of the thread's parts joined by `:`, and
|
|
14
|
-
* `:<generation>` once the thread started over or switched application. The
|
|
15
|
-
* same parts give the same uid (Slack: app, enterprise or `-`, team,
|
|
16
|
-
* channel, thread ts; Discord: application, guild, channel, thread;
|
|
17
|
-
* WhatsApp: WABA, phone number id, and the person's BSUID for a chat or the
|
|
18
|
-
* group's id for a group).
|
|
19
|
-
*/
|
|
20
|
-
export function hostSessionUid(kind, parts, generation) {
|
|
21
|
-
if (!/^[a-z][a-z0-9-]{1,31}$/.test(kind)) {
|
|
22
|
-
throw new Error(`A host kind is lowercase letters and digits: ${kind}.`);
|
|
23
|
-
}
|
|
24
|
-
if (parts.length === 0 || parts.some(part => part === '')) {
|
|
25
|
-
throw new Error('A thread is named by its parts, none of them empty.');
|
|
26
|
-
}
|
|
27
|
-
const key = `${parts.join(':')}${generation ? `:${generation}` : ''}`;
|
|
28
|
-
return `${kind}-${createHash('sha256').update(key).digest('hex').slice(0, 40)}`;
|
|
29
|
-
}
|