feat(captures): add named API sources, CDL routes, and capturer grains#3323
feat(captures): add named API sources, CDL routes, and capturer grains#3323Copilot wants to merge 6 commits into
Conversation
Implements a complete CDL parser, compiler, and language service for Change Data Capture following the same conventions as the existing PDL. Includes: - Capture concepts (CaptureId, CaptureDefinition, SourceDefinition, etc.) - CDL tokenizer with capture-specific keywords - Full AST node hierarchy (CaptureDocument, SourceBlock, MapBlock, AppendBlock, etc.) - Parser stack (CaptureParser, directive parsers, WhenClauseParser, etc.) - Compiler turning AST into CaptureDefinition - ILanguageService + LanguageService - 25 BDD specs covering all major features Agent-Logs-Url: https://github.com/Cratis/Chronicle/sessions/ceeb3daa-8771-49a3-980f-176a970a81df Co-authored-by: einari <134365+einari@users.noreply.github.com>
|
@copilot Great. And as we have for Projections in the workbench, we need a similar editor with full Monaco a language service implemented. |
Implements the Monaco-editor language service for CDL and a Captures feature page in the workbench, following the same conventions as the existing ProjectionEditor. - Components/CaptureEditor/language.ts — Monarch tokenizer for CDL keywords - Components/CaptureEditor/CaptureDefinitionLanguageValidator.ts — inline validation - Components/CaptureEditor/CaptureDefinitionLanguageCompletionProvider.ts — context-sensitive completions - Components/CaptureEditor/CaptureDefinitionLanguageHoverProvider.ts — hover documentation - Components/CaptureEditor/CaptureHelpPanel.tsx — slide-in CDL reference panel - Components/CaptureEditor/CaptureEditor.tsx — Monaco wrapper component - Components/CaptureEditor/index.ts — language registration - Features/EventStore/General/Captures/Captures.tsx — captures feature page - EventStore.tsx — route + menu item for Captures - translation.json — new strings for capture editor and captures feature Agent-Logs-Url: https://github.com/Cratis/Chronicle/sessions/1d098b9d-80e5-4fbb-8a74-750b2b3c4cc3 Co-authored-by: einari <134365+einari@users.noreply.github.com>
Done in commit
|
|
@copilot Great. Lets do a few more things:
|
Agent-Logs-Url: https://github.com/Cratis/Chronicle/sessions/213dbec4-5e25-47f6-a3c2-f8bb9d18cf7e Co-authored-by: einari <134365+einari@users.noreply.github.com>
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Cratis Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: c9f6338 | Previous: 9c41e1c | Ratio |
|---|---|---|---|
Cratis.Chronicle.Benchmarks.AppendManyBenchmark.AppendManyEvents(EventCount: 100) |
137919161.41666666 ns (± 7181163.209171882) |
68128824.7 ns (± 7671149.609764319) |
2.02 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @einari
|
@copilot The API definition should not be done inline - but instead reference an API by name - the API should be defined in a similar way to how we do WebHooks, but we should be able to define the trigger; polling every N minutes - like done here, that is fine. But the API itself is typically something we configure independently.However, on the CDL we should also be able to define a route. So while the API is defined as a source, that can be the root for many different APIs and we then use routes on top. But if not a route is specified, we'll just use the URL straight up. This means we need a way to handle this. On the backend in Core. We need a Capturer manager that sets up the triggers. The manager should be a grain and the triggers should also be a grain, and the actual Capturer should also be a grain. That way we can easily scale things out. See them as supervisors over supervisors. In the client, the interface |
Implemented in
|
Summary
This extends capture authoring and CDL to support named API sources with optional routes, renames the declarative capture interface to
ICapturer, and adds initial backend capturer supervision grains. Documentation has been updated to match the current APIs and language behavior.Added
ICapturer.routeon API sources).Changed
FromApi(api, ...)), with optional route configuration.api(required for API sources) and optionalrouteinstead of inlineurl.ICaptureForis now compatibility-only via inheritance fromICapturer.Fixed
WebhookSourceBuilderto satisfy analyzer ruleRCS1205and unblock client build.Removed
Security
Deprecated
ICaptureForis superseded byICapturerand retained for compatibility.