@burdenoff/microfe-bigconsole 2026.1007.10 → 2026.1007.11

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 (26) hide show
  1. package/dist/bigconsole/assistant/displayCopy.d.ts +33 -0
  2. package/dist/bigconsole/assistant/displayCopy.d.ts.map +1 -0
  3. package/dist/bigconsole/assistant/pageContext.d.ts +14 -0
  4. package/dist/bigconsole/assistant/pageContext.d.ts.map +1 -1
  5. package/dist/bigconsole/assistant/pageContext.js +6 -1
  6. package/dist/bigconsole/assistant/pageContext.js.map +1 -1
  7. package/dist/bigconsole/components/datasink/DataSinkCard.d.ts.map +1 -1
  8. package/dist/bigconsole/components/datasink/DataSinkCard.js +28 -27
  9. package/dist/bigconsole/components/datasink/DataSinkCard.js.map +1 -1
  10. package/dist/bigconsole/constants/backendErrors.js +96 -0
  11. package/dist/bigconsole/constants/backendErrors.js.map +1 -0
  12. package/dist/bigconsole/hooks/useDataSinkAlerts.d.ts +23 -0
  13. package/dist/bigconsole/hooks/useDataSinkAlerts.d.ts.map +1 -1
  14. package/dist/bigconsole/hooks/useDataSinkAlerts.js +138 -113
  15. package/dist/bigconsole/hooks/useDataSinkAlerts.js.map +1 -1
  16. package/dist/bigconsole/pages/DataSinkAlertsPage.d.ts.map +1 -1
  17. package/dist/bigconsole/pages/DataSinkAlertsPage.js +53 -53
  18. package/dist/bigconsole/pages/DataSinkAlertsPage.js.map +1 -1
  19. package/dist/bigconsole/utils/backendError.d.ts +18 -0
  20. package/dist/bigconsole/utils/backendError.d.ts.map +1 -1
  21. package/dist/bigconsole/utils/backendError.js +44 -0
  22. package/dist/bigconsole/utils/backendError.js.map +1 -0
  23. package/dist/bigconsole/workflowOpen.d.ts.map +1 -1
  24. package/dist/bigconsole/workflowOpen.js +15 -14
  25. package/dist/bigconsole/workflowOpen.js.map +1 -1
  26. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"workflowOpen.js","names":[],"sources":["../../src/bigconsole/workflowOpen.ts"],"sourcesContent":["/**\n * Opening a workflow by its key must be READ-ONLY (BOFF-8060 F2).\n *\n * ★★★ THE DEFECT THIS CLOSES. `/workflows/workflow/:id/:version` renders the\n * FluidGrids SDK builder. On mount the SDK loads the definition for `:id` and,\n * when none exists, CREATES one (`CreateWorkflowDefinition`) so that \"Create\n * Workflow\" can hand out a fresh UUID. So ANY link to an unknown key — a stale\n * bookmark, a mistyped URL, a link the assistant composed — wrote a real row.\n * The prod verification of 2026-10-04 caught it as a refused mutation.\n *\n * ★ THE RULE. A route open never creates. The one legitimate create-on-open is\n * the person pressing \"New workflow\", and THAT navigation says so explicitly\n * with router state (`CREATE_WORKFLOW_STATE`). Everything else must first prove\n * the key exists (`verifyWorkflowKey`) before the builder mounts.\n *\n * ★ Framework-free on purpose: this module has no React so the verdict logic is\n * unit-testable without a DOM (this repo's tests run under `bun test`).\n */\nimport type { ApolloClient, TypedDocumentNode } from '@apollo/client';\n\nimport { WorkflowDefinitionExistsDocument, type WorkflowDefinitionExistsQuery } from '../generated/wspace-operations';\nimport { BOOTSTRAP_RETRY_DELAY_MS } from './constants';\n\n/**\n * Router state carried by the explicit \"new workflow\" navigation. Only a\n * navigation to a freshly minted key may set it.\n */\nexport const CREATE_WORKFLOW_STATE = { createWorkflow: true } as const;\n\n/** `NavigateOptions` for the explicit \"new workflow\" navigation. */\nexport const NEW_WORKFLOW_NAV = { state: CREATE_WORKFLOW_STATE } as const;\n\n/** True only when router state came from an explicit \"new workflow\" navigation. */\nexport function isCreateIntent(state: unknown): boolean {\n return typeof state === 'object' && state !== null && (state as { createWorkflow?: unknown }).createWorkflow === true;\n}\n\nexport type WorkflowKeyVerdict = 'found' | 'absent' | 'error';\n\n/** The slice of Apollo's client this module needs (assignable from `ApolloClient`). */\nexport interface WorkflowLookupClient {\n query: (options: {\n query: TypedDocumentNode<WorkflowDefinitionExistsQuery, { workflowKey: string }>;\n variables: { workflowKey: string };\n fetchPolicy: 'network-only';\n }) => Promise<{ data?: WorkflowDefinitionExistsQuery | undefined; error?: unknown }>;\n}\n\n/**\n * Narrows Apollo's generic client to the one call this module makes. An adapter,\n * not a cast: the call is type-checked against the real `ApolloClient.query`.\n */\nexport function toLookupClient(apollo: ApolloClient): WorkflowLookupClient {\n return { query: (options) => apollo.query(options) };\n}\n\n/** One probe. Never throws: a failure is a verdict, not a \"not found\". */\nexport async function probeWorkflowKey(client: WorkflowLookupClient, key: string): Promise<WorkflowKeyVerdict> {\n try {\n const result = await client.query({\n query: WorkflowDefinitionExistsDocument,\n variables: { workflowKey: key },\n fetchPolicy: 'network-only',\n });\n // fe-libs' Apollo client runs with errorPolicy \"all\": a refused query\n // RESOLVES with `{ error }` instead of rejecting. Read it, or a transient\n // failure would be reported as \"this workflow does not exist\".\n if (result.error) return 'error';\n return result.data?.workflowDefinition ? 'found' : 'absent';\n } catch {\n return 'error';\n }\n}\n\nexport interface VerifyOptions {\n /** Wait between the two probes. Defaults to the shell bootstrap delay. */\n retryDelayMs?: number;\n /** Injectable for tests. */\n sleep?: (ms: number) => Promise<void>;\n}\n\nconst defaultSleep = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));\n\n/**\n * Does ANY version of `key` exist in the active workspace?\n *\n * Probes up to twice: on a cold full-page load the workspace token may not be\n * issued when the first probe fires (see `BOOTSTRAP_RETRY_DELAY_MS`), and a\n * wrongly \"absent\" verdict would show a false not-found for a real workflow.\n * `found` ends it at once; otherwise the SECOND probe's verdict stands.\n * Read-only: only ever issues a query.\n */\nexport async function verifyWorkflowKey(\n client: WorkflowLookupClient,\n key: string,\n { retryDelayMs = BOOTSTRAP_RETRY_DELAY_MS, sleep = defaultSleep }: VerifyOptions = {}\n): Promise<WorkflowKeyVerdict> {\n const first = await probeWorkflowKey(client, key);\n if (first === 'found') return 'found';\n await sleep(retryDelayMs);\n return probeWorkflowKey(client, key);\n}\n\n/** What the open guard shows for the key in the URL. */\nexport type WorkflowOpenView = 'builder' | 'not-found' | 'failed' | 'checking';\n\nexport interface WorkflowOpenState {\n /** The key in the URL. */\n key: string;\n /** Router state said \"new workflow\" (an explicit create). */\n createIntent: boolean;\n /** Keys proven to exist (or explicitly created) in this session. */\n verifiedKey: string | null;\n /** The key the last lookup found nothing for. */\n absentKey: string | null;\n /** The key the last lookup failed for. */\n failedKey: string | null;\n}\n\n/**\n * The guard's whole decision. The builder (which creates on mount for an unknown\n * key) is reachable ONLY through the first two clauses; every other state, and\n * every state for a key nobody has vouched for, is not the builder.\n */\nexport function decideWorkflowOpenView({\n key,\n createIntent,\n verifiedKey,\n absentKey,\n failedKey,\n}: WorkflowOpenState): WorkflowOpenView {\n if (createIntent) return 'builder';\n if (verifiedKey === key) return 'builder';\n if (absentKey === key) return 'not-found';\n if (failedKey === key) return 'failed';\n return 'checking';\n}\n"],"mappings":";;;AA2BA,IAAa,IAAwB,EAAE,gBAAgB,IAAM,EAGhD,IAAmB,EAAE,OAAO,GAAuB;AAGhE,SAAgB,EAAe,GAAyB;AACtD,QAAO,OAAO,KAAU,cAAY,KAAmB,EAAuC,mBAAmB;;AAkBnH,SAAgB,EAAe,GAA4C;AACzE,QAAO,EAAE,QAAQ,MAAY,EAAO,MAAM,EAAQ,EAAE;;AAItD,eAAsB,EAAiB,GAA8B,GAA0C;AAC7G,KAAI;EACF,IAAM,IAAS,MAAM,EAAO,MAAM;GAChC,OAAO;GACP,WAAW,EAAE,aAAa,GAAK;GAC/B,aAAa;GACd,CAAC;AAKF,SADI,EAAO,QAAc,UAClB,EAAO,MAAM,qBAAqB,UAAU;SAC7C;AACN,SAAO;;;AAWX,IAAM,KAAgB,MAAe,IAAI,SAAe,MAAY,WAAW,GAAS,EAAG,CAAC;AAW5F,eAAsB,EACpB,GACA,GACA,EAAE,kBAAe,GAA0B,WAAQ,MAAgC,EAAE,EACxD;AAI7B,QAHc,MAAM,EAAiB,GAAQ,EAAI,KACnC,UAAgB,WAC9B,MAAM,EAAM,EAAa,EAClB,EAAiB,GAAQ,EAAI;;AAwBtC,SAAgB,EAAuB,EACrC,QACA,iBACA,gBACA,cACA,gBACsC;AAKtC,QAJI,KACA,MAAgB,IAAY,YAC5B,MAAc,IAAY,cAC1B,MAAc,IAAY,WACvB"}
