@jagilber-org/index-server 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1354 -0
- package/CODE_OF_CONDUCT.md +49 -0
- package/CONTRIBUTING.md +99 -0
- package/LICENSE +21 -0
- package/README.md +228 -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 +46 -0
- package/dist/config/dashboardConfig.js +67 -0
- package/dist/config/defaultValues.d.ts +63 -0
- package/dist/config/defaultValues.js +72 -0
- package/dist/config/dirConstants.d.ts +18 -0
- package/dist/config/dirConstants.js +29 -0
- package/dist/config/featureConfig.d.ts +61 -0
- package/dist/config/featureConfig.js +121 -0
- package/dist/config/runtimeConfig.d.ts +151 -0
- package/dist/config/runtimeConfig.js +380 -0
- package/dist/config/serverConfig.d.ts +90 -0
- package/dist/config/serverConfig.js +167 -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 +2175 -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 +1587 -0
- package/dist/dashboard/client/js/admin.auth.js +179 -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 +426 -0
- package/dist/dashboard/client/js/admin.graph.js +615 -0
- package/dist/dashboard/client/js/admin.instances.js +120 -0
- package/dist/dashboard/client/js/admin.instructions.js +579 -0
- package/dist/dashboard/client/js/admin.logs.js +113 -0
- package/dist/dashboard/client/js/admin.maintenance.js +393 -0
- package/dist/dashboard/client/js/admin.messaging.js +636 -0
- package/dist/dashboard/client/js/admin.monitor.js +184 -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 +292 -0
- package/dist/dashboard/client/js/admin.sqlite.js +373 -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 +47 -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 +23 -0
- package/dist/dashboard/export/exporters/xmlExporter.d.ts +17 -0
- package/dist/dashboard/export/exporters/xmlExporter.js +176 -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 +560 -0
- package/dist/dashboard/server/AdminPanel.d.ts +195 -0
- package/dist/dashboard/server/AdminPanel.js +861 -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 +215 -0
- package/dist/dashboard/server/ApiRoutes.d.ts +17 -0
- package/dist/dashboard/server/ApiRoutes.js +184 -0
- package/dist/dashboard/server/DashboardServer.d.ts +49 -0
- package/dist/dashboard/server/DashboardServer.js +160 -0
- package/dist/dashboard/server/FileMetricsStorage.d.ts +49 -0
- package/dist/dashboard/server/FileMetricsStorage.js +196 -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 +295 -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 +810 -0
- package/dist/dashboard/server/SessionPersistenceManager.d.ts +88 -0
- package/dist/dashboard/server/SessionPersistenceManager.js +458 -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 +448 -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 +210 -0
- package/dist/dashboard/server/metricsSerializer.d.ts +25 -0
- package/dist/dashboard/server/metricsSerializer.js +195 -0
- package/dist/dashboard/server/middleware/ensureLoadedMiddleware.d.ts +25 -0
- package/dist/dashboard/server/middleware/ensureLoadedMiddleware.js +24 -0
- package/dist/dashboard/server/routes/admin.routes.d.ts +16 -0
- package/dist/dashboard/server/routes/admin.routes.js +574 -0
- package/dist/dashboard/server/routes/adminAuth.d.ts +4 -0
- package/dist/dashboard/server/routes/adminAuth.js +46 -0
- package/dist/dashboard/server/routes/alerts.routes.d.ts +7 -0
- package/dist/dashboard/server/routes/alerts.routes.js +91 -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 +279 -0
- package/dist/dashboard/server/routes/index.d.ts +39 -0
- package/dist/dashboard/server/routes/index.js +229 -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 +268 -0
- package/dist/dashboard/server/routes/knowledge.routes.d.ts +6 -0
- package/dist/dashboard/server/routes/knowledge.routes.js +80 -0
- package/dist/dashboard/server/routes/logs.routes.d.ts +6 -0
- package/dist/dashboard/server/routes/logs.routes.js +166 -0
- package/dist/dashboard/server/routes/messaging.routes.d.ts +16 -0
- package/dist/dashboard/server/routes/messaging.routes.js +307 -0
- package/dist/dashboard/server/routes/metrics.routes.d.ts +10 -0
- package/dist/dashboard/server/routes/metrics.routes.js +335 -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 +570 -0
- package/dist/dashboard/server/routes/status.routes.d.ts +7 -0
- package/dist/dashboard/server/routes/status.routes.js +179 -0
- package/dist/dashboard/server/routes/synthetic.routes.d.ts +7 -0
- package/dist/dashboard/server/routes/synthetic.routes.js +197 -0
- package/dist/dashboard/server/routes/tools.routes.d.ts +6 -0
- package/dist/dashboard/server/routes/tools.routes.js +47 -0
- package/dist/dashboard/server/routes/usage.routes.d.ts +6 -0
- package/dist/dashboard/server/routes/usage.routes.js +26 -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 +46 -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 +132 -0
- package/dist/schemas/index.js +372 -0
- package/dist/scripts/runPerformanceBaseline.d.ts +1 -0
- package/dist/scripts/runPerformanceBaseline.js +17 -0
- package/dist/server/backgroundServicesStartup.d.ts +3 -0
- package/dist/server/backgroundServicesStartup.js +51 -0
- package/dist/server/handshakeManager.d.ts +25 -0
- package/dist/server/handshakeManager.js +470 -0
- package/dist/server/index-server.d.ts +38 -0
- package/dist/server/index-server.js +620 -0
- package/dist/server/multiInstanceStartup.d.ts +6 -0
- package/dist/server/multiInstanceStartup.js +132 -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/startupDiagnostics.d.ts +2 -0
- package/dist/server/startupDiagnostics.js +33 -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 +112 -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 +264 -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 +510 -0
- package/dist/services/handlers/instructions.groom.d.ts +1 -0
- package/dist/services/handlers/instructions.groom.js +575 -0
- package/dist/services/handlers/instructions.import.d.ts +1 -0
- package/dist/services/handlers/instructions.import.js +205 -0
- package/dist/services/handlers/instructions.patch.d.ts +1 -0
- package/dist/services/handlers/instructions.patch.js +121 -0
- package/dist/services/handlers/instructions.query.d.ts +159 -0
- package/dist/services/handlers/instructions.query.js +469 -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 +122 -0
- package/dist/services/handlers/instructions.shared.d.ts +32 -0
- package/dist/services/handlers/instructions.shared.js +91 -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 +110 -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 +389 -0
- package/dist/services/handlers.gates.d.ts +1 -0
- package/dist/services/handlers.gates.js +47 -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 +326 -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 +669 -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 +35 -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 +989 -0
- package/dist/services/indexLoader.d.ts +44 -0
- package/dist/services/indexLoader.js +920 -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 +36 -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 +259 -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 +123 -0
- package/dist/services/storage/sqliteStore.d.ts +42 -0
- package/dist/services/storage/sqliteStore.js +361 -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 +325 -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 +94 -0
- package/package.json +139 -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 +40670 -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 +210 -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/dist/README.md +15 -0
- package/scripts/setup-hooks.cjs +28 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
+
|
|
9
|
+
## Our Standards
|
|
10
|
+
|
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
+
|
|
13
|
+
- Demonstrating empathy and kindness toward other people
|
|
14
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
15
|
+
- Giving and gracefully accepting constructive feedback
|
|
16
|
+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
17
|
+
- Focusing on what is best not just for us as individuals, but for the overall community
|
|
18
|
+
|
|
19
|
+
Examples of unacceptable behavior include:
|
|
20
|
+
|
|
21
|
+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
22
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
23
|
+
- Public or private harassment
|
|
24
|
+
- Publishing others' private information, such as a physical or email address, without their explicit permission
|
|
25
|
+
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
26
|
+
|
|
27
|
+
## Scope
|
|
28
|
+
|
|
29
|
+
This Code of Conduct applies within all community spaces, including GitHub repositories, issue trackers, pull requests, discussions, and any other communication channels associated with this project. It also applies when an individual is officially representing the community in public spaces.
|
|
30
|
+
|
|
31
|
+
## Enforcement
|
|
32
|
+
|
|
33
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer via [GitHub Issues](https://github.com/jagilber-org/index-server/issues) or by contacting the maintainer directly.
|
|
34
|
+
|
|
35
|
+
All complaints will be reviewed and investigated promptly and fairly. The project maintainer is obligated to respect the privacy and security of the reporter of any incident.
|
|
36
|
+
|
|
37
|
+
### Enforcement Guidelines
|
|
38
|
+
|
|
39
|
+
**1. Correction** — A private, written warning providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
40
|
+
|
|
41
|
+
**2. Warning** — A warning with consequences for continued behavior. No interaction with the people involved for a specified period of time. Violating these terms may lead to a temporary or permanent ban.
|
|
42
|
+
|
|
43
|
+
**3. Temporary Ban** — A temporary ban from any sort of interaction or public communication with the community for a specified period of time.
|
|
44
|
+
|
|
45
|
+
**4. Permanent Ban** — A permanent ban from any sort of public interaction within the community.
|
|
46
|
+
|
|
47
|
+
## Attribution
|
|
48
|
+
|
|
49
|
+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing.
|
|
4
|
+
|
|
5
|
+
## Contribution Model
|
|
6
|
+
|
|
7
|
+
Public contributions should target `main` in the public repository.
|
|
8
|
+
|
|
9
|
+
- Fork `jagilber-org/index-server`
|
|
10
|
+
- Create a feature branch for your change
|
|
11
|
+
- Open a pull request against `main`
|
|
12
|
+
|
|
13
|
+
Maintainers may use additional private development and publishing workflows internally, but public contributors should work from the public repository and its pull request flow.
|
|
14
|
+
|
|
15
|
+
## Development Setup
|
|
16
|
+
|
|
17
|
+
1. Node 22+
|
|
18
|
+
2. `npm install`
|
|
19
|
+
3. `npm test`
|
|
20
|
+
4. `npm run build`
|
|
21
|
+
|
|
22
|
+
## Branching
|
|
23
|
+
|
|
24
|
+
Use feature branches. Submit PRs to `main`.
|
|
25
|
+
|
|
26
|
+
## Commit Messages
|
|
27
|
+
|
|
28
|
+
Use conventional style where practical (feat:, fix:, docs:, chore:).
|
|
29
|
+
|
|
30
|
+
## Tests
|
|
31
|
+
|
|
32
|
+
Include unit tests for new logic. Run `npm test` and ensure coverage not reduced.
|
|
33
|
+
|
|
34
|
+
### Repo Root Policy
|
|
35
|
+
|
|
36
|
+
The repository root must stay clean. Do not create directories or files in the repo root
|
|
37
|
+
beyond what is tracked in git. Specifically:
|
|
38
|
+
|
|
39
|
+
- **No `instructions/` directory** — instruction data lives outside the repo (set `INDEX_SERVER_DIR` env var). Tests use isolated temp directories via `os.tmpdir()`.
|
|
40
|
+
- **No temp/log sprawl** — use `tmp/` (gitignored) for transient files, never the repo root.
|
|
41
|
+
- **No runtime data dirs** — `data/`, `memory/`, `metrics/`, `feedback/` contain `.gitkeep` only; runtime data goes in external paths configured via env vars.
|
|
42
|
+
|
|
43
|
+
See `docs/testing.md` for the test isolation pattern.
|
|
44
|
+
|
|
45
|
+
### Configuration & Environment Variables
|
|
46
|
+
|
|
47
|
+
Do NOT introduce new top-level `process.env.*` usages scattered across the codebase.
|
|
48
|
+
|
|
49
|
+
All runtime and test tunables must flow through `src/config/runtimeConfig.ts`:
|
|
50
|
+
|
|
51
|
+
1. If you need a new timing / wait value, extend `INDEX_SERVER_TIMING_JSON` key usage (e.g. `{"featureX.startupWait":5000}`) instead of adding `FEATUREX_STARTUP_WAIT_MS`.
|
|
52
|
+
2. For logging verbosity, use `INDEX_SERVER_LOG_LEVEL` (levels: silent,error,warn,info,debug,trace) or add a trace token to `INDEX_SERVER_TRACE` (comma-separated) rather than a new boolean flag.
|
|
53
|
+
3. For mutation gating, rely on `INDEX_SERVER_MUTATION` (legacy `INDEX_SERVER_MUTATION` is auto-mapped; do not reintroduce it).
|
|
54
|
+
4. Fast coverage paths use `INDEX_SERVER_TEST_MODE=coverage-fast`; legacy `FAST_COVERAGE` accepted but should not appear in new code.
|
|
55
|
+
|
|
56
|
+
If an absolutely new capability requires configuration:
|
|
57
|
+
|
|
58
|
+
- Add parsing inside `runtimeConfig.ts` (with JSDoc + deprecation mapping if replacing legacy flags)
|
|
59
|
+
- Update `docs/CONFIGURATION.md` and README consolidation section
|
|
60
|
+
- Add a one-time warning for any temporary legacy alias
|
|
61
|
+
|
|
62
|
+
PRs adding raw `process.env.X` reads outside the config module will be requested to refactor before merge.
|
|
63
|
+
|
|
64
|
+
### Automated Enforcement
|
|
65
|
+
|
|
66
|
+
An automated guard (`npm run guard:env`) executes during `build:verify` and CI to block newly introduced direct `process.env.*` reads. If your change legitimately needs a bootstrap-time read (rare), either:
|
|
67
|
+
|
|
68
|
+
1. Route through `runtimeConfig.ts` (preferred), or
|
|
69
|
+
2. Add a narrowly scoped allowlist pattern with justification in `scripts/enforce-config-usage.ts` (include a comment referencing the follow-up issue to migrate/remove it).
|
|
70
|
+
|
|
71
|
+
Do not silence the guard by broadening allowlists—refactor instead. Enforcement failures list file:line with a remediation suggestion.
|
|
72
|
+
|
|
73
|
+
## Security
|
|
74
|
+
|
|
75
|
+
Do not include secrets in commits. Report vulnerabilities per `SECURITY.md`.
|
|
76
|
+
|
|
77
|
+
## Urgent Security Merge Policy
|
|
78
|
+
|
|
79
|
+
Critical or actively-exploited vulnerabilities may be merged with **zero pre-merge review** when delay would increase exposure risk. The following conditions apply:
|
|
80
|
+
|
|
81
|
+
1. **Post-merge audit required** — a full code review MUST occur within 24 hours of the merge.
|
|
82
|
+
2. **Commit message rationale** — the merge commit must document why the normal review process was bypassed (e.g., active exploitation, severity, blast radius).
|
|
83
|
+
3. **Async reviewer sign-off** — at least one maintainer must provide a reviewing sign-off within 24 hours, confirming the fix is correct and complete.
|
|
84
|
+
4. **Reference the vulnerability** — the commit and/or PR must reference the relevant CVE, advisory, or issue number.
|
|
85
|
+
5. **Scope limit** — this policy applies **only** to critical and actively-exploited vulnerabilities. Non-critical security issues follow the standard review process.
|
|
86
|
+
|
|
87
|
+
If the post-merge audit reveals problems, a follow-up fix must be prioritized immediately. Abuse of this policy to bypass review for non-critical changes will be treated as a process violation.
|
|
88
|
+
|
|
89
|
+
## Code Style
|
|
90
|
+
|
|
91
|
+
Respect existing formatting. Run any lint scripts if present.
|
|
92
|
+
|
|
93
|
+
## Constitution
|
|
94
|
+
|
|
95
|
+
This project is governed by a machine-readable constitution (`constitution.json` / `.specify/memory/constitution.md`). All contributions must align with its principles — review it before submitting significant changes.
|
|
96
|
+
|
|
97
|
+
## Questions
|
|
98
|
+
|
|
99
|
+
Open a discussion or issue.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 jagilber
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# Index Server
|
|
2
|
+
|
|
3
|
+
**Governed knowledge base for AI agents via the Model Context Protocol (MCP).**
|
|
4
|
+
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://github.com/jagilber-org/index-server/packages)
|
|
7
|
+
[](package.json)
|
|
8
|
+
[](https://codecov.io/gh/jagilber-org/index-server)
|
|
9
|
+
[](https://marketplace.visualstudio.com/items?itemName=jagilber-org.index-server)
|
|
10
|
+
[](https://open-vsx.org/extension/jagilber-org/index-server)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
> **🚀 [Quick Start Guide](docs/quickstart.md)** — Get running in 5 minutes with HTTPS and semantic search
|
|
15
|
+
>
|
|
16
|
+
> **📖 [Use Case Scenarios](docs/use-cases.md)** — Real-world examples for support engineers, dev teams, and knowledge management
|
|
17
|
+
|
|
18
|
+
## What Is Index Server?
|
|
19
|
+
|
|
20
|
+
Index Server is a central knowledge base that AI agents connect to via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io). Agents search, read, and contribute knowledge that persists across sessions and repositories — building a governed catalog with versioning, audit trails, and approval workflows. An optional admin dashboard provides real-time monitoring of catalog health, usage analytics, and drift detection.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
### Path A: npx (zero install)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx @jagilber-org/index-server --dashboard
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Path B: VS Code Extension
|
|
33
|
+
|
|
34
|
+
Install **Index Server** from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=jagilber-org.index-server) or [Open VSX](https://open-vsx.org/extension/jagilber-org/index-server).
|
|
35
|
+
|
|
36
|
+
### Path C: Docker
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
docker compose up # HTTP on :8787
|
|
40
|
+
docker compose up tls # HTTPS on :8787 with self-signed certs
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
See [Docker Deployment Guide](docs/docker_deployment.md) for volumes, environment variables, and production configuration.
|
|
44
|
+
|
|
45
|
+
### Path D: From source
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://github.com/jagilber-org/index-server.git
|
|
49
|
+
cd index-server
|
|
50
|
+
npm install
|
|
51
|
+
npm run build
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Configure your MCP client
|
|
55
|
+
|
|
56
|
+
Add to VS Code (`.vscode/mcp.json`):
|
|
57
|
+
|
|
58
|
+
```jsonc
|
|
59
|
+
{
|
|
60
|
+
"servers": {
|
|
61
|
+
"index-server": {
|
|
62
|
+
"type": "stdio",
|
|
63
|
+
"command": "npx",
|
|
64
|
+
"args": [
|
|
65
|
+
"@jagilber-org/index-server",
|
|
66
|
+
"--dashboard"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Copilot CLI (`~/.copilot/mcp-config.json`):
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"mcpServers": {
|
|
78
|
+
"index-server": {
|
|
79
|
+
"type": "stdio",
|
|
80
|
+
"command": "npx",
|
|
81
|
+
"args": ["@jagilber-org/index-server", "--dashboard"],
|
|
82
|
+
"tools": ["*"]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Claude Desktop (`claude_desktop_config.json`):
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"mcpServers": {
|
|
93
|
+
"index-server": {
|
|
94
|
+
"type": "stdio",
|
|
95
|
+
"command": "npx",
|
|
96
|
+
"args": ["@jagilber-org/index-server", "--dashboard"],
|
|
97
|
+
"tools": ["*"]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
See [MCP Configuration Guide](docs/mcp_configuration.md) for advanced patterns, environment variables, and TLS setup.
|
|
104
|
+
|
|
105
|
+
### Verify
|
|
106
|
+
|
|
107
|
+
- Server appears in your MCP client's server list
|
|
108
|
+
- Run `tools/list` to see 40+ available tools
|
|
109
|
+
- Dashboard (if enabled) at `http://localhost:8787`
|
|
110
|
+
|
|
111
|
+
### Enable Semantic Search (optional)
|
|
112
|
+
|
|
113
|
+
Add one env variable to any MCP config above to get embedding-based similarity search:
|
|
114
|
+
|
|
115
|
+
```jsonc
|
|
116
|
+
"env": {
|
|
117
|
+
"INDEX_SERVER_SEMANTIC_ENABLED": "1"
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
First search downloads a ~90MB model (one-time). After that, all searches automatically use semantic mode — no code changes needed. See [Quick Start Guide](docs/quickstart.md#4-enable-semantic-search-optional) for GPU acceleration and offline options.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Teach Your Agents
|
|
126
|
+
|
|
127
|
+
Copy-paste these instructions so your AI agents discover and use the shared knowledge base automatically.
|
|
128
|
+
|
|
129
|
+
### Global instructions (`~/.github/copilot-instructions.md`)
|
|
130
|
+
|
|
131
|
+
```markdown
|
|
132
|
+
## Index Server
|
|
133
|
+
- If index-server MCP tools are available, use them as a shared knowledge base for validated cross-repo patterns and standards.
|
|
134
|
+
- Search before creating: use `index_search` with 2-5 keywords, then `index_dispatch` with action="get" for details.
|
|
135
|
+
- After learning something reusable, add it with `index_add` or promote from a repo with `promote_from_repo`.
|
|
136
|
+
- Index entries are promoted snapshots — always prefer current repo files over index content.
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Per-repo instructions (`.github/copilot-instructions.md`)
|
|
140
|
+
|
|
141
|
+
```markdown
|
|
142
|
+
## Index Server Integration
|
|
143
|
+
- Search order: repo files → .instructions/ → index-server → external docs
|
|
144
|
+
- **Search before add/promote**: Always search for existing guidance before creating new instructions. Use `index_search` with relevant keywords and inspect top results.
|
|
145
|
+
- To retrieve: `index_search` → `index_dispatch` with action="get" and the instruction ID
|
|
146
|
+
- To contribute: validate locally in `.instructions/` first, then promote with `promote_from_repo`
|
|
147
|
+
- To maintain: use `index_dispatch` with action="groom" to clean duplicates, `index_governanceUpdate` to deprecate stale content
|
|
148
|
+
- Current repo state always wins over promoted index snapshots
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Dashboard
|
|
154
|
+
|
|
155
|
+
The optional admin dashboard provides a Grafana-dark themed interface for monitoring and catalog management:
|
|
156
|
+
|
|
157
|
+

|
|
158
|
+
|
|
159
|
+
| Panel | Description |
|
|
160
|
+
|-------|-------------|
|
|
161
|
+
| **Overview** | Server health, uptime, system status |
|
|
162
|
+
| **Instructions** | Catalog browser with usage counts and governance status |
|
|
163
|
+
| **Monitoring** | Performance metrics and error rates |
|
|
164
|
+
| **Maintenance** | Backup, repair, and catalog operations |
|
|
165
|
+
| **Graph** | Mermaid dependency graph of instructions |
|
|
166
|
+
|
|
167
|
+
See [dashboard.md](docs/dashboard.md) for full details. REST client scripts (`scripts/index-server-client.ps1` and `scripts/index-server-client.sh`) provide full CRUD access for CI pipelines and subagents without MCP — see [tools.md](docs/tools.md#rest-client-scripts-agent-access-without-mcp).
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Key Features
|
|
172
|
+
|
|
173
|
+
- **MCP protocol compliance** — Full JSON-RPC 2.0 over stdio with schema validation
|
|
174
|
+
- **40+ tools** for search, CRUD, governance, analytics, messaging, and feedback
|
|
175
|
+
- **Semantic search** — Optional embedding-based similarity search (HuggingFace models)
|
|
176
|
+
- **Bootstrap security** — Mutations gated until human confirmation on fresh installs
|
|
177
|
+
- **Cross-repo knowledge promotion** — Validate locally, then promote proven patterns to the shared catalog
|
|
178
|
+
- **Governance workflows** — Ownership, versioning, approval status, and deterministic governance hashing
|
|
179
|
+
- **REST client scripts** — PowerShell and Bash scripts for CI/agents without MCP
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Documentation
|
|
184
|
+
|
|
185
|
+
| Document | Purpose |
|
|
186
|
+
|----------|---------|
|
|
187
|
+
| [Quick Start](docs/quickstart.md) | Get running in 5 minutes |
|
|
188
|
+
| [Use Cases](docs/use-cases.md) | Real-world scenarios and workflows |
|
|
189
|
+
| [API Reference](docs/tools.md) | Complete MCP tool documentation |
|
|
190
|
+
| [MCP Configuration](docs/mcp_configuration.md) | Setup patterns for all environments |
|
|
191
|
+
| [Server Configuration](docs/configuration.md) | Environment variables and CLI options |
|
|
192
|
+
| [Architecture](docs/architecture.md) | System design and component overview |
|
|
193
|
+
| [Admin Dashboard](docs/dashboard.md) | UI features, drift monitoring, maintenance |
|
|
194
|
+
| [Content Guidance](docs/content_guidance.md) | Local vs. central instruction guidance |
|
|
195
|
+
| [Network Privacy](docs/network-privacy.md) | Network transparency and offline deployment |
|
|
196
|
+
| [Documentation Index](docs/docs_index.md) | Full documentation map |
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Security
|
|
201
|
+
|
|
202
|
+
Index Server makes **zero telemetry calls** and sends **no data to external services** during normal operation. The dashboard binds to **localhost only** by default. All mutations require explicit enablement and are audit-logged. Fresh installations gate mutations until human confirmation via the bootstrap workflow.
|
|
203
|
+
|
|
204
|
+
See [SECURITY.md](SECURITY.md) for vulnerability reporting and [Network Privacy Guide](docs/network-privacy.md) for offline deployment and verification.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Development
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
npm install # Install dependencies
|
|
212
|
+
npm run build # Build TypeScript
|
|
213
|
+
npm test # Run test suite
|
|
214
|
+
npm run typecheck # Type checking
|
|
215
|
+
npm run lint # Linting
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow, code standards, and testing requirements.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## License
|
|
223
|
+
|
|
224
|
+
MIT License — see [LICENSE](LICENSE) file for details.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
Built with [Model Context Protocol (MCP)](https://modelcontextprotocol.io), TypeScript, Node.js, Vitest, and AJV.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
|---------|--------------------|
|
|
7
|
+
| 1.x.x | ✅ Active support |
|
|
8
|
+
| < 1.0 | ❌ End of life |
|
|
9
|
+
|
|
10
|
+
## Reporting a Vulnerability
|
|
11
|
+
|
|
12
|
+
**Do NOT open public issues for security vulnerabilities.**
|
|
13
|
+
|
|
14
|
+
Please report suspected vulnerabilities privately using one of these methods:
|
|
15
|
+
|
|
16
|
+
1. **GitHub Security Advisories** (preferred) — create a new advisory on the [public repository](https://github.com/jagilber-org/index-server/security/advisories).
|
|
17
|
+
2. **Email** — contact the maintainer at the email listed in the repository's GitHub profile.
|
|
18
|
+
|
|
19
|
+
When reporting, include:
|
|
20
|
+
|
|
21
|
+
- Reproduction steps and environment details
|
|
22
|
+
- Impact assessment and affected versions
|
|
23
|
+
- Any relevant logs or proof-of-concept (redact sensitive data)
|
|
24
|
+
|
|
25
|
+
### Response Timeline
|
|
26
|
+
|
|
27
|
+
- **Acknowledgement**: within 48 hours of receipt
|
|
28
|
+
- **Detailed response**: within 7 business days
|
|
29
|
+
- **Fix or mitigation**: coordinated with reporter before public disclosure
|
|
30
|
+
|
|
31
|
+
## Vulnerability Disclosure
|
|
32
|
+
|
|
33
|
+
We follow responsible disclosure practices:
|
|
34
|
+
|
|
35
|
+
- Confirm the issue and assign a CVE if applicable.
|
|
36
|
+
- Prepare a fix and coordinate a release timeline with the reporter.
|
|
37
|
+
- Credit reporters who wish to be acknowledged in the advisory and changelog.
|
|
38
|
+
|
|
39
|
+
## Security Practices
|
|
40
|
+
|
|
41
|
+
- **Pre-commit hooks** scan for secrets and PII before code leaves the developer machine
|
|
42
|
+
- **Bootstrap gating** — all mutation operations require explicit bootstrap confirmation
|
|
43
|
+
- **Audit logging** — every Index mutation is logged with timestamp, action, and actor
|
|
44
|
+
- **Content scanning** — automated checks before public publishing via dual-repo workflow
|
|
45
|
+
- **Mutation controls** — `INDEX_SERVER_MUTATION` environment variable gates write operations
|
|
46
|
+
- **Auth key support** — optional `INDEX_SERVER_AUTH_KEY` for securing dashboard and API access
|
|
47
|
+
|
|
48
|
+
## Hardening Notes
|
|
49
|
+
|
|
50
|
+
This project includes enterprise hardening (see `HARDENING-DESIGN.md`). Keep auth secrets (`INDEX_SERVER_AUTH_KEY`) private. Avoid committing credentials or tokens.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type LogLevel = 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
|
2
|
+
export declare const CWD: string;
|
|
3
|
+
export declare function toAbsolute(raw: string | undefined, fallback?: string): string;
|
|
4
|
+
export declare function numberFromEnv(name: string, defaultValue: number): number;
|
|
5
|
+
export declare function optionalNumberFromEnv(name: string): number | undefined;
|
|
6
|
+
export declare function floatFromEnv(name: string, defaultValue: number): number;
|
|
7
|
+
export declare function optionalIntFromEnv(name: string): number | undefined;
|
|
8
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
9
|
+
export declare function stringFromEnv(name: string, defaultValue: string): string;
|
|
10
|
+
export declare function parseCsvEnv(name: string): string[];
|
|
11
|
+
export declare function parseJSONMaybe<T = unknown>(src?: string): T | undefined;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CWD = void 0;
|
|
7
|
+
exports.toAbsolute = toAbsolute;
|
|
8
|
+
exports.numberFromEnv = numberFromEnv;
|
|
9
|
+
exports.optionalNumberFromEnv = optionalNumberFromEnv;
|
|
10
|
+
exports.floatFromEnv = floatFromEnv;
|
|
11
|
+
exports.optionalIntFromEnv = optionalIntFromEnv;
|
|
12
|
+
exports.clamp = clamp;
|
|
13
|
+
exports.stringFromEnv = stringFromEnv;
|
|
14
|
+
exports.parseCsvEnv = parseCsvEnv;
|
|
15
|
+
exports.parseJSONMaybe = parseJSONMaybe;
|
|
16
|
+
/**
|
|
17
|
+
* Shared low-level utilities used by config domain modules.
|
|
18
|
+
* No imports from other local config files — safe to import anywhere.
|
|
19
|
+
*/
|
|
20
|
+
const path_1 = __importDefault(require("path"));
|
|
21
|
+
exports.CWD = process.cwd();
|
|
22
|
+
function toAbsolute(raw, fallback) {
|
|
23
|
+
if (raw && raw.trim().length) {
|
|
24
|
+
return path_1.default.isAbsolute(raw) ? raw : path_1.default.resolve(exports.CWD, raw);
|
|
25
|
+
}
|
|
26
|
+
if (fallback && fallback.trim().length) {
|
|
27
|
+
return path_1.default.isAbsolute(fallback) ? fallback : path_1.default.resolve(exports.CWD, fallback);
|
|
28
|
+
}
|
|
29
|
+
return exports.CWD;
|
|
30
|
+
}
|
|
31
|
+
function numberFromEnv(name, defaultValue) {
|
|
32
|
+
const raw = process.env[name];
|
|
33
|
+
if (!raw)
|
|
34
|
+
return defaultValue;
|
|
35
|
+
const value = Number(raw);
|
|
36
|
+
return Number.isFinite(value) ? value : defaultValue;
|
|
37
|
+
}
|
|
38
|
+
function optionalNumberFromEnv(name) {
|
|
39
|
+
const raw = process.env[name];
|
|
40
|
+
if (raw === undefined)
|
|
41
|
+
return undefined;
|
|
42
|
+
const value = Number(raw);
|
|
43
|
+
return Number.isFinite(value) ? value : undefined;
|
|
44
|
+
}
|
|
45
|
+
function floatFromEnv(name, defaultValue) {
|
|
46
|
+
const raw = process.env[name];
|
|
47
|
+
if (!raw)
|
|
48
|
+
return defaultValue;
|
|
49
|
+
const value = Number.parseFloat(raw);
|
|
50
|
+
return Number.isFinite(value) ? value : defaultValue;
|
|
51
|
+
}
|
|
52
|
+
function optionalIntFromEnv(name) {
|
|
53
|
+
const raw = process.env[name];
|
|
54
|
+
if (raw === undefined)
|
|
55
|
+
return undefined;
|
|
56
|
+
const value = Number.parseInt(raw, 10);
|
|
57
|
+
return Number.isFinite(value) ? value : undefined;
|
|
58
|
+
}
|
|
59
|
+
function clamp(value, min, max) {
|
|
60
|
+
if (value < min)
|
|
61
|
+
return min;
|
|
62
|
+
if (value > max)
|
|
63
|
+
return max;
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
function stringFromEnv(name, defaultValue) {
|
|
67
|
+
const raw = process.env[name];
|
|
68
|
+
if (raw && raw.trim().length)
|
|
69
|
+
return raw;
|
|
70
|
+
return defaultValue;
|
|
71
|
+
}
|
|
72
|
+
function parseCsvEnv(name) {
|
|
73
|
+
const raw = process.env[name];
|
|
74
|
+
if (!raw)
|
|
75
|
+
return [];
|
|
76
|
+
return raw.split(/[,\s]+/).map(s => s.trim()).filter(Boolean);
|
|
77
|
+
}
|
|
78
|
+
function parseJSONMaybe(src) {
|
|
79
|
+
if (!src)
|
|
80
|
+
return undefined;
|
|
81
|
+
try {
|
|
82
|
+
return JSON.parse(src);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
interface DashboardTlsConfig {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
certPath?: string;
|
|
4
|
+
keyPath?: string;
|
|
5
|
+
caPath?: string;
|
|
6
|
+
}
|
|
7
|
+
interface DashboardHttpConfig {
|
|
8
|
+
enable: boolean;
|
|
9
|
+
port: number;
|
|
10
|
+
host: string;
|
|
11
|
+
maxPortTries: number;
|
|
12
|
+
enableHttpMetrics: boolean;
|
|
13
|
+
requestTimeoutMs: number;
|
|
14
|
+
maxConnections: number;
|
|
15
|
+
verboseLogging: boolean;
|
|
16
|
+
mutationEnabled: boolean;
|
|
17
|
+
adminApiKey?: string;
|
|
18
|
+
rateLimitEnabled: boolean;
|
|
19
|
+
tls: DashboardTlsConfig;
|
|
20
|
+
}
|
|
21
|
+
interface DashboardAdminConfig {
|
|
22
|
+
maxSessionHistory: number;
|
|
23
|
+
backupsDir: string;
|
|
24
|
+
instructionsDir: string;
|
|
25
|
+
stateDir: string;
|
|
26
|
+
}
|
|
27
|
+
interface DashboardSessionPersistenceConfig {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
persistenceDir: string;
|
|
30
|
+
backupIntegration: boolean;
|
|
31
|
+
retention: {
|
|
32
|
+
maxHistoryEntries: number;
|
|
33
|
+
maxHistoryDays: number;
|
|
34
|
+
maxConnectionHistoryDays: number;
|
|
35
|
+
};
|
|
36
|
+
persistenceIntervalMs: number;
|
|
37
|
+
deduplicationEnabled: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface DashboardConfig {
|
|
40
|
+
http: DashboardHttpConfig;
|
|
41
|
+
admin: DashboardAdminConfig;
|
|
42
|
+
sessionPersistence: DashboardSessionPersistenceConfig;
|
|
43
|
+
graphEnabled: boolean;
|
|
44
|
+
}
|
|
45
|
+
export declare function parseDashboardConfig(mutationEnabled: boolean, instructionsBaseDir: string): DashboardConfig;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseDashboardConfig = parseDashboardConfig;
|
|
7
|
+
/**
|
|
8
|
+
* Dashboard domain config: HTTP server, TLS, WebSocket, and session persistence settings.
|
|
9
|
+
*/
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const envUtils_1 = require("../utils/envUtils");
|
|
12
|
+
const SessionPersistence_js_1 = require("../models/SessionPersistence.js");
|
|
13
|
+
const configUtils_1 = require("./configUtils");
|
|
14
|
+
const dirConstants_1 = require("./dirConstants");
|
|
15
|
+
const defaultValues_1 = require("./defaultValues");
|
|
16
|
+
function isDevMode() {
|
|
17
|
+
return process.env.NODE_ENV === 'development' || process.argv.some(a => a === '--watch' || a.includes('--watch'));
|
|
18
|
+
}
|
|
19
|
+
function parseDashboardConfig(mutationEnabled, instructionsBaseDir) {
|
|
20
|
+
const persistenceDefaults = SessionPersistence_js_1.DEFAULT_SESSION_PERSISTENCE_CONFIG;
|
|
21
|
+
const persistenceEnv = SessionPersistence_js_1.SESSION_PERSISTENCE_ENV_VARS;
|
|
22
|
+
const persistenceEnabled = (0, envUtils_1.parseBooleanEnv)(process.env[persistenceEnv.ENABLED], persistenceDefaults.enabled);
|
|
23
|
+
const persistenceDir = (0, configUtils_1.toAbsolute)(process.env[persistenceEnv.PERSISTENCE_DIR], persistenceDefaults.persistenceDir);
|
|
24
|
+
const persistenceInterval = (0, configUtils_1.numberFromEnv)(persistenceEnv.PERSISTENCE_INTERVAL_MS, persistenceDefaults.persistence.intervalMs);
|
|
25
|
+
const backupsDir = (0, configUtils_1.toAbsolute)(process.env.INDEX_SERVER_BACKUPS_DIR, path_1.default.join(configUtils_1.CWD, dirConstants_1.DIR.BACKUPS));
|
|
26
|
+
const stateDir = (0, configUtils_1.toAbsolute)(process.env.INDEX_SERVER_STATE_DIR, path_1.default.join(configUtils_1.CWD, dirConstants_1.DIR.DATA_STATE));
|
|
27
|
+
return {
|
|
28
|
+
http: {
|
|
29
|
+
enable: (0, envUtils_1.getBooleanEnv)('INDEX_SERVER_DASHBOARD'),
|
|
30
|
+
port: (0, configUtils_1.numberFromEnv)('INDEX_SERVER_DASHBOARD_PORT', isDevMode() ? defaultValues_1.DEFAULT_PORTS.DASHBOARD_DEV : defaultValues_1.DEFAULT_PORTS.DASHBOARD),
|
|
31
|
+
host: (0, configUtils_1.stringFromEnv)('INDEX_SERVER_DASHBOARD_HOST', '127.0.0.1'),
|
|
32
|
+
maxPortTries: Math.max(1, (0, configUtils_1.numberFromEnv)('INDEX_SERVER_DASHBOARD_TRIES', defaultValues_1.DEFAULT_LIMITS.MAX_PORT_TRIES)),
|
|
33
|
+
enableHttpMetrics: (0, envUtils_1.getBooleanEnv)('INDEX_SERVER_HTTP_METRICS', true),
|
|
34
|
+
requestTimeoutMs: (0, configUtils_1.numberFromEnv)('INDEX_SERVER_REQUEST_TIMEOUT', defaultValues_1.DEFAULT_TIMEOUTS_MS.REQUEST_TIMEOUT),
|
|
35
|
+
maxConnections: (0, configUtils_1.numberFromEnv)('INDEX_SERVER_MAX_CONNECTIONS', defaultValues_1.DEFAULT_LIMITS.MAX_CONNECTIONS),
|
|
36
|
+
verboseLogging: (0, envUtils_1.getBooleanEnv)('INDEX_SERVER_VERBOSE_LOGGING'),
|
|
37
|
+
mutationEnabled,
|
|
38
|
+
adminApiKey: process.env.INDEX_SERVER_ADMIN_API_KEY || undefined,
|
|
39
|
+
rateLimitEnabled: !(0, envUtils_1.getBooleanEnv)('INDEX_SERVER_DISABLE_RATE_LIMIT'),
|
|
40
|
+
tls: {
|
|
41
|
+
enabled: (0, envUtils_1.getBooleanEnv)('INDEX_SERVER_DASHBOARD_TLS'),
|
|
42
|
+
certPath: process.env.INDEX_SERVER_DASHBOARD_TLS_CERT || undefined,
|
|
43
|
+
keyPath: process.env.INDEX_SERVER_DASHBOARD_TLS_KEY || undefined,
|
|
44
|
+
caPath: process.env.INDEX_SERVER_DASHBOARD_TLS_CA || undefined,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
admin: {
|
|
48
|
+
maxSessionHistory: (0, configUtils_1.numberFromEnv)('INDEX_SERVER_ADMIN_MAX_SESSION_HISTORY', defaultValues_1.DEFAULT_LIMITS.MAX_SESSION_HISTORY),
|
|
49
|
+
backupsDir,
|
|
50
|
+
instructionsDir: instructionsBaseDir,
|
|
51
|
+
stateDir,
|
|
52
|
+
},
|
|
53
|
+
sessionPersistence: {
|
|
54
|
+
enabled: persistenceEnabled,
|
|
55
|
+
persistenceDir,
|
|
56
|
+
backupIntegration: (0, envUtils_1.parseBooleanEnv)(process.env[persistenceEnv.BACKUP_INTEGRATION], persistenceDefaults.backupIntegration),
|
|
57
|
+
retention: {
|
|
58
|
+
maxHistoryEntries: (0, configUtils_1.numberFromEnv)(persistenceEnv.MAX_HISTORY_ENTRIES, persistenceDefaults.retention.maxHistoryEntries),
|
|
59
|
+
maxHistoryDays: (0, configUtils_1.numberFromEnv)(persistenceEnv.MAX_HISTORY_DAYS, persistenceDefaults.retention.maxHistoryDays),
|
|
60
|
+
maxConnectionHistoryDays: (0, configUtils_1.numberFromEnv)(persistenceEnv.MAX_CONNECTION_HISTORY_DAYS, persistenceDefaults.retention.maxConnectionHistoryDays),
|
|
61
|
+
},
|
|
62
|
+
persistenceIntervalMs: persistenceInterval,
|
|
63
|
+
deduplicationEnabled: (0, envUtils_1.parseBooleanEnv)(process.env[persistenceEnv.DEDUPLICATION_ENABLED], persistenceDefaults.deduplication.enabled),
|
|
64
|
+
},
|
|
65
|
+
graphEnabled: (0, envUtils_1.getBooleanEnv)('INDEX_SERVER_DASHBOARD_GRAPH'),
|
|
66
|
+
};
|
|
67
|
+
}
|