@agimon-ai/po 0.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +755 -0
- package/assets/banner.png +0 -0
- package/assets/banner.svg +25 -0
- package/assets/favicon.svg +15 -0
- package/assets/logo-light.png +0 -0
- package/assets/logo-light.svg +25 -0
- package/assets/logo.png +0 -0
- package/assets/logo.svg +25 -0
- package/assets/mascot.png +0 -0
- package/assets/mascot.svg +25 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/antigravity.cjs +5 -0
- package/dist/antigravity.d.mts +2 -0
- package/dist/antigravity.mjs +2 -0
- package/dist/apiContracts.cjs +11 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +52 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +7 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/baseCommand.cjs +3 -0
- package/dist/baseCommand.d.mts +2 -0
- package/dist/baseCommand.mjs +2 -0
- package/dist/bin/cli.cjs +24 -0
- package/dist/bin/cli.cjs.map +1 -0
- package/dist/bin/cli.d.mts +1 -0
- package/dist/bin/cli.mjs +25 -0
- package/dist/bin/cli.mjs.map +1 -0
- package/dist/bin/doomRunner.cjs +33 -0
- package/dist/bin/doomRunner.cjs.map +1 -0
- package/dist/bin/doomRunner.d.mts +4 -0
- package/dist/bin/doomRunner.d.mts.map +1 -0
- package/dist/bin/doomRunner.mjs +32 -0
- package/dist/bin/doomRunner.mjs.map +1 -0
- package/dist/bin/serve.cjs +30 -0
- package/dist/bin/serve.cjs.map +1 -0
- package/dist/bin/serve.d.mts +1 -0
- package/dist/bin/serve.mjs +31 -0
- package/dist/bin/serve.mjs.map +1 -0
- package/dist/builders/cli/extensionAssembler/index.cjs +342 -0
- package/dist/builders/cli/extensionAssembler/index.cjs.map +1 -0
- package/dist/builders/cli/extensionAssembler/index.d.mts +85 -0
- package/dist/builders/cli/extensionAssembler/index.d.mts.map +1 -0
- package/dist/builders/cli/extensionAssembler/index.mjs +335 -0
- package/dist/builders/cli/extensionAssembler/index.mjs.map +1 -0
- package/dist/catalog/index.json +430 -0
- package/dist/cli.cjs +28 -0
- package/dist/cli.d.mts +11 -0
- package/dist/cli.mjs +11 -0
- package/dist/cliApp.cjs +6 -0
- package/dist/cliApp.d.mts +2 -0
- package/dist/cliApp.mjs +2 -0
- package/dist/codex.cjs +8 -0
- package/dist/codex.d.mts +2 -0
- package/dist/codex.mjs +2 -0
- package/dist/commands.cjs +18 -0
- package/dist/commands.d.mts +9 -0
- package/dist/commands.mjs +9 -0
- package/dist/compatibility.cjs +27 -0
- package/dist/compatibility.d.mts +6 -0
- package/dist/compatibility.mjs +6 -0
- package/dist/compatibilityCommand.cjs +4 -0
- package/dist/compatibilityCommand.d.mts +2 -0
- package/dist/compatibilityCommand.mjs +2 -0
- package/dist/compatibilityContext.cjs +3 -0
- package/dist/compatibilityContext.d.mts +2 -0
- package/dist/compatibilityContext.mjs +2 -0
- package/dist/compatibilityOptions.cjs +5 -0
- package/dist/compatibilityOptions.d.mts +2 -0
- package/dist/compatibilityOptions.mjs +2 -0
- package/dist/config.cjs +163 -0
- package/dist/config.d.mts +7 -0
- package/dist/config.mjs +7 -0
- package/dist/doctorCommand.cjs +5 -0
- package/dist/doctorCommand.d.mts +2 -0
- package/dist/doctorCommand.mjs +2 -0
- package/dist/emitMcpCommand.cjs +4 -0
- package/dist/emitMcpCommand.d.mts +2 -0
- package/dist/emitMcpCommand.mjs +2 -0
- package/dist/explainCommand.cjs +5 -0
- package/dist/explainCommand.d.mts +2 -0
- package/dist/explainCommand.mjs +2 -0
- package/dist/extensions/server.cjs +39 -0
- package/dist/extensions/server.cjs.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 +34 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/harnessContext.cjs +5 -0
- package/dist/harnessContext.d.mts +2 -0
- package/dist/harnessContext.mjs +2 -0
- package/dist/harnessState.cjs +19 -0
- package/dist/harnessState.d.mts +2 -0
- package/dist/harnessState.mjs +2 -0
- package/dist/help.cjs +12 -0
- package/dist/help.d.mts +6 -0
- package/dist/help.mjs +6 -0
- package/dist/index.cjs +306 -0
- package/dist/index.d.mts +40 -0
- package/dist/index.mjs +37 -0
- package/dist/initCommand.cjs +4 -0
- package/dist/initCommand.d.mts +2 -0
- package/dist/initCommand.mjs +2 -0
- package/dist/matrixOptions.cjs +28 -0
- package/dist/matrixOptions.d.mts +2 -0
- package/dist/matrixOptions.mjs +2 -0
- package/dist/matrixSwitcher.cjs +11 -0
- package/dist/matrixSwitcher.d.mts +3 -0
- package/dist/matrixSwitcher.mjs +3 -0
- package/dist/mcpFilter.cjs +9 -0
- package/dist/mcpFilter.d.mts +1 -0
- package/dist/mcpFilter.mjs +2 -0
- package/dist/options.cjs +3 -0
- package/dist/options.d.mts +2 -0
- package/dist/options.mjs +2 -0
- package/dist/process.cjs +12 -0
- package/dist/process.d.mts +2 -0
- package/dist/process.mjs +2 -0
- package/dist/projectTrust.cjs +6 -0
- package/dist/projectTrust.d.mts +2 -0
- package/dist/projectTrust.mjs +2 -0
- package/dist/repository.cjs +5 -0
- package/dist/repository.d.mts +2 -0
- package/dist/repository.mjs +2 -0
- package/dist/resourceCollector.cjs +9 -0
- package/dist/resourceCollector.d.mts +1 -0
- package/dist/resourceCollector.mjs +2 -0
- package/dist/router.cjs +6 -0
- package/dist/router.d.mts +2 -0
- package/dist/router.mjs +2 -0
- package/dist/services.cjs +97 -0
- package/dist/services.d.mts +12 -0
- package/dist/services.mjs +12 -0
- package/dist/shared.cjs +18 -0
- package/dist/shared.d.mts +2 -0
- package/dist/shared.mjs +2 -0
- package/dist/src/bin/agentDirectory.cjs +27 -0
- package/dist/src/bin/agentDirectory.cjs.map +1 -0
- package/dist/src/bin/agentDirectory.mjs +26 -0
- package/dist/src/bin/agentDirectory.mjs.map +1 -0
- package/dist/src/builders/apiContractExport/index.cjs +126 -0
- package/dist/src/builders/apiContractExport/index.cjs.map +1 -0
- package/dist/src/builders/apiContractExport/index.mjs +123 -0
- package/dist/src/builders/apiContractExport/index.mjs.map +1 -0
- package/dist/src/builders/cli/entryResolution.cjs +39 -0
- package/dist/src/builders/cli/entryResolution.cjs.map +1 -0
- package/dist/src/builders/cli/entryResolution.mjs +35 -0
- package/dist/src/builders/cli/entryResolution.mjs.map +1 -0
- package/dist/src/builders/cli/harnessContext.cjs +175 -0
- package/dist/src/builders/cli/harnessContext.cjs.map +1 -0
- package/dist/src/builders/cli/harnessContext.d.mts +48 -0
- package/dist/src/builders/cli/harnessContext.d.mts.map +1 -0
- package/dist/src/builders/cli/harnessContext.mjs +167 -0
- package/dist/src/builders/cli/harnessContext.mjs.map +1 -0
- package/dist/src/builders/cli/sessionComposition.cjs +27 -0
- package/dist/src/builders/cli/sessionComposition.cjs.map +1 -0
- package/dist/src/builders/cli/sessionComposition.mjs +26 -0
- package/dist/src/builders/cli/sessionComposition.mjs.map +1 -0
- package/dist/src/builders/hooks/index.cjs +238 -0
- package/dist/src/builders/hooks/index.cjs.map +1 -0
- package/dist/src/builders/hooks/index.mjs +231 -0
- package/dist/src/builders/hooks/index.mjs.map +1 -0
- package/dist/src/builders/native/index.cjs +176 -0
- package/dist/src/builders/native/index.cjs.map +1 -0
- package/dist/src/builders/native/index.d.mts +36 -0
- package/dist/src/builders/native/index.d.mts.map +1 -0
- package/dist/src/builders/native/index.mjs +170 -0
- package/dist/src/builders/native/index.mjs.map +1 -0
- package/dist/src/builders/server/backgroundSync.cjs +333 -0
- package/dist/src/builders/server/backgroundSync.cjs.map +1 -0
- package/dist/src/builders/server/backgroundSync.mjs +320 -0
- package/dist/src/builders/server/backgroundSync.mjs.map +1 -0
- package/dist/src/builders/server/computerUseBinding.cjs +273 -0
- package/dist/src/builders/server/computerUseBinding.cjs.map +1 -0
- package/dist/src/builders/server/computerUseBinding.mjs +269 -0
- package/dist/src/builders/server/computerUseBinding.mjs.map +1 -0
- package/dist/src/builders/server/computerUseRecordings.cjs +188 -0
- package/dist/src/builders/server/computerUseRecordings.cjs.map +1 -0
- package/dist/src/builders/server/computerUseRecordings.mjs +184 -0
- package/dist/src/builders/server/computerUseRecordings.mjs.map +1 -0
- package/dist/src/builders/server/defaultWorkspace.cjs +38 -0
- package/dist/src/builders/server/defaultWorkspace.cjs.map +1 -0
- package/dist/src/builders/server/defaultWorkspace.mjs +35 -0
- package/dist/src/builders/server/defaultWorkspace.mjs.map +1 -0
- package/dist/src/builders/server/idleRestart.cjs +149 -0
- package/dist/src/builders/server/idleRestart.cjs.map +1 -0
- package/dist/src/builders/server/idleRestart.mjs +136 -0
- package/dist/src/builders/server/idleRestart.mjs.map +1 -0
- package/dist/src/builders/server/index.cjs +63 -0
- package/dist/src/builders/server/index.cjs.map +1 -0
- package/dist/src/builders/server/index.mjs +60 -0
- package/dist/src/builders/server/index.mjs.map +1 -0
- package/dist/src/builders/server/logSink.cjs +57 -0
- package/dist/src/builders/server/logSink.cjs.map +1 -0
- package/dist/src/builders/server/logSink.mjs +57 -0
- package/dist/src/builders/server/logSink.mjs.map +1 -0
- package/dist/src/builders/server/mcpApp.cjs +152 -0
- package/dist/src/builders/server/mcpApp.cjs.map +1 -0
- package/dist/src/builders/server/mcpApp.d.mts +18 -0
- package/dist/src/builders/server/mcpApp.d.mts.map +1 -0
- package/dist/src/builders/server/mcpApp.mjs +147 -0
- package/dist/src/builders/server/mcpApp.mjs.map +1 -0
- package/dist/src/builders/server/mcpAppBuild.cjs +111 -0
- package/dist/src/builders/server/mcpAppBuild.cjs.map +1 -0
- package/dist/src/builders/server/mcpAppBuild.d.mts +24 -0
- package/dist/src/builders/server/mcpAppBuild.d.mts.map +1 -0
- package/dist/src/builders/server/mcpAppBuild.mjs +105 -0
- package/dist/src/builders/server/mcpAppBuild.mjs.map +1 -0
- package/dist/src/builders/server/mcpBundle.cjs +87 -0
- package/dist/src/builders/server/mcpBundle.cjs.map +1 -0
- package/dist/src/builders/server/mcpBundle.d.mts +23 -0
- package/dist/src/builders/server/mcpBundle.d.mts.map +1 -0
- package/dist/src/builders/server/mcpBundle.mjs +84 -0
- package/dist/src/builders/server/mcpBundle.mjs.map +1 -0
- package/dist/src/builders/server/packageReloadCheck.cjs +62 -0
- package/dist/src/builders/server/packageReloadCheck.cjs.map +1 -0
- package/dist/src/builders/server/packageReloadCheck.mjs +61 -0
- package/dist/src/builders/server/packageReloadCheck.mjs.map +1 -0
- package/dist/src/builders/server/packageUrl.cjs +210 -0
- package/dist/src/builders/server/packageUrl.cjs.map +1 -0
- package/dist/src/builders/server/packageUrl.mjs +203 -0
- package/dist/src/builders/server/packageUrl.mjs.map +1 -0
- package/dist/src/builders/server/runtime.cjs +1428 -0
- package/dist/src/builders/server/runtime.cjs.map +1 -0
- package/dist/src/builders/server/runtime.mjs +1420 -0
- package/dist/src/builders/server/runtime.mjs.map +1 -0
- package/dist/src/builders/server/runtimeResources.cjs +72 -0
- package/dist/src/builders/server/runtimeResources.cjs.map +1 -0
- package/dist/src/builders/server/runtimeResources.mjs +71 -0
- package/dist/src/builders/server/runtimeResources.mjs.map +1 -0
- package/dist/src/builders/server/selectionStatus.cjs +12 -0
- package/dist/src/builders/server/selectionStatus.cjs.map +1 -0
- package/dist/src/builders/server/selectionStatus.mjs +12 -0
- package/dist/src/builders/server/selectionStatus.mjs.map +1 -0
- package/dist/src/builders/server/sessionArguments.cjs +63 -0
- package/dist/src/builders/server/sessionArguments.cjs.map +1 -0
- package/dist/src/builders/server/sessionArguments.mjs +62 -0
- package/dist/src/builders/server/sessionArguments.mjs.map +1 -0
- package/dist/src/builders/server/shutdown.cjs +16 -0
- package/dist/src/builders/server/shutdown.cjs.map +1 -0
- package/dist/src/builders/server/shutdown.mjs +16 -0
- package/dist/src/builders/server/shutdown.mjs.map +1 -0
- package/dist/src/builders/server/webTemplateDecision.cjs +34 -0
- package/dist/src/builders/server/webTemplateDecision.cjs.map +1 -0
- package/dist/src/builders/server/webTemplateDecision.mjs +32 -0
- package/dist/src/builders/server/webTemplateDecision.mjs.map +1 -0
- package/dist/src/builders/server/workspaceCheckout.cjs +31 -0
- package/dist/src/builders/server/workspaceCheckout.cjs.map +1 -0
- package/dist/src/builders/server/workspaceCheckout.mjs +29 -0
- package/dist/src/builders/server/workspaceCheckout.mjs.map +1 -0
- package/dist/src/builders/web/bundle.cjs +225 -0
- package/dist/src/builders/web/bundle.cjs.map +1 -0
- package/dist/src/builders/web/bundle.d.mts +65 -0
- package/dist/src/builders/web/bundle.d.mts.map +1 -0
- package/dist/src/builders/web/bundle.mjs +221 -0
- package/dist/src/builders/web/bundle.mjs.map +1 -0
- package/dist/src/builders/web/bundleAssetPolicy.cjs +96 -0
- package/dist/src/builders/web/bundleAssetPolicy.cjs.map +1 -0
- package/dist/src/builders/web/bundleAssetPolicy.d.mts +22 -0
- package/dist/src/builders/web/bundleAssetPolicy.d.mts.map +1 -0
- package/dist/src/builders/web/bundleAssetPolicy.mjs +95 -0
- package/dist/src/builders/web/bundleAssetPolicy.mjs.map +1 -0
- package/dist/src/builders/web/index.cjs +361 -0
- package/dist/src/builders/web/index.cjs.map +1 -0
- package/dist/src/builders/web/index.d.mts +109 -0
- package/dist/src/builders/web/index.d.mts.map +1 -0
- package/dist/src/builders/web/index.mjs +342 -0
- package/dist/src/builders/web/index.mjs.map +1 -0
- package/dist/src/builders/web/webDevRoots.cjs +27 -0
- package/dist/src/builders/web/webDevRoots.cjs.map +1 -0
- package/dist/src/builders/web/webDevRoots.d.mts +22 -0
- package/dist/src/builders/web/webDevRoots.d.mts.map +1 -0
- package/dist/src/builders/web/webDevRoots.mjs +25 -0
- package/dist/src/builders/web/webDevRoots.mjs.map +1 -0
- package/dist/src/builders/web/webPluginGenerate.cjs +188 -0
- package/dist/src/builders/web/webPluginGenerate.cjs.map +1 -0
- package/dist/src/builders/web/webPluginGenerate.d.mts +56 -0
- package/dist/src/builders/web/webPluginGenerate.d.mts.map +1 -0
- package/dist/src/builders/web/webPluginGenerate.mjs +178 -0
- package/dist/src/builders/web/webPluginGenerate.mjs.map +1 -0
- package/dist/src/builders/web/webPluginManifest.cjs +128 -0
- package/dist/src/builders/web/webPluginManifest.cjs.map +1 -0
- package/dist/src/builders/web/webPluginManifest.d.mts +64 -0
- package/dist/src/builders/web/webPluginManifest.d.mts.map +1 -0
- package/dist/src/builders/web/webPluginManifest.mjs +118 -0
- package/dist/src/builders/web/webPluginManifest.mjs.map +1 -0
- package/dist/src/builders/web/webPluginScan.cjs +57 -0
- package/dist/src/builders/web/webPluginScan.cjs.map +1 -0
- package/dist/src/builders/web/webPluginScan.d.mts +19 -0
- package/dist/src/builders/web/webPluginScan.d.mts.map +1 -0
- package/dist/src/builders/web/webPluginScan.mjs +54 -0
- package/dist/src/builders/web/webPluginScan.mjs.map +1 -0
- package/dist/src/builders/web/webPluginVite.cjs +255 -0
- package/dist/src/builders/web/webPluginVite.cjs.map +1 -0
- package/dist/src/builders/web/webPluginVite.d.mts +64 -0
- package/dist/src/builders/web/webPluginVite.d.mts.map +1 -0
- package/dist/src/builders/web/webPluginVite.mjs +242 -0
- package/dist/src/builders/web/webPluginVite.mjs.map +1 -0
- package/dist/src/cli/cliApp.cjs +187 -0
- package/dist/src/cli/cliApp.cjs.map +1 -0
- package/dist/src/cli/cliApp.d.mts +32 -0
- package/dist/src/cli/cliApp.d.mts.map +1 -0
- package/dist/src/cli/cliApp.mjs +184 -0
- package/dist/src/cli/cliApp.mjs.map +1 -0
- package/dist/src/cli/commands/api-export/index.cjs +66 -0
- package/dist/src/cli/commands/api-export/index.cjs.map +1 -0
- package/dist/src/cli/commands/api-export/index.mjs +62 -0
- package/dist/src/cli/commands/api-export/index.mjs.map +1 -0
- package/dist/src/cli/commands/baseCommand.cjs +16 -0
- package/dist/src/cli/commands/baseCommand.cjs.map +1 -0
- package/dist/src/cli/commands/baseCommand.d.mts +24 -0
- package/dist/src/cli/commands/baseCommand.d.mts.map +1 -0
- package/dist/src/cli/commands/baseCommand.mjs +16 -0
- package/dist/src/cli/commands/baseCommand.mjs.map +1 -0
- package/dist/src/cli/commands/compat/context.cjs +115 -0
- package/dist/src/cli/commands/compat/context.cjs.map +1 -0
- package/dist/src/cli/commands/compat/context.d.mts +22 -0
- package/dist/src/cli/commands/compat/context.d.mts.map +1 -0
- package/dist/src/cli/commands/compat/context.mjs +110 -0
- package/dist/src/cli/commands/compat/context.mjs.map +1 -0
- package/dist/src/cli/commands/compat/help.cjs +26 -0
- package/dist/src/cli/commands/compat/help.cjs.map +1 -0
- package/dist/src/cli/commands/compat/help.d.mts +4 -0
- package/dist/src/cli/commands/compat/help.d.mts.map +1 -0
- package/dist/src/cli/commands/compat/help.mjs +25 -0
- package/dist/src/cli/commands/compat/help.mjs.map +1 -0
- package/dist/src/cli/commands/compat/index.cjs +73 -0
- package/dist/src/cli/commands/compat/index.cjs.map +1 -0
- package/dist/src/cli/commands/compat/index.d.mts +14 -0
- package/dist/src/cli/commands/compat/index.d.mts.map +1 -0
- package/dist/src/cli/commands/compat/index.mjs +70 -0
- package/dist/src/cli/commands/compat/index.mjs.map +1 -0
- package/dist/src/cli/commands/compat/options.cjs +88 -0
- package/dist/src/cli/commands/compat/options.cjs.map +1 -0
- package/dist/src/cli/commands/compat/options.d.mts +15 -0
- package/dist/src/cli/commands/compat/options.d.mts.map +1 -0
- package/dist/src/cli/commands/compat/options.mjs +86 -0
- package/dist/src/cli/commands/compat/options.mjs.map +1 -0
- package/dist/src/cli/commands/compat/providers/antigravity.cjs +294 -0
- package/dist/src/cli/commands/compat/providers/antigravity.cjs.map +1 -0
- package/dist/src/cli/commands/compat/providers/antigravity.d.mts +9 -0
- package/dist/src/cli/commands/compat/providers/antigravity.d.mts.map +1 -0
- package/dist/src/cli/commands/compat/providers/antigravity.mjs +289 -0
- package/dist/src/cli/commands/compat/providers/antigravity.mjs.map +1 -0
- package/dist/src/cli/commands/compat/providers/codex.cjs +178 -0
- package/dist/src/cli/commands/compat/providers/codex.cjs.map +1 -0
- package/dist/src/cli/commands/compat/providers/codex.d.mts +17 -0
- package/dist/src/cli/commands/compat/providers/codex.d.mts.map +1 -0
- package/dist/src/cli/commands/compat/providers/codex.mjs +170 -0
- package/dist/src/cli/commands/compat/providers/codex.mjs.map +1 -0
- package/dist/src/cli/commands/compat/providers/index.cjs +65 -0
- package/dist/src/cli/commands/compat/providers/index.cjs.map +1 -0
- package/dist/src/cli/commands/compat/providers/index.d.mts +15 -0
- package/dist/src/cli/commands/compat/providers/index.d.mts.map +1 -0
- package/dist/src/cli/commands/compat/providers/index.mjs +45 -0
- package/dist/src/cli/commands/compat/providers/index.mjs.map +1 -0
- package/dist/src/cli/commands/compat/providers/process.cjs +172 -0
- package/dist/src/cli/commands/compat/providers/process.cjs.map +1 -0
- package/dist/src/cli/commands/compat/providers/process.d.mts +33 -0
- package/dist/src/cli/commands/compat/providers/process.d.mts.map +1 -0
- package/dist/src/cli/commands/compat/providers/process.mjs +159 -0
- package/dist/src/cli/commands/compat/providers/process.mjs.map +1 -0
- package/dist/src/cli/commands/compat/providers/shared.cjs +76 -0
- package/dist/src/cli/commands/compat/providers/shared.cjs.map +1 -0
- package/dist/src/cli/commands/compat/providers/shared.d.mts +40 -0
- package/dist/src/cli/commands/compat/providers/shared.d.mts.map +1 -0
- package/dist/src/cli/commands/compat/providers/shared.mjs +61 -0
- package/dist/src/cli/commands/compat/providers/shared.mjs.map +1 -0
- package/dist/src/cli/commands/compat/types.d.mts +31 -0
- package/dist/src/cli/commands/compat/types.d.mts.map +1 -0
- package/dist/src/cli/commands/doctor/help.cjs +19 -0
- package/dist/src/cli/commands/doctor/help.cjs.map +1 -0
- package/dist/src/cli/commands/doctor/help.d.mts +4 -0
- package/dist/src/cli/commands/doctor/help.d.mts.map +1 -0
- package/dist/src/cli/commands/doctor/help.mjs +19 -0
- package/dist/src/cli/commands/doctor/help.mjs.map +1 -0
- package/dist/src/cli/commands/doctor/index.cjs +118 -0
- package/dist/src/cli/commands/doctor/index.cjs.map +1 -0
- package/dist/src/cli/commands/doctor/index.d.mts +33 -0
- package/dist/src/cli/commands/doctor/index.d.mts.map +1 -0
- package/dist/src/cli/commands/doctor/index.mjs +113 -0
- package/dist/src/cli/commands/doctor/index.mjs.map +1 -0
- package/dist/src/cli/commands/emit-mcp/index.cjs +32 -0
- package/dist/src/cli/commands/emit-mcp/index.cjs.map +1 -0
- package/dist/src/cli/commands/emit-mcp/index.d.mts +19 -0
- package/dist/src/cli/commands/emit-mcp/index.d.mts.map +1 -0
- package/dist/src/cli/commands/emit-mcp/index.mjs +31 -0
- package/dist/src/cli/commands/emit-mcp/index.mjs.map +1 -0
- package/dist/src/cli/commands/explain/index.cjs +155 -0
- package/dist/src/cli/commands/explain/index.cjs.map +1 -0
- package/dist/src/cli/commands/explain/index.d.mts +57 -0
- package/dist/src/cli/commands/explain/index.d.mts.map +1 -0
- package/dist/src/cli/commands/explain/index.mjs +150 -0
- package/dist/src/cli/commands/explain/index.mjs.map +1 -0
- package/dist/src/cli/commands/init/constants.cjs +11 -0
- package/dist/src/cli/commands/init/constants.cjs.map +1 -0
- package/dist/src/cli/commands/init/constants.mjs +11 -0
- package/dist/src/cli/commands/init/constants.mjs.map +1 -0
- package/dist/src/cli/commands/init/help.cjs +17 -0
- package/dist/src/cli/commands/init/help.cjs.map +1 -0
- package/dist/src/cli/commands/init/help.d.mts +4 -0
- package/dist/src/cli/commands/init/help.d.mts.map +1 -0
- package/dist/src/cli/commands/init/help.mjs +17 -0
- package/dist/src/cli/commands/init/help.mjs.map +1 -0
- package/dist/src/cli/commands/init/index.cjs +67 -0
- package/dist/src/cli/commands/init/index.cjs.map +1 -0
- package/dist/src/cli/commands/init/index.d.mts +12 -0
- package/dist/src/cli/commands/init/index.d.mts.map +1 -0
- package/dist/src/cli/commands/init/index.mjs +63 -0
- package/dist/src/cli/commands/init/index.mjs.map +1 -0
- package/dist/src/cli/commands/init/presenter.cjs +140 -0
- package/dist/src/cli/commands/init/presenter.cjs.map +1 -0
- package/dist/src/cli/commands/init/presenter.d.mts +8 -0
- package/dist/src/cli/commands/init/presenter.d.mts.map +1 -0
- package/dist/src/cli/commands/init/presenter.mjs +140 -0
- package/dist/src/cli/commands/init/presenter.mjs.map +1 -0
- package/dist/src/cli/commands/sync/help.cjs +34 -0
- package/dist/src/cli/commands/sync/help.cjs.map +1 -0
- package/dist/src/cli/commands/sync/help.d.mts +4 -0
- package/dist/src/cli/commands/sync/help.d.mts.map +1 -0
- package/dist/src/cli/commands/sync/help.mjs +34 -0
- package/dist/src/cli/commands/sync/help.mjs.map +1 -0
- package/dist/src/cli/commands/sync/index.cjs +215 -0
- package/dist/src/cli/commands/sync/index.cjs.map +1 -0
- package/dist/src/cli/commands/sync/index.d.mts +20 -0
- package/dist/src/cli/commands/sync/index.d.mts.map +1 -0
- package/dist/src/cli/commands/sync/index.mjs +206 -0
- package/dist/src/cli/commands/sync/index.mjs.map +1 -0
- package/dist/src/cli/commands/sync/presenter.cjs +58 -0
- package/dist/src/cli/commands/sync/presenter.cjs.map +1 -0
- package/dist/src/cli/commands/sync/presenter.d.mts +16 -0
- package/dist/src/cli/commands/sync/presenter.d.mts.map +1 -0
- package/dist/src/cli/commands/sync/presenter.mjs +57 -0
- package/dist/src/cli/commands/sync/presenter.mjs.map +1 -0
- package/dist/src/cli/commands/sync/workflow.cjs +16 -0
- package/dist/src/cli/commands/sync/workflow.cjs.map +1 -0
- package/dist/src/cli/commands/sync/workflow.mjs +16 -0
- package/dist/src/cli/commands/sync/workflow.mjs.map +1 -0
- package/dist/src/cli/commands/web/index.cjs +88 -0
- package/dist/src/cli/commands/web/index.cjs.map +1 -0
- package/dist/src/cli/commands/web/index.mjs +85 -0
- package/dist/src/cli/commands/web/index.mjs.map +1 -0
- package/dist/src/cli/harnessOptions.cjs +70 -0
- package/dist/src/cli/harnessOptions.cjs.map +1 -0
- package/dist/src/cli/harnessOptions.d.mts +26 -0
- package/dist/src/cli/harnessOptions.d.mts.map +1 -0
- package/dist/src/cli/harnessOptions.mjs +66 -0
- package/dist/src/cli/harnessOptions.mjs.map +1 -0
- package/dist/src/cli/help.cjs +82 -0
- package/dist/src/cli/help.cjs.map +1 -0
- package/dist/src/cli/help.d.mts +10 -0
- package/dist/src/cli/help.d.mts.map +1 -0
- package/dist/src/cli/help.mjs +78 -0
- package/dist/src/cli/help.mjs.map +1 -0
- package/dist/src/cli/matrixOptions.cjs +178 -0
- package/dist/src/cli/matrixOptions.cjs.map +1 -0
- package/dist/src/cli/matrixOptions.d.mts +90 -0
- package/dist/src/cli/matrixOptions.d.mts.map +1 -0
- package/dist/src/cli/matrixOptions.mjs +151 -0
- package/dist/src/cli/matrixOptions.mjs.map +1 -0
- package/dist/src/cli/options.cjs +281 -0
- package/dist/src/cli/options.cjs.map +1 -0
- package/dist/src/cli/options.d.mts +5 -0
- package/dist/src/cli/options.d.mts.map +1 -0
- package/dist/src/cli/options.mjs +279 -0
- package/dist/src/cli/options.mjs.map +1 -0
- package/dist/src/cli/router.cjs +57 -0
- package/dist/src/cli/router.cjs.map +1 -0
- package/dist/src/cli/router.d.mts +32 -0
- package/dist/src/cli/router.d.mts.map +1 -0
- package/dist/src/cli/router.mjs +54 -0
- package/dist/src/cli/router.mjs.map +1 -0
- package/dist/src/cli/server/options.cjs +71 -0
- package/dist/src/cli/server/options.cjs.map +1 -0
- package/dist/src/cli/server/options.mjs +70 -0
- package/dist/src/cli/server/options.mjs.map +1 -0
- package/dist/src/cli/server/processGuards.cjs +83 -0
- package/dist/src/cli/server/processGuards.cjs.map +1 -0
- package/dist/src/cli/server/processGuards.mjs +79 -0
- package/dist/src/cli/server/processGuards.mjs.map +1 -0
- package/dist/src/cli/server/run.cjs +69 -0
- package/dist/src/cli/server/run.cjs.map +1 -0
- package/dist/src/cli/server/run.mjs +66 -0
- package/dist/src/cli/server/run.mjs.map +1 -0
- package/dist/src/composition/harnessState/index.cjs +48 -0
- package/dist/src/composition/harnessState/index.cjs.map +1 -0
- package/dist/src/composition/harnessState/index.d.mts +19 -0
- package/dist/src/composition/harnessState/index.d.mts.map +1 -0
- package/dist/src/composition/harnessState/index.mjs +34 -0
- package/dist/src/composition/harnessState/index.mjs.map +1 -0
- package/dist/src/composition/layerPackageInstaller/index.cjs +651 -0
- package/dist/src/composition/layerPackageInstaller/index.cjs.map +1 -0
- package/dist/src/composition/layerPackageInstaller/index.d.mts +74 -0
- package/dist/src/composition/layerPackageInstaller/index.d.mts.map +1 -0
- package/dist/src/composition/layerPackageInstaller/index.mjs +637 -0
- package/dist/src/composition/layerPackageInstaller/index.mjs.map +1 -0
- package/dist/src/composition/poHomeMigration/index.cjs +234 -0
- package/dist/src/composition/poHomeMigration/index.cjs.map +1 -0
- package/dist/src/composition/poHomeMigration/index.d.mts +12 -0
- package/dist/src/composition/poHomeMigration/index.d.mts.map +1 -0
- package/dist/src/composition/poHomeMigration/index.mjs +226 -0
- package/dist/src/composition/poHomeMigration/index.mjs.map +1 -0
- package/dist/src/composition/projectTrust/index.cjs +51 -0
- package/dist/src/composition/projectTrust/index.cjs.map +1 -0
- package/dist/src/composition/projectTrust/index.d.mts +22 -0
- package/dist/src/composition/projectTrust/index.d.mts.map +1 -0
- package/dist/src/composition/projectTrust/index.mjs +48 -0
- package/dist/src/composition/projectTrust/index.mjs.map +1 -0
- package/dist/src/composition/repository/index.cjs +68 -0
- package/dist/src/composition/repository/index.cjs.map +1 -0
- package/dist/src/composition/repository/index.d.mts +22 -0
- package/dist/src/composition/repository/index.d.mts.map +1 -0
- package/dist/src/composition/repository/index.mjs +63 -0
- package/dist/src/composition/repository/index.mjs.map +1 -0
- package/dist/src/composition/syncPrune/index.cjs +85 -0
- package/dist/src/composition/syncPrune/index.cjs.map +1 -0
- package/dist/src/composition/syncPrune/index.d.mts +33 -0
- package/dist/src/composition/syncPrune/index.d.mts.map +1 -0
- package/dist/src/composition/syncPrune/index.mjs +82 -0
- package/dist/src/composition/syncPrune/index.mjs.map +1 -0
- package/dist/src/composition/syncService/index.cjs +808 -0
- package/dist/src/composition/syncService/index.cjs.map +1 -0
- package/dist/src/composition/syncService/index.d.mts +65 -0
- package/dist/src/composition/syncService/index.d.mts.map +1 -0
- package/dist/src/composition/syncService/index.mjs +792 -0
- package/dist/src/composition/syncService/index.mjs.map +1 -0
- package/dist/src/composition/syncService/localBuilds.cjs +367 -0
- package/dist/src/composition/syncService/localBuilds.cjs.map +1 -0
- package/dist/src/composition/syncService/localBuilds.mjs +358 -0
- package/dist/src/composition/syncService/localBuilds.mjs.map +1 -0
- package/dist/src/composition/transitionLayers.cjs +17 -0
- package/dist/src/composition/transitionLayers.cjs.map +1 -0
- package/dist/src/composition/transitionLayers.d.mts +6 -0
- package/dist/src/composition/transitionLayers.d.mts.map +1 -0
- package/dist/src/composition/transitionLayers.mjs +16 -0
- package/dist/src/composition/transitionLayers.mjs.map +1 -0
- package/dist/src/composition/types/harness.d.mts +52 -0
- package/dist/src/composition/types/harness.d.mts.map +1 -0
- package/dist/src/extensions/setupDiagnostics.cjs +65 -0
- package/dist/src/extensions/setupDiagnostics.cjs.map +1 -0
- package/dist/src/extensions/setupDiagnostics.mjs +64 -0
- package/dist/src/extensions/setupDiagnostics.mjs.map +1 -0
- package/dist/utils.cjs +4 -0
- package/dist/utils.d.mts +2 -0
- package/dist/utils.mjs +2 -0
- package/dist/webBuilder.cjs +59 -0
- package/dist/webBuilder.d.mts +9 -0
- package/dist/webBuilder.mjs +9 -0
- package/docs/server/api-export.md +86 -0
- package/docs/server/api.md +144 -0
- package/docs/server/getting-started.md +114 -0
- package/docs/server/index.md +67 -0
- package/docs/server/ipc.md +97 -0
- package/docs/server/lifecycle.md +108 -0
- package/docs/server/security.md +101 -0
- package/llms.txt +12 -0
- package/package.json +295 -0
- package/src/prompts/po-author-extension/SKILL.md +35 -0
- package/src/prompts/po-author-extension/references/extension-contract.md +134 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/cli/commands/doctor/help.ts
|
|
2
|
+
function doctorHelp() {
|
|
3
|
+
return `Usage: po doctor
|
|
4
|
+
|
|
5
|
+
Checks the Po installation and reports what is wrong without changing
|
|
6
|
+
anything. Validates .po/config.yaml and .po/modes.yaml strictly, including
|
|
7
|
+
the unsupported keys po sync ignores, then reports everything
|
|
8
|
+
po sync --check reports.
|
|
9
|
+
|
|
10
|
+
Exits non-zero when any check fails.
|
|
11
|
+
|
|
12
|
+
Options:
|
|
13
|
+
-h, --help Show this help
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.doctorHelp = doctorHelp;
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=help.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.cjs","names":[],"sources":["../../../../../src/cli/commands/doctor/help.ts"],"sourcesContent":["export function doctorHelp(): string {\n return `Usage: po doctor\n\nChecks the Po installation and reports what is wrong without changing\nanything. Validates .po/config.yaml and .po/modes.yaml strictly, including\nthe unsupported keys po sync ignores, then reports everything\npo sync --check reports.\n\nExits non-zero when any check fails.\n\nOptions:\n -h, --help Show this help\n`;\n}\n"],"mappings":";AAAA,SAAgB,aAAqB;CACnC,OAAO;;;;;;;;;;;;AAYT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.d.mts","names":[],"sources":["../../../../../src/cli/commands/doctor/help.ts"],"mappings":";wBAAgB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/cli/commands/doctor/help.ts
|
|
2
|
+
function doctorHelp() {
|
|
3
|
+
return `Usage: po doctor
|
|
4
|
+
|
|
5
|
+
Checks the Po installation and reports what is wrong without changing
|
|
6
|
+
anything. Validates .po/config.yaml and .po/modes.yaml strictly, including
|
|
7
|
+
the unsupported keys po sync ignores, then reports everything
|
|
8
|
+
po sync --check reports.
|
|
9
|
+
|
|
10
|
+
Exits non-zero when any check fails.
|
|
11
|
+
|
|
12
|
+
Options:
|
|
13
|
+
-h, --help Show this help
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { doctorHelp };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=help.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.mjs","names":[],"sources":["../../../../../src/cli/commands/doctor/help.ts"],"sourcesContent":["export function doctorHelp(): string {\n return `Usage: po doctor\n\nChecks the Po installation and reports what is wrong without changing\nanything. Validates .po/config.yaml and .po/modes.yaml strictly, including\nthe unsupported keys po sync ignores, then reports everything\npo sync --check reports.\n\nExits non-zero when any check fails.\n\nOptions:\n -h, --help Show this help\n`;\n}\n"],"mappings":";AAAA,SAAgB,aAAqB;CACnC,OAAO;;;;;;;;;;;;AAYT"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
const require_runtime = require("../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_help = require("./help.cjs");
|
|
3
|
+
const require_index = require("../../../composition/repository/index.cjs");
|
|
4
|
+
const require_router = require("../../router.cjs");
|
|
5
|
+
const require_index$1 = require("../sync/index.cjs");
|
|
6
|
+
let node_path = require("node:path");
|
|
7
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
8
|
+
let node_os = require("node:os");
|
|
9
|
+
node_os = require_runtime.__toESM(node_os, 1);
|
|
10
|
+
let _agimon_ai_po_config_domains = require("@agimon-ai/po-config/domains");
|
|
11
|
+
let _agimon_ai_po_config_config = require("@agimon-ai/po-config/config");
|
|
12
|
+
let _agimon_ai_po_config_majorModes = require("@agimon-ai/po-config/majorModes");
|
|
13
|
+
let _agimon_ai_po_config_profiles = require("@agimon-ai/po-config/profiles");
|
|
14
|
+
//#region src/cli/commands/doctor/index.ts
|
|
15
|
+
const DOCTOR_COMMAND = "doctor";
|
|
16
|
+
const HARNESS_ROOT_ENV = "PO_ROOT";
|
|
17
|
+
const LABEL_WIDTH = 14;
|
|
18
|
+
function formatSection(section) {
|
|
19
|
+
const label = section.label.padEnd(LABEL_WIDTH);
|
|
20
|
+
if (section.problems.length === 0) return `${label}ok\n`;
|
|
21
|
+
return `${label}${section.problems.length === 1 ? "FAILED" : `${String(section.problems.length)} problem(s)`}\n${section.problems.map((problem) => ` ${problem}\n`).join("")}`;
|
|
22
|
+
}
|
|
23
|
+
function messageOf(error) {
|
|
24
|
+
return error instanceof Error ? error.message : String(error);
|
|
25
|
+
}
|
|
26
|
+
/** Runs one check, turning the throw a strict parser uses into a reported problem. */
|
|
27
|
+
function check(run) {
|
|
28
|
+
try {
|
|
29
|
+
run();
|
|
30
|
+
return [];
|
|
31
|
+
} catch (error) {
|
|
32
|
+
return [messageOf(error)];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Reports what is wrong with a Po installation without changing anything.
|
|
37
|
+
*
|
|
38
|
+
* The strict counterpart to `po sync`, which tolerates unknown config keys
|
|
39
|
+
* so a build cannot break over one. Everything `sync --check` reports is
|
|
40
|
+
* reported here too, so this is the one command to run when something is off.
|
|
41
|
+
*/
|
|
42
|
+
function runDoctor(args, environment = process.env, currentDirectory = process.cwd(), output = process.stdout) {
|
|
43
|
+
if (require_router.wantsHelp(args.slice(1))) {
|
|
44
|
+
output.write(require_help.doctorHelp());
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
const { sections, problems } = collectDoctorReport(environment, currentDirectory);
|
|
48
|
+
for (const section of sections) output.write(formatSection(section));
|
|
49
|
+
if (problems === 0) {
|
|
50
|
+
output.write("\nno problems found\n");
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
output.write(`\n${String(problems)} problem(s) found\n`);
|
|
54
|
+
return 1;
|
|
55
|
+
}
|
|
56
|
+
/** The CLI and session diagnostic tool run the same read-only checks. */
|
|
57
|
+
function collectDoctorReport(environment, currentDirectory) {
|
|
58
|
+
const homeDirectory = environment.HOME ?? node_os.default.homedir();
|
|
59
|
+
const inheritedRoot = environment[HARNESS_ROOT_ENV];
|
|
60
|
+
const repoRoot = inheritedRoot ? node_path.default.resolve(inheritedRoot) : require_index.resolveDoomConfigurationRoot(currentDirectory, homeDirectory);
|
|
61
|
+
const sections = [
|
|
62
|
+
{
|
|
63
|
+
label: "config.yaml",
|
|
64
|
+
problems: check(() => (0, _agimon_ai_po_config_config.loadDoomConfig)(repoRoot, homeDirectory))
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: "modes.yaml",
|
|
68
|
+
problems: check(() => (0, _agimon_ai_po_config_majorModes.loadMajorModesConfig)(repoRoot, homeDirectory))
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: "domains.yaml",
|
|
72
|
+
problems: check(() => (0, _agimon_ai_po_config_domains.loadDomains)(repoRoot, homeDirectory))
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: "profiles.yaml",
|
|
76
|
+
problems: check(() => (0, _agimon_ai_po_config_profiles.loadProfiles)(repoRoot, homeDirectory))
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
const skipped = sections.some((section) => section.problems.length > 0) ? ["packages", "web build"] : [];
|
|
80
|
+
if (skipped.length === 0) try {
|
|
81
|
+
const readiness = require_index$1.syncReadiness(repoRoot, homeDirectory, environment);
|
|
82
|
+
sections.push({
|
|
83
|
+
label: "packages",
|
|
84
|
+
problems: readiness.packages
|
|
85
|
+
}, {
|
|
86
|
+
label: "web build",
|
|
87
|
+
problems: readiness.web
|
|
88
|
+
});
|
|
89
|
+
} catch (error) {
|
|
90
|
+
sections.push({
|
|
91
|
+
label: "installation",
|
|
92
|
+
problems: [messageOf(error)]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
repoRoot,
|
|
97
|
+
homeDirectory,
|
|
98
|
+
sections,
|
|
99
|
+
skipped,
|
|
100
|
+
problems: sections.reduce((total, section) => total + section.problems.length, 0)
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/** Compatibility API. Executables call the command function directly. */
|
|
104
|
+
var DoctorCommand = class {
|
|
105
|
+
name = DOCTOR_COMMAND;
|
|
106
|
+
matches(args) {
|
|
107
|
+
return args[0] === this.name;
|
|
108
|
+
}
|
|
109
|
+
execute(args, environment = process.env, currentDirectory = process.cwd(), output = process.stdout) {
|
|
110
|
+
return runDoctor(args, environment, currentDirectory, output);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
//#endregion
|
|
114
|
+
exports.DoctorCommand = DoctorCommand;
|
|
115
|
+
exports.collectDoctorReport = collectDoctorReport;
|
|
116
|
+
exports.runDoctor = runDoctor;
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["wantsHelp","doctorHelp","os","path","resolveDoomConfigurationRoot","loadDoomConfig","loadMajorModesConfig","loadDomains","loadProfiles","syncReadiness"],"sources":["../../../../../src/cli/commands/doctor/index.ts"],"sourcesContent":["import os from 'node:os';\nimport path from 'node:path';\n\nimport { loadDoomConfig } from '@agimon-ai/po-config/config';\nimport { loadDomains } from '@agimon-ai/po-config/domains';\nimport { loadMajorModesConfig } from '@agimon-ai/po-config/majorModes';\nimport { loadProfiles } from '@agimon-ai/po-config/profiles';\n\nimport { resolveDoomConfigurationRoot } from '../../../composition/repository';\nimport { wantsHelp } from '../../router';\nimport { syncReadiness } from '../sync';\nimport { doctorHelp } from './help';\n\nconst DOCTOR_COMMAND = 'doctor';\nconst HARNESS_ROOT_ENV = 'PO_ROOT';\nconst LABEL_WIDTH = 14;\n\nexport interface DoctorOutput {\n write(chunk: string): void;\n}\n\n/** One checked area and what it found. Empty problems means the section passed. */\ninterface Section {\n label: string;\n problems: string[];\n}\n\nfunction formatSection(section: Section): string {\n const label = section.label.padEnd(LABEL_WIDTH);\n if (section.problems.length === 0) return `${label}ok\\n`;\n return `${label}${section.problems.length === 1 ? 'FAILED' : `${String(section.problems.length)} problem(s)`}\\n${section.problems\n .map((problem) => ` ${problem}\\n`)\n .join('')}`;\n}\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\n/** Runs one check, turning the throw a strict parser uses into a reported problem. */\nfunction check(run: () => void): string[] {\n try {\n run();\n return [];\n } catch (error) {\n return [messageOf(error)];\n }\n}\n\n/**\n * Reports what is wrong with a Po installation without changing anything.\n *\n * The strict counterpart to `po sync`, which tolerates unknown config keys\n * so a build cannot break over one. Everything `sync --check` reports is\n * reported here too, so this is the one command to run when something is off.\n */\nexport function runDoctor(\n args: string[],\n environment: NodeJS.ProcessEnv = process.env,\n currentDirectory = process.cwd(),\n output: DoctorOutput = process.stdout,\n): number {\n if (wantsHelp(args.slice(1))) {\n output.write(doctorHelp());\n return 0;\n }\n const { sections, problems } = collectDoctorReport(environment, currentDirectory);\n for (const section of sections) output.write(formatSection(section));\n if (problems === 0) {\n output.write('\\nno problems found\\n');\n return 0;\n }\n output.write(`\\n${String(problems)} problem(s) found\\n`);\n return 1;\n}\n\n/** The CLI and session diagnostic tool run the same read-only checks. */\nexport function collectDoctorReport(environment: NodeJS.ProcessEnv, currentDirectory: string) {\n const homeDirectory = environment.HOME ?? os.homedir();\n const inheritedRoot = environment[HARNESS_ROOT_ENV];\n const repoRoot = inheritedRoot\n ? path.resolve(inheritedRoot)\n : resolveDoomConfigurationRoot(currentDirectory, homeDirectory);\n const sections: Section[] = [\n { label: 'config.yaml', problems: check(() => loadDoomConfig(repoRoot, homeDirectory)) },\n { label: 'modes.yaml', problems: check(() => loadMajorModesConfig(repoRoot, homeDirectory)) },\n { label: 'domains.yaml', problems: check(() => loadDomains(repoRoot, homeDirectory)) },\n { label: 'profiles.yaml', problems: check(() => loadProfiles(repoRoot, homeDirectory)) },\n ];\n const skipped = sections.some((section) => section.problems.length > 0) ? ['packages', 'web build'] : [];\n if (skipped.length === 0) {\n try {\n const readiness = syncReadiness(repoRoot, homeDirectory, environment);\n sections.push(\n { label: 'packages', problems: readiness.packages },\n { label: 'web build', problems: readiness.web },\n );\n } catch (error) {\n sections.push({ label: 'installation', problems: [messageOf(error)] });\n }\n }\n return {\n repoRoot,\n homeDirectory,\n sections,\n skipped,\n problems: sections.reduce((total, section) => total + section.problems.length, 0),\n };\n}\n/** Compatibility API. Executables call the command function directly. */\nexport class DoctorCommand {\n readonly name = DOCTOR_COMMAND;\n\n matches(args: string[]): boolean {\n return args[0] === this.name;\n }\n\n execute(\n args: string[],\n environment: NodeJS.ProcessEnv = process.env,\n currentDirectory = process.cwd(),\n output: DoctorOutput = process.stdout,\n ): number {\n return runDoctor(args, environment, currentDirectory, output);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,cAAc;AAYpB,SAAS,cAAc,SAA0B;CAC/C,MAAM,QAAQ,QAAQ,MAAM,OAAO,WAAW;CAC9C,IAAI,QAAQ,SAAS,WAAW,GAAG,OAAO,GAAG,MAAM;CACnD,OAAO,GAAG,QAAQ,QAAQ,SAAS,WAAW,IAAI,WAAW,GAAG,OAAO,QAAQ,SAAS,MAAM,EAAE,aAAa,IAAI,QAAQ,SACtH,KAAK,YAAY,KAAK,QAAQ,GAAG,CAAC,CAClC,KAAK,EAAE;AACZ;AAEA,SAAS,UAAU,OAAwB;CACzC,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;;AAGA,SAAS,MAAM,KAA2B;CACxC,IAAI;EACF,IAAI;EACJ,OAAO,CAAC;CACV,SAAS,OAAO;EACd,OAAO,CAAC,UAAU,KAAK,CAAC;CAC1B;AACF;;;;;;;;AASA,SAAgB,UACd,MACA,cAAiC,QAAQ,KACzC,mBAAmB,QAAQ,IAAI,GAC/B,SAAuB,QAAQ,QACvB;CACR,IAAIA,eAAAA,UAAU,KAAK,MAAM,CAAC,CAAC,GAAG;EAC5B,OAAO,MAAMC,aAAAA,WAAW,CAAC;EACzB,OAAO;CACT;CACA,MAAM,EAAE,UAAU,aAAa,oBAAoB,aAAa,gBAAgB;CAChF,KAAK,MAAM,WAAW,UAAU,OAAO,MAAM,cAAc,OAAO,CAAC;CACnE,IAAI,aAAa,GAAG;EAClB,OAAO,MAAM,uBAAuB;EACpC,OAAO;CACT;CACA,OAAO,MAAM,KAAK,OAAO,QAAQ,EAAE,oBAAoB;CACvD,OAAO;AACT;;AAGA,SAAgB,oBAAoB,aAAgC,kBAA0B;CAC5F,MAAM,gBAAgB,YAAY,QAAQC,QAAAA,QAAG,QAAQ;CACrD,MAAM,gBAAgB,YAAY;CAClC,MAAM,WAAW,gBACbC,UAAAA,QAAK,QAAQ,aAAa,IAC1BC,cAAAA,6BAA6B,kBAAkB,aAAa;CAChE,MAAM,WAAsB;EAC1B;GAAE,OAAO;GAAe,UAAU,aAAA,GAAYC,4BAAAA,eAAAA,CAAe,UAAU,aAAa,CAAC;EAAE;EACvF;GAAE,OAAO;GAAc,UAAU,aAAA,GAAYC,gCAAAA,qBAAAA,CAAqB,UAAU,aAAa,CAAC;EAAE;EAC5F;GAAE,OAAO;GAAgB,UAAU,aAAA,GAAYC,6BAAAA,YAAAA,CAAY,UAAU,aAAa,CAAC;EAAE;EACrF;GAAE,OAAO;GAAiB,UAAU,aAAA,GAAYC,8BAAAA,aAAAA,CAAa,UAAU,aAAa,CAAC;EAAE;CACzF;CACA,MAAM,UAAU,SAAS,MAAM,YAAY,QAAQ,SAAS,SAAS,CAAC,IAAI,CAAC,YAAY,WAAW,IAAI,CAAC;CACvG,IAAI,QAAQ,WAAW,GACrB,IAAI;EACF,MAAM,YAAYC,gBAAAA,cAAc,UAAU,eAAe,WAAW;EACpE,SAAS,KACP;GAAE,OAAO;GAAY,UAAU,UAAU;EAAS,GAClD;GAAE,OAAO;GAAa,UAAU,UAAU;EAAI,CAChD;CACF,SAAS,OAAO;EACd,SAAS,KAAK;GAAE,OAAO;GAAgB,UAAU,CAAC,UAAU,KAAK,CAAC;EAAE,CAAC;CACvE;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA,UAAU,SAAS,QAAQ,OAAO,YAAY,QAAQ,QAAQ,SAAS,QAAQ,CAAC;CAClF;AACF;;AAEA,IAAa,gBAAb,MAA2B;CACzB,OAAgB;CAEhB,QAAQ,MAAyB;EAC/B,OAAO,KAAK,OAAO,KAAK;CAC1B;CAEA,QACE,MACA,cAAiC,QAAQ,KACzC,mBAAmB,QAAQ,IAAI,GAC/B,SAAuB,QAAQ,QACvB;EACR,OAAO,UAAU,MAAM,aAAa,kBAAkB,MAAM;CAC9D;AACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/cli/commands/doctor/index.d.ts
|
|
2
|
+
export interface DoctorOutput {
|
|
3
|
+
write(chunk: string): void;
|
|
4
|
+
}
|
|
5
|
+
/** One checked area and what it found. Empty problems means the section passed. */
|
|
6
|
+
interface Section {
|
|
7
|
+
label: string;
|
|
8
|
+
problems: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Reports what is wrong with a Po installation without changing anything.
|
|
12
|
+
*
|
|
13
|
+
* The strict counterpart to `po sync`, which tolerates unknown config keys
|
|
14
|
+
* so a build cannot break over one. Everything `sync --check` reports is
|
|
15
|
+
* reported here too, so this is the one command to run when something is off.
|
|
16
|
+
*/
|
|
17
|
+
export declare function runDoctor(args: string[], environment?: NodeJS.ProcessEnv, currentDirectory?: string, output?: DoctorOutput): number;
|
|
18
|
+
/** The CLI and session diagnostic tool run the same read-only checks. */
|
|
19
|
+
export declare function collectDoctorReport(environment: NodeJS.ProcessEnv, currentDirectory: string): {
|
|
20
|
+
repoRoot: string;
|
|
21
|
+
homeDirectory: string;
|
|
22
|
+
sections: Section[];
|
|
23
|
+
skipped: string[];
|
|
24
|
+
problems: number;
|
|
25
|
+
};
|
|
26
|
+
/** Compatibility API. Executables call the command function directly. */
|
|
27
|
+
export declare class DoctorCommand {
|
|
28
|
+
readonly name = "doctor";
|
|
29
|
+
matches(args: string[]): boolean;
|
|
30
|
+
execute(args: string[], environment?: NodeJS.ProcessEnv, currentDirectory?: string, output?: DoctorOutput): number;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../../src/cli/commands/doctor/index.ts"],"mappings":";iBAiBiB;EACf,MAAM;;;UAIE;EACR;EACA;;;;;;;;;wBAgCc,UACd,gBACA,cAAa,OAAO,YACpB,2BACA,SAAQ;;wBAiBM,oBAAoB,aAAa,OAAO,YAAY;;;;;;;;qBAiCvD;WACF;EAET,QAAQ;EAIR,QACE,gBACA,cAAa,OAAO,YACpB,2BACA,SAAQ"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { doctorHelp } from "./help.mjs";
|
|
2
|
+
import { resolveDoomConfigurationRoot } from "../../../composition/repository/index.mjs";
|
|
3
|
+
import { wantsHelp } from "../../router.mjs";
|
|
4
|
+
import { syncReadiness } from "../sync/index.mjs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import os from "node:os";
|
|
7
|
+
import { loadDomains } from "@agimon-ai/po-config/domains";
|
|
8
|
+
import { loadDoomConfig } from "@agimon-ai/po-config/config";
|
|
9
|
+
import { loadMajorModesConfig } from "@agimon-ai/po-config/majorModes";
|
|
10
|
+
import { loadProfiles } from "@agimon-ai/po-config/profiles";
|
|
11
|
+
//#region src/cli/commands/doctor/index.ts
|
|
12
|
+
const DOCTOR_COMMAND = "doctor";
|
|
13
|
+
const HARNESS_ROOT_ENV = "PO_ROOT";
|
|
14
|
+
const LABEL_WIDTH = 14;
|
|
15
|
+
function formatSection(section) {
|
|
16
|
+
const label = section.label.padEnd(LABEL_WIDTH);
|
|
17
|
+
if (section.problems.length === 0) return `${label}ok\n`;
|
|
18
|
+
return `${label}${section.problems.length === 1 ? "FAILED" : `${String(section.problems.length)} problem(s)`}\n${section.problems.map((problem) => ` ${problem}\n`).join("")}`;
|
|
19
|
+
}
|
|
20
|
+
function messageOf(error) {
|
|
21
|
+
return error instanceof Error ? error.message : String(error);
|
|
22
|
+
}
|
|
23
|
+
/** Runs one check, turning the throw a strict parser uses into a reported problem. */
|
|
24
|
+
function check(run) {
|
|
25
|
+
try {
|
|
26
|
+
run();
|
|
27
|
+
return [];
|
|
28
|
+
} catch (error) {
|
|
29
|
+
return [messageOf(error)];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Reports what is wrong with a Po installation without changing anything.
|
|
34
|
+
*
|
|
35
|
+
* The strict counterpart to `po sync`, which tolerates unknown config keys
|
|
36
|
+
* so a build cannot break over one. Everything `sync --check` reports is
|
|
37
|
+
* reported here too, so this is the one command to run when something is off.
|
|
38
|
+
*/
|
|
39
|
+
function runDoctor(args, environment = process.env, currentDirectory = process.cwd(), output = process.stdout) {
|
|
40
|
+
if (wantsHelp(args.slice(1))) {
|
|
41
|
+
output.write(doctorHelp());
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
const { sections, problems } = collectDoctorReport(environment, currentDirectory);
|
|
45
|
+
for (const section of sections) output.write(formatSection(section));
|
|
46
|
+
if (problems === 0) {
|
|
47
|
+
output.write("\nno problems found\n");
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
output.write(`\n${String(problems)} problem(s) found\n`);
|
|
51
|
+
return 1;
|
|
52
|
+
}
|
|
53
|
+
/** The CLI and session diagnostic tool run the same read-only checks. */
|
|
54
|
+
function collectDoctorReport(environment, currentDirectory) {
|
|
55
|
+
const homeDirectory = environment.HOME ?? os.homedir();
|
|
56
|
+
const inheritedRoot = environment[HARNESS_ROOT_ENV];
|
|
57
|
+
const repoRoot = inheritedRoot ? path.resolve(inheritedRoot) : resolveDoomConfigurationRoot(currentDirectory, homeDirectory);
|
|
58
|
+
const sections = [
|
|
59
|
+
{
|
|
60
|
+
label: "config.yaml",
|
|
61
|
+
problems: check(() => loadDoomConfig(repoRoot, homeDirectory))
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: "modes.yaml",
|
|
65
|
+
problems: check(() => loadMajorModesConfig(repoRoot, homeDirectory))
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: "domains.yaml",
|
|
69
|
+
problems: check(() => loadDomains(repoRoot, homeDirectory))
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: "profiles.yaml",
|
|
73
|
+
problems: check(() => loadProfiles(repoRoot, homeDirectory))
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
const skipped = sections.some((section) => section.problems.length > 0) ? ["packages", "web build"] : [];
|
|
77
|
+
if (skipped.length === 0) try {
|
|
78
|
+
const readiness = syncReadiness(repoRoot, homeDirectory, environment);
|
|
79
|
+
sections.push({
|
|
80
|
+
label: "packages",
|
|
81
|
+
problems: readiness.packages
|
|
82
|
+
}, {
|
|
83
|
+
label: "web build",
|
|
84
|
+
problems: readiness.web
|
|
85
|
+
});
|
|
86
|
+
} catch (error) {
|
|
87
|
+
sections.push({
|
|
88
|
+
label: "installation",
|
|
89
|
+
problems: [messageOf(error)]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
repoRoot,
|
|
94
|
+
homeDirectory,
|
|
95
|
+
sections,
|
|
96
|
+
skipped,
|
|
97
|
+
problems: sections.reduce((total, section) => total + section.problems.length, 0)
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/** Compatibility API. Executables call the command function directly. */
|
|
101
|
+
var DoctorCommand = class {
|
|
102
|
+
name = DOCTOR_COMMAND;
|
|
103
|
+
matches(args) {
|
|
104
|
+
return args[0] === this.name;
|
|
105
|
+
}
|
|
106
|
+
execute(args, environment = process.env, currentDirectory = process.cwd(), output = process.stdout) {
|
|
107
|
+
return runDoctor(args, environment, currentDirectory, output);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
//#endregion
|
|
111
|
+
export { DoctorCommand, collectDoctorReport, runDoctor };
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/cli/commands/doctor/index.ts"],"sourcesContent":["import os from 'node:os';\nimport path from 'node:path';\n\nimport { loadDoomConfig } from '@agimon-ai/po-config/config';\nimport { loadDomains } from '@agimon-ai/po-config/domains';\nimport { loadMajorModesConfig } from '@agimon-ai/po-config/majorModes';\nimport { loadProfiles } from '@agimon-ai/po-config/profiles';\n\nimport { resolveDoomConfigurationRoot } from '../../../composition/repository';\nimport { wantsHelp } from '../../router';\nimport { syncReadiness } from '../sync';\nimport { doctorHelp } from './help';\n\nconst DOCTOR_COMMAND = 'doctor';\nconst HARNESS_ROOT_ENV = 'PO_ROOT';\nconst LABEL_WIDTH = 14;\n\nexport interface DoctorOutput {\n write(chunk: string): void;\n}\n\n/** One checked area and what it found. Empty problems means the section passed. */\ninterface Section {\n label: string;\n problems: string[];\n}\n\nfunction formatSection(section: Section): string {\n const label = section.label.padEnd(LABEL_WIDTH);\n if (section.problems.length === 0) return `${label}ok\\n`;\n return `${label}${section.problems.length === 1 ? 'FAILED' : `${String(section.problems.length)} problem(s)`}\\n${section.problems\n .map((problem) => ` ${problem}\\n`)\n .join('')}`;\n}\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\n/** Runs one check, turning the throw a strict parser uses into a reported problem. */\nfunction check(run: () => void): string[] {\n try {\n run();\n return [];\n } catch (error) {\n return [messageOf(error)];\n }\n}\n\n/**\n * Reports what is wrong with a Po installation without changing anything.\n *\n * The strict counterpart to `po sync`, which tolerates unknown config keys\n * so a build cannot break over one. Everything `sync --check` reports is\n * reported here too, so this is the one command to run when something is off.\n */\nexport function runDoctor(\n args: string[],\n environment: NodeJS.ProcessEnv = process.env,\n currentDirectory = process.cwd(),\n output: DoctorOutput = process.stdout,\n): number {\n if (wantsHelp(args.slice(1))) {\n output.write(doctorHelp());\n return 0;\n }\n const { sections, problems } = collectDoctorReport(environment, currentDirectory);\n for (const section of sections) output.write(formatSection(section));\n if (problems === 0) {\n output.write('\\nno problems found\\n');\n return 0;\n }\n output.write(`\\n${String(problems)} problem(s) found\\n`);\n return 1;\n}\n\n/** The CLI and session diagnostic tool run the same read-only checks. */\nexport function collectDoctorReport(environment: NodeJS.ProcessEnv, currentDirectory: string) {\n const homeDirectory = environment.HOME ?? os.homedir();\n const inheritedRoot = environment[HARNESS_ROOT_ENV];\n const repoRoot = inheritedRoot\n ? path.resolve(inheritedRoot)\n : resolveDoomConfigurationRoot(currentDirectory, homeDirectory);\n const sections: Section[] = [\n { label: 'config.yaml', problems: check(() => loadDoomConfig(repoRoot, homeDirectory)) },\n { label: 'modes.yaml', problems: check(() => loadMajorModesConfig(repoRoot, homeDirectory)) },\n { label: 'domains.yaml', problems: check(() => loadDomains(repoRoot, homeDirectory)) },\n { label: 'profiles.yaml', problems: check(() => loadProfiles(repoRoot, homeDirectory)) },\n ];\n const skipped = sections.some((section) => section.problems.length > 0) ? ['packages', 'web build'] : [];\n if (skipped.length === 0) {\n try {\n const readiness = syncReadiness(repoRoot, homeDirectory, environment);\n sections.push(\n { label: 'packages', problems: readiness.packages },\n { label: 'web build', problems: readiness.web },\n );\n } catch (error) {\n sections.push({ label: 'installation', problems: [messageOf(error)] });\n }\n }\n return {\n repoRoot,\n homeDirectory,\n sections,\n skipped,\n problems: sections.reduce((total, section) => total + section.problems.length, 0),\n };\n}\n/** Compatibility API. Executables call the command function directly. */\nexport class DoctorCommand {\n readonly name = DOCTOR_COMMAND;\n\n matches(args: string[]): boolean {\n return args[0] === this.name;\n }\n\n execute(\n args: string[],\n environment: NodeJS.ProcessEnv = process.env,\n currentDirectory = process.cwd(),\n output: DoctorOutput = process.stdout,\n ): number {\n return runDoctor(args, environment, currentDirectory, output);\n }\n}\n"],"mappings":";;;;;;;;;;;AAaA,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,cAAc;AAYpB,SAAS,cAAc,SAA0B;CAC/C,MAAM,QAAQ,QAAQ,MAAM,OAAO,WAAW;CAC9C,IAAI,QAAQ,SAAS,WAAW,GAAG,OAAO,GAAG,MAAM;CACnD,OAAO,GAAG,QAAQ,QAAQ,SAAS,WAAW,IAAI,WAAW,GAAG,OAAO,QAAQ,SAAS,MAAM,EAAE,aAAa,IAAI,QAAQ,SACtH,KAAK,YAAY,KAAK,QAAQ,GAAG,CAAC,CAClC,KAAK,EAAE;AACZ;AAEA,SAAS,UAAU,OAAwB;CACzC,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;;AAGA,SAAS,MAAM,KAA2B;CACxC,IAAI;EACF,IAAI;EACJ,OAAO,CAAC;CACV,SAAS,OAAO;EACd,OAAO,CAAC,UAAU,KAAK,CAAC;CAC1B;AACF;;;;;;;;AASA,SAAgB,UACd,MACA,cAAiC,QAAQ,KACzC,mBAAmB,QAAQ,IAAI,GAC/B,SAAuB,QAAQ,QACvB;CACR,IAAI,UAAU,KAAK,MAAM,CAAC,CAAC,GAAG;EAC5B,OAAO,MAAM,WAAW,CAAC;EACzB,OAAO;CACT;CACA,MAAM,EAAE,UAAU,aAAa,oBAAoB,aAAa,gBAAgB;CAChF,KAAK,MAAM,WAAW,UAAU,OAAO,MAAM,cAAc,OAAO,CAAC;CACnE,IAAI,aAAa,GAAG;EAClB,OAAO,MAAM,uBAAuB;EACpC,OAAO;CACT;CACA,OAAO,MAAM,KAAK,OAAO,QAAQ,EAAE,oBAAoB;CACvD,OAAO;AACT;;AAGA,SAAgB,oBAAoB,aAAgC,kBAA0B;CAC5F,MAAM,gBAAgB,YAAY,QAAQ,GAAG,QAAQ;CACrD,MAAM,gBAAgB,YAAY;CAClC,MAAM,WAAW,gBACb,KAAK,QAAQ,aAAa,IAC1B,6BAA6B,kBAAkB,aAAa;CAChE,MAAM,WAAsB;EAC1B;GAAE,OAAO;GAAe,UAAU,YAAY,eAAe,UAAU,aAAa,CAAC;EAAE;EACvF;GAAE,OAAO;GAAc,UAAU,YAAY,qBAAqB,UAAU,aAAa,CAAC;EAAE;EAC5F;GAAE,OAAO;GAAgB,UAAU,YAAY,YAAY,UAAU,aAAa,CAAC;EAAE;EACrF;GAAE,OAAO;GAAiB,UAAU,YAAY,aAAa,UAAU,aAAa,CAAC;EAAE;CACzF;CACA,MAAM,UAAU,SAAS,MAAM,YAAY,QAAQ,SAAS,SAAS,CAAC,IAAI,CAAC,YAAY,WAAW,IAAI,CAAC;CACvG,IAAI,QAAQ,WAAW,GACrB,IAAI;EACF,MAAM,YAAY,cAAc,UAAU,eAAe,WAAW;EACpE,SAAS,KACP;GAAE,OAAO;GAAY,UAAU,UAAU;EAAS,GAClD;GAAE,OAAO;GAAa,UAAU,UAAU;EAAI,CAChD;CACF,SAAS,OAAO;EACd,SAAS,KAAK;GAAE,OAAO;GAAgB,UAAU,CAAC,UAAU,KAAK,CAAC;EAAE,CAAC;CACvE;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA,UAAU,SAAS,QAAQ,OAAO,YAAY,QAAQ,QAAQ,SAAS,QAAQ,CAAC;CAClF;AACF;;AAEA,IAAa,gBAAb,MAA2B;CACzB,OAAgB;CAEhB,QAAQ,MAAyB;EAC/B,OAAO,KAAK,OAAO,KAAK;CAC1B;CAEA,QACE,MACA,cAAiC,QAAQ,KACzC,mBAAmB,QAAQ,IAAI,GAC/B,SAAuB,QAAQ,QACvB;EACR,OAAO,UAAU,MAAM,aAAa,kBAAkB,MAAM;CAC9D;AACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const require_baseCommand = require("../baseCommand.cjs");
|
|
2
|
+
let _agimon_ai_po_domain_mcp = require("@agimon-ai/po-domain/mcp");
|
|
3
|
+
//#region src/cli/commands/emit-mcp/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* Writes the resolved MCP config to a directory and exits.
|
|
6
|
+
*
|
|
7
|
+
* Lets claude.sh and codex.sh reuse the same domain-scoped MCP surface instead
|
|
8
|
+
* of reimplementing the filter in shell.
|
|
9
|
+
*/
|
|
10
|
+
async function runEmitMcp(context) {
|
|
11
|
+
const { options, resources } = context;
|
|
12
|
+
if (!options.emitMcp) throw new Error("--emit-mcp requires a target directory");
|
|
13
|
+
if (!resources.mcpConfigPath) throw new Error("--emit-mcp requires MCP to be enabled");
|
|
14
|
+
const emitted = await (0, _agimon_ai_po_domain_mcp.persistMcpConfig)(resources.mcpConfigPath, resources.temporaryDirectory, options.emitMcp);
|
|
15
|
+
process.stdout.write(`${emitted}\n`);
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
/** Compatibility API. Executables call the command function directly. */
|
|
19
|
+
var EmitMcpCommand = class extends require_baseCommand.BaseCommand {
|
|
20
|
+
name = "emit-mcp";
|
|
21
|
+
matches(options) {
|
|
22
|
+
return Boolean(options.emitMcp);
|
|
23
|
+
}
|
|
24
|
+
async execute(context) {
|
|
25
|
+
return runEmitMcp(context);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.EmitMcpCommand = EmitMcpCommand;
|
|
30
|
+
exports.runEmitMcp = runEmitMcp;
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["persistMcpConfig","BaseCommand"],"sources":["../../../../../src/cli/commands/emit-mcp/index.ts"],"sourcesContent":["import { persistMcpConfig } from '@agimon-ai/po-domain/mcp';\n\nimport type { HarnessContext } from '../../../builders/cli/harnessContext';\nimport type { HarnessOptions } from '../../../composition/types/harness';\nimport { BaseCommand } from '../baseCommand';\n\n/**\n * Writes the resolved MCP config to a directory and exits.\n *\n * Lets claude.sh and codex.sh reuse the same domain-scoped MCP surface instead\n * of reimplementing the filter in shell.\n */\nexport async function runEmitMcp(context: HarnessContext): Promise<number> {\n const { options, resources } = context;\n if (!options.emitMcp) throw new Error('--emit-mcp requires a target directory');\n if (!resources.mcpConfigPath) throw new Error('--emit-mcp requires MCP to be enabled');\n\n const emitted = await persistMcpConfig(resources.mcpConfigPath, resources.temporaryDirectory, options.emitMcp);\n process.stdout.write(`${emitted}\\n`);\n return 0;\n}\n\n/** Compatibility API. Executables call the command function directly. */\nexport class EmitMcpCommand extends BaseCommand {\n readonly name = 'emit-mcp';\n\n matches(options: HarnessOptions): boolean {\n return Boolean(options.emitMcp);\n }\n\n async execute(context: HarnessContext): Promise<number> {\n return runEmitMcp(context);\n }\n}\n"],"mappings":";;;;;;;;;AAYA,eAAsB,WAAW,SAA0C;CACzE,MAAM,EAAE,SAAS,cAAc;CAC/B,IAAI,CAAC,QAAQ,SAAS,MAAM,IAAI,MAAM,wCAAwC;CAC9E,IAAI,CAAC,UAAU,eAAe,MAAM,IAAI,MAAM,uCAAuC;CAErF,MAAM,UAAU,OAAA,GAAMA,yBAAAA,iBAAAA,CAAiB,UAAU,eAAe,UAAU,oBAAoB,QAAQ,OAAO;CAC7G,QAAQ,OAAO,MAAM,GAAG,QAAQ,GAAG;CACnC,OAAO;AACT;;AAGA,IAAa,iBAAb,cAAoCC,oBAAAA,YAAY;CAC9C,OAAgB;CAEhB,QAAQ,SAAkC;EACxC,OAAO,QAAQ,QAAQ,OAAO;CAChC;CAEA,MAAM,QAAQ,SAA0C;EACtD,OAAO,WAAW,OAAO;CAC3B;AACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HarnessOptions } from "../../../composition/types/harness.mjs";
|
|
2
|
+
import { HarnessContext } from "../../../builders/cli/harnessContext.mjs";
|
|
3
|
+
import { BaseCommand } from "../baseCommand.mjs";
|
|
4
|
+
//#region src/cli/commands/emit-mcp/index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Writes the resolved MCP config to a directory and exits.
|
|
7
|
+
*
|
|
8
|
+
* Lets claude.sh and codex.sh reuse the same domain-scoped MCP surface instead
|
|
9
|
+
* of reimplementing the filter in shell.
|
|
10
|
+
*/
|
|
11
|
+
export declare function runEmitMcp(context: HarnessContext): Promise<number>;
|
|
12
|
+
/** Compatibility API. Executables call the command function directly. */
|
|
13
|
+
export declare class EmitMcpCommand extends BaseCommand {
|
|
14
|
+
readonly name = "emit-mcp";
|
|
15
|
+
matches(options: HarnessOptions): boolean;
|
|
16
|
+
execute(context: HarnessContext): Promise<number>;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../../src/cli/commands/emit-mcp/index.ts"],"mappings":";;;;;;;;;;wBAYsB,WAAW,SAAS,iBAAiB;;qBAW9C,uBAAuB;WACzB;EAET,QAAQ,SAAS;EAIX,QAAQ,SAAS,iBAAiB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseCommand } from "../baseCommand.mjs";
|
|
2
|
+
import { persistMcpConfig } from "@agimon-ai/po-domain/mcp";
|
|
3
|
+
//#region src/cli/commands/emit-mcp/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* Writes the resolved MCP config to a directory and exits.
|
|
6
|
+
*
|
|
7
|
+
* Lets claude.sh and codex.sh reuse the same domain-scoped MCP surface instead
|
|
8
|
+
* of reimplementing the filter in shell.
|
|
9
|
+
*/
|
|
10
|
+
async function runEmitMcp(context) {
|
|
11
|
+
const { options, resources } = context;
|
|
12
|
+
if (!options.emitMcp) throw new Error("--emit-mcp requires a target directory");
|
|
13
|
+
if (!resources.mcpConfigPath) throw new Error("--emit-mcp requires MCP to be enabled");
|
|
14
|
+
const emitted = await persistMcpConfig(resources.mcpConfigPath, resources.temporaryDirectory, options.emitMcp);
|
|
15
|
+
process.stdout.write(`${emitted}\n`);
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
/** Compatibility API. Executables call the command function directly. */
|
|
19
|
+
var EmitMcpCommand = class extends BaseCommand {
|
|
20
|
+
name = "emit-mcp";
|
|
21
|
+
matches(options) {
|
|
22
|
+
return Boolean(options.emitMcp);
|
|
23
|
+
}
|
|
24
|
+
async execute(context) {
|
|
25
|
+
return runEmitMcp(context);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { EmitMcpCommand, runEmitMcp };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/cli/commands/emit-mcp/index.ts"],"sourcesContent":["import { persistMcpConfig } from '@agimon-ai/po-domain/mcp';\n\nimport type { HarnessContext } from '../../../builders/cli/harnessContext';\nimport type { HarnessOptions } from '../../../composition/types/harness';\nimport { BaseCommand } from '../baseCommand';\n\n/**\n * Writes the resolved MCP config to a directory and exits.\n *\n * Lets claude.sh and codex.sh reuse the same domain-scoped MCP surface instead\n * of reimplementing the filter in shell.\n */\nexport async function runEmitMcp(context: HarnessContext): Promise<number> {\n const { options, resources } = context;\n if (!options.emitMcp) throw new Error('--emit-mcp requires a target directory');\n if (!resources.mcpConfigPath) throw new Error('--emit-mcp requires MCP to be enabled');\n\n const emitted = await persistMcpConfig(resources.mcpConfigPath, resources.temporaryDirectory, options.emitMcp);\n process.stdout.write(`${emitted}\\n`);\n return 0;\n}\n\n/** Compatibility API. Executables call the command function directly. */\nexport class EmitMcpCommand extends BaseCommand {\n readonly name = 'emit-mcp';\n\n matches(options: HarnessOptions): boolean {\n return Boolean(options.emitMcp);\n }\n\n async execute(context: HarnessContext): Promise<number> {\n return runEmitMcp(context);\n }\n}\n"],"mappings":";;;;;;;;;AAYA,eAAsB,WAAW,SAA0C;CACzE,MAAM,EAAE,SAAS,cAAc;CAC/B,IAAI,CAAC,QAAQ,SAAS,MAAM,IAAI,MAAM,wCAAwC;CAC9E,IAAI,CAAC,UAAU,eAAe,MAAM,IAAI,MAAM,uCAAuC;CAErF,MAAM,UAAU,MAAM,iBAAiB,UAAU,eAAe,UAAU,oBAAoB,QAAQ,OAAO;CAC7G,QAAQ,OAAO,MAAM,GAAG,QAAQ,GAAG;CACnC,OAAO;AACT;;AAGA,IAAa,iBAAb,cAAoC,YAAY;CAC9C,OAAgB;CAEhB,QAAQ,SAAkC;EACxC,OAAO,QAAQ,QAAQ,OAAO;CAChC;CAEA,MAAM,QAAQ,SAA0C;EACtD,OAAO,WAAW,OAAO;CAC3B;AACF"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
const require_runtime = require("../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_baseCommand = require("../baseCommand.cjs");
|
|
3
|
+
let node_fs = require("node:fs");
|
|
4
|
+
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
5
|
+
let node_path = require("node:path");
|
|
6
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
7
|
+
let _agimon_ai_po_config = require("@agimon-ai/po-config");
|
|
8
|
+
let _agimon_ai_po_core_mcpSchemaCost = require("@agimon-ai/po-core/mcpSchemaCost");
|
|
9
|
+
let _agimon_ai_po_skill_catalog = require("@agimon-ai/po-skill/catalog");
|
|
10
|
+
//#region src/cli/commands/explain/index.ts
|
|
11
|
+
function readMcpServers(configPath) {
|
|
12
|
+
return JSON.parse(node_fs.default.readFileSync(configPath, "utf8")).mcpServers ?? {};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders the resolved matrix for --explain. Composition spans three config
|
|
16
|
+
* files, so this answers "why is that loaded" in one command instead of a
|
|
17
|
+
* manual trace through domains, major modes, and plugin subsets.
|
|
18
|
+
*/
|
|
19
|
+
function explainMatrix(explanation) {
|
|
20
|
+
const section = (label, values, empty = "(none)") => `${label}:\n${values.length === 0 ? ` ${empty}` : values.map((value) => ` ${value}`).join("\n")}\n`;
|
|
21
|
+
return [
|
|
22
|
+
`po resolved matrix\n\n`,
|
|
23
|
+
`major mode: ${explanation.majorMode}\n\n`,
|
|
24
|
+
section("profile", explanation.profile ? [explanation.profile] : [], "(none)"),
|
|
25
|
+
"\n",
|
|
26
|
+
section("persona", explanation.persona ? [explanation.persona] : [], "(none)"),
|
|
27
|
+
"\n",
|
|
28
|
+
section("domains (content)", explanation.domains),
|
|
29
|
+
"\n",
|
|
30
|
+
section("layers (behavior, from the major mode)", explanation.layers, "core only"),
|
|
31
|
+
"\n",
|
|
32
|
+
section("hook groups from layers", explanation.hookGroups, explanation.hooksEnabled ? "(core groups only)" : "(hooks disabled)"),
|
|
33
|
+
"\n",
|
|
34
|
+
section("plugins", explanation.plugins.map((directory) => node_path.default.basename(directory))),
|
|
35
|
+
"\n",
|
|
36
|
+
section("skill paths", explanation.skillDirectories.map((directory) => node_path.default.relative(process.cwd(), directory))),
|
|
37
|
+
"\n",
|
|
38
|
+
section(explanation.mcpFiltered ? "mcp servers (filtered by domain allowlist)" : "mcp servers (unfiltered)", explanation.mcpServers, "(mcp disabled)"),
|
|
39
|
+
"\n",
|
|
40
|
+
explanation.mcpProxyUpstreams ? section("mcp proxy upstreams (filtered)", explanation.mcpProxyUpstreams) : "mcp proxy upstreams:\n (unfiltered, every upstream in mcp-config.yaml)\n",
|
|
41
|
+
"\n",
|
|
42
|
+
`skills: ${explanation.skillCount} (from ${explanation.skillDirectories.length} paths)\n`,
|
|
43
|
+
`agents: ${explanation.agentCount}\n`,
|
|
44
|
+
`mcp config: ${explanation.mcpConfigPath ?? "(disabled)"}\n`,
|
|
45
|
+
explanation.cost ? renderCost(explanation.cost) : ""
|
|
46
|
+
].join("");
|
|
47
|
+
}
|
|
48
|
+
const TOKEN_COLUMN = 9;
|
|
49
|
+
function tokenLine(label, tokens, note = "") {
|
|
50
|
+
const row = ` ${label.padEnd(16)}${tokens.toLocaleString("en-US").padStart(TOKEN_COLUMN)}`;
|
|
51
|
+
return `${note ? `${row} ${note}` : row}\n`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The bill, rendered last so the sections above keep their order.
|
|
55
|
+
*
|
|
56
|
+
* Skill and persona figures are derived from files on disk and MCP figures
|
|
57
|
+
* from a cached handshake, so two runs of the same selection print the same
|
|
58
|
+
* numbers and a reader can reproduce them without trusting this output.
|
|
59
|
+
*/
|
|
60
|
+
function renderCost(cost) {
|
|
61
|
+
const startup = cost.skillPromptTokens + cost.personaTokens + cost.mcpToolTokens;
|
|
62
|
+
const unpriced = cost.mcpServers.filter((server) => server.unavailable);
|
|
63
|
+
return [
|
|
64
|
+
"\ncontext cost (tokens)\n",
|
|
65
|
+
tokenLine("skills prompt", cost.skillPromptTokens, "always on"),
|
|
66
|
+
tokenLine("persona", cost.personaTokens, "always on"),
|
|
67
|
+
tokenLine("mcp tools", cost.mcpToolTokens, mcpNote(cost.mcpServers)),
|
|
68
|
+
tokenLine("startup total", startup),
|
|
69
|
+
tokenLine("skill bodies", cost.skillBodyTokens, "read on demand"),
|
|
70
|
+
...cost.mcpServers.filter((server) => !server.unavailable).map(serverLine),
|
|
71
|
+
unpriced.length > 0 ? `\n Not priced: ${unpriced.map((server) => `${server.name} (${server.unavailable})`).join(", ")}\n` : "",
|
|
72
|
+
"\n Excludes skills contributed by extensions, which register after startup.\n"
|
|
73
|
+
].join("");
|
|
74
|
+
}
|
|
75
|
+
function mcpNote(servers) {
|
|
76
|
+
const priced = servers.filter((server) => !server.unavailable);
|
|
77
|
+
if (priced.length === 0) return "always on";
|
|
78
|
+
return `always on, ${priced.reduce((total, server) => total + server.toolCount, 0)} tools from ${priced.length} server${priced.length === 1 ? "" : "s"}`;
|
|
79
|
+
}
|
|
80
|
+
function serverLine(server) {
|
|
81
|
+
return tokenLine(` ${server.name}`, server.tokens, server.cached ? "cached" : "measured now");
|
|
82
|
+
}
|
|
83
|
+
/** Prints the fully resolved matrix instead of launching Pi. */
|
|
84
|
+
async function costExplain(context) {
|
|
85
|
+
const { options, resources } = context;
|
|
86
|
+
try {
|
|
87
|
+
const [catalog, countTokens] = await Promise.all([(0, _agimon_ai_po_skill_catalog.buildSkillCatalog)({
|
|
88
|
+
repoRoot: options.repoRoot,
|
|
89
|
+
activeSkillDirectories: resources.skillDirectories,
|
|
90
|
+
extensionSources: []
|
|
91
|
+
}), (0, _agimon_ai_po_skill_catalog.counter)()]);
|
|
92
|
+
const persona = context.personaDirectory ? (0, _agimon_ai_po_config.buildPersonaPrompt)(context.personaRoot ?? options.repoRoot, context.personaDirectory) : void 0;
|
|
93
|
+
const mcp = resources.mcpConfigPath ? await (0, _agimon_ai_po_core_mcpSchemaCost.priceMcpToolSchemas)({
|
|
94
|
+
configPath: resources.mcpConfigPath,
|
|
95
|
+
homeDoomDirectory: (0, _agimon_ai_po_config.globalDoomConfigDirectory)(),
|
|
96
|
+
cwd: options.repoRoot,
|
|
97
|
+
environment: context.environment,
|
|
98
|
+
countTokens
|
|
99
|
+
}) : {
|
|
100
|
+
servers: [],
|
|
101
|
+
totalTokens: 0
|
|
102
|
+
};
|
|
103
|
+
return {
|
|
104
|
+
skillPromptTokens: catalog.promptTokens,
|
|
105
|
+
skillBodyTokens: catalog.bodyTokens,
|
|
106
|
+
personaTokens: persona ? countTokens(persona) : 0,
|
|
107
|
+
mcpServers: mcp.servers,
|
|
108
|
+
mcpToolTokens: mcp.totalTokens
|
|
109
|
+
};
|
|
110
|
+
} catch (error) {
|
|
111
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
112
|
+
process.stderr.write(`[po] explain: could not price the selection: ${detail}\n`);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async function runExplain(context) {
|
|
117
|
+
const { options, resources, plugins, mcpAllowlist } = context;
|
|
118
|
+
const cost = await costExplain(context);
|
|
119
|
+
process.stdout.write(explainMatrix({
|
|
120
|
+
cost,
|
|
121
|
+
majorMode: options.majorMode,
|
|
122
|
+
profile: context.profile,
|
|
123
|
+
persona: context.personaDirectory,
|
|
124
|
+
domains: options.domains,
|
|
125
|
+
plugins: plugins.map((entry) => entry.directory),
|
|
126
|
+
layers: context.selectedLayers,
|
|
127
|
+
hookGroups: context.hookGroups,
|
|
128
|
+
hooksEnabled: options.hooks,
|
|
129
|
+
skillDirectories: resources.skillDirectories,
|
|
130
|
+
skillCount: resources.skillCount,
|
|
131
|
+
agentCount: resources.agentCount,
|
|
132
|
+
agentDirectories: resources.agentDirectories,
|
|
133
|
+
mcpConfigPath: resources.mcpConfigPath,
|
|
134
|
+
mcpServers: resources.mcpConfigPath ? Object.keys(readMcpServers(resources.mcpConfigPath)) : [],
|
|
135
|
+
mcpProxyUpstreams: mcpAllowlist?.proxy,
|
|
136
|
+
mcpFiltered: Boolean(mcpAllowlist)
|
|
137
|
+
}));
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
/** Compatibility API. Executables call the command function directly. */
|
|
141
|
+
var ExplainCommand = class extends require_baseCommand.BaseCommand {
|
|
142
|
+
name = "explain";
|
|
143
|
+
matches(options) {
|
|
144
|
+
return options.explain;
|
|
145
|
+
}
|
|
146
|
+
async execute(context) {
|
|
147
|
+
return runExplain(context);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
//#endregion
|
|
151
|
+
exports.ExplainCommand = ExplainCommand;
|
|
152
|
+
exports.explainMatrix = explainMatrix;
|
|
153
|
+
exports.runExplain = runExplain;
|
|
154
|
+
|
|
155
|
+
//# sourceMappingURL=index.cjs.map
|