@m6d/cortex-server 1.8.0 → 2.0.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/README.md +8 -3
- package/contracts/README.md +23 -0
- package/contracts/graph/embed.ts +50 -0
- package/{src/lib → contracts}/graph/helpers.ts +4 -10
- package/{src/lib → contracts}/graph/neo4j.ts +14 -27
- package/contracts/graph/schema.ts +65 -0
- package/{src/lib → contracts}/graph/types.ts +2 -29
- package/contracts/graph.ts +36 -0
- package/contracts/runtime.ts +208 -0
- package/contracts/wire.ts +143 -0
- package/dist/contracts/graph/embed.d.ts +22 -0
- package/dist/{src/lib → contracts}/graph/helpers.d.ts +16 -14
- package/dist/{src/lib → contracts}/graph/neo4j.d.ts +5 -5
- package/dist/contracts/graph/schema.d.ts +62 -0
- package/dist/{src/lib → contracts}/graph/types.d.ts +1 -1
- package/dist/contracts/graph.d.ts +14 -0
- package/dist/contracts/runtime.d.ts +278 -0
- package/dist/contracts/wire.d.ts +120 -0
- package/dist/src/lib/adapters/database/index.d.ts +61 -0
- package/dist/src/lib/adapters/database/message-content.d.ts +30 -0
- package/dist/src/lib/adapters/database/mssql/attachments.d.ts +100 -0
- package/dist/src/lib/adapters/database/mssql/client.d.ts +8 -0
- package/dist/src/lib/adapters/database/mssql/index.d.ts +194 -0
- package/dist/src/lib/adapters/database/mssql/llm-requests.d.ts +17 -0
- package/dist/src/lib/adapters/database/mssql/messages.d.ts +37 -0
- package/dist/src/lib/adapters/database/mssql/threads.d.ts +50 -0
- package/dist/src/lib/adapters/database/postgres/attachments.d.ts +113 -0
- package/dist/src/lib/adapters/database/postgres/client.d.ts +8 -0
- package/dist/src/lib/adapters/database/postgres/index.d.ts +207 -0
- package/dist/src/lib/adapters/database/postgres/llm-requests.d.ts +17 -0
- package/dist/src/lib/adapters/database/postgres/messages.d.ts +37 -0
- package/dist/src/lib/adapters/database/postgres/threads.d.ts +50 -0
- package/{src/lib/adapters/storage.ts → dist/src/lib/adapters/storage/index.d.ts} +1 -1
- package/dist/src/lib/adapters/{minio.d.ts → storage/minio.d.ts} +1 -1
- package/dist/src/lib/ai/active-runs.d.ts +63 -0
- package/dist/src/lib/ai/attachments.d.ts +30 -0
- package/dist/src/lib/ai/backend-url.d.ts +16 -0
- package/dist/src/lib/ai/cc-runtime.d.ts +61 -0
- package/dist/src/lib/ai/commit-gate.d.ts +21 -0
- package/dist/src/lib/ai/context/builder.d.ts +6 -7
- package/dist/src/lib/ai/context/compression-middleware.d.ts +15 -0
- package/dist/src/lib/ai/context/compressor.d.ts +2 -13
- package/dist/src/lib/ai/context/intra-turn-compressor.d.ts +9 -9
- package/dist/src/lib/ai/context/optimize-thread-context.d.ts +9 -0
- package/dist/src/lib/ai/context/summarizer.d.ts +3 -3
- package/dist/src/lib/ai/context/token-estimator.d.ts +5 -8
- package/dist/src/lib/ai/fetch.d.ts +1 -1
- package/dist/src/lib/ai/finish-turn.d.ts +23 -0
- package/dist/src/lib/ai/helpers.d.ts +37 -4
- package/dist/src/lib/ai/index.d.ts +6 -3
- package/dist/src/lib/ai/inspector.d.ts +41 -0
- package/dist/src/lib/ai/interceptors/request-interceptor.d.ts +6 -5
- package/dist/src/lib/ai/prompt.d.ts +5 -4
- package/dist/src/lib/ai/redis-runs.d.ts +41 -0
- package/dist/src/lib/ai/redis-stream-log.d.ts +39 -0
- package/dist/src/lib/ai/tools/execute-code.tool.d.ts +18 -4
- package/dist/src/lib/ai/tools/query-graph.tool.d.ts +13 -5
- package/dist/src/lib/ai/tools/read-attachment.tool.d.ts +21 -0
- package/dist/src/lib/ai/tools/search-common.d.ts +17 -0
- package/dist/src/lib/ai/tools/search-knowledge.tool.d.ts +15 -0
- package/dist/src/lib/ai/tools/search-services.tool.d.ts +12 -0
- package/dist/src/lib/ai/tools/search-tools.tool.d.ts +12 -0
- package/dist/src/lib/ai/turn-tools.d.ts +39 -0
- package/dist/src/lib/ai/vision/rasterize-pdf.d.ts +26 -0
- package/dist/src/lib/ai/vision/rasterize-pdf.worker.d.ts +1 -0
- package/dist/src/lib/ai/vision/vision-reader.d.ts +45 -0
- package/dist/src/lib/cc/client.d.ts +183 -0
- package/dist/src/lib/cc/config-cache.d.ts +20 -0
- package/dist/src/lib/cc/format.d.ts +23 -0
- package/dist/src/lib/cc/registry.d.ts +34 -0
- package/dist/src/lib/cc/types.d.ts +27 -0
- package/dist/src/lib/config.d.ts +81 -64
- package/dist/src/lib/db/drizzle.config.mssql.d.ts +2 -0
- package/dist/src/lib/db/drizzle.config.pg.d.ts +2 -0
- package/dist/src/lib/db/migrate.d.ts +7 -1
- package/dist/src/lib/db/{schema.d.ts → schema.mssql.d.ts} +138 -29
- package/dist/src/lib/db/schema.pg.d.ts +546 -0
- package/dist/src/lib/factory.d.ts +2 -12
- package/dist/src/lib/graph/index.d.ts +10 -11
- package/dist/src/lib/graph/resolver.d.ts +2 -3
- package/dist/src/lib/index.d.ts +3 -3
- package/dist/src/lib/redis.d.ts +19 -0
- package/dist/src/lib/routes/chat.d.ts +1 -1
- package/dist/src/lib/routes/files.d.ts +1 -1
- package/dist/src/lib/routes/owned-thread.d.ts +17 -0
- package/dist/src/lib/routes/threads.d.ts +1 -1
- package/dist/src/lib/routes/ws.d.ts +1 -1
- package/dist/src/lib/types.d.ts +20 -37
- package/dist/src/lib/ws/connections.d.ts +2 -1
- package/package.json +33 -18
- package/src/lib/adapters/database/index.ts +78 -0
- package/src/lib/adapters/database/message-content.ts +39 -0
- package/src/lib/adapters/database/mssql/attachments.ts +90 -0
- package/src/lib/adapters/database/mssql/client.ts +11 -0
- package/src/lib/adapters/database/mssql/index.ts +23 -0
- package/src/lib/adapters/database/mssql/llm-requests.ts +43 -0
- package/src/lib/adapters/database/mssql/messages.ts +92 -0
- package/src/lib/adapters/database/mssql/threads.ts +83 -0
- package/src/lib/adapters/database/postgres/attachments.ts +88 -0
- package/src/lib/adapters/database/postgres/client.ts +11 -0
- package/src/lib/adapters/database/postgres/index.ts +23 -0
- package/src/lib/adapters/database/postgres/llm-requests.ts +45 -0
- package/src/lib/adapters/database/postgres/messages.ts +92 -0
- package/src/lib/adapters/database/postgres/threads.ts +84 -0
- package/{dist/src/lib/adapters/storage.d.ts → src/lib/adapters/storage/index.ts} +1 -1
- package/src/lib/adapters/{minio.ts → storage/minio.ts} +5 -5
- package/src/lib/ai/active-runs.ts +157 -0
- package/src/lib/ai/attachments.ts +144 -0
- package/src/lib/ai/backend-url.ts +27 -0
- package/src/lib/ai/cc-runtime.ts +63 -0
- package/src/lib/ai/commit-gate.ts +116 -0
- package/src/lib/ai/context/builder.ts +12 -14
- package/src/lib/ai/context/compression-middleware.ts +44 -0
- package/src/lib/ai/context/compressor.ts +67 -59
- package/src/lib/ai/context/intra-turn-compressor.ts +121 -204
- package/src/lib/ai/context/optimize-thread-context.ts +50 -0
- package/src/lib/ai/context/summarizer.ts +28 -30
- package/src/lib/ai/context/token-estimator.ts +35 -30
- package/src/lib/ai/fetch.ts +10 -5
- package/src/lib/ai/finish-turn.ts +75 -0
- package/src/lib/ai/helpers.ts +83 -15
- package/src/lib/ai/index.ts +359 -329
- package/src/lib/ai/inspector.ts +112 -0
- package/src/lib/ai/interceptors/request-interceptor.ts +70 -42
- package/src/lib/ai/prompt.ts +126 -125
- package/src/lib/ai/redis-runs.ts +167 -0
- package/src/lib/ai/redis-stream-log.ts +219 -0
- package/src/lib/ai/tools/execute-code.tool.ts +178 -67
- package/src/lib/ai/tools/query-graph.tool.ts +7 -8
- package/src/lib/ai/tools/read-attachment.tool.ts +59 -0
- package/src/lib/ai/tools/search-common.ts +15 -0
- package/src/lib/ai/tools/search-knowledge.tool.ts +33 -0
- package/src/lib/ai/tools/search-services.tool.ts +31 -0
- package/src/lib/ai/tools/search-tools.tool.ts +29 -0
- package/src/lib/ai/turn-tools.ts +154 -0
- package/src/lib/ai/vision/rasterize-pdf.ts +69 -0
- package/src/lib/ai/vision/rasterize-pdf.worker.ts +81 -0
- package/src/lib/ai/vision/vision-reader.ts +130 -0
- package/src/lib/auth/middleware.ts +5 -3
- package/src/lib/cc/client.ts +273 -0
- package/src/lib/cc/config-cache.ts +32 -0
- package/src/lib/cc/format.ts +96 -0
- package/src/lib/cc/registry.ts +62 -0
- package/src/lib/cc/types.ts +44 -0
- package/src/lib/config.ts +102 -71
- package/src/lib/db/drizzle.config.mssql.ts +9 -0
- package/src/lib/db/drizzle.config.pg.ts +9 -0
- package/src/lib/db/migrate.ts +45 -10
- package/src/lib/db/migrations/mssql/20260729092726_talented_wilson_fisk/migration.sql +20 -0
- package/src/lib/db/migrations/mssql/20260729092726_talented_wilson_fisk/snapshot.json +497 -0
- package/src/lib/db/migrations/mssql/20260801003652_perpetual_blue_shield/migration.sql +1 -0
- package/src/lib/db/migrations/mssql/20260801003652_perpetual_blue_shield/snapshot.json +516 -0
- package/src/lib/db/migrations/mssql/20260812174642_user_id_text/migration.sql +2 -0
- package/src/lib/db/migrations/mssql/20260812174642_user_id_text/snapshot.json +516 -0
- package/src/lib/db/migrations/pg/20260801084117_thick_ben_grimm/migration.sql +53 -0
- package/src/lib/db/migrations/pg/20260801084117_thick_ben_grimm/snapshot.json +584 -0
- package/src/lib/db/migrations/pg/20260812174622_user_id_text/migration.sql +2 -0
- package/src/lib/db/migrations/pg/20260812174622_user_id_text/snapshot.json +584 -0
- package/src/lib/db/{schema.ts → schema.mssql.ts} +29 -18
- package/src/lib/db/schema.pg.ts +95 -0
- package/src/lib/factory.ts +44 -89
- package/src/lib/graph/index.ts +12 -40
- package/src/lib/graph/resolver.ts +146 -116
- package/src/lib/index.ts +11 -4
- package/src/lib/redis.ts +44 -0
- package/src/lib/routes/chat.ts +91 -62
- package/src/lib/routes/files.ts +105 -83
- package/src/lib/routes/owned-thread.ts +17 -0
- package/src/lib/routes/threads.ts +14 -30
- package/src/lib/routes/ws.ts +9 -3
- package/src/lib/types.ts +37 -36
- package/src/lib/ws/connections.ts +9 -1
- package/tsconfig.json +48 -0
- package/dist/src/lib/adapters/database.d.ts +0 -45
- package/dist/src/lib/adapters/mssql.d.ts +0 -3
- package/dist/src/lib/ai/active-streams.d.ts +0 -14
- package/dist/src/lib/ai/context/index.d.ts +0 -16
- package/dist/src/lib/ai/tools/capture-files.tool.d.ts +0 -6
- package/dist/src/lib/cli/extract-endpoints.d.ts +0 -6
- package/dist/src/lib/graph/expand-domains.d.ts +0 -2
- package/dist/src/lib/graph/generate-cypher.d.ts +0 -22
- package/dist/src/lib/graph/seed.d.ts +0 -19
- package/dist/src/lib/graph/validate.d.ts +0 -2
- package/dist/src/lib/routes/index.d.ts +0 -4
- package/dist/src/lib/ws/events.d.ts +0 -39
- package/dist/src/lib/ws/index.d.ts +0 -3
- package/dist/src/lib/ws/notify.d.ts +0 -2
- package/src/lib/adapters/database.ts +0 -48
- package/src/lib/adapters/mssql.ts +0 -231
- package/src/lib/ai/active-streams.ts +0 -123
- package/src/lib/ai/context/index.ts +0 -80
- package/src/lib/ai/tools/capture-files.tool.ts +0 -20
- package/src/lib/cli/extract-endpoints.ts +0 -550
- package/src/lib/graph/expand-domains.ts +0 -276
- package/src/lib/graph/generate-cypher.ts +0 -192
- package/src/lib/graph/seed.ts +0 -162
- package/src/lib/graph/validate.ts +0 -78
- package/src/lib/routes/index.ts +0 -4
- package/src/lib/ws/events.ts +0 -39
- package/src/lib/ws/index.ts +0 -11
- package/src/lib/ws/notify.ts +0 -9
- package/src/sample/db/client.ts +0 -9
- package/src/sample/db/migrations/20260411023125_rich_purple_man/migration.sql +0 -5
- package/src/sample/db/migrations/20260411023125_rich_purple_man/snapshot.json +0 -50
- package/src/sample/db/schema.ts +0 -10
- package/src/sample/domains/account/concepts/session.concept.ts +0 -17
- package/src/sample/domains/account/endpoints/listCurrentSessions.endpoint.ts +0 -31
- package/src/sample/domains/account/endpoints/revokeAllOtherSessions.endpoint.ts +0 -22
- package/src/sample/domains/account/endpoints/revokeCurrentSession.endpoint.ts +0 -33
- package/src/sample/domains/account/index.ts +0 -18
- package/src/sample/domains/appraisals/concepts/appraisalCycle.concept.ts +0 -15
- package/src/sample/domains/appraisals/concepts/appraisalRecord.concept.ts +0 -20
- package/src/sample/domains/appraisals/concepts/appraisalRecordCompetency.concept.ts +0 -10
- package/src/sample/domains/appraisals/concepts/appraisalRecordFunctionalRequirement.concept.ts +0 -10
- package/src/sample/domains/appraisals/concepts/appraisalRecordGoal.concept.ts +0 -17
- package/src/sample/domains/appraisals/endpoints/getAppraisalRecordById.endpoint.ts +0 -321
- package/src/sample/domains/appraisals/endpoints/getAppraisalRecordCompetencies.endpoint.ts +0 -120
- package/src/sample/domains/appraisals/endpoints/getAppraisalRecordFunctionalRequirements.endpoint.ts +0 -126
- package/src/sample/domains/appraisals/endpoints/getAppraisalRecordGoals.endpoint.ts +0 -104
- package/src/sample/domains/appraisals/endpoints/getAppraisalRecordScore.endpoint.ts +0 -58
- package/src/sample/domains/appraisals/endpoints/listAppraisalCyclesSimple.endpoint.ts +0 -52
- package/src/sample/domains/appraisals/endpoints/listAppraisalRecords.endpoint.ts +0 -245
- package/src/sample/domains/appraisals/endpoints/listAppraisalTemplatesSimple.endpoint.ts +0 -52
- package/src/sample/domains/appraisals/index.ts +0 -40
- package/src/sample/domains/appraisals/rules/appraisalRecordScoping.rule.ts +0 -7
- package/src/sample/domains/attendance/concepts/attendancePermission.concept.ts +0 -17
- package/src/sample/domains/attendance/concepts/attendanceTransaction.concept.ts +0 -17
- package/src/sample/domains/attendance/concepts/publicHoliday.concept.ts +0 -10
- package/src/sample/domains/attendance/concepts/punch.concept.ts +0 -19
- package/src/sample/domains/attendance/endpoints/getAttendanceTransactionById.endpoint.ts +0 -444
- package/src/sample/domains/attendance/endpoints/getCurrentAttendanceProfile.endpoint.ts +0 -886
- package/src/sample/domains/attendance/endpoints/getCurrentAttendanceStatistics.endpoint.ts +0 -49
- package/src/sample/domains/attendance/endpoints/listAttendancePermissions.endpoint.ts +0 -176
- package/src/sample/domains/attendance/endpoints/listAttendanceTransactionStates.endpoint.ts +0 -26
- package/src/sample/domains/attendance/endpoints/listAttendanceTransactions.endpoint.ts +0 -373
- package/src/sample/domains/attendance/endpoints/listPublicHolidaysSimple.endpoint.ts +0 -52
- package/src/sample/domains/attendance/endpoints/listPunchTypes.endpoint.ts +0 -25
- package/src/sample/domains/attendance/endpoints/listPunches.endpoint.ts +0 -178
- package/src/sample/domains/attendance/index.ts +0 -41
- package/src/sample/domains/attendance/services/attendancePermissions.service.ts +0 -15
- package/src/sample/domains/employees/concepts/employee.concept.ts +0 -20
- package/src/sample/domains/employees/concepts/employeeBankAccount.concept.ts +0 -19
- package/src/sample/domains/employees/concepts/employeeChild.concept.ts +0 -19
- package/src/sample/domains/employees/concepts/employeeDocument.concept.ts +0 -21
- package/src/sample/domains/employees/concepts/employeeEvent.concept.ts +0 -21
- package/src/sample/domains/employees/concepts/employeeExperience.concept.ts +0 -18
- package/src/sample/domains/employees/concepts/employeeJobLevelChange.concept.ts +0 -21
- package/src/sample/domains/employees/concepts/employeeMedal.concept.ts +0 -20
- package/src/sample/domains/employees/concepts/employeeQualification.concept.ts +0 -20
- package/src/sample/domains/employees/concepts/employeeSpouse.concept.ts +0 -21
- package/src/sample/domains/employees/concepts/employeeViolation.concept.ts +0 -19
- package/src/sample/domains/employees/endpoints/getCurrentEmployee.endpoint.ts +0 -1651
- package/src/sample/domains/employees/endpoints/getCurrentIdentity.endpoint.ts +0 -197
- package/src/sample/domains/employees/endpoints/getCurrentManagers.endpoint.ts +0 -142
- package/src/sample/domains/employees/endpoints/getEmployeeById.endpoint.ts +0 -1659
- package/src/sample/domains/employees/endpoints/getEmployeeStatistics.endpoint.ts +0 -43
- package/src/sample/domains/employees/endpoints/listBankAccounts.endpoint.ts +0 -223
- package/src/sample/domains/employees/endpoints/listChildren.endpoint.ts +0 -211
- package/src/sample/domains/employees/endpoints/listDocuments.endpoint.ts +0 -222
- package/src/sample/domains/employees/endpoints/listEmployeesSimple.endpoint.ts +0 -156
- package/src/sample/domains/employees/endpoints/listEvents.endpoint.ts +0 -120
- package/src/sample/domains/employees/endpoints/listExperiences.endpoint.ts +0 -188
- package/src/sample/domains/employees/endpoints/listJobLevelChanges.endpoint.ts +0 -240
- package/src/sample/domains/employees/endpoints/listMedals.endpoint.ts +0 -266
- package/src/sample/domains/employees/endpoints/listQualifications.endpoint.ts +0 -265
- package/src/sample/domains/employees/endpoints/listSpouses.endpoint.ts +0 -278
- package/src/sample/domains/employees/endpoints/listViolations.endpoint.ts +0 -245
- package/src/sample/domains/employees/index.ts +0 -75
- package/src/sample/domains/employees/services/employees.service.ts +0 -181
- package/src/sample/domains/index.ts +0 -10
- package/src/sample/domains/leaves/concepts/leave.concept.ts +0 -21
- package/src/sample/domains/leaves/concepts/leaveBalance.concept.ts +0 -17
- package/src/sample/domains/leaves/concepts/leaveBalanceTransaction.concept.ts +0 -16
- package/src/sample/domains/leaves/concepts/leaveType.concept.ts +0 -13
- package/src/sample/domains/leaves/concepts/leaveTypes.concept.ts +0 -205
- package/src/sample/domains/leaves/endpoints/getBalance.endpoint.ts +0 -53
- package/src/sample/domains/leaves/endpoints/getLeaveById.endpoint.ts +0 -53
- package/src/sample/domains/leaves/endpoints/listBalanceTransactions.endpoint.ts +0 -196
- package/src/sample/domains/leaves/endpoints/listBalanceTypes.endpoint.ts +0 -26
- package/src/sample/domains/leaves/endpoints/listBalances.endpoint.ts +0 -201
- package/src/sample/domains/leaves/endpoints/listLeaveTypes.endpoint.ts +0 -28
- package/src/sample/domains/leaves/endpoints/listLeaves.endpoint.ts +0 -234
- package/src/sample/domains/leaves/index.ts +0 -38
- package/src/sample/domains/leaves/services/leaveRequests.service.ts +0 -232
- package/src/sample/domains/notifications/concepts/notification.concept.ts +0 -19
- package/src/sample/domains/notifications/endpoints/countMyNotifications.endpoint.ts +0 -21
- package/src/sample/domains/notifications/endpoints/getMyNotification.endpoint.ts +0 -57
- package/src/sample/domains/notifications/endpoints/listMyNotifications.endpoint.ts +0 -59
- package/src/sample/domains/notifications/endpoints/markMyNotificationAsRead.endpoint.ts +0 -32
- package/src/sample/domains/notifications/index.ts +0 -20
- package/src/sample/domains/payroll/concepts/payslip.concept.ts +0 -18
- package/src/sample/domains/payroll/concepts/salaryCertificate.concept.ts +0 -17
- package/src/sample/domains/payroll/concepts/salaryCertificateRequestingEntity.concept.ts +0 -8
- package/src/sample/domains/payroll/endpoints/getPayslipById.endpoint.ts +0 -238
- package/src/sample/domains/payroll/endpoints/listPayslips.endpoint.ts +0 -216
- package/src/sample/domains/payroll/endpoints/listSalaryCertificateLanguages.endpoint.ts +0 -25
- package/src/sample/domains/payroll/endpoints/listSalaryCertificateRequestingEntities.endpoint.ts +0 -62
- package/src/sample/domains/payroll/endpoints/listSalaryCertificateTypes.endpoint.ts +0 -24
- package/src/sample/domains/payroll/endpoints/listSalaryCertificates.endpoint.ts +0 -122
- package/src/sample/domains/payroll/endpoints/previewSalaryCertificate.endpoint.ts +0 -45
- package/src/sample/domains/payroll/index.ts +0 -32
- package/src/sample/domains/payroll/rules/payrollEmployeeContext.rule.ts +0 -7
- package/src/sample/domains/payroll/services/salaryCertificates.service.ts +0 -15
- package/src/sample/domains/servicing/concepts/service.concept.ts +0 -6
- package/src/sample/domains/servicing/concepts/serviceRequest.concept.ts +0 -12
- package/src/sample/domains/servicing/concepts/serviceRequestApproval.concept.ts +0 -9
- package/src/sample/domains/servicing/endpoints/cancelServiceRequest.endpoint.ts +0 -21
- package/src/sample/domains/servicing/endpoints/createServiceRequest.endpoint.ts +0 -511
- package/src/sample/domains/servicing/endpoints/getServiceRequest.endpoint.ts +0 -352
- package/src/sample/domains/servicing/endpoints/getServiceRequestFormItems.endpoint.ts +0 -219
- package/src/sample/domains/servicing/endpoints/getServiceRequestTransactionFormItems.endpoint.ts +0 -216
- package/src/sample/domains/servicing/endpoints/getServiceStates.endpoint.ts +0 -47
- package/src/sample/domains/servicing/endpoints/invokeServiceRequestAction.endpoint.ts +0 -139
- package/src/sample/domains/servicing/endpoints/listServiceRequests.endpoint.ts +0 -292
- package/src/sample/domains/servicing/endpoints/listServices.endpoint.ts +0 -108
- package/src/sample/domains/servicing/endpoints/updateServiceRequest.endpoint.ts +0 -355
- package/src/sample/domains/servicing/index.ts +0 -44
- package/src/sample/domains/servicing/rules/checkValidActions.rule.ts +0 -7
- package/src/sample/domains/servicing/rules/createServiceRequest.rule.ts +0 -7
- package/src/sample/domains/servicing/rules/filterServiceRequestsByState.rule.ts +0 -7
- package/src/sample/domains/servicing/rules/passingOptionFields.rule.ts +0 -7
- package/src/sample/domains/shared/rules/pagination.rule.ts +0 -7
- package/src/sample/domains/suggestions/concepts/suggestion.concept.ts +0 -19
- package/src/sample/domains/suggestions/concepts/suggestionCategory.concept.ts +0 -7
- package/src/sample/domains/suggestions/concepts/suggestionImpactLevel.concept.ts +0 -7
- package/src/sample/domains/suggestions/endpoints/createSuggestion.endpoint.ts +0 -705
- package/src/sample/domains/suggestions/endpoints/deleteSuggestion.endpoint.ts +0 -32
- package/src/sample/domains/suggestions/endpoints/getSuggestionById.endpoint.ts +0 -635
- package/src/sample/domains/suggestions/endpoints/listSuggestionCategories.endpoint.ts +0 -62
- package/src/sample/domains/suggestions/endpoints/listSuggestionImpactLevels.endpoint.ts +0 -62
- package/src/sample/domains/suggestions/endpoints/listSuggestionStates.endpoint.ts +0 -24
- package/src/sample/domains/suggestions/endpoints/listSuggestions.endpoint.ts +0 -132
- package/src/sample/domains/suggestions/endpoints/updateSuggestion.endpoint.ts +0 -690
- package/src/sample/domains/suggestions/endpoints/updateSuggestionState.endpoint.ts +0 -39
- package/src/sample/domains/suggestions/index.ts +0 -34
- package/src/sample/domains/suggestions/rules/suggestionScope.rule.ts +0 -7
- package/src/sample/domains/surveys/concepts/survey.concept.ts +0 -10
- package/src/sample/domains/surveys/concepts/surveyResponse.concept.ts +0 -14
- package/src/sample/domains/surveys/endpoints/getSurveyResponseById.endpoint.ts +0 -131
- package/src/sample/domains/surveys/endpoints/getTargetedSurvey.endpoint.ts +0 -129
- package/src/sample/domains/surveys/endpoints/listTargetedSurveys.endpoint.ts +0 -160
- package/src/sample/domains/surveys/endpoints/respondToSurvey.endpoint.ts +0 -144
- package/src/sample/domains/surveys/index.ts +0 -21
- package/src/sample/drizzle.config.ts +0 -11
- package/src/sample/index.bak.ts +0 -341
- package/src/sample/index.ts +0 -318
- package/src/sample/official-statements/defaults.ts +0 -57
- package/src/sample/official-statements/routes.ts +0 -137
- package/src/sample/official-statements/service.ts +0 -148
- package/src/sample/official-statements/types.ts +0 -23
- /package/src/lib/db/migrations/{20260326231647_nice_speedball → mssql/20260326231647_nice_speedball}/migration.sql +0 -0
- /package/src/lib/db/migrations/{20260326231647_nice_speedball → mssql/20260326231647_nice_speedball}/snapshot.json +0 -0
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
import type { ChatMessage, TokenUsage } from "../types";
|
|
2
|
+
import type { ThreadContextMeta } from "../ai/context/types";
|
|
3
|
+
/**
|
|
4
|
+
* The Postgres twin of `schema.mssql.ts`. Drizzle types its schemas per dialect,
|
|
5
|
+
* so the two cannot be shared — `schema.parity.test.ts` asserts at compile time
|
|
6
|
+
* that they still infer the same rows, which is what the rest of the code sees.
|
|
7
|
+
*/
|
|
8
|
+
export declare const aiSchema: import("drizzle-orm/pg-core").PgSchema<"ai">;
|
|
9
|
+
export declare const threads: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
10
|
+
name: "threads";
|
|
11
|
+
schema: "ai";
|
|
12
|
+
columns: {
|
|
13
|
+
createdAt: import("drizzle-orm/pg-core").PgBuildColumn<"threads", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").PgTimestampBuilder>>, {
|
|
14
|
+
name: string;
|
|
15
|
+
tableName: "threads";
|
|
16
|
+
dataType: "object date";
|
|
17
|
+
data: Date;
|
|
18
|
+
driverParam: string;
|
|
19
|
+
notNull: true;
|
|
20
|
+
hasDefault: true;
|
|
21
|
+
isPrimaryKey: false;
|
|
22
|
+
isAutoincrement: false;
|
|
23
|
+
hasRuntimeDefault: false;
|
|
24
|
+
enumValues: undefined;
|
|
25
|
+
identity: undefined;
|
|
26
|
+
generated: undefined;
|
|
27
|
+
}>;
|
|
28
|
+
updatedAt: import("drizzle-orm/pg-core").PgBuildColumn<"threads", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").PgTimestampBuilder>>>, {
|
|
29
|
+
name: string;
|
|
30
|
+
tableName: "threads";
|
|
31
|
+
dataType: "object date";
|
|
32
|
+
data: Date;
|
|
33
|
+
driverParam: string;
|
|
34
|
+
notNull: true;
|
|
35
|
+
hasDefault: true;
|
|
36
|
+
isPrimaryKey: false;
|
|
37
|
+
isAutoincrement: false;
|
|
38
|
+
hasRuntimeDefault: false;
|
|
39
|
+
enumValues: undefined;
|
|
40
|
+
identity: undefined;
|
|
41
|
+
generated: undefined;
|
|
42
|
+
}>;
|
|
43
|
+
id: import("drizzle-orm/pg-core").PgBuildColumn<"threads", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").PgUUIDBuilder>>, {
|
|
44
|
+
name: string;
|
|
45
|
+
tableName: "threads";
|
|
46
|
+
dataType: "string uuid";
|
|
47
|
+
data: string;
|
|
48
|
+
driverParam: string;
|
|
49
|
+
notNull: true;
|
|
50
|
+
hasDefault: true;
|
|
51
|
+
isPrimaryKey: false;
|
|
52
|
+
isAutoincrement: false;
|
|
53
|
+
hasRuntimeDefault: false;
|
|
54
|
+
enumValues: undefined;
|
|
55
|
+
identity: undefined;
|
|
56
|
+
generated: undefined;
|
|
57
|
+
}>;
|
|
58
|
+
userId: import("drizzle-orm/pg-core").PgBuildColumn<"threads", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
59
|
+
name: string;
|
|
60
|
+
tableName: "threads";
|
|
61
|
+
dataType: "string";
|
|
62
|
+
data: string;
|
|
63
|
+
driverParam: string;
|
|
64
|
+
notNull: true;
|
|
65
|
+
hasDefault: false;
|
|
66
|
+
isPrimaryKey: false;
|
|
67
|
+
isAutoincrement: false;
|
|
68
|
+
hasRuntimeDefault: false;
|
|
69
|
+
enumValues: undefined;
|
|
70
|
+
identity: undefined;
|
|
71
|
+
generated: undefined;
|
|
72
|
+
}>;
|
|
73
|
+
agentId: import("drizzle-orm/pg-core").PgBuildColumn<"threads", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>>, {
|
|
74
|
+
name: string;
|
|
75
|
+
tableName: "threads";
|
|
76
|
+
dataType: "string";
|
|
77
|
+
data: string;
|
|
78
|
+
driverParam: string;
|
|
79
|
+
notNull: true;
|
|
80
|
+
hasDefault: true;
|
|
81
|
+
isPrimaryKey: false;
|
|
82
|
+
isAutoincrement: false;
|
|
83
|
+
hasRuntimeDefault: false;
|
|
84
|
+
enumValues: undefined;
|
|
85
|
+
identity: undefined;
|
|
86
|
+
generated: undefined;
|
|
87
|
+
}>;
|
|
88
|
+
title: import("drizzle-orm/pg-core").PgBuildColumn<"threads", import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>, {
|
|
89
|
+
name: string;
|
|
90
|
+
tableName: "threads";
|
|
91
|
+
dataType: "string";
|
|
92
|
+
data: string;
|
|
93
|
+
driverParam: string;
|
|
94
|
+
notNull: false;
|
|
95
|
+
hasDefault: false;
|
|
96
|
+
isPrimaryKey: false;
|
|
97
|
+
isAutoincrement: false;
|
|
98
|
+
hasRuntimeDefault: false;
|
|
99
|
+
enumValues: undefined;
|
|
100
|
+
identity: undefined;
|
|
101
|
+
generated: undefined;
|
|
102
|
+
}>;
|
|
103
|
+
session: import("drizzle-orm/pg-core").PgBuildColumn<"threads", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, Record<string, unknown>>, {
|
|
104
|
+
name: string;
|
|
105
|
+
tableName: "threads";
|
|
106
|
+
dataType: "object json";
|
|
107
|
+
data: Record<string, unknown>;
|
|
108
|
+
driverParam: unknown;
|
|
109
|
+
notNull: false;
|
|
110
|
+
hasDefault: false;
|
|
111
|
+
isPrimaryKey: false;
|
|
112
|
+
isAutoincrement: false;
|
|
113
|
+
hasRuntimeDefault: false;
|
|
114
|
+
enumValues: undefined;
|
|
115
|
+
identity: undefined;
|
|
116
|
+
generated: undefined;
|
|
117
|
+
}>;
|
|
118
|
+
contextMeta: import("drizzle-orm/pg-core").PgBuildColumn<"threads", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, ThreadContextMeta>, {
|
|
119
|
+
name: string;
|
|
120
|
+
tableName: "threads";
|
|
121
|
+
dataType: "object json";
|
|
122
|
+
data: ThreadContextMeta;
|
|
123
|
+
driverParam: unknown;
|
|
124
|
+
notNull: false;
|
|
125
|
+
hasDefault: false;
|
|
126
|
+
isPrimaryKey: false;
|
|
127
|
+
isAutoincrement: false;
|
|
128
|
+
hasRuntimeDefault: false;
|
|
129
|
+
enumValues: undefined;
|
|
130
|
+
identity: undefined;
|
|
131
|
+
generated: undefined;
|
|
132
|
+
}>;
|
|
133
|
+
};
|
|
134
|
+
dialect: "pg";
|
|
135
|
+
}>;
|
|
136
|
+
export declare const messages: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
137
|
+
name: "messages";
|
|
138
|
+
schema: "ai";
|
|
139
|
+
columns: {
|
|
140
|
+
createdAt: import("drizzle-orm/pg-core").PgBuildColumn<"messages", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").PgTimestampBuilder>>, {
|
|
141
|
+
name: string;
|
|
142
|
+
tableName: "messages";
|
|
143
|
+
dataType: "object date";
|
|
144
|
+
data: Date;
|
|
145
|
+
driverParam: string;
|
|
146
|
+
notNull: true;
|
|
147
|
+
hasDefault: true;
|
|
148
|
+
isPrimaryKey: false;
|
|
149
|
+
isAutoincrement: false;
|
|
150
|
+
hasRuntimeDefault: false;
|
|
151
|
+
enumValues: undefined;
|
|
152
|
+
identity: undefined;
|
|
153
|
+
generated: undefined;
|
|
154
|
+
}>;
|
|
155
|
+
updatedAt: import("drizzle-orm/pg-core").PgBuildColumn<"messages", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").PgTimestampBuilder>>>, {
|
|
156
|
+
name: string;
|
|
157
|
+
tableName: "messages";
|
|
158
|
+
dataType: "object date";
|
|
159
|
+
data: Date;
|
|
160
|
+
driverParam: string;
|
|
161
|
+
notNull: true;
|
|
162
|
+
hasDefault: true;
|
|
163
|
+
isPrimaryKey: false;
|
|
164
|
+
isAutoincrement: false;
|
|
165
|
+
hasRuntimeDefault: false;
|
|
166
|
+
enumValues: undefined;
|
|
167
|
+
identity: undefined;
|
|
168
|
+
generated: undefined;
|
|
169
|
+
}>;
|
|
170
|
+
id: import("drizzle-orm/pg-core").PgBuildColumn<"messages", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
171
|
+
name: string;
|
|
172
|
+
tableName: "messages";
|
|
173
|
+
dataType: "string";
|
|
174
|
+
data: string;
|
|
175
|
+
driverParam: string;
|
|
176
|
+
notNull: true;
|
|
177
|
+
hasDefault: false;
|
|
178
|
+
isPrimaryKey: false;
|
|
179
|
+
isAutoincrement: false;
|
|
180
|
+
hasRuntimeDefault: false;
|
|
181
|
+
enumValues: undefined;
|
|
182
|
+
identity: undefined;
|
|
183
|
+
generated: undefined;
|
|
184
|
+
}>;
|
|
185
|
+
threadId: import("drizzle-orm/pg-core").PgBuildColumn<"messages", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgUUIDBuilder>, {
|
|
186
|
+
name: string;
|
|
187
|
+
tableName: "messages";
|
|
188
|
+
dataType: "string uuid";
|
|
189
|
+
data: string;
|
|
190
|
+
driverParam: string;
|
|
191
|
+
notNull: true;
|
|
192
|
+
hasDefault: false;
|
|
193
|
+
isPrimaryKey: false;
|
|
194
|
+
isAutoincrement: false;
|
|
195
|
+
hasRuntimeDefault: false;
|
|
196
|
+
enumValues: undefined;
|
|
197
|
+
identity: undefined;
|
|
198
|
+
generated: undefined;
|
|
199
|
+
}>;
|
|
200
|
+
text: import("drizzle-orm/pg-core").PgBuildColumn<"messages", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
|
|
201
|
+
name: string;
|
|
202
|
+
tableName: "messages";
|
|
203
|
+
dataType: "string";
|
|
204
|
+
data: string;
|
|
205
|
+
driverParam: string;
|
|
206
|
+
notNull: false;
|
|
207
|
+
hasDefault: false;
|
|
208
|
+
isPrimaryKey: false;
|
|
209
|
+
isAutoincrement: false;
|
|
210
|
+
hasRuntimeDefault: false;
|
|
211
|
+
enumValues: undefined;
|
|
212
|
+
identity: undefined;
|
|
213
|
+
generated: undefined;
|
|
214
|
+
}>;
|
|
215
|
+
content: import("drizzle-orm/pg-core").PgBuildColumn<"messages", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgJsonbBuilder>, ChatMessage>, {
|
|
216
|
+
name: string;
|
|
217
|
+
tableName: "messages";
|
|
218
|
+
dataType: "object json";
|
|
219
|
+
data: ChatMessage;
|
|
220
|
+
driverParam: unknown;
|
|
221
|
+
notNull: true;
|
|
222
|
+
hasDefault: false;
|
|
223
|
+
isPrimaryKey: false;
|
|
224
|
+
isAutoincrement: false;
|
|
225
|
+
hasRuntimeDefault: false;
|
|
226
|
+
enumValues: undefined;
|
|
227
|
+
identity: undefined;
|
|
228
|
+
generated: undefined;
|
|
229
|
+
}>;
|
|
230
|
+
ordinal: import("drizzle-orm/pg-core").PgBuildColumn<"messages", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgIntegerBuilder>>, {
|
|
231
|
+
name: string;
|
|
232
|
+
tableName: "messages";
|
|
233
|
+
dataType: "number int32";
|
|
234
|
+
data: number;
|
|
235
|
+
driverParam: string | number;
|
|
236
|
+
notNull: true;
|
|
237
|
+
hasDefault: true;
|
|
238
|
+
isPrimaryKey: false;
|
|
239
|
+
isAutoincrement: false;
|
|
240
|
+
hasRuntimeDefault: false;
|
|
241
|
+
enumValues: undefined;
|
|
242
|
+
identity: undefined;
|
|
243
|
+
generated: undefined;
|
|
244
|
+
}>;
|
|
245
|
+
role: import("drizzle-orm/pg-core").PgBuildColumn<"messages", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<["system", "user", "assistant", "tool"]>>, {
|
|
246
|
+
name: string;
|
|
247
|
+
tableName: "messages";
|
|
248
|
+
dataType: "string enum";
|
|
249
|
+
data: "system" | "user" | "assistant" | "tool";
|
|
250
|
+
driverParam: string;
|
|
251
|
+
notNull: true;
|
|
252
|
+
hasDefault: false;
|
|
253
|
+
isPrimaryKey: false;
|
|
254
|
+
isAutoincrement: false;
|
|
255
|
+
hasRuntimeDefault: false;
|
|
256
|
+
enumValues: ["system", "user", "assistant", "tool"];
|
|
257
|
+
identity: undefined;
|
|
258
|
+
generated: undefined;
|
|
259
|
+
}>;
|
|
260
|
+
};
|
|
261
|
+
dialect: "pg";
|
|
262
|
+
}>;
|
|
263
|
+
export declare const llmRequests: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
264
|
+
name: "llm_requests";
|
|
265
|
+
schema: "ai";
|
|
266
|
+
columns: {
|
|
267
|
+
id: import("drizzle-orm/pg-core").PgBuildColumn<"llm_requests", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").PgUUIDBuilder>>, {
|
|
268
|
+
name: string;
|
|
269
|
+
tableName: "llm_requests";
|
|
270
|
+
dataType: "string uuid";
|
|
271
|
+
data: string;
|
|
272
|
+
driverParam: string;
|
|
273
|
+
notNull: true;
|
|
274
|
+
hasDefault: true;
|
|
275
|
+
isPrimaryKey: false;
|
|
276
|
+
isAutoincrement: false;
|
|
277
|
+
hasRuntimeDefault: false;
|
|
278
|
+
enumValues: undefined;
|
|
279
|
+
identity: undefined;
|
|
280
|
+
generated: undefined;
|
|
281
|
+
}>;
|
|
282
|
+
messageId: import("drizzle-orm/pg-core").PgBuildColumn<"llm_requests", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
283
|
+
name: string;
|
|
284
|
+
tableName: "llm_requests";
|
|
285
|
+
dataType: "string";
|
|
286
|
+
data: string;
|
|
287
|
+
driverParam: string;
|
|
288
|
+
notNull: true;
|
|
289
|
+
hasDefault: false;
|
|
290
|
+
isPrimaryKey: false;
|
|
291
|
+
isAutoincrement: false;
|
|
292
|
+
hasRuntimeDefault: false;
|
|
293
|
+
enumValues: undefined;
|
|
294
|
+
identity: undefined;
|
|
295
|
+
generated: undefined;
|
|
296
|
+
}>;
|
|
297
|
+
stepNumber: import("drizzle-orm/pg-core").PgBuildColumn<"llm_requests", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgIntegerBuilder>, {
|
|
298
|
+
name: string;
|
|
299
|
+
tableName: "llm_requests";
|
|
300
|
+
dataType: "number int32";
|
|
301
|
+
data: number;
|
|
302
|
+
driverParam: string | number;
|
|
303
|
+
notNull: true;
|
|
304
|
+
hasDefault: false;
|
|
305
|
+
isPrimaryKey: false;
|
|
306
|
+
isAutoincrement: false;
|
|
307
|
+
hasRuntimeDefault: false;
|
|
308
|
+
enumValues: undefined;
|
|
309
|
+
identity: undefined;
|
|
310
|
+
generated: undefined;
|
|
311
|
+
}>;
|
|
312
|
+
prompt: import("drizzle-orm/pg-core").PgBuildColumn<"llm_requests", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
313
|
+
name: string;
|
|
314
|
+
tableName: "llm_requests";
|
|
315
|
+
dataType: "string";
|
|
316
|
+
data: string;
|
|
317
|
+
driverParam: string;
|
|
318
|
+
notNull: true;
|
|
319
|
+
hasDefault: false;
|
|
320
|
+
isPrimaryKey: false;
|
|
321
|
+
isAutoincrement: false;
|
|
322
|
+
hasRuntimeDefault: false;
|
|
323
|
+
enumValues: undefined;
|
|
324
|
+
identity: undefined;
|
|
325
|
+
generated: undefined;
|
|
326
|
+
}>;
|
|
327
|
+
output: import("drizzle-orm/pg-core").PgBuildColumn<"llm_requests", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
|
|
328
|
+
name: string;
|
|
329
|
+
tableName: "llm_requests";
|
|
330
|
+
dataType: "string";
|
|
331
|
+
data: string;
|
|
332
|
+
driverParam: string;
|
|
333
|
+
notNull: false;
|
|
334
|
+
hasDefault: false;
|
|
335
|
+
isPrimaryKey: false;
|
|
336
|
+
isAutoincrement: false;
|
|
337
|
+
hasRuntimeDefault: false;
|
|
338
|
+
enumValues: undefined;
|
|
339
|
+
identity: undefined;
|
|
340
|
+
generated: undefined;
|
|
341
|
+
}>;
|
|
342
|
+
tokenUsage: import("drizzle-orm/pg-core").PgBuildColumn<"llm_requests", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, TokenUsage>, {
|
|
343
|
+
name: string;
|
|
344
|
+
tableName: "llm_requests";
|
|
345
|
+
dataType: "object json";
|
|
346
|
+
data: TokenUsage;
|
|
347
|
+
driverParam: unknown;
|
|
348
|
+
notNull: false;
|
|
349
|
+
hasDefault: false;
|
|
350
|
+
isPrimaryKey: false;
|
|
351
|
+
isAutoincrement: false;
|
|
352
|
+
hasRuntimeDefault: false;
|
|
353
|
+
enumValues: undefined;
|
|
354
|
+
identity: undefined;
|
|
355
|
+
generated: undefined;
|
|
356
|
+
}>;
|
|
357
|
+
};
|
|
358
|
+
dialect: "pg";
|
|
359
|
+
}>;
|
|
360
|
+
export declare const attachments: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
361
|
+
name: "attachments";
|
|
362
|
+
schema: "ai";
|
|
363
|
+
columns: {
|
|
364
|
+
createdAt: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").PgTimestampBuilder>>, {
|
|
365
|
+
name: string;
|
|
366
|
+
tableName: "attachments";
|
|
367
|
+
dataType: "object date";
|
|
368
|
+
data: Date;
|
|
369
|
+
driverParam: string;
|
|
370
|
+
notNull: true;
|
|
371
|
+
hasDefault: true;
|
|
372
|
+
isPrimaryKey: false;
|
|
373
|
+
isAutoincrement: false;
|
|
374
|
+
hasRuntimeDefault: false;
|
|
375
|
+
enumValues: undefined;
|
|
376
|
+
identity: undefined;
|
|
377
|
+
generated: undefined;
|
|
378
|
+
}>;
|
|
379
|
+
updatedAt: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").PgTimestampBuilder>>>, {
|
|
380
|
+
name: string;
|
|
381
|
+
tableName: "attachments";
|
|
382
|
+
dataType: "object date";
|
|
383
|
+
data: Date;
|
|
384
|
+
driverParam: string;
|
|
385
|
+
notNull: true;
|
|
386
|
+
hasDefault: true;
|
|
387
|
+
isPrimaryKey: false;
|
|
388
|
+
isAutoincrement: false;
|
|
389
|
+
hasRuntimeDefault: false;
|
|
390
|
+
enumValues: undefined;
|
|
391
|
+
identity: undefined;
|
|
392
|
+
generated: undefined;
|
|
393
|
+
}>;
|
|
394
|
+
id: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").PgUUIDBuilder>>, {
|
|
395
|
+
name: string;
|
|
396
|
+
tableName: "attachments";
|
|
397
|
+
dataType: "string uuid";
|
|
398
|
+
data: string;
|
|
399
|
+
driverParam: string;
|
|
400
|
+
notNull: true;
|
|
401
|
+
hasDefault: true;
|
|
402
|
+
isPrimaryKey: false;
|
|
403
|
+
isAutoincrement: false;
|
|
404
|
+
hasRuntimeDefault: false;
|
|
405
|
+
enumValues: undefined;
|
|
406
|
+
identity: undefined;
|
|
407
|
+
generated: undefined;
|
|
408
|
+
}>;
|
|
409
|
+
threadId: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgUUIDBuilder>, {
|
|
410
|
+
name: string;
|
|
411
|
+
tableName: "attachments";
|
|
412
|
+
dataType: "string uuid";
|
|
413
|
+
data: string;
|
|
414
|
+
driverParam: string;
|
|
415
|
+
notNull: true;
|
|
416
|
+
hasDefault: false;
|
|
417
|
+
isPrimaryKey: false;
|
|
418
|
+
isAutoincrement: false;
|
|
419
|
+
hasRuntimeDefault: false;
|
|
420
|
+
enumValues: undefined;
|
|
421
|
+
identity: undefined;
|
|
422
|
+
generated: undefined;
|
|
423
|
+
}>;
|
|
424
|
+
userId: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
425
|
+
name: string;
|
|
426
|
+
tableName: "attachments";
|
|
427
|
+
dataType: "string";
|
|
428
|
+
data: string;
|
|
429
|
+
driverParam: string;
|
|
430
|
+
notNull: true;
|
|
431
|
+
hasDefault: false;
|
|
432
|
+
isPrimaryKey: false;
|
|
433
|
+
isAutoincrement: false;
|
|
434
|
+
hasRuntimeDefault: false;
|
|
435
|
+
enumValues: undefined;
|
|
436
|
+
identity: undefined;
|
|
437
|
+
generated: undefined;
|
|
438
|
+
}>;
|
|
439
|
+
messageId: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>, {
|
|
440
|
+
name: string;
|
|
441
|
+
tableName: "attachments";
|
|
442
|
+
dataType: "string";
|
|
443
|
+
data: string;
|
|
444
|
+
driverParam: string;
|
|
445
|
+
notNull: false;
|
|
446
|
+
hasDefault: false;
|
|
447
|
+
isPrimaryKey: false;
|
|
448
|
+
isAutoincrement: false;
|
|
449
|
+
hasRuntimeDefault: false;
|
|
450
|
+
enumValues: undefined;
|
|
451
|
+
identity: undefined;
|
|
452
|
+
generated: undefined;
|
|
453
|
+
}>;
|
|
454
|
+
filename: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
455
|
+
name: string;
|
|
456
|
+
tableName: "attachments";
|
|
457
|
+
dataType: "string";
|
|
458
|
+
data: string;
|
|
459
|
+
driverParam: string;
|
|
460
|
+
notNull: true;
|
|
461
|
+
hasDefault: false;
|
|
462
|
+
isPrimaryKey: false;
|
|
463
|
+
isAutoincrement: false;
|
|
464
|
+
hasRuntimeDefault: false;
|
|
465
|
+
enumValues: undefined;
|
|
466
|
+
identity: undefined;
|
|
467
|
+
generated: undefined;
|
|
468
|
+
}>;
|
|
469
|
+
contentType: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
470
|
+
name: string;
|
|
471
|
+
tableName: "attachments";
|
|
472
|
+
dataType: "string";
|
|
473
|
+
data: string;
|
|
474
|
+
driverParam: string;
|
|
475
|
+
notNull: true;
|
|
476
|
+
hasDefault: false;
|
|
477
|
+
isPrimaryKey: false;
|
|
478
|
+
isAutoincrement: false;
|
|
479
|
+
hasRuntimeDefault: false;
|
|
480
|
+
enumValues: undefined;
|
|
481
|
+
identity: undefined;
|
|
482
|
+
generated: undefined;
|
|
483
|
+
}>;
|
|
484
|
+
sizeBytes: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgIntegerBuilder>, {
|
|
485
|
+
name: string;
|
|
486
|
+
tableName: "attachments";
|
|
487
|
+
dataType: "number int32";
|
|
488
|
+
data: number;
|
|
489
|
+
driverParam: string | number;
|
|
490
|
+
notNull: true;
|
|
491
|
+
hasDefault: false;
|
|
492
|
+
isPrimaryKey: false;
|
|
493
|
+
isAutoincrement: false;
|
|
494
|
+
hasRuntimeDefault: false;
|
|
495
|
+
enumValues: undefined;
|
|
496
|
+
identity: undefined;
|
|
497
|
+
generated: undefined;
|
|
498
|
+
}>;
|
|
499
|
+
storageKey: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
500
|
+
name: string;
|
|
501
|
+
tableName: "attachments";
|
|
502
|
+
dataType: "string";
|
|
503
|
+
data: string;
|
|
504
|
+
driverParam: string;
|
|
505
|
+
notNull: true;
|
|
506
|
+
hasDefault: false;
|
|
507
|
+
isPrimaryKey: false;
|
|
508
|
+
isAutoincrement: false;
|
|
509
|
+
hasRuntimeDefault: false;
|
|
510
|
+
enumValues: undefined;
|
|
511
|
+
identity: undefined;
|
|
512
|
+
generated: undefined;
|
|
513
|
+
}>;
|
|
514
|
+
status: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<["pending", "described", "failed", "skipped"]>>, {
|
|
515
|
+
name: string;
|
|
516
|
+
tableName: "attachments";
|
|
517
|
+
dataType: "string enum";
|
|
518
|
+
data: "pending" | "described" | "failed" | "skipped";
|
|
519
|
+
driverParam: string;
|
|
520
|
+
notNull: true;
|
|
521
|
+
hasDefault: false;
|
|
522
|
+
isPrimaryKey: false;
|
|
523
|
+
isAutoincrement: false;
|
|
524
|
+
hasRuntimeDefault: false;
|
|
525
|
+
enumValues: ["pending", "described", "failed", "skipped"];
|
|
526
|
+
identity: undefined;
|
|
527
|
+
generated: undefined;
|
|
528
|
+
}>;
|
|
529
|
+
description: import("drizzle-orm/pg-core").PgBuildColumn<"attachments", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
|
|
530
|
+
name: string;
|
|
531
|
+
tableName: "attachments";
|
|
532
|
+
dataType: "string";
|
|
533
|
+
data: string;
|
|
534
|
+
driverParam: string;
|
|
535
|
+
notNull: false;
|
|
536
|
+
hasDefault: false;
|
|
537
|
+
isPrimaryKey: false;
|
|
538
|
+
isAutoincrement: false;
|
|
539
|
+
hasRuntimeDefault: false;
|
|
540
|
+
enumValues: undefined;
|
|
541
|
+
identity: undefined;
|
|
542
|
+
generated: undefined;
|
|
543
|
+
}>;
|
|
544
|
+
};
|
|
545
|
+
dialect: "pg";
|
|
546
|
+
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
2
|
import { websocket } from "hono/bun";
|
|
3
|
-
import type { CortexConfig } from "./config
|
|
4
|
-
import type { AppEnv } from "./types
|
|
3
|
+
import type { CortexConfig } from "./config";
|
|
4
|
+
import type { AppEnv } from "./types";
|
|
5
5
|
export type CortexInstance = {
|
|
6
6
|
serve(): Promise<{
|
|
7
7
|
app: Hono<AppEnv>;
|
|
@@ -9,11 +9,6 @@ export type CortexInstance = {
|
|
|
9
9
|
fetch: Hono<AppEnv>["fetch"];
|
|
10
10
|
websocket: typeof websocket;
|
|
11
11
|
}>;
|
|
12
|
-
seedGraph(): Promise<void>;
|
|
13
|
-
extractEndpoints(options: {
|
|
14
|
-
domainsDir: string;
|
|
15
|
-
write?: boolean;
|
|
16
|
-
}): Promise<void>;
|
|
17
12
|
};
|
|
18
13
|
export declare function createCortex(config: CortexConfig): {
|
|
19
14
|
serve(): Promise<{
|
|
@@ -22,9 +17,4 @@ export declare function createCortex(config: CortexConfig): {
|
|
|
22
17
|
fetch: (request: Request, Env?: {} | undefined, executionCtx?: import("hono").ExecutionContext) => Response | Promise<Response>;
|
|
23
18
|
websocket: import("hono/bun").BunWebSocketHandler<import("hono/bun").BunWebSocketData>;
|
|
24
19
|
}>;
|
|
25
|
-
seedGraph(): Promise<void>;
|
|
26
|
-
extractEndpoints(options: {
|
|
27
|
-
domainsDir: string;
|
|
28
|
-
write?: boolean;
|
|
29
|
-
}): Promise<void>;
|
|
30
20
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export {
|
|
10
|
-
export
|
|
11
|
-
export { resolveFromGraph } from "./resolver.ts";
|
|
1
|
+
/**
|
|
2
|
+
* The graph contract lives in `@cortex/contracts/graph` (internal/contracts),
|
|
3
|
+
* because `@m6d/cortex-cli` writes the graph this package reads and the two are
|
|
4
|
+
* installed separately (each vendors its own copy at pack time). It is
|
|
5
|
+
* re-exported here so authoring a project's domains still needs exactly one
|
|
6
|
+
* import path — nothing about the public surface moved.
|
|
7
|
+
*/
|
|
8
|
+
export * from "../../../contracts/graph";
|
|
9
|
+
export type { RerankerConfig, ResolverConfig, ResolvedEndpoint, ResolvedService, ResolvedContext, } from "./resolver";
|
|
10
|
+
export { resolveFromGraph } from "./resolver";
|
|
@@ -5,15 +5,14 @@
|
|
|
5
5
|
* All configuration is passed explicitly — no hardcoded model references
|
|
6
6
|
* or environment variables.
|
|
7
7
|
*/
|
|
8
|
-
import type
|
|
9
|
-
import type { Neo4jClient } from "./neo4j.ts";
|
|
8
|
+
import { type EmbedFn, type Neo4jClient } from "../../../contracts/graph";
|
|
10
9
|
export type RerankerConfig = {
|
|
11
10
|
url: string;
|
|
12
11
|
apiKey: string;
|
|
13
12
|
};
|
|
14
13
|
export type ResolverConfig = {
|
|
15
14
|
neo4j: Neo4jClient;
|
|
16
|
-
|
|
15
|
+
embed: EmbedFn;
|
|
17
16
|
reranker?: RerankerConfig;
|
|
18
17
|
};
|
|
19
18
|
type EndpointDependency = {
|
package/dist/src/lib/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export type { CortexConfig, CortexAgentDefinition, KnowledgeConfig, DatabaseConfig, StorageConfig, PromptContext, ToolContext, ToolSetFactory, } from "./config";
|
|
1
|
+
export type { CortexConfig, CortexAgentDefinition, ControlCenterConfig, KnowledgeConfig, DatabaseConfig, RedisConfig, StorageConfig, PromptContext, ToolContext, ToolSet, ToolSetFactory, } from "./config";
|
|
2
2
|
export { defineAgent } from "./config";
|
|
3
|
+
export type { ProviderConfig } from "./ai/helpers";
|
|
3
4
|
export type { ContextConfig, ThreadContextMeta } from "./ai/context/types";
|
|
4
5
|
export type { Thread, AppEnv } from "./types";
|
|
5
6
|
export type { CortexInstance } from "./factory";
|
|
6
7
|
export { createCortex } from "./factory";
|
|
7
8
|
export type { ResolvedFile, RequestInterceptorOptions, } from "./ai/interceptors/request-interceptor";
|
|
8
9
|
export { createRequestInterceptor } from "./ai/interceptors/request-interceptor";
|
|
9
|
-
export { captureFilesTool } from "./ai/tools/capture-files.tool";
|
|
10
10
|
export { createQueryGraphTool } from "./ai/tools/query-graph.tool";
|
|
11
11
|
export { createExecuteCodeTool } from "./ai/tools/execute-code.tool";
|
|
12
12
|
export * from "./graph/index";
|
|
13
|
-
export
|
|
13
|
+
export * from "../../contracts/wire";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Redis } from "ioredis";
|
|
2
|
+
/**
|
|
3
|
+
* The two long-lived connections everything Redis-backed shares. A subscriber
|
|
4
|
+
* connection cannot issue normal commands, so pub/sub listening gets its own;
|
|
5
|
+
* the publisher carries everything else (claims, stream appends, PUBLISH).
|
|
6
|
+
* Blocking stream reads never run on either — each reader duplicates its own
|
|
7
|
+
* connection, or one blocked XREAD would stall every claim and append behind it.
|
|
8
|
+
*/
|
|
9
|
+
export type RedisConnections = {
|
|
10
|
+
publisher: Redis;
|
|
11
|
+
subscriber: Redis;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Without an `error` listener ioredis raises unhandled-error events, which can
|
|
15
|
+
* crash the process — with one, a flapping or unreachable Redis becomes a log
|
|
16
|
+
* line while ioredis reconnects underneath.
|
|
17
|
+
*/
|
|
18
|
+
export declare function withRedisLogging(client: Redis, role: string): Redis;
|
|
19
|
+
export declare function getRedisConnections(url: string): RedisConnections;
|