@zaip-ai/cli 4.8.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.
- package/dist/services/adapter-hook-sources.d.ts +3 -0
- package/dist/services/adapter-hook-sources.d.ts.map +1 -1
- package/dist/services/adapter-hook-sources.js +3 -0
- package/dist/services/adapter-hook-sources.js.map +1 -1
- package/dist/services/adapters.d.ts +1 -1
- package/dist/services/adapters.d.ts.map +1 -1
- package/dist/services/adapters.js +5 -2
- package/dist/services/adapters.js.map +1 -1
- package/dist/services/adapters.test.js +1 -1
- package/dist/services/adapters.test.js.map +1 -1
- package/dist/services/codex-conversation-lifecycle-hook.d.ts.map +1 -1
- package/dist/services/codex-conversation-lifecycle-hook.js +16 -6
- package/dist/services/codex-conversation-lifecycle-hook.js.map +1 -1
- package/dist/services/codex-hook-activation.d.ts +1 -1
- package/dist/services/codex-hook-activation.d.ts.map +1 -1
- package/dist/services/codex-hook-activation.js +116 -10
- package/dist/services/codex-hook-activation.js.map +1 -1
- package/dist/services/codex-pre-tool-cli-capture-template.d.ts +2 -0
- package/dist/services/codex-pre-tool-cli-capture-template.d.ts.map +1 -0
- package/dist/services/codex-pre-tool-cli-capture-template.js +104 -0
- package/dist/services/codex-pre-tool-cli-capture-template.js.map +1 -0
- package/dist/services/codex-pre-tool-cloud-template.d.ts +2 -0
- package/dist/services/codex-pre-tool-cloud-template.d.ts.map +1 -0
- package/dist/services/codex-pre-tool-cloud-template.js +190 -0
- package/dist/services/codex-pre-tool-cloud-template.js.map +1 -0
- package/dist/services/codex-pre-tool-dependencies.test-support.d.ts +2 -0
- package/dist/services/codex-pre-tool-dependencies.test-support.d.ts.map +1 -0
- package/dist/services/codex-pre-tool-dependencies.test-support.js +9 -0
- package/dist/services/codex-pre-tool-dependencies.test-support.js.map +1 -0
- package/dist/services/codex-pre-tool-hook-fixture.test-support.d.ts +5 -0
- package/dist/services/codex-pre-tool-hook-fixture.test-support.d.ts.map +1 -0
- package/dist/services/codex-pre-tool-hook-fixture.test-support.js +19 -0
- package/dist/services/codex-pre-tool-hook-fixture.test-support.js.map +1 -0
- package/dist/services/codex-pre-tool-hook-template-bootstrap.test.d.ts +2 -0
- package/dist/services/codex-pre-tool-hook-template-bootstrap.test.d.ts.map +1 -0
- package/dist/services/codex-pre-tool-hook-template-bootstrap.test.js +107 -0
- package/dist/services/codex-pre-tool-hook-template-bootstrap.test.js.map +1 -0
- package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-hook-template.js +152 -190
- package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
- package/dist/services/codex-pre-tool-hook-template.test.js +63 -75
- package/dist/services/codex-pre-tool-hook-template.test.js.map +1 -1
- package/dist/services/codex-pre-tool-host-context-template.d.ts +2 -0
- package/dist/services/codex-pre-tool-host-context-template.d.ts.map +1 -0
- package/dist/services/codex-pre-tool-host-context-template.js +139 -0
- package/dist/services/codex-pre-tool-host-context-template.js.map +1 -0
- package/dist/services/codex-pre-tool-support-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-support-template.js +77 -100
- package/dist/services/codex-pre-tool-support-template.js.map +1 -1
- package/dist/services/codex-subagent-hook-template.d.ts +1 -1
- package/dist/services/codex-subagent-hook-template.d.ts.map +1 -1
- package/dist/services/codex-subagent-hook-template.js +59 -15
- package/dist/services/codex-subagent-hook-template.js.map +1 -1
- package/dist/services/codex-validation-runtime-template.d.ts.map +1 -1
- package/dist/services/codex-validation-runtime-template.js +37 -10
- package/dist/services/codex-validation-runtime-template.js.map +1 -1
- package/dist/services/runtime-template-test-support.d.ts +1 -0
- package/dist/services/runtime-template-test-support.d.ts.map +1 -1
- package/dist/services/runtime-template-test-support.js +23 -2
- package/dist/services/runtime-template-test-support.js.map +1 -1
- package/dist/services/runtime-template.test.js +7 -24
- package/dist/services/runtime-template.test.js.map +1 -1
- package/package.json +1 -1
- package/templates/.agents/README-ENG.md +49 -7
- package/templates/.agents/README.md +41 -10
- package/templates/.agents/config/agents/discovery.json +1 -1
- package/templates/.agents/dashboard/.zaip-managed.json +125 -73
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-BW7Vy1cp.js → CostCalculationGuidePage-w6pjt4OM.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-BN8KQPrr.js → DashboardHelpDialog-DhlntQcR.js} +117 -17
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-Prcs-ydy.js → PricingSettingsDialog-BHoZT2an.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-HqGUImIG.js → ProjectSettingsPage-IcncIZ9Y.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-CNpmQMO4.js → TraceabilityWorkspace-C6rORjpr.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-uPnOBShc.js +68 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-CF7B1Hjn.js → dashboard-localization-DWXjEIgc.js} +49 -7
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-DOhy6D2-.js → icons-vendor-Hc9fp_gs.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-DX65Ufuu.js → index-BqeOEZW5.js} +2 -2
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CkPC-yMz.js → react-vendor-C9ta_O10.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-BEdGoIDm.js → traceability-IcefoTOv.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
- package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/contracts.ts +10 -3
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.run-page.test.ts +5 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.period-values.test.tsx +2 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables-keeps-legacy-codex-identity-fields-blank.test.ts +5 -5
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +36 -43
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-loaders.ts +1 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-table-formatters.ts +6 -4
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/aggregate.ts +2 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.ts +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +11 -25
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/cost-summary-defaults.ts +26 -0
- package/templates/.agents/dashboard/modules/operations/package.json +1 -1
- package/templates/.agents/dashboard/modules/operations/src/contracts.ts +11 -16
- package/templates/.agents/dashboard/modules/operations/src/planning-contracts.ts +14 -0
- package/templates/.agents/dashboard/modules/operations/src/react/DecisionTable.tsx +65 -0
- package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.tsx +5 -71
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +10 -36
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +7 -2
- package/templates/.agents/dashboard/modules/operations/src/react/use-operations-filter-sync.ts +66 -0
- package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
- package/templates/.agents/dashboard/packages/branding/package.json +1 -1
- package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
- package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +229 -222
- package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +167 -167
- package/templates/.agents/dashboard/packages/local-runtime/package.json +3 -3
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +229 -222
- package/templates/.agents/dashboard/packages/local-runtime/src/active-capture-failure.test.ts +38 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/active-capture-failure.ts +35 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.test.ts +69 -6
- package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +62 -15
- package/templates/.agents/dashboard/packages/local-runtime/src/manifest-runs.ts +8 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/server-capture-projection-order.test.ts +118 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-cost-run-search.test.ts +90 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-cost-run-search.ts +86 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-routes.ts +8 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/server-projection-loaders.ts +13 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-projections.ts +30 -74
- package/templates/.agents/dashboard/packages/local-runtime/src/server-route-handlers.ts +42 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-routes.test.ts +60 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-run-projections.test.ts +12 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-command.test.ts +29 -4
- package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-refresh.ts +7 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +51 -54
- package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +37 -48
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-filter-matrix.test.ts +5 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.test.ts +49 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.ts +44 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-cached-cost-page.ts +11 -10
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-summary.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-work-item-index.test.ts +18 -1
- package/templates/.agents/dashboard/packages/local-runtime/vitest.config.ts +12 -0
- package/templates/.agents/dashboard/packages/ui/package.json +1 -1
- package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
- package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-pagination.spec.ts +13 -6
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +1 -1
- package/templates/.agents/design/.zaip-managed.json +3 -3
- package/templates/.agents/design/apps/catalog/package.json +1 -1
- package/templates/.agents/design/packages/local-runtime/package.json +1 -1
- package/templates/.agents/requirements/autonomous-assurance.md +39 -3
- package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
- package/templates/.agents/requirements/comparative-audit.md +1 -1
- package/templates/.agents/requirements/context-engine.md +3 -3
- package/templates/.agents/requirements/cost-observability.md +1 -1
- package/templates/.agents/requirements/dashboard-launch.md +1 -1
- package/templates/.agents/requirements/data-export.md +1 -1
- package/templates/.agents/requirements/design-system.md +1 -1
- package/templates/.agents/requirements/execution-engine.md +11 -2
- package/templates/.agents/requirements/kanban-dashboard.md +1 -1
- package/templates/.agents/requirements/model-orchestration.md +1 -1
- package/templates/.agents/requirements/public-distribution.md +1 -1
- package/templates/.agents/requirements/software-architecture.md +1 -1
- package/templates/.agents/requirements/strategic-improvements.md +1 -1
- package/templates/.agents/requirements/work-lifecycle.md +2 -1
- package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
- package/templates/.agents/rules/cloud-hostinger-autonomy.md +1 -1
- package/templates/.agents/rules/production-readiness.md +24 -0
- package/templates/.agents/rules/run-lifecycle-closure.md +2 -1
- package/templates/.agents/rules/security.md +2 -2
- package/templates/.agents/rules/workflow.md +4 -3
- package/templates/.agents/runtime/VERSION +1 -1
- package/templates/.agents/runtime/bin/zaip.mjs +1185 -610
- package/templates/.agents/runtime/checksums.sha256 +6 -6
- package/templates/.agents/runtime/manifest.json +1 -1
- package/templates/.agents/runtime/pnpm-lock.sha256 +1 -1
- package/templates/.agents/runtime/provenance.json +5 -5
- package/templates/.agents/runtime/sbom.cdx.json +71 -71
- package/templates/.agents/skills/zaip-skill-execution/SKILL.md +4 -2
- package/templates/.agents/skills/zaip-skill-execution/references/controlled-release-recovery.md +44 -0
- package/templates/.agents/skills/zaip-skill-execution/references/runtime-governance.md +1 -1
- package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +7 -1
- package/templates/.agents/skills/zaip-skill-github-deploy/references/release-gate-matrix.md +15 -20
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs +38 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.test.mjs +62 -4
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +8 -6
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/guarded-commits.mjs +5 -3
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/SKILL.md +7 -0
- package/templates/.agents/skills/zaip-skill-maintenance-enter/SKILL.md +23 -0
- package/templates/.agents/skills/zaip-skill-maintenance-enter/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.mjs +213 -0
- package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.test.mjs +207 -0
- package/templates/.agents/skills/zaip-skill-maintenance-exit/SKILL.md +21 -0
- package/templates/.agents/skills/zaip-skill-maintenance-exit/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-prd/SKILL.md +6 -0
- package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +26 -0
- package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +46 -11
- package/templates/.agents/skills/zaip-skill-spec/SKILL.md +9 -0
- package/templates/.agents/skills/zaip-skill-testing-strategy/SKILL.md +15 -0
- package/templates/.agents/zaip-aios/VERSION +1 -1
- package/templates/.agents/zaip-aios/guides/11-observabilidade-e-custos.md +22 -0
- package/templates/.agents/zaip-aios/guides/14-troubleshooting.md +1 -1
- package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +52 -5
- package/templates/template-manifest.json +210 -126
- 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:
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
185
|
+
view,
|
|
214
186
|
query,
|
|
215
|
-
riskFilter,
|
|
216
187
|
statusFilter,
|
|
217
|
-
|
|
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(
|
|
197
|
-
expect(
|
|
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", () => {
|
package/templates/.agents/dashboard/modules/operations/src/react/use-operations-filter-sync.ts
ADDED
|
@@ -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
|
+
}
|