@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,490 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REGISTRY_VERSION = exports.MUTATION = exports.STABLE = void 0;
|
|
4
|
+
exports.resolveActiveTier = resolveActiveTier;
|
|
5
|
+
exports.getToolRegistry = getToolRegistry;
|
|
6
|
+
/**
|
|
7
|
+
* Central MCP-style tool registry.
|
|
8
|
+
* Provides per-tool metadata including description, input & output JSON Schemas.
|
|
9
|
+
* This enables host agents to introspect capabilities & perform client-side validation.
|
|
10
|
+
*/
|
|
11
|
+
const schemas_1 = require("../schemas");
|
|
12
|
+
const featureFlags_1 = require("./featureFlags");
|
|
13
|
+
// Input schema helpers (keep intentionally permissive if params optional)
|
|
14
|
+
const stringReq = (name) => ({ type: 'object', additionalProperties: false, required: [name], properties: { [name]: { type: 'string' } } });
|
|
15
|
+
// Explicit param schemas derived from handlers in toolHandlers.ts
|
|
16
|
+
const INPUT_SCHEMAS = {
|
|
17
|
+
// graph export (Phase 1 + Phase 2 enrichment). All params optional.
|
|
18
|
+
'graph_export': { type: 'object', additionalProperties: false, properties: {
|
|
19
|
+
includeEdgeTypes: { type: 'array', items: { type: 'string', enum: ['primary', 'category', 'belongs'] }, maxItems: 3 },
|
|
20
|
+
maxEdges: { type: 'number', minimum: 0 },
|
|
21
|
+
// Added 'mermaid' format for dashboard visualization / documentation embedding
|
|
22
|
+
format: { type: 'string', enum: ['json', 'dot', 'mermaid'] },
|
|
23
|
+
enrich: { type: 'boolean' },
|
|
24
|
+
includeCategoryNodes: { type: 'boolean' },
|
|
25
|
+
includeUsage: { type: 'boolean' }
|
|
26
|
+
} },
|
|
27
|
+
'health_check': { type: 'object', additionalProperties: true }, // no params
|
|
28
|
+
'index_dispatch': { type: 'object', additionalProperties: true, required: ['action'], properties: {
|
|
29
|
+
action: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
enum: [
|
|
32
|
+
// Read-only queries
|
|
33
|
+
'list', 'listScoped', 'get', 'getEnhanced', 'search', 'query', 'categories', 'diff', 'export',
|
|
34
|
+
// Mutations
|
|
35
|
+
'add', 'import', 'remove', 'reload', 'groom', 'repair', 'enrich',
|
|
36
|
+
// Governance
|
|
37
|
+
'governanceHash', 'governanceUpdate',
|
|
38
|
+
// Utilities
|
|
39
|
+
'health', 'inspect', 'dir', 'capabilities', 'batch',
|
|
40
|
+
// Manifest
|
|
41
|
+
'manifestStatus', 'manifestRefresh', 'manifestRepair'
|
|
42
|
+
],
|
|
43
|
+
description: 'Action to perform on the instruction index. Use "capabilities" to list all supported actions.'
|
|
44
|
+
},
|
|
45
|
+
id: { type: 'string', description: 'Instruction ID for get, getEnhanced, remove, inspect, governanceUpdate actions.' },
|
|
46
|
+
q: { type: 'string', description: 'Single-string query for search action. The dispatcher searches the full q phrase first and, if needed, retries with split-word keywords.' },
|
|
47
|
+
keywords: { type: 'array', items: { type: 'string' }, description: 'Explicit keyword array for search action when the caller wants direct token control.' },
|
|
48
|
+
ids: { type: 'array', items: { type: 'string' }, description: 'Array of instruction IDs for remove or export actions.' },
|
|
49
|
+
category: { type: 'string', description: 'Filter by category for list action.' },
|
|
50
|
+
contentType: { type: 'string', description: 'Filter by content type for list, search, or query actions.' },
|
|
51
|
+
text: { type: 'string', description: 'Full-text search within query action.' },
|
|
52
|
+
includeCategories: { type: 'boolean', description: 'Search categories in addition to id/title/semanticSummary/body for search action.' },
|
|
53
|
+
caseSensitive: { type: 'boolean', description: 'Enable case-sensitive matching for search action.' },
|
|
54
|
+
categoriesAny: { type: 'array', items: { type: 'string' }, description: 'Match instructions having any of these categories (query action).' },
|
|
55
|
+
categoriesAll: { type: 'array', items: { type: 'string' }, description: 'Match instructions having all of these categories (query action).' },
|
|
56
|
+
clientHash: { type: 'string', description: 'Client-side index hash for diff action (returns changes since).' },
|
|
57
|
+
metaOnly: { type: 'boolean', description: 'Return metadata only (omit body) for export action.' },
|
|
58
|
+
limit: { type: 'number', description: 'Maximum number of results to return (search or query action).' },
|
|
59
|
+
offset: { type: 'number', description: 'Pagination offset (query action).' },
|
|
60
|
+
// Mutation params for add action (flat-param support: agents can pass these at top level instead of nested entry wrapper)
|
|
61
|
+
entry: { type: 'object', description: 'Instruction entry object for add action. Alternatively, pass id/body/title as top-level params.', additionalProperties: true, properties: { id: { type: 'string' }, title: { type: 'string' }, body: { type: 'string' } } },
|
|
62
|
+
overwrite: { type: 'boolean', description: 'Allow overwriting existing instruction (add action).' },
|
|
63
|
+
lax: { type: 'boolean', description: 'Enable lax mode with default fills for missing optional fields (add action).' },
|
|
64
|
+
// Import action params
|
|
65
|
+
entries: { description: 'Array of instruction entries for import action, or a file path (string) to a JSON array of entries.', oneOf: [{ type: 'array', items: { type: 'object', additionalProperties: true } }, { type: 'string' }] },
|
|
66
|
+
source: { type: 'string', description: 'Directory path containing .json instruction files to import (import action).' },
|
|
67
|
+
mode: { description: 'Import conflict resolution mode (import action) or groom mode object (groom action).' },
|
|
68
|
+
// Governance update params
|
|
69
|
+
owner: { type: 'string', description: 'Owner identifier for governanceUpdate action.' },
|
|
70
|
+
status: { type: 'string', description: 'Governance status for governanceUpdate action.', enum: ['approved', 'draft', 'deprecated'] },
|
|
71
|
+
bump: { type: 'string', description: 'Version bump level for governanceUpdate action.', enum: ['patch', 'minor', 'major', 'none'] },
|
|
72
|
+
lastReviewedAt: { type: 'string', description: 'Last review date (ISO 8601) for governanceUpdate action.' },
|
|
73
|
+
nextReviewDue: { type: 'string', description: 'Next review due date (ISO 8601) for governanceUpdate action.' },
|
|
74
|
+
// Remove action params
|
|
75
|
+
missingOk: { type: 'boolean', description: 'Suppress errors for missing IDs (remove action).' },
|
|
76
|
+
force: { type: 'boolean', description: 'Required for remove action when deleting more than INDEX_SERVER_MAX_BULK_DELETE items. A backup is created automatically.' },
|
|
77
|
+
dryRun: { type: 'boolean', description: 'Preview what would be deleted without actually removing anything (remove action).' }
|
|
78
|
+
} },
|
|
79
|
+
'index_governanceHash': { type: 'object', additionalProperties: true },
|
|
80
|
+
// status enum intentionally limited to schema-supported states (PROJECT_PRD Governance Hash Integrity Policy)
|
|
81
|
+
'index_governanceUpdate': { type: 'object', additionalProperties: false, required: ['id'], properties: {
|
|
82
|
+
id: { type: 'string' },
|
|
83
|
+
owner: { type: 'string' },
|
|
84
|
+
status: { type: 'string', enum: ['approved', 'draft', 'deprecated'] },
|
|
85
|
+
lastReviewedAt: { type: 'string' },
|
|
86
|
+
nextReviewDue: { type: 'string' },
|
|
87
|
+
bump: { type: 'string', enum: ['patch', 'minor', 'major', 'none'] }
|
|
88
|
+
} },
|
|
89
|
+
// NOTE: instructions_query & instructions_categories removed as standalone tools.
|
|
90
|
+
// They are now exclusively accessed via index_dispatch with actions 'query' and 'categories'.
|
|
91
|
+
// legacy read-only instruction method schemas removed in favor of dispatcher
|
|
92
|
+
'index_import': { type: 'object', additionalProperties: false, properties: {
|
|
93
|
+
entries: { oneOf: [
|
|
94
|
+
{ type: 'array', minItems: 1, items: { type: 'object', required: ['id', 'title', 'body', 'priority', 'audience', 'requirement'], additionalProperties: true, properties: {
|
|
95
|
+
id: { type: 'string' }, title: { type: 'string' }, body: { type: 'string', maxLength: 1000000, description: 'Instruction body (default limit 20K chars, absolute max 1MB). Split oversized content into cross-linked instructions.' }, rationale: { type: 'string' }, priority: { type: 'number' }, audience: { type: 'string' }, requirement: { type: 'string' }, categories: { type: 'array', items: { type: 'string' } }, mode: { type: 'string' }
|
|
96
|
+
} } },
|
|
97
|
+
{ type: 'string', description: 'File path to a JSON array of instruction entries' }
|
|
98
|
+
] },
|
|
99
|
+
source: { type: 'string', description: 'Directory path containing .json instruction files to import' },
|
|
100
|
+
mode: { enum: ['skip', 'overwrite'] }
|
|
101
|
+
} },
|
|
102
|
+
'index_add': { type: 'object', additionalProperties: false, required: ['entry'], properties: {
|
|
103
|
+
entry: { type: 'object', required: ['id', 'body'], additionalProperties: true, properties: {
|
|
104
|
+
id: { type: 'string' }, title: { type: 'string' }, body: { type: 'string', maxLength: 1000000, description: 'Instruction body (default limit 20K chars, absolute max 1MB). If content exceeds the limit, split into multiple cross-linked instructions with shared categories.' }, rationale: { type: 'string' }, priority: { type: 'number' }, audience: { type: 'string' }, requirement: { type: 'string' }, categories: { type: 'array', items: { type: 'string' } }, deprecatedBy: { type: 'string' }, riskScore: { type: 'number' }
|
|
105
|
+
} },
|
|
106
|
+
overwrite: { type: 'boolean' },
|
|
107
|
+
lax: { type: 'boolean' }
|
|
108
|
+
} },
|
|
109
|
+
'index_repair': { type: 'object', additionalProperties: true },
|
|
110
|
+
'index_reload': { type: 'object', additionalProperties: true },
|
|
111
|
+
'index_remove': { type: 'object', additionalProperties: false, required: ['ids'], properties: { ids: { type: 'array', minItems: 1, items: { type: 'string' } }, missingOk: { type: 'boolean' }, force: { type: 'boolean', description: 'Required when deleting more than INDEX_SERVER_MAX_BULK_DELETE items (default 5). A backup is created first.' }, dryRun: { type: 'boolean', description: 'Preview what would be deleted without actually removing anything.' } } },
|
|
112
|
+
'index_groom': { type: 'object', additionalProperties: false, properties: { mode: { type: 'object', additionalProperties: false, properties: { dryRun: { type: 'boolean' }, removeDeprecated: { type: 'boolean' }, mergeDuplicates: { type: 'boolean' }, purgeLegacyScopes: { type: 'boolean' }, remapCategories: { type: 'boolean' } } } } },
|
|
113
|
+
// enrichment tool (no params required)
|
|
114
|
+
'index_enrich': { type: 'object', additionalProperties: true },
|
|
115
|
+
'prompt_review': stringReq('prompt'),
|
|
116
|
+
'integrity_verify': { type: 'object', additionalProperties: true },
|
|
117
|
+
'feature_status': { type: 'object', additionalProperties: false, properties: {} },
|
|
118
|
+
'index_health': { type: 'object', additionalProperties: true },
|
|
119
|
+
'usage_track': { type: 'object', additionalProperties: false, required: ['id'], properties: { id: { type: 'string' }, action: { type: 'string', enum: ['retrieved', 'applied', 'cited'], description: 'Usage action type (default: retrieved)' }, signal: { type: 'string', enum: ['helpful', 'not-relevant', 'outdated', 'applied'], description: 'Qualitative signal about instruction usefulness' }, comment: { type: 'string', maxLength: 256, description: 'Optional short comment about the instruction' } } },
|
|
120
|
+
'usage_hotset': { type: 'object', additionalProperties: false, properties: { limit: { type: 'number', minimum: 1, maximum: 100 } } },
|
|
121
|
+
'usage_flush': { type: 'object', additionalProperties: false, properties: { id: { type: 'string', description: 'Instruction ID to reset usage for' }, before: { type: 'string', description: 'ISO date — reset usage for entries with lastUsedAt before this date' } } },
|
|
122
|
+
'metrics_snapshot': { type: 'object', additionalProperties: true },
|
|
123
|
+
'gates_evaluate': { type: 'object', additionalProperties: true },
|
|
124
|
+
'meta_tools': { type: 'object', additionalProperties: true },
|
|
125
|
+
// onboarding / help tool (no params for v1, future may allow sections[] filtering)
|
|
126
|
+
'help_overview': { type: 'object', additionalProperties: true },
|
|
127
|
+
// instruction schema template tool (self-documentation)
|
|
128
|
+
'index_schema': { type: 'object', additionalProperties: true },
|
|
129
|
+
// VSCode activation guide tools (addresses common "disabled by user" pain point)
|
|
130
|
+
'meta_activation_guide': { type: 'object', additionalProperties: true },
|
|
131
|
+
'meta_check_activation': { type: 'object', additionalProperties: false, properties: {
|
|
132
|
+
toolName: { type: 'string', description: 'Tool name to check activation requirements for (e.g., "index_search")' }
|
|
133
|
+
} },
|
|
134
|
+
// manifest tools (index manifest management)
|
|
135
|
+
'manifest_status': { type: 'object', additionalProperties: true },
|
|
136
|
+
'manifest_refresh': { type: 'object', additionalProperties: true },
|
|
137
|
+
'manifest_repair': { type: 'object', additionalProperties: true },
|
|
138
|
+
// feedback system tools
|
|
139
|
+
'feedback_submit': { type: 'object', additionalProperties: false, required: ['type', 'severity', 'title', 'description'], properties: {
|
|
140
|
+
type: { type: 'string', enum: ['issue', 'status', 'security', 'feature-request', 'bug-report', 'performance', 'usability', 'other'] },
|
|
141
|
+
severity: { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
|
|
142
|
+
title: { type: 'string', maxLength: 200 },
|
|
143
|
+
description: { type: 'string', maxLength: 10000 },
|
|
144
|
+
context: { type: 'object', additionalProperties: true, properties: {
|
|
145
|
+
clientInfo: { type: 'object', properties: { name: { type: 'string' }, version: { type: 'string' } } },
|
|
146
|
+
serverVersion: { type: 'string' },
|
|
147
|
+
environment: { type: 'object', additionalProperties: true },
|
|
148
|
+
sessionId: { type: 'string' },
|
|
149
|
+
toolName: { type: 'string' },
|
|
150
|
+
requestId: { type: 'string' }
|
|
151
|
+
} },
|
|
152
|
+
metadata: { type: 'object', additionalProperties: true },
|
|
153
|
+
tags: { type: 'array', maxItems: 10, items: { type: 'string' } }
|
|
154
|
+
} },
|
|
155
|
+
'feedback_list': { type: 'object', additionalProperties: false, properties: {
|
|
156
|
+
type: { type: 'string', enum: ['issue', 'status', 'security', 'feature-request', 'bug-report', 'performance', 'usability', 'other'] },
|
|
157
|
+
severity: { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
|
|
158
|
+
status: { type: 'string', enum: ['new', 'acknowledged', 'in-progress', 'resolved', 'closed'] },
|
|
159
|
+
limit: { type: 'number', minimum: 1, maximum: 200 },
|
|
160
|
+
offset: { type: 'number', minimum: 0 },
|
|
161
|
+
since: { type: 'string' },
|
|
162
|
+
tags: { type: 'array', items: { type: 'string' } }
|
|
163
|
+
} },
|
|
164
|
+
'feedback_get': { type: 'object', additionalProperties: false, required: ['id'], properties: {
|
|
165
|
+
id: { type: 'string' }
|
|
166
|
+
} },
|
|
167
|
+
'feedback_update': { type: 'object', additionalProperties: false, required: ['id'], properties: {
|
|
168
|
+
id: { type: 'string' },
|
|
169
|
+
status: { type: 'string', enum: ['new', 'acknowledged', 'in-progress', 'resolved', 'closed'] },
|
|
170
|
+
metadata: { type: 'object', additionalProperties: true }
|
|
171
|
+
} },
|
|
172
|
+
'feedback_stats': { type: 'object', additionalProperties: false, properties: {
|
|
173
|
+
since: { type: 'string' }
|
|
174
|
+
} },
|
|
175
|
+
'feedback_health': { type: 'object', additionalProperties: true },
|
|
176
|
+
// Unified feedback dispatch (002 Phase 2a)
|
|
177
|
+
'feedback_dispatch': { type: 'object', additionalProperties: true, required: ['action'], properties: {
|
|
178
|
+
action: { type: 'string', enum: ['submit', 'list', 'get', 'update', 'stats', 'health', 'rate'], description: 'Feedback action to perform.' },
|
|
179
|
+
instructionId: { type: 'string', description: 'Instruction ID to rate (rate action).' },
|
|
180
|
+
rating: { type: 'string', enum: ['useful', 'not-useful', 'outdated', 'incomplete'], description: 'Rating value (rate action).' },
|
|
181
|
+
comment: { type: 'string', maxLength: 1000, description: 'Optional comment with rating (rate action).' },
|
|
182
|
+
type: { type: 'string', enum: ['issue', 'status', 'security', 'feature-request', 'bug-report', 'performance', 'usability', 'other'] },
|
|
183
|
+
severity: { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
|
|
184
|
+
title: { type: 'string', maxLength: 200 },
|
|
185
|
+
description: { type: 'string', maxLength: 10000, description: 'Feedback description/body text (submit).' },
|
|
186
|
+
body: { type: 'string', maxLength: 10000, description: 'Alias for description (submit).' },
|
|
187
|
+
id: { type: 'string' },
|
|
188
|
+
status: { type: 'string', enum: ['new', 'acknowledged', 'in-progress', 'resolved', 'closed'] },
|
|
189
|
+
limit: { type: 'number', minimum: 1, maximum: 200 },
|
|
190
|
+
offset: { type: 'number', minimum: 0 },
|
|
191
|
+
since: { type: 'string' },
|
|
192
|
+
tags: { type: 'array', items: { type: 'string' } },
|
|
193
|
+
metadata: { type: 'object', additionalProperties: true }
|
|
194
|
+
} },
|
|
195
|
+
// instructions search tool - PRIMARY discovery mechanism
|
|
196
|
+
'index_search': { type: 'object', additionalProperties: false, required: ['keywords'], properties: {
|
|
197
|
+
keywords: {
|
|
198
|
+
type: 'array',
|
|
199
|
+
items: { type: 'string', minLength: 1, maxLength: 100 },
|
|
200
|
+
minItems: 1,
|
|
201
|
+
maxItems: 10,
|
|
202
|
+
description: 'Search keywords to match against instruction titles, bodies, and categories'
|
|
203
|
+
},
|
|
204
|
+
mode: { type: 'string', enum: ['keyword', 'regex', 'semantic'], default: 'keyword', description: 'Search mode: keyword (substring), regex (patterns like "deploy|release"), or semantic (embedding similarity). Default is semantic when INDEX_SERVER_SEMANTIC_ENABLED=1, otherwise keyword.' },
|
|
205
|
+
limit: { type: 'number', minimum: 1, maximum: 100, default: 50, description: 'Maximum number of instruction IDs to return' },
|
|
206
|
+
includeCategories: { type: 'boolean', default: false, description: 'Include categories in search scope' },
|
|
207
|
+
caseSensitive: { type: 'boolean', default: false, description: 'Perform case-sensitive matching' },
|
|
208
|
+
contentType: { type: 'string', enum: ['instruction', 'template', 'chat-session', 'reference', 'example', 'agent'], description: 'Filter results by content type (optional)' }
|
|
209
|
+
} },
|
|
210
|
+
// promote_from_repo tool
|
|
211
|
+
'promote_from_repo': { type: 'object', additionalProperties: false, required: ['repoPath'], properties: {
|
|
212
|
+
repoPath: { type: 'string', description: 'Absolute path to the Git repository root' },
|
|
213
|
+
scope: { type: 'string', enum: ['all', 'governance', 'specs', 'docs', 'instructions'], default: 'all', description: 'Which content categories to promote' },
|
|
214
|
+
force: { type: 'boolean', default: false, description: 'Re-promote even if content hash unchanged' },
|
|
215
|
+
dryRun: { type: 'boolean', default: false, description: 'Preview what would be promoted without writing' },
|
|
216
|
+
repoId: { type: 'string', description: 'Override repo identifier. Defaults to directory name.' },
|
|
217
|
+
} },
|
|
218
|
+
// bootstrap confirmation gating tools
|
|
219
|
+
'bootstrap_request': { type: 'object', additionalProperties: false, properties: { rationale: { type: 'string' } } },
|
|
220
|
+
'bootstrap_confirmFinalize': { type: 'object', additionalProperties: false, required: ['token'], properties: { token: { type: 'string' } } },
|
|
221
|
+
'bootstrap_status': { type: 'object', additionalProperties: true },
|
|
222
|
+
// Unified bootstrap dispatch (002 Phase 2c)
|
|
223
|
+
'bootstrap': { type: 'object', additionalProperties: true, required: ['action'], properties: {
|
|
224
|
+
action: { type: 'string', enum: ['request', 'confirm', 'status'], description: 'Bootstrap action to perform.' },
|
|
225
|
+
rationale: { type: 'string', description: 'Rationale for bootstrap request.' },
|
|
226
|
+
token: { type: 'string', description: 'Token for confirm action.' }
|
|
227
|
+
} },
|
|
228
|
+
// diagnostics / test-only tools (not stable)
|
|
229
|
+
'diagnostics_block': { type: 'object', additionalProperties: false, required: ['ms'], properties: { ms: { type: 'number', minimum: 0, maximum: 10000 } } },
|
|
230
|
+
'diagnostics_microtaskFlood': { type: 'object', additionalProperties: false, properties: { count: { type: 'number', minimum: 0, maximum: 200000 } } },
|
|
231
|
+
'diagnostics_memoryPressure': { type: 'object', additionalProperties: false, properties: { mb: { type: 'number', minimum: 1, maximum: 512 } } }
|
|
232
|
+
};
|
|
233
|
+
// Inject new schema after definition block (kept outside literal to avoid large diff churn if ordering changes)
|
|
234
|
+
// Provide permissive object with optional includeTrace boolean.
|
|
235
|
+
INPUT_SCHEMAS['index_diagnostics'] = { type: 'object', additionalProperties: false, properties: { includeTrace: { type: 'boolean' } } };
|
|
236
|
+
// Normalization / hash repair tool: allows optional dryRun and forceCanonical flags.
|
|
237
|
+
INPUT_SCHEMAS['index_normalize'] = { type: 'object', additionalProperties: false, properties: { dryRun: { type: 'boolean' }, forceCanonical: { type: 'boolean' } } };
|
|
238
|
+
// Orphan handler schemas (handlers exist but had no INPUT_SCHEMAS entry)
|
|
239
|
+
INPUT_SCHEMAS['index_inspect'] = { type: 'object', additionalProperties: false, required: ['id'], properties: { id: { type: 'string' } } };
|
|
240
|
+
INPUT_SCHEMAS['index_debug'] = { type: 'object', additionalProperties: true };
|
|
241
|
+
INPUT_SCHEMAS['integrity_manifest'] = { type: 'object', additionalProperties: true };
|
|
242
|
+
// Messaging tools: inter-agent messaging system (not stored in instruction index)
|
|
243
|
+
INPUT_SCHEMAS['messaging_send'] = { type: 'object', additionalProperties: false, required: ['channel', 'sender', 'recipients', 'body'], properties: {
|
|
244
|
+
channel: { type: 'string', description: 'Target channel name' },
|
|
245
|
+
sender: { type: 'string', description: 'Sender agent/instance ID' },
|
|
246
|
+
recipients: { type: 'array', items: { type: 'string' }, minItems: 1, description: "Recipients list. Use ['*'] for broadcast." },
|
|
247
|
+
body: { type: 'string', maxLength: 100000, description: 'Message body text' },
|
|
248
|
+
ttlSeconds: { type: 'number', minimum: 1, maximum: 86400, description: 'Time-to-live in seconds (default: 3600)' },
|
|
249
|
+
persistent: { type: 'boolean', description: 'If true, message survives TTL sweep' },
|
|
250
|
+
payload: { type: 'object', additionalProperties: true, description: 'Structured JSON data' },
|
|
251
|
+
priority: { type: 'string', enum: ['low', 'normal', 'high', 'critical'] },
|
|
252
|
+
parentId: { type: 'string', description: 'Parent message ID for threading' },
|
|
253
|
+
requiresAck: { type: 'boolean', description: 'Whether acknowledgment is required' },
|
|
254
|
+
ackBySeconds: { type: 'number', minimum: 1, description: 'ACK deadline in seconds from creation' },
|
|
255
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Optional categorization tags' }
|
|
256
|
+
} };
|
|
257
|
+
INPUT_SCHEMAS['messaging_read'] = { type: 'object', additionalProperties: false, properties: {
|
|
258
|
+
channel: { type: 'string', description: 'Filter by channel name' },
|
|
259
|
+
reader: { type: 'string', description: 'Reader identity for visibility filtering' },
|
|
260
|
+
unreadOnly: { type: 'boolean', description: 'Only return unread messages' },
|
|
261
|
+
limit: { type: 'number', minimum: 1, maximum: 500, description: 'Maximum messages to return' },
|
|
262
|
+
markRead: { type: 'boolean', description: 'Mark returned messages as read by reader' },
|
|
263
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Filter by tags (match any)' },
|
|
264
|
+
sender: { type: 'string', description: 'Filter by sender name' }
|
|
265
|
+
} };
|
|
266
|
+
INPUT_SCHEMAS['messaging_list_channels'] = { type: 'object', additionalProperties: true };
|
|
267
|
+
INPUT_SCHEMAS['messaging_ack'] = { type: 'object', additionalProperties: false, required: ['messageIds', 'reader'], properties: {
|
|
268
|
+
messageIds: { type: 'array', items: { type: 'string' }, minItems: 1, description: 'Message IDs to acknowledge' },
|
|
269
|
+
reader: { type: 'string', description: 'Reader identity' }
|
|
270
|
+
} };
|
|
271
|
+
INPUT_SCHEMAS['messaging_stats'] = { type: 'object', additionalProperties: false, properties: {
|
|
272
|
+
reader: { type: 'string', description: 'Reader identity (default: *)' },
|
|
273
|
+
channel: { type: 'string', description: 'Filter by channel' }
|
|
274
|
+
} };
|
|
275
|
+
INPUT_SCHEMAS['messaging_get'] = { type: 'object', additionalProperties: false, required: ['messageId'], properties: {
|
|
276
|
+
messageId: { type: 'string', description: 'Message ID to retrieve' }
|
|
277
|
+
} };
|
|
278
|
+
INPUT_SCHEMAS['messaging_update'] = { type: 'object', additionalProperties: false, required: ['messageId'], properties: {
|
|
279
|
+
messageId: { type: 'string', description: 'Message ID to update' },
|
|
280
|
+
body: { type: 'string', maxLength: 100000, description: 'New message body' },
|
|
281
|
+
recipients: { type: 'array', items: { type: 'string' }, description: 'New recipients list' },
|
|
282
|
+
payload: { type: 'object', additionalProperties: true, description: 'New structured data' },
|
|
283
|
+
persistent: { type: 'boolean', description: 'New persistence flag' }
|
|
284
|
+
} };
|
|
285
|
+
INPUT_SCHEMAS['messaging_purge'] = { type: 'object', additionalProperties: false, properties: {
|
|
286
|
+
channel: { type: 'string', description: 'Purge messages in this channel' },
|
|
287
|
+
messageIds: { type: 'array', items: { type: 'string' }, description: 'Delete specific message IDs' },
|
|
288
|
+
all: { type: 'boolean', description: 'Purge all messages' }
|
|
289
|
+
} };
|
|
290
|
+
INPUT_SCHEMAS['messaging_reply'] = { type: 'object', additionalProperties: false, required: ['parentId', 'sender', 'body'], properties: {
|
|
291
|
+
parentId: { type: 'string', description: 'ID of the message to reply to' },
|
|
292
|
+
sender: { type: 'string', description: 'Sender agent/instance ID' },
|
|
293
|
+
body: { type: 'string', maxLength: 100000, description: 'Reply message body' },
|
|
294
|
+
replyAll: { type: 'boolean', description: 'If true, reply to all original recipients + sender (excluding self)' },
|
|
295
|
+
recipients: { type: 'array', items: { type: 'string' }, description: 'Override recipients (default: reply to sender only)' },
|
|
296
|
+
priority: { type: 'string', enum: ['low', 'normal', 'high', 'critical'], description: 'Priority (default: inherit from parent)' },
|
|
297
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Optional categorization tags' },
|
|
298
|
+
persistent: { type: 'boolean', description: 'If true, message survives TTL sweep' },
|
|
299
|
+
payload: { type: 'object', additionalProperties: true, description: 'Structured JSON data' }
|
|
300
|
+
} };
|
|
301
|
+
INPUT_SCHEMAS['messaging_thread'] = { type: 'object', additionalProperties: false, required: ['parentId'], properties: {
|
|
302
|
+
parentId: { type: 'string', description: 'Root message ID to retrieve the thread for' }
|
|
303
|
+
} };
|
|
304
|
+
INPUT_SCHEMAS['trace_dump'] = { type: 'object', additionalProperties: false, properties: {
|
|
305
|
+
file: { type: 'string', description: 'Optional path to write the trace buffer JSON file' }
|
|
306
|
+
} };
|
|
307
|
+
// Stable & mutation classification lists (mirrors usage in toolHandlers; exported to remove duplication there).
|
|
308
|
+
exports.STABLE = new Set(['health_check', 'graph_export', 'index_dispatch', 'index_search', 'index_governanceHash', 'prompt_review', 'integrity_verify', 'usage_track', 'usage_hotset', 'metrics_snapshot', 'gates_evaluate', 'meta_tools', 'help_overview', 'index_schema', 'feedback_list', 'feedback_get', 'feedback_stats', 'feedback_health', 'manifest_status', 'index_diagnostics', 'meta_activation_guide', 'meta_check_activation', 'feedback_dispatch', 'bootstrap', 'bootstrap_status', 'feature_status', 'index_health', 'index_inspect', 'index_debug', 'integrity_manifest', 'diagnostics_block', 'diagnostics_microtaskFlood', 'diagnostics_memoryPressure', 'messaging_read', 'messaging_list_channels', 'messaging_stats', 'messaging_get', 'messaging_thread', 'trace_dump']);
|
|
309
|
+
exports.MUTATION = new Set(['index_add', 'index_import', 'index_repair', 'index_reload', 'index_remove', 'index_groom', 'index_enrich', 'index_governanceUpdate', 'index_normalize', 'usage_flush', 'feedback_submit', 'feedback_update', 'manifest_refresh', 'manifest_repair', 'promote_from_repo', 'bootstrap_request', 'bootstrap_confirmFinalize', 'messaging_send', 'messaging_ack', 'messaging_update', 'messaging_purge', 'messaging_reply']);
|
|
310
|
+
// Tool tier classification (002-tool-consolidation spec)
|
|
311
|
+
// core: always visible, essential daily use
|
|
312
|
+
// extended: opt-in via INDEX_SERVER_FLAG_TOOLS_EXTENDED=1 or flags.json tools_extended:true
|
|
313
|
+
// admin: opt-in via INDEX_SERVER_FLAG_TOOLS_ADMIN=1, rarely needed ops/debug tools
|
|
314
|
+
const TOOL_TIERS = {
|
|
315
|
+
// Core (7)
|
|
316
|
+
'health_check': 'core',
|
|
317
|
+
'index_dispatch': 'core',
|
|
318
|
+
'index_search': 'core',
|
|
319
|
+
'prompt_review': 'core',
|
|
320
|
+
'help_overview': 'core',
|
|
321
|
+
'feedback_dispatch': 'core',
|
|
322
|
+
'bootstrap': 'core',
|
|
323
|
+
// Extended (14)
|
|
324
|
+
'graph_export': 'extended',
|
|
325
|
+
'usage_track': 'extended',
|
|
326
|
+
'usage_hotset': 'extended',
|
|
327
|
+
'index_add': 'extended',
|
|
328
|
+
'index_import': 'extended',
|
|
329
|
+
'index_remove': 'extended',
|
|
330
|
+
'index_reload': 'extended',
|
|
331
|
+
'index_governanceHash': 'extended',
|
|
332
|
+
'index_governanceUpdate': 'extended',
|
|
333
|
+
'gates_evaluate': 'extended',
|
|
334
|
+
'integrity_verify': 'extended',
|
|
335
|
+
'metrics_snapshot': 'extended',
|
|
336
|
+
'promote_from_repo': 'extended',
|
|
337
|
+
'index_schema': 'extended',
|
|
338
|
+
// Admin (everything else)
|
|
339
|
+
'feedback_submit': 'admin',
|
|
340
|
+
'feedback_list': 'admin',
|
|
341
|
+
'feedback_get': 'admin',
|
|
342
|
+
'meta_tools': 'admin',
|
|
343
|
+
'meta_activation_guide': 'admin',
|
|
344
|
+
'meta_check_activation': 'admin',
|
|
345
|
+
'feature_status': 'admin',
|
|
346
|
+
'index_health': 'admin',
|
|
347
|
+
'index_diagnostics': 'admin',
|
|
348
|
+
'index_repair': 'admin',
|
|
349
|
+
'index_groom': 'admin',
|
|
350
|
+
'index_enrich': 'admin',
|
|
351
|
+
'index_normalize': 'admin',
|
|
352
|
+
'usage_flush': 'admin',
|
|
353
|
+
'feedback_update': 'admin',
|
|
354
|
+
'feedback_stats': 'admin',
|
|
355
|
+
'feedback_health': 'admin',
|
|
356
|
+
'manifest_status': 'admin',
|
|
357
|
+
'manifest_refresh': 'admin',
|
|
358
|
+
'manifest_repair': 'admin',
|
|
359
|
+
'bootstrap_request': 'admin',
|
|
360
|
+
'bootstrap_confirmFinalize': 'admin',
|
|
361
|
+
'bootstrap_status': 'admin',
|
|
362
|
+
'diagnostics_block': 'admin',
|
|
363
|
+
'diagnostics_microtaskFlood': 'admin',
|
|
364
|
+
'diagnostics_memoryPressure': 'admin',
|
|
365
|
+
'index_inspect': 'admin',
|
|
366
|
+
'index_debug': 'admin',
|
|
367
|
+
'integrity_manifest': 'admin',
|
|
368
|
+
// Messaging tools (extended tier)
|
|
369
|
+
'messaging_send': 'extended',
|
|
370
|
+
'messaging_read': 'extended',
|
|
371
|
+
'messaging_list_channels': 'extended',
|
|
372
|
+
'messaging_ack': 'extended',
|
|
373
|
+
'messaging_stats': 'extended',
|
|
374
|
+
'messaging_get': 'extended',
|
|
375
|
+
'messaging_update': 'extended',
|
|
376
|
+
'messaging_purge': 'extended',
|
|
377
|
+
'messaging_reply': 'extended',
|
|
378
|
+
'messaging_thread': 'extended',
|
|
379
|
+
'trace_dump': 'admin',
|
|
380
|
+
};
|
|
381
|
+
// Tier ordering for filter comparison
|
|
382
|
+
const TIER_LEVEL = { core: 0, extended: 1, admin: 2 };
|
|
383
|
+
/** Resolve the maximum visible tier from feature flags. */
|
|
384
|
+
function resolveActiveTier() {
|
|
385
|
+
if ((0, featureFlags_1.flagEnabled)('tools_admin'))
|
|
386
|
+
return 'admin';
|
|
387
|
+
if ((0, featureFlags_1.flagEnabled)('tools_extended'))
|
|
388
|
+
return 'extended';
|
|
389
|
+
return 'core';
|
|
390
|
+
}
|
|
391
|
+
function getToolRegistry(filter) {
|
|
392
|
+
const maxTier = filter?.tier ?? resolveActiveTier();
|
|
393
|
+
const maxLevel = TIER_LEVEL[maxTier];
|
|
394
|
+
const entries = [];
|
|
395
|
+
const names = new Set([...exports.STABLE, ...exports.MUTATION]);
|
|
396
|
+
// Ensure we also expose any tools that have schemas even if not in STABLE/MUTATION lists.
|
|
397
|
+
for (const k of Object.keys(INPUT_SCHEMAS))
|
|
398
|
+
names.add(k);
|
|
399
|
+
for (const name of Array.from(names).sort()) {
|
|
400
|
+
const tier = TOOL_TIERS[name] || 'admin';
|
|
401
|
+
if (TIER_LEVEL[tier] > maxLevel)
|
|
402
|
+
continue;
|
|
403
|
+
const outputSchema = schemas_1.schemas[name];
|
|
404
|
+
entries.push({
|
|
405
|
+
name,
|
|
406
|
+
description: describeTool(name),
|
|
407
|
+
stable: exports.STABLE.has(name),
|
|
408
|
+
mutation: exports.MUTATION.has(name),
|
|
409
|
+
tier,
|
|
410
|
+
inputSchema: INPUT_SCHEMAS[name] || { type: 'object' },
|
|
411
|
+
outputSchema,
|
|
412
|
+
// zodSchema to be attached incrementally by a forthcoming zodRegistry enhancer.
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
return entries;
|
|
416
|
+
}
|
|
417
|
+
function describeTool(name) {
|
|
418
|
+
switch (name) {
|
|
419
|
+
case 'health_check': return 'Returns server health status & version.';
|
|
420
|
+
case 'graph_export': return 'Export instruction relationship graph (schema v1 minimal or v2 enriched).';
|
|
421
|
+
case 'index_dispatch': return 'Unified dispatcher for instruction index operations. Required: "action". Key params by action: get/getEnhanced(id), search(q or keywords, includeCategories, caseSensitive, limit, mode), query(text,categoriesAny,limit,offset), list(category), diff(clientHash), export(ids,metaOnly), remove(id or ids). Use action="capabilities" to discover all supported actions.';
|
|
422
|
+
case 'index_search': return '🔍 PRIMARY: Search instructions by keywords — returns instruction IDs for targeted retrieval. Supports mode: "keyword" (substring match), "regex" (patterns like "deploy|release"), or "semantic" (embedding similarity). Default mode is semantic when INDEX_SERVER_SEMANTIC_ENABLED=1, otherwise keyword. Use this FIRST to discover relevant instructions, then use index_dispatch get for details.';
|
|
423
|
+
case 'index_governanceHash': return 'Return governance projection & deterministic governance hash.';
|
|
424
|
+
// query & categories now accessed via dispatcher actions.
|
|
425
|
+
// legacy read-only instruction descriptions removed (handled via dispatcher)
|
|
426
|
+
case 'index_import': return 'Import instruction entries from: inline array (entries), file path to JSON array (entries as string), or directory of .json files (source).';
|
|
427
|
+
case 'index_add': return 'Add a single instruction (lax mode fills defaults; overwrite optional).';
|
|
428
|
+
case 'index_repair': return 'Repair out-of-sync sourceHash fields (noop if none drifted).';
|
|
429
|
+
case 'index_reload': return 'Force reload of instruction index from disk.';
|
|
430
|
+
case 'index_remove': return 'Delete one or more instruction entries by id. Bulk deletes exceeding INDEX_SERVER_MAX_BULK_DELETE (default 5) require force=true and auto-create a backup first. Use dryRun=true to preview.';
|
|
431
|
+
case 'index_groom': return 'Groom index: normalize, repair hashes, merge duplicates, remove deprecated, remap categories, apply usage signal feedback (outdated/not-relevant/helpful/applied) to instruction priority and requirement.';
|
|
432
|
+
case 'index_enrich': return 'Persist normalization of placeholder governance fields to disk.';
|
|
433
|
+
case 'index_governanceUpdate': return 'Patch limited governance fields (owner/status/review dates + optional version bump).';
|
|
434
|
+
case 'prompt_review': return 'Static analysis of a prompt returning issues & summary.';
|
|
435
|
+
case 'integrity_verify': return 'Verify each instruction body hash against stored sourceHash.';
|
|
436
|
+
case 'feature_status': return 'Report active index feature flags and counters.';
|
|
437
|
+
case 'usage_track': return 'Track instruction usage with optional qualitative signal. Params: id (required), action (retrieved|applied|cited), signal (helpful|not-relevant|outdated|applied), comment (short text, max 256 chars).';
|
|
438
|
+
case 'usage_hotset': return 'Return the most-used instruction entries (hot set).';
|
|
439
|
+
case 'usage_flush': return 'Reset usage counters for a specific instruction (by id) or for entries with lastUsedAt before a given date.';
|
|
440
|
+
case 'metrics_snapshot': return 'Performance metrics summary for handled methods.';
|
|
441
|
+
case 'index_health': return 'Compare live index to canonical snapshot for drift.';
|
|
442
|
+
case 'gates_evaluate': return 'Evaluate configured gating criteria over current index.';
|
|
443
|
+
case 'meta_tools': return 'Enumerate available tools & their metadata.';
|
|
444
|
+
// feedback system descriptions
|
|
445
|
+
case 'feedback_submit': return 'Submit feedback entry (issue, status report, security alert, feature request, etc.).';
|
|
446
|
+
case 'feedback_list': return 'List feedback entries with filtering options (type, severity, status, date range).';
|
|
447
|
+
case 'feedback_get': return 'Get specific feedback entry by ID with full details.';
|
|
448
|
+
case 'feedback_update': return 'Update feedback entry status and metadata (admin function).';
|
|
449
|
+
case 'feedback_stats': return 'Get feedback system statistics and metrics dashboard.';
|
|
450
|
+
case 'feedback_health': return 'Health check for feedback system storage and configuration.';
|
|
451
|
+
case 'feedback_dispatch': return 'Unified feedback dispatcher. Actions: submit, list, get, update, stats, health, rate.';
|
|
452
|
+
case 'bootstrap': return 'Unified bootstrap dispatcher. Actions: request, confirm, status.';
|
|
453
|
+
case 'manifest_status': return 'Report index manifest presence and drift summary.';
|
|
454
|
+
case 'manifest_refresh': return 'Rewrite manifest from current index state.';
|
|
455
|
+
case 'manifest_repair': return 'Repair manifest by reconciling drift with index.';
|
|
456
|
+
case 'promote_from_repo': return 'Scan a local Git repository and promote its knowledge content (constitutions, docs, instructions, specs) into the instruction index. Reads .specify/config/promotion-map.json and instructions/*.json from the target repo.';
|
|
457
|
+
case 'bootstrap_request': return 'Request a human confirmation bootstrap token (hash persisted, raw returned once).';
|
|
458
|
+
case 'bootstrap_confirmFinalize': return 'Finalize bootstrap by submitting issued token; enables guarded mutations.';
|
|
459
|
+
case 'bootstrap_status': return 'Return bootstrap gating status (referenceMode, confirmed, requireConfirmation).';
|
|
460
|
+
// diagnostics descriptions
|
|
461
|
+
case 'diagnostics_block': return 'Intentionally CPU blocks the event loop for N ms (diagnostic stress).';
|
|
462
|
+
case 'diagnostics_microtaskFlood': return 'Flood the microtask queue with many Promise resolutions to probe event loop starvation.';
|
|
463
|
+
case 'diagnostics_memoryPressure': return 'Allocate & release transient memory to induce GC / memory pressure.';
|
|
464
|
+
case 'diagnostics_handshake': return 'Return recent handshake events (ordering/ready/list_changed trace).';
|
|
465
|
+
case 'help_overview': return 'Structured onboarding guidance for new agents (tool discovery, index lifecycle, promotion workflow).';
|
|
466
|
+
case 'index_schema': return 'Return instruction JSON schema, examples, validation rules, and promotion workflow guidance for self-documentation.';
|
|
467
|
+
case 'index_diagnostics': return 'Summarize loader diagnostics: scanned vs accepted, skipped reasons, missing IDs, optional trace sample.';
|
|
468
|
+
case 'index_normalize': return 'Normalize instruction JSON files (hash repair, version hydrate, timestamps) with optional dryRun.';
|
|
469
|
+
case 'meta_activation_guide': return 'Comprehensive guide for activating Index Server tools in VSCode. Explains why settings.json alone is insufficient and provides activation function reference for all tool categories.';
|
|
470
|
+
case 'meta_check_activation': return 'Check activation requirements for a specific tool. Returns the VSCode activation function needed and step-by-step instructions.';
|
|
471
|
+
case 'index_inspect': return 'Return raw instruction entry by ID for debugging (full JSON).';
|
|
472
|
+
case 'index_debug': return 'Dump raw index state for debugging (entry count, keys, load status).';
|
|
473
|
+
case 'integrity_manifest': return 'Verify integrity of index manifest entries against stored sourceHash values.';
|
|
474
|
+
// messaging system descriptions
|
|
475
|
+
case 'messaging_send': return 'Send a message to a channel with recipient targeting. Supports broadcast (*), directed, priority, TTL, threading, and structured payloads.';
|
|
476
|
+
case 'messaging_read': return 'Read messages from a channel with visibility filtering. Supports unread-only, limit, mark-as-read, tag filtering, and sender filtering.';
|
|
477
|
+
case 'messaging_list_channels': return 'List all active messaging channels with message counts and latest timestamps.';
|
|
478
|
+
case 'messaging_ack': return 'Acknowledge (mark as read) one or more messages by ID.';
|
|
479
|
+
case 'messaging_stats': return 'Get messaging statistics for a reader: total, unread, channel count.';
|
|
480
|
+
case 'messaging_get': return 'Get a single message by ID with full details.';
|
|
481
|
+
case 'messaging_update': return 'Update mutable fields of a message (body, recipients, payload, persistent flag).';
|
|
482
|
+
case 'messaging_purge': return 'Delete messages: all, by channel, or by specific IDs.';
|
|
483
|
+
case 'messaging_reply': return 'Reply to a message with auto-populated channel and parentId. Supports reply-all (all original recipients) or reply-to-sender.';
|
|
484
|
+
case 'messaging_thread': return 'Retrieve a full message thread by root parentId. Returns parent + all nested replies sorted chronologically.';
|
|
485
|
+
case 'trace_dump': return 'Write the in-memory trace ring buffer to a file and return a summary (records count, bytes, env). Requires tracing to be enabled.';
|
|
486
|
+
default: return 'Tool description pending.';
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
// Registry version bumped to align with dispatcher consolidation docs regeneration (TOOLS-GENERATED.md)
|
|
490
|
+
exports.REGISTRY_VERSION = '2026-03-29';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolRegistryEntry } from './toolRegistry';
|
|
3
|
+
declare const zodMap: Record<string, z.ZodTypeAny>;
|
|
4
|
+
export declare function getZodEnhancedRegistry(): ToolRegistryEntry[];
|
|
5
|
+
/** Get the Zod schema for a specific tool by name */
|
|
6
|
+
export declare function getZodSchema(toolName: string): z.ZodTypeAny | undefined;
|
|
7
|
+
/** Check if a tool has a Zod schema registered */
|
|
8
|
+
export declare function hasZodSchema(toolName: string): boolean;
|
|
9
|
+
export type ExtractParams<T extends string> = T extends keyof typeof zodMap ? z.infer<(typeof zodMap)[T]> : unknown;
|
|
10
|
+
export {};
|