@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,84 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
//#region src/builders/server/mcpBundle.ts
|
|
4
|
+
function packageRootOf(entry) {
|
|
5
|
+
let directory = path.dirname(fs.realpathSync(entry));
|
|
6
|
+
for (;;) {
|
|
7
|
+
if (fs.existsSync(path.join(directory, "package.json"))) return directory;
|
|
8
|
+
const parent = path.dirname(directory);
|
|
9
|
+
if (parent === directory) throw new Error(`No package manifest owns ${entry}`);
|
|
10
|
+
directory = parent;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function packagePath(packageDir, field, value) {
|
|
14
|
+
if (typeof value !== "string" || !value.startsWith("./") || value.includes("..")) throw new Error(`poMcp ${field} in ${packageDir} must be a package-relative ./path with no '..'.`);
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
function declaredMcpPlugin(packageDir, manifest) {
|
|
18
|
+
const value = manifest.poMcp;
|
|
19
|
+
if (value === void 0) return void 0;
|
|
20
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error(`poMcp manifest in ${packageDir} must be an object.`);
|
|
21
|
+
const declaration = value;
|
|
22
|
+
if (!Array.isArray(declaration.scopes) || declaration.scopes.length !== 1 || declaration.scopes[0] !== "session") throw new Error(`poMcp scopes in ${packageDir} must be exactly ['session'].`);
|
|
23
|
+
const packageName = manifest.name;
|
|
24
|
+
if (typeof packageName !== "string" || packageName === "") throw new Error(`Package in ${packageDir} has no name.`);
|
|
25
|
+
let ui;
|
|
26
|
+
if (declaration.ui !== void 0) {
|
|
27
|
+
const value = declaration.ui;
|
|
28
|
+
if (typeof value !== "object" || value === null || !Array.isArray(value.widgets) || value.widgets.some((key) => typeof key !== "string" || !key.startsWith(`${packageName}/`)) || new Set(value.widgets).size !== value.widgets.length) throw new Error(`Invalid MCP widget manifest in ${packageDir}`);
|
|
29
|
+
ui = {
|
|
30
|
+
dist: packagePath(packageDir, "ui.dist", value.dist),
|
|
31
|
+
widgets: value.widgets
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
packageName,
|
|
36
|
+
packageDir,
|
|
37
|
+
...ui === void 0 ? {} : { ui },
|
|
38
|
+
entry: packagePath(packageDir, "entry", declaration.entry),
|
|
39
|
+
dist: packagePath(packageDir, "dist", declaration.dist)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The MCP plugins the given compositions select, in first-selection order.
|
|
44
|
+
*
|
|
45
|
+
* A package that two different directories claim is ambiguous, and a built
|
|
46
|
+
* entry that resolves outside its package is refused.
|
|
47
|
+
*/
|
|
48
|
+
function mcpPluginCandidates(compositions) {
|
|
49
|
+
const packages = /* @__PURE__ */ new Map();
|
|
50
|
+
for (const composition of compositions) {
|
|
51
|
+
const majorMode = composition.majorMode?.name;
|
|
52
|
+
if (!majorMode) throw new Error("An MCP bundle composition needs its major mode");
|
|
53
|
+
for (const root of new Set(composition.packageEntries.map(packageRootOf))) {
|
|
54
|
+
const declaration = declaredMcpPlugin(root, JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8")));
|
|
55
|
+
if (declaration === void 0) continue;
|
|
56
|
+
const previous = packages.get(declaration.packageName);
|
|
57
|
+
if (previous && previous.declaration.packageDir !== root) throw new Error(`Ambiguous MCP bundle package: ${declaration.packageName}`);
|
|
58
|
+
const candidate = previous ?? {
|
|
59
|
+
declaration,
|
|
60
|
+
owners: []
|
|
61
|
+
};
|
|
62
|
+
const layers = composition.selections.filter((selection) => selection.outcome === "resolved" && selection.path && packageRootOf(selection.path) === root).map((selection) => selection.layer);
|
|
63
|
+
for (const layer of new Set(layers.length > 0 ? layers : ["default"])) if (!candidate.owners.some((owner) => owner.majorMode === majorMode && owner.layer === layer)) candidate.owners.push({
|
|
64
|
+
majorMode,
|
|
65
|
+
layer
|
|
66
|
+
});
|
|
67
|
+
packages.set(declaration.packageName, candidate);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return [...packages.values()].map(({ declaration, owners }) => {
|
|
71
|
+
const module = fs.realpathSync(path.resolve(declaration.packageDir, declaration.dist));
|
|
72
|
+
const relative = path.relative(declaration.packageDir, module);
|
|
73
|
+
if (relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) throw new Error(`MCP entry escapes package: ${declaration.packageName}`);
|
|
74
|
+
return {
|
|
75
|
+
declaration,
|
|
76
|
+
module,
|
|
77
|
+
owners
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { mcpPluginCandidates };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=mcpBundle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpBundle.mjs","names":[],"sources":["../../../../src/builders/server/mcpBundle.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { DoomServerBundleOwner } from '@agimon-ai/po-core/serverFacet';\n\nimport type { ExtensionComposition } from '../cli/extensionAssembler';\n\nexport interface DeclaredMcpPlugin {\n readonly packageName: string;\n readonly packageDir: string;\n readonly entry: string;\n readonly dist: string;\n readonly ui?: { readonly dist: string; readonly widgets: readonly string[] };\n}\n\nfunction packageRootOf(entry: string): string {\n let directory = path.dirname(fs.realpathSync(entry));\n for (;;) {\n if (fs.existsSync(path.join(directory, 'package.json'))) return directory;\n const parent = path.dirname(directory);\n if (parent === directory) throw new Error(`No package manifest owns ${entry}`);\n directory = parent;\n }\n}\n\nfunction packagePath(packageDir: string, field: string, value: unknown): string {\n if (typeof value !== 'string' || !value.startsWith('./') || value.includes('..'))\n throw new Error(`poMcp ${field} in ${packageDir} must be a package-relative ./path with no '..'.`);\n return value;\n}\n\nfunction declaredMcpPlugin(packageDir: string, manifest: Record<string, unknown>): DeclaredMcpPlugin | undefined {\n const value = manifest.poMcp;\n if (value === undefined) return undefined;\n if (typeof value !== 'object' || value === null || Array.isArray(value))\n throw new Error(`poMcp manifest in ${packageDir} must be an object.`);\n const declaration = value as Record<string, unknown>;\n if (!Array.isArray(declaration.scopes) || declaration.scopes.length !== 1 || declaration.scopes[0] !== 'session')\n throw new Error(`poMcp scopes in ${packageDir} must be exactly ['session'].`);\n const packageName = manifest.name;\n if (typeof packageName !== 'string' || packageName === '') throw new Error(`Package in ${packageDir} has no name.`);\n let ui: DeclaredMcpPlugin['ui'];\n if (declaration.ui !== undefined) {\n const value = declaration.ui as { dist?: unknown; widgets?: unknown } | null;\n if (\n typeof value !== 'object' ||\n value === null ||\n !Array.isArray(value.widgets) ||\n value.widgets.some((key: unknown) => typeof key !== 'string' || !key.startsWith(`${packageName}/`)) ||\n new Set(value.widgets).size !== value.widgets.length\n )\n throw new Error(`Invalid MCP widget manifest in ${packageDir}`);\n ui = { dist: packagePath(packageDir, 'ui.dist', value.dist), widgets: value.widgets as string[] };\n }\n return {\n packageName,\n packageDir,\n ...(ui === undefined ? {} : { ui }),\n entry: packagePath(packageDir, 'entry', declaration.entry),\n dist: packagePath(packageDir, 'dist', declaration.dist),\n };\n}\n\n/** One MCP plugin a composition set selects, with the built entry a host imports. */\nexport interface McpPluginCandidate {\n readonly declaration: DeclaredMcpPlugin;\n /** Absolute, symlink-resolved path of the package's built `dist` entry. */\n readonly module: string;\n /** Every major mode and layer that admitted the package. */\n readonly owners: readonly DoomServerBundleOwner[];\n}\n\n/**\n * The MCP plugins the given compositions select, in first-selection order.\n *\n * A package that two different directories claim is ambiguous, and a built\n * entry that resolves outside its package is refused.\n */\nexport function mcpPluginCandidates(compositions: readonly ExtensionComposition[]): McpPluginCandidate[] {\n const packages = new Map<string, { declaration: DeclaredMcpPlugin; owners: DoomServerBundleOwner[] }>();\n for (const composition of compositions) {\n const majorMode = composition.majorMode?.name;\n if (!majorMode) throw new Error('An MCP bundle composition needs its major mode');\n for (const root of new Set(composition.packageEntries.map(packageRootOf))) {\n const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')) as Record<string, unknown>;\n const declaration = declaredMcpPlugin(root, manifest);\n if (declaration === undefined) continue;\n const previous = packages.get(declaration.packageName);\n if (previous && previous.declaration.packageDir !== root)\n throw new Error(`Ambiguous MCP bundle package: ${declaration.packageName}`);\n const candidate = previous ?? { declaration, owners: [] };\n const layers = composition.selections\n .filter(\n (selection) => selection.outcome === 'resolved' && selection.path && packageRootOf(selection.path) === root,\n )\n .map((selection) => selection.layer);\n for (const layer of new Set(layers.length > 0 ? layers : ['default'])) {\n if (!candidate.owners.some((owner) => owner.majorMode === majorMode && owner.layer === layer))\n candidate.owners.push({ majorMode, layer });\n }\n packages.set(declaration.packageName, candidate);\n }\n }\n return [...packages.values()].map(({ declaration, owners }) => {\n const module = fs.realpathSync(path.resolve(declaration.packageDir, declaration.dist));\n const relative = path.relative(declaration.packageDir, module);\n if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))\n throw new Error(`MCP entry escapes package: ${declaration.packageName}`);\n return { declaration, module, owners };\n });\n}\n"],"mappings":";;;AAeA,SAAS,cAAc,OAAuB;CAC5C,IAAI,YAAY,KAAK,QAAQ,GAAG,aAAa,KAAK,CAAC;CACnD,SAAS;EACP,IAAI,GAAG,WAAW,KAAK,KAAK,WAAW,cAAc,CAAC,GAAG,OAAO;EAChE,MAAM,SAAS,KAAK,QAAQ,SAAS;EACrC,IAAI,WAAW,WAAW,MAAM,IAAI,MAAM,4BAA4B,OAAO;EAC7E,YAAY;CACd;AACF;AAEA,SAAS,YAAY,YAAoB,OAAe,OAAwB;CAC9E,IAAI,OAAO,UAAU,YAAY,CAAC,MAAM,WAAW,IAAI,KAAK,MAAM,SAAS,IAAI,GAC7E,MAAM,IAAI,MAAM,SAAS,MAAM,MAAM,WAAW,iDAAiD;CACnG,OAAO;AACT;AAEA,SAAS,kBAAkB,YAAoB,UAAkE;CAC/G,MAAM,QAAQ,SAAS;CACvB,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;CAChC,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GACpE,MAAM,IAAI,MAAM,qBAAqB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CAAC;GACpD,IAAI,gBAAgB,KAAA,GAAW;GAC/B,MAAM,WAAW,SAAS,IAAI,YAAY,WAAW;GACrD,IAAI,YAAY,SAAS,YAAY,eAAe,MAClD,MAAM,IAAI,MAAM,iCAAiC,YAAY,aAAa;GAC5E,MAAM,YAAY,YAAY;IAAE;IAAa,QAAQ,CAAC;GAAE;GACxD,MAAM,SAAS,YAAY,WACxB,QACE,cAAc,UAAU,YAAY,cAAc,UAAU,QAAQ,cAAc,UAAU,IAAI,MAAM,IACzG,CAAC,CACA,KAAK,cAAc,UAAU,KAAK;GACrC,KAAK,MAAM,SAAS,IAAI,IAAI,OAAO,SAAS,IAAI,SAAS,CAAC,SAAS,CAAC,GAClE,IAAI,CAAC,UAAU,OAAO,MAAM,UAAU,MAAM,cAAc,aAAa,MAAM,UAAU,KAAK,GAC1F,UAAU,OAAO,KAAK;IAAE;IAAW;GAAM,CAAC;GAE9C,SAAS,IAAI,YAAY,aAAa,SAAS;EACjD;CACF;CACA,OAAO,CAAC,GAAG,SAAS,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,aAAa,aAAa;EAC7D,MAAM,SAAS,GAAG,aAAa,KAAK,QAAQ,YAAY,YAAY,YAAY,IAAI,CAAC;EACrF,MAAM,WAAW,KAAK,SAAS,YAAY,YAAY,MAAM;EAC7D,IAAI,aAAa,QAAQ,SAAS,WAAW,KAAK,KAAK,KAAK,KAAK,KAAK,WAAW,QAAQ,GACvF,MAAM,IAAI,MAAM,8BAA8B,YAAY,aAAa;EACzE,OAAO;GAAE;GAAa;GAAQ;EAAO;CACvC,CAAC;AACH"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//#region src/builders/server/packageReloadCheck.ts
|
|
2
|
+
function createPackageReloadCheck() {
|
|
3
|
+
const committed = /* @__PURE__ */ new Map();
|
|
4
|
+
const byModule = (identities) => new Map(identities.map((identity) => [identity.module, identity]));
|
|
5
|
+
return {
|
|
6
|
+
diff(scope, identities) {
|
|
7
|
+
const previous = committed.get(scope);
|
|
8
|
+
const current = byModule(identities);
|
|
9
|
+
if (previous === void 0) return {
|
|
10
|
+
first: true,
|
|
11
|
+
changed: [...new Set(identities.map((identity) => identity.url))],
|
|
12
|
+
reselected: [],
|
|
13
|
+
removed: [],
|
|
14
|
+
superseded: []
|
|
15
|
+
};
|
|
16
|
+
const kept = [...current.values()].filter((identity) => previous.get(identity.module)?.url === identity.url);
|
|
17
|
+
return {
|
|
18
|
+
first: false,
|
|
19
|
+
changed: [...new Set([...current.values()].filter((identity) => previous.get(identity.module)?.url !== identity.url).map((identity) => identity.url))],
|
|
20
|
+
reselected: kept.filter((identity) => previous.get(identity.module)?.selection !== identity.selection).map((identity) => identity.module),
|
|
21
|
+
removed: [...previous.keys()].filter((module) => !current.has(module)),
|
|
22
|
+
superseded: [...new Set([...current.values()].flatMap((identity) => {
|
|
23
|
+
const before = previous.get(identity.module)?.url;
|
|
24
|
+
return before !== void 0 && before !== identity.url ? [before] : [];
|
|
25
|
+
}))]
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
commit(scope, identities) {
|
|
29
|
+
committed.set(scope, byModule(identities));
|
|
30
|
+
},
|
|
31
|
+
forget(scope) {
|
|
32
|
+
committed.delete(scope);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Imports each URL once per process.
|
|
38
|
+
*
|
|
39
|
+
* Package URLs are content-addressed, so a URL already imported is the same code: a
|
|
40
|
+
* reload re-imports only the URLs whose content changed. Native `import()` caches by URL
|
|
41
|
+
* too; this keeps that guarantee explicit and observable for the loaders that take an
|
|
42
|
+
* `importer` seam. A failed import is not cached, so the poison set decides retries.
|
|
43
|
+
*/
|
|
44
|
+
function createLiveModuleCache(importer = (url) => import(url)) {
|
|
45
|
+
const modules = /* @__PURE__ */ new Map();
|
|
46
|
+
return (url) => {
|
|
47
|
+
let module = modules.get(url);
|
|
48
|
+
if (module === void 0) {
|
|
49
|
+
module = importer(url);
|
|
50
|
+
modules.set(url, module);
|
|
51
|
+
module.catch(() => {
|
|
52
|
+
if (modules.get(url) === module) modules.delete(url);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return module;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
exports.createLiveModuleCache = createLiveModuleCache;
|
|
60
|
+
exports.createPackageReloadCheck = createPackageReloadCheck;
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=packageReloadCheck.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageReloadCheck.cjs","names":[],"sources":["../../../../src/builders/server/packageReloadCheck.ts"],"sourcesContent":["/** One package entry a scope loads, identified by the URL its current content imports from. */\nexport interface ScopePackageIdentity {\n /** The resolved entry file, stable across rebuilds. */\n readonly module: string;\n /** Content-addressed import URL from `packageUrls`; a new URL means new content. */\n readonly url: string;\n /**\n * What else decides whether the scope loads this entry (ownership, selected mode). A\n * change remounts the scope without importing anything new.\n */\n readonly selection?: string;\n}\n\nexport interface ScopeChange {\n /** No identities were recorded for this scope before. */\n readonly first: boolean;\n /** URLs that are new to the scope: added entries and entries whose content changed. */\n readonly changed: readonly string[];\n /** Entries whose URL is the same but whose selection changed. */\n readonly reselected: readonly string[];\n /** Entries the scope no longer loads. */\n readonly removed: readonly string[];\n /** Previously committed URLs that a newer URL of the same entry replaces. */\n readonly superseded: readonly string[];\n}\n\nexport interface PackageReloadCheck {\n /**\n * Compares a scope's current identities with the ones it last committed. Nothing is\n * recorded until `commit`, so a reload that fails is retried by the next check.\n */\n diff(scope: string, identities: readonly ScopePackageIdentity[]): ScopeChange;\n commit(scope: string, identities: readonly ScopePackageIdentity[]): void;\n forget(scope: string): void;\n}\n\nexport function createPackageReloadCheck(): PackageReloadCheck {\n const committed = new Map<string, ReadonlyMap<string, ScopePackageIdentity>>();\n const byModule = (identities: readonly ScopePackageIdentity[]) =>\n new Map(identities.map((identity) => [identity.module, identity]));\n return {\n diff(scope, identities) {\n const previous = committed.get(scope);\n const current = byModule(identities);\n if (previous === undefined)\n return {\n first: true,\n changed: [...new Set(identities.map((identity) => identity.url))],\n reselected: [],\n removed: [],\n superseded: [],\n };\n const kept = [...current.values()].filter((identity) => previous.get(identity.module)?.url === identity.url);\n return {\n first: false,\n changed: [\n ...new Set(\n [...current.values()]\n .filter((identity) => previous.get(identity.module)?.url !== identity.url)\n .map((identity) => identity.url),\n ),\n ],\n reselected: kept\n .filter((identity) => previous.get(identity.module)?.selection !== identity.selection)\n .map((identity) => identity.module),\n removed: [...previous.keys()].filter((module) => !current.has(module)),\n superseded: [\n ...new Set(\n [...current.values()].flatMap((identity) => {\n const before = previous.get(identity.module)?.url;\n return before !== undefined && before !== identity.url ? [before] : [];\n }),\n ),\n ],\n };\n },\n commit(scope, identities) {\n committed.set(scope, byModule(identities));\n },\n forget(scope) {\n committed.delete(scope);\n },\n };\n}\n\n/**\n * Imports each URL once per process.\n *\n * Package URLs are content-addressed, so a URL already imported is the same code: a\n * reload re-imports only the URLs whose content changed. Native `import()` caches by URL\n * too; this keeps that guarantee explicit and observable for the loaders that take an\n * `importer` seam. A failed import is not cached, so the poison set decides retries.\n */\nexport function createLiveModuleCache(\n importer: (url: string) => Promise<unknown> = (url) => import(url),\n): (url: string) => Promise<unknown> {\n const modules = new Map<string, Promise<unknown>>();\n return (url) => {\n let module = modules.get(url);\n if (module === undefined) {\n module = importer(url);\n modules.set(url, module);\n module.catch(() => {\n if (modules.get(url) === module) modules.delete(url);\n });\n }\n return module;\n };\n}\n"],"mappings":";AAoCA,SAAgB,2BAA+C;CAC7D,MAAM,4BAAY,IAAI,IAAuD;CAC7E,MAAM,YAAY,eAChB,IAAI,IAAI,WAAW,KAAK,aAAa,CAAC,SAAS,QAAQ,QAAQ,CAAC,CAAC;CACnE,OAAO;EACL,KAAK,OAAO,YAAY;GACtB,MAAM,WAAW,UAAU,IAAI,KAAK;GACpC,MAAM,UAAU,SAAS,UAAU;GACnC,IA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AAS,QAAQ,IAAI,GAAG;EAC5B,IAAI,WAAW,KAAA,GAAW;GACxB,SAAS,SAAS,GAAG;GACrB,QAAQ,IAAI,KAAK,MAAM;GACvB,OAAO,YAAY;IACjB,IAAI,QAAQ,IAAI,GAAG,MAAM,QAAQ,QAAQ,OAAO,GAAG;GACrD,CAAC;EACH;EACA,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//#region src/builders/server/packageReloadCheck.ts
|
|
2
|
+
function createPackageReloadCheck() {
|
|
3
|
+
const committed = /* @__PURE__ */ new Map();
|
|
4
|
+
const byModule = (identities) => new Map(identities.map((identity) => [identity.module, identity]));
|
|
5
|
+
return {
|
|
6
|
+
diff(scope, identities) {
|
|
7
|
+
const previous = committed.get(scope);
|
|
8
|
+
const current = byModule(identities);
|
|
9
|
+
if (previous === void 0) return {
|
|
10
|
+
first: true,
|
|
11
|
+
changed: [...new Set(identities.map((identity) => identity.url))],
|
|
12
|
+
reselected: [],
|
|
13
|
+
removed: [],
|
|
14
|
+
superseded: []
|
|
15
|
+
};
|
|
16
|
+
const kept = [...current.values()].filter((identity) => previous.get(identity.module)?.url === identity.url);
|
|
17
|
+
return {
|
|
18
|
+
first: false,
|
|
19
|
+
changed: [...new Set([...current.values()].filter((identity) => previous.get(identity.module)?.url !== identity.url).map((identity) => identity.url))],
|
|
20
|
+
reselected: kept.filter((identity) => previous.get(identity.module)?.selection !== identity.selection).map((identity) => identity.module),
|
|
21
|
+
removed: [...previous.keys()].filter((module) => !current.has(module)),
|
|
22
|
+
superseded: [...new Set([...current.values()].flatMap((identity) => {
|
|
23
|
+
const before = previous.get(identity.module)?.url;
|
|
24
|
+
return before !== void 0 && before !== identity.url ? [before] : [];
|
|
25
|
+
}))]
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
commit(scope, identities) {
|
|
29
|
+
committed.set(scope, byModule(identities));
|
|
30
|
+
},
|
|
31
|
+
forget(scope) {
|
|
32
|
+
committed.delete(scope);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Imports each URL once per process.
|
|
38
|
+
*
|
|
39
|
+
* Package URLs are content-addressed, so a URL already imported is the same code: a
|
|
40
|
+
* reload re-imports only the URLs whose content changed. Native `import()` caches by URL
|
|
41
|
+
* too; this keeps that guarantee explicit and observable for the loaders that take an
|
|
42
|
+
* `importer` seam. A failed import is not cached, so the poison set decides retries.
|
|
43
|
+
*/
|
|
44
|
+
function createLiveModuleCache(importer = (url) => import(url)) {
|
|
45
|
+
const modules = /* @__PURE__ */ new Map();
|
|
46
|
+
return (url) => {
|
|
47
|
+
let module = modules.get(url);
|
|
48
|
+
if (module === void 0) {
|
|
49
|
+
module = importer(url);
|
|
50
|
+
modules.set(url, module);
|
|
51
|
+
module.catch(() => {
|
|
52
|
+
if (modules.get(url) === module) modules.delete(url);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return module;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { createLiveModuleCache, createPackageReloadCheck };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=packageReloadCheck.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageReloadCheck.mjs","names":[],"sources":["../../../../src/builders/server/packageReloadCheck.ts"],"sourcesContent":["/** One package entry a scope loads, identified by the URL its current content imports from. */\nexport interface ScopePackageIdentity {\n /** The resolved entry file, stable across rebuilds. */\n readonly module: string;\n /** Content-addressed import URL from `packageUrls`; a new URL means new content. */\n readonly url: string;\n /**\n * What else decides whether the scope loads this entry (ownership, selected mode). A\n * change remounts the scope without importing anything new.\n */\n readonly selection?: string;\n}\n\nexport interface ScopeChange {\n /** No identities were recorded for this scope before. */\n readonly first: boolean;\n /** URLs that are new to the scope: added entries and entries whose content changed. */\n readonly changed: readonly string[];\n /** Entries whose URL is the same but whose selection changed. */\n readonly reselected: readonly string[];\n /** Entries the scope no longer loads. */\n readonly removed: readonly string[];\n /** Previously committed URLs that a newer URL of the same entry replaces. */\n readonly superseded: readonly string[];\n}\n\nexport interface PackageReloadCheck {\n /**\n * Compares a scope's current identities with the ones it last committed. Nothing is\n * recorded until `commit`, so a reload that fails is retried by the next check.\n */\n diff(scope: string, identities: readonly ScopePackageIdentity[]): ScopeChange;\n commit(scope: string, identities: readonly ScopePackageIdentity[]): void;\n forget(scope: string): void;\n}\n\nexport function createPackageReloadCheck(): PackageReloadCheck {\n const committed = new Map<string, ReadonlyMap<string, ScopePackageIdentity>>();\n const byModule = (identities: readonly ScopePackageIdentity[]) =>\n new Map(identities.map((identity) => [identity.module, identity]));\n return {\n diff(scope, identities) {\n const previous = committed.get(scope);\n const current = byModule(identities);\n if (previous === undefined)\n return {\n first: true,\n changed: [...new Set(identities.map((identity) => identity.url))],\n reselected: [],\n removed: [],\n superseded: [],\n };\n const kept = [...current.values()].filter((identity) => previous.get(identity.module)?.url === identity.url);\n return {\n first: false,\n changed: [\n ...new Set(\n [...current.values()]\n .filter((identity) => previous.get(identity.module)?.url !== identity.url)\n .map((identity) => identity.url),\n ),\n ],\n reselected: kept\n .filter((identity) => previous.get(identity.module)?.selection !== identity.selection)\n .map((identity) => identity.module),\n removed: [...previous.keys()].filter((module) => !current.has(module)),\n superseded: [\n ...new Set(\n [...current.values()].flatMap((identity) => {\n const before = previous.get(identity.module)?.url;\n return before !== undefined && before !== identity.url ? [before] : [];\n }),\n ),\n ],\n };\n },\n commit(scope, identities) {\n committed.set(scope, byModule(identities));\n },\n forget(scope) {\n committed.delete(scope);\n },\n };\n}\n\n/**\n * Imports each URL once per process.\n *\n * Package URLs are content-addressed, so a URL already imported is the same code: a\n * reload re-imports only the URLs whose content changed. Native `import()` caches by URL\n * too; this keeps that guarantee explicit and observable for the loaders that take an\n * `importer` seam. A failed import is not cached, so the poison set decides retries.\n */\nexport function createLiveModuleCache(\n importer: (url: string) => Promise<unknown> = (url) => import(url),\n): (url: string) => Promise<unknown> {\n const modules = new Map<string, Promise<unknown>>();\n return (url) => {\n let module = modules.get(url);\n if (module === undefined) {\n module = importer(url);\n modules.set(url, module);\n module.catch(() => {\n if (modules.get(url) === module) modules.delete(url);\n });\n }\n return module;\n };\n}\n"],"mappings":";AAoCA,SAAgB,2BAA+C;CAC7D,MAAM,4BAAY,IAAI,IAAuD;CAC7E,MAAM,YAAY,eAChB,IAAI,IAAI,WAAW,KAAK,aAAa,CAAC,SAAS,QAAQ,QAAQ,CAAC,CAAC;CACnE,OAAO;EACL,KAAK,OAAO,YAAY;GACtB,MAAM,WAAW,UAAU,IAAI,KAAK;GACpC,MAAM,UAAU,SAAS,UAAU;GACnC,IAAI,aAAa,KAAA,GACf,OAAO;IACL,OAAO;IACP,SAAS,CAAC,GAAG,IAAI,IAAI,WAAW,KAAK,aAAa,SAAS,GAAG,CAAC,CAAC;IAChE,YAAY,CAAC;IACb,SAAS,CAAC;IACV,YAAY,CAAC;GACf;GACF,MAAM,OAAO,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC,CAAC,QAAQ,aAAa,SAAS,IAAI,SAAS,MAAM,CAAC,EAAE,QAAQ,SAAS,GAAG;GAC3G,OAAO;IACL,OAAO;IACP,SAAS,CACP,GAAG,IAAI,IACL,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC,CAClB,QAAQ,aAAa,SAAS,IAAI,SAAS,MAAM,CAAC,EAAE,QAAQ,SAAS,GAAG,CAAC,CACzE,KAAK,aAAa,SAAS,GAAG,CACnC,CACF;IACA,YAAY,KACT,QAAQ,aAAa,SAAS,IAAI,SAAS,MAAM,CAAC,EAAE,cAAc,SAAS,SAAS,CAAC,CACrF,KAAK,aAAa,SAAS,MAAM;IACpC,SAAS,CAAC,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,QAAQ,WAAW,CAAC,QAAQ,IAAI,MAAM,CAAC;IACrE,YAAY,CACV,GAAG,IAAI,IACL,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC,CAAC,SAAS,aAAa;KAC1C,MAAM,SAAS,SAAS,IAAI,SAAS,MAAM,CAAC,EAAE;KAC9C,OAAO,WAAW,KAAA,KAAa,WAAW,SAAS,MAAM,CAAC,MAAM,IAAI,CAAC;IACvE,CAAC,CACH,CACF;GACF;EACF;EACA,OAAO,OAAO,YAAY;GACxB,UAAU,IAAI,OAAO,SAAS,UAAU,CAAC;EAC3C;EACA,OAAO,OAAO;GACZ,UAAU,OAAO,KAAK;EACxB;CACF;AACF;;;;;;;;;AAUA,SAAgB,sBACd,YAA+C,QAAQ,OAAO,MAC3B;CACnC,MAAM,0BAAU,IAAI,IAA8B;CAClD,QAAQ,QAAQ;EACd,IAAI,SAAS,QAAQ,IAAI,GAAG;EAC5B,IAAI,WAAW,KAAA,GAAW;GACxB,SAAS,SAAS,GAAG;GACrB,QAAQ,IAAI,KAAK,MAAM;GACvB,OAAO,YAAY;IACjB,IAAI,QAAQ,IAAI,GAAG,MAAM,QAAQ,QAAQ,OAAO,GAAG;GACrD,CAAC;EACH;EACA,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
let node_fs = require("node:fs");
|
|
3
|
+
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
6
|
+
let node_url = require("node:url");
|
|
7
|
+
let node_crypto = require("node:crypto");
|
|
8
|
+
node_crypto = require_runtime.__toESM(node_crypto, 1);
|
|
9
|
+
//#region src/builders/server/packageUrl.ts
|
|
10
|
+
/** Realpath fragments of version-scoped package stores: a new version is a new path. */
|
|
11
|
+
const VERSIONED_STORES = [".upm", ".pnpm"].map((store) => `${node_path.default.sep}node_modules${node_path.default.sep}${store}${node_path.default.sep}`);
|
|
12
|
+
const SNAPSHOT_DIRECTORY = node_path.default.join("node_modules", ".po-snapshots");
|
|
13
|
+
const SETTLE_MS = 300;
|
|
14
|
+
const STABLE_ATTEMPTS = 5;
|
|
15
|
+
/** Build outputs a host never imports. */
|
|
16
|
+
const SKIPPED_SUFFIXES = [
|
|
17
|
+
".map",
|
|
18
|
+
".d.ts",
|
|
19
|
+
".d.mts",
|
|
20
|
+
".d.cts",
|
|
21
|
+
".tsbuildinfo"
|
|
22
|
+
];
|
|
23
|
+
function packageRootOf(file) {
|
|
24
|
+
let directory = node_path.default.dirname(file);
|
|
25
|
+
for (;;) {
|
|
26
|
+
if (node_fs.default.existsSync(node_path.default.join(directory, "package.json"))) return directory;
|
|
27
|
+
const parent = node_path.default.dirname(directory);
|
|
28
|
+
if (parent === directory) return void 0;
|
|
29
|
+
directory = parent;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function isVersioned(root) {
|
|
33
|
+
return VERSIONED_STORES.some((store) => `${root}${node_path.default.sep}`.includes(store));
|
|
34
|
+
}
|
|
35
|
+
function exportTargets(value, condition, into) {
|
|
36
|
+
if (condition === "types") return;
|
|
37
|
+
if (typeof value === "string") {
|
|
38
|
+
if (!value.includes("*")) into.push(value);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (Array.isArray(value)) {
|
|
42
|
+
for (const item of value) exportTargets(item, condition, into);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (typeof value === "object" && value !== null) for (const [key, item] of Object.entries(value)) exportTargets(item, key, into);
|
|
46
|
+
}
|
|
47
|
+
function record(value) {
|
|
48
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
49
|
+
}
|
|
50
|
+
/** Package-relative entry targets the manifest declares for a server-side host. */
|
|
51
|
+
function declaredTargets(manifest) {
|
|
52
|
+
const targets = [];
|
|
53
|
+
exportTargets(manifest.exports, void 0, targets);
|
|
54
|
+
if (typeof manifest.main === "string") targets.push(manifest.main);
|
|
55
|
+
const pi = record(manifest.pi);
|
|
56
|
+
if (Array.isArray(pi?.extensions)) {
|
|
57
|
+
for (const entry of pi.extensions) if (typeof entry === "string") targets.push(entry);
|
|
58
|
+
}
|
|
59
|
+
const server = record(manifest.poServer);
|
|
60
|
+
if (typeof server?.dist === "string") targets.push(server.dist);
|
|
61
|
+
const mcp = record(manifest.poMcp);
|
|
62
|
+
if (typeof mcp?.dist === "string") targets.push(mcp.dist);
|
|
63
|
+
return targets;
|
|
64
|
+
}
|
|
65
|
+
function inside(relative) {
|
|
66
|
+
return relative !== "" && relative !== ".." && !relative.startsWith(`..${node_path.default.sep}`) && !node_path.default.isAbsolute(relative);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The files a snapshot carries, package-relative and sorted.
|
|
70
|
+
*
|
|
71
|
+
* A target's whole top-level directory goes with it: bundlers split entries into
|
|
72
|
+
* sibling chunks the entry imports relatively, so copying only the named file would
|
|
73
|
+
* break the import graph.
|
|
74
|
+
*/
|
|
75
|
+
function snapshotFiles(root, entry) {
|
|
76
|
+
const manifest = JSON.parse(node_fs.default.readFileSync(node_path.default.join(root, "package.json"), "utf8"));
|
|
77
|
+
const targets = [.../* @__PURE__ */ new Set([...declaredTargets(manifest), node_path.default.relative(root, entry)])].map((target) => node_path.default.normalize(target));
|
|
78
|
+
const files = /* @__PURE__ */ new Set(["package.json"]);
|
|
79
|
+
for (const target of targets) {
|
|
80
|
+
if (!inside(target) || target.split(node_path.default.sep)[0] === "node_modules") continue;
|
|
81
|
+
const absolute = node_path.default.join(root, target);
|
|
82
|
+
if (!node_fs.default.existsSync(absolute)) throw new Error(`declared entry is missing: ${target}`);
|
|
83
|
+
const top = target.split(node_path.default.sep)[0];
|
|
84
|
+
const topPath = node_path.default.join(root, top);
|
|
85
|
+
if (top === target || !node_fs.default.statSync(topPath).isDirectory()) {
|
|
86
|
+
files.add(target);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const collect = (directory) => {
|
|
90
|
+
for (const dirent of node_fs.default.readdirSync(directory, { withFileTypes: true })) {
|
|
91
|
+
const file = node_path.default.join(directory, dirent.name);
|
|
92
|
+
if (dirent.isDirectory()) {
|
|
93
|
+
if (dirent.name !== "node_modules") collect(file);
|
|
94
|
+
} else if ((dirent.isFile() || dirent.isSymbolicLink()) && !SKIPPED_SUFFIXES.some((suffix) => dirent.name.endsWith(suffix))) files.add(node_path.default.relative(root, file));
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
collect(topPath);
|
|
98
|
+
}
|
|
99
|
+
return [...files].sort();
|
|
100
|
+
}
|
|
101
|
+
function statSignature(root, files) {
|
|
102
|
+
return files.map((file) => {
|
|
103
|
+
const stat = node_fs.default.statSync(node_path.default.join(root, file));
|
|
104
|
+
return `${file}\0${String(stat.size)}\0${String(stat.mtimeMs)}`;
|
|
105
|
+
}).join("\n");
|
|
106
|
+
}
|
|
107
|
+
function contentHash(root, files) {
|
|
108
|
+
const hash = node_crypto.default.createHash("sha256");
|
|
109
|
+
for (const file of files) {
|
|
110
|
+
hash.update(file).update("\0");
|
|
111
|
+
hash.update(node_fs.default.readFileSync(node_path.default.join(root, file))).update("\0");
|
|
112
|
+
}
|
|
113
|
+
return hash.digest("hex").slice(0, 32);
|
|
114
|
+
}
|
|
115
|
+
function pruneOthers(snapshots, keep) {
|
|
116
|
+
if (!node_fs.default.existsSync(snapshots)) return;
|
|
117
|
+
for (const name of node_fs.default.readdirSync(snapshots)) if (name !== keep) node_fs.default.rmSync(node_path.default.join(snapshots, name), {
|
|
118
|
+
recursive: true,
|
|
119
|
+
force: true
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Maps resolved package entries to import URLs that change only when content changes.
|
|
124
|
+
*
|
|
125
|
+
* A package under a versioned store imports in place: an upgrade is already a new path.
|
|
126
|
+
* Any other package (repo-local, or npm-installed) is snapshotted by content into
|
|
127
|
+
* `<package>/node_modules/.po-snapshots/<hash>/`, with its `package.json` so a
|
|
128
|
+
* self-import by name resolves to the snapshot, while dependencies still resolve
|
|
129
|
+
* from `<package>/node_modules`. A snapshot is taken only when every declared entry
|
|
130
|
+
* exists and two reads `settleMs` apart agree, so a build in progress is never
|
|
131
|
+
* captured. The first snapshot of a package in this process prunes its older ones;
|
|
132
|
+
* later ones keep them, because live sessions may still lazily import from them.
|
|
133
|
+
*/
|
|
134
|
+
function createPackageUrls(options = {}) {
|
|
135
|
+
const settleMs = options.settleMs ?? SETTLE_MS;
|
|
136
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
137
|
+
const states = /* @__PURE__ */ new Map();
|
|
138
|
+
const pending = /* @__PURE__ */ new Map();
|
|
139
|
+
const snapshot = async (root, entry) => {
|
|
140
|
+
const snapshots = node_path.default.join(root, SNAPSHOT_DIRECTORY);
|
|
141
|
+
for (let attempt = 0; attempt < STABLE_ATTEMPTS; attempt++) {
|
|
142
|
+
const files = snapshotFiles(root, entry);
|
|
143
|
+
const signature = statSignature(root, files);
|
|
144
|
+
const previous = states.get(root);
|
|
145
|
+
if (previous?.signature === signature && node_fs.default.existsSync(node_path.default.join(snapshots, previous.hash))) return previous.hash;
|
|
146
|
+
const hash = contentHash(root, files);
|
|
147
|
+
const target = node_path.default.join(snapshots, hash);
|
|
148
|
+
if (!node_fs.default.existsSync(target)) {
|
|
149
|
+
await sleep(settleMs);
|
|
150
|
+
const settled = snapshotFiles(root, entry);
|
|
151
|
+
if (settled.join("\n") !== files.join("\n") || contentHash(root, settled) !== hash) continue;
|
|
152
|
+
const staging = node_path.default.join(snapshots, `.${hash}.${String(process.pid)}.${node_crypto.default.randomUUID()}`);
|
|
153
|
+
for (const file of files) {
|
|
154
|
+
node_fs.default.mkdirSync(node_path.default.dirname(node_path.default.join(staging, file)), { recursive: true });
|
|
155
|
+
node_fs.default.copyFileSync(node_path.default.join(root, file), node_path.default.join(staging, file));
|
|
156
|
+
}
|
|
157
|
+
if (contentHash(staging, files) !== hash) {
|
|
158
|
+
node_fs.default.rmSync(staging, {
|
|
159
|
+
recursive: true,
|
|
160
|
+
force: true
|
|
161
|
+
});
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
try {
|
|
165
|
+
node_fs.default.renameSync(staging, target);
|
|
166
|
+
} catch (error) {
|
|
167
|
+
node_fs.default.rmSync(staging, {
|
|
168
|
+
recursive: true,
|
|
169
|
+
force: true
|
|
170
|
+
});
|
|
171
|
+
if (!node_fs.default.existsSync(target)) throw error;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (!previous?.pruned) pruneOthers(snapshots, hash);
|
|
175
|
+
states.set(root, {
|
|
176
|
+
signature,
|
|
177
|
+
hash,
|
|
178
|
+
pruned: true
|
|
179
|
+
});
|
|
180
|
+
return hash;
|
|
181
|
+
}
|
|
182
|
+
throw new Error(`package content kept changing while it was read: ${root}`);
|
|
183
|
+
};
|
|
184
|
+
const pathFor = async (entry) => {
|
|
185
|
+
const real = node_fs.default.realpathSync(entry);
|
|
186
|
+
const root = packageRootOf(real);
|
|
187
|
+
if (root === void 0 || isVersioned(root)) return real;
|
|
188
|
+
const relative = node_path.default.relative(root, real);
|
|
189
|
+
if (relative.split(node_path.default.sep)[0] === "node_modules") return real;
|
|
190
|
+
const key = `${root}\0${relative}`;
|
|
191
|
+
let running = pending.get(key);
|
|
192
|
+
if (!running) {
|
|
193
|
+
running = snapshot(root, real).finally(() => pending.delete(key));
|
|
194
|
+
pending.set(key, running);
|
|
195
|
+
}
|
|
196
|
+
const hash = await running;
|
|
197
|
+
return node_path.default.join(root, SNAPSHOT_DIRECTORY, hash, relative);
|
|
198
|
+
};
|
|
199
|
+
return {
|
|
200
|
+
pathFor,
|
|
201
|
+
urlFor: async (entry) => (0, node_url.pathToFileURL)(await pathFor(entry)).href
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
exports.SNAPSHOT_DIRECTORY = SNAPSHOT_DIRECTORY;
|
|
206
|
+
exports.createPackageUrls = createPackageUrls;
|
|
207
|
+
exports.snapshotFiles = snapshotFiles;
|
|
208
|
+
exports.statSignature = statSignature;
|
|
209
|
+
|
|
210
|
+
//# sourceMappingURL=packageUrl.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageUrl.cjs","names":["path","fs","crypto","pathToFileURL"],"sources":["../../../../src/builders/server/packageUrl.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\n/** Realpath fragments of version-scoped package stores: a new version is a new path. */\nconst VERSIONED_STORES = ['.upm', '.pnpm'].map((store) => `${path.sep}node_modules${path.sep}${store}${path.sep}`);\nexport const SNAPSHOT_DIRECTORY = path.join('node_modules', '.po-snapshots');\nconst SETTLE_MS = 300;\nconst STABLE_ATTEMPTS = 5;\n/** Build outputs a host never imports. */\nconst SKIPPED_SUFFIXES = ['.map', '.d.ts', '.d.mts', '.d.cts', '.tsbuildinfo'];\n\nexport interface PackageUrlOptions {\n /** Delay between the two content reads that prove a build is not in progress. */\n readonly settleMs?: number;\n readonly sleep?: (ms: number) => Promise<void>;\n}\n\nexport interface PackageUrls {\n /** The URL to import for a resolved entry file. Stable until the package content changes. */\n urlFor(entry: string): Promise<string>;\n /** Same as `urlFor`, as a file path, for loaders that take paths (po-hook). */\n pathFor(entry: string): Promise<string>;\n}\n\ninterface PackageState {\n signature: string;\n hash: string;\n pruned: boolean;\n}\n\nfunction packageRootOf(file: string): string | undefined {\n let directory = path.dirname(file);\n for (;;) {\n if (fs.existsSync(path.join(directory, 'package.json'))) return directory;\n const parent = path.dirname(directory);\n if (parent === directory) return undefined;\n directory = parent;\n }\n}\n\nfunction isVersioned(root: string): boolean {\n return VERSIONED_STORES.some((store) => `${root}${path.sep}`.includes(store));\n}\n\nfunction exportTargets(value: unknown, condition: string | undefined, into: string[]): void {\n if (condition === 'types') return;\n if (typeof value === 'string') {\n if (!value.includes('*')) into.push(value);\n return;\n }\n if (Array.isArray(value)) {\n for (const item of value) exportTargets(item, condition, into);\n return;\n }\n if (typeof value === 'object' && value !== null)\n for (const [key, item] of Object.entries(value)) exportTargets(item, key, into);\n}\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\n/** Package-relative entry targets the manifest declares for a server-side host. */\nfunction declaredTargets(manifest: Record<string, unknown>): string[] {\n const targets: string[] = [];\n exportTargets(manifest.exports, undefined, targets);\n if (typeof manifest.main === 'string') targets.push(manifest.main);\n const pi = record(manifest.pi);\n if (Array.isArray(pi?.extensions))\n for (const entry of pi.extensions) if (typeof entry === 'string') targets.push(entry);\n const server = record(manifest.poServer);\n if (typeof server?.dist === 'string') targets.push(server.dist);\n const mcp = record(manifest.poMcp);\n if (typeof mcp?.dist === 'string') targets.push(mcp.dist);\n return targets;\n}\n\nfunction inside(relative: string): boolean {\n return relative !== '' && relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);\n}\n\n/**\n * The files a snapshot carries, package-relative and sorted.\n *\n * A target's whole top-level directory goes with it: bundlers split entries into\n * sibling chunks the entry imports relatively, so copying only the named file would\n * break the import graph.\n */\nexport function snapshotFiles(root: string, entry: string): string[] {\n const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')) as Record<string, unknown>;\n const targets = [...new Set([...declaredTargets(manifest), path.relative(root, entry)])].map((target) =>\n path.normalize(target),\n );\n const files = new Set<string>(['package.json']);\n for (const target of targets) {\n if (!inside(target) || target.split(path.sep)[0] === 'node_modules') continue;\n const absolute = path.join(root, target);\n if (!fs.existsSync(absolute)) throw new Error(`declared entry is missing: ${target}`);\n const top = target.split(path.sep)[0]!;\n const topPath = path.join(root, top);\n if (top === target || !fs.statSync(topPath).isDirectory()) {\n files.add(target);\n continue;\n }\n const collect = (directory: string): void => {\n for (const dirent of fs.readdirSync(directory, { withFileTypes: true })) {\n const file = path.join(directory, dirent.name);\n if (dirent.isDirectory()) {\n if (dirent.name !== 'node_modules') collect(file);\n } else if (\n (dirent.isFile() || dirent.isSymbolicLink()) &&\n !SKIPPED_SUFFIXES.some((suffix) => dirent.name.endsWith(suffix))\n )\n files.add(path.relative(root, file));\n }\n };\n collect(topPath);\n }\n return [...files].sort();\n}\n\nexport function statSignature(root: string, files: readonly string[]): string {\n return files\n .map((file) => {\n const stat = fs.statSync(path.join(root, file));\n return `${file}\\0${String(stat.size)}\\0${String(stat.mtimeMs)}`;\n })\n .join('\\n');\n}\n\nfunction contentHash(root: string, files: readonly string[]): string {\n const hash = crypto.createHash('sha256');\n for (const file of files) {\n hash.update(file).update('\\0');\n hash.update(fs.readFileSync(path.join(root, file))).update('\\0');\n }\n return hash.digest('hex').slice(0, 32);\n}\n\nfunction pruneOthers(snapshots: string, keep: string): void {\n if (!fs.existsSync(snapshots)) return;\n for (const name of fs.readdirSync(snapshots))\n if (name !== keep) fs.rmSync(path.join(snapshots, name), { recursive: true, force: true });\n}\n\n/**\n * Maps resolved package entries to import URLs that change only when content changes.\n *\n * A package under a versioned store imports in place: an upgrade is already a new path.\n * Any other package (repo-local, or npm-installed) is snapshotted by content into\n * `<package>/node_modules/.po-snapshots/<hash>/`, with its `package.json` so a\n * self-import by name resolves to the snapshot, while dependencies still resolve\n * from `<package>/node_modules`. A snapshot is taken only when every declared entry\n * exists and two reads `settleMs` apart agree, so a build in progress is never\n * captured. The first snapshot of a package in this process prunes its older ones;\n * later ones keep them, because live sessions may still lazily import from them.\n */\nexport function createPackageUrls(options: PackageUrlOptions = {}): PackageUrls {\n const settleMs = options.settleMs ?? SETTLE_MS;\n const sleep = options.sleep ?? ((ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms)));\n const states = new Map<string, PackageState>();\n const pending = new Map<string, Promise<string>>();\n\n const snapshot = async (root: string, entry: string): Promise<string> => {\n const snapshots = path.join(root, SNAPSHOT_DIRECTORY);\n for (let attempt = 0; attempt < STABLE_ATTEMPTS; attempt++) {\n const files = snapshotFiles(root, entry);\n const signature = statSignature(root, files);\n const previous = states.get(root);\n if (previous?.signature === signature && fs.existsSync(path.join(snapshots, previous.hash))) return previous.hash;\n const hash = contentHash(root, files);\n const target = path.join(snapshots, hash);\n if (!fs.existsSync(target)) {\n await sleep(settleMs);\n const settled = snapshotFiles(root, entry);\n if (settled.join('\\n') !== files.join('\\n') || contentHash(root, settled) !== hash) continue;\n const staging = path.join(snapshots, `.${hash}.${String(process.pid)}.${crypto.randomUUID()}`);\n for (const file of files) {\n fs.mkdirSync(path.dirname(path.join(staging, file)), { recursive: true });\n fs.copyFileSync(path.join(root, file), path.join(staging, file));\n }\n if (contentHash(staging, files) !== hash) {\n fs.rmSync(staging, { recursive: true, force: true });\n continue;\n }\n try {\n fs.renameSync(staging, target);\n } catch (error) {\n fs.rmSync(staging, { recursive: true, force: true });\n if (!fs.existsSync(target)) throw error;\n }\n }\n if (!previous?.pruned) pruneOthers(snapshots, hash);\n states.set(root, { signature, hash, pruned: true });\n return hash;\n }\n throw new Error(`package content kept changing while it was read: ${root}`);\n };\n\n const pathFor = async (entry: string): Promise<string> => {\n const real = fs.realpathSync(entry);\n const root = packageRootOf(real);\n // A file no package owns (a loose repository hook) has nothing to snapshot.\n if (root === undefined || isVersioned(root)) return real;\n const relative = path.relative(root, real);\n if (relative.split(path.sep)[0] === 'node_modules') return real;\n const key = `${root}\\0${relative}`;\n let running = pending.get(key);\n if (!running) {\n running = snapshot(root, real).finally(() => pending.delete(key));\n pending.set(key, running);\n }\n const hash = await running;\n return path.join(root, SNAPSHOT_DIRECTORY, hash, relative);\n };\n\n return { pathFor, urlFor: async (entry) => pathToFileURL(await pathFor(entry)).href };\n}\n"],"mappings":";;;;;;;;;;AAMA,MAAM,mBAAmB,CAAC,QAAQ,OAAO,CAAC,CAAC,KAAK,UAAU,GAAGA,UAAAA,QAAK,IAAI,cAAcA,UAAAA,QAAK,MAAM,QAAQA,UAAAA,QAAK,KAAK;AACjH,MAAa,qBAAqBA,UAAAA,QAAK,KAAK,gBA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