@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,119 @@
|
|
|
1
|
+
import { SyncState } from "../../composition/syncState/index.mjs";
|
|
2
|
+
import { HarnessState } from "../../composition/harnessState/index.mjs";
|
|
3
|
+
import { findSyncedRoot } from "./bootstrapLocator/index.mjs";
|
|
4
|
+
import { COMPOSED_ENV, EXTERNAL_EXTENSIONS_ENV, MUTE_ENV } from "./compositionState.mjs";
|
|
5
|
+
import { MajorModesConfig } from "@agimon-ai/doompi-config/majorModes";
|
|
6
|
+
import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
7
|
+
import { alreadyComposed as alreadyComposed$1 } from "@agimon-ai/doompi-core/child-process";
|
|
8
|
+
//#region src/builders/cli/composition.d.ts
|
|
9
|
+
export declare const DOOM_FLAGS: {
|
|
10
|
+
readonly majorMode: 'major-mode';
|
|
11
|
+
readonly domains: 'domains';
|
|
12
|
+
readonly profile: 'profile';
|
|
13
|
+
readonly mute: 'mute';
|
|
14
|
+
};
|
|
15
|
+
/** Removed flag, reported rather than ignored when a synced session passes it. */
|
|
16
|
+
export declare const REMOVED_LAYER_FLAG = "layer";
|
|
17
|
+
export interface StartupFlags {
|
|
18
|
+
majorMode?: string;
|
|
19
|
+
domains?: string[];
|
|
20
|
+
profile?: string;
|
|
21
|
+
mute: boolean;
|
|
22
|
+
/** True when the caller passed the removed `--layer` flag. */
|
|
23
|
+
removedLayer: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ComposeOutcome {
|
|
26
|
+
/** Everything that went wrong, reported once the session can show messages. */
|
|
27
|
+
problems: string[];
|
|
28
|
+
/** Config changed since the last sync, which is a prompt to re-sync. */
|
|
29
|
+
stale: boolean;
|
|
30
|
+
loaded: string[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* True when this process was handed the doom extension set on the command line.
|
|
34
|
+
*
|
|
35
|
+
* The launcher and detached Doom Team children both pass the composed list as
|
|
36
|
+
* `--extension` arguments, and Pi merges those with whatever project settings
|
|
37
|
+
* declare. Composing again here would load every extension twice, which Pi
|
|
38
|
+
* reports as each tool and flag conflicting with itself.
|
|
39
|
+
*
|
|
40
|
+
* Matching against the synced paths rather than the mere presence of
|
|
41
|
+
* `--extension` keeps an unrelated one-off, `pi -e ./debug.ts`, from silently
|
|
42
|
+
* costing the user their whole setup.
|
|
43
|
+
*/
|
|
44
|
+
export declare function extensionsProvidedExternally(argv: string[], resolved: Record<string, string>): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Opens this process's session from what sync pinned.
|
|
47
|
+
*
|
|
48
|
+
* The synced record is decoded underneath the live environment, so an inherited
|
|
49
|
+
* value still wins: a launcher run, a nested session, or a CI override is more
|
|
50
|
+
* specific than anything sync wrote. The result becomes the session's state
|
|
51
|
+
* file, which is the authority from here on; the environment it publishes is
|
|
52
|
+
* for the bash hooks and the packages that can only read one.
|
|
53
|
+
*/
|
|
54
|
+
export declare function startSyncedSession(state: SyncState, repoRoot: string, environment?: NodeJS.ProcessEnv): Promise<HarnessState>;
|
|
55
|
+
/**
|
|
56
|
+
* Reads the doom flags off the command line.
|
|
57
|
+
*
|
|
58
|
+
* Pi collects unrecognized flags for extensions but hands their values back
|
|
59
|
+
* only after every extension has loaded, which is too late to decide what to
|
|
60
|
+
* load. Parsing argv with Pi's own parser keeps the value rules identical.
|
|
61
|
+
*/
|
|
62
|
+
export declare function readStartupFlags(argv: string[]): StartupFlags;
|
|
63
|
+
/** Registers the flags so Pi accepts them and lists them in `pi --help`. */
|
|
64
|
+
export declare function registerDoomFlags(pi: Pick<ExtensionAPI, 'registerFlag'>): void;
|
|
65
|
+
/**
|
|
66
|
+
* Applies the startup flags through the same switchers the slash commands use.
|
|
67
|
+
*
|
|
68
|
+
* A bad value is collected rather than thrown: a factory that throws takes the
|
|
69
|
+
* whole doom setup down with it, which is far worse than one unapplied flag.
|
|
70
|
+
*/
|
|
71
|
+
export declare function applyStartupFlags(flags: StartupFlags, majorModesConfig: MajorModesConfig, repoRoot: string, problems: string[]): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Points harness state at a per-process directory before anything writes there.
|
|
74
|
+
*
|
|
75
|
+
* The synced directory is a baseline that every session reads; live switches
|
|
76
|
+
* materialize into this one instead, so a second session in the same repository
|
|
77
|
+
* cannot overwrite what the first is using.
|
|
78
|
+
*/
|
|
79
|
+
export declare function prepareRunDirectory(repoRoot: string, environment?: NodeJS.ProcessEnv): Promise<string>;
|
|
80
|
+
/** Removes this session's scratch directory. */
|
|
81
|
+
export declare function cleanupRunDirectory(repoRoot: string, environment?: NodeJS.ProcessEnv): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Builds the ordered list of extensions to load for the current state.
|
|
84
|
+
*
|
|
85
|
+
* Returns entries in actual Pi factory activation order. CLI argument adaptation
|
|
86
|
+
* remains a launcher concern and synchronized bundles preserve this same order.
|
|
87
|
+
*/
|
|
88
|
+
export interface ComposedRuntimeLoadPlan {
|
|
89
|
+
readonly entries: string[];
|
|
90
|
+
readonly fingerprint: string;
|
|
91
|
+
}
|
|
92
|
+
/** Builds the canonical synchronized activation plan. */
|
|
93
|
+
export declare function composeRuntimeLoadPlan(state: SyncState, harness?: HarnessState, environment?: NodeJS.ProcessEnv): Promise<ComposedRuntimeLoadPlan>;
|
|
94
|
+
/** Compatibility view for callers that only need Pi extension entries. */
|
|
95
|
+
export declare function composeLoadOrder(state: SyncState, harness?: HarnessState, environment?: NodeJS.ProcessEnv): Promise<string[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Imports each extension and hands it a source-aware view of the Pi API.
|
|
98
|
+
*
|
|
99
|
+
* Every Pi extension entry is a factory of the same shape, so one extension can
|
|
100
|
+
* activate the rest. The view delegates to the same host API while retaining the
|
|
101
|
+
* entry path for tools registered through a composed loader. Failures are per
|
|
102
|
+
* entry: one unloadable module must not cost the session everything after it.
|
|
103
|
+
*/
|
|
104
|
+
export declare function loadComposedExtensions(pi: ExtensionAPI, entries: string[], problems: string[]): Promise<string[]>;
|
|
105
|
+
export interface ComposeOptions {
|
|
106
|
+
cwd?: string;
|
|
107
|
+
argv?: string[];
|
|
108
|
+
environment?: NodeJS.ProcessEnv;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Runs the whole synced startup for one Pi session.
|
|
112
|
+
*
|
|
113
|
+
* Never throws: whatever fails is reported through the outcome so the session
|
|
114
|
+
* still starts and can say what is wrong.
|
|
115
|
+
*/
|
|
116
|
+
export declare function composeDoomSession(pi: ExtensionAPI, options?: ComposeOptions): Promise<ComposeOutcome>;
|
|
117
|
+
//#endregion
|
|
118
|
+
export { COMPOSED_ENV, EXTERNAL_EXTENSIONS_ENV, MUTE_ENV, alreadyComposed$1 as alreadyComposed, findSyncedRoot };
|
|
119
|
+
//# sourceMappingURL=composition.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition.d.mts","names":[],"sources":["../../../src/builders/cli/composition.ts"],"mappings":";;;;;;;;qBAwDa;WACX;WACA;WACA;WACA;;;qBAIW;iBAEI;EACf;EACA;EACA;EACA;;EAEA;;iBAGe;;EAEf;;EAEA;EACA;;;;;;;;;;;;;;wBA2Bc,6BAA6B,gBAAgB,UAAU;;;;;;;;;;wBAgBjD,mBACpB,OAAO,WACP,kBACA,cAAa,OAAO,aACnB,QAAQ;;;;;;;;wBA+BK,iBAAiB,iBAAiB;;wBAoBlC,kBAAkB,IAAI,KAAK;;;;;;;wBAgBrB,kBACpB,OAAO,cACP,kBAAkB,kBAClB,kBACA,qBACC;;;;;;;;wBAyCmB,oBACpB,kBACA,cAAa,OAAO,aACnB;;wBAWmB,oBACpB,kBACA,cAAa,OAAO,aACnB;;;;;;;iBAac;WACN;WACA;;;wBAIW,uBACpB,OAAO,WACP,UAAS,cACT,cAAa,OAAO,aACnB,QAAQ;;wBA2CW,iBACpB,OAAO,WACP,UAAS,cACT,cAAa,OAAO,aACnB;;;;;;;;;wBAYmB,uBACpB,IAAI,cACJ,mBACA,qBACC;iBAkCc;EACf;EACA;EACA,cAAc,OAAO;;;;;;;;wBASD,mBAAmB,IAAI,cAAc,UAAS,iBAAsB,QAAQ"}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { createHarnessSession, getHarnessState, loadHarnessState, readHarnessState, updateHarnessState } from "../../composition/harnessState/index.mjs";
|
|
2
|
+
import { PERSONA_ENTRY, packageAttribution, resolveExtensionComposition } from "./extensionAssembler/index.mjs";
|
|
3
|
+
import { computeInputsHash, createMapResolvers, readSyncState, runDirectory } from "../../composition/syncState/index.mjs";
|
|
4
|
+
import { findSyncedRoot, readBundleStatus } from "./bootstrapLocator/index.mjs";
|
|
5
|
+
import { configurePreset } from "./harnessContext.mjs";
|
|
6
|
+
import { COMPOSED_ENV, EXTERNAL_EXTENSIONS_ENV, MUTE_ENV } from "./compositionState.mjs";
|
|
7
|
+
import fs from "node:fs";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { pathToFileURL } from "node:url";
|
|
10
|
+
import { withExtensionSource } from "@agimon-ai/doompi-ui/extensionName";
|
|
11
|
+
import os from "node:os";
|
|
12
|
+
import { loadMajorModesConfig } from "@agimon-ai/doompi-config/majorModes";
|
|
13
|
+
import { parseArgs } from "@earendil-works/pi-coding-agent";
|
|
14
|
+
import { alreadyComposed, alreadyComposed as alreadyComposed$1 } from "@agimon-ai/doompi-core/child-process";
|
|
15
|
+
//#region src/builders/cli/composition.ts
|
|
16
|
+
/**
|
|
17
|
+
* The runtime half of `doom-pi sync`.
|
|
18
|
+
*
|
|
19
|
+
* Pi's own config carries a single entry, the doom-pi extension, and this is
|
|
20
|
+
* what that entry runs: hydrate the harness environment, apply the startup
|
|
21
|
+
* flags, then load the extension set the matrix selects. It runs again on every
|
|
22
|
+
* `/reload`, which is what lets `/mode` swap the set without a restart,
|
|
23
|
+
* since Pi rebuilds its extension runner from whatever a reload produced.
|
|
24
|
+
*/
|
|
25
|
+
const ENABLED_FLAG = "1";
|
|
26
|
+
const SUBAGENT_AGENT_DIRS_ENV = "PI_SUBAGENT_EXTRA_AGENT_DIRS";
|
|
27
|
+
const SUBAGENT_SKILL_DIRS_ENV = "PI_SUBAGENT_EXTRA_SKILL_DIRS";
|
|
28
|
+
const DOMAIN_SEPARATOR = ",";
|
|
29
|
+
const PRIVATE_DIRECTORY_MODE = 448;
|
|
30
|
+
const DOMAIN_APPLY_MODULE = "@agimon-ai/doompi-domain/apply";
|
|
31
|
+
const SELECTION_SWITCH_MODULE = "@agimon-ai/doompi-config/selectionSwitch";
|
|
32
|
+
const NOT_SYNCED = "doompi is configured for Pi but this repository was never synced. Run doompi sync.";
|
|
33
|
+
const UNUSABLE_STATE_MESSAGE = "doompi could not read its synchronized state. Run doompi sync.";
|
|
34
|
+
const TIMING_ENABLED = process.env.DOOMPI_TIMING === ENABLED_FLAG || process.env.PI_TIMING === ENABLED_FLAG;
|
|
35
|
+
const DOOM_FLAGS = {
|
|
36
|
+
majorMode: "major-mode",
|
|
37
|
+
domains: "domains",
|
|
38
|
+
profile: "profile",
|
|
39
|
+
mute: "mute"
|
|
40
|
+
};
|
|
41
|
+
/** Removed flag, reported rather than ignored when a synced session passes it. */
|
|
42
|
+
const REMOVED_LAYER_FLAG = "layer";
|
|
43
|
+
function message(error) {
|
|
44
|
+
return error instanceof Error ? error.message : String(error);
|
|
45
|
+
}
|
|
46
|
+
function realPath(target) {
|
|
47
|
+
try {
|
|
48
|
+
return fs.realpathSync(target);
|
|
49
|
+
} catch {
|
|
50
|
+
return path.resolve(target);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* True when this process was handed the doom extension set on the command line.
|
|
55
|
+
*
|
|
56
|
+
* The launcher and detached Doom Team children both pass the composed list as
|
|
57
|
+
* `--extension` arguments, and Pi merges those with whatever project settings
|
|
58
|
+
* declare. Composing again here would load every extension twice, which Pi
|
|
59
|
+
* reports as each tool and flag conflicting with itself.
|
|
60
|
+
*
|
|
61
|
+
* Matching against the synced paths rather than the mere presence of
|
|
62
|
+
* `--extension` keeps an unrelated one-off, `pi -e ./debug.ts`, from silently
|
|
63
|
+
* costing the user their whole setup.
|
|
64
|
+
*/
|
|
65
|
+
function extensionsProvidedExternally(argv, resolved) {
|
|
66
|
+
const { extensions } = parseArgs(argv);
|
|
67
|
+
if (!extensions || extensions.length === 0) return false;
|
|
68
|
+
const composed = new Set(Object.values(resolved).map(realPath));
|
|
69
|
+
return extensions.some((entry) => composed.has(realPath(entry)));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Opens this process's session from what sync pinned.
|
|
73
|
+
*
|
|
74
|
+
* The synced record is decoded underneath the live environment, so an inherited
|
|
75
|
+
* value still wins: a launcher run, a nested session, or a CI override is more
|
|
76
|
+
* specific than anything sync wrote. The result becomes the session's state
|
|
77
|
+
* file, which is the authority from here on; the environment it publishes is
|
|
78
|
+
* for the bash hooks and the packages that can only read one.
|
|
79
|
+
*/
|
|
80
|
+
async function startSyncedSession(state, repoRoot, environment = process.env) {
|
|
81
|
+
const directory = await prepareRunDirectory(repoRoot, environment);
|
|
82
|
+
const harness = {
|
|
83
|
+
...readHarnessState({
|
|
84
|
+
...state.env,
|
|
85
|
+
...environment
|
|
86
|
+
}),
|
|
87
|
+
...state.fileState,
|
|
88
|
+
mcpProjection: {
|
|
89
|
+
...state.fileState.mcpProjection,
|
|
90
|
+
stagingDirectory: directory
|
|
91
|
+
},
|
|
92
|
+
temporaryDirectory: directory
|
|
93
|
+
};
|
|
94
|
+
createHarnessSession(harness, {
|
|
95
|
+
directory,
|
|
96
|
+
environment
|
|
97
|
+
});
|
|
98
|
+
for (const [key, value] of Object.entries(harness.profileEnvironment)) if (environment[key] === void 0) environment[key] = value;
|
|
99
|
+
return harness;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Reads the doom flags off the command line.
|
|
103
|
+
*
|
|
104
|
+
* Pi collects unrecognized flags for extensions but hands their values back
|
|
105
|
+
* only after every extension has loaded, which is too late to decide what to
|
|
106
|
+
* load. Parsing argv with Pi's own parser keeps the value rules identical.
|
|
107
|
+
*/
|
|
108
|
+
function readStartupFlags(argv) {
|
|
109
|
+
const { unknownFlags } = parseArgs(argv);
|
|
110
|
+
const text = (name) => {
|
|
111
|
+
const value = unknownFlags.get(name);
|
|
112
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
113
|
+
};
|
|
114
|
+
const domains = text(DOOM_FLAGS.domains);
|
|
115
|
+
return {
|
|
116
|
+
majorMode: text(DOOM_FLAGS.majorMode),
|
|
117
|
+
domains: domains?.split(DOMAIN_SEPARATOR).map((name) => name.trim()).filter(Boolean),
|
|
118
|
+
profile: text(DOOM_FLAGS.profile),
|
|
119
|
+
mute: unknownFlags.get(DOOM_FLAGS.mute) !== void 0,
|
|
120
|
+
removedLayer: unknownFlags.get(REMOVED_LAYER_FLAG) !== void 0
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/** Registers the flags so Pi accepts them and lists them in `pi --help`. */
|
|
124
|
+
function registerDoomFlags(pi) {
|
|
125
|
+
pi.registerFlag(DOOM_FLAGS.majorMode, {
|
|
126
|
+
type: "string",
|
|
127
|
+
description: "Named major mode from .doom/modes.yaml"
|
|
128
|
+
});
|
|
129
|
+
pi.registerFlag(DOOM_FLAGS.domains, {
|
|
130
|
+
type: "string",
|
|
131
|
+
description: "Comma-separated content domains"
|
|
132
|
+
});
|
|
133
|
+
pi.registerFlag(DOOM_FLAGS.profile, {
|
|
134
|
+
type: "string",
|
|
135
|
+
description: "Persona and env from .doom/profiles.yaml"
|
|
136
|
+
});
|
|
137
|
+
pi.registerFlag(DOOM_FLAGS.mute, {
|
|
138
|
+
type: "boolean",
|
|
139
|
+
description: "Disable the notification extension"
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Applies the startup flags through the same switchers the slash commands use.
|
|
144
|
+
*
|
|
145
|
+
* A bad value is collected rather than thrown: a factory that throws takes the
|
|
146
|
+
* whole doom setup down with it, which is far worse than one unapplied flag.
|
|
147
|
+
*/
|
|
148
|
+
async function applyStartupFlags(flags, majorModesConfig, repoRoot, problems) {
|
|
149
|
+
if (flags.removedLayer) problems.push(`--${REMOVED_LAYER_FLAG} was replaced by --${DOOM_FLAGS.majorMode}`);
|
|
150
|
+
if (flags.majorMode) try {
|
|
151
|
+
const { applyMajorMode } = await import(SELECTION_SWITCH_MODULE);
|
|
152
|
+
applyMajorMode(majorModesConfig, flags.majorMode, getHarnessState());
|
|
153
|
+
} catch (error) {
|
|
154
|
+
problems.push(`--${DOOM_FLAGS.majorMode} ${flags.majorMode}: ${message(error)}`);
|
|
155
|
+
}
|
|
156
|
+
if (flags.domains && flags.domains.length > 0) try {
|
|
157
|
+
const { applyDomains } = await import(DOMAIN_APPLY_MODULE);
|
|
158
|
+
await applyDomains(flags.domains, getHarnessState());
|
|
159
|
+
} catch (error) {
|
|
160
|
+
problems.push(`--domains ${flags.domains.join(DOMAIN_SEPARATOR)}: ${message(error)}`);
|
|
161
|
+
}
|
|
162
|
+
if (flags.profile) try {
|
|
163
|
+
const [{ applyProfile }, { resolveProfile }] = await Promise.all([import(SELECTION_SWITCH_MODULE), import("@agimon-ai/doompi-config/profiles")]);
|
|
164
|
+
await applyProfile(resolveProfile(repoRoot, flags.profile), getHarnessState());
|
|
165
|
+
} catch (error) {
|
|
166
|
+
problems.push(`--profile ${flags.profile}: ${message(error)}`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Points harness state at a per-process directory before anything writes there.
|
|
171
|
+
*
|
|
172
|
+
* The synced directory is a baseline that every session reads; live switches
|
|
173
|
+
* materialize into this one instead, so a second session in the same repository
|
|
174
|
+
* cannot overwrite what the first is using.
|
|
175
|
+
*/
|
|
176
|
+
async function prepareRunDirectory(repoRoot, environment = process.env) {
|
|
177
|
+
const directory = runDirectory(repoRoot, process.pid, environment.HOME ?? os.homedir());
|
|
178
|
+
await fs.promises.mkdir(directory, {
|
|
179
|
+
mode: PRIVATE_DIRECTORY_MODE,
|
|
180
|
+
recursive: true
|
|
181
|
+
});
|
|
182
|
+
updateHarnessState({ temporaryDirectory: directory }, environment);
|
|
183
|
+
return directory;
|
|
184
|
+
}
|
|
185
|
+
/** Removes this session's scratch directory. */
|
|
186
|
+
async function cleanupRunDirectory(repoRoot, environment = process.env) {
|
|
187
|
+
await fs.promises.rm(runDirectory(repoRoot, process.pid, environment.HOME ?? os.homedir()), {
|
|
188
|
+
recursive: true,
|
|
189
|
+
force: true
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/** Builds the canonical synchronized activation plan. */
|
|
193
|
+
async function composeRuntimeLoadPlan(state, harness = getHarnessState(), environment = process.env) {
|
|
194
|
+
const repoRoot = harness.root ?? state.root;
|
|
195
|
+
const resolvers = createMapResolvers(state.resolved, state.compiled);
|
|
196
|
+
const context = {
|
|
197
|
+
agents: harness.agents,
|
|
198
|
+
autoStop: false,
|
|
199
|
+
preset: state.selection.preset,
|
|
200
|
+
personaEntry: resolvers.packageEntry(PERSONA_ENTRY),
|
|
201
|
+
majorMode: harness.majorMode,
|
|
202
|
+
layers: [...harness.layers],
|
|
203
|
+
majorModesConfig: loadMajorModesConfig(repoRoot),
|
|
204
|
+
resolvers
|
|
205
|
+
};
|
|
206
|
+
const composition = resolveExtensionComposition({
|
|
207
|
+
...context,
|
|
208
|
+
mute: environment[MUTE_ENV] === ENABLED_FLAG
|
|
209
|
+
});
|
|
210
|
+
updateHarnessState({
|
|
211
|
+
childExtensions: [...composition.childActivation],
|
|
212
|
+
compositionFingerprint: composition.fingerprint,
|
|
213
|
+
packageAttribution: packageAttribution(composition)
|
|
214
|
+
}, environment);
|
|
215
|
+
if (harness.agents) {
|
|
216
|
+
environment[SUBAGENT_AGENT_DIRS_ENV] = harness.agentDirectories.join(path.delimiter);
|
|
217
|
+
environment[SUBAGENT_SKILL_DIRS_ENV] = harness.skillDirectories.join(path.delimiter);
|
|
218
|
+
}
|
|
219
|
+
const entries = [...composition.parentActivation];
|
|
220
|
+
const bundle = state.bundles?.[composition.fingerprint];
|
|
221
|
+
return {
|
|
222
|
+
entries: bundle ? [bundle] : entries,
|
|
223
|
+
fingerprint: composition.fingerprint
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
/** Compatibility view for callers that only need Pi extension entries. */
|
|
227
|
+
async function composeLoadOrder(state, harness = getHarnessState(), environment = process.env) {
|
|
228
|
+
return (await composeRuntimeLoadPlan(state, harness, environment)).entries;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Imports each extension and hands it a source-aware view of the Pi API.
|
|
232
|
+
*
|
|
233
|
+
* Every Pi extension entry is a factory of the same shape, so one extension can
|
|
234
|
+
* activate the rest. The view delegates to the same host API while retaining the
|
|
235
|
+
* entry path for tools registered through a composed loader. Failures are per
|
|
236
|
+
* entry: one unloadable module must not cost the session everything after it.
|
|
237
|
+
*/
|
|
238
|
+
async function loadComposedExtensions(pi, entries, problems) {
|
|
239
|
+
const loaded = [];
|
|
240
|
+
for (const entry of entries) {
|
|
241
|
+
const importStartedAt = performance.now();
|
|
242
|
+
let module;
|
|
243
|
+
try {
|
|
244
|
+
module = await import(pathToFileURL(entry).href);
|
|
245
|
+
if (TIMING_ENABLED) process.stderr.write(`[doompi:timing] import ${(performance.now() - importStartedAt).toFixed(1)}ms ${entry}\n`);
|
|
246
|
+
} catch (error) {
|
|
247
|
+
problems.push(`${entry}: ${message(error)}`);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (typeof module.default !== "function") {
|
|
251
|
+
problems.push(`${entry}: does not export an extension factory`);
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
const factoryStartedAt = performance.now();
|
|
255
|
+
try {
|
|
256
|
+
await module.default(withExtensionSource(pi, entry));
|
|
257
|
+
if (TIMING_ENABLED) process.stderr.write(`[doompi:timing] factory ${(performance.now() - factoryStartedAt).toFixed(1)}ms ${entry}\n`);
|
|
258
|
+
loaded.push(entry);
|
|
259
|
+
} catch (error) {
|
|
260
|
+
problems.push(`${entry}: ${message(error)}`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return loaded;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Runs the whole synced startup for one Pi session.
|
|
267
|
+
*
|
|
268
|
+
* Never throws: whatever fails is reported through the outcome so the session
|
|
269
|
+
* still starts and can say what is wrong.
|
|
270
|
+
*/
|
|
271
|
+
async function composeDoomSession(pi, options = {}) {
|
|
272
|
+
const environment = options.environment ?? process.env;
|
|
273
|
+
const problems = [];
|
|
274
|
+
const homeDirectory = environment.HOME ?? os.homedir();
|
|
275
|
+
const repoRoot = findSyncedRoot(options.cwd ?? process.cwd(), homeDirectory);
|
|
276
|
+
if (!repoRoot) return {
|
|
277
|
+
problems: [NOT_SYNCED],
|
|
278
|
+
stale: false,
|
|
279
|
+
loaded: []
|
|
280
|
+
};
|
|
281
|
+
let state;
|
|
282
|
+
try {
|
|
283
|
+
state = readSyncState(repoRoot, homeDirectory);
|
|
284
|
+
} catch (error) {
|
|
285
|
+
return {
|
|
286
|
+
problems: [message(error)],
|
|
287
|
+
stale: false,
|
|
288
|
+
loaded: []
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
if (!state) return {
|
|
292
|
+
problems: [NOT_SYNCED],
|
|
293
|
+
stale: false,
|
|
294
|
+
loaded: []
|
|
295
|
+
};
|
|
296
|
+
const argv = options.argv ?? process.argv.slice(2);
|
|
297
|
+
if (environment[EXTERNAL_EXTENSIONS_ENV] === ENABLED_FLAG || extensionsProvidedExternally(argv, {
|
|
298
|
+
...state.resolved,
|
|
299
|
+
...state.bundles
|
|
300
|
+
})) return {
|
|
301
|
+
problems: [],
|
|
302
|
+
stale: false,
|
|
303
|
+
loaded: []
|
|
304
|
+
};
|
|
305
|
+
configurePreset({
|
|
306
|
+
preset: state.selection.preset,
|
|
307
|
+
piArgs: []
|
|
308
|
+
}, environment);
|
|
309
|
+
if (!alreadyComposed(environment)) {
|
|
310
|
+
environment[COMPOSED_ENV] = ENABLED_FLAG;
|
|
311
|
+
await startSyncedSession(state, repoRoot, environment);
|
|
312
|
+
const flags = readStartupFlags(argv);
|
|
313
|
+
if (flags.mute) environment[MUTE_ENV] = ENABLED_FLAG;
|
|
314
|
+
await applyStartupFlags(flags, loadMajorModesConfig(repoRoot), repoRoot, problems);
|
|
315
|
+
}
|
|
316
|
+
let loadPlan;
|
|
317
|
+
try {
|
|
318
|
+
loadPlan = await composeRuntimeLoadPlan(state, loadHarnessState(environment).state, environment);
|
|
319
|
+
} catch (error) {
|
|
320
|
+
return {
|
|
321
|
+
problems: [...problems, message(error)],
|
|
322
|
+
stale: false,
|
|
323
|
+
loaded: []
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
const selectedBundle = state.bundles?.[loadPlan.fingerprint];
|
|
327
|
+
if (selectedBundle) try {
|
|
328
|
+
const status = readBundleStatus(repoRoot, loadPlan.fingerprint, homeDirectory);
|
|
329
|
+
if (!status.fresh || status.bundle !== selectedBundle) return {
|
|
330
|
+
problems: [...problems, UNUSABLE_STATE_MESSAGE],
|
|
331
|
+
stale: false,
|
|
332
|
+
loaded: []
|
|
333
|
+
};
|
|
334
|
+
} catch {
|
|
335
|
+
return {
|
|
336
|
+
problems: [...problems, UNUSABLE_STATE_MESSAGE],
|
|
337
|
+
stale: false,
|
|
338
|
+
loaded: []
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
const loaded = await loadComposedExtensions(pi, loadPlan.entries, problems);
|
|
342
|
+
return {
|
|
343
|
+
problems,
|
|
344
|
+
stale: computeInputsHash(repoRoot, state.selection, homeDirectory) !== state.inputsHash || loadHarnessState(environment).state.majorMode === state.selection.majorMode && loadPlan.fingerprint !== state.compositionFingerprint,
|
|
345
|
+
loaded
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
//#endregion
|
|
349
|
+
export { COMPOSED_ENV, DOOM_FLAGS, EXTERNAL_EXTENSIONS_ENV, MUTE_ENV, REMOVED_LAYER_FLAG, alreadyComposed$1 as alreadyComposed, applyStartupFlags, cleanupRunDirectory, composeDoomSession, composeLoadOrder, composeRuntimeLoadPlan, extensionsProvidedExternally, findSyncedRoot, loadComposedExtensions, prepareRunDirectory, readStartupFlags, registerDoomFlags, startSyncedSession };
|
|
350
|
+
|
|
351
|
+
//# sourceMappingURL=composition.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition.mjs","names":[],"sources":["../../../src/builders/cli/composition.ts"],"sourcesContent":["import fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport { loadMajorModesConfig, type MajorModesConfig } from '@agimon-ai/doompi-config/majorModes';\nimport { alreadyComposed } from '@agimon-ai/doompi-core/child-process';\nimport { withExtensionSource } from '@agimon-ai/doompi-ui/extensionName';\nimport { type ExtensionAPI, parseArgs } from '@earendil-works/pi-coding-agent';\n\nimport {\n createHarnessSession,\n getHarnessState,\n type HarnessState,\n loadHarnessState,\n readHarnessState,\n updateHarnessState,\n} from '../../composition/harnessState';\nimport {\n computeInputsHash,\n createMapResolvers,\n readSyncState,\n runDirectory,\n type SyncState,\n} from '../../composition/syncState';\nimport type { HarnessPreset } from '../../composition/types/harness';\nimport { findSyncedRoot, readBundleStatus } from './bootstrapLocator';\nimport { COMPOSED_ENV, EXTERNAL_EXTENSIONS_ENV, MUTE_ENV } from './compositionState';\nimport { PERSONA_ENTRY, packageAttribution, resolveExtensionComposition } from './extensionAssembler';\nimport { configurePreset } from './harnessContext';\n\nexport { findSyncedRoot } from './bootstrapLocator';\nexport { alreadyComposed } from '@agimon-ai/doompi-core/child-process';\nexport { COMPOSED_ENV, EXTERNAL_EXTENSIONS_ENV, MUTE_ENV } from './compositionState';\n\n/**\n * The runtime half of `doom-pi sync`.\n *\n * Pi's own config carries a single entry, the doom-pi extension, and this is\n * what that entry runs: hydrate the harness environment, apply the startup\n * flags, then load the extension set the matrix selects. It runs again on every\n * `/reload`, which is what lets `/mode` swap the set without a restart,\n * since Pi rebuilds its extension runner from whatever a reload produced.\n */\n\nconst ENABLED_FLAG = '1';\nconst SUBAGENT_AGENT_DIRS_ENV = 'PI_SUBAGENT_EXTRA_AGENT_DIRS';\nconst SUBAGENT_SKILL_DIRS_ENV = 'PI_SUBAGENT_EXTRA_SKILL_DIRS';\nconst DOMAIN_SEPARATOR = ',';\nconst PRIVATE_DIRECTORY_MODE = 0o700;\nconst DOMAIN_APPLY_MODULE = '@agimon-ai/doompi-domain/apply';\nconst SELECTION_SWITCH_MODULE = '@agimon-ai/doompi-config/selectionSwitch';\nconst NOT_SYNCED = 'doompi is configured for Pi but this repository was never synced. Run doompi sync.';\nconst UNUSABLE_STATE_MESSAGE = 'doompi could not read its synchronized state. Run doompi sync.';\nconst TIMING_ENABLED = process.env.DOOMPI_TIMING === ENABLED_FLAG || process.env.PI_TIMING === ENABLED_FLAG;\n\nexport const DOOM_FLAGS = {\n majorMode: 'major-mode',\n domains: 'domains',\n profile: 'profile',\n mute: 'mute',\n} as const;\n\n/** Removed flag, reported rather than ignored when a synced session passes it. */\nexport const REMOVED_LAYER_FLAG = 'layer';\n\nexport interface StartupFlags {\n majorMode?: string;\n domains?: string[];\n profile?: string;\n mute: boolean;\n /** True when the caller passed the removed `--layer` flag. */\n removedLayer: boolean;\n}\n\nexport interface ComposeOutcome {\n /** Everything that went wrong, reported once the session can show messages. */\n problems: string[];\n /** Config changed since the last sync, which is a prompt to re-sync. */\n stale: boolean;\n loaded: string[];\n}\n\nfunction message(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction realPath(target: string): string {\n try {\n return fs.realpathSync(target);\n } catch {\n return path.resolve(target);\n }\n}\n\n/**\n * True when this process was handed the doom extension set on the command line.\n *\n * The launcher and detached Doom Team children both pass the composed list as\n * `--extension` arguments, and Pi merges those with whatever project settings\n * declare. Composing again here would load every extension twice, which Pi\n * reports as each tool and flag conflicting with itself.\n *\n * Matching against the synced paths rather than the mere presence of\n * `--extension` keeps an unrelated one-off, `pi -e ./debug.ts`, from silently\n * costing the user their whole setup.\n */\nexport function extensionsProvidedExternally(argv: string[], resolved: Record<string, string>): boolean {\n const { extensions } = parseArgs(argv);\n if (!extensions || extensions.length === 0) return false;\n const composed = new Set(Object.values(resolved).map(realPath));\n return extensions.some((entry) => composed.has(realPath(entry)));\n}\n\n/**\n * Opens this process's session from what sync pinned.\n *\n * The synced record is decoded underneath the live environment, so an inherited\n * value still wins: a launcher run, a nested session, or a CI override is more\n * specific than anything sync wrote. The result becomes the session's state\n * file, which is the authority from here on; the environment it publishes is\n * for the bash hooks and the packages that can only read one.\n */\nexport async function startSyncedSession(\n state: SyncState,\n repoRoot: string,\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<HarnessState> {\n const directory = await prepareRunDirectory(repoRoot, environment);\n const harness: HarnessState = {\n ...readHarnessState({ ...state.env, ...environment }),\n // Recorded separately because no variable carries them.\n ...state.fileState,\n // Every synced process gets private mutable staging. The source content\n // identity is unchanged because the projection fingerprint excludes it.\n mcpProjection: {\n ...state.fileState.mcpProjection,\n stagingDirectory: directory,\n },\n temporaryDirectory: directory,\n };\n createHarnessSession(harness, { directory, environment });\n // The profile's own defaults, which the launcher applies at spawn. They are\n // recorded as a map rather than as variables so /profile can tell which ones\n // it owns when it swaps them out later.\n for (const [key, value] of Object.entries(harness.profileEnvironment)) {\n if (environment[key] === undefined) environment[key] = value;\n }\n return harness;\n}\n\n/**\n * Reads the doom flags off the command line.\n *\n * Pi collects unrecognized flags for extensions but hands their values back\n * only after every extension has loaded, which is too late to decide what to\n * load. Parsing argv with Pi's own parser keeps the value rules identical.\n */\nexport function readStartupFlags(argv: string[]): StartupFlags {\n const { unknownFlags } = parseArgs(argv);\n const text = (name: string): string | undefined => {\n const value = unknownFlags.get(name);\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\n };\n const domains = text(DOOM_FLAGS.domains);\n return {\n majorMode: text(DOOM_FLAGS.majorMode),\n domains: domains\n ?.split(DOMAIN_SEPARATOR)\n .map((name) => name.trim())\n .filter(Boolean),\n profile: text(DOOM_FLAGS.profile),\n mute: unknownFlags.get(DOOM_FLAGS.mute) !== undefined,\n removedLayer: unknownFlags.get(REMOVED_LAYER_FLAG) !== undefined,\n };\n}\n\n/** Registers the flags so Pi accepts them and lists them in `pi --help`. */\nexport function registerDoomFlags(pi: Pick<ExtensionAPI, 'registerFlag'>): void {\n pi.registerFlag(DOOM_FLAGS.majorMode, {\n type: 'string',\n description: 'Named major mode from .doom/modes.yaml',\n });\n pi.registerFlag(DOOM_FLAGS.domains, { type: 'string', description: 'Comma-separated content domains' });\n pi.registerFlag(DOOM_FLAGS.profile, { type: 'string', description: 'Persona and env from .doom/profiles.yaml' });\n pi.registerFlag(DOOM_FLAGS.mute, { type: 'boolean', description: 'Disable the notification extension' });\n}\n\n/**\n * Applies the startup flags through the same switchers the slash commands use.\n *\n * A bad value is collected rather than thrown: a factory that throws takes the\n * whole doom setup down with it, which is far worse than one unapplied flag.\n */\nexport async function applyStartupFlags(\n flags: StartupFlags,\n majorModesConfig: MajorModesConfig,\n repoRoot: string,\n problems: string[],\n): Promise<void> {\n // Reported rather than ignored: Pi hands unrecognized flags to extensions, so\n // a stale `--layer dev` would otherwise start a session on the wrong mode\n // without saying anything.\n if (flags.removedLayer) problems.push(`--${REMOVED_LAYER_FLAG} was replaced by --${DOOM_FLAGS.majorMode}`);\n if (flags.majorMode) {\n try {\n const { applyMajorMode } = await import(SELECTION_SWITCH_MODULE);\n applyMajorMode(majorModesConfig, flags.majorMode, getHarnessState());\n } catch (error) {\n problems.push(`--${DOOM_FLAGS.majorMode} ${flags.majorMode}: ${message(error)}`);\n }\n }\n if (flags.domains && flags.domains.length > 0) {\n try {\n const { applyDomains } = await import(DOMAIN_APPLY_MODULE);\n await applyDomains(flags.domains, getHarnessState());\n } catch (error) {\n problems.push(`--domains ${flags.domains.join(DOMAIN_SEPARATOR)}: ${message(error)}`);\n }\n }\n if (flags.profile) {\n try {\n const [{ applyProfile }, { resolveProfile }] = await Promise.all([\n import(SELECTION_SWITCH_MODULE),\n import('@agimon-ai/doompi-config/profiles'),\n ]);\n await applyProfile(resolveProfile(repoRoot, flags.profile), getHarnessState());\n } catch (error) {\n problems.push(`--profile ${flags.profile}: ${message(error)}`);\n }\n }\n}\n\n/**\n * Points harness state at a per-process directory before anything writes there.\n *\n * The synced directory is a baseline that every session reads; live switches\n * materialize into this one instead, so a second session in the same repository\n * cannot overwrite what the first is using.\n */\nexport async function prepareRunDirectory(\n repoRoot: string,\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<string> {\n const directory = runDirectory(repoRoot, process.pid, environment.HOME ?? os.homedir());\n await fs.promises.mkdir(directory, { mode: PRIVATE_DIRECTORY_MODE, recursive: true });\n // Through the store rather than the environment: the state file is the\n // authority, and a switcher reading a stale directory would write a live\n // session's resources into the wrong place.\n updateHarnessState({ temporaryDirectory: directory }, environment);\n return directory;\n}\n\n/** Removes this session's scratch directory. */\nexport async function cleanupRunDirectory(\n repoRoot: string,\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<void> {\n await fs.promises.rm(runDirectory(repoRoot, process.pid, environment.HOME ?? os.homedir()), {\n recursive: true,\n force: true,\n });\n}\n\n/**\n * Builds the ordered list of extensions to load for the current state.\n *\n * Returns entries in actual Pi factory activation order. CLI argument adaptation\n * remains a launcher concern and synchronized bundles preserve this same order.\n */\nexport interface ComposedRuntimeLoadPlan {\n readonly entries: string[];\n readonly fingerprint: string;\n}\n\n/** Builds the canonical synchronized activation plan. */\nexport async function composeRuntimeLoadPlan(\n state: SyncState,\n harness: HarnessState = getHarnessState(),\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<ComposedRuntimeLoadPlan> {\n const repoRoot = harness.root ?? state.root;\n const resolvers = createMapResolvers(state.resolved, state.compiled);\n const context = {\n agents: harness.agents,\n // Exiting when the agent settles is a launcher decision with no synced\n // equivalent: a session started by hand is meant to stay open.\n autoStop: false,\n preset: state.selection.preset,\n personaEntry: resolvers.packageEntry(PERSONA_ENTRY),\n majorMode: harness.majorMode,\n layers: [...harness.layers],\n majorModesConfig: loadMajorModesConfig(repoRoot),\n resolvers,\n };\n\n // A state field, so it goes through the store: Doom Team reads it from the\n // environment the store publishes when it builds a child's spawn snapshot.\n const composition = resolveExtensionComposition({\n ...context,\n mute: environment[MUTE_ENV] === ENABLED_FLAG,\n });\n updateHarnessState(\n {\n childExtensions: [...composition.childActivation],\n compositionFingerprint: composition.fingerprint,\n packageAttribution: packageAttribution(composition),\n },\n environment,\n );\n if (harness.agents) {\n environment[SUBAGENT_AGENT_DIRS_ENV] = harness.agentDirectories.join(path.delimiter);\n environment[SUBAGENT_SKILL_DIRS_ENV] = harness.skillDirectories.join(path.delimiter);\n }\n const entries = [...composition.parentActivation];\n const bundle = state.bundles?.[composition.fingerprint];\n return {\n entries: bundle ? [bundle] : entries,\n fingerprint: composition.fingerprint,\n };\n}\n\n/** Compatibility view for callers that only need Pi extension entries. */\nexport async function composeLoadOrder(\n state: SyncState,\n harness: HarnessState = getHarnessState(),\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<string[]> {\n return (await composeRuntimeLoadPlan(state, harness, environment)).entries;\n}\n\n/**\n * Imports each extension and hands it a source-aware view of the Pi API.\n *\n * Every Pi extension entry is a factory of the same shape, so one extension can\n * activate the rest. The view delegates to the same host API while retaining the\n * entry path for tools registered through a composed loader. Failures are per\n * entry: one unloadable module must not cost the session everything after it.\n */\nexport async function loadComposedExtensions(\n pi: ExtensionAPI,\n entries: string[],\n problems: string[],\n): Promise<string[]> {\n const loaded: string[] = [];\n for (const entry of entries) {\n const importStartedAt = performance.now();\n let module: { default?: unknown };\n try {\n module = (await import(pathToFileURL(entry).href)) as { default?: unknown };\n if (TIMING_ENABLED) {\n process.stderr.write(`[doompi:timing] import ${(performance.now() - importStartedAt).toFixed(1)}ms ${entry}\\n`);\n }\n } catch (error) {\n problems.push(`${entry}: ${message(error)}`);\n continue;\n }\n if (typeof module.default !== 'function') {\n problems.push(`${entry}: does not export an extension factory`);\n continue;\n }\n const factoryStartedAt = performance.now();\n try {\n await (module.default as (api: ExtensionAPI) => void | Promise<void>)(withExtensionSource(pi, entry));\n if (TIMING_ENABLED) {\n process.stderr.write(\n `[doompi:timing] factory ${(performance.now() - factoryStartedAt).toFixed(1)}ms ${entry}\\n`,\n );\n }\n loaded.push(entry);\n } catch (error) {\n problems.push(`${entry}: ${message(error)}`);\n }\n }\n return loaded;\n}\n\nexport interface ComposeOptions {\n cwd?: string;\n argv?: string[];\n environment?: NodeJS.ProcessEnv;\n}\n\n/**\n * Runs the whole synced startup for one Pi session.\n *\n * Never throws: whatever fails is reported through the outcome so the session\n * still starts and can say what is wrong.\n */\nexport async function composeDoomSession(pi: ExtensionAPI, options: ComposeOptions = {}): Promise<ComposeOutcome> {\n const environment = options.environment ?? process.env;\n const problems: string[] = [];\n const homeDirectory = environment.HOME ?? os.homedir();\n const repoRoot = findSyncedRoot(options.cwd ?? process.cwd(), homeDirectory);\n if (!repoRoot) return { problems: [NOT_SYNCED], stale: false, loaded: [] };\n\n let state: SyncState | undefined;\n try {\n state = readSyncState(repoRoot, homeDirectory);\n } catch (error) {\n return { problems: [message(error)], stale: false, loaded: [] };\n }\n if (!state) return { problems: [NOT_SYNCED], stale: false, loaded: [] };\n\n const argv = options.argv ?? process.argv.slice(2);\n // The launcher and Doom Team children compose the set themselves and pass it\n // in, so this entry has nothing left to do but stay out of the way.\n if (\n environment[EXTERNAL_EXTENSIONS_ENV] === ENABLED_FLAG ||\n extensionsProvidedExternally(argv, { ...state.resolved, ...state.bundles })\n ) {\n return { problems: [], stale: false, loaded: [] };\n }\n\n configurePreset({ preset: state.selection.preset as HarnessPreset, piArgs: [] }, environment);\n\n // Only the first load opens a session. A reload finds the pointer this set\n // and reads the file back, which is what carries a live /domains or /profile\n // switch across the reload instead of resetting it to what sync pinned.\n if (!alreadyComposed(environment)) {\n environment[COMPOSED_ENV] = ENABLED_FLAG;\n await startSyncedSession(state, repoRoot, environment);\n const flags = readStartupFlags(argv);\n if (flags.mute) environment[MUTE_ENV] = ENABLED_FLAG;\n await applyStartupFlags(flags, loadMajorModesConfig(repoRoot), repoRoot, problems);\n }\n\n let loadPlan: ComposedRuntimeLoadPlan;\n try {\n // Read back through the store rather than from this process: the startup\n // flags may have switched the layer or the domains a moment ago, and the\n // environment being managed is not always this process's own.\n loadPlan = await composeRuntimeLoadPlan(state, loadHarnessState(environment).state, environment);\n } catch (error) {\n return { problems: [...problems, message(error)], stale: false, loaded: [] };\n }\n\n const selectedBundle = state.bundles?.[loadPlan.fingerprint];\n if (selectedBundle) {\n try {\n const status = readBundleStatus(repoRoot, loadPlan.fingerprint, homeDirectory);\n if (!status.fresh || status.bundle !== selectedBundle) {\n return { problems: [...problems, UNUSABLE_STATE_MESSAGE], stale: false, loaded: [] };\n }\n } catch {\n return { problems: [...problems, UNUSABLE_STATE_MESSAGE], stale: false, loaded: [] };\n }\n }\n\n const loaded = await loadComposedExtensions(pi, loadPlan.entries, problems);\n return {\n problems,\n stale:\n computeInputsHash(repoRoot, state.selection, homeDirectory) !== state.inputsHash ||\n (loadHarnessState(environment).state.majorMode === state.selection.majorMode &&\n loadPlan.fingerprint !== state.compositionFingerprint),\n loaded,\n };\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
let _agimon_ai_doompi_core_child_process = require("@agimon-ai/doompi-core/child-process");
|
|
2
|
+
//#region src/builders/cli/compositionState.ts
|
|
3
|
+
/** Marks a process whose extensions this module composed. */
|
|
4
|
+
const COMPOSED_ENV = _agimon_ai_doompi_core_child_process.DOOMPI_COMPOSED_ENV;
|
|
5
|
+
/** Set by the launcher when it passes one precomposed aggregate to Pi. */
|
|
6
|
+
const EXTERNAL_EXTENSIONS_ENV = _agimon_ai_doompi_core_child_process.DOOMPI_EXTENSIONS_PROVIDED_ENV;
|
|
7
|
+
/** Survives reload, where argv is re-read but the startup flags must not be. */
|
|
8
|
+
const MUTE_ENV = "DOOMPI_MUTE";
|
|
9
|
+
const COMPOSITION_CLAIM_KEY = Symbol.for("@agimon-ai/doompi:composition-claim");
|
|
10
|
+
/**
|
|
11
|
+
* Owns composition until Pi starts the freshly loaded extension runner.
|
|
12
|
+
*
|
|
13
|
+
* Pi resolves project resources before user resources, so the first DoomPi
|
|
14
|
+
* factory is the repository-local one when both scopes register the package.
|
|
15
|
+
* A process-global symbol survives distinct installed module URLs and lets that
|
|
16
|
+
* first factory own the load cycle. Releasing on `session_start` leaves a later
|
|
17
|
+
* `/reload` free to compose a new runner.
|
|
18
|
+
*/
|
|
19
|
+
function acquireCompositionClaim() {
|
|
20
|
+
if (Reflect.get(globalThis, COMPOSITION_CLAIM_KEY) !== void 0) return void 0;
|
|
21
|
+
const claim = Symbol("doompi-composition");
|
|
22
|
+
Reflect.set(globalThis, COMPOSITION_CLAIM_KEY, claim);
|
|
23
|
+
return () => {
|
|
24
|
+
if (Reflect.get(globalThis, COMPOSITION_CLAIM_KEY) === claim) Reflect.deleteProperty(globalThis, COMPOSITION_CLAIM_KEY);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.COMPOSED_ENV = COMPOSED_ENV;
|
|
29
|
+
exports.EXTERNAL_EXTENSIONS_ENV = EXTERNAL_EXTENSIONS_ENV;
|
|
30
|
+
exports.MUTE_ENV = MUTE_ENV;
|
|
31
|
+
exports.acquireCompositionClaim = acquireCompositionClaim;
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=compositionState.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compositionState.cjs","names":["DOOMPI_COMPOSED_ENV","DOOMPI_EXTENSIONS_PROVIDED_ENV"],"sources":["../../../src/builders/cli/compositionState.ts"],"sourcesContent":["import { DOOMPI_COMPOSED_ENV, DOOMPI_EXTENSIONS_PROVIDED_ENV } from '@agimon-ai/doompi-core/child-process';\n\n/** Marks a process whose extensions this module composed. */\nexport const COMPOSED_ENV = DOOMPI_COMPOSED_ENV;\n/** Set by the launcher when it passes one precomposed aggregate to Pi. */\nexport const EXTERNAL_EXTENSIONS_ENV = DOOMPI_EXTENSIONS_PROVIDED_ENV;\n/** Survives reload, where argv is re-read but the startup flags must not be. */\nexport const MUTE_ENV = 'DOOMPI_MUTE';\n\nconst COMPOSITION_CLAIM_KEY = Symbol.for('@agimon-ai/doompi:composition-claim');\n\nexport type ReleaseCompositionClaim = () => void;\n\n/**\n * Owns composition until Pi starts the freshly loaded extension runner.\n *\n * Pi resolves project resources before user resources, so the first DoomPi\n * factory is the repository-local one when both scopes register the package.\n * A process-global symbol survives distinct installed module URLs and lets that\n * first factory own the load cycle. Releasing on `session_start` leaves a later\n * `/reload` free to compose a new runner.\n */\nexport function acquireCompositionClaim(): ReleaseCompositionClaim | undefined {\n if (Reflect.get(globalThis, COMPOSITION_CLAIM_KEY) !== undefined) return undefined;\n\n const claim = Symbol('doompi-composition');\n Reflect.set(globalThis, COMPOSITION_CLAIM_KEY, claim);\n return () => {\n if (Reflect.get(globalThis, COMPOSITION_CLAIM_KEY) === claim) {\n Reflect.deleteProperty(globalThis, COMPOSITION_CLAIM_KEY);\n }\n };\n}\n"],"mappings":";;;AAGA,MAAa,eAAeA,qCAAAA;;AAE5B,MAAa,0BAA0BC,qCAAAA;;AAEvC,MAAa,WAAW;AAExB,MAAM,wBAAwB,OAAO,IAAI,qCAAqC;;;;;;;;;;AAa9E,SAAgB,0BAA+D;CAC7E,IAAI,QAAQ,IAAI,YAAY,qBAAqB,MAAM,KAAA,GAAW,OAAO,KAAA;CAEzE,MAAM,QAAQ,OAAO,oBAAoB;CACzC,QAAQ,IAAI,YAAY,uBAAuB,KAAK;CACpD,aAAa;EACX,IAAI,QAAQ,IAAI,YAAY,qBAAqB,MAAM,OACrD,QAAQ,eAAe,YAAY,qBAAqB;CAE5D;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/builders/cli/compositionState.d.ts
|
|
2
|
+
/** Marks a process whose extensions this module composed. */
|
|
3
|
+
export declare const COMPOSED_ENV = "DOOMPI_COMPOSED";
|
|
4
|
+
/** Set by the launcher when it passes one precomposed aggregate to Pi. */
|
|
5
|
+
export declare const EXTERNAL_EXTENSIONS_ENV = "DOOMPI_EXTENSIONS_PROVIDED";
|
|
6
|
+
/** Survives reload, where argv is re-read but the startup flags must not be. */
|
|
7
|
+
export declare const MUTE_ENV = "DOOMPI_MUTE";
|
|
8
|
+
//#endregion
|
|
9
|
+
//# sourceMappingURL=compositionState.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compositionState.d.cts","names":[],"sources":["../../../src/builders/cli/compositionState.ts"],"mappings":";;qBAGa;;qBAEA;;qBAEA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/builders/cli/compositionState.d.ts
|
|
2
|
+
/** Marks a process whose extensions this module composed. */
|
|
3
|
+
export declare const COMPOSED_ENV = "DOOMPI_COMPOSED";
|
|
4
|
+
/** Set by the launcher when it passes one precomposed aggregate to Pi. */
|
|
5
|
+
export declare const EXTERNAL_EXTENSIONS_ENV = "DOOMPI_EXTENSIONS_PROVIDED";
|
|
6
|
+
/** Survives reload, where argv is re-read but the startup flags must not be. */
|
|
7
|
+
export declare const MUTE_ENV = "DOOMPI_MUTE";
|
|
8
|
+
//#endregion
|
|
9
|
+
//# sourceMappingURL=compositionState.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compositionState.d.mts","names":[],"sources":["../../../src/builders/cli/compositionState.ts"],"mappings":";;qBAGa;;qBAEA;;qBAEA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DOOMPI_COMPOSED_ENV, DOOMPI_EXTENSIONS_PROVIDED_ENV } from "@agimon-ai/doompi-core/child-process";
|
|
2
|
+
//#region src/builders/cli/compositionState.ts
|
|
3
|
+
/** Marks a process whose extensions this module composed. */
|
|
4
|
+
const COMPOSED_ENV = DOOMPI_COMPOSED_ENV;
|
|
5
|
+
/** Set by the launcher when it passes one precomposed aggregate to Pi. */
|
|
6
|
+
const EXTERNAL_EXTENSIONS_ENV = DOOMPI_EXTENSIONS_PROVIDED_ENV;
|
|
7
|
+
/** Survives reload, where argv is re-read but the startup flags must not be. */
|
|
8
|
+
const MUTE_ENV = "DOOMPI_MUTE";
|
|
9
|
+
const COMPOSITION_CLAIM_KEY = Symbol.for("@agimon-ai/doompi:composition-claim");
|
|
10
|
+
/**
|
|
11
|
+
* Owns composition until Pi starts the freshly loaded extension runner.
|
|
12
|
+
*
|
|
13
|
+
* Pi resolves project resources before user resources, so the first DoomPi
|
|
14
|
+
* factory is the repository-local one when both scopes register the package.
|
|
15
|
+
* A process-global symbol survives distinct installed module URLs and lets that
|
|
16
|
+
* first factory own the load cycle. Releasing on `session_start` leaves a later
|
|
17
|
+
* `/reload` free to compose a new runner.
|
|
18
|
+
*/
|
|
19
|
+
function acquireCompositionClaim() {
|
|
20
|
+
if (Reflect.get(globalThis, COMPOSITION_CLAIM_KEY) !== void 0) return void 0;
|
|
21
|
+
const claim = Symbol("doompi-composition");
|
|
22
|
+
Reflect.set(globalThis, COMPOSITION_CLAIM_KEY, claim);
|
|
23
|
+
return () => {
|
|
24
|
+
if (Reflect.get(globalThis, COMPOSITION_CLAIM_KEY) === claim) Reflect.deleteProperty(globalThis, COMPOSITION_CLAIM_KEY);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { COMPOSED_ENV, EXTERNAL_EXTENSIONS_ENV, MUTE_ENV, acquireCompositionClaim };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=compositionState.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compositionState.mjs","names":[],"sources":["../../../src/builders/cli/compositionState.ts"],"sourcesContent":["import { DOOMPI_COMPOSED_ENV, DOOMPI_EXTENSIONS_PROVIDED_ENV } from '@agimon-ai/doompi-core/child-process';\n\n/** Marks a process whose extensions this module composed. */\nexport const COMPOSED_ENV = DOOMPI_COMPOSED_ENV;\n/** Set by the launcher when it passes one precomposed aggregate to Pi. */\nexport const EXTERNAL_EXTENSIONS_ENV = DOOMPI_EXTENSIONS_PROVIDED_ENV;\n/** Survives reload, where argv is re-read but the startup flags must not be. */\nexport const MUTE_ENV = 'DOOMPI_MUTE';\n\nconst COMPOSITION_CLAIM_KEY = Symbol.for('@agimon-ai/doompi:composition-claim');\n\nexport type ReleaseCompositionClaim = () => void;\n\n/**\n * Owns composition until Pi starts the freshly loaded extension runner.\n *\n * Pi resolves project resources before user resources, so the first DoomPi\n * factory is the repository-local one when both scopes register the package.\n * A process-global symbol survives distinct installed module URLs and lets that\n * first factory own the load cycle. Releasing on `session_start` leaves a later\n * `/reload` free to compose a new runner.\n */\nexport function acquireCompositionClaim(): ReleaseCompositionClaim | undefined {\n if (Reflect.get(globalThis, COMPOSITION_CLAIM_KEY) !== undefined) return undefined;\n\n const claim = Symbol('doompi-composition');\n Reflect.set(globalThis, COMPOSITION_CLAIM_KEY, claim);\n return () => {\n if (Reflect.get(globalThis, COMPOSITION_CLAIM_KEY) === claim) {\n Reflect.deleteProperty(globalThis, COMPOSITION_CLAIM_KEY);\n }\n };\n}\n"],"mappings":";;;AAGA,MAAa,eAAe;;AAE5B,MAAa,0BAA0B;;AAEvC,MAAa,WAAW;AAExB,MAAM,wBAAwB,OAAO,IAAI,qCAAqC;;;;;;;;;;AAa9E,SAAgB,0BAA+D;CAC7E,IAAI,QAAQ,IAAI,YAAY,qBAAqB,MAAM,KAAA,GAAW,OAAO,KAAA;CAEzE,MAAM,QAAQ,OAAO,oBAAoB;CACzC,QAAQ,IAAI,YAAY,uBAAuB,KAAK;CACpD,aAAa;EACX,IAAI,QAAQ,IAAI,YAAY,qBAAqB,MAAM,OACrD,QAAQ,eAAe,YAAY,qBAAqB;CAE5D;AACF"}
|