@zaip-ai/cli 4.9.0 → 5.0.0

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 (180) hide show
  1. package/dist/services/adapter-hook-sources.d.ts +3 -0
  2. package/dist/services/adapter-hook-sources.d.ts.map +1 -1
  3. package/dist/services/adapter-hook-sources.js +3 -0
  4. package/dist/services/adapter-hook-sources.js.map +1 -1
  5. package/dist/services/adapters.d.ts +1 -1
  6. package/dist/services/adapters.d.ts.map +1 -1
  7. package/dist/services/adapters.js +5 -2
  8. package/dist/services/adapters.js.map +1 -1
  9. package/dist/services/adapters.test.js +1 -1
  10. package/dist/services/adapters.test.js.map +1 -1
  11. package/dist/services/codex-conversation-lifecycle-hook.d.ts.map +1 -1
  12. package/dist/services/codex-conversation-lifecycle-hook.js +16 -6
  13. package/dist/services/codex-conversation-lifecycle-hook.js.map +1 -1
  14. package/dist/services/codex-hook-activation.d.ts +1 -1
  15. package/dist/services/codex-hook-activation.d.ts.map +1 -1
  16. package/dist/services/codex-hook-activation.js +116 -10
  17. package/dist/services/codex-hook-activation.js.map +1 -1
  18. package/dist/services/codex-pre-tool-cli-capture-template.d.ts +2 -0
  19. package/dist/services/codex-pre-tool-cli-capture-template.d.ts.map +1 -0
  20. package/dist/services/codex-pre-tool-cli-capture-template.js +104 -0
  21. package/dist/services/codex-pre-tool-cli-capture-template.js.map +1 -0
  22. package/dist/services/codex-pre-tool-cloud-template.d.ts +2 -0
  23. package/dist/services/codex-pre-tool-cloud-template.d.ts.map +1 -0
  24. package/dist/services/codex-pre-tool-cloud-template.js +190 -0
  25. package/dist/services/codex-pre-tool-cloud-template.js.map +1 -0
  26. package/dist/services/codex-pre-tool-dependencies.test-support.d.ts +2 -0
  27. package/dist/services/codex-pre-tool-dependencies.test-support.d.ts.map +1 -0
  28. package/dist/services/codex-pre-tool-dependencies.test-support.js +9 -0
  29. package/dist/services/codex-pre-tool-dependencies.test-support.js.map +1 -0
  30. package/dist/services/codex-pre-tool-hook-fixture.test-support.d.ts +5 -0
  31. package/dist/services/codex-pre-tool-hook-fixture.test-support.d.ts.map +1 -0
  32. package/dist/services/codex-pre-tool-hook-fixture.test-support.js +19 -0
  33. package/dist/services/codex-pre-tool-hook-fixture.test-support.js.map +1 -0
  34. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.d.ts +2 -0
  35. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.d.ts.map +1 -0
  36. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.js +107 -0
  37. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.js.map +1 -0
  38. package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -1
  39. package/dist/services/codex-pre-tool-hook-template.js +96 -210
  40. package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
  41. package/dist/services/codex-pre-tool-hook-template.test.js +32 -80
  42. package/dist/services/codex-pre-tool-hook-template.test.js.map +1 -1
  43. package/dist/services/codex-pre-tool-host-context-template.d.ts +2 -0
  44. package/dist/services/codex-pre-tool-host-context-template.d.ts.map +1 -0
  45. package/dist/services/codex-pre-tool-host-context-template.js +139 -0
  46. package/dist/services/codex-pre-tool-host-context-template.js.map +1 -0
  47. package/dist/services/codex-pre-tool-support-template.d.ts.map +1 -1
  48. package/dist/services/codex-pre-tool-support-template.js +61 -101
  49. package/dist/services/codex-pre-tool-support-template.js.map +1 -1
  50. package/dist/services/codex-subagent-hook-template.d.ts +1 -1
  51. package/dist/services/codex-subagent-hook-template.d.ts.map +1 -1
  52. package/dist/services/codex-subagent-hook-template.js +13 -2
  53. package/dist/services/codex-subagent-hook-template.js.map +1 -1
  54. package/dist/services/codex-validation-runtime-template.d.ts.map +1 -1
  55. package/dist/services/codex-validation-runtime-template.js +10 -4
  56. package/dist/services/codex-validation-runtime-template.js.map +1 -1
  57. package/dist/services/runtime-template-test-support.d.ts +1 -0
  58. package/dist/services/runtime-template-test-support.d.ts.map +1 -1
  59. package/dist/services/runtime-template-test-support.js +23 -2
  60. package/dist/services/runtime-template-test-support.js.map +1 -1
  61. package/dist/services/runtime-template.test.js +4 -23
  62. package/dist/services/runtime-template.test.js.map +1 -1
  63. package/package.json +1 -1
  64. package/templates/.agents/README-ENG.md +49 -7
  65. package/templates/.agents/README.md +37 -10
  66. package/templates/.agents/config/agents/discovery.json +1 -1
  67. package/templates/.agents/dashboard/.zaip-managed.json +121 -73
  68. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-BW7Vy1cp.js → CostCalculationGuidePage-w6pjt4OM.js} +1 -1
  69. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-Cp_hEVd8.js → DashboardHelpDialog-DhlntQcR.js} +76 -11
  70. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-Prcs-ydy.js → PricingSettingsDialog-BHoZT2an.js} +1 -1
  71. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-Cu40wAFF.js → ProjectSettingsPage-IcncIZ9Y.js} +1 -1
  72. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-Bh3YBd3C.js → TraceabilityWorkspace-C6rORjpr.js} +1 -1
  73. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-uPnOBShc.js +68 -0
  74. package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-CF7B1Hjn.js → dashboard-localization-DWXjEIgc.js} +49 -7
  75. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-DOhy6D2-.js → icons-vendor-Hc9fp_gs.js} +1 -1
  76. package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-qVSJnJ0_.js → index-BqeOEZW5.js} +2 -2
  77. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CkPC-yMz.js → react-vendor-C9ta_O10.js} +1 -1
  78. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-BEdGoIDm.js → traceability-IcefoTOv.js} +1 -1
  79. package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
  80. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  81. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  82. package/templates/.agents/dashboard/modules/cost-monitor/src/contracts.ts +10 -3
  83. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.run-page.test.ts +5 -1
  84. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.period-values.test.tsx +2 -2
  85. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables-keeps-legacy-codex-identity-fields-blank.test.ts +5 -5
  86. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +36 -43
  87. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-loaders.ts +1 -0
  88. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-table-formatters.ts +6 -4
  89. package/templates/.agents/dashboard/modules/cost-monitor/src/server/aggregate.ts +2 -2
  90. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.ts +1 -1
  91. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +11 -25
  92. package/templates/.agents/dashboard/modules/cost-monitor/src/server/cost-summary-defaults.ts +26 -0
  93. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  94. package/templates/.agents/dashboard/modules/operations/src/contracts.ts +11 -16
  95. package/templates/.agents/dashboard/modules/operations/src/planning-contracts.ts +14 -0
  96. package/templates/.agents/dashboard/modules/operations/src/react/DecisionTable.tsx +65 -0
  97. package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.tsx +5 -71
  98. package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +10 -36
  99. package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +7 -2
  100. package/templates/.agents/dashboard/modules/operations/src/react/use-operations-filter-sync.ts +66 -0
  101. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  102. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  103. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  104. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  105. package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +193 -191
  106. package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +169 -169
  107. package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
  108. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +193 -191
  109. package/templates/.agents/dashboard/packages/local-runtime/src/active-capture-failure.test.ts +38 -0
  110. package/templates/.agents/dashboard/packages/local-runtime/src/active-capture-failure.ts +35 -0
  111. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.test.ts +53 -2
  112. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +18 -1
  113. package/templates/.agents/dashboard/packages/local-runtime/src/manifest-runs.ts +8 -2
  114. package/templates/.agents/dashboard/packages/local-runtime/src/server-capture-projection-order.test.ts +118 -0
  115. package/templates/.agents/dashboard/packages/local-runtime/src/server-cost-run-search.test.ts +90 -0
  116. package/templates/.agents/dashboard/packages/local-runtime/src/server-cost-run-search.ts +86 -0
  117. package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-routes.ts +8 -1
  118. package/templates/.agents/dashboard/packages/local-runtime/src/server-projection-loaders.ts +13 -0
  119. package/templates/.agents/dashboard/packages/local-runtime/src/server-projections.ts +30 -74
  120. package/templates/.agents/dashboard/packages/local-runtime/src/server-route-handlers.ts +42 -0
  121. package/templates/.agents/dashboard/packages/local-runtime/src/server-routes.test.ts +60 -0
  122. package/templates/.agents/dashboard/packages/local-runtime/src/server-run-projections.test.ts +12 -2
  123. package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-command.test.ts +29 -4
  124. package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-refresh.ts +7 -0
  125. package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +51 -54
  126. package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +28 -45
  127. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-filter-matrix.test.ts +5 -0
  128. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.test.ts +49 -0
  129. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.ts +44 -1
  130. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-cached-cost-page.ts +11 -10
  131. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-summary.ts +1 -1
  132. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-work-item-index.test.ts +18 -1
  133. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  134. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  135. package/templates/.agents/design/.zaip-managed.json +3 -3
  136. package/templates/.agents/design/apps/catalog/package.json +1 -1
  137. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  138. package/templates/.agents/requirements/autonomous-assurance.md +11 -2
  139. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  140. package/templates/.agents/requirements/comparative-audit.md +1 -1
  141. package/templates/.agents/requirements/context-engine.md +1 -1
  142. package/templates/.agents/requirements/cost-observability.md +1 -1
  143. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  144. package/templates/.agents/requirements/data-export.md +1 -1
  145. package/templates/.agents/requirements/design-system.md +1 -1
  146. package/templates/.agents/requirements/execution-engine.md +1 -1
  147. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  148. package/templates/.agents/requirements/model-orchestration.md +1 -1
  149. package/templates/.agents/requirements/public-distribution.md +1 -1
  150. package/templates/.agents/requirements/software-architecture.md +1 -1
  151. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  152. package/templates/.agents/requirements/work-lifecycle.md +2 -1
  153. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  154. package/templates/.agents/rules/run-lifecycle-closure.md +2 -1
  155. package/templates/.agents/rules/workflow.md +1 -0
  156. package/templates/.agents/runtime/VERSION +1 -1
  157. package/templates/.agents/runtime/bin/zaip.mjs +1178 -764
  158. package/templates/.agents/runtime/checksums.sha256 +6 -6
  159. package/templates/.agents/runtime/manifest.json +1 -1
  160. package/templates/.agents/runtime/pnpm-lock.sha256 +1 -1
  161. package/templates/.agents/runtime/provenance.json +5 -5
  162. package/templates/.agents/runtime/sbom.cdx.json +59 -59
  163. package/templates/.agents/skills/zaip-skill-execution/SKILL.md +1 -1
  164. package/templates/.agents/skills/zaip-skill-execution/references/controlled-release-recovery.md +14 -0
  165. package/templates/.agents/skills/zaip-skill-execution/references/runtime-governance.md +1 -1
  166. package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +5 -1
  167. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs +12 -0
  168. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.test.mjs +25 -0
  169. package/templates/.agents/skills/zaip-skill-maintenance-enter/SKILL.md +23 -0
  170. package/templates/.agents/skills/zaip-skill-maintenance-enter/agents/openai.yaml +4 -0
  171. package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.mjs +213 -0
  172. package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.test.mjs +207 -0
  173. package/templates/.agents/skills/zaip-skill-maintenance-exit/SKILL.md +21 -0
  174. package/templates/.agents/skills/zaip-skill-maintenance-exit/agents/openai.yaml +4 -0
  175. package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +2 -0
  176. package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +37 -8
  177. package/templates/.agents/zaip-aios/VERSION +1 -1
  178. package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +38 -0
  179. package/templates/template-manifest.json +188 -116
  180. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-Co2Jiuzh.js +0 -68
