@zaip-ai/cli 3.2.0 → 3.3.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 (95) hide show
  1. package/dist/services/adapters.d.ts +1 -1
  2. package/dist/services/adapters.d.ts.map +1 -1
  3. package/dist/services/adapters.js +2 -1
  4. package/dist/services/adapters.js.map +1 -1
  5. package/dist/services/logger.js +24 -8
  6. package/dist/services/logger.js.map +1 -1
  7. package/dist/services/logger.test.js +21 -4
  8. package/dist/services/logger.test.js.map +1 -1
  9. package/package.json +2 -2
  10. package/templates/.agents/README-ENG.md +2 -1
  11. package/templates/.agents/README.md +2 -1
  12. package/templates/.agents/config/agents/catalog.yaml +1 -0
  13. package/templates/.agents/config/agents/discovery.json +2 -2
  14. package/templates/.agents/config/clients/codex/agents/zaip-agent-builder.toml +2 -2
  15. package/templates/.agents/dashboard/.zaip-managed.json +60 -52
  16. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-CEDZjl4V.js → CostCalculationGuidePage-BBFDrn64.js} +1 -1
  17. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-BzaUTZDx.js → DashboardHelpDialog-Cd-qo9w7.js} +4 -3
  18. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-21cCJik-.js → PricingSettingsDialog-J7L5m8lk.js} +1 -1
  19. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-BAvLPAee.js → ProjectSettingsPage-BpsAFy0g.js} +1 -1
  20. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-wqW52uCx.js → TraceabilityWorkspace-BzVtGLWS.js} +1 -1
  21. package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-06__WZco.js → cost-monitor--iPcnZdx.js} +1 -1
  22. package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-BkAm8-h4.js → dashboard-localization-jvdDfNKs.js} +2 -1
  23. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-DEmo6Tn2.js → icons-vendor-CWzf_RiP.js} +1 -1
  24. package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-DqZKJS8y.js → index-DfdlGa7c.js} +2 -2
  25. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CadYsm83.js → react-vendor-CtHdbZk3.js} +1 -1
  26. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-BzKK8kK3.js → traceability-BKrDH2TR.js} +1 -1
  27. package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
  28. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  29. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  30. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  31. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.helpers.tsx +4 -1
  32. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +5 -0
  33. package/templates/.agents/dashboard/modules/operations/src/react/export/xlsx-runtime-e2e.test.ts +55 -31
  34. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  35. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  36. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  37. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  38. package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +186 -166
  39. package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +135 -115
  40. package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
  41. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +187 -167
  42. package/templates/.agents/dashboard/packages/local-runtime/src/server-period-macro-metric.test.ts +19 -0
  43. package/templates/.agents/dashboard/packages/local-runtime/src/server-read-projections.ts +3 -3
  44. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-cache.test.ts +94 -0
  45. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-cache.ts +32 -1
  46. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-force-canonical.test.ts +58 -3
  47. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-projection.ts +2 -0
  48. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-counts-every-root-execution-day-returns.test.ts +13 -0
  49. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-keeps-orphan-telemetry-out-kanban-without.test.ts +2 -1
  50. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-schema.ts +15 -2
  51. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.test.ts +2 -1
  52. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-dashboard-views.ts +20 -2
  53. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  54. package/templates/.agents/dashboard/scripts/qualify-macro-overview.mjs +50 -0
  55. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  56. package/templates/.agents/design/.zaip-managed.json +3 -3
  57. package/templates/.agents/design/apps/catalog/package.json +1 -1
  58. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  59. package/templates/.agents/requirements/autonomous-assurance.md +1 -1
  60. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  61. package/templates/.agents/requirements/comparative-audit.md +1 -1
  62. package/templates/.agents/requirements/context-engine.md +1 -1
  63. package/templates/.agents/requirements/cost-observability.md +1 -1
  64. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  65. package/templates/.agents/requirements/data-export.md +1 -1
  66. package/templates/.agents/requirements/design-system.md +1 -1
  67. package/templates/.agents/requirements/execution-engine.md +1 -1
  68. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  69. package/templates/.agents/requirements/model-orchestration.md +1 -1
  70. package/templates/.agents/requirements/public-distribution.md +11 -3
  71. package/templates/.agents/requirements/software-architecture.md +1 -1
  72. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  73. package/templates/.agents/requirements/work-lifecycle.md +1 -1
  74. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  75. package/templates/.agents/runtime/VERSION +1 -1
  76. package/templates/.agents/runtime/bin/zaip.mjs +13 -12
  77. package/templates/.agents/runtime/checksums.sha256 +5 -5
  78. package/templates/.agents/runtime/manifest.json +1 -1
  79. package/templates/.agents/runtime/provenance.json +4 -4
  80. package/templates/.agents/runtime/sbom.cdx.json +1 -1
  81. package/templates/.agents/skills/zaip-aios/SKILL.md +0 -1
  82. package/templates/.agents/skills/zaip-skill-author-skills/scripts/audit-skill-catalog.mjs +1 -0
  83. package/templates/.agents/skills/zaip-skill-config/SKILL.md +1 -1
  84. package/templates/.agents/skills/zaip-skill-github-setup/SKILL.md +2 -2
  85. package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +4 -0
  86. package/templates/.agents/skills/zaip-skill-setup/SKILL.md +35 -13
  87. package/templates/.agents/skills/zaip-skill-setup/agents/openai.yaml +2 -2
  88. package/templates/.agents/skills/zaip-skill-update-version-doc/SKILL.md +39 -0
  89. package/templates/.agents/skills/zaip-skill-update-version-doc/agents/openai.yaml +4 -0
  90. package/templates/.agents/skills/zaip-skill-update-version-doc/scripts/update-version-doc.mjs +21 -0
  91. package/templates/.agents/skills/zaip-skill-update-version-doc/scripts/update-version-doc.test.mjs +32 -0
  92. package/templates/.agents/zaip-aios/README.md +2 -1
  93. package/templates/.agents/zaip-aios/VERSION +1 -1
  94. package/templates/.agents/zaip-aios/guides/20-instalacao-detalhada.md +7 -3
  95. package/templates/template-manifest.json +120 -96
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-frontend",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-cost-monitor",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-operations",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -601,12 +601,15 @@ export function formatExecutionAverageHint(
601
601
  locale: OperationsLocale,
