@zaip-ai/cli 1.3.6 → 1.3.8
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 +31 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +22 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/services/sqlite-bootstrap.d.ts +29 -0
- package/dist/services/sqlite-bootstrap.d.ts.map +1 -0
- package/dist/services/sqlite-bootstrap.js +141 -0
- package/dist/services/sqlite-bootstrap.js.map +1 -0
- package/dist/services/stack-install.d.ts +14 -0
- package/dist/services/stack-install.d.ts.map +1 -0
- package/dist/services/stack-install.js +176 -0
- package/dist/services/stack-install.js.map +1 -0
- package/dist/services/stack-node.d.ts +12 -0
- package/dist/services/stack-node.d.ts.map +1 -0
- package/dist/services/stack-node.js +150 -0
- package/dist/services/stack-node.js.map +1 -0
- package/dist/services/stack-package-manager.d.ts +12 -0
- package/dist/services/stack-package-manager.d.ts.map +1 -0
- package/dist/services/stack-package-manager.js +178 -0
- package/dist/services/stack-package-manager.js.map +1 -0
- package/dist/services/stack-plan.d.ts +33 -0
- package/dist/services/stack-plan.d.ts.map +1 -0
- package/dist/services/stack-plan.js +116 -0
- package/dist/services/stack-plan.js.map +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/templates/.agents/dashboard/.zaip-managed.json +35 -27
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-3Lrfq645.js → DashboardHelpDialog-VcLx9iOO.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-BwnJpl02.js +3 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-BomxqCBU.css → ProjectSettingsPage-GgzpZ_PY.css} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-diq9g1L8.js → TraceabilityWorkspace-DFZwIXSC.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-Deo_W81f.js → index-Dyo_wpL4.js} +2 -2
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.tsx +15 -2
- package/templates/.agents/dashboard/apps/frontend/src/ProjectStackEditor.tsx +22 -6
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +2 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-model.ts +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-page.css +0 -104
- package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +26 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-stack-versions.css +117 -0
- package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +119 -119
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +119 -119
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.test.ts +153 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +161 -40
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-prerequisites.mjs +5 -5
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-prerequisites.test.mjs +8 -0
- package/templates/.agents/dashboard/stack-dependencies.json +14 -0
- package/templates/.agents/requirements/autonomous-assurance.md +1 -1
- package/templates/.agents/requirements/comparative-audit.md +1 -1
- package/templates/.agents/requirements/context-engine.md +1 -1
- package/templates/.agents/requirements/cost-observability.md +1 -1
- package/templates/.agents/requirements/dashboard-launch.md +1 -1
- package/templates/.agents/requirements/data-export.md +1 -1
- package/templates/.agents/requirements/design-system.md +1 -1
- package/templates/.agents/requirements/execution-engine.md +1 -1
- package/templates/.agents/requirements/kanban-dashboard.md +1 -1
- package/templates/.agents/requirements/model-orchestration.md +1 -1
- package/templates/.agents/requirements/public-distribution.md +1 -1
- package/templates/.agents/requirements/software-architecture.md +1 -1
- package/templates/.agents/requirements/strategic-improvements.md +1 -1
- package/templates/.agents/requirements/work-lifecycle.md +1 -1
- package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
- package/templates/README.md +1 -1
- package/templates/template-manifest.json +53 -45
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-B_Oj6Dlf.js +0 -3
|
@@ -424,4 +424,157 @@ describe("project settings persistence", () => {
|
|
|
424
424
|
"growth_strategy",
|
|
425
425
|
]);
|
|
426
426
|
});
|
|
427
|
+
|
|
428
|
+
it("reports the project-local installed version separately from configured stack versions", async () => {
|
|
429
|
+
const { filesystem } = await fixtureProject();
|
|
430
|
+
const current = await readProjectSettings(filesystem);
|
|
431
|
+
await filesystem.writeTextAtomic(
|
|
432
|
+
PROJECT_CONFIG_PATH,
|
|
433
|
+
serializeYaml({
|
|
434
|
+
...current,
|
|
435
|
+
stack: {
|
|
436
|
+
...current.stack,
|
|
437
|
+
overrides: {
|
|
438
|
+
...current.stack.overrides,
|
|
439
|
+
components: { backend_api: { name: "Hono", version: "4.12.34" } },
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
}),
|
|
443
|
+
);
|
|
444
|
+
await filesystem.writeTextAtomic(
|
|
445
|
+
".agents/dashboard/stack-dependencies.json",
|
|
446
|
+
JSON.stringify({
|
|
447
|
+
schema_version: 1,
|
|
448
|
+
node: "22.16.0",
|
|
449
|
+
packages: [
|
|
450
|
+
{ name: "typescript", version: "7.0.2", development: true },
|
|
451
|
+
{ name: "redis", version: "6.2.1", development: false },
|
|
452
|
+
{ name: "hono", version: "4.12.33", development: false },
|
|
453
|
+
],
|
|
454
|
+
}),
|
|
455
|
+
);
|
|
456
|
+
await mkdir(join(filesystem.root, "node_modules", "hono"), { recursive: true });
|
|
457
|
+
await writeFile(
|
|
458
|
+
join(filesystem.root, "node_modules", "hono", "package.json"),
|
|
459
|
+
JSON.stringify({ name: "hono", version: "4.12.35", main: "index.js" }),
|
|
460
|
+
"utf8",
|
|
461
|
+
);
|
|
462
|
+
await writeFile(
|
|
463
|
+
join(filesystem.root, "node_modules", "hono", "index.js"),
|
|
464
|
+
"export {};",
|
|
465
|
+
"utf8",
|
|
466
|
+
);
|
|
467
|
+
|
|
468
|
+
const overview = await readProjectOverview(filesystem);
|
|
469
|
+
|
|
470
|
+
expect(overview.stack_components).toEqual(
|
|
471
|
+
expect.arrayContaining([
|
|
472
|
+
expect.objectContaining({
|
|
473
|
+
name: "Hono",
|
|
474
|
+
version: "4.12.35",
|
|
475
|
+
configured_version: "4.12.34",
|
|
476
|
+
source: "node_modules/hono/package.json",
|
|
477
|
+
installation: "installed",
|
|
478
|
+
verification: "exact",
|
|
479
|
+
}),
|
|
480
|
+
expect.objectContaining({
|
|
481
|
+
name: "TypeScript",
|
|
482
|
+
version: null,
|
|
483
|
+
configured_version: "7.0.2",
|
|
484
|
+
installation: "missing",
|
|
485
|
+
verification: "unavailable",
|
|
486
|
+
}),
|
|
487
|
+
expect.objectContaining({
|
|
488
|
+
name: "Redis",
|
|
489
|
+
version: null,
|
|
490
|
+
configured_version: "6.2.1",
|
|
491
|
+
installation: "missing",
|
|
492
|
+
verification: "unavailable",
|
|
493
|
+
}),
|
|
494
|
+
]),
|
|
495
|
+
);
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
it("only reports Hono and React as bundled when their dashboard artifacts exist", async () => {
|
|
499
|
+
const { filesystem } = await fixtureProject();
|
|
500
|
+
await filesystem.writeTextAtomic(
|
|
501
|
+
".agents/dashboard/stack-dependencies.json",
|
|
502
|
+
JSON.stringify({
|
|
503
|
+
schema_version: 1,
|
|
504
|
+
node: "22.16.0",
|
|
505
|
+
packages: [
|
|
506
|
+
{ name: "hono", version: "4.12.34", development: false },
|
|
507
|
+
{ name: "react", version: "19.2.7", development: false },
|
|
508
|
+
],
|
|
509
|
+
}),
|
|
510
|
+
);
|
|
511
|
+
const absent = await readProjectOverview(filesystem);
|
|
512
|
+
expect(absent.stack_components).toEqual(
|
|
513
|
+
expect.arrayContaining([
|
|
514
|
+
expect.objectContaining({ name: "Hono", installation: "missing", version: null }),
|
|
515
|
+
expect.objectContaining({ name: "React", installation: "missing", version: null }),
|
|
516
|
+
]),
|
|
517
|
+
);
|
|
518
|
+
|
|
519
|
+
await filesystem.writeTextAtomic(
|
|
520
|
+
".agents/dashboard/packages/local-runtime/server.mjs",
|
|
521
|
+
"/* bundled runtime */",
|
|
522
|
+
);
|
|
523
|
+
await filesystem.writeTextAtomic(
|
|
524
|
+
".agents/dashboard/apps/frontend/dist/assets/index.js",
|
|
525
|
+
"/* bundled frontend */",
|
|
526
|
+
);
|
|
527
|
+
const bundled = await readProjectOverview(filesystem);
|
|
528
|
+
expect(bundled.stack_components).toEqual(
|
|
529
|
+
expect.arrayContaining([
|
|
530
|
+
expect.objectContaining({
|
|
531
|
+
name: "Hono",
|
|
532
|
+
version: null,
|
|
533
|
+
configured_version: "4.12.34",
|
|
534
|
+
installation: "bundled",
|
|
535
|
+
source: ".agents/dashboard/packages/local-runtime/server.mjs",
|
|
536
|
+
}),
|
|
537
|
+
expect.objectContaining({
|
|
538
|
+
name: "React",
|
|
539
|
+
version: null,
|
|
540
|
+
configured_version: "19.2.7",
|
|
541
|
+
installation: "bundled",
|
|
542
|
+
source: ".agents/dashboard/apps/frontend/dist",
|
|
543
|
+
}),
|
|
544
|
+
]),
|
|
545
|
+
);
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
it("does not accept a local package without its matching identity and entrypoint", async () => {
|
|
549
|
+
const { filesystem } = await fixtureProject();
|
|
550
|
+
await mkdir(join(filesystem.root, "node_modules", "hono"), { recursive: true });
|
|
551
|
+
await writeFile(
|
|
552
|
+
join(filesystem.root, "node_modules", "hono", "package.json"),
|
|
553
|
+
JSON.stringify({ name: "not-hono", version: "4.12.35", main: "index.js" }),
|
|
554
|
+
"utf8",
|
|
555
|
+
);
|
|
556
|
+
await writeFile(
|
|
557
|
+
join(filesystem.root, "node_modules", "hono", "index.js"),
|
|
558
|
+
"export {};",
|
|
559
|
+
"utf8",
|
|
560
|
+
);
|
|
561
|
+
|
|
562
|
+
const mismatched = await readProjectOverview(filesystem);
|
|
563
|
+
expect(mismatched.stack_components).toEqual(
|
|
564
|
+
expect.arrayContaining([
|
|
565
|
+
expect.objectContaining({ name: "Hono", installation: "missing", version: null }),
|
|
566
|
+
]),
|
|
567
|
+
);
|
|
568
|
+
|
|
569
|
+
await filesystem.writeTextAtomic(
|
|
570
|
+
"node_modules/hono/package.json",
|
|
571
|
+
JSON.stringify({ name: "hono", version: "4.12.35", main: "missing.js" }),
|
|
572
|
+
);
|
|
573
|
+
const incomplete = await readProjectOverview(filesystem);
|
|
574
|
+
expect(incomplete.stack_components).toEqual(
|
|
575
|
+
expect.arrayContaining([
|
|
576
|
+
expect.objectContaining({ name: "Hono", installation: "missing", version: null }),
|
|
577
|
+
]),
|
|
578
|
+
);
|
|
579
|
+
});
|
|
427
580
|
});
|
|
@@ -12,6 +12,7 @@ const AGENT_CATALOG_PATH = ".agents/config/agents/catalog.yaml";
|
|
|
12
12
|
const CODEX_CONFIG_PATH = ".codex/config.toml";
|
|
13
13
|
const FRAMEWORK_LOCK_PATH = ".agents/config/framework.lock.yaml";
|
|
14
14
|
const SQLITE_READ_MODEL_PATH = ".local/dashboard-sqlite/read-model.sqlite";
|
|
15
|
+
const DASHBOARD_STACK_DEPENDENCIES_PATH = ".agents/dashboard/stack-dependencies.json";
|
|
15
16
|
export const SOFTWARE_ARCHITECTURE_PATH = ".agents/architecture/software-architecture.md";
|
|
16
17
|
|
|
17
18
|
export type ProjectOverview = {
|
|
@@ -24,8 +25,10 @@ export type ProjectOverview = {
|
|
|
24
25
|
stack_components: Array<{
|
|
25
26
|
name: string;
|
|
26
27
|
version: string | null;
|
|
28
|
+
configured_version: string | null;
|
|
27
29
|
source: string | null;
|
|
28
30
|
verification: "exact" | "constraint" | "unavailable";
|
|
31
|
+
installation: "runtime" | "installed" | "missing" | "bundled";
|
|
29
32
|
}>;
|
|
30
33
|
areas: Array<{
|
|
31
34
|
id:
|
|
@@ -142,63 +145,181 @@ async function countCodexHookEvents(filesystem: WorkspaceFileSystem): Promise<nu
|
|
|
142
145
|
async function readVerifiedStackComponents(
|
|
143
146
|
filesystem: WorkspaceFileSystem,
|
|
144
147
|
): Promise<ProjectOverview["stack_components"]> {
|
|
145
|
-
const [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
const [project, fallback, bundledRuntime, bundledFrontend] = await Promise.all([
|
|
149
|
+
readProjectSettings(filesystem),
|
|
150
|
+
readDashboardStackDependencies(filesystem),
|
|
151
|
+
hasNonEmptyFile(filesystem, ".agents/dashboard/packages/local-runtime/server.mjs"),
|
|
152
|
+
hasBundledDashboardFrontend(filesystem),
|
|
149
153
|
]);
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
component("Astro", packageVersion(rootPackage, "astro"), "package.json", "exact"),
|
|
155
|
-
component("Redis", packageVersion(rootPackage, "redis"), "package.json", "exact"),
|
|
156
|
-
component("BullMQ", packageVersion(rootPackage, "bullmq"), "package.json", "exact"),
|
|
157
|
-
component(
|
|
158
|
-
"Hono",
|
|
159
|
-
packageVersion(dashboardRuntime, "hono"),
|
|
160
|
-
".agents/dashboard/packages/local-runtime/package.json",
|
|
161
|
-
"exact",
|
|
162
|
-
),
|
|
163
|
-
component(
|
|
164
|
-
"React",
|
|
165
|
-
packageVersion(dashboardFrontend, "react"),
|
|
166
|
-
".agents/dashboard/apps/frontend/package.json",
|
|
167
|
-
"exact",
|
|
154
|
+
const configured = configuredStackVersions(project, fallback);
|
|
155
|
+
const packages = await Promise.all(
|
|
156
|
+
["typescript", "vite", "astro", "redis", "bullmq", "hono", "react"].map((name) =>
|
|
157
|
+
readInstalledPackageVersion(filesystem, name),
|
|
168
158
|
),
|
|
159
|
+
);
|
|
160
|
+
const installed = new Map(packages.map((item) => [item.name, item]));
|
|
161
|
+
return [
|
|
162
|
+
runtimeComponent("Node.js", process.versions.node, configured.get("node")),
|
|
163
|
+
packageComponent("TypeScript", "typescript", configured.get("typescript"), installed),
|
|
164
|
+
packageComponent("Vite", "vite", configured.get("vite"), installed),
|
|
165
|
+
packageComponent("Astro", "astro", configured.get("astro"), installed),
|
|
166
|
+
packageComponent("Redis", "redis", configured.get("redis"), installed),
|
|
167
|
+
packageComponent("BullMQ", "bullmq", configured.get("bullmq"), installed),
|
|
168
|
+
packageComponent("Hono", "hono", configured.get("hono"), installed, bundledRuntime),
|
|
169
|
+
packageComponent("React", "react", configured.get("react"), installed, bundledFrontend),
|
|
169
170
|
];
|
|
170
171
|
}
|
|
171
172
|
|
|
172
|
-
type
|
|
173
|
-
|
|
174
|
-
devDependencies?: Record<string, string>;
|
|
175
|
-
};
|
|
173
|
+
type InstalledPackage = { name: string; version: string | null };
|
|
174
|
+
type DashboardStackDependencies = { node: string | null; packages: Map<string, string> };
|
|
176
175
|
|
|
177
|
-
async function
|
|
176
|
+
async function readInstalledPackageVersion(
|
|
178
177
|
filesystem: WorkspaceFileSystem,
|
|
179
|
-
|
|
180
|
-
): Promise<
|
|
178
|
+
name: string,
|
|
179
|
+
): Promise<InstalledPackage> {
|
|
181
180
|
try {
|
|
182
|
-
const value =
|
|
183
|
-
|
|
181
|
+
const value = recordValue(
|
|
182
|
+
JSON.parse(await filesystem.readText(`node_modules/${name}/package.json`)),
|
|
183
|
+
);
|
|
184
|
+
const version = stringValue(value.version);
|
|
185
|
+
const entrypoint = packageEntrypoint(value);
|
|
186
|
+
if (
|
|
187
|
+
value.name !== name ||
|
|
188
|
+
version === null ||
|
|
189
|
+
!/^\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/.test(version) ||
|
|
190
|
+
entrypoint === null
|
|
191
|
+
)
|
|
192
|
+
return { name, version: null };
|
|
193
|
+
await filesystem.readText(`node_modules/${name}/${entrypoint}`);
|
|
194
|
+
return { name, version };
|
|
184
195
|
} catch {
|
|
185
|
-
return {};
|
|
196
|
+
return { name, version: null };
|
|
186
197
|
}
|
|
187
198
|
}
|
|
188
199
|
|
|
189
|
-
function
|
|
190
|
-
|
|
200
|
+
async function readDashboardStackDependencies(
|
|
201
|
+
filesystem: WorkspaceFileSystem,
|
|
202
|
+
): Promise<DashboardStackDependencies> {
|
|
203
|
+
try {
|
|
204
|
+
const source = recordValue(
|
|
205
|
+
JSON.parse(await filesystem.readText(DASHBOARD_STACK_DEPENDENCIES_PATH)),
|
|
206
|
+
);
|
|
207
|
+
const packages = new Map<string, string>();
|
|
208
|
+
for (const item of Array.isArray(source.packages) ? source.packages : []) {
|
|
209
|
+
const definition = recordValue(item);
|
|
210
|
+
const name = stringValue(definition.name);
|
|
211
|
+
const version = stringValue(definition.version);
|
|
212
|
+
if (name !== null && version !== null) packages.set(name, version);
|
|
213
|
+
}
|
|
214
|
+
return { node: stringValue(source.node), packages };
|
|
215
|
+
} catch {
|
|
216
|
+
return { node: null, packages: new Map() };
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function configuredStackVersions(
|
|
221
|
+
project: ProjectConfig,
|
|
222
|
+
fallback: DashboardStackDependencies,
|
|
223
|
+
): Map<string, string> {
|
|
224
|
+
const components = recordValue(recordValue(project.stack.overrides).components);
|
|
225
|
+
const configured = new Map(fallback.packages);
|
|
226
|
+
if (fallback.node !== null) configured.set("node", fallback.node);
|
|
227
|
+
for (const [component, packageName] of Object.entries({
|
|
228
|
+
backend_runtime: "node",
|
|
229
|
+
primary_language: "typescript",
|
|
230
|
+
web_language: "typescript",
|
|
231
|
+
web_build: "vite",
|
|
232
|
+
site_framework: "astro",
|
|
233
|
+
cache_messaging: "redis",
|
|
234
|
+
async_queue: "bullmq",
|
|
235
|
+
backend_api: "hono",
|
|
236
|
+
web_framework: "react",
|
|
237
|
+
})) {
|
|
238
|
+
const version = stringValue(recordValue(components[component]).version);
|
|
239
|
+
if (version !== null) configured.set(packageName, version);
|
|
240
|
+
}
|
|
241
|
+
return configured;
|
|
191
242
|
}
|
|
192
243
|
|
|
193
|
-
function
|
|
244
|
+
async function hasBundledDashboardFrontend(filesystem: WorkspaceFileSystem): Promise<boolean> {
|
|
245
|
+
try {
|
|
246
|
+
return (await filesystem.listFiles(".agents/dashboard/apps/frontend/dist", ".js")).length > 0;
|
|
247
|
+
} catch {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
async function hasNonEmptyFile(filesystem: WorkspaceFileSystem, path: string): Promise<boolean> {
|
|
253
|
+
try {
|
|
254
|
+
return (await filesystem.readText(path)).trim().length > 0;
|
|
255
|
+
} catch {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function runtimeComponent(
|
|
194
261
|
name: string,
|
|
195
262
|
version: string | null,
|
|
196
|
-
|
|
197
|
-
|
|
263
|
+
configuredVersion: string | undefined,
|
|
264
|
+
): ProjectOverview["stack_components"][number] {
|
|
265
|
+
return {
|
|
266
|
+
name,
|
|
267
|
+
version,
|
|
268
|
+
configured_version: configuredVersion ?? null,
|
|
269
|
+
source: `Runtime do Dashboard: ${process.execPath}`,
|
|
270
|
+
verification: "exact",
|
|
271
|
+
installation: "runtime",
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function packageComponent(
|
|
276
|
+
name: string,
|
|
277
|
+
packageName: string,
|
|
278
|
+
configuredVersion: string | undefined,
|
|
279
|
+
installed: ReadonlyMap<string, InstalledPackage>,
|
|
280
|
+
bundled = false,
|
|
198
281
|
): ProjectOverview["stack_components"][number] {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
282
|
+
const actual = installed.get(packageName)?.version ?? null;
|
|
283
|
+
if (actual !== null)
|
|
284
|
+
return {
|
|
285
|
+
name,
|
|
286
|
+
version: actual,
|
|
287
|
+
configured_version: configuredVersion ?? null,
|
|
288
|
+
source: `node_modules/${packageName}/package.json`,
|
|
289
|
+
verification: "exact",
|
|
290
|
+
installation: "installed",
|
|
291
|
+
};
|
|
292
|
+
if (bundled)
|
|
293
|
+
return {
|
|
294
|
+
name,
|
|
295
|
+
version: null,
|
|
296
|
+
configured_version: configuredVersion ?? null,
|
|
297
|
+
source:
|
|
298
|
+
packageName === "hono"
|
|
299
|
+
? ".agents/dashboard/packages/local-runtime/server.mjs"
|
|
300
|
+
: ".agents/dashboard/apps/frontend/dist",
|
|
301
|
+
verification: configuredVersion === undefined ? "unavailable" : "constraint",
|
|
302
|
+
installation: "bundled",
|
|
303
|
+
};
|
|
304
|
+
return {
|
|
305
|
+
name,
|
|
306
|
+
version: null,
|
|
307
|
+
configured_version: configuredVersion ?? null,
|
|
308
|
+
source: null,
|
|
309
|
+
verification: "unavailable",
|
|
310
|
+
installation: "missing",
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function stringValue(value: unknown): string | null {
|
|
315
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function packageEntrypoint(pkg: Record<string, unknown>): string | null {
|
|
319
|
+
if (typeof pkg.bin === "string") return pkg.bin;
|
|
320
|
+
const bin = Object.values(recordValue(pkg.bin)).find((value) => typeof value === "string");
|
|
321
|
+
if (typeof bin === "string") return bin;
|
|
322
|
+
return stringValue(pkg.main);
|
|
202
323
|
}
|
|
203
324
|
|
|
204
325
|
export async function persistProjectSettings(
|
package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-prerequisites.mjs
CHANGED
|
@@ -19,22 +19,22 @@ export async function ensureDashboardRecordsDirectory(root) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export async function assertDashboardPrerequisites(workspaceRoot) {
|
|
22
|
-
const major =
|
|
23
|
-
if (!Number.isInteger(major) || major < 22)
|
|
22
|
+
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
23
|
+
if (!Number.isInteger(major) || major < 22 || (major === 22 && minor < 16))
|
|
24
24
|
throw new Error(
|
|
25
|
-
`O Dashboard SQLite requer Node.js 22 ou superior; a versão encontrada foi ${process.versions.node}.
|
|
25
|
+
`O Dashboard SQLite requer Node.js 22.16.0 ou superior; a versão encontrada foi ${process.versions.node}. Atualize o Node.js e tente novamente.`,
|
|
26
26
|
);
|
|
27
27
|
try {
|
|
28
28
|
await import("node:sqlite");
|
|
29
29
|
} catch {
|
|
30
30
|
throw new Error(
|
|
31
|
-
"O Node.js instalado não disponibiliza node:sqlite. Reinstale
|
|
31
|
+
"O Node.js instalado não disponibiliza node:sqlite. Reinstale o Node.js 22.16.0 ou superior com suporte a SQLite.",
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
34
|
await ensureDashboardRecordsDirectory(workspaceRoot);
|
|
35
35
|
const required = resolve(workspaceRoot, ".agents/config");
|
|
36
36
|
if (!(await exists(required)))
|
|
37
37
|
throw new Error(
|
|
38
|
-
`Pré-requisito do Dashboard SQLite ausente: ${relative(workspaceRoot, required) || required}. Execute
|
|
38
|
+
`Pré-requisito do Dashboard SQLite ausente: ${relative(workspaceRoot, required) || required}. Execute npx @zaip-ai/cli@latest init na raiz do projeto e tente novamente.`,
|
|
39
39
|
);
|
|
40
40
|
}
|
package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-prerequisites.test.mjs
CHANGED
|
@@ -35,4 +35,12 @@ describe("dashboard SQLite prerequisites", () => {
|
|
|
35
35
|
await expect(assertDashboardPrerequisites(root)).resolves.toBeUndefined();
|
|
36
36
|
await expect(access(join(root, ".agents", "records"))).resolves.toBeUndefined();
|
|
37
37
|
});
|
|
38
|
+
|
|
39
|
+
it("directs incomplete consumers to init instead of a development install", async () => {
|
|
40
|
+
const root = await mkdtemp(join(tmpdir(), "zaip-dashboard-missing-config-"));
|
|
41
|
+
temporaryDirectories.push(root);
|
|
42
|
+
await expect(assertDashboardPrerequisites(root)).rejects.toThrow(
|
|
43
|
+
"npx @zaip-ai/cli@latest init",
|
|
44
|
+
);
|
|
45
|
+
});
|
|
38
46
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"node": "22.16.0",
|
|
4
|
+
"packages": [
|
|
5
|
+
{ "name": "typescript", "version": "7.0.2", "development": true },
|
|
6
|
+
{ "name": "vite", "version": "8.1.4", "development": true },
|
|
7
|
+
{ "name": "astro", "version": "7.2.4", "development": true },
|
|
8
|
+
{ "name": "redis", "version": "6.2.1", "development": false },
|
|
9
|
+
{ "name": "bullmq", "version": "6.2.0", "development": false },
|
|
10
|
+
{ "name": "hono", "version": "4.12.34", "development": false },
|
|
11
|
+
{ "name": "react", "version": "19.2.7", "development": false },
|
|
12
|
+
{ "name": "react-dom", "version": "19.2.7", "development": false }
|
|
13
|
+
]
|
|
14
|
+
}
|
package/templates/README.md
CHANGED
|
@@ -55,7 +55,7 @@ A atualização documental não aprova uma release. Consulte o [registro de limi
|
|
|
55
55
|
|
|
56
56
|
## Instalação em um comando
|
|
57
57
|
|
|
58
|
-
Com
|
|
58
|
+
Com Node.js 22.16.0 ou superior e npm, execute a instalação na raiz do projeto que receberá o ZAIP-AIOS. O `init` instala automaticamente as dependências ausentes da stack (TypeScript, Vite, Astro, cliente Redis, BullMQ, Hono, React e React DOM), verifica os runtimes distribuídos e prepara e valida o SQLite local. Um projeto novo recebe `package.json` e lockfile; versões locais existentes são preservadas e o retorno informa a versão encontrada e a configurada no ZAIP-AIOS. Não é necessário um driver SQLite separado:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
61
|
npx @zaip-ai/cli@latest init
|