@burdenoff/microfe-healthybowl 2026.630.1 → 2026.630.2

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,4 +1,5 @@
1
- var e = typeof window < "u" && window.location.hostname !== "app.gethealthybowl.com", t = {
1
+ //#region src/config/assistantUsecases.ts
2
+ var e = typeof window < "u", t = {
2
3
  id: "general",
3
4
  label: "General",
4
5
  description: "General help with HealthyBowl — crops, livestock, the marketplace, and farm operations",
@@ -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' | '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` mode. It is admin-gated, shows\n * a one-time confirm dialog, and prepends a describe-and-confirm instruction —\n * but the in-sandbox agent still auto-executes (there is no hard server-side\n * confirmation yet, per the ai-assistant agent). So it is held OFF on the\n * PRODUCTION app (`app.gethealthybowl.com`) and stays ON for alpha\n * (`alphaapp.gethealthybowl.com`) + local dev, until the agent-side hard confirm\n * lands. Flipping it does not touch the transport, which already supports the mode.\n *\n * Why a RUNTIME hostname check and not `import.meta.env.VITE_*`: this microfe\n * ships a PREBUILT dist (the app bundles dist/index.js, not src), so Vite bakes\n * any `import.meta.env` at MICROFE build time — where the env is never 'prod' —\n * making a build-time env flag unable to distinguish prod from alpha. The\n * runtime `window.location.hostname` is the reliable signal in the browser.\n */\nconst PROD_APP_HOST = 'app.gethealthybowl.com';\nexport const API_CALLS_MODE_ENABLED = typeof window !== 'undefined' && window.location.hostname !== PROD_APP_HOST;\n\nconst GENERAL: AssistantUsecase = {\n id: 'general',\n label: 'General',\n description: 'General help with HealthyBowl — crops, livestock, the marketplace, and farm operations',\n suggestions: [\n 'How do I add a new crop?',\n 'Explain the livestock health tracker',\n 'How does the marketplace work?',\n 'What government schemes can I apply for?',\n ],\n};\n\nconst API_CALLS: AssistantUsecase = {\n id: 'api-calls',\n label: 'Actions',\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 requiresAdmin: true,\n writeCapable: true,\n};\n\n// Modes the panel knows about. Phase 1 = general; phase 2 adds api-calls (admin-\n// gated + guarded). The mode selector filters this further by role at runtime.\nexport const ASSISTANT_USECASE_CONFIG: readonly AssistantUsecase[] = API_CALLS_MODE_ENABLED\n ? [GENERAL, API_CALLS]\n : [GENERAL];\n"],"mappings":"AA+CA,IAAa,IAAyB,OAAO,SAAW,OAAe,OAAO,SAAS,aADjE,0BAGhB,IAA4B;CAChC,IAAI;CACJ,OAAO;CACP,aAAa;CACb,aAAa;EACX;EACA;EACA;EACA;EACD;CACF,EAmBY,IAAwD,IACjE,CAAC,GAlB+B;CAClC,IAAI;CACJ,OAAO;CACP,aACE;CACF,aAAa;EACX;EACA;EACA;EACA;EACD;CACD,eAAe;CACf,cAAc;CACf,CAKuB,GACpB,CAAC,EAAQ"}
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' | '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, and (3) a describe-and-confirm instruction prepended to the prompt.\n * The in-sandbox agent still auto-executes (no hard server-side confirm yet) —\n * that residual risk was accepted when enabling on prod.\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\nconst GENERAL: AssistantUsecase = {\n id: 'general',\n label: 'General',\n description: 'General help with HealthyBowl — crops, livestock, the marketplace, and farm operations',\n suggestions: [\n 'How do I add a new crop?',\n 'Explain the livestock health tracker',\n 'How does the marketplace work?',\n 'What government schemes can I apply for?',\n ],\n};\n\nconst API_CALLS: AssistantUsecase = {\n id: 'api-calls',\n label: 'Actions',\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 requiresAdmin: true,\n writeCapable: true,\n};\n\n// Modes the panel knows about. Phase 1 = general; phase 2 adds api-calls (admin-\n// gated + guarded). The mode selector filters this further by role at runtime.\nexport const ASSISTANT_USECASE_CONFIG: readonly AssistantUsecase[] = API_CALLS_MODE_ENABLED\n ? [GENERAL, API_CALLS]\n : [GENERAL];\n"],"mappings":";AA2CA,IAAa,IAAyB,OAAO,SAAW,KAElD,IAA4B;CAChC,IAAI;CACJ,OAAO;CACP,aAAa;CACb,aAAa;EACX;EACA;EACA;EACA;EACD;CACF,EAmBY,IAAwD,IACjE,CAAC,GAlB+B;CAClC,IAAI;CACJ,OAAO;CACP,aACE;CACF,aAAa;EACX;EACA;EACA;EACA;EACD;CACD,eAAe;CACf,cAAc;CACf,CAKuB,GACpB,CAAC,EAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-healthybowl",
3
- "version": "2026.630.1",
3
+ "version": "2026.630.2",
4
4
  "description": "Burdenoff HealthyBowl Microfrontend - Comprehensive organic farming and agro-foods management platform",
5
5
  "type": "module",
6
6
  "files": [