@datalayer/agent-runtimes 1.5.23 → 1.5.25

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.
Files changed (127) hide show
  1. package/dist-embed/chunks/{CellSidebarExtension-CDnzN9Cb.js → CellSidebarExtension-B-73cmcQ.js} +1 -1
  2. package/dist-embed/chunks/{ChatView-BjZ993Ch.js → ChatView-CUWE6I5M.js} +3 -3
  3. package/dist-embed/chunks/{DeckComponent-Cb4_dZpN.js → DeckComponent-ymp4My5d.js} +1 -1
  4. package/dist-embed/chunks/{DocumentView-Caxb2xz-.js → DocumentView-i99p_Qzt.js} +1 -1
  5. package/dist-embed/chunks/{EphemeralDocument-DIHjR5l8.js → EphemeralDocument--pV47gPl.js} +1 -1
  6. package/dist-embed/chunks/{EphemeralNotebook-1Rwa3anx.js → EphemeralNotebook-BqccUXGd.js} +1 -1
  7. package/dist-embed/chunks/{ExcalidrawComponent-vJQwgcUt.js → ExcalidrawComponent-DgSMy796.js} +1 -1
  8. package/dist-embed/chunks/{ExcalidrawModal-BDgjdSz2.js → ExcalidrawModal-DFJW9pQh.js} +1 -1
  9. package/dist-embed/chunks/{JupyterLexicalExtension-_7FM5Om8.js → JupyterLexicalExtension-CqDatsgf.js} +5 -5
  10. package/dist-embed/chunks/{KernelVariables-CKIqy599.js → KernelVariables-CS6h5HyK.js} +1 -1
  11. package/dist-embed/chunks/{NotebookToolSurfaces-YAM1bvZS.js → NotebookToolSurfaces-CTLbTvsS.js} +1 -1
  12. package/dist-embed/chunks/{NotebookView-C8RCvsR1.js → NotebookView-BJpTApeL.js} +1 -1
  13. package/dist-embed/chunks/{Output-BWClePP-.js → Output-no9rnFJ7.js} +1 -1
  14. package/dist-embed/chunks/{SandboxDetailsDialog-CDSxIC0-.js → SandboxDetailsDialog-BAv6RMed.js} +1 -1
  15. package/dist-embed/chunks/{SchemaForm-CO_2yGg2.js → SchemaForm-CE5NfpBU.js} +1 -1
  16. package/dist-embed/chunks/{WidgetVariableView--osoOLv8.js → WidgetVariableView-V4DsgfIK.js} +1 -1
  17. package/dist-embed/chunks/{YouTubePlugin-BB7Z7INn.js → YouTubePlugin-CpgyVTwG.js} +1 -1
  18. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-D6Ko4I2x.js → ar-SA-G6X2FPQ2-DwUjDWHp.js} +1 -1
  19. package/dist-embed/chunks/{az-AZ-76LH7QW2-B3UhxnSz.js → az-AZ-76LH7QW2-DROX4pJc.js} +1 -1
  20. package/dist-embed/chunks/{bg-BG-XCXSNQG7-BS-QRZjB.js → bg-BG-XCXSNQG7-DPLzP9Bm.js} +1 -1
  21. package/dist-embed/chunks/{bn-BD-2XOGV67Q-DNg0uIV0.js → bn-BD-2XOGV67Q-CCOU2J2j.js} +1 -1
  22. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-Bn4yHfTY.js → ca-ES-6MX7JW3Y-3RgFapBd.js} +1 -1
  23. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-DUGnyonZ.js → cs-CZ-2BRQDIVT-BJS7ofhJ.js} +1 -1
  24. package/dist-embed/chunks/{da-DK-5WZEPLOC-Is8nybqO.js → da-DK-5WZEPLOC-BHDT0zzh.js} +1 -1
  25. package/dist-embed/chunks/{de-DE-XR44H4JA-D54sMa4L.js → de-DE-XR44H4JA-CWVJKc9t.js} +1 -1
  26. package/dist-embed/chunks/{el-GR-BZB4AONW-CvM3SWat.js → el-GR-BZB4AONW-2z8DB9lI.js} +1 -1
  27. package/dist-embed/chunks/{es-ES-U4NZUMDT-BZDRRuRf.js → es-ES-U4NZUMDT-DzXGWPd4.js} +1 -1
  28. package/dist-embed/chunks/{eu-ES-A7QVB2H4-DAmknI9y.js → eu-ES-A7QVB2H4-CslHE4iE.js} +1 -1
  29. package/dist-embed/chunks/{fa-IR-HGAKTJCU-CQhKri4O.js → fa-IR-HGAKTJCU-CBWUHs2r.js} +1 -1
  30. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-DzEDoP64.js → fi-FI-Z5N7JZ37-MAr8kZMI.js} +1 -1
  31. package/dist-embed/chunks/{fr-FR-RHASNOE6-DiSkyvEB.js → fr-FR-RHASNOE6-BUz3aHQJ.js} +1 -1
  32. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-3AJMzY-I.js → gl-ES-HMX3MZ6V-DvzQmDYv.js} +1 -1
  33. package/dist-embed/chunks/{he-IL-6SHJWFNN-Cuh5an4X.js → he-IL-6SHJWFNN-DKR3cKyQ.js} +1 -1
  34. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-BbeuFB83.js → hi-IN-IWLTKZ5I-C4tyBNwa.js} +1 -1
  35. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-C1OMfhob.js → hu-HU-A5ZG7DT2-C8BnBgH5.js} +1 -1
  36. package/dist-embed/chunks/{id-ID-SAP4L64H-BzKILJTZ.js → id-ID-SAP4L64H-Bn1hY5OS.js} +1 -1
  37. package/dist-embed/chunks/{index-CPpm1tqJ.js → index-5N0EOEHV.js} +1 -1
  38. package/dist-embed/chunks/{index-f418CYn7.js → index-BKB97UwL.js} +1 -1
  39. package/dist-embed/chunks/{index-CyQgE_Es.js → index-BN8Bbau-.js} +2 -2
  40. package/dist-embed/chunks/{index-CKFrz1es.js → index-BTdq_niO.js} +1 -1
  41. package/dist-embed/chunks/{index-D4QM3qbA.js → index-Bhzj1Pnv.js} +1 -1
  42. package/dist-embed/chunks/{index-BMandbJB.js → index-BzMt3uYX.js} +1 -1
  43. package/dist-embed/chunks/{index-DLimRfHQ.js → index-CCRwowMu.js} +1 -1
  44. package/dist-embed/chunks/{index-BFdE0KFI.js → index-CEbnhuIo.js} +1 -1
  45. package/dist-embed/chunks/{index-CAd5YQQl.js → index-CZB8DyUw.js} +1 -1
  46. package/dist-embed/chunks/{index-BO6VQLH6.js → index-Cd5CgKFr.js} +1 -1
  47. package/dist-embed/chunks/{index-D64QvG43.js → index-CkQ6IAoY.js} +1 -1
  48. package/dist-embed/chunks/{index-BktUM85c.js → index-Coj9opLJ.js} +1 -1
  49. package/dist-embed/chunks/{index-dYwQAVs_.js → index-D9_026K2.js} +1 -1
  50. package/dist-embed/chunks/{index-SbFvdBPQ.js → index-DVaPKQyL.js} +1 -1
  51. package/dist-embed/chunks/{index-f9WZsG2n.js → index-DWfzdTZo.js} +1 -1
  52. package/dist-embed/chunks/{index-DY8mjz1l.js → index-DdBQBN76.js} +1 -1
  53. package/dist-embed/chunks/{index-DEjLPUAD.js → index-Di3aBGLV.js} +1 -1
  54. package/dist-embed/chunks/{index-Cu0bp_EI.js → index-Gngo0bXi.js} +1 -1
  55. package/dist-embed/chunks/{index-DyVR0igi.js → index-S4sn4R3i.js} +1 -1
  56. package/dist-embed/chunks/{index-noRoZrq5.js → index-Z2pxzg3H.js} +1 -1
  57. package/dist-embed/chunks/{index-PqsSImlj.js → index-_H5U6gal.js} +1 -1
  58. package/dist-embed/chunks/{index-x45cMPwN.js → index-_nsBY26B.js} +1 -1
  59. package/dist-embed/chunks/{index-CM7xo08K.js → index-b6e3y1R-.js} +1 -1
  60. package/dist-embed/chunks/{index-wk9vl2uW.js → index-szXn1pzS.js} +1 -1
  61. package/dist-embed/chunks/{index.esm-p0OnSU9h.js → index.esm-nZym6gpK.js} +1 -1
  62. package/dist-embed/chunks/isEqual-g-jK7vY0.js +1 -0
  63. package/dist-embed/chunks/{it-IT-JPQ66NNP-DuG05fUR.js → it-IT-JPQ66NNP-DEiaanA7.js} +1 -1
  64. package/dist-embed/chunks/{ja-JP-DBVTYXUO-DeDfL3Bk.js → ja-JP-DBVTYXUO-Bb0GBZrQ.js} +1 -1
  65. package/dist-embed/chunks/{kaa-6HZHGXH3-BRKFVG6s.js → kaa-6HZHGXH3-DxqTv9uN.js} +1 -1
  66. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-Uqakmhz5.js → kab-KAB-ZGHBKWFO-D0V0yQgV.js} +1 -1
  67. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-DWMXMIAK.js → kk-KZ-P5N5QNE5-CYyEyHXW.js} +1 -1
  68. package/dist-embed/chunks/{km-KH-HSX4SM5Z-BXNl9QnV.js → km-KH-HSX4SM5Z-CCTEGikY.js} +1 -1
  69. package/dist-embed/chunks/{ko-KR-MTYHY66A-BZgIqTuN.js → ko-KR-MTYHY66A-C-QDut19.js} +1 -1
  70. package/dist-embed/chunks/{ku-TR-6OUDTVRD-CQNa5i5U.js → ku-TR-6OUDTVRD-CIqn8p2Y.js} +1 -1
  71. package/dist-embed/chunks/{lt-LT-XHIRWOB4-BQW2k7iv.js → lt-LT-XHIRWOB4-BDLUWFPH.js} +1 -1
  72. package/dist-embed/chunks/{lv-LV-5QDEKY6T-B0HRRCC4.js → lv-LV-5QDEKY6T-BItabIJP.js} +1 -1
  73. package/dist-embed/chunks/{mr-IN-CRQNXWMA-DXR6sWSH.js → mr-IN-CRQNXWMA-DXXb8N2w.js} +1 -1
  74. package/dist-embed/chunks/{my-MM-5M5IBNSE-BZ5_9oCm.js → my-MM-5M5IBNSE-TidIfjqS.js} +1 -1
  75. package/dist-embed/chunks/{nb-NO-T6EIAALU-CBtv36wZ.js → nb-NO-T6EIAALU-DEINynK7.js} +1 -1
  76. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-CcqE3cY8.js → nl-NL-IS3SIHDZ-D04rJzNe.js} +1 -1
  77. package/dist-embed/chunks/{nn-NO-6E72VCQL-Cl9wPgpU.js → nn-NO-6E72VCQL-oWFzCtpf.js} +1 -1
  78. package/dist-embed/chunks/{oc-FR-POXYY2M6-CQEkV2p1.js → oc-FR-POXYY2M6-BmFfP6hk.js} +1 -1
  79. package/dist-embed/chunks/{pa-IN-N4M65BXN-CaE6yG0U.js → pa-IN-N4M65BXN-RkXrgKXw.js} +1 -1
  80. package/dist-embed/chunks/{percentages-BXMCSKIN-Bk5xifLL.js → percentages-BXMCSKIN-BL_DuU3S.js} +3 -3
  81. package/dist-embed/chunks/{pl-PL-T2D74RX3-M1pQcF2j.js → pl-PL-T2D74RX3-DqxkHzTj.js} +1 -1
  82. package/dist-embed/chunks/{pt-BR-5N22H2LF-BFDHu72z.js → pt-BR-5N22H2LF-DFA-wWC5.js} +1 -1
  83. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-DFcZY1Gz.js → pt-PT-UZXXM6DQ-Z5jw_7aw.js} +1 -1
  84. package/dist-embed/chunks/{renderer-Dy4lZ1KZ.js → renderer-DKKfWkWv.js} +1 -1
  85. package/dist-embed/chunks/{ro-RO-JPDTUUEW-BGm_Xwik.js → ro-RO-JPDTUUEW-DjC09bHq.js} +1 -1
  86. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-BsrZ_x8p.js → ru-RU-B4JR7IUQ-CqwD7Yik.js} +1 -1
  87. package/dist-embed/chunks/{si-LK-N5RQ5JYF-BfaYS44g.js → si-LK-N5RQ5JYF-OVf4k6G3.js} +1 -1
  88. package/dist-embed/chunks/{sk-SK-C5VTKIMK-D-K9yMTN.js → sk-SK-C5VTKIMK-BG__kjLT.js} +1 -1
  89. package/dist-embed/chunks/{sl-SI-NN7IZMDC-B48XvZUw.js → sl-SI-NN7IZMDC-CIgxidVH.js} +1 -1
  90. package/dist-embed/chunks/{subset-shared.chunk-DzA7mJjZ.js → subset-shared.chunk-BR0LJHtQ.js} +1 -1
  91. package/dist-embed/chunks/{subset-worker.chunk-CsTEdHAt.js → subset-worker.chunk-52aAcjvz.js} +1 -1
  92. package/dist-embed/chunks/{sv-SE-XGPEYMSR-DfhLO_Vt.js → sv-SE-XGPEYMSR-CYHz3xCa.js} +1 -1
  93. package/dist-embed/chunks/{ta-IN-2NMHFXQM-EZA_oxSt.js → ta-IN-2NMHFXQM-BphRr9QY.js} +1 -1
  94. package/dist-embed/chunks/{th-TH-HPSO5L25-G9vy_zQH.js → th-TH-HPSO5L25-Ba2-2Bo0.js} +1 -1
  95. package/dist-embed/chunks/{tr-TR-DEFEU3FU-DBj_G5CD.js → tr-TR-DEFEU3FU-CRKE7Roy.js} +1 -1
  96. package/dist-embed/chunks/{uk-UA-QMV73CPH-DN7lMu5H.js → uk-UA-QMV73CPH-DlNE5CAT.js} +1 -1
  97. package/dist-embed/chunks/{vi-VN-M7AON7JQ-LoT02qgd.js → vi-VN-M7AON7JQ-Cp44PRXY.js} +1 -1
  98. package/dist-embed/chunks/{zh-CN-LNUGB5OW-CjexwOqT.js → zh-CN-LNUGB5OW-JHqqwp0j.js} +1 -1
  99. package/dist-embed/chunks/{zh-HK-E62DVLB3-B0ys_HV6.js → zh-HK-E62DVLB3-YEs97mA8.js} +1 -1
  100. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-tQJWLJuU.js → zh-TW-RAJ6MFWO-CgmeTbuy.js} +1 -1
  101. package/dist-embed/datalayer-app-main.js +65 -65
  102. package/lib/apps/plugins/pap-sign-in/signIn.d.ts +3 -89
  103. package/lib/apps/plugins/pap-sign-in/signIn.js +5 -142
  104. package/lib/chat/messages/ChatMessageList.js +3 -1
  105. package/lib/chat/presence/Presence.d.ts +4 -4
  106. package/lib/chat/presence/Presence.js +3 -2
  107. package/lib/chat/presence/presenceStatus.d.ts +3 -34
  108. package/lib/chat/presence/presenceStatus.js +4 -46
  109. package/lib/portable/conversation.d.ts +3 -0
  110. package/lib/portable/conversation.js +15 -1
  111. package/lib/portable/direct.d.ts +100 -0
  112. package/lib/portable/direct.js +172 -0
  113. package/lib/portable/displays.d.ts +109 -0
  114. package/lib/portable/displays.js +261 -0
  115. package/lib/portable/fixtures.d.ts +11 -0
  116. package/lib/portable/fixtures.js +72 -0
  117. package/lib/portable/index.d.ts +6 -0
  118. package/lib/portable/index.js +10 -0
  119. package/lib/portable/presence.d.ts +47 -0
  120. package/lib/portable/presence.js +71 -0
  121. package/lib/portable/signIn.d.ts +96 -0
  122. package/lib/portable/signIn.js +148 -0
  123. package/lib/portable/views.d.ts +147 -0
  124. package/lib/portable/views.js +52 -0
  125. package/lib/runtimes/__tests__/fixtures/accounting-agent-card.json +1 -1
  126. package/package.json +1 -1
  127. package/dist-embed/chunks/isEqual-Cwjr2skl.js +0 -1
