@a5c-ai/genty-platform 5.1.1-staging.00ceebd28cf2
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 +48 -0
- package/dist/anycli/cache.d.ts +45 -0
- package/dist/anycli/cache.d.ts.map +1 -0
- package/dist/anycli/cache.js +118 -0
- package/dist/anycli/index.d.ts +10 -0
- package/dist/anycli/index.d.ts.map +1 -0
- package/dist/anycli/index.js +25 -0
- package/dist/anycli/types.d.ts +32 -0
- package/dist/anycli/types.d.ts.map +1 -0
- package/dist/anycli/types.js +9 -0
- package/dist/api/breakpoints.d.ts +93 -0
- package/dist/api/breakpoints.d.ts.map +1 -0
- package/dist/api/breakpoints.js +334 -0
- package/dist/api/effects.d.ts +14 -0
- package/dist/api/effects.d.ts.map +1 -0
- package/dist/api/effects.js +306 -0
- package/dist/api/effectsTypes.d.ts +79 -0
- package/dist/api/effectsTypes.d.ts.map +1 -0
- package/dist/api/effectsTypes.js +6 -0
- package/dist/api/eventStream.d.ts +34 -0
- package/dist/api/eventStream.d.ts.map +1 -0
- package/dist/api/eventStream.js +126 -0
- package/dist/api/index.d.ts +10 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +27 -0
- package/dist/api/runs.d.ts +85 -0
- package/dist/api/runs.d.ts.map +1 -0
- package/dist/api/runs.js +247 -0
- package/dist/api/sessions.d.ts +17 -0
- package/dist/api/sessions.d.ts.map +1 -0
- package/dist/api/sessions.js +58 -0
- package/dist/api/utils.d.ts +28 -0
- package/dist/api/utils.d.ts.map +1 -0
- package/dist/api/utils.js +74 -0
- package/dist/breakpoints/analytics.d.ts +46 -0
- package/dist/breakpoints/analytics.d.ts.map +1 -0
- package/dist/breakpoints/analytics.js +64 -0
- package/dist/breakpoints/approvalChains.d.ts +68 -0
- package/dist/breakpoints/approvalChains.d.ts.map +1 -0
- package/dist/breakpoints/approvalChains.js +111 -0
- package/dist/breakpoints/delegation.d.ts +42 -0
- package/dist/breakpoints/delegation.d.ts.map +1 -0
- package/dist/breakpoints/delegation.js +199 -0
- package/dist/breakpoints/delegationTypes.d.ts +46 -0
- package/dist/breakpoints/delegationTypes.d.ts.map +1 -0
- package/dist/breakpoints/delegationTypes.js +10 -0
- package/dist/breakpoints/postures.d.ts +28 -0
- package/dist/breakpoints/postures.d.ts.map +1 -0
- package/dist/breakpoints/postures.js +100 -0
- package/dist/compression/compaction.d.ts +82 -0
- package/dist/compression/compaction.d.ts.map +1 -0
- package/dist/compression/compaction.js +310 -0
- package/dist/compression/compactionStrategy.d.ts +37 -0
- package/dist/compression/compactionStrategy.d.ts.map +1 -0
- package/dist/compression/compactionStrategy.js +52 -0
- package/dist/compression/compressionFamilies.d.ts +39 -0
- package/dist/compression/compressionFamilies.d.ts.map +1 -0
- package/dist/compression/compressionFamilies.js +123 -0
- package/dist/context/dynamic.d.ts +16 -0
- package/dist/context/dynamic.d.ts.map +1 -0
- package/dist/context/dynamic.js +55 -0
- package/dist/context/instructions.d.ts +15 -0
- package/dist/context/instructions.d.ts.map +1 -0
- package/dist/context/instructions.js +97 -0
- package/dist/cost/claudeCodeParser.d.ts +81 -0
- package/dist/cost/claudeCodeParser.d.ts.map +1 -0
- package/dist/cost/claudeCodeParser.js +232 -0
- package/dist/cost/collector.d.ts +42 -0
- package/dist/cost/collector.d.ts.map +1 -0
- package/dist/cost/collector.js +105 -0
- package/dist/cost/effectCost.d.ts +23 -0
- package/dist/cost/effectCost.d.ts.map +1 -0
- package/dist/cost/effectCost.js +26 -0
- package/dist/cost/index.d.ts +7 -0
- package/dist/cost/index.d.ts.map +1 -0
- package/dist/cost/index.js +28 -0
- package/dist/cost/journal.d.ts +40 -0
- package/dist/cost/journal.d.ts.map +1 -0
- package/dist/cost/journal.js +158 -0
- package/dist/cost/types.d.ts +172 -0
- package/dist/cost/types.d.ts.map +1 -0
- package/dist/cost/types.js +229 -0
- package/dist/daemon/automationExecutor.d.ts +16 -0
- package/dist/daemon/automationExecutor.d.ts.map +1 -0
- package/dist/daemon/automationExecutor.js +222 -0
- package/dist/daemon/config.d.ts +8 -0
- package/dist/daemon/config.d.ts.map +1 -0
- package/dist/daemon/config.js +245 -0
- package/dist/daemon/daemonLog.d.ts +13 -0
- package/dist/daemon/daemonLog.d.ts.map +1 -0
- package/dist/daemon/daemonLog.js +64 -0
- package/dist/daemon/durableQueue.d.ts +41 -0
- package/dist/daemon/durableQueue.d.ts.map +1 -0
- package/dist/daemon/durableQueue.js +183 -0
- package/dist/daemon/fileWatcher.d.ts +9 -0
- package/dist/daemon/fileWatcher.d.ts.map +1 -0
- package/dist/daemon/fileWatcher.js +144 -0
- package/dist/daemon/index.d.ts +9 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +26 -0
- package/dist/daemon/lifecycle.d.ts +12 -0
- package/dist/daemon/lifecycle.d.ts.map +1 -0
- package/dist/daemon/lifecycle.js +257 -0
- package/dist/daemon/loop.d.ts +27 -0
- package/dist/daemon/loop.d.ts.map +1 -0
- package/dist/daemon/loop.js +387 -0
- package/dist/daemon/timerScheduler.d.ts +13 -0
- package/dist/daemon/timerScheduler.d.ts.map +1 -0
- package/dist/daemon/timerScheduler.js +212 -0
- package/dist/daemon/types.d.ts +122 -0
- package/dist/daemon/types.d.ts.map +1 -0
- package/dist/daemon/types.js +25 -0
- package/dist/daemon/webhookListener.d.ts +6 -0
- package/dist/daemon/webhookListener.d.ts.map +1 -0
- package/dist/daemon/webhookListener.js +132 -0
- package/dist/extensions/discovery.d.ts +15 -0
- package/dist/extensions/discovery.d.ts.map +1 -0
- package/dist/extensions/discovery.js +119 -0
- package/dist/extensions/installer.d.ts +14 -0
- package/dist/extensions/installer.d.ts.map +1 -0
- package/dist/extensions/installer.js +100 -0
- package/dist/governance/authority.d.ts +68 -0
- package/dist/governance/authority.d.ts.map +1 -0
- package/dist/governance/authority.js +136 -0
- package/dist/governance/bridge.d.ts +17 -0
- package/dist/governance/bridge.d.ts.map +1 -0
- package/dist/governance/bridge.js +46 -0
- package/dist/governance/builtins.d.ts +25 -0
- package/dist/governance/builtins.d.ts.map +1 -0
- package/dist/governance/builtins.js +67 -0
- package/dist/governance/categories.d.ts +58 -0
- package/dist/governance/categories.d.ts.map +1 -0
- package/dist/governance/categories.js +120 -0
- package/dist/governance/decisionTrail.d.ts +60 -0
- package/dist/governance/decisionTrail.d.ts.map +1 -0
- package/dist/governance/decisionTrail.js +68 -0
- package/dist/governance/engine.d.ts +20 -0
- package/dist/governance/engine.d.ts.map +1 -0
- package/dist/governance/engine.js +124 -0
- package/dist/governance/index.d.ts +20 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +75 -0
- package/dist/governance/logging.d.ts +18 -0
- package/dist/governance/logging.d.ts.map +1 -0
- package/dist/governance/logging.js +83 -0
- package/dist/governance/mandate.d.ts +83 -0
- package/dist/governance/mandate.d.ts.map +1 -0
- package/dist/governance/mandate.js +180 -0
- package/dist/governance/permissionEvents.d.ts +51 -0
- package/dist/governance/permissionEvents.d.ts.map +1 -0
- package/dist/governance/permissionEvents.js +52 -0
- package/dist/governance/permissionPropagation.d.ts +18 -0
- package/dist/governance/permissionPropagation.d.ts.map +1 -0
- package/dist/governance/permissionPropagation.js +58 -0
- package/dist/governance/postureBridge.d.ts +17 -0
- package/dist/governance/postureBridge.d.ts.map +1 -0
- package/dist/governance/postureBridge.js +117 -0
- package/dist/governance/privacySettings.d.ts +31 -0
- package/dist/governance/privacySettings.d.ts.map +1 -0
- package/dist/governance/privacySettings.js +104 -0
- package/dist/governance/sandboxBridge.d.ts +49 -0
- package/dist/governance/sandboxBridge.d.ts.map +1 -0
- package/dist/governance/sandboxBridge.js +77 -0
- package/dist/governance/sandboxPolicy.d.ts +51 -0
- package/dist/governance/sandboxPolicy.d.ts.map +1 -0
- package/dist/governance/sandboxPolicy.js +177 -0
- package/dist/governance/types.d.ts +3 -0
- package/dist/governance/types.d.ts.map +1 -0
- package/dist/governance/types.js +5 -0
- package/dist/harness/adapters/adapterBridge.d.ts +71 -0
- package/dist/harness/adapters/adapterBridge.d.ts.map +1 -0
- package/dist/harness/adapters/adapterBridge.js +117 -0
- package/dist/harness/adapters/adapterClientFactory.d.ts +29 -0
- package/dist/harness/adapters/adapterClientFactory.d.ts.map +1 -0
- package/dist/harness/adapters/adapterClientFactory.js +90 -0
- package/dist/harness/adapters/adapterEventEmitter.d.ts +51 -0
- package/dist/harness/adapters/adapterEventEmitter.d.ts.map +1 -0
- package/dist/harness/adapters/adapterEventEmitter.js +143 -0
- package/dist/harness/adapters/adapterEventMapper.d.ts +63 -0
- package/dist/harness/adapters/adapterEventMapper.d.ts.map +1 -0
- package/dist/harness/adapters/adapterEventMapper.js +100 -0
- package/dist/harness/adapters/adapterHarnessMap.d.ts +25 -0
- package/dist/harness/adapters/adapterHarnessMap.d.ts.map +1 -0
- package/dist/harness/adapters/adapterHarnessMap.js +55 -0
- package/dist/harness/adapters/adapterStdinReader.d.ts +45 -0
- package/dist/harness/adapters/adapterStdinReader.d.ts.map +1 -0
- package/dist/harness/adapters/adapterStdinReader.js +106 -0
- package/dist/harness/adapters/adapterTypes.d.ts +122 -0
- package/dist/harness/adapters/adapterTypes.d.ts.map +1 -0
- package/dist/harness/adapters/adapterTypes.js +11 -0
- package/dist/harness/adapters/index.d.ts +17 -0
- package/dist/harness/adapters/index.d.ts.map +1 -0
- package/dist/harness/adapters/index.js +34 -0
- package/dist/harness/backgroundTracker.d.ts +64 -0
- package/dist/harness/backgroundTracker.d.ts.map +1 -0
- package/dist/harness/backgroundTracker.js +107 -0
- package/dist/harness/budgetDowngrade.d.ts +12 -0
- package/dist/harness/budgetDowngrade.d.ts.map +1 -0
- package/dist/harness/budgetDowngrade.js +71 -0
- package/dist/harness/builtInHarness.d.ts +3 -0
- package/dist/harness/builtInHarness.d.ts.map +1 -0
- package/dist/harness/builtInHarness.js +18 -0
- package/dist/harness/capabilityRouter.d.ts +76 -0
- package/dist/harness/capabilityRouter.d.ts.map +1 -0
- package/dist/harness/capabilityRouter.js +176 -0
- package/dist/harness/circuitBreaker.d.ts +51 -0
- package/dist/harness/circuitBreaker.d.ts.map +1 -0
- package/dist/harness/circuitBreaker.js +110 -0
- package/dist/harness/concurrentEffects.d.ts +39 -0
- package/dist/harness/concurrentEffects.d.ts.map +1 -0
- package/dist/harness/concurrentEffects.js +90 -0
- package/dist/harness/effectRouting.d.ts +57 -0
- package/dist/harness/effectRouting.d.ts.map +1 -0
- package/dist/harness/effectRouting.js +130 -0
- package/dist/harness/extensionToolBridge.d.ts +13 -0
- package/dist/harness/extensionToolBridge.d.ts.map +1 -0
- package/dist/harness/extensionToolBridge.js +23 -0
- package/dist/harness/fallbackChains.d.ts +42 -0
- package/dist/harness/fallbackChains.d.ts.map +1 -0
- package/dist/harness/fallbackChains.js +69 -0
- package/dist/harness/gentySessionContext.d.ts +31 -0
- package/dist/harness/gentySessionContext.d.ts.map +1 -0
- package/dist/harness/gentySessionContext.js +49 -0
- package/dist/harness/gentySessionIntegration.d.ts +16 -0
- package/dist/harness/gentySessionIntegration.d.ts.map +1 -0
- package/dist/harness/gentySessionIntegration.js +66 -0
- package/dist/harness/hostContract.d.ts +69 -0
- package/dist/harness/hostContract.d.ts.map +1 -0
- package/dist/harness/hostContract.js +169 -0
- package/dist/harness/index.d.ts +25 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +122 -0
- package/dist/harness/internal/createRun/agent-core-loop.d.ts +43 -0
- package/dist/harness/internal/createRun/agent-core-loop.d.ts.map +1 -0
- package/dist/harness/internal/createRun/agent-core-loop.js +247 -0
- package/dist/harness/internal/createRun/askUserQuestion.d.ts +11 -0
- package/dist/harness/internal/createRun/askUserQuestion.d.ts.map +1 -0
- package/dist/harness/internal/createRun/askUserQuestion.js +162 -0
- package/dist/harness/internal/createRun/index.d.ts +25 -0
- package/dist/harness/internal/createRun/index.d.ts.map +1 -0
- package/dist/harness/internal/createRun/index.js +163 -0
- package/dist/harness/internal/createRun/orchestration/constants.d.ts +7 -0
- package/dist/harness/internal/createRun/orchestration/constants.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/constants.js +17 -0
- package/dist/harness/internal/createRun/orchestration/dispatch.d.ts +23 -0
- package/dist/harness/internal/createRun/orchestration/dispatch.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/dispatch.js +135 -0
- package/dist/harness/internal/createRun/orchestration/effects.d.ts +135 -0
- package/dist/harness/internal/createRun/orchestration/effects.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/effects.js +904 -0
- package/dist/harness/internal/createRun/orchestration/effectsHelpers.d.ts +21 -0
- package/dist/harness/internal/createRun/orchestration/effectsHelpers.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/effectsHelpers.js +80 -0
- package/dist/harness/internal/createRun/orchestration/externalPhase.d.ts +3 -0
- package/dist/harness/internal/createRun/orchestration/externalPhase.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/externalPhase.js +403 -0
- package/dist/harness/internal/createRun/orchestration/externalPhaseHelpers.d.ts +16 -0
- package/dist/harness/internal/createRun/orchestration/externalPhaseHelpers.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/externalPhaseHelpers.js +106 -0
- package/dist/harness/internal/createRun/orchestration/hookDecisionEffects.d.ts +32 -0
- package/dist/harness/internal/createRun/orchestration/hookDecisionEffects.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/hookDecisionEffects.js +76 -0
- package/dist/harness/internal/createRun/orchestration/index.d.ts +29 -0
- package/dist/harness/internal/createRun/orchestration/index.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/index.js +370 -0
- package/dist/harness/internal/createRun/orchestration/internalPhase.d.ts +3 -0
- package/dist/harness/internal/createRun/orchestration/internalPhase.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/internalPhase.js +656 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.d.ts +27 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/internalTools.js +264 -0
- package/dist/harness/internal/createRun/orchestration/internalToolsHelpers.d.ts +17 -0
- package/dist/harness/internal/createRun/orchestration/internalToolsHelpers.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/internalToolsHelpers.js +23 -0
- package/dist/harness/internal/createRun/orchestration/taskResult.d.ts +10 -0
- package/dist/harness/internal/createRun/orchestration/taskResult.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/taskResult.js +67 -0
- package/dist/harness/internal/createRun/orchestration/types.d.ts +48 -0
- package/dist/harness/internal/createRun/orchestration/types.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/types.js +2 -0
- package/dist/harness/internal/createRun/orchestration/verbose.d.ts +7 -0
- package/dist/harness/internal/createRun/orchestration/verbose.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/verbose.js +240 -0
- package/dist/harness/internal/createRun/orchestration/workerSessionEnhancer.d.ts +4 -0
- package/dist/harness/internal/createRun/orchestration/workerSessionEnhancer.d.ts.map +1 -0
- package/dist/harness/internal/createRun/orchestration/workerSessionEnhancer.js +36 -0
- package/dist/harness/internal/createRun/output.d.ts +40 -0
- package/dist/harness/internal/createRun/output.d.ts.map +1 -0
- package/dist/harness/internal/createRun/output.js +467 -0
- package/dist/harness/internal/createRun/pi.d.ts +10 -0
- package/dist/harness/internal/createRun/pi.d.ts.map +1 -0
- package/dist/harness/internal/createRun/pi.js +35 -0
- package/dist/harness/internal/createRun/planProcess/agentOutput.d.ts +5 -0
- package/dist/harness/internal/createRun/planProcess/agentOutput.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/agentOutput.js +113 -0
- package/dist/harness/internal/createRun/planProcess/delegation.d.ts +23 -0
- package/dist/harness/internal/createRun/planProcess/delegation.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/delegation.js +176 -0
- package/dist/harness/internal/createRun/planProcess/external.d.ts +14 -0
- package/dist/harness/internal/createRun/planProcess/external.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/external.js +139 -0
- package/dist/harness/internal/createRun/planProcess/index.d.ts +12 -0
- package/dist/harness/internal/createRun/planProcess/index.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/index.js +24 -0
- package/dist/harness/internal/createRun/planProcess/paths.d.ts +7 -0
- package/dist/harness/internal/createRun/planProcess/paths.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/paths.js +98 -0
- package/dist/harness/internal/createRun/planProcess/phase.d.ts +6 -0
- package/dist/harness/internal/createRun/planProcess/phase.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/phase.js +424 -0
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.d.ts +37 -0
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/phaseHelpers.js +159 -0
- package/dist/harness/internal/createRun/planProcess/phaseTypes.d.ts +25 -0
- package/dist/harness/internal/createRun/planProcess/phaseTypes.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/phaseTypes.js +6 -0
- package/dist/harness/internal/createRun/planProcess/prompts.d.ts +22 -0
- package/dist/harness/internal/createRun/planProcess/prompts.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/prompts.js +239 -0
- package/dist/harness/internal/createRun/planProcess/recovery.d.ts +18 -0
- package/dist/harness/internal/createRun/planProcess/recovery.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/recovery.js +205 -0
- package/dist/harness/internal/createRun/planProcess/runState.d.ts +40 -0
- package/dist/harness/internal/createRun/planProcess/runState.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/runState.js +179 -0
- package/dist/harness/internal/createRun/planProcess/understandIntent.d.ts +22 -0
- package/dist/harness/internal/createRun/planProcess/understandIntent.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/understandIntent.js +65 -0
- package/dist/harness/internal/createRun/planProcess/validation.d.ts +4 -0
- package/dist/harness/internal/createRun/planProcess/validation.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/validation.js +260 -0
- package/dist/harness/internal/createRun/planProcess/validationSource.d.ts +13 -0
- package/dist/harness/internal/createRun/planProcess/validationSource.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/validationSource.js +345 -0
- package/dist/harness/internal/createRun/planProcess/validationText.d.ts +3 -0
- package/dist/harness/internal/createRun/planProcess/validationText.d.ts.map +1 -0
- package/dist/harness/internal/createRun/planProcess/validationText.js +145 -0
- package/dist/harness/internal/createRun/prompts.d.ts +59 -0
- package/dist/harness/internal/createRun/prompts.d.ts.map +1 -0
- package/dist/harness/internal/createRun/prompts.js +427 -0
- package/dist/harness/internal/createRun/resumeState.d.ts +28 -0
- package/dist/harness/internal/createRun/resumeState.d.ts.map +1 -0
- package/dist/harness/internal/createRun/resumeState.js +133 -0
- package/dist/harness/internal/createRun/utils.d.ts +184 -0
- package/dist/harness/internal/createRun/utils.d.ts.map +1 -0
- package/dist/harness/internal/createRun/utils.js +218 -0
- package/dist/harness/internal.d.ts +13 -0
- package/dist/harness/internal.d.ts.map +1 -0
- package/dist/harness/internal.js +149 -0
- package/dist/harness/invoker/launch.d.ts +20 -0
- package/dist/harness/invoker/launch.d.ts.map +1 -0
- package/dist/harness/invoker/launch.js +23 -0
- package/dist/harness/invoker/processControl.d.ts +11 -0
- package/dist/harness/invoker/processControl.d.ts.map +1 -0
- package/dist/harness/invoker/processControl.js +50 -0
- package/dist/harness/invoker.d.ts +44 -0
- package/dist/harness/invoker.d.ts.map +1 -0
- package/dist/harness/invoker.js +341 -0
- package/dist/harness/lspIntegration.d.ts +48 -0
- package/dist/harness/lspIntegration.d.ts.map +1 -0
- package/dist/harness/lspIntegration.js +45 -0
- package/dist/harness/modeSelector.d.ts +50 -0
- package/dist/harness/modeSelector.d.ts.map +1 -0
- package/dist/harness/modeSelector.js +124 -0
- package/dist/harness/modelSelection.d.ts +37 -0
- package/dist/harness/modelSelection.d.ts.map +1 -0
- package/dist/harness/modelSelection.js +81 -0
- package/dist/harness/multiHarnessDispatch.d.ts +49 -0
- package/dist/harness/multiHarnessDispatch.d.ts.map +1 -0
- package/dist/harness/multiHarnessDispatch.js +73 -0
- package/dist/harness/oauthIntegration.d.ts +55 -0
- package/dist/harness/oauthIntegration.d.ts.map +1 -0
- package/dist/harness/oauthIntegration.js +84 -0
- package/dist/harness/operatorCommands.d.ts +38 -0
- package/dist/harness/operatorCommands.d.ts.map +1 -0
- package/dist/harness/operatorCommands.js +118 -0
- package/dist/harness/parallelFileOps.d.ts +56 -0
- package/dist/harness/parallelFileOps.d.ts.map +1 -0
- package/dist/harness/parallelFileOps.js +166 -0
- package/dist/harness/piSecureSandbox.d.ts +8 -0
- package/dist/harness/piSecureSandbox.d.ts.map +1 -0
- package/dist/harness/piSecureSandbox.js +366 -0
- package/dist/harness/piSecureSandboxTypes.d.ts +51 -0
- package/dist/harness/piSecureSandboxTypes.d.ts.map +1 -0
- package/dist/harness/piSecureSandboxTypes.js +6 -0
- package/dist/harness/piWrapper/compaction.d.ts +13 -0
- package/dist/harness/piWrapper/compaction.d.ts.map +1 -0
- package/dist/harness/piWrapper/compaction.js +38 -0
- package/dist/harness/piWrapper/instructionPrompts.d.ts +2 -0
- package/dist/harness/piWrapper/instructionPrompts.d.ts.map +1 -0
- package/dist/harness/piWrapper/instructionPrompts.js +97 -0
- package/dist/harness/piWrapper/moduleSupport.d.ts +78 -0
- package/dist/harness/piWrapper/moduleSupport.d.ts.map +1 -0
- package/dist/harness/piWrapper/moduleSupport.js +207 -0
- package/dist/harness/piWrapper.d.ts +82 -0
- package/dist/harness/piWrapper.d.ts.map +1 -0
- package/dist/harness/piWrapper.js +406 -0
- package/dist/harness/planMode.d.ts +68 -0
- package/dist/harness/planMode.d.ts.map +1 -0
- package/dist/harness/planMode.js +145 -0
- package/dist/harness/profileOrchestration.d.ts +55 -0
- package/dist/harness/profileOrchestration.d.ts.map +1 -0
- package/dist/harness/profileOrchestration.js +61 -0
- package/dist/harness/selectionPolicies.d.ts +29 -0
- package/dist/harness/selectionPolicies.d.ts.map +1 -0
- package/dist/harness/selectionPolicies.js +165 -0
- package/dist/harness/streamingParallelism.d.ts +43 -0
- package/dist/harness/streamingParallelism.d.ts.map +1 -0
- package/dist/harness/streamingParallelism.js +113 -0
- package/dist/harness/streamingRenderer.d.ts +64 -0
- package/dist/harness/streamingRenderer.d.ts.map +1 -0
- package/dist/harness/streamingRenderer.js +85 -0
- package/dist/harness/types.d.ts +278 -0
- package/dist/harness/types.d.ts.map +1 -0
- package/dist/harness/types.js +34 -0
- package/dist/harness/websocketSession.d.ts +63 -0
- package/dist/harness/websocketSession.d.ts.map +1 -0
- package/dist/harness/websocketSession.js +113 -0
- package/dist/harness/worktreeIsolation.d.ts +39 -0
- package/dist/harness/worktreeIsolation.d.ts.map +1 -0
- package/dist/harness/worktreeIsolation.js +85 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/interaction/askUserQuestion/core.d.ts +8 -0
- package/dist/interaction/askUserQuestion/core.d.ts.map +1 -0
- package/dist/interaction/askUserQuestion/core.js +112 -0
- package/dist/interaction/askUserQuestion/terminal.d.ts +15 -0
- package/dist/interaction/askUserQuestion/terminal.d.ts.map +1 -0
- package/dist/interaction/askUserQuestion/terminal.js +128 -0
- package/dist/interaction/askUserQuestion.d.ts +10 -0
- package/dist/interaction/askUserQuestion.d.ts.map +1 -0
- package/dist/interaction/askUserQuestion.js +295 -0
- package/dist/interaction/askUserQuestionTypes.d.ts +31 -0
- package/dist/interaction/askUserQuestionTypes.d.ts.map +1 -0
- package/dist/interaction/askUserQuestionTypes.js +6 -0
- package/dist/interaction/commandDiscovery.d.ts +38 -0
- package/dist/interaction/commandDiscovery.d.ts.map +1 -0
- package/dist/interaction/commandDiscovery.js +106 -0
- package/dist/interaction/index.d.ts +11 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/interaction/index.js +42 -0
- package/dist/interaction/interactionRouter.d.ts +25 -0
- package/dist/interaction/interactionRouter.d.ts.map +1 -0
- package/dist/interaction/interactionRouter.js +55 -0
- package/dist/interaction/model-switch.d.ts +16 -0
- package/dist/interaction/model-switch.d.ts.map +1 -0
- package/dist/interaction/model-switch.js +41 -0
- package/dist/interaction/permissionApprovalUi.d.ts +32 -0
- package/dist/interaction/permissionApprovalUi.d.ts.map +1 -0
- package/dist/interaction/permissionApprovalUi.js +96 -0
- package/dist/interaction/steering.d.ts +17 -0
- package/dist/interaction/steering.d.ts.map +1 -0
- package/dist/interaction/steering.js +41 -0
- package/dist/interaction/typedEffectPatterns.d.ts +55 -0
- package/dist/interaction/typedEffectPatterns.d.ts.map +1 -0
- package/dist/interaction/typedEffectPatterns.js +190 -0
- package/dist/mcp/channels/allowlist.d.ts +19 -0
- package/dist/mcp/channels/allowlist.d.ts.map +1 -0
- package/dist/mcp/channels/allowlist.js +140 -0
- package/dist/mcp/channels/channelManager.d.ts +64 -0
- package/dist/mcp/channels/channelManager.d.ts.map +1 -0
- package/dist/mcp/channels/channelManager.js +137 -0
- package/dist/mcp/channels/inboundQueue.d.ts +47 -0
- package/dist/mcp/channels/inboundQueue.d.ts.map +1 -0
- package/dist/mcp/channels/inboundQueue.js +96 -0
- package/dist/mcp/channels/index.d.ts +16 -0
- package/dist/mcp/channels/index.d.ts.map +1 -0
- package/dist/mcp/channels/index.js +38 -0
- package/dist/mcp/channels/outbound.d.ts +33 -0
- package/dist/mcp/channels/outbound.d.ts.map +1 -0
- package/dist/mcp/channels/outbound.js +94 -0
- package/dist/mcp/channels/permissionRelay.d.ts +62 -0
- package/dist/mcp/channels/permissionRelay.d.ts.map +1 -0
- package/dist/mcp/channels/permissionRelay.js +159 -0
- package/dist/mcp/channels/types.d.ts +135 -0
- package/dist/mcp/channels/types.d.ts.map +1 -0
- package/dist/mcp/channels/types.js +16 -0
- package/dist/mcp/client/auth.d.ts +57 -0
- package/dist/mcp/client/auth.d.ts.map +1 -0
- package/dist/mcp/client/auth.js +99 -0
- package/dist/mcp/client/config.d.ts +28 -0
- package/dist/mcp/client/config.d.ts.map +1 -0
- package/dist/mcp/client/config.js +144 -0
- package/dist/mcp/client/executor.d.ts +30 -0
- package/dist/mcp/client/executor.d.ts.map +1 -0
- package/dist/mcp/client/executor.js +61 -0
- package/dist/mcp/client/index.d.ts +13 -0
- package/dist/mcp/client/index.d.ts.map +1 -0
- package/dist/mcp/client/index.js +30 -0
- package/dist/mcp/client/manager.d.ts +74 -0
- package/dist/mcp/client/manager.d.ts.map +1 -0
- package/dist/mcp/client/manager.js +215 -0
- package/dist/mcp/client/resourceBrowser.d.ts +52 -0
- package/dist/mcp/client/resourceBrowser.d.ts.map +1 -0
- package/dist/mcp/client/resourceBrowser.js +80 -0
- package/dist/mcp/client/toolRegistry.d.ts +113 -0
- package/dist/mcp/client/toolRegistry.d.ts.map +1 -0
- package/dist/mcp/client/toolRegistry.js +190 -0
- package/dist/mcp/client/types.d.ts +96 -0
- package/dist/mcp/client/types.d.ts.map +1 -0
- package/dist/mcp/client/types.js +15 -0
- package/dist/mcp/transport/index.d.ts +9 -0
- package/dist/mcp/transport/index.d.ts.map +1 -0
- package/dist/mcp/transport/index.js +13 -0
- package/dist/mcp/transport/session.d.ts +18 -0
- package/dist/mcp/transport/session.d.ts.map +1 -0
- package/dist/mcp/transport/session.js +78 -0
- package/dist/mcp/transport/types.d.ts +19 -0
- package/dist/mcp/transport/types.d.ts.map +1 -0
- package/dist/mcp/transport/types.js +7 -0
- package/dist/mcp/transport/websocket.d.ts +41 -0
- package/dist/mcp/transport/websocket.d.ts.map +1 -0
- package/dist/mcp/transport/websocket.js +271 -0
- package/dist/observability/alertWebhooks.d.ts +35 -0
- package/dist/observability/alertWebhooks.d.ts.map +1 -0
- package/dist/observability/alertWebhooks.js +68 -0
- package/dist/observability/analytics.d.ts +66 -0
- package/dist/observability/analytics.d.ts.map +1 -0
- package/dist/observability/analytics.js +104 -0
- package/dist/observability/auditExport.d.ts +25 -0
- package/dist/observability/auditExport.d.ts.map +1 -0
- package/dist/observability/auditExport.js +108 -0
- package/dist/observability/contextIntrospection.d.ts +40 -0
- package/dist/observability/contextIntrospection.d.ts.map +1 -0
- package/dist/observability/contextIntrospection.js +93 -0
- package/dist/observability/failureTriage.d.ts +28 -0
- package/dist/observability/failureTriage.d.ts.map +1 -0
- package/dist/observability/failureTriage.js +168 -0
- package/dist/observability/health.d.ts +19 -0
- package/dist/observability/health.d.ts.map +1 -0
- package/dist/observability/health.js +129 -0
- package/dist/observability/index.d.ts +14 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +53 -0
- package/dist/observability/progressSummarizer.d.ts +27 -0
- package/dist/observability/progressSummarizer.d.ts.map +1 -0
- package/dist/observability/progressSummarizer.js +143 -0
- package/dist/observability/promptPlan.d.ts +52 -0
- package/dist/observability/promptPlan.d.ts.map +1 -0
- package/dist/observability/promptPlan.js +101 -0
- package/dist/observability/resumeDashboard.d.ts +32 -0
- package/dist/observability/resumeDashboard.d.ts.map +1 -0
- package/dist/observability/resumeDashboard.js +204 -0
- package/dist/observability/runStatus.d.ts +44 -0
- package/dist/observability/runStatus.d.ts.map +1 -0
- package/dist/observability/runStatus.js +169 -0
- package/dist/observability/subagentHealth.d.ts +66 -0
- package/dist/observability/subagentHealth.d.ts.map +1 -0
- package/dist/observability/subagentHealth.js +107 -0
- package/dist/observability/subagentProgress.d.ts +64 -0
- package/dist/observability/subagentProgress.d.ts.map +1 -0
- package/dist/observability/subagentProgress.js +91 -0
- package/dist/observability/timeline.d.ts +11 -0
- package/dist/observability/timeline.d.ts.map +1 -0
- package/dist/observability/timeline.js +176 -0
- package/dist/observability/types.d.ts +62 -0
- package/dist/observability/types.d.ts.map +1 -0
- package/dist/observability/types.js +8 -0
- package/dist/observability/webhooks.d.ts +68 -0
- package/dist/observability/webhooks.d.ts.map +1 -0
- package/dist/observability/webhooks.js +132 -0
- package/dist/plugins/ccCompatibility.d.ts +79 -0
- package/dist/plugins/ccCompatibility.d.ts.map +1 -0
- package/dist/plugins/ccCompatibility.js +139 -0
- package/dist/plugins/index.d.ts +16 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +38 -0
- package/dist/plugins/loader.d.ts +37 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +112 -0
- package/dist/plugins/management.d.ts +33 -0
- package/dist/plugins/management.d.ts.map +1 -0
- package/dist/plugins/management.js +99 -0
- package/dist/plugins/marketplace.d.ts +64 -0
- package/dist/plugins/marketplace.d.ts.map +1 -0
- package/dist/plugins/marketplace.js +101 -0
- package/dist/plugins/sandbox.d.ts +38 -0
- package/dist/plugins/sandbox.d.ts.map +1 -0
- package/dist/plugins/sandbox.js +109 -0
- package/dist/plugins/trust.d.ts +31 -0
- package/dist/plugins/trust.d.ts.map +1 -0
- package/dist/plugins/trust.js +66 -0
- package/dist/plugins/types.d.ts +27 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +7 -0
- package/dist/plugins/validation.d.ts +32 -0
- package/dist/plugins/validation.d.ts.map +1 -0
- package/dist/plugins/validation.js +117 -0
- package/dist/plugins/version-check.d.ts +23 -0
- package/dist/plugins/version-check.d.ts.map +1 -0
- package/dist/plugins/version-check.js +70 -0
- package/dist/plugins/versioning.d.ts +40 -0
- package/dist/plugins/versioning.d.ts.map +1 -0
- package/dist/plugins/versioning.js +101 -0
- package/dist/processes/index.d.ts +12 -0
- package/dist/processes/index.d.ts.map +1 -0
- package/dist/processes/index.js +15 -0
- package/dist/processes/recommender.d.ts +36 -0
- package/dist/processes/recommender.d.ts.map +1 -0
- package/dist/processes/recommender.js +73 -0
- package/dist/processes/scorer.d.ts +26 -0
- package/dist/processes/scorer.d.ts.map +1 -0
- package/dist/processes/scorer.js +104 -0
- package/dist/processes/types.d.ts +48 -0
- package/dist/processes/types.d.ts.map +1 -0
- package/dist/processes/types.js +9 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +28 -0
- package/dist/seams/contract.d.ts +63 -0
- package/dist/seams/contract.d.ts.map +1 -0
- package/dist/seams/contract.js +141 -0
- package/dist/seams/index.d.ts +3 -0
- package/dist/seams/index.d.ts.map +1 -0
- package/dist/seams/index.js +8 -0
- package/dist/session/context.d.ts +22 -0
- package/dist/session/context.d.ts.map +1 -0
- package/dist/session/context.js +113 -0
- package/dist/session/continuityState.d.ts +39 -0
- package/dist/session/continuityState.d.ts.map +1 -0
- package/dist/session/continuityState.js +164 -0
- package/dist/session/cost.d.ts +72 -0
- package/dist/session/cost.d.ts.map +1 -0
- package/dist/session/cost.js +221 -0
- package/dist/session/crossRunComm.d.ts +40 -0
- package/dist/session/crossRunComm.d.ts.map +1 -0
- package/dist/session/crossRunComm.js +86 -0
- package/dist/session/crossRunState.d.ts +8 -0
- package/dist/session/crossRunState.d.ts.map +1 -0
- package/dist/session/crossRunState.js +45 -0
- package/dist/session/discovery.d.ts +22 -0
- package/dist/session/discovery.d.ts.map +1 -0
- package/dist/session/discovery.js +35 -0
- package/dist/session/history.d.ts +30 -0
- package/dist/session/history.d.ts.map +1 -0
- package/dist/session/history.js +144 -0
- package/dist/session/index.d.ts +8 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +73 -0
- package/dist/session/memoryConsolidation.d.ts +31 -0
- package/dist/session/memoryConsolidation.d.ts.map +1 -0
- package/dist/session/memoryConsolidation.js +135 -0
- package/dist/session/memoryExtraction.d.ts +65 -0
- package/dist/session/memoryExtraction.d.ts.map +1 -0
- package/dist/session/memoryExtraction.js +201 -0
- package/dist/session/parse.d.ts +45 -0
- package/dist/session/parse.d.ts.map +1 -0
- package/dist/session/parse.js +170 -0
- package/dist/session/persistence.d.ts +46 -0
- package/dist/session/persistence.d.ts.map +1 -0
- package/dist/session/persistence.js +180 -0
- package/dist/session/sessionSharing.d.ts +55 -0
- package/dist/session/sessionSharing.d.ts.map +1 -0
- package/dist/session/sessionSharing.js +113 -0
- package/dist/session/sessionTemplates.d.ts +57 -0
- package/dist/session/sessionTemplates.d.ts.map +1 -0
- package/dist/session/sessionTemplates.js +93 -0
- package/dist/session/types.d.ts +267 -0
- package/dist/session/types.d.ts.map +1 -0
- package/dist/session/types.js +45 -0
- package/dist/session/write.d.ts +61 -0
- package/dist/session/write.d.ts.map +1 -0
- package/dist/session/write.js +213 -0
- package/dist/skills/chain.d.ts +31 -0
- package/dist/skills/chain.d.ts.map +1 -0
- package/dist/skills/chain.js +113 -0
- package/dist/skills/discovery.d.ts +34 -0
- package/dist/skills/discovery.d.ts.map +1 -0
- package/dist/skills/discovery.js +185 -0
- package/dist/skills/index.d.ts +12 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +18 -0
- package/dist/skills/router.d.ts +35 -0
- package/dist/skills/router.d.ts.map +1 -0
- package/dist/skills/router.js +143 -0
- package/dist/skills/types.d.ts +33 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +5 -0
- package/dist/storage/atomic.d.ts +2 -0
- package/dist/storage/atomic.d.ts.map +1 -0
- package/dist/storage/atomic.js +54 -0
- package/dist/storage/clock.d.ts +2 -0
- package/dist/storage/clock.d.ts.map +1 -0
- package/dist/storage/clock.js +6 -0
- package/dist/storage/index.d.ts +7 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +9 -0
- package/dist/storage/journalWatcher.d.ts +24 -0
- package/dist/storage/journalWatcher.d.ts.map +1 -0
- package/dist/storage/journalWatcher.js +173 -0
- package/dist/storage/paths.d.ts +5 -0
- package/dist/storage/paths.d.ts.map +1 -0
- package/dist/storage/paths.js +26 -0
- package/dist/storage/snapshotState.d.ts +10 -0
- package/dist/storage/snapshotState.d.ts.map +1 -0
- package/dist/storage/snapshotState.js +15 -0
- package/dist/storage/storeTaskArtifacts.d.ts +6 -0
- package/dist/storage/storeTaskArtifacts.d.ts.map +1 -0
- package/dist/storage/storeTaskArtifacts.js +55 -0
- package/dist/storage/types.d.ts +21 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/types.js +2 -0
- package/dist/tasks/crud.d.ts +33 -0
- package/dist/tasks/crud.d.ts.map +1 -0
- package/dist/tasks/crud.js +150 -0
- package/dist/tasks/index.d.ts +2 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +9 -0
- package/dist/trust/harness-signing.d.ts +15 -0
- package/dist/trust/harness-signing.d.ts.map +1 -0
- package/dist/trust/harness-signing.js +46 -0
- package/dist/trust/key-store.d.ts +15 -0
- package/dist/trust/key-store.d.ts.map +1 -0
- package/dist/trust/key-store.js +66 -0
- package/package.json +161 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Plugin validation — structural checks for manifests and installed plugin
|
|
4
|
+
* directories.
|
|
5
|
+
*
|
|
6
|
+
* `validatePlugin` performs in-memory manifest validation.
|
|
7
|
+
* `diagnosePlugin` inspects the file-system layout of a plugin directory.
|
|
8
|
+
* `formatDiagnostics` renders issues into a human-readable report.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.validatePlugin = validatePlugin;
|
|
12
|
+
exports.diagnosePlugin = diagnosePlugin;
|
|
13
|
+
exports.formatDiagnostics = formatDiagnostics;
|
|
14
|
+
const node_fs_1 = require("node:fs");
|
|
15
|
+
const node_path_1 = require("node:path");
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Manifest validation
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
const KNOWN_PERMISSIONS = new Set([
|
|
20
|
+
'fs:read',
|
|
21
|
+
'fs:write',
|
|
22
|
+
'net:outbound',
|
|
23
|
+
'process:spawn',
|
|
24
|
+
'env:read',
|
|
25
|
+
'mcp:connect',
|
|
26
|
+
'shell:execute',
|
|
27
|
+
]);
|
|
28
|
+
/**
|
|
29
|
+
* Validate a plugin manifest in memory.
|
|
30
|
+
* Returns errors (fatal) and warnings (non-fatal observations).
|
|
31
|
+
*/
|
|
32
|
+
function validatePlugin(manifest) {
|
|
33
|
+
const errors = [];
|
|
34
|
+
const warnings = [];
|
|
35
|
+
// Required string fields
|
|
36
|
+
if (!manifest.id || typeof manifest.id !== 'string') {
|
|
37
|
+
errors.push('Missing or invalid "id" field');
|
|
38
|
+
}
|
|
39
|
+
if (!manifest.name || typeof manifest.name !== 'string') {
|
|
40
|
+
errors.push('Missing or invalid "name" field');
|
|
41
|
+
}
|
|
42
|
+
if (!manifest.version || typeof manifest.version !== 'string') {
|
|
43
|
+
errors.push('Missing or invalid "version" field');
|
|
44
|
+
}
|
|
45
|
+
if (!manifest.entrypoint || typeof manifest.entrypoint !== 'string') {
|
|
46
|
+
errors.push('Missing or invalid "entrypoint" field');
|
|
47
|
+
}
|
|
48
|
+
// Permissions array
|
|
49
|
+
if (!Array.isArray(manifest.permissions)) {
|
|
50
|
+
errors.push('"permissions" must be an array');
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
for (const perm of manifest.permissions) {
|
|
54
|
+
if (!KNOWN_PERMISSIONS.has(perm)) {
|
|
55
|
+
warnings.push(`Unknown permission "${perm}"`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Version format (basic check)
|
|
60
|
+
if (manifest.version) {
|
|
61
|
+
const parts = manifest.version.replace(/^v/, '').split('.');
|
|
62
|
+
if (parts.length < 3) {
|
|
63
|
+
warnings.push(`Version "${manifest.version}" is not standard semver`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return { valid: errors.length === 0, errors, warnings };
|
|
67
|
+
}
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
// Directory diagnosis
|
|
70
|
+
// ---------------------------------------------------------------------------
|
|
71
|
+
/**
|
|
72
|
+
* Inspect a plugin directory on disk and return diagnostic entries.
|
|
73
|
+
*/
|
|
74
|
+
function diagnosePlugin(pluginDir) {
|
|
75
|
+
const entries = [];
|
|
76
|
+
if (!(0, node_fs_1.existsSync)(pluginDir)) {
|
|
77
|
+
entries.push({ level: 'error', message: `Plugin directory does not exist: ${pluginDir}` });
|
|
78
|
+
return entries;
|
|
79
|
+
}
|
|
80
|
+
// Check for manifest file
|
|
81
|
+
const manifestPath = (0, node_path_1.join)(pluginDir, 'plugin.json');
|
|
82
|
+
if (!(0, node_fs_1.existsSync)(manifestPath)) {
|
|
83
|
+
entries.push({ level: 'error', message: 'Missing plugin.json manifest' });
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
entries.push({ level: 'info', message: 'plugin.json found' });
|
|
87
|
+
}
|
|
88
|
+
// Check for entrypoint (common patterns)
|
|
89
|
+
const commonEntrypoints = ['index.js', 'index.ts', 'dist/index.js'];
|
|
90
|
+
const hasEntry = commonEntrypoints.some((e) => (0, node_fs_1.existsSync)((0, node_path_1.join)(pluginDir, e)));
|
|
91
|
+
if (!hasEntry) {
|
|
92
|
+
entries.push({ level: 'warning', message: 'No common entrypoint found (index.js, index.ts, dist/index.js)' });
|
|
93
|
+
}
|
|
94
|
+
// Check for README
|
|
95
|
+
if (!(0, node_fs_1.existsSync)((0, node_path_1.join)(pluginDir, 'README.md'))) {
|
|
96
|
+
entries.push({ level: 'warning', message: 'No README.md found' });
|
|
97
|
+
}
|
|
98
|
+
return entries;
|
|
99
|
+
}
|
|
100
|
+
// ---------------------------------------------------------------------------
|
|
101
|
+
// Formatting
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
const LEVEL_PREFIX = {
|
|
104
|
+
error: 'ERROR',
|
|
105
|
+
warning: 'WARN ',
|
|
106
|
+
info: 'INFO ',
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Render diagnostic entries into a human-readable multi-line string.
|
|
110
|
+
*/
|
|
111
|
+
function formatDiagnostics(entries) {
|
|
112
|
+
if (entries.length === 0)
|
|
113
|
+
return 'No diagnostics.';
|
|
114
|
+
return entries
|
|
115
|
+
.map((e) => `[${LEVEL_PREFIX[e.level]}] ${e.message}`)
|
|
116
|
+
.join('\n');
|
|
117
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PluginVersionChecker — simple semver compatibility checks for plugins.
|
|
3
|
+
*
|
|
4
|
+
* Compares a plugin manifest's `minPlatformVersion` against the current
|
|
5
|
+
* platform version to determine whether the plugin is compatible.
|
|
6
|
+
*/
|
|
7
|
+
import type { PluginManifest } from './types';
|
|
8
|
+
export interface VersionCheckResult {
|
|
9
|
+
compatible: boolean;
|
|
10
|
+
issues: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare class PluginVersionChecker {
|
|
13
|
+
/**
|
|
14
|
+
* Check whether a plugin manifest is compatible with the given platform
|
|
15
|
+
* version.
|
|
16
|
+
*
|
|
17
|
+
* When `minPlatformVersion` is not specified in the manifest the plugin
|
|
18
|
+
* is assumed compatible. Invalid version strings produce an issue but
|
|
19
|
+
* are treated as incompatible.
|
|
20
|
+
*/
|
|
21
|
+
checkCompatibility(manifest: PluginManifest, platformVersion: string): VersionCheckResult;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=version-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-check.d.ts","sourceRoot":"","sources":["../../src/plugins/version-check.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAmCD,qBAAa,oBAAoB;IAC/B;;;;;;;OAOG;IACH,kBAAkB,CAChB,QAAQ,EAAE,cAAc,EACxB,eAAe,EAAE,MAAM,GACtB,kBAAkB;CAkCtB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* PluginVersionChecker — simple semver compatibility checks for plugins.
|
|
4
|
+
*
|
|
5
|
+
* Compares a plugin manifest's `minPlatformVersion` against the current
|
|
6
|
+
* platform version to determine whether the plugin is compatible.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PluginVersionChecker = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Parse a version string in `major.minor.patch` format.
|
|
12
|
+
* Returns `undefined` if the string is not a valid semver triple.
|
|
13
|
+
*/
|
|
14
|
+
function parseSemVer(version) {
|
|
15
|
+
const cleaned = version.replace(/^v/, '');
|
|
16
|
+
const parts = cleaned.split('.');
|
|
17
|
+
if (parts.length < 3)
|
|
18
|
+
return undefined;
|
|
19
|
+
const major = parseInt(parts[0], 10);
|
|
20
|
+
const minor = parseInt(parts[1], 10);
|
|
21
|
+
// Strip pre-release / build metadata for comparison
|
|
22
|
+
const patch = parseInt(parts[2].split('-')[0], 10);
|
|
23
|
+
if (isNaN(major) || isNaN(minor) || isNaN(patch))
|
|
24
|
+
return undefined;
|
|
25
|
+
return { major, minor, patch };
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Return `true` if `actual >= required` using standard semver ordering.
|
|
29
|
+
*/
|
|
30
|
+
function semverGte(actual, required) {
|
|
31
|
+
if (actual.major !== required.major)
|
|
32
|
+
return actual.major > required.major;
|
|
33
|
+
if (actual.minor !== required.minor)
|
|
34
|
+
return actual.minor > required.minor;
|
|
35
|
+
return actual.patch >= required.patch;
|
|
36
|
+
}
|
|
37
|
+
class PluginVersionChecker {
|
|
38
|
+
/**
|
|
39
|
+
* Check whether a plugin manifest is compatible with the given platform
|
|
40
|
+
* version.
|
|
41
|
+
*
|
|
42
|
+
* When `minPlatformVersion` is not specified in the manifest the plugin
|
|
43
|
+
* is assumed compatible. Invalid version strings produce an issue but
|
|
44
|
+
* are treated as incompatible.
|
|
45
|
+
*/
|
|
46
|
+
checkCompatibility(manifest, platformVersion) {
|
|
47
|
+
const issues = [];
|
|
48
|
+
// If the manifest does not specify a minimum, it is compatible with any version
|
|
49
|
+
if (!manifest.minPlatformVersion) {
|
|
50
|
+
return { compatible: true, issues };
|
|
51
|
+
}
|
|
52
|
+
const required = parseSemVer(manifest.minPlatformVersion);
|
|
53
|
+
if (!required) {
|
|
54
|
+
issues.push(`Invalid minPlatformVersion "${manifest.minPlatformVersion}" in manifest for plugin "${manifest.id}"`);
|
|
55
|
+
return { compatible: false, issues };
|
|
56
|
+
}
|
|
57
|
+
const actual = parseSemVer(platformVersion);
|
|
58
|
+
if (!actual) {
|
|
59
|
+
issues.push(`Invalid platform version "${platformVersion}" — cannot verify compatibility`);
|
|
60
|
+
return { compatible: false, issues };
|
|
61
|
+
}
|
|
62
|
+
if (!semverGte(actual, required)) {
|
|
63
|
+
issues.push(`Plugin "${manifest.id}" requires platform >= ${manifest.minPlatformVersion}, ` +
|
|
64
|
+
`but current platform is ${platformVersion}`);
|
|
65
|
+
return { compatible: false, issues };
|
|
66
|
+
}
|
|
67
|
+
return { compatible: true, issues };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.PluginVersionChecker = PluginVersionChecker;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin versioning — semver-aware update policy for installed plugins.
|
|
3
|
+
*
|
|
4
|
+
* Determines whether a plugin update should be applied automatically (patch),
|
|
5
|
+
* require user confirmation (minor), or be blocked until explicitly approved
|
|
6
|
+
* (major).
|
|
7
|
+
*/
|
|
8
|
+
export interface PluginVersion {
|
|
9
|
+
major: number;
|
|
10
|
+
minor: number;
|
|
11
|
+
patch: number;
|
|
12
|
+
preRelease?: string;
|
|
13
|
+
}
|
|
14
|
+
export type UpdateAction = 'auto' | 'prompt' | 'block';
|
|
15
|
+
export interface UpdateCheckResult {
|
|
16
|
+
available: boolean;
|
|
17
|
+
currentVersion: string;
|
|
18
|
+
latestVersion: string;
|
|
19
|
+
action: UpdateAction;
|
|
20
|
+
reason: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Parse a semver string into a PluginVersion.
|
|
24
|
+
* Returns `undefined` for malformed strings.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseVersion(version: string): PluginVersion | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Check whether an update is available and what action policy applies.
|
|
29
|
+
*/
|
|
30
|
+
export declare function checkForUpdate(currentVersionStr: string, latestVersionStr: string): UpdateCheckResult;
|
|
31
|
+
/**
|
|
32
|
+
* Determine the update action for a version transition.
|
|
33
|
+
*
|
|
34
|
+
* Policy:
|
|
35
|
+
* - patch change → auto
|
|
36
|
+
* - minor change (same major) → prompt
|
|
37
|
+
* - major change → block
|
|
38
|
+
*/
|
|
39
|
+
export declare function shouldAutoUpdate(current: PluginVersion, latest: PluginVersion): UpdateAction;
|
|
40
|
+
//# sourceMappingURL=versioning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../../src/plugins/versioning.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAYvE;AAmBD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,iBAAiB,EAAE,MAAM,EACzB,gBAAgB,EAAE,MAAM,GACvB,iBAAiB,CAsCnB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,aAAa,GACpB,YAAY,CAId"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Plugin versioning — semver-aware update policy for installed plugins.
|
|
4
|
+
*
|
|
5
|
+
* Determines whether a plugin update should be applied automatically (patch),
|
|
6
|
+
* require user confirmation (minor), or be blocked until explicitly approved
|
|
7
|
+
* (major).
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.parseVersion = parseVersion;
|
|
11
|
+
exports.checkForUpdate = checkForUpdate;
|
|
12
|
+
exports.shouldAutoUpdate = shouldAutoUpdate;
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Parsing
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
/**
|
|
17
|
+
* Parse a semver string into a PluginVersion.
|
|
18
|
+
* Returns `undefined` for malformed strings.
|
|
19
|
+
*/
|
|
20
|
+
function parseVersion(version) {
|
|
21
|
+
const cleaned = version.replace(/^v/, '');
|
|
22
|
+
const [core, preRelease] = cleaned.split('-', 2);
|
|
23
|
+
const parts = core.split('.');
|
|
24
|
+
if (parts.length < 3)
|
|
25
|
+
return undefined;
|
|
26
|
+
const major = parseInt(parts[0], 10);
|
|
27
|
+
const minor = parseInt(parts[1], 10);
|
|
28
|
+
const patch = parseInt(parts[2], 10);
|
|
29
|
+
if (isNaN(major) || isNaN(minor) || isNaN(patch))
|
|
30
|
+
return undefined;
|
|
31
|
+
return { major, minor, patch, preRelease };
|
|
32
|
+
}
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// Comparison helpers
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
/**
|
|
37
|
+
* Return true if `a` is strictly less than `b` in semver ordering.
|
|
38
|
+
*/
|
|
39
|
+
function isOlderThan(a, b) {
|
|
40
|
+
if (a.major !== b.major)
|
|
41
|
+
return a.major < b.major;
|
|
42
|
+
if (a.minor !== b.minor)
|
|
43
|
+
return a.minor < b.minor;
|
|
44
|
+
return a.patch < b.patch;
|
|
45
|
+
}
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
// Public API
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
/**
|
|
50
|
+
* Check whether an update is available and what action policy applies.
|
|
51
|
+
*/
|
|
52
|
+
function checkForUpdate(currentVersionStr, latestVersionStr) {
|
|
53
|
+
const current = parseVersion(currentVersionStr);
|
|
54
|
+
const latest = parseVersion(latestVersionStr);
|
|
55
|
+
if (!current || !latest) {
|
|
56
|
+
return {
|
|
57
|
+
available: false,
|
|
58
|
+
currentVersion: currentVersionStr,
|
|
59
|
+
latestVersion: latestVersionStr,
|
|
60
|
+
action: 'block',
|
|
61
|
+
reason: 'Unable to parse version string',
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
if (!isOlderThan(current, latest)) {
|
|
65
|
+
return {
|
|
66
|
+
available: false,
|
|
67
|
+
currentVersion: currentVersionStr,
|
|
68
|
+
latestVersion: latestVersionStr,
|
|
69
|
+
action: 'auto',
|
|
70
|
+
reason: 'Already up to date',
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const action = shouldAutoUpdate(current, latest);
|
|
74
|
+
const reason = action === 'auto'
|
|
75
|
+
? 'Patch update — applied automatically'
|
|
76
|
+
: action === 'prompt'
|
|
77
|
+
? 'Minor update — user confirmation required'
|
|
78
|
+
: 'Major update — blocked until explicitly approved';
|
|
79
|
+
return {
|
|
80
|
+
available: true,
|
|
81
|
+
currentVersion: currentVersionStr,
|
|
82
|
+
latestVersion: latestVersionStr,
|
|
83
|
+
action,
|
|
84
|
+
reason,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Determine the update action for a version transition.
|
|
89
|
+
*
|
|
90
|
+
* Policy:
|
|
91
|
+
* - patch change → auto
|
|
92
|
+
* - minor change (same major) → prompt
|
|
93
|
+
* - major change → block
|
|
94
|
+
*/
|
|
95
|
+
function shouldAutoUpdate(current, latest) {
|
|
96
|
+
if (latest.major > current.major)
|
|
97
|
+
return 'block';
|
|
98
|
+
if (latest.minor > current.minor)
|
|
99
|
+
return 'prompt';
|
|
100
|
+
return 'auto';
|
|
101
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process recommender module for L6 Agent-Platform.
|
|
3
|
+
*
|
|
4
|
+
* Provides process registration, criteria-based scoring, and
|
|
5
|
+
* recommendation of the most relevant processes for a given task.
|
|
6
|
+
*/
|
|
7
|
+
export type { ProcessDescriptor, RecommendationCriteria, ProcessRecommendation, } from './types';
|
|
8
|
+
export { ProcessScorer } from './scorer';
|
|
9
|
+
export type { ScoringResult } from './scorer';
|
|
10
|
+
export { ProcessRecommender } from './recommender';
|
|
11
|
+
export type { ProcessFilter } from './recommender';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/processes/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Process recommender module for L6 Agent-Platform.
|
|
4
|
+
*
|
|
5
|
+
* Provides process registration, criteria-based scoring, and
|
|
6
|
+
* recommendation of the most relevant processes for a given task.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ProcessRecommender = exports.ProcessScorer = void 0;
|
|
10
|
+
// Scorer
|
|
11
|
+
var scorer_1 = require("./scorer");
|
|
12
|
+
Object.defineProperty(exports, "ProcessScorer", { enumerable: true, get: function () { return scorer_1.ProcessScorer; } });
|
|
13
|
+
// Recommender
|
|
14
|
+
var recommender_1 = require("./recommender");
|
|
15
|
+
Object.defineProperty(exports, "ProcessRecommender", { enumerable: true, get: function () { return recommender_1.ProcessRecommender; } });
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProcessRecommender — registers process descriptors and recommends
|
|
3
|
+
* the most relevant ones for a given set of criteria.
|
|
4
|
+
*
|
|
5
|
+
* Delegates scoring to {@link ProcessScorer} and exposes a simple
|
|
6
|
+
* registry + query API analogous to the sibling SkillRouter.
|
|
7
|
+
*/
|
|
8
|
+
import type { ProcessDescriptor, ProcessRecommendation, RecommendationCriteria } from './types';
|
|
9
|
+
export interface ProcessFilter {
|
|
10
|
+
category?: string;
|
|
11
|
+
domain?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class ProcessRecommender {
|
|
14
|
+
private readonly registry;
|
|
15
|
+
private readonly scorer;
|
|
16
|
+
/** Register a single process descriptor. Replaces any existing entry with the same id. */
|
|
17
|
+
register(descriptor: ProcessDescriptor): void;
|
|
18
|
+
/** Register multiple descriptors at once. */
|
|
19
|
+
registerBatch(descriptors: ProcessDescriptor[]): void;
|
|
20
|
+
/**
|
|
21
|
+
* Score all registered processes against the given criteria and return
|
|
22
|
+
* the top results sorted by descending score. Processes that score 0
|
|
23
|
+
* are excluded.
|
|
24
|
+
*/
|
|
25
|
+
recommend(criteria: RecommendationCriteria): ProcessRecommendation[];
|
|
26
|
+
/** Look up a process descriptor by its id. */
|
|
27
|
+
getById(id: string): ProcessDescriptor | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* List all registered descriptors, optionally filtered by category
|
|
30
|
+
* and/or domain.
|
|
31
|
+
*/
|
|
32
|
+
list(filter?: ProcessFilter): ProcessDescriptor[];
|
|
33
|
+
/** Return the number of registered process descriptors. */
|
|
34
|
+
get size(): number;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=recommender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recommender.d.ts","sourceRoot":"","sources":["../../src/processes/recommender.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAKjB,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwC;IACjE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAI9C,0FAA0F;IAC1F,QAAQ,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAI7C,6CAA6C;IAC7C,aAAa,CAAC,WAAW,EAAE,iBAAiB,EAAE,GAAG,IAAI;IAQrD;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,sBAAsB,GAAG,qBAAqB,EAAE;IAepE,8CAA8C;IAC9C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAIlD;;;OAGG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,iBAAiB,EAAE;IAgBjD,2DAA2D;IAC3D,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ProcessRecommender — registers process descriptors and recommends
|
|
4
|
+
* the most relevant ones for a given set of criteria.
|
|
5
|
+
*
|
|
6
|
+
* Delegates scoring to {@link ProcessScorer} and exposes a simple
|
|
7
|
+
* registry + query API analogous to the sibling SkillRouter.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ProcessRecommender = void 0;
|
|
11
|
+
const scorer_1 = require("./scorer");
|
|
12
|
+
const DEFAULT_MAX_RESULTS = 5;
|
|
13
|
+
class ProcessRecommender {
|
|
14
|
+
registry = new Map();
|
|
15
|
+
scorer = new scorer_1.ProcessScorer();
|
|
16
|
+
// ── registration ─────────────────────────────────────────────────────────
|
|
17
|
+
/** Register a single process descriptor. Replaces any existing entry with the same id. */
|
|
18
|
+
register(descriptor) {
|
|
19
|
+
this.registry.set(descriptor.id, descriptor);
|
|
20
|
+
}
|
|
21
|
+
/** Register multiple descriptors at once. */
|
|
22
|
+
registerBatch(descriptors) {
|
|
23
|
+
for (const descriptor of descriptors) {
|
|
24
|
+
this.register(descriptor);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// ── queries ──────────────────────────────────────────────────────────────
|
|
28
|
+
/**
|
|
29
|
+
* Score all registered processes against the given criteria and return
|
|
30
|
+
* the top results sorted by descending score. Processes that score 0
|
|
31
|
+
* are excluded.
|
|
32
|
+
*/
|
|
33
|
+
recommend(criteria) {
|
|
34
|
+
const maxResults = criteria.maxResults ?? DEFAULT_MAX_RESULTS;
|
|
35
|
+
const results = [];
|
|
36
|
+
for (const process of this.registry.values()) {
|
|
37
|
+
const { score, reasons } = this.scorer.score(process, criteria);
|
|
38
|
+
if (score > 0) {
|
|
39
|
+
results.push({ process, score, reasons });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
results.sort((a, b) => b.score - a.score);
|
|
43
|
+
return results.slice(0, maxResults);
|
|
44
|
+
}
|
|
45
|
+
/** Look up a process descriptor by its id. */
|
|
46
|
+
getById(id) {
|
|
47
|
+
return this.registry.get(id);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* List all registered descriptors, optionally filtered by category
|
|
51
|
+
* and/or domain.
|
|
52
|
+
*/
|
|
53
|
+
list(filter) {
|
|
54
|
+
const all = Array.from(this.registry.values());
|
|
55
|
+
if (!filter) {
|
|
56
|
+
return all;
|
|
57
|
+
}
|
|
58
|
+
return all.filter((process) => {
|
|
59
|
+
if (filter.category && process.category !== filter.category) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
if (filter.domain && process.domain !== filter.domain) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
return true;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** Return the number of registered process descriptors. */
|
|
69
|
+
get size() {
|
|
70
|
+
return this.registry.size;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.ProcessRecommender = ProcessRecommender;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProcessScorer — computes a relevance score for a ProcessDescriptor
|
|
3
|
+
* against a set of RecommendationCriteria.
|
|
4
|
+
*
|
|
5
|
+
* Scoring factors:
|
|
6
|
+
* 1. Keyword overlap between criteria text and the process description,
|
|
7
|
+
* task ids, inputs, and outputs.
|
|
8
|
+
* 2. Category bonus when the process category appears in the criteria text.
|
|
9
|
+
* 3. Domain bonus when criteria.domain matches process.domain.
|
|
10
|
+
* 4. Quality score multiplier (boosts/dampens the raw score).
|
|
11
|
+
*/
|
|
12
|
+
import type { ProcessDescriptor, RecommendationCriteria } from './types';
|
|
13
|
+
export interface ScoringResult {
|
|
14
|
+
score: number;
|
|
15
|
+
reasons: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare class ProcessScorer {
|
|
18
|
+
/**
|
|
19
|
+
* Score a single process against the given criteria.
|
|
20
|
+
*
|
|
21
|
+
* Returns a composite score >= 0 and an array of human-readable
|
|
22
|
+
* reason strings explaining what contributed to the score.
|
|
23
|
+
*/
|
|
24
|
+
score(process: ProcessDescriptor, criteria: RecommendationCriteria): ScoringResult;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=scorer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scorer.d.ts","sourceRoot":"","sources":["../../src/processes/scorer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAoCzE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,qBAAa,aAAa;IACxB;;;;;OAKG;IACH,KAAK,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,sBAAsB,GAAG,aAAa;CA6DnF"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ProcessScorer — computes a relevance score for a ProcessDescriptor
|
|
4
|
+
* against a set of RecommendationCriteria.
|
|
5
|
+
*
|
|
6
|
+
* Scoring factors:
|
|
7
|
+
* 1. Keyword overlap between criteria text and the process description,
|
|
8
|
+
* task ids, inputs, and outputs.
|
|
9
|
+
* 2. Category bonus when the process category appears in the criteria text.
|
|
10
|
+
* 3. Domain bonus when criteria.domain matches process.domain.
|
|
11
|
+
* 4. Quality score multiplier (boosts/dampens the raw score).
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ProcessScorer = void 0;
|
|
15
|
+
// ── helpers ──────────────────────────────────────────────────────────────────
|
|
16
|
+
/** Normalize text to a set of lowercase tokens for overlap scoring. */
|
|
17
|
+
function tokenize(text) {
|
|
18
|
+
return new Set(text
|
|
19
|
+
.toLowerCase()
|
|
20
|
+
.split(/[\s,.\-_/|:;]+/)
|
|
21
|
+
.filter((token) => token.length > 1));
|
|
22
|
+
}
|
|
23
|
+
/** Count how many tokens from `query` appear in `corpus`. */
|
|
24
|
+
function tokenOverlap(query, corpus) {
|
|
25
|
+
let count = 0;
|
|
26
|
+
for (const token of query) {
|
|
27
|
+
if (corpus.has(token)) {
|
|
28
|
+
count += 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return count;
|
|
32
|
+
}
|
|
33
|
+
// ── constants ────────────────────────────────────────────────────────────────
|
|
34
|
+
const CATEGORY_BONUS = 10;
|
|
35
|
+
const DOMAIN_BONUS = 15;
|
|
36
|
+
/** Range for the quality multiplier: [MIN, MAX]. */
|
|
37
|
+
const QUALITY_MULTIPLIER_MIN = 0.5;
|
|
38
|
+
const QUALITY_MULTIPLIER_MAX = 1.5;
|
|
39
|
+
class ProcessScorer {
|
|
40
|
+
/**
|
|
41
|
+
* Score a single process against the given criteria.
|
|
42
|
+
*
|
|
43
|
+
* Returns a composite score >= 0 and an array of human-readable
|
|
44
|
+
* reason strings explaining what contributed to the score.
|
|
45
|
+
*/
|
|
46
|
+
score(process, criteria) {
|
|
47
|
+
let rawScore = 0;
|
|
48
|
+
const reasons = [];
|
|
49
|
+
// ── 1. Build query tokens from criteria ────────────────────────────
|
|
50
|
+
const queryParts = [criteria.taskDescription];
|
|
51
|
+
if (criteria.repoContext)
|
|
52
|
+
queryParts.push(criteria.repoContext);
|
|
53
|
+
if (criteria.capabilities)
|
|
54
|
+
queryParts.push(...criteria.capabilities);
|
|
55
|
+
const queryTokens = tokenize(queryParts.join(' '));
|
|
56
|
+
// ── 2. Build corpus tokens from process ────────────────────────────
|
|
57
|
+
const corpusParts = [process.name, process.description];
|
|
58
|
+
if (process.category)
|
|
59
|
+
corpusParts.push(process.category);
|
|
60
|
+
if (process.tasks)
|
|
61
|
+
corpusParts.push(...process.tasks);
|
|
62
|
+
if (process.inputs)
|
|
63
|
+
corpusParts.push(...process.inputs);
|
|
64
|
+
if (process.outputs)
|
|
65
|
+
corpusParts.push(...process.outputs);
|
|
66
|
+
const corpusTokens = tokenize(corpusParts.join(' '));
|
|
67
|
+
// ── 3. Keyword overlap ─────────────────────────────────────────────
|
|
68
|
+
if (queryTokens.size > 0 && corpusTokens.size > 0) {
|
|
69
|
+
const overlap = tokenOverlap(queryTokens, corpusTokens);
|
|
70
|
+
if (overlap > 0) {
|
|
71
|
+
const ratio = overlap / queryTokens.size;
|
|
72
|
+
const keywordScore = ratio * 100;
|
|
73
|
+
rawScore += keywordScore;
|
|
74
|
+
reasons.push(`keyword overlap ${overlap}/${queryTokens.size} (${Math.round(ratio * 100)}%)`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// ── 4. Category bonus ──────────────────────────────────────────────
|
|
78
|
+
if (process.category) {
|
|
79
|
+
const categoryLower = process.category.toLowerCase();
|
|
80
|
+
const rawQuery = queryParts.join(' ').toLowerCase();
|
|
81
|
+
if (rawQuery.includes(categoryLower)) {
|
|
82
|
+
rawScore += CATEGORY_BONUS;
|
|
83
|
+
reasons.push(`category match "${process.category}"`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// ── 5. Domain bonus ────────────────────────────────────────────────
|
|
87
|
+
if (criteria.domain &&
|
|
88
|
+
process.domain &&
|
|
89
|
+
criteria.domain.toLowerCase() === process.domain.toLowerCase()) {
|
|
90
|
+
rawScore += DOMAIN_BONUS;
|
|
91
|
+
reasons.push('domain match');
|
|
92
|
+
}
|
|
93
|
+
// ── 6. Quality multiplier ──────────────────────────────────────────
|
|
94
|
+
if (typeof process.qualityScore === 'number' && rawScore > 0) {
|
|
95
|
+
const clamped = Math.max(0, Math.min(1, process.qualityScore));
|
|
96
|
+
const multiplier = QUALITY_MULTIPLIER_MIN +
|
|
97
|
+
clamped * (QUALITY_MULTIPLIER_MAX - QUALITY_MULTIPLIER_MIN);
|
|
98
|
+
rawScore *= multiplier;
|
|
99
|
+
reasons.push(`quality multiplier x${multiplier.toFixed(2)}`);
|
|
100
|
+
}
|
|
101
|
+
return { score: Math.round(rawScore * 100) / 100, reasons };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.ProcessScorer = ProcessScorer;
|