1
+ {"version":3,"file":"workflowOpen.js","names":[],"sources":["../../src/bigconsole/workflowOpen.ts"],"sourcesContent":["/**\n * Opening a workflow by its key must be READ-ONLY (BOFF-8060 F2).\n *\n * ★★★ THE DEFECT THIS CLOSES. `/workflows/workflow/:id/:version` renders the\n * FluidGrids SDK builder. On mount the SDK loads the definition for `:id` and,\n * when none exists, CREATES one (`CreateWorkflowDefinition`) so that \"Create\n * Workflow\" can hand out a fresh UUID. So ANY link to an unknown key — a stale\n * bookmark, a mistyped URL, a link the assistant composed — wrote a real row.\n * The prod verification of 2026-10-04 caught it as a refused mutation.\n *\n * ★ THE RULE. A route open never creates. The one legitimate create-on-open is\n * the person pressing \"New workflow\", and THAT navigation says so explicitly\n * with router state (`CREATE_WORKFLOW_STATE`). Everything else must first prove\n * the key exists (`verifyWorkflowKey`) before the builder mounts.\n *\n * ★ Framework-free on purpose: this module has no React so the verdict logic is\n * unit-testable without a DOM (this repo's tests run under `bun test`).\n */\nimport type { ApolloClient, TypedDocumentNode } from '@apollo/client';\n\nimport { WorkflowDefinitionExistsDocument, type WorkflowDefinitionExistsQuery } from '../generated/wspace-operations';\nimport { BOOTSTRAP_RETRY_DELAY_MS } from './constants';\nimport { hasGraphQLErrorCode } from './utils/backendError';\n\n/**\n * The server's own \"no such workflow\" answer. workflow-svc answers an unknown\n * key with a GraphQL error coded `NOT_FOUND` (HTTP 404) rather than\n * `workflowDefinition: null`, so this code IS the absent verdict.\n */\nconst WORKFLOW_ABSENT_CODES: ReadonlySet<string> = new Set(['NOT_FOUND']);\n\n/**\n * Router state carried by the explicit \"new workflow\" navigation. Only a\n * navigation to a freshly minted key may set it.\n */\nexport const CREATE_WORKFLOW_STATE = { createWorkflow: true } as const;\n\n/** `NavigateOptions` for the explicit \"new workflow\" navigation. */\nexport const NEW_WORKFLOW_NAV = { state: CREATE_WORKFLOW_STATE } as const;\n\n/** True only when router state came from an explicit \"new workflow\" navigation. */\nexport function isCreateIntent(state: unknown): boolean {\n return typeof state === 'object' && state !== null && (state as { createWorkflow?: unknown }).createWorkflow === true;\n}\n\nexport type WorkflowKeyVerdict = 'found' | 'absent' | 'error';\n\n/** The slice of Apollo's client this module needs (assignable from `ApolloClient`). */\nexport interface WorkflowLookupClient {\n query: (options: {\n query: TypedDocumentNode<WorkflowDefinitionExistsQuery, { workflowKey: string }>;\n variables: { workflowKey: string };\n fetchPolicy: 'network-only';\n }) => Promise<{ data?: WorkflowDefinitionExistsQuery | undefined; error?: unknown }>;\n}\n\n/**\n * Narrows Apollo's generic client to the one call this module makes. An adapter,\n * not a cast: the call is type-checked against the real `ApolloClient.query`.\n */\nexport function toLookupClient(apollo: ApolloClient): WorkflowLookupClient {\n return { query: (options) => apollo.query(options) };\n}\n\n/** One probe. Never throws: a failure is a verdict, not a \"not found\". */\nexport async function probeWorkflowKey(client: WorkflowLookupClient, key: string): Promise<WorkflowKeyVerdict> {\n try {\n const result = await client.query({\n query: WorkflowDefinitionExistsDocument,\n variables: { workflowKey: key },\n fetchPolicy: 'network-only',\n });\n // fe-libs' Apollo client runs with errorPolicy \"all\": a refused query\n // RESOLVES with `{ error }` instead of rejecting. Read it, or a transient\n // failure would be reported as \"this workflow does not exist\".\n //\n // ★ Except the server's own NOT_FOUND, which is an answer, not a failure\n // (BOFF-8060 i18n B4). Reading it as 'error' sent every unknown key to the\n // \"couldn't load\" state after ~27 s, so the not-found copy never rendered.\n // `verifyWorkflowKey` still asks twice, so a cold-boot miss cannot stick.\n if (result.error) return hasGraphQLErrorCode(result.error, WORKFLOW_ABSENT_CODES) ? 'absent' : 'error';\n return result.data?.workflowDefinition ? 'found' : 'absent';\n } catch (error) {\n return hasGraphQLErrorCode(error, WORKFLOW_ABSENT_CODES) ? 'absent' : 'error';\n }\n}\n\nexport interface VerifyOptions {\n /** Wait between the two probes. Defaults to the shell bootstrap delay. */\n retryDelayMs?: number;\n /** Injectable for tests. */\n sleep?: (ms: number) => Promise<void>;\n}\n\nconst defaultSleep = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));\n\n/**\n * Does ANY version of `key` exist in the active workspace?\n *\n * Probes up to twice: on a cold full-page load the workspace token may not be\n * issued when the first probe fires (see `BOOTSTRAP_RETRY_DELAY_MS`), and a\n * wrongly \"absent\" verdict would show a false not-found for a real workflow.\n * `found` ends it at once; otherwise the SECOND probe's verdict stands.\n * Read-only: only ever issues a query.\n */\nexport async function verifyWorkflowKey(\n client: WorkflowLookupClient,\n key: string,\n { retryDelayMs = BOOTSTRAP_RETRY_DELAY_MS, sleep = defaultSleep }: VerifyOptions = {}\n): Promise<WorkflowKeyVerdict> {\n const first = await probeWorkflowKey(client, key);\n if (first === 'found') return 'found';\n await sleep(retryDelayMs);\n return probeWorkflowKey(client, key);\n}\n\n/** What the open guard shows for the key in the URL. */\nexport type WorkflowOpenView = 'builder' | 'not-found' | 'failed' | 'checking';\n\nexport interface WorkflowOpenState {\n /** The key in the URL. */\n key: string;\n /** Router state said \"new workflow\" (an explicit create). */\n createIntent: boolean;\n /** Keys proven to exist (or explicitly created) in this session. */\n verifiedKey: string | null;\n /** The key the last lookup found nothing for. */\n absentKey: string | null;\n /** The key the last lookup failed for. */\n failedKey: string | null;\n}\n\n/**\n * The guard's whole decision. The builder (which creates on mount for an unknown\n * key) is reachable ONLY through the first two clauses; every other state, and\n * every state for a key nobody has vouched for, is not the builder.\n */\nexport function decideWorkflowOpenView({\n key,\n createIntent,\n verifiedKey,\n absentKey,\n failedKey,\n}: WorkflowOpenState): WorkflowOpenView {\n if (createIntent) return 'builder';\n if (verifiedKey === key) return 'builder';\n if (absentKey === key) return 'not-found';\n if (failedKey === key) return 'failed';\n return 'checking';\n}\n"],"mappings":";;;;AA6BA,IAAM,IAA6C,IAAI,IAAI,CAAC,YAAY,CAAC,EAM5D,IAAwB,EAAE,gBAAgB,IAAM,EAGhD,IAAmB,EAAE,OAAO,GAAuB;AAGhE,SAAgB,EAAe,GAAyB;AACtD,QAAO,OAAO,KAAU,cAAY,KAAmB,EAAuC,mBAAmB;;AAkBnH,SAAgB,EAAe,GAA4C;AACzE,QAAO,EAAE,QAAQ,MAAY,EAAO,MAAM,EAAQ,EAAE;;AAItD,eAAsB,EAAiB,GAA8B,GAA0C;AAC7G,KAAI;EACF,IAAM,IAAS,MAAM,EAAO,MAAM;GAChC,OAAO;GACP,WAAW,EAAE,aAAa,GAAK;GAC/B,aAAa;GACd,CAAC;AAUF,SADI,EAAO,QAAc,EAAoB,EAAO,OAAO,EAAsB,GAAG,WAAW,UACxF,EAAO,MAAM,qBAAqB,UAAU;UAC5C,GAAO;AACd,SAAO,EAAoB,GAAO,EAAsB,GAAG,WAAW;;;AAW1E,IAAM,KAAgB,MAAe,IAAI,SAAe,MAAY,WAAW,GAAS,EAAG,CAAC;AAW5F,eAAsB,EACpB,GACA,GACA,EAAE,kBAAe,GAA0B,WAAQ,MAAgC,EAAE,EACxD;AAI7B,QAHc,MAAM,EAAiB,GAAQ,EAAI,KACnC,UAAgB,WAC9B,MAAM,EAAM,EAAa,EAClB,EAAiB,GAAQ,EAAI;;AAwBtC,SAAgB,EAAuB,EACrC,QACA,iBACA,gBACA,cACA,gBACsC;AAKtC,QAJI,KACA,MAAgB,IAAY,YAC5B,MAAc,IAAY,cAC1B,MAAc,IAAY,WACvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-bigconsole",
3
- "version": "2026.1007.10",
3
+ "version": "2026.1007.11",
4
4
  "description": "BigConsole - AI-powered analytics and dashboard platform",
5
5
  "type": "module",
6
6
  "files": [
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@apollo/client": "^4.0.11",
53
- "@burdenoff/fe-libs": "2026.1007.3",
53
+ "@burdenoff/fe-libs": "2026.1007.6",
54
54
  "@burdenoff/fluidgrids-fe-sdk": "2026.731.4",
55
55
  "@iconify/react": "^6.0.2",
56
56
  "@monaco-editor/react": "^4.7.0",
@@ -85,7 +85,7 @@
85
85
  "zustand": "^5.0.3"
86
86
  },
87
87
  "devDependencies": {
88
- "@burdenoff/fe-libs": "2026.1007.3",
88
+ "@burdenoff/fe-libs": "2026.1007.6",
89
89
  "@burdenoff/fluidgrids-fe-sdk": "2026.731.4",
90
90
  "@eslint/js": "^10.0.1",
91
91
  "@graphql-codegen/add": "^5.0.0",