@burdenoff/microfe-healthybowl 2026.1007.2 → 2026.1008.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistantUsecases.js","names":[],"sources":["../../src/config/assistantUsecases.ts"],"sourcesContent":["/**\n * HealthyBowl AI Assistant usecases.\n *\n * `AssistantUsecaseId` is the full set of modes the transport/runtime\n * understands — it drives the image/resource switches in `services/assistantApi`.\n * `ASSISTANT_USECASE_CONFIG` is the set of modes the panel KNOWS about; the mode\n * selector further filters them at runtime by the user's role (see\n * `useAssistantApiAccess`) so a write-capable mode only appears for org admins.\n * - `general` — docs Q&A (proxy-token auth, available to everyone).\n * - `api-calls` — WRITE-CAPABLE: the agent executes GraphQL on the user's\n * behalf (app-client-credentials auth). Minting its per-sandbox OAuth app\n * requires a global Owner/Admin actor, so it is gated to admins, guarded by a\n * confirm-before-mutate dialog + a soft agent preamble, and master-flagged.\n * - `vibe-plugins` — a VibeControls-only concept HealthyBowl never exposes.\n */\n\n// Full set of runtime-understood modes. Keep in sync with the image/resource\n// switches in `services/assistantApi.ts`.\nexport type AssistantUsecaseId = 'general' | 'assistant' | 'api-calls' | 'vibe-plugins';\n\nexport interface AssistantUsecase {\n id: AssistantUsecaseId;\n label: string;\n description: string;\n suggestions: readonly string[];\n /** Only offered to a global Owner/Admin (minting the OAuth app needs admin). */\n requiresAdmin?: boolean;\n /** Executes mutations on live data → triggers the confirm-before-mutate guard. */\n writeCapable?: boolean;\n}\n\n/**\n * Master switch for the write-capable `api-calls` (\"Actions\") mode. Enabled on\n * ALL environments (alpha + production) as of 2026-06-30, by explicit product\n * decision. The mode remains gated by: (1) the admin check — only org\n * Owners/Admins ever see it (useAssistantApiAccess), (2) a one-time consent\n * dialog, (3) the user's approval of each write — since 2026-09-07 the sandbox\n * refuses a mutation and holds it until the user presses Approve on the\n * pending-write card (ai-assistant #41/#42, fe-libs #194), and the model holds\n * no token that could send it — and (4) a describe-and-confirm instruction\n * prepended to the prompt, which is advisory. The approval is recorded inside\n * the sandbox, so it stops an accidental or misread write; it is not a wall\n * against a model set on getting round it.\n *\n * `typeof window` keeps it false during any non-browser evaluation; in the\n * browser it's always on (the admin gate is the real boundary).\n */\nexport const API_CALLS_MODE_ENABLED = typeof window !== 'undefined';\n\n// Default \"Ask\" for EVERY user: docs Q&A + READ-ONLY live data. Unlike\n// `api-calls` it authenticates with the user's OWN forwarded token (no\n// admin-gated OAuth-app mint), and the in-sandbox helper rejects mutations\n// (AI_ASSISTANT_READONLY) — so it needs no admin and answers questions like\n// \"list my livestock\" against real data. Writes live in `api-calls` below.\nconst ASSISTANT: AssistantUsecase = {\n id: 'assistant',\n label: 'Ask',\n description:\n 'Ask about HealthyBowl and your own farm data — crops, livestock, weather, finances. Reads your live records; use \"Take action\" to make changes.',\n suggestions: [\n 'List all my livestock',\n 'How many crops do I have?',\n 'Explain the livestock health tracker',\n 'What government schemes can I apply for?',\n ],\n};\n\nconst API_CALLS: AssistantUsecase = {\n id: 'api-calls',\n // Display label only — the mode ID stays 'api-calls' (see services/assistantApi).\n label: 'Take action',\n description:\n 'Let the assistant take actions for you — add crops, log harvests, update records. It describes what it will do and asks before changing anything.',\n suggestions: [\n 'Add a new crop',\n 'Log a harvest for one of my fields',\n 'List all my livestock',\n \"Update a crop's status\",\n ],\n writeCapable: true,\n};\n\n// Modes the panel knows about. The default \"Ask\" is now the read-only\n// `assistant` mode (docs + live data, available to everyone). `api-calls`\n// (\"Take action\", write) is added when enabled and further filtered to admins\n// at runtime by the mode selector. `general` (docs-only) is retained in the\n// type for back-compat with persisted conversations but no longer surfaced.\nexport const ASSISTANT_USECASE_CONFIG: readonly AssistantUsecase[] = API_CALLS_MODE_ENABLED\n ? [ASSISTANT, API_CALLS]\n : [ASSISTANT];\n"],"mappings":";AA+CA,IAAa,IAAyB,OAAO,SAAW,KAOlD,IAA8B;CAClC,IAAI;CACJ,OAAO;CACP,aACE;CACF,aAAa;EACX;EACA;EACA;EACA;CACF;AACF,GAsBa,IAAwD,IACjE,CAAC,GAAW;CApBd,IAAI;CAEJ,OAAO;CACP,aACE;CACF,aAAa;EACX;EACA;EACA;EACA;CACF;CACA,cAAc;AASA,CAAS,IACrB,CAAC,CAAS"}
|
|
1
|
+
{"version":3,"file":"assistantUsecases.js","names":[],"sources":["../../src/config/assistantUsecases.ts"],"sourcesContent":["/**\n * HealthyBowl AI Assistant usecases.\n *\n * `AssistantUsecaseId` is the full set of modes the transport/runtime\n * understands — it drives the image/resource switches in `services/assistantApi`.\n * `ASSISTANT_USECASE_CONFIG` is the set of modes the panel KNOWS about; the mode\n * selector further filters them at runtime by the user's role (see\n * `useAssistantApiAccess`) so a write-capable mode only appears for org admins.\n * - `general` — docs Q&A (proxy-token auth, available to everyone).\n * - `api-calls` — WRITE-CAPABLE: the agent executes GraphQL on the user's\n * behalf (app-client-credentials auth). Minting its per-sandbox OAuth app\n * requires a global Owner/Admin actor, so it is gated to admins, guarded by a\n * confirm-before-mutate dialog + a soft agent preamble, and master-flagged.\n * - `vibe-plugins` — a VibeControls-only concept HealthyBowl never exposes.\n */\n\n// Full set of runtime-understood modes. Keep in sync with the image/resource\n// switches in `services/assistantApi.ts`.\nexport type AssistantUsecaseId = 'general' | 'assistant' | 'api-calls' | 'vibe-plugins';\n\nexport interface AssistantUsecase {\n id: AssistantUsecaseId;\n label: string;\n description: string;\n suggestions: readonly string[];\n /** Only offered to a global Owner/Admin (minting the OAuth app needs admin). */\n requiresAdmin?: boolean;\n /** Executes mutations on live data → triggers the confirm-before-mutate guard. */\n writeCapable?: boolean;\n}\n\n/**\n * Master switch for the write-capable `api-calls` (\"Actions\") mode. Enabled on\n * ALL environments (alpha + production) as of 2026-06-30, by explicit product\n * decision. The mode remains gated by: (1) the admin check — only org\n * Owners/Admins ever see it (useAssistantApiAccess), (2) a one-time consent\n * dialog, (3) the user's approval of each write — since 2026-09-07 the sandbox\n * refuses a mutation and holds it until the user presses Approve on the\n * pending-write card (ai-assistant #41/#42, fe-libs #194), and the model holds\n * no token that could send it — and (4) a describe-and-confirm instruction\n * prepended to the prompt, which is advisory. The approval is recorded inside\n * the sandbox, so it stops an accidental or misread write; it is not a wall\n * against a model set on getting round it.\n *\n * `typeof window` keeps it false during any non-browser evaluation; in the\n * browser it's always on (the admin gate is the real boundary).\n */\nexport const API_CALLS_MODE_ENABLED = typeof window !== 'undefined';\n\n// Default \"Ask\" for EVERY user: docs Q&A + READ-ONLY live data. Unlike\n// `api-calls` it authenticates with the user's OWN forwarded token (no\n// admin-gated OAuth-app mint), and the in-sandbox helper rejects mutations\n// (AI_ASSISTANT_READONLY) — so it needs no admin and answers questions like\n// \"list my livestock\" against real data. Writes live in `api-calls` below.\nconst ASSISTANT: AssistantUsecase = {\n id: 'assistant',\n label: 'Ask',\n description:\n 'Ask about HealthyBowl and your own farm data — crops, livestock, weather, finances. Reads your live records; use \"Take action\" to make changes.',\n suggestions: [\n 'List all my livestock',\n 'How many crops do I have?',\n 'Explain the livestock health tracker',\n 'What government schemes can I apply for?',\n ],\n};\n\nconst API_CALLS: AssistantUsecase = {\n id: 'api-calls',\n // Display label only — the mode ID stays 'api-calls' (see services/assistantApi).\n label: 'Take action',\n description:\n 'Let the assistant take actions for you — add crops, log harvests, update records. It describes what it will do and asks before changing anything.',\n suggestions: [\n 'Add a new crop',\n 'Log a harvest for one of my fields',\n 'List all my livestock',\n \"Update a crop's status\",\n ],\n writeCapable: true,\n};\n\n// Modes the panel knows about. The default \"Ask\" is now the read-only\n// `assistant` mode (docs + live data, available to everyone). `api-calls`\n// (\"Take action\", write) is added when enabled and further filtered to admins\n// at runtime by the mode selector. `general` (docs-only) is retained in the\n// type for back-compat with persisted conversations but no longer surfaced.\nexport const ASSISTANT_USECASE_CONFIG: readonly AssistantUsecase[] = API_CALLS_MODE_ENABLED\n ? [ASSISTANT, API_CALLS]\n : [ASSISTANT];\n\n/**\n * Every mode's product copy (label, description, suggestion chips), regardless of the runtime\n * gate above. The app's i18n extractor reads THIS, not `ASSISTANT_USECASE_CONFIG`, because it runs\n * outside a browser where the gate is false and `api-calls` would be silently omitted, which\n * would deprecate its translated copy at the next seed (BOFF-8851 H2).\n */\nexport const ASSISTANT_USECASES_ALL: readonly AssistantUsecase[] = [ASSISTANT, API_CALLS];\n"],"mappings":";AA+CA,IAAa,IAAyB,OAAO,SAAW,KAOlD,IAA8B;CAClC,IAAI;CACJ,OAAO;CACP,aACE;CACF,aAAa;EACX;EACA;EACA;EACA;CACF;AACF,GAsBa,IAAwD,IACjE,CAAC,GAAW;CApBd,IAAI;CAEJ,OAAO;CACP,aACE;CACF,aAAa;EACX;EACA;EACA;EACA;CACF;CACA,cAAc;AASA,CAAS,IACrB,CAAC,CAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageContext.js","names":[],"sources":["../../src/utils/pageContext.ts"],"sourcesContent":["/**\n * Page context gathering — captures the user's current browser context to send\n * alongside every assistant prompt so the agent is aware of where the user is.\n *\n * Only keys the ai-assistant agent's context-loader allow-lists are emitted\n * (currentUrl / currentPage / entityType / entityId / …); anything else is\n * dropped server-side. entityType/entityId are resolved from the HealthyBowl\n * route by matching the pathname SUFFIX, because the MFE mounts under a\n * host-controlled base path (…/healthybowl/…) rather than a fixed prefix.\n */\n\n/**\n * ★ A type ALIAS, not an interface, and that distinction is load-bearing.\n *\n * The shared `PageContext` carries `[key: string]: unknown` so the transport can\n * pass a product's extra keys through untouched. TypeScript grants an implicit\n * index signature to object type aliases but NOT to interfaces, so as an\n * `interface` this shape was rejected where the seam expects the shared one —\n * despite being a strict superset of it. Nothing about the fields changed.\n */\nexport type PageContext = {\n currentUrl: string;\n currentPage: string;\n platform: string;\n entityType?: string;\n entityId?: string;\n viewportSize: string;\n version: string;\n timestamp: string;\n};\n\n// HealthyBowl detail routes → entityType. Matched on the pathname SUFFIX, so the\n// host base path / workspace segment is irrelevant. Order: most specific first.\n// The single-segment matchers (crops/:id, marketplace/:id) negative-lookahead\n// their STATIC sibling list-routes (crops/{fields,planning,harvest} and\n// marketplace/{cart,wishlist,orders} — see HealthyBowlRoutes.tsx) so a list page\n// like /crops/fields isn't mis-tagged as a crop with a fabricated entityId\n// \"fields\". Keep the exclusions in sync if new static sub-routes are added under\n// those parents.\n//\n// ORDER IS LOAD-BEARING in one more place: /compliance/ics/growers/:id also matches the ICS GROUP\n// pattern, so growers are listed first AND the group pattern excludes them. Get that wrong and the\n// agent is handed a group whose id is the literal string \"growers\" — a fabricated entity it will\n// then confidently try to explain. That is the failure mode this whole resolver exists to avoid:\n// a wrong entity is worse than no entity, because no entity merely costs a follow-up question.\n//\n// Two routes deliberately map to an entity they do not name: /satellite/:fieldId is a field seen\n// through a different lens, and /livestock/records/:animalId is the same animal as\n// /livestock/animals/:animalId. Resolving them to FIELD and ANIMAL is what lets \"explain this\"\n// work on those pages at all.\nconst HB_ENTITY_ROUTES: ReadonlyArray<readonly [RegExp, string]> = [\n // ── Crops ─────────────────────────────────────────────────────────────────\n [/\\/crops\\/fields\\/([^/]+)\\/?$/, 'HEALTHYBOWL_FIELD'],\n [/\\/crops\\/planning\\/([^/]+)\\/?$/, 'HEALTHYBOWL_PLAN'],\n [/\\/crops\\/harvest\\/([^/]+)\\/?$/, 'HEALTHYBOWL_HARVEST'],\n [/\\/crops\\/(?!fields\\/?$|planning\\/?$|harvest\\/?$)([^/]+)\\/?$/, 'HEALTHYBOWL_CROP'],\n // A field seen through the satellite lens is still that field — the agent should be able to\n // answer \"explain this\" here without asking which field the user means.\n [/\\/satellite\\/([^/]+)\\/?$/, 'HEALTHYBOWL_FIELD'],\n [/\\/garden\\/plantings\\/([^/]+)\\/?$/, 'HEALTHYBOWL_GARDEN_PLANTING'],\n\n // ── Livestock ─────────────────────────────────────────────────────────────\n [/\\/livestock\\/animals\\/([^/]+)\\/?$/, 'HEALTHYBOWL_ANIMAL'],\n // Same animal, different view. Both routes take an animalId, so both resolve to the animal.\n [/\\/livestock\\/records\\/([^/]+)\\/?$/, 'HEALTHYBOWL_ANIMAL'],\n\n // ── Compliance ────────────────────────────────────────────────────────────\n // Growers MUST be matched before groups. `/compliance/ics/growers/g-1` also matches the group\n // pattern, and would resolve to a group whose id is the literal string \"growers\" — a fabricated\n // entity the agent would then try to explain.\n [/\\/compliance\\/ics\\/growers\\/([^/]+)\\/?$/, 'HEALTHYBOWL_ICS_GROWER'],\n [/\\/compliance\\/ics\\/(?!growers\\/?$)([^/]+)\\/?$/, 'HEALTHYBOWL_ICS_GROUP'],\n [/\\/compliance\\/certifications\\/([^/]+)\\/?$/, 'HEALTHYBOWL_CERTIFICATION'],\n\n // ── Distribution, storage and the co-op ───────────────────────────────────\n [/\\/distribution\\/csa\\/([^/]+)\\/?$/, 'HEALTHYBOWL_CSA_PLAN'],\n [/\\/distribution\\/routes\\/([^/]+)\\/?$/, 'HEALTHYBOWL_DELIVERY_ROUTE'],\n [/\\/storage\\/lots\\/([^/]+)\\/?$/, 'HEALTHYBOWL_STORAGE_LOT'],\n [/\\/coop\\/lots\\/([^/]+)\\/?$/, 'HEALTHYBOWL_COOP_LOT'],\n [/\\/coop\\/members\\/([^/]+)\\/?$/, 'HEALTHYBOWL_COOP_MEMBERSHIP'],\n\n // ── Marketplace, money and people ─────────────────────────────────────────\n [/\\/marketplace\\/(?!cart\\/?$|wishlist\\/?$|orders\\/?$)([^/]+)\\/?$/, 'HEALTHYBOWL_MARKETPLACE_PRODUCT'],\n [/\\/inputs-insurance\\/claims\\/([^/]+)\\/?$/, 'HEALTHYBOWL_INSURANCE_CLAIM'],\n [/\\/government-schemes\\/schemes\\/([^/]+)\\/?$/, 'HEALTHYBOWL_SCHEME'],\n [/\\/contacts\\/([^/]+)\\/?$/, 'HEALTHYBOWL_CONTACT'],\n [/\\/consultant\\/clients\\/([^/]+)\\/?$/, 'HEALTHYBOWL_CLIENT_WORKSPACE'],\n [/\\/field-capture\\/conflicts\\/([^/]+)\\/?$/, 'HEALTHYBOWL_CAPTURE_CONFLICT'],\n];\n\nexport function resolveHealthyBowlEntity(pathname: string): {\n entityType?: string;\n entityId?: string;\n} {\n for (const [pattern, entityType] of HB_ENTITY_ROUTES) {\n const match = pathname.match(pattern);\n if (match) return { entityType, entityId: match[1] };\n }\n return {};\n}\n\n// Friendly display labels for the top HealthyBowl sections. Anything not listed\n// falls back to a title-cased version of the first path segment.\
|
|
1
|
+
{"version":3,"file":"pageContext.js","names":[],"sources":["../../src/utils/pageContext.ts"],"sourcesContent":["/**\n * Page context gathering — captures the user's current browser context to send\n * alongside every assistant prompt so the agent is aware of where the user is.\n *\n * Only keys the ai-assistant agent's context-loader allow-lists are emitted\n * (currentUrl / currentPage / entityType / entityId / …); anything else is\n * dropped server-side. entityType/entityId are resolved from the HealthyBowl\n * route by matching the pathname SUFFIX, because the MFE mounts under a\n * host-controlled base path (…/healthybowl/…) rather than a fixed prefix.\n */\n\n/**\n * ★ A type ALIAS, not an interface, and that distinction is load-bearing.\n *\n * The shared `PageContext` carries `[key: string]: unknown` so the transport can\n * pass a product's extra keys through untouched. TypeScript grants an implicit\n * index signature to object type aliases but NOT to interfaces, so as an\n * `interface` this shape was rejected where the seam expects the shared one —\n * despite being a strict superset of it. Nothing about the fields changed.\n */\nexport type PageContext = {\n currentUrl: string;\n currentPage: string;\n platform: string;\n entityType?: string;\n entityId?: string;\n viewportSize: string;\n version: string;\n timestamp: string;\n};\n\n// HealthyBowl detail routes → entityType. Matched on the pathname SUFFIX, so the\n// host base path / workspace segment is irrelevant. Order: most specific first.\n// The single-segment matchers (crops/:id, marketplace/:id) negative-lookahead\n// their STATIC sibling list-routes (crops/{fields,planning,harvest} and\n// marketplace/{cart,wishlist,orders} — see HealthyBowlRoutes.tsx) so a list page\n// like /crops/fields isn't mis-tagged as a crop with a fabricated entityId\n// \"fields\". Keep the exclusions in sync if new static sub-routes are added under\n// those parents.\n//\n// ORDER IS LOAD-BEARING in one more place: /compliance/ics/growers/:id also matches the ICS GROUP\n// pattern, so growers are listed first AND the group pattern excludes them. Get that wrong and the\n// agent is handed a group whose id is the literal string \"growers\" — a fabricated entity it will\n// then confidently try to explain. That is the failure mode this whole resolver exists to avoid:\n// a wrong entity is worse than no entity, because no entity merely costs a follow-up question.\n//\n// Two routes deliberately map to an entity they do not name: /satellite/:fieldId is a field seen\n// through a different lens, and /livestock/records/:animalId is the same animal as\n// /livestock/animals/:animalId. Resolving them to FIELD and ANIMAL is what lets \"explain this\"\n// work on those pages at all.\nconst HB_ENTITY_ROUTES: ReadonlyArray<readonly [RegExp, string]> = [\n // ── Crops ─────────────────────────────────────────────────────────────────\n [/\\/crops\\/fields\\/([^/]+)\\/?$/, 'HEALTHYBOWL_FIELD'],\n [/\\/crops\\/planning\\/([^/]+)\\/?$/, 'HEALTHYBOWL_PLAN'],\n [/\\/crops\\/harvest\\/([^/]+)\\/?$/, 'HEALTHYBOWL_HARVEST'],\n [/\\/crops\\/(?!fields\\/?$|planning\\/?$|harvest\\/?$)([^/]+)\\/?$/, 'HEALTHYBOWL_CROP'],\n // A field seen through the satellite lens is still that field — the agent should be able to\n // answer \"explain this\" here without asking which field the user means.\n [/\\/satellite\\/([^/]+)\\/?$/, 'HEALTHYBOWL_FIELD'],\n [/\\/garden\\/plantings\\/([^/]+)\\/?$/, 'HEALTHYBOWL_GARDEN_PLANTING'],\n\n // ── Livestock ─────────────────────────────────────────────────────────────\n [/\\/livestock\\/animals\\/([^/]+)\\/?$/, 'HEALTHYBOWL_ANIMAL'],\n // Same animal, different view. Both routes take an animalId, so both resolve to the animal.\n [/\\/livestock\\/records\\/([^/]+)\\/?$/, 'HEALTHYBOWL_ANIMAL'],\n\n // ── Compliance ────────────────────────────────────────────────────────────\n // Growers MUST be matched before groups. `/compliance/ics/growers/g-1` also matches the group\n // pattern, and would resolve to a group whose id is the literal string \"growers\" — a fabricated\n // entity the agent would then try to explain.\n [/\\/compliance\\/ics\\/growers\\/([^/]+)\\/?$/, 'HEALTHYBOWL_ICS_GROWER'],\n [/\\/compliance\\/ics\\/(?!growers\\/?$)([^/]+)\\/?$/, 'HEALTHYBOWL_ICS_GROUP'],\n [/\\/compliance\\/certifications\\/([^/]+)\\/?$/, 'HEALTHYBOWL_CERTIFICATION'],\n\n // ── Distribution, storage and the co-op ───────────────────────────────────\n [/\\/distribution\\/csa\\/([^/]+)\\/?$/, 'HEALTHYBOWL_CSA_PLAN'],\n [/\\/distribution\\/routes\\/([^/]+)\\/?$/, 'HEALTHYBOWL_DELIVERY_ROUTE'],\n [/\\/storage\\/lots\\/([^/]+)\\/?$/, 'HEALTHYBOWL_STORAGE_LOT'],\n [/\\/coop\\/lots\\/([^/]+)\\/?$/, 'HEALTHYBOWL_COOP_LOT'],\n [/\\/coop\\/members\\/([^/]+)\\/?$/, 'HEALTHYBOWL_COOP_MEMBERSHIP'],\n\n // ── Marketplace, money and people ─────────────────────────────────────────\n [/\\/marketplace\\/(?!cart\\/?$|wishlist\\/?$|orders\\/?$)([^/]+)\\/?$/, 'HEALTHYBOWL_MARKETPLACE_PRODUCT'],\n [/\\/inputs-insurance\\/claims\\/([^/]+)\\/?$/, 'HEALTHYBOWL_INSURANCE_CLAIM'],\n [/\\/government-schemes\\/schemes\\/([^/]+)\\/?$/, 'HEALTHYBOWL_SCHEME'],\n [/\\/contacts\\/([^/]+)\\/?$/, 'HEALTHYBOWL_CONTACT'],\n [/\\/consultant\\/clients\\/([^/]+)\\/?$/, 'HEALTHYBOWL_CLIENT_WORKSPACE'],\n [/\\/field-capture\\/conflicts\\/([^/]+)\\/?$/, 'HEALTHYBOWL_CAPTURE_CONFLICT'],\n];\n\nexport function resolveHealthyBowlEntity(pathname: string): {\n entityType?: string;\n entityId?: string;\n} {\n for (const [pattern, entityType] of HB_ENTITY_ROUTES) {\n const match = pathname.match(pattern);\n if (match) return { entityType, entityId: match[1] };\n }\n return {};\n}\n\n// Friendly display labels for the top HealthyBowl sections. Anything not listed\n// falls back to a title-cased version of the first path segment.\nexport const PAGE_LABELS: Readonly<Record<string, string>> = {\n home: 'Dashboard',\n crops: 'Crops',\n livestock: 'Livestock',\n marketplace: 'Marketplace',\n inventory: 'Inventory',\n weather: 'Weather',\n tasks: 'Farm Tasks',\n analytics: 'Analytics',\n consultant: 'Advisory',\n 'government-schemes': 'Government Schemes',\n 'market-prices': 'Market Prices',\n contracts: 'Contracts',\n};\n\n/**\n * A short, human-friendly label for the page the user is currently on — used by\n * the assistant header subtitle (\"Context: <page>\") and the empty state. Derived\n * from the same route parsing as `gatherPageContext`.\n */\nexport function describeCurrentPage(): string {\n const { currentPage } = gatherPageContext();\n const firstSegment = currentPage.split('/')[0] ?? '';\n if (!firstSegment || firstSegment === 'home') return PAGE_LABELS.home;\n return (\n PAGE_LABELS[firstSegment] ??\n firstSegment\n .split('-')\n .map((word) => (word ? word.charAt(0).toUpperCase() + word.slice(1) : word))\n .join(' ')\n );\n}\n\nexport function gatherPageContext(): PageContext {\n const pathname = window.location.pathname;\n const pathSegments = pathname.split('/').filter(Boolean);\n // Human-readable page label: the portion of the path after the `healthybowl`\n // mount segment, falling back to the trailing segments.\n const hbIndex = pathSegments.indexOf('healthybowl');\n const currentPage =\n (hbIndex >= 0 ? pathSegments.slice(hbIndex + 1, hbIndex + 4) : pathSegments.slice(-3)).join('/') || 'home';\n\n return {\n currentUrl: window.location.href,\n currentPage,\n platform: 'healthybowl',\n ...resolveHealthyBowlEntity(pathname),\n viewportSize: `${window.innerWidth}x${window.innerHeight}`,\n version: import.meta.env.VITE_APP_VERSION ?? '2026.627.1',\n timestamp: new Date().toISOString(),\n };\n}\n"],"mappings":";AAkDA,IAAM,IAA6D;CAEjE,CAAC,gCAAgC,mBAAmB;CACpD,CAAC,kCAAkC,kBAAkB;CACrD,CAAC,iCAAiC,qBAAqB;CACvD,CAAC,+DAA+D,kBAAkB;CAGlF,CAAC,4BAA4B,mBAAmB;CAChD,CAAC,oCAAoC,6BAA6B;CAGlE,CAAC,qCAAqC,oBAAoB;CAE1D,CAAC,qCAAqC,oBAAoB;CAM1D,CAAC,2CAA2C,wBAAwB;CACpE,CAAC,iDAAiD,uBAAuB;CACzE,CAAC,6CAA6C,2BAA2B;CAGzE,CAAC,oCAAoC,sBAAsB;CAC3D,CAAC,uCAAuC,4BAA4B;CACpE,CAAC,gCAAgC,yBAAyB;CAC1D,CAAC,6BAA6B,sBAAsB;CACpD,CAAC,gCAAgC,6BAA6B;CAG9D,CAAC,kEAAkE,iCAAiC;CACpG,CAAC,2CAA2C,6BAA6B;CACzE,CAAC,8CAA8C,oBAAoB;CACnE,CAAC,2BAA2B,qBAAqB;CACjD,CAAC,sCAAsC,8BAA8B;CACrE,CAAC,2CAA2C,8BAA8B;AAC5E;AAEA,SAAgB,EAAyB,GAGvC;CACA,KAAK,IAAM,CAAC,GAAS,MAAe,GAAkB;EACpD,IAAM,IAAQ,EAAS,MAAM,CAAO;EACpC,IAAI,GAAO,OAAO;GAAE;GAAY,UAAU,EAAM;EAAG;CACrD;CACA,OAAO,CAAC;AACV;AAIA,IAAa,IAAgD;CAC3D,MAAM;CACN,OAAO;CACP,WAAW;CACX,aAAa;CACb,WAAW;CACX,SAAS;CACT,OAAO;CACP,WAAW;CACX,YAAY;CACZ,sBAAsB;CACtB,iBAAiB;CACjB,WAAW;AACb;AAOA,SAAgB,IAA8B;CAC5C,IAAM,EAAE,mBAAgB,EAAkB,GACpC,IAAe,EAAY,MAAM,GAAG,EAAE,MAAM;CAElD,OADI,CAAC,KAAgB,MAAiB,SAAe,EAAY,OAE/D,EAAY,MACZ,EACG,MAAM,GAAG,EACT,KAAK,MAAU,KAAO,EAAK,OAAO,CAAC,EAAE,YAAY,IAAI,EAAK,MAAM,CAAC,CAAS,EAC1E,KAAK,GAAG;AAEf;AAEA,SAAgB,IAAiC;CAC/C,IAAM,IAAW,OAAO,SAAS,UAC3B,IAAe,EAAS,MAAM,GAAG,EAAE,OAAO,OAAO,GAGjD,IAAU,EAAa,QAAQ,aAAa,GAC5C,KACH,KAAW,IAAI,EAAa,MAAM,IAAU,GAAG,IAAU,CAAC,IAAI,EAAa,MAAM,EAAE,GAAG,KAAK,GAAG,KAAK;CAEtG,OAAO;EACL,YAAY,OAAO,SAAS;EAC5B;EACA,UAAU;EACV,GAAG,EAAyB,CAAQ;EACpC,cAAc,GAAG,OAAO,WAAW,GAAG,OAAO;EAC7C,SAA6C;EAC7C,4BAAW,IAAI,KAAK,GAAE,YAAY;CACpC;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-healthybowl",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1008.1",
|
|
4
4
|
"description": "Burdenoff HealthyBowl Microfrontend - Comprehensive organic farming and agro-foods management platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@apollo/client": "^4.0.11",
|
|
51
|
-
"@burdenoff/fe-libs": "2026.
|
|
51
|
+
"@burdenoff/fe-libs": "2026.1008.4",
|
|
52
52
|
"@burdenoff/planmagnet-fe-sdk": "2026.831.1",
|
|
53
53
|
"@tanstack/react-query": "^5.90.16",
|
|
54
54
|
"clsx": "^2.1.1",
|