@zaip-ai/cli 1.3.5 → 1.3.7

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 (76) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/init.d.ts.map +1 -1
  3. package/dist/commands/init.js +7 -0
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/services/install-agents-template.d.ts.map +1 -1
  6. package/dist/services/install-agents-template.js +18 -2
  7. package/dist/services/install-agents-template.js.map +1 -1
  8. package/dist/services/sqlite-bootstrap.d.ts +29 -0
  9. package/dist/services/sqlite-bootstrap.d.ts.map +1 -0
  10. package/dist/services/sqlite-bootstrap.js +141 -0
  11. package/dist/services/sqlite-bootstrap.js.map +1 -0
  12. package/dist/services/template-manifest.d.ts.map +1 -1
  13. package/dist/services/template-manifest.js +2 -0
  14. package/dist/services/template-manifest.js.map +1 -1
  15. package/package.json +2 -2
  16. package/templates/.agents/architecture/.gitkeep +0 -0
  17. package/templates/.agents/branding/.gitkeep +0 -0
  18. package/templates/.agents/dashboard/.zaip-managed.json +51 -39
  19. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-D1mpyYwh.js → CostCalculationGuidePage-DwVZOmMV.js} +1 -1
  20. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-CKO47D5s.js → DashboardHelpDialog--czwAlcH.js} +723 -723
  21. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-BuSlCbyZ.js → PricingSettingsDialog-CyjMXkm8.js} +1 -1
  22. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-CUHFkAhZ.js → ProjectSettingsPage-B_Oj6Dlf.js} +1 -1
  23. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-BmASq2gW.js → TraceabilityWorkspace-CAqYVin1.js} +1 -1
  24. package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-Csj6LiAt.js → cost-monitor-C09KmlSw.js} +1 -1
  25. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-VyTTl_ph.js → icons-vendor-DXBOtWNI.js} +1 -1
  26. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-CblPpexd.js +2 -0
  27. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CTC6vtln.js → react-vendor-DaNXQPyk.js} +1 -1
  28. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-9Mtvbwrg.js → traceability-I4AKqVDX.js} +1 -1
  29. package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
  30. package/templates/.agents/dashboard/apps/frontend/src/App.tsx +17 -8
  31. package/templates/.agents/dashboard/apps/frontend/src/cost-period-refresh.test.ts +8 -3
  32. package/templates/.agents/dashboard/apps/frontend/src/operations-period.test.ts +19 -1
  33. package/templates/.agents/dashboard/apps/frontend/src/operations-period.ts +8 -0
  34. package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +7 -4
  35. package/templates/.agents/dashboard/modules/operations/src/react/OperationsFilteredStatusDialog.tsx +131 -0
  36. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +2 -133
  37. package/templates/.agents/dashboard/modules/operations/src/react/operations-overview.status-cards.test.ts +13 -7
  38. package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +1 -1
  39. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-prerequisites.mjs +40 -0
  40. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-prerequisites.test.mjs +46 -0
  41. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +33 -26
  42. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +5 -8
  43. package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-loading.spec.ts +4 -6
  44. package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-period-transition.spec.ts +37 -17
  45. package/templates/.agents/dashboard/tests/e2e/specs/dashboard-performance-matrix.spec.ts +5 -3
  46. package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +12 -5
  47. package/templates/.agents/growth/.gitkeep +0 -0
  48. package/templates/.agents/marketing/.gitkeep +0 -0
  49. package/templates/.agents/requirements/autonomous-assurance.md +1 -1
  50. package/templates/.agents/requirements/comparative-audit.md +1 -1
  51. package/templates/.agents/requirements/context-engine.md +1 -1
  52. package/templates/.agents/requirements/cost-observability.md +1 -1
  53. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  54. package/templates/.agents/requirements/data-export.md +1 -1
  55. package/templates/.agents/requirements/design-system.md +1 -1
  56. package/templates/.agents/requirements/execution-engine.md +1 -1
  57. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  58. package/templates/.agents/requirements/model-orchestration.md +1 -1
  59. package/templates/.agents/requirements/public-distribution.md +1 -1
  60. package/templates/.agents/requirements/software-architecture.md +1 -1
  61. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  62. package/templates/.agents/requirements/work-lifecycle.md +1 -1
  63. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  64. package/templates/.agents/sales/.gitkeep +0 -0
  65. package/templates/README.md +722 -0
  66. package/templates/template-manifest.json +84 -85
  67. package/templates/.agents/architecture/software-architecture.md +0 -131
  68. package/templates/.agents/branding/brandbook.docx +0 -0
  69. package/templates/.agents/branding/brandbook.md +0 -60
  70. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DIwDvCu5.js +0 -2
  71. package/templates/.agents/growth/estrategia-bootstrap-90-dias.md +0 -169
  72. package/templates/.agents/growth/strategy.md +0 -27
  73. package/templates/.agents/marketing/estrategia-marketing-zaip-90-dias.md +0 -197
  74. package/templates/.agents/marketing/strategy.md +0 -29
  75. package/templates/.agents/sales/playbook.md +0 -32
  76. package/templates/.agents/sales/roteiro-comercial-zaip.md +0 -252
