@jagilber-org/index-server 1.19.1
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/CHANGELOG.md +1218 -0
- package/CODE_OF_CONDUCT.md +49 -0
- package/CONTRIBUTING.md +75 -0
- package/LICENSE +21 -0
- package/README.md +523 -0
- package/SECURITY.md +50 -0
- package/dist/config/configUtils.d.ts +11 -0
- package/dist/config/configUtils.js +87 -0
- package/dist/config/dashboardConfig.d.ts +45 -0
- package/dist/config/dashboardConfig.js +63 -0
- package/dist/config/defaultValues.d.ts +61 -0
- package/dist/config/defaultValues.js +70 -0
- package/dist/config/dirConstants.d.ts +17 -0
- package/dist/config/dirConstants.js +28 -0
- package/dist/config/featureConfig.d.ts +61 -0
- package/dist/config/featureConfig.js +121 -0
- package/dist/config/runtimeConfig.d.ts +145 -0
- package/dist/config/runtimeConfig.js +334 -0
- package/dist/config/serverConfig.d.ts +90 -0
- package/dist/config/serverConfig.js +164 -0
- package/dist/dashboard/analytics/AnalyticsEngine.d.ts +142 -0
- package/dist/dashboard/analytics/AnalyticsEngine.js +373 -0
- package/dist/dashboard/analytics/BusinessIntelligence.d.ts +187 -0
- package/dist/dashboard/analytics/BusinessIntelligence.js +594 -0
- package/dist/dashboard/client/admin.html +2150 -0
- package/dist/dashboard/client/chunks/mermaid-layout-elk.esm.min/chunk-SP2CHFBE.mjs +1 -0
- package/dist/dashboard/client/chunks/mermaid-layout-elk.esm.min/render-T6MDALS3.mjs +27 -0
- package/dist/dashboard/client/css/admin.css +1466 -0
- package/dist/dashboard/client/js/admin.boot.js +359 -0
- package/dist/dashboard/client/js/admin.config.js +196 -0
- package/dist/dashboard/client/js/admin.embeddings.js +425 -0
- package/dist/dashboard/client/js/admin.graph.js +583 -0
- package/dist/dashboard/client/js/admin.instances.js +120 -0
- package/dist/dashboard/client/js/admin.instructions.js +552 -0
- package/dist/dashboard/client/js/admin.logs.js +113 -0
- package/dist/dashboard/client/js/admin.maintenance.js +354 -0
- package/dist/dashboard/client/js/admin.messaging.js +635 -0
- package/dist/dashboard/client/js/admin.monitor.js +181 -0
- package/dist/dashboard/client/js/admin.overview.js +221 -0
- package/dist/dashboard/client/js/admin.performance.js +61 -0
- package/dist/dashboard/client/js/admin.sessions.js +293 -0
- package/dist/dashboard/client/js/admin.sqlite.js +366 -0
- package/dist/dashboard/client/js/admin.utils.js +49 -0
- package/dist/dashboard/client/js/chart.umd.js +14 -0
- package/dist/dashboard/client/js/elk.bundled.js +6696 -0
- package/dist/dashboard/client/js/marked.umd.js +74 -0
- package/dist/dashboard/client/js/mermaid.min.js +3022 -0
- package/dist/dashboard/client/mermaid-layout-elk.esm.min.mjs +1 -0
- package/dist/dashboard/export/DataExporter.d.ts +169 -0
- package/dist/dashboard/export/DataExporter.js +737 -0
- package/dist/dashboard/export/exporters/csvExporter.d.ts +11 -0
- package/dist/dashboard/export/exporters/csvExporter.js +46 -0
- package/dist/dashboard/export/exporters/exportTypes.d.ts +89 -0
- package/dist/dashboard/export/exporters/exportTypes.js +5 -0
- package/dist/dashboard/export/exporters/jsonExporter.d.ts +7 -0
- package/dist/dashboard/export/exporters/jsonExporter.js +22 -0
- package/dist/dashboard/export/exporters/xmlExporter.d.ts +17 -0
- package/dist/dashboard/export/exporters/xmlExporter.js +175 -0
- package/dist/dashboard/integration/APIIntegration.d.ts +41 -0
- package/dist/dashboard/integration/APIIntegration.js +95 -0
- package/dist/dashboard/security/SecurityMonitor.d.ts +167 -0
- package/dist/dashboard/security/SecurityMonitor.js +559 -0
- package/dist/dashboard/server/AdminPanel.d.ts +183 -0
- package/dist/dashboard/server/AdminPanel.js +792 -0
- package/dist/dashboard/server/AdminPanelConfig.d.ts +42 -0
- package/dist/dashboard/server/AdminPanelConfig.js +80 -0
- package/dist/dashboard/server/AdminPanelState.d.ts +47 -0
- package/dist/dashboard/server/AdminPanelState.js +214 -0
- package/dist/dashboard/server/ApiRoutes.d.ts +17 -0
- package/dist/dashboard/server/ApiRoutes.js +149 -0
- package/dist/dashboard/server/DashboardServer.d.ts +49 -0
- package/dist/dashboard/server/DashboardServer.js +159 -0
- package/dist/dashboard/server/FileMetricsStorage.d.ts +49 -0
- package/dist/dashboard/server/FileMetricsStorage.js +195 -0
- package/dist/dashboard/server/HttpTransport.d.ts +23 -0
- package/dist/dashboard/server/HttpTransport.js +116 -0
- package/dist/dashboard/server/InstanceManager.d.ts +53 -0
- package/dist/dashboard/server/InstanceManager.js +284 -0
- package/dist/dashboard/server/KnowledgeStore.d.ts +35 -0
- package/dist/dashboard/server/KnowledgeStore.js +105 -0
- package/dist/dashboard/server/LeaderElection.d.ts +81 -0
- package/dist/dashboard/server/LeaderElection.js +268 -0
- package/dist/dashboard/server/MetricsCollector.d.ts +200 -0
- package/dist/dashboard/server/MetricsCollector.js +803 -0
- package/dist/dashboard/server/SessionPersistenceManager.d.ts +88 -0
- package/dist/dashboard/server/SessionPersistenceManager.js +457 -0
- package/dist/dashboard/server/ThinClient.d.ts +64 -0
- package/dist/dashboard/server/ThinClient.js +237 -0
- package/dist/dashboard/server/WebSocketManager.d.ts +161 -0
- package/dist/dashboard/server/WebSocketManager.js +463 -0
- package/dist/dashboard/server/httpLifecycle.d.ts +17 -0
- package/dist/dashboard/server/httpLifecycle.js +35 -0
- package/dist/dashboard/server/legacyDashboardHtml.d.ts +9 -0
- package/dist/dashboard/server/legacyDashboardHtml.js +618 -0
- package/dist/dashboard/server/legacyDashboardStyles.d.ts +5 -0
- package/dist/dashboard/server/legacyDashboardStyles.js +490 -0
- package/dist/dashboard/server/metricsAggregation.d.ts +252 -0
- package/dist/dashboard/server/metricsAggregation.js +206 -0
- package/dist/dashboard/server/metricsSerializer.d.ts +25 -0
- package/dist/dashboard/server/metricsSerializer.js +195 -0
- package/dist/dashboard/server/routes/admin.routes.d.ts +16 -0
- package/dist/dashboard/server/routes/admin.routes.js +596 -0
- package/dist/dashboard/server/routes/alerts.routes.d.ts +7 -0
- package/dist/dashboard/server/routes/alerts.routes.js +93 -0
- package/dist/dashboard/server/routes/api.feedback.routes.d.ts +73 -0
- package/dist/dashboard/server/routes/api.feedback.routes.js +171 -0
- package/dist/dashboard/server/routes/api.instructions.routes.d.ts +101 -0
- package/dist/dashboard/server/routes/api.instructions.routes.js +213 -0
- package/dist/dashboard/server/routes/api.usage.routes.d.ts +57 -0
- package/dist/dashboard/server/routes/api.usage.routes.js +374 -0
- package/dist/dashboard/server/routes/embeddings.routes.d.ts +6 -0
- package/dist/dashboard/server/routes/embeddings.routes.js +246 -0
- package/dist/dashboard/server/routes/graph.routes.d.ts +6 -0
- package/dist/dashboard/server/routes/graph.routes.js +280 -0
- package/dist/dashboard/server/routes/index.d.ts +38 -0
- package/dist/dashboard/server/routes/index.js +194 -0
- package/dist/dashboard/server/routes/instances.routes.d.ts +6 -0
- package/dist/dashboard/server/routes/instances.routes.js +35 -0
- package/dist/dashboard/server/routes/instructions.routes.d.ts +8 -0
- package/dist/dashboard/server/routes/instructions.routes.js +336 -0
- package/dist/dashboard/server/routes/knowledge.routes.d.ts +6 -0
- package/dist/dashboard/server/routes/knowledge.routes.js +82 -0
- package/dist/dashboard/server/routes/logs.routes.d.ts +6 -0
- package/dist/dashboard/server/routes/logs.routes.js +164 -0
- package/dist/dashboard/server/routes/messaging.routes.d.ts +16 -0
- package/dist/dashboard/server/routes/messaging.routes.js +293 -0
- package/dist/dashboard/server/routes/metrics.routes.d.ts +10 -0
- package/dist/dashboard/server/routes/metrics.routes.js +346 -0
- package/dist/dashboard/server/routes/scripts.routes.d.ts +9 -0
- package/dist/dashboard/server/routes/scripts.routes.js +84 -0
- package/dist/dashboard/server/routes/sqlite.routes.d.ts +9 -0
- package/dist/dashboard/server/routes/sqlite.routes.js +569 -0
- package/dist/dashboard/server/routes/status.routes.d.ts +7 -0
- package/dist/dashboard/server/routes/status.routes.js +183 -0
- package/dist/dashboard/server/routes/synthetic.routes.d.ts +7 -0
- package/dist/dashboard/server/routes/synthetic.routes.js +195 -0
- package/dist/dashboard/server/routes/tools.routes.d.ts +6 -0
- package/dist/dashboard/server/routes/tools.routes.js +46 -0
- package/dist/dashboard/server/routes/usage.routes.d.ts +6 -0
- package/dist/dashboard/server/routes/usage.routes.js +25 -0
- package/dist/dashboard/server/wsInit.d.ts +16 -0
- package/dist/dashboard/server/wsInit.js +35 -0
- package/dist/externalClientLib.d.ts +1 -0
- package/dist/externalClientLib.js +2 -0
- package/dist/minimal/index.d.ts +1 -0
- package/dist/minimal/index.js +140 -0
- package/dist/models/SessionPersistence.d.ts +115 -0
- package/dist/models/SessionPersistence.js +66 -0
- package/dist/models/instruction.d.ts +45 -0
- package/dist/models/instruction.js +2 -0
- package/dist/perf/benchmark.d.ts +1 -0
- package/dist/perf/benchmark.js +50 -0
- package/dist/portableClientWrapper.d.ts +1 -0
- package/dist/portableClientWrapper.js +2 -0
- package/dist/schemas/index.d.ts +128 -0
- package/dist/schemas/index.js +371 -0
- package/dist/scripts/runPerformanceBaseline.d.ts +1 -0
- package/dist/scripts/runPerformanceBaseline.js +17 -0
- package/dist/server/handshakeManager.d.ts +25 -0
- package/dist/server/handshakeManager.js +472 -0
- package/dist/server/index-server.d.ts +56 -0
- package/dist/server/index-server.js +822 -0
- package/dist/server/registry.d.ts +44 -0
- package/dist/server/registry.js +236 -0
- package/dist/server/sdkServer.d.ts +8 -0
- package/dist/server/sdkServer.js +299 -0
- package/dist/server/shutdownGuard.d.ts +41 -0
- package/dist/server/shutdownGuard.js +52 -0
- package/dist/server/thin-client.d.ts +22 -0
- package/dist/server/thin-client.js +111 -0
- package/dist/server/transport.d.ts +41 -0
- package/dist/server/transport.js +312 -0
- package/dist/server/transportFactory.d.ts +21 -0
- package/dist/server/transportFactory.js +429 -0
- package/dist/services/atomicFs.d.ts +22 -0
- package/dist/services/atomicFs.js +103 -0
- package/dist/services/auditLog.d.ts +38 -0
- package/dist/services/auditLog.js +142 -0
- package/dist/services/autoBackup.d.ts +14 -0
- package/dist/services/autoBackup.js +171 -0
- package/dist/services/autoSplit.d.ts +32 -0
- package/dist/services/autoSplit.js +113 -0
- package/dist/services/backupZip.d.ts +25 -0
- package/dist/services/backupZip.js +110 -0
- package/dist/services/bootstrapGating.d.ts +123 -0
- package/dist/services/bootstrapGating.js +221 -0
- package/dist/services/canonical.d.ts +23 -0
- package/dist/services/canonical.js +65 -0
- package/dist/services/categoryRules.d.ts +7 -0
- package/dist/services/categoryRules.js +37 -0
- package/dist/services/classificationService.d.ts +42 -0
- package/dist/services/classificationService.js +168 -0
- package/dist/services/embeddingService.d.ts +62 -0
- package/dist/services/embeddingService.js +259 -0
- package/dist/services/errors.d.ts +22 -0
- package/dist/services/errors.js +31 -0
- package/dist/services/featureFlags.d.ts +25 -0
- package/dist/services/featureFlags.js +89 -0
- package/dist/services/features.d.ts +13 -0
- package/dist/services/features.js +35 -0
- package/dist/services/handlers/instructions.add.d.ts +1 -0
- package/dist/services/handlers/instructions.add.js +496 -0
- package/dist/services/handlers/instructions.groom.d.ts +1 -0
- package/dist/services/handlers/instructions.groom.js +523 -0
- package/dist/services/handlers/instructions.import.d.ts +1 -0
- package/dist/services/handlers/instructions.import.js +173 -0
- package/dist/services/handlers/instructions.patch.d.ts +1 -0
- package/dist/services/handlers/instructions.patch.js +167 -0
- package/dist/services/handlers/instructions.query.d.ts +163 -0
- package/dist/services/handlers/instructions.query.js +522 -0
- package/dist/services/handlers/instructions.reload.d.ts +1 -0
- package/dist/services/handlers/instructions.reload.js +13 -0
- package/dist/services/handlers/instructions.remove.d.ts +1 -0
- package/dist/services/handlers/instructions.remove.js +118 -0
- package/dist/services/handlers/instructions.shared.d.ts +31 -0
- package/dist/services/handlers/instructions.shared.js +124 -0
- package/dist/services/handlers.activation.d.ts +1 -0
- package/dist/services/handlers.activation.js +203 -0
- package/dist/services/handlers.bootstrap.d.ts +1 -0
- package/dist/services/handlers.bootstrap.js +38 -0
- package/dist/services/handlers.dashboardConfig.d.ts +34 -0
- package/dist/services/handlers.dashboardConfig.js +108 -0
- package/dist/services/handlers.diagnostics.d.ts +1 -0
- package/dist/services/handlers.diagnostics.js +64 -0
- package/dist/services/handlers.feedback.d.ts +15 -0
- package/dist/services/handlers.feedback.js +378 -0
- package/dist/services/handlers.gates.d.ts +1 -0
- package/dist/services/handlers.gates.js +46 -0
- package/dist/services/handlers.graph.d.ts +53 -0
- package/dist/services/handlers.graph.js +231 -0
- package/dist/services/handlers.help.d.ts +1 -0
- package/dist/services/handlers.help.js +119 -0
- package/dist/services/handlers.instructionSchema.d.ts +1 -0
- package/dist/services/handlers.instructionSchema.js +227 -0
- package/dist/services/handlers.instructions.d.ts +8 -0
- package/dist/services/handlers.instructions.js +14 -0
- package/dist/services/handlers.instructionsDiagnostics.d.ts +1 -0
- package/dist/services/handlers.instructionsDiagnostics.js +14 -0
- package/dist/services/handlers.integrity.d.ts +1 -0
- package/dist/services/handlers.integrity.js +35 -0
- package/dist/services/handlers.manifest.d.ts +1 -0
- package/dist/services/handlers.manifest.js +24 -0
- package/dist/services/handlers.messaging.d.ts +12 -0
- package/dist/services/handlers.messaging.js +203 -0
- package/dist/services/handlers.metrics.d.ts +1 -0
- package/dist/services/handlers.metrics.js +43 -0
- package/dist/services/handlers.promote.d.ts +1 -0
- package/dist/services/handlers.promote.js +306 -0
- package/dist/services/handlers.prompt.d.ts +1 -0
- package/dist/services/handlers.prompt.js +7 -0
- package/dist/services/handlers.search.d.ts +69 -0
- package/dist/services/handlers.search.js +645 -0
- package/dist/services/handlers.testPrimitive.d.ts +1 -0
- package/dist/services/handlers.testPrimitive.js +5 -0
- package/dist/services/handlers.trace.d.ts +1 -0
- package/dist/services/handlers.trace.js +31 -0
- package/dist/services/handlers.usage.d.ts +1 -0
- package/dist/services/handlers.usage.js +11 -0
- package/dist/services/hotScore.d.ts +137 -0
- package/dist/services/hotScore.js +244 -0
- package/dist/services/indexContext.d.ts +117 -0
- package/dist/services/indexContext.js +968 -0
- package/dist/services/indexLoader.d.ts +44 -0
- package/dist/services/indexLoader.js +921 -0
- package/dist/services/indexRepository.d.ts +32 -0
- package/dist/services/indexRepository.js +71 -0
- package/dist/services/indexingService.d.ts +1 -0
- package/dist/services/indexingService.js +2 -0
- package/dist/services/instructions.dispatcher.d.ts +1 -0
- package/dist/services/instructions.dispatcher.js +231 -0
- package/dist/services/logPrefix.d.ts +1 -0
- package/dist/services/logPrefix.js +30 -0
- package/dist/services/logger.d.ts +52 -0
- package/dist/services/logger.js +268 -0
- package/dist/services/manifestManager.d.ts +82 -0
- package/dist/services/manifestManager.js +200 -0
- package/dist/services/messaging/agentMailbox.d.ts +60 -0
- package/dist/services/messaging/agentMailbox.js +353 -0
- package/dist/services/messaging/messagingPersistence.d.ts +20 -0
- package/dist/services/messaging/messagingPersistence.js +111 -0
- package/dist/services/messaging/messagingTypes.d.ts +150 -0
- package/dist/services/messaging/messagingTypes.js +66 -0
- package/dist/services/ownershipService.d.ts +1 -0
- package/dist/services/ownershipService.js +38 -0
- package/dist/services/performanceBaseline.d.ts +19 -0
- package/dist/services/performanceBaseline.js +210 -0
- package/dist/services/preflight.d.ts +12 -0
- package/dist/services/preflight.js +79 -0
- package/dist/services/promptReviewService.d.ts +44 -0
- package/dist/services/promptReviewService.js +101 -0
- package/dist/services/responseEnvelope.d.ts +6 -0
- package/dist/services/responseEnvelope.js +25 -0
- package/dist/services/seedBootstrap.d.ts +34 -0
- package/dist/services/seedBootstrap.js +427 -0
- package/dist/services/storage/factory.d.ts +17 -0
- package/dist/services/storage/factory.js +35 -0
- package/dist/services/storage/hashUtils.d.ts +11 -0
- package/dist/services/storage/hashUtils.js +35 -0
- package/dist/services/storage/index.d.ts +12 -0
- package/dist/services/storage/index.js +18 -0
- package/dist/services/storage/jsonFileStore.d.ts +32 -0
- package/dist/services/storage/jsonFileStore.js +241 -0
- package/dist/services/storage/migrationEngine.d.ts +35 -0
- package/dist/services/storage/migrationEngine.js +93 -0
- package/dist/services/storage/sqliteMessageStore.d.ts +53 -0
- package/dist/services/storage/sqliteMessageStore.js +146 -0
- package/dist/services/storage/sqliteSchema.d.ts +12 -0
- package/dist/services/storage/sqliteSchema.js +122 -0
- package/dist/services/storage/sqliteStore.d.ts +41 -0
- package/dist/services/storage/sqliteStore.js +339 -0
- package/dist/services/storage/sqliteUsageStore.d.ts +35 -0
- package/dist/services/storage/sqliteUsageStore.js +94 -0
- package/dist/services/storage/types.d.ts +171 -0
- package/dist/services/storage/types.js +12 -0
- package/dist/services/toolHandlers.d.ts +23 -0
- package/dist/services/toolHandlers.js +50 -0
- package/dist/services/toolRegistry.d.ts +20 -0
- package/dist/services/toolRegistry.js +490 -0
- package/dist/services/toolRegistry.zod.d.ts +10 -0
- package/dist/services/toolRegistry.zod.js +323 -0
- package/dist/services/tracing.d.ts +26 -0
- package/dist/services/tracing.js +260 -0
- package/dist/services/usageBuckets.d.ts +161 -0
- package/dist/services/usageBuckets.js +364 -0
- package/dist/services/validationService.d.ts +38 -0
- package/dist/services/validationService.js +125 -0
- package/dist/utils/BufferRing.d.ts +203 -0
- package/dist/utils/BufferRing.js +551 -0
- package/dist/utils/BufferRingExamples.d.ts +55 -0
- package/dist/utils/BufferRingExamples.js +188 -0
- package/dist/utils/envUtils.d.ts +42 -0
- package/dist/utils/envUtils.js +80 -0
- package/dist/utils/memoryMonitor.d.ts +83 -0
- package/dist/utils/memoryMonitor.js +275 -0
- package/dist/versioning/schemaVersion.d.ts +6 -0
- package/dist/versioning/schemaVersion.js +93 -0
- package/package.json +134 -0
- package/schemas/README.md +13 -0
- package/schemas/feedback-entry.schema.json +27 -0
- package/schemas/graph-export-v2.schema.json +60 -0
- package/schemas/index-server.code-schema.json +38477 -0
- package/schemas/instruction.schema.json +262 -0
- package/schemas/json-schema/SessionPersistence-persisted-admin-session.schema.json +54 -0
- package/schemas/json-schema/SessionPersistence-persisted-session-history-entry.schema.json +51 -0
- package/schemas/json-schema/SessionPersistence-persisted-web-socket-connection.schema.json +54 -0
- package/schemas/json-schema/SessionPersistence-session-persistence-config.schema.json +110 -0
- package/schemas/json-schema/SessionPersistence-session-persistence-data.schema.json +229 -0
- package/schemas/json-schema/SessionPersistence-session-persistence-manifest.schema.json +109 -0
- package/schemas/json-schema/SessionPersistence-session-persistence-metadata.schema.json +55 -0
- package/schemas/json-schema/instruction-audience-scope.schema.json +14 -0
- package/schemas/json-schema/instruction-content-type.schema.json +17 -0
- package/schemas/json-schema/instruction-instruction-entry.schema.json +206 -0
- package/schemas/json-schema/instruction-requirement-level.schema.json +16 -0
- package/schemas/manifest.json +78 -0
- package/schemas/manifest.schema.json +33 -0
- package/schemas/usage-batch.schema.json +16 -0
- package/schemas/usage-buckets.schema.json +30 -0
- package/schemas/usage-event.schema.json +17 -0
- package/scripts/copy-dashboard-assets.mjs +170 -0
- package/scripts/setup-hooks.cjs +28 -0
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// JSON Schemas for tool response contracts. These are used in tests to lock interfaces.
|
|
3
|
+
// Increment version in docs/tools.md when changing any stable schema.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.schemas = exports.instructionEntry = void 0;
|
|
6
|
+
exports.instructionEntry = {
|
|
7
|
+
type: 'object',
|
|
8
|
+
additionalProperties: false,
|
|
9
|
+
required: [
|
|
10
|
+
'id', 'title', 'body', 'priority', 'audience', 'requirement', 'categories', 'sourceHash', 'schemaVersion', 'createdAt', 'updatedAt',
|
|
11
|
+
'version', 'status', 'owner', 'priorityTier', 'classification', 'lastReviewedAt', 'nextReviewDue', 'changeLog', 'semanticSummary'
|
|
12
|
+
],
|
|
13
|
+
properties: {
|
|
14
|
+
id: { type: 'string', minLength: 1 },
|
|
15
|
+
title: { type: 'string' },
|
|
16
|
+
body: { type: 'string' },
|
|
17
|
+
rationale: { type: 'string' },
|
|
18
|
+
priority: { type: 'number' },
|
|
19
|
+
audience: { enum: ['individual', 'group', 'all'] },
|
|
20
|
+
requirement: { enum: ['mandatory', 'critical', 'recommended', 'optional', 'deprecated'] },
|
|
21
|
+
categories: { type: 'array', items: { type: 'string' } },
|
|
22
|
+
sourceHash: { type: 'string' },
|
|
23
|
+
schemaVersion: { type: 'string' },
|
|
24
|
+
deprecatedBy: { type: 'string' },
|
|
25
|
+
createdAt: { type: 'string' },
|
|
26
|
+
updatedAt: { type: 'string' },
|
|
27
|
+
usageCount: { type: 'number' },
|
|
28
|
+
firstSeenTs: { type: 'string' },
|
|
29
|
+
lastUsedAt: { type: 'string' },
|
|
30
|
+
riskScore: { type: 'number' },
|
|
31
|
+
workspaceId: { type: 'string' },
|
|
32
|
+
userId: { type: 'string' },
|
|
33
|
+
teamIds: { type: 'array', items: { type: 'string' } },
|
|
34
|
+
version: { type: 'string' },
|
|
35
|
+
status: { enum: ['draft', 'review', 'approved', 'deprecated'] },
|
|
36
|
+
owner: { type: 'string' },
|
|
37
|
+
priorityTier: { enum: ['P1', 'P2', 'P3', 'P4'] },
|
|
38
|
+
classification: { enum: ['public', 'internal', 'restricted'] },
|
|
39
|
+
lastReviewedAt: { type: 'string' },
|
|
40
|
+
nextReviewDue: { type: 'string' },
|
|
41
|
+
changeLog: { type: 'array', items: { type: 'object', required: ['version', 'changedAt', 'summary'], additionalProperties: false, properties: { version: { type: 'string' }, changedAt: { type: 'string' }, summary: { type: 'string' } } } },
|
|
42
|
+
supersedes: { type: 'string' },
|
|
43
|
+
semanticSummary: { type: 'string' },
|
|
44
|
+
createdByAgent: { type: 'string' },
|
|
45
|
+
sourceWorkspace: { type: 'string' }
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
// (listLike schema removed after dispatcher consolidation of read-only instruction methods)
|
|
49
|
+
// Using unknown for schema values to avoid any and preserve flexibility
|
|
50
|
+
exports.schemas = {
|
|
51
|
+
'health_check': {
|
|
52
|
+
type: 'object', additionalProperties: false,
|
|
53
|
+
required: ['status', 'timestamp', 'version'],
|
|
54
|
+
properties: {
|
|
55
|
+
status: { const: 'ok' },
|
|
56
|
+
timestamp: { type: 'string' },
|
|
57
|
+
version: { type: 'string' }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
'index_dispatch': {
|
|
61
|
+
// Dispatcher returns varying shapes; keep loose but assert required action echo when capabilities.
|
|
62
|
+
anyOf: [
|
|
63
|
+
{ type: 'object', required: ['supportedActions', 'mutationEnabled', 'version'], additionalProperties: true, properties: {
|
|
64
|
+
version: { type: 'string' },
|
|
65
|
+
supportedActions: { type: 'array', items: { type: 'string' } },
|
|
66
|
+
mutationEnabled: { type: 'boolean' }
|
|
67
|
+
} },
|
|
68
|
+
{ type: 'object', required: ['results'], additionalProperties: true, properties: { results: { type: 'array' } } },
|
|
69
|
+
{ type: 'object', required: ['hash'], additionalProperties: true, properties: { hash: { type: 'string' } } },
|
|
70
|
+
{ type: 'object', required: ['error'], additionalProperties: true, properties: { error: { type: 'string' } } }
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
'index_import': {
|
|
74
|
+
anyOf: [
|
|
75
|
+
{ type: 'object', required: ['error'], properties: { error: { type: 'string' } }, additionalProperties: true },
|
|
76
|
+
{ type: 'object', required: ['hash', 'imported', 'skipped', 'overwritten', 'errors', 'total'], additionalProperties: false, properties: {
|
|
77
|
+
hash: { type: 'string' }, imported: { type: 'number' }, skipped: { type: 'number' }, overwritten: { type: 'number' }, total: { type: 'number' }, errors: { type: 'array', items: { type: 'object', required: ['id', 'error'], properties: { id: { type: 'string' }, error: { type: 'string' } }, additionalProperties: false } }
|
|
78
|
+
} }
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
'index_repair': { type: 'object', required: ['repaired', 'updated'], additionalProperties: false, properties: { repaired: { type: 'number' }, updated: { type: 'array', items: { type: 'string' } } } },
|
|
82
|
+
'prompt_review': {
|
|
83
|
+
anyOf: [
|
|
84
|
+
{ type: 'object', required: ['truncated', 'message', 'max'], additionalProperties: false, properties: {
|
|
85
|
+
truncated: { const: true },
|
|
86
|
+
message: { type: 'string' },
|
|
87
|
+
max: { type: 'number' }
|
|
88
|
+
} },
|
|
89
|
+
{ type: 'object', required: ['issues', 'summary', 'length'], additionalProperties: false, properties: {
|
|
90
|
+
issues: { type: 'array', items: { type: 'object' } },
|
|
91
|
+
summary: { type: 'object' },
|
|
92
|
+
length: { type: 'number' }
|
|
93
|
+
} }
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
'integrity_verify': {
|
|
97
|
+
type: 'object', additionalProperties: false,
|
|
98
|
+
required: ['hash', 'count', 'issues', 'issueCount'],
|
|
99
|
+
properties: {
|
|
100
|
+
hash: { type: 'string' },
|
|
101
|
+
count: { type: 'number' },
|
|
102
|
+
issues: { type: 'array', items: { type: 'object', required: ['id', 'expected', 'actual'], properties: { id: { type: 'string' }, expected: { type: 'string' }, actual: { type: 'string' } }, additionalProperties: false } },
|
|
103
|
+
issueCount: { type: 'number' }
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
'usage_track': {
|
|
107
|
+
anyOf: [
|
|
108
|
+
{ type: 'object', required: ['error'], properties: { error: { type: 'string' } }, additionalProperties: true },
|
|
109
|
+
{ type: 'object', required: ['notFound'], properties: { notFound: { const: true } }, additionalProperties: true },
|
|
110
|
+
{ type: 'object', required: ['featureDisabled'], properties: { featureDisabled: { const: true } }, additionalProperties: true },
|
|
111
|
+
{ type: 'object', required: ['id', 'usageCount', 'lastUsedAt'], additionalProperties: false, properties: {
|
|
112
|
+
id: { type: 'string' }, usageCount: { type: 'number' }, firstSeenTs: { type: 'string' }, lastUsedAt: { type: 'string' }
|
|
113
|
+
} }
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
'usage_hotset': {
|
|
117
|
+
type: 'object', additionalProperties: false,
|
|
118
|
+
required: ['hash', 'count', 'limit', 'items'],
|
|
119
|
+
properties: {
|
|
120
|
+
hash: { type: 'string' },
|
|
121
|
+
count: { type: 'number' },
|
|
122
|
+
'feature_status': {
|
|
123
|
+
type: 'object',
|
|
124
|
+
properties: {},
|
|
125
|
+
additionalProperties: false
|
|
126
|
+
},
|
|
127
|
+
limit: { type: 'number' },
|
|
128
|
+
items: { type: 'array', items: { type: 'object', required: ['id', 'usageCount'], additionalProperties: false, properties: {
|
|
129
|
+
id: { type: 'string' }, usageCount: { type: 'number' }, lastUsedAt: { type: 'string' }
|
|
130
|
+
} } }
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
'metrics_snapshot': {
|
|
134
|
+
type: 'object', additionalProperties: false,
|
|
135
|
+
required: ['generatedAt', 'methods'],
|
|
136
|
+
properties: {
|
|
137
|
+
generatedAt: { type: 'string' },
|
|
138
|
+
methods: { type: 'array', items: { type: 'object', required: ['method', 'count', 'avgMs', 'maxMs'], additionalProperties: false, properties: {
|
|
139
|
+
method: { type: 'string' }, count: { type: 'number' }, avgMs: { type: 'number' }, maxMs: { type: 'number' }
|
|
140
|
+
} } },
|
|
141
|
+
features: { type: 'object', additionalProperties: true }
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
'index_governanceHash': {
|
|
145
|
+
type: 'object', additionalProperties: false,
|
|
146
|
+
required: ['count', 'governanceHash', 'items'],
|
|
147
|
+
properties: {
|
|
148
|
+
count: { type: 'number' },
|
|
149
|
+
governanceHash: { type: 'string' },
|
|
150
|
+
items: { type: 'array', items: { type: 'object', required: ['id', 'title', 'version', 'owner', 'priorityTier', 'nextReviewDue', 'semanticSummarySha256', 'changeLogLength'], additionalProperties: false, properties: {
|
|
151
|
+
id: { type: 'string' }, title: { type: 'string' }, version: { type: 'string' }, owner: { type: 'string' }, priorityTier: { type: 'string' }, nextReviewDue: { type: 'string' }, semanticSummarySha256: { type: 'string' }, changeLogLength: { type: 'number' }
|
|
152
|
+
} } }
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
'index_health': {
|
|
156
|
+
anyOf: [
|
|
157
|
+
{ type: 'object', required: ['snapshot', 'hash', 'count'], additionalProperties: true, properties: { snapshot: { const: 'missing' }, hash: { type: 'string' }, count: { type: 'number' } } },
|
|
158
|
+
{ type: 'object', required: ['snapshot', 'hash', 'count', 'missing', 'changed', 'extra', 'drift'], additionalProperties: true, properties: {
|
|
159
|
+
snapshot: { const: 'present' }, hash: { type: 'string' }, count: { type: 'number' },
|
|
160
|
+
missing: { type: 'array', items: { type: 'string' } },
|
|
161
|
+
changed: { type: 'array', items: { type: 'string' } },
|
|
162
|
+
extra: { type: 'array', items: { type: 'string' } },
|
|
163
|
+
drift: { type: 'number' }
|
|
164
|
+
} },
|
|
165
|
+
{ type: 'object', required: ['snapshot', 'hash', 'error'], additionalProperties: true, properties: { snapshot: { const: 'error' }, hash: { type: 'string' }, error: { type: 'string' } } }
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
'gates_evaluate': {
|
|
169
|
+
anyOf: [
|
|
170
|
+
{ type: 'object', required: ['notConfigured'], properties: { notConfigured: { const: true } }, additionalProperties: true },
|
|
171
|
+
{ type: 'object', required: ['error'], properties: { error: { type: 'string' } }, additionalProperties: true },
|
|
172
|
+
{ type: 'object', required: ['generatedAt', 'results', 'summary'], additionalProperties: false, properties: {
|
|
173
|
+
generatedAt: { type: 'string' },
|
|
174
|
+
results: { type: 'array', items: { type: 'object', required: ['id', 'passed', 'count', 'op', 'value', 'severity'], additionalProperties: true, properties: {
|
|
175
|
+
id: { type: 'string' }, passed: { type: 'boolean' }, count: { type: 'number' }, op: { type: 'string' }, value: { type: 'number' }, severity: { type: 'string' }, description: { type: 'string' }
|
|
176
|
+
} } },
|
|
177
|
+
summary: { type: 'object', required: ['errors', 'warnings', 'total'], properties: { errors: { type: 'number' }, warnings: { type: 'number' }, total: { type: 'number' } }, additionalProperties: false }
|
|
178
|
+
} }
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
// Graph export (legacy v1 + enriched v2). Optional contract registration enabling future schema locking.
|
|
182
|
+
'graph_export': {
|
|
183
|
+
anyOf: [
|
|
184
|
+
{ type: 'object', required: ['meta', 'nodes', 'edges'], additionalProperties: true, properties: {
|
|
185
|
+
meta: { type: 'object', required: ['graphSchemaVersion', 'nodeCount', 'edgeCount'], additionalProperties: true, properties: { graphSchemaVersion: { const: 1 }, nodeCount: { type: 'number' }, edgeCount: { type: 'number' } } },
|
|
186
|
+
nodes: { type: 'array', items: { type: 'object', required: ['id'], additionalProperties: true, properties: { id: { type: 'string' } } } },
|
|
187
|
+
edges: { type: 'array', items: { type: 'object', required: ['from', 'to', 'type'], additionalProperties: true, properties: { from: { type: 'string' }, to: { type: 'string' }, type: { enum: ['primary', 'category'] } } } }
|
|
188
|
+
} },
|
|
189
|
+
{ type: 'object', required: ['meta', 'nodes', 'edges'], additionalProperties: true, properties: {
|
|
190
|
+
meta: { type: 'object', required: ['graphSchemaVersion', 'nodeCount', 'edgeCount'], additionalProperties: true, properties: { graphSchemaVersion: { const: 2 }, nodeCount: { type: 'number' }, edgeCount: { type: 'number' } } },
|
|
191
|
+
nodes: { type: 'array', items: { type: 'object', required: ['id'], additionalProperties: true, properties: { id: { type: 'string' }, nodeType: { enum: ['instruction', 'category'] }, categories: { type: 'array', items: { type: 'string' } }, primaryCategory: { type: 'string' }, usageCount: { type: 'number' } } } },
|
|
192
|
+
edges: { type: 'array', items: { type: 'object', required: ['from', 'to', 'type'], additionalProperties: true, properties: { from: { type: 'string' }, to: { type: 'string' }, type: { enum: ['primary', 'category', 'belongs'] } } } },
|
|
193
|
+
mermaid: { type: 'string' }, dot: { type: 'string' }
|
|
194
|
+
} }
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
'meta_tools': {
|
|
198
|
+
type: 'object', additionalProperties: true,
|
|
199
|
+
required: ['stable', 'dynamic', 'tools'],
|
|
200
|
+
properties: {
|
|
201
|
+
// Legacy flat list (includes disabled flag)
|
|
202
|
+
tools: { type: 'array', items: { type: 'object', required: ['method'], additionalProperties: true, properties: {
|
|
203
|
+
method: { type: 'string' }, stable: { type: 'boolean' }, mutation: { type: 'boolean' }, disabled: { type: 'boolean' }
|
|
204
|
+
} } },
|
|
205
|
+
stable: {
|
|
206
|
+
type: 'object', additionalProperties: false,
|
|
207
|
+
required: ['tools'],
|
|
208
|
+
properties: {
|
|
209
|
+
tools: { type: 'array', items: { type: 'object', required: ['method', 'stable', 'mutation'], additionalProperties: true, properties: {
|
|
210
|
+
method: { type: 'string' },
|
|
211
|
+
stable: { type: 'boolean' },
|
|
212
|
+
mutation: { type: 'boolean' }
|
|
213
|
+
} } }
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
dynamic: {
|
|
217
|
+
type: 'object', additionalProperties: true,
|
|
218
|
+
required: ['generatedAt', 'mutationEnabled', 'disabled'],
|
|
219
|
+
properties: {
|
|
220
|
+
generatedAt: { type: 'string' },
|
|
221
|
+
mutationEnabled: { type: 'boolean' },
|
|
222
|
+
disabled: { type: 'array', items: { type: 'object', required: ['method'], additionalProperties: false, properties: { method: { type: 'string' } } } }
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
// New MCP style registry (optional for now)
|
|
226
|
+
mcp: {
|
|
227
|
+
type: 'object', additionalProperties: true,
|
|
228
|
+
required: ['registryVersion', 'tools'],
|
|
229
|
+
properties: {
|
|
230
|
+
registryVersion: { type: 'string' },
|
|
231
|
+
tools: { type: 'array', items: { type: 'object', required: ['name', 'description', 'stable', 'mutation', 'inputSchema'], additionalProperties: false, properties: {
|
|
232
|
+
name: { type: 'string' },
|
|
233
|
+
description: { type: 'string' },
|
|
234
|
+
stable: { type: 'boolean' },
|
|
235
|
+
mutation: { type: 'boolean' },
|
|
236
|
+
inputSchema: { type: 'object' },
|
|
237
|
+
outputSchema: { type: 'object' }
|
|
238
|
+
} } }
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
'help_overview': {
|
|
244
|
+
type: 'object',
|
|
245
|
+
additionalProperties: true,
|
|
246
|
+
required: ['generatedAt', 'version', 'sections'],
|
|
247
|
+
properties: {
|
|
248
|
+
generatedAt: { type: 'string' },
|
|
249
|
+
version: { type: 'string' },
|
|
250
|
+
summary: { type: 'string' },
|
|
251
|
+
sections: { type: 'array', items: { type: 'object', required: ['id', 'title', 'content'], additionalProperties: true, properties: {
|
|
252
|
+
id: { type: 'string' },
|
|
253
|
+
title: { type: 'string' },
|
|
254
|
+
content: { type: 'string' },
|
|
255
|
+
bullets: { type: 'array', items: { type: 'string' } },
|
|
256
|
+
nextActions: { type: 'array', items: { type: 'string' } }
|
|
257
|
+
} } },
|
|
258
|
+
lifecycleModel: { type: 'object', additionalProperties: true, properties: {
|
|
259
|
+
tiers: { type: 'array', items: { type: 'object', required: ['tier', 'purpose'], additionalProperties: true, properties: { tier: { type: 'string' }, purpose: { type: 'string' } } } },
|
|
260
|
+
promotionChecklist: { type: 'array', items: { type: 'string' } }
|
|
261
|
+
} },
|
|
262
|
+
toolDiscovery: { type: 'object', additionalProperties: true, properties: {
|
|
263
|
+
primary: { type: 'array', items: { type: 'string' } },
|
|
264
|
+
diagnostics: { type: 'array', items: { type: 'string' } }
|
|
265
|
+
} }
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
'index_schema': {
|
|
269
|
+
type: 'object',
|
|
270
|
+
additionalProperties: false,
|
|
271
|
+
required: ['generatedAt', 'version', 'summary', 'schema', 'minimalExample', 'requiredFields', 'optionalFieldsCommon', 'promotionWorkflow', 'validationRules', 'nextSteps'],
|
|
272
|
+
properties: {
|
|
273
|
+
generatedAt: { type: 'string' },
|
|
274
|
+
version: { type: 'string' },
|
|
275
|
+
summary: { type: 'string' },
|
|
276
|
+
schema: { type: 'object', additionalProperties: true },
|
|
277
|
+
minimalExample: { type: 'object', additionalProperties: true },
|
|
278
|
+
requiredFields: { type: 'array', items: { type: 'string' } },
|
|
279
|
+
optionalFieldsCommon: { type: 'array', items: { type: 'string' } },
|
|
280
|
+
promotionWorkflow: { type: 'array', items: { type: 'object', required: ['stage', 'description', 'checklistItems'], additionalProperties: false, properties: {
|
|
281
|
+
stage: { type: 'string' },
|
|
282
|
+
description: { type: 'string' },
|
|
283
|
+
checklistItems: { type: 'array', items: { type: 'string' } }
|
|
284
|
+
} } },
|
|
285
|
+
validationRules: { type: 'array', items: { type: 'object', required: ['field', 'rule', 'constraint'], additionalProperties: false, properties: {
|
|
286
|
+
field: { type: 'string' },
|
|
287
|
+
rule: { type: 'string' },
|
|
288
|
+
constraint: { type: 'string' }
|
|
289
|
+
} } },
|
|
290
|
+
nextSteps: { type: 'array', items: { type: 'string' } }
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
'usage_flush': { type: 'object', required: ['flushed'], additionalProperties: false, properties: { flushed: { const: true } } },
|
|
294
|
+
'index_reload': { type: 'object', required: ['reloaded', 'hash', 'count'], additionalProperties: false, properties: { reloaded: { const: true }, hash: { type: 'string' }, count: { type: 'number' } } },
|
|
295
|
+
'index_remove': { type: 'object', required: ['removed', 'removedIds', 'missing', 'errorCount', 'errors'], additionalProperties: false, properties: {
|
|
296
|
+
removed: { type: 'number' },
|
|
297
|
+
removedIds: { type: 'array', items: { type: 'string' } },
|
|
298
|
+
missing: { type: 'array', items: { type: 'string' } },
|
|
299
|
+
errorCount: { type: 'number' },
|
|
300
|
+
errors: { type: 'array', items: { type: 'object', required: ['id', 'error'], additionalProperties: false, properties: { id: { type: 'string' }, error: { type: 'string' } } } }
|
|
301
|
+
} },
|
|
302
|
+
'index_enrich': { type: 'object', required: ['rewritten', 'updated', 'skipped'], additionalProperties: false, properties: {
|
|
303
|
+
rewritten: { type: 'number' },
|
|
304
|
+
updated: { type: 'array', items: { type: 'string' } },
|
|
305
|
+
skipped: { type: 'array', items: { type: 'string' } }
|
|
306
|
+
} },
|
|
307
|
+
'index_add': {
|
|
308
|
+
anyOf: [
|
|
309
|
+
{ type: 'object', required: ['error'], properties: { error: { type: 'string' }, id: { type: 'string' } }, additionalProperties: true },
|
|
310
|
+
{ type: 'object', required: ['id', 'hash', 'skipped', 'created', 'overwritten'], additionalProperties: false, properties: {
|
|
311
|
+
id: { type: 'string' }, hash: { type: 'string' }, skipped: { type: 'boolean' }, created: { type: 'boolean' }, overwritten: { type: 'boolean' }
|
|
312
|
+
} }
|
|
313
|
+
]
|
|
314
|
+
},
|
|
315
|
+
'index_groom': {
|
|
316
|
+
type: 'object', additionalProperties: false,
|
|
317
|
+
required: ['previousHash', 'hash', 'scanned', 'repairedHashes', 'normalizedCategories', 'deprecatedRemoved', 'duplicatesMerged', 'signalApplied', 'filesRewritten', 'purgedScopes', 'dryRun', 'notes'],
|
|
318
|
+
properties: {
|
|
319
|
+
previousHash: { type: 'string' },
|
|
320
|
+
hash: { type: 'string' },
|
|
321
|
+
scanned: { type: 'number' },
|
|
322
|
+
repairedHashes: { type: 'number' },
|
|
323
|
+
normalizedCategories: { type: 'number' },
|
|
324
|
+
deprecatedRemoved: { type: 'number' },
|
|
325
|
+
duplicatesMerged: { type: 'number' },
|
|
326
|
+
signalApplied: { type: 'number' },
|
|
327
|
+
filesRewritten: { type: 'number' },
|
|
328
|
+
purgedScopes: { type: 'number' },
|
|
329
|
+
migrated: { type: 'number' },
|
|
330
|
+
remappedCategories: { type: 'number' },
|
|
331
|
+
dryRun: { type: 'boolean' },
|
|
332
|
+
notes: { type: 'array', items: { type: 'string' } }
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
'index_search': {
|
|
336
|
+
type: 'object',
|
|
337
|
+
additionalProperties: false,
|
|
338
|
+
required: ['results', 'totalMatches', 'query', 'executionTimeMs'],
|
|
339
|
+
properties: {
|
|
340
|
+
results: {
|
|
341
|
+
type: 'array',
|
|
342
|
+
items: {
|
|
343
|
+
type: 'object',
|
|
344
|
+
additionalProperties: false,
|
|
345
|
+
required: ['instructionId', 'relevanceScore', 'matchedFields'],
|
|
346
|
+
properties: {
|
|
347
|
+
instructionId: { type: 'string' },
|
|
348
|
+
relevanceScore: { type: 'number' },
|
|
349
|
+
matchedFields: {
|
|
350
|
+
type: 'array',
|
|
351
|
+
items: { enum: ['title', 'body', 'categories'] }
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
totalMatches: { type: 'number' },
|
|
357
|
+
query: {
|
|
358
|
+
type: 'object',
|
|
359
|
+
additionalProperties: false,
|
|
360
|
+
required: ['keywords', 'limit', 'includeCategories', 'caseSensitive'],
|
|
361
|
+
properties: {
|
|
362
|
+
keywords: { type: 'array', items: { type: 'string' } },
|
|
363
|
+
limit: { type: 'number' },
|
|
364
|
+
includeCategories: { type: 'boolean' },
|
|
365
|
+
caseSensitive: { type: 'boolean' }
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
executionTimeMs: { type: 'number' }
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// CLI runner for performance baseline measurement
|
|
4
|
+
const performanceBaseline_1 = require("../services/performanceBaseline");
|
|
5
|
+
async function main() {
|
|
6
|
+
try {
|
|
7
|
+
const results = await (0, performanceBaseline_1.runPerformanceBaseline)();
|
|
8
|
+
process.exit(results.summary.meetsTarget ? 0 : 1);
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
console.error('❌ Performance baseline failed:', error instanceof Error ? error.message : String(error));
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (require.main === module) {
|
|
16
|
+
main();
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare function isHandshakeTraceEnabled(): boolean;
|
|
2
|
+
export declare function handshakeLog(stage: string, data?: Record<string, unknown>): void;
|
|
3
|
+
export declare function isHandshakeFallbacksEnabled(): boolean;
|
|
4
|
+
export declare const SUPPORTED_PROTOCOL_VERSIONS: string[];
|
|
5
|
+
export interface HandshakeEvent {
|
|
6
|
+
seq: number;
|
|
7
|
+
ts: string;
|
|
8
|
+
stage: string;
|
|
9
|
+
extra?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export declare function record(stage: string, extra?: Record<string, unknown>): void;
|
|
12
|
+
export declare function isInitFrameDiagEnabled(): boolean;
|
|
13
|
+
export declare function initFrameLog(stage: string, extra?: Record<string, unknown>): void;
|
|
14
|
+
export declare function negotiateProtocolVersion(requested?: string): string;
|
|
15
|
+
export declare function emitReadyGlobal(server: any, reason: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Pre-connect stdin sniffer: if we observe an initialize request but downstream logic fails
|
|
18
|
+
* to emit server/ready, schedule a guarded fallback emission.
|
|
19
|
+
*/
|
|
20
|
+
export declare function setupStdinSniffer(server: any): void;
|
|
21
|
+
/**
|
|
22
|
+
* Safety fallback timers for missed ready emissions, unconditional DIAG fallback,
|
|
23
|
+
* and _oninitialize patch for protocol negotiation.
|
|
24
|
+
*/
|
|
25
|
+
export declare function setupSafetyFallbacks(server: any): void;
|