@beignet/cli 0.0.40 → 0.0.42
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/CHANGELOG.md +19 -0
- package/README.md +139 -17
- package/dist/analysis/source-index.d.ts +38 -0
- package/dist/analysis/source-index.d.ts.map +1 -0
- package/dist/analysis/source-index.js +271 -0
- package/dist/analysis/source-index.js.map +1 -0
- package/dist/analysis/workspace.d.ts +16 -0
- package/dist/analysis/workspace.d.ts.map +1 -0
- package/dist/analysis/workspace.js +134 -0
- package/dist/analysis/workspace.js.map +1 -0
- package/dist/app-map-schema.d.ts +5 -0
- package/dist/app-map-schema.d.ts.map +1 -0
- package/dist/app-map-schema.js +26 -0
- package/dist/app-map-schema.js.map +1 -0
- package/dist/app-map.d.ts +96 -0
- package/dist/app-map.d.ts.map +1 -0
- package/dist/app-map.js +1141 -0
- package/dist/app-map.js.map +1 -0
- package/dist/check.d.ts +7 -0
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +20 -5
- package/dist/check.js.map +1 -1
- package/dist/choices.d.ts +18 -0
- package/dist/choices.d.ts.map +1 -1
- package/dist/choices.js +35 -0
- package/dist/choices.js.map +1 -1
- package/dist/db.d.ts +49 -13
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +202 -21
- package/dist/db.js.map +1 -1
- package/dist/doctor-fixes.d.ts +64 -0
- package/dist/doctor-fixes.d.ts.map +1 -0
- package/dist/doctor-fixes.js +142 -0
- package/dist/doctor-fixes.js.map +1 -0
- package/dist/explain.d.ts +100 -0
- package/dist/explain.d.ts.map +1 -0
- package/dist/explain.js +606 -0
- package/dist/explain.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +165 -21
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +33 -9
- package/dist/inspect.d.ts.map +1 -1
- package/dist/inspect.js +406 -119
- package/dist/inspect.js.map +1 -1
- package/dist/lib.d.ts +10 -2
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +5 -2
- package/dist/lib.js.map +1 -1
- package/dist/make/shared.js +3 -3
- package/dist/make/shared.js.map +1 -1
- package/dist/make.d.ts.map +1 -1
- package/dist/make.js +63 -2
- package/dist/make.js.map +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +188 -12
- package/dist/mcp.js.map +1 -1
- package/dist/preflight.d.ts.map +1 -1
- package/dist/preflight.js +10 -0
- package/dist/preflight.js.map +1 -1
- package/dist/provider-add.d.ts.map +1 -1
- package/dist/provider-add.js +167 -13
- package/dist/provider-add.js.map +1 -1
- package/dist/provider-audit.d.ts +6 -0
- package/dist/provider-audit.d.ts.map +1 -1
- package/dist/provider-audit.js +63 -15
- package/dist/provider-audit.js.map +1 -1
- package/dist/templates/agents.d.ts.map +1 -1
- package/dist/templates/agents.js +35 -6
- package/dist/templates/agents.js.map +1 -1
- package/dist/templates/base.d.ts.map +1 -1
- package/dist/templates/base.js +13 -7
- package/dist/templates/base.js.map +1 -1
- package/dist/templates/index.d.ts +1 -1
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +8 -1
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/server.d.ts +3 -0
- package/dist/templates/server.d.ts.map +1 -1
- package/dist/templates/server.js +55 -1
- package/dist/templates/server.js.map +1 -1
- package/dist/templates/shared.d.ts +2 -1
- package/dist/templates/shared.d.ts.map +1 -1
- package/dist/templates/shared.js +8 -5
- package/dist/templates/shared.js.map +1 -1
- package/package.json +3 -2
- package/skills/app-structure/SKILL.md +48 -6
- package/src/analysis/source-index.ts +395 -0
- package/src/analysis/workspace.ts +180 -0
- package/src/app-map-schema.ts +28 -0
- package/src/app-map.ts +1705 -0
- package/src/check.ts +27 -4
- package/src/choices.ts +57 -0
- package/src/db.ts +276 -28
- package/src/doctor-fixes.ts +252 -0
- package/src/explain.ts +894 -0
- package/src/index.ts +237 -31
- package/src/inspect.ts +567 -147
- package/src/lib.ts +64 -1
- package/src/make/shared.ts +3 -3
- package/src/make.ts +90 -2
- package/src/mcp.ts +292 -12
- package/src/preflight.ts +14 -0
- package/src/provider-add.ts +211 -12
- package/src/provider-audit.ts +127 -22
- package/src/templates/agents.ts +35 -6
- package/src/templates/base.ts +25 -6
- package/src/templates/index.ts +18 -1
- package/src/templates/server.ts +58 -1
- package/src/templates/shared.ts +15 -7
package/dist/make.js
CHANGED
|
@@ -558,6 +558,7 @@ export async function makeJob(options) {
|
|
|
558
558
|
await updateOutboxRegistry(targetDir, names, "jobs", config, {
|
|
559
559
|
dryRun: true,
|
|
560
560
|
});
|
|
561
|
+
await updateInngestJobRegistry(targetDir, names, config, { dryRun: true });
|
|
561
562
|
const result = await makeFeatureArtifact({
|
|
562
563
|
targetDir,
|
|
563
564
|
config,
|
|
@@ -582,6 +583,9 @@ export async function makeJob(options) {
|
|
|
582
583
|
await applyOutboxPortWiring(result, targetDir, config, {
|
|
583
584
|
dryRun: Boolean(options.dryRun),
|
|
584
585
|
});
|
|
586
|
+
await applyInngestJobRegistryUpdate(result, targetDir, names, config, {
|
|
587
|
+
dryRun: Boolean(options.dryRun),
|
|
588
|
+
});
|
|
585
589
|
return result;
|
|
586
590
|
}
|
|
587
591
|
export async function makeTask(options) {
|
|
@@ -2416,6 +2420,65 @@ async function applyOutboxRegistryUpdate(result, targetDir, names, kind, config,
|
|
|
2416
2420
|
result.files.push(config.paths.outbox);
|
|
2417
2421
|
}
|
|
2418
2422
|
}
|
|
2423
|
+
function inngestRegistryPath(config) {
|
|
2424
|
+
return path.posix.join(path.posix.dirname(config.paths.server), "inngest.ts");
|
|
2425
|
+
}
|
|
2426
|
+
async function appUsesInngestJobs(targetDir) {
|
|
2427
|
+
const source = await readOptionalFile(path.join(targetDir, "package.json"));
|
|
2428
|
+
if (source === undefined)
|
|
2429
|
+
return false;
|
|
2430
|
+
try {
|
|
2431
|
+
const packageJson = JSON.parse(source);
|
|
2432
|
+
return Boolean(packageJson.dependencies?.["@beignet/provider-jobs-inngest"] ??
|
|
2433
|
+
packageJson.devDependencies?.["@beignet/provider-jobs-inngest"]);
|
|
2434
|
+
}
|
|
2435
|
+
catch {
|
|
2436
|
+
return false;
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
async function updateInngestJobRegistry(targetDir, names, config, options) {
|
|
2440
|
+
if (!(await appUsesInngestJobs(targetDir)))
|
|
2441
|
+
return undefined;
|
|
2442
|
+
const registryPath = inngestRegistryPath(config);
|
|
2443
|
+
const destination = path.join(targetDir, registryPath);
|
|
2444
|
+
const existing = await readOptionalFile(destination);
|
|
2445
|
+
if (existing === undefined) {
|
|
2446
|
+
throw new Error(`@beignet/provider-jobs-inngest is installed, but ${registryPath} is missing. Run \`beignet provider add jobs-inngest\` to create the execution registry before generating jobs.`);
|
|
2447
|
+
}
|
|
2448
|
+
const featureIndexPath = path.join(featureArtifactDir(names, "jobs", config), "index.ts");
|
|
2449
|
+
const registryName = `${names.featureSingularCamel}Jobs`;
|
|
2450
|
+
const importLine = `import { ${registryName} } from "${aliasModule(featureIndexPath)}";`;
|
|
2451
|
+
let next = existing;
|
|
2452
|
+
if (!next.includes(importLine))
|
|
2453
|
+
next = insertAfterImports(next, importLine);
|
|
2454
|
+
const registry = arrayInitializerInfo(next, "inngestJobs");
|
|
2455
|
+
if (!registry) {
|
|
2456
|
+
throw new Error(`Could not find \`export const inngestJobs = [...]\` in ${registryPath}. Restore the generated registry or register ${registryName} manually.`);
|
|
2457
|
+
}
|
|
2458
|
+
if (!identifiersFromArrayExpression(registry.text).has(registryName)) {
|
|
2459
|
+
const updatedArray = appendToArrayExpression(registry.text, [
|
|
2460
|
+
`...${registryName}`,
|
|
2461
|
+
]);
|
|
2462
|
+
next = `${next.slice(0, registry.start)}${updatedArray}${next.slice(registry.end)}`;
|
|
2463
|
+
}
|
|
2464
|
+
if (next === existing)
|
|
2465
|
+
return "skipped";
|
|
2466
|
+
if (!options.dryRun)
|
|
2467
|
+
await writeFile(destination, next);
|
|
2468
|
+
return "updated";
|
|
2469
|
+
}
|
|
2470
|
+
async function applyInngestJobRegistryUpdate(result, targetDir, names, config, options) {
|
|
2471
|
+
const registryResult = await updateInngestJobRegistry(targetDir, names, config, options);
|
|
2472
|
+
if (registryResult === undefined)
|
|
2473
|
+
return;
|
|
2474
|
+
const registryPath = inngestRegistryPath(config);
|
|
2475
|
+
if (registryResult === "updated")
|
|
2476
|
+
result.updatedFiles.push(registryPath);
|
|
2477
|
+
if (registryResult === "skipped")
|
|
2478
|
+
result.skippedFiles.push(registryPath);
|
|
2479
|
+
if (!result.files.includes(registryPath))
|
|
2480
|
+
result.files.push(registryPath);
|
|
2481
|
+
}
|
|
2419
2482
|
function schemasFile(names, mode, options) {
|
|
2420
2483
|
return `import { z } from "zod";
|
|
2421
2484
|
|
|
@@ -3621,8 +3684,6 @@ export const ${names.jobExportName} = defineJob("${names.jobName}", {
|
|
|
3621
3684
|
\tpayload: ${names.payloadSchemaName},
|
|
3622
3685
|
\tretry: retry.exponential({
|
|
3623
3686
|
\t\tattempts: 3,
|
|
3624
|
-
\t\tinitialDelay: "1s",
|
|
3625
|
-
\t\tmaxDelay: "1m",
|
|
3626
3687
|
\t}),
|
|
3627
3688
|
\tasync handle({ payload, ctx }) {
|
|
3628
3689
|
\t\tctx.ports.logger.info("Job handled", {
|