@@ -8,12 +8,13 @@ test("refreshes Cost Monitor within five seconds when Todo o Período is selecte
8
8
  page,
9
9
  }) => {
10
10
  await openDashboard(page);
11
+ await selectThisMonth(page);
11
12
  await openCostMonitor(page);
12
13
 
13
- const summary = waitForCostSummary(page, "all");
14
+ const summaryRequest = waitForCostSummaryRequest(page, "all");
14
15
  const startedAt = Date.now();
15
16
  await periodControl(page).selectOption("all");
16
- await summary;
17
+ await summaryRequest;
17
18
  await expectCostMonitorReady(page);
18
19
 
19
20
  expect(Date.now() - startedAt).toBeLessThan(fiveSeconds);
@@ -31,22 +32,23 @@ test("loads Cost Monitor within five seconds when the user enters after choosing
31
32
  .click();
32
33
  await expect(periodControl(page)).toBeVisible();
33
34
 
35
+ await selectThisMonth(page);
36
+ const summary = waitForCostSummary(page, "all");
34
37
  await periodControl(page).selectOption("all");
38
+ await summary;
35
39
  await expect(page.locator(".period-transition-overlay")).toHaveCount(0, { timeout: 60_000 });
36
40
 
37
- const summary = waitForCostSummary(page, "all");
38
41
  const startedAt = Date.now();
39
42
  await page
40
43
  .getByRole("navigation", { name: "Áreas do dashboard" })
41
44
  .getByRole("button", { name: /Monitor de Custos/ })
42
45
  .click();
43
- await summary;
44
46
  await expectCostMonitorReady(page);
45
47
 
46
48
  expect(Date.now() - startedAt).toBeLessThan(fiveSeconds);
47
49
  });
48
50
 
