@wireai/activation 0.13.5 → 0.13.6-next.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/README.md +131 -0
- package/dist/analytics/index.d.mts +2 -2
- package/dist/analytics/index.d.ts +2 -2
- package/dist/{currentSession-DgJf0fRz.d.mts → currentSession-Cs3lweFZ.d.mts} +13 -0
- package/dist/{currentSession-EOHU64QD.d.ts → currentSession-DD6dKB0i.d.ts} +13 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/OnboardingFlow.tsx +8 -1
- package/src/types.ts +13 -0
- package/src/utils/readPlan.ts +74 -0
package/README.md
CHANGED
|
@@ -1363,6 +1363,137 @@ generation context). For the full
|
|
|
1363
1363
|
scaffold-the-screen integration job, the [`wire-rn-integration`](./INTEGRATION_PROMPT.md)
|
|
1364
1364
|
skill drives it end to end.
|
|
1365
1365
|
|
|
1366
|
+
## EU AI Act: acceptable use and our position
|
|
1367
|
+
|
|
1368
|
+
**Position as of 2026-08-06, against Regulation (EU) 2024/1689 as amended by Regulation (EU) 2026/1744.**
|
|
1369
|
+
|
|
1370
|
+
This is our own reading of where this kit sits inside the regulation, written down so an integrator
|
|
1371
|
+
can see the reasoning and disagree with it. It is not legal advice. Nobody has audited this kit
|
|
1372
|
+
against the regulation, and a review by a qualified lawyer is pending. Where that review says we
|
|
1373
|
+
read something wrong, this section gets corrected and re-dated.
|
|
1374
|
+
|
|
1375
|
+
### Who is who
|
|
1376
|
+
|
|
1377
|
+
The app that ships a Wire-powered surface is the **deployer** of that surface. You choose the flow,
|
|
1378
|
+
the audience, the questions, and what the answers are used for.
|
|
1379
|
+
|
|
1380
|
+
Wire is the provider of a limited-risk component inside that: a card renderer, plus a backend that
|
|
1381
|
+
selects and fills cards from a fixed vocabulary you configure.
|
|
1382
|
+
|
|
1383
|
+
### Not for high-risk use
|
|
1384
|
+
|
|
1385
|
+
**This system is not intended to be put into service as, or changed into, a high-risk AI system.**
|
|
1386
|
+
|
|
1387
|
+
Do not deploy Wire-powered surfaces in an Annex III high-risk area:
|
|
1388
|
+
|
|
1389
|
+
1. Biometrics
|
|
1390
|
+
2. Critical infrastructure
|
|
1391
|
+
3. Education and vocational training
|
|
1392
|
+
4. Employment, workers management and access to self-employment
|
|
1393
|
+
5. Access to essential private and public services and benefits
|
|
1394
|
+
6. Law enforcement
|
|
1395
|
+
7. Migration, asylum and border control
|
|
1396
|
+
8. Administration of justice and democratic processes
|
|
1397
|
+
|
|
1398
|
+
Obligations for Annex III systems apply from 2 December 2027, which is not a countdown to when this
|
|
1399
|
+
becomes usable there. It is not what this kit is built for, at any date.
|
|
1400
|
+
|
|
1401
|
+
Two prohibitions in Article 5(1) have been live since 2 February 2025 and were left untouched by the
|
|
1402
|
+
Omnibus. Do not use these surfaces for subliminal, manipulative or deceptive techniques that
|
|
1403
|
+
materially distort behaviour, and do not use them to exploit vulnerabilities due to age, disability,
|
|
1404
|
+
or a specific social or economic situation.
|
|
1405
|
+
|
|
1406
|
+
That second one deserves saying out loud, because an onboarding flow that adapts per user is an easy
|
|
1407
|
+
place to cross it without meaning to. A flow that adapts because it learned what a user responds to
|
|
1408
|
+
is one short step from a flow that adapts because it learned what a user cannot resist. Optimise for
|
|
1409
|
+
the user finishing something they came to do.
|
|
1410
|
+
|
|
1411
|
+
### Article 50(1): telling people they are talking to an AI
|
|
1412
|
+
|
|
1413
|
+
Article 50(1) applies since 2 August 2026. There is no legacy grace period for it.
|
|
1414
|
+
|
|
1415
|
+
It requires that AI systems intended to interact directly with natural persons are designed so those
|
|
1416
|
+
persons are informed they are interacting with an AI system, unless that is obvious from the point of
|
|
1417
|
+
view of a reasonably well-informed, observant and circumspect natural person.
|
|
1418
|
+
|
|
1419
|
+
Our reading of the generated-UI case: generated onboarding UI is not a conversational agent. Cards,
|
|
1420
|
+
buttons, pickers and form fields do not present themselves as a person, and someone tapping through a
|
|
1421
|
+
signup flow is not being led to believe there is a human on the other end. A form is obvious.
|
|
1422
|
+
|
|
1423
|
+
Where that reading stops: if you build a chat-like or free-text-responding surface, one that answers
|
|
1424
|
+
a user in free prose the way a person would, that is the case Article 50(1) was written for. If you
|
|
1425
|
+
build that, **your app owns the disclosure**, not the kit.
|
|
1426
|
+
|
|
1427
|
+
We cannot place it for you. We do not control your screen, your copy, or your first-run experience.
|
|
1428
|
+
Put it where the user meets the surface, not buried in a settings page nobody opens.
|
|
1429
|
+
|
|
1430
|
+
The honest edge in between: `TextInputCard` takes free text, and the copy on the next card is
|
|
1431
|
+
generated from what the user typed. We read that as a form that adapts rather than a conversation,
|
|
1432
|
+
because the system does not answer as an interlocutor and the interaction stays inside the card
|
|
1433
|
+
vocabulary you configured. If that reading does not hold for the flow you built, disclose. Nothing in
|
|
1434
|
+
the kit stops you.
|
|
1435
|
+
|
|
1436
|
+
### Article 50(2): marking generated content
|
|
1437
|
+
|
|
1438
|
+
Article 50(2) covers providers of AI systems that generate synthetic audio, image, video or text, and
|
|
1439
|
+
requires the outputs to be marked in a machine-readable format as artificially generated or
|
|
1440
|
+
manipulated. Its legacy grace period runs to 2 December 2026, and only for providers of those
|
|
1441
|
+
generators.
|
|
1442
|
+
|
|
1443
|
+
Our reading has two parts.
|
|
1444
|
+
|
|
1445
|
+
The first is that Wire does not provide the generative model. The card copy a user reads was produced
|
|
1446
|
+
by a third-party model. Provider-level marking of a model's output sits upstream, with the provider
|
|
1447
|
+
of that model.
|
|
1448
|
+
|
|
1449
|
+
The second is that for the layer we do provide, the carve-out written into the article is the one we
|
|
1450
|
+
rely on. It "shall not apply to the extent the AI systems perform an assistive function for standard
|
|
1451
|
+
editing or do not substantially alter the input data provided by the deployer or the semantics
|
|
1452
|
+
thereof." You supply the app description, the first question, the allowed components and the copy
|
|
1453
|
+
constraints. The system selects and fills cards inside that. We read it as assistive rather than as
|
|
1454
|
+
generating a work of synthetic content.
|
|
1455
|
+
|
|
1456
|
+
Where that reading stops: if you use this kit as the delivery surface for a general content
|
|
1457
|
+
generator, handing a model's free-form output to a user as content, our reading does not carry over
|
|
1458
|
+
to your app. Look at Article 50(2) for yourself in that case.
|
|
1459
|
+
|
|
1460
|
+
### Article 50(3): emotion recognition
|
|
1461
|
+
|
|
1462
|
+
We do not read Article 50(3) as engaged by anything this kit does today.
|
|
1463
|
+
|
|
1464
|
+
Article 3(39) defines an emotion recognition system as one inferring emotions or intentions **on the
|
|
1465
|
+
basis of biometric data**, and recital 18 confines that to biometric signals like face, gesture and
|
|
1466
|
+
voice. This kit reads typed and tapped answers, and text is not biometric data. No camera, no
|
|
1467
|
+
microphone, no biometric processing anywhere in the flow.
|
|
1468
|
+
|
|
1469
|
+
### Article 25: the specification, and why we are not standing behind a licence
|
|
1470
|
+
|
|
1471
|
+
Article 25(2) closes with an express carve-out. The provider flip does not apply "in cases where the
|
|
1472
|
+
initial provider has clearly specified that its AI system is not to be changed into a high-risk AI
|
|
1473
|
+
system."
|
|
1474
|
+
|
|
1475
|
+
The sentence in bold under **Not for high-risk use** is that specification. It is written
|
|
1476
|
+
deliberately, and it is why this section exists in the README rather than in a lawyer's drawer.
|
|
1477
|
+
|
|
1478
|
+
Article 25(4) ends by exempting third parties who make tools, services, processes or components
|
|
1479
|
+
(other than general-purpose AI models) publicly available "under a free and open-source licence" from
|
|
1480
|
+
the written-agreement duty. `@wireai/activation` is published on npm under the MIT licence, so on the
|
|
1481
|
+
face of it that sentence reaches it, though the source repository is private and that is a difference
|
|
1482
|
+
worth stating rather than glossing over.
|
|
1483
|
+
|
|
1484
|
+
We would rather not stand on that carve-out. Unlike the open-source SDK underneath this kit, we
|
|
1485
|
+
usually know who integrates this one and we have a direct channel to them. So if you integrate the
|
|
1486
|
+
kit and need information about it to meet your own obligations as a deployer, ask, and you get it in
|
|
1487
|
+
writing. That is a commitment about how we behave, not a claim about our legal position.
|
|
1488
|
+
|
|
1489
|
+
### What this section is not
|
|
1490
|
+
|
|
1491
|
+
Nobody has reviewed or audited this kit against the regulation. This is not a statement that it meets
|
|
1492
|
+
a legal standard, and it is not a badge for a landing page.
|
|
1493
|
+
|
|
1494
|
+
It is what we think the regulation asks of a component like this one, what we did about it, and which
|
|
1495
|
+
parts sit on your side of the line rather than ours. Your app, your users, your assessment.
|
|
1496
|
+
|
|
1366
1497
|
## More from Code Meet AI
|
|
1367
1498
|
|
|
1368
1499
|
**Open source:** [wireai-rn](https://github.com/chohra-med/wireai-rn) · [expo_boilerplate](https://github.com/chohra-med/expo_boilerplate) · [colorway-c-brand](https://github.com/chohra-med/colorway-c-brand) · [claude_design_skill](https://github.com/chohra-med/claude_design_skill)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { R as ReportAppEventOptions, r as reportAppEvent } from '../transport-j5gFfJhK.mjs';
|
|
2
|
-
import { C as ClientEventTarget, W as WireUserContext, E as EventQueueOptions } from '../currentSession-
|
|
3
|
-
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, c as ClientEvent, d as ClientEventType, e as ContextEnvelope, f as ContextEnvelopeInput, D as DeviceKeyStorage, g as EnvelopeSource, h as EventQueue, R as ResolveAutoDeviceKeyOptions, i as WIRE_ONBOARDING_EVENTS, j as WireOnboardingEventName, k as analyticsUserIdStorageKey, l as buildContextEnvelope, m as clearPiiFromContext, n as clearUserContext, o as createEventQueue, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, s as looksLikeEmail, t as makeSessionId, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, B as resetEventQueueKeys, F as resolveAutoDeviceKey, G as setCurrentSessionId, H as toAnalyticsEvent } from '../currentSession-
|
|
2
|
+
import { C as ClientEventTarget, W as WireUserContext, E as EventQueueOptions } from '../currentSession-Cs3lweFZ.mjs';
|
|
3
|
+
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, c as ClientEvent, d as ClientEventType, e as ContextEnvelope, f as ContextEnvelopeInput, D as DeviceKeyStorage, g as EnvelopeSource, h as EventQueue, R as ResolveAutoDeviceKeyOptions, i as WIRE_ONBOARDING_EVENTS, j as WireOnboardingEventName, k as analyticsUserIdStorageKey, l as buildContextEnvelope, m as clearPiiFromContext, n as clearUserContext, o as createEventQueue, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, s as looksLikeEmail, t as makeSessionId, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, B as resetEventQueueKeys, F as resolveAutoDeviceKey, G as setCurrentSessionId, H as toAnalyticsEvent } from '../currentSession-Cs3lweFZ.mjs';
|
|
4
4
|
import { W as WireOnboardingStorage } from '../types-BpwiRpA8.mjs';
|
|
5
5
|
import '../types-Cju-1_jT.mjs';
|
|
6
6
|
import '../types-BKfpdZzX.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { R as ReportAppEventOptions, r as reportAppEvent } from '../transport-B_0SgCBe.js';
|
|
2
|
-
import { C as ClientEventTarget, W as WireUserContext, E as EventQueueOptions } from '../currentSession-
|
|
3
|
-
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, c as ClientEvent, d as ClientEventType, e as ContextEnvelope, f as ContextEnvelopeInput, D as DeviceKeyStorage, g as EnvelopeSource, h as EventQueue, R as ResolveAutoDeviceKeyOptions, i as WIRE_ONBOARDING_EVENTS, j as WireOnboardingEventName, k as analyticsUserIdStorageKey, l as buildContextEnvelope, m as clearPiiFromContext, n as clearUserContext, o as createEventQueue, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, s as looksLikeEmail, t as makeSessionId, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, B as resetEventQueueKeys, F as resolveAutoDeviceKey, G as setCurrentSessionId, H as toAnalyticsEvent } from '../currentSession-
|
|
2
|
+
import { C as ClientEventTarget, W as WireUserContext, E as EventQueueOptions } from '../currentSession-DD6dKB0i.js';
|
|
3
|
+
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, c as ClientEvent, d as ClientEventType, e as ContextEnvelope, f as ContextEnvelopeInput, D as DeviceKeyStorage, g as EnvelopeSource, h as EventQueue, R as ResolveAutoDeviceKeyOptions, i as WIRE_ONBOARDING_EVENTS, j as WireOnboardingEventName, k as analyticsUserIdStorageKey, l as buildContextEnvelope, m as clearPiiFromContext, n as clearUserContext, o as createEventQueue, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, s as looksLikeEmail, t as makeSessionId, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, B as resetEventQueueKeys, F as resolveAutoDeviceKey, G as setCurrentSessionId, H as toAnalyticsEvent } from '../currentSession-DD6dKB0i.js';
|
|
4
4
|
import { W as WireOnboardingStorage } from '../types-BpwiRpA8.js';
|
|
5
5
|
import '../types-h2BZvl1t.js';
|
|
6
6
|
import '../types-BKfpdZzX.js';
|
|
@@ -471,6 +471,19 @@ type OnboardingResult = {
|
|
|
471
471
|
answers: Record<string, unknown>;
|
|
472
472
|
/** The raw message thread, for custom downstream parsing. */
|
|
473
473
|
raw: Message[];
|
|
474
|
+
/**
|
|
475
|
+
* The backend's onboarding plan, when it sent one. Present ONLY on the AI path: a tenant running
|
|
476
|
+
* the static flow, or any run the server finished without a plan, leaves this `undefined` AND
|
|
477
|
+
* leaves the key off the result object entirely — so a host written before plans existed sees
|
|
478
|
+
* byte-identically what it always saw.
|
|
479
|
+
*
|
|
480
|
+
* ⚠️ The kit does NOT interpret this and does NOT validate it. It checks one structural fact (a
|
|
481
|
+
* plan is an object) and hands the payload straight through, unread, unlogged, and never attached
|
|
482
|
+
* to an analytics event. THE HOST MUST VALIDATE IT before applying it: the fields are
|
|
483
|
+
* backend-authored, they may gain new ones without a kit release, and what any of them mean is
|
|
484
|
+
* the host's decision, not the kit's.
|
|
485
|
+
*/
|
|
486
|
+
plan?: unknown;
|
|
474
487
|
};
|
|
475
488
|
/**
|
|
476
489
|
* Lifecycle events emitted as the flow runs, for host-side analytics. The kit owns
|
|
@@ -471,6 +471,19 @@ type OnboardingResult = {
|
|
|
471
471
|
answers: Record<string, unknown>;
|
|
472
472
|
/** The raw message thread, for custom downstream parsing. */
|
|
473
473
|
raw: Message[];
|
|
474
|
+
/**
|
|
475
|
+
* The backend's onboarding plan, when it sent one. Present ONLY on the AI path: a tenant running
|
|
476
|
+
* the static flow, or any run the server finished without a plan, leaves this `undefined` AND
|
|
477
|
+
* leaves the key off the result object entirely — so a host written before plans existed sees
|
|
478
|
+
* byte-identically what it always saw.
|
|
479
|
+
*
|
|
480
|
+
* ⚠️ The kit does NOT interpret this and does NOT validate it. It checks one structural fact (a
|
|
481
|
+
* plan is an object) and hands the payload straight through, unread, unlogged, and never attached
|
|
482
|
+
* to an analytics event. THE HOST MUST VALIDATE IT before applying it: the fields are
|
|
483
|
+
* backend-authored, they may gain new ones without a kit release, and what any of them mean is
|
|
484
|
+
* the host's decision, not the kit's.
|
|
485
|
+
*/
|
|
486
|
+
plan?: unknown;
|
|
474
487
|
};
|
|
475
488
|
/**
|
|
476
489
|
* Lifecycle events emitted as the flow runs, for host-side analytics. The kit owns
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { ReactNode } from 'react';
|
|
3
|
-
import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, U as PermissionPlacement, c as ClientEvent, g as EnvelopeSource } from './currentSession-
|
|
4
|
-
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-
|
|
3
|
+
import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, U as PermissionPlacement, c as ClientEvent, g as EnvelopeSource } from './currentSession-Cs3lweFZ.mjs';
|
|
4
|
+
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-Cs3lweFZ.mjs';
|
|
5
5
|
import { O as OnboardingTheme } from './types-BKfpdZzX.mjs';
|
|
6
6
|
export { a as OnboardingButtonStyle, b as OnboardingColors, c as OnboardingFonts, d as OnboardingRadius, e as OnboardingSpacing } from './types-BKfpdZzX.mjs';
|
|
7
7
|
export { C as CenteredModal, a as CenteredModalHandle, b as CenteredModalProps } from './CenteredModal-C3qQBHsA.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { ReactNode } from 'react';
|
|
3
|
-
import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, U as PermissionPlacement, c as ClientEvent, g as EnvelopeSource } from './currentSession-
|
|
4
|
-
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-
|
|
3
|
+
import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, U as PermissionPlacement, c as ClientEvent, g as EnvelopeSource } from './currentSession-DD6dKB0i.js';
|
|
4
|
+
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-DD6dKB0i.js';
|
|
5
5
|
import { O as OnboardingTheme } from './types-BKfpdZzX.js';
|
|
6
6
|
export { a as OnboardingButtonStyle, b as OnboardingColors, c as OnboardingFonts, d as OnboardingRadius, e as OnboardingSpacing } from './types-BKfpdZzX.js';
|
|
7
7
|
export { C as CenteredModal, a as CenteredModalHandle, b as CenteredModalProps } from './CenteredModal-Cdgns6--.js';
|
package/dist/index.js
CHANGED
|
@@ -1127,6 +1127,26 @@ var deriveAnswers = (messages) => {
|
|
|
1127
1127
|
return out;
|
|
1128
1128
|
};
|
|
1129
1129
|
|
|
1130
|
+
// src/utils/readPlan.ts
|
|
1131
|
+
var PLAN_PART_KIND = "onboarding_plan";
|
|
1132
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1133
|
+
var hasDataParts = (value) => isRecord(value) && Array.isArray(value.dataParts);
|
|
1134
|
+
var planFromPart = (part) => {
|
|
1135
|
+
if (!isRecord(part) || part.kind !== PLAN_PART_KIND) return void 0;
|
|
1136
|
+
return isRecord(part.plan) ? part.plan : void 0;
|
|
1137
|
+
};
|
|
1138
|
+
var readPlan = (messages) => {
|
|
1139
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
1140
|
+
const message = messages[i];
|
|
1141
|
+
if (!hasDataParts(message)) continue;
|
|
1142
|
+
for (const part of message.dataParts) {
|
|
1143
|
+
const plan = planFromPart(part);
|
|
1144
|
+
if (plan !== void 0) return plan;
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
return void 0;
|
|
1148
|
+
};
|
|
1149
|
+
|
|
1130
1150
|
// src/utils/readProgress.ts
|
|
1131
1151
|
var readProgress = (response) => {
|
|
1132
1152
|
var _a;
|
|
@@ -1797,7 +1817,10 @@ var OnboardingFlow = ({
|
|
|
1797
1817
|
const handleFinish = React19.useCallback(() => {
|
|
1798
1818
|
if (finished.current) return;
|
|
1799
1819
|
finished.current = true;
|
|
1800
|
-
|
|
1820
|
+
const result = { answers: deriveAnswers(messages), raw: messages };
|
|
1821
|
+
const plan = readPlan(messages);
|
|
1822
|
+
if (plan !== void 0) result.plan = plan;
|
|
1823
|
+
onCompleteRef.current(result);
|
|
1801
1824
|
}, [messages]);
|
|
1802
1825
|
const handleRetry = React19.useCallback(() => {
|
|
1803
1826
|
attempts.current = 0;
|