@@ -355,11 +355,18 @@ export interface RunProjection {
355
355
  artifact_path: string;
356
356
  status: "running" | "completed" | "failed" | "cancelled";
357
357
  phase: string;
358
- entrypoint: "conversation" | "task" | "spec" | "prd";
358
+ entrypoint: "observation" | "conversation" | "task" | "spec" | "prd";
359
359
  work_type: "new" | "rework";
360
360
  run_role: "intake" | "orchestrator" | "subagent";
361
361
  run_kind: "run" | "subrun";
362
- run_purpose: "intake" | "orchestration" | "execution" | "review" | "audit" | "finalization";
362
+ run_purpose:
363
+ | "observation"
364
+ | "intake"
365
+ | "orchestration"
366
+ | "execution"
367
+ | "review"
368
+ | "audit"
369
+ | "finalization";
363
370
  requires_finalizer: boolean;
364
371
  parent_run_id: string | null;
365
372
  client: string;
@@ -378,7 +385,7 @@ export interface RunProjection {
378
385
  terminal_call_count: number | null;
379
386
  failed_call_count: number | null;
380
387
  cancelled_call_count: number | null;
381
- conversation_id: string;
388
+ conversation_id: string | null;
382
389
  client_thread_id?: string | null;
383
390
  client_turn_id?: string | null;
384
391
  is_active?: boolean;
@@ -600,16 +607,4 @@ export interface TaskDetailProjection {
600
607
  artifact_path: string;
601
608
  }
602
609
 
603
- export interface PrdDetailProjection {
604
- id: string;
605
- title: string;
606
- body: string;
607
- artifact_path: string;
608
- }
609
-
610
- export interface SpecDetailProjection {
611
- id: string;
612
- title: string;
613
- body: string;
614
- artifact_path: string;
615
- }
610
+ export type { PrdDetailProjection, SpecDetailProjection } from "./planning-contracts.js";
@@ -0,0 +1,14 @@
1
+ /** Canonical detail payloads for PRD and SPEC drilldowns. */
2
+ export interface PrdDetailProjection {
3
+ id: string;
4
+ title: string;
5
+ body: string;
6
+ artifact_path: string;
7
+ }
8
+
9
+ export interface SpecDetailProjection {
10
+ id: string;
11
+ title: string;
12
+ body: string;
13
+ artifact_path: string;
14
+ }
@@ -0,0 +1,65 @@
1
+ import { DataTable, formatDateTime } from "@zaip-ai/dashboard-ui";
2
+ import { useState } from "react";
3
+ import type { DecisionProjection } from "../contracts.js";
4
+ import { EntityDetailsDialog } from "./EntityDetailsDialog.js";
5
+ import { DecisionOriginBadge, DecisionStageBadge } from "./EntityTableBadges.js";
6
+ import type { OperationsLocale } from "./status-labels.js";
7
+ import { sortByDateDesc } from "./table-order.js";
8
+
9
+ export function DecisionTable({
10
+ rows,
11
+ locale,
12
+ }: {
13
+ rows: readonly DecisionProjection[];
14
+ locale: OperationsLocale;
15
+ }) {
16
+ const [selected, setSelected] = useState<DecisionProjection | null>(null);
17
+ const orderedRows = sortByDateDesc(rows, (row) => row.created_at);
18
+ return (
19
+ <>
20
+ <DataTable
21
+ columns={[
22
+ {
23
+ key: "date",
24
+ label: "Data de criação",
25
+ render: (row) => formatDateTime(row.created_at),
26
+ },
27
+ {
28
+ key: "title",
29
+ label: "Decisão",
30
+ render: (row) => (
31
+ <>
32
+ <strong>{row.title}</strong>
33
+ <small>{row.id}</small>
34
+ </>
35
+ ),
36
+ },
37
+ {
38
+ key: "origin",
39
+ label: "Origem",
40
+ render: (row) => <DecisionOriginBadge origin={row.origin} />,
41
+ },
42
+ {
43
+ key: "stage",
44
+ label: "Fase",
45
+ render: (row) => <DecisionStageBadge scopeType={row.scope_type} />,
46
+ },
47
+ { key: "scope", label: "Escopo", render: (row) => `${row.scope_type}: ${row.scope_id}` },
48
+ ]}
49
+ locale={locale}
50
+ rowKey={(row) => row.id}
51
+ onRowClick={setSelected}
52
+ rows={orderedRows}
53
+ showColumnInfo
54
+ sortable
55
+ />
56
+ {selected ? (
57
+ <EntityDetailsDialog
58
+ details={{ kind: "decision", row: selected }}
59
+ locale={locale}
60
+ onClose={() => setSelected(null)}
61
+ />
62
+ ) : null}
63
+ </>
64
+ );
65
+ }
@@ -5,12 +5,7 @@ import {
5
5
  formatDateTime,
6
6
  } from "@zaip-ai/dashboard-ui";
7
7
  import { useState } from "react";
8
- import type {
9
- ChangeProjection,
10
- DecisionProjection,
11
- ExecutionProjection,
12
- RunProjection,
13
- } from "../contracts.js";
8
+ import type { ChangeProjection, ExecutionProjection, RunProjection } from "../contracts.js";
14
9
  import { buildConversationRows } from "./conversation-rows.js";
15
10
  import { EntityDetailsDialog } from "./EntityDetailsDialog.js";
16
11
  import { displayedDuration, formatDisplayedDuration } from "./operation-duration.js";
@@ -569,6 +564,7 @@ function runPurposeLabel(purpose: RunProjection["run_purpose"], locale: Operatio
569
564
  review: "Revisão",
570
565
  audit: "Auditoria",
571
566
  finalization: "Finalização",
567
+ observation: "Observação",
572
568
  }[purpose];
573
569
  }
574
570
 
@@ -701,7 +697,7 @@ export function canBuildCanonicalConversationRows(
701
697
  } => execution.kind === "interaction" && execution.origin.type === "interaction",
702
698
  )
