Skip to content

Embedded Bridle chat ​

13 October 2026: accepted direction; implementation planned, not verified. A concrete proposal of 16 October 2026 for the passes, routes and API is below, for agreement in STOR-60. Bridle is the shared chat UI, in the embedded page the Bridle UI the app vendors; Store Deputy API authenticates sessions, applies permissions and talks to Agentfy. This does not reopen the completed app-chat task STOR-58. No widget asset URL or supported SDK parameter is claimed until STOR-61 verifies the actual Bridle interface.

Boundaries ​

The module establishes local shop context. Bridle renders chat. Store Deputy API authorizes each conversation and operation; Agentfy runs the agent; Store Deputy MCP invokes the shop through the existing module protocol. Agent IDs are not authorization credentials. Agentfy keys and connection secrets stay server-side.

Use an immutable Bridle release with SRI and crossorigin="anonymous", with CORS on the static host. Do not use mutable latest.js. Static, app and API origins are separate configuration values. Define CSP requirements and a tested release/hash upgrade path. A pinned script must never change in place.

Two modes ​

ModeLocal proofStore Deputy authorization
AdminConnected shop, enabled chat, current OpenCart admin session and module access permissionSigned admin pass AND authenticated team member with access to this shop; existing operation approvals remain required; since 29 October 2026 the admin chat itself shows the price change proposals and the Approvals panel, where an owner or admin approves or rejects (the same routes and role rule as the site)
ShopperCurrent OpenCart guest/customer session and associated cartSigned shopper pass, active connection and paid entitlement; only this shopper's cart and own orders

UI visibility is not authorization. Repeat checks at pass issuance and on API operations. A shopper pass must never authorize admin operations. OpenCart user ID is for audit, not Store Deputy membership or roles.

Planned exchange ​

  1. The module issues a signed pass through a same-origin POST with session, Origin and CSRF checks, rate limits and Cache-Control: no-store. No CORS response does not itself prevent CSRF. Standard OpenCart routes need no rewrite rules.
  2. Bridle exchanges the pass at Store Deputy API for a scoped chat session. API verifies exact signed bytes, purpose, connection/storefront, time bounds and nonce. Proposed single-use exchange requires atomic nonce consumption and an explicit lost-response/restart policy.
  3. Chat messages use that chat session. API binds it to actor, shop and conversation and supplies trusted context outside the model's arguments. API and module enforce shopper ownership on every tool operation.
  4. Login/logout, expiry, cart merge, role changes, Pause and revocation trigger revalidation or invalidation. A new pass must not inherit another person's conversation. Model input cannot select another customer or cart.

Shopper payload baseline: version, connectionId, storefrontId, customer, sessionRef, cartRef, issuedAt, expiresAt, nonce; separate signing prefix sd-shopper-pass-v1. On the storefront endpoint a shopper pass names the cart for as long as the module's row for its cartRef lives (7 days from the last pass the browser received, the longest chat session an owner can choose for the Storefront Agent; a login or logout ends it): its expiresAt governs the exchange for a chat only (26 October 2026, proposed). Admin baseline: version, connectionId, ocUserId, issuedAt, expiresAt, nonce; separate prefix sd-admin-pass-v1. STOR-60 must define purpose/audience and strict JSON Schemas, serialization, limits, errors and fixtures before implementation. Do not add draft fields to the existing strict schema piecemeal.

Use one module route name extension/module/storedeputy/storefront/pass; admin context is a separate admin route. This pass route is not in the manifest; the address the API will send storefront operations to is a different thing, the manifest's store.storefronts[].endpoint (storefront, reserved; STOR-68). Opaque references need a server-side mapping to the real session/cart: an HMAC cannot be reversed. Never expose shop cookies, session IDs, connection secrets or PII in passes. Do not forward OpenCart user_token to external hosts or logs.

Proposal of 16 October 2026 for agreement (STOR-60) ​

