├── .eslintrc.cjs ├── .github └── workflows │ ├── github-pages.yml │ └── unit_tests.yaml ├── .gitignore ├── .php-cs-fixer.php ├── LICENSE ├── Makefile ├── README.md ├── app ├── README.md └── Template │ ├── Component.php │ ├── Component │ ├── StaticPageBreadcrumbs.php │ ├── StaticPageDocumentTableOfContents.php │ └── StaticPageDocumentsMenu.php │ ├── StaticPageLayout.php │ └── StaticPageLayout │ ├── Turbo.php │ └── Turbo │ ├── Document.php │ ├── Page.php │ ├── Tutorial.php │ └── TutorialList.php ├── bin └── resonance.php ├── composer.json ├── composer.lock ├── config.ini.example ├── constants.php ├── container.php ├── docs ├── .gitignore ├── .nojekyll ├── CNAME └── pages │ ├── community │ └── index.md │ ├── docs │ ├── changelog │ │ └── index.md │ ├── extras │ │ ├── index.md │ │ └── ssl-certificate-for-local-development │ │ │ └── index.md │ ├── features │ │ ├── ai │ │ │ ├── index.md │ │ │ ├── machine-learning │ │ │ │ └── index.md │ │ │ ├── prompt-subject-responders │ │ │ │ └── index.md │ │ │ ├── prompt-templates │ │ │ │ ├── chatml │ │ │ │ │ └── index.md │ │ │ │ ├── gemma │ │ │ │ │ └── index.md │ │ │ │ ├── index.md │ │ │ │ ├── mistral-instruct │ │ │ │ │ └── index.md │ │ │ │ └── phi-2 │ │ │ │ │ └── index.md │ │ │ └── server │ │ │ │ ├── index.md │ │ │ │ └── llama-cpp │ │ │ │ ├── extractors │ │ │ │ ├── index.md │ │ │ │ ├── subject │ │ │ │ │ └── index.md │ │ │ │ ├── when │ │ │ │ │ └── index.md │ │ │ │ └── yes-no-maybe │ │ │ │ │ └── index.md │ │ │ │ └── index.md │ │ ├── asset-bundling-esbuild │ │ │ ├── accessing-entrypoints-in-php.md │ │ │ ├── cache-busting.md │ │ │ ├── index.md │ │ │ └── preloading-assets.md │ │ ├── configuration │ │ │ └── index.md │ │ ├── console │ │ │ └── index.md │ │ ├── conversational-applications │ │ │ ├── dialogue-nodes │ │ │ │ └── index.md │ │ │ └── index.md │ │ ├── database │ │ │ ├── doctrine │ │ │ │ ├── console.md │ │ │ │ ├── entities.md │ │ │ │ ├── entity-managers.md │ │ │ │ ├── events.md │ │ │ │ └── index.md │ │ │ ├── index.md │ │ │ ├── migrations │ │ │ │ └── index.md │ │ │ └── swoole │ │ │ │ ├── connection-pools.md │ │ │ │ ├── database-entities.md │ │ │ │ ├── database-queries.md │ │ │ │ ├── index.md │ │ │ │ └── reusing-database-queries.md │ │ ├── dependency-injection │ │ │ └── index.md │ │ ├── events │ │ │ └── index.md │ │ ├── generating-static-sites │ │ │ ├── deploying-to-github-pages.md │ │ │ ├── index.md │ │ │ ├── markdown-extensions.md │ │ │ ├── page-structure.md │ │ │ └── providing-layouts.md │ │ ├── graphql │ │ │ ├── developing-schema.md │ │ │ ├── index.md │ │ │ ├── merging-sql-queries.md │ │ │ ├── reusing-database-queries.md │ │ │ └── standalone-promise-adapter.md │ │ ├── grpc │ │ │ ├── client │ │ │ │ └── index.md │ │ │ └── index.md │ │ ├── http │ │ │ ├── controllers.md │ │ │ ├── index.md │ │ │ ├── interceptors.md │ │ │ ├── middleware.md │ │ │ ├── pipe-messages.md │ │ │ ├── responders.md │ │ │ ├── routing.md │ │ │ ├── server.md │ │ │ ├── serving-assets.md │ │ │ └── sessions.md │ │ ├── index.md │ │ ├── mail │ │ │ └── index.md │ │ ├── observability │ │ │ ├── index.md │ │ │ └── observable-task-table │ │ │ │ └── index.md │ │ ├── security │ │ │ ├── authentication │ │ │ │ └── index.md │ │ │ ├── authorization │ │ │ │ └── index.md │ │ │ ├── content-security-policy │ │ │ │ └── index.md │ │ │ ├── csrf-protection │ │ │ │ └── index.md │ │ │ ├── index.md │ │ │ └── oauth2 │ │ │ │ ├── authorization-code-grant │ │ │ │ └── index.md │ │ │ │ ├── configuration │ │ │ │ └── index.md │ │ │ │ ├── enabling-grants │ │ │ │ └── index.md │ │ │ │ ├── index.md │ │ │ │ ├── installation │ │ │ │ └── index.md │ │ │ │ └── persistent-data │ │ │ │ └── index.md │ │ ├── server-side-rendering │ │ │ └── index.md │ │ ├── swoole-futures │ │ │ ├── index.md │ │ │ └── standalone-usage.md │ │ ├── swoole-server-tasks │ │ │ └── index.md │ │ ├── templating │ │ │ ├── index.md │ │ │ ├── php-templates │ │ │ │ └── index.md │ │ │ └── twig │ │ │ │ ├── index.md │ │ │ │ ├── registering-extensions.md │ │ │ │ ├── registering-template-loaders.md │ │ │ │ └── rendering-templates.md │ │ ├── timers │ │ │ ├── cron │ │ │ │ └── index.md │ │ │ ├── index.md │ │ │ └── tick-timer │ │ │ │ └── index.md │ │ ├── translations │ │ │ └── index.md │ │ ├── validation │ │ │ ├── constraints │ │ │ │ └── index.md │ │ │ ├── form-models │ │ │ │ └── index.md │ │ │ ├── http-controller-parameters │ │ │ │ └── index.md │ │ │ └── index.md │ │ ├── vector-store │ │ │ ├── index.md │ │ │ └── sqlite-vss │ │ │ │ └── index.md │ │ └── websockets │ │ │ ├── index.md │ │ │ ├── protocols.md │ │ │ └── server.md │ ├── getting-started │ │ ├── index.md │ │ ├── installation-and-requirements.md │ │ └── resonances-goals-and-principles.md │ └── index.md │ ├── index.md │ ├── swoole │ └── index.md │ ├── tutorials │ ├── basic-graphql-schema │ │ └── index.md │ ├── hello-world │ │ └── index.md │ ├── how-to-create-llm-websocket-chat-with-llama-cpp │ │ └── index.md │ ├── how-to-serve-llm-completions │ │ └── index.md │ ├── how-to-setup-postfix-for-outgoing-emails │ │ └── index.md │ ├── index.md │ ├── oauth2-server │ │ └── index.md │ ├── retrieval-augmented-generation-with-resonance-and-rubixml │ │ └── index.md │ ├── semi-scripted-conversational-applications │ │ └── index.md │ └── session-based-authentication │ │ └── index.md │ └── use-cases │ └── index.md ├── examples └── machine-learning │ ├── .gitignore │ ├── README.md │ ├── app │ ├── Command │ │ └── TrainIris.php │ ├── HtmlErrorTemplate.php │ ├── HttpResponder │ │ └── Predict.php │ ├── UserRepository.php │ ├── lang │ │ └── en │ │ │ └── error.ini │ └── views │ │ ├── error.twig │ │ └── homepage.twig │ ├── bin │ ├── doctrine.php │ └── resonance.php │ ├── composer.json │ ├── composer.lock │ ├── config.ini.example │ ├── constants.php │ ├── container.php │ ├── datasets │ └── iris.ndjson │ ├── models │ └── .gitignore │ ├── psalm.xml │ └── tools │ └── psalm │ ├── .gitignore │ ├── composer.json │ └── composer.lock ├── package.json ├── phpunit.xml ├── phpunit_bootstrap.php ├── psalm.xml ├── rector.php ├── resources ├── css │ ├── _fonts.css │ ├── _reset.css │ ├── docs-breadcrumbs.css │ ├── docs-common.css │ ├── docs-formatted-content.css │ ├── docs-hljs.css │ ├── docs-links-group.css │ ├── docs-page-document.css │ ├── docs-page-homepage.css │ └── docs-page-tutorial.css ├── icons │ ├── circle-info-000000.svg │ ├── fire-000000.svg │ ├── info-000000.svg │ ├── lightbulb-000000.svg │ ├── plug-circle-plus-333333.svg │ ├── search-000000.svg │ ├── triangle-exclamation-000000.svg │ └── up-right-from-square-fbb829.svg ├── images │ ├── amphp.webp │ ├── chatgpt.webp │ ├── favicon.ico │ ├── ogimage.webp │ ├── openswoole.png │ ├── resonance_cat.webp │ ├── rubixml.png │ ├── swoole.png │ └── zork.png └── ts │ ├── app │ ├── EventIterator.ts │ ├── Logger.ts │ ├── LoggerInterface.ts │ ├── MainLoopIterator.ts │ └── createLogger.ts │ ├── configureTurbo.ts │ ├── docs │ ├── controller_article.ts │ ├── controller_aside-filter.ts │ ├── controller_aside.ts │ ├── controller_graphviz.ts │ ├── controller_hljs.ts │ ├── controller_mermaid.ts │ ├── controller_minimap.ts │ ├── global_stimulus.ts │ └── global_turbo.ts │ └── stimulus.ts ├── src ├── AcceptHeader.php ├── AcceptHeaderTest.php ├── ApplicationConfiguration.php ├── ArrayFlattenIterator.php ├── ArrayFlattenIteratorTest.php ├── AssetFileRegistry.php ├── Attribute.php ├── Attribute │ ├── Can.php │ ├── ConsoleCommand.php │ ├── ContentSecurityPolicy.php │ ├── ControlsWebSocketProtocol.php │ ├── CrudActionSubject.php │ ├── CurrentRequest.php │ ├── CurrentResponse.php │ ├── DecidesCrudAction.php │ ├── DecidesSiteAction.php │ ├── DoctrineEntityManager.php │ ├── DoctrineEntityRepository.php │ ├── DoctrineEntityRouteParameter.php │ ├── ExtractsOpenAPIMetadataResponse.php │ ├── ExtractsOpenAPIMetadataSecurityRequirement.php │ ├── ExtractsOpenAPIRouteParameter.php │ ├── ExtractsOpenAPIRouteRequestBody.php │ ├── ExtractsOpenAPIRouteSecurityRequirement.php │ ├── GrantsFeature.php │ ├── GraphQLRootField.php │ ├── HandlesMiddlewareAttribute.php │ ├── HandlesServerPipeMessage.php │ ├── HandlesServerTask.php │ ├── Intercepts.php │ ├── ListensTo.php │ ├── ListensToDoctrineEntityEvents.php │ ├── ListensToDoctrineEvents.php │ ├── OnParameterResolution.php │ ├── ProvidesAuthenticatedUser.php │ ├── ProvidesOAuth2Grant.php │ ├── ProvidesOAuth2Scope.php │ ├── ProvidesRouteParameter.php │ ├── RequiresOAuth2Scope.php │ ├── RequiresPhpExtension.php │ ├── RequiresSingletonCollection.php │ ├── ResolvesHttpControllerParameter.php │ ├── RespondsToHttp.php │ ├── RespondsToOAuth2Endpoint.php │ ├── RespondsToPromptSubject.php │ ├── RespondsToWebSocketJsonRPC.php │ ├── RouteParameter.php │ ├── ScheduledWithCron.php │ ├── ScheduledWithTickTimer.php │ ├── SessionAuthenticated.php │ ├── SideEffect.php │ ├── Singleton.php │ ├── StaticPageLayout.php │ ├── TwigExtension.php │ ├── TwigFilter.php │ ├── TwigFunction.php │ ├── TwigLoader.php │ ├── ValidatedRequest.php │ ├── ValidatesCSRFToken.php │ ├── WantsFeature.php │ └── WebSocketAware.php ├── AuthenticatedUser.php ├── AuthenticatedUserSource.php ├── AuthenticatedUserStoreAggregate.php ├── AuthenticatedUserStoreInterface.php ├── BackusNaurFormGrammar.php ├── BackusNaurFormGrammar │ ├── InlineGrammar.php │ ├── SubjectActionGrammar.php │ ├── YesNoGrammar.php │ └── YesNoMaybeGrammar.php ├── CSPNonceManager.php ├── CSRFManager.php ├── CastableEnumTrait.php ├── CastsValidatedDataInterface.php ├── Command.php ├── Command │ ├── Cron.php │ ├── GenerateDefuseKey.php │ ├── GenerateHttpController.php │ ├── GenerateHttpResponder.php │ ├── GrpcGenerate.php │ ├── GrpcRewrite.php │ ├── LlamaCppGenerate.php │ ├── LlamaCppGenerate │ │ ├── Completion.php │ │ └── Embedding.php │ ├── LlamaCppHealth.php │ ├── LlamaCppInfill.php │ ├── MailSend.php │ ├── PostfixBounce.php │ ├── Serve.php │ ├── StaticPagesBuild.php │ ├── StaticPagesDumpContent.php │ ├── StaticPagesMakeEmbeddings.php │ └── Watch.php ├── CommandLoader.php ├── CommonMarkAdmonitionBlock.php ├── CommonMarkAdmonitionBlockParser.php ├── CommonMarkAdmonitionBlockStartParser.php ├── CommonMarkAdmonitionExtension.php ├── CommonMarkAdmonitionRenderer.php ├── CommonMarkEmbedAdapter.php ├── CommonMarkFencedCodeRenderer.php ├── CommonMarkInlineCodeRenderer.php ├── CommonMarkRenderedContentWithTableOfContentsLinks.php ├── CommonMarkTableOfContentsBuilder.php ├── CommonMarkTableOfContentsLink.php ├── ConfigurationFile.php ├── ConsoleApplication.php ├── Constraint.php ├── Constraint │ ├── AnyConstraint.php │ ├── AnyConstraintTest.php │ ├── AnyOfConstraint.php │ ├── AnyOfConstraintTest.php │ ├── BooleanConstraint.php │ ├── BooleanConstraintTest.php │ ├── ConstConstraint.php │ ├── ConstConstraintTest.php │ ├── EnumConstraint.php │ ├── EnumConstraintTest.php │ ├── FilenameConstraint.php │ ├── FilenameConstraintTest.php │ ├── IntegerConstraint.php │ ├── IntegerConstraintTest.php │ ├── ListConstraint.php │ ├── ListConstraintTest.php │ ├── MapConstraint.php │ ├── MapConstraintTest.php │ ├── NumberConstraint.php │ ├── NumberConstraintTest.php │ ├── ObjectConstraint.php │ ├── ObjectConstraintTest.php │ ├── StringConstraint.php │ ├── StringConstraintTest.php │ ├── TupleConstraint.php │ └── TupleConstraintTest.php ├── ConstraintDefaultValue.php ├── ConstraintPath.php ├── ConstraintReason.php ├── ConstraintResult.php ├── ConstraintResultErrorMessage.php ├── ConstraintResultStatus.php ├── ConstraintSourceInterface.php ├── ConstraintStringFormat.php ├── ConstraintValidationException.php ├── ConstructorParametersIterator.php ├── ContentSecurityPolicyDirectives.php ├── ContentSecurityPolicyRequestRules.php ├── ContentSecurityPolicyRulesRepository.php ├── ContentSecurityPolicyType.php ├── ContentType.php ├── ContentTypeResponder.php ├── CookieManager.php ├── CoroutineCommand.php ├── CronJob.php ├── CronJobAggregate.php ├── CronJobInterface.php ├── CronJobRunner.php ├── CronRegisteredJob.php ├── CronScheduler.php ├── CrudAction.php ├── CrudActionGate.php ├── CrudActionGateAggregate.php ├── CrudActionGateInterface.php ├── CrudActionSubjectInterface.php ├── CurlErrorMessage.php ├── CurlException.php ├── DatabaseConfiguration.php ├── DatabaseConnection.php ├── DatabaseConnectionPoolConfiguration.php ├── DatabaseConnectionPoolDriverName.php ├── DatabaseConnectionPoolRepository.php ├── DatabaseEntity.php ├── DatabaseEntityInterface.php ├── DatabaseExecutedStatement.php ├── DatabasePreparedStatement.php ├── DatabaseQuery.php ├── DatabaseQueryInterface.php ├── DatabaseQueryLogger.php ├── DependencyInjectionContainer.php ├── DependencyInjectionContainerException.php ├── DependencyInjectionContainerException │ ├── AmbiguousProvider.php │ ├── DependencyCycle.php │ ├── DisabledFeatureProvider.php │ ├── MissingPhpExtensions.php │ └── MissingProvider.php ├── DependencyProvider.php ├── DependencyProviderIterator.php ├── DependencyStack.php ├── DialogueController.php ├── DialogueControllerInterface.php ├── DialogueInput.php ├── DialogueInput │ └── UserInput.php ├── DialogueInputInterface.php ├── DialogueMessageChunk.php ├── DialogueMessageProducer.php ├── DialogueMessageProducer │ ├── ConstMessageProducer.php │ ├── ConstMessageProducerTest.php │ ├── EmptyMessageProducer.php │ └── LlamaCppPromptMessageProducer.php ├── DialogueMessageProducerInterface.php ├── DialogueNode.php ├── DialogueNodeInterface.php ├── DialogueNodeSideEffect.php ├── DialogueNodeSideEffectInterface.php ├── DialogueNodeTest.php ├── DialogueResponse.php ├── DialogueResponse │ ├── CatchAllResponse.php │ ├── LiteralInputResponse.php │ ├── LlamaCppExtractSubjectResponse.php │ ├── LlamaCppExtractWhenResponse.php │ └── LlamaCppExtractYesNoMaybeResponse.php ├── DialogueResponseInterface.php ├── DialogueResponseResolution.php ├── DialogueResponseResolutionInterface.php ├── DialogueResponseResolutionStatus.php ├── DialogueResponseSortedIterator.php ├── DialogueResponseSortedIteratorTest.php ├── DoctrineAttributeDriver.php ├── DoctrineConnectionRepository.php ├── DoctrineConsoleEntityManagerProvider.php ├── DoctrineConsoleRunner.php ├── DoctrineDriverConnectTrait.php ├── DoctrineEntityListener.php ├── DoctrineEntityListenerCollection.php ├── DoctrineEntityListenerResolver.php ├── DoctrineEntityManagerRepository.php ├── DoctrineEntityManagerWeakStore.php ├── DoctrineEventSubscriber.php ├── DoctrineEventSubscriber │ └── RegisterEntityListeners.php ├── DoctrineMySQLDriver.php ├── DoctrinePostgreSQLDriver.php ├── DoctrineSQLiteDriver.php ├── EntityManagerWeakReference.php ├── EnumValuesTrait.php ├── Environment.php ├── ErrorHttpResponderDependencies.php ├── ErrorTemplateInterface.php ├── EsbuildMeta.php ├── EsbuildMetaBuilder.php ├── EsbuildMetaEntryPoints.php ├── EsbuildMetaPreloadsRenderer.php ├── EsbuildPreloadable.php ├── EsbuildPreloadableType.php ├── EsbuildPreloadablesIterator.php ├── Event.php ├── Event │ ├── HttpResponseReady.php │ ├── HttpServerBeforeStop.php │ ├── HttpServerStarted.php │ ├── MailBounced.php │ └── UnhandledException.php ├── EventDispatcher.php ├── EventDispatcherInterface.php ├── EventListener.php ├── EventListener │ ├── CloseDoctrineConnection.php │ ├── CloseWebSocketConnections.php │ ├── LogRequest.php │ ├── PersistSession.php │ └── ReportThrowableToLogger.php ├── EventListenerAggregate.php ├── EventListenerInterface.php ├── Feature.php ├── FeatureInterface.php ├── FooInterface.php ├── FrontMatterCollectionReference.php ├── Gatekeeper.php ├── GatekeeperRequestContext.php ├── GatekeeperUserContext.php ├── GeneratorHelper.php ├── GraphQLAdapter.php ├── GraphQLDatabaseQueryAdapter.php ├── GraphQLExecutionPromise.php ├── GraphQLFieldableInterface.php ├── GraphQLResolverException.php ├── GraphQLResolverException │ ├── Forbidden.php │ └── InvalidReturnType.php ├── GraphQLReusableDatabaseQueryInterface.php ├── GraphQLRootFieldType.php ├── GraphQLSchemaRootFieldInterface.php ├── GrpcBaseClient.php ├── GrpcConfiguration.php ├── GrpcPoolConfiguration.php ├── HtmlErrorTemplateInterface.php ├── HttpControllerDependencies.php ├── HttpControllerMetadataException.php ├── HttpControllerParameter.php ├── HttpControllerParameterResolution.php ├── HttpControllerParameterResolutionStatus.php ├── HttpControllerParameterResolver.php ├── HttpControllerParameterResolver │ ├── CurrentRequestResolver.php │ ├── CurrentResponseResolver.php │ ├── DoctrineEntityManagerResolver.php │ ├── DoctrineEntityRepositoryResolver.php │ ├── DoctrineEntityRouteParameterResolver.php │ ├── RouteParameterResolver.php │ ├── SessionAuthenticatedResolver.php │ └── ValidatedRequestResolver.php ├── HttpControllerParameterResolverAggregate.php ├── HttpControllerParameterResolverInterface.php ├── HttpControllerReflectionMethod.php ├── HttpControllerRequestHandler.php ├── HttpError.php ├── HttpError │ ├── BadRequest.php │ ├── Forbidden.php │ ├── MethodNotAllowed.php │ ├── PageNotFound.php │ └── ServerError.php ├── HttpInterceptableInterface.php ├── HttpInterceptor.php ├── HttpInterceptor │ ├── InternalRedirectInterceptor.php │ ├── JsonTemplateInterceptor.php │ ├── OAuth2UserSessionAuthenticatedInterceptor.php │ └── TwigTemplateInterceptor.php ├── HttpInterceptorAggregate.php ├── HttpInterceptorInterface.php ├── HttpMiddleware.php ├── HttpMiddleware │ ├── CanMiddleware.php │ ├── ContentSecurityPolicyMiddleware.php │ ├── RequiresOAuth2ScopeMiddleware.php │ ├── RespondsToOAuth2EndpointMiddleware.php │ └── ValidatesCSRFTokenMiddleware.php ├── HttpMiddlewareAggregate.php ├── HttpMiddlewareAttribute.php ├── HttpMiddlewareInterface.php ├── HttpRecursiveResponder.php ├── HttpRequestData.php ├── HttpRequestLanguageDetector.php ├── HttpResponder.php ├── HttpResponder │ ├── Error.php │ ├── Error │ │ ├── BadRequest.php │ │ ├── Forbidden.php │ │ ├── MethodNotAllowed.php │ │ ├── PageNotFound.php │ │ └── ServerError.php │ ├── FunctionResponder.php │ ├── GraphQL.php │ ├── HttpController.php │ ├── Json.php │ ├── NotAcceptable.php │ ├── OAuth2.php │ ├── OAuth2 │ │ ├── AccessToken.php │ │ └── Authorization.php │ ├── Override.php │ └── Redirect.php ├── HttpResponderAggregate.php ├── HttpResponderCollection.php ├── HttpResponderInterface.php ├── HttpResponderLoggableInterface.php ├── HttpResponderWithAttribute.php ├── HttpRouteMatch.php ├── HttpRouteMatchRegistry.php ├── HttpRouteMatchStatus.php ├── HttpRouteParameterBinderAggregate.php ├── HttpRouteParameterBinderInterface.php ├── HttpRouteSymbolInterface.php ├── InotifyIterator.php ├── InputValidatedData.php ├── InputValidatedData │ ├── FrontMatter.php │ └── JsonRPCMessage.php ├── InputValidationResult.php ├── InputValidator.php ├── InputValidator │ ├── FrontMatterValidator.php │ └── JsonRPCMessageValidator.php ├── InputValidatorCollection.php ├── InputValidatorController.php ├── InternalLinkBuilder.php ├── InternalRedirect.php ├── IntlDateFormatterRepository.php ├── IntlFormatter.php ├── JsonErrorTemplate.php ├── JsonErrorTemplateInterface.php ├── JsonRPCMethodInterface.php ├── JsonRPCMethodValidatorInterface.php ├── JsonRPCNotification.php ├── JsonRPCNotificationError.php ├── JsonRPCRequest.php ├── JsonRPCResponse.php ├── JsonRPCResponseError.php ├── JsonSchemableInterface.php ├── JsonSerializer.php ├── JsonTemplate.php ├── LlamaCppClient.php ├── LlamaCppClientInterface.php ├── LlamaCppClientResponseChunk.php ├── LlamaCppClientTest.php ├── LlamaCppCompletionIterator.php ├── LlamaCppCompletionRequest.php ├── LlamaCppCompletionToken.php ├── LlamaCppConfiguration.php ├── LlamaCppEmbedding.php ├── LlamaCppEmbeddingRequest.php ├── LlamaCppExtractSubject.php ├── LlamaCppExtractSubjectInterface.php ├── LlamaCppExtractSubjectResult.php ├── LlamaCppExtractSubjectTest.php ├── LlamaCppExtractWhen.php ├── LlamaCppExtractWhenInterface.php ├── LlamaCppExtractWhenResult.php ├── LlamaCppExtractWhenTest.php ├── LlamaCppExtractYesNoMaybe.php ├── LlamaCppExtractYesNoMaybeResult.php ├── LlamaCppExtractYesNoMaybeTest.php ├── LlamaCppHealthStatus.php ├── LlamaCppInfill.php ├── LlamaCppInfillRequest.php ├── LlamaCppLinkBuilder.php ├── LlmChatHistory.php ├── LlmChatHistoryRenderer.php ├── LlmChatMessage.php ├── LlmChatMessageRenderer.php ├── LlmChatMessageRenderer │ ├── ChatMLMessageRenderer.php │ ├── ChatMLMessageRendererTest.php │ ├── GemmaInstructMessageRenderer.php │ ├── MistralInstructMessageRenderer.php │ └── Phi2QuestionRenderer.php ├── LlmChatMessageRendererInterface.php ├── LlmChatTemplateType.php ├── LlmCompletionProgress.php ├── LlmCompletionProgressInterface.php ├── LlmCompletionTokenInterface.php ├── LlmPersona.php ├── LlmPersona │ └── HelpfulAssistant.php ├── LlmPersonaInterface.php ├── LlmPrompt.php ├── LlmPrompt │ └── SubjectActionPrompt.php ├── LoggableInterface.php ├── MailBounceReportInterface.php ├── Mailer.php ├── MailerConfiguration.php ├── MailerRepository.php ├── MailerTransportConfiguration.php ├── MarkdownParser.php ├── NameableEnumTrait.php ├── NameableInterface.php ├── OAuth2AccessTokenRepository.php ├── OAuth2AuthCodeRepository.php ├── OAuth2AuthorizationCodeFlowController.php ├── OAuth2AuthorizationCodeFlowControllerInterface.php ├── OAuth2AuthorizationRequestSessionStore.php ├── OAuth2AuthorizedUser.php ├── OAuth2Claim.php ├── OAuth2ClaimReader.php ├── OAuth2ClientRepository.php ├── OAuth2Configuration.php ├── OAuth2Endpoint.php ├── OAuth2EndpointResponderAggregate.php ├── OAuth2Entity.php ├── OAuth2Entity │ ├── Client.php │ ├── RefreshToken.php │ ├── Scope.php │ ├── Token.php │ ├── Token │ │ ├── AccessToken.php │ │ └── AuthCode.php │ └── User.php ├── OAuth2EntityRepositoryInterface.php ├── OAuth2Grant.php ├── OAuth2GrantAwareClient.php ├── OAuth2GrantCollection.php ├── OAuth2GrantProvider.php ├── OAuth2GrantProviderInterface.php ├── OAuth2RefreshTokenRepository.php ├── OAuth2Scope.php ├── OAuth2ScopeCollection.php ├── OAuth2ScopeInterface.php ├── OAuth2ScopePattern.php ├── OAuth2ScopePatternChunk.php ├── OAuth2ScopePatternChunkTest.php ├── OAuth2ScopePatternMatch.php ├── OAuth2ScopePatternTest.php ├── OAuth2ScopeRepository.php ├── OAuth2SecretAwareClient.php ├── OAuth2UserSessionAuthenticated.php ├── ObjectType │ └── RootFieldType.php ├── ObservableTask.php ├── ObservableTaskCategory.php ├── ObservableTaskConfiguration.php ├── ObservableTaskInterface.php ├── ObservableTaskSlotStatusUpdate.php ├── ObservableTaskStatus.php ├── ObservableTaskStatusReporter.php ├── ObservableTaskStatusUpdate.php ├── ObservableTaskTable.php ├── ObservableTaskTableRow.php ├── ObservableTaskTableTest.php ├── PDOException.php ├── PHPFileIterator.php ├── PHPFileNamespaceReader.php ├── PHPFileReflectionClassAttribute.php ├── PHPFileReflectionClassAttributeIterator.php ├── PHPFileReflectionClassIterator.php ├── PHPFileReflectionFunctionAttribute.php ├── PHPFileReflectionFunctionAttributeIterator.php ├── PHPFileReflectionFunctionIterator.php ├── PHPFileTokenIterator.php ├── PHPProjectFiles.php ├── PHPTokenSequenceMatcher.php ├── PostfixBounceAnalyzer.php ├── PostfixBounceAnalyzerTest.php ├── PostfixBounceReport.php ├── PromptSubjectRequest.php ├── PromptSubjectResponderAggregate.php ├── PromptSubjectResponderCollection.php ├── PromptSubjectResponderInterface.php ├── PromptSubjectResponse.php ├── PromptSubjectResponseChunk.php ├── PsrMessage.php ├── PsrMessage │ ├── SwooleServerRequest.php │ └── SwooleServerResponse.php ├── PsrStringStream.php ├── PsrSwooleResponder.php ├── RedisConfiguration.php ├── RedisConnection.php ├── RedisConnectionPoolConfiguration.php ├── RedisConnectionPoolRepository.php ├── ReflectionAttributeInterface.php ├── ReflectionAttributeManager.php ├── RegisterableInterface.php ├── RequestDataSource.php ├── RequestMethod.php ├── RespondsToHttpAttributeClassCollection.php ├── RespondsToHttpAttributeRoute.php ├── RespondsToPromptSubjectAttributeCollection.php ├── RubixMLBackend │ └── Swoole.php ├── SQLiteVSSConfiguration.php ├── SQLiteVSSConnectionBuilder.php ├── SanitizedMarkdownParser.php ├── SecureIdentifierGenerator.php ├── SecurityPolicyHeaders.php ├── Serializer.php ├── Serializer │ ├── Igbinary.php │ └── Vanilla.php ├── SerializerInterface.php ├── ServerPipeMessage.php ├── ServerPipeMessage │ └── CloseWebSocketConnection.php ├── ServerPipeMessageDispatcher.php ├── ServerPipeMessageHandlerCollection.php ├── ServerPipeMessageHandlerInterface.php ├── ServerPipeMessageInterface.php ├── ServerTask.php ├── ServerTask │ └── SendEmailMessage.php ├── ServerTaskHandler.php ├── ServerTaskHandler │ └── SendsEmailMessage.php ├── ServerTaskHandlerCollection.php ├── ServerTaskHandlerDispatcher.php ├── ServerTaskHandlerInterface.php ├── Session.php ├── SessionAuthentication.php ├── SessionConfiguration.php ├── SessionManager.php ├── SideEffectProvider.php ├── SideEffectProvider │ ├── RegisterDoctrineJsonDocumentType.php │ └── RegisterDoctrineUlidType.php ├── SideEffectProviderInterface.php ├── SingletonAttribute.php ├── SingletonAttributeClassFilterInterator.php ├── SingletonCollection.php ├── SingletonCollectionInterface.php ├── SingletonContainer.php ├── SingletonContainerAttributeIterator.php ├── SingletonContainerException.php ├── SingletonContainerException │ └── NotFoundException.php ├── SingletonContainerInterface.php ├── SingletonContainerTest.php ├── SingletonFunctionParameter.php ├── SingletonFunctionParametersIterator.php ├── SingletonProvider.php ├── SingletonProvider │ ├── AuthenticatedUserStoreAggregateProvider.php │ ├── ConfigurationFileProvider.php │ ├── ConfigurationProvider.php │ ├── ConfigurationProvider │ │ ├── ApplicationConfigurationProvider.php │ │ ├── DatabaseConfigurationProvider.php │ │ ├── GrpcConfigurationProvider.php │ │ ├── LlamaCppConfigurationProvider.php │ │ ├── MailerConfigurationProvider.php │ │ ├── OAuth2ConfigurationProvider.php │ │ ├── ObservableTaskConfigurationProvider.php │ │ ├── RedisConfigurationProvider.php │ │ ├── SQLiteVSSConfigurationProvider.php │ │ ├── SessionConfigurationProvider.php │ │ ├── StaticPageConfigurationProvider.php │ │ ├── SwooleConfigurationProvider.php │ │ ├── TranslatorConfigurationProvider.php │ │ └── WebSocketConfigurationProvider.php │ ├── ConsoleApplicationProvider.php │ ├── ConsoleOutputProvider.php │ ├── CronJobAggregateProvider.php │ ├── CrudActionGateAggregateProvider.php │ ├── DatabaseConnectionPoolRepositoryProvider.php │ ├── DoctrineAttributeDriverProvider.php │ ├── DoctrineDBALConfigurationProvider.php │ ├── DoctrineEntityListenerCollectionProvider.php │ ├── DoctrineEntityListenerResolverProvider.php │ ├── DoctrineEntityManagerRepositoryProvider.php │ ├── DoctrineEventManagerProvider.php │ ├── DoctrineORMConfigurationProvider.php │ ├── EventListenerAggregateProvider.php │ ├── FilesystemProvider.php │ ├── GraphQLSchemaProvider.php │ ├── HTMLPurifierProvider.php │ ├── HttpClientProvider.php │ ├── HttpControllerParameterResolverAggregateProvider.php │ ├── HttpInterceptorAggregateProvider.php │ ├── HttpMiddlewareAggregateProvider.php │ ├── HttpResponderCollectionProvider.php │ ├── HttpRouteParameterBinderAggregateProvider.php │ ├── HyperfChannelPool.php │ ├── InputValidatorCollectionProvider.php │ ├── InputValidatorControllerProvider.php │ ├── LlmChatMessageRendererProvider.php │ ├── MailerRepositoryProvider.php │ ├── NettePrinterProvider.php │ ├── NetteSchemaProcessorProvider.php │ ├── OAuth2AuthorizationServerProvider.php │ ├── OAuth2EndpointResponderAggregateProvider.php │ ├── OAuth2GrantCollectionProvider.php │ ├── OAuth2ResourceServerProvider.php │ ├── OAuth2ScopeCollectionProvider.php │ ├── PromptSubjectResponderCollectionProvider.php │ ├── RedisConnectionPoolRepositoryProvider.php │ ├── RequestContextProvider.php │ ├── RespondsToHttpAttributeClassCollectionProvider.php │ ├── RespondsToPromptSubjectAttributeCollectionProvider.php │ ├── SerializerProvider.php │ ├── ServerPipeMessageHandlerCollectionProvider.php │ ├── ServerTaskHandlerCollectionProvider.php │ ├── SiteActionGateAggregateProvider.php │ ├── StaticPageAggregateProvider.php │ ├── StaticPageCollectionAggregateProvider.php │ ├── StaticPageLayoutAggregateProvider.php │ ├── TickTimerJobAggregateProvider.php │ ├── TranslatorBridgeProvider.php │ ├── TwigChainLoaderProvider.php │ ├── TwigEnvironmentProvider.php │ ├── TwigFilterCollectionProvider.php │ ├── TwigFunctionCollectionProvider.php │ ├── UrlGeneratorProvider.php │ ├── UrlMatcherProvider.php │ ├── WebSocketJsonRPCResponderAggregateProvider.php │ └── WebSocketProtocolControllerAggregateProvider.php ├── SingletonProviderInterface.php ├── SiteAction.php ├── SiteActionGate.php ├── SiteActionGateAggregate.php ├── SiteActionInterface.php ├── StaticPage.php ├── StaticPageAggregate.php ├── StaticPageChunkIterator.php ├── StaticPageCollection.php ├── StaticPageCollectionAggregate.php ├── StaticPageConfiguration.php ├── StaticPageContentRenderer.php ├── StaticPageContentType.php ├── StaticPageFileException.php ├── StaticPageFileException │ ├── DuplicateCollectionReferenceException.php │ └── FrontMatterValidationException.php ├── StaticPageFileIterator.php ├── StaticPageForestGenerator.php ├── StaticPageInternalLinkDelimiterProcessor.php ├── StaticPageInternalLinkMarkdownExtension.php ├── StaticPageInternalLinkNode.php ├── StaticPageInternalLinkNodeRenderer.php ├── StaticPageIterator.php ├── StaticPageLayoutAggregate.php ├── StaticPageLayoutInterface.php ├── StaticPageMarkdownParser.php ├── StaticPageParentIterator.php ├── StaticPageProcessor.php ├── StaticPageReferenceException.php ├── StaticPageRenderingException.php ├── StaticPageSitemapGenerator.php ├── SubjectActionTokenReader.php ├── SubjectActionTokenReaderTest.php ├── SwooleChannelIterator.php ├── SwooleChannelIteratorChunk.php ├── SwooleChannelIteratorError.php ├── SwooleConfiguration.php ├── SwooleContextRequestResponseReader.php ├── SwooleLoggerBridge.php ├── SwooleServer.php ├── SwooleServerRequestServer.php ├── SwooleServerRequestUri.php ├── SwooleTableAvailableRowsPool.php ├── SwooleTableAvailableRowsPoolTest.php ├── SwooleTaskServerMessageBroker.php ├── SwooleTaskServerMessageBus.php ├── SwooleTimeout.php ├── SwooleTimeoutScheduled.php ├── SwooleTimeoutTest.php ├── Template.php ├── TemplateComponentInterface.php ├── TemplateFilters.php ├── TemplateInterface.php ├── TestsDependencyInectionContainerTrait.php ├── TestsGraphQLQueriesTrait.php ├── TickTimerJobAggregate.php ├── TickTimerJobInterface.php ├── TickTimerRegisteredJob.php ├── TickTimerScheduler.php ├── TranslationException.php ├── TranslationException │ ├── LanguageNotFoundException.php │ ├── MissingTranslationParameterException.php │ └── PhraseNotFoundException.php ├── TranslationsLoader.php ├── TranslatorBridge.php ├── TranslatorConfiguration.php ├── TwigApplicationFilesystemLoader.php ├── TwigBridgeExtension.php ├── TwigChainLoader.php ├── TwigEsbuildContext.php ├── TwigFilter.php ├── TwigFilter │ ├── IntlFormatDate.php │ └── Trans.php ├── TwigFilterCollection.php ├── TwigFilterInterface.php ├── TwigFunction.php ├── TwigFunction │ ├── CSPInclude.php │ ├── CSPNonce.php │ ├── CSRFToken.php │ ├── Esbuild.php │ ├── EsbuildPreload.php │ ├── EsbuildRenderPreloads.php │ ├── GatekeeperCan.php │ ├── GatekeeperCanCrud.php │ ├── Old.php │ └── Route.php ├── TwigFunctionCollection.php ├── TwigFunctionInterface.php ├── TwigOptionalLoaderInterface.php ├── TwigResonanceFilesystemLoader.php ├── TwigTemplate.php ├── UserInterface.php ├── UserRepositoryInterface.php ├── UserRoleInterface.php ├── WebSocketAuthResolution.php ├── WebSocketConfiguration.php ├── WebSocketConnection.php ├── WebSocketConnectionStatus.php ├── WebSocketJsonRPCConnectionController.php ├── WebSocketJsonRPCConnectionControllerInterface.php ├── WebSocketJsonRPCConnectionHandle.php ├── WebSocketJsonRPCResponder.php ├── WebSocketJsonRPCResponder │ └── LlamaCppSubjectActionPromptResponder.php ├── WebSocketJsonRPCResponderAggregate.php ├── WebSocketJsonRPCResponderInterface.php ├── WebSocketProtocol.php ├── WebSocketProtocolController.php ├── WebSocketProtocolController │ └── JsonRPCProtocolController.php ├── WebSocketProtocolControllerAggregate.php ├── WebSocketProtocolControllerInterface.php ├── WebSocketProtocolException.php ├── WebSocketProtocolException │ ├── UnexpectedNotification.php │ └── UnexpectedRequest.php ├── WebSocketProtocolIterator.php ├── WebSocketProtocolIteratorTest.php ├── WebSocketResolvedProtocolController.php ├── WebSocketServerConnectionTable.php ├── WebSocketServerController.php ├── YesNo.php ├── YesNoMaybe.php └── helpers │ ├── coroutineMustGetContext.php │ ├── coroutineMustGo.php │ ├── coroutineMustRun.php │ └── generatorGetReturn.php ├── tmuxinator.example.yml ├── tools ├── php-cs-fixer │ ├── .gitignore │ ├── Makefile │ ├── composer.json │ └── composer.lock └── psalm │ ├── .gitignore │ ├── Makefile │ ├── composer.json │ └── composer.lock ├── tsconfig.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | /*.cache 3 | /.pnp.* 4 | /.yarn 5 | /config.ini 6 | /esbuild-meta-docs.json 7 | /node_modules 8 | /sqlite-vss 9 | /vendor -------------------------------------------------------------------------------- /app/README.md: -------------------------------------------------------------------------------- 1 | # App 2 | 3 | This folder contains templates used to generate the 4 | [documentation](https://resonance.distantmagic.com/). 5 | 6 | For the framework itself, check the `src/` folder. 7 | -------------------------------------------------------------------------------- /app/Template/Component.php: -------------------------------------------------------------------------------- 1 | make(ConsoleApplication::class)->run()); 10 | -------------------------------------------------------------------------------- /constants.php: -------------------------------------------------------------------------------- 1 | phpProjectFiles->indexDirectory(DM_RESONANCE_ROOT); 17 | $container->phpProjectFiles->indexDirectory(DM_APP_ROOT); 18 | $container->registerSingletons(); 19 | 20 | return $container; 21 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | /artifact.tar 2 | /build 3 | /public 4 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distantmagic/resonance/8fa506ee4cb6977224375ce5c7a95f84cb627783/docs/.nojekyll -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | resonance.distantmagic.com 2 | -------------------------------------------------------------------------------- /docs/pages/community/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | - primary_navigation 5 | layout: dm:tutorial-list 6 | title: Community 7 | description: > 8 | Join our community channels to stay informed about new Resonance 9 | developments and features. 10 | --- 11 | 12 | # Community 13 | 14 | Feel free to use [GitHub discussions](https://github.com/distantmagic/resonance/discussions) and other pages related to the repository. 15 | -------------------------------------------------------------------------------- /docs/pages/docs/extras/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/index 6 | title: Extras 7 | description: > 8 | Read additional information that might be useful but is not directly 9 | related to the framework. 10 | --- 11 | 12 | # Extras 13 | 14 | {{docs/extras/*/index}} 15 | -------------------------------------------------------------------------------- /docs/pages/docs/features/ai/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/index 6 | title: Artificial Intelligence 7 | description: > 8 | Use integration features to serve or use AI models. 9 | --- 10 | 11 | # Artificial Intelligence 12 | 13 | {{docs/features/ai/*/index}} 14 | -------------------------------------------------------------------------------- /docs/pages/docs/features/ai/prompt-templates/gemma/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/ai/prompt-templates/index 6 | title: Gemma 7 | description: > 8 | Google's Open-Source alternative to Gemini. 9 | --- 10 | 11 | # Gemma 12 | 13 | Those templates are prepared based on the 14 | [Huggingsface blog release](https://huggingface.co/blog/gemma#prompt-format). 15 | 16 | # Usage 17 | 18 | ## Chat Format 19 | 20 | ``` 21 | user 22 | knock knock 23 | ``` 24 | 25 | ```php 26 | 8 | Match prompt template with the LLM you are using for the best results. 9 | --- 10 | 11 | # Prompt Templates 12 | 13 | Although Large Language Models and Small Language Models strive to be able to 14 | respond to any user prompt, they still require some dose of engineering in 15 | order to get desired results. 16 | 17 | Resonance includes prompt templates for common tasks and the most popular 18 | models. 19 | 20 | Contributions here are more than welcome. 21 | 22 | {{docs/features/ai/prompt-templates/*/index}} 23 | -------------------------------------------------------------------------------- /docs/pages/docs/features/ai/server/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/ai/index 6 | title: Server 7 | description: > 8 | Use Resonance to connect various language models. 9 | --- 10 | 11 | # Server 12 | 13 | {{docs/features/ai/server/*/index}} 14 | -------------------------------------------------------------------------------- /docs/pages/docs/features/conversational-applications/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/index 6 | title: Conversational Applications 7 | description: > 8 | Build and maintain copilots, scripted dialogues, semi-scripted 9 | dialogues and fully conversational applications. 10 | --- 11 | 12 | # Conversational Applications 13 | 14 | You can build and maintain copilots, scripted dialogues, 15 | semi-scripted dialogues and fully conversational applications. 16 | 17 | {{docs/features/conversational-applications/*/index}} 18 | -------------------------------------------------------------------------------- /docs/pages/docs/features/database/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/index 6 | title: SQL Database 7 | description: > 8 | Learn how Resonance uses connection pools. Create and reuse queries, 9 | create database entities, and integrate with a migration tool. 10 | --- 11 | 12 | # SQL Database 13 | 14 | {{docs/features/database/*/index}} 15 | -------------------------------------------------------------------------------- /docs/pages/docs/features/database/swoole/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - name: documents 4 | next: docs/features/database/doctrine/index 5 | layout: dm:document 6 | parent: docs/features/database/index 7 | title: Swoole 8 | description: > 9 | Use Resonance's wrapper around Swoole connection pools. 10 | --- 11 | 12 | # Swoole 13 | 14 | {{docs/features/database/swoole/*!docs/features/database/swoole/index}} 15 | -------------------------------------------------------------------------------- /docs/pages/docs/features/graphql/merging-sql-queries.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | description: test 5 | draft: true 6 | layout: dm:document 7 | parent: docs/features/graphql/index 8 | title: Merging SQL Queries 9 | --- 10 | 11 | # Merging SQL Queries 12 | -------------------------------------------------------------------------------- /docs/pages/docs/features/http/server.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/http/index 6 | title: Server 7 | description: > 8 | Configure the Resonance "serve" command and start the http server. 9 | --- 10 | 11 | # HTTP Server 12 | 13 | # Usage 14 | 15 | Resonance comes with the `serve` command by default. You can call 16 | `php ./bin/resonance.php serve` to start the http server. 17 | 18 | You can configure it using the {{docs/features/configuration/index}} file. 19 | If you want to add {{docs/features/websockets/index}}, you can follow their 20 | configuration page. 21 | -------------------------------------------------------------------------------- /docs/pages/docs/features/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - name: documents 4 | next: docs/extras/index 5 | layout: dm:document 6 | parent: docs/index 7 | title: Features 8 | description: > 9 | Learn about the functionalities provided by the Resonance framework. 10 | --- 11 | 12 | # Features 13 | 14 | {{docs/features/*/index}} 15 | -------------------------------------------------------------------------------- /docs/pages/docs/features/observability/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/index 6 | title: Observability 7 | description: > 8 | Observability is the ability to understand the state of a running system. 9 | --- 10 | 11 | # Observability 12 | 13 | {{docs/features/observability/*/index}} 14 | -------------------------------------------------------------------------------- /docs/pages/docs/features/server-side-rendering/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | description: test 5 | draft: true 6 | layout: dm:document 7 | parent: docs/features/index 8 | title: Server Side Rendering 9 | --- 10 | -------------------------------------------------------------------------------- /docs/pages/docs/features/templating/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/index 6 | title: Templating 7 | description: > 8 | Learn how to utilize Twig or write your own PHP templates. 9 | --- 10 | 11 | # Templating 12 | 13 | {{docs/features/templating/*/index}} 14 | -------------------------------------------------------------------------------- /docs/pages/docs/features/templating/twig/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/templating/index 6 | title: Twig 7 | description: > 8 | Learn how the the Twig environment is integrated within the Resonance 9 | framework. 10 | --- 11 | 12 | # Twig 13 | 14 | [Twig](https://twig.symfony.com/) is "the flexible, fast, and secure template 15 | engine for PHP." It's bundled with Resonance alongside a few useful extensions 16 | that integrate the Twig environment with the framework. 17 | 18 | {{docs/features/templating/twig/*!docs/features/templating/twig/index}} 19 | -------------------------------------------------------------------------------- /docs/pages/docs/features/timers/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/index 6 | title: Timers 7 | description: > 8 | Learn how to schedule cyclical tasks. 9 | --- 10 | 11 | # Timers 12 | 13 | {{docs/features/timers/*/index}} 14 | -------------------------------------------------------------------------------- /docs/pages/docs/features/validation/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/index 6 | title: Validation 7 | description: > 8 | Validate and convert any data. Learn how to validate HTML forms, incoming 9 | WebSocket messages and more. 10 | --- 11 | 12 | # Validation 13 | 14 | You can use validators to check if any incoming data is correct. For example: 15 | form data filled by the user, incoming {{docs/features/websockets/index}} 16 | message, and others. 17 | 18 | {{docs/features/validation/*/index}} 19 | -------------------------------------------------------------------------------- /docs/pages/docs/features/vector-store/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/index 6 | title: Vector Store 7 | description: > 8 | Vector stores can be used to store and search large vectors, such as LLM 9 | embeddings. 10 | --- 11 | 12 | # Vector Store 13 | 14 | Explore Resonance's integrations with vector stores. 15 | 16 | {{docs/features/vector-store/*/index}} 17 | -------------------------------------------------------------------------------- /docs/pages/docs/features/websockets/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | layout: dm:document 5 | parent: docs/features/index 6 | title: WebSockets 7 | description: > 8 | Start and use the WebSockets server. 9 | --- 10 | 11 | # WebSockets 12 | 13 | {{docs/features/websockets/*!docs/features/websockets/index}} 14 | -------------------------------------------------------------------------------- /docs/pages/docs/getting-started/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - name: documents 4 | next: docs/changelog/index 5 | layout: dm:document 6 | parent: docs/index 7 | title: Getting Started 8 | description: > 9 | Learn about the installation, requirements and framework's long-term 10 | goals. 11 | --- 12 | 13 | # Getting Started 14 | 15 | {{docs/getting-started/*!docs/getting-started/index}} 16 | -------------------------------------------------------------------------------- /docs/pages/docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - documents 4 | - name: primary_navigation 5 | next: tutorials/index 6 | description: docs 7 | layout: dm:document 8 | title: Documentation 9 | --- 10 | 11 | # Documentation 12 | 13 | {{docs/*/index}} 14 | -------------------------------------------------------------------------------- /docs/pages/swoole/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - primary_navigation 4 | description: test 5 | draft: true 6 | layout: dm:page 7 | title: Swoole 8 | --- 9 | 10 | # Swoole 11 | -------------------------------------------------------------------------------- /docs/pages/tutorials/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - name: primary_navigation 4 | next: use-cases/index 5 | description: docs 6 | layout: dm:tutorial-list 7 | title: Tutorials 8 | --- 9 | 10 | # Tutorials 11 | 12 | If you want to suggest a tutorial, feel free to open an issue in the 13 | [GitHub](https://github.com/distantmagic/resonance) repo. 14 | 15 | More tutorials and recipes are coming. Join our {{community/index}} to receive 16 | notifications. 17 | 18 | {{tutorials/*/index}} 19 | -------------------------------------------------------------------------------- /docs/pages/tutorials/oauth2-server/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - tutorials 4 | draft: true 5 | layout: dm:tutorial 6 | parent: tutorials/index 7 | tags: 8 | - OAuth2 9 | title: OAuth 2.0 Server 10 | description: > 11 | Learn how to setup an OAuth 2.0 server with Resonance and Doctrine. 12 | --- 13 | -------------------------------------------------------------------------------- /docs/pages/tutorials/retrieval-augmented-generation-with-resonance-and-rubixml/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - tutorials 4 | draft: true 5 | layout: dm:tutorial 6 | parent: tutorials/index 7 | tags: 8 | - llama.cpp 9 | - RubixML 10 | - Static Site Generator 11 | title: Semantic Search with Resonance and RubixML 12 | description: > 13 | Learn how to implement a semantic search using KNN search. 14 | --- 15 | 16 | ## Overview 17 | 18 | To achieve the semantic search index, we will go through the following steps: 19 | 1. Prepare the training data (cleaning up, chunking) 20 | -------------------------------------------------------------------------------- /examples/machine-learning/.gitignore: -------------------------------------------------------------------------------- 1 | /cache 2 | /config.ini 3 | /oauth2 4 | /repository 5 | /ssl 6 | /vendor 7 | -------------------------------------------------------------------------------- /examples/machine-learning/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distantmagic/resonance/8fa506ee4cb6977224375ce5c7a95f84cb627783/examples/machine-learning/README.md -------------------------------------------------------------------------------- /examples/machine-learning/app/UserRepository.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

