@1mcp/agent 0.39.6 → 0.40.0-beta.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/README.md +14 -7
- package/build/admin/assets/{admin-BackendLogsWorkspace-BKavXT9B.js → admin-BackendLogsWorkspace-DnPzXW3E.js} +1 -1
- package/build/admin/assets/{admin-InstructionTemplatesWorkspace-CvG4EPdZ.js → admin-InstructionTemplatesWorkspace-B7beKEgz.js} +1 -1
- package/build/admin/assets/{admin-OAuthServicesWorkspace-BKqTW6r0.js → admin-OAuthServicesWorkspace-Bu74Bzt5.js} +1 -1
- package/build/admin/assets/{admin-PresetAuthoringWorkspace-BboJVBFl.js → admin-PresetAuthoringWorkspace-053b1zwU.js} +1 -1
- package/build/admin/assets/{admin-console-BwfDrlgF.js → admin-console-DVuqABnE.js} +3 -3
- package/build/admin/assets/admin-icons-wOzB38gm.js +1 -0
- package/build/admin/assets/admin-vendor-BLZ1Mauf.js +3 -0
- package/build/admin/assets/admin-vendor-BdHKHno1.js +1 -0
- package/build/admin/assets/admin-vendor-BqYiU41k.js +51 -0
- package/build/admin/assets/admin-vendor-C291Vs-N.js +3 -0
- package/build/admin/assets/admin-vendor-VzhcFgoy.js +1 -0
- package/build/admin/index.html +7 -5
- package/build/application/backendPreparationAdmission.d.ts +77 -0
- package/build/application/backendPreparationAdmission.d.ts.map +1 -0
- package/build/application/backendPreparationAdmission.js +423 -0
- package/build/application/backendPreparationAdmission.js.map +1 -0
- package/build/application/backendPreparationCoordinator.d.ts +122 -0
- package/build/application/backendPreparationCoordinator.d.ts.map +1 -0
- package/build/application/backendPreparationCoordinator.js +885 -0
- package/build/application/backendPreparationCoordinator.js.map +1 -0
- package/build/application/projectLifecycle.d.ts +49 -0
- package/build/application/projectLifecycle.d.ts.map +1 -0
- package/build/application/projectLifecycle.js +228 -0
- package/build/application/projectLifecycle.js.map +1 -0
- package/build/cli.d.ts.map +1 -1
- package/build/cli.js +39 -17
- package/build/cli.js.map +1 -1
- package/build/commands/admin/index.d.ts.map +1 -1
- package/build/commands/admin/index.js +2 -6
- package/build/commands/admin/index.js.map +1 -1
- package/build/commands/app/index.d.ts.map +1 -1
- package/build/commands/app/index.js +5 -17
- package/build/commands/app/index.js.map +1 -1
- package/build/commands/auth/index.d.ts.map +1 -1
- package/build/commands/auth/index.js +2 -7
- package/build/commands/auth/index.js.map +1 -1
- package/build/commands/bootstrap/bootstrap.d.ts +38 -0
- package/build/commands/bootstrap/bootstrap.d.ts.map +1 -0
- package/build/commands/bootstrap/bootstrap.js +265 -0
- package/build/commands/bootstrap/bootstrap.js.map +1 -0
- package/build/commands/bootstrap/bootstrapOwnership.d.ts +13 -0
- package/build/commands/bootstrap/bootstrapOwnership.d.ts.map +1 -0
- package/build/commands/bootstrap/bootstrapOwnership.js +112 -0
- package/build/commands/bootstrap/bootstrapOwnership.js.map +1 -0
- package/build/commands/bootstrap/index.d.ts +3 -0
- package/build/commands/bootstrap/index.d.ts.map +1 -0
- package/build/commands/bootstrap/index.js +22 -0
- package/build/commands/bootstrap/index.js.map +1 -0
- package/build/commands/cliSetup/index.d.ts.map +1 -1
- package/build/commands/cliSetup/index.js +3 -4
- package/build/commands/cliSetup/index.js.map +1 -1
- package/build/commands/cliSetup/installPreparationSkill.d.ts +8 -0
- package/build/commands/cliSetup/installPreparationSkill.d.ts.map +1 -0
- package/build/commands/cliSetup/installPreparationSkill.js +201 -0
- package/build/commands/cliSetup/installPreparationSkill.js.map +1 -0
- package/build/commands/cliSetup/preparationSkill.generated.d.ts +2 -0
- package/build/commands/cliSetup/preparationSkill.generated.d.ts.map +1 -0
- package/build/commands/cliSetup/preparationSkill.generated.js +8 -0
- package/build/commands/cliSetup/preparationSkill.generated.js.map +1 -0
- package/build/commands/cliSetup/setupFiles.d.ts +5 -1
- package/build/commands/cliSetup/setupFiles.d.ts.map +1 -1
- package/build/commands/cliSetup/setupFiles.js +54 -37
- package/build/commands/cliSetup/setupFiles.js.map +1 -1
- package/build/commands/inspect/index.d.ts.map +1 -1
- package/build/commands/inspect/index.js +4 -4
- package/build/commands/inspect/index.js.map +1 -1
- package/build/commands/inspect/inspect.d.ts +2 -1
- package/build/commands/inspect/inspect.d.ts.map +1 -1
- package/build/commands/inspect/inspect.js +10 -5
- package/build/commands/inspect/inspect.js.map +1 -1
- package/build/commands/inspect/inspectUtils.js +3 -0
- package/build/commands/inspect/inspectUtils.js.map +1 -1
- package/build/commands/instructions/index.d.ts.map +1 -1
- package/build/commands/instructions/index.js +8 -3
- package/build/commands/instructions/index.js.map +1 -1
- package/build/commands/instructions/instructions.d.ts +3 -1
- package/build/commands/instructions/instructions.d.ts.map +1 -1
- package/build/commands/instructions/instructions.js +24 -0
- package/build/commands/instructions/instructions.js.map +1 -1
- package/build/commands/instructions/instructionsUtils.d.ts +2 -0
- package/build/commands/instructions/instructionsUtils.d.ts.map +1 -1
- package/build/commands/instructions/instructionsUtils.js +14 -4
- package/build/commands/instructions/instructionsUtils.js.map +1 -1
- package/build/commands/mcp/index.d.ts.map +1 -1
- package/build/commands/mcp/index.js +16 -21
- package/build/commands/mcp/index.js.map +1 -1
- package/build/commands/mcp/installSource.d.ts +3 -1
- package/build/commands/mcp/installSource.d.ts.map +1 -1
- package/build/commands/mcp/installSource.js +2 -2
- package/build/commands/mcp/installSource.js.map +1 -1
- package/build/commands/mcp/knownServerSetup.d.ts +4 -0
- package/build/commands/mcp/knownServerSetup.d.ts.map +1 -0
- package/build/commands/mcp/knownServerSetup.js +102 -0
- package/build/commands/mcp/knownServerSetup.js.map +1 -0
- package/build/commands/mcp/setup.d.ts +28 -0
- package/build/commands/mcp/setup.d.ts.map +1 -0
- package/build/commands/mcp/setup.js +56 -0
- package/build/commands/mcp/setup.js.map +1 -0
- package/build/commands/mcp/tools.d.ts.map +1 -1
- package/build/commands/mcp/tools.js +3 -3
- package/build/commands/mcp/tools.js.map +1 -1
- package/build/commands/preparation/index.d.ts +3 -0
- package/build/commands/preparation/index.d.ts.map +1 -0
- package/build/commands/preparation/index.js +55 -0
- package/build/commands/preparation/index.js.map +1 -0
- package/build/commands/preparation/preparation.d.ts +18 -0
- package/build/commands/preparation/preparation.d.ts.map +1 -0
- package/build/commands/preparation/preparation.js +102 -0
- package/build/commands/preparation/preparation.js.map +1 -0
- package/build/commands/preset/index.d.ts.map +1 -1
- package/build/commands/preset/index.js +4 -51
- package/build/commands/preset/index.js.map +1 -1
- package/build/commands/project/index.d.ts +3 -0
- package/build/commands/project/index.d.ts.map +1 -0
- package/build/commands/project/index.js +40 -0
- package/build/commands/project/index.js.map +1 -0
- package/build/commands/project/project.d.ts +34 -0
- package/build/commands/project/project.d.ts.map +1 -0
- package/build/commands/project/project.js +119 -0
- package/build/commands/project/project.js.map +1 -0
- package/build/commands/proxy/index.d.ts +2 -1
- package/build/commands/proxy/index.d.ts.map +1 -1
- package/build/commands/proxy/index.js +6 -46
- package/build/commands/proxy/index.js.map +1 -1
- package/build/commands/proxy/proxy.d.ts.map +1 -1
- package/build/commands/proxy/proxy.js +7 -1
- package/build/commands/proxy/proxy.js.map +1 -1
- package/build/commands/registry/index.d.ts.map +1 -1
- package/build/commands/registry/index.js +16 -20
- package/build/commands/registry/index.js.map +1 -1
- package/build/commands/run/index.d.ts.map +1 -1
- package/build/commands/run/index.js +9 -3
- package/build/commands/run/index.js.map +1 -1
- package/build/commands/run/run.d.ts +4 -1
- package/build/commands/run/run.d.ts.map +1 -1
- package/build/commands/run/run.js +80 -14
- package/build/commands/run/run.js.map +1 -1
- package/build/commands/serve/cooperativeRuntime.d.ts.map +1 -1
- package/build/commands/serve/cooperativeRuntime.js +2 -1
- package/build/commands/serve/cooperativeRuntime.js.map +1 -1
- package/build/commands/serve/index.d.ts.map +1 -1
- package/build/commands/serve/index.js +57 -39
- package/build/commands/serve/index.js.map +1 -1
- package/build/commands/shared/agentSession.d.ts +5 -0
- package/build/commands/shared/agentSession.d.ts.map +1 -0
- package/build/commands/shared/agentSession.js +75 -0
- package/build/commands/shared/agentSession.js.map +1 -0
- package/build/commands/shared/apiClient.d.ts +2 -0
- package/build/commands/shared/apiClient.d.ts.map +1 -1
- package/build/commands/shared/apiClient.js +10 -6
- package/build/commands/shared/apiClient.js.map +1 -1
- package/build/commands/shared/cliContext.d.ts +2 -1
- package/build/commands/shared/cliContext.d.ts.map +1 -1
- package/build/commands/shared/cliContext.js +2 -1
- package/build/commands/shared/cliContext.js.map +1 -1
- package/build/commands/shared/clientSurfaceAttachment.d.ts +7 -1
- package/build/commands/shared/clientSurfaceAttachment.d.ts.map +1 -1
- package/build/commands/shared/clientSurfaceAttachment.js +221 -140
- package/build/commands/shared/clientSurfaceAttachment.js.map +1 -1
- package/build/commands/shared/projectOwnerStorage.d.ts +8 -0
- package/build/commands/shared/projectOwnerStorage.d.ts.map +1 -0
- package/build/commands/shared/projectOwnerStorage.js +63 -0
- package/build/commands/shared/projectOwnerStorage.js.map +1 -0
- package/build/commands/shared/projectOwnerStore.d.ts +78 -0
- package/build/commands/shared/projectOwnerStore.d.ts.map +1 -0
- package/build/commands/shared/projectOwnerStore.js +482 -0
- package/build/commands/shared/projectOwnerStore.js.map +1 -0
- package/build/commands/shared/projectSelectionOptions.d.ts +24 -0
- package/build/commands/shared/projectSelectionOptions.d.ts.map +1 -0
- package/build/commands/shared/projectSelectionOptions.js +20 -0
- package/build/commands/shared/projectSelectionOptions.js.map +1 -0
- package/build/commands/shared/serveTargetResolver.d.ts +7 -1
- package/build/commands/shared/serveTargetResolver.d.ts.map +1 -1
- package/build/commands/shared/serveTargetResolver.js +99 -4
- package/build/commands/shared/serveTargetResolver.js.map +1 -1
- package/build/commands/target/index.d.ts.map +1 -1
- package/build/commands/target/index.js +6 -13
- package/build/commands/target/index.js.map +1 -1
- package/build/commands/wait/index.d.ts.map +1 -1
- package/build/commands/wait/index.js +3 -3
- package/build/commands/wait/index.js.map +1 -1
- package/build/commands/wait/wait.d.ts +2 -1
- package/build/commands/wait/wait.d.ts.map +1 -1
- package/build/commands/wait/wait.js.map +1 -1
- package/build/config/configLoader.d.ts.map +1 -1
- package/build/config/configLoader.js +5 -1
- package/build/config/configLoader.js.map +1 -1
- package/build/config/configManager.d.ts.map +1 -1
- package/build/config/configManager.js +5 -1
- package/build/config/configManager.js.map +1 -1
- package/build/config/projectConfigLoader.d.ts +4 -0
- package/build/config/projectConfigLoader.d.ts.map +1 -1
- package/build/config/projectConfigLoader.js +129 -28
- package/build/config/projectConfigLoader.js.map +1 -1
- package/build/config/projectConfigTypes.d.ts +7 -0
- package/build/config/projectConfigTypes.d.ts.map +1 -1
- package/build/config/projectConfigTypes.js +1 -0
- package/build/config/projectConfigTypes.js.map +1 -1
- package/build/constants/cliTimeouts.d.ts +4 -0
- package/build/constants/cliTimeouts.d.ts.map +1 -0
- package/build/constants/cliTimeouts.js +4 -0
- package/build/constants/cliTimeouts.js.map +1 -0
- package/build/constants/mcp.d.ts +1 -1
- package/build/constants/mcp.d.ts.map +1 -1
- package/build/constants/mcp.js +1 -1
- package/build/constants/mcp.js.map +1 -1
- package/build/core/capabilities/capabilityCatalog.d.ts +7 -0
- package/build/core/capabilities/capabilityCatalog.d.ts.map +1 -1
- package/build/core/capabilities/capabilityCatalog.js +58 -2
- package/build/core/capabilities/capabilityCatalog.js.map +1 -1
- package/build/core/capabilities/capabilityPagination.d.ts +12 -4
- package/build/core/capabilities/capabilityPagination.d.ts.map +1 -1
- package/build/core/capabilities/capabilityPagination.js +15 -2
- package/build/core/capabilities/capabilityPagination.js.map +1 -1
- package/build/core/capabilities/capabilityVisibility.d.ts +3 -0
- package/build/core/capabilities/capabilityVisibility.d.ts.map +1 -1
- package/build/core/capabilities/capabilityVisibility.js.map +1 -1
- package/build/core/capabilities/lazyLoadingOrchestrator.d.ts +2 -1
- package/build/core/capabilities/lazyLoadingOrchestrator.d.ts.map +1 -1
- package/build/core/capabilities/lazyLoadingOrchestrator.js +2 -2
- package/build/core/capabilities/lazyLoadingOrchestrator.js.map +1 -1
- package/build/core/capabilities/metaToolProvider.d.ts +2 -2
- package/build/core/capabilities/metaToolProvider.d.ts.map +1 -1
- package/build/core/capabilities/metaToolProvider.js +2 -2
- package/build/core/capabilities/metaToolProvider.js.map +1 -1
- package/build/core/capabilities/runtimeCapabilityCatalog.d.ts +1 -0
- package/build/core/capabilities/runtimeCapabilityCatalog.d.ts.map +1 -1
- package/build/core/capabilities/runtimeCapabilityCatalog.js +23 -9
- package/build/core/capabilities/runtimeCapabilityCatalog.js.map +1 -1
- package/build/core/context/projectOwner.d.ts +16 -0
- package/build/core/context/projectOwner.d.ts.map +1 -0
- package/build/core/context/projectOwner.js +33 -0
- package/build/core/context/projectOwner.js.map +1 -0
- package/build/core/context/projectPreparationAuthority.d.ts +37 -0
- package/build/core/context/projectPreparationAuthority.d.ts.map +1 -0
- package/build/core/context/projectPreparationAuthority.js +113 -0
- package/build/core/context/projectPreparationAuthority.js.map +1 -0
- package/build/core/instructions/inspectionGuidance.d.ts +2 -0
- package/build/core/instructions/inspectionGuidance.d.ts.map +1 -0
- package/build/core/instructions/inspectionGuidance.js +2 -0
- package/build/core/instructions/inspectionGuidance.js.map +1 -0
- package/build/core/instructions/instructionAggregator.d.ts +1 -0
- package/build/core/instructions/instructionAggregator.d.ts.map +1 -1
- package/build/core/instructions/instructionAggregator.js +2 -2
- package/build/core/instructions/instructionAggregator.js.map +1 -1
- package/build/core/instructions/instructionsDistribution.d.ts +5 -0
- package/build/core/instructions/instructionsDistribution.d.ts.map +1 -1
- package/build/core/instructions/instructionsDistribution.js +72 -15
- package/build/core/instructions/instructionsDistribution.js.map +1 -1
- package/build/core/instructions/preparationGuidance.d.ts +3 -0
- package/build/core/instructions/preparationGuidance.d.ts.map +1 -0
- package/build/core/instructions/preparationGuidance.js +14 -0
- package/build/core/instructions/preparationGuidance.js.map +1 -0
- package/build/core/instructions/sessionGuidance.d.ts +3 -0
- package/build/core/instructions/sessionGuidance.d.ts.map +1 -0
- package/build/core/instructions/sessionGuidance.js +25 -0
- package/build/core/instructions/sessionGuidance.js.map +1 -0
- package/build/core/instructions/templateTypes.d.ts +3 -1
- package/build/core/instructions/templateTypes.d.ts.map +1 -1
- package/build/core/instructions/templateTypes.js +15 -5
- package/build/core/instructions/templateTypes.js.map +1 -1
- package/build/core/protocol/requestHandlerUtils.d.ts.map +1 -1
- package/build/core/protocol/requestHandlerUtils.js +23 -4
- package/build/core/protocol/requestHandlerUtils.js.map +1 -1
- package/build/core/server/connectionResolver.d.ts +5 -0
- package/build/core/server/connectionResolver.d.ts.map +1 -1
- package/build/core/server/connectionResolver.js +11 -0
- package/build/core/server/connectionResolver.js.map +1 -1
- package/build/core/server/runtimeLaunchIpc.d.ts +167 -2
- package/build/core/server/runtimeLaunchIpc.d.ts.map +1 -1
- package/build/core/server/runtimeReplacementConfig.d.ts +167 -2
- package/build/core/server/runtimeReplacementConfig.d.ts.map +1 -1
- package/build/core/tools/handlers/serverManagementHandler.d.ts +413 -7
- package/build/core/tools/handlers/serverManagementHandler.d.ts.map +1 -1
- package/build/core/tools/internal/adapters/helpers/configTransformers.d.ts +59 -1
- package/build/core/tools/internal/adapters/helpers/configTransformers.d.ts.map +1 -1
- package/build/core/types/server.d.ts +7 -1
- package/build/core/types/server.d.ts.map +1 -1
- package/build/core/types/transport.d.ts +249 -3
- package/build/core/types/transport.d.ts.map +1 -1
- package/build/core/types/transport.js +27 -0
- package/build/core/types/transport.js.map +1 -1
- package/build/domains/admin/adminInstructionPreviewRuntime.d.ts.map +1 -1
- package/build/domains/admin/adminInstructionPreviewRuntime.js +4 -1
- package/build/domains/admin/adminInstructionPreviewRuntime.js.map +1 -1
- package/build/domains/backend-preparation/adapterRegistry.d.ts +8 -0
- package/build/domains/backend-preparation/adapterRegistry.d.ts.map +1 -0
- package/build/domains/backend-preparation/adapterRegistry.js +15 -0
- package/build/domains/backend-preparation/adapterRegistry.js.map +1 -0
- package/build/domains/backend-preparation/builtInIntegrationDefinitions.d.ts +4 -0
- package/build/domains/backend-preparation/builtInIntegrationDefinitions.d.ts.map +1 -0
- package/build/domains/backend-preparation/builtInIntegrationDefinitions.js +3 -0
- package/build/domains/backend-preparation/builtInIntegrationDefinitions.js.map +1 -0
- package/build/domains/backend-preparation/configuredCommandAdapter.d.ts +88 -0
- package/build/domains/backend-preparation/configuredCommandAdapter.d.ts.map +1 -0
- package/build/domains/backend-preparation/configuredCommandAdapter.js +196 -0
- package/build/domains/backend-preparation/configuredCommandAdapter.js.map +1 -0
- package/build/domains/backend-preparation/configuredCommandProcess.d.ts +27 -0
- package/build/domains/backend-preparation/configuredCommandProcess.d.ts.map +1 -0
- package/build/domains/backend-preparation/configuredCommandProcess.js +183 -0
- package/build/domains/backend-preparation/configuredCommandProcess.js.map +1 -0
- package/build/domains/backend-preparation/contracts.d.ts +131 -0
- package/build/domains/backend-preparation/contracts.d.ts.map +1 -0
- package/build/domains/backend-preparation/contracts.js +2 -0
- package/build/domains/backend-preparation/contracts.js.map +1 -0
- package/build/domains/backend-preparation/integrationDefinitions.d.ts +171 -0
- package/build/domains/backend-preparation/integrationDefinitions.d.ts.map +1 -0
- package/build/domains/backend-preparation/integrationDefinitions.js +246 -0
- package/build/domains/backend-preparation/integrationDefinitions.js.map +1 -0
- package/build/domains/backend-preparation/policy.d.ts +50 -0
- package/build/domains/backend-preparation/policy.d.ts.map +1 -0
- package/build/domains/backend-preparation/policy.js +58 -0
- package/build/domains/backend-preparation/policy.js.map +1 -0
- package/build/domains/backend-preparation/scheduler.d.ts +18 -0
- package/build/domains/backend-preparation/scheduler.d.ts.map +1 -0
- package/build/domains/backend-preparation/scheduler.js +62 -0
- package/build/domains/backend-preparation/scheduler.js.map +1 -0
- package/build/domains/backend-preparation/service.d.ts +67 -0
- package/build/domains/backend-preparation/service.d.ts.map +1 -0
- package/build/domains/backend-preparation/service.js +709 -0
- package/build/domains/backend-preparation/service.js.map +1 -0
- package/build/domains/config-change/configChange.js +5 -5
- package/build/domains/config-change/configChange.js.map +1 -1
- package/build/domains/installation/knownServerCatalog.d.ts +14 -0
- package/build/domains/installation/knownServerCatalog.d.ts.map +1 -0
- package/build/domains/installation/knownServerCatalog.js +56 -0
- package/build/domains/installation/knownServerCatalog.js.map +1 -0
- package/build/domains/installation/knownServerSetup.d.ts +21 -0
- package/build/domains/installation/knownServerSetup.d.ts.map +1 -0
- package/build/domains/installation/knownServerSetup.js +330 -0
- package/build/domains/installation/knownServerSetup.js.map +1 -0
- package/build/domains/installation/knownServerSetupTypes.d.ts +34 -0
- package/build/domains/installation/knownServerSetupTypes.d.ts.map +1 -0
- package/build/domains/installation/knownServerSetupTypes.js +2 -0
- package/build/domains/installation/knownServerSetupTypes.js.map +1 -0
- package/build/domains/project-selection/projectBindingScope.d.ts +7 -0
- package/build/domains/project-selection/projectBindingScope.d.ts.map +1 -0
- package/build/domains/project-selection/projectBindingScope.js +9 -0
- package/build/domains/project-selection/projectBindingScope.js.map +1 -0
- package/build/domains/project-selection/projectPolicy.d.ts +11 -0
- package/build/domains/project-selection/projectPolicy.d.ts.map +1 -0
- package/build/domains/project-selection/projectPolicy.js +104 -0
- package/build/domains/project-selection/projectPolicy.js.map +1 -0
- package/build/domains/project-selection/projectSelection.d.ts +30 -0
- package/build/domains/project-selection/projectSelection.d.ts.map +1 -0
- package/build/domains/project-selection/projectSelection.js +124 -0
- package/build/domains/project-selection/projectSelection.js.map +1 -0
- package/build/globalOptions.d.ts +9 -0
- package/build/globalOptions.d.ts.map +1 -1
- package/build/globalOptions.js +13 -11
- package/build/globalOptions.js.map +1 -1
- package/build/observability/events/registry.d.ts +7 -1
- package/build/observability/events/registry.d.ts.map +1 -1
- package/build/observability/events/registry.js +7 -1
- package/build/observability/events/registry.js.map +1 -1
- package/build/sdk/legacy/client/runtime/backendDispatchLifetime.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/backendDispatchLifetime.js +8 -2
- package/build/sdk/legacy/client/runtime/backendDispatchLifetime.js.map +1 -1
- package/build/sdk/legacy/client/runtime/legacyTransport.d.ts +2 -0
- package/build/sdk/legacy/client/runtime/legacyTransport.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/serveClient.d.ts +6 -1
- package/build/sdk/legacy/client/runtime/serveClient.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/serveClient.js +16 -5
- package/build/sdk/legacy/client/runtime/serveClient.js.map +1 -1
- package/build/sdk/legacy/commands/serve.d.ts.map +1 -1
- package/build/sdk/legacy/commands/serve.js +11 -5
- package/build/sdk/legacy/commands/serve.js.map +1 -1
- package/build/sdk/legacy/server/protocol/projectAdmission.d.ts +4 -0
- package/build/sdk/legacy/server/protocol/projectAdmission.d.ts.map +1 -0
- package/build/sdk/legacy/server/protocol/projectAdmission.js +24 -0
- package/build/sdk/legacy/server/protocol/projectAdmission.js.map +1 -0
- package/build/sdk/legacy/server/protocol/promptRequestHandlers.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/promptRequestHandlers.js +6 -3
- package/build/sdk/legacy/server/protocol/promptRequestHandlers.js.map +1 -1
- package/build/sdk/legacy/server/protocol/resourceRequestHandlers.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/resourceRequestHandlers.js +6 -4
- package/build/sdk/legacy/server/protocol/resourceRequestHandlers.js.map +1 -1
- package/build/sdk/legacy/server/protocol/resourceSubscriptions.d.ts +1 -1
- package/build/sdk/legacy/server/protocol/resourceSubscriptions.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/resourceSubscriptions.js +193 -41
- package/build/sdk/legacy/server/protocol/resourceSubscriptions.js.map +1 -1
- package/build/sdk/legacy/server/protocol/toolRequestHandlers.d.ts.map +1 -1
- package/build/sdk/legacy/server/protocol/toolRequestHandlers.js +93 -17
- package/build/sdk/legacy/server/protocol/toolRequestHandlers.js.map +1 -1
- package/build/sdk/legacy/server/runtime/clientInstancePool.d.ts +12 -0
- package/build/sdk/legacy/server/runtime/clientInstancePool.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/clientInstancePool.js +117 -4
- package/build/sdk/legacy/server/runtime/clientInstancePool.js.map +1 -1
- package/build/sdk/legacy/server/runtime/connectionManager.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/connectionManager.js +2 -0
- package/build/sdk/legacy/server/runtime/connectionManager.js.map +1 -1
- package/build/sdk/legacy/server/runtime/requestContextPreparation.d.ts +19 -1
- package/build/sdk/legacy/server/runtime/requestContextPreparation.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/requestContextPreparation.js +40 -7
- package/build/sdk/legacy/server/runtime/requestContextPreparation.js.map +1 -1
- package/build/sdk/legacy/server/runtime/serverManager.d.ts +6 -2
- package/build/sdk/legacy/server/runtime/serverManager.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/serverManager.js +85 -17
- package/build/sdk/legacy/server/runtime/serverManager.js.map +1 -1
- package/build/sdk/legacy/server/runtime/templateServerManager.d.ts +26 -4
- package/build/sdk/legacy/server/runtime/templateServerManager.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/templateServerManager.js +260 -14
- package/build/sdk/legacy/server/runtime/templateServerManager.js.map +1 -1
- package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.js +1 -1
- package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.js.map +1 -1
- package/build/sdk/legacy/transport/http/streamableSessionLifecycle.d.ts.map +1 -1
- package/build/sdk/legacy/transport/http/streamableSessionLifecycle.js +14 -3
- package/build/sdk/legacy/transport/http/streamableSessionLifecycle.js.map +1 -1
- package/build/sdk/legacy/transport/stdioProxyTransport.d.ts +1 -0
- package/build/sdk/legacy/transport/stdioProxyTransport.d.ts.map +1 -1
- package/build/sdk/legacy/transport/stdioProxyTransport.js +2 -0
- package/build/sdk/legacy/transport/stdioProxyTransport.js.map +1 -1
- package/build/template/handlebarsTemplateRenderer.d.ts.map +1 -1
- package/build/template/handlebarsTemplateRenderer.js +3 -0
- package/build/template/handlebarsTemplateRenderer.js.map +1 -1
- package/build/transport/http/middlewares/projectAdmission.d.ts +5 -0
- package/build/transport/http/middlewares/projectAdmission.d.ts.map +1 -0
- package/build/transport/http/middlewares/projectAdmission.js +33 -0
- package/build/transport/http/middlewares/projectAdmission.js.map +1 -0
- package/build/transport/http/routes/apiRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/apiRoutes.js +4 -0
- package/build/transport/http/routes/apiRoutes.js.map +1 -1
- package/build/transport/http/routes/inspectHelpers.d.ts +1 -0
- package/build/transport/http/routes/inspectHelpers.d.ts.map +1 -1
- package/build/transport/http/routes/inspectHelpers.js +2 -0
- package/build/transport/http/routes/inspectHelpers.js.map +1 -1
- package/build/transport/http/routes/inspectRequestContext.d.ts +5 -2
- package/build/transport/http/routes/inspectRequestContext.d.ts.map +1 -1
- package/build/transport/http/routes/inspectRequestContext.js +41 -19
- package/build/transport/http/routes/inspectRequestContext.js.map +1 -1
- package/build/transport/http/routes/inspectRoutes.d.ts +11 -2
- package/build/transport/http/routes/inspectRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/inspectRoutes.js +94 -24
- package/build/transport/http/routes/inspectRoutes.js.map +1 -1
- package/build/transport/http/routes/instructionsRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/instructionsRoutes.js +20 -8
- package/build/transport/http/routes/instructionsRoutes.js.map +1 -1
- package/build/transport/http/routes/modernHttpRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/modernHttpRoutes.js +96 -13
- package/build/transport/http/routes/modernHttpRoutes.js.map +1 -1
- package/build/transport/http/routes/modernInteractionBinding.d.ts.map +1 -1
- package/build/transport/http/routes/modernInteractionBinding.js +3 -9
- package/build/transport/http/routes/modernInteractionBinding.js.map +1 -1
- package/build/transport/http/routes/modernSubscriptions.d.ts.map +1 -1
- package/build/transport/http/routes/modernSubscriptions.js +7 -5
- package/build/transport/http/routes/modernSubscriptions.js.map +1 -1
- package/build/transport/http/routes/modernTemplateContext.d.ts +2 -1
- package/build/transport/http/routes/modernTemplateContext.d.ts.map +1 -1
- package/build/transport/http/routes/modernTemplateContext.js +14 -3
- package/build/transport/http/routes/modernTemplateContext.js.map +1 -1
- package/build/transport/http/routes/modernToolHeaderRegistry.d.ts.map +1 -1
- package/build/transport/http/routes/modernToolHeaderRegistry.js +2 -2
- package/build/transport/http/routes/modernToolHeaderRegistry.js.map +1 -1
- package/build/transport/http/routes/preparationRoutes.d.ts +26 -0
- package/build/transport/http/routes/preparationRoutes.d.ts.map +1 -0
- package/build/transport/http/routes/preparationRoutes.js +132 -0
- package/build/transport/http/routes/preparationRoutes.js.map +1 -0
- package/build/transport/http/routes/projectRoutes.d.ts +18 -0
- package/build/transport/http/routes/projectRoutes.d.ts.map +1 -0
- package/build/transport/http/routes/projectRoutes.js +159 -0
- package/build/transport/http/routes/projectRoutes.js.map +1 -0
- package/build/transport/http/routes/streamableHttpRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/streamableHttpRoutes.js +24 -4
- package/build/transport/http/routes/streamableHttpRoutes.js.map +1 -1
- package/build/transport/http/routes/toolRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/toolRoutes.js +163 -20
- package/build/transport/http/routes/toolRoutes.js.map +1 -1
- package/build/transport/http/utils/contextExtractor.d.ts +2 -0
- package/build/transport/http/utils/contextExtractor.d.ts.map +1 -1
- package/build/transport/http/utils/contextExtractor.js +11 -0
- package/build/transport/http/utils/contextExtractor.js.map +1 -1
- package/build/transport/http/utils/templateContextAuthority.d.ts +2 -0
- package/build/transport/http/utils/templateContextAuthority.d.ts.map +1 -1
- package/build/transport/http/utils/templateContextAuthority.js +23 -2
- package/build/transport/http/utils/templateContextAuthority.js.map +1 -1
- package/build/types/context.d.ts +13 -0
- package/build/types/context.d.ts.map +1 -1
- package/build/types/context.js.map +1 -1
- package/build/utils/cli/help.d.ts +7 -0
- package/build/utils/cli/help.d.ts.map +1 -0
- package/build/utils/cli/help.js +57 -0
- package/build/utils/cli/help.js.map +1 -0
- package/package.json +20 -22
- package/build/admin/assets/admin-icons-CYGTDZA5.js +0 -1
- package/build/admin/assets/admin-vendor-62eL-qdH.js +0 -1
- package/build/admin/assets/admin-vendor-BbMrl7MK.js +0 -3
- package/build/admin/assets/admin-vendor-DpjVwd81.js +0 -62
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { withGlobalOptions } from '../../globalOptions.js';
|
|
2
2
|
import printer from '../../utils/ui/printer.js';
|
|
3
3
|
import { buildBackupsCommand } from './backups.js';
|
|
4
4
|
import { buildConsolidateCommand } from './consolidate.js';
|
|
@@ -16,9 +16,8 @@ import { buildStatusCommand } from './status.js';
|
|
|
16
16
|
* Register app command group and subcommands
|
|
17
17
|
*/
|
|
18
18
|
export function setupAppCommands(yargs) {
|
|
19
|
-
return yargs.command('app', 'Manage desktop
|
|
19
|
+
return withGlobalOptions(yargs).command('app', 'Manage desktop app configurations', (yargs) => {
|
|
20
20
|
return yargs
|
|
21
|
-
.options(globalOptions || {})
|
|
22
21
|
.command({
|
|
23
22
|
command: 'consolidate [app-name..]',
|
|
24
23
|
describe: 'Consolidate MCP servers from desktop applications into 1mcp',
|
|
@@ -74,20 +73,9 @@ export function setupAppCommands(yargs) {
|
|
|
74
73
|
},
|
|
75
74
|
})
|
|
76
75
|
.demandCommand(1, 'You must specify a subcommand')
|
|
77
|
-
.help()
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
The app command group helps you consolidate MCP servers from various desktop
|
|
81
|
-
applications (Claude Desktop, Cursor, VS Code, etc.) into a unified 1mcp proxy.
|
|
82
|
-
|
|
83
|
-
This simplifies configuration management by:
|
|
84
|
-
• Moving all MCP servers to a single 1mcp instance
|
|
85
|
-
• Replacing individual app configs with one 1mcp connection
|
|
86
|
-
• Providing safe backup and restore capabilities
|
|
87
|
-
• Supporting both automatic and manual setup workflows
|
|
88
|
-
|
|
89
|
-
For more information about each command, use: $0 app <command> --help
|
|
90
|
-
`);
|
|
76
|
+
.help()
|
|
77
|
+
.alias('help', 'h')
|
|
78
|
+
.epilogue('Run 1mcp app <command> --help for configuration, discovery, and backup options.');
|
|
91
79
|
}, () => {
|
|
92
80
|
// This handler runs when 'app' is called without a subcommand
|
|
93
81
|
printer.info('Please specify a subcommand. Use --help for available commands.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,OAAO,MAAM,0BAA0B,CAAC;AAI/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAW;IAC1C,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC,OAAO,CACrC,KAAK,EACL,mCAAmC,EACnC,CAAC,KAAK,EAAE,EAAE;QACR,OAAO,KAAK;aACT,OAAO,CAAC;YACP,OAAO,EAAE,0BAA0B;YACnC,QAAQ,EAAE,6DAA6D;YACvE,OAAO,EAAE,uBAAuB;YAChC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;gBACtB,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;gBAChE,MAAM,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACjC,CAAC;SACF,CAAC;aACD,OAAO,CAAC;YACP,OAAO,EAAE,oBAAoB;YAC7B,QAAQ,EAAE,yDAAyD;YACnE,OAAO,EAAE,mBAAmB;YAC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,MAAM,CAAC,cAAc,CAAC,CAAC;gBACxD,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;SACF,CAAC;aACD,aAAa,CAAC,CAAC,EAAE,+BAA+B,CAAC;aACjD,IAAI,EAAE;aACN,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC;aAClB,QAAQ,CAAC,iFAAiF,CAAC,CAAC;IACjG,CAAC,EACD,GAAG,EAAE;QACH,8DAA8D;QAC9D,OAAO,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;QAChF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAElC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAElC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CA0HnD"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { runCliCommand } from '../shared/commandRunner.js';
|
|
2
|
-
import {
|
|
2
|
+
import { withGlobalOptions } from '../../globalOptions.js';
|
|
3
3
|
export function setupAuthCommands(yargs) {
|
|
4
|
-
return yargs.command('auth <subcommand>', 'Manage authentication profiles for
|
|
4
|
+
return withGlobalOptions(yargs).command('auth <subcommand>', 'Manage authentication profiles for running servers', (commandYargs) => {
|
|
5
5
|
commandYargs
|
|
6
6
|
.command('login', 'Save a bearer token for a 1MCP server URL', (sub) => sub
|
|
7
|
-
.options(globalOptions || {})
|
|
8
7
|
.option('context', {
|
|
9
8
|
describe: 'Runtime Target Context name',
|
|
10
9
|
type: 'string',
|
|
@@ -23,7 +22,6 @@ export function setupAuthCommands(yargs) {
|
|
|
23
22
|
await runCliCommand(argv, authLoginCommand);
|
|
24
23
|
})
|
|
25
24
|
.command('status', 'Show saved authentication profiles', (sub) => sub
|
|
26
|
-
.options(globalOptions || {})
|
|
27
25
|
.option('context', {
|
|
28
26
|
describe: 'Runtime Target Context name',
|
|
29
27
|
type: 'string',
|
|
@@ -37,7 +35,6 @@ export function setupAuthCommands(yargs) {
|
|
|
37
35
|
await runCliCommand(argv, authStatusCommand);
|
|
38
36
|
})
|
|
39
37
|
.command('logout', 'Remove a saved authentication profile', (sub) => sub
|
|
40
|
-
.options(globalOptions || {})
|
|
41
38
|
.option('context', {
|
|
42
39
|
describe: 'Runtime Target Context name',
|
|
43
40
|
type: 'string',
|
|
@@ -61,7 +58,6 @@ export function setupAuthCommands(yargs) {
|
|
|
61
58
|
await runCliCommand(argv, authLogoutCommand);
|
|
62
59
|
})
|
|
63
60
|
.command('export-oauth-credentials', 'Explicitly export native inbound and upstream OAuth credentials to plaintext files in a stopped local Runtime Scope', (sub) => sub
|
|
64
|
-
.options(globalOptions || {})
|
|
65
61
|
.option('session-storage-path', { type: 'string', describe: 'Session storage base used by the runtime' })
|
|
66
62
|
.option('confirm-plaintext-export', {
|
|
67
63
|
type: 'boolean',
|
|
@@ -72,7 +68,6 @@ export function setupAuthCommands(yargs) {
|
|
|
72
68
|
await runCliCommand(argv, exportOAuthCredentialsCommand);
|
|
73
69
|
})
|
|
74
70
|
.command('export-upstream-credentials', 'Explicitly export native upstream OAuth credentials to plaintext files in a stopped local Runtime Scope', (sub) => sub
|
|
75
|
-
.options(globalOptions || {})
|
|
76
71
|
.option('session-storage-path', { type: 'string', describe: 'Session storage base used by the runtime' })
|
|
77
72
|
.option('confirm-plaintext-export', {
|
|
78
73
|
type: 'boolean',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI1D,MAAM,UAAU,iBAAiB,CAAC,KAAW;IAC3C,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC,OAAO,CACrC,mBAAmB,EACnB,oDAAoD,EACpD,CAAC,YAAY,EAAE,EAAE;QACf,YAAY;aACT,OAAO,CACN,OAAO,EACP,2CAA2C,EAC3C,CAAC,GAAG,EAAE,EAAE,CACN,GAAG;aACA,MAAM,CAAC,SAAS,EAAE;YACjB,QAAQ,EAAE,6BAA6B;YACvC,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,CAAC,KAAK,EAAE;YACb,KAAK,EAAE,GAAG;YACV,QAAQ,EAAE,yDAAyD;YACnE,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,CAAC,OAAO,EAAE;YACf,KAAK,EAAE,GAAG;YACV,QAAQ,EAAE,4CAA4C;YACtD,IAAI,EAAE,QAAQ;SACf,CAAC,EACN,KAAK,EAAE,IAAI,EAAE,EAAE;YACb,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;YACxD,MAAM,aAAa,CAAC,IAA8C,EAAE,gBAAgB,CAAC,CAAC;QACxF,CAAC,CACF;aACA,OAAO,CACN,QAAQ,EACR,oCAAoC,EACpC,CAAC,GAAG,EAAE,EAAE,CACN,GAAG;aACA,MAAM,CAAC,SAAS,EAAE;YACjB,QAAQ,EAAE,6BAA6B;YACvC,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,C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AE,KAAK;YACd,QAAQ,EAAE,iFAAiF;SAC5F,CAAC,EACN,KAAK,EAAE,IAAI,EAAE,EAAE;YACb,MAAM,EAAE,6BAA6B,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;YACtF,MAAM,aAAa,CACjB,IAA2D,EAC3D,6BAA6B,CAC9B,CAAC;QACJ,CAAC,CACF;aACA,OAAO,CACN,6BAA6B,EAC7B,yGAAyG,EACzG,CAAC,GAAG,EAAE,EAAE,CACN,GAAG;aACA,MAAM,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,0CAA0C,EAAE,CAAC;aACxG,MAAM,CAAC,0BAA0B,EAAE;YAClC,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,iFAAiF;SAC5F,CAAC,EACN,KAAK,EAAE,IAAI,EAAE,EAAE;YACb,MAAM,EAAE,gCAAgC,EAAE,GAAG,MAAM,MAAM,CAAC,gCAAgC,CAAC,CAAC;YAC5F,MAAM,aAAa,CACjB,IAA8D,EAC9D,gCAAgC,CACjC,CAAC;QACJ,CAAC,CACF;aACA,aAAa,CACZ,CAAC,EACD,uGAAuG,CACxG,CAAC;IACN,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Readable } from 'node:stream';
|
|
2
|
+
import { type ProjectOwnerTarget } from '../shared/projectOwnerStore.js';
|
|
3
|
+
import type { ProjectSelectionOptions } from '../shared/projectSelectionOptions.js';
|
|
4
|
+
import type { GlobalOptions } from '../../globalOptions.js';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export declare const BOOTSTRAP_INPUT_LIMIT: number;
|
|
7
|
+
export declare const BOOTSTRAP_INSTRUCTIONS_ADVISORY_THRESHOLD = 9000;
|
|
8
|
+
export declare const BOOTSTRAP_DEADLINE_MS = 5000;
|
|
9
|
+
export declare const bootstrapOptionsSchema: z.ZodObject<{
|
|
10
|
+
client: z.ZodEnum<{
|
|
11
|
+
codex: "codex";
|
|
12
|
+
claude: "claude";
|
|
13
|
+
}>;
|
|
14
|
+
event: z.ZodEnum<{
|
|
15
|
+
SessionStart: "SessionStart";
|
|
16
|
+
SubagentStart: "SubagentStart";
|
|
17
|
+
SessionEnd: "SessionEnd";
|
|
18
|
+
}>;
|
|
19
|
+
project: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
|
+
'project-set': z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export interface BootstrapCommandOptions extends GlobalOptions, ProjectSelectionOptions {
|
|
23
|
+
client: 'codex' | 'claude';
|
|
24
|
+
event: 'SessionStart' | 'SubagentStart' | 'SessionEnd';
|
|
25
|
+
url?: string;
|
|
26
|
+
context?: string;
|
|
27
|
+
preset?: string;
|
|
28
|
+
tags?: string[];
|
|
29
|
+
'tag-filter'?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function readBootstrapInput(input: Readable, deadlineMs?: number): Promise<string>;
|
|
32
|
+
export declare function buildInstructionsArguments(options: BootstrapCommandOptions): string[];
|
|
33
|
+
/** No shell, no stdin forwarding, and only the owned child is terminated on a deadline. */
|
|
34
|
+
export declare function runInstructionsProcess(executable: string, args: string[], deadlineMs?: number): Promise<string>;
|
|
35
|
+
export declare function renderBootstrapContext(options: BootstrapCommandOptions, input: string, renderInstructions: (options: BootstrapCommandOptions) => Promise<string>): Promise<string>;
|
|
36
|
+
export declare function bootstrapCommand(options: BootstrapCommandOptions): Promise<void>;
|
|
37
|
+
export declare function releaseRecordedOwnerTarget(ownerFile: string, target: ProjectOwnerTarget): Promise<void>;
|
|
38
|
+
//# sourceMappingURL=bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../src/commands/bootstrap/bootstrap.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ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,CAAC,MAAM,CAAC,GACxE,OAAO,CAAC,MAAM,CAAC,CAiDjB;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkDtF;AAED,wBAAsB,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAS7G"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { isAbsolute } from 'node:path';
|
|
3
|
+
import { resolveAgentSessionOptions } from '../shared/agentSession.js';
|
|
4
|
+
import { readProjectOwnerAssignment } from '../shared/projectOwnerStore.js';
|
|
5
|
+
import { getRuntimeParentEnvironment } from '../../config/runtimeBootstrap.js';
|
|
6
|
+
import { renderManagedDocContent } from '../../core/instructions/instructionsDistribution.js';
|
|
7
|
+
import { isSea } from 'node:sea';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { bootstrapOwner, releaseSessionOwner } from './bootstrapOwnership.js';
|
|
10
|
+
export const BOOTSTRAP_INPUT_LIMIT = 64 * 1024;
|
|
11
|
+
export const BOOTSTRAP_INSTRUCTIONS_ADVISORY_THRESHOLD = 9000;
|
|
12
|
+
export const BOOTSTRAP_DEADLINE_MS = 5000;
|
|
13
|
+
const instructionsFailures = {
|
|
14
|
+
instructions_timeout: 'Runtime instructions deadline exceeded',
|
|
15
|
+
instructions_unavailable: 'Runtime instructions process unavailable',
|
|
16
|
+
instructions_failed: 'Runtime instructions failed',
|
|
17
|
+
instructions_empty: 'Runtime returned no instructions',
|
|
18
|
+
};
|
|
19
|
+
class InstructionsProcessError extends Error {
|
|
20
|
+
code;
|
|
21
|
+
constructor(code) {
|
|
22
|
+
super(instructionsFailures[code]);
|
|
23
|
+
this.code = code;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function bootstrapGap(playbook, reason, recovery) {
|
|
27
|
+
return `${playbook}\nBootstrap coverage gap [${reason}]: project-specific instructions were not delivered. ${recovery}\n`;
|
|
28
|
+
}
|
|
29
|
+
export const bootstrapOptionsSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
client: z.enum(['codex', 'claude']),
|
|
32
|
+
event: z.enum(['SessionStart', 'SubagentStart', 'SessionEnd']),
|
|
33
|
+
project: z.array(z.string().min(1).max(4096)).min(1).max(32).optional(),
|
|
34
|
+
'project-set': z
|
|
35
|
+
.string()
|
|
36
|
+
.min(1)
|
|
37
|
+
.max(4096)
|
|
38
|
+
.refine(isAbsolute, 'Project set must be an absolute definition path')
|
|
39
|
+
.optional(),
|
|
40
|
+
})
|
|
41
|
+
.superRefine((value, context) => {
|
|
42
|
+
if (value['project-set']) {
|
|
43
|
+
if (value.project?.some((label) => label.length > 128)) {
|
|
44
|
+
context.addIssue({ code: 'custom', message: 'Project selection labels must fit 128 characters' });
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (!value.project)
|
|
49
|
+
return;
|
|
50
|
+
if (value.project.length !== 1) {
|
|
51
|
+
context.addIssue({ code: 'custom', message: 'Without project-set, assign exactly one checkout' });
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (!isAbsolute(value.project[0])) {
|
|
55
|
+
context.addIssue({ code: 'custom', message: 'Worker checkout assignment must be an absolute path' });
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
// Both clients document these fields. Agent identity and cwd are deliberately not assignment channels.
|
|
59
|
+
const hookInputSchema = z
|
|
60
|
+
.object({
|
|
61
|
+
hook_event_name: z.enum(['SessionStart', 'SubagentStart']),
|
|
62
|
+
session_id: z.string().optional(),
|
|
63
|
+
cwd: z.string().optional(),
|
|
64
|
+
agent_id: z.string().optional(),
|
|
65
|
+
agent_type: z.string().optional(),
|
|
66
|
+
})
|
|
67
|
+
.passthrough();
|
|
68
|
+
export async function readBootstrapInput(input, deadlineMs = 1000) {
|
|
69
|
+
return new Promise((resolve, reject) => {
|
|
70
|
+
let bytes = 0;
|
|
71
|
+
const chunks = [];
|
|
72
|
+
const finish = (error) => {
|
|
73
|
+
clearTimeout(timer);
|
|
74
|
+
input.off('data', onData);
|
|
75
|
+
input.off('end', onEnd);
|
|
76
|
+
input.off('error', onError);
|
|
77
|
+
input.pause();
|
|
78
|
+
if (error)
|
|
79
|
+
reject(error);
|
|
80
|
+
else
|
|
81
|
+
resolve(Buffer.concat(chunks).toString('utf8'));
|
|
82
|
+
};
|
|
83
|
+
const onData = (chunk) => {
|
|
84
|
+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
85
|
+
bytes += buffer.length;
|
|
86
|
+
if (bytes > BOOTSTRAP_INPUT_LIMIT) {
|
|
87
|
+
finish(new Error('Hook input exceeds 64 KiB'));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
chunks.push(buffer);
|
|
91
|
+
};
|
|
92
|
+
const onEnd = () => finish();
|
|
93
|
+
const onError = (error) => finish(error);
|
|
94
|
+
const timer = setTimeout(() => finish(bytes === 0 ? undefined : new Error('Hook stdin deadline exceeded')), deadlineMs);
|
|
95
|
+
input.on('data', onData);
|
|
96
|
+
input.once('end', onEnd);
|
|
97
|
+
input.once('error', onError);
|
|
98
|
+
input.resume();
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
export function buildInstructionsArguments(options) {
|
|
102
|
+
const args = ['instructions'];
|
|
103
|
+
for (const project of options.project ?? [])
|
|
104
|
+
args.push(`--project=${project}`);
|
|
105
|
+
for (const key of [
|
|
106
|
+
'project-set',
|
|
107
|
+
'project-owner',
|
|
108
|
+
'url',
|
|
109
|
+
'context',
|
|
110
|
+
'preset',
|
|
111
|
+
'tag-filter',
|
|
112
|
+
'config',
|
|
113
|
+
'config-dir',
|
|
114
|
+
]) {
|
|
115
|
+
const value = options[key];
|
|
116
|
+
if (typeof value === 'string')
|
|
117
|
+
args.push(`--${key}=${value}`);
|
|
118
|
+
}
|
|
119
|
+
for (const tag of options.tags ?? [])
|
|
120
|
+
args.push(`--tags=${tag}`);
|
|
121
|
+
return args;
|
|
122
|
+
}
|
|
123
|
+
/** No shell, no stdin forwarding, and only the owned child is terminated on a deadline. */
|
|
124
|
+
export async function runInstructionsProcess(executable, args, deadlineMs = BOOTSTRAP_DEADLINE_MS) {
|
|
125
|
+
return new Promise((resolve, reject) => {
|
|
126
|
+
const environment = { ...getRuntimeParentEnvironment() };
|
|
127
|
+
for (const key of Object.keys(environment)) {
|
|
128
|
+
if (['ONE_MCP_PROJECT', 'ONE_MCP_PROJECT_SET'].includes(key.toUpperCase()))
|
|
129
|
+
delete environment[key];
|
|
130
|
+
}
|
|
131
|
+
const child = spawn(executable, args, { shell: false, env: environment, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
132
|
+
const chunks = [];
|
|
133
|
+
let settled = false;
|
|
134
|
+
const finish = (error) => {
|
|
135
|
+
if (settled)
|
|
136
|
+
return;
|
|
137
|
+
settled = true;
|
|
138
|
+
clearTimeout(timer);
|
|
139
|
+
if (error) {
|
|
140
|
+
child.kill('SIGKILL');
|
|
141
|
+
reject(error);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const output = Buffer.concat(chunks).toString('utf8').trim();
|
|
145
|
+
if (!output)
|
|
146
|
+
reject(new InstructionsProcessError('instructions_empty'));
|
|
147
|
+
else
|
|
148
|
+
resolve(output);
|
|
149
|
+
};
|
|
150
|
+
const timer = setTimeout(() => finish(new InstructionsProcessError('instructions_timeout')), deadlineMs);
|
|
151
|
+
child.stdout.on('data', (chunk) => {
|
|
152
|
+
chunks.push(chunk);
|
|
153
|
+
});
|
|
154
|
+
// Drain stderr without retaining potentially sensitive runtime diagnostics.
|
|
155
|
+
child.stderr.resume();
|
|
156
|
+
child.once('error', () => finish(new InstructionsProcessError('instructions_unavailable')));
|
|
157
|
+
child.once('close', (code) => {
|
|
158
|
+
if (code !== 0)
|
|
159
|
+
finish(new InstructionsProcessError('instructions_failed'));
|
|
160
|
+
else
|
|
161
|
+
finish();
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
export async function renderBootstrapContext(options, input, renderInstructions) {
|
|
166
|
+
const playbook = renderManagedDocContent();
|
|
167
|
+
try {
|
|
168
|
+
bootstrapOptionsSchema.parse(options);
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
return bootstrapGap(playbook, 'invalid_assignment', 'Validate the client/event and use one absolute checkout or an absolute project-set definition with valid member labels before rerunning bootstrap.');
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
if (input.trim()) {
|
|
175
|
+
const parsed = hookInputSchema.parse(JSON.parse(input));
|
|
176
|
+
if (parsed.hook_event_name !== options.event)
|
|
177
|
+
throw new Error('Hook event does not match --event');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
return bootstrapGap(playbook, 'invalid_hook_input', 'Check that the hook delivers complete JSON with a matching hook_event_name, then rerun bootstrap with the assigned target.');
|
|
182
|
+
}
|
|
183
|
+
const assignment = options['project-set']
|
|
184
|
+
? { projectSet: options['project-set'], selection: options.project }
|
|
185
|
+
: options.project;
|
|
186
|
+
if (options.event === 'SubagentStart' && !assignment) {
|
|
187
|
+
return bootstrapGap(playbook, 'assignment_unresolved', 'Worker Project Assignment unresolved. Parent session identity and hook cwd are not targets. Before project-specific instructions or tools, obtain the dispatch assignment and run bootstrap with an explicit absolute --project path or --project-set definition path. Select an explicit target for each checkout-specific call in a multi-project set.');
|
|
188
|
+
}
|
|
189
|
+
const selection = assignment ? `Explicit Worker Project Assignment: ${JSON.stringify(assignment)}\n` : '';
|
|
190
|
+
const prefix = `${playbook}\n${selection}`;
|
|
191
|
+
try {
|
|
192
|
+
const rendered = await renderInstructions(options);
|
|
193
|
+
if (rendered.length > BOOTSTRAP_INSTRUCTIONS_ADVISORY_THRESHOLD) {
|
|
194
|
+
return `${prefix}${rendered}\n\n=== PRESET ADVISORY FOR THE AGENT ===\nInform the user briefly that the 1MCP instructions are large. Recommend using a 1MCP preset to select fewer relevant MCP servers in future sessions, for example \`1mcp instructions --preset <name>\`. All instructions have been delivered; continue the current task. Do not change the user's configuration automatically.\n`;
|
|
195
|
+
}
|
|
196
|
+
return `${prefix}${rendered}`;
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
const reason = error instanceof InstructionsProcessError ? error.code : 'instructions_failed';
|
|
200
|
+
return bootstrapGap(prefix, reason, `${instructionsFailures[reason]}. Check runtime availability and rerun 1mcp instructions with the same assignment, runtime and filters before project-specific tool use. Do not change targets or permissions to bypass the failure.`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
export async function bootstrapCommand(options) {
|
|
204
|
+
let input;
|
|
205
|
+
try {
|
|
206
|
+
input = process.stdin.isTTY ? '' : await readBootstrapInput(process.stdin);
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
input = '!invalid-hook-input';
|
|
210
|
+
}
|
|
211
|
+
if (options.event === 'SessionEnd') {
|
|
212
|
+
try {
|
|
213
|
+
await releaseSessionOwner(options, input, releaseRecordedOwnerTarget);
|
|
214
|
+
process.stdout.write(`${JSON.stringify({ suppressOutput: true })}\n`);
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
process.exitCode = 1;
|
|
218
|
+
process.stderr.write('Ownership cleanup coverage gap: session identity, recorded target, or runtime release could not be verified. Inspect project status before removal.\n');
|
|
219
|
+
process.stdout.write(`${JSON.stringify({ systemMessage: 'Ownership cleanup coverage gap: session identity, recorded targets, or runtime release could not be verified. Retry recorded terminal cleanup with project recover --project-owner <own-file>; inspect project status before removal.' })}\n`);
|
|
220
|
+
}
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
let ownerMessage = '';
|
|
224
|
+
let ownedOptions = options;
|
|
225
|
+
try {
|
|
226
|
+
const manualOptions = input.trim() ? options : await resolveAgentSessionOptions(options);
|
|
227
|
+
if (input.trim() || manualOptions['project-owner']) {
|
|
228
|
+
bootstrapOptionsSchema.parse(options);
|
|
229
|
+
const ownerFile = await bootstrapOwner(manualOptions, input);
|
|
230
|
+
ownedOptions = { ...options, 'project-owner': ownerFile };
|
|
231
|
+
if (options.event === 'SubagentStart' && !options.project && !options['project-set']) {
|
|
232
|
+
const assignment = await readProjectOwnerAssignment(ownerFile);
|
|
233
|
+
if (assignment?.project || assignment?.['project-set']) {
|
|
234
|
+
ownedOptions = { ...ownedOptions, project: assignment.project, 'project-set': assignment['project-set'] };
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
ownerMessage = `\nCaller ownership: your private fallback is --project-owner ${JSON.stringify(ownerFile)}. Codex CODEX_THREAD_ID resolves this credential through its private hook-written thread locator; CODEX_SESSION_ID, when present, must agree. Both IDs also support legacy direct resolution; normal calls omit --project-owner. Hosts without a trustworthy locator or both-ID integration and Claude require this explicit reference. Use the verified startup project by default; an assigned worker retains its dispatch default after per-call overrides. Do not pass this credential reference to parent, sibling, or child workers; each worker receives its own at bootstrap. Turn completion does not end ownership. Remote runtimes do not support this local ownership credential; remote instruction and tool calls remain available without local release coverage.\n`;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
ownerMessage =
|
|
242
|
+
'\nOwnership coverage gap: a verified session/worker identity, assigned default, or private owner storage was unavailable. No caller credential was fabricated; retain your own hook reference and resolve the reported sandbox or assignment gap. Do not release another caller.\n';
|
|
243
|
+
}
|
|
244
|
+
const context = await renderBootstrapContext(ownedOptions, input, async (selected) => {
|
|
245
|
+
const args = buildInstructionsArguments(selected);
|
|
246
|
+
const cliArgs = isSea() ? args : [process.argv[1], ...args];
|
|
247
|
+
return runInstructionsProcess(process.execPath, cliArgs);
|
|
248
|
+
});
|
|
249
|
+
process.stdout.write(`${JSON.stringify({ hookSpecificOutput: { hookEventName: options.event, additionalContext: context + ownerMessage } })}\n`);
|
|
250
|
+
}
|
|
251
|
+
export async function releaseRecordedOwnerTarget(ownerFile, target) {
|
|
252
|
+
const args = ['project', 'release', '--terminal-cleanup', '--format=json', `--project-owner=${ownerFile}`];
|
|
253
|
+
if (target['project-set'])
|
|
254
|
+
args.push(`--project-set=${target['project-set']}`);
|
|
255
|
+
else
|
|
256
|
+
for (const project of target.project)
|
|
257
|
+
args.push(`--project=${project}`);
|
|
258
|
+
for (const key of ['config-dir', 'config', 'context', 'url']) {
|
|
259
|
+
if (target[key])
|
|
260
|
+
args.push(`--${key}=${target[key]}`);
|
|
261
|
+
}
|
|
262
|
+
args.push(`--expected-runtime-scope=${target.runtimeScopeId}`);
|
|
263
|
+
await runInstructionsProcess(process.execPath, isSea() ? args : [process.argv[1], ...args], 2000);
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../src/commands/bootstrap/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAA2B,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAEhH,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAC;AAG7F,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,GAAG,IAAI,CAAC;AAC/C,MAAM,CAAC,MAAM,yCAAyC,GAAG,IAAI,CAAC;AAC9D,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;A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B;IAC5F,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,oBAAoB,EAAE,eAAe,EAAE,mBAAmB,SAAS,EAAE,CAAC,CAAC;IAC3G,IAAI,MAAM,CAAC,aAAa,CAAC;QAAE,IAAI,CAAC,IAAI,CAAC,iBAAiB,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;;QAC1E,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,OAAO;YAAE,IAAI,CAAC,IAAI,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC;IAC7E,KAAK,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAU,EAAE,CAAC;QACtE,IAAI,MAAM,CAAC,GAAG,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACxD,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,4BAA4B,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC;IAC/D,MAAM,sBAAsB,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AACpG,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ProjectOwnerTarget } from '../shared/projectOwnerStore.js';
|
|
2
|
+
import type { ProjectSelectionOptions } from '../shared/projectSelectionOptions.js';
|
|
3
|
+
import type { GlobalOptions } from '../../globalOptions.js';
|
|
4
|
+
interface OwnershipHookOptions extends GlobalOptions, ProjectSelectionOptions {
|
|
5
|
+
client: 'codex' | 'claude';
|
|
6
|
+
event: 'SessionStart' | 'SubagentStart' | 'SessionEnd';
|
|
7
|
+
}
|
|
8
|
+
export declare function bootstrapOwner(options: OwnershipHookOptions, input: string): Promise<string>;
|
|
9
|
+
export declare function releaseSessionOwner(options: OwnershipHookOptions, input: string, release: (ownerFile: string, target: ProjectOwnerTarget) => Promise<void>): Promise<void>;
|
|
10
|
+
/** Recovery requires prior verified SessionEnd evidence, never age or a parent's lifetime. */
|
|
11
|
+
export declare function recoverEndedSessionOwner(file: string, release: (ownerFile: string, target: ProjectOwnerTarget) => Promise<void>): Promise<void>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=bootstrapOwnership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrapOwnership.d.ts","sourceRoot":"","sources":["../../../src/commands/bootstrap/bootstrapOwnership.ts"],"names":[],"mappings":"AAQA,OAAO,EAQL,KAAK,kBAAkB,EAQxB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAI/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,UAAU,oBAAqB,SAAQ,aAAa,EAAE,uBAAuB;IAC3E,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC3B,KAAK,EAAE,cAAc,GAAG,eAAe,GAAG,YAAY,CAAC;CACxD;AAwBD,wBAAsB,cAAc,CAAC,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgClG;AAED,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,GACxE,OAAO,CAAC,IAAI,CAAC,CAgCf;AAED,8FAA8F;AAC9F,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,GACxE,OAAO,CAAC,IAAI,CAAC,CAWf"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { createProjectOwnerStorage, hasProjectOwnerState, resolveProjectOwnerStorage, temporaryProjectOwnerStorage, } from '../shared/projectOwnerStorage.js';
|
|
3
|
+
import { assertNoProjectOwnerCalls, assertProjectOwnerAbsent, createHookProjectOwner, hookProjectOwnerPath, isProjectOwnerEnded, markProjectOwnerEnded, markProjectOwnerReleased, readProjectOwner, readProjectOwnerTargets, readProjectOwnerTerminal, recordHookThreadLocator, recordProjectOwnerAssignment, removeProjectOwner, withProjectOwnerLock, } from '../shared/projectOwnerStore.js';
|
|
4
|
+
import { resolveProjectContext } from '../../config/projectConfigLoader.js';
|
|
5
|
+
import { getConfigDir } from '../../constants.js';
|
|
6
|
+
import { canonicalizeCheckoutPath } from '../../domains/project-selection/projectSelection.js';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
const inputSchema = z.object({
|
|
9
|
+
hook_event_name: z.enum(['SessionStart', 'SubagentStart', 'SessionEnd']),
|
|
10
|
+
session_id: z.string().min(1).max(512),
|
|
11
|
+
agent_id: z.string().min(1).max(512).optional(),
|
|
12
|
+
cwd: z.string().refine(path.isAbsolute).optional(),
|
|
13
|
+
});
|
|
14
|
+
function identity(options, input) {
|
|
15
|
+
const parsed = inputSchema.parse(JSON.parse(input));
|
|
16
|
+
if (parsed.hook_event_name !== options.event)
|
|
17
|
+
throw new Error('Hook event mismatch');
|
|
18
|
+
if (options.event === 'SessionStart' && parsed.agent_id)
|
|
19
|
+
throw new Error('SessionStart cannot establish worker assignment; use SubagentStart');
|
|
20
|
+
if (options.event === 'SubagentStart' && !parsed.agent_id)
|
|
21
|
+
throw new Error('Worker identity is missing');
|
|
22
|
+
if (options.event === 'SessionEnd' && parsed.agent_id)
|
|
23
|
+
throw new Error('SessionEnd does not verify worker termination');
|
|
24
|
+
return {
|
|
25
|
+
client: options.client,
|
|
26
|
+
sessionId: parsed.session_id,
|
|
27
|
+
...(parsed.agent_id ? { agentId: parsed.agent_id } : {}),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export async function bootstrapOwner(options, input) {
|
|
31
|
+
if (options.event === 'SessionEnd')
|
|
32
|
+
throw new Error('End events cannot create ownership');
|
|
33
|
+
const hookIdentity = input.trim() ? identity(options, input) : undefined;
|
|
34
|
+
const storage = hookIdentity
|
|
35
|
+
? await resolveProjectOwnerStorage(getConfigDir(options['config-dir']), hookIdentity.client, hookIdentity.agentId ?? hookIdentity.sessionId, hookIdentity.sessionId)
|
|
36
|
+
: undefined;
|
|
37
|
+
let file = options['project-owner'];
|
|
38
|
+
if (!file) {
|
|
39
|
+
if (!hookIdentity || !storage)
|
|
40
|
+
throw new Error('Missing hook owner identity');
|
|
41
|
+
if (storage === temporaryProjectOwnerStorage(getConfigDir(options['config-dir'])))
|
|
42
|
+
await createProjectOwnerStorage(storage);
|
|
43
|
+
file = await createHookProjectOwner(storage, hookIdentity);
|
|
44
|
+
}
|
|
45
|
+
await readProjectOwner(file);
|
|
46
|
+
const parsed = input.trim() ? inputSchema.parse(JSON.parse(input)) : undefined;
|
|
47
|
+
let project = options.project;
|
|
48
|
+
if (options.event === 'SessionStart' && !project && !options['project-set'] && parsed?.cwd) {
|
|
49
|
+
project = [await canonicalizeCheckoutPath((await resolveProjectContext(parsed.cwd)).projectRoot, parsed.cwd)];
|
|
50
|
+
}
|
|
51
|
+
await recordProjectOwnerAssignment(file, {
|
|
52
|
+
version: 1,
|
|
53
|
+
worker: options.event === 'SubagentStart',
|
|
54
|
+
...(project ? { project } : {}),
|
|
55
|
+
...(options['project-set'] ? { 'project-set': options['project-set'] } : {}),
|
|
56
|
+
});
|
|
57
|
+
if (hookIdentity && storage)
|
|
58
|
+
await recordHookThreadLocator(storage, hookIdentity, file);
|
|
59
|
+
return file;
|
|
60
|
+
}
|
|
61
|
+
export async function releaseSessionOwner(options, input, release) {
|
|
62
|
+
if (options.event !== 'SessionEnd')
|
|
63
|
+
throw new Error('Only verified SessionEnd may release ownership');
|
|
64
|
+
const hookIdentity = identity(options, input);
|
|
65
|
+
const storage = await resolveProjectOwnerStorage(getConfigDir(options['config-dir']), hookIdentity.client, hookIdentity.sessionId, hookIdentity.sessionId);
|
|
66
|
+
const file = hookProjectOwnerPath(storage, hookIdentity);
|
|
67
|
+
if (!(await hasProjectOwnerState(storage, hookIdentity.client, hookIdentity.sessionId, hookIdentity.sessionId))) {
|
|
68
|
+
await assertProjectOwnerAbsent(file, hookIdentity);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
await withProjectOwnerLock(file, async () => {
|
|
72
|
+
if ((await readProjectOwnerTerminal(file))?.released) {
|
|
73
|
+
await removeProjectOwner(file);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
let targets;
|
|
77
|
+
try {
|
|
78
|
+
targets = await readProjectOwnerTargets(file);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
|
|
82
|
+
await assertProjectOwnerAbsent(file, identity(options, input));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
await markProjectOwnerEnded(file, identity(options, input));
|
|
88
|
+
await releaseTargets(file, targets, release);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/** Recovery requires prior verified SessionEnd evidence, never age or a parent's lifetime. */
|
|
92
|
+
export async function recoverEndedSessionOwner(file, release) {
|
|
93
|
+
await withProjectOwnerLock(file, async () => {
|
|
94
|
+
if ((await readProjectOwnerTerminal(file))?.released) {
|
|
95
|
+
await removeProjectOwner(file);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (!(await isProjectOwnerEnded(file)))
|
|
99
|
+
throw new Error('No verified terminal record; active or abandoned owners cannot be recovered automatically');
|
|
100
|
+
const targets = await readProjectOwnerTargets(file);
|
|
101
|
+
await releaseTargets(file, targets, release);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
async function releaseTargets(file, targets, release) {
|
|
105
|
+
await assertNoProjectOwnerCalls(file);
|
|
106
|
+
const results = await Promise.allSettled(targets.map((target) => release(file, target)));
|
|
107
|
+
if (results.some((result) => result.status === 'rejected'))
|
|
108
|
+
throw new Error('Session ownership cleanup is incomplete');
|
|
109
|
+
await markProjectOwnerReleased(file);
|
|
110
|
+
await removeProjectOwner(file);
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=bootstrapOwnership.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrapOwnership.js","sourceRoot":"","sources":["../../../src/commands/bootstrap/bootstrapOwnership.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EAExB,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAG9F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;IACxE,UA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O;QACT,CAAC;QACD,IAAI,CAAC,CAAC,MAAM,mBAAmB,CAAC,IAAI,CAAC,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,2FAA2F,CAAC,CAAC;QAC/G,MAAM,OAAO,GAAG,MAAM,uBAAuB,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,cAAc,CAC3B,IAAY,EACZ,OAA6B,EAC7B,OAAyE;IAEzE,MAAM,yBAAyB,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACzF,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,MAAM,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,kBAAkB,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/bootstrap/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAElC,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CA2BvD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { withProjectSelectionOptions } from '../shared/projectSelectionOptions.js';
|
|
2
|
+
import { withGlobalOptions } from '../../globalOptions.js';
|
|
3
|
+
export function setupBootstrapCommand(yargs) {
|
|
4
|
+
return withGlobalOptions(yargs).command('bootstrap', 'Deliver agent hook instructions', (command) => withProjectSelectionOptions(command)
|
|
5
|
+
.env(false)
|
|
6
|
+
.option('client', { type: 'string', choices: ['codex', 'claude'], demandOption: true })
|
|
7
|
+
.option('event', {
|
|
8
|
+
type: 'string',
|
|
9
|
+
choices: ['SessionStart', 'SubagentStart', 'SessionEnd'],
|
|
10
|
+
demandOption: true,
|
|
11
|
+
})
|
|
12
|
+
.option('url', { type: 'string', describe: 'Runtime URL' })
|
|
13
|
+
.option('context', { type: 'string', describe: 'Named Runtime Target Context' })
|
|
14
|
+
.option('preset', { type: 'string' })
|
|
15
|
+
.option('tags', { type: 'array', string: true })
|
|
16
|
+
.option('tag-filter', { type: 'string' })
|
|
17
|
+
.epilogue('Worker assignments come from dispatch instructions, never parent cwd or session identity. Disabled or untrusted hooks remain a delivery coverage gap.'), async (argv) => {
|
|
18
|
+
const { bootstrapCommand } = await import('./bootstrap.js');
|
|
19
|
+
await bootstrapCommand(argv);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|