@zaip-ai/cli 3.1.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.
- package/README.md +11 -5
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +16 -6
- package/dist/commands/init.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 +2 -1
- package/dist/services/adapters.js.map +1 -1
- package/dist/services/github-setup-status.d.ts +12 -0
- package/dist/services/github-setup-status.d.ts.map +1 -0
- package/dist/services/github-setup-status.js +84 -0
- package/dist/services/github-setup-status.js.map +1 -0
- package/dist/services/github-setup-status.test.d.ts +2 -0
- package/dist/services/github-setup-status.test.d.ts.map +1 -0
- package/dist/services/github-setup-status.test.js +57 -0
- package/dist/services/github-setup-status.test.js.map +1 -0
- package/dist/services/logger.d.ts +10 -1
- package/dist/services/logger.d.ts.map +1 -1
- package/dist/services/logger.js +39 -6
- package/dist/services/logger.js.map +1 -1
- package/dist/services/logger.test.js +50 -5
- package/dist/services/logger.test.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/templates/.agents/README-ENG.md +2 -1
- package/templates/.agents/README.md +2 -1
- package/templates/.agents/config/agents/catalog.yaml +1 -0
- package/templates/.agents/config/agents/discovery.json +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-builder.toml +2 -2
- package/templates/.agents/dashboard/.zaip-managed.json +60 -52
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-CEDZjl4V.js → CostCalculationGuidePage-BBFDrn64.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-DIWDmvAS.js → DashboardHelpDialog-Cd-qo9w7.js} +4 -3
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-BBRBKaHa.js → PricingSettingsDialog-J7L5m8lk.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-BAvLPAee.js → ProjectSettingsPage-BpsAFy0g.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-C9dDhj34.js → TraceabilityWorkspace-BzVtGLWS.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-06__WZco.js → cost-monitor--iPcnZdx.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-CoAVMZN6.js → dashboard-localization-jvdDfNKs.js} +2 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-DEmo6Tn2.js → icons-vendor-CWzf_RiP.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-BVzw_Wux.js → index-DfdlGa7c.js} +2 -2
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CadYsm83.js → react-vendor-CtHdbZk3.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-BzKK8kK3.js → traceability-BKrDH2TR.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/operations/package.json +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.helpers.tsx +4 -1
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +5 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/xlsx-runtime-e2e.test.ts +55 -31
- 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 +186 -166
- package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +135 -115
- package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +187 -167
- package/templates/.agents/dashboard/packages/local-runtime/src/server-period-macro-metric.test.ts +19 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-read-projections.ts +3 -3
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-cache.test.ts +94 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-cache.ts +32 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-force-canonical.test.ts +58 -3
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-projection.ts +2 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-counts-every-root-execution-day-returns.test.ts +13 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-keeps-orphan-telemetry-out-kanban-without.test.ts +2 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-schema.ts +15 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.test.ts +2 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-dashboard-views.ts +20 -2
- package/templates/.agents/dashboard/packages/ui/package.json +1 -1
- package/templates/.agents/dashboard/scripts/qualify-macro-overview.mjs +50 -0
- package/templates/.agents/dashboard/tests/e2e/package.json +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 +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 +17 -2
- 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 +13 -12
- package/templates/.agents/runtime/checksums.sha256 +5 -5
- package/templates/.agents/runtime/manifest.json +1 -1
- package/templates/.agents/runtime/provenance.json +4 -4
- package/templates/.agents/runtime/sbom.cdx.json +1 -1
- package/templates/.agents/skills/zaip-aios/SKILL.md +0 -1
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/audit-skill-catalog.mjs +1 -0
- package/templates/.agents/skills/zaip-skill-config/SKILL.md +12 -0
- package/templates/.agents/skills/zaip-skill-github-setup/SKILL.md +7 -1
- package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +4 -0
- package/templates/.agents/skills/zaip-skill-setup/SKILL.md +36 -2
- package/templates/.agents/skills/zaip-skill-setup/agents/openai.yaml +2 -2
- package/templates/.agents/skills/zaip-skill-update-version-doc/SKILL.md +39 -0
- package/templates/.agents/skills/zaip-skill-update-version-doc/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-update-version-doc/scripts/update-version-doc.mjs +21 -0
- package/templates/.agents/skills/zaip-skill-update-version-doc/scripts/update-version-doc.test.mjs +32 -0
- package/templates/.agents/zaip-aios/README.md +2 -1
- package/templates/.agents/zaip-aios/VERSION +1 -1
- package/templates/.agents/zaip-aios/guides/20-instalacao-detalhada.md +26 -1
- package/templates/template-manifest.json +120 -96
package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.helpers.tsx
CHANGED
|
@@ -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
|
|
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)",
|
package/templates/.agents/dashboard/modules/operations/src/react/export/xlsx-runtime-e2e.test.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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("
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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
|
});
|