@robono/server 0.20.1 → 0.22.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +36 -4
  3. package/SBOM.spdx.json +9 -9
  4. package/dist/messenger-connected-templates.d.ts.map +1 -1
  5. package/dist/messenger-connected-templates.js +6 -3
  6. package/dist/messenger-connected-templates.js.map +1 -1
  7. package/dist/messenger-customer-templates.d.ts +4 -0
  8. package/dist/messenger-customer-templates.d.ts.map +1 -0
  9. package/dist/messenger-customer-templates.js +111 -0
  10. package/dist/messenger-customer-templates.js.map +1 -0
  11. package/dist/messenger-init.d.ts.map +1 -1
  12. package/dist/messenger-init.js +3 -2
  13. package/dist/messenger-init.js.map +1 -1
  14. package/dist/messenger-install-cli.js +28 -8
  15. package/dist/messenger-install-cli.js.map +1 -1
  16. package/dist/messenger-install.d.ts +14 -1
  17. package/dist/messenger-install.d.ts.map +1 -1
  18. package/dist/messenger-install.js +244 -48
  19. package/dist/messenger-install.js.map +1 -1
  20. package/dist/messenger-node.d.ts +14 -0
  21. package/dist/messenger-node.d.ts.map +1 -0
  22. package/dist/messenger-node.js +127 -0
  23. package/dist/messenger-node.js.map +1 -0
  24. package/dist/messenger-upgrade.d.ts +21 -0
  25. package/dist/messenger-upgrade.d.ts.map +1 -0
  26. package/dist/messenger-upgrade.js +136 -0
  27. package/dist/messenger-upgrade.js.map +1 -0
  28. package/dist/messenger-vite-templates.d.ts +12 -0
  29. package/dist/messenger-vite-templates.d.ts.map +1 -0
  30. package/dist/messenger-vite-templates.js +89 -0
  31. package/dist/messenger-vite-templates.js.map +1 -0
  32. package/legacy/0.21.0/messenger-connected-templates.js +138 -0
  33. package/legacy/0.21.0/messenger-customer-templates.js +111 -0
  34. package/legacy/0.21.0/messenger-init.js +121 -0
  35. package/legacy/0.21.0/messenger-install.js +243 -0
  36. package/legacy/0.21.0/messenger-preview-template.js +43 -0
  37. package/legacy/0.21.0/package.json +1 -0
  38. package/package.json +11 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  ## 0.20.1 — 2026-11-04
2
2
 
3
+ ## 0.22.0
4
+
5
+ - Automatic React + Vite setup with same-origin development and production Node servers, preserving the existing application and Vite configuration.
6
+ - Safe generated-file upgrades with original hashes, private backups, review proposals, deletion/edit protection, and verified 0.21.0 migration baselines.
7
+ - Node/Express-compatible messaging handler retaining authentication, permissions and origin checks.
8
+ - Private setup/source paths are blocked in development and production; accidental frontend imports of private generated server code fail the production build.
9
+
10
+
11
+ ## 0.21.0
12
+
13
+ - Generated CustomerMessenger accepts an existing Supabase/Firebase sign-in client directly, with a custom-account option.
14
+ - Optional development connection checks use the signed-in account without copying a token. Checks are read-only, clear on account changes and are hidden in production.
15
+ - Resume interrupted package installation without replacing customer integration or permission code.
16
+ - Reuse existing Next.js Supabase public settings and configure allowed website origins through the server environment.
17
+
18
+
3
19
  Use cross-spawn for package-manager commands so Windows npm/pnpm/Yarn command files can run correctly while preserving argument boundaries. No server API or generated-file changes.
4
20
 
5
21
  ## 0.20.0 — release candidate
package/README.md CHANGED
@@ -413,9 +413,9 @@ synchronize revocations and suspension to Robono promptly: a queued message
413
413
  cannot detect an unsynchronized change known only to your server.
414
414
 
415
415
 
416
- ## Install into an existing app (0.20+)
416
+ ## Install into an existing app (0.22+)
417
417
 
418
- Run from a Next.js App Router project with Node.js 22 or later:
418
+ Run from a Next.js App Router or React + Vite project with Node.js 22.12 or later:
419
419
 
420
420
  ```sh
421
421
  npx --package @robono/server robono-messenger-install --origin https://your-company.com --company "Your company"
@@ -425,7 +425,7 @@ For Expo 55–56, run from the phone project and add `--server-project ../your-n
425
425
 
426
426
  The installer preserves existing provider package versions. Package installation scripts are disabled; run any required dependency-specific build steps yourself. Expo uses its installed SDK's version selection for native peers. Rebuild both mobile apps after native changes.
427
427
 
428
- Open `.robono/SETUP.md`. Provider sign-in verification is supplied; connect your own current messaging eligibility, suspension and conversation permission checks in `robono-access.ts`. They intentionally deny access until connected. Synchronize relationships and groups from your server. Import the generated `robonoAccounts` and `ConnectedRobonoChat`, create the accounts adapter once with `useMemo`, and supply your current contact names and avatars. Keep the connected screen mounted in your signed-in application. The messenger account menu unregisters notifications before ending provider sign-in; provider events also clear local chat on account changes. If a session is already invalid, remote device removal may fail, so account revocation must also be synchronized server-side.
428
+ Open `.robono/SETUP.md`. Provider sign-in verification is supplied; connect your own current messaging eligibility, suspension and conversation permission checks in `robono-access.ts`. They intentionally deny access until connected. Synchronize relationships and groups from your server. Import the generated `CustomerMessenger` and render `<CustomerMessenger auth={yourExistingSignInClient} contacts={yourContacts}/>` for Supabase or Firebase. Account subscription and cleanup are included. For custom sign-in pass `accounts={yourAccounts}` using the generated `RobonoAccounts` interface. Keep the connected screen mounted in your signed-in application. The messenger account menu unregisters notifications before ending provider sign-in; provider events also clear local chat on account changes. If a session is already invalid, remote device removal may fail, so account revocation must also be synchronized server-side.
429
429
 
