@zaip-ai/cli 1.3.8 → 1.4.1
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 +58 -3
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +17 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/services/adapters.js +4 -4
- package/dist/services/adapters.js.map +1 -1
- package/dist/services/codex-config-template.d.ts +2 -2
- package/dist/services/codex-config-template.d.ts.map +1 -1
- package/dist/services/codex-config-template.js +3 -3
- package/dist/services/codex-config-template.js.map +1 -1
- package/dist/services/codex-rules.d.ts +1 -1
- package/dist/services/codex-rules.d.ts.map +1 -1
- package/dist/services/codex-rules.js +9 -24
- package/dist/services/codex-rules.js.map +1 -1
- package/dist/services/delivery-git-preflight.d.ts +23 -0
- package/dist/services/delivery-git-preflight.d.ts.map +1 -0
- package/dist/services/delivery-git-preflight.js +69 -0
- package/dist/services/delivery-git-preflight.js.map +1 -0
- package/dist/services/doctor.d.ts.map +1 -1
- package/dist/services/doctor.js +13 -1
- package/dist/services/doctor.js.map +1 -1
- package/dist/services/install-agents-template.d.ts.map +1 -1
- package/dist/services/install-agents-template.js +22 -28
- package/dist/services/install-agents-template.js.map +1 -1
- package/dist/services/install-profile.d.ts +8 -0
- package/dist/services/install-profile.d.ts.map +1 -0
- package/dist/services/install-profile.js +56 -0
- package/dist/services/install-profile.js.map +1 -0
- package/dist/services/logger.d.ts.map +1 -1
- package/dist/services/logger.js +6 -5
- package/dist/services/logger.js.map +1 -1
- package/dist/services/stack-git.d.ts +9 -0
- package/dist/services/stack-git.d.ts.map +1 -0
- package/dist/services/stack-git.js +188 -0
- package/dist/services/stack-git.js.map +1 -0
- package/dist/services/stack-plan.d.ts +3 -1
- package/dist/services/stack-plan.d.ts.map +1 -1
- package/dist/services/stack-plan.js +15 -1
- package/dist/services/stack-plan.js.map +1 -1
- package/dist/services/stack-terraform.d.ts +13 -0
- package/dist/services/stack-terraform.d.ts.map +1 -0
- package/dist/services/stack-terraform.js +274 -0
- package/dist/services/stack-terraform.js.map +1 -0
- package/dist/services/template-manifest.d.ts.map +1 -1
- package/dist/services/template-manifest.js +14 -1
- package/dist/services/template-manifest.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/.agents/.env.example +34 -0
- package/templates/{README.md → .agents/README.md} +124 -60
- package/templates/.agents/config/agents/catalog.yaml +23 -23
- package/templates/.agents/config/clients/codex/agents/zaip-agent-analyst.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-auditor.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-backend.toml +5 -4
- package/templates/.agents/config/clients/codex/agents/zaip-agent-brand-strategist.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-builder.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-cloud-engineer.toml +10 -7
- package/templates/.agents/config/clients/codex/agents/zaip-agent-data-analyst.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-designer.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-finalizer.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-frontend.toml +5 -4
- package/templates/.agents/config/clients/codex/agents/zaip-agent-general-operations.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-governance-compliance.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-growth-strategist.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-integrator.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-marketing-analyst.toml +5 -4
- package/templates/.agents/config/clients/codex/agents/zaip-agent-orchestrator.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-refactoring-specialist.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-reviewer.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-sales-specialist.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-security-auditor.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-task-executor.toml +1 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-website-developer.toml +5 -4
- package/templates/.agents/config/clients/codex/agents/zaip-agent-writer.toml +1 -0
- package/templates/.agents/config/pricing/models.json +25 -1
- package/templates/.agents/config/project.yaml +2 -0
- package/templates/.agents/dashboard/.zaip-managed.json +200 -88
- package/templates/.agents/dashboard/DATA-DICTIONARY.md +1 -1
- package/templates/.agents/dashboard/README.md +58 -19
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-DwVZOmMV.js → CostCalculationGuidePage-snUCQYTC.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-VcLx9iOO.js → DashboardHelpDialog-oZVlf-l5.js} +72 -8
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-CyjMXkm8.js → PricingSettingsDialog-BPtVUGgs.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-3Awyaovx.js +3 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-DFZwIXSC.js → TraceabilityWorkspace-BYjVOHI_.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-DbaLbU2q.js +68 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-DXBOtWNI.js → icons-vendor-TPUT2IUt.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Cmlx8OYH.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-ZJFXmK7m.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-DaNXQPyk.js → react-vendor-Ct48XHGL.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-I4AKqVDX.js → traceability-BDe4_Ubl.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +6 -6
- package/templates/.agents/dashboard/apps/frontend/src/App.tsx +73 -67
- package/templates/.agents/dashboard/apps/frontend/src/AppLoadingBoundary.tsx +35 -7
- package/templates/.agents/dashboard/apps/frontend/src/AppWorkBoard.ts +55 -0
- package/templates/.agents/dashboard/apps/frontend/src/ProjectStackEditor.tsx +11 -0
- package/templates/.agents/dashboard/apps/frontend/src/app-loading-boundary.css +98 -0
- package/templates/.agents/dashboard/apps/frontend/src/cost-period-refresh.test.ts +5 -5
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api-reconciliation.ts +33 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.test.ts +75 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +7 -8
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-model.ts +14 -2
- package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +35 -0
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +78 -2
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.test.ts +28 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.ts +8 -5
- package/templates/.agents/dashboard/apps/frontend/src/use-app-effects.ts +180 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/contracts.ts +7 -4
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorContent.tsx +13 -7
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +14 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTableDisplay.ts +211 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +152 -157
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.tsx +155 -142
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/InvocationManifestQuery.test.ts +145 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/period-cost-groups.ts +7 -5
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-compact-cost-page.ts +4 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-group-page.ts +4 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-run-page.ts +4 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +4 -4
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts +79 -1
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.tsx +105 -11
- package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +482 -332
- package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +430 -285
- package/templates/.agents/dashboard/packages/local-runtime/scripts/build-sqlite-runtime.mjs +14 -2
- package/templates/.agents/dashboard/packages/local-runtime/scripts/rebuild-sqlite-read-model.mjs +6 -26
- package/templates/.agents/dashboard/packages/local-runtime/scripts/validate-sqlite-read-model.mjs +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/scripts/verify-persistent-launch.mjs +268 -0
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +482 -332
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.test.ts +90 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +112 -22
- package/templates/.agents/dashboard/packages/local-runtime/src/server-agent-assets.ts +39 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-browser-lease.ts +33 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-refresh.test.ts +148 -11
- package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-result.test.ts +68 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-refresh.test.ts +19 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-refresh.ts +39 -43
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-revision.test.ts +42 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-revision.ts +26 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-synchronization.ts +34 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-startup.ts +30 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-work-reconciliation.test.ts +89 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-work-reconciliation.ts +88 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-workspace.ts +68 -7
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +11 -5
- package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +129 -99
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-agent-productivity.test.ts +111 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-agent-productivity.ts +140 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-agent-page.test.ts +127 -4
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-agent-page.ts +145 -5
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-aggregates.ts +156 -23
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-group-projection.ts +18 -9
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-projection.ts +52 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-persistence.ts +35 -13
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-force-canonical.test.ts +56 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-incremental-cache.test.ts +29 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-incremental-cache.ts +136 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-incremental-refresh.test.ts +251 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-projection.ts +22 -7
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-cache.test-support.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-canonical-parsing.ts +42 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-canonical.ts +793 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider-duration.test.ts +270 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider-fixture.ts +3 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider.test.ts +18 -4
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-source-fingerprint.test.ts +87 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-source-fingerprint.ts +105 -16
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.test.ts +131 -59
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.ts +1000 -1115
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-snapshot-cache.ts +13 -92
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-claims.test.mjs +79 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-page.mjs +27 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-lifecycle.mjs +6 -6
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-prerequisites.mjs +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-refresh.mjs +2 -10
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-server.mjs +142 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +231 -239
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +18 -29
- package/templates/.agents/dashboard/packages/windows-launcher/Program.cs +6 -0
- package/templates/.agents/dashboard/zaip-dashboard-windows.exe +0 -0
- package/templates/.agents/requirements/autonomous-assurance.md +1 -1
- package/templates/.agents/requirements/cloud-hostinger-autonomy.md +47 -0
- 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 +2 -2
- 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/rules/autonomy-decision.md +1 -1
- package/templates/.agents/rules/cloud-hostinger-autonomy.md +21 -0
- package/templates/.agents/rules/core.md +5 -4
- package/templates/.agents/rules/local-sqlite-storage.md +18 -0
- package/templates/.agents/rules/meta-mcp.md +21 -0
- package/templates/.agents/rules/workflow.md +1 -0
- package/templates/.agents/runtime/bin/zaip.mjs +305 -137
- package/templates/.agents/runtime/checksums.sha256 +2 -2
- package/templates/.agents/runtime/provenance.json +2 -2
- package/templates/.agents/skills/zaip-skill-api-to-mcp/SKILL.md +4 -0
- package/templates/.agents/skills/zaip-skill-brand-governance/SKILL.md +25 -9
- package/templates/.agents/skills/zaip-skill-brand-governance/references/brandbook-framework.md +2 -2
- package/templates/.agents/skills/zaip-skill-brand-governance/references/brandbook-standards.md +2 -2
- package/templates/.agents/skills/zaip-skill-change/references/observable-evidence.md +15 -0
- package/templates/.agents/skills/zaip-skill-dashboard-sqlite/SKILL.md +13 -5
- package/templates/.agents/skills/zaip-skill-data-analyst/SKILL.md +10 -5
- package/templates/.agents/skills/zaip-skill-execution/SKILL.md +5 -4
- package/templates/.agents/skills/zaip-skill-frontend-launcher/SKILL.md +4 -3
- package/templates/.agents/skills/zaip-skill-frontend-launcher/references/launcher-contract.md +5 -3
- package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +5 -5
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs +78 -13
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.test.mjs +59 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/yaml-parser.mjs +157 -0
- package/templates/.agents/skills/zaip-skill-growth-strategy-revops/SKILL.md +11 -6
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/SKILL.md +17 -0
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/agents/openai.yaml +7 -0
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/autonomous-cloud-inputs.example.json +41 -0
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/autonomous-runner.md +84 -0
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/operational-contract.md +19 -0
- package/templates/.agents/skills/zaip-skill-local-credentials/SKILL.md +43 -0
- package/templates/.agents/skills/zaip-skill-local-credentials/agents/openai.yaml +6 -0
- package/templates/.agents/skills/zaip-skill-local-credentials/references/dotenv-resolution.md +47 -0
- package/templates/.agents/skills/zaip-skill-marketing/SKILL.md +8 -3
- package/templates/.agents/skills/zaip-skill-meta-ads/SKILL.md +16 -0
- package/templates/.agents/skills/zaip-skill-meta-ads/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-ads/references/setup.md +3 -0
- package/templates/.agents/skills/zaip-skill-meta-ads-setup/SKILL.md +24 -0
- package/templates/.agents/skills/zaip-skill-meta-ads-setup/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-ads-setup/references/diagnostics.md +13 -0
- package/templates/.agents/skills/zaip-skill-meta-ads-setup/references/official-sources.md +10 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-api-health/SKILL.md +12 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-api-health/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-api-health/references/LICENSE +21 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-api-health/references/upstream.md +77 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-api-integration/SKILL.md +12 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-api-integration/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-api-integration/references/LICENSE +21 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-api-integration/references/upstream.md +126 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-app-health-check/SKILL.md +12 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-app-health-check/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-app-health-check/references/LICENSE +21 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-app-health-check/references/upstream.md +67 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-app-review-prep/SKILL.md +12 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-app-review-prep/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-app-review-prep/references/LICENSE +21 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-app-review-prep/references/upstream.md +69 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-compliance-check/SKILL.md +12 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-compliance-check/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-compliance-check/references/LICENSE +21 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-compliance-check/references/upstream.md +79 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-debug-access-token/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-debug-access-token/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-debug-access-token/references/LICENSE +21 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-debug-access-token/references/upstream.md +144 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-debug-webhooks/SKILL.md +12 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-debug-webhooks/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-debug-webhooks/references/LICENSE +21 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-debug-webhooks/references/upstream.md +83 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-search-docs/SKILL.md +10 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-search-docs/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-search-docs/references/LICENSE +21 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-search-docs/references/setup.md +11 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-search-docs/references/upstream.md +55 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-webhook-setup/SKILL.md +12 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-webhook-setup/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-webhook-setup/references/LICENSE +21 -0
- package/templates/.agents/skills/zaip-skill-meta-devtools-webhook-setup/references/upstream.md +56 -0
- package/templates/.agents/skills/zaip-skill-sales-methodology/SKILL.md +12 -7
- package/templates/.agents/skills/zaip-skill-sqlite-read-model/SKILL.md +11 -4
- package/templates/.agents/skills/zaip-skill-tool-setup/SKILL.md +6 -4
- package/templates/.agents/skills/zaip-skill-tool-setup/references/codex-config.md +4 -2
- package/templates/.agents/skills/zaip-skill-tool-setup/references/secrets.md +1 -0
- package/templates/.agents/tools/catalog.yaml +6 -0
- package/templates/.agents/tools/cloud-runner-dns.mjs +28 -0
- package/templates/.agents/tools/cloud-runner-terraform.mjs +212 -0
- package/templates/.agents/tools/cloud-runner.integration.test.mjs +239 -0
- package/templates/.agents/tools/cloud-runner.mjs +786 -0
- package/templates/.agents/tools/cloud-runner.test.mjs +534 -0
- package/templates/.agents/tools/cloud-terraform-plan-policy.mjs +262 -0
- package/templates/.agents/tools/mcp/development/meta-devtools/README.md +14 -0
- package/templates/.agents/tools/mcp/development/meta-devtools/manifest.yaml +28 -0
- package/templates/.agents/tools/mcp/infra/cloudflare/manifest.yaml +2 -3
- package/templates/.agents/tools/mcp/infra/hostinger/manifest.yaml +1 -3
- package/templates/.agents/tools/mcp/marketing/meta-ads/README.md +15 -13
- package/templates/.agents/tools/mcp/marketing/meta-ads/manifest.yaml +15 -10
- package/templates/.agents/tools/profiles/development.yaml +3 -0
- package/templates/infra/terraform/.terraform.lock.hcl +42 -0
- package/templates/infra/terraform/README.md +31 -0
- package/templates/infra/terraform/backend.tf.json +13 -0
- package/templates/infra/terraform/deployment-inputs.example.yaml +22 -0
- package/templates/infra/terraform/fixtures/approved-targets.json +32 -0
- package/templates/infra/terraform/fixtures/plan-approved.json +67 -0
- package/templates/infra/terraform/main.tf +77 -0
- package/templates/infra/terraform/outputs.tf +20 -0
- package/templates/infra/terraform/terraform.tfvars.example +26 -0
- package/templates/infra/terraform/variables.tf +91 -0
- package/templates/infra/terraform/versions.tf +18 -0
- package/templates/scripts/validate-cloud-hostinger-contract.mjs +89 -0
- package/templates/scripts/validate-cloud-terraform-plan.mjs +1 -0
- package/templates/template-manifest.json +599 -167
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-BwnJpl02.js +0 -3
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-C09KmlSw.js +0 -68
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Dyo_wpL4.js +0 -2
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-hPPfVGQv.css +0 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-stale-seed.ts +0 -50
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { copyFile, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
1
|
+
import { copyFile, mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
|
|
@@ -39,6 +39,10 @@ const buildOptions = {
|
|
|
39
39
|
"node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/helper/websocket/index.js",
|
|
40
40
|
),
|
|
41
41
|
hono: resolve(root, "node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/index.js"),
|
|
42
|
+
"hono/streaming": resolve(
|
|
43
|
+
root,
|
|
44
|
+
"node_modules/.pnpm/hono@4.12.34/node_modules/hono/dist/helper/streaming/index.js",
|
|
45
|
+
),
|
|
42
46
|
zod: resolve(root, "node_modules/.pnpm/zod@4.4.3/node_modules/zod"),
|
|
43
47
|
"@zaip-ai/core": resolve(root, "packages/core/src/index.ts"),
|
|
44
48
|
"@zaip-ai/costs": resolve(root, "packages/costs/src/index.ts"),
|
|
@@ -103,7 +107,15 @@ await writeFile(
|
|
|
103
107
|
(await readFile(distributedServer, "utf8")).replace(/[ \t]+$/gm, ""),
|
|
104
108
|
"utf8",
|
|
105
109
|
);
|
|
106
|
-
|
|
110
|
+
// Replace the entrypoint atomically: Windows may keep the previous file mapped
|
|
111
|
+
// in a running reader even after that reader has closed its file descriptor.
|
|
112
|
+
const stagedServer = resolve(packageRoot, `server.mjs.${process.pid}.tmp`);
|
|
113
|
+
try {
|
|
114
|
+
await copyFile(distributedServer, stagedServer);
|
|
115
|
+
await rename(stagedServer, resolve(packageRoot, "server.mjs"));
|
|
116
|
+
} finally {
|
|
117
|
+
await rm(stagedServer, { force: true });
|
|
118
|
+
}
|
|
107
119
|
if (process.env.ZAIP_RUNTIME_METAFILE === "1") {
|
|
108
120
|
await writeFile(
|
|
109
121
|
resolve(packageRoot, "dist/server.cjs.metafile.json"),
|
package/templates/.agents/dashboard/packages/local-runtime/scripts/rebuild-sqlite-read-model.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { relative, resolve } from "node:path";
|
|
1
|
+
import { resolve } from "node:path";
|
|
3
2
|
|
|
4
3
|
const workspaceRoot = resolve(
|
|
5
4
|
process.env.ZAIP_WORKSPACE ?? resolve(import.meta.dirname, "../../../../.."),
|
|
@@ -7,27 +6,8 @@ const workspaceRoot = resolve(
|
|
|
7
6
|
process.env.ZAIP_UI_ROOT ??= resolve(workspaceRoot, ".agents/dashboard/apps/frontend/dist");
|
|
8
7
|
const { default: runtime } = await import("../dist/server.cjs");
|
|
9
8
|
const { rebuildSqliteReadModel, validateSqliteReadModelSchema } = runtime;
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
process.stdout.write(
|
|
16
|
-
`${JSON.stringify({ storage_mode: "sqlite_read_model", ...result, schema })}\n`,
|
|
17
|
-
);
|
|
18
|
-
} finally {
|
|
19
|
-
// The background seed refresher owns only its generated refresh-*.sqlite
|
|
20
|
-
// path. Cleanup belongs to this worker so a launcher exit cannot leak it.
|
|
21
|
-
if (typeof cleanupPath === "string") {
|
|
22
|
-
const refreshDirectory = resolve(workspaceRoot, ".local", "dashboard-sqlite");
|
|
23
|
-
const candidate = resolve(cleanupPath);
|
|
24
|
-
const name = relative(refreshDirectory, candidate);
|
|
25
|
-
const safeGeneratedRefresh =
|
|
26
|
-
name !== "" &&
|
|
27
|
-
!name.startsWith("..") &&
|
|
28
|
-
!name.includes("/") &&
|
|
29
|
-
!name.includes("\\") &&
|
|
30
|
-
/^refresh-\d+-[0-9a-f]+\.sqlite$/i.test(name);
|
|
31
|
-
if (safeGeneratedRefresh) await rm(candidate, { force: true }).catch(() => {});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
9
|
+
const result = await rebuildSqliteReadModel(workspaceRoot);
|
|
10
|
+
const schema = validateSqliteReadModelSchema(result.path);
|
|
11
|
+
process.stdout.write(
|
|
12
|
+
`${JSON.stringify({ storage_mode: "sqlite_read_model", ...result, schema })}\n`,
|
|
13
|
+
);
|
package/templates/.agents/dashboard/packages/local-runtime/scripts/validate-sqlite-read-model.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { DatabaseSync } from "node:sqlite";
|
|
|
5
5
|
const workspaceRoot = resolve(import.meta.dirname, "../../../../..");
|
|
6
6
|
const databasePath =
|
|
7
7
|
process.env.ZAIP_SQLITE_DB_PATH ??
|
|
8
|
-
resolve(workspaceRoot, ".local/
|
|
8
|
+
resolve(workspaceRoot, ".local/sqlite/zaip-aios-dashboard.sqlite");
|
|
9
9
|
const runtime = await import("../dist/server.cjs");
|
|
10
10
|
const schema = runtime.validateSqliteReadModelSchema(databasePath);
|
|
11
11
|
const database = new DatabaseSync(databasePath, { readOnly: true });
|
package/templates/.agents/dashboard/packages/local-runtime/scripts/verify-persistent-launch.mjs
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
import { readdir, readFile, stat } from "node:fs/promises";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
|
+
import { join, resolve } from "node:path";
|
|
7
|
+
import { performance } from "node:perf_hooks";
|
|
8
|
+
import { DatabaseSync } from "node:sqlite";
|
|
9
|
+
|
|
10
|
+
// Exercise the shipped Windows entrypoint, not a test-only server. This command
|
|
11
|
+
// does not edit sources. Its isolated browser owns the tested session.
|
|
12
|
+
const workspace = resolve(
|
|
13
|
+
process.env.ZAIP_WORKSPACE ?? resolve(import.meta.dirname, "../../../../.."),
|
|
14
|
+
);
|
|
15
|
+
const databasePath = resolve(workspace, ".local/sqlite/zaip-aios-dashboard.sqlite");
|
|
16
|
+
const executable = resolve(workspace, ".agents/dashboard/zaip-dashboard-windows.exe");
|
|
17
|
+
const workspaceKey = createHash("sha256")
|
|
18
|
+
.update(`${workspace}:dashboard-sqlite`)
|
|
19
|
+
.digest("hex")
|
|
20
|
+
.slice(0, 16);
|
|
21
|
+
const sessionPath = join(
|
|
22
|
+
tmpdir(),
|
|
23
|
+
"zaip-aios",
|
|
24
|
+
`dashboard-sqlite-${workspaceKey}`,
|
|
25
|
+
"dashboard-sqlite-session.json",
|
|
26
|
+
);
|
|
27
|
+
const launchTimeoutMs = positiveNumber(process.env.ZAIP_VERIFY_LAUNCH_TIMEOUT_MS, 180_000);
|
|
28
|
+
const refreshTimeoutMs = positiveNumber(process.env.ZAIP_VERIFY_REFRESH_TIMEOUT_MS, 180_000);
|
|
29
|
+
const warmBudgetMs = positiveNumber(process.env.ZAIP_VERIFY_WARM_BUDGET_MS, 15_000);
|
|
30
|
+
const { chromium } = await import("@playwright/test");
|
|
31
|
+
const browser = await chromium.launch({ headless: true });
|
|
32
|
+
const pages = [];
|
|
33
|
+
const pageErrors = [];
|
|
34
|
+
|
|
35
|
+
function positiveNumber(value, fallback) {
|
|
36
|
+
const number = value === undefined ? fallback : Number(value);
|
|
37
|
+
assert.ok(
|
|
38
|
+
Number.isFinite(number) && number > 0,
|
|
39
|
+
"Verification timeouts must be positive numbers",
|
|
40
|
+
);
|
|
41
|
+
return number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function session() {
|
|
45
|
+
const value = JSON.parse(await readFile(sessionPath, "utf8"));
|
|
46
|
+
assert.equal(value.workspaceKey, workspaceKey, "The launcher must select this workspace");
|
|
47
|
+
assert.equal(
|
|
48
|
+
resolve(value.dbPath),
|
|
49
|
+
databasePath,
|
|
50
|
+
"The launcher must use the official persistent database",
|
|
51
|
+
);
|
|
52
|
+
assert.ok(Number.isInteger(value.serverPid) && value.serverPid > 0);
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function api(value, route) {
|
|
57
|
+
const response = await fetch(`http://127.0.0.1:${value.port}/api/v2/${route}`, {
|
|
58
|
+
headers: { "x-zaip-session": value.token },
|
|
59
|
+
signal: AbortSignal.timeout(10_000),
|
|
60
|
+
});
|
|
61
|
+
const body = await response.json();
|
|
62
|
+
return { status: response.status, body };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function launch() {
|
|
66
|
+
const started = performance.now();
|
|
67
|
+
if (process.env.ZAIP_VERIFY_EXISTING_SESSION === "1") {
|
|
68
|
+
const current = await session();
|
|
69
|
+
const page = await browser.newPage({ viewport: { width: 1440, height: 960 } });
|
|
70
|
+
pages.push(page);
|
|
71
|
+
page.on("pageerror", (error) => pageErrors.push(error.message));
|
|
72
|
+
await page.goto(
|
|
73
|
+
`http://127.0.0.1:${current.port}/?token=${encodeURIComponent(current.token)}`,
|
|
74
|
+
{ waitUntil: "domcontentloaded", timeout: 30_000 },
|
|
75
|
+
);
|
|
76
|
+
await page.getByRole("navigation", { name: "Áreas do dashboard" }).waitFor({ timeout: 30_000 });
|
|
77
|
+
await page.getByText("Status das tarefas", { exact: true }).waitFor({ timeout: 30_000 });
|
|
78
|
+
return { current, page, elapsedMs: null, visibleMs: Math.round(performance.now() - started) };
|
|
79
|
+
}
|
|
80
|
+
const claimPath = join(sessionPath, "..", "dashboard-sqlite-launch.json");
|
|
81
|
+
const previousClaim = JSON.parse(await readFile(claimPath, "utf8").catch(() => "null"));
|
|
82
|
+
const page = await browser.newPage({ viewport: { width: 1440, height: 960 } });
|
|
83
|
+
pages.push(page);
|
|
84
|
+
page.on("pageerror", (error) => pageErrors.push(error.message));
|
|
85
|
+
let wrapperError;
|
|
86
|
+
const handoff = new Promise((resolveLaunch, reject) => {
|
|
87
|
+
const child = spawn(executable, [], {
|
|
88
|
+
cwd: workspace,
|
|
89
|
+
env: { ...process.env, ZAIP_UI_NO_BROWSER: "1" },
|
|
90
|
+
stdio: "ignore",
|
|
91
|
+
windowsHide: true,
|
|
92
|
+
});
|
|
93
|
+
const timeout = setTimeout(() => {
|
|
94
|
+
// Stop only the wrapper this verification started. Do not terminate the
|
|
95
|
+
// dashboard, its writer, another launcher, or another workspace.
|
|
96
|
+
child.kill();
|
|
97
|
+
reject(new Error(`Executable did not finish its handoff within ${launchTimeoutMs}ms`));
|
|
98
|
+
}, launchTimeoutMs);
|
|
99
|
+
child.once("error", (error) => {
|
|
100
|
+
clearTimeout(timeout);
|
|
101
|
+
reject(error);
|
|
102
|
+
});
|
|
103
|
+
child.once("exit", (code) => {
|
|
104
|
+
clearTimeout(timeout);
|
|
105
|
+
if (code === 0) resolveLaunch();
|
|
106
|
+
else reject(new Error(`Dashboard executable exited with code ${code}`));
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
// Attach to preparation immediately, including while the runtime is building.
|
|
110
|
+
// The browser is the session owner and must remain connected through refresh.
|
|
111
|
+
void handoff.catch((error) => {
|
|
112
|
+
wrapperError = error;
|
|
113
|
+
});
|
|
114
|
+
let attached = false;
|
|
115
|
+
while (performance.now() - started < launchTimeoutMs) {
|
|
116
|
+
if (wrapperError) throw wrapperError;
|
|
117
|
+
const claim = JSON.parse(await readFile(claimPath, "utf8").catch(() => "null"));
|
|
118
|
+
if (claim?.claimId && claim.claimId !== previousClaim?.claimId) {
|
|
119
|
+
try {
|
|
120
|
+
await page.goto(`http://127.0.0.1:${claim.launchPort}/`, {
|
|
121
|
+
waitUntil: "domcontentloaded",
|
|
122
|
+
timeout: 10_000,
|
|
123
|
+
});
|
|
124
|
+
attached = true;
|
|
125
|
+
break;
|
|
126
|
+
} catch {
|
|
127
|
+
/* The owner can publish its claim just before listening. */
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
await new Promise((done) => setTimeout(done, 100));
|
|
131
|
+
}
|
|
132
|
+
assert.ok(attached, "The verification browser must attach to the latest launch");
|
|
133
|
+
await handoff;
|
|
134
|
+
const elapsedMs = Math.round(performance.now() - started);
|
|
135
|
+
const current = await session();
|
|
136
|
+
const health = await api(current, "health");
|
|
137
|
+
assert.equal(health.status, 200);
|
|
138
|
+
assert.equal(health.body.workspaceKey, workspaceKey);
|
|
139
|
+
assert.equal(health.body.status, "ok");
|
|
140
|
+
await page.getByRole("navigation", { name: "Áreas do dashboard" }).waitFor({ timeout: 30_000 });
|
|
141
|
+
await page.getByText("Status das tarefas", { exact: true }).waitFor({ timeout: 30_000 });
|
|
142
|
+
return { elapsedMs, current, health, page, visibleMs: Math.round(performance.now() - started) };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async function awaitCurrentSnapshot(current) {
|
|
146
|
+
const started = performance.now();
|
|
147
|
+
let latest;
|
|
148
|
+
while (performance.now() - started < refreshTimeoutMs) {
|
|
149
|
+
latest = await api(current, "health");
|
|
150
|
+
if (latest.status === 200 && latest.body.snapshot_state === "current") {
|
|
151
|
+
const readiness = await api(current, "ready");
|
|
152
|
+
if (
|
|
153
|
+
readiness.status === 200 &&
|
|
154
|
+
readiness.body.status === "ready" &&
|
|
155
|
+
readiness.body.snapshot_state === "current"
|
|
156
|
+
) {
|
|
157
|
+
return { elapsedMs: Math.round(performance.now() - started), health: latest.body };
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
await new Promise((done) => setTimeout(done, 1_000));
|
|
161
|
+
}
|
|
162
|
+
throw new Error(
|
|
163
|
+
`Canonical refresh did not reach current within ${refreshTimeoutMs}ms; last state=${latest?.body?.snapshot_state}`,
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async function databaseInventory() {
|
|
168
|
+
const paths = [];
|
|
169
|
+
async function visit(directory) {
|
|
170
|
+
for (const entry of await readdir(directory, { withFileTypes: true })) {
|
|
171
|
+
const path = join(directory, entry.name);
|
|
172
|
+
if (entry.isDirectory()) await visit(path);
|
|
173
|
+
else if (entry.isFile() && /\.(?:sqlite|db)$/i.test(entry.name)) paths.push(resolve(path));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
await visit(resolve(workspace, ".local/sqlite"));
|
|
177
|
+
paths.sort();
|
|
178
|
+
assert.ok(
|
|
179
|
+
paths.includes(databasePath),
|
|
180
|
+
"The dashboard database must exist at its stable path in the shared SQLite folder",
|
|
181
|
+
);
|
|
182
|
+
const database = new DatabaseSync(databasePath, { readOnly: true });
|
|
183
|
+
try {
|
|
184
|
+
const integrity = database.prepare("PRAGMA quick_check").all();
|
|
185
|
+
assert.deepEqual(
|
|
186
|
+
integrity.map((row) => row.quick_check),
|
|
187
|
+
["ok"],
|
|
188
|
+
);
|
|
189
|
+
const metadata = Object.fromEntries(
|
|
190
|
+
database
|
|
191
|
+
.prepare(
|
|
192
|
+
"SELECT key, value FROM zaip_vw_read_model_metadata WHERE key IN ('schema_version', 'source_file_count', 'canonical_run_count', 'last_synced_at', 'last_sync_at', 'source_checked_at', 'snapshot_day')",
|
|
193
|
+
)
|
|
194
|
+
.all()
|
|
195
|
+
.map(({ key, value }) => [key, value]),
|
|
196
|
+
);
|
|
197
|
+
const info = await stat(databasePath);
|
|
198
|
+
return {
|
|
199
|
+
path: databasePath,
|
|
200
|
+
paths,
|
|
201
|
+
bytes: info.size,
|
|
202
|
+
birthtime_ms: info.birthtimeMs,
|
|
203
|
+
integrity: "ok",
|
|
204
|
+
metadata,
|
|
205
|
+
};
|
|
206
|
+
} finally {
|
|
207
|
+
database.close();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
try {
|
|
212
|
+
const first = await launch();
|
|
213
|
+
const initialRefresh = await awaitCurrentSnapshot(first.current);
|
|
214
|
+
const beforeSecond = await databaseInventory();
|
|
215
|
+
const second = await launch();
|
|
216
|
+
// Session ownership can change with the latest click; storage must stay fixed.
|
|
217
|
+
assert.ok(
|
|
218
|
+
second.elapsedMs <= warmBudgetMs,
|
|
219
|
+
`Warm handoff took ${second.elapsedMs}ms; budget=${warmBudgetMs}ms`,
|
|
220
|
+
);
|
|
221
|
+
const finalRefresh = await awaitCurrentSnapshot(second.current);
|
|
222
|
+
const final = await databaseInventory();
|
|
223
|
+
// Other purposes may create/update their own databases independently.
|
|
224
|
+
assert.equal(final.path, beforeSecond.path);
|
|
225
|
+
assert.equal(
|
|
226
|
+
final.birthtime_ms,
|
|
227
|
+
beforeSecond.birthtime_ms,
|
|
228
|
+
"The database must be updated in place",
|
|
229
|
+
);
|
|
230
|
+
assert.deepEqual(pageErrors, [], "Dashboard must render without uncaught JavaScript errors");
|
|
231
|
+
if (process.env.ZAIP_VERIFY_SCREENSHOT) {
|
|
232
|
+
await second.page.screenshot({
|
|
233
|
+
path: resolve(process.env.ZAIP_VERIFY_SCREENSHOT),
|
|
234
|
+
fullPage: true,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
const browserCheck = {
|
|
238
|
+
status: "passed",
|
|
239
|
+
mode: "isolated_headless",
|
|
240
|
+
first_visible_ms: first.visibleMs,
|
|
241
|
+
warm_visible_ms: second.visibleMs,
|
|
242
|
+
};
|
|
243
|
+
process.stdout.write(
|
|
244
|
+
`${JSON.stringify({
|
|
245
|
+
status: "passed",
|
|
246
|
+
mode:
|
|
247
|
+
process.env.ZAIP_VERIFY_EXISTING_SESSION === "1"
|
|
248
|
+
? "existing_session"
|
|
249
|
+
: "two_executable_launches",
|
|
250
|
+
checked_at: new Date().toISOString(),
|
|
251
|
+
entrypoint: executable,
|
|
252
|
+
browser_opened: false,
|
|
253
|
+
first_handoff_ms: first.elapsedMs,
|
|
254
|
+
first_refresh_wait_ms: initialRefresh.elapsedMs,
|
|
255
|
+
warm_handoff_ms: second.elapsedMs,
|
|
256
|
+
warm_budget_ms: warmBudgetMs,
|
|
257
|
+
final_refresh_wait_ms: finalRefresh.elapsedMs,
|
|
258
|
+
server_pid: second.current.serverPid,
|
|
259
|
+
server_reused: second.current.serverPid === first.current.serverPid,
|
|
260
|
+
port: second.current.port,
|
|
261
|
+
database: final,
|
|
262
|
+
browser_check: browserCheck,
|
|
263
|
+
})}\n`,
|
|
264
|
+
);
|
|
265
|
+
} finally {
|
|
266
|
+
for (const page of pages) await page.close().catch(() => {});
|
|
267
|
+
await browser.close();
|
|
268
|
+
}
|