@zaip-ai/cli 5.0.0 → 5.1.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/adapters.d.ts +1 -1
- package/dist/services/adapters.js +1 -1
- package/package.json +1 -1
- package/templates/.agents/README-ENG.md +9 -0
- package/templates/.agents/README.md +9 -0
- package/templates/.agents/config/agents/discovery.json +1 -1
- package/templates/.agents/dashboard/.zaip-managed.json +95 -55
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-w6pjt4OM.js → CostCalculationGuidePage-uR-asJv_.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-DhlntQcR.js → DashboardHelpDialog-CngnpoLL.js} +12 -3
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-BHoZT2an.js → PricingSettingsDialog-Bszw3ekd.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-IcncIZ9Y.js → ProjectSettingsPage-IJ1znG4w.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-C6rORjpr.js → TraceabilityWorkspace-CsBpHqq_.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-uPnOBShc.js → cost-monitor-B0Jwz_rk.js} +4 -4
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-DWXjEIgc.js → dashboard-localization-D41g5rdo.js} +9 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-Hc9fp_gs.js → icons-vendor-CjGGux6h.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Bedlm0f7.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-C9ta_O10.js → react-vendor-B9jZSAKf.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-IcefoTOv.js → traceability-DFpwb0TN.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
- package/templates/.agents/dashboard/apps/frontend/package.json +2 -2
- package/templates/.agents/dashboard/apps/frontend/src/AppDashboardContent.tsx +3 -0
- package/templates/.agents/dashboard/apps/frontend/src/AppOverlays.tsx +16 -7
- package/templates/.agents/dashboard/apps/frontend/src/__tests__/app-composition-support.ts +1 -0
- package/templates/.agents/dashboard/apps/frontend/src/cost-period-refresh.test.ts +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/operations-period-render.test.ts +2 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-trace-documents.navigation.test.tsx +125 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-trace-documents.ts +67 -9
- package/templates/.agents/dashboard/apps/frontend/src/use-dashboard-app-model.tsx +15 -15
- package/templates/.agents/dashboard/apps/frontend/src/use-dashboard-locale.ts +18 -0
- package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
- package/templates/.agents/dashboard/modules/operations/package.json +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +4 -39
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewTopPanel.navigation.test.tsx +150 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewTopPanel.tsx +7 -3
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +4 -7
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPageOverview.tsx +3 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-contract.ts +51 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +5 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operations-page-contract.ts +1 -0
- package/templates/.agents/dashboard/modules/operations/src/react/use-operations-default-range.ts +16 -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/dashboard-build-fingerprint.mjs +87 -0
- package/templates/.agents/dashboard/packages/local-runtime/dashboard-build-fingerprint.test.mjs +48 -0
- package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/scripts/build-frontend.mjs +29 -0
- package/templates/.agents/dashboard/packages/local-runtime/scripts/build-sqlite-runtime.mjs +5 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-build.mjs +12 -5
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-paths.mjs +8 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +1 -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/qualify-top-five-trace.mjs +53 -0
- package/templates/.agents/dashboard/tests/e2e/verify-top-five-served.mjs +78 -0
- package/templates/.agents/design/.zaip-managed.json +14 -6
- package/templates/.agents/design/apps/catalog/dist/assets/index-BGxXxXTo.js +72 -0
- package/templates/.agents/design/apps/catalog/dist/index.html +1 -1
- package/templates/.agents/design/apps/catalog/package.json +1 -1
- package/templates/.agents/design/apps/catalog/src/components/TopEntitiesSpecimen.tsx +45 -0
- package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +3 -1
- package/templates/.agents/design/apps/catalog/src/stories/Components.stories.tsx +2 -0
- package/templates/.agents/design/packages/local-runtime/package.json +1 -1
- package/templates/.agents/requirements/autonomous-assurance.md +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
- package/templates/.agents/runtime/VERSION +1 -1
- package/templates/.agents/runtime/bin/zaip.mjs +10 -10
- 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 +1 -1
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract-cli.test.mjs +53 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.test.mjs +1 -32
- package/templates/.agents/zaip-aios/VERSION +1 -1
- package/templates/.agents/zaip-aios/guides/10-seguranca.md +2 -2
- package/templates/template-manifest.json +146 -94
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-BqeOEZW5.js +0 -2
|
@@ -25,6 +25,7 @@ export function OperationsPageOverview({
|
|
|
25
25
|
locale,
|
|
26
26
|
onOpenTask,
|
|
27
27
|
onOpenDocument,
|
|
28
|
+
onOpenMacro,
|
|
28
29
|
onLoadStatus,
|
|
29
30
|
statusPage,
|
|
30
31
|
onLoadStatusPage,
|
|
@@ -55,6 +56,7 @@ export function OperationsPageOverview({
|
|
|
55
56
|
locale: OperationsLocale;
|
|
56
57
|
onOpenTask: OverviewProps["onOpenTask"];
|
|
57
58
|
onOpenDocument: OverviewProps["onOpenDocument"];
|
|
59
|
+
onOpenMacro: OverviewProps["onOpenMacro"];
|
|
58
60
|
onLoadStatus: OverviewProps["onLoadStatus"];
|
|
59
61
|
statusPage: OverviewProps["statusPage"];
|
|
60
62
|
onLoadStatusPage: OverviewProps["onLoadStatusPage"];
|
|
@@ -96,6 +98,7 @@ export function OperationsPageOverview({
|
|
|
96
98
|
}}
|
|
97
99
|
onOpenTask={onOpenTask}
|
|
98
100
|
onOpenDocument={onOpenDocument}
|
|
101
|
+
onOpenMacro={onOpenMacro}
|
|
99
102
|
onLoadStatus={onLoadStatus}
|
|
100
103
|
statusPage={statusPage}
|
|
101
104
|
onLoadStatusPage={onLoadStatusPage}
|
package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-contract.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { OperationsProjection } from "../contracts.js";
|
|
2
|
+
import type { OperationDatePreset, OperationDateRange } from "./operation-date-range.js";
|
|
3
|
+
import type {
|
|
4
|
+
FactualCostFact,
|
|
5
|
+
OverviewClassification,
|
|
6
|
+
OverviewClassificationPage,
|
|
7
|
+
OverviewStatusKind,
|
|
8
|
+
OverviewStatusPage,
|
|
9
|
+
} from "./operations-page-contract.js";
|
|
10
|
+
import type { OperationsLocale } from "./status-labels.js";
|
|
11
|
+
import type { WorkStage } from "./work-board-model.js";
|
|
12
|
+
export interface OperationsOverviewProps {
|
|
13
|
+
currency: "BRL" | "USD";
|
|
14
|
+
data: OperationsProjection;
|
|
15
|
+
/** App-controlled range paired with datePreset; retained by Page while loading. */
|
|
16
|
+
dateRange?: OperationDateRange;
|
|
17
|
+
datePreset: OperationDatePreset;
|
|
18
|
+
locale: OperationsLocale;
|
|
19
|
+
onDatePresetChange: (preset: OperationDatePreset) => void;
|
|
20
|
+
onOpenTask: (taskId: string) => Promise<boolean>;
|
|
21
|
+
onOpenDocument: (kind: "prd" | "spec", id: string) => void;
|
|
22
|
+
onOpenMacro: (kind: "prd" | "spec", id: string) => void;
|
|
23
|
+
onLoadStatus?: ((stage: WorkStage, kind: OverviewStatusKind, offset: number) => void) | undefined;
|
|
24
|
+
statusPage?:
|
|
25
|
+
| ((stage: WorkStage, kind: OverviewStatusKind) => OverviewStatusPage | undefined)
|
|
26
|
+
| undefined;
|
|
27
|
+
onLoadStatusPage?:
|
|
28
|
+
| ((stage: WorkStage, kind: OverviewStatusKind, offset: number) => void)
|
|
29
|
+
| undefined;
|
|
30
|
+
classificationPage?:
|
|
31
|
+
| ((
|
|
32
|
+
kind: OverviewStatusKind,
|
|
33
|
+
classification: OverviewClassification,
|
|
34
|
+
) => OverviewClassificationPage | undefined)
|
|
35
|
+
| undefined;
|
|
36
|
+
onLoadClassificationPage?:
|
|
37
|
+
| ((kind: OverviewStatusKind, classification: OverviewClassification, offset: number) => void)
|
|
38
|
+
| undefined;
|
|
39
|
+
onLoadMacroMetrics?: (() => void) | undefined;
|
|
40
|
+
prds?: OperationsProjection["prds"];
|
|
41
|
+
runs?: OperationsProjection["runs"];
|
|
42
|
+
specs?: OperationsProjection["specs"];
|
|
43
|
+
tasks?: OperationsProjection["tasks"];
|
|
44
|
+
/** Factual Cost Monitor snapshot total for the selected locale/currency. */
|
|
45
|
+
factualCostTotal?: number | null | undefined;
|
|
46
|
+
/** Measurement completeness for the matching Cost Monitor snapshot. */
|
|
47
|
+
factualCostFact?: FactualCostFact | undefined;
|
|
48
|
+
costLoading?: boolean | undefined;
|
|
49
|
+
resolveRunCost?: ((runId: string) => number | null) | undefined;
|
|
50
|
+
includeLegacyEffort?: boolean;
|
|
51
|
+
}
|
|
@@ -118,7 +118,11 @@ describe("overview period filter", () => {
|
|
|
118
118
|
const periods = readFileSync(new URL("PeriodSummaryTable.tsx", import.meta.url), "utf8");
|
|
119
119
|
const costCard = readFileSync(new URL("OverviewCostKpi.tsx", import.meta.url), "utf8");
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
const contract = readFileSync(
|
|
122
|
+
new URL("operations-overview-contract.ts", import.meta.url),
|
|
123
|
+
"utf8",
|
|
124
|
+
);
|
|
125
|
+
expect(contract).toContain('currency: "BRL" | "USD"');
|
|
122
126
|
expect(source).toContain("const selectedCurrencyCost =");
|
|
123
127
|
expect(source).toContain("formatCurrency(value, currency, locale)");
|
|
124
128
|
expect(source).toContain("<OverviewCostKpi");
|
package/templates/.agents/dashboard/modules/operations/src/react/operations-page-contract.ts
CHANGED
|
@@ -103,6 +103,7 @@ export interface OperationsPageProps {
|
|
|
103
103
|
locale: OperationsLocale;
|
|
104
104
|
onLocaleChange: (locale: OperationsLocale) => void;
|
|
105
105
|
onOpenDocument: (kind: "prd" | "spec", id: string) => void;
|
|
106
|
+
onOpenMacro: (kind: "prd" | "spec", id: string) => void;
|
|
106
107
|
onOpenTask: (taskId: string) => Promise<boolean>;
|
|
107
108
|
onPriorityChange: (itemIds: readonly string[]) => Promise<void>;
|
|
108
109
|
onDetailDataRequest?: (view: OperationsView) => void;
|
package/templates/.agents/dashboard/modules/operations/src/react/use-operations-default-range.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { factualCostDateRange, initialOperationsDateRange } from "./operation-date-range.js";
|
|
3
|
+
import type { OperationsPageProps } from "./operations-page-contract.js";
|
|
4
|
+
export function useOperationsDefaultRange(
|
|
5
|
+
data: OperationsPageProps["data"],
|
|
6
|
+
factualCostPeriods: OperationsPageProps["factualCostPeriods"],
|
|
7
|
+
) {
|
|
8
|
+
const defaultDateRange = useMemo(() => {
|
|
9
|
+
const operationsRange = initialOperationsDateRange(
|
|
10
|
+
data.tasks,
|
|
11
|
+
Object.keys(data.summary.periods?.daily ?? {}),
|
|
12
|
+
);
|
|
13
|
+
return factualCostDateRange(factualCostPeriods?.day, operationsRange);
|
|
14
|
+
}, [data.summary.periods, data.tasks, factualCostPeriods?.day]);
|
|
15
|
+
return defaultDateRange;
|
|
16
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mkdir, readdir, readFile, rename, stat, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
4
|
+
import { dashboardBuildTargets, workspaceRoot } from "./start-dashboard-paths.mjs";
|
|
5
|
+
|
|
6
|
+
export async function contentFingerprint(paths, excluded = [], root = workspaceRoot) {
|
|
7
|
+
const entries = new Map();
|
|
8
|
+
async function visit(path) {
|
|
9
|
+
const key = relative(root, path).replaceAll("\\", "/");
|
|
10
|
+
const name = path.replaceAll("\\", "/").split("/").at(-1);
|
|
11
|
+
if (
|
|
12
|
+
["node_modules", ".turbo"].includes(name) ||
|
|
13
|
+
/\.(test|spec)\./.test(name) ||
|
|
14
|
+
excluded.some((part) => `/${key}/`.includes(part))
|
|
15
|
+
)
|
|
16
|
+
return;
|
|
17
|
+
const details = await stat(path).catch((error) => {
|
|
18
|
+
if (error.code === "ENOENT") return null;
|
|
19
|
+
throw error;
|
|
20
|
+
});
|
|
21
|
+
if (!details) {
|
|
22
|
+
entries.set(key, "missing");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (details.isDirectory()) {
|
|
26
|
+
entries.set(`${key}/`, "directory");
|
|
27
|
+
for (const entry of await readdir(path)) await visit(join(path, entry));
|
|
28
|
+
} else
|
|
29
|
+
entries.set(
|
|
30
|
+
key,
|
|
31
|
+
createHash("sha256")
|
|
32
|
+
.update(await readFile(path))
|
|
33
|
+
.digest("hex"),
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
for (const path of paths) await visit(path);
|
|
37
|
+
return createHash("sha256")
|
|
38
|
+
.update(JSON.stringify([...entries].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))))
|
|
39
|
+
.digest("hex");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const receiptPath = (name, root) => resolve(root, ".local/dashboard-build", `${name}.json`);
|
|
43
|
+
export const sourceFingerprint = (target, root = workspaceRoot) =>
|
|
44
|
+
contentFingerprint(target.sourceRoots, ["/dist/", ...target.excludedSourcePaths], root);
|
|
45
|
+
const outputFingerprint = (target, root) =>
|
|
46
|
+
contentFingerprint(target.outputRoots ?? target.artifacts, [], root);
|
|
47
|
+
|
|
48
|
+
export async function inspectBuildFingerprint(name, target, root = workspaceRoot) {
|
|
49
|
+
const receipt = await readFile(receiptPath(name, root), "utf8")
|
|
50
|
+
.then(JSON.parse)
|
|
51
|
+
.catch(() => null);
|
|
52
|
+
if (receipt?.version !== 1) return false;
|
|
53
|
+
return (
|
|
54
|
+
receipt.source === (await sourceFingerprint(target, root)) &&
|
|
55
|
+
receipt.output === (await outputFingerprint(target, root))
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function recordDashboardBuild(
|
|
60
|
+
name,
|
|
61
|
+
before,
|
|
62
|
+
target = dashboardBuildTargets[name],
|
|
63
|
+
root = workspaceRoot,
|
|
64
|
+
) {
|
|
65
|
+
const source = await sourceFingerprint(target, root);
|
|
66
|
+
if (source !== before)
|
|
67
|
+
throw new Error(
|
|
68
|
+
`Dashboard ${name} inputs changed during build; no reusable receipt was recorded`,
|
|
69
|
+
);
|
|
70
|
+
for (const path of target.artifacts) await stat(path);
|
|
71
|
+
const receipt = { version: 1, source, output: await outputFingerprint(target, root) };
|
|
72
|
+
const path = receiptPath(name, root);
|
|
73
|
+
await mkdir(dirname(path), { recursive: true });
|
|
74
|
+
const temporary = `${path}.${process.pid}.tmp`;
|
|
75
|
+
await writeFile(temporary, `${JSON.stringify(receipt)}\n`);
|
|
76
|
+
await rename(temporary, path);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export async function dashboardReleaseFrozen(root = workspaceRoot) {
|
|
80
|
+
const text = await readFile(resolve(root, ".agents/config/release-cycle.json"), "utf8").catch(
|
|
81
|
+
(error) => {
|
|
82
|
+
if (error.code === "ENOENT") return null;
|
|
83
|
+
throw error;
|
|
84
|
+
},
|
|
85
|
+
);
|
|
86
|
+
return text !== null && JSON.parse(text).state === "frozen";
|
|
87
|
+
}
|
package/templates/.agents/dashboard/packages/local-runtime/dashboard-build-fingerprint.test.mjs
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdir, mkdtemp, rm, utimes, writeFile } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { test } from "vitest";
|
|
6
|
+
import {
|
|
7
|
+
inspectBuildFingerprint,
|
|
8
|
+
recordDashboardBuild,
|
|
9
|
+
sourceFingerprint,
|
|
10
|
+
} from "./dashboard-build-fingerprint.mjs";
|
|
11
|
+
import { refreshDashboardBuildTargets } from "./start-dashboard-build.mjs";
|
|
12
|
+
|
|
13
|
+
test("build reuse follows bytes, includes missing/deleted inputs, and freezes without mutation", async (context) => {
|
|
14
|
+
const root = await mkdtemp(join(tmpdir(), "zaip-build-fingerprint-"));
|
|
15
|
+
context.onTestFinished(() => rm(root, { recursive: true, force: true }));
|
|
16
|
+
await mkdir(join(root, "src"));
|
|
17
|
+
const source = join(root, "src/readme.md"),
|
|
18
|
+
output = join(root, "bundle.js");
|
|
19
|
+
await writeFile(source, "help");
|
|
20
|
+
await writeFile(output, "bundle");
|
|
21
|
+
const target = { sourceRoots: [join(root, "src")], excludedSourcePaths: [], artifacts: [output] };
|
|
22
|
+
await recordDashboardBuild("fixture", await sourceFingerprint(target, root), target, root);
|
|
23
|
+
await utimes(source, new Date(), new Date(Date.now() + 60_000));
|
|
24
|
+
assert.equal(await inspectBuildFingerprint("fixture", target, root), true);
|
|
25
|
+
await writeFile(source, "new help");
|
|
26
|
+
assert.equal(await inspectBuildFingerprint("fixture", target, root), false);
|
|
27
|
+
const before = await sourceFingerprint(target, root);
|
|
28
|
+
await rm(source);
|
|
29
|
+
await assert.rejects(
|
|
30
|
+
recordDashboardBuild("fixture", before, target, root),
|
|
31
|
+
/changed during build/,
|
|
32
|
+
);
|
|
33
|
+
let builds = 0;
|
|
34
|
+
await assert.rejects(
|
|
35
|
+
refreshDashboardBuildTargets({
|
|
36
|
+
targets: { fixture: target },
|
|
37
|
+
frozen: true,
|
|
38
|
+
inspectTarget: async () => ({
|
|
39
|
+
missingArtifacts: [],
|
|
40
|
+
artifactsModifiedAt: 1,
|
|
41
|
+
sourcesModifiedAt: 2,
|
|
42
|
+
}),
|
|
43
|
+
runBuild: async () => builds++,
|
|
44
|
+
}),
|
|
45
|
+
/release is frozen/,
|
|
46
|
+
);
|
|
47
|
+
assert.equal(builds, 0);
|
|
48
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { recordDashboardBuild, sourceFingerprint } from "../dashboard-build-fingerprint.mjs";
|
|
4
|
+
import { dashboardBuildTargets, workspaceRoot } from "../start-dashboard-paths.mjs";
|
|
5
|
+
|
|
6
|
+
const before = await sourceFingerprint(dashboardBuildTargets.frontend);
|
|
7
|
+
const result = spawnSync(
|
|
8
|
+
process.execPath,
|
|
9
|
+
[resolve(workspaceRoot, "node_modules/vite/bin/vite.js"), "build"],
|
|
10
|
+
{
|
|
11
|
+
cwd: resolve(workspaceRoot, ".agents/dashboard/apps/frontend"),
|
|
12
|
+
windowsHide: true,
|
|
13
|
+
stdio: "inherit",
|
|
14
|
+
},
|
|
15
|
+
);
|
|
16
|
+
if (result.error) throw result.error;
|
|
17
|
+
if (result.status !== 0) process.exit(result.status ?? 1);
|
|
18
|
+
const normalized = spawnSync(
|
|
19
|
+
process.execPath,
|
|
20
|
+
[resolve(workspaceRoot, "scripts/normalize-generated-text.mjs"), "dist"],
|
|
21
|
+
{
|
|
22
|
+
cwd: resolve(workspaceRoot, ".agents/dashboard/apps/frontend"),
|
|
23
|
+
windowsHide: true,
|
|
24
|
+
stdio: "inherit",
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
if (normalized.error) throw normalized.error;
|
|
28
|
+
if (normalized.status !== 0) process.exit(normalized.status ?? 1);
|
|
29
|
+
await recordDashboardBuild("frontend", before);
|
|
@@ -2,6 +2,10 @@ import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { recordDashboardBuild, sourceFingerprint } from "../dashboard-build-fingerprint.mjs";
|
|
6
|
+
import { dashboardBuildTargets } from "../start-dashboard-paths.mjs";
|
|
7
|
+
|
|
8
|
+
const inputsBeforeBuild = await sourceFingerprint(dashboardBuildTargets.runtime);
|
|
5
9
|
|
|
6
10
|
const root = resolve(import.meta.dirname, "../../../../..");
|
|
7
11
|
const packageRoot = resolve(root, ".agents/dashboard/packages/local-runtime");
|
|
@@ -117,4 +121,5 @@ if (process.env.ZAIP_RUNTIME_METAFILE === "1") {
|
|
|
117
121
|
"utf8",
|
|
118
122
|
);
|
|
119
123
|
}
|
|
124
|
+
await recordDashboardBuild("runtime", inputsBeforeBuild);
|
|
120
125
|
process.stdout.write("SQLite dashboard runtime rebuilt.\n");
|
|
@@ -3,6 +3,7 @@ import { createHash } from "node:crypto";
|
|
|
3
3
|
import { readdir, stat } from "node:fs/promises";
|
|
4
4
|
import { join, resolve } from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
|
+
import { dashboardReleaseFrozen, inspectBuildFingerprint } from "./dashboard-build-fingerprint.mjs";
|
|
6
7
|
import { formatLauncherError } from "./start-dashboard-logging.mjs";
|
|
7
8
|
import {
|
|
8
9
|
dashboardBuildTargets,
|
|
@@ -55,7 +56,7 @@ export async function runSqliteBuild(target) {
|
|
|
55
56
|
const frontend = target === "frontend";
|
|
56
57
|
const command = process.execPath;
|
|
57
58
|
const args = frontend
|
|
58
|
-
? [resolve(
|
|
59
|
+
? [resolve(packageRoot, "scripts/build-frontend.mjs")]
|
|
59
60
|
: [
|
|
60
61
|
resolve(
|
|
61
62
|
workspaceRoot,
|
|
@@ -110,6 +111,7 @@ export async function refreshDashboardBuildTargets({
|
|
|
110
111
|
forceRebuild = process.env.ZAIP_DASHBOARD_FORCE_REBUILD === "1",
|
|
111
112
|
inspectTarget = inspectDashboardBuildTarget,
|
|
112
113
|
runBuild = runSqliteBuild,
|
|
114
|
+
frozen = undefined,
|
|
113
115
|
onProgress = () => {},
|
|
114
116
|
} = {}) {
|
|
115
117
|
const builtTargets = [];
|
|
@@ -121,10 +123,11 @@ export async function refreshDashboardBuildTargets({
|
|
|
121
123
|
"Conferindo somente as dependências que geram este artefato.",
|
|
122
124
|
);
|
|
123
125
|
const state = await inspectTarget(target);
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
const contentFresh =
|
|
127
|
+
inspectTarget === inspectDashboardBuildTarget
|
|
128
|
+
? await inspectBuildFingerprint(name, target)
|
|
129
|
+
: state.artifactsModifiedAt >= state.sourcesModifiedAt;
|
|
130
|
+
const needsBuild = forceRebuild || state.missingArtifacts.length > 0 || !contentFresh;
|
|
128
131
|
if (!needsBuild) {
|
|
129
132
|
buildProgress(
|
|
130
133
|
onProgress,
|
|
@@ -134,6 +137,10 @@ export async function refreshDashboardBuildTargets({
|
|
|
134
137
|
);
|
|
135
138
|
continue;
|
|
136
139
|
}
|
|
140
|
+
if (frozen ?? (await dashboardReleaseFrozen()))
|
|
141
|
+
throw new Error(
|
|
142
|
+
`Dashboard ${name} needs an explicit build, but the release is frozen. Reopen the release before changing candidate artifacts.`,
|
|
143
|
+
);
|
|
137
144
|
const reason = forceRebuild
|
|
138
145
|
? "A atualização foi solicitada explicitamente."
|
|
139
146
|
: state.missingArtifacts.length > 0
|
|
@@ -36,6 +36,7 @@ export const maxPortHistory = 50;
|
|
|
36
36
|
export const dashboardBuildTargets = {
|
|
37
37
|
frontend: {
|
|
38
38
|
artifacts: [resolve(frontendRoot, "index.html")],
|
|
39
|
+
outputRoots: [frontendRoot],
|
|
39
40
|
sourceRoots: [
|
|
40
41
|
resolve(workspaceRoot, ".agents/dashboard/apps/frontend/src"),
|
|
41
42
|
resolve(workspaceRoot, ".agents/dashboard/apps/frontend/public"),
|
|
@@ -54,6 +55,11 @@ export const dashboardBuildTargets = {
|
|
|
54
55
|
resolve(workspaceRoot, "tsconfig.base.json"),
|
|
55
56
|
resolve(workspaceRoot, "pnpm-lock.yaml"),
|
|
56
57
|
resolve(workspaceRoot, "README.md"),
|
|
58
|
+
resolve(workspaceRoot, "README-ENG.md"),
|
|
59
|
+
resolve(workspaceRoot, ".agents/zaip-aios/guides"),
|
|
60
|
+
resolve(packageRoot, "scripts/build-frontend.mjs"),
|
|
61
|
+
resolve(packageRoot, "dashboard-build-fingerprint.mjs"),
|
|
62
|
+
resolve(packageRoot, "start-dashboard-paths.mjs"),
|
|
57
63
|
],
|
|
58
64
|
excludedSourcePaths: ["/server/"],
|
|
59
65
|
},
|
|
@@ -67,6 +73,8 @@ export const dashboardBuildTargets = {
|
|
|
67
73
|
sourceRoots: [
|
|
68
74
|
resolve(packageRoot, "src"),
|
|
69
75
|
resolve(packageRoot, "scripts"),
|
|
76
|
+
resolve(packageRoot, "dashboard-build-fingerprint.mjs"),
|
|
77
|
+
resolve(packageRoot, "start-dashboard-paths.mjs"),
|
|
70
78
|
resolve(packageRoot, "package.json"),
|
|
71
79
|
resolve(packageRoot, "tsconfig.json"),
|
|
72
80
|
resolve(workspaceRoot, ".agents/dashboard/modules/operations/src"),
|
|
@@ -198,6 +198,7 @@ describe("dashboard executable session", () => {
|
|
|
198
198
|
const progress = [];
|
|
199
199
|
const result = await refreshDashboardBuildTargets({
|
|
200
200
|
targets,
|
|
201
|
+
frozen: false,
|
|
201
202
|
forceRebuild,
|
|
202
203
|
inspectTarget: async (target) => states[target.artifacts[0]],
|
|
203
204
|
runBuild: async (target) => calls.push(target),
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { dirname, join, resolve } from "node:path";
|
|
5
|
+
|
|
6
|
+
const root = resolve(import.meta.dirname, "../../../..");
|
|
7
|
+
assert.equal(resolve(process.cwd()), root);
|
|
8
|
+
const mode = process.argv[2];
|
|
9
|
+
assert.ok(["test", "check"].includes(mode));
|
|
10
|
+
function run(args) {
|
|
11
|
+
const result = spawnSync(process.execPath, args, {
|
|
12
|
+
cwd: root,
|
|
13
|
+
windowsHide: true,
|
|
14
|
+
encoding: "utf8",
|
|
15
|
+
timeout: 240_000,
|
|
16
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
17
|
+
env: { ...process.env, CI: "true" },
|
|
18
|
+
});
|
|
19
|
+
process.stdout.write(result.stdout ?? "");
|
|
20
|
+
process.stderr.write(result.stderr ?? "");
|
|
21
|
+
assert.equal(result.status, 0, result.error?.message);
|
|
22
|
+
}
|
|
23
|
+
if (!existsSync(join(root, "node_modules/.modules.yaml"))) {
|
|
24
|
+
const branch = spawnSync("git", ["symbolic-ref", "-q", "HEAD"], {
|
|
25
|
+
cwd: root,
|
|
26
|
+
windowsHide: true,
|
|
27
|
+
encoding: "utf8",
|
|
28
|
+
timeout: 10000,
|
|
29
|
+
});
|
|
30
|
+
assert.equal(branch.status, 1, "Only prepare dependencies in detached candidate");
|
|
31
|
+
const manager = join(dirname(process.execPath), "node_modules/corepack/dist/pnpm.js");
|
|
32
|
+
assert.ok(existsSync(manager));
|
|
33
|
+
run([manager, "install", "--offline", "--frozen-lockfile", "--ignore-scripts"]);
|
|
34
|
+
}
|
|
35
|
+
if (mode === "test") {
|
|
36
|
+
run([
|
|
37
|
+
"node_modules/vitest/vitest.mjs",
|
|
38
|
+
"run",
|
|
39
|
+
"--maxWorkers=1",
|
|
40
|
+
".agents/dashboard/modules/operations/src/react/OperationsOverviewTopPanel.navigation.test.tsx",
|
|
41
|
+
".agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts",
|
|
42
|
+
".agents/dashboard/modules/operations/src/react/OperationsOverview.macro-metrics.test.ts",
|
|
43
|
+
".agents/dashboard/apps/frontend/src/use-app-trace-documents.navigation.test.tsx",
|
|
44
|
+
".agents/dashboard/apps/frontend/src/operations-period-render.test.ts",
|
|
45
|
+
]);
|
|
46
|
+
} else {
|
|
47
|
+
for (const project of [
|
|
48
|
+
".agents/dashboard/modules/operations/tsconfig.json",
|
|
49
|
+
".agents/dashboard/apps/frontend/tsconfig.json",
|
|
50
|
+
".agents/design/apps/catalog/tsconfig.json",
|
|
51
|
+
])
|
|
52
|
+
run(["node_modules/typescript/bin/tsc", "--noEmit", "--project", project]);
|
|
53
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
3
|
+
import { chromium, expect } from "@playwright/test";
|
|
4
|
+
|
|
5
|
+
const baseUrl = process.env.ZAIP_TOP_FIVE_URL ?? "http://127.0.0.1:4417";
|
|
6
|
+
assert.equal(new URL(baseUrl).hostname, "127.0.0.1", "Local dashboard only");
|
|
7
|
+
const output = ".local/top-five-served";
|
|
8
|
+
await mkdir(output, { recursive: true });
|
|
9
|
+
const browser = await chromium.launch({ headless: true });
|
|
10
|
+
try {
|
|
11
|
+
const page = await browser.newPage({ viewport: { width: 1440, height: 1000 } });
|
|
12
|
+
page.setDefaultTimeout(60_000);
|
|
13
|
+
const errors = [];
|
|
14
|
+
const responses = [];
|
|
15
|
+
page.on("pageerror", (error) => errors.push(error.message));
|
|
16
|
+
page.on("response", (response) => {
|
|
17
|
+
if (response.url().includes("/api/v2/operations") || response.url().includes("/trace"))
|
|
18
|
+
responses.push({ path: new URL(response.url()).pathname, status: response.status() });
|
|
19
|
+
});
|
|
20
|
+
await page.goto(baseUrl, { waitUntil: "domcontentloaded" });
|
|
21
|
+
await page.getByRole("heading", { name: "Top 5 tarefas", exact: true }).waitFor();
|
|
22
|
+
const bundles = await page
|
|
23
|
+
.locator('script[src],link[rel="modulepreload"]')
|
|
24
|
+
.evaluateAll((nodes) =>
|
|
25
|
+
nodes.map((node) => node.getAttribute("src") ?? node.getAttribute("href")),
|
|
26
|
+
);
|
|
27
|
+
const cases = [];
|
|
28
|
+
for (const [kind, buttonName, heading, index] of [
|
|
29
|
+
["spec", /^SPECs/, "Top 5 SPECs", 0],
|
|
30
|
+
["prd", /^PRDs/, "Top 5 PRDs", 0],
|
|
31
|
+
["task", /^Tarefas/, "Top 5 tarefas", 0],
|
|
32
|
+
["spec", /^SPECs/, "Top 5 SPECs", 1],
|
|
33
|
+
]) {
|
|
34
|
+
await page.getByRole("button", { name: buttonName }).first().click();
|
|
35
|
+
const panel = page
|
|
36
|
+
.locator("article")
|
|
37
|
+
.filter({ has: page.getByRole("heading", { name: heading, exact: true }) });
|
|
38
|
+
await panel.waitFor();
|
|
39
|
+
const bar = panel.locator(".operations-run-bar").nth(index);
|
|
40
|
+
await expect(bar).toBeEnabled();
|
|
41
|
+
const accessibleName = await bar.getAttribute("aria-label");
|
|
42
|
+
const title = (await bar.getAttribute("title")).replace(/: [^:]+$/, "");
|
|
43
|
+
if (index === 1) {
|
|
44
|
+
await bar.focus();
|
|
45
|
+
await bar.press("Enter");
|
|
46
|
+
} else await bar.click();
|
|
47
|
+
const dialog = page.getByRole("dialog").last();
|
|
48
|
+
await dialog.waitFor();
|
|
49
|
+
await expect(dialog).toContainText(title);
|
|
50
|
+
const text = await dialog.innerText();
|
|
51
|
+
const id = text.match(new RegExp(`\\b${kind.toUpperCase()}-[A-Z0-9-]+`))?.[0];
|
|
52
|
+
assert.ok(id, `Selected ${kind} identity is visible`);
|
|
53
|
+
await page.screenshot({ path: `${output}/${kind}-${index}.png` });
|
|
54
|
+
cases.push({ kind, index, title, id, accessibleName, observedAt: new Date().toISOString() });
|
|
55
|
+
await dialog.getByRole("button", { name: "Fechar", exact: true }).click();
|
|
56
|
+
await expect(dialog).not.toBeVisible();
|
|
57
|
+
}
|
|
58
|
+
assert.deepEqual(errors, []);
|
|
59
|
+
assert.equal(
|
|
60
|
+
responses.some((response) => response.status >= 400),
|
|
61
|
+
false,
|
|
62
|
+
);
|
|
63
|
+
const report = {
|
|
64
|
+
result: "passed",
|
|
65
|
+
baseUrl,
|
|
66
|
+
viewport: "1440x1000",
|
|
67
|
+
browser: browser.version(),
|
|
68
|
+
candidate: process.argv[2] ?? null,
|
|
69
|
+
bundles,
|
|
70
|
+
cases,
|
|
71
|
+
responses,
|
|
72
|
+
errors,
|
|
73
|
+
};
|
|
74
|
+
await writeFile(`${output}/report.json`, JSON.stringify(report, null, 2));
|
|
75
|
+
console.log(JSON.stringify(report, null, 2));
|
|
76
|
+
} finally {
|
|
77
|
+
await browser.close();
|
|
78
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"files": [
|
|
5
5
|
{
|
|
6
6
|
"path": "DESIGN.md",
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
"path": "apps/catalog/dist/assets/index-32GZO95T.js",
|
|
27
27
|
"sha256": "12695d7255f03bf97d35c63efcff5b1ed52319ab36cbeacbf32de815a85cb03a"
|
|
28
28
|
},
|
|
29
|
+
{
|
|
30
|
+
"path": "apps/catalog/dist/assets/index-BGxXxXTo.js",
|
|
31
|
+
"sha256": "e6b716d44fd773a3735d97d3bf3fd1959b2241696ff699e684ffd9889f941663"
|
|
32
|
+
},
|
|
29
33
|
{
|
|
30
34
|
"path": "apps/catalog/dist/assets/index-BP8IxOxt.js",
|
|
31
35
|
"sha256": "972731afbaa1a1de2666477d46df0f7af55bfe698cb74bae919bac2718e1fbc8"
|
|
@@ -60,7 +64,7 @@
|
|
|
60
64
|
},
|
|
61
65
|
{
|
|
62
66
|
"path": "apps/catalog/dist/index.html",
|
|
63
|
-
"sha256": "
|
|
67
|
+
"sha256": "4b3d44098eabcf0c06da564cefab001010523b9f5152d7d647caa6112224f432"
|
|
64
68
|
},
|
|
65
69
|
{
|
|
66
70
|
"path": "apps/catalog/dist/logo_novo_azul.png",
|
|
@@ -276,7 +280,7 @@
|
|
|
276
280
|
},
|
|
277
281
|
{
|
|
278
282
|
"path": "apps/catalog/package.json",
|
|
279
|
-
"sha256": "
|
|
283
|
+
"sha256": "90285448c2f5d279607059952aa7233329049613882cc623f68da9305fded44f"
|
|
280
284
|
},
|
|
281
285
|
{
|
|
282
286
|
"path": "apps/catalog/public/logo_novo_azul.png",
|
|
@@ -322,6 +326,10 @@
|
|
|
322
326
|
"path": "apps/catalog/src/components/StackVersionFieldSpecimen.tsx",
|
|
323
327
|
"sha256": "b33c5f2d78c34f8b2484be09d50244b8d67f1ce38d958c06306ecd742895284b"
|
|
324
328
|
},
|
|
329
|
+
{
|
|
330
|
+
"path": "apps/catalog/src/components/TopEntitiesSpecimen.tsx",
|
|
331
|
+
"sha256": "2c3855f3d7d7f2c8570d7dc4ebf457b1d83dbeacc991dc4d8a4fc010155dc6c5"
|
|
332
|
+
},
|
|
325
333
|
{
|
|
326
334
|
"path": "apps/catalog/src/components/WorkspaceStatusSpecimen.tsx",
|
|
327
335
|
"sha256": "6275e010e85452df87079176f79f30e6778ab72d1c463541bf19ac5ec72efb76"
|
|
@@ -344,7 +352,7 @@
|
|
|
344
352
|
},
|
|
345
353
|
{
|
|
346
354
|
"path": "apps/catalog/src/pages/ComponentsPage.tsx",
|
|
347
|
-
"sha256": "
|
|
355
|
+
"sha256": "73a60ec9c86e94ed1b8ebe9064d65e4bb6c20551a2f652ce639b35642f81b0dc"
|
|
348
356
|
},
|
|
349
357
|
{
|
|
350
358
|
"path": "apps/catalog/src/pages/DesignSystemPage.tsx",
|
|
@@ -360,7 +368,7 @@
|
|
|
360
368
|
},
|
|
361
369
|
{
|
|
362
370
|
"path": "apps/catalog/src/stories/Components.stories.tsx",
|
|
363
|
-
"sha256": "
|
|
371
|
+
"sha256": "2a854431eb13a393de6d9475bf3308db20f7ccbdcb84d3983694cfe09b962ab7"
|
|
364
372
|
},
|
|
365
373
|
{
|
|
366
374
|
"path": "apps/catalog/src/stories/DashboardFilters.stories.tsx",
|
|
@@ -408,7 +416,7 @@
|
|
|
408
416
|
},
|
|
409
417
|
{
|
|
410
418
|
"path": "packages/local-runtime/package.json",
|
|
411
|
-
"sha256": "
|
|
419
|
+
"sha256": "0e6f81da73ac2ce53dce5ea41197cab4939e784976420a2bf0c3aeccd45573e1"
|
|
412
420
|
},
|
|
413
421
|
{
|
|
414
422
|
"path": "packages/local-runtime/runtime.mjs",
|