430
430
  The development-only `/robono-preview` page shows the actual website messenger for fictional Alice and Bob. Text stays in page memory, disappears on reload, and never reaches Robono. It demonstrates text only and returns 404 outside development. It is not evidence that your live connection or permissions work.
431
431
 
@@ -436,8 +436,40 @@ npx --package @robono/server robono-messenger-install --check
436
436
  npx --package @robono/server robono-messenger-install --check --json
437
437
  ```
438
438
 
439
- The checklist distinguishes files, configured permission code, required credentials, contacts and live connection results. It does not infer security from edited source or claim all customer permission rules were tested. Reports exclude tokens and message content.
439
+ During development, add `setupChecks` to `CustomerMessenger` and press **Check connection** after signing in. It uses the current login without copied tokens, performs read-only settings/conversation/notification checks, and displays fixed guidance without response contents. It cancels and clears on account changes and is hidden in production. The command-line checker remains available for additional security checks.
440
+
441
+ If installation was interrupted, run `robono-messenger-install --resume` from the same project. Required package commands are reconstructed from the installed tool, not executed from saved metadata. Existing integration source, permissions, screens and environment files are preserved. Set `ROBONO_ALLOWED_ORIGINS` on the server for production addresses without editing generated source. Existing Next.js Supabase public configuration is reused when available.
442
+
443
+ The checklist distinguishes files, package installation, configured permission code, required credentials, contacts and live connection results. It does not infer security from edited source or claim all customer permission rules were tested. Reports exclude tokens and message content.
440
444
 
441
445
  Supabase uses the official client's `auth.getUser(token)` on the server. Firebase uses the official Admin client's `verifyIdToken(token, true)`, including revocation/disabled-account checks. Exported `supabaseMessengerAuthentication` and `firebaseMessengerAuthentication` accept your configured provider clients; no provider secrets belong in client code. Continue checking app-specific suspension and memberships in `authorize`.
442
446
 
443
447
  Notifications remain a separate credential step: website origin/chat path for browsers; APNs key, Team ID, Key ID and Bundle ID for iPhone; app `google-services.json` and a privately uploaded FCM service account for Android. Upload private notification credentials in Robono's setup screen. Chat can work before alerts are configured. You still need real background alert checks.
448
+
449
+
450
+ ### React + Vite
451
+
452
+ The installer preserves your Vite configuration, application entry points and existing package commands. Generated client files are under `src/robono/client` (or `robono/client` in a project without `src`). Private server files live under `.robono/server`, outside the frontend source. The supplied runner blocks private setup/server files in development; the production build rejects frontend imports of those files.
453
+
454
+ ```sh
455
+ npm --prefix .robono run dev
456
+ npm --prefix .robono run build
457
+ npm --prefix .robono start
458
+ ```
459
+
460
+ The development runner starts your existing Vite site and `/api/robono` together on loopback. Open its printed address; `/robono-preview` is the fictional two-person preview. Restart after editing server code. Existing Vite plugins and the configured build output directory are retained. Custom Vite roots need a manual connection. Supply `ROBONO_DEV_PORT` if the configured development port is occupied.
461
+
462
+ Production serves the built website and the same authenticated messaging route from one Node process. Deploy on a Node host with HTTPS; static-only hosting cannot execute private account checks. Configure `PORT`, optional `HOST`, `ROBONO_PUBLIC_ORIGIN`, `ROBONO_ALLOWED_ORIGINS`, `ROBONO_API_KEY` and provider credentials on that host. The runner reads private root `.env.local` / `.env` files locally; it never writes them. Never put private keys in `VITE_` variables. Existing Vite Supabase public URL/key variables are accepted for identity verification. Production never serves the preview or setup/source directories.
463
+
464
+ Other Node/Express applications can import `createMessengerNodeHandler` from `@robono/server/node`. Mount it before body parsers, passing a configured `getMessenger` and exact public origin; it returns whether it handled `/api/robono`. It preserves the existing authentication, permission, origin and notification-helper checks. JSON request bodies are capped at 256 KiB; attachment bytes use the existing signed-upload flow. The ready-made website server is also exported as `createMessengerWebsiteServer` and serves only a dedicated built frontend directory.
465
+
466
+ ### Safe upgrades
467
+
468
+ ```sh
469
+ npx --package @robono/server robono-messenger-install --upgrade --dry-run
470
+ npx --package @robono/server robono-messenger-install --upgrade
471
+ ```
472
+
473
+ The installer records the hashes of generated files. Upgrades replace verified unchanged files, back up replacements privately under `.robono/backups`, and preserve customer edits and deletions. A changed file needing review gets a proposed version under `.robono/updates`; `.robono/upgrade-report.json` lists exact paths and reasons, without file contents or secrets. Permission changes are never guessed or merged automatically. Apply reviewed changes yourself and run the upgrade again. Pending review uses exit code 2; command/install errors use exit code 1.
474
+
475
+ Installations from 0.21.0 are compared against bundled copies of that published generator. Older files that cannot be verified are preserved for review. An installation that did not save its company name needs `--company` with its existing name. Package commands are reconstructed, never executed from metadata. `--resume` finishes interrupted dependencies; it does not replace integration code. Keep `.robono/setup.json` with your project for future comparisons. The upgrade checks for edits made after planning before it writes files.
package/SBOM.spdx.json CHANGED
@@ -2,22 +2,22 @@
2
2
  "spdxVersion": "SPDX-2.3",
3
3
  "dataLicense": "CC0-1.0",
4
4
  "SPDXID": "SPDXRef-DOCUMENT",
5
- "name": "@robono/server@0.20.1",
6
- "documentNamespace": "http://spdx.org/spdxdocs/@robono%2fserver-0.20.1-***",
5
+ "name": "@robono/server@0.22.0",
6
+ "documentNamespace": "http://spdx.org/spdxdocs/@robono%2fserver-0.22.0-***",
7
7
  "creationInfo": {
8
- "created": "2026-11-04T05:52:06.219Z",
8
+ "created": "2026-11-04T07:21:06.992Z",
9
9
  "creators": [
10
10
  "Tool: npm/cli-11.6.2"
11
11
  ]
12
12
  },
13
13
  "documentDescribes": [
14
- "SPDXRef-Package-robono.server-0.20.1"
14
+ "SPDXRef-Package-robono.server-0.22.0"
15
15
  ],
16
16
  "packages": [
17
17
  {
18
18
  "name": "@robono/server",
19
- "SPDXID": "SPDXRef-Package-robono.server-0.20.1",
20
- "versionInfo": "0.20.1",
19
+ "SPDXID": "SPDXRef-Package-robono.server-0.22.0",
20
+ "versionInfo": "0.22.0",
21
21
  "packageFileName": "",
22
22
  "description": "Provider-neutral server SDK for the Robono Bridge API.",
23
23
  "primaryPackagePurpose": "LIBRARY",
@@ -29,7 +29,7 @@
29
29
  {
30
30
  "referenceCategory": "PACKAGE-MANAGER",
31
31
  "referenceType": "purl",
32
- "referenceLocator": "pkg:npm/%40robono/server@0.20.1"
32
+ "referenceLocator": "pkg:npm/%40robono/server@0.22.0"
33
33
  }
34
34
  ]
35
35
  },
@@ -175,12 +175,12 @@
175
175
  "relationships": [
176
176
  {
177
177
  "spdxElementId": "SPDXRef-DOCUMENT",
178
- "relatedSpdxElement": "SPDXRef-Package-robono.server-0.20.1",
178
+ "relatedSpdxElement": "SPDXRef-Package-robono.server-0.22.0",
179
179
  "relationshipType": "DESCRIBES"
180
180
  },
181
181
  {
182
182
  "spdxElementId": "SPDXRef-Package-cross-spawn-7.0.6",
183
- "relatedSpdxElement": "SPDXRef-Package-robono.server-0.20.1",
183
+ "relatedSpdxElement": "SPDXRef-Package-robono.server-0.22.0",
184
184
  "relationshipType": "DEPENDENCY_OF"
185
185
  },
186
186
  {
@@ -1 +1 @@
1
- {"version":3,"file":"messenger-connected-templates.d.ts","sourceRoot":"","sources":["../src/messenger-connected-templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AACjE,MAAM,MAAM,qBAAqB,GAAC,QAAQ,GAAC,UAAU,GAAC,UAAU,CAAC;AACjE,wBAAgB,uBAAuB,CAAC,KAAK,EAAC,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,EAAC,OAAO,EAAC,uBAAuB,0BAkIlG"}
1
+ {"version":3,"file":"messenger-connected-templates.d.ts","sourceRoot":"","sources":["../src/messenger-connected-templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AAEjE,MAAM,MAAM,qBAAqB,GAAC,QAAQ,GAAC,UAAU,GAAC,UAAU,CAAC;AACjE,wBAAgB,uBAAuB,CAAC,KAAK,EAAC,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,EAAC,OAAO,EAAC,uBAAuB,0BAoIlG"}
@@ -1,3 +1,4 @@
1
+ import { customerMessengerTemplates } from './messenger-customer-templates.js';
1
2
  export function connectStarterTemplates(files, options) {
2
3
  const provider = options.auth ?? 'custom', web = options.platform === 'web', q = JSON.stringify;
3
4
  if (!['custom', 'supabase', 'firebase'].includes(provider))
@@ -8,7 +9,8 @@ import {supabaseMessengerAuthentication} from '@robono/server';
8
9
  let verify:ReturnType<typeof supabaseMessengerAuthentication>|undefined;
9
10
  export async function authenticate(request:Request){
10
11
  if(verify)return verify(request);
11
- const url=process.env.SUPABASE_URL,key=process.env.SUPABASE_PUBLISHABLE_KEY;
12
+ const url=process.env.SUPABASE_URL??process.env.NEXT_PUBLIC_SUPABASE_URL;
13
+ const key=process.env.SUPABASE_PUBLISHABLE_KEY??process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY??process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;
12
14
  if(!url||!key)throw Error('Set your existing Supabase URL and publishable key on the server.');
13
15
  const provider=createClient(url,key,{auth:{persistSession:false,autoRefreshToken:false,detectSessionInUrl:false}});
14
16
  verify=supabaseMessengerAuthentication(provider.auth);
@@ -30,7 +32,7 @@ export async function authorize(access:MessengerAccess):Promise<boolean>{
30
32
  throw Error('Connect your existing messaging permission check in robono-access.ts');
31
33
  }
32
34
  `;