703
699
  .every((execution) => execution.origin.conversation_id.trim().length > 0) &&
704
- rows.every((row) => row.id.trim().length > 0 && row.conversation_id.trim().length > 0)
700
+ rows.every((row) => row.id.trim().length > 0 && (row.conversation_id?.trim().length ?? 0) > 0)
705
701
  );
706
702
  }
707
703
 
@@ -721,68 +717,6 @@ function CanonicalEntityLoadingState({
721
717
  );
722
718
  }
723
719
 
724
- export function DecisionTable({
725
- rows,
726
- locale,
727
- }: {
728
- rows: readonly DecisionProjection[];
729
- locale: OperationsLocale;
730
- }) {
731
- const [selected, setSelected] = useState<DecisionProjection | null>(null);
732
- const orderedRows = sortByDateDesc(rows, (row) => row.created_at);
733
- return (
734
- <>
735
- <DataTable
736
- columns={[
737
- {
738
- key: "date",
739
- label: "Data de criação",
740
- render: (row) => formatDateTime(row.created_at),
741
- },
742
- {
743
- key: "title",
744
- label: "Decisão",
745
- render: (row) => (
746
- <>
747
- <strong>{row.title}</strong>
748
- <small>{row.id}</small>
749
- </>
750
- ),
751
- },
752
- {
753
- key: "origin",
754
- label: "Origem",
755
- render: (row) => <DecisionOriginBadge origin={row.origin} />,
756
- },
757
- {
758
- key: "stage",
759
- label: "Fase",
760
- render: (row) => <DecisionStageBadge scopeType={row.scope_type} />,
761
- },
762
- { key: "scope", label: "Escopo", render: (row) => `${row.scope_type}: ${row.scope_id}` },
763
- ]}
764
- locale={locale}
765
- rowKey={(row) => row.id}
766
- onRowClick={setSelected}
767
- rows={orderedRows}
768
- showColumnInfo
769
- sortable
770
- />
771
- {selected ? (
772
- <EntityDetailsDialog
773
- details={{ kind: "decision", row: selected }}
774
- locale={locale}
775
- onClose={() => setSelected(null)}
776
- />
777
- ) : null}
778
- </>
779
- );
780
- }
720
+ export { DecisionTable } from "./DecisionTable.js";
781
721
 
