@vibesdotdev/integrations-kafka 0.0.0-stage → 1.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUDIT-CODE.md +40 -0
- package/AUDIT-SEAL.md +12 -0
- package/LICENSE +126 -0
- package/README.md +76 -2
- package/SEALED.md +13 -0
- package/dist/admin.d.ts +20 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +51 -0
- package/dist/admin.js.map +1 -0
- package/dist/auth/sasl.node.impl.d.ts +18 -0
- package/dist/auth/sasl.node.impl.d.ts.map +1 -0
- package/dist/auth/sasl.node.impl.js +62 -0
- package/dist/auth/sasl.node.impl.js.map +1 -0
- package/dist/chat/realtime-transport/host.d.ts +14 -0
- package/dist/chat/realtime-transport/host.d.ts.map +1 -0
- package/dist/chat/realtime-transport/host.js +7 -0
- package/dist/chat/realtime-transport/host.js.map +1 -0
- package/dist/chat/realtime-transport/index.d.ts +15 -0
- package/dist/chat/realtime-transport/index.d.ts.map +1 -0
- package/dist/chat/realtime-transport/index.js +13 -0
- package/dist/chat/realtime-transport/index.js.map +1 -0
- package/dist/chat/realtime-transport/lifecycle.d.ts +30 -0
- package/dist/chat/realtime-transport/lifecycle.d.ts.map +1 -0
- package/dist/chat/realtime-transport/lifecycle.js +125 -0
- package/dist/chat/realtime-transport/lifecycle.js.map +1 -0
- package/dist/chat/realtime-transport/projection.d.ts +127 -0
- package/dist/chat/realtime-transport/projection.d.ts.map +1 -0
- package/dist/chat/realtime-transport/projection.js +156 -0
- package/dist/chat/realtime-transport/projection.js.map +1 -0
- package/dist/chat/realtime-transport/sse-kafka-bridge.d.ts +32 -0
- package/dist/chat/realtime-transport/sse-kafka-bridge.d.ts.map +1 -0
- package/dist/chat/realtime-transport/sse-kafka-bridge.js +58 -0
- package/dist/chat/realtime-transport/sse-kafka-bridge.js.map +1 -0
- package/dist/chat/realtime-transport/ws-kafka-bridge.d.ts +10 -0
- package/dist/chat/realtime-transport/ws-kafka-bridge.d.ts.map +1 -0
- package/dist/chat/realtime-transport/ws-kafka-bridge.js +13 -0
- package/dist/chat/realtime-transport/ws-kafka-bridge.js.map +1 -0
- package/dist/client.d.ts +16 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +29 -0
- package/dist/client.js.map +1 -0
- package/dist/config/kafka.config.descriptor.d.ts +109 -0
- package/dist/config/kafka.config.descriptor.d.ts.map +1 -0
- package/dist/config/kafka.config.descriptor.js +60 -0
- package/dist/config/kafka.config.descriptor.js.map +1 -0
- package/dist/connections.d.ts +27 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +20 -0
- package/dist/connections.js.map +1 -0
- package/dist/connections.node.impl.d.ts +34 -0
- package/dist/connections.node.impl.d.ts.map +1 -0
- package/dist/connections.node.impl.js +236 -0
- package/dist/connections.node.impl.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/kafka-client.node.impl.d.ts +9 -0
- package/dist/kafka-client.node.impl.d.ts.map +1 -0
- package/dist/kafka-client.node.impl.js +10 -0
- package/dist/kafka-client.node.impl.js.map +1 -0
- package/dist/kafka-connector.impl.d.ts +53 -0
- package/dist/kafka-connector.impl.d.ts.map +1 -0
- package/dist/kafka-connector.impl.js +97 -0
- package/dist/kafka-connector.impl.js.map +1 -0
- package/dist/kafka-event-adapter.descriptor.d.ts +11 -0
- package/dist/kafka-event-adapter.descriptor.d.ts.map +1 -0
- package/dist/kafka-event-adapter.descriptor.js +20 -0
- package/dist/kafka-event-adapter.descriptor.js.map +1 -0
- package/dist/kafka-event-adapter.impl.d.ts +22 -0
- package/dist/kafka-event-adapter.impl.d.ts.map +1 -0
- package/dist/kafka-event-adapter.impl.js +140 -0
- package/dist/kafka-event-adapter.impl.js.map +1 -0
- package/dist/kafka-substrate.descriptor.d.ts +4 -0
- package/dist/kafka-substrate.descriptor.d.ts.map +1 -0
- package/dist/kafka-substrate.descriptor.js +12 -0
- package/dist/kafka-substrate.descriptor.js.map +1 -0
- package/dist/kafka.d.ts +18 -0
- package/dist/kafka.d.ts.map +1 -0
- package/dist/kafka.js +23 -0
- package/dist/kafka.js.map +1 -0
- package/dist/kafka.node.plugin.d.ts +3 -0
- package/dist/kafka.node.plugin.d.ts.map +1 -0
- package/dist/kafka.node.plugin.js +66 -0
- package/dist/kafka.node.plugin.js.map +1 -0
- package/dist/kafka.plugin.d.ts +10 -0
- package/dist/kafka.plugin.d.ts.map +1 -0
- package/dist/kafka.plugin.js +28 -0
- package/dist/kafka.plugin.js.map +1 -0
- package/dist/logging/kafka.logger.descriptor.d.ts +7 -0
- package/dist/logging/kafka.logger.descriptor.d.ts.map +1 -0
- package/dist/logging/kafka.logger.descriptor.js +13 -0
- package/dist/logging/kafka.logger.descriptor.js.map +1 -0
- package/dist/message-schemas.d.ts +94 -0
- package/dist/message-schemas.d.ts.map +1 -0
- package/dist/message-schemas.js +68 -0
- package/dist/message-schemas.js.map +1 -0
- package/dist/request-queue-timeout-guard.d.ts +29 -0
- package/dist/request-queue-timeout-guard.d.ts.map +1 -0
- package/dist/request-queue-timeout-guard.js +245 -0
- package/dist/request-queue-timeout-guard.js.map +1 -0
- package/dist/schemas/contracts.d.ts +190 -0
- package/dist/schemas/contracts.d.ts.map +1 -0
- package/dist/schemas/contracts.js +85 -0
- package/dist/schemas/contracts.js.map +1 -0
- package/dist/schemas/kafka.d.ts +116 -0
- package/dist/schemas/kafka.d.ts.map +1 -0
- package/dist/schemas/kafka.js +13 -0
- package/dist/schemas/kafka.js.map +1 -0
- package/dist/schemas/realtime.d.ts +135 -0
- package/dist/schemas/realtime.d.ts.map +1 -0
- package/dist/schemas/realtime.js +44 -0
- package/dist/schemas/realtime.js.map +1 -0
- package/dist/schemas/worker-context.d.ts +14 -0
- package/dist/schemas/worker-context.d.ts.map +1 -0
- package/dist/schemas/worker-context.js +26 -0
- package/dist/schemas/worker-context.js.map +1 -0
- package/dist/topics.d.ts +85 -0
- package/dist/topics.d.ts.map +1 -0
- package/dist/topics.js +90 -0
- package/dist/topics.js.map +1 -0
- package/dist/workers/adapter/db-ops.d.ts +28 -0
- package/dist/workers/adapter/db-ops.d.ts.map +1 -0
- package/dist/workers/adapter/db-ops.js +14 -0
- package/dist/workers/adapter/db-ops.js.map +1 -0
- package/dist/workers/adapter/index.d.ts +16 -0
- package/dist/workers/adapter/index.d.ts.map +1 -0
- package/dist/workers/adapter/index.js +15 -0
- package/dist/workers/adapter/index.js.map +1 -0
- package/dist/workers/adapter/provider.d.ts +151 -0
- package/dist/workers/adapter/provider.d.ts.map +1 -0
- package/dist/workers/adapter/provider.js +654 -0
- package/dist/workers/adapter/provider.js.map +1 -0
- package/dist/workers/adapter/worker-adapter.kafka.descriptor.d.ts +36 -0
- package/dist/workers/adapter/worker-adapter.kafka.descriptor.d.ts.map +1 -0
- package/dist/workers/adapter/worker-adapter.kafka.descriptor.js +22 -0
- package/dist/workers/adapter/worker-adapter.kafka.descriptor.js.map +1 -0
- package/dist/workers/adapter/worker-adapter.kafka.impl.d.ts +36 -0
- package/dist/workers/adapter/worker-adapter.kafka.impl.d.ts.map +1 -0
- package/dist/workers/adapter/worker-adapter.kafka.impl.js +84 -0
- package/dist/workers/adapter/worker-adapter.kafka.impl.js.map +1 -0
- package/dist/workers/adapter/workers-kafka.db.context.d.ts +6 -0
- package/dist/workers/adapter/workers-kafka.db.context.d.ts.map +1 -0
- package/dist/workers/adapter/workers-kafka.db.context.descriptor.d.ts +43 -0
- package/dist/workers/adapter/workers-kafka.db.context.descriptor.d.ts.map +1 -0
- package/dist/workers/adapter/workers-kafka.db.context.descriptor.js +20 -0
- package/dist/workers/adapter/workers-kafka.db.context.descriptor.js.map +1 -0
- package/dist/workers/adapter/workers-kafka.db.context.js +5 -0
- package/dist/workers/adapter/workers-kafka.db.context.js.map +1 -0
- package/dist/workers/index.d.ts +8 -0
- package/dist/workers/index.d.ts.map +1 -0
- package/dist/workers/index.js +9 -0
- package/dist/workers/index.js.map +1 -0
- package/dist/workers/provider-jobs.sqlite-schema.d.ts +438 -0
- package/dist/workers/provider-jobs.sqlite-schema.d.ts.map +1 -0
- package/dist/workers/provider-jobs.sqlite-schema.js +37 -0
- package/dist/workers/provider-jobs.sqlite-schema.js.map +1 -0
- package/dist/workers/shared-store.context.d.ts +25 -0
- package/dist/workers/shared-store.context.d.ts.map +1 -0
- package/dist/workers/shared-store.context.js +88 -0
- package/dist/workers/shared-store.context.js.map +1 -0
- package/dist/workers/shared-store.plugin.d.ts +8 -0
- package/dist/workers/shared-store.plugin.d.ts.map +1 -0
- package/dist/workers/shared-store.plugin.js +22 -0
- package/dist/workers/shared-store.plugin.js.map +1 -0
- package/dist/workers/workers-kafka.consumer.plugin.d.ts +4 -0
- package/dist/workers/workers-kafka.consumer.plugin.d.ts.map +1 -0
- package/dist/workers/workers-kafka.consumer.plugin.js +11 -0
- package/dist/workers/workers-kafka.consumer.plugin.js.map +1 -0
- package/dist/workers/workers-kafka.plugin.d.ts +9 -0
- package/dist/workers/workers-kafka.plugin.d.ts.map +1 -0
- package/dist/workers/workers-kafka.plugin.js +27 -0
- package/dist/workers/workers-kafka.plugin.js.map +1 -0
- package/package.json +210 -4
package/AUDIT-CODE.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Kafka provider audit
|
|
2
|
+
|
|
3
|
+
This audit covers the canonical `integrations/kafka` owner and
|
|
4
|
+
`@vibesdotdev/integrations-kafka` package.
|
|
5
|
+
|
|
6
|
+
## Capability union
|
|
7
|
+
|
|
8
|
+
- `src/connections.ts` owns KafkaJS connection purposes, producer/consumer/admin
|
|
9
|
+
access, custom consumers, request-queue protection, and disconnect handling.
|
|
10
|
+
- `src/kafka-connector.impl.ts` owns the provider connector implementations.
|
|
11
|
+
- `src/admin.ts`, `src/topics.ts`, `src/message-schemas.ts`, and `src/kafka.ts`
|
|
12
|
+
own admin operations, topic definitions, wire schemas, and environment
|
|
13
|
+
configuration.
|
|
14
|
+
- `src/kafka-event-adapter.impl.ts` owns the runtime `events/adapter`
|
|
15
|
+
implementation; `src/kafka-event-adapter.descriptor.ts` declares its neutral
|
|
16
|
+
runtime contract.
|
|
17
|
+
- `src/kafka.plugin.ts` registers the `kafka` substrate and event-adapter
|
|
18
|
+
descriptor/loaders under the bare plugin id `integrations-kafka`.
|
|
19
|
+
|
|
20
|
+
## Canonical public entrypoints
|
|
21
|
+
|
|
22
|
+
The package exports `.`, `./plugin`, `./substrate`, `./connector`,
|
|
23
|
+
`./connections`, `./admin`, `./topics`, `./message-schemas`, `./schemas/kafka`,
|
|
24
|
+
`./config`, `./event-adapter`, and `./event-adapter/descriptor`. There is no
|
|
25
|
+
provider alias package or retired scoped plugin id.
|
|
26
|
+
|
|
27
|
+
## Consumer boundary
|
|
28
|
+
|
|
29
|
+
Chat bridges should replace the retired package specifier with
|
|
30
|
+
`@vibesdotdev/integrations-kafka` while preserving the existing
|
|
31
|
+
`./connections` and `./topics` subpaths. Runtime composition registers the
|
|
32
|
+
`integrations-kafka` plugin after `events` and
|
|
33
|
+
`integrations/base`; the plugin resolves the default `kafka` event
|
|
34
|
+
adapter without a direct Chat-to-Kafka implementation fork.
|
|
35
|
+
|
|
36
|
+
## Verification
|
|
37
|
+
|
|
38
|
+
The focused provider suite covers schemas, configuration, connection guards,
|
|
39
|
+
and runtime plugin composition. Build and typecheck must run from this package;
|
|
40
|
+
packed external imports must resolve every documented subpath.
|
package/AUDIT-SEAL.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Kafka provider seal receipt
|
|
2
|
+
|
|
3
|
+
Package: `@vibesdotdev/integrations-kafka@0.1.0-rc.0`
|
|
4
|
+
|
|
5
|
+
The provider owns Kafka transport behavior and registers the canonical bare
|
|
6
|
+
runtime plugin id `integrations-kafka`. The runtime event-adapter descriptor and
|
|
7
|
+
loader are provider-owned; generic event kinds remain Framework-owned.
|
|
8
|
+
|
|
9
|
+
The package exposes the provider's documented subpaths, keeps `kafkajs` behind
|
|
10
|
+
the provider boundary, and does not publish a compatibility package or legacy
|
|
11
|
+
plugin identity. Final SHA, tree, artifact digest, and fresh-clone evidence are
|
|
12
|
+
recorded in the Integrations migration receipt after the successor push.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: VIBES DEV LLC
|
|
6
|
+
Licensed Work: @vibesdotdev/integrations-kafka
|
|
7
|
+
The Licensed Work is (c) 2026 VIBES DEV LLC.
|
|
8
|
+
Additional Use Grant: In this grant, "Vibes Platform" means the hosted services VIBES DEV LLC
|
|
9
|
+
operates at vibes.dev and its subdomains.
|
|
10
|
+
|
|
11
|
+
You may make production use of the Licensed Work, including commercial
|
|
12
|
+
use, subject to the limits below. Permitted production use includes:
|
|
13
|
+
building, operating and selling your own applications, agents and services
|
|
14
|
+
on or with the Vibes Platform; self-hosting the Licensed Work for use inside
|
|
15
|
+
your own organization; and providing consulting, integration or development
|
|
16
|
+
services to clients who build on the Vibes Platform.
|
|
17
|
+
|
|
18
|
+
The production use permitted above does not include use that:
|
|
19
|
+
|
|
20
|
+
(a) offers third parties a hosted, managed or embedded service that
|
|
21
|
+
substitutes for the Vibes Platform or a material part of it (including
|
|
22
|
+
agent hosting; fleet, sandbox or container provisioning; package
|
|
23
|
+
registry; source hosting and continuous integration; and managed AI,
|
|
24
|
+
storage, secrets or messaging), where the Licensed Work provides a
|
|
25
|
+
material part of that service's value and that service earns more than
|
|
26
|
+
US$1,000,000 in gross revenue in any twelve-month period;
|
|
27
|
+
(b) sells, rents, sublicenses or white-labels the Licensed Work, or access
|
|
28
|
+
to Vibes Platform functionality, as a product in its own right;
|
|
29
|
+
(c) removes, disables or works around entitlement checks, usage metering,
|
|
30
|
+
quotas or plan limits, or reaches Vibes Platform features the user's
|
|
31
|
+
account is not entitled to;
|
|
32
|
+
(d) scrapes, bulk-exports or harvests data or content from the Vibes
|
|
33
|
+
Platform or its users other than through documented interfaces and
|
|
34
|
+
within their terms, or uses outputs or data obtained from the Vibes
|
|
35
|
+
Platform to train or improve a product that competes with it;
|
|
36
|
+
(e) violates applicable law, infringes anyone's rights, commits fraud or
|
|
37
|
+
deception, conducts unlawful surveillance or harassment, distributes
|
|
38
|
+
malware, or accesses systems without authorization; or
|
|
39
|
+
(f) violates applicable antitrust or competition law.
|
|
40
|
+
|
|
41
|
+
A written permission from the Licensor extends this grant.
|
|
42
|
+
Change Date: Four years from the date the Licensed Work is published.
|
|
43
|
+
Change License: MIT
|
|
44
|
+
|
|
45
|
+
For information about alternative licensing arrangements for the Licensed Work,
|
|
46
|
+
contact VIBES DEV LLC through https://vibes.dev.
|
|
47
|
+
|
|
48
|
+
Notice
|
|
49
|
+
|
|
50
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
51
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
52
|
+
under an Open Source License, as stated in this License.
|
|
53
|
+
|
|
54
|
+
-----------------------------------------------------------------------------
|
|
55
|
+
|
|
56
|
+
Business Source License 1.1
|
|
57
|
+
|
|
58
|
+
License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
59
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
60
|
+
|
|
61
|
+
Terms
|
|
62
|
+
|
|
63
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
64
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
65
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
66
|
+
production use.
|
|
67
|
+
|
|
68
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
69
|
+
available distribution of a specific version of the Licensed Work under this
|
|
70
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
71
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
72
|
+
above terminate.
|
|
73
|
+
|
|
74
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
75
|
+
currently in effect as described in this License, you must purchase a
|
|
76
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
77
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
78
|
+
|
|
79
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
80
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
81
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
82
|
+
for each version of the Licensed Work released by Licensor.
|
|
83
|
+
|
|
84
|
+
You must conspicuously display this License on each original or modified copy
|
|
85
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
86
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
87
|
+
License apply to your use of that work.
|
|
88
|
+
|
|
89
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
90
|
+
terminate your rights under this License for the current and all other
|
|
91
|
+
versions of the Licensed Work.
|
|
92
|
+
|
|
93
|
+
This License does not grant you any right in any trademark or logo of
|
|
94
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
95
|
+
Licensor as expressly required by this License).
|
|
96
|
+
|
|
97
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
98
|
+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
99
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
100
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
101
|
+
TITLE.
|
|
102
|
+
|
|
103
|
+
MariaDB hereby grants you permission to use this License’s text to license
|
|
104
|
+
your works, and to refer to it using the trademark “Business Source License”,
|
|
105
|
+
as long as you comply with the Covenants of Licensor below.
|
|
106
|
+
|
|
107
|
+
Covenants of Licensor
|
|
108
|
+
|
|
109
|
+
In consideration of the right to use this License’s text and the “Business
|
|
110
|
+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
111
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
112
|
+
|
|
113
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
114
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
115
|
+
where “compatible” means that software provided under the Change License can
|
|
116
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
117
|
+
later version. Licensor may specify additional Change Licenses without
|
|
118
|
+
limitation.
|
|
119
|
+
|
|
120
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
121
|
+
impose any additional restriction on the right granted in this License, as
|
|
122
|
+
the Additional Use Grant; or (b) insert the text “None”.
|
|
123
|
+
|
|
124
|
+
3. To specify a Change Date.
|
|
125
|
+
|
|
126
|
+
4. Not to modify this License in any other way.
|
package/README.md
CHANGED
|
@@ -1,3 +1,77 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vibesdotdev/integrations-kafka
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Kafka eventing substrate for Vibes runtime consumers. Provides KafkaJS
|
|
4
|
+
connections, provider clients, admin, topics, schemas, configuration, and the
|
|
5
|
+
runtime event adapter.
|
|
6
|
+
|
|
7
|
+
## Owns
|
|
8
|
+
|
|
9
|
+
- **Connections** (`./connections`): Connection management and purpose-specific
|
|
10
|
+
Kafka clients.
|
|
11
|
+
- **Provider clients** (`./connector`): Producer, consumer, and admin adapters.
|
|
12
|
+
- **Admin** (`./admin`): Topic administration.
|
|
13
|
+
- **Topics** (`./topics`): Topic catalog and retention configuration.
|
|
14
|
+
- **Schemas** (`./message-schemas`, `./schemas/kafka`): Kafka wire and connection
|
|
15
|
+
schemas.
|
|
16
|
+
- **Config** (`./config`): Runtime config-manifest reader.
|
|
17
|
+
- **Event adapter** (`./event-adapter`): Runtime events adapter implementation.
|
|
18
|
+
|
|
19
|
+
## Does not own
|
|
20
|
+
|
|
21
|
+
- **Domain-specific event payloads** → owned by domain packages (e.g. chat,
|
|
22
|
+
workers, tools) that consume these envelopes.
|
|
23
|
+
- **Job execution** → worker and app owners. Kafka is transport only.
|
|
24
|
+
- **Broker provisioning** → infrastructure packages.
|
|
25
|
+
|
|
26
|
+
## Hard rules
|
|
27
|
+
|
|
28
|
+
- `kafkajs` is internal to this package. Features publish through the typed
|
|
29
|
+
helpers or via job submission — never by importing `kafkajs` directly.
|
|
30
|
+
- Connections read the runtime's declared build qualifier at use. Build-scope acquisition refuses with `UNAVAILABLE / kafka-build-scope`; operational failures remain typed and observable.
|
|
31
|
+
- Domain packages own domain event payload schemas; this package owns Kafka wire
|
|
32
|
+
and connection schemas.
|
|
33
|
+
|
|
34
|
+
## Public entrypoints
|
|
35
|
+
|
|
36
|
+
`.`, `./plugin`, `./node.plugin`, `./substrate`, `./connector`, `./connections`, `./admin`,
|
|
37
|
+
`./topics`, `./message-schemas`, `./schemas/kafka`, `./config`, and
|
|
38
|
+
`./event-adapter`, `./event-adapter/descriptor`, `./chat/realtime-transport`,
|
|
39
|
+
`./workers`, `./workers/plugin`, `./workers/consumer.plugin`, and `./workers/provider-jobs-schema`.
|
|
40
|
+
|
|
41
|
+
Compose `./plugin` with `./node.plugin` on Node Kafka hosts. The universal
|
|
42
|
+
plugin registers contracts without loading KafkaJS. Resolve `getKafkaClient(runtime)`
|
|
43
|
+
for the runtime-owned connection, admin and subscription lifecycle. Synchronous
|
|
44
|
+
accessors require client activation. See [SPEC.md](SPEC.md) for typed refusals.
|
|
45
|
+
|
|
46
|
+
Workers cloud hosts compose `./workers/plugin`; consumer hosts add
|
|
47
|
+
`./workers/consumer.plugin` and the Workers plugin. Both use the same persistent
|
|
48
|
+
host-injected `workers-kafka/db` context. Invalid or missing store capabilities
|
|
49
|
+
refuse with `UNAVAILABLE / queue-store-context-unavailable`; no memory fallback
|
|
50
|
+
is used. `cancelJob` validates and persists the complete Workers attribution
|
|
51
|
+
and reason, then includes them with the admitted stamp in local and distributed
|
|
52
|
+
events; `updateJob` is not a cancellation path and refuses `cancelled` with
|
|
53
|
+
`INVALID_INPUT / cancel-provenance-required`. Historical rows remain absent;
|
|
54
|
+
retry and fresh failed-row admission clear provenance. Application migrations
|
|
55
|
+
must add nullable JSON `cancellation` to `provider_jobs` (`TEXT NULL` for
|
|
56
|
+
SQLite/libSQL or `JSONB NULL` for PostgreSQL) without backfilling old rows. See
|
|
57
|
+
[workers SPEC](src/workers/SPEC.md).
|
|
58
|
+
|
|
59
|
+
`readKafkaBaseConfig` returns brokers and TLS only. Connector configuration and
|
|
60
|
+
resolution results keep canonical credential references; the Node KafkaJS
|
|
61
|
+
construction boundary resolves them with `runtime.resolveCredential` and passes
|
|
62
|
+
the result only to KafkaJS. Authenticated clients are available through
|
|
63
|
+
`getKafkaClient(runtime)` and the `kafka-producer`, `kafka-consumer` and
|
|
64
|
+
`kafka-admin` provider `getConnector()` entrypoints.
|
|
65
|
+
|
|
66
|
+
## Verification
|
|
67
|
+
|
|
68
|
+
`bun run check`, `bun run test`, and `bun run build` from package root.
|
|
69
|
+
Check includes all source and test suites without emitting files; build uses
|
|
70
|
+
`tsconfig.build.json` to emit production source into `dist/`.
|
|
71
|
+
|
|
72
|
+
## Links
|
|
73
|
+
|
|
74
|
+
- [runtime/SPEC.md](../../../framework/runtime/SPEC.md)
|
|
75
|
+
- [runtime-plugin/SPEC.md](../../../framework/runtime-plugin/SPEC.md)
|
|
76
|
+
- [logging/SPEC.md](../../../framework/logging/SPEC.md)
|
|
77
|
+
- [workers/SPEC.md](../../../framework/workers/SPEC.md)
|
package/SEALED.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Kafka provider candidate
|
|
2
|
+
|
|
3
|
+
Status: candidate, release-gated
|
|
4
|
+
|
|
5
|
+
`@vibesdotdev/integrations-kafka@0.1.0-rc.0` owns Kafka connections, provider
|
|
6
|
+
connector implementations, schemas, configuration, topic catalog, admin
|
|
7
|
+
operations, and the runtime event adapter. Framework owns the generic events
|
|
8
|
+
kinds and schemas. Consumers compose `integrations-kafka`; they do not import
|
|
9
|
+
KafkaJS or maintain a duplicate transport.
|
|
10
|
+
|
|
11
|
+
The release receipt must include package build/check/test, every documented
|
|
12
|
+
export, packed external imports, exact private Forge main/tree, and the Chat
|
|
13
|
+
manifest migration proof.
|
package/dist/admin.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { VibesRuntime } from '@vibesdotdev/kernel';
|
|
2
|
+
/** Topic operations share the semantic client's connection owner. */
|
|
3
|
+
export declare class KafkaAdmin {
|
|
4
|
+
private readonly runtime;
|
|
5
|
+
constructor(runtime: VibesRuntime);
|
|
6
|
+
private getAdmin;
|
|
7
|
+
private run;
|
|
8
|
+
createTopics(): Promise<void>;
|
|
9
|
+
listTopics(): Promise<string[]>;
|
|
10
|
+
deleteTopics(topics: string[]): Promise<void>;
|
|
11
|
+
describeCluster(): Promise<{
|
|
12
|
+
topics: Array<import("kafkajs").ITopicMetadata>;
|
|
13
|
+
} | null>;
|
|
14
|
+
getTopicMetadata(topics?: string[]): Promise<{
|
|
15
|
+
topics: Array<import("kafkajs").ITopicMetadata>;
|
|
16
|
+
} | null>;
|
|
17
|
+
disconnect(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare function getKafkaAdmin(runtime: VibesRuntime): KafkaAdmin;
|
|
20
|
+
//# sourceMappingURL=admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOxD,qEAAqE;AACrE,qBAAa,UAAU;IACV,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,YAAY;IAElD,OAAO,CAAC,QAAQ;YAIF,GAAG;IAOX,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAa7B,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAK/B,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD,eAAe;;;IACf,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE;;;IAE5B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGjC;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,cAA+C"}
|
package/dist/admin.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CapabilityError, CaughtFailureSchema, valueFreeFailure } from '@vibesdotdev/kernel';
|
|
2
|
+
import { requireKafkaClient } from "./client.js";
|
|
3
|
+
import { getKafkaConnections, KafkaConnectionPurpose } from "./connections.js";
|
|
4
|
+
import { topicConfigurationsSchema } from "./topics.js";
|
|
5
|
+
/** Topic operations share the semantic client's connection owner. */
|
|
6
|
+
export class KafkaAdmin {
|
|
7
|
+
runtime;
|
|
8
|
+
constructor(runtime) {
|
|
9
|
+
this.runtime = runtime;
|
|
10
|
+
}
|
|
11
|
+
getAdmin() {
|
|
12
|
+
return getKafkaConnections(this.runtime).getAdmin(KafkaConnectionPurpose.CHAT);
|
|
13
|
+
}
|
|
14
|
+
async run(operation) {
|
|
15
|
+
const admin = await this.getAdmin();
|
|
16
|
+
if (!admin)
|
|
17
|
+
return null; // Declared build scope intentionally has no broker resources.
|
|
18
|
+
try {
|
|
19
|
+
return await operation(admin);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
throw new CapabilityError('Kafka admin operation failed.', 'UNAVAILABLE', { reason: 'kafka-admin-operation-failed', details: { failure: valueFreeFailure(CaughtFailureSchema.parse(error)) } });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async createTopics() {
|
|
26
|
+
const configs = topicConfigurationsSchema.parse({});
|
|
27
|
+
await this.run(admin => admin.createTopics({
|
|
28
|
+
topics: Object.entries(configs).map(([topic, config]) => ({
|
|
29
|
+
topic, numPartitions: config.partitions, replicationFactor: config.replicationFactor,
|
|
30
|
+
configEntries: [
|
|
31
|
+
{ name: 'retention.ms', value: config.retentionMs.toString() },
|
|
32
|
+
{ name: 'segment.ms', value: config.segmentMs.toString() }
|
|
33
|
+
]
|
|
34
|
+
}))
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
async listTopics() {
|
|
38
|
+
const metadata = await this.run(admin => admin.fetchTopicMetadata());
|
|
39
|
+
return metadata ? metadata.topics.map(topic => topic.name) : [];
|
|
40
|
+
}
|
|
41
|
+
async deleteTopics(topics) {
|
|
42
|
+
await this.run(admin => admin.deleteTopics({ topics }));
|
|
43
|
+
}
|
|
44
|
+
describeCluster() { return this.run(admin => admin.fetchTopicMetadata()); }
|
|
45
|
+
getTopicMetadata(topics) { return this.run(admin => admin.fetchTopicMetadata({ topics: topics ?? [] })); }
|
|
46
|
+
async disconnect() {
|
|
47
|
+
await getKafkaConnections(this.runtime).disconnect(KafkaConnectionPurpose.CHAT);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function getKafkaAdmin(runtime) { return requireKafkaClient(runtime).admin; }
|
|
51
|
+
//# sourceMappingURL=admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Kafka, type KafkaConfig } from 'kafkajs';
|
|
2
|
+
import { type VibesRuntime } from '@vibesdotdev/kernel';
|
|
3
|
+
import type { KafkaQueueTimerOwner } from '../request-queue-timeout-guard.ts';
|
|
4
|
+
import type { KafkaVendorClient } from '../schemas/kafka.ts';
|
|
5
|
+
import { type KafkaPublicConfig, type KafkaSasl } from '../schemas/contracts.ts';
|
|
6
|
+
type KafkaConstructionConfig = KafkaPublicConfig & {
|
|
7
|
+
sasl?: KafkaSasl;
|
|
8
|
+
clientId?: string;
|
|
9
|
+
};
|
|
10
|
+
type KafkaConstructionOptions = Omit<Partial<KafkaConfig>, 'brokers' | 'ssl' | 'sasl'>;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve credential references and construct KafkaJS inside the Node boundary.
|
|
13
|
+
* The resolved password is neither passed to a callback nor retained in public
|
|
14
|
+
* configuration; only KafkaJS receives it in its constructor options.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createAuthenticatedKafka(runtime: VibesRuntime, config: KafkaConstructionConfig, options?: KafkaConstructionOptions, owner?: KafkaQueueTimerOwner): Promise<Kafka & KafkaVendorClient>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=sasl.node.impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sasl.node.impl.d.ts","sourceRoot":"","sources":["../../src/auth/sasl.node.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAIxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAA4C,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE3H,KAAK,uBAAuB,GAAG,iBAAiB,GAAG;IAClD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,wBAAwB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC;AAEvF;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC7C,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,uBAAuB,EAC/B,OAAO,GAAE,wBAA6B,EACtC,KAAK,GAAE,oBAGN,GACC,OAAO,CAAC,KAAK,GAAG,iBAAiB,CAAC,CAgDpC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Kafka } from 'kafkajs';
|
|
2
|
+
import {} from '@vibesdotdev/kernel';
|
|
3
|
+
import { getLogger } from '@vibesdotdev/logging';
|
|
4
|
+
import { loadKafkaSettings } from "../config/kafka.config.descriptor.js";
|
|
5
|
+
import { armKafkaClientQueues, createKafkaRequestQueueTimeoutGuard } from "../request-queue-timeout-guard.js";
|
|
6
|
+
import { KafkaPublicConfigSchema, KafkaSaslSchema } from "../schemas/contracts.js";
|
|
7
|
+
/**
|
|
8
|
+
* Resolve credential references and construct KafkaJS inside the Node boundary.
|
|
9
|
+
* The resolved password is neither passed to a callback nor retained in public
|
|
10
|
+
* configuration; only KafkaJS receives it in its constructor options.
|
|
11
|
+
*/
|
|
12
|
+
export async function createAuthenticatedKafka(runtime, config, options = {}, owner = {
|
|
13
|
+
signal: runtime.lifecycle.signal,
|
|
14
|
+
timeout: (callback, delayMs) => runtime.lifecycle.timeout(callback, delayMs)
|
|
15
|
+
}) {
|
|
16
|
+
const publicConfig = KafkaPublicConfigSchema.parse({
|
|
17
|
+
brokers: config.brokers,
|
|
18
|
+
ssl: config.ssl
|
|
19
|
+
});
|
|
20
|
+
const settings = await loadKafkaSettings(runtime);
|
|
21
|
+
const saslReference = config.sasl ?? (settings.saslUsername ? {
|
|
22
|
+
mechanism: settings.saslMechanism,
|
|
23
|
+
username: settings.saslUsername,
|
|
24
|
+
password: { source: 'secret', key: 'KAFKA_SASL_PASSWORD' }
|
|
25
|
+
} : undefined);
|
|
26
|
+
let sasl;
|
|
27
|
+
if (saslReference) {
|
|
28
|
+
const parsedSasl = KafkaSaslSchema.parse(saslReference);
|
|
29
|
+
const credential = await runtime.resolveCredential(parsedSasl.password);
|
|
30
|
+
if (!credential.ok)
|
|
31
|
+
throw credential.error;
|
|
32
|
+
const credentials = { username: parsedSasl.username, password: credential.value };
|
|
33
|
+
switch (parsedSasl.mechanism) {
|
|
34
|
+
case 'plain':
|
|
35
|
+
sasl = { mechanism: 'plain', ...credentials };
|
|
36
|
+
break;
|
|
37
|
+
case 'scram-sha-256':
|
|
38
|
+
sasl = { mechanism: 'scram-sha-256', ...credentials };
|
|
39
|
+
break;
|
|
40
|
+
case 'scram-sha-512':
|
|
41
|
+
sasl = { mechanism: 'scram-sha-512', ...credentials };
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const vendorConfig = {
|
|
46
|
+
...options,
|
|
47
|
+
brokers: publicConfig.brokers,
|
|
48
|
+
ssl: publicConfig.ssl,
|
|
49
|
+
clientId: config.clientId ?? options.clientId
|
|
50
|
+
};
|
|
51
|
+
if (sasl)
|
|
52
|
+
vendorConfig.sasl = sasl;
|
|
53
|
+
const ensureGuard = createKafkaRequestQueueTimeoutGuard({
|
|
54
|
+
building: () => runtime.scope.qualifiers?.building === true,
|
|
55
|
+
logger: getLogger('kafka', runtime).child('connections')
|
|
56
|
+
});
|
|
57
|
+
await ensureGuard();
|
|
58
|
+
const client = new Kafka(vendorConfig);
|
|
59
|
+
armKafkaClientQueues(owner, client);
|
|
60
|
+
return client;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=sasl.node.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sasl.node.impl.js","sourceRoot":"","sources":["../../src/auth/sasl.node.impl.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SseMessage } from '../../schemas/realtime.ts';
|
|
2
|
+
/** Host capabilities supplied by the Chat/app realtime surface. */
|
|
3
|
+
export interface SseBridgeHost {
|
|
4
|
+
broadcastToChannel(channel: string, data: SseMessage): void;
|
|
5
|
+
}
|
|
6
|
+
export interface WebSocketBridgeHost {
|
|
7
|
+
broadcast(channel: string, data: SseMessage): number | void;
|
|
8
|
+
}
|
|
9
|
+
export interface KafkaRealtimeHosts {
|
|
10
|
+
sse: SseBridgeHost;
|
|
11
|
+
websocket: WebSocketBridgeHost;
|
|
12
|
+
}
|
|
13
|
+
export declare const unavailableSseBridgeHost: SseBridgeHost;
|
|
14
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../src/chat/realtime-transport/host.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC7B,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CAC5D;AACD,MAAM,WAAW,mBAAmB;IACnC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;CAC5D;AACD,MAAM,WAAW,kBAAkB;IAClC,GAAG,EAAE,aAAa,CAAC;IACnB,SAAS,EAAE,mBAAmB,CAAC;CAC/B;AACD,eAAO,MAAM,wBAAwB,EAAE,aAItC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
2
|
+
export const unavailableSseBridgeHost = {
|
|
3
|
+
broadcastToChannel() {
|
|
4
|
+
throw new CapabilityError('Kafka SSE bridge host is not registered.', 'UNAVAILABLE', { reason: 'kafka-realtime-host-unavailable' });
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../../src/chat/realtime-transport/host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AActD,MAAM,CAAC,MAAM,wBAAwB,GAAkB;IACtD,kBAAkB;QACjB,MAAM,IAAI,eAAe,CAAC,0CAA0C,EAAE,aAAa,EAAE,EAAE,MAAM,EAAE,iCAAiC,EAAE,CAAC,CAAC;IACrI,CAAC;CACD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Provider-owned Chat realtime projections backed by Kafka. */
|
|
2
|
+
import { SSEKafkaBridge } from './sse-kafka-bridge.ts';
|
|
3
|
+
import { WSKafkaBridge } from './ws-kafka-bridge.ts';
|
|
4
|
+
import type { VibesRuntime } from '@vibesdotdev/kernel';
|
|
5
|
+
import type { KafkaRealtimeHosts } from './host.ts';
|
|
6
|
+
export type { KafkaRealtimeHosts, SseBridgeHost, WebSocketBridgeHost } from './host.ts';
|
|
7
|
+
export { SSEKafkaBridge, mapKafkaAgentEventType } from './sse-kafka-bridge.ts';
|
|
8
|
+
export type { SseBridgeConnection, SseMessage } from './sse-kafka-bridge.ts';
|
|
9
|
+
export { WSKafkaBridge } from './ws-kafka-bridge.ts';
|
|
10
|
+
/** Compose both provider bridges with the app-owned realtime hosts. */
|
|
11
|
+
export declare function createKafkaRealtimeBridges(runtime: VibesRuntime, hosts: KafkaRealtimeHosts): {
|
|
12
|
+
sse: SSEKafkaBridge;
|
|
13
|
+
websocket: WSKafkaBridge;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chat/realtime-transport/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,uEAAuE;AACvE,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,kBAAkB;;;EAM1B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Provider-owned Chat realtime projections backed by Kafka. */
|
|
2
|
+
import { SSEKafkaBridge } from "./sse-kafka-bridge.js";
|
|
3
|
+
import { WSKafkaBridge } from "./ws-kafka-bridge.js";
|
|
4
|
+
export { SSEKafkaBridge, mapKafkaAgentEventType } from "./sse-kafka-bridge.js";
|
|
5
|
+
export { WSKafkaBridge } from "./ws-kafka-bridge.js";
|
|
6
|
+
/** Compose both provider bridges with the app-owned realtime hosts. */
|
|
7
|
+
export function createKafkaRealtimeBridges(runtime, hosts) {
|
|
8
|
+
return {
|
|
9
|
+
sse: new SSEKafkaBridge(runtime, hosts.sse),
|
|
10
|
+
websocket: new WSKafkaBridge(runtime, hosts.websocket)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/chat/realtime-transport/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKrD,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,uEAAuE;AACvE,MAAM,UAAU,0BAA0B,CACxC,OAAqB,EACrB,KAAyB;IAEzB,OAAO;QACL,GAAG,EAAE,IAAI,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC;QAC3C,SAAS,EAAE,IAAI,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;KACvD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type VibesRuntime } from '@vibesdotdev/kernel';
|
|
2
|
+
import { RealtimeProjection } from './projection.ts';
|
|
3
|
+
export declare class BridgeLifecycle {
|
|
4
|
+
private readonly runtime;
|
|
5
|
+
private readonly projection;
|
|
6
|
+
private readonly surface;
|
|
7
|
+
private readonly closeConnections;
|
|
8
|
+
private readonly consumers;
|
|
9
|
+
private owner?;
|
|
10
|
+
private starting?;
|
|
11
|
+
private stopping?;
|
|
12
|
+
private registered;
|
|
13
|
+
private active;
|
|
14
|
+
private closed;
|
|
15
|
+
private readonly id;
|
|
16
|
+
constructor(runtime: VibesRuntime, projection: RealtimeProjection, surface: 'sse' | 'ws', closeConnections: () => void);
|
|
17
|
+
start(): Promise<void>;
|
|
18
|
+
private activate;
|
|
19
|
+
private acquire;
|
|
20
|
+
private release;
|
|
21
|
+
stop(): Promise<void>;
|
|
22
|
+
private deactivate;
|
|
23
|
+
isRunning(): boolean;
|
|
24
|
+
getStats(): {
|
|
25
|
+
active: boolean;
|
|
26
|
+
consumers: string[];
|
|
27
|
+
consumerCount: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/chat/realtime-transport/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,qBAAa,eAAe;IAUf,OAAO,CAAC,QAAQ,CAAC,OAAO;IAAgB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAAsB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAAgB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAT9K,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoC;IAC9D,OAAO,CAAC,KAAK,CAAC,CAAc;IAC5B,OAAO,CAAC,QAAQ,CAAC,CAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,CAAgB;IACjC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAA2C;gBAEjC,OAAO,EAAE,YAAY,EAAmB,UAAU,EAAE,kBAAkB,EAAmB,OAAO,EAAE,KAAK,GAAG,IAAI,EAAmB,gBAAgB,EAAE,MAAM,IAAI;IAE1L,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAOR,QAAQ;YAaR,OAAO;YA2CP,OAAO;IAUrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;YAIP,UAAU;IAWxB,SAAS;IACT,QAAQ;;;;;CACR"}
|