33
- files['.env.example'] += provider === 'supabase' ? 'SUPABASE_URL=\nSUPABASE_PUBLISHABLE_KEY=\n' : '# Server only: path to your existing Firebase service-account file, or workload identity.\nGOOGLE_APPLICATION_CREDENTIALS=\n';
35
+ files['.env.example'] += provider === 'supabase' ? '# Existing NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY\n# (or NEXT_PUBLIC_SUPABASE_ANON_KEY) are reused when present. Otherwise set:\n# SUPABASE_URL=\n# SUPABASE_PUBLISHABLE_KEY=\n' : '# Server only: path to your existing Firebase service-account file, or workload identity.\nGOOGLE_APPLICATION_CREDENTIALS=\n';
34
36
  }
35
37
  files['client/RobonoChat.tsx'] = web ? `'use client';
36
38
  import {useEffect,useRef} from 'react';
@@ -129,7 +131,8 @@ export function robonoAccounts(auth:Auth):RobonoAccounts{
129
131
  }}:null),()=>listener(null));},signOut:()=>signOut(auth)};
130
132
  }
131
133
  `;
132
- files['ROBONO-SETUP.md'] += `\n## Connected accounts\n${provider === 'custom' ? 'Implement the small RobonoAccounts interface using your existing verified sign-in client.' : 'Use robonoAccounts(yourExisting' + (provider === 'supabase' ? 'SupabaseClient' : 'FirebaseAuth') + '). Create it once with useMemo, then pass it as accounts to ConnectedRobonoChat.'} Pass your current contact dictionary as contacts; names and avatars update without restarting the chat. The connected screen listens for sign-in, sign-out and account switching. It uses a fresh token for each request and never substitutes one account’s token for another.\n\nKeep ConnectedRobonoChat mounted in your signed-in application. Keep your own account suspension and permission checks in robono-access.ts; provider identity verification does not replace them. Missing permission code intentionally denies access. For explicit host sign-out, unregister messaging before revoking your session when possible. If the provider session has already expired, local content is still cleared; synchronize revoked account access on the server so notifications are also blocked.\n`;
134
+ files['ROBONO-SETUP.md'] += `\n## Connected accounts\n${provider === 'custom' ? 'Implement the small RobonoAccounts interface using your existing verified sign-in client.' : 'Import CustomerMessenger and pass your existing ' + (provider === 'supabase' ? 'Supabase client' : 'Firebase Auth instance') + ' as auth. The account wrapper is included.'} Pass your current contact dictionary as contacts; names and avatars update without restarting the chat. The connected screen listens for sign-in, sign-out and account switching. It uses a fresh token for each request and never substitutes one account’s token for another.\n\nKeep CustomerMessenger mounted in your signed-in application. Add setupChecks during development for a connection check using your existing login; no copied tokens are needed. The panel is hidden in production. Keep your own account suspension and permission checks in robono-access.ts; provider identity verification does not replace them. Missing permission code intentionally denies access. For explicit host sign-out, unregister messaging before revoking your session when possible. If the provider session has already expired, local content is still cleared; synchronize revoked account access on the server so notifications are also blocked.\n`;
135
+ Object.assign(files, customerMessengerTemplates(options));
133
136
  return files;