782
- import {
783
- DecisionOriginBadge,
784
- DecisionStageBadge,
785
- EntryBadge,
786
- RiskBadge,
787
- StatusBadge,
788
- } from "./EntityTableBadges.js";
722
+ import { EntryBadge, RiskBadge, StatusBadge } from "./EntityTableBadges.js";
@@ -20,6 +20,7 @@ import {
20
20
  workListTypeOnViewChange,
21
21
  } from "./operations-page-contract.js";
22
22
  import { useOperationFilterFeedback } from "./use-operation-filter-feedback.js";
23
+ import { useOperationsFilterSync } from "./use-operations-filter-sync.js";
23
24
 
24
25
  export {
25
26
  type DashboardGlobalFilters,
@@ -179,43 +180,17 @@ export function OperationsPage({
179
180
  setRiskFilter("");
180
181
  setOriginFilter("");
181
182
  };
182
- useEffect(() => {
183
- // The parent replaces the aggregate snapshot while a period transition is
184
- // loading. Defer paged entity hydration until that replacement is stable,
185
- // otherwise the aggregate response can overwrite a newer entity page.
186
- if (loading) return;
187
- if (view === "work-kanban" || view === "work-list") {
188
- const timeout = window.setTimeout(() => {
189
- const filters = {
190
- query,
191
- status: statusFilter,
192
- risk: riskFilter,
193
- origin: originFilter,
194
- };
195
- if (view === "work-kanban") onBoardFiltersChange?.(filters);
196
- else onWorkListFiltersChange?.(filters);
197
- }, 180);
198
- return () => window.clearTimeout(timeout);
199
- }
200
- if (!["runs", "conversations", "executions", "changes", "decisions"].includes(view)) return;
201
- const timeout = window.setTimeout(() => {
202
- onEntityFiltersChange?.(
203
- view as "runs" | "conversations" | "executions" | "changes" | "decisions",
204
- { query, status: statusFilter, risk: riskFilter },
205
- );
206
- }, 180);
207
- return () => window.clearTimeout(timeout);
208
- }, [
209
- onBoardFiltersChange,
210
- onWorkListFiltersChange,
211
- onEntityFiltersChange,
183
+ useOperationsFilterSync({
212
184
  loading,
213
- originFilter,
185
+ view,
214
186
  query,
215
- riskFilter,
216
187
  statusFilter,
217
- view,
218
- ]);
188
+ riskFilter,
189
+ originFilter,
190
+ onBoardFiltersChange,
191
+ onWorkListFiltersChange,
192
+ onEntityFiltersChange,
193
+ });
219
194
  // Only work views interpret a status option as a canonical work stage.
220
195
  // Runs, Changes and Executions use their respective persisted statuses.
221
196
  const hasEntityStageStatus =
@@ -329,6 +304,7 @@ export function OperationsPage({
329
304
  (row) =>
330
305
  row.entrypoint === "conversation" &&
331
306
  row.task_id === null &&
307
+ row.conversation_id !== null &&
332
308
  conversationIds.has(row.conversation_id),
333
309
  );
334
310
  const decisions = data.decisions.filter(
@@ -756,5 +732,3 @@ export function OperationsPage({
756
732
  </main>
757
733
  );
758
734
  }
759
-
760
- /** Loading is never a valid zero-valued Operations projection. */
@@ -188,13 +188,18 @@ describe("overview period filter", () => {
188
188
 
189
189
  it("resets the real List navigation callback on re-entry without changing Kanban routing", () => {
190
190
  const source = readFileSync(new URL("OperationsPage.tsx", import.meta.url), "utf8");
191
+ const filterSync = readFileSync(
192
+ new URL("use-operations-filter-sync.ts", import.meta.url),
193
+ "utf8",
194
+ );
191
195
 
192
196
  expect(workListTypeOnViewChange("work-list")).toBe("all");
193
197
  expect(workListTypeOnViewChange("work-kanban")).toBeNull();
194
198
  expect(source).toContain("const nextWorkListType = workListTypeOnViewChange(nextView)");
195
199
  expect(source).toContain("onWorkListTypeChange?.(nextWorkListType)");
196
- expect(source).toContain('if (view === "work-kanban") onBoardFiltersChange?.(filters)');
197
- expect(source).toContain("else onWorkListFiltersChange?.(filters)");
200
+ expect(source).toContain("useOperationsFilterSync({");
201
+ expect(filterSync).toContain('if (view === "work-kanban") onBoardFiltersChange?.(filters)');
202
+ expect(filterSync).toContain("else onWorkListFiltersChange?.(filters)");
198
203
  });
199
204
 
200
205
  it("scopes task and macro metrics to the active overview entity kind", () => {
@@ -0,0 +1,66 @@
1
+ import { useEffect } from "react";
2
+ import type { OperationsPageProps } from "./operations-page-contract.js";
3
+ import type { OperationsView } from "./operations-page-filters.js";
4
+ import type { TaskOrigin } from "./task-origin.js";
5
+
6
+ interface OperationsFilterSyncInput {
7
+ loading: boolean;
8
+ view: OperationsView;
9
+ query: string;
10
+ statusFilter: string;
11
+ riskFilter: string;
12
+ originFilter: TaskOrigin | "";
13
+ onBoardFiltersChange: OperationsPageProps["onBoardFiltersChange"];
14
+ onWorkListFiltersChange: OperationsPageProps["onWorkListFiltersChange"];
15
+ onEntityFiltersChange: OperationsPageProps["onEntityFiltersChange"];
16
+ }
17
+
18
+ export function useOperationsFilterSync({
19
+ loading,
20
+ view,
21
+ query,
22
+ statusFilter,
23
+ riskFilter,
24
+ originFilter,
25
+ onBoardFiltersChange,
26
+ onWorkListFiltersChange,
27
+ onEntityFiltersChange,
28
+ }: OperationsFilterSyncInput): void {
29
+ useEffect(() => {
30
+ // The parent replaces the aggregate snapshot while a period transition is
31
+ // loading. Defer paged entity hydration until that replacement is stable,
32
+ // otherwise the aggregate response can overwrite a newer entity page.
33
+ if (loading) return;
34
+ if (view === "work-kanban" || view === "work-list") {
35
+ const timeout = window.setTimeout(() => {
36
+ const filters = {
37
+ query,
38
+ status: statusFilter,
39
+ risk: riskFilter,
40
+ origin: originFilter,
41
+ };
42
+ if (view === "work-kanban") onBoardFiltersChange?.(filters);
43
+ else onWorkListFiltersChange?.(filters);
44
+ }, 180);
45
+ return () => window.clearTimeout(timeout);
46
+ }
47
+ if (!["runs", "conversations", "executions", "changes", "decisions"].includes(view)) return;
48
+ const timeout = window.setTimeout(() => {
49
+ onEntityFiltersChange?.(
50
+ view as "runs" | "conversations" | "executions" | "changes" | "decisions",
51
+ { query, status: statusFilter, risk: riskFilter },
52
+ );
53
+ }, 180);
54
+ return () => window.clearTimeout(timeout);
55
+ }, [
56
+ onBoardFiltersChange,
57
+ onWorkListFiltersChange,
58
+ onEntityFiltersChange,
59
+ loading,
60
+ originFilter,
61
+ query,
62
+ riskFilter,
63
+ statusFilter,
64
+ view,
65
+ ]);
66
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-traceability",
3
- "version": "4.9.0",
3
+ "version": "5.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-branding",
3
- "version": "4.9.0",
3
+ "version": "5.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-contracts",
3
- "version": "4.9.0",
3
+ "version": "5.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-data-export",
3
- "version": "4.9.0",
3
+ "version": "5.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {