everything-dev 1.48.0 → 1.50.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/dist/app.cjs +66 -86
- package/dist/app.cjs.map +1 -1
- package/dist/app.mjs +66 -87
- package/dist/app.mjs.map +1 -1
- package/dist/cli/db-doctor.cjs +6 -23
- package/dist/cli/db-doctor.cjs.map +1 -1
- package/dist/cli/db-doctor.mjs +7 -24
- package/dist/cli/db-doctor.mjs.map +1 -1
- package/dist/cli/db-repair.cjs +25 -20
- package/dist/cli/db-repair.cjs.map +1 -1
- package/dist/cli/db-repair.mjs +25 -20
- package/dist/cli/db-repair.mjs.map +1 -1
- package/dist/cli/db-studio.cjs +4 -2
- package/dist/cli/db-studio.cjs.map +1 -1
- package/dist/cli/db-studio.mjs +5 -3
- package/dist/cli/db-studio.mjs.map +1 -1
- package/dist/cli/framework-version.cjs +45 -9
- package/dist/cli/framework-version.cjs.map +1 -1
- package/dist/cli/framework-version.mjs +45 -10
- package/dist/cli/framework-version.mjs.map +1 -1
- package/dist/cli/infra.cjs +89 -3
- package/dist/cli/infra.cjs.map +1 -1
- package/dist/cli/infra.mjs +83 -4
- package/dist/cli/infra.mjs.map +1 -1
- package/dist/cli/init.cjs +39 -15
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.d.cts +8 -3
- package/dist/cli/init.d.cts.map +1 -1
- package/dist/cli/init.d.mts +8 -3
- package/dist/cli/init.d.mts.map +1 -1
- package/dist/cli/init.mjs +39 -16
- package/dist/cli/init.mjs.map +1 -1
- package/dist/cli/status.cjs +6 -2
- package/dist/cli/status.cjs.map +1 -1
- package/dist/cli/status.mjs +7 -3
- package/dist/cli/status.mjs.map +1 -1
- package/dist/cli/sync.cjs +1 -3
- package/dist/cli/sync.cjs.map +1 -1
- package/dist/cli/sync.mjs +1 -3
- package/dist/cli/sync.mjs.map +1 -1
- package/dist/cli/upgrade.cjs +8 -4
- package/dist/cli/upgrade.cjs.map +1 -1
- package/dist/cli/upgrade.mjs +8 -4
- package/dist/cli/upgrade.mjs.map +1 -1
- package/dist/cli.cjs +73 -9
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +74 -10
- package/dist/cli.mjs.map +1 -1
- package/dist/config.cjs +7 -3
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +7 -3
- package/dist/config.mjs.map +1 -1
- package/dist/contract.cjs +76 -4
- package/dist/contract.cjs.map +1 -1
- package/dist/contract.d.cts +164 -19
- package/dist/contract.d.cts.map +1 -1
- package/dist/contract.d.mts +164 -19
- package/dist/contract.d.mts.map +1 -1
- package/dist/contract.meta.cjs +17 -2
- package/dist/contract.meta.cjs.map +1 -1
- package/dist/contract.meta.d.cts +23 -2
- package/dist/contract.meta.d.mts +23 -2
- package/dist/contract.meta.mjs +17 -2
- package/dist/contract.meta.mjs.map +1 -1
- package/dist/contract.mjs +72 -5
- package/dist/contract.mjs.map +1 -1
- package/dist/db.cjs +33 -25
- package/dist/db.cjs.map +1 -1
- package/dist/db.d.cts +16 -9
- package/dist/db.d.cts.map +1 -1
- package/dist/db.d.mts +16 -9
- package/dist/db.d.mts.map +1 -1
- package/dist/db.mjs +33 -24
- package/dist/db.mjs.map +1 -1
- package/dist/dev-session.cjs +28 -0
- package/dist/dev-session.cjs.map +1 -1
- package/dist/dev-session.mjs +29 -1
- package/dist/dev-session.mjs.map +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/infra/planner.cjs +337 -0
- package/dist/infra/planner.cjs.map +1 -0
- package/dist/infra/planner.mjs +336 -0
- package/dist/infra/planner.mjs.map +1 -0
- package/dist/infra/preflight.cjs +131 -0
- package/dist/infra/preflight.cjs.map +1 -0
- package/dist/infra/preflight.mjs +130 -0
- package/dist/infra/preflight.mjs.map +1 -0
- package/dist/infra/types.cjs +9 -0
- package/dist/infra/types.cjs.map +1 -0
- package/dist/infra/types.mjs +8 -0
- package/dist/infra/types.mjs.map +1 -0
- package/dist/near-cli.cjs +37 -0
- package/dist/near-cli.cjs.map +1 -1
- package/dist/near-cli.mjs +36 -1
- package/dist/near-cli.mjs.map +1 -1
- package/dist/orchestrator.cjs +10 -2
- package/dist/orchestrator.cjs.map +1 -1
- package/dist/orchestrator.mjs +10 -2
- package/dist/orchestrator.mjs.map +1 -1
- package/dist/plugin.cjs +160 -43
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +64 -8
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +64 -8
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +164 -47
- package/dist/plugin.mjs.map +1 -1
- package/dist/process-registry.cjs +88 -0
- package/dist/process-registry.cjs.map +1 -0
- package/dist/process-registry.mjs +83 -0
- package/dist/process-registry.mjs.map +1 -0
- package/dist/publish.cjs +4 -0
- package/dist/publish.cjs.map +1 -1
- package/dist/publish.mjs +4 -0
- package/dist/publish.mjs.map +1 -1
- package/dist/service-descriptor.cjs +4 -0
- package/dist/service-descriptor.cjs.map +1 -1
- package/dist/service-descriptor.mjs +4 -1
- package/dist/service-descriptor.mjs.map +1 -1
- package/dist/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/dist/ui/index.cjs +2 -1
- package/dist/ui/index.d.cts +2 -2
- package/dist/ui/index.d.mts +2 -2
- package/dist/ui/index.mjs +2 -2
- package/dist/ui/router.cjs +40 -0
- package/dist/ui/router.cjs.map +1 -1
- package/dist/ui/router.d.cts +6 -1
- package/dist/ui/router.d.cts.map +1 -1
- package/dist/ui/router.d.mts +6 -1
- package/dist/ui/router.d.mts.map +1 -1
- package/dist/ui/router.mjs +40 -1
- package/dist/ui/router.mjs.map +1 -1
- package/package.json +4 -1
- package/skills/cli-reference/SKILL.md +5 -4
- package/skills/dev-workflow/SKILL.md +40 -11
- package/skills/plugin-development/SKILL.md +9 -2
package/dist/plugin.d.mts
CHANGED
|
@@ -57,11 +57,15 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
|
|
|
57
57
|
proxy: z.ZodDefault<z.ZodBoolean>;
|
|
58
58
|
ssr: z.ZodDefault<z.ZodBoolean>;
|
|
59
59
|
port: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
apiPort: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
uiPort: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
authPort: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
pluginPortStart: z.ZodOptional<z.ZodNumber>;
|
|
60
64
|
interactive: z.ZodOptional<z.ZodBoolean>;
|
|
61
65
|
}, z.core.$strip>, z.ZodObject<{
|
|
62
66
|
status: z.ZodEnum<{
|
|
63
|
-
error: "error";
|
|
64
67
|
started: "started";
|
|
68
|
+
error: "error";
|
|
65
69
|
}>;
|
|
66
70
|
description: z.ZodString;
|
|
67
71
|
processes: z.ZodArray<z.ZodString>;
|
|
@@ -386,10 +390,10 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
|
|
|
386
390
|
source: z.ZodOptional<z.ZodString>;
|
|
387
391
|
plugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
388
392
|
overrides: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
389
|
-
plugins: "plugins";
|
|
390
|
-
ui: "ui";
|
|
391
393
|
host: "host";
|
|
394
|
+
ui: "ui";
|
|
392
395
|
api: "api";
|
|
396
|
+
plugins: "plugins";
|
|
393
397
|
}>>>;
|
|
394
398
|
noInteractive: z.ZodDefault<z.ZodBoolean>;
|
|
395
399
|
noInstall: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -405,10 +409,10 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
|
|
|
405
409
|
extends: z.ZodString;
|
|
406
410
|
plugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
407
411
|
overrides: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
408
|
-
plugins: "plugins";
|
|
409
|
-
ui: "ui";
|
|
410
412
|
host: "host";
|
|
413
|
+
ui: "ui";
|
|
411
414
|
api: "api";
|
|
415
|
+
plugins: "plugins";
|
|
412
416
|
}>>>;
|
|
413
417
|
filesCopied: z.ZodNumber;
|
|
414
418
|
timings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -480,6 +484,8 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
|
|
|
480
484
|
name: z.ZodString;
|
|
481
485
|
installed: z.ZodOptional<z.ZodString>;
|
|
482
486
|
latest: z.ZodOptional<z.ZodString>;
|
|
487
|
+
isLinked: z.ZodOptional<z.ZodBoolean>;
|
|
488
|
+
specifier: z.ZodOptional<z.ZodString>;
|
|
483
489
|
}, z.core.$strip>>;
|
|
484
490
|
lastSync: z.ZodOptional<z.ZodString>;
|
|
485
491
|
envFile: z.ZodEnum<{
|
|
@@ -492,8 +498,8 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
|
|
|
492
498
|
}, z.core.$strip>, _$_orpc_contract0.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
493
499
|
typesGen: _$_orpc_contract0.ContractProcedure<z.ZodObject<{
|
|
494
500
|
env: z.ZodOptional<z.ZodEnum<{
|
|
495
|
-
development: "development";
|
|
496
501
|
production: "production";
|
|
502
|
+
development: "development";
|
|
497
503
|
}>>;
|
|
498
504
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
499
505
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -545,7 +551,6 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
|
|
|
545
551
|
appliedHashCount: z.ZodNumber;
|
|
546
552
|
expectedTables: z.ZodArray<z.ZodString>;
|
|
547
553
|
missingTables: z.ZodArray<z.ZodString>;
|
|
548
|
-
legacyCount: z.ZodNumber;
|
|
549
554
|
workspaceDir: z.ZodOptional<z.ZodString>;
|
|
550
555
|
dbSecret: z.ZodOptional<z.ZodString>;
|
|
551
556
|
dbUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -568,6 +573,57 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
|
|
|
568
573
|
diagnosis: z.ZodAny;
|
|
569
574
|
error: z.ZodOptional<z.ZodString>;
|
|
570
575
|
}, z.core.$strip>, _$_orpc_contract0.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
576
|
+
ps: _$_orpc_contract0.ContractProcedure<_$_orpc_contract0.Schema<unknown, unknown>, z.ZodObject<{
|
|
577
|
+
status: z.ZodEnum<{
|
|
578
|
+
error: "error";
|
|
579
|
+
ok: "ok";
|
|
580
|
+
}>;
|
|
581
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
582
|
+
pid: z.ZodNumber;
|
|
583
|
+
configDir: z.ZodString;
|
|
584
|
+
parentPid: z.ZodOptional<z.ZodNumber>;
|
|
585
|
+
role: z.ZodEnum<{
|
|
586
|
+
standalone: "standalone";
|
|
587
|
+
"workspace-parent": "workspace-parent";
|
|
588
|
+
"workspace-child": "workspace-child";
|
|
589
|
+
}>;
|
|
590
|
+
ports: z.ZodDefault<z.ZodObject<{
|
|
591
|
+
host: z.ZodOptional<z.ZodNumber>;
|
|
592
|
+
api: z.ZodOptional<z.ZodNumber>;
|
|
593
|
+
ui: z.ZodOptional<z.ZodNumber>;
|
|
594
|
+
auth: z.ZodOptional<z.ZodNumber>;
|
|
595
|
+
}, z.core.$strip>>;
|
|
596
|
+
budget: z.ZodOptional<z.ZodObject<{
|
|
597
|
+
min: z.ZodNumber;
|
|
598
|
+
max: z.ZodNumber;
|
|
599
|
+
}, z.core.$strip>>;
|
|
600
|
+
startedAt: z.ZodNumber;
|
|
601
|
+
description: z.ZodString;
|
|
602
|
+
}, z.core.$strip>>;
|
|
603
|
+
error: z.ZodOptional<z.ZodString>;
|
|
604
|
+
}, z.core.$strip>, _$_orpc_contract0.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
605
|
+
kill: _$_orpc_contract0.ContractProcedure<z.ZodObject<{
|
|
606
|
+
configDir: z.ZodOptional<z.ZodString>;
|
|
607
|
+
signal: z.ZodDefault<z.ZodEnum<{
|
|
608
|
+
SIGTERM: "SIGTERM";
|
|
609
|
+
SIGKILL: "SIGKILL";
|
|
610
|
+
}>>;
|
|
611
|
+
all: z.ZodDefault<z.ZodBoolean>;
|
|
612
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
613
|
+
status: z.ZodEnum<{
|
|
614
|
+
error: "error";
|
|
615
|
+
killed: "killed";
|
|
616
|
+
}>;
|
|
617
|
+
killed: z.ZodArray<z.ZodObject<{
|
|
618
|
+
pid: z.ZodNumber;
|
|
619
|
+
configDir: z.ZodString;
|
|
620
|
+
}, z.core.$strip>>;
|
|
621
|
+
skipped: z.ZodArray<z.ZodObject<{
|
|
622
|
+
pid: z.ZodNumber;
|
|
623
|
+
reason: z.ZodString;
|
|
624
|
+
}, z.core.$strip>>;
|
|
625
|
+
error: z.ZodOptional<z.ZodString>;
|
|
626
|
+
}, z.core.$strip>, _$_orpc_contract0.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
571
627
|
}, z.ZodObject<{
|
|
572
628
|
configPath: z.ZodOptional<z.ZodString>;
|
|
573
629
|
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>, undefined, {
|
|
@@ -681,7 +737,7 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
|
|
|
681
737
|
}> | undefined;
|
|
682
738
|
} | null;
|
|
683
739
|
runtimeConfig: {
|
|
684
|
-
env: "
|
|
740
|
+
env: "production" | "staging" | "development";
|
|
685
741
|
account: string;
|
|
686
742
|
networkId: "testnet" | "mainnet";
|
|
687
743
|
host: {
|
package/dist/plugin.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;;;;UAoGiB,cAAA;EACf,YAAA,EAAc,eAAA;EACd,QAAA,EAAU,GAAA,SAAY,iBAAA;EACtB,aAAA,EAAe,aAAA;AAAA;AAAA,UAGA,YAAA;EACf,YAAA;EACA,gBAAA;EACA,OAAA;EACA,MAAA;EACA,OAAA;IAAW,IAAA;IAAe,EAAA;IAAa,GAAA;IAAc,IAAA;EAAA;EACrD,QAAA;AAAA;AAAA,KAGU,aAAA;EACV,KAAA;EACA,MAAA;EACA,UAAA;EACA,OAAA;AAAA;AAAA,cAGW,YAAA,EAAY,YAAA;AAAA,iBAKT,iBAAA,CAAA,IAAsB,cAAA;EAAmB,OAAA,GAAU,YAAA;AAAA;AAAA,iBA2I7C,wBAAA,CACpB,SAAA,UACA,SAAA,UACA,OAAA,EAAS,GAAA,WACR,OAAA,CAAQ,SAAA;AAAA,cA4BV,QAAA"}
|
package/dist/plugin.mjs
CHANGED
|
@@ -6,26 +6,30 @@ import { buildRuntimePluginsForConfig, drainConfigWarnings, findConfigPath, getH
|
|
|
6
6
|
import { createPlugin, z } from "./sdk.mjs";
|
|
7
7
|
import { bosContract } from "./contract.mjs";
|
|
8
8
|
import { computeSriHashForUrl, parseDeployLines } from "./integrity.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { pruneDeadEffect, readRegistry, unregisterPid } from "./process-registry.mjs";
|
|
10
|
+
import { PortAllocatorLive, buildRuntimeConfig, detectLocalPackages } from "./app.mjs";
|
|
10
11
|
import { syncResolvedSharedDeps } from "./shared-deps.mjs";
|
|
11
12
|
import { run } from "./utils/run.mjs";
|
|
12
13
|
import { colors } from "./utils/theme.mjs";
|
|
13
14
|
import { buildEveryPluginQuietly, buildEverythingDevQuietly, buildWorkspaceTargets, fileExists, getPluginRef, readJsonFile, selectWorkspaceTargets } from "./build.mjs";
|
|
14
|
-
import { ensureEnvFile, loadProjectEnv, syncGeneratedInfra, writeGeneratedInfra } from "./cli/infra.mjs";
|
|
15
|
+
import { ensureEnvFile, loadProjectEnv, materializeInfraPlan, syncGeneratedInfra, writeGeneratedInfra } from "./cli/infra.mjs";
|
|
15
16
|
import { saveBosConfig } from "./utils/save-config.mjs";
|
|
16
|
-
import { buildInitPatterns, copyFilteredFiles, detectGitRemoteUrl, fetchParentConfig, generateDatabaseMigrations, personalizeAgentsMd, personalizeConfig, removeInitLockfile, resolveSourceDir, runBunInstall, runTypesGen, scaffoldMinimalProject, stripOrphanedWorkspacesFromLockfile, writeInitSnapshot } from "./cli/init.mjs";
|
|
17
|
+
import { buildInitPatterns, buildPluginRouteExclusions, copyFilteredFiles, detectGitRemoteUrl, fetchParentConfig, generateDatabaseMigrations, personalizeAgentsMd, personalizeConfig, removeInitLockfile, resolveSourceDir, runBunInstall, runTypesGen, scaffoldMinimalProject, stripOrphanedWorkspacesFromLockfile, writeInitSnapshot } from "./cli/init.mjs";
|
|
17
18
|
import { getStatus } from "./cli/status.mjs";
|
|
18
19
|
import { syncTemplate } from "./cli/sync.mjs";
|
|
19
20
|
import { upgradeTemplate } from "./cli/upgrade.mjs";
|
|
20
21
|
import { generateCodeArtifacts } from "./code-artifacts.mjs";
|
|
21
|
-
import {
|
|
22
|
+
import { buildDescription, buildServiceDescriptorMap, buildServiceDescriptorMapFromPlan } from "./service-descriptor.mjs";
|
|
23
|
+
import { planInfra } from "./infra/planner.mjs";
|
|
24
|
+
import { preflightLocalInfra } from "./infra/preflight.mjs";
|
|
25
|
+
import { addFunctionCallAccessKey, deleteAccessKeys, ensureNearCli, listPublishKeys } from "./near-cli.mjs";
|
|
22
26
|
import { extractPublishedUrl, publishToFastKv } from "./publish.mjs";
|
|
23
|
-
import { buildDescription, buildServiceDescriptorMap } from "./service-descriptor.mjs";
|
|
24
27
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
25
28
|
import { basename, dirname, join, resolve } from "node:path";
|
|
26
29
|
import { Effect } from "effect";
|
|
27
30
|
import { EventEmitter } from "node:events";
|
|
28
31
|
import process from "node:process";
|
|
32
|
+
import { createInterface } from "node:readline/promises";
|
|
29
33
|
|
|
30
34
|
//#region src/plugin.ts
|
|
31
35
|
const pluginEvents = new EventEmitter();
|
|
@@ -385,7 +389,6 @@ var plugin_default = createPlugin({
|
|
|
385
389
|
processes: [],
|
|
386
390
|
timings: devTimings
|
|
387
391
|
};
|
|
388
|
-
const hostPort = input.port ?? getHostDevelopmentPort(deps.bosConfig.app.host.development);
|
|
389
392
|
suppressWarnings();
|
|
390
393
|
const developmentRuntime = buildRuntimeConfig(deps.bosConfig, {
|
|
391
394
|
uiSource,
|
|
@@ -397,49 +400,70 @@ var plugin_default = createPlugin({
|
|
|
397
400
|
});
|
|
398
401
|
drainConfigWarnings();
|
|
399
402
|
resumeWarnings();
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
403
|
+
const plan = await timePhase(devTimings, "ports", () => Effect.runPromise(planInfra({
|
|
404
|
+
configDir: deps.configDir,
|
|
405
|
+
bosConfig: developmentRuntime,
|
|
406
|
+
cli: {
|
|
407
|
+
port: input.port,
|
|
408
|
+
apiPort: input.apiPort,
|
|
409
|
+
authPort: input.authPort,
|
|
410
|
+
uiPort: input.uiPort,
|
|
411
|
+
pluginPortStart: input.pluginPortStart,
|
|
412
|
+
ssr,
|
|
413
|
+
proxy,
|
|
414
|
+
hostSource,
|
|
415
|
+
uiSource,
|
|
416
|
+
apiSource,
|
|
417
|
+
authSource,
|
|
418
|
+
interactive: input.interactive
|
|
419
|
+
}
|
|
420
|
+
}).pipe(Effect.provide(PortAllocatorLive))));
|
|
421
|
+
const mergedEnv = { ...plan.envGenerated };
|
|
422
|
+
for (const [k, v] of Object.entries(process.env)) if (v != null && !(k in plan.envGenerated)) mergedEnv[k] = v;
|
|
423
|
+
const preflightFailures = await Effect.runPromise(preflightLocalInfra(plan.envGenerated, mergedEnv));
|
|
424
|
+
if (preflightFailures.length > 0) return {
|
|
425
|
+
status: "error",
|
|
426
|
+
description: `Infra preflight failed: ${preflightFailures.map((f) => f.error).join("; ")}`,
|
|
427
|
+
processes: [],
|
|
428
|
+
timings: devTimings
|
|
429
|
+
};
|
|
430
|
+
const services = buildServiceDescriptorMapFromPlan(plan, {
|
|
413
431
|
ssr,
|
|
414
432
|
proxy
|
|
415
433
|
});
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
|
|
434
|
+
materializeInfraPlan(deps.configDir, plan.envGenerated, plan.composeModel.databases.map((d) => ({
|
|
435
|
+
serviceName: `postgres-${d.slug.replace(/_/g, "-")}`,
|
|
436
|
+
containerName: d.containerName,
|
|
437
|
+
port: d.port,
|
|
438
|
+
volumeName: d.volumeName,
|
|
439
|
+
databaseName: d.dbName
|
|
440
|
+
})), plan.composeModel.redis.map((r) => ({
|
|
441
|
+
serviceName: `redis-${r.slug.replace(/_/g, "-")}`,
|
|
442
|
+
containerName: r.containerName,
|
|
443
|
+
port: r.port,
|
|
444
|
+
volumeName: r.volumeName
|
|
445
|
+
})), plan.runtimeConfig.account, plan.resolvedPorts.host);
|
|
446
|
+
ensureEnvFile(deps.configDir);
|
|
447
|
+
loadProjectEnv(deps.configDir);
|
|
448
|
+
const packages = [...plan.serviceDescriptors.keys()];
|
|
449
|
+
if (process.env.DEBUG === "true" || process.env.DEBUG === "1") console.error("[DEBUG dev] services keys:", packages.join(", "));
|
|
424
450
|
if (services.get("api")?.proxy) {
|
|
425
451
|
const proxyUrl = resolveProxyUrl(deps.bosConfig);
|
|
426
|
-
if (proxyUrl)
|
|
452
|
+
if (proxyUrl) plan.orchestrator.env.API_PROXY = proxyUrl;
|
|
427
453
|
}
|
|
428
|
-
const orchestrator = {
|
|
429
|
-
packages,
|
|
430
|
-
env: displayEnv,
|
|
431
|
-
description: buildDescription(services),
|
|
432
|
-
port: runtimeConfig.host.port,
|
|
433
|
-
interactive: input.interactive
|
|
434
|
-
};
|
|
435
454
|
pendingSession = {
|
|
436
|
-
orchestrator,
|
|
455
|
+
orchestrator: plan.orchestrator,
|
|
437
456
|
services,
|
|
438
|
-
runtimeConfig
|
|
457
|
+
runtimeConfig: plan.runtimeConfig
|
|
439
458
|
};
|
|
459
|
+
await timePhase(devTimings, "generate artifacts", () => generateCodeArtifacts(deps.configDir, deps.bosConfig, {
|
|
460
|
+
env: "development",
|
|
461
|
+
extendsChain: devExtendsChain,
|
|
462
|
+
runtimeConfig: plan.runtimeConfig
|
|
463
|
+
}));
|
|
440
464
|
return {
|
|
441
465
|
status: "started",
|
|
442
|
-
description:
|
|
466
|
+
description: buildDescription(services) || plan.description,
|
|
443
467
|
processes: packages,
|
|
444
468
|
timings: devTimings
|
|
445
469
|
};
|
|
@@ -534,8 +558,22 @@ var plugin_default = createPlugin({
|
|
|
534
558
|
if (!value || value.length === 0) missingSecrets.push(secret);
|
|
535
559
|
}
|
|
536
560
|
if (missingSecrets.length > 0) warnings.push(`Missing ${missingSecrets.length} secret(s): ${missingSecrets.join(", ")}`);
|
|
537
|
-
const services = buildServiceDescriptorMap(runtimeConfig);
|
|
538
561
|
const stagingEnvVars = isStaging ? { BOS_GATEWAY: config.staging?.domain ?? config.domain ?? "" } : {};
|
|
562
|
+
const plan = await Effect.runPromise(planInfra({
|
|
563
|
+
configDir: deps.configDir,
|
|
564
|
+
bosConfig: runtimeConfig,
|
|
565
|
+
cli: {
|
|
566
|
+
port: input.port,
|
|
567
|
+
ssr: false,
|
|
568
|
+
proxy: false,
|
|
569
|
+
hostSource: "remote",
|
|
570
|
+
uiSource: "remote",
|
|
571
|
+
apiSource: "remote",
|
|
572
|
+
authSource: "remote",
|
|
573
|
+
interactive: input.interactive
|
|
574
|
+
}
|
|
575
|
+
}).pipe(Effect.provide(PortAllocatorLive)));
|
|
576
|
+
const services = buildServiceDescriptorMap(runtimeConfig);
|
|
539
577
|
const summary = {
|
|
540
578
|
configSource: remoteConfig ? `bos://${account}/${domain}` : findConfigPath() ?? "bos.config.json",
|
|
541
579
|
configSourceHttp: remoteConfig && account && domain ? buildRegistryConfigUrl(account, domain) : void 0,
|
|
@@ -555,10 +593,11 @@ var plugin_default = createPlugin({
|
|
|
555
593
|
env: {
|
|
556
594
|
NODE_ENV: "production",
|
|
557
595
|
...productionEnv,
|
|
558
|
-
...stagingEnvVars
|
|
596
|
+
...stagingEnvVars,
|
|
597
|
+
...plan.launch.env
|
|
559
598
|
},
|
|
560
599
|
description: `${isStaging ? "Staging" : "Production"} Mode (${config.account})`,
|
|
561
|
-
port,
|
|
600
|
+
port: plan.resolvedPorts.host ?? port,
|
|
562
601
|
interactive: input.interactive,
|
|
563
602
|
noLogs: true
|
|
564
603
|
},
|
|
@@ -572,7 +611,7 @@ var plugin_default = createPlugin({
|
|
|
572
611
|
});
|
|
573
612
|
return {
|
|
574
613
|
status: "running",
|
|
575
|
-
url: `http://localhost:${port}`
|
|
614
|
+
url: plan.launch.hostUrl ?? `http://localhost:${plan.resolvedPorts.host ?? port}`
|
|
576
615
|
};
|
|
577
616
|
}),
|
|
578
617
|
build: builder.build.handler(async ({ input }) => {
|
|
@@ -779,6 +818,11 @@ var plugin_default = createPlugin({
|
|
|
779
818
|
const contract = getRegistryNamespaceForAccount(account);
|
|
780
819
|
try {
|
|
781
820
|
await Effect.runPromise(ensureNearCli);
|
|
821
|
+
const oldKeys = await listPublishKeys({
|
|
822
|
+
account,
|
|
823
|
+
contract,
|
|
824
|
+
network
|
|
825
|
+
});
|
|
782
826
|
const keyPair = await addFunctionCallAccessKey({
|
|
783
827
|
account,
|
|
784
828
|
contract,
|
|
@@ -786,6 +830,24 @@ var plugin_default = createPlugin({
|
|
|
786
830
|
functionNames: PUBLISH_FUNCTION_NAMES,
|
|
787
831
|
network
|
|
788
832
|
});
|
|
833
|
+
if (oldKeys.length > 0) {
|
|
834
|
+
console.log();
|
|
835
|
+
console.log(` Found ${oldKeys.length} existing publish key${oldKeys.length > 1 ? "s" : ""}:`);
|
|
836
|
+
for (const k of oldKeys) console.log(` ${colors.dim(k)}`);
|
|
837
|
+
const rl = createInterface({
|
|
838
|
+
input: process.stdin,
|
|
839
|
+
output: process.stdout
|
|
840
|
+
});
|
|
841
|
+
const answer = await rl.question(" Remove old key(s)? [Y/n] ");
|
|
842
|
+
rl.close();
|
|
843
|
+
if (answer.toLowerCase() !== "n" && answer.toLowerCase() !== "no") try {
|
|
844
|
+
await deleteAccessKeys(account, oldKeys, network);
|
|
845
|
+
console.log(` ${colors.green("✓")} Removed ${oldKeys.length} old key${oldKeys.length > 1 ? "s" : ""}`);
|
|
846
|
+
} catch {
|
|
847
|
+
console.log(` ${colors.yellow("⚠")} Failed to remove old key${oldKeys.length > 1 ? "s" : ""} (new key still active)`);
|
|
848
|
+
}
|
|
849
|
+
else console.log(` ${colors.dim("Old key(s) retained.")}`);
|
|
850
|
+
}
|
|
789
851
|
return {
|
|
790
852
|
status: "published",
|
|
791
853
|
account,
|
|
@@ -907,9 +969,11 @@ var plugin_default = createPlugin({
|
|
|
907
969
|
}));
|
|
908
970
|
} else {
|
|
909
971
|
const patterns = buildInitPatterns(overrides, plugins, pluginDirMap);
|
|
972
|
+
const routeExclusions = overrides.includes("ui") ? buildPluginRouteExclusions(parentConfig, plugins) : [];
|
|
910
973
|
filesCopied = await timePhase(timings, "copy files", () => copyFilteredFiles(sourceDir, targetDir, patterns, {
|
|
911
974
|
overrides,
|
|
912
|
-
plugins
|
|
975
|
+
plugins,
|
|
976
|
+
ignore: routeExclusions
|
|
913
977
|
}));
|
|
914
978
|
await timePhase(timings, "personalize config", () => personalizeConfig(targetDir, {
|
|
915
979
|
extendsAccount,
|
|
@@ -927,7 +991,8 @@ var plugin_default = createPlugin({
|
|
|
927
991
|
}));
|
|
928
992
|
await timePhase(timings, "write snapshot", () => writeInitSnapshot(targetDir, extendsAccount, extendsGateway, sourceDir, patterns, {
|
|
929
993
|
overrides,
|
|
930
|
-
plugins
|
|
994
|
+
plugins,
|
|
995
|
+
ignore: routeExclusions
|
|
931
996
|
}));
|
|
932
997
|
await timePhase(timings, "personalize agents", () => personalizeAgentsMd(targetDir, {
|
|
933
998
|
overrides,
|
|
@@ -1170,7 +1235,6 @@ var plugin_default = createPlugin({
|
|
|
1170
1235
|
appliedHashCount: 0,
|
|
1171
1236
|
expectedTables: [],
|
|
1172
1237
|
missingTables: [],
|
|
1173
|
-
legacyCount: 0,
|
|
1174
1238
|
error: "No bos.config.json"
|
|
1175
1239
|
};
|
|
1176
1240
|
const projectDir = resolve(dirname(configPath));
|
|
@@ -1187,7 +1251,6 @@ var plugin_default = createPlugin({
|
|
|
1187
1251
|
appliedHashCount: 0,
|
|
1188
1252
|
expectedTables: [],
|
|
1189
1253
|
missingTables: [],
|
|
1190
|
-
legacyCount: 0,
|
|
1191
1254
|
error: "Failed to load config"
|
|
1192
1255
|
};
|
|
1193
1256
|
const { resolvePluginDbInfo } = await import("./cli/db-studio.mjs");
|
|
@@ -1209,7 +1272,6 @@ var plugin_default = createPlugin({
|
|
|
1209
1272
|
appliedHashCount: 0,
|
|
1210
1273
|
expectedTables: [],
|
|
1211
1274
|
missingTables: [],
|
|
1212
|
-
legacyCount: 0,
|
|
1213
1275
|
error: error instanceof Error ? error.message : "Unknown error"
|
|
1214
1276
|
};
|
|
1215
1277
|
}
|
|
@@ -1267,6 +1329,61 @@ var plugin_default = createPlugin({
|
|
|
1267
1329
|
error: error instanceof Error ? error.message : "Unknown error"
|
|
1268
1330
|
};
|
|
1269
1331
|
}
|
|
1332
|
+
}),
|
|
1333
|
+
ps: builder.ps.handler(async () => {
|
|
1334
|
+
try {
|
|
1335
|
+
return {
|
|
1336
|
+
status: "ok",
|
|
1337
|
+
entries: await Effect.runPromise(pruneDeadEffect(readRegistry()))
|
|
1338
|
+
};
|
|
1339
|
+
} catch (error) {
|
|
1340
|
+
return {
|
|
1341
|
+
status: "error",
|
|
1342
|
+
entries: [],
|
|
1343
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1346
|
+
}),
|
|
1347
|
+
kill: builder.kill.handler(async ({ input }) => {
|
|
1348
|
+
try {
|
|
1349
|
+
const entries = await Effect.runPromise(pruneDeadEffect(readRegistry()));
|
|
1350
|
+
const configPath = findConfigPath();
|
|
1351
|
+
const targetConfigDir = input.all ? void 0 : input.configDir ?? (configPath ? resolve(dirname(configPath)) : void 0);
|
|
1352
|
+
const targets = targetConfigDir ? entries.filter((entry) => entry.configDir === targetConfigDir) : entries;
|
|
1353
|
+
const killed = [];
|
|
1354
|
+
const skipped = [];
|
|
1355
|
+
for (const entry of targets) try {
|
|
1356
|
+
process.kill(entry.pid, input.signal === "SIGKILL" ? "SIGKILL" : "SIGTERM");
|
|
1357
|
+
killed.push({
|
|
1358
|
+
pid: entry.pid,
|
|
1359
|
+
configDir: entry.configDir
|
|
1360
|
+
});
|
|
1361
|
+
unregisterPid(entry.pid);
|
|
1362
|
+
} catch (err) {
|
|
1363
|
+
if (err.code === "ESRCH") {
|
|
1364
|
+
skipped.push({
|
|
1365
|
+
pid: entry.pid,
|
|
1366
|
+
reason: "process already exited"
|
|
1367
|
+
});
|
|
1368
|
+
unregisterPid(entry.pid);
|
|
1369
|
+
} else skipped.push({
|
|
1370
|
+
pid: entry.pid,
|
|
1371
|
+
reason: err.message ?? "kill failed"
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
return {
|
|
1375
|
+
status: "killed",
|
|
1376
|
+
killed,
|
|
1377
|
+
skipped
|
|
1378
|
+
};
|
|
1379
|
+
} catch (error) {
|
|
1380
|
+
return {
|
|
1381
|
+
status: "error",
|
|
1382
|
+
killed: [],
|
|
1383
|
+
skipped: [],
|
|
1384
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1270
1387
|
})
|
|
1271
1388
|
})
|
|
1272
1389
|
});
|