@lobu/runtime-device 21.2.1 → 23.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/component.json +1 -1
- package/dist/dependencies.bun.lock +91 -83
- package/npm-shrinkwrap.json +492 -438
- package/package.json +12 -2
- package/vendor/cli/dist/bundled-skills/lobu/SKILL.md +1 -1
- package/vendor/cli/dist/commands/_lib/apply/apply-cmd.js +5 -6
- package/vendor/cli/dist/commands/_lib/apply/client.d.ts +1 -0
- package/vendor/cli/dist/commands/_lib/apply/client.js +26 -7
- package/vendor/cli/dist/commands/_lib/apply/desired-state.d.ts +9 -1
- package/vendor/cli/dist/commands/_lib/apply/diff.d.ts +1 -0
- package/vendor/cli/dist/commands/_lib/apply/diff.js +46 -4
- package/vendor/cli/dist/commands/_lib/apply/map-config.js +18 -38
- package/vendor/cli/dist/commands/_lib/init-from-org/bootstrap.js +5 -17
- package/vendor/cli/dist/commands/init.d.ts +0 -2
- package/vendor/cli/dist/commands/init.js +0 -27
- package/vendor/cli/dist/commands/login.d.ts +17 -0
- package/vendor/cli/dist/commands/login.js +43 -17
- package/vendor/cli/dist/commands/memory/_lib/errors.d.ts +0 -8
- package/vendor/cli/dist/commands/memory/_lib/errors.js +0 -12
- package/vendor/cli/dist/commands/memory/_lib/mcp.js +6 -6
- package/vendor/cli/dist/commands/memory/_lib/seed-cmd.js +4 -10
- package/vendor/cli/dist/config/define.d.ts +21 -15
- package/vendor/cli/dist/config/define.js +2 -2
- package/vendor/cli/dist/connectors/README.md +21 -6
- package/vendor/cli/dist/connectors/_google/actions.ts +270 -0
- package/vendor/cli/dist/connectors/_google/discovery/calendar_v3.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/chat_v1.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/docs_v1.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/drive_v3.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/gmail_v1.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/people_v1.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/sheets_v4.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/tasks_v1.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery/youtube_v3.json +1 -0
- package/vendor/cli/dist/connectors/_google/discovery.ts +442 -0
- package/vendor/cli/dist/connectors/_google/errors.ts +91 -0
- package/vendor/cli/dist/connectors/_google/list-feed.ts +223 -0
- package/vendor/cli/dist/connectors/_google/policies.ts +127 -0
- package/vendor/cli/dist/connectors/agentid.ts +43 -0
- package/vendor/cli/dist/connectors/chat-user-identity.ts +2 -1
- package/vendor/cli/dist/connectors/github-automation-events.ts +9 -0
- package/vendor/cli/dist/connectors/github-identity.ts +28 -3
- package/vendor/cli/dist/connectors/github.ts +101 -59
- package/vendor/cli/dist/connectors/google_calendar.ts +207 -719
- package/vendor/cli/dist/connectors/google_drive.ts +16 -2
- package/vendor/cli/dist/connectors/google_gmail.ts +52 -33
- package/vendor/cli/dist/connectors/herdr.ts +406 -0
- package/vendor/cli/dist/connectors/jira-helpers.ts +313 -0
- package/vendor/cli/dist/connectors/jira.ts +35 -227
- package/vendor/cli/dist/connectors/linear.ts +7 -4
- package/vendor/cli/dist/connectors/linkedin-browser-script.ts +13 -0
- package/vendor/cli/dist/connectors/linkedin-draft-page.js +104 -0
- package/vendor/cli/dist/connectors/linkedin-drafts.ts +73 -0
- package/vendor/cli/dist/connectors/linkedin-identity.ts +32 -0
- package/vendor/cli/dist/connectors/linkedin-inbox-adapter.js +1185 -0
- package/vendor/cli/dist/connectors/linkedin-inbox.ts +156 -0
- package/vendor/cli/dist/connectors/linkedin-like.ts +114 -0
- package/vendor/cli/dist/connectors/linkedin-takeout.ts +577 -0
- package/vendor/cli/dist/connectors/linkedin.ts +3998 -0
- package/vendor/cli/dist/connectors/postgres.ts +27 -2
- package/vendor/cli/dist/connectors/takeout-utils.ts +240 -0
- package/vendor/cli/dist/connectors/tiktok-inbox-page.js +230 -0
- package/vendor/cli/dist/connectors/tiktok-web-page.js +217 -0
- package/vendor/cli/dist/connectors/tiktok_web.ts +319 -0
- package/vendor/cli/dist/connectors/whatsapp-web-adapter.js +285 -567
- package/vendor/cli/dist/connectors/whatsapp-web-helpers.ts +74 -455
- package/vendor/cli/dist/connectors/whatsapp-web-identity.ts +135 -0
- package/vendor/cli/dist/connectors/whatsapp_web.ts +159 -618
- package/vendor/cli/dist/connectors/x-dm-adapter.js +556 -0
- package/vendor/cli/dist/connectors/x-identity.ts +31 -2
- package/vendor/cli/dist/connectors/x.ts +539 -253
- package/vendor/cli/dist/index.js +1 -37
- package/vendor/cli/dist/internal/context.d.ts +10 -0
- package/vendor/cli/dist/internal/context.js +26 -16
- package/vendor/cli/dist/internal/node-version.d.ts +1 -1
- package/vendor/cli/dist/internal/node-version.js +1 -1
- package/vendor/cli/dist/internal/oauth.d.ts +3 -1
- package/vendor/cli/dist/internal/oauth.js +4 -3
- package/vendor/cli/dist/internal/runtime-components.d.ts +9 -0
- package/vendor/cli/dist/internal/runtime-components.js +67 -2
- package/vendor/cli/dist/mac-auth.js +17 -1
- package/vendor/cli/dist/providers.json +1 -1
- package/vendor/cli/dist/runtime-components.json +4 -4
- package/vendor/cli/dist/templates/AGENTS.md.tmpl +12 -5
- package/vendor/cli/dist/templates/README.md.tmpl +1 -1
- package/vendor/cli/dist/vendor/ora/.bun-tag-fde20e9a6df212fa +0 -0
- package/vendor/cli/dist/vendor/ora/index.d.ts +332 -0
- package/vendor/cli/dist/vendor/ora/index.js +424 -0
- package/vendor/cli/dist/vendor/ora/license +9 -0
- package/vendor/cli/dist/vendor/ora/package.json +64 -0
- package/vendor/cli/dist/vendor/ora/readme.md +329 -0
- package/vendor/cli/package.json +2 -2
- package/vendor/connector-sdk/dist/browser-handoff-banner.d.ts +39 -0
- package/vendor/connector-sdk/dist/browser-handoff-banner.js +175 -0
- package/vendor/connector-sdk/dist/browser-requirement.d.ts +36 -0
- package/vendor/connector-sdk/dist/browser-requirement.js +60 -0
- package/vendor/connector-sdk/dist/browser-source-read.d.ts +52 -0
- package/vendor/connector-sdk/dist/browser-source-read.js +107 -0
- package/vendor/connector-sdk/dist/connector-runtime.d.ts +3 -1
- package/vendor/connector-sdk/dist/connector-runtime.js +10 -0
- package/vendor/connector-sdk/dist/connector-types.d.ts +169 -45
- package/vendor/connector-sdk/dist/define-connector.d.ts +4 -2
- package/vendor/connector-sdk/dist/define-connector.js +3 -0
- package/vendor/connector-sdk/dist/index.d.ts +8 -2
- package/vendor/connector-sdk/dist/index.js +3 -0
- package/vendor/connector-sdk/dist/reaction-client-types.d.ts +16 -21
- package/vendor/connector-sdk/dist/reaction-client-types.typecheck.d.ts +5 -0
- package/vendor/connector-sdk/package.json +13 -1
- package/vendor/connector-worker/dist/agent-turn/guest-entry.js +43 -30
- package/vendor/connector-worker/dist/agent-turn/guest.bundle.js +416 -330
- package/vendor/connector-worker/dist/agent-turn/memory.d.ts +3 -2
- package/vendor/connector-worker/dist/agent-turn/memory.js +3 -20
- package/vendor/connector-worker/dist/agent-turn/types.d.ts +3 -15
- package/vendor/connector-worker/dist/agent-turn/workspace.d.ts +2 -2
- package/vendor/connector-worker/dist/agent-turn/workspace.js +2 -4
- package/vendor/connector-worker/dist/daemon/action-monitor.d.ts +12 -0
- package/vendor/connector-worker/dist/daemon/action-monitor.js +25 -0
- package/vendor/connector-worker/dist/daemon/agent-turn.js +0 -9
- package/vendor/connector-worker/dist/daemon/automation.d.ts +4 -11
- package/vendor/connector-worker/dist/daemon/automation.js +6 -6
- package/vendor/connector-worker/dist/daemon/builtins/index.d.ts +12 -0
- package/vendor/connector-worker/dist/daemon/builtins/index.js +61 -1
- package/vendor/connector-worker/dist/daemon/builtins/os-shell.d.ts +2 -1
- package/vendor/connector-worker/dist/daemon/builtins/os-shell.js +40 -27
- package/vendor/connector-worker/dist/daemon/client.d.ts +6 -4
- package/vendor/connector-worker/dist/daemon/client.js +3 -3
- package/vendor/connector-worker/dist/daemon/device-concurrency.d.ts +8 -0
- package/vendor/connector-worker/dist/daemon/device-concurrency.js +13 -0
- package/vendor/connector-worker/dist/daemon/executor.d.ts +1 -1
- package/vendor/connector-worker/dist/daemon/executor.js +48 -120
- package/vendor/connector-worker/dist/daemon/log.d.ts +2 -0
- package/vendor/connector-worker/dist/daemon/log.js +23 -2
- package/vendor/connector-worker/dist/daemon/mac-device-daemon.d.ts +23 -6
- package/vendor/connector-worker/dist/daemon/mac-device-daemon.js +57 -23
- package/vendor/connector-worker/dist/daemon/native-bridge/client.d.ts +6 -0
- package/vendor/connector-worker/dist/daemon/native-bridge/client.js +15 -0
- package/vendor/connector-worker/dist/daemon/native-bridge/executor.js +29 -25
- package/vendor/connector-worker/dist/daemon/native-bridge/protocol.d.ts +1 -1
- package/vendor/connector-worker/dist/daemon/native-bridge/protocol.js +1 -0
- package/vendor/connector-worker/dist/daemon/poll-loop.d.ts +3 -0
- package/vendor/connector-worker/dist/daemon/poll-loop.js +5 -1
- package/vendor/connector-worker/dist/daemon/start.d.ts +1 -0
- package/vendor/connector-worker/dist/daemon/start.js +15 -20
- package/vendor/connector-worker/dist/daemon/terminal-failure.js +0 -11
- package/vendor/connector-worker/dist/daemon/worker-id.d.ts +17 -0
- package/vendor/connector-worker/dist/daemon/worker-id.js +22 -0
- package/vendor/connector-worker/dist/executor/interface.d.ts +34 -2
- package/vendor/connector-worker/dist/executor/isolate.js +66 -15
- package/vendor/connector-worker/dist/executor/redact.d.ts +1 -0
- package/vendor/connector-worker/dist/executor/redact.js +97 -26
- package/vendor/connector-worker/dist/executor/runtime.d.ts +7 -0
- package/vendor/connector-worker/dist/executor/runtime.js +26 -0
- package/vendor/connector-worker/dist/isolate/bridge.js +3 -1
- package/vendor/connector-worker/dist/mac-device-daemon.js +24 -29
- package/vendor/connector-worker/package.json +2 -2
- package/vendor/core/dist/agent-policy.js +1 -1
- package/vendor/core/dist/agent-store.d.ts +2 -0
- package/vendor/core/dist/agent-tooling.d.ts +1 -1
- package/vendor/core/dist/agent-tooling.js +1 -1
- package/vendor/core/dist/capabilities.d.ts +1 -1
- package/vendor/core/dist/capabilities.js +2 -1
- package/vendor/core/dist/connector-query-errors.d.ts +32 -0
- package/vendor/core/dist/connector-query-errors.js +41 -1
- package/vendor/core/dist/contracts/agent-settings.d.ts +0 -11
- package/vendor/core/dist/contracts/agent-settings.js +1 -7
- package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +93 -0
- package/vendor/core/dist/contracts/tools/collection-presentation.js +88 -0
- package/vendor/core/dist/contracts/tools/collection-selection.d.ts +47 -0
- package/vendor/core/dist/contracts/tools/collection-selection.js +74 -0
- package/vendor/core/dist/contracts/tools/manage-agents.d.ts +10 -4
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +1 -1
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +5 -1
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +19 -4
- package/vendor/core/dist/contracts/tools/manage-automations.js +25 -8
- package/vendor/core/dist/contracts/tools/manage-connections.d.ts +1 -0
- package/vendor/core/dist/contracts/tools/manage-connections.js +3 -0
- package/vendor/core/dist/contracts/tools/manage-conversations.js +2 -2
- package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +11 -0
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +42 -3
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +181 -152
- package/vendor/core/dist/contracts/tools/manage-entity.js +118 -162
- package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +14 -0
- package/vendor/core/dist/contracts/tools/manage-feeds.js +17 -0
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +41 -3
- package/vendor/core/dist/contracts/tools/manage-operations.js +40 -2
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +182 -7
- package/vendor/core/dist/contracts/tools/manage-views.js +49 -13
- package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +11 -2
- package/vendor/core/dist/contracts/tools/read-knowledge.js +23 -3
- package/vendor/core/dist/contracts/tools/save-memory.d.ts +3 -6
- package/vendor/core/dist/contracts/tools/save-memory.js +2 -6
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +2 -1
- package/vendor/core/dist/contracts/tools/view-attach.js +7 -2
- package/vendor/core/dist/contracts/worker/protocol.d.ts +130 -159
- package/vendor/core/dist/contracts/worker/protocol.js +88 -76
- package/vendor/core/dist/device-pin-tombstones.d.ts +44 -0
- package/vendor/core/dist/device-pin-tombstones.js +57 -0
- package/vendor/core/dist/index.d.ts +5 -5
- package/vendor/core/dist/index.js +4 -6
- package/vendor/core/dist/json-template.d.ts +6 -10
- package/vendor/core/dist/json-template.js +5 -9
- package/vendor/core/dist/logger.js +17 -26
- package/vendor/core/dist/shell-safety.d.ts +9 -0
- package/vendor/core/dist/shell-safety.js +154 -0
- package/vendor/core/dist/suggestions.d.ts +1 -1
- package/vendor/core/dist/suggestions.js +1 -1
- package/vendor/core/dist/tool-trace-summary.d.ts +1 -1
- package/vendor/core/dist/tool-trace-summary.js +1 -1
- package/vendor/core/dist/types.d.ts +1 -3
- package/vendor/core/dist/utils/diagnostic-scrubber.d.ts +7 -0
- package/vendor/core/dist/utils/diagnostic-scrubber.js +437 -0
- package/vendor/core/dist/worker/auth.d.ts +44 -6
- package/vendor/core/dist/worker/auth.js +44 -11
- package/vendor/core/dist/worker/wire.d.ts +0 -10
- package/vendor/core/package.json +20 -11
- package/vendor/ora/.bun-tag-fde20e9a6df212fa +0 -0
- package/vendor/ora/index.d.ts +332 -0
- package/vendor/ora/index.js +424 -0
- package/vendor/ora/license +9 -0
- package/vendor/ora/package.json +53 -0
- package/vendor/ora/readme.md +329 -0
- package/vendor/cli/dist/commands/telemetry.d.ts +0 -10
- package/vendor/cli/dist/commands/telemetry.js +0 -66
- package/vendor/connector-worker/dist/daemon/device-chat.d.ts +0 -9
- package/vendor/connector-worker/dist/daemon/device-chat.js +0 -61
- package/vendor/core/dist/contracts/worker/device-chat.d.ts +0 -4
- package/vendor/core/dist/contracts/worker/device-chat.js +0 -26
- package/vendor/core/dist/sentry.d.ts +0 -26
- package/vendor/core/dist/sentry.js +0 -133
- package/vendor/core/dist/tool-policy.d.ts +0 -74
- package/vendor/core/dist/tool-policy.js +0 -305
- package/vendor/core/dist/utils/sentry-scrubber.d.ts +0 -29
- package/vendor/core/dist/utils/sentry-scrubber.js +0 -228
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WhatsApp Web chat-sender identity: namespace and normalization.
|
|
3
|
+
*
|
|
4
|
+
* A WhatsApp person is addressed by one of two unrelated JIDs: the phone-number
|
|
5
|
+
* JID (`<digits>@s.whatsapp.net`, which the web client also spells `@c.us`) and
|
|
6
|
+
* the privacy LID (`<digits>@lid`). The SAME human can arrive under either, but
|
|
7
|
+
* nothing in a message proves that a given LID and a given phone JID belong to
|
|
8
|
+
* one person — the page's own LID→phone migration is best-effort and silent on
|
|
9
|
+
* a miss. So the stored key KEEPS its server suffix: a phone JID and a LID are
|
|
10
|
+
* two distinct keys that never compare equal, and a member who wants to be
|
|
11
|
+
* recognised under both carries both, each written by an explicit link. This
|
|
12
|
+
* module never derives one from the other.
|
|
13
|
+
*
|
|
14
|
+
* Group JIDs (`@g.us`), broadcasts and newsletters name a conversation, not a
|
|
15
|
+
* person, so they are not user keys at all.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { ChatUserIdentity } from "./chat-user-identity.js";
|
|
19
|
+
import type { ConnectorIdentityModule } from "./connector-identity-module.js";
|
|
20
|
+
|
|
21
|
+
/** Connector-owned identity namespaces (not SDK-global). */
|
|
22
|
+
export const WHATSAPP_WEB_IDENTITY = {
|
|
23
|
+
/**
|
|
24
|
+
* A WhatsApp person JID, server suffix included: `<digits>@s.whatsapp.net`
|
|
25
|
+
* or `<digits>@lid`. Distinct from the connector's `wa_jid` person-entity
|
|
26
|
+
* attribution key, so a chat link on a `$member` never collides with the
|
|
27
|
+
* contact entity the same sender's messages auto-create.
|
|
28
|
+
*/
|
|
29
|
+
USER_JID: "whatsapp_user_jid",
|
|
30
|
+
} as const;
|
|
31
|
+
|
|
32
|
+
export const WHATSAPP_PHONE_SERVER = "s.whatsapp.net";
|
|
33
|
+
export const WHATSAPP_LEGACY_PHONE_SERVER = "c.us";
|
|
34
|
+
export const WHATSAPP_LID_SERVER = "lid";
|
|
35
|
+
/** Chat JID suffix for WhatsApp groups (a conversation, not a person). */
|
|
36
|
+
export const WHATSAPP_GROUP_SUFFIX = "@g.us";
|
|
37
|
+
/**
|
|
38
|
+
* Chat JID suffixes for 1:1 chats, including the web client's legacy phone
|
|
39
|
+
* spelling. Anything else (group, broadcast, newsletter) is not a DM.
|
|
40
|
+
*/
|
|
41
|
+
export const WHATSAPP_DM_SUFFIXES = [
|
|
42
|
+
"@s.whatsapp.net",
|
|
43
|
+
"@c.us",
|
|
44
|
+
"@lid",
|
|
45
|
+
] as const;
|
|
46
|
+
|
|
47
|
+
/** True when `value` is only ASCII digits, with a length in [min, max]. */
|
|
48
|
+
function isDigits(value: string, min: number, max: number): boolean {
|
|
49
|
+
if (value.length < min || value.length > max) return false;
|
|
50
|
+
for (const ch of value) {
|
|
51
|
+
if (ch < "0" || ch > "9") return false;
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Canonicalize a WhatsApp person JID, or null when the value is not one.
|
|
58
|
+
*
|
|
59
|
+
* - `@c.us` is the web client's spelling of the phone server and becomes
|
|
60
|
+
* `@s.whatsapp.net`, matching the connector's own canonical form.
|
|
61
|
+
* - A multi-device suffix (`<user>:<device>@server`) addresses one of the
|
|
62
|
+
* person's devices, not a different person, so it is dropped.
|
|
63
|
+
* - Group, broadcast, newsletter and any other server return null.
|
|
64
|
+
*
|
|
65
|
+
* The user part is digits only and bounded, so an arbitrary string can never
|
|
66
|
+
* become an indexed identity value.
|
|
67
|
+
*/
|
|
68
|
+
export function normalizeWhatsAppUserJid(
|
|
69
|
+
raw: string | null | undefined,
|
|
70
|
+
): string | null {
|
|
71
|
+
if (typeof raw !== "string") return null;
|
|
72
|
+
const value = raw.trim().toLowerCase();
|
|
73
|
+
const at = value.indexOf("@");
|
|
74
|
+
if (at <= 0 || at !== value.lastIndexOf("@")) return null;
|
|
75
|
+
const server = value.slice(at + 1);
|
|
76
|
+
const userPart = value.slice(0, at);
|
|
77
|
+
const colon = userPart.indexOf(":");
|
|
78
|
+
const user = colon === -1 ? userPart : userPart.slice(0, colon);
|
|
79
|
+
if (colon !== -1 && !isDigits(userPart.slice(colon + 1), 1, 4)) return null;
|
|
80
|
+
if (!isDigits(user, 5, 32)) return null;
|
|
81
|
+
if (
|
|
82
|
+
server === WHATSAPP_PHONE_SERVER ||
|
|
83
|
+
server === WHATSAPP_LEGACY_PHONE_SERVER
|
|
84
|
+
) {
|
|
85
|
+
return `${user}@${WHATSAPP_PHONE_SERVER}`;
|
|
86
|
+
}
|
|
87
|
+
if (server === WHATSAPP_LID_SERVER) return `${user}@${WHATSAPP_LID_SERVER}`;
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Normalize a WhatsApp Web identity namespace value. Returns `undefined` when
|
|
93
|
+
* the namespace is not owned here (caller falls back to generic hygiene).
|
|
94
|
+
*/
|
|
95
|
+
export function normalizeWhatsAppWebIdentityValue(
|
|
96
|
+
namespace: string,
|
|
97
|
+
raw: string,
|
|
98
|
+
): string | null | undefined {
|
|
99
|
+
switch (namespace) {
|
|
100
|
+
case WHATSAPP_WEB_IDENTITY.USER_JID:
|
|
101
|
+
return normalizeWhatsAppUserJid(raw);
|
|
102
|
+
default:
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** The WhatsApp Web connector's contribution to the server identity wiring. */
|
|
108
|
+
export const whatsAppWebIdentityModule: ConnectorIdentityModule = {
|
|
109
|
+
key: "whatsapp.web",
|
|
110
|
+
// Links a chat sender to a member; not an event-recall key.
|
|
111
|
+
recallNamespaces: [],
|
|
112
|
+
normalize: normalizeWhatsAppWebIdentityValue,
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* WhatsApp Web's sender-identity model. JIDs are unique across all of WhatsApp,
|
|
117
|
+
* so there is no tenant axis: `teamId` is ignored and the scope is global.
|
|
118
|
+
*
|
|
119
|
+
* `providerId` names no sign-in provider Lobu configures — WhatsApp has no OAuth
|
|
120
|
+
* login — so no web sign-in can ever stamp this namespace. A link has to come
|
|
121
|
+
* from an explicit, sender-proven linking step.
|
|
122
|
+
*/
|
|
123
|
+
export const whatsAppWebChatUserIdentity: ChatUserIdentity = {
|
|
124
|
+
platform: "whatsapp.web",
|
|
125
|
+
providerId: "whatsapp",
|
|
126
|
+
namespace: WHATSAPP_WEB_IDENTITY.USER_JID,
|
|
127
|
+
buildUserKey(_teamId, platformUserId) {
|
|
128
|
+
return normalizeWhatsAppUserJid(platformUserId);
|
|
129
|
+
},
|
|
130
|
+
userKeyScope: () => ({ kind: "global" }),
|
|
131
|
+
// The stored key is already the JID the device's `send_message` addresses.
|
|
132
|
+
platformUserIdFromKey(key) {
|
|
133
|
+
return normalizeWhatsAppUserJid(key);
|
|
134
|
+
},
|
|
135
|
+
};
|