49
- test("shows one retry after a summary 503 and does not retry in a loop", async ({ page }) => {
51
+ test("retries a summary 503 once when Cost Monitor opens and does not loop", async ({ page }) => {
50
52
  let summaries = 0;
51
53
  await page.route("**/api/v2/cost-monitor**", async (route) => {
52
54
  const url = new URL(route.request().url());
@@ -62,16 +64,10 @@ test("shows one retry after a summary 503 and does not retry in a loop", async (
62
64
  });
63
65
 
64
66
  await openDashboard(page);
65
- await openCostMonitor(page, false);
66
- const retry = page.locator(".app-loading-panel-error").getByRole("button", {
67
- name: "Tentar novamente",
68
- });
69
- await expect(retry).toBeVisible();
70
-
71
- await retry.click();
72
- await expectCostMonitorReady(page);
67
+ await openCostMonitor(page);
73
68
  await page.waitForTimeout(750);
74
69
  expect(summaries).toBe(2);
70
+ await expect(page.locator(".app-error")).toHaveCount(0);
75
71
  });
76
72
 
77
73
  test("does not let a late all-time summary overwrite the newer period", async ({ page }) => {
@@ -136,6 +132,7 @@ test("does not let a late all-time summary overwrite the newer period", async ({
136
132
  });
137
133
 
138
134
  await openDashboard(page);
135
+ await selectThisMonth(page);
139
136
  await openCostMonitor(page);
140
137
  await expect.poll(() => priorPeriodBody).not.toBeNull();
141
138
  const staleBody = withStaleSummarySentinel(priorPeriodBody!);
@@ -182,17 +179,26 @@ async function openDashboard(page: Page) {
182
179
  await operations;
183
180
  }
184
181
 
185
- async function openCostMonitor(page: Page, expectReady = true) {
186
- const summary = expectReady ? waitForCostSummary(page, "this-month") : null;
182
+ async function openCostMonitor(page: Page) {
187
183
  await page
188
184
  .getByRole("navigation", { name: "Áreas do dashboard" })
189
185
  .getByRole("button", { name: /Monitor de Custos/ })
190
186
  .click();
191
- if (!expectReady) return;
192
- await summary;
193
187
  await expectCostMonitorReady(page);
194
188
  }
195
189
 
190
+ async function selectThisMonth(page: Page) {
191
+ await page
192
+ .getByRole("navigation", { name: "Áreas do dashboard" })
193
+ .getByRole("button", { name: /Operação/ })
194
+ .click();
195
+ const summary =
196
+ (await page.locator(".cost-tabs").count()) > 0 ? waitForCostSummary(page, "this-month") : null;
197
+ await periodControl(page).selectOption("this-month");
198
+ await summary;
199
+ await expect(page.locator(".period-transition-overlay")).toHaveCount(0, { timeout: 60_000 });
200
+ }
201
+
196
202
  function periodControl(page: Page) {
197
203
  return page.locator(".dashboard-global-controls").getByRole("combobox", { name: "Período" });
198
204
  }
@@ -209,6 +215,20 @@ function waitForCostSummary(page: Page, preset: "all" | "this-month") {
209
215
  });
210
216
  }
211
217
 
218
+ function waitForCostSummaryRequest(page: Page, preset: "all" | "this-month") {
219
+ return page.waitForRequest(
220
+ (request) => {
221
+ const url = new URL(request.url());
222
+ if (url.pathname !== COST_MONITOR_PATH || url.searchParams.get("scope") !== "summary")
223
+ return false;
224
+ return preset === "all"
225
+ ? !url.searchParams.has("from") && !url.searchParams.has("to")
226
+ : url.searchParams.has("from") && url.searchParams.has("to");
227
+ },
228
+ { timeout: 10_000 },
229
+ );
230
+ }
231
+
212
232
  async function expectCostMonitorReady(page: Page) {
213
233
  await expect(page.locator(".cost-tabs")).toBeVisible({ timeout: fiveSeconds });
214
234
  const dailyTable = page.locator(".cost-content-daily table");
@@ -294,9 +294,11 @@ async function exerciseOperations(
294
294
  },
295
295
  successfulResponses,
296
296
  content === ".operations-work-board"
297
- ? boardStages.map((stage) =>
298
- operationSelectionResponseMatcher(content, kind, expectedPeriod, stage),
299
- )
297
+ ? kind === "Tudo"
298
+ ? undefined
299
+ : boardStages.map((stage) =>
300
+ operationSelectionResponseMatcher(content, kind, expectedPeriod, stage),
301
+ )
300
302
  : [selectionResponse],
301
303
  );
302
304
  }
@@ -249,7 +249,7 @@ test("renders the modern read-only dashboard and meets accessibility gates", asy
249
249
  await page.getByRole("combobox", { name: "Período nos filtros" }).selectOption("today");
250
250
  await expect(page.getByLabel("Data inicial nos filtros")).toHaveValue(today);
251
251
  await page.getByLabel("Data inicial nos filtros").fill(initialStart);
252
- await expect(page.getByRole("combobox", { name: "Período nos filtros" })).toHaveValue("custom");
252
+ await expect(period).toHaveValue("custom");
253
253
 
254
254
  await period.selectOption("today");
255
255
  await expect(startDate).toHaveValue(today);
@@ -572,7 +572,10 @@ test("loads monthly overview quickly and keeps PRD and SPEC chart totals reconci
572
572
  const quickProjection = (await quickResponse.json()) as {
573
573
  summary: {
574
574
  overview_metrics?: {
575
- macro_metrics?: Record<"specs" | "prds", { total_duration_ms: number | null }>;
575
+ macro_metrics?: Record<
576
+ "specs" | "prds",
577
+ { entity_count: number; total_duration_ms: number | null }
578
+ >;
576
579
  };
577
580
  };
578
581
  };
@@ -602,6 +605,8 @@ test("loads monthly overview quickly and keeps PRD and SPEC chart totals reconci
602
605
  const macroKey = kind === "SPECs" ? "specs" : "prds";
603
606
  const macroDuration =
604
607
  quickProjection.summary.overview_metrics?.macro_metrics?.[macroKey]?.total_duration_ms;
608
+ const macroCount =
609
+ quickProjection.summary.overview_metrics?.macro_metrics?.[macroKey]?.entity_count;
605
610
  expect(macroDuration).not.toBeUndefined();
606
611
  if (macroDuration === null) {
607
612
  await expect(
@@ -610,7 +615,7 @@ test("loads monthly overview quickly and keeps PRD and SPEC chart totals reconci
610
615
  name: new RegExp(`Tempo total de execu[cç][aã]o de ${kind}`),
611
616
  })
612
617
  .locator("strong"),
613
- ).toHaveText("Indisponível");
618
+ ).toHaveText(macroCount === 0 ? "0" : "Indisponível");
614
619
  }
615
620
  }
616
621
  }
@@ -681,6 +686,9 @@ async function openDashboard(page: import("@playwright/test").Page) {
681
686
  }
682
687
 
683
688
  async function selectPopulatedAllTime(page: import("@playwright/test").Page) {
689
+ await selectOperations(page);
690
+ const period = page.getByRole("combobox", { name: /Per/ }).first();
691
+ if ((await period.inputValue()) === "all") return null;
684
692
  const response = page.waitForResponse((candidate) => {
685
693
  if (
686
694
  candidate.status() !== 200 ||
@@ -692,8 +700,7 @@ async function selectPopulatedAllTime(page: import("@playwright/test").Page) {
692
700
  const url = new URL(candidate.url());
693
701
  return !url.searchParams.has("from") && !url.searchParams.has("to");
694
702
  });
695
- await selectOperations(page);
696
- await page.getByRole("combobox", { name: /Per/ }).first().selectOption("all");
703
+ await period.selectOption("all");
697
704
  return response;
698
705
  }
699
706
 
File without changes
File without changes
@@ -6,7 +6,7 @@ title: Garantia adaptativa e execução autônoma
6
6
  status: active
7
7
  version: 3
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Garantia adaptativa e execução autônoma
@@ -6,7 +6,7 @@ title: Auditoria comparativa e plano de evolução
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Auditoria comparativa e plano de evolução
@@ -6,7 +6,7 @@ title: Contexto mínimo, seguro e navegável
6
6
  status: active
7
7
  version: 8
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Context engine
@@ -6,7 +6,7 @@ title: Tokens, custos e cobertura
6
6
  status: active
7
7
  version: 10
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Cost observability
@@ -6,7 +6,7 @@ title: Inicialização e hidratação confiável do dashboard
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Inicialização e hidratação confiável do dashboard
@@ -6,7 +6,7 @@ title: Exportação contextual de dados para Excel
6
6
  status: proposed
7
7
  version: 2
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Exportação contextual de dados
@@ -6,7 +6,7 @@ title: Contrato visual e catálogo executável
6
6
  status: active
7
7
  version: 3
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Design system
@@ -6,7 +6,7 @@ title: Preparação, materialização e DAG
6
6
  status: active
7
7
  version: 11
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Execution engine
@@ -6,7 +6,7 @@ title: Projeções operacionais e analíticas
6
6
  status: active
7
7
  version: 14
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Kanban and dashboard
@@ -6,7 +6,7 @@ title: Seleção automática e observável de modelo e effort
6
6
  status: active
7
7
  version: 7
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Orquestração de modelos
@@ -6,7 +6,7 @@ title: Distribuição pública e ativação
6
6
  status: active
7
7
  version: 3
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Distribuição pública e ativação
@@ -6,7 +6,7 @@ title: Layout modular e limites de código-fonte
6
6
  status: active
7
7
  version: 5
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Software architecture
@@ -6,7 +6,7 @@ title: Melhorias estratégicas de custo, qualidade e resiliência
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Melhorias estratégicas de custo, qualidade e resiliência
@@ -6,7 +6,7 @@ title: Ciclo de vida do trabalho
6
6
  status: active
7
7
  version: 24
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Work lifecycle
@@ -6,7 +6,7 @@ title: Evidências, custo por Task e autonomia por SPEC
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "1.3.5"
9
+ source_release: "1.3.7"
10
10
  ---
11
11
 
12
12
  # Evidências, custo por Task e autonomia por SPEC
File without changes