@oscharko-dev/keiko-server 0.2.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/dist/.tsbuildinfo +1 -0
- package/dist/assistant-response.d.ts +6 -0
- package/dist/assistant-response.d.ts.map +1 -0
- package/dist/assistant-response.js +12 -0
- package/dist/browser.d.ts +11 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +245 -0
- package/dist/chat-handlers.d.ts +48 -0
- package/dist/chat-handlers.d.ts.map +1 -0
- package/dist/chat-handlers.js +821 -0
- package/dist/chat-stream-handlers.d.ts +4 -0
- package/dist/chat-stream-handlers.d.ts.map +1 -0
- package/dist/chat-stream-handlers.js +136 -0
- package/dist/conversation-prompt.d.ts +8 -0
- package/dist/conversation-prompt.d.ts.map +1 -0
- package/dist/conversation-prompt.js +36 -0
- package/dist/conversation-validation.d.ts +26 -0
- package/dist/conversation-validation.d.ts.map +1 -0
- package/dist/conversation-validation.js +125 -0
- package/dist/credentialPersistence.d.ts +23 -0
- package/dist/credentialPersistence.d.ts.map +1 -0
- package/dist/credentialPersistence.js +93 -0
- package/dist/credentialVault.d.ts +30 -0
- package/dist/credentialVault.d.ts.map +1 -0
- package/dist/credentialVault.js +206 -0
- package/dist/csp.d.ts +3 -0
- package/dist/csp.d.ts.map +1 -0
- package/dist/csp.js +75 -0
- package/dist/deps.d.ts +78 -0
- package/dist/deps.d.ts.map +1 -0
- package/dist/deps.js +457 -0
- package/dist/editor/agentRoutes.d.ts +7 -0
- package/dist/editor/agentRoutes.d.ts.map +1 -0
- package/dist/editor/agentRoutes.js +197 -0
- package/dist/editor/assuredGateRunner.d.ts +36 -0
- package/dist/editor/assuredGateRunner.d.ts.map +1 -0
- package/dist/editor/assuredGateRunner.js +100 -0
- package/dist/editor/assuredPreFilter.d.ts +34 -0
- package/dist/editor/assuredPreFilter.d.ts.map +1 -0
- package/dist/editor/assuredPreFilter.js +134 -0
- package/dist/editor/assuredPreFilterRunner.d.ts +31 -0
- package/dist/editor/assuredPreFilterRunner.d.ts.map +1 -0
- package/dist/editor/assuredPreFilterRunner.js +312 -0
- package/dist/editor/builtinLanguageProviders.d.ts +6 -0
- package/dist/editor/builtinLanguageProviders.d.ts.map +1 -0
- package/dist/editor/builtinLanguageProviders.js +221 -0
- package/dist/editor/codingContext.d.ts +12 -0
- package/dist/editor/codingContext.d.ts.map +1 -0
- package/dist/editor/codingContext.js +121 -0
- package/dist/editor/codingContextEvidence.d.ts +7 -0
- package/dist/editor/codingContextEvidence.d.ts.map +1 -0
- package/dist/editor/codingContextEvidence.js +52 -0
- package/dist/editor/codingContextProviders.d.ts +36 -0
- package/dist/editor/codingContextProviders.d.ts.map +1 -0
- package/dist/editor/codingContextProviders.js +348 -0
- package/dist/editor/completionModelEvidence.d.ts +16 -0
- package/dist/editor/completionModelEvidence.d.ts.map +1 -0
- package/dist/editor/completionModelEvidence.js +50 -0
- package/dist/editor/completionRoutes.d.ts +37 -0
- package/dist/editor/completionRoutes.d.ts.map +1 -0
- package/dist/editor/completionRoutes.js +411 -0
- package/dist/editor/contextRoutes.d.ts +6 -0
- package/dist/editor/contextRoutes.d.ts.map +1 -0
- package/dist/editor/contextRoutes.js +411 -0
- package/dist/editor/disposableAssuredExecution.d.ts +22 -0
- package/dist/editor/disposableAssuredExecution.d.ts.map +1 -0
- package/dist/editor/disposableAssuredExecution.js +57 -0
- package/dist/editor/editorCompletionModel.d.ts +47 -0
- package/dist/editor/editorCompletionModel.d.ts.map +1 -0
- package/dist/editor/editorCompletionModel.js +156 -0
- package/dist/editor/editorInlineCompletionModel.d.ts +34 -0
- package/dist/editor/editorInlineCompletionModel.d.ts.map +1 -0
- package/dist/editor/editorInlineCompletionModel.js +112 -0
- package/dist/editor/editorModelTokenBudget.d.ts +46 -0
- package/dist/editor/editorModelTokenBudget.d.ts.map +1 -0
- package/dist/editor/editorModelTokenBudget.js +121 -0
- package/dist/editor/inlineCompletionRateLimiter.d.ts +19 -0
- package/dist/editor/inlineCompletionRateLimiter.d.ts.map +1 -0
- package/dist/editor/inlineCompletionRateLimiter.js +46 -0
- package/dist/editor/inlineCompletionRoutes.d.ts +26 -0
- package/dist/editor/inlineCompletionRoutes.d.ts.map +1 -0
- package/dist/editor/inlineCompletionRoutes.js +404 -0
- package/dist/editor/inlineCompletionTelemetryEvidence.d.ts +5 -0
- package/dist/editor/inlineCompletionTelemetryEvidence.d.ts.map +1 -0
- package/dist/editor/inlineCompletionTelemetryEvidence.js +42 -0
- package/dist/editor/languageCancellation.d.ts +19 -0
- package/dist/editor/languageCancellation.d.ts.map +1 -0
- package/dist/editor/languageCancellation.js +48 -0
- package/dist/editor/languageProvider.d.ts +39 -0
- package/dist/editor/languageProvider.d.ts.map +1 -0
- package/dist/editor/languageProvider.js +11 -0
- package/dist/editor/languageRoutes.d.ts +15 -0
- package/dist/editor/languageRoutes.d.ts.map +1 -0
- package/dist/editor/languageRoutes.js +106 -0
- package/dist/editor/languageSanitize.d.ts +8 -0
- package/dist/editor/languageSanitize.d.ts.map +1 -0
- package/dist/editor/languageSanitize.js +101 -0
- package/dist/editor/languageService.d.ts +36 -0
- package/dist/editor/languageService.d.ts.map +1 -0
- package/dist/editor/languageService.js +93 -0
- package/dist/editor/languageServiceHost.d.ts +14 -0
- package/dist/editor/languageServiceHost.d.ts.map +1 -0
- package/dist/editor/languageServiceHost.js +242 -0
- package/dist/editor/localKnowledgeRetrieval.d.ts +21 -0
- package/dist/editor/localKnowledgeRetrieval.d.ts.map +1 -0
- package/dist/editor/localKnowledgeRetrieval.js +44 -0
- package/dist/editor/patchApplyEvidence.d.ts +21 -0
- package/dist/editor/patchApplyEvidence.d.ts.map +1 -0
- package/dist/editor/patchApplyEvidence.js +87 -0
- package/dist/editor/patchApplyRoutes.d.ts +16 -0
- package/dist/editor/patchApplyRoutes.d.ts.map +1 -0
- package/dist/editor/patchApplyRoutes.js +307 -0
- package/dist/editor/postApplyVerification.d.ts +42 -0
- package/dist/editor/postApplyVerification.d.ts.map +1 -0
- package/dist/editor/postApplyVerification.js +177 -0
- package/dist/editor/testGenerationEvidence.d.ts +6 -0
- package/dist/editor/testGenerationEvidence.d.ts.map +1 -0
- package/dist/editor/testGenerationEvidence.js +72 -0
- package/dist/editor/testGenerationPatch.d.ts +10 -0
- package/dist/editor/testGenerationPatch.d.ts.map +1 -0
- package/dist/editor/testGenerationPatch.js +66 -0
- package/dist/editor/testGenerationRoutes.d.ts +21 -0
- package/dist/editor/testGenerationRoutes.d.ts.map +1 -0
- package/dist/editor/testGenerationRoutes.js +254 -0
- package/dist/editor/testGenerationRunner.d.ts +23 -0
- package/dist/editor/testGenerationRunner.d.ts.map +1 -0
- package/dist/editor/testGenerationRunner.js +120 -0
- package/dist/editor/textOffsets.d.ts +6 -0
- package/dist/editor/textOffsets.d.ts.map +1 -0
- package/dist/editor/textOffsets.js +82 -0
- package/dist/editor/typescriptLanguageProvider.d.ts +3 -0
- package/dist/editor/typescriptLanguageProvider.d.ts.map +1 -0
- package/dist/editor/typescriptLanguageProvider.js +217 -0
- package/dist/evidence.d.ts +28 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +145 -0
- package/dist/files-deny.d.ts +3 -0
- package/dist/files-deny.d.ts.map +1 -0
- package/dist/files-deny.js +12 -0
- package/dist/files.d.ts +97 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +733 -0
- package/dist/gateway-setup.d.ts +10 -0
- package/dist/gateway-setup.d.ts.map +1 -0
- package/dist/gateway-setup.js +896 -0
- package/dist/governed-workflow.d.ts +17 -0
- package/dist/governed-workflow.d.ts.map +1 -0
- package/dist/governed-workflow.js +147 -0
- package/dist/grounded-answer.d.ts +12 -0
- package/dist/grounded-answer.d.ts.map +1 -0
- package/dist/grounded-answer.js +69 -0
- package/dist/grounded-context-index.d.ts +25 -0
- package/dist/grounded-context-index.d.ts.map +1 -0
- package/dist/grounded-context-index.js +169 -0
- package/dist/grounded-document-evidence.d.ts +28 -0
- package/dist/grounded-document-evidence.d.ts.map +1 -0
- package/dist/grounded-document-evidence.js +430 -0
- package/dist/grounded-handoff.d.ts +4 -0
- package/dist/grounded-handoff.d.ts.map +1 -0
- package/dist/grounded-handoff.js +445 -0
- package/dist/grounded-orchestrator.d.ts +43 -0
- package/dist/grounded-orchestrator.d.ts.map +1 -0
- package/dist/grounded-orchestrator.js +1445 -0
- package/dist/grounded-prompt.d.ts +2 -0
- package/dist/grounded-prompt.d.ts.map +1 -0
- package/dist/grounded-prompt.js +17 -0
- package/dist/grounded-qa-hybrid.d.ts +36 -0
- package/dist/grounded-qa-hybrid.d.ts.map +1 -0
- package/dist/grounded-qa-hybrid.js +762 -0
- package/dist/grounded-qa-multi-source.d.ts +38 -0
- package/dist/grounded-qa-multi-source.d.ts.map +1 -0
- package/dist/grounded-qa-multi-source.js +461 -0
- package/dist/grounded-qa.d.ts +45 -0
- package/dist/grounded-qa.d.ts.map +1 -0
- package/dist/grounded-qa.js +877 -0
- package/dist/grounded-rerank.d.ts +26 -0
- package/dist/grounded-rerank.d.ts.map +1 -0
- package/dist/grounded-rerank.js +72 -0
- package/dist/grounded-turn-registry.d.ts +23 -0
- package/dist/grounded-turn-registry.d.ts.map +1 -0
- package/dist/grounded-turn-registry.js +102 -0
- package/dist/headers.d.ts +3 -0
- package/dist/headers.d.ts.map +1 -0
- package/dist/headers.js +22 -0
- package/dist/host-check.d.ts +3 -0
- package/dist/host-check.d.ts.map +1 -0
- package/dist/host-check.js +58 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/load-csp.d.ts +3 -0
- package/dist/load-csp.d.ts.map +1 -0
- package/dist/load-csp.js +100 -0
- package/dist/local-knowledge-grounded-qa.d.ts +42 -0
- package/dist/local-knowledge-grounded-qa.d.ts.map +1 -0
- package/dist/local-knowledge-grounded-qa.js +678 -0
- package/dist/local-knowledge-handlers.d.ts +24 -0
- package/dist/local-knowledge-handlers.d.ts.map +1 -0
- package/dist/local-knowledge-handlers.js +1285 -0
- package/dist/local-knowledge-indexing-registry.d.ts +13 -0
- package/dist/local-knowledge-indexing-registry.d.ts.map +1 -0
- package/dist/local-knowledge-indexing-registry.js +53 -0
- package/dist/localKnowledgeKeyProvider.d.ts +11 -0
- package/dist/localKnowledgeKeyProvider.d.ts.map +1 -0
- package/dist/localKnowledgeKeyProvider.js +48 -0
- package/dist/memory-audit-event-builders.d.ts +21 -0
- package/dist/memory-audit-event-builders.d.ts.map +1 -0
- package/dist/memory-audit-event-builders.js +187 -0
- package/dist/memory-audit-handler.d.ts +23 -0
- package/dist/memory-audit-handler.d.ts.map +1 -0
- package/dist/memory-audit-handler.js +191 -0
- package/dist/memory-capture-policy.d.ts +10 -0
- package/dist/memory-capture-policy.d.ts.map +1 -0
- package/dist/memory-capture-policy.js +44 -0
- package/dist/memory-consolidation-handlers.d.ts +6 -0
- package/dist/memory-consolidation-handlers.d.ts.map +1 -0
- package/dist/memory-consolidation-handlers.js +491 -0
- package/dist/memory-consolidation-registry.d.ts +47 -0
- package/dist/memory-consolidation-registry.d.ts.map +1 -0
- package/dist/memory-consolidation-registry.js +106 -0
- package/dist/memory-conv-handlers.d.ts +8 -0
- package/dist/memory-conv-handlers.d.ts.map +1 -0
- package/dist/memory-conv-handlers.js +369 -0
- package/dist/memory-conversation-context.d.ts +13 -0
- package/dist/memory-conversation-context.d.ts.map +1 -0
- package/dist/memory-conversation-context.js +22 -0
- package/dist/memory-diagnostics.d.ts +29 -0
- package/dist/memory-diagnostics.d.ts.map +1 -0
- package/dist/memory-diagnostics.js +122 -0
- package/dist/memory-embedding.d.ts +21 -0
- package/dist/memory-embedding.d.ts.map +1 -0
- package/dist/memory-embedding.js +264 -0
- package/dist/memory-handlers.d.ts +19 -0
- package/dist/memory-handlers.d.ts.map +1 -0
- package/dist/memory-handlers.js +1204 -0
- package/dist/memory-maintenance-handlers.d.ts +35 -0
- package/dist/memory-maintenance-handlers.d.ts.map +1 -0
- package/dist/memory-maintenance-handlers.js +219 -0
- package/dist/memory-record-builders.d.ts +4 -0
- package/dist/memory-record-builders.d.ts.map +1 -0
- package/dist/memory-record-builders.js +19 -0
- package/dist/memory-retention.d.ts +31 -0
- package/dist/memory-retention.d.ts.map +1 -0
- package/dist/memory-retention.js +151 -0
- package/dist/memory-retrieval-signals.d.ts +12 -0
- package/dist/memory-retrieval-signals.d.ts.map +1 -0
- package/dist/memory-retrieval-signals.js +100 -0
- package/dist/memory-salience.d.ts +12 -0
- package/dist/memory-salience.d.ts.map +1 -0
- package/dist/memory-salience.js +154 -0
- package/dist/memory-scope-sanitizer.d.ts +6 -0
- package/dist/memory-scope-sanitizer.d.ts.map +1 -0
- package/dist/memory-scope-sanitizer.js +106 -0
- package/dist/memory-target-resolver.d.ts +4 -0
- package/dist/memory-target-resolver.d.ts.map +1 -0
- package/dist/memory-target-resolver.js +73 -0
- package/dist/memory-workflow-port.d.ts +14 -0
- package/dist/memory-workflow-port.d.ts.map +1 -0
- package/dist/memory-workflow-port.js +186 -0
- package/dist/private-json.d.ts +3 -0
- package/dist/private-json.d.ts.map +1 -0
- package/dist/private-json.js +62 -0
- package/dist/promptEnhancer/index.d.ts +3 -0
- package/dist/promptEnhancer/index.d.ts.map +1 -0
- package/dist/promptEnhancer/index.js +5 -0
- package/dist/promptEnhancer/orchestrate.d.ts +2 -0
- package/dist/promptEnhancer/orchestrate.d.ts.map +1 -0
- package/dist/promptEnhancer/orchestrate.js +5 -0
- package/dist/promptEnhancer/routes.d.ts +9 -0
- package/dist/promptEnhancer/routes.d.ts.map +1 -0
- package/dist/promptEnhancer/routes.js +205 -0
- package/dist/qualityIntelligence/capsuleAdapter.d.ts +27 -0
- package/dist/qualityIntelligence/capsuleAdapter.d.ts.map +1 -0
- package/dist/qualityIntelligence/capsuleAdapter.js +57 -0
- package/dist/qualityIntelligence/connectorAuthorization.d.ts +22 -0
- package/dist/qualityIntelligence/connectorAuthorization.d.ts.map +1 -0
- package/dist/qualityIntelligence/connectorAuthorization.js +35 -0
- package/dist/qualityIntelligence/connectorErrors.d.ts +16 -0
- package/dist/qualityIntelligence/connectorErrors.d.ts.map +1 -0
- package/dist/qualityIntelligence/connectorErrors.js +56 -0
- package/dist/qualityIntelligence/connectorRoutes.d.ts +7 -0
- package/dist/qualityIntelligence/connectorRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/connectorRoutes.js +167 -0
- package/dist/qualityIntelligence/editRoutes.d.ts +5 -0
- package/dist/qualityIntelligence/editRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/editRoutes.js +293 -0
- package/dist/qualityIntelligence/exportAssembly.d.ts +22 -0
- package/dist/qualityIntelligence/exportAssembly.d.ts.map +1 -0
- package/dist/qualityIntelligence/exportAssembly.js +352 -0
- package/dist/qualityIntelligence/exportRoutes.d.ts +5 -0
- package/dist/qualityIntelligence/exportRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/exportRoutes.js +320 -0
- package/dist/qualityIntelligence/figma/figmaConcurrency.d.ts +8 -0
- package/dist/qualityIntelligence/figma/figmaConcurrency.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaConcurrency.js +34 -0
- package/dist/qualityIntelligence/figma/figmaConnector.d.ts +65 -0
- package/dist/qualityIntelligence/figma/figmaConnector.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaConnector.js +184 -0
- package/dist/qualityIntelligence/figma/figmaConnectorAudit.d.ts +52 -0
- package/dist/qualityIntelligence/figma/figmaConnectorAudit.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaConnectorAudit.js +63 -0
- package/dist/qualityIntelligence/figma/figmaConnectorErrors.d.ts +31 -0
- package/dist/qualityIntelligence/figma/figmaConnectorErrors.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaConnectorErrors.js +220 -0
- package/dist/qualityIntelligence/figma/figmaConnectorMetrics.d.ts +44 -0
- package/dist/qualityIntelligence/figma/figmaConnectorMetrics.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaConnectorMetrics.js +49 -0
- package/dist/qualityIntelligence/figma/figmaConsent.d.ts +39 -0
- package/dist/qualityIntelligence/figma/figmaConsent.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaConsent.js +62 -0
- package/dist/qualityIntelligence/figma/figmaHttpPort.d.ts +28 -0
- package/dist/qualityIntelligence/figma/figmaHttpPort.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaHttpPort.js +70 -0
- package/dist/qualityIntelligence/figma/figmaObservedActions.d.ts +49 -0
- package/dist/qualityIntelligence/figma/figmaObservedActions.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaObservedActions.js +89 -0
- package/dist/qualityIntelligence/figma/figmaReadiness.d.ts +32 -0
- package/dist/qualityIntelligence/figma/figmaReadiness.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaReadiness.js +67 -0
- package/dist/qualityIntelligence/figma/figmaRenderPort.d.ts +29 -0
- package/dist/qualityIntelligence/figma/figmaRenderPort.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaRenderPort.js +93 -0
- package/dist/qualityIntelligence/figma/figmaResnapshot.d.ts +28 -0
- package/dist/qualityIntelligence/figma/figmaResnapshot.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaResnapshot.js +38 -0
- package/dist/qualityIntelligence/figma/figmaRetry.d.ts +31 -0
- package/dist/qualityIntelligence/figma/figmaRetry.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaRetry.js +62 -0
- package/dist/qualityIntelligence/figma/figmaScopeRef.d.ts +9 -0
- package/dist/qualityIntelligence/figma/figmaScopeRef.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaScopeRef.js +18 -0
- package/dist/qualityIntelligence/figma/figmaScopedPagination.d.ts +86 -0
- package/dist/qualityIntelligence/figma/figmaScopedPagination.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaScopedPagination.js +308 -0
- package/dist/qualityIntelligence/figma/figmaSnapshotBuilder.d.ts +31 -0
- package/dist/qualityIntelligence/figma/figmaSnapshotBuilder.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaSnapshotBuilder.js +314 -0
- package/dist/qualityIntelligence/figma/figmaSnapshotHash.d.ts +18 -0
- package/dist/qualityIntelligence/figma/figmaSnapshotHash.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaSnapshotHash.js +63 -0
- package/dist/qualityIntelligence/figma/figmaSnapshotTypes.d.ts +65 -0
- package/dist/qualityIntelligence/figma/figmaSnapshotTypes.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaSnapshotTypes.js +13 -0
- package/dist/qualityIntelligence/figma/figmaTokenSource.d.ts +9 -0
- package/dist/qualityIntelligence/figma/figmaTokenSource.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaTokenSource.js +61 -0
- package/dist/qualityIntelligence/figma/figmaTokenStore.d.ts +19 -0
- package/dist/qualityIntelligence/figma/figmaTokenStore.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaTokenStore.js +156 -0
- package/dist/qualityIntelligence/figma/figmaUrl.d.ts +6 -0
- package/dist/qualityIntelligence/figma/figmaUrl.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/figmaUrl.js +36 -0
- package/dist/qualityIntelligence/figma/index.d.ts +20 -0
- package/dist/qualityIntelligence/figma/index.d.ts.map +1 -0
- package/dist/qualityIntelligence/figma/index.js +26 -0
- package/dist/qualityIntelligence/figmaCodegenRoutes.d.ts +28 -0
- package/dist/qualityIntelligence/figmaCodegenRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/figmaCodegenRoutes.js +165 -0
- package/dist/qualityIntelligence/figmaSnapshotAdapter.d.ts +55 -0
- package/dist/qualityIntelligence/figmaSnapshotAdapter.d.ts.map +1 -0
- package/dist/qualityIntelligence/figmaSnapshotAdapter.js +219 -0
- package/dist/qualityIntelligence/figmaSnapshotOrchestration.d.ts +64 -0
- package/dist/qualityIntelligence/figmaSnapshotOrchestration.d.ts.map +1 -0
- package/dist/qualityIntelligence/figmaSnapshotOrchestration.js +203 -0
- package/dist/qualityIntelligence/figmaSnapshotRoutes.d.ts +112 -0
- package/dist/qualityIntelligence/figmaSnapshotRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/figmaSnapshotRoutes.js +1063 -0
- package/dist/qualityIntelligence/figmaSnapshotScreenIds.d.ts +19 -0
- package/dist/qualityIntelligence/figmaSnapshotScreenIds.d.ts.map +1 -0
- package/dist/qualityIntelligence/figmaSnapshotScreenIds.js +75 -0
- package/dist/qualityIntelligence/generationPort.d.ts +15 -0
- package/dist/qualityIntelligence/generationPort.d.ts.map +1 -0
- package/dist/qualityIntelligence/generationPort.js +185 -0
- package/dist/qualityIntelligence/handoffErrors.d.ts +9 -0
- package/dist/qualityIntelligence/handoffErrors.d.ts.map +1 -0
- package/dist/qualityIntelligence/handoffErrors.js +21 -0
- package/dist/qualityIntelligence/handoffRoutes.d.ts +15 -0
- package/dist/qualityIntelligence/handoffRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/handoffRoutes.js +341 -0
- package/dist/qualityIntelligence/index.d.ts +17 -0
- package/dist/qualityIntelligence/index.d.ts.map +1 -0
- package/dist/qualityIntelligence/index.js +36 -0
- package/dist/qualityIntelligence/judgePort.d.ts +30 -0
- package/dist/qualityIntelligence/judgePort.d.ts.map +1 -0
- package/dist/qualityIntelligence/judgePort.js +326 -0
- package/dist/qualityIntelligence/modelSelection.d.ts +58 -0
- package/dist/qualityIntelligence/modelSelection.d.ts.map +1 -0
- package/dist/qualityIntelligence/modelSelection.js +148 -0
- package/dist/qualityIntelligence/reCheckRoutes.d.ts +6 -0
- package/dist/qualityIntelligence/reCheckRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/reCheckRoutes.js +1157 -0
- package/dist/qualityIntelligence/retentionEnforcement.d.ts +13 -0
- package/dist/qualityIntelligence/retentionEnforcement.d.ts.map +1 -0
- package/dist/qualityIntelligence/retentionEnforcement.js +47 -0
- package/dist/qualityIntelligence/retentionRoutes.d.ts +8 -0
- package/dist/qualityIntelligence/retentionRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/retentionRoutes.js +74 -0
- package/dist/qualityIntelligence/reviewRoutes.d.ts +5 -0
- package/dist/qualityIntelligence/reviewRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/reviewRoutes.js +145 -0
- package/dist/qualityIntelligence/reviewStore.d.ts +75 -0
- package/dist/qualityIntelligence/reviewStore.d.ts.map +1 -0
- package/dist/qualityIntelligence/reviewStore.js +170 -0
- package/dist/qualityIntelligence/runExecution.d.ts +36 -0
- package/dist/qualityIntelligence/runExecution.d.ts.map +1 -0
- package/dist/qualityIntelligence/runExecution.js +180 -0
- package/dist/qualityIntelligence/runIngestion.d.ts +70 -0
- package/dist/qualityIntelligence/runIngestion.d.ts.map +1 -0
- package/dist/qualityIntelligence/runIngestion.js +1235 -0
- package/dist/qualityIntelligence/runRegistry.d.ts +31 -0
- package/dist/qualityIntelligence/runRegistry.d.ts.map +1 -0
- package/dist/qualityIntelligence/runRegistry.js +66 -0
- package/dist/qualityIntelligence/runRoutes.d.ts +16 -0
- package/dist/qualityIntelligence/runRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/runRoutes.js +357 -0
- package/dist/qualityIntelligence/traceabilityRoutes.d.ts +5 -0
- package/dist/qualityIntelligence/traceabilityRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/traceabilityRoutes.js +173 -0
- package/dist/qualityIntelligence/uiRoutes.d.ts +7 -0
- package/dist/qualityIntelligence/uiRoutes.d.ts.map +1 -0
- package/dist/qualityIntelligence/uiRoutes.js +336 -0
- package/dist/read-handlers.d.ts +9 -0
- package/dist/read-handlers.d.ts.map +1 -0
- package/dist/read-handlers.js +265 -0
- package/dist/relationship-handlers.d.ts +191 -0
- package/dist/relationship-handlers.d.ts.map +1 -0
- package/dist/relationship-handlers.js +0 -0
- package/dist/routes.d.ts +37 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +507 -0
- package/dist/run-engine.d.ts +25 -0
- package/dist/run-engine.d.ts.map +1 -0
- package/dist/run-engine.js +385 -0
- package/dist/run-handlers.d.ts +9 -0
- package/dist/run-handlers.d.ts.map +1 -0
- package/dist/run-handlers.js +465 -0
- package/dist/run-request.d.ts +17 -0
- package/dist/run-request.d.ts.map +1 -0
- package/dist/run-request.js +219 -0
- package/dist/runs.d.ts +47 -0
- package/dist/runs.d.ts.map +1 -0
- package/dist/runs.js +100 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +152 -0
- package/dist/sink.d.ts +28 -0
- package/dist/sink.d.ts.map +1 -0
- package/dist/sink.js +80 -0
- package/dist/sse-write.d.ts +9 -0
- package/dist/sse-write.d.ts.map +1 -0
- package/dist/sse-write.js +26 -0
- package/dist/sse.d.ts +8 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +27 -0
- package/dist/static.d.ts +5 -0
- package/dist/static.d.ts.map +1 -0
- package/dist/static.js +76 -0
- package/dist/store/chats.d.ts +17 -0
- package/dist/store/chats.d.ts.map +1 -0
- package/dist/store/chats.js +624 -0
- package/dist/store/db.d.ts +11 -0
- package/dist/store/db.d.ts.map +1 -0
- package/dist/store/db.js +203 -0
- package/dist/store/errors.d.ts +13 -0
- package/dist/store/errors.d.ts.map +1 -0
- package/dist/store/errors.js +30 -0
- package/dist/store/index.d.ts +7 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +6 -0
- package/dist/store/messages.d.ts +8 -0
- package/dist/store/messages.d.ts.map +1 -0
- package/dist/store/messages.js +149 -0
- package/dist/store/paths.d.ts +5 -0
- package/dist/store/paths.d.ts.map +1 -0
- package/dist/store/paths.js +84 -0
- package/dist/store/projects.d.ts +8 -0
- package/dist/store/projects.d.ts.map +1 -0
- package/dist/store/projects.js +59 -0
- package/dist/store/relationship-audit.d.ts +42 -0
- package/dist/store/relationship-audit.d.ts.map +1 -0
- package/dist/store/relationship-audit.js +155 -0
- package/dist/store/relationships.d.ts +191 -0
- package/dist/store/relationships.d.ts.map +1 -0
- package/dist/store/relationships.js +724 -0
- package/dist/store/schema.d.ts +4 -0
- package/dist/store/schema.d.ts.map +1 -0
- package/dist/store/schema.js +220 -0
- package/dist/store/types.d.ts +29 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +8 -0
- package/dist/store/validation.d.ts +7 -0
- package/dist/store/validation.d.ts.map +1 -0
- package/dist/store/validation.js +117 -0
- package/dist/store-handlers.d.ts +17 -0
- package/dist/store-handlers.d.ts.map +1 -0
- package/dist/store-handlers.js +872 -0
- package/dist/terminal-errors.d.ts +22 -0
- package/dist/terminal-errors.d.ts.map +1 -0
- package/dist/terminal-errors.js +45 -0
- package/dist/terminal-evidence.d.ts +21 -0
- package/dist/terminal-evidence.d.ts.map +1 -0
- package/dist/terminal-evidence.js +65 -0
- package/dist/terminal-routes.d.ts +10 -0
- package/dist/terminal-routes.d.ts.map +1 -0
- package/dist/terminal-routes.js +219 -0
- package/dist/terminal.d.ts +68 -0
- package/dist/terminal.d.ts.map +1 -0
- package/dist/terminal.js +855 -0
- package/package.json +52 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
// Quality Intelligence Conversation Center → workflow handoff route (Epic #270, Issue #281).
|
|
2
|
+
//
|
|
3
|
+
// Single additive HTTP handler:
|
|
4
|
+
// * POST /api/quality-intelligence/handoff
|
|
5
|
+
//
|
|
6
|
+
// Hard constraints:
|
|
7
|
+
// * The Conversation Center is the existing chat surface — QI integration is via WORKFLOW
|
|
8
|
+
// HANDOFF only, never a parallel chat/agent/memory channel.
|
|
9
|
+
// * The request body IS a `QualityIntelligenceConversationCenterHandoff` envelope. The envelope
|
|
10
|
+
// carries ONLY refs (chat-message id, run id, source-envelope ids) — never chat content,
|
|
11
|
+
// never an excerpt, never a body. Unknown top-level keys are REJECTED so a misbehaving
|
|
12
|
+
// client cannot smuggle content through the seam.
|
|
13
|
+
// * The route resolves `requestedByChatMessageId` against the existing chat-store seam
|
|
14
|
+
// (`UiStore`). If recognised, the handoff is persisted as a single system message on the
|
|
15
|
+
// owning chat (taskType=`qi-handoff`); the message content is a fixed, non-echoing
|
|
16
|
+
// descriptor — the envelope itself stays out of the message body.
|
|
17
|
+
// * If the chat-message ref is unknown → `404 QI_HANDOFF_UNKNOWN_CHAT_MESSAGE`.
|
|
18
|
+
// * No provider SDK imports. No new runtime dependency. A "design-tests" handoff additionally
|
|
19
|
+
// starts a model-routed QI run in the BACKGROUND from the chat's connected folder (through the
|
|
20
|
+
// Keiko Model Gateway + Harness, like any QI run) and links the run id back to the chat — this
|
|
21
|
+
// is the governed workflow handoff (Issue #281), not a parallel chat/agent/model channel.
|
|
22
|
+
// * Test Intelligence reference (TI) is acknowledged only by plain phrase; this file MUST
|
|
23
|
+
// NOT contain any reference to the prior external TI-namespace packages — enforced by
|
|
24
|
+
// `independenceGuard.test.ts` and the repo-wide `npm run check:qi-supply-chain` gate.
|
|
25
|
+
//
|
|
26
|
+
// Group export `QI_HANDOFF_ROUTE_GROUP` keeps the route registration mechanically merge-safe
|
|
27
|
+
// with sibling QI epic work (e.g. #280) — the dispatcher in `routes.ts` only needs to spread
|
|
28
|
+
// the group.
|
|
29
|
+
import { randomUUID } from "node:crypto";
|
|
30
|
+
import { QualityIntelligence } from "@oscharko-dev/keiko-contracts";
|
|
31
|
+
import { qiHandoffErrorBody, } from "./handoffErrors.js";
|
|
32
|
+
import { containsForbiddenSecretShape } from "./connectorErrors.js";
|
|
33
|
+
import { executeQiRun } from "./runExecution.js";
|
|
34
|
+
import { qiRunRegistry } from "./runRegistry.js";
|
|
35
|
+
// ─── Body reading ──────────────────────────────────────────────────────────────
|
|
36
|
+
const MAX_BODY_BYTES = 64 * 1024;
|
|
37
|
+
class BodyTooLargeError extends Error {
|
|
38
|
+
constructor() {
|
|
39
|
+
super("Handoff body exceeds the route cap");
|
|
40
|
+
this.name = "BodyTooLargeError";
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const readBody = (req) => new Promise((resolve, reject) => {
|
|
44
|
+
const chunks = [];
|
|
45
|
+
let total = 0;
|
|
46
|
+
let capped = false;
|
|
47
|
+
req.on("data", (chunk) => {
|
|
48
|
+
total += chunk.length;
|
|
49
|
+
if (total > MAX_BODY_BYTES) {
|
|
50
|
+
if (!capped) {
|
|
51
|
+
capped = true;
|
|
52
|
+
chunks.length = 0;
|
|
53
|
+
reject(new BodyTooLargeError());
|
|
54
|
+
req.resume();
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
chunks.push(chunk);
|
|
59
|
+
});
|
|
60
|
+
req.on("end", () => {
|
|
61
|
+
if (!capped)
|
|
62
|
+
resolve(Buffer.concat(chunks).toString("utf8"));
|
|
63
|
+
});
|
|
64
|
+
req.on("error", reject);
|
|
65
|
+
});
|
|
66
|
+
const isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
67
|
+
// ─── Envelope validation (envelope-only invariant) ─────────────────────────────
|
|
68
|
+
// The envelope's permitted top-level keys. Anything else MUST be rejected so a leaky
|
|
69
|
+
// client cannot smuggle chat content, bodies, excerpts, or unstructured payloads
|
|
70
|
+
// through this seam.
|
|
71
|
+
const ALLOWED_ENVELOPE_KEYS = new Set([
|
|
72
|
+
"id",
|
|
73
|
+
"requestedByChatMessageId",
|
|
74
|
+
"runId",
|
|
75
|
+
"promptedAction",
|
|
76
|
+
"payloadRef",
|
|
77
|
+
]);
|
|
78
|
+
// `payloadRef` carries strictly envelope-id refs and nothing else. The branded
|
|
79
|
+
// `sourceEnvelopeIds` array is the only permitted member.
|
|
80
|
+
const ALLOWED_PAYLOAD_REF_KEYS = new Set(["sourceEnvelopeIds"]);
|
|
81
|
+
const errResult = (status, code) => ({
|
|
82
|
+
status,
|
|
83
|
+
body: qiHandoffErrorBody(code),
|
|
84
|
+
});
|
|
85
|
+
const scanForbiddenStrings = (value) => {
|
|
86
|
+
if (typeof value === "string")
|
|
87
|
+
return containsForbiddenSecretShape(value);
|
|
88
|
+
if (Array.isArray(value))
|
|
89
|
+
return value.some(scanForbiddenStrings);
|
|
90
|
+
if (isPlainObject(value)) {
|
|
91
|
+
for (const v of Object.values(value)) {
|
|
92
|
+
if (scanForbiddenStrings(v))
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
return false;
|
|
98
|
+
};
|
|
99
|
+
const isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
|
|
100
|
+
const isAllowedAction = (value) => {
|
|
101
|
+
if (typeof value !== "string")
|
|
102
|
+
return false;
|
|
103
|
+
for (const action of QualityIntelligence.QUALITY_INTELLIGENCE_HANDOFF_PROMPTED_ACTIONS) {
|
|
104
|
+
if (action === value)
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
};
|
|
109
|
+
const fail = (code = "QI_HANDOFF_BAD_REQUEST") => ({
|
|
110
|
+
kind: "err",
|
|
111
|
+
result: errResult(400, code),
|
|
112
|
+
});
|
|
113
|
+
const hasOnlyAllowedKeys = (obj, allowed) => {
|
|
114
|
+
for (const key of Object.keys(obj)) {
|
|
115
|
+
if (!allowed.has(key))
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
return true;
|
|
119
|
+
};
|
|
120
|
+
const parseSourceEnvelopeIds = (raw) => {
|
|
121
|
+
if (!Array.isArray(raw))
|
|
122
|
+
return undefined;
|
|
123
|
+
const ids = [];
|
|
124
|
+
for (const candidate of raw) {
|
|
125
|
+
if (typeof candidate !== "string")
|
|
126
|
+
return undefined;
|
|
127
|
+
try {
|
|
128
|
+
ids.push(QualityIntelligence.asQualityIntelligenceSourceEnvelopeId(candidate));
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return ids;
|
|
135
|
+
};
|
|
136
|
+
const parseOptionalRunId = (raw) => {
|
|
137
|
+
if (raw === undefined)
|
|
138
|
+
return { ok: true, value: undefined };
|
|
139
|
+
if (typeof raw !== "string")
|
|
140
|
+
return { ok: false };
|
|
141
|
+
try {
|
|
142
|
+
return { ok: true, value: QualityIntelligence.asQualityIntelligenceRunId(raw) };
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
return { ok: false };
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const validatePayloadRef = (raw) => {
|
|
149
|
+
if (!isPlainObject(raw))
|
|
150
|
+
return undefined;
|
|
151
|
+
if (!hasOnlyAllowedKeys(raw, ALLOWED_PAYLOAD_REF_KEYS))
|
|
152
|
+
return undefined;
|
|
153
|
+
return parseSourceEnvelopeIds(raw.sourceEnvelopeIds);
|
|
154
|
+
};
|
|
155
|
+
const validateEnvelope = (parsed) => {
|
|
156
|
+
if (!isPlainObject(parsed))
|
|
157
|
+
return fail();
|
|
158
|
+
if (!hasOnlyAllowedKeys(parsed, ALLOWED_ENVELOPE_KEYS))
|
|
159
|
+
return fail();
|
|
160
|
+
if (!isNonEmptyString(parsed.id))
|
|
161
|
+
return fail();
|
|
162
|
+
if (!isNonEmptyString(parsed.requestedByChatMessageId))
|
|
163
|
+
return fail();
|
|
164
|
+
if (!isAllowedAction(parsed.promptedAction))
|
|
165
|
+
return fail();
|
|
166
|
+
const sourceEnvelopeIds = validatePayloadRef(parsed.payloadRef);
|
|
167
|
+
if (sourceEnvelopeIds === undefined)
|
|
168
|
+
return fail();
|
|
169
|
+
const runIdResult = parseOptionalRunId(parsed.runId);
|
|
170
|
+
if (!runIdResult.ok)
|
|
171
|
+
return fail();
|
|
172
|
+
// Defence-in-depth: scrub every string value for credential-shaped substrings.
|
|
173
|
+
if (scanForbiddenStrings(parsed))
|
|
174
|
+
return fail("QI_HANDOFF_FORBIDDEN_PAYLOAD");
|
|
175
|
+
const envelope = {
|
|
176
|
+
id: parsed.id,
|
|
177
|
+
requestedByChatMessageId: parsed.requestedByChatMessageId,
|
|
178
|
+
promptedAction: parsed.promptedAction,
|
|
179
|
+
payloadRef: { sourceEnvelopeIds },
|
|
180
|
+
...(runIdResult.value !== undefined ? { runId: runIdResult.value } : {}),
|
|
181
|
+
};
|
|
182
|
+
return { kind: "ok", envelope };
|
|
183
|
+
};
|
|
184
|
+
// Single indexed lookup — replaces O(P×C×M) triple scan on every handoff POST.
|
|
185
|
+
const findChatMessage = (deps, messageId) => {
|
|
186
|
+
const message = deps.store.findMessageById(messageId);
|
|
187
|
+
if (message === undefined)
|
|
188
|
+
return undefined;
|
|
189
|
+
return { chatId: message.chatId, message };
|
|
190
|
+
};
|
|
191
|
+
// ─── Persisted handoff record ──────────────────────────────────────────────────
|
|
192
|
+
//
|
|
193
|
+
// We persist the handoff as a single system message on the owning chat. The message
|
|
194
|
+
// content is a fixed, non-echoing descriptor — the envelope itself is NOT serialised
|
|
195
|
+
// into the message body. This preserves the envelope-only invariant on the persisted
|
|
196
|
+
// row and keeps the chat surface free of secret-shaped content.
|
|
197
|
+
const HANDOFF_TASK_TYPE = "qi-handoff";
|
|
198
|
+
const HANDOFF_CONTENT_BY_ACTION = {
|
|
199
|
+
"design-tests": "Quality Intelligence: design-tests handoff requested.",
|
|
200
|
+
"validate-tests": "Quality Intelligence: validate-tests handoff requested.",
|
|
201
|
+
"review-coverage": "Quality Intelligence: review-coverage handoff requested.",
|
|
202
|
+
"request-export": "Quality Intelligence: request-export handoff requested.",
|
|
203
|
+
};
|
|
204
|
+
const buildHandoffMessage = (resolved, envelope, now, linkedRunId) => ({
|
|
205
|
+
chatId: resolved.chatId,
|
|
206
|
+
role: "system",
|
|
207
|
+
content: HANDOFF_CONTENT_BY_ACTION[envelope.promptedAction],
|
|
208
|
+
timestamp: now(),
|
|
209
|
+
runId: linkedRunId,
|
|
210
|
+
workflowId: undefined,
|
|
211
|
+
workflowStatus: undefined,
|
|
212
|
+
shortResult: undefined,
|
|
213
|
+
taskType: HANDOFF_TASK_TYPE,
|
|
214
|
+
});
|
|
215
|
+
// For a "design-tests" handoff, start a model-routed QI run in the BACKGROUND from the chat's
|
|
216
|
+
// connected workspace context. Fire-and-forget: the run registers with the in-flight registry (so it
|
|
217
|
+
// surfaces in the run list) and persists to evidence on completion; the handoff returns the run id
|
|
218
|
+
// immediately so the Conversation Center can link + poll it. The run goes through the Keiko Model
|
|
219
|
+
// Gateway + Harness like any QI run — this is the governed workflow handoff (Issue #281), not a
|
|
220
|
+
// parallel chat/agent/model path.
|
|
221
|
+
//
|
|
222
|
+
// Multi-source (Epic #532/#729): a chat may connect more than one folder. The run ingests EVERY
|
|
223
|
+
// connected workspace root so the QI run covers the full context the user connected — not just the
|
|
224
|
+
// first folder. `executeQiRun` already applies the per-run source cap, deny-list guard, and byte
|
|
225
|
+
// budget over the source list.
|
|
226
|
+
//
|
|
227
|
+
// `envelope.payloadRef.sourceEnvelopeIds` are reserved for a future capability that narrows the run
|
|
228
|
+
// to a user-selected SUBSET of the connected context; until that resolver exists the run faithfully
|
|
229
|
+
// ingests the chat's whole connected workspace context, so an empty (or any) id list is honoured by
|
|
230
|
+
// using the connected scopes.
|
|
231
|
+
const startHandoffRun = (deps, roots) => {
|
|
232
|
+
const runId = `qi-run-${randomUUID()}`;
|
|
233
|
+
const registeredAt = new Date().toISOString();
|
|
234
|
+
const controller = qiRunRegistry.register(runId, registeredAt);
|
|
235
|
+
const totals = { candidates: 0, findings: 0, exports: 0 };
|
|
236
|
+
void executeQiRun({
|
|
237
|
+
request: {
|
|
238
|
+
sources: roots.map((path) => ({
|
|
239
|
+
kind: "workspace",
|
|
240
|
+
label: "Conversation Center",
|
|
241
|
+
path,
|
|
242
|
+
})),
|
|
243
|
+
},
|
|
244
|
+
runId,
|
|
245
|
+
deps,
|
|
246
|
+
registeredAt,
|
|
247
|
+
signal: controller.signal,
|
|
248
|
+
onAccepted: () => undefined,
|
|
249
|
+
onEvent: (event) => {
|
|
250
|
+
if (event.payload.kind === "candidate:proposed")
|
|
251
|
+
totals.candidates += 1;
|
|
252
|
+
if (event.payload.kind === "finding:recorded")
|
|
253
|
+
totals.findings += 1;
|
|
254
|
+
qiRunRegistry.updateTotals(runId, totals);
|
|
255
|
+
},
|
|
256
|
+
})
|
|
257
|
+
.then((summary) => {
|
|
258
|
+
qiRunRegistry.complete(runId, summary.status);
|
|
259
|
+
})
|
|
260
|
+
.catch(() => {
|
|
261
|
+
qiRunRegistry.complete(runId, "failed");
|
|
262
|
+
});
|
|
263
|
+
return runId;
|
|
264
|
+
};
|
|
265
|
+
// Collect the distinct, non-empty absolute roots of a chat's connected workspace context. Prefers
|
|
266
|
+
// the canonical multi-source `connectedScopes` list (Epic #532); falls back to the legacy singular
|
|
267
|
+
// `connectedScope` for older chats. Non-folder scopes (no `root`) are skipped — the handoff run
|
|
268
|
+
// ingests workspace folders only. Order-preserving exact-string de-duplication.
|
|
269
|
+
const collectConnectedRoots = (chat) => {
|
|
270
|
+
const scopes = chat?.connectedScopes ?? (chat?.connectedScope !== undefined ? [chat.connectedScope] : []);
|
|
271
|
+
const roots = [];
|
|
272
|
+
for (const scope of scopes) {
|
|
273
|
+
const root = scope.root;
|
|
274
|
+
if (typeof root === "string" && root.length > 0 && !roots.includes(root)) {
|
|
275
|
+
roots.push(root);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return roots;
|
|
279
|
+
};
|
|
280
|
+
// Resolve the run id linked to a handoff: a "design-tests" handoff over a chat with a connected
|
|
281
|
+
// workspace context starts a background run; otherwise it falls back to any run id the envelope
|
|
282
|
+
// already carried.
|
|
283
|
+
const resolveHandoffRunId = (deps, envelope, chatId) => {
|
|
284
|
+
if (envelope.promptedAction !== "design-tests")
|
|
285
|
+
return envelope.runId;
|
|
286
|
+
const chat = deps.store.findChatById(chatId);
|
|
287
|
+
const roots = collectConnectedRoots(chat);
|
|
288
|
+
if (roots.length > 0)
|
|
289
|
+
return startHandoffRun(deps, roots);
|
|
290
|
+
return envelope.runId;
|
|
291
|
+
};
|
|
292
|
+
export const createHandleQiHandoff = (options = {}) => {
|
|
293
|
+
const now = options.now ?? (() => Date.now());
|
|
294
|
+
return async (ctx, deps) => {
|
|
295
|
+
let raw;
|
|
296
|
+
try {
|
|
297
|
+
raw = await readBody(ctx.req);
|
|
298
|
+
}
|
|
299
|
+
catch (e) {
|
|
300
|
+
if (e instanceof BodyTooLargeError) {
|
|
301
|
+
return errResult(413, "QI_HANDOFF_PAYLOAD_TOO_LARGE");
|
|
302
|
+
}
|
|
303
|
+
return errResult(400, "QI_HANDOFF_BAD_REQUEST");
|
|
304
|
+
}
|
|
305
|
+
let parsed;
|
|
306
|
+
try {
|
|
307
|
+
parsed = JSON.parse(raw);
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
return errResult(400, "QI_HANDOFF_BAD_REQUEST");
|
|
311
|
+
}
|
|
312
|
+
const validation = validateEnvelope(parsed);
|
|
313
|
+
if (validation.kind === "err")
|
|
314
|
+
return validation.result;
|
|
315
|
+
const { envelope } = validation;
|
|
316
|
+
const resolved = findChatMessage(deps, envelope.requestedByChatMessageId);
|
|
317
|
+
if (resolved === undefined) {
|
|
318
|
+
return errResult(404, "QI_HANDOFF_UNKNOWN_CHAT_MESSAGE");
|
|
319
|
+
}
|
|
320
|
+
const linkedRunId = resolveHandoffRunId(deps, envelope, resolved.chatId);
|
|
321
|
+
const persisted = deps.store.createMessage(buildHandoffMessage(resolved, envelope, now, linkedRunId));
|
|
322
|
+
const body = {
|
|
323
|
+
handoffId: envelope.id,
|
|
324
|
+
chatId: resolved.chatId,
|
|
325
|
+
persistedMessageId: persisted.id,
|
|
326
|
+
...(linkedRunId !== undefined ? { runId: linkedRunId } : {}),
|
|
327
|
+
};
|
|
328
|
+
return { status: 200, body };
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
export const handleQiHandoff = createHandleQiHandoff();
|
|
332
|
+
// Mechanically-mergeable route group. Sibling QI epic work (e.g. #280) registers its
|
|
333
|
+
// own group separately; the dispatcher in `routes.ts` spreads each group into the
|
|
334
|
+
// route table, so the merge surface here is a single array literal.
|
|
335
|
+
export const QI_HANDOFF_ROUTE_GROUP = [
|
|
336
|
+
{
|
|
337
|
+
method: "POST",
|
|
338
|
+
pattern: "/api/quality-intelligence/handoff",
|
|
339
|
+
handler: handleQiHandoff,
|
|
340
|
+
},
|
|
341
|
+
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { isFigmaConnectorAuthorized, isJiraConnectorAuthorized, summariseQiConnectorCapabilities, type QiConnectorCapabilities, type QiConnectorConfig, } from "./connectorAuthorization.js";
|
|
2
|
+
export { payloadContainsForbiddenSecretShape, qiConnectorErrorBody, type QiConnectorErrorBody, type QiConnectorErrorCode, } from "./connectorErrors.js";
|
|
3
|
+
export { handleQiCapabilities, handleQiDryRunFigma, handleQiDryRunJira, handleQiSourceSelect, } from "./connectorRoutes.js";
|
|
4
|
+
export { handleListQiRuns, handleGetQiRun } from "./uiRoutes.js";
|
|
5
|
+
export { QI_HANDOFF_ROUTE_GROUP, createHandleQiHandoff, handleQiHandoff, type QiHandoffRouteOptions, type QiHandoffSuccessBody, } from "./handoffRoutes.js";
|
|
6
|
+
export { qiHandoffErrorBody, type QiHandoffErrorBody, type QiHandoffErrorCode, } from "./handoffErrors.js";
|
|
7
|
+
export { QI_RUN_EXECUTION_ROUTE_GROUP, handleStartQiRun, handleCancelQiRun } from "./runRoutes.js";
|
|
8
|
+
export { qiRunRegistry, QiRunRegistry } from "./runRegistry.js";
|
|
9
|
+
export { executeQiRun, QiIngestionError, QiGenerationError } from "./runExecution.js";
|
|
10
|
+
export { applyReviewDecision, appendEditAudit, loadRunReviewState, runReviewStateOf, candidateReviewStateOf, type QiReviewAction, type QiAuditAction, type QiReviewStateArtifact, } from "./reviewStore.js";
|
|
11
|
+
export { QI_REVIEW_ROUTE_GROUP, handleQiReview } from "./reviewRoutes.js";
|
|
12
|
+
export { QI_EXPORT_ROUTE_GROUP, handleQiExport } from "./exportRoutes.js";
|
|
13
|
+
export { QI_EDIT_ROUTE_GROUP, handleQiEditCandidate } from "./editRoutes.js";
|
|
14
|
+
export { QI_RETENTION_ROUTE_GROUP, handleQiDeleteRun } from "./retentionRoutes.js";
|
|
15
|
+
export { QI_TRACEABILITY_ROUTE_GROUP, handleQiTraceabilityExport } from "./traceabilityRoutes.js";
|
|
16
|
+
export { QI_RECHECK_ROUTE_GROUP, handleQiReCheck, handleQiRegenerateStale, } from "./reCheckRoutes.js";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,gCAAgC,EAChC,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,mCAAmC,EACnC,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtF,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,qBAAqB,GAC3B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAElG,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,uBAAuB,GACxB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Public barrel for the keiko-server Quality Intelligence connector route group
|
|
2
|
+
// (Epic #270, Issue #278).
|
|
3
|
+
//
|
|
4
|
+
// Re-exports the additive connector route handlers, the authorisation predicates,
|
|
5
|
+
// and the safe-error helpers so the server route registrar can mount them as one
|
|
6
|
+
// cohesive group. The route group is DISABLED BY DEFAULT — every connector
|
|
7
|
+
// authorisation predicate returns `false` unless explicit config flips it.
|
|
8
|
+
//
|
|
9
|
+
// Nothing in this barrel performs IO or imports a provider SDK; the runtime
|
|
10
|
+
// behaviour lives in the existing keiko-server route plumbing.
|
|
11
|
+
export { isFigmaConnectorAuthorized, isJiraConnectorAuthorized, summariseQiConnectorCapabilities, } from "./connectorAuthorization.js";
|
|
12
|
+
export { payloadContainsForbiddenSecretShape, qiConnectorErrorBody, } from "./connectorErrors.js";
|
|
13
|
+
export { handleQiCapabilities, handleQiDryRunFigma, handleQiDryRunJira, handleQiSourceSelect, } from "./connectorRoutes.js";
|
|
14
|
+
// Issue #280 — read-only UI routes for the Quality Intelligence panel.
|
|
15
|
+
export { handleListQiRuns, handleGetQiRun } from "./uiRoutes.js";
|
|
16
|
+
// Issue #281 — Conversation Center → QI workflow handoff route group.
|
|
17
|
+
export { QI_HANDOFF_ROUTE_GROUP, createHandleQiHandoff, handleQiHandoff, } from "./handoffRoutes.js";
|
|
18
|
+
export { qiHandoffErrorBody, } from "./handoffErrors.js";
|
|
19
|
+
// Issue #273/#280 — QI run execution (start + cancel) route group + in-flight registry.
|
|
20
|
+
export { QI_RUN_EXECUTION_ROUTE_GROUP, handleStartQiRun, handleCancelQiRun } from "./runRoutes.js";
|
|
21
|
+
export { qiRunRegistry, QiRunRegistry } from "./runRegistry.js";
|
|
22
|
+
export { executeQiRun, QiIngestionError, QiGenerationError } from "./runExecution.js";
|
|
23
|
+
// Issue #282 — review-state companion store (read + mutation seams).
|
|
24
|
+
export { applyReviewDecision, appendEditAudit, loadRunReviewState, runReviewStateOf, candidateReviewStateOf, } from "./reviewStore.js";
|
|
25
|
+
// Issue #282 — review-action route group.
|
|
26
|
+
export { QI_REVIEW_ROUTE_GROUP, handleQiReview } from "./reviewRoutes.js";
|
|
27
|
+
// Issue #283 — export route group (local serialise + TMS dry-run preview).
|
|
28
|
+
export { QI_EXPORT_ROUTE_GROUP, handleQiExport } from "./exportRoutes.js";
|
|
29
|
+
// Issue #726 (Epic #712) — inline-edit route group.
|
|
30
|
+
export { QI_EDIT_ROUTE_GROUP, handleQiEditCandidate } from "./editRoutes.js";
|
|
31
|
+
// Issue #282 follow-up — run-deletion control route group (DELETE /runs/:id, ADR-0023 D8).
|
|
32
|
+
export { QI_RETENTION_ROUTE_GROUP, handleQiDeleteRun } from "./retentionRoutes.js";
|
|
33
|
+
// Issue #740 (Epic #734) — requirement↔test traceability matrix export route group.
|
|
34
|
+
export { QI_TRACEABILITY_ROUTE_GROUP, handleQiTraceabilityExport } from "./traceabilityRoutes.js";
|
|
35
|
+
// Issue #743 (Epic #735) — drift re-check + targeted regeneration route group.
|
|
36
|
+
export { QI_RECHECK_ROUTE_GROUP, handleQiReCheck, handleQiRegenerateStale, } from "./reCheckRoutes.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ChatMessage } from "@oscharko-dev/keiko-model-gateway";
|
|
2
|
+
import type { TestQualityJudgeVerdict } from "@oscharko-dev/keiko-contracts";
|
|
3
|
+
import type { UiHandlerDeps } from "../deps.js";
|
|
4
|
+
export declare class QiJudgeError extends Error {
|
|
5
|
+
readonly code: string;
|
|
6
|
+
constructor(code: string, message: string);
|
|
7
|
+
}
|
|
8
|
+
interface JudgeSourceContext {
|
|
9
|
+
readonly atomId: string;
|
|
10
|
+
readonly text: string;
|
|
11
|
+
}
|
|
12
|
+
interface JudgePromptInput {
|
|
13
|
+
readonly candidateText: string;
|
|
14
|
+
readonly sourceContext: readonly JudgeSourceContext[];
|
|
15
|
+
}
|
|
16
|
+
export declare function scrubCandidateText(text: string): string;
|
|
17
|
+
export declare function buildJudgePrompt(candidateText: string, sourceContext?: readonly JudgeSourceContext[]): readonly ChatMessage[];
|
|
18
|
+
export declare function parseJudgeVerdict(rawText: string): TestQualityJudgeVerdict;
|
|
19
|
+
export interface QiJudgePort {
|
|
20
|
+
readonly judge: (input: JudgePromptInput, signal?: AbortSignal) => Promise<TestQualityJudgeVerdict & {
|
|
21
|
+
readonly gatewayCallCount: number;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build a judge port bound to one model id. Applies the qi:judge-logic capability gate
|
|
26
|
+
* (chat model with text capability). Gateway-only; no direct provider calls.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createQiJudgePort(deps: UiHandlerDeps, modelId: string): QiJudgePort;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=judgePort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"judgePort.d.ts","sourceRoot":"","sources":["../../src/qualityIntelligence/judgePort.ts"],"names":[],"mappings":"AAUA,OAAO,EAKL,KAAK,WAAW,EAGjB,MAAM,mCAAmC,CAAC;AAK3C,OAAO,KAAK,EAEV,uBAAuB,EAExB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,qBAAa,YAAa,SAAQ,KAAK;IACrC,SAAgB,IAAI,EAAE,MAAM,CAAC;gBACjB,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAK1C;AAQD,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,gBAAgB;IACxB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACvD;AAgCD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASvD;AAyBD,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,MAAM,EACrB,aAAa,GAAE,SAAS,kBAAkB,EAAO,GAChD,SAAS,WAAW,EAAE,CAsBxB;AAmKD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB,CAW1E;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,CACd,KAAK,EAAE,gBAAgB,EACvB,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,uBAAuB,GAAG;QAAE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,CAqDnF"}
|