134
137
  }
135
138
  //# sourceMappingURL=messenger-connected-templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messenger-connected-templates.js","sourceRoot":"","sources":["../src/messenger-connected-templates.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,uBAAuB,CAAC,KAA2B,EAAC,OAA+B;IAClG,MAAM,QAAQ,GAAC,OAAO,CAAC,IAAI,IAAE,QAAQ,EAAC,GAAG,GAAC,OAAO,CAAC,QAAQ,KAAG,KAAK,EAAC,CAAC,GAAC,IAAI,CAAC,SAAS,CAAC;IACpF,IAAG,CAAC,CAAC,QAAQ,EAAC,UAAU,EAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAC,MAAM,KAAK,CAAC,8CAA8C,CAAC,CAAC;IACpH,IAAG,QAAQ,KAAG,QAAQ,EAAC,CAAC;QACvB,MAAM,KAAK,GAAC,QAAQ,KAAG,UAAU,CAAA,CAAC,CAAA;;;;;;;;;;EAUlC,CAAA,CAAC,CAAA;;;;;;;;;;EAUD,CAAC;QACD,KAAK,CAAC,yBAAyB,CAAC,GAAC,yDAAyD,KAAK;;;;;CAKhG,CAAC;QACA,KAAK,CAAC,cAAc,CAAC,IAAE,QAAQ,KAAG,UAAU,CAAA,CAAC,CAAA,4CAA4C,CAAA,CAAC,CAAA,8HAA8H,CAAC;IAC1N,CAAC;IACD,KAAK,CAAC,uBAAuB,CAAC,GAAC,GAAG,CAAA,CAAC,CAAA;;;;;;;;;;;wFAWoD,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;;;;;;;CAO7G,CAAA,CAAC,CAAA;;;;;;;;mDAQiD,CAAC,CAAC,OAAO,CAAC,MAAM,GAAC,aA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diagnostics stay generated. */