{{ error.code }}

10 |
{{ error.message(request) }}
11 | 12 | -------------------------------------------------------------------------------- /examples/machine-learning/app/views/homepage.twig: -------------------------------------------------------------------------------- 1 | Hello, world! 2 | -------------------------------------------------------------------------------- /examples/machine-learning/bin/doctrine.php: -------------------------------------------------------------------------------- 1 | make(ConsoleApplication::class)->run()); 10 | -------------------------------------------------------------------------------- /examples/machine-learning/constants.php: -------------------------------------------------------------------------------- 1 | phpProjectFiles->indexDirectory(DM_RESONANCE_ROOT); 16 | $container->phpProjectFiles->indexDirectory(DM_APP_ROOT); 17 | $container->registerSingletons(); 18 | 19 | return $container; 20 | -------------------------------------------------------------------------------- /examples/machine-learning/models/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /examples/machine-learning/tools/psalm/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | -------------------------------------------------------------------------------- /examples/machine-learning/tools/psalm/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "vimeo/psalm": "^5.21" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /phpunit_bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /resources/icons/info-000000.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /resources/icons/search-000000.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | 16 | 17 | -------------------------------------------------------------------------------- /resources/icons/triangle-exclamation-000000.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /resources/icons/up-right-from-square-fbb829.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /resources/images/amphp.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distantmagic/resonance/8fa506ee4cb6977224375ce5c7a95f84cb627783/resources/images/amphp.webp -------------------------------------------------------------------------------- /resources/images/chatgpt.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distantmagic/resonance/8fa506ee4cb6977224375ce5c7a95f84cb627783/resources/images/chatgpt.webp -------------------------------------------------------------------------------- /resources/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distantmagic/resonance/8fa506ee4cb6977224375ce5c7a95f84cb627783/resources/images/favicon.ico -------------------------------------------------------------------------------- /resources/images/ogimage.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distantmagic/resonance/8fa506ee4cb6977224375ce5c7a95f84cb627783/resources/images/ogimage.webp -------------------------------------------------------------------------------- /resources/images/openswoole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distantmagic/resonance/8fa506ee4cb6977224375ce5c7a95f84cb627783/resources/images/openswoole.png -------------------------------------------------------------------------------- /resources/images/resonance_cat.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distantmagic/resonance/8fa506ee4cb6977224375ce5c7a95f84cb627783/resources/images/resonance_cat.webp -------------------------------------------------------------------------------- /resources/images/rubixml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distantmagic/resonance/8fa506ee4cb6977224375ce5c7a95f84cb627783/resources/images/rubixml.png -------------------------------------------------------------------------------- /resources/images/swoole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distantmagic/resonance/8fa506ee4cb6977224375ce5c7a95f84cb627783/resources/images/swoole.png -------------------------------------------------------------------------------- /resources/images/zork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distantmagic/resonance/8fa506ee4cb6977224375ce5c7a95f84cb627783/resources/images/zork.png -------------------------------------------------------------------------------- /resources/ts/app/LoggerInterface.ts: -------------------------------------------------------------------------------- 1 | type LoggingMethod = (...message: Array) => void; 2 | 3 | export interface LoggerInterface { 4 | debug: LoggingMethod; 5 | error: LoggingMethod; 6 | info: LoggingMethod; 7 | log: LoggingMethod; 8 | success: LoggingMethod; 9 | warn: LoggingMethod; 10 | 11 | ns(contextName: string): LoggerInterface; 12 | } 13 | -------------------------------------------------------------------------------- /resources/ts/app/createLogger.ts: -------------------------------------------------------------------------------- 1 | import { Logger } from "./Logger"; 2 | 3 | import type { LoggerInterface } from "./LoggerInterface"; 4 | 5 | export function createLogger(contextName: string): LoggerInterface { 6 | return new Logger(contextName); 7 | } 8 | -------------------------------------------------------------------------------- /resources/ts/docs/controller_aside.ts: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus"; 2 | 3 | import { stimulus } from "../stimulus"; 4 | 5 | @stimulus("aside") 6 | export class controller_aside extends Controller { 7 | public connect(): void { 8 | const activeLink = this.element.querySelector("a.active"); 9 | 10 | if (!(activeLink instanceof HTMLAnchorElement)) { 11 | return; 12 | } 13 | 14 | activeLink.scrollIntoView({ 15 | behavior: "auto", 16 | block: "center", 17 | inline: "center", 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /resources/ts/docs/global_stimulus.ts: -------------------------------------------------------------------------------- 1 | import { Application } from "@hotwired/stimulus"; 2 | 3 | window.stimulusApplication = Application.start(); 4 | -------------------------------------------------------------------------------- /resources/ts/docs/global_turbo.ts: -------------------------------------------------------------------------------- 1 | import "@hotwired/turbo"; 2 | 3 | import { configureTurbo } from "../configureTurbo"; 4 | 5 | configureTurbo(); 6 | -------------------------------------------------------------------------------- /src/ApplicationConfiguration.php: -------------------------------------------------------------------------------- 1 | $aliases 16 | * @param null|non-empty-string $description 17 | */ 18 | public function __construct( 19 | public string $name, 20 | public array $aliases = [], 21 | public ?string $description = null, 22 | public bool $isEnabled = true, 23 | public bool $isHidden = false, 24 | ) {} 25 | } 26 | -------------------------------------------------------------------------------- /src/Attribute/ContentSecurityPolicy.php: -------------------------------------------------------------------------------- 1 | $fromAttribute 15 | */ 16 | public function __construct( 17 | public string $fromAttribute, 18 | ) {} 19 | } 20 | -------------------------------------------------------------------------------- /src/Attribute/ExtractsOpenAPIMetadataSecurityRequirement.php: -------------------------------------------------------------------------------- 1 | $fromAttribute 15 | */ 16 | public function __construct( 17 | public string $fromAttribute, 18 | ) {} 19 | } 20 | -------------------------------------------------------------------------------- /src/Attribute/ExtractsOpenAPIRouteParameter.php: -------------------------------------------------------------------------------- 1 | $fromAttribute 15 | */ 16 | public function __construct( 17 | public string $fromAttribute, 18 | ) {} 19 | } 20 | -------------------------------------------------------------------------------- /src/Attribute/ExtractsOpenAPIRouteRequestBody.php: -------------------------------------------------------------------------------- 1 | $fromAttribute 15 | */ 16 | public function __construct( 17 | public string $fromAttribute, 18 | ) {} 19 | } 20 | -------------------------------------------------------------------------------- /src/Attribute/ExtractsOpenAPIRouteSecurityRequirement.php: -------------------------------------------------------------------------------- 1 | $fromAttribute 15 | */ 16 | public function __construct( 17 | public string $fromAttribute, 18 | ) {} 19 | } 20 | -------------------------------------------------------------------------------- /src/Attribute/GrantsFeature.php: -------------------------------------------------------------------------------- 1 | $attribute 15 | */ 16 | public function __construct( 17 | public string $attribute, 18 | public int $priority, 19 | ) {} 20 | } 21 | -------------------------------------------------------------------------------- /src/Attribute/HandlesServerPipeMessage.php: -------------------------------------------------------------------------------- 1 | $className 16 | */ 17 | public function __construct(public string $className) {} 18 | } 19 | -------------------------------------------------------------------------------- /src/Attribute/HandlesServerTask.php: -------------------------------------------------------------------------------- 1 | $responseClassName 16 | */ 17 | public function __construct(public string $responseClassName) {} 18 | } 19 | -------------------------------------------------------------------------------- /src/Attribute/ListensTo.php: -------------------------------------------------------------------------------- 1 | pattern = new OAuth2ScopePattern($pattern, $separator); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Attribute/ProvidesRouteParameter.php: -------------------------------------------------------------------------------- 1 | $attribute 15 | */ 16 | public function __construct(public string $attribute) {} 17 | } 18 | -------------------------------------------------------------------------------- /src/Attribute/RespondsToOAuth2Endpoint.php: -------------------------------------------------------------------------------- 1 | $examples 17 | */ 18 | public function __construct( 19 | public string $action, 20 | public string $subject, 21 | public array $examples = [], 22 | ) {} 23 | } 24 | -------------------------------------------------------------------------------- /src/Attribute/RespondsToWebSocketJsonRPC.php: -------------------------------------------------------------------------------- 1 | expression = new CronExpression($expression); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Attribute/ScheduledWithTickTimer.php: -------------------------------------------------------------------------------- 1 | grammar; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/BackusNaurFormGrammar/YesNoGrammar.php: -------------------------------------------------------------------------------- 1 | grammar = 'root ::= "yes" | "no"'; 21 | } 22 | 23 | public function getGrammarContent(): string 24 | { 25 | return $this->grammar; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/BackusNaurFormGrammar/YesNoMaybeGrammar.php: -------------------------------------------------------------------------------- 1 | grammar = 'root ::= "yes" | "no" | "maybe"'; 21 | } 22 | 23 | public function getGrammarContent(): string 24 | { 25 | return $this->grammar; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/CastableEnumTrait.php: -------------------------------------------------------------------------------- 1 | getName(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/CastsValidatedDataInterface.php: -------------------------------------------------------------------------------- 1 | addBlockStartParser(new CommonMarkAdmonitionBlockStartParser()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/CommonMarkRenderedContentWithTableOfContentsLinks.php: -------------------------------------------------------------------------------- 1 | $tableOfContentsLinks 14 | */ 15 | public function __construct( 16 | Document $document, 17 | string $content, 18 | public readonly array $tableOfContentsLinks 19 | ) { 20 | parent::__construct($document, $content); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/CommonMarkTableOfContentsLink.php: -------------------------------------------------------------------------------- 1 | $config 11 | */ 12 | public function __construct(public array $config) {} 13 | } 14 | -------------------------------------------------------------------------------- /src/ConsoleApplication.php: -------------------------------------------------------------------------------- 1 | $path 13 | */ 14 | public function __construct(private array $path = []) {} 15 | 16 | public function __toString(): string 17 | { 18 | return implode('.', $this->path); 19 | } 20 | 21 | public function fork(string $next): self 22 | { 23 | return new self([...$this->path, $next]); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/ConstraintReason.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Set $cronJobs; 15 | 16 | public function __construct() 17 | { 18 | $this->cronJobs = new Set(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/CronJobInterface.php: -------------------------------------------------------------------------------- 1 | logger->info(sprintf('cron_job_start(%s)', $cronRegisteredJob->name)); 21 | $cronRegisteredJob->cronJob->onCronTick(); 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/CronRegisteredJob.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | abstract readonly class CrudActionGate implements CrudActionGateInterface {} 13 | -------------------------------------------------------------------------------- /src/CrudActionGateInterface.php: -------------------------------------------------------------------------------- 1 | curlHandle), 19 | curl_error($this->curlHandle), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/CurlException.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Map $connectionPoolConfiguration; 15 | 16 | public function __construct() 17 | { 18 | $this->connectionPoolConfiguration = new Map(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/DatabaseConnectionPoolDriverName.php: -------------------------------------------------------------------------------- 1 | content; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/DialogueInputInterface.php: -------------------------------------------------------------------------------- 1 | content; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DialogueMessageProducer.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | interface DialogueMessageProducerInterface extends IteratorAggregate, Stringable {} 14 | -------------------------------------------------------------------------------- /src/DialogueNodeSideEffect.php: -------------------------------------------------------------------------------- 1 | resolveResponseWithProgress($dialogueInput); 14 | 15 | return generatorGetReturn($resolveGenerator); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DialogueResponseInterface.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | public function resolveResponseWithProgress(DialogueInputInterface $dialogueInput): Generator; 19 | } 20 | -------------------------------------------------------------------------------- /src/DialogueResponseResolutionInterface.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | public static function values(): array 13 | { 14 | return array_column(self::cases(), 'value'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Environment.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | abstract readonly class EventListener implements EventListenerInterface 14 | { 15 | public function shouldRegister(): bool 16 | { 17 | return true; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/EventListenerInterface.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | interface GraphQLReusableDatabaseQueryInterface extends DatabaseQueryInterface 13 | { 14 | public function reusableQueryId(): string; 15 | } 16 | -------------------------------------------------------------------------------- /src/GraphQLRootFieldType.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Map $poolConfiguration; 15 | 16 | public function __construct() 17 | { 18 | $this->poolConfiguration = new Map(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/HtmlErrorTemplateInterface.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | abstract readonly class HttpControllerParameterResolver implements HttpControllerParameterResolverInterface {} 13 | -------------------------------------------------------------------------------- /src/HttpControllerParameterResolverInterface.php: -------------------------------------------------------------------------------- 1 | $parameter 17 | * @param TAttribute $attribute 18 | */ 19 | public function resolve( 20 | ServerRequestInterface $request, 21 | ResponseInterface $response, 22 | HttpControllerParameter $parameter, 23 | Attribute $attribute, 24 | ): HttpControllerParameterResolution; 25 | } 26 | -------------------------------------------------------------------------------- /src/HttpError.php: -------------------------------------------------------------------------------- 1 | translatorBridge->trans($request, 'error.bad_request'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/HttpError/Forbidden.php: -------------------------------------------------------------------------------- 1 | translatorBridge->trans($request, 'error.forbidden'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/HttpError/MethodNotAllowed.php: -------------------------------------------------------------------------------- 1 | translatorBridge->trans($request, 'error.method_not_allowed'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/HttpError/PageNotFound.php: -------------------------------------------------------------------------------- 1 | translatorBridge->trans($request, 'error.page_not_found'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/HttpError/ServerError.php: -------------------------------------------------------------------------------- 1 | translatorBridge->trans($request, 'error.server_error'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/HttpInterceptableInterface.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | abstract readonly class HttpInterceptor implements HttpInterceptorInterface 16 | { 17 | public function createStream(string|Stringable $content): StreamInterface 18 | { 19 | return new PsrStringStream($content); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/HttpInterceptorAggregate.php: -------------------------------------------------------------------------------- 1 | , 14 | * HttpInterceptorInterface 15 | * > 16 | */ 17 | public Map $interceptors; 18 | 19 | public function __construct() 20 | { 21 | $this->interceptors = new Map(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/HttpInterceptorInterface.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | abstract readonly class HttpMiddleware implements HttpMiddlewareInterface {} 13 | -------------------------------------------------------------------------------- /src/HttpMiddlewareAttribute.php: -------------------------------------------------------------------------------- 1 | withStatus($this->code) 22 | ->withHeader('location', $this->location) 23 | ; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/HttpResponderCollection.php: -------------------------------------------------------------------------------- 1 | $httpResponders 13 | */ 14 | public Map $httpResponders; 15 | 16 | public function __construct() 17 | { 18 | $this->httpResponders = new Map(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/HttpResponderInterface.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Map $routeVars; 15 | 16 | /** 17 | * @param null|non-empty-string $uniqueResponderId 18 | * @param array $routeVars 19 | */ 20 | public function __construct( 21 | public HttpRouteMatchStatus $status, 22 | public ?string $uniqueResponderId = null, 23 | array $routeVars = [], 24 | ) { 25 | $this->routeVars = new Map($routeVars); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/HttpRouteMatchStatus.php: -------------------------------------------------------------------------------- 1 | constraintResult)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/InputValidator.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | abstract readonly class InputValidator implements CastsValidatedDataInterface, ConstraintSourceInterface {} 14 | -------------------------------------------------------------------------------- /src/InputValidatorCollection.php: -------------------------------------------------------------------------------- 1 | $inputValidators 13 | */ 14 | public Map $inputValidators; 15 | 16 | public function __construct() 17 | { 18 | $this->inputValidators = new Map(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/JsonErrorTemplate.php: -------------------------------------------------------------------------------- 1 | $httpError->code(), 18 | 'message' => $httpError->message($request), 19 | ]); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/JsonErrorTemplateInterface.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | public function cases(): array; 13 | 14 | public function castToRPCMethod(string $methodName): JsonRPCMethodInterface; 15 | 16 | /** 17 | * @return array 18 | */ 19 | public function values(): array; 20 | } 21 | -------------------------------------------------------------------------------- /src/JsonRPCRequest.php: -------------------------------------------------------------------------------- 1 | $this->rpcRequest->requestId, 20 | 'jsonrpc' => '2.0', 21 | 'method' => $this->rpcRequest->method, 22 | 'result' => $this->content, 23 | ]); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/JsonSchemableInterface.php: -------------------------------------------------------------------------------- 1 | , 13 | * const?: int|float|non-empty-string, 14 | * default?: mixed, 15 | * type?: non-empty-string|list, 16 | * ... 17 | * } 18 | */ 19 | interface JsonSchemableInterface extends JsonSerializable 20 | { 21 | /** 22 | * @return PJsonSchema 23 | */ 24 | public function toJsonSchema(): array|object; 25 | } 26 | -------------------------------------------------------------------------------- /src/LlamaCppClientInterface.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | public function generateInfill(LlamaCppInfillRequest $request): Generator; 19 | 20 | public function getHealth(): LlamaCppHealthStatus; 21 | } 22 | -------------------------------------------------------------------------------- /src/LlamaCppClientResponseChunk.php: -------------------------------------------------------------------------------- 1 | $embedding 11 | */ 12 | public function __construct( 13 | public array $embedding, 14 | ) {} 15 | } 16 | -------------------------------------------------------------------------------- /src/LlamaCppEmbeddingRequest.php: -------------------------------------------------------------------------------- 1 | $this->content, 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/LlamaCppExtractSubjectResult.php: -------------------------------------------------------------------------------- 1 | 19 | */ 20 | public function extractWithProgress( 21 | string $input, 22 | string $condition, 23 | LlmPersonaInterface $persona, 24 | ): Generator; 25 | } 26 | -------------------------------------------------------------------------------- /src/LlamaCppExtractWhenResult.php: -------------------------------------------------------------------------------- 1 | content; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/LlamaCppInfillRequest.php: -------------------------------------------------------------------------------- 1 | $this->before, 20 | 'infill_suffix' => $this->after, 21 | ]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/LlamaCppLinkBuilder.php: -------------------------------------------------------------------------------- 1 | ollamaConfiguration->scheme, 21 | $this->ollamaConfiguration->host, 22 | $this->ollamaConfiguration->port, 23 | $path, 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/LlmChatHistory.php: -------------------------------------------------------------------------------- 1 | $messages 11 | */ 12 | public function __construct( 13 | public array $messages, 14 | ) {} 15 | } 16 | -------------------------------------------------------------------------------- /src/LlmChatHistoryRenderer.php: -------------------------------------------------------------------------------- 1 | messages as $message) { 22 | $ret .= $this->llmChatMessageRenderer->renderLlmChatMessage($message)."\n"; 23 | } 24 | 25 | return $ret; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/LlmChatMessage.php: -------------------------------------------------------------------------------- 1 | {$llmChatMessage->actor} 18 | {$llmChatMessage->message}<|im_end|> 19 | FORMATTED; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LlmChatMessageRenderer/GemmaInstructMessageRenderer.php: -------------------------------------------------------------------------------- 1 | {$llmChatMessage->actor} 18 | {$llmChatMessage->message} 19 | FORMATTED; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LlmChatMessageRenderer/MistralInstructMessageRenderer.php: -------------------------------------------------------------------------------- 1 | message}[/INST] 18 | FORMATTED; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/LlmChatMessageRenderer/Phi2QuestionRenderer.php: -------------------------------------------------------------------------------- 1 | message 18 | Answer: 19 | FORMATTED; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LlmChatMessageRendererInterface.php: -------------------------------------------------------------------------------- 1 | category; 17 | } 18 | 19 | public function shouldNotify(): bool 20 | { 21 | return $this->shouldNotify; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/LlmCompletionProgressInterface.php: -------------------------------------------------------------------------------- 1 | personaDescription = <<<'PERSONA' 16 | You are a helpful assistant. 17 | PERSONA; 18 | } 19 | 20 | public function getPersonaDescription(): string 21 | { 22 | return $this->personaDescription; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/LlmPersonaInterface.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Map $transportConfiguration; 15 | 16 | public function __construct() 17 | { 18 | $this->transportConfiguration = new Map(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/MailerRepository.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Map $mailer; 15 | 16 | public function __construct() 17 | { 18 | $this->mailer = new Map(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/NameableEnumTrait.php: -------------------------------------------------------------------------------- 1 | name; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/NameableInterface.php: -------------------------------------------------------------------------------- 1 | identifier; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/OAuth2Claim.php: -------------------------------------------------------------------------------- 1 | $scopes 18 | */ 19 | public function __construct( 20 | public AccessTokenEntityInterface $accessToken, 21 | public ClientEntityInterface $client, 22 | public UserInterface $user, 23 | public Set $scopes, 24 | ) {} 25 | } 26 | -------------------------------------------------------------------------------- /src/OAuth2Endpoint.php: -------------------------------------------------------------------------------- 1 | getIdentifier(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/OAuth2Entity/Token.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Set $oAuth2Grants; 15 | 16 | public function __construct() 17 | { 18 | $this->oAuth2Grants = new Set(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/OAuth2GrantProvider.php: -------------------------------------------------------------------------------- 1 | $parameters 13 | */ 14 | public function __construct(public Map $parameters) {} 15 | 16 | public function jsonSerialize(): mixed 17 | { 18 | return $this->getIdentifier(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/OAuth2ScopeCollection.php: -------------------------------------------------------------------------------- 1 | > $scopes 14 | */ 15 | public Map $scopes; 16 | 17 | public function __construct() 18 | { 19 | $this->scopes = new Map(); 20 | } 21 | 22 | /** 23 | * @param class-string $scopeClass 24 | */ 25 | public function addScope(ProvidesOAuth2Scope $attribute, string $scopeClass): void 26 | { 27 | $this->scopes->put($attribute, $scopeClass); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/OAuth2ScopeInterface.php: -------------------------------------------------------------------------------- 1 | basename = trim($chunk, '{}'); 14 | } 15 | 16 | public function isVariable(): bool 17 | { 18 | return str_starts_with($this->chunk, '{') && str_ends_with($this->chunk, '}'); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/OAuth2ScopePatternMatch.php: -------------------------------------------------------------------------------- 1 | $parameters 13 | */ 14 | public Map $parameters; 15 | 16 | public function __construct() 17 | { 18 | $this->parameters = new Map(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/OAuth2SecretAwareClient.php: -------------------------------------------------------------------------------- 1 | $type->name, 19 | 'fields' => $fields, 20 | ]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/ObservableTaskCategory.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | interface ObservableTaskInterface extends IteratorAggregate 13 | { 14 | public function getCategory(): string; 15 | 16 | public function getName(): string; 17 | } 18 | -------------------------------------------------------------------------------- /src/ObservableTaskStatus.php: -------------------------------------------------------------------------------- 1 | true, 23 | default => false, 24 | }; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/ObservableTaskStatusReporter.php: -------------------------------------------------------------------------------- 1 | $this->status->value, 26 | 'data' => $this->data, 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/ObservableTaskTableRow.php: -------------------------------------------------------------------------------- 1 | reflectionFunction); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/PromptSubjectRequest.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Map $connectionPoolConfiguration; 15 | 16 | public function __construct() 17 | { 18 | $this->connectionPoolConfiguration = new Map(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/ReflectionAttributeInterface.php: -------------------------------------------------------------------------------- 1 | , PHPFileReflectionClassAttribute> $attributes 14 | */ 15 | public Map $attributes; 16 | 17 | public function __construct() 18 | { 19 | $this->attributes = new Map(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/RespondsToHttpAttributeRoute.php: -------------------------------------------------------------------------------- 1 | symfonyRoute = new Route($attribute->pattern); 17 | $this->symfonyRoute->setMethods($attribute->method->value); 18 | 19 | if ($attribute->requirements) { 20 | $this->symfonyRoute->setRequirements($attribute->requirements); 21 | } 22 | 23 | $this->symfonyRoute->compile(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/RespondsToPromptSubjectAttributeCollection.php: -------------------------------------------------------------------------------- 1 | $attributes 14 | */ 15 | public Set $attributes; 16 | 17 | public function __construct() 18 | { 19 | $this->attributes = new Set(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/SQLiteVSSConfiguration.php: -------------------------------------------------------------------------------- 1 | markdownParser = new MarkdownParser(); 19 | } 20 | 21 | public function toHtml(string $content): string 22 | { 23 | $text = $this->markdownParser->toHtml($content); 24 | 25 | return $this->purifier->purify($text); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/SecureIdentifierGenerator.php: -------------------------------------------------------------------------------- 1 | $byteLength 14 | */ 15 | public function generate(int $byteLength = 32): string 16 | { 17 | return bin2hex(random_bytes($byteLength)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Serializer.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | abstract readonly class ServerTaskHandler implements ServerTaskHandlerInterface {} 13 | -------------------------------------------------------------------------------- /src/ServerTaskHandlerInterface.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | #[Singleton(provides: Pool::class)] 17 | final readonly class HyperfChannelPool extends SingletonProvider 18 | { 19 | public function provide(SingletonContainer $singletons, PHPProjectFiles $phpProjectFiles): Pool 20 | { 21 | return Pool::getInstance(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/SingletonProviderInterface.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Map $staticPages; 15 | 16 | public function __construct() 17 | { 18 | $this->staticPages = new Map(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/StaticPageContentType.php: -------------------------------------------------------------------------------- 1 | getPathname(), 23 | ), 24 | previous: $previous, 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/StaticPageFileException/FrontMatterValidationException.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function renderStaticPage(StaticPage $staticPage): Generator; 15 | } 16 | -------------------------------------------------------------------------------- /src/StaticPageReferenceException.php: -------------------------------------------------------------------------------- 1 | escape((string) $requestData->get($field, $default)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/TemplateInterface.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Set $tickTimerJobs; 15 | 16 | public function __construct() 17 | { 18 | $this->tickTimerJobs = new Set(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/TickTimerJobInterface.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Set $twigFilters; 15 | 16 | public function __construct() 17 | { 18 | $this->twigFilters = new Set(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/TwigFilterInterface.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public Set $twigFunctions; 15 | 16 | public function __construct() 17 | { 18 | $this->twigFunctions = new Set(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/TwigFunctionInterface.php: -------------------------------------------------------------------------------- 1 | getValue()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WebSocketProtocolException/UnexpectedRequest.php: -------------------------------------------------------------------------------- 1 | getValue()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WebSocketResolvedProtocolController.php: -------------------------------------------------------------------------------- 1 | $generator 15 | * 16 | * @return TReturn 17 | */ 18 | function generatorGetReturn(Generator $generator): mixed 19 | { 20 | /** 21 | * @var mixed $value explicitly mixed for typechecks 22 | */ 23 | foreach ($generator as $value) { 24 | } 25 | 26 | return $generator->getReturn(); 27 | } 28 | -------------------------------------------------------------------------------- /tmuxinator.example.yml: -------------------------------------------------------------------------------- 1 | name: distantmagic 2 | root: ~/workspace/distantmagic/distantmagic/resonance 3 | 4 | on_project_start: 5 | - make node_modules 6 | - make vendor 7 | - make ssg 8 | 9 | windows: 10 | - "esbuild.watch": make esbuild.watch 11 | - "eslint.watch": make eslint.watch 12 | - "ssg.serve": make ssg.serve 13 | - "ssg.watch": make ssg.watch 14 | - "tsc.watch": make tsc.watch 15 | - "shell": git status 16 | -------------------------------------------------------------------------------- /tools/php-cs-fixer/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | -------------------------------------------------------------------------------- /tools/php-cs-fixer/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "friendsofphp/php-cs-fixer": "^3.21" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tools/psalm/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | -------------------------------------------------------------------------------- /tools/psalm/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "vimeo/psalm": "^5.17" 4 | } 5 | } 6 | --------------------------------------------------------------------------------