@graphoria/server 0.1.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/LICENSE +201 -0
- package/NOTICE +10 -0
- package/README.md +129 -0
- package/cli.ts +105 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/src/ai/agent/agent.d.ts +37 -0
- package/dist/src/ai/agent/agent.d.ts.map +1 -0
- package/dist/src/ai/agent/index.d.ts +3 -0
- package/dist/src/ai/agent/index.d.ts.map +1 -0
- package/dist/src/ai/agent/providers/anthropic.d.ts +10 -0
- package/dist/src/ai/agent/providers/anthropic.d.ts.map +1 -0
- package/dist/src/ai/agent/providers/index.d.ts +8 -0
- package/dist/src/ai/agent/providers/index.d.ts.map +1 -0
- package/dist/src/ai/agent/providers/ollama.d.ts +11 -0
- package/dist/src/ai/agent/providers/ollama.d.ts.map +1 -0
- package/dist/src/ai/agent/providers/openai.d.ts +14 -0
- package/dist/src/ai/agent/providers/openai.d.ts.map +1 -0
- package/dist/src/ai/agent/types.d.ts +51 -0
- package/dist/src/ai/agent/types.d.ts.map +1 -0
- package/dist/src/ai/ask-field.test.d.ts +2 -0
- package/dist/src/ai/ask-field.test.d.ts.map +1 -0
- package/dist/src/ai/index.d.ts +7 -0
- package/dist/src/ai/index.d.ts.map +1 -0
- package/dist/src/ai/mcp/create-server.d.ts +14 -0
- package/dist/src/ai/mcp/create-server.d.ts.map +1 -0
- package/dist/src/ai/mcp/create-server.test.d.ts +2 -0
- package/dist/src/ai/mcp/create-server.test.d.ts.map +1 -0
- package/dist/src/ai/mcp/index.d.ts +13 -0
- package/dist/src/ai/mcp/index.d.ts.map +1 -0
- package/dist/src/ai/mcp/index.test.d.ts +2 -0
- package/dist/src/ai/mcp/index.test.d.ts.map +1 -0
- package/dist/src/ai/mcp/instructions.d.ts +2 -0
- package/dist/src/ai/mcp/instructions.d.ts.map +1 -0
- package/dist/src/ai/tools/agent.d.ts +4 -0
- package/dist/src/ai/tools/agent.d.ts.map +1 -0
- package/dist/src/ai/tools/agent.test.d.ts +2 -0
- package/dist/src/ai/tools/agent.test.d.ts.map +1 -0
- package/dist/src/ai/tools/core.d.ts +75 -0
- package/dist/src/ai/tools/core.d.ts.map +1 -0
- package/dist/src/ai/tools/query-data.d.ts +35 -0
- package/dist/src/ai/tools/query-data.d.ts.map +1 -0
- package/dist/src/analyzeQuery/analyzers/fragmentAnalyzer.d.ts +5 -0
- package/dist/src/analyzeQuery/analyzers/fragmentAnalyzer.d.ts.map +1 -0
- package/dist/src/analyzeQuery/analyzers/operationAnalyzer.d.ts +6 -0
- package/dist/src/analyzeQuery/analyzers/operationAnalyzer.d.ts.map +1 -0
- package/dist/src/analyzeQuery/analyzers/selectionAnalyzer.d.ts +6 -0
- package/dist/src/analyzeQuery/analyzers/selectionAnalyzer.d.ts.map +1 -0
- package/dist/src/analyzeQuery/analyzers/variableAnalyzer.d.ts +4 -0
- package/dist/src/analyzeQuery/analyzers/variableAnalyzer.d.ts.map +1 -0
- package/dist/src/analyzeQuery/depthLimit.d.ts +16 -0
- package/dist/src/analyzeQuery/depthLimit.d.ts.map +1 -0
- package/dist/src/analyzeQuery/depthLimit.test.d.ts +2 -0
- package/dist/src/analyzeQuery/depthLimit.test.d.ts.map +1 -0
- package/dist/src/analyzeQuery/directiveUtils.d.ts +4 -0
- package/dist/src/analyzeQuery/directiveUtils.d.ts.map +1 -0
- package/dist/src/analyzeQuery/directiveUtils.test.d.ts +2 -0
- package/dist/src/analyzeQuery/directiveUtils.test.d.ts.map +1 -0
- package/dist/src/analyzeQuery/index.d.ts +5 -0
- package/dist/src/analyzeQuery/index.d.ts.map +1 -0
- package/dist/src/analyzeQuery/index.test.d.ts +2 -0
- package/dist/src/analyzeQuery/index.test.d.ts.map +1 -0
- package/dist/src/analyzeQuery/resolveVariables.d.ts +71 -0
- package/dist/src/analyzeQuery/resolveVariables.d.ts.map +1 -0
- package/dist/src/analyzeQuery/resolveVariables.test.d.ts +2 -0
- package/dist/src/analyzeQuery/resolveVariables.test.d.ts.map +1 -0
- package/dist/src/analyzeQuery/staticValues.test.d.ts +2 -0
- package/dist/src/analyzeQuery/staticValues.test.d.ts.map +1 -0
- package/dist/src/analyzeQuery/typeUtils.d.ts +9 -0
- package/dist/src/analyzeQuery/typeUtils.d.ts.map +1 -0
- package/dist/src/analyzeQuery/types.d.ts +54 -0
- package/dist/src/analyzeQuery/types.d.ts.map +1 -0
- package/dist/src/analyzeQuery/valueExtractors.d.ts +4 -0
- package/dist/src/analyzeQuery/valueExtractors.d.ts.map +1 -0
- package/dist/src/authentication/duration.d.ts +14 -0
- package/dist/src/authentication/duration.d.ts.map +1 -0
- package/dist/src/authentication/duration.test.d.ts +2 -0
- package/dist/src/authentication/duration.test.d.ts.map +1 -0
- package/dist/src/authentication/index.d.ts +4 -0
- package/dist/src/authentication/index.d.ts.map +1 -0
- package/dist/src/authentication/index.test.d.ts +2 -0
- package/dist/src/authentication/index.test.d.ts.map +1 -0
- package/dist/src/authentication/jwt.d.ts +10 -0
- package/dist/src/authentication/jwt.d.ts.map +1 -0
- package/dist/src/authentication/jwt.test.d.ts +2 -0
- package/dist/src/authentication/jwt.test.d.ts.map +1 -0
- package/dist/src/authentication/paseto.d.ts +7 -0
- package/dist/src/authentication/paseto.d.ts.map +1 -0
- package/dist/src/authentication/paseto.test.d.ts +2 -0
- package/dist/src/authentication/paseto.test.d.ts.map +1 -0
- package/dist/src/authentication/tokenRepository.d.ts +14 -0
- package/dist/src/authentication/tokenRepository.d.ts.map +1 -0
- package/dist/src/authentication/tokenRepository.test.d.ts +2 -0
- package/dist/src/authentication/tokenRepository.test.d.ts.map +1 -0
- package/dist/src/authentication/types.d.ts +42 -0
- package/dist/src/authentication/types.d.ts.map +1 -0
- package/dist/src/cli/seedAuth.d.ts +4 -0
- package/dist/src/cli/seedAuth.d.ts.map +1 -0
- package/dist/src/cli/seedAuth.test.d.ts +2 -0
- package/dist/src/cli/seedAuth.test.d.ts.map +1 -0
- package/dist/src/cli/seedAuthArgs.d.ts +9 -0
- package/dist/src/cli/seedAuthArgs.d.ts.map +1 -0
- package/dist/src/config/helpers/cronHelper.d.ts +21 -0
- package/dist/src/config/helpers/cronHelper.d.ts.map +1 -0
- package/dist/src/config/helpers/cronHelper.test.d.ts +2 -0
- package/dist/src/config/helpers/cronHelper.test.d.ts.map +1 -0
- package/dist/src/config/helpers/index.d.ts +4 -0
- package/dist/src/config/helpers/index.d.ts.map +1 -0
- package/dist/src/config/helpers/operationHelper.d.ts +44 -0
- package/dist/src/config/helpers/operationHelper.d.ts.map +1 -0
- package/dist/src/config/helpers/queueHelper.d.ts +20 -0
- package/dist/src/config/helpers/queueHelper.d.ts.map +1 -0
- package/dist/src/config/helpers/queueHelper.test.d.ts +2 -0
- package/dist/src/config/helpers/queueHelper.test.d.ts.map +1 -0
- package/dist/src/config/index.d.ts +236 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/types/ai.d.ts +29 -0
- package/dist/src/config/types/ai.d.ts.map +1 -0
- package/dist/src/config/types/auth.d.ts +112 -0
- package/dist/src/config/types/auth.d.ts.map +1 -0
- package/dist/src/config/types/configuration.d.ts +61 -0
- package/dist/src/config/types/configuration.d.ts.map +1 -0
- package/dist/src/config/types/cron.d.ts +81 -0
- package/dist/src/config/types/cron.d.ts.map +1 -0
- package/dist/src/config/types/db.d.ts +210 -0
- package/dist/src/config/types/db.d.ts.map +1 -0
- package/dist/src/config/types/index.d.ts +17 -0
- package/dist/src/config/types/index.d.ts.map +1 -0
- package/dist/src/config/types/operation.d.ts +226 -0
- package/dist/src/config/types/operation.d.ts.map +1 -0
- package/dist/src/config/types/queue.d.ts +142 -0
- package/dist/src/config/types/queue.d.ts.map +1 -0
- package/dist/src/config/types/remote-rest.d.ts +18 -0
- package/dist/src/config/types/remote-rest.d.ts.map +1 -0
- package/dist/src/config/types/remote-schema.d.ts +27 -0
- package/dist/src/config/types/remote-schema.d.ts.map +1 -0
- package/dist/src/config/types/virtual-columns.d.ts +89 -0
- package/dist/src/config/types/virtual-columns.d.ts.map +1 -0
- package/dist/src/config/types/virtual-columns.test.d.ts +2 -0
- package/dist/src/config/types/virtual-columns.test.d.ts.map +1 -0
- package/dist/src/configuration/getSchemas/index.d.ts +867 -0
- package/dist/src/configuration/getSchemas/index.d.ts.map +1 -0
- package/dist/src/configuration/getSchemas/mergeEntities/index.d.ts +412 -0
- package/dist/src/configuration/getSchemas/mergeEntities/index.d.ts.map +1 -0
- package/dist/src/configuration/getSchemas/type-definition-generator/index.d.ts +16 -0
- package/dist/src/configuration/getSchemas/type-definition-generator/index.d.ts.map +1 -0
- package/dist/src/configuration/getSchemas/type-definition-generator/index.test.d.ts +2 -0
- package/dist/src/configuration/getSchemas/type-definition-generator/index.test.d.ts.map +1 -0
- package/dist/src/configuration/gql/buildExecute.d.ts +31 -0
- package/dist/src/configuration/gql/buildExecute.d.ts.map +1 -0
- package/dist/src/configuration/gql/buildExecute.test.d.ts +2 -0
- package/dist/src/configuration/gql/buildExecute.test.d.ts.map +1 -0
- package/dist/src/configuration/gql/gqlAuthOperations.d.ts +9 -0
- package/dist/src/configuration/gql/gqlAuthOperations.d.ts.map +1 -0
- package/dist/src/configuration/gql/gqlAuthOperations.test.d.ts +2 -0
- package/dist/src/configuration/gql/gqlAuthOperations.test.d.ts.map +1 -0
- package/dist/src/configuration/gql/handleGraphQLRequestFactory.d.ts +28 -0
- package/dist/src/configuration/gql/handleGraphQLRequestFactory.d.ts.map +1 -0
- package/dist/src/configuration/gql/handleGraphQLRequestFactory.test.d.ts +2 -0
- package/dist/src/configuration/gql/handleGraphQLRequestFactory.test.d.ts.map +1 -0
- package/dist/src/configuration/gql/handleGraphQLSubscriptionFactory.d.ts +19 -0
- package/dist/src/configuration/gql/handleGraphQLSubscriptionFactory.d.ts.map +1 -0
- package/dist/src/configuration/index.d.ts +719 -0
- package/dist/src/configuration/index.d.ts.map +1 -0
- package/dist/src/configuration/rest/generateOpenAPI.d.ts +19 -0
- package/dist/src/configuration/rest/generateOpenAPI.d.ts.map +1 -0
- package/dist/src/configuration/rest/handleRESTRequestFactory.d.ts +12 -0
- package/dist/src/configuration/rest/handleRESTRequestFactory.d.ts.map +1 -0
- package/dist/src/configuration/rest/handleRESTRequestFactory.test.d.ts +2 -0
- package/dist/src/configuration/rest/handleRESTRequestFactory.test.d.ts.map +1 -0
- package/dist/src/configuration/rest/index.d.ts +20 -0
- package/dist/src/configuration/rest/index.d.ts.map +1 -0
- package/dist/src/configuration/rest/openApiErrors.d.ts +71 -0
- package/dist/src/configuration/rest/openApiErrors.d.ts.map +1 -0
- package/dist/src/console/App.d.ts +3 -0
- package/dist/src/console/App.d.ts.map +1 -0
- package/dist/src/console/Login.d.ts +6 -0
- package/dist/src/console/Login.d.ts.map +1 -0
- package/dist/src/console/api.d.ts +17 -0
- package/dist/src/console/api.d.ts.map +1 -0
- package/dist/src/console/api.test.d.ts +2 -0
- package/dist/src/console/api.test.d.ts.map +1 -0
- package/dist/src/console/client.d.ts +67 -0
- package/dist/src/console/client.d.ts.map +1 -0
- package/dist/src/console/frontend.d.ts +8 -0
- package/dist/src/console/frontend.d.ts.map +1 -0
- package/dist/src/console/pages/ConfigPage.d.ts +2 -0
- package/dist/src/console/pages/ConfigPage.d.ts.map +1 -0
- package/dist/src/console/pages/RolesPage.d.ts +2 -0
- package/dist/src/console/pages/RolesPage.d.ts.map +1 -0
- package/dist/src/console/pages/StatusPage.d.ts +2 -0
- package/dist/src/console/pages/StatusPage.d.ts.map +1 -0
- package/dist/src/console/pages/TablesPage.d.ts +2 -0
- package/dist/src/console/pages/TablesPage.d.ts.map +1 -0
- package/dist/src/console/useApi.d.ts +8 -0
- package/dist/src/console/useApi.d.ts.map +1 -0
- package/dist/src/cron/index.d.ts +63 -0
- package/dist/src/cron/index.d.ts.map +1 -0
- package/dist/src/databases/auth/auth-operations.d.ts +11 -0
- package/dist/src/databases/auth/auth-operations.d.ts.map +1 -0
- package/dist/src/databases/auth/password.d.ts +3 -0
- package/dist/src/databases/auth/password.d.ts.map +1 -0
- package/dist/src/databases/auth/password.test.d.ts +2 -0
- package/dist/src/databases/auth/password.test.d.ts.map +1 -0
- package/dist/src/databases/common.d.ts +53 -0
- package/dist/src/databases/common.d.ts.map +1 -0
- package/dist/src/databases/common.test.d.ts +2 -0
- package/dist/src/databases/common.test.d.ts.map +1 -0
- package/dist/src/databases/core/executor.d.ts +10 -0
- package/dist/src/databases/core/executor.d.ts.map +1 -0
- package/dist/src/databases/core/executor.test.d.ts +2 -0
- package/dist/src/databases/core/executor.test.d.ts.map +1 -0
- package/dist/src/databases/core/function-mapping.d.ts +38 -0
- package/dist/src/databases/core/function-mapping.d.ts.map +1 -0
- package/dist/src/databases/core/identifier.d.ts +2 -0
- package/dist/src/databases/core/identifier.d.ts.map +1 -0
- package/dist/src/databases/core/identifier.test.d.ts +2 -0
- package/dist/src/databases/core/identifier.test.d.ts.map +1 -0
- package/dist/src/databases/core/query-builder.d.ts +64 -0
- package/dist/src/databases/core/query-builder.d.ts.map +1 -0
- package/dist/src/databases/core/query-builder.test.d.ts +2 -0
- package/dist/src/databases/core/query-builder.test.d.ts.map +1 -0
- package/dist/src/databases/directives.d.ts +16 -0
- package/dist/src/databases/directives.d.ts.map +1 -0
- package/dist/src/databases/directives.test.d.ts +2 -0
- package/dist/src/databases/directives.test.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/auth.d.ts +9 -0
- package/dist/src/databases/engines/mssql/auth.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/auth.test.d.ts +2 -0
- package/dist/src/databases/engines/mssql/auth.test.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/connection.d.ts +14 -0
- package/dist/src/databases/engines/mssql/connection.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/format.d.ts +5 -0
- package/dist/src/databases/engines/mssql/format.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/getStructure.d.ts +48 -0
- package/dist/src/databases/engines/mssql/getStructure.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/getViews.d.ts +7 -0
- package/dist/src/databases/engines/mssql/getViews.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/query/index.d.ts +7 -0
- package/dist/src/databases/engines/mssql/query/index.d.ts.map +1 -0
- package/dist/src/databases/engines/mssql/query/index.test.d.ts +2 -0
- package/dist/src/databases/engines/mssql/query/index.test.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/auth.d.ts +9 -0
- package/dist/src/databases/engines/mysql/auth.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/auth.test.d.ts +2 -0
- package/dist/src/databases/engines/mysql/auth.test.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/connection.d.ts +14 -0
- package/dist/src/databases/engines/mysql/connection.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/format.d.ts +5 -0
- package/dist/src/databases/engines/mysql/format.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/getStructure.d.ts +48 -0
- package/dist/src/databases/engines/mysql/getStructure.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/getViews.d.ts +7 -0
- package/dist/src/databases/engines/mysql/getViews.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/query/index.d.ts +7 -0
- package/dist/src/databases/engines/mysql/query/index.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/query/index.test.d.ts +2 -0
- package/dist/src/databases/engines/mysql/query/index.test.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/auth.d.ts +9 -0
- package/dist/src/databases/engines/postgresql/auth.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/auth.test.d.ts +2 -0
- package/dist/src/databases/engines/postgresql/auth.test.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/connection.d.ts +14 -0
- package/dist/src/databases/engines/postgresql/connection.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/format.d.ts +5 -0
- package/dist/src/databases/engines/postgresql/format.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/getStructure.d.ts +48 -0
- package/dist/src/databases/engines/postgresql/getStructure.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/getViews.d.ts +7 -0
- package/dist/src/databases/engines/postgresql/getViews.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/query/index.d.ts +7 -0
- package/dist/src/databases/engines/postgresql/query/index.d.ts.map +1 -0
- package/dist/src/databases/engines/postgresql/query/index.test.d.ts +2 -0
- package/dist/src/databases/engines/postgresql/query/index.test.d.ts.map +1 -0
- package/dist/src/databases/engines/shared/claims.d.ts +2 -0
- package/dist/src/databases/engines/shared/claims.d.ts.map +1 -0
- package/dist/src/databases/engines/shared/types.d.ts +8 -0
- package/dist/src/databases/engines/shared/types.d.ts.map +1 -0
- package/dist/src/databases/high-level-operations.d.ts +146 -0
- package/dist/src/databases/high-level-operations.d.ts.map +1 -0
- package/dist/src/databases/high-level-operations.test.d.ts +2 -0
- package/dist/src/databases/high-level-operations.test.d.ts.map +1 -0
- package/dist/src/databases/index.d.ts +8 -0
- package/dist/src/databases/index.d.ts.map +1 -0
- package/dist/src/databases/metadata/structure.d.ts +56 -0
- package/dist/src/databases/metadata/structure.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/convert.d.ts +2 -0
- package/dist/src/databases/schemaBuilder/convert.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateCreateTable/index.d.ts +15 -0
- package/dist/src/databases/schemaBuilder/generateCreateTable/index.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateCreateTable/index.test.d.ts +2 -0
- package/dist/src/databases/schemaBuilder/generateCreateTable/index.test.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateCreateView/index.d.ts +18 -0
- package/dist/src/databases/schemaBuilder/generateCreateView/index.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateInsert/index.d.ts +8 -0
- package/dist/src/databases/schemaBuilder/generateInsert/index.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateInsert/index.test.d.ts +2 -0
- package/dist/src/databases/schemaBuilder/generateInsert/index.test.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateSchemaCreation/index.d.ts +7 -0
- package/dist/src/databases/schemaBuilder/generateSchemaCreation/index.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/generateSchemaCreation/index.test.d.ts +2 -0
- package/dist/src/databases/schemaBuilder/generateSchemaCreation/index.test.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/mssqlToPostgres/convertView.d.ts +2 -0
- package/dist/src/databases/schemaBuilder/mssqlToPostgres/convertView.d.ts.map +1 -0
- package/dist/src/databases/schemaBuilder/utils.d.ts +8 -0
- package/dist/src/databases/schemaBuilder/utils.d.ts.map +1 -0
- package/dist/src/databases/sqlTypeUtils.d.ts +24 -0
- package/dist/src/databases/sqlTypeUtils.d.ts.map +1 -0
- package/dist/src/databases/sqlTypeUtils.test.d.ts +2 -0
- package/dist/src/databases/sqlTypeUtils.test.d.ts.map +1 -0
- package/dist/src/databases/transformers/data-transformers.d.ts +215 -0
- package/dist/src/databases/transformers/data-transformers.d.ts.map +1 -0
- package/dist/src/databases/transformers/data-transformers.test.d.ts +2 -0
- package/dist/src/databases/transformers/data-transformers.test.d.ts.map +1 -0
- package/dist/src/databases/transformers/genResolverName.d.ts +2 -0
- package/dist/src/databases/transformers/genResolverName.d.ts.map +1 -0
- package/dist/src/databases/transformers/genResolverName.test.d.ts +2 -0
- package/dist/src/databases/transformers/genResolverName.test.d.ts.map +1 -0
- package/dist/src/index.d.ts +139 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/logging/index.d.ts +21 -0
- package/dist/src/logging/index.d.ts.map +1 -0
- package/dist/src/queues/kafka.d.ts +22 -0
- package/dist/src/queues/kafka.d.ts.map +1 -0
- package/dist/src/queues/rabbitmq.d.ts +34 -0
- package/dist/src/queues/rabbitmq.d.ts.map +1 -0
- package/dist/src/queues/rabbitmq.test.d.ts +2 -0
- package/dist/src/queues/rabbitmq.test.d.ts.map +1 -0
- package/dist/src/remoteREST/index.d.ts +13 -0
- package/dist/src/remoteREST/index.d.ts.map +1 -0
- package/dist/src/remoteREST/parse.d.ts +8 -0
- package/dist/src/remoteREST/parse.d.ts.map +1 -0
- package/dist/src/remoteREST/parse.test.d.ts +2 -0
- package/dist/src/remoteREST/parse.test.d.ts.map +1 -0
- package/dist/src/remoteREST/proxy.d.ts +6 -0
- package/dist/src/remoteREST/proxy.d.ts.map +1 -0
- package/dist/src/remoteREST/proxy.test.d.ts +2 -0
- package/dist/src/remoteREST/proxy.test.d.ts.map +1 -0
- package/dist/src/remoteREST/transform.d.ts +8 -0
- package/dist/src/remoteREST/transform.d.ts.map +1 -0
- package/dist/src/remoteREST/transform.test.d.ts +2 -0
- package/dist/src/remoteREST/transform.test.d.ts.map +1 -0
- package/dist/src/remoteREST/types.d.ts +37 -0
- package/dist/src/remoteREST/types.d.ts.map +1 -0
- package/dist/src/remoteSchemas/index.d.ts +13 -0
- package/dist/src/remoteSchemas/index.d.ts.map +1 -0
- package/dist/src/remoteSchemas/introspect.d.ts +7 -0
- package/dist/src/remoteSchemas/introspect.d.ts.map +1 -0
- package/dist/src/remoteSchemas/introspect.test.d.ts +2 -0
- package/dist/src/remoteSchemas/introspect.test.d.ts.map +1 -0
- package/dist/src/remoteSchemas/proxy.d.ts +7 -0
- package/dist/src/remoteSchemas/proxy.d.ts.map +1 -0
- package/dist/src/remoteSchemas/proxy.test.d.ts +2 -0
- package/dist/src/remoteSchemas/proxy.test.d.ts.map +1 -0
- package/dist/src/remoteSchemas/transform.d.ts +9 -0
- package/dist/src/remoteSchemas/transform.d.ts.map +1 -0
- package/dist/src/remoteSchemas/transform.test.d.ts +2 -0
- package/dist/src/remoteSchemas/transform.test.d.ts.map +1 -0
- package/dist/src/remoteSchemas/types.d.ts +41 -0
- package/dist/src/remoteSchemas/types.d.ts.map +1 -0
- package/dist/src/singletons/ai.d.ts +25 -0
- package/dist/src/singletons/ai.d.ts.map +1 -0
- package/dist/src/singletons/ai.test.d.ts +2 -0
- package/dist/src/singletons/ai.test.d.ts.map +1 -0
- package/dist/src/singletons/authentication.d.ts +4 -0
- package/dist/src/singletons/authentication.d.ts.map +1 -0
- package/dist/src/singletons/cache/index.d.ts +5 -0
- package/dist/src/singletons/cache/index.d.ts.map +1 -0
- package/dist/src/singletons/cache/lruCacheStore.d.ts +12 -0
- package/dist/src/singletons/cache/lruCacheStore.d.ts.map +1 -0
- package/dist/src/singletons/cache/lruCacheStore.test.d.ts +2 -0
- package/dist/src/singletons/cache/lruCacheStore.test.d.ts.map +1 -0
- package/dist/src/singletons/cache/redisCacheStore.d.ts +16 -0
- package/dist/src/singletons/cache/redisCacheStore.d.ts.map +1 -0
- package/dist/src/singletons/cache/redisClient.d.ts +3 -0
- package/dist/src/singletons/cache/redisClient.d.ts.map +1 -0
- package/dist/src/singletons/cache/registry.d.ts +7 -0
- package/dist/src/singletons/cache/registry.d.ts.map +1 -0
- package/dist/src/singletons/cache/registry.test.d.ts +2 -0
- package/dist/src/singletons/cache/registry.test.d.ts.map +1 -0
- package/dist/src/singletons/cache/types.d.ts +8 -0
- package/dist/src/singletons/cache/types.d.ts.map +1 -0
- package/dist/src/singletons/cron.d.ts +69 -0
- package/dist/src/singletons/cron.d.ts.map +1 -0
- package/dist/src/singletons/databases.d.ts +27 -0
- package/dist/src/singletons/databases.d.ts.map +1 -0
- package/dist/src/singletons/databases.test.d.ts +2 -0
- package/dist/src/singletons/databases.test.d.ts.map +1 -0
- package/dist/src/singletons/env.d.ts +494 -0
- package/dist/src/singletons/env.d.ts.map +1 -0
- package/dist/src/singletons/queues.d.ts +17 -0
- package/dist/src/singletons/queues.d.ts.map +1 -0
- package/dist/src/subscriptions/index.d.ts +4 -0
- package/dist/src/subscriptions/index.d.ts.map +1 -0
- package/dist/src/subscriptions/strategies/database.d.ts +12 -0
- package/dist/src/subscriptions/strategies/database.d.ts.map +1 -0
- package/dist/src/subscriptions/strategies/index.d.ts +12 -0
- package/dist/src/subscriptions/strategies/index.d.ts.map +1 -0
- package/dist/src/subscriptions/strategies/queue.d.ts +11 -0
- package/dist/src/subscriptions/strategies/queue.d.ts.map +1 -0
- package/dist/src/subscriptions/types.d.ts +67 -0
- package/dist/src/subscriptions/types.d.ts.map +1 -0
- package/dist/src/subscriptions/utils/polling.d.ts +17 -0
- package/dist/src/subscriptions/utils/polling.d.ts.map +1 -0
- package/dist/src/types/common.d.ts +44 -0
- package/dist/src/types/common.d.ts.map +1 -0
- package/dist/src/types/configuration.d.ts +28 -0
- package/dist/src/types/configuration.d.ts.map +1 -0
- package/dist/src/types/db.d.ts +43 -0
- package/dist/src/types/db.d.ts.map +1 -0
- package/dist/src/types/env.d.ts +2302 -0
- package/dist/src/types/env.d.ts.map +1 -0
- package/dist/src/types/env.test.d.ts +2 -0
- package/dist/src/types/env.test.d.ts.map +1 -0
- package/dist/src/types/resolver.d.ts +121 -0
- package/dist/src/types/resolver.d.ts.map +1 -0
- package/dist/src/types/zod/ai.d.ts +6 -0
- package/dist/src/types/zod/ai.d.ts.map +1 -0
- package/dist/src/types/zod/auth.d.ts +76 -0
- package/dist/src/types/zod/auth.d.ts.map +1 -0
- package/dist/src/types/zod/configuration.d.ts +1278 -0
- package/dist/src/types/zod/configuration.d.ts.map +1 -0
- package/dist/src/types/zod/configuration.test.d.ts +2 -0
- package/dist/src/types/zod/configuration.test.d.ts.map +1 -0
- package/dist/src/types/zod/cron.d.ts +32 -0
- package/dist/src/types/zod/cron.d.ts.map +1 -0
- package/dist/src/types/zod/db.d.ts +441 -0
- package/dist/src/types/zod/db.d.ts.map +1 -0
- package/dist/src/types/zod/db.test.d.ts +2 -0
- package/dist/src/types/zod/db.test.d.ts.map +1 -0
- package/dist/src/types/zod/mcp.d.ts +6 -0
- package/dist/src/types/zod/mcp.d.ts.map +1 -0
- package/dist/src/types/zod/operation.d.ts +9 -0
- package/dist/src/types/zod/operation.d.ts.map +1 -0
- package/dist/src/types/zod/queue.d.ts +656 -0
- package/dist/src/types/zod/queue.d.ts.map +1 -0
- package/dist/src/types/zod/queue.test.d.ts +2 -0
- package/dist/src/types/zod/queue.test.d.ts.map +1 -0
- package/dist/src/types/zod/remoteREST.d.ts +6 -0
- package/dist/src/types/zod/remoteREST.d.ts.map +1 -0
- package/dist/src/types/zod/remoteSchema.d.ts +6 -0
- package/dist/src/types/zod/remoteSchema.d.ts.map +1 -0
- package/dist/src/utils/benchmark.d.ts +2 -0
- package/dist/src/utils/benchmark.d.ts.map +1 -0
- package/dist/src/utils/event-emitter.d.ts +19 -0
- package/dist/src/utils/event-emitter.d.ts.map +1 -0
- package/dist/src/utils/responses.d.ts +19 -0
- package/dist/src/utils/responses.d.ts.map +1 -0
- package/dist/src/utils/responses.test.d.ts +2 -0
- package/dist/src/utils/responses.test.d.ts.map +1 -0
- package/dist/src/utils/safeJSONParse.d.ts +2 -0
- package/dist/src/utils/safeJSONParse.d.ts.map +1 -0
- package/dist/src/utils/selection.d.ts +3 -0
- package/dist/src/utils/selection.d.ts.map +1 -0
- package/dist/src/utils/selection.test.d.ts +2 -0
- package/dist/src/utils/selection.test.d.ts.map +1 -0
- package/dist/src/utils/sessionVariables.d.ts +47 -0
- package/dist/src/utils/sessionVariables.d.ts.map +1 -0
- package/dist/src/utils/sessionVariables.test.d.ts +2 -0
- package/dist/src/utils/sessionVariables.test.d.ts.map +1 -0
- package/dist/src/utils/writeSchema.d.ts +3 -0
- package/dist/src/utils/writeSchema.d.ts.map +1 -0
- package/dist/standalone.d.ts +3 -0
- package/dist/standalone.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +119 -0
- package/playgrounds/console/index.html +25 -0
- package/playgrounds/graphiql/index.html +1144 -0
- package/playgrounds/scalar/index.html +19 -0
- package/src/ai/agent/agent.ts +222 -0
- package/src/ai/agent/index.ts +2 -0
- package/src/ai/agent/providers/anthropic.ts +113 -0
- package/src/ai/agent/providers/index.ts +62 -0
- package/src/ai/agent/providers/ollama.ts +128 -0
- package/src/ai/agent/providers/openai.ts +100 -0
- package/src/ai/agent/types.ts +65 -0
- package/src/ai/index.ts +8 -0
- package/src/ai/mcp/create-server.ts +444 -0
- package/src/ai/mcp/index.ts +80 -0
- package/src/ai/mcp/instructions.ts +103 -0
- package/src/ai/tools/agent.ts +111 -0
- package/src/ai/tools/core.ts +486 -0
- package/src/ai/tools/query-data.ts +109 -0
- package/src/analyzeQuery/analyzers/fragmentAnalyzer.ts +29 -0
- package/src/analyzeQuery/analyzers/operationAnalyzer.ts +50 -0
- package/src/analyzeQuery/analyzers/selectionAnalyzer.ts +135 -0
- package/src/analyzeQuery/analyzers/variableAnalyzer.ts +17 -0
- package/src/analyzeQuery/depthLimit.ts +124 -0
- package/src/analyzeQuery/directiveUtils.ts +99 -0
- package/src/analyzeQuery/index.ts +66 -0
- package/src/analyzeQuery/resolveVariables.ts +394 -0
- package/src/analyzeQuery/typeUtils.ts +47 -0
- package/src/analyzeQuery/types.ts +57 -0
- package/src/analyzeQuery/valueExtractors.ts +96 -0
- package/src/authentication/duration.ts +50 -0
- package/src/authentication/index.ts +34 -0
- package/src/authentication/jwt.ts +220 -0
- package/src/authentication/paseto.ts +256 -0
- package/src/authentication/tokenRepository.ts +75 -0
- package/src/authentication/types.ts +78 -0
- package/src/cli/seedAuth.ts +51 -0
- package/src/cli/seedAuthArgs.ts +50 -0
- package/src/config/helpers/cronHelper.ts +29 -0
- package/src/config/helpers/index.ts +8 -0
- package/src/config/helpers/operationHelper.ts +146 -0
- package/src/config/helpers/queueHelper.ts +27 -0
- package/src/config/index.ts +315 -0
- package/src/config/types/ai.ts +35 -0
- package/src/config/types/auth.ts +147 -0
- package/src/config/types/configuration.ts +69 -0
- package/src/config/types/cron.ts +140 -0
- package/src/config/types/db.ts +256 -0
- package/src/config/types/index.ts +129 -0
- package/src/config/types/operation.ts +253 -0
- package/src/config/types/queue.ts +172 -0
- package/src/config/types/remote-rest.ts +28 -0
- package/src/config/types/remote-schema.ts +39 -0
- package/src/config/types/virtual-columns.ts +157 -0
- package/src/configuration/getSchemas/index.ts +82 -0
- package/src/configuration/getSchemas/mergeEntities/index.ts +221 -0
- package/src/configuration/getSchemas/type-definition-generator/index.ts +511 -0
- package/src/configuration/gql/buildExecute.ts +54 -0
- package/src/configuration/gql/gqlAuthOperations.ts +150 -0
- package/src/configuration/gql/handleGraphQLRequestFactory.ts +415 -0
- package/src/configuration/gql/handleGraphQLSubscriptionFactory.ts +249 -0
- package/src/configuration/index.ts +138 -0
- package/src/configuration/rest/generateOpenAPI.ts +361 -0
- package/src/configuration/rest/handleRESTRequestFactory.ts +335 -0
- package/src/configuration/rest/index.ts +167 -0
- package/src/configuration/rest/openApiErrors.ts +106 -0
- package/src/console/api.ts +270 -0
- package/src/cron/index.ts +251 -0
- package/src/databases/auth/auth-operations.ts +36 -0
- package/src/databases/auth/password.ts +4 -0
- package/src/databases/common.ts +642 -0
- package/src/databases/core/executor.ts +97 -0
- package/src/databases/core/function-mapping.ts +176 -0
- package/src/databases/core/identifier.ts +8 -0
- package/src/databases/core/query-builder.ts +47 -0
- package/src/databases/directives.ts +112 -0
- package/src/databases/engines/mssql/auth.ts +112 -0
- package/src/databases/engines/mssql/connection.ts +151 -0
- package/src/databases/engines/mssql/format.ts +23 -0
- package/src/databases/engines/mssql/getStructure.ts +112 -0
- package/src/databases/engines/mssql/getViews.ts +17 -0
- package/src/databases/engines/mssql/query/index.ts +306 -0
- package/src/databases/engines/mysql/auth.ts +100 -0
- package/src/databases/engines/mysql/connection.ts +100 -0
- package/src/databases/engines/mysql/format.ts +23 -0
- package/src/databases/engines/mysql/getStructure.ts +116 -0
- package/src/databases/engines/mysql/getViews.ts +20 -0
- package/src/databases/engines/mysql/query/index.ts +291 -0
- package/src/databases/engines/postgresql/auth.ts +98 -0
- package/src/databases/engines/postgresql/connection.ts +99 -0
- package/src/databases/engines/postgresql/format.ts +23 -0
- package/src/databases/engines/postgresql/getStructure.ts +149 -0
- package/src/databases/engines/postgresql/getViews.ts +20 -0
- package/src/databases/engines/postgresql/query/index.ts +291 -0
- package/src/databases/engines/shared/claims.ts +26 -0
- package/src/databases/engines/shared/types.ts +7 -0
- package/src/databases/high-level-operations.ts +272 -0
- package/src/databases/index.ts +28 -0
- package/src/databases/metadata/structure.ts +12 -0
- package/src/databases/schemaBuilder/convert.ts +121 -0
- package/src/databases/schemaBuilder/generateCreateTable/index.ts +133 -0
- package/src/databases/schemaBuilder/generateCreateView/index.ts +101 -0
- package/src/databases/schemaBuilder/generateInsert/index.ts +47 -0
- package/src/databases/schemaBuilder/generateSchemaCreation/index.ts +29 -0
- package/src/databases/schemaBuilder/mssqlToPostgres/convertView.ts +47 -0
- package/src/databases/schemaBuilder/utils.ts +17 -0
- package/src/databases/sqlTypeUtils.ts +91 -0
- package/src/databases/transformers/data-transformers.ts +128 -0
- package/src/databases/transformers/genResolverName.ts +18 -0
- package/src/index.ts +461 -0
- package/src/logging/index.ts +69 -0
- package/src/queues/kafka.ts +409 -0
- package/src/queues/rabbitmq.ts +331 -0
- package/src/remoteREST/index.ts +46 -0
- package/src/remoteREST/parse.ts +68 -0
- package/src/remoteREST/proxy.ts +92 -0
- package/src/remoteREST/transform.ts +121 -0
- package/src/remoteREST/types.ts +38 -0
- package/src/remoteSchemas/index.ts +48 -0
- package/src/remoteSchemas/introspect.ts +44 -0
- package/src/remoteSchemas/proxy.ts +146 -0
- package/src/remoteSchemas/transform.ts +210 -0
- package/src/remoteSchemas/types.ts +43 -0
- package/src/singletons/ai.ts +91 -0
- package/src/singletons/authentication.ts +13 -0
- package/src/singletons/cache/index.ts +4 -0
- package/src/singletons/cache/lruCacheStore.ts +34 -0
- package/src/singletons/cache/redisCacheStore.ts +81 -0
- package/src/singletons/cache/redisClient.ts +12 -0
- package/src/singletons/cache/registry.ts +51 -0
- package/src/singletons/cache/types.ts +7 -0
- package/src/singletons/cron.ts +21 -0
- package/src/singletons/databases.ts +68 -0
- package/src/singletons/env.ts +3 -0
- package/src/singletons/queues.ts +101 -0
- package/src/subscriptions/index.ts +20 -0
- package/src/subscriptions/strategies/database.ts +68 -0
- package/src/subscriptions/strategies/index.ts +38 -0
- package/src/subscriptions/strategies/queue.ts +61 -0
- package/src/subscriptions/types.ts +74 -0
- package/src/subscriptions/utils/polling.ts +119 -0
- package/src/types/common.ts +57 -0
- package/src/types/configuration.ts +52 -0
- package/src/types/db.ts +87 -0
- package/src/types/env.ts +137 -0
- package/src/types/resolver.ts +181 -0
- package/src/types/zod/ai.ts +8 -0
- package/src/types/zod/auth.ts +96 -0
- package/src/types/zod/configuration.ts +46 -0
- package/src/types/zod/cron.ts +35 -0
- package/src/types/zod/db.ts +146 -0
- package/src/types/zod/mcp.ts +8 -0
- package/src/types/zod/operation.ts +37 -0
- package/src/types/zod/queue.ts +182 -0
- package/src/types/zod/remoteREST.ts +8 -0
- package/src/types/zod/remoteSchema.ts +11 -0
- package/src/utils/benchmark.ts +13 -0
- package/src/utils/event-emitter.ts +217 -0
- package/src/utils/responses.ts +42 -0
- package/src/utils/safeJSONParse.ts +10 -0
- package/src/utils/selection.ts +35 -0
- package/src/utils/sessionVariables.ts +131 -0
- package/src/utils/writeSchema.ts +13 -0
- package/standalone.ts +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Alex Ferreli
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Graphoria
|
|
2
|
+
Copyright 2026 Alex Ferreli
|
|
3
|
+
|
|
4
|
+
This product includes software developed by Alex Ferreli and contributors.
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this software except in compliance with the License.
|
|
8
|
+
You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# @graphoria/server
|
|
2
|
+
|
|
3
|
+
The runtime that powers Graphoria — schema introspection, GraphQL/REST handlers, JWT/PASETO authentication, RBAC, message queues, cron, remote schemas, and remote REST integration. This package is what you install into a Bun application to get a complete API server out of one configuration file.
|
|
4
|
+
|
|
5
|
+
> Looking for the full guide? Start with the [Quickstart](../../docs/QUICKSTART.md), then dig into the topic-specific docs in [`docs/`](../../docs/).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun add @graphoria/server
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Installing the server package is enough: the runtime is exported from `@graphoria/server` and the configuration helpers + types from `@graphoria/server/config`.
|
|
14
|
+
|
|
15
|
+
## Public API
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { createGraphQLEngine, createHandlers, createBunServer } from "@graphoria/server";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
| Export | Use |
|
|
22
|
+
| --------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| `createBunServer` | Spin up a `Bun.serve` server end-to-end. Returns `{ server, prefixes, execute }`. |
|
|
24
|
+
| `createHandlers` | Build the route map and websocket handler so you can compose them with your own server. Also returns `execute`. |
|
|
25
|
+
| `createGraphQLEngine` | Run GraphQL queries in-process — no server. Returns `{ execute, roles, close }`. `execute` bypasses auth (full privileges). |
|
|
26
|
+
|
|
27
|
+
`createBunServer` and `createHandlers` also return `execute`, the same in-process query runner as `createGraphQLEngine`, bound to the running server's schema.
|
|
28
|
+
|
|
29
|
+
### One-call setup
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { createBunServer } from "@graphoria/server";
|
|
33
|
+
|
|
34
|
+
// JWT_SECRET and ADMIN_SECRET are read from the environment (see below).
|
|
35
|
+
const { server, prefixes } = await createBunServer({
|
|
36
|
+
configuration: "./graphoria.ts",
|
|
37
|
+
port: 3000,
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Embedding into an existing Bun.serve
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { createHandlers } from "@graphoria/server";
|
|
45
|
+
|
|
46
|
+
const { serverHandlers } = await createHandlers({
|
|
47
|
+
configuration: "./graphoria.ts",
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
Bun.serve({
|
|
51
|
+
port: 3000,
|
|
52
|
+
routes: { "/health": () => new Response("OK"), ...serverHandlers.routes },
|
|
53
|
+
websocket: serverHandlers.websocket,
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Running a query without a server
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { createGraphQLEngine } from "@graphoria/server";
|
|
61
|
+
|
|
62
|
+
const { execute, close } = await createGraphQLEngine({
|
|
63
|
+
configuration: "./graphoria.ts",
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Defaults to the superadmin role (full privileges); pass { role } to scope it.
|
|
67
|
+
const result = await execute("query { users { id name } }");
|
|
68
|
+
console.log(result);
|
|
69
|
+
|
|
70
|
+
await close(); // release database connections
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`execute` bypasses authentication — there is no token verification — so don't expose it to untrusted input. Because no HTTP request exists, operation `init`/`beforeRequest` hooks and header-derived session variables do not run.
|
|
74
|
+
|
|
75
|
+
## Environment variables
|
|
76
|
+
|
|
77
|
+
The server reads a small set of environment variables. Every variable has a sensible default except `JWT_SECRET` (or PASETO equivalents) and `ADMIN_SECRET`, both of which are required.
|
|
78
|
+
|
|
79
|
+
| Variable | Default | Purpose |
|
|
80
|
+
| ---------------------- | ------------------------------ | -------------------------------------------------------------------------- |
|
|
81
|
+
| `PORT` | `3000` | HTTP port for `createBunServer`. |
|
|
82
|
+
| `JWT_SECRET` | _required_ | Symmetric secret for JWT signing. |
|
|
83
|
+
| `JWT_EXPIRES_IN` | `5m` | Access-token lifetime. |
|
|
84
|
+
| `JWT_RT_EXPIRES_IN` | `7d` | Refresh-token lifetime. |
|
|
85
|
+
| `PASETO_LOCAL_KEY` | _required for_ `paseto_local` | XChaCha20-Poly1305 key (`k4.local.…`). |
|
|
86
|
+
| `PASETO_SECRET_KEY` | _required for_ `paseto_public` | Ed25519 secret (`k4.secret.…`). |
|
|
87
|
+
| `PASETO_PUBLIC_KEY` | _required for_ `paseto_public` | Ed25519 public (`k4.public.…`). |
|
|
88
|
+
| `ADMIN_SECRET` | _required_ | Bypasses RBAC when sent in the admin header. |
|
|
89
|
+
| `REDIS_URL` | `redis://localhost:6379` | Refresh-token rotation + cache. |
|
|
90
|
+
| `GRAPHQL_API_ENDPOINT` | `/graphql` | GraphQL endpoint path. |
|
|
91
|
+
| `REST_API_PREFIX` | `/rest` | REST API prefix. |
|
|
92
|
+
| `GRAPHIQL_ENDPOINT` | `/graphiql` | Built-in GraphiQL playground path. |
|
|
93
|
+
| `SCALAR_ENDPOINT` | `/scalar` | Scalar API documentation path. |
|
|
94
|
+
| `OPENAPI_ENDPOINT` | `/openapi.json` | OpenAPI document path. |
|
|
95
|
+
| `CORS_ENABLED` | `true` | Toggle CORS preflight handler. |
|
|
96
|
+
| `MAX_QUERY_DEPTH` | `0` (disabled) | Reject queries deeper than this — guard against abusive nested selections. |
|
|
97
|
+
|
|
98
|
+
The complete list lives in [`packages/server/src/types/env.ts`](./src/types/env.ts).
|
|
99
|
+
|
|
100
|
+
## Configuration helpers
|
|
101
|
+
|
|
102
|
+
Import the configuration helpers — plus `ConfigurationFn` and the config types — from `@graphoria/server/config`:
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
import type { ConfigurationFn } from "@graphoria/server/config";
|
|
106
|
+
import {
|
|
107
|
+
operation,
|
|
108
|
+
cron,
|
|
109
|
+
z,
|
|
110
|
+
queue,
|
|
111
|
+
virtualColumnExpression,
|
|
112
|
+
virtualColumnFunction,
|
|
113
|
+
createOneToBooleanMSSQL,
|
|
114
|
+
createYAndNToBooleanMSSQL,
|
|
115
|
+
} from "@graphoria/server/config";
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## See also
|
|
119
|
+
|
|
120
|
+
- [Quickstart](../../docs/QUICKSTART.md)
|
|
121
|
+
- [Configuration Reference](../../docs/CONFIGURATION.md)
|
|
122
|
+
- [Authentication](../../docs/AUTHENTICATION.md)
|
|
123
|
+
- [Permissions & Access Control](../../docs/PERMISSIONS.md)
|
|
124
|
+
- [Operations](../../docs/OPERATIONS.md)
|
|
125
|
+
- [Queues](../../docs/QUEUES.md)
|
|
126
|
+
- [Cron Jobs](../../docs/CRON.md)
|
|
127
|
+
- [Remote GraphQL Schemas](../../docs/REMOTE_SCHEMAS.md)
|
|
128
|
+
- [Remote REST APIs](../../docs/REMOTE_REST.md)
|
|
129
|
+
- [Subscriptions](../../docs/SUBSCRIPTIONS.md)
|
package/cli.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import { parseArgs } from "util";
|
|
3
|
+
|
|
4
|
+
import { seedAuthCommand } from "./src/cli/seedAuth";
|
|
5
|
+
import { version } from "./package.json";
|
|
6
|
+
|
|
7
|
+
const rawArgs = Bun.argv.slice(2);
|
|
8
|
+
|
|
9
|
+
if (rawArgs[0] === "seed-auth") {
|
|
10
|
+
await seedAuthCommand(rawArgs.slice(1));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { values } = parseArgs({
|
|
14
|
+
args: rawArgs,
|
|
15
|
+
options: {
|
|
16
|
+
config: { type: "string", short: "c" },
|
|
17
|
+
port: { type: "string", short: "p" },
|
|
18
|
+
cluster: { type: "boolean", short: "C" },
|
|
19
|
+
workers: { type: "string", short: "w" },
|
|
20
|
+
help: { type: "boolean", short: "h" },
|
|
21
|
+
version: { type: "boolean", short: "v" },
|
|
22
|
+
},
|
|
23
|
+
strict: true,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
if (values.help) {
|
|
27
|
+
console.log(
|
|
28
|
+
`
|
|
29
|
+
graphoria v${version}
|
|
30
|
+
|
|
31
|
+
Usage: graphoria [options]
|
|
32
|
+
graphoria seed-auth --user <name> --password <pwd> --role <role> [--config <path>] [--claims <json>]
|
|
33
|
+
|
|
34
|
+
Options:
|
|
35
|
+
-c, --config <path> Path to configuration file (env: CONFIGURATION)
|
|
36
|
+
-p, --port <number> Server port (env: PORT, default: 3000)
|
|
37
|
+
-C, --cluster Run in cluster mode (auto-detect CPU cores)
|
|
38
|
+
-w, --workers <N> Number of cluster workers (implies --cluster)
|
|
39
|
+
-h, --help Show this help message
|
|
40
|
+
-v, --version Show version number
|
|
41
|
+
|
|
42
|
+
Subcommands:
|
|
43
|
+
seed-auth Insert an auth user (argon2id-hashed) into the configured auth database
|
|
44
|
+
|
|
45
|
+
Environment variables:
|
|
46
|
+
ADMIN_SECRET Admin secret for superadmin access (required)
|
|
47
|
+
JWT_SECRET JWT signing secret (required)
|
|
48
|
+
CONFIGURATION Path to configuration file
|
|
49
|
+
PORT Server port (default: 3000)
|
|
50
|
+
NODE_ENV Environment mode (default: DEVELOPMENT)
|
|
51
|
+
ANONYMOUS_ROLE Default unauthenticated role (default: anonymous)
|
|
52
|
+
GRAPHQL_API_ENDPOINT GraphQL endpoint path (default: /graphql)
|
|
53
|
+
REST_API_PREFIX REST API prefix (default: /rest)
|
|
54
|
+
CORS_ENABLED Enable CORS (default: true)
|
|
55
|
+
`.trim(),
|
|
56
|
+
);
|
|
57
|
+
process.exit(0);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (values.version) {
|
|
61
|
+
console.log(version);
|
|
62
|
+
process.exit(0);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const standaloneScript = `${import.meta.dir}/standalone.ts`;
|
|
66
|
+
const cmd: string[] = ["bun", standaloneScript];
|
|
67
|
+
if (values.config) cmd.push("--config", values.config);
|
|
68
|
+
if (values.port) cmd.push("--port", values.port);
|
|
69
|
+
|
|
70
|
+
if (values.cluster || values.workers) {
|
|
71
|
+
cmd.push("--reuse-port");
|
|
72
|
+
const requested = values.workers ? parseInt(values.workers, 10) : NaN;
|
|
73
|
+
const workers =
|
|
74
|
+
Number.isNaN(requested) || requested <= 0 ? navigator.hardwareConcurrency : requested;
|
|
75
|
+
|
|
76
|
+
const children = Array.from({ length: workers }, () =>
|
|
77
|
+
Bun.spawn({
|
|
78
|
+
cmd,
|
|
79
|
+
stdout: "inherit",
|
|
80
|
+
stderr: "inherit",
|
|
81
|
+
stdin: "inherit",
|
|
82
|
+
}),
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
console.log(`🚀 Cluster started with ${workers} workers`);
|
|
86
|
+
|
|
87
|
+
function kill() {
|
|
88
|
+
for (const child of children) {
|
|
89
|
+
child.kill();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
process.on("SIGINT", kill);
|
|
94
|
+
process.on("exit", kill);
|
|
95
|
+
} else {
|
|
96
|
+
const child = Bun.spawn({
|
|
97
|
+
cmd,
|
|
98
|
+
stdout: "inherit",
|
|
99
|
+
stderr: "inherit",
|
|
100
|
+
stdin: "inherit",
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
process.on("SIGINT", () => child.kill());
|
|
104
|
+
process.on("exit", () => child.kill());
|
|
105
|
+
}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Tool } from "./types";
|
|
2
|
+
/** Pre-bound agent config. Use with {@link createAgent}. */
|
|
3
|
+
export interface AgentConfig {
|
|
4
|
+
tools: Tool[];
|
|
5
|
+
systemPrompt: string;
|
|
6
|
+
/** Wraps the raw user prompt into the final user message sent to the LLM. */
|
|
7
|
+
wrap: (content: string) => string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Create a pre-configured agent function. Bind tools, system prompt, and prompt
|
|
11
|
+
* wrapper once — call with just a prompt string any number of times.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const ask = createAgent({
|
|
15
|
+
* tools,
|
|
16
|
+
* systemPrompt: "You are a database assistant...",
|
|
17
|
+
* wrap: (prompt) => `Database-query from user:\n> ${prompt}`,
|
|
18
|
+
* });
|
|
19
|
+
* const answer = await ask("list all contacts grouped by role");
|
|
20
|
+
*/
|
|
21
|
+
export declare function createAgent(config: AgentConfig): (prompt: string) => Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Send a prompt to the LLM and return ONLY the final text answer.
|
|
24
|
+
* Handles tool-calling loops internally — the caller never sees tool calls.
|
|
25
|
+
*
|
|
26
|
+
* Use {@link createAgent} for a pre-configured single-arg version.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const answer = await ask(
|
|
30
|
+
* "list all contacts grouped by role",
|
|
31
|
+
* tools,
|
|
32
|
+
* "You are a database assistant...",
|
|
33
|
+
* (prompt) => `Database-query from user:\n> ${prompt}`,
|
|
34
|
+
* );
|
|
35
|
+
*/
|
|
36
|
+
export declare function ask(prompt: string, tools: Tool[], systemPrompt: string, wrap: (content: string) => string): Promise<string>;
|
|
37
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../../src/ai/agent/agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAW,IAAI,EAAkB,MAAM,SAAS,CAAC;AAsE7D,4DAA4D;AAC5D,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CACnC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAEpF;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAsB,GAAG,CACvB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,IAAI,EAAE,EACb,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAChC,OAAO,CAAC,MAAM,CAAC,CAyGjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Provider } from "../types";
|
|
2
|
+
export interface AnthropicConfig {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
model: string;
|
|
5
|
+
maxTokens?: number;
|
|
6
|
+
temperature?: number;
|
|
7
|
+
}
|
|
8
|
+
/** Provider for Anthropic's Messages API (Claude). */
|
|
9
|
+
export declare function makeAnthropic(cfg: AnthropicConfig): Provider;
|
|
10
|
+
//# sourceMappingURL=anthropic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../../../src/ai/agent/providers/anthropic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAuB,QAAQ,EAA4B,MAAM,UAAU,CAAC;AAExF,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAkED,sDAAsD;AACtD,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,QAAQ,CAqC5D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Provider } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the active LLM provider from `LLM_PROVIDER` (default "ollama").
|
|
4
|
+
* The provider module (and its SDK) is dynamically imported on demand, so
|
|
5
|
+
* unused provider SDKs never load. Each provider reads its own env vars lazily.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getProvider(): Promise<Provider>;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/agent/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AA+CzC;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC,CAS/C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Provider } from "../types";
|
|
2
|
+
export declare const config: {
|
|
3
|
+
host: string;
|
|
4
|
+
model: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Native Ollama provider. Talks to /api/chat directly (no SDK) and keeps the
|
|
8
|
+
* per-model sampling presets. Default provider — runs local/free, no API key.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ollamaProvider: Provider;
|
|
11
|
+
//# sourceMappingURL=ollama.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ollama.d.ts","sourceRoot":"","sources":["../../../../../src/ai/agent/providers/ollama.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,QAAQ,EAAkB,MAAM,UAAU,CAAC;AAM9E,eAAO,MAAM,MAAM;;;CAGlB,CAAC;AA6EF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,QAqC5B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Provider } from "../types";
|
|
2
|
+
export interface OpenAICompatConfig {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
model: string;
|
|
5
|
+
/** Override for OpenAI-compatible endpoints (DeepSeek, Groq, Mistral, …). */
|
|
6
|
+
baseURL?: string;
|
|
7
|
+
temperature?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Provider for any OpenAI-compatible Chat Completions endpoint.
|
|
11
|
+
* Used for OpenAI, DeepSeek, and other compatible servers via `baseURL`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function makeOpenAICompatible(cfg: OpenAICompatConfig): Provider;
|
|
14
|
+
//# sourceMappingURL=openai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../../../src/ai/agent/providers/openai.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAuB,QAAQ,EAAkB,MAAM,UAAU,CAAC;AAK9E,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAuDD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,kBAAkB,GAAG,QAAQ,CA4BtE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
export interface ToolFunction {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: Record<string, unknown>;
|
|
8
|
+
required?: string[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface ToolDefinition {
|
|
12
|
+
type: "function";
|
|
13
|
+
function: ToolFunction;
|
|
14
|
+
}
|
|
15
|
+
export interface Tool<TSchema extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
schema: TSchema;
|
|
19
|
+
execute: (args: z.infer<TSchema>) => Promise<unknown>;
|
|
20
|
+
}
|
|
21
|
+
export interface ToolCall {
|
|
22
|
+
/** Correlation id. Synthesized for providers that omit one (Ollama). */
|
|
23
|
+
id: string;
|
|
24
|
+
function: {
|
|
25
|
+
name: string;
|
|
26
|
+
arguments: Record<string, unknown>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface Message {
|
|
30
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
31
|
+
content: string;
|
|
32
|
+
tool_calls?: ToolCall[];
|
|
33
|
+
/** Tool-result correlation id (OpenAI tool_call_id / Anthropic tool_use_id). */
|
|
34
|
+
tool_call_id?: string;
|
|
35
|
+
/** Tool name for Ollama tool-result messages. */
|
|
36
|
+
tool_name?: string;
|
|
37
|
+
}
|
|
38
|
+
/** Normalized result of one chat turn, independent of provider wire format. */
|
|
39
|
+
export interface ChatResult {
|
|
40
|
+
content: string;
|
|
41
|
+
toolCalls: ToolCall[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A chat backend. Each implementation translates the normalized message/tool
|
|
45
|
+
* history to and from its provider's wire format. Stateless: the full message
|
|
46
|
+
* history is passed on every call.
|
|
47
|
+
*/
|
|
48
|
+
export interface Provider {
|
|
49
|
+
chat(messages: Message[], tools: ToolDefinition[]): Promise<ChatResult>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai/agent/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,YAAY,CAAC;CACxB;AAID,MAAM,WAAW,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACvD;AAID,MAAM,WAAW,QAAQ;IACvB,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,CAAC;CACH;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;IACxB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,+EAA+E;AAC/E,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask-field.test.d.ts","sourceRoot":"","sources":["../../../src/ai/ask-field.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ask, createAgent } from "./agent";
|
|
2
|
+
export type { AgentConfig } from "./agent";
|
|
3
|
+
export { createMCPRoutes } from "./mcp";
|
|
4
|
+
export type { CreateMCPRoutesOptions } from "./mcp";
|
|
5
|
+
export { buildAgentTools } from "./tools/agent";
|
|
6
|
+
export type { RoleEntities } from "./tools/core";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,YAAY,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|