@burdenoff/microfe-healthybowl 2026.1003.1 → 2026.1004.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,2 @@
1
1
  import "@burdenoff/fe-libs/shared/assistant/ui/AssistantMarkdownRenderer";
2
+ import "@burdenoff/fe-libs/shared/assistant/uiActions/assistantHref";
@@ -1,5 +1,94 @@
1
- //#region src/components/assistant/assistantProductOptions.ts
2
- var e = { themeWords: "any" }, t = "proposal-v1";
1
+ var e = {
2
+ themeWords: "any",
3
+ entityRoutes: [
4
+ {
5
+ id: "healthybowl-field",
6
+ pattern: "/healthybowl/crops/fields/:id",
7
+ params: { id: { kind: "id" } },
8
+ visibleWith: "hb-grp-crops",
9
+ noun: {
10
+ key: "entity.field",
11
+ fallback: "field"
12
+ }
13
+ },
14
+ {
15
+ id: "healthybowl-crop",
16
+ pattern: "/healthybowl/crops/:id",
17
+ params: { id: {
18
+ kind: "id",
19
+ exclude: [
20
+ "fields",
21
+ "planning",
22
+ "harvest"
23
+ ]
24
+ } },
25
+ visibleWith: "hb-grp-crops",
26
+ noun: {
27
+ key: "entity.crop",
28
+ fallback: "crop"
29
+ }
30
+ },
31
+ {
32
+ id: "healthybowl-plan",
33
+ pattern: "/healthybowl/crops/planning/:id",
34
+ params: { id: {
35
+ kind: "id",
36
+ exclude: ["calendar", "report"]
37
+ } },
38
+ visibleWith: "hb-grp-crops",
39
+ noun: {
40
+ key: "entity.plan",
41
+ fallback: "crop plan"
42
+ }
43
+ },
44
+ {
45
+ id: "healthybowl-harvest",
46
+ pattern: "/healthybowl/crops/harvest/:id",
47
+ params: { id: { kind: "id" } },
48
+ visibleWith: "hb-grp-crops",
49
+ noun: {
50
+ key: "entity.harvest",
51
+ fallback: "harvest"
52
+ }
53
+ },
54
+ {
55
+ id: "healthybowl-animal",
56
+ pattern: "/healthybowl/livestock/animals/:id",
57
+ params: { id: { kind: "id" } },
58
+ visibleWith: "hb-grp-livestock",
59
+ noun: {
60
+ key: "entity.animal",
61
+ fallback: "animal"
62
+ }
63
+ },
64
+ {
65
+ id: "healthybowl-listing",
66
+ pattern: "/healthybowl/marketplace/:id",
67
+ params: { id: {
68
+ kind: "id",
69
+ exclude: [
70
+ "cart",
71
+ "wishlist",
72
+ "orders"
73
+ ]
74
+ } },
75
+ visibleWith: "hb-marketplace",
76
+ noun: {
77
+ key: "entity.listing",
78
+ fallback: "marketplace listing"
79
+ }
80
+ },
81
+ {
82
+ id: "healthybowl-connections",
83
+ pattern: "/integrations/connections",
84
+ params: {},
85
+ noun: {
86
+ key: "entity.connections",
87
+ fallback: "Connected Systems"
88
+ }
89
+ }
90
+ ]
91
+ }, t = "proposal-v1";
3
92
  //#endregion
4
93
  export { e as LOCAL_UI_COMMANDS, t as WRITE_APPROVAL };
5
94
 