Proposed by Yevhen Kariakin; not agreed, not implemented. The machine contract is contracts/embedded/passes.yaml (status proposed), with fixtures and signature vectors in contracts/embedded/pass-vectors.json, checked by bun run contracts:check and, for the PHP module, by php contracts/scripts/pass-vectors.php. It replaces the shopperPass draft that stood in protocol.yaml since 6 October. What follows is the same proposal in words; the YAML wins on any difference.

The passes ​

Both passes have one form: base64url(payload) + "." + hex HMAC-SHA256(secret, prefix + "\n" + base64url(payload)), the key being the connection secret as UTF-8 bytes, exactly as Module Protocol 1 signs. The verifier checks the signature over the base64url text it received and only then parses the JSON and validates it against a strict schema (additionalProperties: false). Nobody canonicalizes.

Admin passShopper pass
Prefixsd-admin-pass-v1sd-shopper-pass-v1
audienceadmin-chatshopper-chat
Payloadversion: 1, audience, connectionId, ocUserId (audit only), issuedAt, expiresAt, nonceversion: 1, audience, connectionId, storefrontId, customer {id} or null, sessionRef or null (exactly one of the two), cartRef, issuedAt, expiresAt, nonce
Issued bythe module's admin application, to a signed-in administrator with access to the modulethe module's storefront application, to the browser holding the storefront session
Provesthis browser is in this shop's admin panel nowthis browser holds this storefront session, cart and customer or guest

Rules for both: at most 120 seconds from issuedAt to expiresAt (the module issues 90); the API refuses a pass after expiresAt or issued more than 300 seconds ahead; the nonce (16 to 64 characters, at least 16 random bytes) is used once per connection, recorded atomically by the API, so a second exchange answers PASS_REPLAYED and a lost answer is recovered with a new pass; ids only, never a credential, cookie, name, email or phone; a pass of a revoked or replaced connection fails because the secret changed; the payload repeats the audience and the verifier refuses a pass whose audience disagrees with the prefix it verified under.

Module routes (OpenCart 3) ​

Follows the module's structure since 13 October (extension/module/storedeputy in the admin, extension/storedeputy/{backend,frontend} in the catalog) and replaces the name extension/module/storedeputy/storefront/pass above, which predates it. POST only, JSON in and out, Cache-Control: no-store, plain HTTP status codes (these are browser routes, not signed protocol answers).

RouteChecksAnswer
admin index.php?route=extension/module/storedeputy/pass&user_token=…admin session and user_token; permission access on the module; Origin present and equal to the admin's own origin; connection active; admin chat enabled; not paused; 30 per minute per session, 60 per address200 { pass, expiresAt }; 403 forbidden | invalid_origin; 409 not_connected | chat_disabled | paused; 429 rate_limited
catalog index.php?route=extension/module/storedeputy/passstorefront session cookie (identity only from the server session, STOR-40); Origin equal to this storefront's origin, with SameSite on the session cookie as the CSRF measure; connection active; shopper agent enabled for this storefront; not paused; 10 per minute per session, 60 per addressthe same shape

index.php?route=extension/storedeputy/frontend itself is not a pass route: it is the future storefront-side protocol endpoint the API will send storefront operations to, named per storefront in the manifest (store.storefronts[].endpoint, STOR-68). The module ships no Bridle loader of its own; the unreferenced admin/view/javascript/storedeputy/storedeputy.js, which builds a script tag for bridle.cleanslice.org/sdk/latest.js, predates this contract and should go.

Store Deputy API routes ​