602
602
  ): string {
603
603
  if (totalTasks <= 0) return "0";
604
- if (totalDurationMs <= 0 || totalDays <= 0) {
604
+ if (totalDurationMs <= 0) {
605
605
  return locale === "pt-BR"
606
606
  ? "Médias de execução indisponíveis"
607
607
  : "Execution averages unavailable";
608
608
  }
609
609
  const averagePerTask = formatRoundedDuration(totalDurationMs / totalTasks, locale);
610
+ // Macro aggregates can provide duration and population without individual
611
+ // execution days. Keep the known per-item average available in that case.
612
+ if (totalDays <= 0) return `${averagePerTask} / item`;
610
613
  const averagePerDay = formatDurationInHours(totalDurationMs / totalDays);
611
614
  const totalDaysLabel =
612
615
  locale === "pt-BR" ? `${totalDays} dias` : `${totalDays} ${totalDays === 1 ? "day" : "days"}`;
@@ -357,6 +357,11 @@ describe("execution average summary", () => {
357
357
  "20 min / tarefa (6 h / dia) (6 dias)",
358
358
  );
359
359
  });
360
+ it("keeps the known macro average when execution days are unavailable", () => {
361
+ expect(formatExecutionAverageHint(3_600_000, 3, 0, "pt-BR")).toBe("20 min / item");
362
+ expect(formatExecutionAverageHint(3_600_000, 3, 0, "en-US")).toBe("20 min / item");
363
+ expect(formatExecutionAverageHint(0, 3, 0, "pt-BR")).toBe("Médias de execução indisponíveis");
364
+ });
360
365
  it("localizes English and shows zero for an empty population", () => {
361
366
  expect(formatExecutionAverageHint(3_600_000, 3, 1, "en-US")).toBe(
362
367
  "20 min / task (1 h / day) (1 day)",
@@ -1,7 +1,5 @@
1
- import { readdirSync } from "node:fs";
2
- import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
3
- import { tmpdir } from "node:os";
4
- import { join } from "node:path";
1
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
2
+ import { join, resolve } from "node:path";
5
3
  import { describe, expect, it } from "vitest";
6
4
  // `exceljs` exposes this Node-specific entrypoint without a declaration file.
7
5
  // The runtime export test needs the Node loader rather than ExcelJS's browser build.
@@ -176,46 +174,61 @@ const cases: readonly Case[] = [
176
174
  ];
177
175
 
178
176
  describe.skipIf(!enabled)("runtime XLSX exports", () => {
179
- it("writes and reopens every eligible XLSX with rows and no wholly empty column", async () => {
180
- const root = join(tmpdir(), "zaip-aios");
181
- const sessionPaths = await Promise.all(
182
- readdirSync(root)
183
- .filter((name) => name.startsWith("dashboard-sqlite-"))
184
- .map(async (name) => {
185
- const path = join(root, name, "dashboard-sqlite-session.json");
186
- return { path, modified: (await stat(path).catch(() => null))?.mtimeMs ?? 0 };
187
- }),
188
- );
189
- const sessionPath = sessionPaths.sort((left, right) => right.modified - left.modified)[0]?.path;
190
- expect(sessionPath).toBeDefined();
191
- const session = JSON.parse(await readFile(sessionPath!, "utf8")) as {
177
+ it("reopens served exports and preserves headers, every row and unavailable cells", async () => {
178
+ // An explicit isolated session prevents attaching to a user's unrelated dashboard.
179
+ const sessionPath = process.env.ZAIP_E2E_XLSX_SESSION;
180
+ if (!sessionPath) throw new Error("ZAIP_E2E_XLSX_SESSION must name the isolated session");
181
+ const session = JSON.parse(await readFile(sessionPath, "utf8")) as {
192
182
  port: number;
193
183
  token: string;
184
+ proofTaskId: string;
194
185
  };
195
- const output = join(process.cwd(), "..", "..", "..", "..", ".local", "dashboard-export-e2e");
186
+ expect(Number.isInteger(session.port) && session.port > 0 && session.port < 65536).toBe(true);
187
+ expect(session.proofTaskId).toMatch(/^TASK-/);
188
+ const output = resolve(process.env.ZAIP_E2E_XLSX_OUTPUT ?? ".local/dashboard-export-e2e");
196
189
  await mkdir(output, { recursive: true });
197
- for (const item of cases) {
190
+ const report: { name: string; rows: number; pages: number; unavailableCells: number }[] = [];
191
+ const filtered = {
192
+ ...cases.find((item) => item.name === "operations-work-list")!,
193
+ name: "operations-work-list-filtered",
194
+ query: session.proofTaskId,
195
+ };
196
+ for (const item of [...cases, filtered]) {
198
197
  const source: Row[] = [];
198
+ let pages = 0;
199
+ const filters = "query" in item ? { query: String(item.query) } : {};
199
200
  for (let offset = 0; ; ) {
201
+ const query = new URLSearchParams({
202
+ view: item.view,
203
+ offset: String(offset),
204
+ limit: "1",
205
+ ...filters,
206
+ });
200
207
  const response = await fetch(
201
- `http://127.0.0.1:${session.port}/api/v2/sqlite-views?view=${item.view}&offset=${offset}&limit=100`,
202
- { headers: { "x-zaip-session": session.token } },
208
+ `http://127.0.0.1:${session.port}/api/v2/sqlite-views?${query}`,
209
+ { headers: { "x-zaip-session": session.token }, signal: AbortSignal.timeout(30_000) },
203
210
  );
204
211
  expect(response.ok, item.view).toBe(true);
205
212
  const page = (await response.json()) as { rows: Row[]; total_count: number };
206
213
  source.push(...page.rows);
214
+ pages += 1;
207
215
  offset += page.rows.length;
208
216
  if (offset >= page.total_count) break;
209
217
  expect(page.rows.length, `${item.view} pagination`).toBeGreaterThan(0);
210
218
  }
211
219
  const rows = item.map(source);
220
+ if (item.name === "operations-work-list") {
221
+ expect(rows.length).toBeGreaterThanOrEqual(2);
222
+ expect(pages).toBeGreaterThan(1);
223
+ }
224
+ if (item.name === filtered.name) expect(rows).toHaveLength(1);
212
225
  const chunks: Uint8Array[] = [];
213
226
  await exportSnapshotToXlsxParts({
214
227
  snapshot: createExportSnapshot({
215
228
  id: item.name,
216
229
  createdAt: new Date().toISOString(),
217
230
  view: item.name,
218
- filters: {},
231
+ filters,
219
232
  totalRows: rows.length,
220
233
  pages: async function* () {
221
234
  yield rows;
@@ -234,15 +247,26 @@ describe.skipIf(!enabled)("runtime XLSX exports", () => {
234
247
  await writeFile(path, Buffer.concat(chunks.map((chunk) => Buffer.from(chunk))));
235
248
  const workbook = new ExcelJS.Workbook();
236
249
  await workbook.xlsx.load(await readFile(path));
237
- expect(workbook.worksheets[0]?.rowCount, item.name).toBe(rows.length + 1);
238
- const empty = item.headers.filter(
239
- (header) =>
240
- rows.length > 0 &&
241
- rows.every(
242
- (row) => row[header] === null || row[header] === undefined || row[header] === "",
243
- ),
244
- );
245
- expect(empty, `${item.name} columns`).toEqual([]);
250
+ const sheet = workbook.worksheets[0];
251
+ expect(sheet?.rowCount, item.name).toBe(rows.length + 1);
252
+ expect(sheet.getRow(1).values.slice(1), item.name).toEqual(item.headers);
253
+ let unavailableCells = 0;
254
+ for (const [index, row] of rows.entries()) {
255
+ for (const [column, header] of item.headers.entries()) {
256
+ const value = row[header];
257
+ if (value === null || value === undefined) unavailableCells += 1;
258
+ const expected = typeof value === "number" ? value : String(value ?? "");
259
+ expect(
260
+ sheet.getCell(index + 2, column + 1).value ?? "",
261
+ `${item.name}:${index}:${header}`,
262
+ ).toEqual(expected);
263
+ }
264
+ }
265
+ report.push({ name: item.name, rows: rows.length, pages, unavailableCells });
246
266
  }
267
+ await writeFile(
268
+ join(output, "report.json"),
269
+ JSON.stringify({ passed: true, views: report }, null, 2),
270
+ );
247
271
  }, 120_000);
248
272
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-traceability",
3
- "version": "3.2.0",
3
+ "version": "3.3.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": "3.2.0",
3
+ "version": "3.3.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": "3.2.0",
3
+ "version": "3.3.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": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {