@aglyn/plugins-workflows 1.0.0-beta.196 → 1.0.0-beta.198

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aglyn/plugins-workflows",
3
- "version": "1.0.0-beta.196",
3
+ "version": "1.0.0-beta.198",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://aglyn.com",
6
6
  "repository": {
@@ -25,17 +25,17 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "dependencies": {
28
- "@aglyn/aglyn": "1.0.0-beta.196",
29
- "@aglyn/shared-data-mdi": "1.0.0-beta.196",
30
- "@aglyn/shared-ui-jsx": "1.0.0-beta.196",
31
- "@aglyn/shared-ui-next": "1.0.0-beta.196",
32
- "@aglyn/shared-ui-snackstack": "1.0.0-beta.196",
33
- "@aglyn/shared-util-email": "1.0.0-beta.196",
34
- "@aglyn/shared-util-http": "1.0.0-beta.196",
35
- "@aglyn/shared-util-timestamp": "1.0.0-beta.196",
36
- "@aglyn/tenant-data-admin": "1.0.0-beta.196",
37
- "@aglyn/tenant-feature-instance": "1.0.0-beta.196",
38
- "@aglyn/tenant-runtime": "1.0.0-beta.196",
28
+ "@aglyn/aglyn": "1.0.0-beta.198",
29
+ "@aglyn/shared-data-mdi": "1.0.0-beta.198",
30
+ "@aglyn/shared-ui-jsx": "1.0.0-beta.198",
31
+ "@aglyn/shared-ui-next": "1.0.0-beta.198",
32
+ "@aglyn/shared-ui-snackstack": "1.0.0-beta.198",
33
+ "@aglyn/shared-util-email": "1.0.0-beta.198",
34
+ "@aglyn/shared-util-http": "1.0.0-beta.198",
35
+ "@aglyn/shared-util-timestamp": "1.0.0-beta.198",
36
+ "@aglyn/tenant-data-admin": "1.0.0-beta.198",
37
+ "@aglyn/tenant-feature-instance": "1.0.0-beta.198",
38
+ "@aglyn/tenant-runtime": "1.0.0-beta.198",
39
39
  "@swc/helpers": "0.5.23"
40
40
  },
41
41
  "peerDependencies": {
@@ -135,11 +135,12 @@ const RUN_FILTER_OPTIONS = {
135
135
  * workflow that had run all day.
136
136
  *
137
137
  * `target.id` equality is what makes the read proportional to the card:
138
- * it asks for this workflow's rows rather than the site's. It carries no
139
- * `orderBy` deliberately — an equality plus an ordering on a second field
140
- * needs a composite index, and the client sort below already puts the
141
- * newest first. The untargeted case has no equality to pair, so it orders
142
- * server-side instead.
138
+ * it asks for this workflow's rows rather than the site's. Both shapes
139
+ * order by `createdAt` descending, so the ceiling keeps the NEWEST entries;
140
+ * an equality with no ordering would keep an arbitrary `__name__` slice of
141
+ * the automation's history once it outgrew the window. The targeted shape
142
+ * is served by the `activity` (`target.id` ↑, `createdAt` ↓) composite the
143
+ * console's organization activity route already uses.
143
144
  */ const { data: entries } = useFirestoreCollection(()=>{
144
145
  if (!hostId) return null;
145
146
  const base = collection(firestore, 'hosts', hostId, 'activity');
@@ -152,7 +153,7 @@ const RUN_FILTER_OPTIONS = {
152
153
  * comparing `length === WINDOW` cannot, because it is wrong in both
153
154
  * directions at exactly the count that equals the ceiling. The probe row
154
155
  * is dropped below and never rendered.
155
- */ return targetId ? query(base, where('target.id', '==', targetId), limit(WINDOW + 1)) : query(base, orderBy('createdAt', 'desc'), limit(WINDOW + 1));
156
+ */ return targetId ? query(base, where('target.id', '==', targetId), orderBy('createdAt', 'desc'), limit(WINDOW + 1)) : query(base, orderBy('createdAt', 'desc'), limit(WINDOW + 1));
156
157
  }, // `targetId` belongs here: it now shapes the query, so a card that
157
158
  // switched workflows without it would go on showing the first one's runs.
158
159
  [
@@ -337,7 +338,7 @@ const RUN_FILTER_OPTIONS = {
337
338
  }),
338
339
  truncated ? /*#__PURE__*/ _jsx(Alert, {
339
340
  severity: "info",
340
- children: `Runs found in the ${WINDOW} most recent activity entries for ` + 'this site. Older runs than that are recorded and are not ' + 'listed here.'
341
+ children: `Runs found in the ${WINDOW} most recent activity entries for ` + (targetId ? 'this automation' : 'this site') + '. Older runs than that are recorded and are not listed here.'
341
342
  }) : null
342
343
  ]
343
344
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/workflows/src/lib/components/host-run-history-card.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport {\n actionRunResult,\n actionRunSummary,\n actionTriggerLabel,\n} from '@aglyn/aglyn/app-utils/activity-presenter'\nimport { useConsoleWidgetSlot } from '@aglyn/aglyn/app-utils/console-widget-slot-context'\nimport { HOST_EVENT_TYPES } from '@aglyn/aglyn/app-utils/workflows'\nimport type { ConsoleAutomationTarget } from '@aglyn/aglyn/plugin-manager/feature-plugins'\nimport { CardDisplay, type HelpTipContent } from '@aglyn/shared-ui-jsx'\nimport ListFilterChips from '@aglyn/shared-ui-jsx/components/list-filter-chips.component'\nimport { ListPagination } from '@aglyn/shared-ui-jsx/components/list-pagination.component'\nimport { ListTable } from '@aglyn/shared-ui-jsx/components/list-table.component'\nimport { inMemoryListField } from '@aglyn/shared-ui-jsx/const/list-grid-filter'\nimport { TABLE_PAGE_SIZE_DEFAULT } from '@aglyn/shared-ui-jsx/const/table-pagination'\nimport { useListRowsFilter } from '@aglyn/shared-ui-jsx/hooks/use-list-rows-filter'\nimport { Alert, Chip, Stack, Tooltip, Typography } from '@mui/material'\nimport type { GridColDef } from '@mui/x-data-grid'\nimport { collection, limit, orderBy, query, where } from 'firebase/firestore'\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useFirestore,\n useFirestoreCollection,\n} from '@aglyn/tenant-feature-instance'\nimport { pluginDocsHelp } from '@aglyn/aglyn'\n\nexport interface HostRunHistoryCardProps {\n hostId: string\n /** The org the page names, for what other plugins add to a failed run. */\n orgId?: string\n /** Show only runs of this action/workflow. */\n targetId?: string\n /**\n * What `targetId` names, and its name. A run row records its automation's id\n * but not whether it is an action or a workflow, so the card that opened the\n * history says; without it, a failed run offers nothing beside its summary.\n */\n targetType?: ConsoleAutomationTarget['type']\n targetName?: string\n header?: string\n /** Overrides the default help affordance on the card header. */\n help?: HelpTipContent\n}\n\n/**\n * Activity rows read before the run filter.\n *\n * A CEILING rather than a page, and the difference is the client-side filter\n * below. `activity` holds publishes, media saves and member changes as well as\n * runs, and only a document carrying a run verdict is a row here — so a\n * server page of ten activity entries might contain two runs, one, or none,\n * and paging the QUERY would hand the reader pages of wildly different\n * heights with no way to tell a short page from the end of the history.\n *\n * The filter cannot move to the server either: `actionRunResult` falls back to\n * reading the prose `action` for entries written before AGL-2171, which have\n * no `result` field, and `where('result','in',…)` excludes exactly those. That\n * is the same field-presence trap as ordering on an optional field, and it\n * would silently drop every historic run.\n */\nconst WINDOW = 200\n\nconst RESULT_COLOR = {\n succeeded: 'success',\n failed: 'error',\n skipped: 'warning',\n} as const\n\nconst RESULT_LABEL = {\n succeeded: 'Succeeded',\n failed: 'Failed',\n skipped: 'Skipped',\n} as const\n\ntype RunResult = keyof typeof RESULT_LABEL\n\n/** One run as the grid holds it: the entry, and what it is shown and filtered by. */\ninterface RunRow {\n $id: string\n entry: any\n result: RunResult\n trigger: string\n triggerLabel: string\n summary: string\n createdAtMs: number | null\n}\n\n/*\n * What the run grid's Filters panel offers. The card holds its whole window,\n * so the panel and the search answer over every run it read. Trigger and\n * Result are picked from the event list and the three verdicts; what\n * happened is typed.\n */\nconst RUN_FILTER_FIELDS = [\n inMemoryListField('createdAtMs', 'date'),\n inMemoryListField('trigger', 'select'),\n inMemoryListField('result', 'select'),\n inMemoryListField('summary', 'text'),\n]\nconst RUN_FILTER_HEADERS: Readonly<Record<string, string>> = {\n createdAtMs: 'Time',\n trigger: 'Trigger',\n result: 'Result',\n summary: 'What happened',\n}\nconst RUN_FILTER_OPTIONS = {\n trigger: HOST_EVENT_TYPES.map((event) => ({\n value: event,\n label: actionTriggerLabel(event),\n })),\n result: (Object.keys(RESULT_LABEL) as RunResult[]).map((result) => ({\n value: result,\n label: RESULT_LABEL[result],\n })),\n}\n/** What the quick search reads on a run row. */\nconst RUN_SEARCH_FIELDS = ['summary', 'triggerLabel'] as const\n\n/**\n * The run-history table `/product/workflows` advertises (AGL-2171):\n * `Time | Trigger | Result | What happened`.\n *\n * A separate component from `HostActivityCard` on purpose. That card is\n * the site's general feed — publishes, media saves, member changes — and\n * a run is a different record with different columns. Pointing the Runs\n * dialog at the general feed is what produced a list of\n * `Action ran on formSubmission — My automation` where the mockup shows\n * four columns.\n *\n * `actionRunResult` returning `undefined` is the filter: the activity\n * collection holds far more than runs, and a publish has no verdict. An\n * entry that is not a run simply does not appear, rather than appearing\n * under a `Succeeded` that means nothing for it.\n */\nexport function HostRunHistoryCard(props: HostRunHistoryCardProps) {\n const {\n hostId,\n orgId,\n targetId,\n targetType,\n targetName = '',\n header = 'Run history',\n help = pluginDocsHelp('buildAWorkflow', {\n anchor: '#4-save-and-test',\n excerpt:\n 'Every run of this automation, including the ones a trigger ' +\n 'condition skipped — which is the answer to \"why did it not fire?\".',\n }),\n } = props\n const firestore = useFirestore()\n /**\n * The shell's zone renderer (AGL-2919), for what other plugins add to a\n * failed run; `null` outside the console shell.\n */\n const RunZone = useConsoleWidgetSlot()\n /** The automation a failed run belongs to, as the `automationRun` zone names it. */\n const zoneTarget = useMemo<ConsoleAutomationTarget | null>(\n () => (targetId && targetType ? { type: targetType, id: targetId, name: targetName } : null),\n [targetId, targetType, targetName],\n )\n /*\n * The window is NARROWED BY THE SERVER, not by the client (AGL-2292).\n *\n * A bare `limit(200)` with no ordering is not \"the most recent 200 runs\" —\n * Firestore answers an unordered limit in `__name__` order, so it is an\n * arbitrary slice of the host's whole activity feed. `activity` also holds\n * publishes, media saves and member changes, and only entries carrying a\n * run result survive the filter below, so a busy site could fill all 200\n * places with rows this card discards and report \"No runs yet\" for a\n * workflow that had run all day.\n *\n * `target.id` equality is what makes the read proportional to the card:\n * it asks for this workflow's rows rather than the site's. It carries no\n * `orderBy` deliberately — an equality plus an ordering on a second field\n * needs a composite index, and the client sort below already puts the\n * newest first. The untargeted case has no equality to pair, so it orders\n * server-side instead.\n */\n const { data: entries } = useFirestoreCollection<any>(\n () => {\n if (!hostId) return null\n const base = collection(firestore, 'hosts', hostId, 'activity')\n /*\n * `WINDOW + 1` is a PROBE, not an off-by-one (AGL-2501).\n *\n * The card used to say \"showing what we read\" by saying nothing at all.\n * Reading one document more than the ceiling turns \"there is older\n * history than this\" into a fact for the price of a single read;\n * comparing `length === WINDOW` cannot, because it is wrong in both\n * directions at exactly the count that equals the ceiling. The probe row\n * is dropped below and never rendered.\n */\n return targetId\n ? query(base, where('target.id', '==', targetId), limit(WINDOW + 1))\n : query(base, orderBy('createdAt', 'desc'), limit(WINDOW + 1))\n },\n // `targetId` belongs here: it now shapes the query, so a card that\n // switched workflows without it would go on showing the first one's runs.\n [firestore, hostId, targetId],\n { idField: '$id' },\n )\n /** The activity ceiling bit — there are older entries than were read. */\n const truncated = (entries?.length ?? 0) > WINDOW\n\n const runs = useMemo(\n () =>\n [...(entries ?? [])]\n .slice(0, WINDOW)\n .filter((entry) => !targetId || entry.target?.id === targetId)\n .map((entry) => ({ entry, result: actionRunResult(entry) }))\n .filter(\n (row): row is { entry: any; result: RunResult } =>\n Boolean(row.result),\n )\n .sort(\n (a, b) =>\n (b.entry.createdAt?.seconds ?? 0) -\n (a.entry.createdAt?.seconds ?? 0),\n )\n .map(\n ({ entry, result }): RunRow => ({\n $id: String(entry.$id),\n entry,\n result,\n trigger: String(entry.trigger ?? ''),\n // `formSubmission` → `Form submitted`.\n triggerLabel: actionTriggerLabel(entry.trigger),\n summary: actionRunSummary(entry),\n createdAtMs:\n typeof entry.createdAt?.seconds === 'number'\n ? entry.createdAt.seconds * 1000\n : null,\n }),\n ),\n [entries, targetId],\n )\n const listFilter = useListRowsFilter({\n rows: runs,\n fields: RUN_FILTER_FIELDS,\n options: RUN_FILTER_OPTIONS,\n headers: RUN_FILTER_HEADERS,\n search: RUN_SEARCH_FIELDS,\n })\n const matched = listFilter.rows\n\n /*\n * The page is a SLICE, because the rows are already in hand.\n *\n * Every run in the window has been read and paid for by the query above, so\n * a second query per page would buy nothing and cost a read. What the card\n * lacked was not a cheaper read but a control: it sliced the newest\n * twenty-five off the window and rendered them in one wall, so run\n * twenty-six was read, discarded, and unreachable — on the surface a reader\n * opens precisely to ask \"why did it not fire the time before last?\".\n */\n const [page, setPage] = useState(0)\n const [pageSize, setPageSize] = useState(TABLE_PAGE_SIZE_DEFAULT)\n // A different workflow is a different history: page three of the last one\n // is not a position in this one, and an out-of-range page renders empty\n // with no explanation, which reads as the runs having gone.\n // A narrowed list starts again at its first page, for the same reason.\n const searchKey = listFilter.gridFilter.searchWords.join(' ')\n useEffect(\n () => setPage(0),\n [targetId, hostId, listFilter.gridFilter.clauses, searchKey],\n )\n const shown = useMemo(\n () => matched.slice(page * pageSize, page * pageSize + pageSize),\n [matched, page, pageSize],\n )\n\n const { filterColumns } = listFilter\n const columns = useMemo(\n () =>\n filterColumns([\n {\n field: 'createdAtMs',\n headerName: 'Time',\n width: 120,\n renderCell: ({ row }: { row: RunRow }) => {\n const at = row.entry.createdAt?.toDate?.()\n return (\n <Tooltip title={at ? at.toLocaleString() : ''}>\n <span>{at ? at.toLocaleTimeString() : '--'}</span>\n </Tooltip>\n )\n },\n },\n {\n field: 'trigger',\n headerName: 'Trigger',\n width: 180,\n renderCell: ({ row }: { row: RunRow }) => row.triggerLabel,\n },\n {\n field: 'result',\n headerName: 'Result',\n width: 120,\n renderCell: ({ row }: { row: RunRow }) => (\n <Chip\n size=\"small\"\n variant=\"outlined\"\n color={RESULT_COLOR[row.result]}\n label={RESULT_LABEL[row.result]}\n />\n ),\n },\n {\n field: 'summary',\n headerName: 'What happened',\n flex: 1,\n minWidth: 220,\n renderCell: ({ row }: { row: RunRow }) => (\n <Stack sx={{ minWidth: 0, py: 0.75 }}>\n <Typography variant=\"body2\">{row.summary}</Typography>\n {row.entry.durationMs != null ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`${row.entry.durationMs}ms`}\n </Typography>\n ) : null}\n {/*\n What other plugins add to a failed run (AGL-2919): the\n `automationRun` zone, through the shell's gated slot.\n */}\n {RunZone && zoneTarget && row.result === 'failed' ? (\n <RunZone\n slot=\"automationRun\"\n hostId={hostId}\n orgId={orgId}\n target={zoneTarget}\n runId={row.$id}\n />\n ) : null}\n </Stack>\n ),\n },\n ] as GridColDef[]),\n [filterColumns, RunZone, zoneTarget, hostId, orgId],\n )\n\n return (\n <CardDisplay\n header={header}\n help={help}\n contentGutterX\n contentGutterY\n contentBordered=\"all\"\n >\n {runs.length === 0 ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'No runs yet — every run of this automation is logged here, ' +\n 'including the ones a condition skipped.'}\n </Typography>\n ) : (\n <Stack spacing={1.5}>\n <ListFilterChips {...listFilter.chipsProps} />\n <ListTable\n aria-label=\"Run history\"\n rows={shown}\n columns={columns}\n {...listFilter.gridProps}\n // A failed run carries what other plugins add under its summary.\n getRowHeight={() => 'auto'}\n // `ListPagination` below pages the matches.\n hideFooter\n noRowsLabel=\"No runs match these filters\"\n />\n <ListPagination\n page={page}\n pageSize={pageSize}\n rowCount={shown.length}\n // The runs in the window that match, which is a number this card\n // genuinely holds. What it does not know is how many runs are OLDER\n // than the window, and the notice below says so rather than letting\n // the count line imply a total it cannot see.\n count={matched.length}\n onPageChange={setPage}\n onPageSizeChange={setPageSize}\n />\n {truncated ? (\n <Alert severity=\"info\">\n {`Runs found in the ${WINDOW} most recent activity entries for ` +\n 'this site. Older runs than that are recorded and are not ' +\n 'listed here.'}\n </Alert>\n ) : null}\n </Stack>\n )}\n </CardDisplay>\n )\n}\nHostRunHistoryCard.displayName = 'HostRunHistoryCard'\n\nexport default HostRunHistoryCard\n"],"names":["actionRunResult","actionRunSummary","actionTriggerLabel","useConsoleWidgetSlot","HOST_EVENT_TYPES","CardDisplay","ListFilterChips","ListPagination","ListTable","inMemoryListField","TABLE_PAGE_SIZE_DEFAULT","useListRowsFilter","Alert","Chip","Stack","Tooltip","Typography","collection","limit","orderBy","query","where","useEffect","useMemo","useState","useFirestore","useFirestoreCollection","pluginDocsHelp","WINDOW","RESULT_COLOR","succeeded","failed","skipped","RESULT_LABEL","RUN_FILTER_FIELDS","RUN_FILTER_HEADERS","createdAtMs","trigger","result","summary","RUN_FILTER_OPTIONS","map","event","value","label","Object","keys","RUN_SEARCH_FIELDS","HostRunHistoryCard","props","hostId","orgId","targetId","targetType","targetName","header","help","anchor","excerpt","firestore","RunZone","zoneTarget","type","id","name","data","entries","base","idField","truncated","length","runs","slice","filter","entry","target","row","Boolean","sort","a","b","createdAt","seconds","$id","String","triggerLabel","listFilter","rows","fields","options","headers","search","matched","page","setPage","pageSize","setPageSize","searchKey","gridFilter","searchWords","join","clauses","shown","filterColumns","columns","field","headerName","width","renderCell","at","toDate","title","toLocaleString","span","toLocaleTimeString","size","variant","color","flex","minWidth","sx","py","durationMs","slot","runId","contentGutterX","contentGutterY","contentBordered","spacing","chipsProps","aria-label","gridProps","getRowHeight","hideFooter","noRowsLabel","rowCount","count","onPageChange","onPageSizeChange","severity","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SACEA,eAAe,EACfC,gBAAgB,EAChBC,kBAAkB,QACb,4CAA2C;AAClD,SAASC,oBAAoB,QAAQ,qDAAoD;AACzF,SAASC,gBAAgB,QAAQ,mCAAkC;AAEnE,SAASC,WAAW,QAA6B,uBAAsB;AACvE,OAAOC,qBAAqB,8DAA6D;AACzF,SAASC,cAAc,QAAQ,4DAA2D;AAC1F,SAASC,SAAS,QAAQ,uDAAsD;AAChF,SAASC,i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CACRC,OAAOA;gCACPwB,QAAQd;gCACR+D,OAAOhD,IAAIO,GAAG;iCAEd;;;YAGV;SACD,GACH;QAACoB;QAAe3C;QAASC;QAAYX;QAAQC;KAAM;IAGrD,qBACE,KAAC9C;QACCkD,QAAQA;QACRC,MAAMA;QACNqE,cAAc;QACdC,cAAc;QACdC,iBAAgB;kBAEfxD,KAAKD,MAAM,KAAK,kBACf,KAACtD;YAAWoG,SAAQ;YAAQC,OAAM;sBAC/B,gEACC;2BAGJ,MAACvG;YAAMkH,SAAS;;8BAChB,KAAC1H,8BAAoBgF,WAAW2C,UAAU;8BAC1C,KAACzH;oBACC0H,cAAW;oBACX3C,MAAMe;oBACNE,SAASA;mBACLlB,WAAW6C,SAAS;oBACxB,iEAAiE;oBACjEC,cAAc,IAAM;oBACpB,4CAA4C;oBAC5CC,UAAU;oBACVC,aAAY;;8BAEd,KAAC/H;oBACCsF,MAAMA;oBACNE,UAAUA;oBACVwC,UAAUjC,MAAMhC,MAAM;oBACtB,iEAAiE;oBACjE,oEAAoE;oBACpE,oEAAoE;oBACpE,8CAA8C;oBAC9CkE,OAAO5C,QAAQtB,MAAM;oBACrBmE,cAAc3C;oBACd4C,kBAAkB1C;;gBAEnB3B,0BACC,KAACzD;oBAAM+H,UAAS;8BACb,CAAC,kBAAkB,EAAE/G,OAAO,kCAAkC,CAAC,GAC9D,8DACA;qBAEF;;;;AAKZ;AACAoB,mBAAmB4F,WAAW,GAAG;AAEjC,eAAe5F,mBAAkB"}
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/workflows/src/lib/components/host-run-history-card.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport {\n actionRunResult,\n actionRunSummary,\n actionTriggerLabel,\n} from '@aglyn/aglyn/app-utils/activity-presenter'\nimport { useConsoleWidgetSlot } from '@aglyn/aglyn/app-utils/console-widget-slot-context'\nimport { HOST_EVENT_TYPES } from '@aglyn/aglyn/app-utils/workflows'\nimport type { ConsoleAutomationTarget } from '@aglyn/aglyn/plugin-manager/feature-plugins'\nimport { CardDisplay, type HelpTipContent } from '@aglyn/shared-ui-jsx'\nimport ListFilterChips from '@aglyn/shared-ui-jsx/components/list-filter-chips.component'\nimport { ListPagination } from '@aglyn/shared-ui-jsx/components/list-pagination.component'\nimport { ListTable } from '@aglyn/shared-ui-jsx/components/list-table.component'\nimport { inMemoryListField } from '@aglyn/shared-ui-jsx/const/list-grid-filter'\nimport { TABLE_PAGE_SIZE_DEFAULT } from '@aglyn/shared-ui-jsx/const/table-pagination'\nimport { useListRowsFilter } from '@aglyn/shared-ui-jsx/hooks/use-list-rows-filter'\nimport { Alert, Chip, Stack, Tooltip, Typography } from '@mui/material'\nimport type { GridColDef } from '@mui/x-data-grid'\nimport { collection, limit, orderBy, query, where } from 'firebase/firestore'\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useFirestore,\n useFirestoreCollection,\n} from '@aglyn/tenant-feature-instance'\nimport { pluginDocsHelp } from '@aglyn/aglyn'\n\nexport interface HostRunHistoryCardProps {\n hostId: string\n /** The org the page names, for what other plugins add to a failed run. */\n orgId?: string\n /** Show only runs of this action/workflow. */\n targetId?: string\n /**\n * What `targetId` names, and its name. A run row records its automation's id\n * but not whether it is an action or a workflow, so the card that opened the\n * history says; without it, a failed run offers nothing beside its summary.\n */\n targetType?: ConsoleAutomationTarget['type']\n targetName?: string\n header?: string\n /** Overrides the default help affordance on the card header. */\n help?: HelpTipContent\n}\n\n/**\n * Activity rows read before the run filter.\n *\n * A CEILING rather than a page, and the difference is the client-side filter\n * below. `activity` holds publishes, media saves and member changes as well as\n * runs, and only a document carrying a run verdict is a row here — so a\n * server page of ten activity entries might contain two runs, one, or none,\n * and paging the QUERY would hand the reader pages of wildly different\n * heights with no way to tell a short page from the end of the history.\n *\n * The filter cannot move to the server either: `actionRunResult` falls back to\n * reading the prose `action` for entries written before AGL-2171, which have\n * no `result` field, and `where('result','in',…)` excludes exactly those. That\n * is the same field-presence trap as ordering on an optional field, and it\n * would silently drop every historic run.\n */\nconst WINDOW = 200\n\nconst RESULT_COLOR = {\n succeeded: 'success',\n failed: 'error',\n skipped: 'warning',\n} as const\n\nconst RESULT_LABEL = {\n succeeded: 'Succeeded',\n failed: 'Failed',\n skipped: 'Skipped',\n} as const\n\ntype RunResult = keyof typeof RESULT_LABEL\n\n/** One run as the grid holds it: the entry, and what it is shown and filtered by. */\ninterface RunRow {\n $id: string\n entry: any\n result: RunResult\n trigger: string\n triggerLabel: string\n summary: string\n createdAtMs: number | null\n}\n\n/*\n * What the run grid's Filters panel offers. The card holds its whole window,\n * so the panel and the search answer over every run it read. Trigger and\n * Result are picked from the event list and the three verdicts; what\n * happened is typed.\n */\nconst RUN_FILTER_FIELDS = [\n inMemoryListField('createdAtMs', 'date'),\n inMemoryListField('trigger', 'select'),\n inMemoryListField('result', 'select'),\n inMemoryListField('summary', 'text'),\n]\nconst RUN_FILTER_HEADERS: Readonly<Record<string, string>> = {\n createdAtMs: 'Time',\n trigger: 'Trigger',\n result: 'Result',\n summary: 'What happened',\n}\nconst RUN_FILTER_OPTIONS = {\n trigger: HOST_EVENT_TYPES.map((event) => ({\n value: event,\n label: actionTriggerLabel(event),\n })),\n result: (Object.keys(RESULT_LABEL) as RunResult[]).map((result) => ({\n value: result,\n label: RESULT_LABEL[result],\n })),\n}\n/** What the quick search reads on a run row. */\nconst RUN_SEARCH_FIELDS = ['summary', 'triggerLabel'] as const\n\n/**\n * The run-history table `/product/workflows` advertises (AGL-2171):\n * `Time | Trigger | Result | What happened`.\n *\n * A separate component from `HostActivityCard` on purpose. That card is\n * the site's general feed — publishes, media saves, member changes — and\n * a run is a different record with different columns. Pointing the Runs\n * dialog at the general feed is what produced a list of\n * `Action ran on formSubmission — My automation` where the mockup shows\n * four columns.\n *\n * `actionRunResult` returning `undefined` is the filter: the activity\n * collection holds far more than runs, and a publish has no verdict. An\n * entry that is not a run simply does not appear, rather than appearing\n * under a `Succeeded` that means nothing for it.\n */\nexport function HostRunHistoryCard(props: HostRunHistoryCardProps) {\n const {\n hostId,\n orgId,\n targetId,\n targetType,\n targetName = '',\n header = 'Run history',\n help = pluginDocsHelp('buildAWorkflow', {\n anchor: '#4-save-and-test',\n excerpt:\n 'Every run of this automation, including the ones a trigger ' +\n 'condition skipped — which is the answer to \"why did it not fire?\".',\n }),\n } = props\n const firestore = useFirestore()\n /**\n * The shell's zone renderer (AGL-2919), for what other plugins add to a\n * failed run; `null` outside the console shell.\n */\n const RunZone = useConsoleWidgetSlot()\n /** The automation a failed run belongs to, as the `automationRun` zone names it. */\n const zoneTarget = useMemo<ConsoleAutomationTarget | null>(\n () => (targetId && targetType ? { type: targetType, id: targetId, name: targetName } : null),\n [targetId, targetType, targetName],\n )\n /*\n * The window is NARROWED BY THE SERVER, not by the client (AGL-2292).\n *\n * A bare `limit(200)` with no ordering is not \"the most recent 200 runs\" —\n * Firestore answers an unordered limit in `__name__` order, so it is an\n * arbitrary slice of the host's whole activity feed. `activity` also holds\n * publishes, media saves and member changes, and only entries carrying a\n * run result survive the filter below, so a busy site could fill all 200\n * places with rows this card discards and report \"No runs yet\" for a\n * workflow that had run all day.\n *\n * `target.id` equality is what makes the read proportional to the card:\n * it asks for this workflow's rows rather than the site's. Both shapes\n * order by `createdAt` descending, so the ceiling keeps the NEWEST entries;\n * an equality with no ordering would keep an arbitrary `__name__` slice of\n * the automation's history once it outgrew the window. The targeted shape\n * is served by the `activity` (`target.id` ↑, `createdAt` ↓) composite the\n * console's organization activity route already uses.\n */\n const { data: entries } = useFirestoreCollection<any>(\n () => {\n if (!hostId) return null\n const base = collection(firestore, 'hosts', hostId, 'activity')\n /*\n * `WINDOW + 1` is a PROBE, not an off-by-one (AGL-2501).\n *\n * The card used to say \"showing what we read\" by saying nothing at all.\n * Reading one document more than the ceiling turns \"there is older\n * history than this\" into a fact for the price of a single read;\n * comparing `length === WINDOW` cannot, because it is wrong in both\n * directions at exactly the count that equals the ceiling. The probe row\n * is dropped below and never rendered.\n */\n return targetId\n ? query(\n base,\n where('target.id', '==', targetId),\n orderBy('createdAt', 'desc'),\n limit(WINDOW + 1),\n )\n : query(base, orderBy('createdAt', 'desc'), limit(WINDOW + 1))\n },\n // `targetId` belongs here: it now shapes the query, so a card that\n // switched workflows without it would go on showing the first one's runs.\n [firestore, hostId, targetId],\n { idField: '$id' },\n )\n /** The activity ceiling bit — there are older entries than were read. */\n const truncated = (entries?.length ?? 0) > WINDOW\n\n const runs = useMemo(\n () =>\n [...(entries ?? [])]\n .slice(0, WINDOW)\n .filter((entry) => !targetId || entry.target?.id === targetId)\n .map((entry) => ({ entry, result: actionRunResult(entry) }))\n .filter(\n (row): row is { entry: any; result: RunResult } =>\n Boolean(row.result),\n )\n .sort(\n (a, b) =>\n (b.entry.createdAt?.seconds ?? 0) -\n (a.entry.createdAt?.seconds ?? 0),\n )\n .map(\n ({ entry, result }): RunRow => ({\n $id: String(entry.$id),\n entry,\n result,\n trigger: String(entry.trigger ?? ''),\n // `formSubmission` → `Form submitted`.\n triggerLabel: actionTriggerLabel(entry.trigger),\n summary: actionRunSummary(entry),\n createdAtMs:\n typeof entry.createdAt?.seconds === 'number'\n ? entry.createdAt.seconds * 1000\n : null,\n }),\n ),\n [entries, targetId],\n )\n const listFilter = useListRowsFilter({\n rows: runs,\n fields: RUN_FILTER_FIELDS,\n options: RUN_FILTER_OPTIONS,\n headers: RUN_FILTER_HEADERS,\n search: RUN_SEARCH_FIELDS,\n })\n const matched = listFilter.rows\n\n /*\n * The page is a SLICE, because the rows are already in hand.\n *\n * Every run in the window has been read and paid for by the query above, so\n * a second query per page would buy nothing and cost a read. What the card\n * lacked was not a cheaper read but a control: it sliced the newest\n * twenty-five off the window and rendered them in one wall, so run\n * twenty-six was read, discarded, and unreachable — on the surface a reader\n * opens precisely to ask \"why did it not fire the time before last?\".\n */\n const [page, setPage] = useState(0)\n const [pageSize, setPageSize] = useState(TABLE_PAGE_SIZE_DEFAULT)\n // A different workflow is a different history: page three of the last one\n // is not a position in this one, and an out-of-range page renders empty\n // with no explanation, which reads as the runs having gone.\n // A narrowed list starts again at its first page, for the same reason.\n const searchKey = listFilter.gridFilter.searchWords.join(' ')\n useEffect(\n () => setPage(0),\n [targetId, hostId, listFilter.gridFilter.clauses, searchKey],\n )\n const shown = useMemo(\n () => matched.slice(page * pageSize, page * pageSize + pageSize),\n [matched, page, pageSize],\n )\n\n const { filterColumns } = listFilter\n const columns = useMemo(\n () =>\n filterColumns([\n {\n field: 'createdAtMs',\n headerName: 'Time',\n width: 120,\n renderCell: ({ row }: { row: RunRow }) => {\n const at = row.entry.createdAt?.toDate?.()\n return (\n <Tooltip title={at ? at.toLocaleString() : ''}>\n <span>{at ? at.toLocaleTimeString() : '--'}</span>\n </Tooltip>\n )\n },\n },\n {\n field: 'trigger',\n headerName: 'Trigger',\n width: 180,\n renderCell: ({ row }: { row: RunRow }) => row.triggerLabel,\n },\n {\n field: 'result',\n headerName: 'Result',\n width: 120,\n renderCell: ({ row }: { row: RunRow }) => (\n <Chip\n size=\"small\"\n variant=\"outlined\"\n color={RESULT_COLOR[row.result]}\n label={RESULT_LABEL[row.result]}\n />\n ),\n },\n {\n field: 'summary',\n headerName: 'What happened',\n flex: 1,\n minWidth: 220,\n renderCell: ({ row }: { row: RunRow }) => (\n <Stack sx={{ minWidth: 0, py: 0.75 }}>\n <Typography variant=\"body2\">{row.summary}</Typography>\n {row.entry.durationMs != null ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`${row.entry.durationMs}ms`}\n </Typography>\n ) : null}\n {/*\n What other plugins add to a failed run (AGL-2919): the\n `automationRun` zone, through the shell's gated slot.\n */}\n {RunZone && zoneTarget && row.result === 'failed' ? (\n <RunZone\n slot=\"automationRun\"\n hostId={hostId}\n orgId={orgId}\n target={zoneTarget}\n runId={row.$id}\n />\n ) : null}\n </Stack>\n ),\n },\n ] as GridColDef[]),\n [filterColumns, RunZone, zoneTarget, hostId, orgId],\n )\n\n return (\n <CardDisplay\n header={header}\n help={help}\n contentGutterX\n contentGutterY\n contentBordered=\"all\"\n >\n {runs.length === 0 ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'No runs yet — every run of this automation is logged here, ' +\n 'including the ones a condition skipped.'}\n </Typography>\n ) : (\n <Stack spacing={1.5}>\n <ListFilterChips {...listFilter.chipsProps} />\n <ListTable\n aria-label=\"Run history\"\n rows={shown}\n columns={columns}\n {...listFilter.gridProps}\n // A failed run carries what other plugins add under its summary.\n getRowHeight={() => 'auto'}\n // `ListPagination` below pages the matches.\n hideFooter\n noRowsLabel=\"No runs match these filters\"\n />\n <ListPagination\n page={page}\n pageSize={pageSize}\n rowCount={shown.length}\n // The runs in the window that match, which is a number this card\n // genuinely holds. What it does not know is how many runs are OLDER\n // than the window, and the notice below says so rather than letting\n // the count line imply a total it cannot see.\n count={matched.length}\n onPageChange={setPage}\n onPageSizeChange={setPageSize}\n />\n {truncated ? (\n <Alert severity=\"info\">\n {`Runs found in the ${WINDOW} most recent activity entries for ` +\n (targetId ? 'this automation' : 'this site') +\n '. Older runs than that are recorded and are not listed here.'}\n </Alert>\n ) : null}\n </Stack>\n )}\n </CardDisplay>\n )\n}\nHostRunHistoryCard.displayName = 'HostRunHistoryCard'\n\nexport default HostRunHistoryCard\n"],"names":["actionRunResult","actionRunSummary","actionTriggerLabel","useConsoleWidgetSlot","HOST_EVENT_TYPES","CardDisplay","ListFilterChips","ListPagination","ListTable","inMemoryListField","TABLE_PAGE_SIZE_DEFAULT","useListRowsFilter","Alert","Chip","Stack","Tooltip","Typography","collection","limit","orderBy","query","where","useEffect","useMemo","useState","useFirestore","useFirestoreCollection","pluginDocsHelp","WINDOW","RESULT_COLOR","succeeded","failed","skipped","RESULT_LABEL","RUN_FILTER_FIELDS","RUN_FILTER_HEADERS","createdAtMs","trigger","result","summary","RUN_FILTER_OPTIONS","map","event","value","label","Object","keys","RUN_SEARCH_FIELDS","HostRunHistoryCard","props","hostId","orgId","targetId","targetType","targetName","header","help","anchor","excerpt","firestore","RunZone","zoneTarget","type","id","name","data","entries","base","idField","truncated","length","runs","slice","filter","entry","target","row","Boolean","sort","a","b","createdAt","seconds","$id","String","triggerLabel","listFilter","rows","fields","options","headers","search","matched","page","setPage","pageSize","setPageSize","searchKey","gridFilter","searchWords","join","clauses","shown","filterColumns","columns","field","headerName","width","renderCell","at","toDate","title","toLocaleString","span","toLocaleTimeString","size","variant","color","flex","minWidth","sx","py","durationMs","slot","runId","contentGutterX","contentGutterY","contentBordered","spacing","chipsProps","aria-label","gridProps","getRowHeight","hideFooter","noRowsLabel","rowCount","count","onPageChange","onPageSizeChange","severity","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SACEA,eAAe,EACfC,gBAAgB,EAChBC,kBAAkB,QACb,4CAA2C;AAClD,SAASC,oBAAoB,QAAQ,qDAAoD;AACzF,SAASC,gBAAgB,QAAQ,mCAAkC;AAEnE,SAASC,WAAW,QAA6B,uBAAsB;AACvE,OAAOC,qBAAqB,8DAA6D;AACzF,SAASC,cAAc,QAAQ,4DAA2D;AAC1F,SAASC,SAAS,QAAQ,uDAAsD;AAChF,SAASC,iBAAiB,QAAQ,8CAA6C;AAC/E,SAASC,uBAAuB,QAAQ,8CAA6C;AACrF,SAASC,iBAAiB,QAAQ,kDAAiD;AACnF,SAASC,KAAK,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,EAAEC,UAAU,QAAQ,gBAAe;AAEvE,SAASC,UAAU,EAAEC,KAAK,EAAEC,OAAO,EAAEC,KAAK,EAAEC,KAAK,QAAQ,qBAAoB;AA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