@agimon-ai/doompi 0.0.1-alpha.76 → 0.0.1-alpha.78
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/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/antigravity.cjs +5 -0
- package/dist/antigravity.d.cts +2 -0
- package/dist/antigravity.d.mts +2 -0
- package/dist/antigravity.mjs +2 -0
- package/dist/api-contracts.cjs +11 -0
- package/dist/api-contracts.cjs.map +1 -0
- package/dist/api-contracts.d.cts +52 -0
- package/dist/api-contracts.d.cts.map +1 -0
- package/dist/api-contracts.d.mts +52 -0
- package/dist/api-contracts.d.mts.map +1 -0
- package/dist/api-contracts.mjs +7 -0
- package/dist/api-contracts.mjs.map +1 -0
- package/dist/base-command.cjs +3 -0
- package/dist/base-command.d.cts +2 -0
- package/dist/base-command.d.mts +2 -0
- package/dist/base-command.mjs +2 -0
- package/dist/bin/cli.cjs +29 -0
- package/dist/bin/cli.cjs.map +1 -0
- package/dist/bin/cli.d.cts +1 -0
- package/dist/bin/cli.d.mts +1 -0
- package/dist/bin/cli.mjs +30 -0
- package/dist/bin/cli.mjs.map +1 -0
- package/dist/bin/doomRunner.cjs +39 -0
- package/dist/bin/doomRunner.cjs.map +1 -0
- package/dist/bin/doomRunner.d.cts +12 -0
- package/dist/bin/doomRunner.d.cts.map +1 -0
- package/dist/bin/doomRunner.d.mts +12 -0
- package/dist/bin/doomRunner.d.mts.map +1 -0
- package/dist/bin/doomRunner.mjs +38 -0
- package/dist/bin/doomRunner.mjs.map +1 -0
- package/dist/bin/dpi.cjs +12 -0
- package/dist/bin/dpi.cjs.map +1 -0
- package/dist/bin/dpi.d.cts +1 -0
- package/dist/bin/dpi.d.mts +1 -0
- package/dist/bin/dpi.mjs +14 -0
- package/dist/bin/dpi.mjs.map +1 -0
- package/dist/bin/serve.cjs +11 -0
- package/dist/bin/serve.cjs.map +1 -0
- package/dist/bin/serve.d.cts +1 -0
- package/dist/bin/serve.d.mts +1 -0
- package/dist/bin/serve.mjs +13 -0
- package/dist/bin/serve.mjs.map +1 -0
- package/dist/builders/apiContractExport/index.cjs +81 -0
- package/dist/builders/apiContractExport/index.cjs.map +1 -0
- package/dist/builders/apiContractExport/index.mjs +77 -0
- package/dist/builders/apiContractExport/index.mjs.map +1 -0
- package/dist/builders/apiContracts/index.cjs +87 -0
- package/dist/builders/apiContracts/index.cjs.map +1 -0
- package/dist/builders/apiContracts/index.mjs +82 -0
- package/dist/builders/apiContracts/index.mjs.map +1 -0
- package/dist/builders/cli/bootstrapClaim.cjs +53 -0
- package/dist/builders/cli/bootstrapClaim.cjs.map +1 -0
- package/dist/builders/cli/bootstrapClaim.mjs +51 -0
- package/dist/builders/cli/bootstrapClaim.mjs.map +1 -0
- package/dist/builders/cli/bootstrapLocator/index.cjs +204 -0
- package/dist/builders/cli/bootstrapLocator/index.cjs.map +1 -0
- package/dist/builders/cli/bootstrapLocator/index.d.cts +5 -0
- package/dist/builders/cli/bootstrapLocator/index.d.cts.map +1 -0
- package/dist/builders/cli/bootstrapLocator/index.d.mts +5 -0
- package/dist/builders/cli/bootstrapLocator/index.d.mts.map +1 -0
- package/dist/builders/cli/bootstrapLocator/index.mjs +196 -0
- package/dist/builders/cli/bootstrapLocator/index.mjs.map +1 -0
- package/dist/builders/cli/composition.cjs +378 -0
- package/dist/builders/cli/composition.cjs.map +1 -0
- package/dist/builders/cli/composition.d.cts +119 -0
- package/dist/builders/cli/composition.d.cts.map +1 -0
- package/dist/builders/cli/composition.d.mts +119 -0
- package/dist/builders/cli/composition.d.mts.map +1 -0
- package/dist/builders/cli/composition.mjs +351 -0
- package/dist/builders/cli/composition.mjs.map +1 -0
- package/dist/builders/cli/compositionState.cjs +33 -0
- package/dist/builders/cli/compositionState.cjs.map +1 -0
- package/dist/builders/cli/compositionState.d.cts +9 -0
- package/dist/builders/cli/compositionState.d.cts.map +1 -0
- package/dist/builders/cli/compositionState.d.mts +9 -0
- package/dist/builders/cli/compositionState.d.mts.map +1 -0
- package/dist/builders/cli/compositionState.mjs +30 -0
- package/dist/builders/cli/compositionState.mjs.map +1 -0
- package/dist/builders/cli/constants.cjs +20 -0
- package/dist/builders/cli/constants.cjs.map +1 -0
- package/dist/builders/cli/constants.d.cts +17 -0
- package/dist/builders/cli/constants.d.cts.map +1 -0
- package/dist/builders/cli/constants.d.mts +17 -0
- package/dist/builders/cli/constants.d.mts.map +1 -0
- package/dist/builders/cli/constants.mjs +19 -0
- package/dist/builders/cli/constants.mjs.map +1 -0
- package/dist/builders/cli/contextCatalog.cjs +130 -0
- package/dist/builders/cli/contextCatalog.cjs.map +1 -0
- package/dist/builders/cli/contextCatalog.mjs +130 -0
- package/dist/builders/cli/contextCatalog.mjs.map +1 -0
- package/dist/builders/cli/dpiSettings.cjs +118 -0
- package/dist/builders/cli/dpiSettings.cjs.map +1 -0
- package/dist/builders/cli/dpiSettings.mjs +111 -0
- package/dist/builders/cli/dpiSettings.mjs.map +1 -0
- package/dist/builders/cli/entryResolution.cjs +23 -0
- package/dist/builders/cli/entryResolution.cjs.map +1 -0
- package/dist/builders/cli/entryResolution.d.cts +5 -0
- package/dist/builders/cli/entryResolution.d.cts.map +1 -0
- package/dist/builders/cli/entryResolution.d.mts +5 -0
- package/dist/builders/cli/entryResolution.d.mts.map +1 -0
- package/dist/builders/cli/entryResolution.mjs +20 -0
- package/dist/builders/cli/entryResolution.mjs.map +1 -0
- package/dist/builders/cli/extensionAssembler/index.cjs +386 -0
- package/dist/builders/cli/extensionAssembler/index.cjs.map +1 -0
- package/dist/builders/cli/extensionAssembler/index.d.cts +113 -0
- package/dist/builders/cli/extensionAssembler/index.d.cts.map +1 -0
- package/dist/builders/cli/extensionAssembler/index.d.mts +113 -0
- package/dist/builders/cli/extensionAssembler/index.d.mts.map +1 -0
- package/dist/builders/cli/extensionAssembler/index.mjs +376 -0
- package/dist/builders/cli/extensionAssembler/index.mjs.map +1 -0
- package/dist/builders/cli/harnessContext.cjs +186 -0
- package/dist/builders/cli/harnessContext.cjs.map +1 -0
- package/dist/builders/cli/harnessContext.d.cts +51 -0
- package/dist/builders/cli/harnessContext.d.cts.map +1 -0
- package/dist/builders/cli/harnessContext.d.mts +51 -0
- package/dist/builders/cli/harnessContext.d.mts.map +1 -0
- package/dist/builders/cli/harnessContext.mjs +179 -0
- package/dist/builders/cli/harnessContext.mjs.map +1 -0
- package/dist/builders/cli/index.cjs +151 -0
- package/dist/builders/cli/index.cjs.map +1 -0
- package/dist/builders/cli/index.d.cts +22 -0
- package/dist/builders/cli/index.d.cts.map +1 -0
- package/dist/builders/cli/index.d.mts +22 -0
- package/dist/builders/cli/index.d.mts.map +1 -0
- package/dist/builders/cli/index.mjs +147 -0
- package/dist/builders/cli/index.mjs.map +1 -0
- package/dist/builders/cli/launchPlan/index.cjs +102 -0
- package/dist/builders/cli/launchPlan/index.cjs.map +1 -0
- package/dist/builders/cli/launchPlan/index.d.cts +43 -0
- package/dist/builders/cli/launchPlan/index.d.cts.map +1 -0
- package/dist/builders/cli/launchPlan/index.d.mts +43 -0
- package/dist/builders/cli/launchPlan/index.d.mts.map +1 -0
- package/dist/builders/cli/launchPlan/index.mjs +100 -0
- package/dist/builders/cli/launchPlan/index.mjs.map +1 -0
- package/dist/builders/cli/launcherComposition/index.cjs +84 -0
- package/dist/builders/cli/launcherComposition/index.cjs.map +1 -0
- package/dist/builders/cli/launcherComposition/index.mjs +80 -0
- package/dist/builders/cli/launcherComposition/index.mjs.map +1 -0
- package/dist/builders/cli/piExtensionAlias/index.cjs +40 -0
- package/dist/builders/cli/piExtensionAlias/index.cjs.map +1 -0
- package/dist/builders/cli/piExtensionAlias/index.mjs +35 -0
- package/dist/builders/cli/piExtensionAlias/index.mjs.map +1 -0
- package/dist/builders/cli/piExtensionDispatcher/index.cjs +205 -0
- package/dist/builders/cli/piExtensionDispatcher/index.cjs.map +1 -0
- package/dist/builders/cli/piExtensionDispatcher/index.mjs +198 -0
- package/dist/builders/cli/piExtensionDispatcher/index.mjs.map +1 -0
- package/dist/builders/cli/prepare.cjs +64 -0
- package/dist/builders/cli/prepare.cjs.map +1 -0
- package/dist/builders/cli/prepare.mjs +62 -0
- package/dist/builders/cli/prepare.mjs.map +1 -0
- package/dist/builders/cli/projectSettings.cjs +155 -0
- package/dist/builders/cli/projectSettings.cjs.map +1 -0
- package/dist/builders/cli/projectSettings.d.cts +27 -0
- package/dist/builders/cli/projectSettings.d.cts.map +1 -0
- package/dist/builders/cli/projectSettings.d.mts +27 -0
- package/dist/builders/cli/projectSettings.d.mts.map +1 -0
- package/dist/builders/cli/projectSettings.mjs +144 -0
- package/dist/builders/cli/projectSettings.mjs.map +1 -0
- package/dist/builders/cli/runtimeBundle/index.cjs +130 -0
- package/dist/builders/cli/runtimeBundle/index.cjs.map +1 -0
- package/dist/builders/cli/runtimeBundle/index.d.cts +21 -0
- package/dist/builders/cli/runtimeBundle/index.d.cts.map +1 -0
- package/dist/builders/cli/runtimeBundle/index.d.mts +21 -0
- package/dist/builders/cli/runtimeBundle/index.d.mts.map +1 -0
- package/dist/builders/cli/runtimeBundle/index.mjs +126 -0
- package/dist/builders/cli/runtimeBundle/index.mjs.map +1 -0
- package/dist/builders/server/index.cjs +184 -0
- package/dist/builders/server/index.cjs.map +1 -0
- package/dist/builders/server/index.mjs +181 -0
- package/dist/builders/server/index.mjs.map +1 -0
- package/dist/builders/server/runtime.cjs +603 -0
- package/dist/builders/server/runtime.cjs.map +1 -0
- package/dist/builders/server/runtime.mjs +595 -0
- package/dist/builders/server/runtime.mjs.map +1 -0
- package/dist/builders/server/selectionStatus.cjs +12 -0
- package/dist/builders/server/selectionStatus.cjs.map +1 -0
- package/dist/builders/server/selectionStatus.mjs +12 -0
- package/dist/builders/server/selectionStatus.mjs.map +1 -0
- package/dist/builders/server/sessionArguments.cjs +22 -0
- package/dist/builders/server/sessionArguments.cjs.map +1 -0
- package/dist/builders/server/sessionArguments.mjs +22 -0
- package/dist/builders/server/sessionArguments.mjs.map +1 -0
- package/dist/builders/web/bundle.cjs +110 -0
- package/dist/builders/web/bundle.cjs.map +1 -0
- package/dist/builders/web/bundle.d.cts +29 -0
- package/dist/builders/web/bundle.d.cts.map +1 -0
- package/dist/builders/web/bundle.d.mts +29 -0
- package/dist/builders/web/bundle.d.mts.map +1 -0
- package/dist/builders/web/bundle.mjs +107 -0
- package/dist/builders/web/bundle.mjs.map +1 -0
- package/dist/builders/web/bundleAssetPolicy.cjs +96 -0
- package/dist/builders/web/bundleAssetPolicy.cjs.map +1 -0
- package/dist/builders/web/bundleAssetPolicy.d.cts +22 -0
- package/dist/builders/web/bundleAssetPolicy.d.cts.map +1 -0
- package/dist/builders/web/bundleAssetPolicy.d.mts +22 -0
- package/dist/builders/web/bundleAssetPolicy.d.mts.map +1 -0
- package/dist/builders/web/bundleAssetPolicy.mjs +95 -0
- package/dist/builders/web/bundleAssetPolicy.mjs.map +1 -0
- package/dist/builders/web/index.cjs +75 -0
- package/dist/builders/web/index.cjs.map +1 -0
- package/dist/builders/web/index.d.cts +29 -0
- package/dist/builders/web/index.d.cts.map +1 -0
- package/dist/builders/web/index.d.mts +29 -0
- package/dist/builders/web/index.d.mts.map +1 -0
- package/dist/builders/web/index.mjs +72 -0
- package/dist/builders/web/index.mjs.map +1 -0
- package/dist/builders/web/webDevRoots.cjs +27 -0
- package/dist/builders/web/webDevRoots.cjs.map +1 -0
- package/dist/builders/web/webDevRoots.d.cts +22 -0
- package/dist/builders/web/webDevRoots.d.cts.map +1 -0
- package/dist/builders/web/webDevRoots.d.mts +22 -0
- package/dist/builders/web/webDevRoots.d.mts.map +1 -0
- package/dist/builders/web/webDevRoots.mjs +25 -0
- package/dist/builders/web/webDevRoots.mjs.map +1 -0
- package/dist/builders/web/webPluginGenerate.cjs +113 -0
- package/dist/builders/web/webPluginGenerate.cjs.map +1 -0
- package/dist/builders/web/webPluginGenerate.d.cts +28 -0
- package/dist/builders/web/webPluginGenerate.d.cts.map +1 -0
- package/dist/builders/web/webPluginGenerate.d.mts +28 -0
- package/dist/builders/web/webPluginGenerate.d.mts.map +1 -0
- package/dist/builders/web/webPluginGenerate.mjs +106 -0
- package/dist/builders/web/webPluginGenerate.mjs.map +1 -0
- package/dist/builders/web/webPluginManifest.cjs +92 -0
- package/dist/builders/web/webPluginManifest.cjs.map +1 -0
- package/dist/builders/web/webPluginManifest.d.cts +44 -0
- package/dist/builders/web/webPluginManifest.d.cts.map +1 -0
- package/dist/builders/web/webPluginManifest.d.mts +44 -0
- package/dist/builders/web/webPluginManifest.d.mts.map +1 -0
- package/dist/builders/web/webPluginManifest.mjs +88 -0
- package/dist/builders/web/webPluginManifest.mjs.map +1 -0
- package/dist/builders/web/webPluginScan.cjs +53 -0
- package/dist/builders/web/webPluginScan.cjs.map +1 -0
- package/dist/builders/web/webPluginScan.d.cts +16 -0
- package/dist/builders/web/webPluginScan.d.cts.map +1 -0
- package/dist/builders/web/webPluginScan.d.mts +16 -0
- package/dist/builders/web/webPluginScan.d.mts.map +1 -0
- package/dist/builders/web/webPluginScan.mjs +50 -0
- package/dist/builders/web/webPluginScan.mjs.map +1 -0
- package/dist/builders/web/webPluginVite.cjs +124 -0
- package/dist/builders/web/webPluginVite.cjs.map +1 -0
- package/dist/builders/web/webPluginVite.d.cts +36 -0
- package/dist/builders/web/webPluginVite.d.cts.map +1 -0
- package/dist/builders/web/webPluginVite.d.mts +36 -0
- package/dist/builders/web/webPluginVite.d.mts.map +1 -0
- package/dist/builders/web/webPluginVite.mjs +116 -0
- package/dist/builders/web/webPluginVite.mjs.map +1 -0
- package/dist/builders/web.cjs +33 -0
- package/dist/builders/web.d.cts +9 -0
- package/dist/builders/web.d.mts +9 -0
- package/dist/builders/web.mjs +9 -0
- package/dist/cli/cliApp.cjs +177 -0
- package/dist/cli/cliApp.cjs.map +1 -0
- package/dist/cli/cliApp.d.cts +25 -0
- package/dist/cli/cliApp.d.cts.map +1 -0
- package/dist/cli/cliApp.d.mts +25 -0
- package/dist/cli/cliApp.d.mts.map +1 -0
- package/dist/cli/cliApp.mjs +175 -0
- package/dist/cli/cliApp.mjs.map +1 -0
- package/dist/cli/commands/api-export/index.cjs +65 -0
- package/dist/cli/commands/api-export/index.cjs.map +1 -0
- package/dist/cli/commands/api-export/index.mjs +61 -0
- package/dist/cli/commands/api-export/index.mjs.map +1 -0
- package/dist/cli/commands/baseCommand.cjs +16 -0
- package/dist/cli/commands/baseCommand.cjs.map +1 -0
- package/dist/cli/commands/baseCommand.d.cts +24 -0
- package/dist/cli/commands/baseCommand.d.cts.map +1 -0
- package/dist/cli/commands/baseCommand.d.mts +24 -0
- package/dist/cli/commands/baseCommand.d.mts.map +1 -0
- package/dist/cli/commands/baseCommand.mjs +16 -0
- package/dist/cli/commands/baseCommand.mjs.map +1 -0
- package/dist/cli/commands/compat/context.cjs +115 -0
- package/dist/cli/commands/compat/context.cjs.map +1 -0
- package/dist/cli/commands/compat/context.d.cts +22 -0
- package/dist/cli/commands/compat/context.d.cts.map +1 -0
- package/dist/cli/commands/compat/context.d.mts +22 -0
- package/dist/cli/commands/compat/context.d.mts.map +1 -0
- package/dist/cli/commands/compat/context.mjs +110 -0
- package/dist/cli/commands/compat/context.mjs.map +1 -0
- package/dist/cli/commands/compat/help.cjs +26 -0
- package/dist/cli/commands/compat/help.cjs.map +1 -0
- package/dist/cli/commands/compat/help.d.cts +4 -0
- package/dist/cli/commands/compat/help.d.cts.map +1 -0
- package/dist/cli/commands/compat/help.d.mts +4 -0
- package/dist/cli/commands/compat/help.d.mts.map +1 -0
- package/dist/cli/commands/compat/help.mjs +25 -0
- package/dist/cli/commands/compat/help.mjs.map +1 -0
- package/dist/cli/commands/compat/index.cjs +73 -0
- package/dist/cli/commands/compat/index.cjs.map +1 -0
- package/dist/cli/commands/compat/index.d.cts +14 -0
- package/dist/cli/commands/compat/index.d.cts.map +1 -0
- package/dist/cli/commands/compat/index.d.mts +14 -0
- package/dist/cli/commands/compat/index.d.mts.map +1 -0
- package/dist/cli/commands/compat/index.mjs +70 -0
- package/dist/cli/commands/compat/index.mjs.map +1 -0
- package/dist/cli/commands/compat/options.cjs +88 -0
- package/dist/cli/commands/compat/options.cjs.map +1 -0
- package/dist/cli/commands/compat/options.d.cts +15 -0
- package/dist/cli/commands/compat/options.d.cts.map +1 -0
- package/dist/cli/commands/compat/options.d.mts +15 -0
- package/dist/cli/commands/compat/options.d.mts.map +1 -0
- package/dist/cli/commands/compat/options.mjs +86 -0
- package/dist/cli/commands/compat/options.mjs.map +1 -0
- package/dist/cli/commands/compat/providers/antigravity.cjs +294 -0
- package/dist/cli/commands/compat/providers/antigravity.cjs.map +1 -0
- package/dist/cli/commands/compat/providers/antigravity.d.cts +9 -0
- package/dist/cli/commands/compat/providers/antigravity.d.cts.map +1 -0
- package/dist/cli/commands/compat/providers/antigravity.d.mts +9 -0
- package/dist/cli/commands/compat/providers/antigravity.d.mts.map +1 -0
- package/dist/cli/commands/compat/providers/antigravity.mjs +289 -0
- package/dist/cli/commands/compat/providers/antigravity.mjs.map +1 -0
- package/dist/cli/commands/compat/providers/codex.cjs +178 -0
- package/dist/cli/commands/compat/providers/codex.cjs.map +1 -0
- package/dist/cli/commands/compat/providers/codex.d.cts +17 -0
- package/dist/cli/commands/compat/providers/codex.d.cts.map +1 -0
- package/dist/cli/commands/compat/providers/codex.d.mts +17 -0
- package/dist/cli/commands/compat/providers/codex.d.mts.map +1 -0
- package/dist/cli/commands/compat/providers/codex.mjs +170 -0
- package/dist/cli/commands/compat/providers/codex.mjs.map +1 -0
- package/dist/cli/commands/compat/providers/index.cjs +65 -0
- package/dist/cli/commands/compat/providers/index.cjs.map +1 -0
- package/dist/cli/commands/compat/providers/index.d.cts +15 -0
- package/dist/cli/commands/compat/providers/index.d.cts.map +1 -0
- package/dist/cli/commands/compat/providers/index.d.mts +15 -0
- package/dist/cli/commands/compat/providers/index.d.mts.map +1 -0
- package/dist/cli/commands/compat/providers/index.mjs +45 -0
- package/dist/cli/commands/compat/providers/index.mjs.map +1 -0
- package/dist/cli/commands/compat/providers/process.cjs +172 -0
- package/dist/cli/commands/compat/providers/process.cjs.map +1 -0
- package/dist/cli/commands/compat/providers/process.d.cts +33 -0
- package/dist/cli/commands/compat/providers/process.d.cts.map +1 -0
- package/dist/cli/commands/compat/providers/process.d.mts +33 -0
- package/dist/cli/commands/compat/providers/process.d.mts.map +1 -0
- package/dist/cli/commands/compat/providers/process.mjs +159 -0
- package/dist/cli/commands/compat/providers/process.mjs.map +1 -0
- package/dist/cli/commands/compat/providers/shared.cjs +76 -0
- package/dist/cli/commands/compat/providers/shared.cjs.map +1 -0
- package/dist/cli/commands/compat/providers/shared.d.cts +40 -0
- package/dist/cli/commands/compat/providers/shared.d.cts.map +1 -0
- package/dist/cli/commands/compat/providers/shared.d.mts +40 -0
- package/dist/cli/commands/compat/providers/shared.d.mts.map +1 -0
- package/dist/cli/commands/compat/providers/shared.mjs +61 -0
- package/dist/cli/commands/compat/providers/shared.mjs.map +1 -0
- package/dist/cli/commands/compat/types.d.cts +31 -0
- package/dist/cli/commands/compat/types.d.cts.map +1 -0
- package/dist/cli/commands/compat/types.d.mts +31 -0
- package/dist/cli/commands/compat/types.d.mts.map +1 -0
- package/dist/cli/commands/doctor/help.cjs +19 -0
- package/dist/cli/commands/doctor/help.cjs.map +1 -0
- package/dist/cli/commands/doctor/help.d.cts +4 -0
- package/dist/cli/commands/doctor/help.d.cts.map +1 -0
- package/dist/cli/commands/doctor/help.d.mts +4 -0
- package/dist/cli/commands/doctor/help.d.mts.map +1 -0
- package/dist/cli/commands/doctor/help.mjs +19 -0
- package/dist/cli/commands/doctor/help.mjs.map +1 -0
- package/dist/cli/commands/doctor/index.cjs +116 -0
- package/dist/cli/commands/doctor/index.cjs.map +1 -0
- package/dist/cli/commands/doctor/index.d.cts +12 -0
- package/dist/cli/commands/doctor/index.d.cts.map +1 -0
- package/dist/cli/commands/doctor/index.d.mts +12 -0
- package/dist/cli/commands/doctor/index.d.mts.map +1 -0
- package/dist/cli/commands/doctor/index.mjs +112 -0
- package/dist/cli/commands/doctor/index.mjs.map +1 -0
- package/dist/cli/commands/emit-mcp/index.cjs +32 -0
- package/dist/cli/commands/emit-mcp/index.cjs.map +1 -0
- package/dist/cli/commands/emit-mcp/index.d.cts +19 -0
- package/dist/cli/commands/emit-mcp/index.d.cts.map +1 -0
- package/dist/cli/commands/emit-mcp/index.d.mts +19 -0
- package/dist/cli/commands/emit-mcp/index.d.mts.map +1 -0
- package/dist/cli/commands/emit-mcp/index.mjs +31 -0
- package/dist/cli/commands/emit-mcp/index.mjs.map +1 -0
- package/dist/cli/commands/explain/index.cjs +155 -0
- package/dist/cli/commands/explain/index.cjs.map +1 -0
- package/dist/cli/commands/explain/index.d.cts +57 -0
- package/dist/cli/commands/explain/index.d.cts.map +1 -0
- package/dist/cli/commands/explain/index.d.mts +57 -0
- package/dist/cli/commands/explain/index.d.mts.map +1 -0
- package/dist/cli/commands/explain/index.mjs +150 -0
- package/dist/cli/commands/explain/index.mjs.map +1 -0
- package/dist/cli/commands/history-export/help.cjs +18 -0
- package/dist/cli/commands/history-export/help.cjs.map +1 -0
- package/dist/cli/commands/history-export/help.d.cts +4 -0
- package/dist/cli/commands/history-export/help.d.cts.map +1 -0
- package/dist/cli/commands/history-export/help.d.mts +4 -0
- package/dist/cli/commands/history-export/help.d.mts.map +1 -0
- package/dist/cli/commands/history-export/help.mjs +18 -0
- package/dist/cli/commands/history-export/help.mjs.map +1 -0
- package/dist/cli/commands/history-export/index.cjs +76 -0
- package/dist/cli/commands/history-export/index.cjs.map +1 -0
- package/dist/cli/commands/history-export/index.mjs +74 -0
- package/dist/cli/commands/history-export/index.mjs.map +1 -0
- package/dist/cli/commands/history-import/help.cjs +20 -0
- package/dist/cli/commands/history-import/help.cjs.map +1 -0
- package/dist/cli/commands/history-import/help.d.cts +4 -0
- package/dist/cli/commands/history-import/help.d.cts.map +1 -0
- package/dist/cli/commands/history-import/help.d.mts +4 -0
- package/dist/cli/commands/history-import/help.d.mts.map +1 -0
- package/dist/cli/commands/history-import/help.mjs +20 -0
- package/dist/cli/commands/history-import/help.mjs.map +1 -0
- package/dist/cli/commands/history-import/index.cjs +78 -0
- package/dist/cli/commands/history-import/index.cjs.map +1 -0
- package/dist/cli/commands/history-import/index.mjs +75 -0
- package/dist/cli/commands/history-import/index.mjs.map +1 -0
- package/dist/cli/commands/init/constants.cjs +11 -0
- package/dist/cli/commands/init/constants.cjs.map +1 -0
- package/dist/cli/commands/init/constants.mjs +11 -0
- package/dist/cli/commands/init/constants.mjs.map +1 -0
- package/dist/cli/commands/init/help.cjs +17 -0
- package/dist/cli/commands/init/help.cjs.map +1 -0
- package/dist/cli/commands/init/help.d.cts +4 -0
- package/dist/cli/commands/init/help.d.cts.map +1 -0
- package/dist/cli/commands/init/help.d.mts +4 -0
- package/dist/cli/commands/init/help.d.mts.map +1 -0
- package/dist/cli/commands/init/help.mjs +17 -0
- package/dist/cli/commands/init/help.mjs.map +1 -0
- package/dist/cli/commands/init/index.cjs +87 -0
- package/dist/cli/commands/init/index.cjs.map +1 -0
- package/dist/cli/commands/init/index.d.cts +12 -0
- package/dist/cli/commands/init/index.d.cts.map +1 -0
- package/dist/cli/commands/init/index.d.mts +12 -0
- package/dist/cli/commands/init/index.d.mts.map +1 -0
- package/dist/cli/commands/init/index.mjs +83 -0
- package/dist/cli/commands/init/index.mjs.map +1 -0
- package/dist/cli/commands/init/presenter.cjs +170 -0
- package/dist/cli/commands/init/presenter.cjs.map +1 -0
- package/dist/cli/commands/init/presenter.d.cts +8 -0
- package/dist/cli/commands/init/presenter.d.cts.map +1 -0
- package/dist/cli/commands/init/presenter.d.mts +8 -0
- package/dist/cli/commands/init/presenter.d.mts.map +1 -0
- package/dist/cli/commands/init/presenter.mjs +170 -0
- package/dist/cli/commands/init/presenter.mjs.map +1 -0
- package/dist/cli/commands/launch/index.cjs +128 -0
- package/dist/cli/commands/launch/index.cjs.map +1 -0
- package/dist/cli/commands/launch/index.d.cts +29 -0
- package/dist/cli/commands/launch/index.d.cts.map +1 -0
- package/dist/cli/commands/launch/index.d.mts +29 -0
- package/dist/cli/commands/launch/index.d.mts.map +1 -0
- package/dist/cli/commands/launch/index.mjs +122 -0
- package/dist/cli/commands/launch/index.mjs.map +1 -0
- package/dist/cli/commands/sandbox/args.cjs +50 -0
- package/dist/cli/commands/sandbox/args.cjs.map +1 -0
- package/dist/cli/commands/sandbox/args.mjs +50 -0
- package/dist/cli/commands/sandbox/args.mjs.map +1 -0
- package/dist/cli/commands/sandbox/harness.cjs +61 -0
- package/dist/cli/commands/sandbox/harness.cjs.map +1 -0
- package/dist/cli/commands/sandbox/harness.mjs +60 -0
- package/dist/cli/commands/sandbox/harness.mjs.map +1 -0
- package/dist/cli/commands/sandbox/index.cjs +57 -0
- package/dist/cli/commands/sandbox/index.cjs.map +1 -0
- package/dist/cli/commands/sandbox/index.mjs +56 -0
- package/dist/cli/commands/sandbox/index.mjs.map +1 -0
- package/dist/cli/commands/sync/help.cjs +31 -0
- package/dist/cli/commands/sync/help.cjs.map +1 -0
- package/dist/cli/commands/sync/help.d.cts +4 -0
- package/dist/cli/commands/sync/help.d.cts.map +1 -0
- package/dist/cli/commands/sync/help.d.mts +4 -0
- package/dist/cli/commands/sync/help.d.mts.map +1 -0
- package/dist/cli/commands/sync/help.mjs +31 -0
- package/dist/cli/commands/sync/help.mjs.map +1 -0
- package/dist/cli/commands/sync/index.cjs +577 -0
- package/dist/cli/commands/sync/index.cjs.map +1 -0
- package/dist/cli/commands/sync/index.d.cts +65 -0
- package/dist/cli/commands/sync/index.d.cts.map +1 -0
- package/dist/cli/commands/sync/index.d.mts +65 -0
- package/dist/cli/commands/sync/index.d.mts.map +1 -0
- package/dist/cli/commands/sync/index.mjs +560 -0
- package/dist/cli/commands/sync/index.mjs.map +1 -0
- package/dist/cli/commands/sync/prepare.cjs +43 -0
- package/dist/cli/commands/sync/prepare.cjs.map +1 -0
- package/dist/cli/commands/sync/prepare.mjs +40 -0
- package/dist/cli/commands/sync/prepare.mjs.map +1 -0
- package/dist/cli/commands/sync/presenter.cjs +58 -0
- package/dist/cli/commands/sync/presenter.cjs.map +1 -0
- package/dist/cli/commands/sync/presenter.d.cts +16 -0
- package/dist/cli/commands/sync/presenter.d.cts.map +1 -0
- package/dist/cli/commands/sync/presenter.d.mts +16 -0
- package/dist/cli/commands/sync/presenter.d.mts.map +1 -0
- package/dist/cli/commands/sync/presenter.mjs +57 -0
- package/dist/cli/commands/sync/presenter.mjs.map +1 -0
- package/dist/cli/commands/sync/workflow.cjs +99 -0
- package/dist/cli/commands/sync/workflow.cjs.map +1 -0
- package/dist/cli/commands/sync/workflow.mjs +96 -0
- package/dist/cli/commands/sync/workflow.mjs.map +1 -0
- package/dist/cli/dpi.cjs +98 -0
- package/dist/cli/dpi.cjs.map +1 -0
- package/dist/cli/dpi.mjs +91 -0
- package/dist/cli/dpi.mjs.map +1 -0
- package/dist/cli/harnessOptions.cjs +60 -0
- package/dist/cli/harnessOptions.cjs.map +1 -0
- package/dist/cli/harnessOptions.d.cts +24 -0
- package/dist/cli/harnessOptions.d.cts.map +1 -0
- package/dist/cli/harnessOptions.d.mts +24 -0
- package/dist/cli/harnessOptions.d.mts.map +1 -0
- package/dist/cli/harnessOptions.mjs +57 -0
- package/dist/cli/harnessOptions.mjs.map +1 -0
- package/dist/cli/help.cjs +89 -0
- package/dist/cli/help.cjs.map +1 -0
- package/dist/cli/help.d.cts +12 -0
- package/dist/cli/help.d.cts.map +1 -0
- package/dist/cli/help.d.mts +12 -0
- package/dist/cli/help.d.mts.map +1 -0
- package/dist/cli/help.mjs +83 -0
- package/dist/cli/help.mjs.map +1 -0
- package/dist/cli/matrixOptions.cjs +178 -0
- package/dist/cli/matrixOptions.cjs.map +1 -0
- package/dist/cli/matrixOptions.d.cts +90 -0
- package/dist/cli/matrixOptions.d.cts.map +1 -0
- package/dist/cli/matrixOptions.d.mts +90 -0
- package/dist/cli/matrixOptions.d.mts.map +1 -0
- package/dist/cli/matrixOptions.mjs +151 -0
- package/dist/cli/matrixOptions.mjs.map +1 -0
- package/dist/cli/options.cjs +306 -0
- package/dist/cli/options.cjs.map +1 -0
- package/dist/cli/options.d.cts +5 -0
- package/dist/cli/options.d.cts.map +1 -0
- package/dist/cli/options.d.mts +5 -0
- package/dist/cli/options.d.mts.map +1 -0
- package/dist/cli/options.mjs +304 -0
- package/dist/cli/options.mjs.map +1 -0
- package/dist/cli/router.cjs +59 -0
- package/dist/cli/router.cjs.map +1 -0
- package/dist/cli/router.d.cts +32 -0
- package/dist/cli/router.d.cts.map +1 -0
- package/dist/cli/router.d.mts +32 -0
- package/dist/cli/router.d.mts.map +1 -0
- package/dist/cli/router.mjs +56 -0
- package/dist/cli/router.mjs.map +1 -0
- package/dist/cli/server/options.cjs +71 -0
- package/dist/cli/server/options.cjs.map +1 -0
- package/dist/cli/server/options.mjs +70 -0
- package/dist/cli/server/options.mjs.map +1 -0
- package/dist/cli/server/run.cjs +45 -0
- package/dist/cli/server/run.cjs.map +1 -0
- package/dist/cli/server/run.mjs +45 -0
- package/dist/cli/server/run.mjs.map +1 -0
- package/dist/cli-app.cjs +5 -0
- package/dist/cli-app.d.cts +2 -0
- package/dist/cli-app.d.mts +2 -0
- package/dist/cli-app.mjs +2 -0
- package/dist/cli.cjs +28 -0
- package/dist/cli.d.cts +11 -0
- package/dist/cli.d.mts +11 -0
- package/dist/cli.mjs +11 -0
- package/dist/codex.cjs +8 -0
- package/dist/codex.d.cts +2 -0
- package/dist/codex.d.mts +2 -0
- package/dist/codex.mjs +2 -0
- package/dist/commands.cjs +23 -0
- package/dist/commands.d.cts +9 -0
- package/dist/commands.d.mts +9 -0
- package/dist/commands.mjs +9 -0
- package/dist/compatibility-command.cjs +4 -0
- package/dist/compatibility-command.d.cts +2 -0
- package/dist/compatibility-command.d.mts +2 -0
- package/dist/compatibility-command.mjs +2 -0
- package/dist/compatibility-context.cjs +3 -0
- package/dist/compatibility-context.d.cts +2 -0
- package/dist/compatibility-context.d.mts +2 -0
- package/dist/compatibility-context.mjs +2 -0
- package/dist/compatibility-options.cjs +5 -0
- package/dist/compatibility-options.d.cts +2 -0
- package/dist/compatibility-options.d.mts +2 -0
- package/dist/compatibility-options.mjs +2 -0
- package/dist/compatibility.cjs +27 -0
- package/dist/compatibility.d.cts +6 -0
- package/dist/compatibility.d.mts +6 -0
- package/dist/compatibility.mjs +6 -0
- package/dist/compiler/cache.cjs +331 -0
- package/dist/compiler/cache.cjs.map +1 -0
- package/dist/compiler/cache.mjs +323 -0
- package/dist/compiler/cache.mjs.map +1 -0
- package/dist/compiler/index.cjs +996 -0
- package/dist/compiler/index.cjs.map +1 -0
- package/dist/compiler/index.mjs +988 -0
- package/dist/compiler/index.mjs.map +1 -0
- package/dist/compiler/inputs.cjs +83 -0
- package/dist/compiler/inputs.cjs.map +1 -0
- package/dist/compiler/inputs.mjs +78 -0
- package/dist/compiler/inputs.mjs.map +1 -0
- package/dist/composer.cjs +28 -0
- package/dist/composer.d.cts +4 -0
- package/dist/composer.d.mts +4 -0
- package/dist/composer.mjs +4 -0
- package/dist/composition/harnessState/index.cjs +48 -0
- package/dist/composition/harnessState/index.cjs.map +1 -0
- package/dist/composition/harnessState/index.d.cts +19 -0
- package/dist/composition/harnessState/index.d.cts.map +1 -0
- package/dist/composition/harnessState/index.d.mts +19 -0
- package/dist/composition/harnessState/index.d.mts.map +1 -0
- package/dist/composition/harnessState/index.mjs +34 -0
- package/dist/composition/harnessState/index.mjs.map +1 -0
- package/dist/composition/layerPackageInstaller/index.cjs +342 -0
- package/dist/composition/layerPackageInstaller/index.cjs.map +1 -0
- package/dist/composition/layerPackageInstaller/index.d.cts +45 -0
- package/dist/composition/layerPackageInstaller/index.d.cts.map +1 -0
- package/dist/composition/layerPackageInstaller/index.d.mts +45 -0
- package/dist/composition/layerPackageInstaller/index.d.mts.map +1 -0
- package/dist/composition/layerPackageInstaller/index.mjs +334 -0
- package/dist/composition/layerPackageInstaller/index.mjs.map +1 -0
- package/dist/composition/projectTrust/index.cjs +51 -0
- package/dist/composition/projectTrust/index.cjs.map +1 -0
- package/dist/composition/projectTrust/index.d.cts +22 -0
- package/dist/composition/projectTrust/index.d.cts.map +1 -0
- package/dist/composition/projectTrust/index.d.mts +22 -0
- package/dist/composition/projectTrust/index.d.mts.map +1 -0
- package/dist/composition/projectTrust/index.mjs +48 -0
- package/dist/composition/projectTrust/index.mjs.map +1 -0
- package/dist/composition/repository/index.cjs +69 -0
- package/dist/composition/repository/index.cjs.map +1 -0
- package/dist/composition/repository/index.d.cts +22 -0
- package/dist/composition/repository/index.d.cts.map +1 -0
- package/dist/composition/repository/index.d.mts +22 -0
- package/dist/composition/repository/index.d.mts.map +1 -0
- package/dist/composition/repository/index.mjs +64 -0
- package/dist/composition/repository/index.mjs.map +1 -0
- package/dist/composition/syncDrift/index.cjs +160 -0
- package/dist/composition/syncDrift/index.cjs.map +1 -0
- package/dist/composition/syncDrift/index.d.cts +41 -0
- package/dist/composition/syncDrift/index.d.cts.map +1 -0
- package/dist/composition/syncDrift/index.d.mts +41 -0
- package/dist/composition/syncDrift/index.d.mts.map +1 -0
- package/dist/composition/syncDrift/index.mjs +152 -0
- package/dist/composition/syncDrift/index.mjs.map +1 -0
- package/dist/composition/syncState/index.cjs +593 -0
- package/dist/composition/syncState/index.cjs.map +1 -0
- package/dist/composition/syncState/index.d.cts +188 -0
- package/dist/composition/syncState/index.d.cts.map +1 -0
- package/dist/composition/syncState/index.d.mts +188 -0
- package/dist/composition/syncState/index.d.mts.map +1 -0
- package/dist/composition/syncState/index.mjs +559 -0
- package/dist/composition/syncState/index.mjs.map +1 -0
- package/dist/composition/transitionLayers.cjs +17 -0
- package/dist/composition/transitionLayers.cjs.map +1 -0
- package/dist/composition/transitionLayers.d.cts +6 -0
- package/dist/composition/transitionLayers.d.cts.map +1 -0
- package/dist/composition/transitionLayers.d.mts +6 -0
- package/dist/composition/transitionLayers.d.mts.map +1 -0
- package/dist/composition/transitionLayers.mjs +16 -0
- package/dist/composition/transitionLayers.mjs.map +1 -0
- package/dist/composition/types/harness.d.cts +49 -0
- package/dist/composition/types/harness.d.cts.map +1 -0
- package/dist/composition/types/harness.d.mts +49 -0
- package/dist/composition/types/harness.d.mts.map +1 -0
- package/dist/config.cjs +163 -0
- package/dist/config.d.cts +7 -0
- package/dist/config.d.mts +7 -0
- package/dist/config.mjs +7 -0
- package/dist/emit-mcp-command.cjs +4 -0
- package/dist/emit-mcp-command.d.cts +2 -0
- package/dist/emit-mcp-command.d.mts +2 -0
- package/dist/emit-mcp-command.mjs +2 -0
- package/dist/explain-command.cjs +5 -0
- package/dist/explain-command.d.cts +2 -0
- package/dist/explain-command.d.mts +2 -0
- package/dist/explain-command.mjs +2 -0
- package/dist/extensions/agent-model.cjs +41 -0
- package/dist/extensions/agent-model.cjs.map +1 -0
- package/dist/extensions/agent-model.d.cts +22 -0
- package/dist/extensions/agent-model.d.cts.map +1 -0
- package/dist/extensions/agent-model.d.mts +22 -0
- package/dist/extensions/agent-model.d.mts.map +1 -0
- package/dist/extensions/agent-model.mjs +35 -0
- package/dist/extensions/agent-model.mjs.map +1 -0
- package/dist/extensions/composed-pi.cjs +46 -0
- package/dist/extensions/composed-pi.cjs.map +1 -0
- package/dist/extensions/composed-pi.d.cts +13 -0
- package/dist/extensions/composed-pi.d.cts.map +1 -0
- package/dist/extensions/composed-pi.d.mts +13 -0
- package/dist/extensions/composed-pi.d.mts.map +1 -0
- package/dist/extensions/composed-pi.mjs +41 -0
- package/dist/extensions/composed-pi.mjs.map +1 -0
- package/dist/extensions/context-catalog.cjs +96 -0
- package/dist/extensions/context-catalog.cjs.map +1 -0
- package/dist/extensions/context-catalog.d.cts +4 -0
- package/dist/extensions/context-catalog.d.cts.map +1 -0
- package/dist/extensions/context-catalog.d.mts +5 -0
- package/dist/extensions/context-catalog.d.mts.map +1 -0
- package/dist/extensions/context-catalog.mjs +96 -0
- package/dist/extensions/context-catalog.mjs.map +1 -0
- package/dist/extensions/cordis-finalizer.cjs +24 -0
- package/dist/extensions/cordis-finalizer.cjs.map +1 -0
- package/dist/extensions/cordis-finalizer.d.cts +7 -0
- package/dist/extensions/cordis-finalizer.d.cts.map +1 -0
- package/dist/extensions/cordis-finalizer.d.mts +7 -0
- package/dist/extensions/cordis-finalizer.d.mts.map +1 -0
- package/dist/extensions/cordis-finalizer.mjs +19 -0
- package/dist/extensions/cordis-finalizer.mjs.map +1 -0
- package/dist/extensions/cordis-host.cjs +19 -0
- package/dist/extensions/cordis-host.cjs.map +1 -0
- package/dist/extensions/cordis-host.d.cts +7 -0
- package/dist/extensions/cordis-host.d.cts.map +1 -0
- package/dist/extensions/cordis-host.d.mts +7 -0
- package/dist/extensions/cordis-host.d.mts.map +1 -0
- package/dist/extensions/cordis-host.mjs +14 -0
- package/dist/extensions/cordis-host.mjs.map +1 -0
- package/dist/extensions/effort.cjs +54 -0
- package/dist/extensions/effort.cjs.map +1 -0
- package/dist/extensions/effort.d.cts +8 -0
- package/dist/extensions/effort.d.cts.map +1 -0
- package/dist/extensions/effort.d.mts +8 -0
- package/dist/extensions/effort.d.mts.map +1 -0
- package/dist/extensions/effort.mjs +48 -0
- package/dist/extensions/effort.mjs.map +1 -0
- package/dist/extensions/launcher-bootstrap.cjs +38 -0
- package/dist/extensions/launcher-bootstrap.cjs.map +1 -0
- package/dist/extensions/launcher-bootstrap.d.cts +16 -0
- package/dist/extensions/launcher-bootstrap.d.cts.map +1 -0
- package/dist/extensions/launcher-bootstrap.d.mts +16 -0
- package/dist/extensions/launcher-bootstrap.d.mts.map +1 -0
- package/dist/extensions/launcher-bootstrap.mjs +33 -0
- package/dist/extensions/launcher-bootstrap.mjs.map +1 -0
- package/dist/extensions/ollama-provider.cjs +32 -0
- package/dist/extensions/ollama-provider.cjs.map +1 -0
- package/dist/extensions/ollama-provider.d.cts +5 -0
- package/dist/extensions/ollama-provider.d.cts.map +1 -0
- package/dist/extensions/ollama-provider.d.mts +5 -0
- package/dist/extensions/ollama-provider.d.mts.map +1 -0
- package/dist/extensions/ollama-provider.mjs +32 -0
- package/dist/extensions/ollama-provider.mjs.map +1 -0
- package/dist/extensions/pi.cjs +63 -0
- package/dist/extensions/pi.cjs.map +1 -0
- package/dist/extensions/pi.d.cts +7 -0
- package/dist/extensions/pi.d.cts.map +1 -0
- package/dist/extensions/pi.d.mts +7 -0
- package/dist/extensions/pi.d.mts.map +1 -0
- package/dist/extensions/pi.mjs +58 -0
- package/dist/extensions/pi.mjs.map +1 -0
- package/dist/extensions/server.cjs +20 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.cts +5 -0
- package/dist/extensions/server.d.cts.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +15 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/style-system.cjs +234 -0
- package/dist/extensions/style-system.cjs.map +1 -0
- package/dist/extensions/style-system.d.cts +32 -0
- package/dist/extensions/style-system.d.cts.map +1 -0
- package/dist/extensions/style-system.d.mts +32 -0
- package/dist/extensions/style-system.d.mts.map +1 -0
- package/dist/extensions/style-system.mjs +219 -0
- package/dist/extensions/style-system.mjs.map +1 -0
- package/dist/extensions/terminal-child-session.cjs +76 -0
- package/dist/extensions/terminal-child-session.cjs.map +1 -0
- package/dist/extensions/terminal-child-session.d.cts +7 -0
- package/dist/extensions/terminal-child-session.d.cts.map +1 -0
- package/dist/extensions/terminal-child-session.d.mts +7 -0
- package/dist/extensions/terminal-child-session.d.mts.map +1 -0
- package/dist/extensions/terminal-child-session.mjs +69 -0
- package/dist/extensions/terminal-child-session.mjs.map +1 -0
- package/dist/extensions/transition-coordinator.cjs +154 -0
- package/dist/extensions/transition-coordinator.cjs.map +1 -0
- package/dist/extensions/transition-coordinator.d.cts +8 -0
- package/dist/extensions/transition-coordinator.d.cts.map +1 -0
- package/dist/extensions/transition-coordinator.d.mts +8 -0
- package/dist/extensions/transition-coordinator.d.mts.map +1 -0
- package/dist/extensions/transition-coordinator.mjs +146 -0
- package/dist/extensions/transition-coordinator.mjs.map +1 -0
- package/dist/harness-context.cjs +5 -0
- package/dist/harness-context.d.cts +2 -0
- package/dist/harness-context.d.mts +2 -0
- package/dist/harness-context.mjs +2 -0
- package/dist/harness-state.cjs +19 -0
- package/dist/harness-state.d.cts +2 -0
- package/dist/harness-state.d.mts +2 -0
- package/dist/harness-state.mjs +2 -0
- package/dist/help.cjs +16 -0
- package/dist/help.d.cts +8 -0
- package/dist/help.d.mts +8 -0
- package/dist/help.mjs +8 -0
- package/dist/index.cjs +368 -0
- package/dist/index.d.cts +49 -0
- package/dist/index.d.mts +49 -0
- package/dist/index.mjs +46 -0
- package/dist/init-command.cjs +4 -0
- package/dist/init-command.d.cts +2 -0
- package/dist/init-command.d.mts +2 -0
- package/dist/init-command.mjs +2 -0
- package/dist/launch-command.cjs +7 -0
- package/dist/launch-command.d.cts +2 -0
- package/dist/launch-command.d.mts +2 -0
- package/dist/launch-command.mjs +2 -0
- package/dist/matrix-options.cjs +28 -0
- package/dist/matrix-options.d.cts +2 -0
- package/dist/matrix-options.d.mts +2 -0
- package/dist/matrix-options.mjs +2 -0
- package/dist/matrix-switcher.cjs +11 -0
- package/dist/matrix-switcher.d.cts +3 -0
- package/dist/matrix-switcher.d.mts +3 -0
- package/dist/matrix-switcher.mjs +3 -0
- package/dist/mcp-filter.cjs +9 -0
- package/dist/mcp-filter.d.cts +1 -0
- package/dist/mcp-filter.d.mts +1 -0
- package/dist/mcp-filter.mjs +2 -0
- package/dist/options.cjs +3 -0
- package/dist/options.d.cts +2 -0
- package/dist/options.d.mts +2 -0
- package/dist/options.mjs +2 -0
- package/dist/process.cjs +12 -0
- package/dist/process.d.cts +2 -0
- package/dist/process.d.mts +2 -0
- package/dist/process.mjs +2 -0
- package/dist/project-trust.cjs +6 -0
- package/dist/project-trust.d.cts +2 -0
- package/dist/project-trust.d.mts +2 -0
- package/dist/project-trust.mjs +2 -0
- package/dist/repository.cjs +5 -0
- package/dist/repository.d.cts +2 -0
- package/dist/repository.d.mts +2 -0
- package/dist/repository.mjs +2 -0
- package/dist/resource-collector.cjs +9 -0
- package/dist/resource-collector.d.cts +1 -0
- package/dist/resource-collector.d.mts +1 -0
- package/dist/resource-collector.mjs +2 -0
- package/dist/services.cjs +154 -0
- package/dist/services.d.cts +21 -0
- package/dist/services.d.mts +21 -0
- package/dist/services.mjs +21 -0
- package/dist/shared.cjs +18 -0
- package/dist/shared.d.cts +2 -0
- package/dist/shared.d.mts +2 -0
- package/dist/shared.mjs +2 -0
- package/dist/sync-command.cjs +13 -0
- package/dist/sync-command.d.cts +2 -0
- package/dist/sync-command.d.mts +2 -0
- package/dist/sync-command.mjs +2 -0
- package/dist/sync-state.cjs +33 -0
- package/dist/sync-state.d.cts +2 -0
- package/dist/sync-state.d.mts +2 -0
- package/dist/sync-state.mjs +2 -0
- package/dist/utils.cjs +6 -0
- package/dist/utils.d.cts +3 -0
- package/dist/utils.d.mts +3 -0
- package/dist/utils.mjs +3 -0
- package/package.json +16 -16
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { resolveDoomConfigurationRoot } from "../../composition/repository/index.mjs";
|
|
2
|
+
import { readSyncDrift } from "../../composition/syncDrift/index.mjs";
|
|
3
|
+
import { canonicalContractJson, createApiDocuments, parseCompiledContracts } from "@agimon-ai/doompi-core/api-contracts";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { readSyncRegistration } from "@agimon-ai/doompi-core/sync-registration";
|
|
7
|
+
import { globalDoomConfigDirectory } from "@agimon-ai/doompi-config/config";
|
|
8
|
+
import { loadMajorModesConfig, resolveLayers } from "@agimon-ai/doompi-config/majorModes";
|
|
9
|
+
import crypto from "node:crypto";
|
|
10
|
+
import { parseDoomServerBundle } from "@agimon-ai/doompi-core/server-facet";
|
|
11
|
+
//#region src/builders/apiContractExport/index.ts
|
|
12
|
+
/** Read only published generations. Export must never implicitly sync or activate a facet. */
|
|
13
|
+
function exportApiContracts(options) {
|
|
14
|
+
const globalRoot = globalDoomConfigDirectory(options.homeDirectory);
|
|
15
|
+
const workspaceRoot = resolveDoomConfigurationRoot(options.cwd, options.homeDirectory);
|
|
16
|
+
const read = (root) => {
|
|
17
|
+
const drift = readSyncDrift({
|
|
18
|
+
repoRoot: root,
|
|
19
|
+
homeDirectory: options.homeDirectory,
|
|
20
|
+
requireFreshSources: false
|
|
21
|
+
});
|
|
22
|
+
if (!drift.fresh) throw new Error(`Run doompi sync for '${root}' before exporting API contracts: ${drift.reasons.join(", ")}`);
|
|
23
|
+
const registration = readSyncRegistration(root, options.homeDirectory);
|
|
24
|
+
if (!registration?.serverBundle) throw new Error(`No synced server bundle for '${root}'`);
|
|
25
|
+
const descriptor = parseDoomServerBundle(JSON.parse(fs.readFileSync(registration.serverBundle.path, "utf8")));
|
|
26
|
+
if (!descriptor.contracts) throw new Error(`Resync '${root}' to generate API contracts`);
|
|
27
|
+
const file = path.resolve(path.dirname(registration.serverBundle.path), descriptor.contracts.file);
|
|
28
|
+
const bytes = fs.readFileSync(file);
|
|
29
|
+
if (crypto.createHash("sha256").update(bytes).digest("hex") !== descriptor.contracts.sha256) throw new Error(`API contract checksum mismatch for '${root}'`);
|
|
30
|
+
return {
|
|
31
|
+
compiled: parseCompiledContracts(JSON.parse(bytes.toString("utf8"))),
|
|
32
|
+
config: loadMajorModesConfig(root, options.homeDirectory)
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const global = read(globalRoot);
|
|
36
|
+
const workspace = globalRoot === workspaceRoot ? global : read(workspaceRoot);
|
|
37
|
+
const sessionMode = options.majorMode ?? workspace.config.defaultMajorMode;
|
|
38
|
+
const selection = (source, scope, majorMode) => ({
|
|
39
|
+
scope,
|
|
40
|
+
majorMode,
|
|
41
|
+
activeLayers: resolveLayers(source.config, majorMode),
|
|
42
|
+
compiled: source.compiled
|
|
43
|
+
});
|
|
44
|
+
if (!Object.hasOwn(workspace.config.majorMode, sessionMode)) throw new Error(`Unknown major mode '${sessionMode}'`);
|
|
45
|
+
const documents = createApiDocuments([
|
|
46
|
+
selection(global, "global", global.config.defaultMajorMode),
|
|
47
|
+
selection(workspace, "workspace", workspace.config.defaultMajorMode),
|
|
48
|
+
selection(workspace, "session", sessionMode)
|
|
49
|
+
]);
|
|
50
|
+
const files = {
|
|
51
|
+
"openapi.json": canonicalContractJson(documents.openapi),
|
|
52
|
+
"asyncapi.json": canonicalContractJson(documents.asyncapi)
|
|
53
|
+
};
|
|
54
|
+
const manifest = {
|
|
55
|
+
...documents.manifest,
|
|
56
|
+
artifacts: Object.fromEntries(Object.entries(files).map(([name, bytes]) => [name, { sha256: crypto.createHash("sha256").update(bytes).digest("hex") }]))
|
|
57
|
+
};
|
|
58
|
+
fs.mkdirSync(options.outputDirectory, { recursive: true });
|
|
59
|
+
for (const [name, bytes] of Object.entries({
|
|
60
|
+
...files,
|
|
61
|
+
"manifest.json": canonicalContractJson(manifest)
|
|
62
|
+
})) {
|
|
63
|
+
const target = path.join(options.outputDirectory, name);
|
|
64
|
+
const temporary = `${target}.${crypto.randomUUID()}.tmp`;
|
|
65
|
+
try {
|
|
66
|
+
fs.writeFileSync(temporary, bytes, { flag: "wx" });
|
|
67
|
+
fs.renameSync(temporary, target);
|
|
68
|
+
} finally {
|
|
69
|
+
fs.rmSync(temporary, { force: true });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return documents.manifest;
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { exportApiContracts };
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/builders/apiContractExport/index.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { globalDoomConfigDirectory } from '@agimon-ai/doompi-config/config';\nimport { loadMajorModesConfig, resolveLayers } from '@agimon-ai/doompi-config/majorModes';\nimport {\n canonicalContractJson,\n createApiDocuments,\n parseCompiledContracts,\n type ApiContractSelection,\n type ApiDocuments,\n} from '@agimon-ai/doompi-core/api-contracts';\nimport { parseDoomServerBundle } from '@agimon-ai/doompi-core/server-facet';\nimport { readSyncRegistration } from '@agimon-ai/doompi-core/sync-registration';\n\nimport { resolveDoomConfigurationRoot } from '../../composition/repository';\nimport { readSyncDrift } from '../../composition/syncDrift';\n\n/** Read only published generations. Export must never implicitly sync or activate a facet. */\nexport function exportApiContracts(options: {\n cwd: string;\n homeDirectory: string;\n outputDirectory: string;\n majorMode?: string;\n}): ApiDocuments['manifest'] {\n const globalRoot = globalDoomConfigDirectory(options.homeDirectory);\n const workspaceRoot = resolveDoomConfigurationRoot(options.cwd, options.homeDirectory);\n const read = (root: string) => {\n const drift = readSyncDrift({\n repoRoot: root,\n homeDirectory: options.homeDirectory,\n requireFreshSources: false,\n });\n if (!drift.fresh)\n throw new Error(`Run doompi sync for '${root}' before exporting API contracts: ${drift.reasons.join(', ')}`);\n const registration = readSyncRegistration(root, options.homeDirectory);\n if (!registration?.serverBundle) throw new Error(`No synced server bundle for '${root}'`);\n const descriptor = parseDoomServerBundle(JSON.parse(fs.readFileSync(registration.serverBundle.path, 'utf8')));\n if (!descriptor.contracts) throw new Error(`Resync '${root}' to generate API contracts`);\n const file = path.resolve(path.dirname(registration.serverBundle.path), descriptor.contracts.file);\n const bytes = fs.readFileSync(file);\n if (crypto.createHash('sha256').update(bytes).digest('hex') !== descriptor.contracts.sha256)\n throw new Error(`API contract checksum mismatch for '${root}'`);\n return {\n compiled: parseCompiledContracts(JSON.parse(bytes.toString('utf8'))),\n config: loadMajorModesConfig(root, options.homeDirectory),\n };\n };\n const global = read(globalRoot);\n const workspace = globalRoot === workspaceRoot ? global : read(workspaceRoot);\n const sessionMode = options.majorMode ?? workspace.config.defaultMajorMode;\n const selection = (\n source: typeof global,\n scope: ApiContractSelection['scope'],\n majorMode: string,\n ): ApiContractSelection => ({\n scope,\n majorMode,\n activeLayers: resolveLayers(source.config, majorMode),\n compiled: source.compiled,\n });\n // A typo must not silently export an empty session surface.\n if (!Object.hasOwn(workspace.config.majorMode, sessionMode)) throw new Error(`Unknown major mode '${sessionMode}'`);\n const documents = createApiDocuments([\n selection(global, 'global', global.config.defaultMajorMode),\n selection(workspace, 'workspace', workspace.config.defaultMajorMode),\n selection(workspace, 'session', sessionMode),\n ]);\n const files = {\n 'openapi.json': canonicalContractJson(documents.openapi),\n 'asyncapi.json': canonicalContractJson(documents.asyncapi),\n };\n const manifest = {\n ...documents.manifest,\n artifacts: Object.fromEntries(\n Object.entries(files).map(([name, bytes]) => [\n name,\n {\n sha256: crypto.createHash('sha256').update(bytes).digest('hex'),\n },\n ]),\n ),\n };\n fs.mkdirSync(options.outputDirectory, { recursive: true });\n // Write the manifest last. Consumers verify both checksums before accepting the bundle.\n for (const [name, bytes] of Object.entries({ ...files, 'manifest.json': canonicalContractJson(manifest) })) {\n const target = path.join(options.outputDirectory, name);\n const temporary = `${target}.${crypto.randomUUID()}.tmp`;\n try {\n fs.writeFileSync(temporary, bytes, { flag: 'wx' });\n fs.renameSync(temporary, target);\n } finally {\n fs.rmSync(temporary, { force: true });\n }\n }\n return documents.manifest;\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,SAAgB,mBAAmB,SAKN;CAC3B,MAAM,aAAa,0BAA0B,QAAQ,aAAa;CAClE,MAAM,gBAAgB,6BAA6B,QAAQ,KAAK,QAAQ,aAAa;CACrF,MAAM,QAAQ,SAAiB;EAC7B,MAAM,QAAQ,cAAc;GAC1B,UAAU;GACV,eAAe,QAAQ;GACvB,qBAAqB;EACvB,CAAC;EACD,IAAI,CAAC,MAAM,OACT,MAAM,IAAI,MAAM,wBAAwB,KAAK,oCAAoC,MAAM,QAAQ,KAAK,IAAI,GAAG;EAC7G,MAAM,eAAe,qBAAqB,MAAM,QAAQ,aAAa;EACrE,IAAI,CAAC,cAAc,cAAc,MAAM,IAAI,MAAM,gCAAgC,KAAK,EAAE;EACxF,MAAM,aAAa,sBAAsB,KAAK,MAAM,GAAG,aAAa,aAAa,aAAa,MAAM,MAAM,CAAC,CAAC;EAC5G,IAAI,CAAC,WAAW,WAAW,MAAM,IAAI,MAAM,WAAW,KAAK,4BAA4B;EACvF,MAAM,OAAO,KAAK,QAAQ,KAAK,QAAQ,aAAa,aAAa,IAAI,GAAG,WAAW,UAAU,IAAI;EACjG,MAAM,QAAQ,GAAG,aAAa,IAAI;EAClC,IAAI,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,KAAK,MAAM,WAAW,UAAU,QACnF,MAAM,IAAI,MAAM,uCAAuC,KAAK,EAAE;EAChE,OAAO;GACL,UAAU,uBAAuB,KAAK,MAAM,MAAM,SAAS,MAAM,CAAC,CAAC;GACnE,QAAQ,qBAAqB,MAAM,QAAQ,aAAa;EAC1D;CACF;CACA,MAAM,SAAS,KAAK,UAAU;CAC9B,MAAM,YAAY,eAAe,gBAAgB,SAAS,KAAK,aAAa;CAC5E,MAAM,cAAc,QAAQ,aAAa,UAAU,OAAO;CAC1D,MAAM,aACJ,QACA,OACA,eAC0B;EAC1B;EACA;EACA,cAAc,cAAc,OAAO,QAAQ,SAAS;EACpD,UAAU,OAAO;CACnB;CAEA,IAAI,CAAC,OAAO,OAAO,UAAU,OAAO,WAAW,WAAW,GAAG,MAAM,IAAI,MAAM,uBAAuB,YAAY,EAAE;CAClH,MAAM,YAAY,mBAAmB;EACnC,UAAU,QAAQ,UAAU,OAAO,OAAO,gBAAgB;EAC1D,UAAU,WAAW,aAAa,UAAU,OAAO,gBAAgB;EACnE,UAAU,WAAW,WAAW,WAAW;CAC7C,CAAC;CACD,MAAM,QAAQ;EACZ,gBAAgB,sBAAsB,UAAU,OAAO;EACvD,iBAAiB,sBAAsB,UAAU,QAAQ;CAC3D;CACA,MAAM,WAAW;EACf,GAAG,UAAU;EACb,WAAW,OAAO,YAChB,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAC3C,MACA,EACE,QAAQ,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,KAAK,EAChE,CACF,CAAC,CACH;CACF;CACA,GAAG,UAAU,QAAQ,iBAAiB,EAAE,WAAW,KAAK,CAAC;CAEzD,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ;EAAE,GAAG;EAAO,iBAAiB,sBAAsB,QAAQ;CAAE,CAAC,GAAG;EAC1G,MAAM,SAAS,KAAK,KAAK,QAAQ,iBAAiB,IAAI;EACtD,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,WAAW,EAAE;EACnD,IAAI;GACF,GAAG,cAAc,WAAW,OAAO,EAAE,MAAM,KAAK,CAAC;GACjD,GAAG,WAAW,WAAW,MAAM;EACjC,UAAU;GACR,GAAG,OAAO,WAAW,EAAE,OAAO,KAAK,CAAC;EACtC;CACF;CACA,OAAO,UAAU;AACnB"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_index = require("../../compiler/index.cjs");
|
|
3
|
+
let _agimon_ai_doompi_core_api_contracts = require("@agimon-ai/doompi-core/api-contracts");
|
|
4
|
+
let node_fs = require("node:fs");
|
|
5
|
+
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
6
|
+
let node_path = require("node:path");
|
|
7
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
8
|
+
let node_url = require("node:url");
|
|
9
|
+
let node_child_process = require("node:child_process");
|
|
10
|
+
let node_util = require("node:util");
|
|
11
|
+
let node_crypto = require("node:crypto");
|
|
12
|
+
node_crypto = require_runtime.__toESM(node_crypto, 1);
|
|
13
|
+
//#region src/builders/apiContracts/index.ts
|
|
14
|
+
const execute = (0, node_util.promisify)(node_child_process.execFile);
|
|
15
|
+
const CONTRACT_MANIFEST_SUFFIX = "#contracts";
|
|
16
|
+
/** Contracts have a separate entry graph so exporting never imports a server facet. */
|
|
17
|
+
async function compileApiContracts(input) {
|
|
18
|
+
node_fs.default.mkdirSync(input.outputDirectory, { recursive: true });
|
|
19
|
+
const compiled = {
|
|
20
|
+
version: 1,
|
|
21
|
+
generation: input.descriptor.generation,
|
|
22
|
+
fingerprint: input.descriptor.fingerprint,
|
|
23
|
+
packages: []
|
|
24
|
+
};
|
|
25
|
+
const compilerManifests = {};
|
|
26
|
+
const gaps = [];
|
|
27
|
+
for (const [index, facet] of input.descriptor.entries.entries()) {
|
|
28
|
+
const root = input.packageRoots.get(facet.packageName);
|
|
29
|
+
const manifest = JSON.parse(node_fs.default.readFileSync(node_path.default.join(root, "package.json"), "utf8"));
|
|
30
|
+
const entry = {
|
|
31
|
+
packageName: facet.packageName,
|
|
32
|
+
packageVersion: manifest.version ?? "unknown",
|
|
33
|
+
scopes: facet.scopes,
|
|
34
|
+
owners: facet.owners
|
|
35
|
+
};
|
|
36
|
+
compiled.packages.push(entry);
|
|
37
|
+
try {
|
|
38
|
+
const declaration = manifest.doompiServer?.contracts;
|
|
39
|
+
if (!declaration) throw new Error("No doompiServer.contracts declaration");
|
|
40
|
+
for (const value of [declaration.entry, declaration.dist]) {
|
|
41
|
+
if (typeof value !== "string" || !value.startsWith("./") || value.includes("..") || /[\\%?#]/u.test(value)) throw new Error("Contract entry and dist must be contained package-relative files");
|
|
42
|
+
if (value === declaration.dist) {
|
|
43
|
+
const relative = node_path.default.relative(node_fs.default.realpathSync(root), node_fs.default.realpathSync(node_path.default.join(root, value)));
|
|
44
|
+
if (relative.startsWith("..") || node_path.default.isAbsolute(relative)) throw new Error("Contract entry escapes package");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const built = node_path.default.resolve(root, declaration.dist);
|
|
48
|
+
const options = {
|
|
49
|
+
repositoryRoot: input.repositoryRoot,
|
|
50
|
+
sharedCacheDirectory: input.sharedCacheDirectory,
|
|
51
|
+
outputDirectory: node_path.default.join(input.outputDirectory, "contracts", String(index)),
|
|
52
|
+
outputName: "contract"
|
|
53
|
+
};
|
|
54
|
+
const module = await require_index.compileExtensionModule(built, input.cacheDirectory, options);
|
|
55
|
+
compilerManifests[`${facet.packageName}${CONTRACT_MANIFEST_SUFFIX}`] = require_index.extensionModuleManifestPath(built, input.cacheDirectory, options);
|
|
56
|
+
entry.module = `./${node_path.default.relative(input.outputDirectory, module).split(node_path.default.sep).join("/")}`;
|
|
57
|
+
const { stdout } = await execute(process.execPath, [
|
|
58
|
+
"--input-type=module",
|
|
59
|
+
"-e",
|
|
60
|
+
"try { const m = await import(process.argv[1]); process.stdout.write(JSON.stringify(m.default, (_key, value) => { if (typeof value === \"function\" || typeof value === \"bigint\" || typeof value === \"undefined\" || (typeof value === \"number\" && !Number.isFinite(value))) throw new Error(\"Contract contains non-JSON data\"); return value; })); } catch (error) { process.stderr.write(error instanceof Error ? `${error.name}: ${error.message}` : String(error)); process.exitCode = 1; }",
|
|
61
|
+
(0, node_url.pathToFileURL)(module).href
|
|
62
|
+
], {
|
|
63
|
+
timeout: 1e4,
|
|
64
|
+
maxBuffer: 16777216
|
|
65
|
+
});
|
|
66
|
+
entry.contract = (0, _agimon_ai_doompi_core_api_contracts.parseApiContract)(JSON.parse(stdout));
|
|
67
|
+
} catch (error) {
|
|
68
|
+
entry.problem = (error !== null && typeof error === "object" && "stderr" in error && typeof error.stderr === "string" && error.stderr.trim() ? error.stderr.trim() : error instanceof Error ? error.message : String(error)).slice(0, 1e3);
|
|
69
|
+
gaps.push(`${facet.packageName}: ${entry.problem}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const bytes = (0, _agimon_ai_doompi_core_api_contracts.canonicalContractJson)(compiled);
|
|
73
|
+
node_fs.default.writeFileSync(node_path.default.join(input.outputDirectory, _agimon_ai_doompi_core_api_contracts.DOOM_API_CONTRACT_FILE), bytes);
|
|
74
|
+
return {
|
|
75
|
+
contracts: {
|
|
76
|
+
file: `./${_agimon_ai_doompi_core_api_contracts.DOOM_API_CONTRACT_FILE}`,
|
|
77
|
+
sha256: node_crypto.default.createHash("sha256").update(bytes).digest("hex")
|
|
78
|
+
},
|
|
79
|
+
compilerManifests,
|
|
80
|
+
gaps
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
exports.CONTRACT_MANIFEST_SUFFIX = CONTRACT_MANIFEST_SUFFIX;
|
|
85
|
+
exports.compileApiContracts = compileApiContracts;
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["promisify","execFile","fs","path","compileExtensionModule","extensionModuleManifestPath","pathToFileURL","parseApiContract","canonicalContractJson","DOOM_API_CONTRACT_FILE","crypto"],"sources":["../../../src/builders/apiContracts/index.ts"],"sourcesContent":["import { execFile } from 'node:child_process';\nimport crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { promisify } from 'node:util';\n\nimport {\n canonicalContractJson,\n DOOM_API_CONTRACT_FILE,\n parseApiContract,\n type DoomCompiledContracts,\n type DoomPackageContract,\n} from '@agimon-ai/doompi-core/api-contracts';\nimport type { DoomServerBundle } from '@agimon-ai/doompi-core/server-facet';\n\nimport { compileExtensionModule, extensionModuleManifestPath } from '../../compiler';\n\nconst execute = promisify(execFile);\nexport const CONTRACT_MANIFEST_SUFFIX = '#contracts';\n\n/** Contracts have a separate entry graph so exporting never imports a server facet. */\nexport async function compileApiContracts(input: {\n descriptor: DoomServerBundle;\n packageRoots: ReadonlyMap<string, string>;\n repositoryRoot: string;\n outputDirectory: string;\n cacheDirectory: string;\n sharedCacheDirectory?: string;\n}): Promise<{\n contracts: { file: string; sha256: string };\n compilerManifests: Record<string, string>;\n gaps: string[];\n}> {\n fs.mkdirSync(input.outputDirectory, { recursive: true });\n const compiled: DoomCompiledContracts = {\n version: 1,\n generation: input.descriptor.generation,\n fingerprint: input.descriptor.fingerprint,\n packages: [],\n };\n const compilerManifests: Record<string, string> = {};\n const gaps: string[] = [];\n for (const [index, facet] of input.descriptor.entries.entries()) {\n const root = input.packageRoots.get(facet.packageName)!;\n const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')) as {\n version?: string;\n doompiServer?: { contracts?: { entry?: string; dist?: string } };\n };\n const entry: DoomPackageContract = {\n packageName: facet.packageName,\n packageVersion: manifest.version ?? 'unknown',\n scopes: facet.scopes,\n owners: facet.owners,\n };\n compiled.packages.push(entry);\n try {\n const declaration = manifest.doompiServer?.contracts;\n if (!declaration) throw new Error('No doompiServer.contracts declaration');\n for (const value of [declaration.entry, declaration.dist]) {\n if (typeof value !== 'string' || !value.startsWith('./') || value.includes('..') || /[\\\\%?#]/u.test(value))\n throw new Error('Contract entry and dist must be contained package-relative files');\n if (value === declaration.dist) {\n const relative = path.relative(fs.realpathSync(root), fs.realpathSync(path.join(root, value)));\n if (relative.startsWith('..') || path.isAbsolute(relative)) throw new Error('Contract entry escapes package');\n }\n }\n const built = path.resolve(root, declaration.dist!);\n const options = {\n repositoryRoot: input.repositoryRoot,\n sharedCacheDirectory: input.sharedCacheDirectory,\n outputDirectory: path.join(input.outputDirectory, 'contracts', String(index)),\n outputName: 'contract',\n };\n const module = await compileExtensionModule(built, input.cacheDirectory, options);\n compilerManifests[`${facet.packageName}${CONTRACT_MANIFEST_SUFFIX}`] = extensionModuleManifestPath(\n built,\n input.cacheDirectory,\n options,\n );\n entry.module = `./${path.relative(input.outputDirectory, module).split(path.sep).join('/')}`;\n // A bounded separate process keeps module caches, timers and errors out of sync.\n const { stdout } = await execute(\n process.execPath,\n [\n '--input-type=module',\n '-e',\n 'try { const m = await import(process.argv[1]); process.stdout.write(JSON.stringify(m.default, (_key, value) => { if (typeof value === \"function\" || typeof value === \"bigint\" || typeof value === \"undefined\" || (typeof value === \"number\" && !Number.isFinite(value))) throw new Error(\"Contract contains non-JSON data\"); return value; })); } catch (error) { process.stderr.write(error instanceof Error ? `${error.name}: ${error.message}` : String(error)); process.exitCode = 1; }',\n pathToFileURL(module).href,\n ],\n { timeout: 10_000, maxBuffer: 16 * 1024 * 1024 },\n );\n entry.contract = parseApiContract(JSON.parse(stdout));\n } catch (error) {\n entry.problem = (\n error !== null &&\n typeof error === 'object' &&\n 'stderr' in error &&\n typeof error.stderr === 'string' &&\n error.stderr.trim()\n ? error.stderr.trim()\n : error instanceof Error\n ? error.message\n : String(error)\n ).slice(0, 1000);\n gaps.push(`${facet.packageName}: ${entry.problem}`);\n }\n }\n const bytes = canonicalContractJson(compiled);\n fs.writeFileSync(path.join(input.outputDirectory, DOOM_API_CONTRACT_FILE), bytes);\n return {\n contracts: { file: `./${DOOM_API_CONTRACT_FILE}`, sha256: crypto.createHash('sha256').update(bytes).digest('hex') },\n compilerManifests,\n gaps,\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,MAAM,WAAA,GAAUA,UAAAA,UAAAA,CAAUC,mBAAAA,QAAQ;AAClC,MAAa,2BAA2B;;AAGxC,eAAsB,oBAAoB,OAWvC;CACD,QAAA,QAAG,UAAU,MAAM,iBAAiB,EAAE,WAAW,KAAK,CAAC;CACvD,MAAM,WAAkC;EACtC,SAAS;EACT,YAAY,MAAM,WAAW;EAC7B,aAAa,MAAM,WAAW;EAC9B,UAAU,CAAC;CACb;CACA,MAAM,oBAA4C,CAAC;CACnD,MAAM,OAAiB,CAAC;CACxB,KAAK,MAAM,CAAC,OAAO,UAAU,MAAM,WAAW,QAAQ,QAAQ,GAAG;EAC/D,MAAM,OAAO,MAAM,aAAa,IAAI,MAAM,WAAW;EACrD,MAAM,WAAW,KAAK,MAAMC,QAAAA,QAAG,aAAaC,UAAAA,QAAK,KAAK,MAAM,cAAc,GAAG,MAAM,CAAC;EAIpF,MAAM,QAA6B;GACjC,aAAa,MAAM;GACnB,gBAAgB,SAAS,WAAW;GACpC,QAAQ,MAAM;GACd,QAAQ,MAAM;EAChB;EACA,SAAS,SAAS,KAAK,KAAK;EAC5B,IAAI;GACF,MAAM,cAAc,SAAS,cAAc;GAC3C,IAAI,CAAC,aAAa,MAAM,IAAI,MAAM,uCAAuC;GACzE,KAAK,MAAM,SAAS,CAAC,YAAY,OAAO,YAAY,IAAI,GAAG;IACzD,IAAI,OAAO,UAAU,YAAY,CAAC,MAAM,WAAW,IAAI,KAAK,MAAM,SAAS,IAAI,KAAK,WAAW,KAAK,KAAK,GACvG,MAAM,IAAI,MAAM,kEAAkE;IACpF,IAAI,UAAU,YAAY,MAAM;KAC9B,MAAM,WAAWA,UAAAA,QAAK,SAASD,QAAAA,QAAG,aAAa,IAAI,GAAGA,QAAAA,QAAG,aAAaC,UAAAA,QAAK,KAAK,MAAM,KAAK,CAAC,CAAC;KAC7F,IAAI,SAAS,WAAW,IAAI,KAAKA,UAAAA,QAAK,WAAW,QAAQ,GAAG,MAAM,IAAI,MAAM,gCAAgC;IAC9G;GACF;GACA,MAAM,QAAQA,UAAAA,QAAK,QAAQ,MAAM,YAAY,IAAK;GAClD,MAAM,UAAU;IACd,gBAAgB,MAAM;IACtB,sBAAsB,MAAM;IAC5B,iBAAiBA,UAAAA,QAAK,KAAK,MAAM,iBAAiB,aAAa,OAAO,KAAK,CAAC;IAC5E,YAAY;GACd;GACA,MAAM,SAAS,MAAMC,cAAAA,uBAAuB,OAAO,MAAM,gBAAgB,OAAO;GAChF,kBAAkB,GAAG,MAAM,cAAc,8BAA8BC,cAAAA,4BACrE,OACA,MAAM,gBACN,OACF;GACA,MAAM,SAAS,KAAKF,UAAAA,QAAK,SAAS,MAAM,iBAAiB,MAAM,CAAC,CAAC,MAAMA,UAAAA,QAAK,GAAG,CAAC,CAAC,KAAK,GAAG;GAEzF,MAAM,EAAE,WAAW,MAAM,QACvB,QAAQ,UACR;IACE;IACA;IACA;KACAG,GAAAA,SAAAA,cAAAA,CAAc,MAAM,CAAC,CAAC;GACxB,GACA;IAAE,SAAS;IAAQ,WAAW;GAAiB,CACjD;GACA,MAAM,YAAA,GAAWC,qCAAAA,iBAAAA,CAAiB,KAAK,MAAM,MAAM,CAAC;EACtD,SAAS,OAAO;GACd,MAAM,WACJ,UAAU,QACV,OAAO,UAAU,YACjB,YAAY,SACZ,OAAO,MAAM,WAAW,YACxB,MAAM,OAAO,KAAK,IACd,MAAM,OAAO,KAAK,IAClB,iBAAiB,QACf,MAAM,UACN,OAAO,KAAK,EAAA,CAClB,MAAM,GAAG,GAAI;GACf,KAAK,KAAK,GAAG,MAAM,YAAY,IAAI,MAAM,SAAS;EACpD;CACF;CACA,MAAM,SAAA,GAAQC,qCAAAA,sBAAAA,CAAsB,QAAQ;CAC5C,QAAA,QAAG,cAAcL,UAAAA,QAAK,KAAK,MAAM,iBAAiBM,qCAAAA,sBAAsB,GAAG,KAAK;CAChF,OAAO;EACL,WAAW;GAAE,MAAM,KAAKA,qCAAAA;GAA0B,QAAQC,YAAAA,QAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,KAAK;EAAE;EAClH;EACA;CACF;AACF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { compileExtensionModule, extensionModuleManifestPath } from "../../compiler/index.mjs";
|
|
2
|
+
import { DOOM_API_CONTRACT_FILE, canonicalContractJson, parseApiContract } from "@agimon-ai/doompi-core/api-contracts";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { pathToFileURL } from "node:url";
|
|
6
|
+
import { execFile } from "node:child_process";
|
|
7
|
+
import { promisify } from "node:util";
|
|
8
|
+
import crypto from "node:crypto";
|
|
9
|
+
//#region src/builders/apiContracts/index.ts
|
|
10
|
+
const execute = promisify(execFile);
|
|
11
|
+
const CONTRACT_MANIFEST_SUFFIX = "#contracts";
|
|
12
|
+
/** Contracts have a separate entry graph so exporting never imports a server facet. */
|
|
13
|
+
async function compileApiContracts(input) {
|
|
14
|
+
fs.mkdirSync(input.outputDirectory, { recursive: true });
|
|
15
|
+
const compiled = {
|
|
16
|
+
version: 1,
|
|
17
|
+
generation: input.descriptor.generation,
|
|
18
|
+
fingerprint: input.descriptor.fingerprint,
|
|
19
|
+
packages: []
|
|
20
|
+
};
|
|
21
|
+
const compilerManifests = {};
|
|
22
|
+
const gaps = [];
|
|
23
|
+
for (const [index, facet] of input.descriptor.entries.entries()) {
|
|
24
|
+
const root = input.packageRoots.get(facet.packageName);
|
|
25
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
|
|
26
|
+
const entry = {
|
|
27
|
+
packageName: facet.packageName,
|
|
28
|
+
packageVersion: manifest.version ?? "unknown",
|
|
29
|
+
scopes: facet.scopes,
|
|
30
|
+
owners: facet.owners
|
|
31
|
+
};
|
|
32
|
+
compiled.packages.push(entry);
|
|
33
|
+
try {
|
|
34
|
+
const declaration = manifest.doompiServer?.contracts;
|
|
35
|
+
if (!declaration) throw new Error("No doompiServer.contracts declaration");
|
|
36
|
+
for (const value of [declaration.entry, declaration.dist]) {
|
|
37
|
+
if (typeof value !== "string" || !value.startsWith("./") || value.includes("..") || /[\\%?#]/u.test(value)) throw new Error("Contract entry and dist must be contained package-relative files");
|
|
38
|
+
if (value === declaration.dist) {
|
|
39
|
+
const relative = path.relative(fs.realpathSync(root), fs.realpathSync(path.join(root, value)));
|
|
40
|
+
if (relative.startsWith("..") || path.isAbsolute(relative)) throw new Error("Contract entry escapes package");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const built = path.resolve(root, declaration.dist);
|
|
44
|
+
const options = {
|
|
45
|
+
repositoryRoot: input.repositoryRoot,
|
|
46
|
+
sharedCacheDirectory: input.sharedCacheDirectory,
|
|
47
|
+
outputDirectory: path.join(input.outputDirectory, "contracts", String(index)),
|
|
48
|
+
outputName: "contract"
|
|
49
|
+
};
|
|
50
|
+
const module = await compileExtensionModule(built, input.cacheDirectory, options);
|
|
51
|
+
compilerManifests[`${facet.packageName}${CONTRACT_MANIFEST_SUFFIX}`] = extensionModuleManifestPath(built, input.cacheDirectory, options);
|
|
52
|
+
entry.module = `./${path.relative(input.outputDirectory, module).split(path.sep).join("/")}`;
|
|
53
|
+
const { stdout } = await execute(process.execPath, [
|
|
54
|
+
"--input-type=module",
|
|
55
|
+
"-e",
|
|
56
|
+
"try { const m = await import(process.argv[1]); process.stdout.write(JSON.stringify(m.default, (_key, value) => { if (typeof value === \"function\" || typeof value === \"bigint\" || typeof value === \"undefined\" || (typeof value === \"number\" && !Number.isFinite(value))) throw new Error(\"Contract contains non-JSON data\"); return value; })); } catch (error) { process.stderr.write(error instanceof Error ? `${error.name}: ${error.message}` : String(error)); process.exitCode = 1; }",
|
|
57
|
+
pathToFileURL(module).href
|
|
58
|
+
], {
|
|
59
|
+
timeout: 1e4,
|
|
60
|
+
maxBuffer: 16777216
|
|
61
|
+
});
|
|
62
|
+
entry.contract = parseApiContract(JSON.parse(stdout));
|
|
63
|
+
} catch (error) {
|
|
64
|
+
entry.problem = (error !== null && typeof error === "object" && "stderr" in error && typeof error.stderr === "string" && error.stderr.trim() ? error.stderr.trim() : error instanceof Error ? error.message : String(error)).slice(0, 1e3);
|
|
65
|
+
gaps.push(`${facet.packageName}: ${entry.problem}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const bytes = canonicalContractJson(compiled);
|
|
69
|
+
fs.writeFileSync(path.join(input.outputDirectory, DOOM_API_CONTRACT_FILE), bytes);
|
|
70
|
+
return {
|
|
71
|
+
contracts: {
|
|
72
|
+
file: `./${DOOM_API_CONTRACT_FILE}`,
|
|
73
|
+
sha256: crypto.createHash("sha256").update(bytes).digest("hex")
|
|
74
|
+
},
|
|
75
|
+
compilerManifests,
|
|
76
|
+
gaps
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { CONTRACT_MANIFEST_SUFFIX, compileApiContracts };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/builders/apiContracts/index.ts"],"sourcesContent":["import { execFile } from 'node:child_process';\nimport crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { promisify } from 'node:util';\n\nimport {\n canonicalContractJson,\n DOOM_API_CONTRACT_FILE,\n parseApiContract,\n type DoomCompiledContracts,\n type DoomPackageContract,\n} from '@agimon-ai/doompi-core/api-contracts';\nimport type { DoomServerBundle } from '@agimon-ai/doompi-core/server-facet';\n\nimport { compileExtensionModule, extensionModuleManifestPath } from '../../compiler';\n\nconst execute = promisify(execFile);\nexport const CONTRACT_MANIFEST_SUFFIX = '#contracts';\n\n/** Contracts have a separate entry graph so exporting never imports a server facet. */\nexport async function compileApiContracts(input: {\n descriptor: DoomServerBundle;\n packageRoots: ReadonlyMap<string, string>;\n repositoryRoot: string;\n outputDirectory: string;\n cacheDirectory: string;\n sharedCacheDirectory?: string;\n}): Promise<{\n contracts: { file: string; sha256: string };\n compilerManifests: Record<string, string>;\n gaps: string[];\n}> {\n fs.mkdirSync(input.outputDirectory, { recursive: true });\n const compiled: DoomCompiledContracts = {\n version: 1,\n generation: input.descriptor.generation,\n fingerprint: input.descriptor.fingerprint,\n packages: [],\n };\n const compilerManifests: Record<string, string> = {};\n const gaps: string[] = [];\n for (const [index, facet] of input.descriptor.entries.entries()) {\n const root = input.packageRoots.get(facet.packageName)!;\n const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')) as {\n version?: string;\n doompiServer?: { contracts?: { entry?: string; dist?: string } };\n };\n const entry: DoomPackageContract = {\n packageName: facet.packageName,\n packageVersion: manifest.version ?? 'unknown',\n scopes: facet.scopes,\n owners: facet.owners,\n };\n compiled.packages.push(entry);\n try {\n const declaration = manifest.doompiServer?.contracts;\n if (!declaration) throw new Error('No doompiServer.contracts declaration');\n for (const value of [declaration.entry, declaration.dist]) {\n if (typeof value !== 'string' || !value.startsWith('./') || value.includes('..') || /[\\\\%?#]/u.test(value))\n throw new Error('Contract entry and dist must be contained package-relative files');\n if (value === declaration.dist) {\n const relative = path.relative(fs.realpathSync(root), fs.realpathSync(path.join(root, value)));\n if (relative.startsWith('..') || path.isAbsolute(relative)) throw new Error('Contract entry escapes package');\n }\n }\n const built = path.resolve(root, declaration.dist!);\n const options = {\n repositoryRoot: input.repositoryRoot,\n sharedCacheDirectory: input.sharedCacheDirectory,\n outputDirectory: path.join(input.outputDirectory, 'contracts', String(index)),\n outputName: 'contract',\n };\n const module = await compileExtensionModule(built, input.cacheDirectory, options);\n compilerManifests[`${facet.packageName}${CONTRACT_MANIFEST_SUFFIX}`] = extensionModuleManifestPath(\n built,\n input.cacheDirectory,\n options,\n );\n entry.module = `./${path.relative(input.outputDirectory, module).split(path.sep).join('/')}`;\n // A bounded separate process keeps module caches, timers and errors out of sync.\n const { stdout } = await execute(\n process.execPath,\n [\n '--input-type=module',\n '-e',\n 'try { const m = await import(process.argv[1]); process.stdout.write(JSON.stringify(m.default, (_key, value) => { if (typeof value === \"function\" || typeof value === \"bigint\" || typeof value === \"undefined\" || (typeof value === \"number\" && !Number.isFinite(value))) throw new Error(\"Contract contains non-JSON data\"); return value; })); } catch (error) { process.stderr.write(error instanceof Error ? `${error.name}: ${error.message}` : String(error)); process.exitCode = 1; }',\n pathToFileURL(module).href,\n ],\n { timeout: 10_000, maxBuffer: 16 * 1024 * 1024 },\n );\n entry.contract = parseApiContract(JSON.parse(stdout));\n } catch (error) {\n entry.problem = (\n error !== null &&\n typeof error === 'object' &&\n 'stderr' in error &&\n typeof error.stderr === 'string' &&\n error.stderr.trim()\n ? error.stderr.trim()\n : error instanceof Error\n ? error.message\n : String(error)\n ).slice(0, 1000);\n gaps.push(`${facet.packageName}: ${entry.problem}`);\n }\n }\n const bytes = canonicalContractJson(compiled);\n fs.writeFileSync(path.join(input.outputDirectory, DOOM_API_CONTRACT_FILE), bytes);\n return {\n contracts: { file: `./${DOOM_API_CONTRACT_FILE}`, sha256: crypto.createHash('sha256').update(bytes).digest('hex') },\n compilerManifests,\n gaps,\n };\n}\n"],"mappings":";;;;;;;;;AAkBA,MAAM,UAAU,UAAU,QAAQ;AAClC,MAAa,2BAA2B;;AAGxC,eAAsB,oBAAoB,OAWvC;CACD,GAAG,UAAU,MAAM,iBAAiB,EAAE,WAAW,KAAK,CAAC;CACvD,MAAM,WAAkC;EACtC,SAAS;EACT,YAAY,MAAM,WAAW;EAC7B,aAAa,MAAM,WAAW;EAC9B,UAAU,CAAC;CACb;CACA,MAAM,oBAA4C,CAAC;CACnD,MAAM,OAAiB,CAAC;CACxB,KAAK,MAAM,CAAC,OAAO,UAAU,MAAM,WAAW,QAAQ,QAAQ,GAAG;EAC/D,MAAM,OAAO,MAAM,aAAa,IAAI,MAAM,WAAW;EACrD,MAAM,WAAW,KAAK,MAAM,GAAG,aAAa,KAAK,KAAK,MAAM,cAAc,GAAG,MAAM,CAAC;EAIpF,MAAM,QAA6B;GACjC,aAAa,MAAM;GACnB,gBAAgB,SAAS,WAAW;GACpC,QAAQ,MAAM;GACd,QAAQ,MAAM;EAChB;EACA,SAAS,SAAS,KAAK,KAAK;EAC5B,IAAI;GACF,MAAM,cAAc,SAAS,cAAc;GAC3C,IAAI,CAAC,aAAa,MAAM,IAAI,MAAM,uCAAuC;GACzE,KAAK,MAAM,SAAS,CAAC,YAAY,OAAO,YAAY,IAAI,GAAG;IACzD,IAAI,OAAO,UAAU,YAAY,CAAC,MAAM,WAAW,IAAI,KAAK,MAAM,SAAS,IAAI,KAAK,WAAW,KAAK,KAAK,GACvG,MAAM,IAAI,MAAM,kEAAkE;IACpF,IAAI,UAAU,YAAY,MAAM;KAC9B,MAAM,WAAW,KAAK,SAAS,GAAG,aAAa,IAAI,GAAG,GAAG,aAAa,KAAK,KAAK,MAAM,KAAK,CAAC,CAAC;KAC7F,IAAI,SAAS,WAAW,IAAI,KAAK,KAAK,WAAW,QAAQ,GAAG,MAAM,IAAI,MAAM,gCAAgC;IAC9G;GACF;GACA,MAAM,QAAQ,KAAK,QAAQ,MAAM,YAAY,IAAK;GAClD,MAAM,UAAU;IACd,gBAAgB,MAAM;IACtB,sBAAsB,MAAM;IAC5B,iBAAiB,KAAK,KAAK,MAAM,iBAAiB,aAAa,OAAO,KAAK,CAAC;IAC5E,YAAY;GACd;GACA,MAAM,SAAS,MAAM,uBAAuB,OAAO,MAAM,gBAAgB,OAAO;GAChF,kBAAkB,GAAG,MAAM,cAAc,8BAA8B,4BACrE,OACA,MAAM,gBACN,OACF;GACA,MAAM,SAAS,KAAK,KAAK,SAAS,MAAM,iBAAiB,MAAM,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG;GAEzF,MAAM,EAAE,WAAW,MAAM,QACvB,QAAQ,UACR;IACE;IACA;IACA;IACA,cAAc,MAAM,CAAC,CAAC;GACxB,GACA;IAAE,SAAS;IAAQ,WAAW;GAAiB,CACjD;GACA,MAAM,WAAW,iBAAiB,KAAK,MAAM,MAAM,CAAC;EACtD,SAAS,OAAO;GACd,MAAM,WACJ,UAAU,QACV,OAAO,UAAU,YACjB,YAAY,SACZ,OAAO,MAAM,WAAW,YACxB,MAAM,OAAO,KAAK,IACd,MAAM,OAAO,KAAK,IAClB,iBAAiB,QACf,MAAM,UACN,OAAO,KAAK,EAAA,CAClB,MAAM,GAAG,GAAI;GACf,KAAK,KAAK,GAAG,MAAM,YAAY,IAAI,MAAM,SAAS;EACpD;CACF;CACA,MAAM,QAAQ,sBAAsB,QAAQ;CAC5C,GAAG,cAAc,KAAK,KAAK,MAAM,iBAAiB,sBAAsB,GAAG,KAAK;CAChF,OAAO;EACL,WAAW;GAAE,MAAM,KAAK;GAA0B,QAAQ,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,KAAK;EAAE;EAClH;EACA;CACF;AACF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
4
|
+
//#region src/builders/cli/bootstrapClaim.ts
|
|
5
|
+
/**
|
|
6
|
+
* Process-wide ownership of one repository's DoomPi load cycle.
|
|
7
|
+
*
|
|
8
|
+
* Pi unions the extension lists of its user and project settings scopes and
|
|
9
|
+
* dedupes only by the resolved file's real path, so registering DoomPi in both
|
|
10
|
+
* scopes loads two separate installs of the same package. Each one would
|
|
11
|
+
* otherwise read, recompile, and rewrite the same home-scoped worktree state
|
|
12
|
+
* for the same repository, and two installs at different versions disagree about the state
|
|
13
|
+
* contract. A process-global symbol survives the distinct module URLs those
|
|
14
|
+
* installs have, so the first factory owns the cycle and the rest stand down.
|
|
15
|
+
* Pi resolves project resources before user ones, which makes the owner the
|
|
16
|
+
* repository-local install whenever both scopes register the package.
|
|
17
|
+
*/
|
|
18
|
+
const BOOTSTRAP_CLAIM_KEY = Symbol.for("@agimon-ai/doompi:bootstrap-claim");
|
|
19
|
+
/**
|
|
20
|
+
* The registry shared by every DoomPi install in this process.
|
|
21
|
+
*
|
|
22
|
+
* The symbol description is part of the cross-install contract and must stay
|
|
23
|
+
* exactly as written: two installs only meet here when they compute the same
|
|
24
|
+
* key. A value of another shape belongs to an install that spelled the
|
|
25
|
+
* registry differently, so this one starts its own rather than corrupting it.
|
|
26
|
+
*/
|
|
27
|
+
function claimRegistry() {
|
|
28
|
+
const existing = Reflect.get(globalThis, BOOTSTRAP_CLAIM_KEY);
|
|
29
|
+
if (existing instanceof Map) return existing;
|
|
30
|
+
const created = /* @__PURE__ */ new Map();
|
|
31
|
+
Reflect.set(globalThis, BOOTSTRAP_CLAIM_KEY, created);
|
|
32
|
+
return created;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Claims the load cycle for one repository, or reports that it is already owned.
|
|
36
|
+
*
|
|
37
|
+
* Callers must acquire before their first `await`, because releasing happens on
|
|
38
|
+
* `session_start` and an interleaved second factory would otherwise slip in.
|
|
39
|
+
*/
|
|
40
|
+
function acquireBootstrapClaim(repoRoot) {
|
|
41
|
+
const registry = claimRegistry();
|
|
42
|
+
const key = node_path.default.resolve(repoRoot);
|
|
43
|
+
if (registry.has(key)) return void 0;
|
|
44
|
+
const claim = Symbol("doompi-bootstrap");
|
|
45
|
+
registry.set(key, claim);
|
|
46
|
+
return () => {
|
|
47
|
+
if (registry.get(key) === claim) registry.delete(key);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
exports.acquireBootstrapClaim = acquireBootstrapClaim;
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=bootstrapClaim.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrapClaim.cjs","names":["path"],"sources":["../../../src/builders/cli/bootstrapClaim.ts"],"sourcesContent":["import path from 'node:path';\n\n/**\n * Process-wide ownership of one repository's DoomPi load cycle.\n *\n * Pi unions the extension lists of its user and project settings scopes and\n * dedupes only by the resolved file's real path, so registering DoomPi in both\n * scopes loads two separate installs of the same package. Each one would\n * otherwise read, recompile, and rewrite the same home-scoped worktree state\n * for the same repository, and two installs at different versions disagree about the state\n * contract. A process-global symbol survives the distinct module URLs those\n * installs have, so the first factory owns the cycle and the rest stand down.\n * Pi resolves project resources before user ones, which makes the owner the\n * repository-local install whenever both scopes register the package.\n */\n\nconst BOOTSTRAP_CLAIM_KEY = Symbol.for('@agimon-ai/doompi:bootstrap-claim');\n\nexport type ReleaseBootstrapClaim = () => void;\n\n/**\n * The registry shared by every DoomPi install in this process.\n *\n * The symbol description is part of the cross-install contract and must stay\n * exactly as written: two installs only meet here when they compute the same\n * key. A value of another shape belongs to an install that spelled the\n * registry differently, so this one starts its own rather than corrupting it.\n */\nfunction claimRegistry(): Map<string, symbol> {\n const existing = Reflect.get(globalThis, BOOTSTRAP_CLAIM_KEY);\n if (existing instanceof Map) return existing as Map<string, symbol>;\n const created = new Map<string, symbol>();\n Reflect.set(globalThis, BOOTSTRAP_CLAIM_KEY, created);\n return created;\n}\n\n/**\n * Claims the load cycle for one repository, or reports that it is already owned.\n *\n * Callers must acquire before their first `await`, because releasing happens on\n * `session_start` and an interleaved second factory would otherwise slip in.\n */\nexport function acquireBootstrapClaim(repoRoot: string): ReleaseBootstrapClaim | undefined {\n const registry = claimRegistry();\n const key = path.resolve(repoRoot);\n if (registry.has(key)) return undefined;\n\n const claim = Symbol('doompi-bootstrap');\n registry.set(key, claim);\n return () => {\n if (registry.get(key) === claim) registry.delete(key);\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,MAAM,sBAAsB,OAAO,IAAI,mCAAmC;;;;;;;;;AAY1E,SAAS,gBAAqC;CAC5C,MAAM,WAAW,QAAQ,IAAI,YAAY,mBAAmB;CAC5D,IAAI,oBAAoB,KAAK,OAAO;CACpC,MAAM,0BAAU,IAAI,IAAoB;CACxC,QAAQ,IAAI,YAAY,qBAAqB,OAAO;CACpD,OAAO;AACT;;;;;;;AAQA,SAAgB,sBAAsB,UAAqD;CACzF,MAAM,WAAW,cAAc;CAC/B,MAAM,MAAMA,UAAAA,QAAK,QAAQ,QAAQ;CACjC,IAAI,SAAS,IAAI,GAAG,GAAG,OAAO,KAAA;CAE9B,MAAM,QAAQ,OAAO,kBAAkB;CACvC,SAAS,IAAI,KAAK,KAAK;CACvB,aAAa;EACX,IAAI,SAAS,IAAI,GAAG,MAAM,OAAO,SAAS,OAAO,GAAG;CACtD;AACF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
//#region src/builders/cli/bootstrapClaim.ts
|
|
3
|
+
/**
|
|
4
|
+
* Process-wide ownership of one repository's DoomPi load cycle.
|
|
5
|
+
*
|
|
6
|
+
* Pi unions the extension lists of its user and project settings scopes and
|
|
7
|
+
* dedupes only by the resolved file's real path, so registering DoomPi in both
|
|
8
|
+
* scopes loads two separate installs of the same package. Each one would
|
|
9
|
+
* otherwise read, recompile, and rewrite the same home-scoped worktree state
|
|
10
|
+
* for the same repository, and two installs at different versions disagree about the state
|
|
11
|
+
* contract. A process-global symbol survives the distinct module URLs those
|
|
12
|
+
* installs have, so the first factory owns the cycle and the rest stand down.
|
|
13
|
+
* Pi resolves project resources before user ones, which makes the owner the
|
|
14
|
+
* repository-local install whenever both scopes register the package.
|
|
15
|
+
*/
|
|
16
|
+
const BOOTSTRAP_CLAIM_KEY = Symbol.for("@agimon-ai/doompi:bootstrap-claim");
|
|
17
|
+
/**
|
|
18
|
+
* The registry shared by every DoomPi install in this process.
|
|
19
|
+
*
|
|
20
|
+
* The symbol description is part of the cross-install contract and must stay
|
|
21
|
+
* exactly as written: two installs only meet here when they compute the same
|
|
22
|
+
* key. A value of another shape belongs to an install that spelled the
|
|
23
|
+
* registry differently, so this one starts its own rather than corrupting it.
|
|
24
|
+
*/
|
|
25
|
+
function claimRegistry() {
|
|
26
|
+
const existing = Reflect.get(globalThis, BOOTSTRAP_CLAIM_KEY);
|
|
27
|
+
if (existing instanceof Map) return existing;
|
|
28
|
+
const created = /* @__PURE__ */ new Map();
|
|
29
|
+
Reflect.set(globalThis, BOOTSTRAP_CLAIM_KEY, created);
|
|
30
|
+
return created;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Claims the load cycle for one repository, or reports that it is already owned.
|
|
34
|
+
*
|
|
35
|
+
* Callers must acquire before their first `await`, because releasing happens on
|
|
36
|
+
* `session_start` and an interleaved second factory would otherwise slip in.
|
|
37
|
+
*/
|
|
38
|
+
function acquireBootstrapClaim(repoRoot) {
|
|
39
|
+
const registry = claimRegistry();
|
|
40
|
+
const key = path.resolve(repoRoot);
|
|
41
|
+
if (registry.has(key)) return void 0;
|
|
42
|
+
const claim = Symbol("doompi-bootstrap");
|
|
43
|
+
registry.set(key, claim);
|
|
44
|
+
return () => {
|
|
45
|
+
if (registry.get(key) === claim) registry.delete(key);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { acquireBootstrapClaim };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=bootstrapClaim.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrapClaim.mjs","names":[],"sources":["../../../src/builders/cli/bootstrapClaim.ts"],"sourcesContent":["import path from 'node:path';\n\n/**\n * Process-wide ownership of one repository's DoomPi load cycle.\n *\n * Pi unions the extension lists of its user and project settings scopes and\n * dedupes only by the resolved file's real path, so registering DoomPi in both\n * scopes loads two separate installs of the same package. Each one would\n * otherwise read, recompile, and rewrite the same home-scoped worktree state\n * for the same repository, and two installs at different versions disagree about the state\n * contract. A process-global symbol survives the distinct module URLs those\n * installs have, so the first factory owns the cycle and the rest stand down.\n * Pi resolves project resources before user ones, which makes the owner the\n * repository-local install whenever both scopes register the package.\n */\n\nconst BOOTSTRAP_CLAIM_KEY = Symbol.for('@agimon-ai/doompi:bootstrap-claim');\n\nexport type ReleaseBootstrapClaim = () => void;\n\n/**\n * The registry shared by every DoomPi install in this process.\n *\n * The symbol description is part of the cross-install contract and must stay\n * exactly as written: two installs only meet here when they compute the same\n * key. A value of another shape belongs to an install that spelled the\n * registry differently, so this one starts its own rather than corrupting it.\n */\nfunction claimRegistry(): Map<string, symbol> {\n const existing = Reflect.get(globalThis, BOOTSTRAP_CLAIM_KEY);\n if (existing instanceof Map) return existing as Map<string, symbol>;\n const created = new Map<string, symbol>();\n Reflect.set(globalThis, BOOTSTRAP_CLAIM_KEY, created);\n return created;\n}\n\n/**\n * Claims the load cycle for one repository, or reports that it is already owned.\n *\n * Callers must acquire before their first `await`, because releasing happens on\n * `session_start` and an interleaved second factory would otherwise slip in.\n */\nexport function acquireBootstrapClaim(repoRoot: string): ReleaseBootstrapClaim | undefined {\n const registry = claimRegistry();\n const key = path.resolve(repoRoot);\n if (registry.has(key)) return undefined;\n\n const claim = Symbol('doompi-bootstrap');\n registry.set(key, claim);\n return () => {\n if (registry.get(key) === claim) registry.delete(key);\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,sBAAsB,OAAO,IAAI,mCAAmC;;;;;;;;;AAY1E,SAAS,gBAAqC;CAC5C,MAAM,WAAW,QAAQ,IAAI,YAAY,mBAAmB;CAC5D,IAAI,oBAAoB,KAAK,OAAO;CACpC,MAAM,0BAAU,IAAI,IAAoB;CACxC,QAAQ,IAAI,YAAY,qBAAqB,OAAO;CACpD,OAAO;AACT;;;;;;;AAQA,SAAgB,sBAAsB,UAAqD;CACzF,MAAM,WAAW,cAAc;CAC/B,MAAM,MAAM,KAAK,QAAQ,QAAQ;CACjC,IAAI,SAAS,IAAI,GAAG,GAAG,OAAO,KAAA;CAE9B,MAAM,QAAQ,OAAO,kBAAkB;CACvC,SAAS,IAAI,KAAK,KAAK;CACvB,aAAa;EACX,IAAI,SAAS,IAAI,GAAG,MAAM,OAAO,SAAS,OAAO,GAAG;CACtD;AACF"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_index = require("../../../composition/repository/index.cjs");
|
|
3
|
+
const require_entryResolution = require("../entryResolution.cjs");
|
|
4
|
+
const require_index$1 = require("../../../composition/syncState/index.cjs");
|
|
5
|
+
const require_inputs = require("../../../compiler/inputs.cjs");
|
|
6
|
+
let node_fs = require("node:fs");
|
|
7
|
+
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
8
|
+
let node_path = require("node:path");
|
|
9
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
10
|
+
let _agimon_ai_doompi_core_sync_registration = require("@agimon-ai/doompi-core/sync-registration");
|
|
11
|
+
let node_os = require("node:os");
|
|
12
|
+
node_os = require_runtime.__toESM(node_os, 1);
|
|
13
|
+
let node_crypto = require("node:crypto");
|
|
14
|
+
node_crypto = require_runtime.__toESM(node_crypto, 1);
|
|
15
|
+
let _agimon_ai_doompi_core_sync_state_contract = require("@agimon-ai/doompi-core/sync-state-contract");
|
|
16
|
+
//#region src/builders/cli/bootstrapLocator/index.ts
|
|
17
|
+
const BOOTSTRAP_ENTRY_ENV = "DOOMPI_BOOTSTRAP_ENTRY";
|
|
18
|
+
const SHA256 = /^[a-f0-9]{64}$/u;
|
|
19
|
+
function isRecord(value) {
|
|
20
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
21
|
+
}
|
|
22
|
+
function stringRecord(value) {
|
|
23
|
+
if (!isRecord(value)) return {};
|
|
24
|
+
return Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[1] === "string"));
|
|
25
|
+
}
|
|
26
|
+
function canonicalPath(target) {
|
|
27
|
+
const absolute = node_path.default.resolve(target);
|
|
28
|
+
try {
|
|
29
|
+
return node_fs.default.realpathSync(absolute);
|
|
30
|
+
} catch {
|
|
31
|
+
const parent = node_path.default.dirname(absolute);
|
|
32
|
+
if (parent === absolute) return absolute;
|
|
33
|
+
return node_path.default.join(canonicalPath(parent), node_path.default.basename(absolute));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function isInside(directory, target) {
|
|
37
|
+
const relative = node_path.default.relative(canonicalPath(directory), canonicalPath(target));
|
|
38
|
+
return relative === "" || !relative.startsWith("..") && !node_path.default.isAbsolute(relative);
|
|
39
|
+
}
|
|
40
|
+
function parseFingerprints(value) {
|
|
41
|
+
if (!Array.isArray(value)) return void 0;
|
|
42
|
+
const fingerprints = value.map(require_inputs.parseInputFingerprint);
|
|
43
|
+
return fingerprints.some((fingerprint) => fingerprint === void 0) ? void 0 : fingerprints;
|
|
44
|
+
}
|
|
45
|
+
function packagedDoomEntry() {
|
|
46
|
+
return process.env[BOOTSTRAP_ENTRY_ENV] || require_entryResolution.ownEntry("composedPi");
|
|
47
|
+
}
|
|
48
|
+
function locationHasState(repoRoot, homeDirectory) {
|
|
49
|
+
return (0, _agimon_ai_doompi_core_sync_registration.readSyncRegistration)(repoRoot, homeDirectory) !== void 0;
|
|
50
|
+
}
|
|
51
|
+
/** Finds the nearest configured repository with generated Doom sync state. */
|
|
52
|
+
function findSyncedRoot(cwd, homeDirectory = node_os.default.homedir()) {
|
|
53
|
+
if (locationHasState(cwd, homeDirectory)) return canonicalPath(cwd);
|
|
54
|
+
const root = require_index.resolveDoomConfigurationRoot(cwd, homeDirectory);
|
|
55
|
+
return locationHasState(root, homeDirectory) ? canonicalPath(root) : void 0;
|
|
56
|
+
}
|
|
57
|
+
function readBootstrapState(repoRoot, homeDirectory = node_os.default.homedir()) {
|
|
58
|
+
const registration = (0, _agimon_ai_doompi_core_sync_registration.readSyncRegistration)(repoRoot, homeDirectory);
|
|
59
|
+
if (!registration) return void 0;
|
|
60
|
+
const statePath = registration.statePath;
|
|
61
|
+
const generatedDirectory = registration.generationRoot;
|
|
62
|
+
const state = require_index$1.readSyncState(repoRoot, homeDirectory);
|
|
63
|
+
if (!state) return void 0;
|
|
64
|
+
const bootstrap = typeof state.bootstrap === "string" ? state.bootstrap : void 0;
|
|
65
|
+
if (bootstrap && !isInside(generatedDirectory, bootstrap)) throw new Error(`Doom bootstrap must stay inside ${generatedDirectory}: ${bootstrap}`);
|
|
66
|
+
let precompile;
|
|
67
|
+
if (state.precompile !== void 0) {
|
|
68
|
+
const value = state.precompile;
|
|
69
|
+
if (!isRecord(value) || typeof value.version !== "number" || value.strategy !== _agimon_ai_doompi_core_sync_state_contract.BUNDLED_PRECOMPILE_STRATEGY || typeof value.bootstrapEntry !== "string" || typeof value.bootstrapManifest !== "string" || !isRecord(value.bundleManifests) || Object.values(value.bundleManifests).some((manifest) => typeof manifest !== "string")) throw new Error(`Doom sync state at ${statePath} has an invalid precompile record`);
|
|
70
|
+
precompile = {
|
|
71
|
+
version: value.version,
|
|
72
|
+
strategy: value.strategy,
|
|
73
|
+
bootstrapEntry: value.bootstrapEntry,
|
|
74
|
+
bootstrapManifest: value.bootstrapManifest,
|
|
75
|
+
bundleManifests: value.bundleManifests
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
statePath,
|
|
80
|
+
generatedDirectory,
|
|
81
|
+
bootstrap,
|
|
82
|
+
bundles: stringRecord(state.bundles),
|
|
83
|
+
precompile
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function readCompilerManifest(manifestPath, generatedDirectory) {
|
|
87
|
+
if (!isInside(generatedDirectory, manifestPath)) return void 0;
|
|
88
|
+
try {
|
|
89
|
+
const parsed = JSON.parse(node_fs.default.readFileSync(manifestPath, "utf8"));
|
|
90
|
+
if (!isRecord(parsed) || typeof parsed.output !== "string" || !Array.isArray(parsed.artifacts) || parsed.artifacts.some((artifact) => typeof artifact !== "string") || !Array.isArray(parsed.entries) || parsed.entries.some((entry) => typeof entry !== "string") || !Array.isArray(parsed.inputs) || parsed.artifactInputs !== void 0 && !Array.isArray(parsed.artifactInputs)) return;
|
|
91
|
+
const inputs = parseFingerprints(parsed.inputs);
|
|
92
|
+
const artifactInputs = parsed.artifactInputs === void 0 ? void 0 : parseFingerprints(parsed.artifactInputs);
|
|
93
|
+
if (!inputs || parsed.artifactInputs !== void 0 && !artifactInputs) return void 0;
|
|
94
|
+
const artifacts = parsed.artifacts;
|
|
95
|
+
const entries = parsed.entries;
|
|
96
|
+
if (!isInside(generatedDirectory, parsed.output) || artifacts.some((artifact) => !isInside(generatedDirectory, artifact))) return;
|
|
97
|
+
return {
|
|
98
|
+
output: parsed.output,
|
|
99
|
+
artifacts,
|
|
100
|
+
entries,
|
|
101
|
+
inputs,
|
|
102
|
+
...artifactInputs ? { artifactInputs } : {}
|
|
103
|
+
};
|
|
104
|
+
} catch {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function artifactInputsAreIntact(manifest, generatedDirectory) {
|
|
109
|
+
try {
|
|
110
|
+
if (!manifest.artifactInputs || manifest.artifactInputs.length === 0) return false;
|
|
111
|
+
const expected = new Set([manifest.output, ...manifest.artifacts].map(canonicalPath));
|
|
112
|
+
const seen = /* @__PURE__ */ new Set();
|
|
113
|
+
for (const input of manifest.artifactInputs) {
|
|
114
|
+
if (!SHA256.test(input.sha256) || !isInside(generatedDirectory, input.path)) return false;
|
|
115
|
+
const target = canonicalPath(input.path);
|
|
116
|
+
if (!expected.has(target)) return false;
|
|
117
|
+
const stat = node_fs.default.statSync(target);
|
|
118
|
+
if (!stat.isFile() || stat.size !== input.size) return false;
|
|
119
|
+
if (node_crypto.default.createHash("sha256").update(node_fs.default.readFileSync(target)).digest("hex") !== input.sha256) return false;
|
|
120
|
+
seen.add(target);
|
|
121
|
+
}
|
|
122
|
+
return seen.size === expected.size;
|
|
123
|
+
} catch {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function compilerManifestIsUsable(manifest, generatedDirectory) {
|
|
128
|
+
return artifactInputsAreIntact(manifest, generatedDirectory);
|
|
129
|
+
}
|
|
130
|
+
function compilerManifestIsFresh(manifest, generatedDirectory) {
|
|
131
|
+
return compilerManifestIsUsable(manifest, generatedDirectory) && require_inputs.inputsAreFresh(manifest.inputs);
|
|
132
|
+
}
|
|
133
|
+
function bootstrapRecord(state, expectedBootstrapEntry, requireFreshInputs) {
|
|
134
|
+
if (!state.bootstrap || !state.precompile) return void 0;
|
|
135
|
+
if (state.precompile.version !== _agimon_ai_doompi_core_sync_state_contract.PRECOMPILE_STATE_VERSION || canonicalPath(state.precompile.bootstrapEntry) !== canonicalPath(expectedBootstrapEntry)) return;
|
|
136
|
+
const record = readCompilerManifest(state.precompile.bootstrapManifest, state.generatedDirectory);
|
|
137
|
+
if (!record || !compilerManifestIsUsable(record, state.generatedDirectory) || requireFreshInputs && !compilerManifestIsFresh(record, state.generatedDirectory) || record.output !== state.bootstrap || record.entries.length !== 1 || canonicalPath(record.entries[0] ?? "") !== canonicalPath(expectedBootstrapEntry)) return;
|
|
138
|
+
return record;
|
|
139
|
+
}
|
|
140
|
+
function usableBootstrapRecord(state, expectedBootstrapEntry) {
|
|
141
|
+
return bootstrapRecord(state, expectedBootstrapEntry, false);
|
|
142
|
+
}
|
|
143
|
+
function freshBootstrapRecord(state, expectedBootstrapEntry) {
|
|
144
|
+
return bootstrapRecord(state, expectedBootstrapEntry, true);
|
|
145
|
+
}
|
|
146
|
+
/** Validates only the bootstrap graph needed before the generated bootstrap is imported. */
|
|
147
|
+
function readStartupBootstrapStatus(repoRoot, expectedBootstrapEntry, homeDirectory = node_os.default.homedir()) {
|
|
148
|
+
const state = readBootstrapState(repoRoot, homeDirectory);
|
|
149
|
+
const expected = expectedBootstrapEntry ?? packagedDoomEntry();
|
|
150
|
+
if (!state) return {
|
|
151
|
+
bootstrap: void 0,
|
|
152
|
+
fresh: false
|
|
153
|
+
};
|
|
154
|
+
return {
|
|
155
|
+
bootstrap: state.bootstrap,
|
|
156
|
+
fresh: usableBootstrapRecord(state, expected) !== void 0
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/** Validates one selected composition without touching any inactive bundle inputs. */
|
|
160
|
+
function readBundleStatus(repoRoot, compositionFingerprint, homeDirectory = node_os.default.homedir()) {
|
|
161
|
+
const state = readBootstrapState(repoRoot, homeDirectory);
|
|
162
|
+
const bundle = state?.bundles[compositionFingerprint];
|
|
163
|
+
const manifestPath = state?.precompile?.bundleManifests[compositionFingerprint];
|
|
164
|
+
if (!state || state.precompile?.version !== _agimon_ai_doompi_core_sync_state_contract.PRECOMPILE_STATE_VERSION || !bundle || !manifestPath) return {
|
|
165
|
+
bundle,
|
|
166
|
+
fresh: false
|
|
167
|
+
};
|
|
168
|
+
const manifest = readCompilerManifest(manifestPath, state.generatedDirectory);
|
|
169
|
+
return {
|
|
170
|
+
bundle,
|
|
171
|
+
fresh: Boolean(manifest && manifest.output === bundle && compilerManifestIsUsable(manifest, state.generatedDirectory))
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/** Validates the bootstrap and every bundle for `doompi sync --check` diagnostics. */
|
|
175
|
+
function readBootstrapStatus(repoRoot, expectedBootstrapEntry, homeDirectory = node_os.default.homedir()) {
|
|
176
|
+
const state = readBootstrapState(repoRoot, homeDirectory);
|
|
177
|
+
const expected = expectedBootstrapEntry ?? packagedDoomEntry();
|
|
178
|
+
if (!state?.bootstrap || !state.precompile || !freshBootstrapRecord(state, expected)) return {
|
|
179
|
+
bootstrap: state?.bootstrap,
|
|
180
|
+
fresh: false
|
|
181
|
+
};
|
|
182
|
+
const manifests = Object.values(state.precompile.bundleManifests);
|
|
183
|
+
if (new Set(manifests).size !== manifests.length) return {
|
|
184
|
+
bootstrap: state.bootstrap,
|
|
185
|
+
fresh: false
|
|
186
|
+
};
|
|
187
|
+
const fresh = Object.entries(state.bundles).every(([fingerprint, bundle]) => {
|
|
188
|
+
const manifestPath = state.precompile?.bundleManifests[fingerprint];
|
|
189
|
+
if (!manifestPath) return false;
|
|
190
|
+
const manifest = readCompilerManifest(manifestPath, state.generatedDirectory);
|
|
191
|
+
return Boolean(manifest && manifest.output === bundle && compilerManifestIsFresh(manifest, state.generatedDirectory));
|
|
192
|
+
});
|
|
193
|
+
return {
|
|
194
|
+
bootstrap: state.bootstrap,
|
|
195
|
+
fresh
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
//#endregion
|
|
199
|
+
exports.findSyncedRoot = findSyncedRoot;
|
|
200
|
+
exports.readBootstrapStatus = readBootstrapStatus;
|
|
201
|
+
exports.readBundleStatus = readBundleStatus;
|
|
202
|
+
exports.readStartupBootstrapStatus = readStartupBootstrapStatus;
|
|
203
|
+
|
|
204
|
+
//# sourceMappingURL=index.cjs.map
|