@@ -0,0 +1,47 @@
1
+ /**
2
+ * What an application is doing, in plain words (LOOP T-08): the one line of
3
+ * status beside its face — the same states and words in the web chat
4
+ * (`chat/presence`) and on Datalayer Mobile (MOBILE M-030).
5
+ *
6
+ * @module portable/presence
7
+ */
8
+ import type { ConversationState } from './conversation';
9
+ /**
10
+ * The states a person is told about. Paused is its deployment's: its owner
11
+ * paused it (LOOP R-17), and it answers nobody until it is resumed.
12
+ */
13
+ export type PresenceState = 'idle' | 'thinking' | 'working' | 'waiting' | 'paused';
14
+ /** The line each state is said by. */
15
+ export declare const PRESENCE_LINES: Record<PresenceState, string>;
16
+ /** The newest tool call of the conversation, as far as presence reads it. */
17
+ export interface PresenceTool {
18
+ /** It has not returned. */
19
+ open: boolean;
20
+ /** It waits on a person's approval. */
21
+ pendingApproval: boolean;
22
+ }
23
+ /**
24
+ * The state, from whether a turn is running, the newest tool call, and
25
+ * whether its deployment is paused.
26
+ *
27
+ * Paused wins: a paused application does nothing, whatever its last turn
28
+ * left behind.
29
+ * Waiting for an approval is said whether or not the turn is still
30
+ * streaming — the stream may end while the approval is asked. A tool that
31
+ * has not returned counts as work only during a turn: a stopped turn can
32
+ * leave one open, and the application is not working then.
33
+ */
34
+ export declare function presenceState(busy: boolean, tool?: PresenceTool, paused?: boolean): PresenceState;
35
+ /**
36
+ * The newest tool call of the conversation: whether it has not returned, and
37
+ * whether it waits on a person's approval. A tool call is an item with a
38
+ * tool name and a call id; it has returned once it is complete or failed.
39
+ */
40
+ export declare function presenceToolOf(items: readonly unknown[]): PresenceTool;
41
+ /**
42
+ * The state of a conversation a native client holds (`reduceConversation`):
43
+ * from whether its turn streams, its newest tool call, the question its
44
+ * application waits on, and whether its deployment is paused. A question
45
+ * asked and not answered is waiting for the person, as an approval is.
46
+ */
47
+ export declare function presenceOfConversation(state: Pick<ConversationState, 'items' | 'running' | 'asking'>, paused?: boolean): PresenceState;
@@ -0,0 +1,71 @@
1
+ /*
2
+ * Copyright (c) 2025-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /** The line each state is said by. */
6
+ export const PRESENCE_LINES = {
7
+ idle: 'Ready',
8
+ thinking: 'Thinking…',
9
+ working: 'Working…',
10
+ waiting: 'Waiting for you',
11
+ paused: 'Paused',
12
+ };
13
+ /**
14
+ * The state, from whether a turn is running, the newest tool call, and
15
+ * whether its deployment is paused.
16
+ *
17
+ * Paused wins: a paused application does nothing, whatever its last turn
18
+ * left behind.
19
+ * Waiting for an approval is said whether or not the turn is still
20
+ * streaming — the stream may end while the approval is asked. A tool that
21
+ * has not returned counts as work only during a turn: a stopped turn can
22
+ * leave one open, and the application is not working then.
23
+ */
24
+ export function presenceState(busy, tool, paused = false) {
25
+ if (paused) {
26
+ return 'paused';
27
+ }
28
+ if (tool?.open && tool.pendingApproval) {
29
+ return 'waiting';
30
+ }
31
+ if (!busy) {
32
+ return 'idle';
33
+ }
34
+ return tool?.open ? 'working' : 'thinking';
35
+ }
36
+ /**
37
+ * The newest tool call of the conversation: whether it has not returned, and
38
+ * whether it waits on a person's approval. A tool call is an item with a
39
+ * tool name and a call id; it has returned once it is complete or failed.
40
+ */
41
+ export function presenceToolOf(items) {
42
+ for (let index = items.length - 1; index >= 0; index -= 1) {
43
+ const item = items[index];
44
+ if (typeof item.toolName === 'string' && item.toolCallId) {
45
+ const open = item.status !== 'complete' && item.status !== 'error';
46
+ const pendingApproval = open &&
47
+ item.result
48
+ ?.pending_approval === true;
49
+ return { open, pendingApproval };
50
+ }
51
+ }
52
+ return { open: false, pendingApproval: false };
53
+ }
54
+ /**
55
+ * The state of a conversation a native client holds (`reduceConversation`):
56
+ * from whether its turn streams, its newest tool call, the question its
57
+ * application waits on, and whether its deployment is paused. A question
58
+ * asked and not answered is waiting for the person, as an approval is.
59
+ */
60
+ export function presenceOfConversation(state, paused = false) {
61
+ let tool;
62
+ for (let index = state.items.length - 1; index >= 0; index -= 1) {
63
+ const item = state.items[index];
64
+ if (item.kind === 'tool') {
65
+ tool = { open: item.status === 'running', pendingApproval: false };
66
+ break;
67
+ }
68
+ }
69
+ const said = presenceState(state.running, tool, paused);
70
+ return said === 'idle' && state.asking ? 'waiting' : said;
71
+ }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * What the gateway's `pap_sign_in` tool answers, read and checked
3
+ * (AGENT_PROTOCOLS PI-56, PAP_DATALAYER P-03): the person signs in at a
4
+ * company themselves — on the company's page (`direct`), by entering a
5
+ * code there (`device`), or by typing what the company asks on Datalayer's
6
+ * own page (`mediated`), never in the conversation. The chat shows the link,
7
+ * the code and until when; the agent never sees what the person types. A
8
+ * business over PACT answers its `pact_sign_in` the same way (a `device`
9
+ * sign-in at the business).
10
+ *
11
+ * Pure: no React. A test reaches it without a chat around it.
12
+ *
13
+ * Kept in `portable/` (MOBILE M-037): Datalayer Mobile reads the same
14
+ * sign-in with the same checks; the web plugin re-exports it.
15
+ *
16
+ * @module portable/signIn
17
+ */
18
+ /** A sign-in waiting for the person, as the card shows it. */
19
+ export type PapSignInWaiting = {
20
+ mode: 'direct' | 'device' | 'mediated';
21
+ /** The company's page — Datalayer's own, for `mediated` — `https` only. */
22
+ open: string;
23
+ /** The page's domain, read from its address: what the person can trust. */
24
+ host: string;
25
+ /**
26
+ * The company's domain, when the gateway names it: for a bound `direct`
27
+ * sign-in the page opened is Datalayer's start link (PAP_DATALAYER P-04),
28
+ * which sends the person on to the company and takes them back only from it.
29
+ */
30
+ company?: string;
31
+ /** The code to enter, for `device`. */
32
+ code?: string;
33
+ /** Where the company sent a code, for `mediated`, when it did. */
34
+ sentTo?: string;
35
+ /** Until when, ISO 8601. */
36
+ expiresAt?: string;
37
+ /**
38
+ * What the company said it needs (its `authorization` event's scope,
39
+ * PAP_DATALAYER P-02): what the person is asked to allow there.
40
+ */
41
+ needs?: string[];
42
+ };
43
+ /** What the card says. */
44
+ export declare const PAP_SIGN_IN_WORDS: {
45
+ readonly title: (host: string) => string;
46
+ readonly direct: "Open the company’s page through Datalayer, sign in there, and this conversation goes on once you are back.";
47
+ readonly device: "Open the company’s page and enter this code there.";
48
+ /** `mediated`: the page is Datalayer's, which names the company and asks what it asks. */
49
+ readonly mediatedTitle: (host: string) => string;
50
+ readonly mediated: "Open this page: it names the company and asks what the company needs. Type it there, never in this conversation.";
51
+ readonly sentTo: (to: string) => string;
52
+ readonly needs: (scopes: string[]) => string;
53
+ readonly open: (host: string) => string;
54
+ readonly code: "Your code";
55
+ readonly copy: "Copy the code";
56
+ readonly copied: "Copied";
57
+ readonly until: (at: string) => string;
58
+ readonly checkAgain: "I have signed in: check again";
59
+ readonly tellMe: "Tell me when you are done.";
60
+ readonly checkMessage: (host: string) => string;
61
+ readonly refused: "This sign-in link cannot be opened safely, so it is not shown.";
62
+ readonly qr: (host: string) => string;
63
+ /** Once the person's browser came back from the company (P-04), said under the card. */
64
+ readonly returned: {
65
+ readonly signed_in: (company: string) => string;
66
+ readonly denied: (company: string) => string;
67
+ readonly refused: (company: string) => string;
68
+ };
69
+ };
70
+ /**
71
+ * Where Datalayer's `/pap/signed-in` page says a Direct Sign-In came back
72
+ * (PAP_DATALAYER P-04): the card waiting for that company hears it in the
73
+ * person's tab, so the conversation goes on there.
74
+ */
75
+ export declare const PAP_SIGN_IN_CHANNEL = "datalayer-pap-sign-in";
76
+ /** How a Direct Sign-In came back. */
77
+ export type PapSignInReturn = keyof typeof PAP_SIGN_IN_WORDS.returned;
78
+ /** What a message on the channel says of this company's sign-in, or `null`: another company's, or not one. */
79
+ export declare function signInReturnOf(message: unknown, company: string): PapSignInReturn | null;
80
+ /**
81
+ * `pap_sign_in` — or a business's `pact_sign_in` (PI-56) — as the gateway
82
+ * names it with or without a prefix.
83
+ */
84
+ export declare const PAP_SIGN_IN_TOOL: RegExp;
85
+ /** Whether a tool is `pap_sign_in` or `pact_sign_in`, as the gateway names it with or without a prefix. */
86
+ export declare const isPapSignInTool: (name: string) => boolean;
87
+ /** The page's address, `https` only; `null` for anything else. */
88
+ export declare function safeSignInUrl(open: unknown): URL | null;
89
+ /**
90
+ * The sign-in waiting for the person, or why it is not shown: `null` for a
91
+ * result that is not one (another status: the chat's default row says it),
92
+ * `{ refused }` for a link that is not `https`.
93
+ */
94
+ export declare function readPapSignIn(result: unknown): PapSignInWaiting | {
95
+ refused: string;
96
+ } | null;
@@ -0,0 +1,148 @@
1
+ /*
2
+ * Copyright (c) 2025-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /** What the card says. */
6
+ export const PAP_SIGN_IN_WORDS = {
7
+ title: (host) => `Sign in at ${host}`,
8
+ direct: 'Open the company’s page through Datalayer, sign in there, and this conversation goes on once you are back.',
9
+ device: 'Open the company’s page and enter this code there.',
10
+ /** `mediated`: the page is Datalayer's, which names the company and asks what it asks. */
11
+ mediatedTitle: (host) => `Sign in through ${host}`,
12
+ mediated: 'Open this page: it names the company and asks what the company needs. Type it there, never in this conversation.',
13
+ sentTo: (to) => `The company sent a code to ${to}.`,
14
+ needs: (scopes) => `It needs: ${scopes.join(', ')}.`,
15
+ open: (host) => `Open ${host}`,
16
+ code: 'Your code',
17
+ copy: 'Copy the code',
18
+ copied: 'Copied',
19
+ until: (at) => `Until ${new Date(at).toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' })}.`,
20
+ checkAgain: 'I have signed in: check again',
21
+ tellMe: 'Tell me when you are done.',
22
+ checkMessage: (host) => `I have signed in at ${host}. Please check again.`,
23
+ refused: 'This sign-in link cannot be opened safely, so it is not shown.',
24
+ qr: (host) => `A code to scan to open ${host} on your phone`,
25
+ /** Once the person's browser came back from the company (P-04), said under the card. */
26
+ returned: {
27
+ signed_in: (company) => `Signed in at ${company}: checking again.`,
28
+ denied: (company) => `You did not sign in at ${company}: ask again when you want to.`,
29
+ refused: (company) => `That sign-in at ${company} was refused, and nothing was kept: start it again here.`,
30
+ },
31
+ };
32
+ /**
33
+ * Where Datalayer's `/pap/signed-in` page says a Direct Sign-In came back
34
+ * (PAP_DATALAYER P-04): the card waiting for that company hears it in the
35
+ * person's tab, so the conversation goes on there.
36
+ */
37
+ export const PAP_SIGN_IN_CHANNEL = 'datalayer-pap-sign-in';
38
+ /** One OAuth scope token (RFC 6749 §3.3). */
39
+ const SCOPE = /^[\x21\x23-\x5B\x5D-\x7E]{1,128}$/;
40
+ const DOMAIN = /^(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
41
+ /** What a message on the channel says of this company's sign-in, or `null`: another company's, or not one. */
42
+ export function signInReturnOf(message, company) {
43
+ if (!message || typeof message !== 'object' || Array.isArray(message)) {
44
+ return null;
45
+ }
46
+ const said = message;
47
+ const outcome = said.outcome;
48
+ return said.company === company &&
49
+ (outcome === 'signed_in' || outcome === 'denied' || outcome === 'refused')
50
+ ? outcome
51
+ : null;
52
+ }
53
+ /**
54
+ * `pap_sign_in` — or a business's `pact_sign_in` (PI-56) — as the gateway
55
+ * names it with or without a prefix.
56
+ */
57
+ export const PAP_SIGN_IN_TOOL = /(^|[_.:\-/])pa(?:p|ct)_sign_in$/;
58
+ /** Whether a tool is `pap_sign_in` or `pact_sign_in`, as the gateway names it with or without a prefix. */
59
+ export const isPapSignInTool = (name) => PAP_SIGN_IN_TOOL.test(name);
60
+ /** An MCP result's own object: its structured content, or the JSON of its text. */
61
+ function unwrapped(result) {
62
+ let value = result;
63
+ if (typeof value === 'string') {
64
+ try {
65
+ value = JSON.parse(value);
66
+ }
67
+ catch {
68
+ return null;
69
+ }
70
+ }
71
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
72
+ return null;
73
+ }
74
+ const data = value;
75
+ if (data.structuredContent && typeof data.structuredContent === 'object') {
76
+ return unwrapped(data.structuredContent);
77
+ }
78
+ if (Array.isArray(data.content)) {
79
+ const text = data.content.find(part => part?.type === 'text' && typeof part.text === 'string');
80
+ return text ? unwrapped(text.text) : null;
81
+ }
82
+ // FastMCP wraps a non-object answer as `{result: …}`.
83
+ if (data.result && typeof data.result === 'object' && !('status' in data)) {
84
+ return unwrapped(data.result);
85
+ }
86
+ return data;
87
+ }
88
+ /** The page's address, `https` only; `null` for anything else. */
89
+ export function safeSignInUrl(open) {
90
+ if (typeof open !== 'string') {
91
+ return null;
92
+ }
93
+ try {
94
+ const url = new URL(open);
95
+ return url.protocol === 'https:' && url.hostname ? url : null;
96
+ }
97
+ catch {
98
+ return null;
99
+ }
100
+ }
101
+ /**
102
+ * The sign-in waiting for the person, or why it is not shown: `null` for a
103
+ * result that is not one (another status: the chat's default row says it),
104
+ * `{ refused }` for a link that is not `https`.
105
+ */
106
+ export function readPapSignIn(result) {
107
+ const data = unwrapped(result);
108
+ if (!data || data.status !== 'waiting_for_the_person') {
109
+ return null;
110
+ }
111
+ if (data.mode !== 'direct' &&
112
+ data.mode !== 'device' &&
113
+ data.mode !== 'mediated') {
114
+ return null;
115
+ }
116
+ const url = safeSignInUrl(data.open);
117
+ if (!url) {
118
+ return { refused: PAP_SIGN_IN_WORDS.refused };
119
+ }
120
+ if (data.mode === 'device' && (typeof data.code !== 'string' || !data.code)) {
121
+ return null;
122
+ }
123
+ // A bound Direct Sign-In opens Datalayer's start link: the card names the company the gateway
124
+ // names (`PapSignIn.company`); without one, the page's own domain is the company's.
125
+ const company = typeof data.company === 'string' && DOMAIN.test(data.company)
126
+ ? data.company
127
+ : '';
128
+ // What the company said it needs: scope tokens only, anything else not shown.
129
+ const needs = Array.isArray(data.needs)
130
+ ? data.needs.filter((scope) => typeof scope === 'string' && SCOPE.test(scope))
131
+ : [];
132
+ return {
133
+ mode: data.mode,
134
+ open: url.toString(),
135
+ host: url.hostname,
136
+ ...(company ? { company } : {}),
137
+ ...(typeof data.code === 'string' && data.code ? { code: data.code } : {}),
138
+ ...(data.mode === 'mediated' &&
139
+ typeof data.sent_to === 'string' &&
140
+ data.sent_to
141
+ ? { sentTo: data.sent_to }
142
+ : {}),
143
+ ...(typeof data.expires_at === 'string' && data.expires_at
144
+ ? { expiresAt: data.expires_at }
145
+ : {}),
146
+ ...(needs.length > 0 ? { needs } : {}),
147
+ };
148
+ }
@@ -0,0 +1,147 @@
1
+ /**
2
+ * The conversation's components, as one contract for every renderer (MOBILE
3
+ * §4.1–4.2, M-032): the props each one takes, and what each says — to the
4
+ * eye and to a screen reader — computed here once, so that a native renderer
5
+ * (Datalayer Mobile's `.native` views) and the web's draw the same rows with
6
+ * the same words and states, over `reduceConversation`'s state.
7
+ *
8
+ * A renderer owns its markup and its look, never these words, these states or
9
+ * the rule of when a person may type.
10
+ *
11
+ * @module portable/views
12
+ */
13
+ import type { ConversationItem, ConversationQuestion, ConversationState } from './conversation';
14
+ import type { ProtocolDisplay } from './displays';
15
+ import { type PresenceState } from './presence';
16
+ export type MessageItem = Extract<ConversationItem, {
17
+ kind: 'message';
18
+ }>;
19
+ export type ToolItem = Extract<ConversationItem, {
20
+ kind: 'tool';
21
+ }>;
22
+ export type StepItem = Extract<ConversationItem, {
23
+ kind: 'step';
24
+ }>;
25
+ export type TurnEndItem = Extract<ConversationItem, {
26
+ kind: 'end';
27
+ }>;
28
+ export type ErrorItem = Extract<ConversationItem, {
29
+ kind: 'error';
30
+ }>;
31
+ /** A message: the person's words as they are, an answer through the safe Markdown subset. */
32
+ export type MessageRowProps = {
33
+ item: MessageItem;
34
+ };
35
+ /** A tool call, collapsed until the person opens it. */
36
+ export type ToolRowProps = {
37
+ item: ToolItem;
38
+ expanded: boolean;
39
+ onToggle: () => void;
40
+ };
41
+ /** A step of the application's code. */
42
+ export type StepRowProps = {
43
+ item: StepItem;
44
+ };
45
+ /** How a turn that said nothing ended. */
46
+ export type TurnEndRowProps = {
47
+ item: TurnEndItem;
48
+ };
49
+ /** A failure, announced. */
50
+ export type ErrorRowProps = {
51
+ item: ErrorItem;
52
+ };
53
+ /** What the application waits for the person to answer (`loop.ask`). */
54
+ export type QuestionCardProps = {
55
+ question: ConversationQuestion;
56
+ busy: boolean;
57
+ /** A choice, or words, answered by a message. */
58
+ onChoose: (option: string) => void;
59
+ /** A form, answered by a settings change. */
60
+ onForm: (values: Record<string, unknown>) => void;
61
+ };
62
+ /**
63
+ * A protocol display under its tool row (MOBILE M-037): what it shows is
64
+ * `displayLine`'s and the display's own; what the person does goes out
65
+ * through the host — a sign-in page opened outside the conversation, an
66
+ * operation answered where approvals are, *I have signed in* said as their
67
+ * next message. Nothing is answered from the card itself.
68
+ */
69
+ export type ProtocolDisplayProps = {
70
+ display: ProtocolDisplay;
71
+ /** Open a sign-in page, `https` only, outside the conversation. */
72
+ onOpenSignIn: (url: string) => void;
73
+ /** Open the approval an operation stands for. */
74
+ onOpenApproval: (approvalId: string) => void;
75
+ /** The person says they signed in (`PAP_SIGN_IN_WORDS.checkMessage`). */
76
+ onSignedIn: (words: string) => void;
77
+ /**
78
+ * Open a Direct Conversation under the conversation a company answered in
79
+ * (`portable/direct`, MOBILE M-038); absent where none can be opened.
80
+ */
81
+ onOpenDirect?: (company: string, conversationId: string) => void;
82
+ };
83
+ /** The line beside the application's face. */
84
+ export type PresenceLineProps = {
85
+ state: PresenceState;
86
+ };
87
+ /** The message box and its one button: Send, or Stop while a turn streams. */
88
+ export type ComposerProps = ComposerState & {
89
+ draft: string;
90
+ onDraft: (draft: string) => void;
91
+ onSend: () => void;
92
+ onStop: () => void;
93
+ };
94
+ /** A whole conversation: its state and what the person can do to it. */
95
+ export type ConversationViewProps = {
96
+ state: ConversationState;
97
+ /** It is being read from the server. */
98
+ opening: boolean;
99
+ /** It was ended; its record stays. */
100
+ ended: boolean;
101
+ /** Why nothing can be sent, when nothing can (paused, closed). */
102
+ closed?: string;
103
+ placeholder: string;
104
+ onSend: (words: string) => void;
105
+ onStop: () => void;
106
+ onForm: (values: Record<string, unknown>) => void;
107
+ };
108
+ /** A tool call's state, in words. */
109
+ export declare const TOOL_STATUS_WORDS: Record<ToolItem['status'], string>;
110
+ /** Said while a conversation is read from the server. */
111
+ export declare const OPENING_WORDS = "Opening your conversation\u2026";
112
+ /** Said once an answer is complete — once, never token by token. */
113
+ export declare const ANSWER_COMPLETE = "The answer is complete.";
114
+ /** Said in place of the message box of an ended conversation. */
115
+ export declare const ENDED_WORDS = "This conversation has ended. Its record stays.";
116
+ /** Said under a question answered in the message box. */
117
+ export declare const ANSWER_BELOW = "Answer in the message box below.";
118
+ /** What a message says to a screen reader: whose, and its words. */
119
+ export declare const messageLabel: (item: MessageItem) => string;
120
+ /** A tool call's one line: its name and its state. */
121
+ export declare const toolLabel: (item: ToolItem) => string;
122
+ /** A step's one line: running or done, and its name. */
123
+ export declare const stepLine: (item: StepItem) => string;
124
+ /** Said of the oldest rows a device did not keep, or nothing. */
125
+ export declare const droppedWords: (dropped: number) => string;
126
+ /** The line of a presence state. */
127
+ export declare const presenceLine: ({ state }: PresenceLineProps) => string;
128
+ /** Whether the person may type, why not, and what the box says. */
129
+ export type ComposerState = {
130
+ /** Why nothing can be sent; `''` when something can. */
131
+ blocked: string;
132
+ canType: boolean;
133
+ /** A turn is streaming: the button is Stop. */
134
+ running: boolean;
135
+ placeholder: string;
136
+ };
137
+ /**
138
+ * The message box, from the conversation: closed or ended, nothing is sent;
139
+ * while it opens or a turn streams, nothing is typed; a form or a file
140
+ * question is answered elsewhere; a text question puts its prompt in the box.
141
+ */
142
+ export declare function composerOf({ state, opening, ended, closed, placeholder, running, }: Pick<ConversationViewProps, 'state' | 'opening' | 'ended' | 'closed' | 'placeholder'> & {
143
+ /** A turn is running, as its client knows it before its first event. */
144
+ running?: boolean;
145
+ }): ComposerState;
146
+ /** Whether the question card is shown: asked, and no turn streaming. */
147
+ export declare const showsQuestion: (state: ConversationState, running?: boolean) => boolean;
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Copyright (c) 2025-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ import { PRESENCE_LINES } from './presence';
6
+ /** A tool call's state, in words. */
7
+ export const TOOL_STATUS_WORDS = {
8
+ running: 'running',
9
+ complete: 'done',
10
+ error: 'failed',
11
+ };
12
+ /** Said while a conversation is read from the server. */
13
+ export const OPENING_WORDS = 'Opening your conversation…';
14
+ /** Said once an answer is complete — once, never token by token. */
15
+ export const ANSWER_COMPLETE = 'The answer is complete.';
16
+ /** Said in place of the message box of an ended conversation. */
17
+ export const ENDED_WORDS = 'This conversation has ended. Its record stays.';
18
+ /** Said under a question answered in the message box. */
19
+ export const ANSWER_BELOW = 'Answer in the message box below.';
20
+ /** What a message says to a screen reader: whose, and its words. */
21
+ export const messageLabel = (item) => `${item.role === 'user' ? 'You' : 'Answer'}: ${item.text}`;
22
+ /** A tool call's one line: its name and its state. */
23
+ export const toolLabel = (item) => `Tool ${item.name || 'call'}, ${TOOL_STATUS_WORDS[item.status]}`;
24
+ /** A step's one line: running or done, and its name. */
25
+ export const stepLine = (item) => `${item.status === 'running' ? '…' : '✓'} ${item.name}`;
26
+ /** Said of the oldest rows a device did not keep, or nothing. */
27
+ export const droppedWords = (dropped) => dropped > 0
28
+ ? `${dropped} earlier ${dropped === 1 ? 'row is' : 'rows are'} not kept on this device.`
29
+ : '';
30
+ /** The line of a presence state. */
31
+ export const presenceLine = ({ state }) => PRESENCE_LINES[state];
32
+ /**
33
+ * The message box, from the conversation: closed or ended, nothing is sent;
34
+ * while it opens or a turn streams, nothing is typed; a form or a file
35
+ * question is answered elsewhere; a text question puts its prompt in the box.
36
+ */
37
+ export function composerOf({ state, opening, ended, closed, placeholder, running = state.running, }) {
38
+ const blocked = closed || (ended ? ENDED_WORDS : '');
39
+ const asking = state.asking;
40
+ return {
41
+ blocked,
42
+ running,
43
+ canType: !blocked &&
44
+ !opening &&
45
+ !running &&
46
+ asking?.kind !== 'form' &&
47
+ asking?.kind !== 'file',
48
+ placeholder: asking?.kind === 'text' ? asking.prompt : placeholder,
49
+ };
50
+ }
51
+ /** Whether the question card is shown: asked, and no turn streaming. */
52
+ export const showsQuestion = (state, running = state.running) => Boolean(state.asking) && !running;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "Accounting",
3
3
  "description": "Answers requests for financial reports, such as open invoices, aged balances, a trial balance or a customer's ledger, from the Odoo books, which it only reads.",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "supportedInterfaces": [
6
6
  {
7
7
  "protocolBinding": "JSONRPC",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.5.23",
3
+ "version": "1.5.25",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -1 +0,0 @@
1
- import{ge as se,gf as fe,gg as te,gh as _e,gi as le,gj as ge,gk as ve,gl as qe,gm as de,gn as Ae,go as ye}from"../datalayer-app-main.js";var D,X;function ce(){if(X)return D;X=1;var u="__lodash_hash_undefined__";function e(_){return this.__data__.set(_,u),this}return D=e,D}var H,Y;function pe(){if(Y)return H;Y=1;function u(e){return this.__data__.has(e)}return H=u,H}var B,Z;function Te(){if(Z)return B;Z=1;var u=se(),e=ce(),_=pe();function a(f){var t=-1,r=f==null?0:f.length;for(this.__data__=new u;++t<r;)this.add(f[t])}return a.prototype.add=a.prototype.push=e,a.prototype.has=_,B=a,B}var M,$;function Ee(){if($)return M;$=1;function u(e,_){for(var a=-1,f=e==null?0:e.length;++a<f;)if(_(e[a],a,e))return!0;return!1}return M=u,M}var x,W;function Oe(){if(W)return x;W=1;function u(e,_){return e.has(_)}return x=u,x}var G,j;function ue(){if(j)return G;j=1;var u=Te(),e=Ee(),_=Oe(),a=1,f=2;function t(r,v,T,O,d,l){var S=T&a,R=r.length,I=v.length;if(R!=I&&!(S&&I>R))return!1;var A=l.get(r),q=l.get(v);if(A&&q)return A==v&&q==r;var g=-1,y=!0,c=T&f?new u:void 0;for(l.set(r,v),l.set(v,r);++g<R;){var i=r[g],p=v[g];if(O)var s=S?O(p,i,g,v,r,l):O(i,p,g,r,v,l);if(s!==void 0){if(s)continue;y=!1;break}if(c){if(!e(v,function(n,E){if(!_(c,E)&&(i===n||d(i,n,T,O,l)))return c.push(E)})){y=!1;break}}else if(!(i===p||d(i,p,T,O,l))){y=!1;break}}return l.delete(r),l.delete(v),y}return G=t,G}var m,z;function Re(){if(z)return m;z=1;function u(e){var _=-1,a=Array(e.size);return e.forEach(function(f,t){a[++_]=[t,f]}),a}return m=u,m}var N,V;function he(){if(V)return N;V=1;function u(e){var _=-1,a=Array(e.size);return e.forEach(function(f){a[++_]=f}),a}return N=u,N}var U,k;function Se(){if(k)return U;k=1;var u=fe(),e=te(),_=_e(),a=ue(),f=Re(),t=he(),r=1,v=2,T="[object Boolean]",O="[object Date]",d="[object Error]",l="[object Map]",S="[object Number]",R="[object RegExp]",I="[object Set]",A="[object String]",q="[object Symbol]",g="[object ArrayBuffer]",y="[object DataView]",c=u?u.prototype:void 0,i=c?c.valueOf:void 0;function p(s,n,E,h,w,C,P){switch(E){case y:if(s.byteLength!=n.byteLength||s.byteOffset!=n.byteOffset)return!1;s=s.buffer,n=n.buffer;case g:return!(s.byteLength!=n.byteLength||!C(new e(s),new e(n)));case T:case O:case S:return _(+s,+n);case d:return s.name==n.name&&s.message==n.message;case R:case A:return s==n+"";case l:var L=f;case I:var o=h&r;if(L||(L=t),s.size!=n.size&&!o)return!1;var b=P.get(s);if(b)return b==n;h|=v,P.set(s,n);var ie=a(L(s),L(n),h,w,C,P);return P.delete(s),ie;case q:if(i)return i.call(s)==i.call(n)}return!1}return U=p,U}var F,ee;function Ie(){if(ee)return F;ee=1;var u=le(),e=1,_=Object.prototype,a=_.hasOwnProperty;function f(t,r,v,T,O,d){var l=v&e,S=u(t),R=S.length,I=u(r),A=I.length;if(R!=A&&!l)return!1;for(var q=R;q--;){var g=S[q];if(!(l?g in r:a.call(r,g)))return!1}var y=d.get(t),c=d.get(r);if(y&&c)return y==r&&c==t;var i=!0;d.set(t,r),d.set(r,t);for(var p=l;++q<R;){g=S[q];var s=t[g],n=r[g];if(T)var E=l?T(n,s,g,r,t,d):T(s,n,g,t,r,d);if(!(E===void 0?s===n||O(s,n,v,T,d):E)){i=!1;break}p||(p=g=="constructor")}if(i&&!p){var h=t.constructor,w=r.constructor;h!=w&&"constructor"in t&&"constructor"in r&&!(typeof h=="function"&&h instanceof h&&typeof w=="function"&&w instanceof w)&&(i=!1)}return d.delete(t),d.delete(r),i}return F=f,F}var K,re;function we(){if(re)return K;re=1;var u=ge(),e=ue(),_=Se(),a=Ie(),f=ve(),t=qe(),r=de(),v=Ae(),T=1,O="[object Arguments]",d="[object Array]",l="[object Object]",S=Object.prototype,R=S.hasOwnProperty;function I(A,q,g,y,c,i){var p=t(A),s=t(q),n=p?d:f(A),E=s?d:f(q);n=n==O?l:n,E=E==O?l:E;var h=n==l,w=E==l,C=n==E;if(C&&r(A)){if(!r(q))return!1;p=!0,h=!1}if(C&&!h)return i||(i=new u),p||v(A)?e(A,q,g,y,c,i):_(A,q,n,g,y,c,i);if(!(g&T)){var P=h&&R.call(A,"__wrapped__"),L=w&&R.call(q,"__wrapped__");if(P||L){var o=P?A.value():A,b=L?q.value():q;return i||(i=new u),c(o,b,g,y,i)}}return C?(i||(i=new u),a(A,q,g,y,c,i)):!1}return K=I,K}var J,ae;function Pe(){if(ae)return J;ae=1;var u=we(),e=ye();function _(a,f,t,r,v){return a===f?!0:a==null||f==null||!e(a)&&!e(f)?a!==a&&f!==f:u(a,f,t,r,_,v)}return J=_,J}var Q,ne;function Ce(){if(ne)return Q;ne=1;var u=Pe();function e(_,a){return u(_,a)}return Q=e,Q}export{Pe as a,he as b,Te as c,Oe as d,Ce as r};