3
+ export declare function customerMessengerTemplates(options: MessengerStarterOptions): Record<string, string>;
4
+ //# sourceMappingURL=messenger-customer-templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messenger-customer-templates.d.ts","sourceRoot":"","sources":["../src/messenger-customer-templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AAEjE,yFAAyF;AACzF,wBAAgB,0BAA0B,CAAC,OAAO,EAAC,uBAAuB,GAAE,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,CA4GhG"}
@@ -0,0 +1,111 @@
1
+ /** A single customer-facing component; account wiring and diagnostics stay generated. */
2
+ export function customerMessengerTemplates(options) {
3
+ const provider = options.auth ?? 'custom';
4
+ const web = options.platform === 'web';
5
+ const type = provider === 'supabase' ? 'SupabaseClient' : provider === 'firebase' ? 'Auth' : 'RobonoAccounts';
6
+ const typeImport = provider === 'supabase' ? "import type {SupabaseClient} from '@supabase/supabase-js';" : provider === 'firebase' ? "import type {Auth} from 'firebase/auth';" : "import type {RobonoAccounts} from './ConnectedRobonoChat';";
7
+ return {
8
+ 'client/CustomerMessenger.tsx': `'use client';
9
+ import React,{useMemo,type ComponentProps} from 'react';
10
+ import {ConnectedRobonoChat} from './ConnectedRobonoChat';
11
+ import {MessengerSetup} from './MessengerSetup';
12
+ ${typeImport}
13
+ ${provider === 'custom' ? '' : "import {robonoAccounts} from './robono-accounts';"}
14
+ type Props=Omit<ComponentProps<typeof ConnectedRobonoChat>,'accounts'>&{
15
+ ${provider === 'custom' ? 'accounts' : 'auth'}:${type};
16
+ /** Optional development-only connection check. Never shown in a production build. */
17
+ setupChecks?:boolean;
18
+ };
19
+ export function CustomerMessenger({${provider === 'custom' ? 'accounts' : 'auth'},setupChecks=false,...props}:Props){
20
+ ${provider === 'custom' ? '' : 'const accounts=useMemo(()=>robonoAccounts(auth),[auth]);'}
21
+ return <>
22
+ {setupChecks&&${web ? "process.env.NODE_ENV==='development'" : '__DEV__'}&&<MessengerSetup accounts={accounts}/>}
23
+ <ConnectedRobonoChat accounts={accounts} {...props}/>
24
+ </>;
25
+ }
26
+ `,
27
+ 'client/check-messenger-connection.ts': `export interface ConnectionCheck {name:string;status:'passed'|'failed'|'needs-action';detail:string}
28
+ /** Read-only checks in the signed-in app. Tokens never enter the report or Robono's website. */
29
+ export async function checkMessengerConnection(getAccessToken:()=>Promise<string>,signal:AbortSignal):Promise<ConnectionCheck[]>{
30
+ const endpoint=${JSON.stringify(web ? '/api/robono' : options.origin + '/api/robono')};
31
+ const checks:ConnectionCheck[]=[];
32
+ const run=async(name:string,operation:string,service:string,inspect:(data:any)=>Omit<ConnectionCheck,'name'>)=>{
33
+ try{
34
+ const token=await getAccessToken();
35
+ if(signal.aborted)throw Error('Cancelled');
36
+ const response=await fetch(endpoint+'?service='+service,{method:'POST',redirect:'error',signal,
37
+ headers:{'content-type':'application/json',authorization:'Bearer '+token},body:JSON.stringify({operation})});
38
+ if(!response.ok){
39
+ const detail=response.status===401?'Sign in again, then check that the server uses the same sign-in provider.':
40
+ response.status===403?'Check the server’s account permissions and allowed website address.':
41
+ response.status===404?'The /api/robono route is missing. Run the installer checklist.':
42
+ response.status===429?'The service is busy or a usage limit was reached. Try again shortly.':
43
+ 'The server could not complete this check. Check its private configuration and permission code.';
44
+ checks.push({name,status:'failed',detail});return;
45
+ }
46
+ checks.push({name,...inspect(await response.json())});
47
+ }catch{
48
+ if(signal.aborted)return;
49
+ checks.push({name,status:'failed',detail:'Could not connect with the current login. Check your server address and internet connection.'});
50
+ }
51
+ };
52
+ await run('Signed-in messaging','settings','messages',data=>({status:data.settings?'passed':'failed',detail:data.settings?'Your current account can load messaging settings.':'The route did not return messaging settings.'}));
53
+ if(!signal.aborted)await run('Conversations','conversations','messages',data=>({status:!Array.isArray(data.conversations)?'failed':data.conversations.length?'passed':'needs-action',detail:!Array.isArray(data.conversations)?'The route did not return conversations.':data.conversations.length?'Your account has available conversations.':'Connect a second test account and synchronize their permitted relationship from your server.'}));
54
+ if(!signal.aborted)await run('Notifications','notification-status','notifications',data=>({status:!Array.isArray(data.providers)?'failed':data.providers.length?'passed':'needs-action',detail:!Array.isArray(data.providers)?'Check that the server uses the current messaging package.':data.providers.length?'A notification provider is configured. Test an actual background notification next.':'Connect website or Apple/Google notification settings in Robono. Chat can work before alerts are connected.'}));
55
+ return checks;
56
+ }
57
+ `,
58
+ 'client/MessengerSetup.tsx': `'use client';
59
+ import React,{useEffect,useRef,useState} from 'react';
60
+ ${web ? '' : "import {View,Text,Pressable} from 'react-native';"}
61
+ import type {RobonoAccounts,RobonoAccount} from './ConnectedRobonoChat';
62
+ import {checkMessengerConnection,type ConnectionCheck} from './check-messenger-connection';
63
+ export function MessengerSetup({accounts}:{accounts:RobonoAccounts}){
64
+ const current=useRef<RobonoAccount|null>(null),generation=useRef(0),pending=useRef<AbortController|null>(null);
65
+ const [signedIn,setSignedIn]=useState(false),[busy,setBusy]=useState(false),[checks,setChecks]=useState<ConnectionCheck[]>([]);
66
+ useEffect(()=>{
67
+ generation.current++;current.current=null;pending.current?.abort();setBusy(false);setChecks([]);setSignedIn(false);
68
+ let live=true;
69
+ const off=accounts.subscribe(account=>{
70
+ if(!live)return;
71
+ if(current.current?.id!==account?.id){generation.current++;pending.current?.abort();setChecks([]);setBusy(false);}
72
+ current.current=account;setSignedIn(!!account);
73
+ });
74
+ return()=>{live=false;generation.current++;current.current=null;pending.current?.abort();off();};
75
+ },[accounts]);
76
+ const run=async()=>{
77
+ if(!current.current||pending.current&&!pending.current.signal.aborted)return;
78
+ const account=current.current,version=generation.current,controller=new AbortController();
79
+ pending.current=controller;setBusy(true);setChecks([]);
80
+ const timer=setTimeout(()=>controller.abort(),20000);
81
+ const token=async()=>{
82
+ if(current.current?.id!==account.id||generation.current!==version)throw Error('Account changed');
83
+ const value=await current.current.getAccessToken();
84
+ if(current.current?.id!==account.id||generation.current!==version)throw Error('Account changed');
85
+ return value;
86
+ };
87
+ try{
88
+ const result=await checkMessengerConnection(token,controller.signal);
89
+ if(generation.current===version)setChecks(controller.signal.aborted?[{name:'Connection',status:'failed',detail:'The check timed out. Check your connection and try again.'}]:result);
90
+ }finally{
91
+ clearTimeout(timer);
92
+ if(pending.current===controller)pending.current=null;
93
+ if(generation.current===version)setBusy(false);
94
+ }
95
+ };
96
+ ${web ? `return <aside aria-label="Messenger setup check" style={{padding:12,border:'1px solid #b8b8b8',borderRadius:8,background:'#fff',color:'#222',fontFamily:'system-ui',marginBottom:8}}>
97
+ <button type="button" disabled={!signedIn||busy} onClick={()=>void run()}>{busy?'Checking connection…':'Check connection'}</button>
98
+ <p style={{margin:'8px 0',fontSize:14}}>{signedIn?'Uses your current login. No copied tokens or messages.':'Sign in to your app to check the connection.'} Development only.</p>
99
+ {checks.length>0&&<ul aria-live="polite" style={{margin:0,paddingLeft:20}}>{checks.map(check=><li key={check.name}><strong>{check.status==='passed'?'Ready':check.status==='failed'?'Fix':'Next'} — {check.name}:</strong> {check.detail}</li>)}</ul>}
100
+ {checks.length>0&&<p style={{fontSize:12,marginBottom:0}}>These are connection checks. They do not prove account isolation, delivery or background notifications.</p>}
101
+ </aside>;` : `return <View accessibilityLabel="Messenger setup check" style={{padding:12,borderWidth:1,borderColor:'#b8b8b8',borderRadius:8,backgroundColor:'#fff',marginBottom:8}}>
102
+ <Pressable accessibilityRole="button" accessibilityState={{disabled:!signedIn||busy}} disabled={!signedIn||busy} onPress={()=>void run()} style={{padding:8}}><Text style={{color:'#174ea6',fontWeight:'600'}}>{busy?'Checking connection…':'Check connection'}</Text></Pressable>
103
+ <Text style={{color:'#222',marginVertical:8}}>{signedIn?'Uses your current login. No copied tokens or messages.':'Sign in to your app to check the connection.'} Development only.</Text>
104
+ {checks.map(check=><Text key={check.name} style={{color:'#222',marginBottom:6}}>{check.status==='passed'?'Ready':check.status==='failed'?'Fix':'Next'} — {check.name}: {check.detail}</Text>)}
105
+ {checks.length>0&&<Text style={{color:'#555',fontSize:12}}>These are connection checks. They do not prove account isolation, delivery or background notifications.</Text>}
106
+ </View>;`}
107
+ }
108
+ `,
109
+ };
110
+ }
111
+ //# sourceMappingURL=messenger-customer-templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messenger-customer-templates.js","sourceRoot":"","sources":["../src/messenger-customer-templates.ts"],"names":[],"mappings":"AAEA,yFAAyF;AACzF,MAAM,UAAU,0BAA0B,CAAC,OAA+B;IACxE,MAAM,QAAQ,GAAC,OAAO,CAAC,IAAI,IAAE,QAAQ,CAAC;IACtC,MAAM,GAAG,GAAC,OAAO,CAAC,QAAQ,KAAG,KAAK,CAAC;IACnC,MAAM,IAAI,GAAC,QAAQ,KAAG,UAAU,CAAA,CAAC,CAAA,gBAAgB,CAAA,CAAC,CAAA,QAAQ,KAAG,UAAU,CAAA,CAAC,CAAA,MAAM,CAAA,CAAC,CAAA,gBAAgB,CAAC;IAChG,MAAM,UAAU,GAAC,QAAQ,KAAG,UAAU,CAAA,CAAC,CAAA,4DAA4D,CAAA,CAAC,CAAA,QAAQ,KAAG,UAAU,CAAA,CAAC,CAAA,0CAA0C,CAAA,CAAC,CAAA,4DAA4D,CAAC;IAClO,OAAO;QACL,8BAA8B,EAAC;;;;EAIjC,UAAU;EACV,QAAQ,KAAG,QAAQ,CAAA,CAAC,CAAA,EAAE,CAAA,CAAC,CAAA,mDAAmD;;IAExE,QAAQ,KAAG,QAAQ,CAAA,CAAC,CAAA,UAAU,CAAA,CAAC,CAAA,MAAM,IAAI,IAAI;;;;qCAIZ,QAAQ,KAAG,QAAQ,CAAA,CAAC,CAAA,UAAU,CAAA,CAAC,CAAA,MAAM;IACtE,QAAQ,KAAG,QAAQ,CAAA,CAAC,CAAA,EAAE,CAAA,CAAC,CAAA,0DAA0D;;oBAEjE,GAAG,CAAA,CAAC,CAAA,sCAAsC,CAAA,CAAC,CAAA,SAAS;;;;CAIvE;QACG,sCAAsC,EAAC;;;mBAGxB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAA,CAAC,CAAA,aAAa,CAAA,CAAC,CAAA,OAAO,CAAC,MAAM,GAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BhF;QACG,2BAA2B,EAAC;;EAE9B,GAAG,CAAA,CAAC,CAAA,EAAE,CAAA,CAAC,CAAA,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCxD,GAAG,CAAA,CAAC,CAAA;;;;;YAKI,CAAA,CAAC,CAAA;;;;;WAKF;;CAEV;KACE,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"messenger-init.d.ts","sourceRoot":"","sources":["../src/messenger-init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AAGtG,MAAM,WAAW,uBAAuB;IAAE,QAAQ,EAAC,KAAK,GAAC,MAAM,CAAC;IAAA,SAAS,EAAC,MAAM,GAAC,OAAO,CAAC;IAAA,MAAM,EAAC,MAAM,CAAC;IAAA,WAAW,EAAC,MAAM,CAAC;IAAA,IAAI,CAAC,EAAC,qBAAqB,CAAA;CAAC;AACtJ,4FAA4F;AAC5F,wBAAgB,qBAAqB,CAAC,OAAO,EAAC,uBAAuB,GAAE,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,CA+E3F;AACD,uFAAuF;AACvF,wBAAsB,qBAAqB,CAAC,WAAW,EAAC,MAAM,EAAC,OAAO,EAAC,uBAAuB,qBAc7F"}
1
+ {"version":3,"file":"messenger-init.d.ts","sourceRoot":"","sources":["../src/messenger-init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AAGtG,MAAM,WAAW,uBAAuB;IAAE,QAAQ,EAAC,KAAK,GAAC,MAAM,CAAC;IAAA,SAAS,EAAC,MAAM,GAAC,OAAO,CAAC;IAAA,MAAM,EAAC,MAAM,CAAC;IAAA,WAAW,EAAC,MAAM,CAAC;IAAA,IAAI,CAAC,EAAC,qBAAqB,CAAA;CAAC;AACtJ,4FAA4F;AAC5F,wBAAgB,qBAAqB,CAAC,OAAO,EAAC,uBAAuB,GAAE,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,CAgF3F;AACD,uFAAuF;AACvF,wBAAsB,qBAAqB,CAAC,WAAW,EAAC,MAAM,EAAC,OAAO,EAAC,uBAAuB,qBAc7F"}
@@ -26,7 +26,7 @@ export async function authorize(access:MessengerAccess):Promise<boolean>{
26
26
  `;
27
27
  const files = {
28
28
  '.gitignore': '.env\n.env.local\nnode_modules/\n',
29
- '.env.example': `# Server only. Never prefix this with NEXT_PUBLIC_, VITE_ or EXPO_PUBLIC_.\nROBONO_API_KEY=\n`,
29
+ '.env.example': `# Server only. Never prefix this with NEXT_PUBLIC_, VITE_ or EXPO_PUBLIC_.\nROBONO_API_KEY=\n# Optional comma-separated exact website origins. Set this before deployment.\nROBONO_ALLOWED_ORIGINS=${options.origin}\n`,
30
30
  'server/robono-access.ts': auth,
31
31
  'server/robono.ts': `import {createRobonoMessengerServer} from '@robono/server';
32
32
  import {authenticate,authorize} from './robono-access';
@@ -35,7 +35,8 @@ export function getMessenger(){
35
35
  if(messenger)return messenger;
36
36
  const apiKey=process.env.ROBONO_API_KEY;
37
37
  if(!apiKey)throw Error('Set ROBONO_API_KEY on your server.');
38
- return messenger=createRobonoMessengerServer({apiKey,authenticate,authorize,allowedOrigins:[${q(options.origin)}]});
38
+ const allowedOrigins=process.env.ROBONO_ALLOWED_ORIGINS?.split(',').map((value:string)=>value.trim()).filter(Boolean)??[${q(options.origin)}];
39
+ return messenger=createRobonoMessengerServer({apiKey,authenticate,authorize,allowedOrigins});
39
40
  }
40
41
  `,
41
42
  [route]: `import {getMessenger} from ${q(options.framework === 'next' ? '../../../server/robono' : './robono')};
@@ -1 +1 @@
1
- {"version":3,"file":"messenger-init.js","sourceRoot":"","sources":["../src/messenger-init.ts"],"names":[],"mappings":"AAAA,OAAO,E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
3
  import { stdin, stdout } from 'node:process';
4
- import { planMessengerInstallation, applyMessengerInstallation, messengerInstallationChecklist } from './messenger-install.js';
4
+ import { planMessengerInstallation, planMessengerInstallationResume, applyMessengerInstallation, messengerInstallationChecklist } from './messenger-install.js';
5
+ import { planMessengerUpgrade } from './messenger-upgrade.js';
5
6
  import { checkRobonoMessengerSetup } from './messenger-check.js';
6
7
  const args = process.argv.slice(2), values = {}, flags = new Set();
7
8
  let prompt;
8
9
  try {
9
10
  for (let i = 0; i < args.length; i++) {
10
11
  const arg = args[i];
11
- if (['--help', '--yes', '--dry-run', '--no-install', '--check', '--json'].includes(arg)) {
12
+ if (['--help', '--yes', '--dry-run', '--no-install', '--check', '--json', '--resume', '--upgrade'].includes(arg)) {
12
13
  flags.add(arg);
13
14
  continue;
14
15
  }
@@ -18,14 +19,19 @@ try {
18
19
  }
19
20
  if (flags.has('--help')) {
20
21
  console.log(`robono-messenger-install [--project .] [--server-project ../server] [--auth supabase|firebase|custom] --origin https://your-company.com --company "Your company"
21
- Detects Next.js App Router or Expo 55–56, places files, and installs matching packages.
22
+ Detects Next.js App Router, React + Vite or Expo 55–56, places files, and installs matching packages.
22
23
  Expo also needs a separate Next.js server and a static app.json. Existing application screens and .env files are preserved.
23
24
  --dry-run lists the exact files and commands without changing anything.
24
25
  --yes applies that plan without an interactive prompt. --no-install writes files only.
26
+ --resume finishes package installation using your saved setup, preserving all existing integration code.
27
+ --upgrade updates unchanged generated files, backs them up, and saves proposals for edited files. Use --dry-run first to review.
28
+ React + Vite includes a Node server: npm --prefix .robono run dev / build / start. No Next.js server is needed.
25
29
  --check shows one setup checklist; set the three ROBONO_* test variables to include live checks. --json prints a shareable checklist.
26
30
  The development-only /robono-preview route uses fictional people and never sends messages outside the page.`);
27
31
  }
28
32
  else if (flags.has('--check')) {
33
+ if (flags.has('--upgrade') || flags.has('--resume'))
34
+ throw Error('Choose --check, --upgrade or --resume separately.');
29
35
  let checks = await messengerInstallationChecklist(values['--project'] ?? '.');
30
36
  const endpoint = process.env.ROBONO_MESSENGER_URL, origin = process.env.ROBONO_WEBSITE_ORIGIN, accessToken = process.env.ROBONO_TEST_USER_TOKEN;
31
37
  if (endpoint && origin && accessToken) {
@@ -49,17 +55,24 @@ The development-only /robono-preview route uses fictional people and never sends
49
55
  if (stdin.isTTY && !flags.has('--yes'))
50
56
  prompt = createInterface({ input: stdin, output: stdout });
51
57
  const ask = async (key, label) => values[key] ?? (prompt ? (await prompt.question(label + ': ')).trim() : undefined);
52
- const origin = await ask('--origin', 'Website/server origin (for example https://your-company.com)'), companyName = await ask('--company', 'Company name');
53
- if (!origin || !companyName)
58
+ if (flags.has('--resume') && (flags.has('--no-install') || Object.keys(values).some(key => key !== '--project')))
59
+ throw Error('Use --resume with your existing --project only. It preserves the saved setup.');
60
+ const existing = flags.has('--resume') || flags.has('--upgrade');
61
+ if (flags.has('--resume') && flags.has('--upgrade'))
62
+ throw Error('Choose --resume or --upgrade.');
63
+ if (flags.has('--upgrade') && Object.keys(values).some(key => !['--project', '--company'].includes(key)))
64
+ throw Error('Upgrade uses the saved installation. Only --project and a missing legacy --company may be supplied.');
65
+ const origin = existing ? undefined : await ask('--origin', 'Website/server origin (for example https://your-company.com)'), companyName = existing ? undefined : await ask('--company', 'Company name');
66
+ if (!existing && (!origin || !companyName))
54
67
  throw Error('Supply --origin and --company, or run interactively.');
55
68
  const auth = values['--auth'];
56
69
  if (auth && !['custom', 'supabase', 'firebase'].includes(auth))
57
70
  throw Error('Choose custom, supabase or firebase.');
58
- const plan = await planMessengerInstallation({ project: values['--project'] ?? '.', origin, companyName, ...(values['--server-project'] ? { serverProject: values['--server-project'] } : {}), ...(auth ? { auth: auth } : {}) });
71
+ const plan = flags.has('--upgrade') ? await planMessengerUpgrade(values['--project'] ?? '.', values['--company'] ? { companyName: values['--company'] } : {}) : flags.has('--resume') ? await planMessengerInstallationResume(values['--project'] ?? '.') : await planMessengerInstallation({ project: values['--project'] ?? '.', origin: origin, companyName: companyName, ...(values['--server-project'] ? { serverProject: values['--server-project'] } : {}), ...(auth ? { auth: auth } : {}) });
59
72
  for (const file of plan.files)
60
73
  console.log('Create: ' + file.path);
61
74
  for (const file of plan.replacements)
62
- console.log('Merge missing Expo plugins: ' + file.path + ' (original saved in .robono)');
75
+ console.log('Update: ' + file.path);
63
76
  for (const command of plan.commands)
64
77
  console.log(`Install in ${command.cwd}: ${command.command} ${command.args.join(' ')}`);
65
78
  for (const note of plan.notes)
@@ -68,7 +81,14 @@ The development-only /robono-preview route uses fictional people and never sends
68
81
  if (!flags.has('--yes') && (!prompt || !/^y(es)?$/i.test((await prompt.question('Apply this plan? [y/N] ')).trim())))
69
82
  throw Error('Nothing changed. Use --yes to apply the displayed plan.');
70
83
  await applyMessengerInstallation(plan, !flags.has('--no-install'));
71
- console.log('Integration files are ready. Open .robono/SETUP.md, then run robono-messenger-install --check. Nothing was deployed.');
84
+ if ('upgradeReport' in plan) {
85
+ const report = plan.upgradeReport;
86
+ if (report.conflicts.length) {
87
+ console.log('Your edited files were preserved. Review .robono/upgrade-report.json before treating the upgrade as complete.');
88
+ process.exitCode = 2;
89
+ }
90
+ }
91
+ console.log('Integration files are ready. Open .robono/SETUP.md. Add CustomerMessenger to your screen; its optional setupChecks button checks your current login without copied tokens. Run --check for the local checklist. Nothing was deployed.');
72
92
  }
73
93
  }
74
94
  }
@@ -1 +1 @@
1
- {"version":3,"file":"messenger-install-cli.js","sourceRoot":"","sources":["../src/messenger-install-cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAC,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAC,yBAAyB,EAAC,0BAA0B,EAAC,8BAA8B,EAAC,MAAM,wBAAwB,CAAC;AAC3H,OAAO,EAAC,yBAAyB,EAAC,MAAM,sBAAsB,CAAC;AAC/D,MAAM,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CA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AAO,CAAA,CAAC,CAAA,sBAAsB,CAAC,CAAC;IAAA,OAAO,CAAC,QAAQ,GAAC,CAAC,CAAC;AAAA,CAAC;QAAO,CAAC;IAAA,MAAM,EAAE,KAAK,EAAE,CAAC;AAAA,CAAC"}
@@ -23,9 +23,22 @@ export interface MessengerInstallPlan {
23
23
  args: string[];
24
24
  }[];
25
25
  notes: string[];
26
+ setupFile?: string;
26
27
  }
28
+ export declare const messengerInstallerVersion = "0.22.0";
29
+ export declare const generatedHash: (content: string) => string;
30
+ export declare function generatedKey(file: string, client: string, server: string): string;
31
+ export declare function exists(file: string): Promise<boolean>;
32
+ export declare function safePath(file: string): Promise<void>;
33
+ export declare function readMessengerSetup(file: string): Promise<{
34
+ text: string;
35
+ setup: any;
36
+ }>;
27
37
  export declare function planMessengerInstallation(options: MessengerInstallOptions): Promise<MessengerInstallPlan>;
28
- /** Preflight all files; exclusive writes and rollback avoid overwriting customer work. */
38
+ export declare function buildMessengerInstallation(options: MessengerInstallOptions, mode: 'new' | 'resume' | 'upgrade'): Promise<MessengerInstallPlan>;
39
+ /** Reconstruct trusted package commands; never execute commands from saved metadata. */
40
+ export declare function planMessengerInstallationResume(directory: string): Promise<MessengerInstallPlan>;
41
+ /** Preflight, exclusive installer lock, atomic replacements and recoverable rollback. */
29
42
  export declare function applyMessengerInstallation(plan: MessengerInstallPlan, install?: boolean): Promise<void>;
30
43
  export declare function messengerInstallationChecklist(directory: string): Promise<{
31
44
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"messenger-install.d.ts","sourceRoot":"","sources":["../src/messenger-install.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,uBAAuB;IAAE,OAAO,EAAC,MAAM,CAAC;IAAA,aAAa,CAAC,EAAC,MAAM,CAAC;IAAA,MAAM,EAAC,MAAM,CAAC;IAAA,WAAW,EAAC,MAAM,CAAC;IAAA,IAAI,CAAC,EAAC,QAAQ,GAAC,UAAU,GAAC,UAAU,CAAA;CAAC;AAErJ,MAAM,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