RouteWho calls itDoes
POST /v1/embedded/admin/authorizethe app page in the popup, signed inchecks live membership of the connection's team; issues a one-time code (2 minutes, only its hash stored, bound to the person, the connection and an S256 challenge)
POST /v1/embedded/admin/check { pass }the embedded page, before it offers sign-inread-only: verifies the pass like the exchange but does not record its nonce, and answers { state: 'connected' } or STORE_NOT_CONNECTED / STORE_PAUSED; the page then shows that in place instead of sending the person to the popup
POST /v1/embedded/admin/session { pass }the embedded page, after the check, no sign-inproposed 9 November 2026 (see the admin link): with a link for the pass's admin account, answers a chat session from the pass alone; without one, EMBEDDED_LINK_MISSING (404) and the pass is not used up
POST /v1/embedded/admin/exchange { pass, code, codeVerifier }the embedded pageverifies the pass (signature, schema, time, nonce), consumes the code atomically, checks the verifier, that the code's connection is the pass's, membership, team block, Pause (the agent's state is not checked); the person's conversation for the store is bound on the first chat request, exactly as the app chat does; answers { chatToken, expiresAt, teamId, storeId, parentOrigin }
POST /v1/embedded/admin/refresh { pass, chatToken }the embedded page, before the session endsa new pass proves the admin session is alive, the token proves the identity; no popup
POST /v1/embedded/shopper/exchange { pass }the embedded page on a storefrontbuilt (STOR-107) and used by the shopper page; proven with the fake Agentfy only
existing …/teams/{teamId}/stores/{storeId}/chat…the embedded pagewith Authorization: Bearer <chatToken>, accepted only there and only for its own team and store; membership, team block, connection, Pause and agent state are rechecked on every request

The chat token is opaque to the browser and lives 30 minutes, in memory and in the iframe's own sessionStorage (that browser tab only, never the pass or the code): coming back to the module's page in the same tab renews it with a fresh pass, for the same shop administrator, instead of a new sign-in. Errors: PASS_INVALID (400, one code for shape, schema and signature), PASS_EXPIRED (400), PASS_REPLAYED (409), PASS_AUDIENCE (400), STORE_NOT_CONNECTED (409), STORE_PAUSED (409), STOREFRONT_UNKNOWN (400), INVALID_EMBEDDED_GRANT (400, the code), CHAT_SESSION_INVALID (401), FEATURE_NOT_INCLUDED (409), and the existing PERMISSION_DENIED, TEAM_BLOCKED. The admin exchange and the refresh do not check the agent's state (29 October 2026): AGENT_NOT_READY, AGENT_PAUSED and PLAN_LIMIT_REACHED come from the chat routes on every message, so the page waits for an agent that is still being created without asking for a new sign-in.

FEATURE_NOT_INCLUDED (11 November 2026, STOR-112; built, proven only with the fake Agentfy): a plan has a switch "includes the storefront agent" (on for every plan unless an operator switches it off by hand). On a plan without it the shopper exchange, every shopper chat route of an already open chat, and creating the storefront agent answer 409 FEATURE_NOT_INCLUDED with details.feature = "storefrontAgent". The agent is not deleted from Agentfy: it works again as soon as the team's plan includes the switch. The shopper page shows it as "unavailable", and the store's Storefront Agent tab in the app explains it in place of the create button.

Limits and topic check on the shopper agent (11 November 2026, STOR-136; built, proven only with the fake Agentfy and unit tests, never against a live Agentfy or a real storefront). The shopper chat is open to any anonymous visitor, so a plain off-topic question (an essay, a song, code) would be answered at the store's and our expense. Three layers keep it to the store. (1) The agent's instructions: it answers only about this store (products, orders, delivery, payment, returns, policies, helping choose a purchase, gift ideas from the catalog) and politely refuses the rest. (2) Hard limits set per plan in the admin console, each a whole number where empty means no limit: the longest message (default 1000 characters), messages per shopper conversation per hour (20) and per UTC day (60), and shopper messages per store per UTC day (500). They are counted in the database, under one lock per store, so they hold across API replicas. A message that is too long is refused 422 and not counted; a used up count is refused 429, with details.retryAfterSeconds; both answer SHOPPER_LIMIT_REACHED with details.limit (messageLength, conversationHour, conversationDay, storeDay) and details.max. The shopper page shows a plain text for each and suggests contacting the store; the chat stays usable. (3) A topic check through Agentfy: before the message is relayed, a small guard agent (same Agentfy team as the store's agents, so its cost lands on that team; no tools; the model set in the admin console, Settings, Agents) says whether the message is about shopping in this store. It is lenient (gifts, sizes, delivery, greetings and small talk that leads to shopping pass). A message it refuses is counted against the limits, is not sent to the storefront agent, and is answered 201 with status: "refused", refusal: "offTopic" and no run; the page shows a note from the assistant. The check fails open: a guard that is off (platform switch), not made yet, slower than 6 seconds, broken or that answers something that is not a verdict lets the message through. Each check is a fresh guest conversation carrying only the store name and the message. The guard is itself a model reading untrusted text, so it can be fooled by a crafted message; the limits and the agent's own instructions are the other layers. The Admin Agent has no hard limits and its tools are untouched; it has a soft rule in its instructions and, since 16 November 2026 (STOR-149, below), the same topic check with a softer rule. The tokens and cost Agentfy reports per finished turn (for the Admin Agent, the storefront agent and the guard) are collected by a background job and shown in the admin console on a client's card, and today's shopper messages against the store's daily limit and the refusals on the owner's Storefront Agent tab.

Topic check on the Admin Agent (16 November 2026, STOR-149; built, proven only with the fake Agentfy and unit tests, never against a live Agentfy, a language model or a real store). It changes the decision of 11 November that the Admin Agent has instructions only: the team's messages to it are now judged by the same guard agent before the Admin Agent sees them, so it answers only about the store. Nothing else of the Admin Agent changes (its tools, egress and profile grants stay as they are). The guard receives the message under the header Team message: instead of Shopper message: and applies a softer rule: anything about running the store passes (catalog, prices, stock, orders, customers, texts for products and the site, emails to suppliers and customers, marketing, reports, files and attachments, questions about Store Deputy and what the agent can do, greetings that lead into work), and when in doubt it passes, because the team is a paying customer and a refused real task is worse than a missed essay. An essay, homework, a song or poem not meant for the store, unrelated code and general questions are refused. A refused message is not sent to the Admin Agent and does not use the plan's monthly messages; the run answers status: "refused", reason: "offTopic" with no run id, the chat shows a note from Store Deputy in the person's language saying this is not about the store and what the agent can do, and the message and the note stay in the conversation's history after a reload. Refusals are counted for the admin console (the Admin Agent row of the usage table). The check fails open exactly like the shopper one, a message with only attachments is not checked, and a message with text and attachments is checked by its text. A platform admin turns it on or off in the admin console, Settings, Agents (adminTopicCheck, on by default), separately from the shopper switch. The guard is still a model reading untrusted text and can be fooled; the skill tells it the message is data and not to follow instructions in it.

Where Bridle runs ​

Recommended: an iframe served by the Store Deputy app ({app_url}/embedded/admin-chat and /embedded/shopper-chat, connection id in the query; the module's Activity tab embeds /embedded/admin-activity the same way, which shows the agent's activity to the team's owners and admins). The optional query parameter lang (en, uk or ru) opens the page in the shop admin's language for that view only, without changing the language saved on the site. The pass and the chat token then live in the app's origin, out of reach of the shop page's scripts and other extensions; Bridle loads inside our page from the immutable release with SRI, or is the UI the app already vendors; the API's CORS stays as it is; the login popup is the same origin as the iframe, so the one-time code never crosses an origin: the popup hands it over with window.opener.postMessage, the app's own origin as the exact targetOrigin, and the iframe accepts it only from that origin, from the window it opened and with its own state. The shop page only creates the iframe, fetches passes from its own route and hands them over (postMessage, messages pass, ready, pass_needed, state, all under protocol: "sd-embedded/1"; our names, not Bridle's). A collapsible corner panel (STOR-102) also tells the iframe with active ({ protocol: "sd-embedded/1", type: "active", active: boolean }) whether the panel is shown or collapsed: while active: false the iframe stops polling the waiting-proposals count and does not renew the session, and on active: true it refreshes the count at once. If the parent never sends active, the iframe assumes it is active; the module's own always-open window on the module page need not send it. It relieves the request volume when several of a shop's admins share one client address. A script inline in the shop page is the rejected alternative: shared memory with every other script of the page, per-store CORS on the API, a cross-origin code hand-over and CSP work on every shop.

Bridle interface check (16 October 2026, STOR-61). The published SDK @cleanslice/bridle (npm 0.12.0 to 0.13.3: a web component and a headless client) speaks only the Bridle Socket.IO hub protocol (apiUrl, agentId, a hub JWT) and offers no transport hook, so it cannot carry Store Deputy's own chat routes. bridle.cleanslice.org/sdk/latest.js is mutable; versioned builds exist on unpkg and jsDelivr. Therefore the embedded page uses the Bridle UI the app vendors, with Store Deputy's transport, which also keeps the 11 October rule "UI reuse, not the hub transport". Implemented locally in app/slices/agent/embeddedChat; not run against a real shop.

Flow in the admin panel: iframe ready → the page sends a pass → the person clicks "Sign in to Store Deputy" → popup signs in and calls authorize → the code reaches the iframe inside the app origin → exchange → chat → refresh with a fresh pass before 30 minutes end. A lost exchange answer means a new pass and the popup again (one click with a live app session); the API never returns a chat token for a code twice. Pause, a lost role, a replaced connection or a team block end the session at the next request.

What was wrong. The chat inside the OpenCart admin asked the person to sign in to Store Deputy in a popup every time: right after they had connected the store, again after 30 minutes, again when the Store Deputy browser session ended, and the popup then wanted a second click on "Continue".

What the proposal does. An OpenCart admin account is linked, per connection, to the Store Deputy person who authorized it, and while the link exists the shop's signed admin pass alone opens that person's chat.

  • At Connect. The module sends the ocUserId of the administrator who pressed Connect in the Connect exchange (optional, ^[0-9]{1,20}$). When the connection is confirmed, that admin is linked to the person who approved Connect. A module that does not send it makes no link.
  • Other admins sign in once. The popup's exchange makes the same link for the pass's ocUserId; after that there is no popup again, whatever happens to the 30-minute token or to the Store Deputy browser session. The latest link of (connection, admin) wins: the same person keeps the link, another person replaces it and ends the first person's open tokens.
  • POST /v1/embedded/admin/session { pass }. Public and rate-limited. The pass is verified as at the exchange. With a link, a store that is connected and not paused, an active person who is still a member of the team and a team that is not blocked, it answers a chat session. Without a link it answers EMBEDDED_LINK_MISSING (404) without using the pass's nonce up, so the same pass still serves the popup's exchange; the page then shows its sign-in card. A linked person who left the team loses the link at that moment and gets the same answer.
  • The linked token carries the link's id (lnk) instead of the Store Deputy session id (sid). refresh and every chat request check that the link still exists and names the same person, connection, store and team; signing out of Store Deputy does not end it, removing the link does.
  • The popup without the extra click. A person who is already signed in gets their one-time code at once and the window closes; one who is not sees the sign-in form and then the same. A click is needed only to try again after a failure.
  • While the agent is being created the chat shows its "preparing" state, as after any exchange, never the sign-in card.
  • Seeing and removing links. GET /v1/teams/{teamId}/stores/{storeId}/embedded-links (an owner or admin sees all, a member only their own) and DELETE …/embedded-links/{linkId} (an owner or admin any, a member their own); the store page lists them under the Admin Agent. Links also end when the store is disconnected or Connect is run again (new connection), when the person's password is reset, and the first time they are used after the person left the team.

The trust change, said plainly. Before, whoever held a pass still needed the person's Store Deputy sign-in. Now whoever controls the shop's module secret (it signs the pass), or the logged-in OpenCart admin account that is linked, gets the linked person's chat on this one store, with that person's role in the team, including approving price changes if that role may, until the link is removed. The link is per store and per OpenCart admin account; it never opens the person's other stores or the Store Deputy site.

Status. A proposal, pending the founder's and Artem's agreement (the module change is one optional field in the Connect exchange request). It is implemented in the API, the site and the OpenCart 3 and 4 modules and proven only with the fake driver and the fake Agentfy in the API's embeddedAdminLink suite, the site's unit tests and the e2e/ browser run with a fake shop. It has not run against the module on a real shop, a real OpenCart admin session or a real Agentfy. Machine-readable: contracts/embedded/passes.yaml (admin_session, admin_links).

Open for agreement ​

With Artem: the two route names; Origin plus SameSite as the storefront CSRF measure or an extra token in the page; how cartRef and sessionRef are derived and mapped back (STOR-40/41); rate-limit numbers and where the counters live; removing the latest.js loader. With the founder: the iframe served by the app versus a script in the page; 120 seconds for a pass, 30 minutes for a chat session, refresh without a popup; Pause ending embedded access.

The shopper's page (10 November 2026, STOR-133) ​

{app_url}/embedded/shopper-chat is the page a storefront page puts in an iframe, for a shopper who is anonymous or a store customer: no Store Deputy sign-in and no popup. It tells the storefront page ready, receives the shopper pass the module signs (postMessage, protocol: "sd-embedded/1"), exchanges it for a chat token (POST /v1/embedded/shopper/exchange) and chats with the store's shopper agent through the shopper routes (POST /v1/embedded/shopper/chat, its event stream and GET …/chat/history). It accepts a pass only from the window that embeds it, then only from the storefront origin the exchange names, and refuses a session whose origin is not the one that sent the pass. The token lives in the page's memory only. There is no refresh for a shopper: before the token ends, or when the API says the session is over (the shopper logged in or out, a new visit), the page sends pass_needed and exchanges the new pass; a message refused for that reason is sent again once. A store that is not connected or is paused, a team that is blocked, a plan without the shopper agent and an agent that is still being created are shown in plain words (the last one is retried by itself). There are no approvals, no list of past chats and no file attachments for a shopper. The optional lang query parameter applies as on the admin page. A reference storefront loader is contracts/embedded/shopper-loader.example.js (for the module's STOR-29). Cart changes (23 November 2026, STOR-155). After every change of the shopper's cart or checkout that the shop confirmed, the page sends the storefront page { protocol: "sd-embedded/1", type: "cart_changed" }, so the storefront can refresh its mini-cart and totals (the module does, STOR-36). Confirmed means the shop's own answer: outcome applied from cart_add_item, cart_update_item, cart_remove_item and checkout_update, outcome placed from checkout_place. A call that merely succeeded (outcome conflict, rejected, not_found or handoff), a failed call, a read, the model's words and the loading of the earlier conversation send nothing. The API decides: the shopper's event stream marks a finished cart tool call (tool_result with ok: true, or tool.finished succeeded; the tool name may carry a server prefix) cartChanged: true only when the journal of the conversation's MCP calls holds a shop-confirmed change that was not yet reported, and the page forwards one message per marked event, only to the storefront origin the exchange named. (26 November 2026, STOR-167: the first version matched the journal by Agentfy's tool call id, but the live run stream's tool_result carries no id and its tool_call.id differs from the X-Agentfy-Tool-Call-Id of the MCP request, so on a real storefront nothing was ever marked. Now the newest confirmed change of the conversation is taken and a per-conversation cursor makes each change count once, however often the stream is replayed or read by two tabs; two changes in one answer give at least one message, and the page refreshes the whole cart anyway.) The message carries no data; the page asks the shop for the cart. Proven with the fake Agentfy, which now streams the live event shapes, and unit tests; not yet against a live Agentfy or a real storefront. Status: built and unit-tested locally only; it has not run in a browser against a real storefront, the module's pass route or a real Agentfy.

End-to-end check (16 October 2026, STOR-64) ​

e2e/ drives a real Chromium: a fake shop admin page embeds /embedded/admin-chat with the reference loader (contracts/embedded/parent-loader.example.js), hands it signed passes, the person signs in in the popup, approves and chats. Replayed, expired, shopper-prefixed and foreign passes, a non-member, a removed member, ended sessions, Pause, disconnect, a blocked popup, a reload and a price proposal (its card and the Approvals button appear in the embedded page since 29 October 2026; the scenario was updated but not run again) are covered (bun run embedded:e2e, see e2e/README.md). It proves the API, the site and the browser chain with fakes only: the shop is a fake module in the test, the agent is the scripted fake Agentfy. No real OpenCart (STOR-62 is not built) and no real Agentfy were involved, and the run is local.

Price change approvals in the admin chat (29 October 2026) ​

Price change approvals in the admin chat (29 October 2026). The admin chat token may also read and decide this store's price changes, so the embedded page shows the proposal card inline at the end of the turn that made it and the composer's Approvals button with the waiting count, as the site's chat page does. Only an owner or admin decides; the session tells the page the person's role and the API checks it on every decision. This is implemented only locally; it is proven against the local test shops only once the API's suite embeddedChat has been run on them, which has not happened yet, and it has not run in a real browser, against a real shop or a real Agentfy.

Earlier chats (29 October 2026). The admin chat token may also list and read the person's own earlier conversations with this store's agent, so the embedded page has a History button next to New chat and shows an old conversation read-only; routes GET …/chat/conversations and GET …/chat/conversations/{id}/messages, only the person's own, others answer 404. Tool calls do not appear in an old conversation: Agentfy's history does not carry them. This is implemented only locally; the API's cases in the embeddedChat suite have not been run, and nothing ran in a real browser, against a real shop or a real Agentfy. Many chats at once (29 October 2026). A person may have any number of conversations with the same store agent, all writable, each its own conversation for the agent: the token creates one (POST …/chat/conversations), writes into it (POST …/chat/conversations/{id}/runs), archives and restores it (…/archive, …/restore) and lists them, newest activity first, for the store or across the team (GET /v1/teams/{teamId}/chat/conversations, its own team only). A conversation with no message for the agent's chat session length (default 7 days, 0 = never) is archived, not deleted. The agent answers one turn at a time, so a message sent while it answers in another chat waits (status queued) and is sent when it is free. The old routes without a conversation remain as deprecated aliases. Implemented only locally; its API case has not been run, and nothing ran in a real browser, against a real shop or a real Agentfy.

Admin login ​

Open Store Deputy login in a popup. Return a one-time authorization code bound to the initiating flow (state/PKCE), then exchange for a shop-scoped admin-chat token, not a general account token. Validate exact postMessage origin, source window, schema and state; set an exact targetOrigin. Handle blocked/closed popups and page reload.

Keep chat tokens in memory or the iframe's own sessionStorage, not localStorage. Memory in an inline widget is not isolation from shop-page scripts. A chat iframe on a separate origin can isolate its memory while login still uses a popup; the isolation choice remains open. Do not rely on third-party cookies for embedded login.

Decisions before implementation ​

STOR-60, Yevhen with Artem: exact endpoints/JSON, pass and session TTL, single-use/retry semantics, logout/revocation propagation, allowed origins, script versus iframe, version updates and Bridle SDK compatibility. A 60–120 second exchange pass is a proposal, not a fixed limit. The earlier 15-minute pass sent with every message is a historical draft, not the newly agreed wire contract.

STOR-31 must verify real Agentfy visitor conversations and trusted shopper tool context. The completed employee flow does not prove this capability. Record evidence or a precise upstream blocker; do not bypass it by granting shoppers admin/team identity.

Store connection via authorization code/PKCE is a separate migration. These chat tasks do not change current pairing or remove trust-key checks.

Delivery and ownership ​

TaskOwnerScope
STOR-60YevhenContract and fixtures
STOR-61YevhenBridle adapter
STOR-62ArtemOpenCart admin widget and pass
STOR-63YevhenAdmin authentication
STOR-64YevhenAdmin E2E
STOR-29 / STOR-30Artem / YevhenShopper bootstrap and session
STOR-31YevhenAgentfy visitor support
STOR-36 / STOR-37Artem / YevhenCart synchronization and shopper E2E

Start with the admin widget, then the shopper flow. New tasks remain Backlog; this does not silently expand the pilot scope. PHP tasks belong to Artem; API, adapter and E2E tasks belong to Yevhen. Existing STOR-40/41 readers are reused.

Acceptance must distinguish fake tests from real OpenCart/Agentfy runs. Cover concurrent shops/users, pass audience confusion, replay/expiry, CSRF, revoked membership/subscription/connection, cart merge and logout in several tabs, reconnect, lost exchange response, blocked popup and CDN/API/SRI failures. No write without the existing approval mechanism.