@fayz-ai/plugin-getting-started 0.0.0-stage → 0.2.0-canary.20261027164140

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 (71) hide show
  1. package/LICENSE +21 -0
  2. package/dist/chunk-QAYRR3A4.js +2964 -0
  3. package/dist/chunk-QAYRR3A4.js.map +1 -0
  4. package/dist/components/ProgressRing.d.ts +16 -0
  5. package/dist/components/ProgressRing.d.ts.map +1 -0
  6. package/dist/components/StartTrialAction.d.ts +70 -0
  7. package/dist/components/StartTrialAction.d.ts.map +1 -0
  8. package/dist/components/StartTrialCta.d.ts +12 -0
  9. package/dist/components/StartTrialCta.d.ts.map +1 -0
  10. package/dist/components/StoreLiveCard.d.ts +21 -0
  11. package/dist/components/StoreLiveCard.d.ts.map +1 -0
  12. package/dist/components/TrialEndBanner.d.ts +12 -0
  13. package/dist/components/TrialEndBanner.d.ts.map +1 -0
  14. package/dist/config.d.ts +82 -0
  15. package/dist/config.d.ts.map +1 -0
  16. package/dist/context.d.ts +33 -0
  17. package/dist/context.d.ts.map +1 -0
  18. package/dist/data/index.d.ts +5 -0
  19. package/dist/data/index.d.ts.map +1 -0
  20. package/dist/data/mock.d.ts +27 -0
  21. package/dist/data/mock.d.ts.map +1 -0
  22. package/dist/data/supabase.d.ts +10 -0
  23. package/dist/data/supabase.d.ts.map +1 -0
  24. package/dist/data/tables.d.ts +15 -0
  25. package/dist/data/tables.d.ts.map +1 -0
  26. package/dist/data/types.d.ts +24 -0
  27. package/dist/data/types.d.ts.map +1 -0
  28. package/dist/host.d.ts +93 -0
  29. package/dist/host.d.ts.map +1 -0
  30. package/dist/host.js +78 -0
  31. package/dist/host.js.map +1 -0
  32. package/dist/index.d.ts +26 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +138 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/lib/agent-tools.d.ts +143 -0
  37. package/dist/lib/agent-tools.d.ts.map +1 -0
  38. package/dist/lib/journey-steps.d.ts +152 -0
  39. package/dist/lib/journey-steps.d.ts.map +1 -0
  40. package/dist/lib/program.d.ts +37 -0
  41. package/dist/lib/program.d.ts.map +1 -0
  42. package/dist/lib/store-profile.d.ts +75 -0
  43. package/dist/lib/store-profile.d.ts.map +1 -0
  44. package/dist/lib/store-settings.d.ts +70 -0
  45. package/dist/lib/store-settings.d.ts.map +1 -0
  46. package/dist/lib/tour.d.ts +86 -0
  47. package/dist/lib/tour.d.ts.map +1 -0
  48. package/dist/lib/trial-clock.d.ts +14 -0
  49. package/dist/lib/trial-clock.d.ts.map +1 -0
  50. package/dist/lib/trial-source-bridge.d.ts +17 -0
  51. package/dist/lib/trial-source-bridge.d.ts.map +1 -0
  52. package/dist/locales/en.d.ts +2 -0
  53. package/dist/locales/en.d.ts.map +1 -0
  54. package/dist/locales/index.d.ts +2 -0
  55. package/dist/locales/index.d.ts.map +1 -0
  56. package/dist/locales/pt-BR.d.ts +2 -0
  57. package/dist/locales/pt-BR.d.ts.map +1 -0
  58. package/dist/migrations/index.d.ts +10 -0
  59. package/dist/migrations/index.d.ts.map +1 -0
  60. package/dist/migrations/main.browser.js +11 -0
  61. package/dist/migrations/main.browser.js.map +1 -0
  62. package/dist/migrations/main.js +992 -0
  63. package/dist/migrations/main.js.map +1 -0
  64. package/dist/settings/TrialSettingsTab.d.ts +23 -0
  65. package/dist/settings/TrialSettingsTab.d.ts.map +1 -0
  66. package/dist/store.d.ts +23 -0
  67. package/dist/store.d.ts.map +1 -0
  68. package/dist/types.d.ts +80 -0
  69. package/dist/types.d.ts.map +1 -0
  70. package/package.json +74 -3
  71. package/README.md +0 -3
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ export interface ProgressRingProps {
3
+ value: number;
4
+ max: number;
5
+ /** 40 on the card, 28 on the floating CTA, 20 on the phone chip (UX spec §2.1). */
6
+ size?: number;
7
+ label: string;
8
+ /** The whole ring turns success with a check in the middle. */
9
+ complete?: boolean;
10
+ /** Drawn over a primary background (the ready pill). */
11
+ onPrimary?: boolean;
12
+ className?: string;
13
+ }
14
+ /** UX spec §2.1 — the n/N ring. Real text in the middle, never only the stroke. */
15
+ export declare function ProgressRing({ value, max, size, label, complete, onPrimary, className }: ProgressRingProps): React.JSX.Element;
16
+ //# sourceMappingURL=ProgressRing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressRing.d.ts","sourceRoot":"","sources":["../../src/components/ProgressRing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,IAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,iBAAiB,qBA+B/G"}
@@ -0,0 +1,70 @@
1
+ import * as React from 'react';
2
+ import { type MinimumLine, type MinimumsCount } from '../lib/journey-steps';
3
+ import type { Journey, StartTrialResult } from '../types';
4
+ /** What is still missing, worded for a screen: "Falta o horário para iniciar o teste." + where to go. */
5
+ export interface StartTrialMissing {
6
+ key: string;
7
+ /** The step's own title when this app has the step; the slot's words otherwise. */
8
+ title: string;
9
+ text: string;
10
+ route?: string;
11
+ }
12
+ export interface StartTrialState {
13
+ /**
14
+ * The journey is in setup and the trial has not started: the action means
15
+ * something. False while the journey is unknown, after the trial started, or
16
+ * when the plugin is not on in this app (no programs declare a journey and
17
+ * the server never answered).
18
+ */
19
+ available: boolean;
20
+ ready: boolean;
21
+ starting: boolean;
22
+ trialDays: number;
23
+ /** "Iniciar teste · 14 dias" */
24
+ label: string;
25
+ /** The projected end, worded, for a confirmation line. */
26
+ projectedEnd: string;
27
+ journey: Journey | null;
28
+ minimums: MinimumsCount;
29
+ lines: MinimumLine[];
30
+ /** The first open minimum, or null when ready. */
31
+ missing: StartTrialMissing | null;
32
+ /** The last error or server disagreement, in the house's words. */
33
+ notice: string | null;
34
+ /** Runs the RPC through the plugin's store (event emitted there). Resolves null on error, with `notice` set. */
35
+ start: () => Promise<StartTrialResult | null>;
36
+ /** The host's permissions allow starting the trial / asking to contract (`SDK_PERMISSIONS.trialManage`). Always true without a host adapter. */
37
+ allowed: boolean;
38
+ /** The host's emulator attributes for the start/contract buttons. */
39
+ markProps: Record<string, string>;
40
+ }
41
+ /**
42
+ * "Iniciar teste" as a hook: the minimums still missing (declared by the
43
+ * programs, read from the rows and the server), the copy, the route to the
44
+ * first missing one, the RPC and the event (through the plugin's store) and the
45
+ * trial length. An app composes this where it celebrates — the test order's
46
+ * "Funcionou." pane — without knowing a key, an RPC or an event name.
47
+ */
48
+ export declare function useStartTrial(): StartTrialState;
49
+ export interface StartTrialActionProps {
50
+ /** After the trial started (not on "already started"). The app leaves its screen here. */
51
+ onStarted?: (result: Extract<StartTrialResult, {
52
+ ok: true;
53
+ }>) => void;
54
+ /** Before navigating to the first missing step. Return false to keep the screen. */
55
+ onNavigate?: (route: string) => boolean | void;
56
+ /**
57
+ * `inline` (default) asks once, in the same surface — this action is composed
58
+ * inside dialogs and a dialog must not stack on a dialog. `none` starts on
59
+ * the first click.
60
+ */
61
+ confirm?: 'inline' | 'none';
62
+ className?: string;
63
+ }
64
+ /**
65
+ * The "Iniciar teste · N dias" button an app composes into its own screen, with
66
+ * the "falta X" line and the way to X when the trial cannot start yet. Draws
67
+ * nothing while the journey is unknown or once the trial has started.
68
+ */
69
+ export declare function StartTrialAction({ onStarted, onNavigate, confirm, className }: StartTrialActionProps): React.JSX.Element | null;
70
+ //# sourceMappingURL=StartTrialAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StartTrialAction.d.ts","sourceRoot":"","sources":["../../src/components/StartTrialAction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,OAAO,EAC8D,KAAK,WAAW,EAAE,KAAK,aAAa,EACxG,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAIzD,yGAAyG;AACzG,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,aAAa,CAAA;IACvB,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,kDAAkD;IAClD,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAA;IACjC,mEAAmE;IACnE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,gHAAgH;IAChH,KAAK,EAAE,MAAM,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;IAC7C,gJAAgJ;IAChJ,OAAO,EAAE,OAAO,CAAA;IAChB,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC;AAiBD;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,eAAe,CAqF/C;AAED,MAAM,WAAW,qBAAqB;IACpC,0FAA0F;IAC1F,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,gBAAgB,EAAE;QAAE,EAAE,EAAE,IAAI,CAAA;KAAE,CAAC,KAAK,IAAI,CAAA;IACrE,oFAAoF;IACpF,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAA;IAC9C;;;;OAIG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,OAAkB,EAAE,SAAS,EAAE,EAAE,qBAAqB,4BA6D/G"}
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ export { countMinimums } from '../lib/journey-steps';
3
+ /**
4
+ * The floating "set up your operation" pill of the journey (UX spec §2.3, tech design §7).
5
+ *
6
+ * Registered in `shell.sidebar.footer` only to be mounted: it draws nothing in
7
+ * the rail (the shell's TrialWidget reads the source this widget publishes) and
8
+ * puts the pill on `document.body` through a portal, because the shell does not
9
+ * draw `shell.floating` yet (decision 11).
10
+ */
11
+ export declare function StartTrialCta(): React.ReactPortal | null;
12
+ //# sourceMappingURL=StartTrialCta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StartTrialCta.d.ts","sourceRoot":"","sources":["../../src/components/StartTrialCta.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAgB9B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAqDpD;;;;;;;GAOG;AACH,wBAAgB,aAAa,6BA8B5B"}
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * "Sua loja no ar" — the journey as a dashboard card (UX spec §2.1–2.2, moment 3).
4
+ *
5
+ * Nine steps and no more: the ones picked by key out of the shell's activation
6
+ * catalog, the ring counting what is really there, one "AGORA", the done ones
7
+ * struck through, "Quando quiser" below a separator, and the one call to
8
+ * action the phase allows. Reads the same rows the Tarefas tab and the
9
+ * assistant read, so the three never disagree about what is done.
10
+ */
11
+ export interface StoreLiveCardProps {
12
+ className?: string;
13
+ /**
14
+ * `rail` is the same card at the width of the assistant's Tarefas tab: tighter
15
+ * padding, no tour anchor (the dashboard card is the tour's stop), and rows
16
+ * that get out of the way of the screen they open on a phone.
17
+ */
18
+ variant?: 'card' | 'rail';
19
+ }
20
+ export declare function StoreLiveCard({ className, variant }: StoreLiveCardProps): React.JSX.Element | null;
21
+ //# sourceMappingURL=StoreLiveCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StoreLiveCard.d.ts","sourceRoot":"","sources":["../../src/components/StoreLiveCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAiD9B;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,OAAgB,EAAE,EAAE,kBAAkB,4BA8JhF"}
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * UX spec, moments 10 and 11. Two lines, never at the same time:
4
+ *
5
+ * - D0 (phase `trial`, under 24 h left): the last-day notice, small, dismissable
6
+ * for 8 h. The first and only banner before the end — the rail clock carries
7
+ * the days until then.
8
+ * - `expired`: the plan gates already deny on their own; this is the line that
9
+ * says why, and the one click to "Quero contratar", inline, never a modal.
10
+ */
11
+ export declare function TrialEndBanner(): React.JSX.Element | null;
12
+ //# sourceMappingURL=TrialEndBanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrialEndBanner.d.ts","sourceRoot":"","sources":["../../src/components/TrialEndBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B;;;;;;;;GAQG;AACH,wBAAgB,cAAc,6BA6G7B"}
@@ -0,0 +1,82 @@
1
+ import type { GettingStartedDataProvider } from './data/types';
2
+ /**
3
+ * What the app adds to the journey the programs already declared.
4
+ *
5
+ * The journey is tagged at the source (`OnboardingStepDef.journey`, by the
6
+ * plugin that owns each step); this is the app's composition on top of it,
7
+ * by catalog key: a base-list step it wants counted (`team`), a line it wants
8
+ * outside the total, a minimum the server requires that no program tags.
9
+ * Everything here is additive and ordered after the tagged steps.
10
+ */
11
+ export interface JourneyOverride {
12
+ launch?: string[];
13
+ later?: string[];
14
+ extra?: string[];
15
+ /** Catalog keys of the steps the trial cannot start without. */
16
+ minimums?: string[];
17
+ }
18
+ /**
19
+ * The screens the plugin's surfaces open. Every path the plugin navigates to
20
+ * comes from here; an app (or a host with its own router) overrides any of them.
21
+ */
22
+ export interface GettingStartedRoutes {
23
+ /** Where the store-live card lives — the tour's first stop. Default `/`. */
24
+ home?: string;
25
+ /** The trial settings (hours, payment methods, the clock): the hours/payments steps and the tour's last stop. Default `/settings/trial`. */
26
+ trial?: string;
27
+ /** Where "see the plans" / "subscribe" go (trial-end banner, trial settings). Default `/settings/subscription`. */
28
+ subscription?: string;
29
+ }
30
+ export interface GettingStartedPluginOptions {
31
+ /**
32
+ * Trial length shown in copy before the journey loads. One source in the app
33
+ * (`billing.trialDays`, the same number the sign-up promises); the pool config
34
+ * (`plg_getting_started_config.trial_days`) is the truth once it answers, and
35
+ * a disagreement between the two is reported once per session (see
36
+ * `noteTrialDaysDivergence`).
37
+ */
38
+ trialDays?: number;
39
+ /** Verticals the program is seeded for. Default: food. */
40
+ verticals?: string[];
41
+ /** The app's composition of the journey. See {@link JourneyOverride}. */
42
+ journey?: JourneyOverride;
43
+ /** Data provider override (tests, storybook). */
44
+ dataProvider?: GettingStartedDataProvider;
45
+ /** Overrides of the screens the surfaces open. See {@link GettingStartedRoutes}. */
46
+ routes?: GettingStartedRoutes;
47
+ }
48
+ export interface ResolvedGettingStartedConfig {
49
+ trialDays: number;
50
+ verticals: string[];
51
+ journey: Required<JourneyOverride>;
52
+ /** Every screen the surfaces open, defaults filled. */
53
+ routes: Required<GettingStartedRoutes>;
54
+ /** The plugin's own settings tab — where hours and payment methods are edited. Same as `routes.trial`. */
55
+ trialRoute: string;
56
+ /** Where "see the plans" goes. Same as `routes.subscription`. */
57
+ subscriptionRoute: string;
58
+ }
59
+ export declare const DEFAULT_TRIAL_DAYS = 14;
60
+ export declare const TRIAL_ROUTE = "/settings/trial";
61
+ export declare const SUBSCRIPTION_ROUTE = "/settings/subscription";
62
+ export declare const HOME_ROUTE = "/";
63
+ export declare const DEFAULT_ROUTES: Readonly<Required<GettingStartedRoutes>>;
64
+ export declare function resolveRoutes(routes?: GettingStartedRoutes): Required<GettingStartedRoutes>;
65
+ export declare function resolveJourneyOverride(journey?: JourneyOverride): Required<JourneyOverride>;
66
+ export declare function resolveConfig(options?: GettingStartedPluginOptions): ResolvedGettingStartedConfig;
67
+ /**
68
+ * The config of the manifest in force, for the surfaces an app composes
69
+ * outside the plugin's own context (`useStartTrial`, `<StartTrialAction/>`).
70
+ * Set by `createGettingStartedPlugin`; defaults when nothing built one yet.
71
+ */
72
+ export declare function setActiveConfig(config: ResolvedGettingStartedConfig): void;
73
+ export declare function getActiveConfig(): ResolvedGettingStartedConfig;
74
+ /**
75
+ * The app's `trialDays` and the pool's disagree: say so once, in the console,
76
+ * so the number in the copy and the number the clock runs on are reconciled by
77
+ * someone instead of silently differing. A manifest `diagnostics` entry can
78
+ * only check that something EXISTS (the table is checked there); comparing
79
+ * values needs the journey loaded, so it lives here.
80
+ */
81
+ export declare function noteTrialDaysDivergence(config: Pick<ResolvedGettingStartedConfig, 'trialDays'>, poolTrialDays: number | null | undefined): void;
82
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 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oB,CAAA;AAC5C,eAAO,MAAM,kBAAkB,2BAA2B,CAAA;AAC1D,eAAO,MAAM,UAAU,MAAM,CAAA;AAE7B,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAIlE,CAAA;AAKF,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAM3F;AAKD,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,CAO3F;AAED,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,2BAA2B,GAAG,4BAA4B,CAWjG;AAID;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,4BAA4B,GAAG,IAAI,CAE1E;AAED,wBAAgB,eAAe,IAAI,4BAA4B,CAE9D;AAID;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC,4BAA4B,EAAE,WAAW,CAAC,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAU/I"}
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ import type { ResolvedGettingStartedConfig } from './config';
3
+ import type { GettingStartedDataProvider } from './data/types';
4
+ import { type JourneyState } from './store';
5
+ export declare const GettingStartedContextProvider: React.FC<{
6
+ config: ResolvedGettingStartedConfig;
7
+ provider: GettingStartedDataProvider;
8
+ store: import("zustand").StoreApi<JourneyState>;
9
+ children?: React.ReactNode;
10
+ }>;
11
+ export declare const useGettingStartedConfig: () => ResolvedGettingStartedConfig;
12
+ export declare const useGettingStartedProvider: () => GettingStartedDataProvider;
13
+ export declare const useGettingStartedStore: <T>(selector: (state: JourneyState) => T) => T;
14
+ export interface GettingStartedScope {
15
+ config: ResolvedGettingStartedConfig;
16
+ provider: GettingStartedDataProvider;
17
+ }
18
+ /**
19
+ * The plugin has no page: its surfaces are mounted by the shell (widget zones,
20
+ * the settings area), so each one is wrapped in the context trio here instead
21
+ * of under a plugin route.
22
+ */
23
+ export declare function withGettingStartedContext<P extends object>(Component: React.ComponentType<P>, scope: GettingStartedScope): React.ComponentType<P>;
24
+ /** Loads the journey for the active tenant once; again when the tenant changes. */
25
+ export declare function useEnsureJourney(): void;
26
+ /**
27
+ * Every surface of the plugin reads the journey declaration (the tagged steps
28
+ * of the active programs + the app's override) and syncs it before rendering,
29
+ * so the selectors' default is current even in a surface that only hands them
30
+ * the catalog.
31
+ */
32
+ export declare function withJourneyDeclaration<P extends object>(Component: React.ComponentType<P>): React.ComponentType<P>;
33
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAC5D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAK5D,eAAO,MAAM,6BAA6B;;;;;EAAsB,CAAA;AAChE,eAAO,MAAM,uBAAuB,oCAAgB,CAAA;AACpD,eAAO,MAAM,yBAAyB,kCAAkB,CAAA;AACxD,eAAO,MAAM,sBAAsB,gDAAe,CAAA;AAElD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,4BAA4B,CAAA;IACpC,QAAQ,EAAE,0BAA0B,CAAA;CACrC;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EACxD,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACjC,KAAK,EAAE,mBAAmB,GACzB,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAQxB;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,IAAI,IAAI,CAavC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAOlH"}
@@ -0,0 +1,5 @@
1
+ export { T, RPC } from './tables';
2
+ export { GettingStartedError, isForbidden, isMissingClock, type GettingStartedDataProvider } from './types';
3
+ export { createSupabaseGettingStartedProvider, mapJourney, mapMinimums, mapStartTrial } from './supabase';
4
+ export { createMockGettingStartedProvider, derivePhase, type MockGettingStartedOptions, type MockGettingStartedProvider, } from './mock';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAC3G,OAAO,EAAE,oCAAoC,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACzG,OAAO,EACL,gCAAgC,EAAE,WAAW,EAC7C,KAAK,yBAAyB,EAAE,KAAK,0BAA0B,GAChE,MAAM,QAAQ,CAAA"}
@@ -0,0 +1,27 @@
1
+ import type { JourneyMinimums, JourneyPhase } from '../types';
2
+ import type { GettingStartedDataProvider } from './types';
3
+ export interface MockGettingStartedOptions {
4
+ tenantId?: string;
5
+ /** plg_getting_started_config.trial_days */
6
+ trialDays?: number;
7
+ /** The spine DEFAULT on tenants.trial_ends_at (db 044): the preparation window. */
8
+ setupWindowDays?: number;
9
+ minimums?: Partial<Omit<JourneyMinimums, 'ready'>>;
10
+ /** Injectable clock, so a test can walk through the phases without waiting. */
11
+ now?: () => Date;
12
+ }
13
+ export interface MockGettingStartedProvider extends GettingStartedDataProvider {
14
+ /** What the sensors would have found. */
15
+ setMinimums(patch: Partial<Omit<JourneyMinimums, 'ready'>>): void;
16
+ /** Marks the tenant as paying — the phase becomes `converted`. */
17
+ markConverted(): void;
18
+ }
19
+ /** The same rules as v_getting_started_journey, so the mock and the pool agree. */
20
+ export declare function derivePhase(input: {
21
+ now: Date;
22
+ trialEndsAt: string | null;
23
+ trialStartedAt: string | null;
24
+ convertedAt: string | null;
25
+ }): JourneyPhase;
26
+ export declare function createMockGettingStartedProvider(options?: MockGettingStartedOptions): MockGettingStartedProvider;
27
+ //# sourceMappingURL=mock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,eAAe,EAAE,YAAY,EAA2C,MAAM,UAAU,CAAA;AAC7H,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAEzD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAA;IAClD,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,IAAI,CAAA;CACjB;AAED,MAAM,WAAW,0BAA2B,SAAQ,0BAA0B;IAC5E,yCAAyC;IACzC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAA;IACjE,kEAAkE;IAClE,aAAa,IAAI,IAAI,CAAA;CACtB;AAKD,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,GAAG,EAAE,IAAI,CAAA;IACT,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B,GAAG,YAAY,CAKf;AAED,wBAAgB,gCAAgC,CAAC,OAAO,GAAE,yBAA8B,GAAG,0BAA0B,CAwFpH"}
@@ -0,0 +1,10 @@
1
+ import type { Journey, JourneyMinimums, StartTrialResult } from '../types';
2
+ import { type GettingStartedDataProvider } from './types';
3
+ type Row = Record<string, unknown>;
4
+ export declare function mapMinimums(raw: unknown): JourneyMinimums;
5
+ /** The jsonb `getting_started_journey()` answers, as the plugin reads it. */
6
+ export declare function mapJourney(raw: Row): Journey;
7
+ export declare function mapStartTrial(raw: Row): StartTrialResult;
8
+ export declare function createSupabaseGettingStartedProvider(): GettingStartedDataProvider;
9
+ export {};
10
+ //# sourceMappingURL=supabase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/data/supabase.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAgB,eAAe,EAA4C,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAClI,OAAO,EAAuB,KAAK,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAG9E,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAkBlC,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAMzD;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAgB5C;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,gBAAgB,CAWxD;AAoBD,wBAAgB,oCAAoC,IAAI,0BAA0B,CA+BjF"}
@@ -0,0 +1,15 @@
1
+ export declare const T: {
2
+ readonly config: "plg_getting_started_config";
3
+ readonly journeys: "plg_getting_started_journeys";
4
+ readonly events: "plg_getting_started_events";
5
+ readonly journeyView: "v_getting_started_journey";
6
+ };
7
+ export declare const RPC: {
8
+ readonly journey: "getting_started_journey";
9
+ readonly startTrial: "getting_started_start_trial";
10
+ readonly requestContract: "getting_started_request_contract";
11
+ readonly isPlatformOperator: "getting_started_is_platform_operator";
12
+ readonly platformJourneys: "getting_started_platform_journeys";
13
+ readonly trialSet: "getting_started_trial_set";
14
+ };
15
+ //# sourceMappingURL=tables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../src/data/tables.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,CAAC;;;;;CAKJ,CAAA;AAEV,eAAO,MAAM,GAAG;;;;;;;CAQN,CAAA"}
@@ -0,0 +1,24 @@
1
+ import type { Journey, JourneyEvent, RequestContractResult, StartTrialResult } from '../types';
2
+ export interface GettingStartedDataProvider {
3
+ /** Phase, dates and minimums for the active tenant. `null` when there is no tenant in scope. */
4
+ getJourney(): Promise<Journey | null>;
5
+ /** Idempotent: a trial already running answers `alreadyStarted` without touching the date. */
6
+ startTrial(): Promise<StartTrialResult>;
7
+ /** "Quero contratar". Once a day per tenant — the second call answers `alreadyRequestedToday`. */
8
+ requestContract(note?: string): Promise<RequestContractResult>;
9
+ /** The tenant's timeline, newest first. */
10
+ listEvents(limit?: number): Promise<JourneyEvent[]>;
11
+ }
12
+ /** Thrown by the Supabase provider; `code` is the SQLSTATE when the pool refused. */
13
+ export declare class GettingStartedError extends Error {
14
+ code?: string;
15
+ constructor(message: string, code?: string);
16
+ }
17
+ export declare function isForbidden(error: unknown): boolean;
18
+ /**
19
+ * The pool has no clock yet: `getting_started_journey` / `getting_started_start_trial`
20
+ * are not there (migration 000/001 not applied). PostgREST answers PGRST202,
21
+ * Postgres 42883; a mock or a proxy may only carry the sentence.
22
+ */
23
+ export declare function isMissingClock(error: unknown): boolean;
24
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE9F,MAAM,WAAW,0BAA0B;IACzC,gGAAgG;IAChG,UAAU,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IACrC,8FAA8F;IAC9F,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAA;IACvC,kGAAkG;IAClG,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAC9D,2CAA2C;IAC3C,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;CACpD;AAED,qFAAqF;AACrF,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAA;gBACD,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAK3C;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAItD"}
package/dist/host.d.ts ADDED
@@ -0,0 +1,93 @@
1
+ import * as React from 'react';
2
+ import { type OnboardingProgramDef, type OnboardingTourDef, type PluginAITool } from '@fayz-ai/core';
3
+ import { type ActivationBackend, type HostPermissionsAdapter } from '@fayz-ai/admin/host';
4
+ import { type GettingStartedPluginOptions, type ResolvedGettingStartedConfig } from './config';
5
+ import type { GettingStartedDataProvider } from './data/types';
6
+ import { type StoreSettingsProvider } from './lib/store-settings';
7
+ import { type StoreProfileProvider } from './lib/store-profile';
8
+ import { type JourneyTourMoment } from './lib/tour';
9
+ import { type StoreLiveCardProps } from './components/StoreLiveCard';
10
+ import { type StartTrialActionProps } from './components/StartTrialAction';
11
+ export interface GettingStartedHostOptions extends Omit<GettingStartedPluginOptions, 'dataProvider'> {
12
+ /** Journey, start trial, "quero contratar", timeline — the host's backend. Required: there is no platform default here. */
13
+ dataProvider: GettingStartedDataProvider;
14
+ /** Where the activation checklist rows live. Omitted: the platform `tasks` table (only right on the platform). */
15
+ activation?: ActivationBackend;
16
+ /** Where hours and payment methods live. Omitted: `tenants.settings.store` (only right on the platform). */
17
+ storeSettings?: StoreSettingsProvider;
18
+ /**
19
+ * Where the store profile ("how the house serves") lives. Omitted: the
20
+ * profile step is dropped from the programs and `saveStoreProfile` is not
21
+ * offered nor registered — a host never writes the platform's questionnaire.
22
+ */
23
+ storeProfile?: StoreProfileProvider;
24
+ /** The host's permission engine for the start-trial / contract / confirm / create-task buttons. Omitted: allow-all. */
25
+ permissions?: HostPermissionsAdapter;
26
+ /**
27
+ * The programs whose steps make the checklist. Default: the store-live
28
+ * program alone (`buildStoreLiveProgram`). Without `storeProfile`, the
29
+ * store-live program's profile step is removed from whatever is passed.
30
+ */
31
+ programs?: OnboardingProgramDef[];
32
+ /** The tour's opening stops, anchored on the host's DOM. Default: the plugin's own (`data-tour` anchors). */
33
+ tour?: OnboardingTourDef;
34
+ /** Routes the host can open; a step whose route is not here keeps its title and loses its link. Default: every route. */
35
+ hasRoute?: (route: string) => boolean;
36
+ /** Register the client handlers of `aiTools` (the assistant runs them in the browser). Default true. */
37
+ registerToolHandlers?: boolean;
38
+ }
39
+ export interface GettingStartedHost {
40
+ config: ResolvedGettingStartedConfig;
41
+ provider: GettingStartedDataProvider;
42
+ programs: OnboardingProgramDef[];
43
+ /**
44
+ * Mount once, high in the host's tree, where the org and the user are
45
+ * painted: runs the checklist (rows, sensors) and the tour spotlight. The
46
+ * surfaces below render without it, but nothing ticks.
47
+ */
48
+ Provider: React.ComponentType<{
49
+ children?: React.ReactNode;
50
+ }>;
51
+ /** The home card ("Sua loja no ar", n/9). */
52
+ StoreLiveCard: React.ComponentType<Omit<StoreLiveCardProps, 'variant'>>;
53
+ /** The same card for the top of the Tasks tab: pass as `<TasksPanel top={<RailTasksBlock/>}/>`. */
54
+ RailTasksBlock: React.ComponentType;
55
+ /** The floating "Iniciar teste · N dias" pill (portals itself). */
56
+ StartTrialCta: React.ComponentType;
57
+ /** The button an app composes into its own screen. */
58
+ StartTrialAction: React.ComponentType<StartTrialActionProps>;
59
+ /** The end-of-trial banner for the top bar. */
60
+ TrialEndBanner: React.ComponentType;
61
+ /** The trial settings (hours, payment methods, the journey). Optional surface. */
62
+ TrialSettingsTab: React.ComponentType;
63
+ tour: {
64
+ id: string;
65
+ /** Starts the journey tour now; without `force` only once per tenant. */
66
+ start: (opts?: {
67
+ force?: boolean;
68
+ moment?: JourneyTourMoment;
69
+ }) => boolean;
70
+ };
71
+ /** The assistant tools to hand to the host's agent transport. */
72
+ aiTools: PluginAITool[];
73
+ /** Restores every platform default this host installed (backends, permissions, programs). */
74
+ dispose: () => void;
75
+ }
76
+ /**
77
+ * The getting-started surfaces for a host that does not run AdminShell nor the
78
+ * plugin runtime (a legacy product mounting them slot by slot). Everything the
79
+ * plugin would read from the platform is injected here; nothing below assumes
80
+ * the platform's tables.
81
+ */
82
+ export declare function createGettingStartedHost(options: GettingStartedHostOptions): GettingStartedHost;
83
+ export { buildStoreLiveProgram, withoutStoreProfileStep, storeSetupRouting, hasOpeningHours, hasPaymentMethods, PROGRAM_ID as STORE_LIVE_PROGRAM_ID, type BuildStoreLiveProgramInput, } from './lib/program';
84
+ export { journeyTour, buildOwnJourneyTour, buildJourneyTour, buildJourneyClosingStop, JOURNEY_TOUR_ID, CARD_ANCHOR as STORE_LIVE_CARD_ANCHOR, TRIAL_TAB_ANCHOR, } from './lib/tour';
85
+ export { resolveConfig, resolveRoutes, DEFAULT_ROUTES, type GettingStartedRoutes, type ResolvedGettingStartedConfig } from './config';
86
+ export { STORE_PROFILE_STEP_KEY, SERVICE_MODES, OPERATIONS, DELIVERY_METHODS, TABLE_BANDS, PROFILE_KEYS, storeProfileFrom, storeProfileFromAnswers, storeProfileToAnswers, storeProfileAnswered, type StoreProfile, type StoreProfileProvider, type SaveStoreProfileWriteResult, type StoreOperation, type StoreServiceMode, type StoreDeliveryMethod, type StoreTableBand, } from './lib/store-profile';
87
+ export { SAVE_PROFILE_TOOL } from './lib/agent-tools';
88
+ export type { GettingStartedDataProvider } from './data/types';
89
+ export type { StoreSettingsProvider, StoreSettingKey, SaveStoreSettingResult } from './lib/store-settings';
90
+ export type { ActivationBackend, HostPermissionsAdapter } from '@fayz-ai/admin/host';
91
+ export type { Journey, JourneyPhase, JourneyMinimums, JourneyEvent, StartTrialResult, RequestContractResult, StoreHours, PaymentMethod } from './types';
92
+ export { GettingStartedError, isForbidden, isMissingClock, createMockGettingStartedProvider } from './data';
93
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAwB,KAAK,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAC1H,OAAO,EAEL,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EACpD,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAkC,KAAK,2BAA2B,EAAE,KAAK,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAE9H,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAG9D,OAAO,EAA0B,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACzF,OAAO,EAAyB,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AACtF,OAAO,EAA0D,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAI3G,OAAO,EAAsC,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAExG,OAAO,EAA4C,KAAK,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAIpH,MAAM,WAAW,yBAA0B,SAAQ,IAAI,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C9D,YAAY,EAAE,qBAAqB,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC1G,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACpF,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvJ,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,cAAc,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAA"}
package/dist/host.js ADDED
@@ -0,0 +1,78 @@
1
+ import { resolveConfig, setActiveConfig, setJourneyOverride, gettingStartedLocales, useJourneyStore, registerGettingStartedToolHandlers, configureStoreSettings, configureStoreProfile, buildStoreLiveProgram, withoutStoreProfileStep, setHostJourneyPrograms, useJourneyTourStore, JOURNEY_TOUR_ID, gettingStartedAiToolsFor, startJourneyTour, withGettingStartedContext, withJourneyDeclaration, TrialSettingsTab, TrialEndBanner, StartTrialAction, StartTrialCta, StoreLiveCard } from './chunk-QAYRR3A4.js';
2
+ export { DEFAULT_ROUTES, DELIVERY_METHODS, GettingStartedError, JOURNEY_TOUR_ID, OPERATIONS, PROFILE_KEYS, SAVE_PROFILE_TOOL, SERVICE_MODES, CARD_ANCHOR as STORE_LIVE_CARD_ANCHOR, PROGRAM_ID as STORE_LIVE_PROGRAM_ID, STORE_PROFILE_STEP_KEY, TABLE_BANDS, TRIAL_TAB_ANCHOR, buildJourneyClosingStop, buildJourneyTour, buildOwnJourneyTour, buildStoreLiveProgram, createMockGettingStartedProvider, hasOpeningHours, hasPaymentMethods, isForbidden, isMissingClock, journeyTour, resolveConfig, resolveRoutes, storeProfileAnswered, storeProfileFrom, storeProfileFromAnswers, storeProfileToAnswers, storeSetupRouting, withoutStoreProfileStep } from './chunk-QAYRR3A4.js';
3
+ import { registerTranslations } from '@fayz-ai/core';
4
+ import { configureActivationBackend, configurePermissions, HostActivationProvider } from '@fayz-ai/admin/host';
5
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
6
+
7
+ function createGettingStartedHost(options) {
8
+ const config = resolveConfig(options);
9
+ setActiveConfig(config);
10
+ setJourneyOverride(config.journey);
11
+ registerTranslations(gettingStartedLocales);
12
+ const provider = options.dataProvider;
13
+ const profile = !!options.storeProfile;
14
+ useJourneyStore.getState().bind(provider);
15
+ if (options.registerToolHandlers !== false) registerGettingStartedToolHandlers(useJourneyStore, { profile });
16
+ if (options.activation) configureActivationBackend(options.activation);
17
+ if (options.storeSettings) configureStoreSettings(options.storeSettings);
18
+ if (options.storeProfile) configureStoreProfile(options.storeProfile);
19
+ if (options.permissions) configurePermissions(options.permissions);
20
+ const given = options.programs ?? [buildStoreLiveProgram({ provider, config, profile })];
21
+ const programs = profile ? given : given.map(withoutStoreProfileStep);
22
+ setHostJourneyPrograms(programs);
23
+ if (options.tour) {
24
+ useJourneyTourStore.getState().rememberRuntime({
25
+ onboardingTours: [{
26
+ ...options.tour,
27
+ pluginId: "getting-started",
28
+ pluginName: "Getting started",
29
+ order: options.tour.order ?? 0,
30
+ when: options.tour.when ?? "trial_started"
31
+ }]
32
+ });
33
+ }
34
+ const scope = { config, provider };
35
+ const surface = (Component, name) => {
36
+ const Wrapped = withGettingStartedContext(withJourneyDeclaration(Component), scope);
37
+ Wrapped.displayName = `GettingStartedHost(${name})`;
38
+ return Wrapped;
39
+ };
40
+ const hasRoute = options.hasRoute;
41
+ function Provider({ children }) {
42
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
43
+ /* @__PURE__ */ jsx(HostActivationProvider, { programs, hasRoute }),
44
+ children
45
+ ] });
46
+ }
47
+ const RailBlock = () => /* @__PURE__ */ jsx(StoreLiveCard, { variant: "rail" });
48
+ return {
49
+ config,
50
+ provider,
51
+ programs,
52
+ Provider,
53
+ StoreLiveCard: surface(StoreLiveCard, "StoreLiveCard"),
54
+ RailTasksBlock: surface(RailBlock, "RailTasksBlock"),
55
+ StartTrialCta: surface(StartTrialCta, "StartTrialCta"),
56
+ StartTrialAction: surface(StartTrialAction, "StartTrialAction"),
57
+ TrialEndBanner: surface(TrialEndBanner, "TrialEndBanner"),
58
+ TrialSettingsTab: surface(TrialSettingsTab, "TrialSettingsTab"),
59
+ tour: {
60
+ id: JOURNEY_TOUR_ID,
61
+ start: (opts) => startJourneyTour({ force: opts?.force, moment: opts?.moment ?? "manual" })
62
+ },
63
+ aiTools: gettingStartedAiToolsFor({ profile }),
64
+ dispose: () => {
65
+ if (options.activation) configureActivationBackend(null);
66
+ if (options.storeSettings) configureStoreSettings(null);
67
+ if (options.storeProfile) configureStoreProfile(null);
68
+ if (options.permissions) configurePermissions(null);
69
+ setHostJourneyPrograms(void 0);
70
+ if (options.tour) useJourneyTourStore.getState().rememberRuntime(null);
71
+ useJourneyStore.getState().reset();
72
+ }
73
+ };
74
+ }
75
+
76
+ export { createGettingStartedHost };
77
+ //# sourceMappingURL=host.js.map
78
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/host.tsx"],"names":[],"mappings":";;;;;;AA2FO,SAAS,yBAAyB,OAAA,EAAwD;AAC/F,EAAA,MAAM,MAAA,GAAS,cAAc,OAAO,CAAA;AACpC,EAAA,eAAA,CAAgB,MAAM,CAAA;AACtB,EAAA,kBAAA,CAAmB,OAAO,OAAO,CAAA;AACjC,EAAA,oBAAA,CAAqB,qBAAqB,CAAA;AAE1C,EAAA,MAAM,WAAW,OAAA,CAAQ,YAAA;AACzB,EAAA,MAAM,OAAA,GAAU,CAAC,CAAC,OAAA,CAAQ,YAAA;AAC1B,EAAA,eAAA,CAAgB,QAAA,EAAS,CAAE,IAAA,CAAK,QAAQ,CAAA;AACxC,EAAA,IAAI,QAAQ,oBAAA,KAAyB,KAAA,qCAA0C,eAAA,EAAiB,EAAE,SAAS,CAAA;AAC3G,EAAA,IAAI,OAAA,CAAQ,UAAA,EAAY,0BAAA,CAA2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,CAAA;AACvD,MAAA,IAAI,OAAA,CAAQ,aAAA,EAAe,sBAAA,CAAuB,IAAI,CAAA;AACtD,MAAA,IAAI,OAAA,CAAQ,YAAA,EAAc,qBAAA,CAAsB,IAAI,CAAA;AACpD,MAAA,IAAI,OAAA,CAAQ,WAAA,EAAa,oBAAA,CAAqB,IAAI,CAAA;AAClD,MAAA,sBAAA,CAAuB,MAAS,CAAA;AAChC,MAAA,IAAI,QAAQ,IAAA,EAAM,mBAAA,CAAoB,QAAA,EAAS,CAAE,gBAAgB,IAAI,CAAA;AACrE,MAAA,eAAA,CAAgB,QAAA,GAAW,KAAA,EAAM;AAAA,IACnC;AAAA,GACF;AACF","file":"host.js","sourcesContent":["import * as React from 'react'\nimport { registerTranslations, type OnboardingProgramDef, type OnboardingTourDef, type PluginAITool } from '@fayz-ai/core'\nimport {\n HostActivationProvider, configureActivationBackend, configurePermissions,\n type ActivationBackend, type HostPermissionsAdapter,\n} from '@fayz-ai/admin/host'\nimport { resolveConfig, setActiveConfig, type GettingStartedPluginOptions, type ResolvedGettingStartedConfig } from './config'\nimport { withGettingStartedContext, withJourneyDeclaration } from './context'\nimport type { GettingStartedDataProvider } from './data/types'\nimport { setHostJourneyPrograms, setJourneyOverride } from './lib/journey-steps'\nimport { buildStoreLiveProgram, withoutStoreProfileStep } from './lib/program'\nimport { configureStoreSettings, type StoreSettingsProvider } from './lib/store-settings'\nimport { configureStoreProfile, type StoreProfileProvider } from './lib/store-profile'\nimport { JOURNEY_TOUR_ID, startJourneyTour, useJourneyTourStore, type JourneyTourMoment } from './lib/tour'\nimport { gettingStartedAiToolsFor, registerGettingStartedToolHandlers } from './lib/agent-tools'\nimport { useJourneyStore } from './store'\nimport { gettingStartedLocales } from './locales'\nimport { StoreLiveCard as StoreLiveCardView, type StoreLiveCardProps } from './components/StoreLiveCard'\nimport { StartTrialCta as StartTrialCtaView } from './components/StartTrialCta'\nimport { StartTrialAction as StartTrialActionView, type StartTrialActionProps } from './components/StartTrialAction'\nimport { TrialEndBanner as TrialEndBannerView } from './components/TrialEndBanner'\nimport { TrialSettingsTab as TrialSettingsTabView } from './settings/TrialSettingsTab'\n\nexport interface GettingStartedHostOptions extends Omit<GettingStartedPluginOptions, 'dataProvider'> {\n /** Journey, start trial, \"quero contratar\", timeline — the host's backend. Required: there is no platform default here. */\n dataProvider: GettingStartedDataProvider\n /** Where the activation checklist rows live. Omitted: the platform `tasks` table (only right on the platform). */\n activation?: ActivationBackend\n /** Where hours and payment methods live. Omitted: `tenants.settings.store` (only right on the platform). */\n storeSettings?: StoreSettingsProvider\n /**\n * Where the store profile (\"how the house serves\") lives. Omitted: the\n * profile step is dropped from the programs and `saveStoreProfile` is not\n * offered nor registered — a host never writes the platform's questionnaire.\n */\n storeProfile?: StoreProfileProvider\n /** The host's permission engine for the start-trial / contract / confirm / create-task buttons. Omitted: allow-all. */\n permissions?: HostPermissionsAdapter\n /**\n * The programs whose steps make the checklist. Default: the store-live\n * program alone (`buildStoreLiveProgram`). Without `storeProfile`, the\n * store-live program's profile step is removed from whatever is passed.\n */\n programs?: OnboardingProgramDef[]\n /** The tour's opening stops, anchored on the host's DOM. Default: the plugin's own (`data-tour` anchors). */\n tour?: OnboardingTourDef\n /** Routes the host can open; a step whose route is not here keeps its title and loses its link. Default: every route. */\n hasRoute?: (route: string) => boolean\n /** Register the client handlers of `aiTools` (the assistant runs them in the browser). Default true. */\n registerToolHandlers?: boolean\n}\n\nexport interface GettingStartedHost {\n config: ResolvedGettingStartedConfig\n provider: GettingStartedDataProvider\n programs: OnboardingProgramDef[]\n /**\n * Mount once, high in the host's tree, where the org and the user are\n * painted: runs the checklist (rows, sensors) and the tour spotlight. The\n * surfaces below render without it, but nothing ticks.\n */\n Provider: React.ComponentType<{ children?: React.ReactNode }>\n /** The home card (\"Sua loja no ar\", n/9). */\n StoreLiveCard: React.ComponentType<Omit<StoreLiveCardProps, 'variant'>>\n /** The same card for the top of the Tasks tab: pass as `<TasksPanel top={<RailTasksBlock/>}/>`. */\n RailTasksBlock: React.ComponentType\n /** The floating \"Iniciar teste · N dias\" pill (portals itself). */\n StartTrialCta: React.ComponentType\n /** The button an app composes into its own screen. */\n StartTrialAction: React.ComponentType<StartTrialActionProps>\n /** The end-of-trial banner for the top bar. */\n TrialEndBanner: React.ComponentType\n /** The trial settings (hours, payment methods, the journey). Optional surface. */\n TrialSettingsTab: React.ComponentType\n tour: {\n id: string\n /** Starts the journey tour now; without `force` only once per tenant. */\n start: (opts?: { force?: boolean; moment?: JourneyTourMoment }) => boolean\n }\n /** The assistant tools to hand to the host's agent transport. */\n aiTools: PluginAITool[]\n /** Restores every platform default this host installed (backends, permissions, programs). */\n dispose: () => void\n}\n\n/**\n * The getting-started surfaces for a host that does not run AdminShell nor the\n * plugin runtime (a legacy product mounting them slot by slot). Everything the\n * plugin would read from the platform is injected here; nothing below assumes\n * the platform's tables.\n */\nexport function createGettingStartedHost(options: GettingStartedHostOptions): GettingStartedHost {\n const config = resolveConfig(options)\n setActiveConfig(config)\n setJourneyOverride(config.journey)\n registerTranslations(gettingStartedLocales)\n\n const provider = options.dataProvider\n const profile = !!options.storeProfile\n useJourneyStore.getState().bind(provider)\n if (options.registerToolHandlers !== false) registerGettingStartedToolHandlers(useJourneyStore, { profile })\n if (options.activation) configureActivationBackend(options.activation)\n if (options.storeSettings) configureStoreSettings(options.storeSettings)\n if (options.storeProfile) configureStoreProfile(options.storeProfile)\n if (options.permissions) configurePermissions(options.permissions)\n\n const given = options.programs ?? [buildStoreLiveProgram({ provider, config, profile })]\n const programs = profile ? given : given.map(withoutStoreProfileStep)\n setHostJourneyPrograms(programs)\n if (options.tour) {\n useJourneyTourStore.getState().rememberRuntime({\n onboardingTours: [{\n ...options.tour,\n pluginId: 'getting-started',\n pluginName: 'Getting started',\n order: options.tour.order ?? 0,\n when: options.tour.when ?? 'trial_started',\n }],\n })\n }\n\n const scope = { config, provider }\n const surface = <P extends object>(Component: React.ComponentType<P>, name: string): React.ComponentType<P> => {\n const Wrapped = withGettingStartedContext(withJourneyDeclaration(Component), scope)\n Wrapped.displayName = `GettingStartedHost(${name})`\n return Wrapped\n }\n\n const hasRoute = options.hasRoute\n function Provider({ children }: { children?: React.ReactNode }) {\n return (\n <>\n <HostActivationProvider programs={programs} hasRoute={hasRoute} />\n {children}\n </>\n )\n }\n\n const RailBlock = () => <StoreLiveCardView variant=\"rail\" />\n\n return {\n config,\n provider,\n programs,\n Provider,\n StoreLiveCard: surface(StoreLiveCardView as React.ComponentType<Omit<StoreLiveCardProps, 'variant'>>, 'StoreLiveCard'),\n RailTasksBlock: surface(RailBlock, 'RailTasksBlock'),\n StartTrialCta: surface(StartTrialCtaView, 'StartTrialCta'),\n StartTrialAction: surface(StartTrialActionView, 'StartTrialAction'),\n TrialEndBanner: surface(TrialEndBannerView, 'TrialEndBanner'),\n TrialSettingsTab: surface(TrialSettingsTabView, 'TrialSettingsTab'),\n tour: {\n id: JOURNEY_TOUR_ID,\n start: (opts) => startJourneyTour({ force: opts?.force, moment: opts?.moment ?? 'manual' }),\n },\n aiTools: gettingStartedAiToolsFor({ profile }),\n dispose: () => {\n if (options.activation) configureActivationBackend(null)\n if (options.storeSettings) configureStoreSettings(null)\n if (options.storeProfile) configureStoreProfile(null)\n if (options.permissions) configurePermissions(null)\n setHostJourneyPrograms(undefined)\n if (options.tour) useJourneyTourStore.getState().rememberRuntime(null)\n useJourneyStore.getState().reset()\n },\n }\n}\n\n// Composition: what a host needs to build its own programs and tour from the plugin's.\nexport {\n buildStoreLiveProgram, withoutStoreProfileStep, storeSetupRouting, hasOpeningHours, hasPaymentMethods,\n PROGRAM_ID as STORE_LIVE_PROGRAM_ID, type BuildStoreLiveProgramInput,\n} from './lib/program'\nexport {\n journeyTour, buildOwnJourneyTour, buildJourneyTour, buildJourneyClosingStop, JOURNEY_TOUR_ID,\n CARD_ANCHOR as STORE_LIVE_CARD_ANCHOR, TRIAL_TAB_ANCHOR,\n} from './lib/tour'\nexport { resolveConfig, resolveRoutes, DEFAULT_ROUTES, type GettingStartedRoutes, type ResolvedGettingStartedConfig } from './config'\nexport {\n STORE_PROFILE_STEP_KEY, SERVICE_MODES, OPERATIONS, DELIVERY_METHODS, TABLE_BANDS, PROFILE_KEYS,\n storeProfileFrom, storeProfileFromAnswers, storeProfileToAnswers, storeProfileAnswered,\n type StoreProfile, type StoreProfileProvider, type SaveStoreProfileWriteResult,\n type StoreOperation, type StoreServiceMode, type StoreDeliveryMethod, type StoreTableBand,\n} from './lib/store-profile'\nexport { SAVE_PROFILE_TOOL } from './lib/agent-tools'\nexport type { GettingStartedDataProvider } from './data/types'\nexport type { StoreSettingsProvider, StoreSettingKey, SaveStoreSettingResult } from './lib/store-settings'\nexport type { ActivationBackend, HostPermissionsAdapter } from '@fayz-ai/admin/host'\nexport type { Journey, JourneyPhase, JourneyMinimums, JourneyEvent, StartTrialResult, RequestContractResult, StoreHours, PaymentMethod } from './types'\nexport { GettingStartedError, isForbidden, isMissingClock, createMockGettingStartedProvider } from './data'\n"]}