@@ -1 +1 @@
1
- {"version":3,"file":"assistantProductOptions.js","names":[],"sources":["../../../src/components/assistant/assistantProductOptions.ts"],"sourcesContent":["/**\n * The three answers fe-libs 2026.929.1 asks every product for, beyond the ones\n * HealthyBowl already gave (BOFF-7801, BOFF-7802, BOFF-7803 5a), plus the list\n * of every answer the panel wrapper gives.\n *\n * ★ A LEAF, deliberately. Its imports are types only, so they are erased at\n * build time, and it loads nothing at run time. The wrapper that mounts the\n * provider (`AIAssistantPanel.tsx`) imports the shared panel, whose\n * react-markdown touches `document` at module scope. Tests that need these\n * VALUES, to run them through fe-libs' own readers, would then need a DOM just\n * to read three constants. So the values live here and the wrapper hands them\n * to the provider.\n */\nimport type { LocalUiCommandOptions } from '@burdenoff/fe-libs/shared/assistant/localUiCommands';\nimport type { AssistantProductCapabilities } from '@burdenoff/fe-libs/shared/assistant/product';\nimport type { WriteApprovalMode } from '@burdenoff/fe-libs/shared/assistant/writeProposals';\n\n/**\n * How the panel reads a UI command it carries out itself (BOFF-7802).\n *\n * ★★ `any`, fe-libs' default, stated rather than left implicit. fe-libs'\n * guidance: pick `mode-only` only when the product's CONTENT has themes of its\n * own (a BigConsole dashboard, a document designer), where \"use the dark theme\"\n * is about the content and must reach the model. HealthyBowl's content (farms,\n * crops, livestock, orders, the marketplace) has no theme of its own. The only\n * theme a farmer can mean is the app's, so \"use the dark theme\" and \"dark mode\"\n * both change it locally, with no turn spent on the model.\n */\nexport const LOCAL_UI_COMMANDS: LocalUiCommandOptions = { themeWords: 'any' };\n\n/**\n * Whether HealthyBowl's finished turns feed the production latency histograms\n * (BOFF-7801).\n *\n * ★ On. That is fe-libs' own default (on unless `false`) and what HealthyBowl\n * does today: the provider never set the field, so its turns have been reported\n * by default. The reports carry timings and coarse dimensions only, and the\n * proposal flow's latency is a measurement the 5a rollout needs.\n */\nexport const REPORT_TURN_TIMINGS: boolean = true;\n\n/**\n * Which write-approval flow HealthyBowl's assistant REQUESTS (BOFF-7803 5a).\n *\n * ★★★ At `proposal-v1` fe-libs provisions Ask and Take action through the\n * `assistant:use`-gated `provisionAssistantSandbox`, requests the proposal flow\n * for Take action, and lets a spoken Take-action turn through only when the\n * sandbox's own `/health` also says v1. Every change then waits for the button\n * on its card; the sandbox and wspace-sandbox-svc decide whether it runs.\n *\n * ★★ That provisioning path has NO `createSandbox` fallback: while\n * wspace-sandbox-svc cannot answer it (its session relay switched off), the\n * assistant cannot start at all. This flag reaches users only when\n * healthybowl-app pins the microfe version that carries it, so the app bump is\n * the release switch.\n *\n * ★ It decides what the panel ASKS FOR, never which UI it shows: cards, the\n * confirm dialog and the prompt's write rules all follow the issuing sandbox's\n * own `/health`.\n */\nexport const WRITE_APPROVAL: WriteApprovalMode = 'proposal-v1';\n\n/**\n * Every question the shared panel asks that HealthyBowl answers, each passed to\n * `<AssistantProductProvider>` in `AIAssistantPanel.tsx` as `field={VALUE}`.\n * `productSeam.test.ts` checks the wrapper source against this list.\n */\nexport const ANSWERED_CAPABILITIES = [\n 'modes',\n 'describeCurrentPage',\n 'gatherPageContext',\n 'buildPrompt',\n 'reportTokenUsage',\n 'storageFolders',\n 'localUiCommands',\n 'reportTurnTimings',\n 'writeApproval',\n] as const satisfies readonly (keyof AssistantProductCapabilities)[];\n\n/**\n * The one question HealthyBowl leaves to fe-libs ON PURPOSE.\n *\n * ★★ `confirmWrite`: with none, a HIGH-risk write proposal is confirmed in\n * fe-libs' shared `AssistantWriteConfirmDialog` (BOFF-7803 5a), because that is\n * the STRONGER of the two dialogs HealthyBowl could use.\n *\n * HealthyBowl does have a dialog of its own: `ConfirmProvider` / `useConfirm`\n * in `src/healthybowl/components/ConfirmDialog.tsx`, mounted in\n * `HealthyBowlRoot.tsx`. It is a generic OK/Cancel `AlertDialog` (title,\n * message, two buttons) built for delete prompts. It has no server readback,\n * no target count, no consequences, no 600 ms arming, no trusted-click check\n * and no Enter guard, so an adapter over it cannot meet the contract fe-libs\n * sets for `confirmWrite` (readback, `targetCount`, consequences, the exact\n * `confirmLabel`, payload options read-only, sensitive values masked). The\n * shared dialog meets all of it. (It is also mounted only inside\n * `HealthyBowlRoot`, while the assistant panel mounts in the app shell outside\n * it, where `useConfirm` throws.)\n *\n * This keeps the operator's 09-26 intent, \"HIGH proposals use the stronger\n * dialog\". It DEPARTS from the write-approval contract §3.4 and checklist W3.3,\n * which planned an adapter over HealthyBowl's `ConfirmProvider`; the departure\n * is recorded on BOFF-7803. Adopt `confirmWrite` only with a HealthyBowl dialog\n * that meets the whole contract, plus a contract test.\n */\nexport const LEFT_TO_FE_LIBS = ['confirmWrite'] as const satisfies readonly (keyof AssistantProductCapabilities)[];\n\n/**\n * ★★ Compile-time, enforced by `type:check`: every field of fe-libs'\n * `AssistantProductCapabilities` is either answered above or deliberately left\n * to fe-libs. Every field there is OPTIONAL, so a field fe-libs adds would\n * otherwise go unanswered with no error anywhere. It silently takes fe-libs'\n * default, which is how a product ends up on a behaviour nobody chose. When\n * this line fails, decide the new field and add it to one of the two lists.\n */\ntype Unanswered = Exclude<\n keyof AssistantProductCapabilities,\n (typeof ANSWERED_CAPABILITIES)[number] | (typeof LEFT_TO_FE_LIBS)[number]\n>;\nexport const EVERY_CAPABILITY_DECIDED: [Unanswered] extends [never] ? true : false = true;\n"],"mappings":";AA4BA,IAAa,IAA2C,EAAE,YAAY,MAAM,GAgC/D,IAAoC"}
1
+ {"version":3,"file":"assistantProductOptions.js","names":[],"sources":["../../../src/components/assistant/assistantProductOptions.ts"],"sourcesContent":["/**\n * The three answers fe-libs 2026.929.1 asks every product for, beyond the ones\n * HealthyBowl already gave (BOFF-7801, BOFF-7802, BOFF-7803 5a), plus the list\n * of every answer the panel wrapper gives.\n *\n * ★ A LEAF, deliberately. Its imports are types only, so they are erased at\n * build time, and it loads nothing at run time. The wrapper that mounts the\n * provider (`AIAssistantPanel.tsx`) imports the shared panel, whose\n * react-markdown touches `document` at module scope. Tests that need these\n * VALUES, to run them through fe-libs' own readers, would then need a DOM just\n * to read three constants. So the values live here and the wrapper hands them\n * to the provider.\n */\nimport type { LocalUiCommandOptions } from '@burdenoff/fe-libs/shared/assistant/localUiCommands';\nimport type { AssistantEntityRoute } from '@burdenoff/fe-libs/shared/assistant/uiActions/entityRoutes';\nimport type { AssistantProductCapabilities } from '@burdenoff/fe-libs/shared/assistant/product';\nimport type { WriteApprovalMode } from '@burdenoff/fe-libs/shared/assistant/writeProposals';\n\n/**\n * The pages of ONE record that no sidebar entry names (BOFF-8060 N1b), so \"take me\n * there\" can open them from a link in the assistant's own reply.\n *\n * ★★ `exclude` lists the router's STATIC siblings of each `:id` segment\n * (`HealthyBowlRoutes.tsx`): `crops/:id` would otherwise swallow `crops/fields`,\n * which is a list page, not a crop. `entityRoutes.test.ts` renders every template\n * through the real route table and checks every static sibling against them, so\n * the two lists cannot drift from the router unnoticed.\n *\n * ★ `visibleWith` is the nav entry the person must be able to SEE (a role that\n * cannot see Crops is not taken to a crop). `/integrations/connections` has none:\n * HealthyBowl has no Integrations entry in its navigation (a reviewed product\n * decision), and the page is reached from the user menu.\n */\nexport const ENTITY_ROUTES: readonly AssistantEntityRoute[] = [\n {\n id: 'healthybowl-field',\n pattern: '/healthybowl/crops/fields/:id',\n params: { id: { kind: 'id' } },\n visibleWith: 'hb-grp-crops',\n noun: { key: 'entity.field', fallback: 'field' },\n },\n {\n id: 'healthybowl-crop',\n pattern: '/healthybowl/crops/:id',\n params: { id: { kind: 'id', exclude: ['fields', 'planning', 'harvest'] } },\n visibleWith: 'hb-grp-crops',\n noun: { key: 'entity.crop', fallback: 'crop' },\n },\n {\n id: 'healthybowl-plan',\n pattern: '/healthybowl/crops/planning/:id',\n params: { id: { kind: 'id', exclude: ['calendar', 'report'] } },\n visibleWith: 'hb-grp-crops',\n noun: { key: 'entity.plan', fallback: 'crop plan' },\n },\n {\n id: 'healthybowl-harvest',\n pattern: '/healthybowl/crops/harvest/:id',\n params: { id: { kind: 'id' } },\n visibleWith: 'hb-grp-crops',\n noun: { key: 'entity.harvest', fallback: 'harvest' },\n },\n {\n id: 'healthybowl-animal',\n pattern: '/healthybowl/livestock/animals/:id',\n params: { id: { kind: 'id' } },\n visibleWith: 'hb-grp-livestock',\n noun: { key: 'entity.animal', fallback: 'animal' },\n },\n {\n id: 'healthybowl-listing',\n pattern: '/healthybowl/marketplace/:id',\n params: { id: { kind: 'id', exclude: ['cart', 'wishlist', 'orders'] } },\n visibleWith: 'hb-marketplace',\n noun: { key: 'entity.listing', fallback: 'marketplace listing' },\n },\n {\n id: 'healthybowl-connections',\n pattern: '/integrations/connections',\n params: {},\n noun: { key: 'entity.connections', fallback: 'Connected Systems' },\n },\n];\n\n/**\n * How the panel reads a UI command it carries out itself (BOFF-7802).\n *\n * ★★ `any`, fe-libs' default, stated rather than left implicit. fe-libs'\n * guidance: pick `mode-only` only when the product's CONTENT has themes of its\n * own (a BigConsole dashboard, a document designer), where \"use the dark theme\"\n * is about the content and must reach the model. HealthyBowl's content (farms,\n * crops, livestock, orders, the marketplace) has no theme of its own. The only\n * theme a farmer can mean is the app's, so \"use the dark theme\" and \"dark mode\"\n * both change it locally, with no turn spent on the model.\n */\nexport const LOCAL_UI_COMMANDS: LocalUiCommandOptions = { themeWords: 'any', entityRoutes: ENTITY_ROUTES };\n\n/**\n * Whether HealthyBowl's finished turns feed the production latency histograms\n * (BOFF-7801).\n *\n * ★ On. That is fe-libs' own default (on unless `false`) and what HealthyBowl\n * does today: the provider never set the field, so its turns have been reported\n * by default. The reports carry timings and coarse dimensions only, and the\n * proposal flow's latency is a measurement the 5a rollout needs.\n */\nexport const REPORT_TURN_TIMINGS: boolean = true;\n\n/**\n * Which write-approval flow HealthyBowl's assistant REQUESTS (BOFF-7803 5a).\n *\n * ★★★ At `proposal-v1` fe-libs provisions Ask and Take action through the\n * `assistant:use`-gated `provisionAssistantSandbox`, requests the proposal flow\n * for Take action, and lets a spoken Take-action turn through only when the\n * sandbox's own `/health` also says v1. Every change then waits for the button\n * on its card; the sandbox and wspace-sandbox-svc decide whether it runs.\n *\n * ★★ That provisioning path has NO `createSandbox` fallback: while\n * wspace-sandbox-svc cannot answer it (its session relay switched off), the\n * assistant cannot start at all. This flag reaches users only when\n * healthybowl-app pins the microfe version that carries it, so the app bump is\n * the release switch.\n *\n * ★ It decides what the panel ASKS FOR, never which UI it shows: cards, the\n * confirm dialog and the prompt's write rules all follow the issuing sandbox's\n * own `/health`.\n */\nexport const WRITE_APPROVAL: WriteApprovalMode = 'proposal-v1';\n\n/**\n * Every question the shared panel asks that HealthyBowl answers, each passed to\n * `<AssistantProductProvider>` in `AIAssistantPanel.tsx` as `field={VALUE}`.\n * `productSeam.test.ts` checks the wrapper source against this list.\n */\nexport const ANSWERED_CAPABILITIES = [\n 'modes',\n 'describeCurrentPage',\n 'gatherPageContext',\n 'buildPrompt',\n 'reportTokenUsage',\n 'storageFolders',\n 'localUiCommands',\n 'reportTurnTimings',\n 'writeApproval',\n] as const satisfies readonly (keyof AssistantProductCapabilities)[];\n\n/**\n * The one question HealthyBowl leaves to fe-libs ON PURPOSE.\n *\n * ★★ `confirmWrite`: with none, a HIGH-risk write proposal is confirmed in\n * fe-libs' shared `AssistantWriteConfirmDialog` (BOFF-7803 5a), because that is\n * the STRONGER of the two dialogs HealthyBowl could use.\n *\n * HealthyBowl does have a dialog of its own: `ConfirmProvider` / `useConfirm`\n * in `src/healthybowl/components/ConfirmDialog.tsx`, mounted in\n * `HealthyBowlRoot.tsx`. It is a generic OK/Cancel `AlertDialog` (title,\n * message, two buttons) built for delete prompts. It has no server readback,\n * no target count, no consequences, no 600 ms arming, no trusted-click check\n * and no Enter guard, so an adapter over it cannot meet the contract fe-libs\n * sets for `confirmWrite` (readback, `targetCount`, consequences, the exact\n * `confirmLabel`, payload options read-only, sensitive values masked). The\n * shared dialog meets all of it. (It is also mounted only inside\n * `HealthyBowlRoot`, while the assistant panel mounts in the app shell outside\n * it, where `useConfirm` throws.)\n *\n * This keeps the operator's 09-26 intent, \"HIGH proposals use the stronger\n * dialog\". It DEPARTS from the write-approval contract §3.4 and checklist W3.3,\n * which planned an adapter over HealthyBowl's `ConfirmProvider`; the departure\n * is recorded on BOFF-7803. Adopt `confirmWrite` only with a HealthyBowl dialog\n * that meets the whole contract, plus a contract test.\n */\nexport const LEFT_TO_FE_LIBS = ['confirmWrite'] as const satisfies readonly (keyof AssistantProductCapabilities)[];\n\n/**\n * ★★ Compile-time, enforced by `type:check`: every field of fe-libs'\n * `AssistantProductCapabilities` is either answered above or deliberately left\n * to fe-libs. Every field there is OPTIONAL, so a field fe-libs adds would\n * otherwise go unanswered with no error anywhere. It silently takes fe-libs'\n * default, which is how a product ends up on a behaviour nobody chose. When\n * this line fails, decide the new field and add it to one of the two lists.\n */\ntype Unanswered = Exclude<\n keyof AssistantProductCapabilities,\n (typeof ANSWERED_CAPABILITIES)[number] | (typeof LEFT_TO_FE_LIBS)[number]\n>;\nexport const EVERY_CAPABILITY_DECIDED: [Unanswered] extends [never] ? true : false = true;\n"],"mappings":"AA+FA,IAAa,IAA2C;CAAE,YAAY;CAAO,cAAc;EA7DzF;GACE,IAAI;GACJ,SAAS;GACT,QAAQ,EAAE,IAAI,EAAE,MAAM,KAAK,EAAE;GAC7B,aAAa;GACb,MAAM;IAAE,KAAK;IAAgB,UAAU;GAAQ;EACjD;EACA;GACE,IAAI;GACJ,SAAS;GACT,QAAQ,EAAE,IAAI;IAAE,MAAM;IAAM,SAAS;KAAC;KAAU;KAAY;IAAS;GAAE,EAAE;GACzE,aAAa;GACb,MAAM;IAAE,KAAK;IAAe,UAAU;GAAO;EAC/C;EACA;GACE,IAAI;GACJ,SAAS;GACT,QAAQ,EAAE,IAAI;IAAE,MAAM;IAAM,SAAS,CAAC,YAAY,QAAQ;GAAE,EAAE;GAC9D,aAAa;GACb,MAAM;IAAE,KAAK;IAAe,UAAU;GAAY;EACpD;EACA;GACE,IAAI;GACJ,SAAS;GACT,QAAQ,EAAE,IAAI,EAAE,MAAM,KAAK,EAAE;GAC7B,aAAa;GACb,MAAM;IAAE,KAAK;IAAkB,UAAU;GAAU;EACrD;EACA;GACE,IAAI;GACJ,SAAS;GACT,QAAQ,EAAE,IAAI,EAAE,MAAM,KAAK,EAAE;GAC7B,aAAa;GACb,MAAM;IAAE,KAAK;IAAiB,UAAU;GAAS;EACnD;EACA;GACE,IAAI;GACJ,SAAS;GACT,QAAQ,EAAE,IAAI;IAAE,MAAM;IAAM,SAAS;KAAC;KAAQ;KAAY;IAAQ;GAAE,EAAE;GACtE,aAAa;GACb,MAAM;IAAE,KAAK;IAAkB,UAAU;GAAsB;EACjE;EACA;GACE,IAAI;GACJ,SAAS;GACT,QAAQ,CAAC;GACT,MAAM;IAAE,KAAK;IAAsB,UAAU;GAAoB;EACnE;CAcyF;AAAc,GAgC5F,IAAoC"}