@moltzap/client 2026.812.0 → 2026.902.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -21
- package/NOTICE +19 -0
- package/README.md +50 -0
- package/bin/moltzapd +9 -0
- package/dist/client-runtime.d.ts +10 -0
- package/dist/client-runtime.d.ts.map +1 -0
- package/dist/client-runtime.js +218 -0
- package/dist/client-runtime.js.map +1 -0
- package/dist/contract.d.ts +338 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +213 -0
- package/dist/contract.js.map +1 -0
- package/dist/contract.types-check.d.ts +99 -0
- package/dist/contract.types-check.d.ts.map +1 -0
- package/dist/contract.types-check.js +7 -0
- package/dist/contract.types-check.js.map +1 -0
- package/dist/daemon/configuration.d.ts +46 -0
- package/dist/daemon/configuration.d.ts.map +1 -0
- package/dist/daemon/configuration.js +69 -0
- package/dist/daemon/configuration.js.map +1 -0
- package/dist/daemon/management.d.ts +23 -0
- package/dist/daemon/management.d.ts.map +1 -0
- package/dist/daemon/management.js +489 -0
- package/dist/daemon/management.js.map +1 -0
- package/dist/daemon/registration.d.ts +72 -0
- package/dist/daemon/registration.d.ts.map +1 -0
- package/dist/daemon/registration.js +109 -0
- package/dist/daemon/registration.js.map +1 -0
- package/dist/daemon/runtime/activation.d.ts +95 -0
- package/dist/daemon/runtime/activation.d.ts.map +1 -0
- package/dist/daemon/runtime/activation.js +99 -0
- package/dist/daemon/runtime/activation.js.map +1 -0
- package/dist/daemon/runtime/controller.d.ts +34 -0
- package/dist/daemon/runtime/controller.d.ts.map +1 -0
- package/dist/daemon/runtime/controller.js +106 -0
- package/dist/daemon/runtime/controller.js.map +1 -0
- package/dist/daemon/runtime/history-export.d.ts +23 -0
- package/dist/daemon/runtime/history-export.d.ts.map +1 -0
- package/dist/daemon/runtime/history-export.js +47 -0
- package/dist/daemon/runtime/history-export.js.map +1 -0
- package/dist/daemon/runtime/index.d.ts +24 -0
- package/dist/daemon/runtime/index.d.ts.map +1 -0
- package/dist/daemon/runtime/index.js +65 -0
- package/dist/daemon/runtime/index.js.map +1 -0
- package/dist/daemon/runtime/protocol.d.ts +63 -0
- package/dist/daemon/runtime/protocol.d.ts.map +1 -0
- package/dist/daemon/runtime/protocol.js +133 -0
- package/dist/daemon/runtime/protocol.js.map +1 -0
- package/dist/endpoint/addressing/index.d.ts +39 -0
- package/dist/endpoint/addressing/index.d.ts.map +1 -0
- package/dist/endpoint/addressing/index.js +114 -0
- package/dist/endpoint/addressing/index.js.map +1 -0
- package/dist/endpoint/engine-dissemination.d.ts +11 -0
- package/dist/endpoint/engine-dissemination.d.ts.map +1 -0
- package/dist/endpoint/engine-dissemination.js +71 -0
- package/dist/endpoint/engine-dissemination.js.map +1 -0
- package/dist/endpoint/engine-durability.d.ts +69 -0
- package/dist/endpoint/engine-durability.d.ts.map +1 -0
- package/dist/endpoint/engine-durability.js +210 -0
- package/dist/endpoint/engine-durability.js.map +1 -0
- package/dist/endpoint/engine-send.d.ts +50 -0
- package/dist/endpoint/engine-send.d.ts.map +1 -0
- package/dist/endpoint/engine-send.js +422 -0
- package/dist/endpoint/engine-send.js.map +1 -0
- package/dist/endpoint/engine-types.d.ts +132 -0
- package/dist/endpoint/engine-types.d.ts.map +1 -0
- package/dist/endpoint/engine-types.js +13 -0
- package/dist/endpoint/engine-types.js.map +1 -0
- package/dist/endpoint/engine.d.ts +14 -0
- package/dist/endpoint/engine.d.ts.map +1 -0
- package/dist/endpoint/engine.js +280 -0
- package/dist/endpoint/engine.js.map +1 -0
- package/dist/endpoint/protocol/evidence.d.ts +37 -0
- package/dist/endpoint/protocol/evidence.d.ts.map +1 -0
- package/dist/endpoint/protocol/evidence.js +80 -0
- package/dist/endpoint/protocol/evidence.js.map +1 -0
- package/dist/endpoint/protocol/index.d.ts +26 -0
- package/dist/endpoint/protocol/index.d.ts.map +1 -0
- package/dist/endpoint/protocol/index.js +543 -0
- package/dist/endpoint/protocol/index.js.map +1 -0
- package/dist/endpoint/recovery/barrier.d.ts +23 -0
- package/dist/endpoint/recovery/barrier.d.ts.map +1 -0
- package/dist/endpoint/recovery/barrier.js +47 -0
- package/dist/endpoint/recovery/barrier.js.map +1 -0
- package/dist/endpoint/recovery/index.d.ts +29 -0
- package/dist/endpoint/recovery/index.d.ts.map +1 -0
- package/dist/endpoint/recovery/index.js +489 -0
- package/dist/endpoint/recovery/index.js.map +1 -0
- package/dist/endpoint/recovery/reanchor/empty.d.ts +22 -0
- package/dist/endpoint/recovery/reanchor/empty.d.ts.map +1 -0
- package/dist/endpoint/recovery/reanchor/empty.js +163 -0
- package/dist/endpoint/recovery/reanchor/empty.js.map +1 -0
- package/dist/endpoint/recovery/reanchor/index.d.ts +30 -0
- package/dist/endpoint/recovery/reanchor/index.d.ts.map +1 -0
- package/dist/endpoint/recovery/reanchor/index.js +479 -0
- package/dist/endpoint/recovery/reanchor/index.js.map +1 -0
- package/dist/endpoint/recovery/state.d.ts +130 -0
- package/dist/endpoint/recovery/state.d.ts.map +1 -0
- package/dist/endpoint/recovery/state.js +296 -0
- package/dist/endpoint/recovery/state.js.map +1 -0
- package/dist/endpoint/recovery/store-evidence.d.ts +17 -0
- package/dist/endpoint/recovery/store-evidence.d.ts.map +1 -0
- package/dist/endpoint/recovery/store-evidence.js +79 -0
- package/dist/endpoint/recovery/store-evidence.js.map +1 -0
- package/dist/endpoint/recovery/store.d.ts +56 -0
- package/dist/endpoint/recovery/store.d.ts.map +1 -0
- package/dist/endpoint/recovery/store.js +499 -0
- package/dist/endpoint/recovery/store.js.map +1 -0
- package/dist/endpoint/representation-canonical.d.ts +17 -0
- package/dist/endpoint/representation-canonical.d.ts.map +1 -0
- package/dist/endpoint/representation-canonical.js +48 -0
- package/dist/endpoint/representation-canonical.js.map +1 -0
- package/dist/endpoint/representation-codec.d.ts +51 -0
- package/dist/endpoint/representation-codec.d.ts.map +1 -0
- package/dist/endpoint/representation-codec.js +159 -0
- package/dist/endpoint/representation-codec.js.map +1 -0
- package/dist/endpoint/representation-schemas.d.ts +1831 -0
- package/dist/endpoint/representation-schemas.d.ts.map +1 -0
- package/dist/endpoint/representation-schemas.js +195 -0
- package/dist/endpoint/representation-schemas.js.map +1 -0
- package/dist/endpoint/representation-verification.d.ts +79 -0
- package/dist/endpoint/representation-verification.d.ts.map +1 -0
- package/dist/endpoint/representation-verification.js +420 -0
- package/dist/endpoint/representation-verification.js.map +1 -0
- package/dist/endpoint/representation.d.ts +6 -0
- package/dist/endpoint/representation.d.ts.map +1 -0
- package/dist/endpoint/representation.js +8 -0
- package/dist/endpoint/representation.js.map +1 -0
- package/dist/endpoint/router-worker/index.d.ts +16 -0
- package/dist/endpoint/router-worker/index.d.ts.map +1 -0
- package/dist/endpoint/router-worker/index.js +547 -0
- package/dist/endpoint/router-worker/index.js.map +1 -0
- package/dist/endpoint/router-worker/types.d.ts +183 -0
- package/dist/endpoint/router-worker/types.d.ts.map +1 -0
- package/dist/endpoint/router-worker/types.js +31 -0
- package/dist/endpoint/router-worker/types.js.map +1 -0
- package/dist/endpoint/store/anchors.d.ts +83 -0
- package/dist/endpoint/store/anchors.d.ts.map +1 -0
- package/dist/endpoint/store/anchors.js +471 -0
- package/dist/endpoint/store/anchors.js.map +1 -0
- package/dist/endpoint/store/database/index.d.ts +6 -0
- package/dist/endpoint/store/database/index.d.ts.map +1 -0
- package/dist/endpoint/store/database/index.js +6 -0
- package/dist/endpoint/store/database/index.js.map +1 -0
- package/dist/endpoint/store/database/schema.d.ts +44 -0
- package/dist/endpoint/store/database/schema.d.ts.map +1 -0
- package/dist/endpoint/store/database/schema.js +345 -0
- package/dist/endpoint/store/database/schema.js.map +1 -0
- package/dist/endpoint/store/database/values.d.ts +119 -0
- package/dist/endpoint/store/database/values.d.ts.map +1 -0
- package/dist/endpoint/store/database/values.js +194 -0
- package/dist/endpoint/store/database/values.js.map +1 -0
- package/dist/endpoint/store/deliveries.d.ts +38 -0
- package/dist/endpoint/store/deliveries.d.ts.map +1 -0
- package/dist/endpoint/store/deliveries.js +124 -0
- package/dist/endpoint/store/deliveries.js.map +1 -0
- package/dist/endpoint/store/dissemination.d.ts +27 -0
- package/dist/endpoint/store/dissemination.d.ts.map +1 -0
- package/dist/endpoint/store/dissemination.js +139 -0
- package/dist/endpoint/store/dissemination.js.map +1 -0
- package/dist/endpoint/store/index.d.ts +15 -0
- package/dist/endpoint/store/index.d.ts.map +1 -0
- package/dist/endpoint/store/index.js +76 -0
- package/dist/endpoint/store/index.js.map +1 -0
- package/dist/endpoint/store/management.d.ts +42 -0
- package/dist/endpoint/store/management.d.ts.map +1 -0
- package/dist/endpoint/store/management.js +259 -0
- package/dist/endpoint/store/management.js.map +1 -0
- package/dist/endpoint/store/outbound.d.ts +62 -0
- package/dist/endpoint/store/outbound.d.ts.map +1 -0
- package/dist/endpoint/store/outbound.js +278 -0
- package/dist/endpoint/store/outbound.js.map +1 -0
- package/dist/endpoint/store/records.d.ts +56 -0
- package/dist/endpoint/store/records.d.ts.map +1 -0
- package/dist/endpoint/store/records.js +352 -0
- package/dist/endpoint/store/records.js.map +1 -0
- package/dist/endpoint/store/rows/index.d.ts +138 -0
- package/dist/endpoint/store/rows/index.d.ts.map +1 -0
- package/dist/endpoint/store/rows/index.js +307 -0
- package/dist/endpoint/store/rows/index.js.map +1 -0
- package/dist/endpoint/store/types.d.ts +223 -0
- package/dist/endpoint/store/types.d.ts.map +1 -0
- package/dist/endpoint/store/types.js +15 -0
- package/dist/endpoint/store/types.js.map +1 -0
- package/dist/endpoint/store.d.ts +10 -0
- package/dist/endpoint/store.d.ts.map +1 -0
- package/dist/endpoint/store.js +6 -0
- package/dist/endpoint/store.js.map +1 -0
- package/dist/harness-mcp-contract.d.ts +101 -0
- package/dist/harness-mcp-contract.d.ts.map +1 -0
- package/dist/harness-mcp-contract.js +61 -0
- package/dist/harness-mcp-contract.js.map +1 -0
- package/dist/{harness-mcp-server.d.ts → harness-mcp-http.d.ts} +9 -8
- package/dist/harness-mcp-http.d.ts.map +1 -0
- package/dist/{harness-mcp-server.js → harness-mcp-http.js} +38 -60
- package/dist/harness-mcp-http.js.map +1 -0
- package/dist/harness-mcp-subscription.d.ts +12 -7
- package/dist/harness-mcp-subscription.d.ts.map +1 -1
- package/dist/harness-mcp-subscription.js +113 -100
- package/dist/harness-mcp-subscription.js.map +1 -1
- package/dist/harness-mcp-wire.d.ts +24 -49
- package/dist/harness-mcp-wire.d.ts.map +1 -1
- package/dist/harness-mcp-wire.js +381 -124
- package/dist/harness-mcp-wire.js.map +1 -1
- package/dist/index.d.ts +4 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -10
- package/dist/index.js.map +1 -1
- package/dist/management-runtime.d.ts +217 -0
- package/dist/management-runtime.d.ts.map +1 -0
- package/dist/management-runtime.js +127 -0
- package/dist/management-runtime.js.map +1 -0
- package/dist/server.d.ts +16 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +46 -0
- package/dist/server.js.map +1 -0
- package/dist/server.types-check.d.ts +23 -0
- package/dist/server.types-check.d.ts.map +1 -0
- package/dist/server.types-check.js +7 -0
- package/dist/server.types-check.js.map +1 -0
- package/package.json +24 -52
- package/dist/agent-client.d.ts +0 -5
- package/dist/agent-client.d.ts.map +0 -1
- package/dist/agent-client.js +0 -3
- package/dist/agent-client.js.map +0 -1
- package/dist/auth.d.ts +0 -37
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js +0 -79
- package/dist/auth.js.map +0 -1
- package/dist/bounded-map.d.ts +0 -32
- package/dist/bounded-map.d.ts.map +0 -1
- package/dist/bounded-map.js +0 -79
- package/dist/bounded-map.js.map +0 -1
- package/dist/channel-base/format-cross-conv.d.ts +0 -43
- package/dist/channel-base/format-cross-conv.d.ts.map +0 -1
- package/dist/channel-base/format-cross-conv.js +0 -65
- package/dist/channel-base/format-cross-conv.js.map +0 -1
- package/dist/channel-base/format-group-block.d.ts +0 -48
- package/dist/channel-base/format-group-block.d.ts.map +0 -1
- package/dist/channel-base/format-group-block.js +0 -62
- package/dist/channel-base/format-group-block.js.map +0 -1
- package/dist/channel-base/index.d.ts +0 -12
- package/dist/channel-base/index.d.ts.map +0 -1
- package/dist/channel-base/index.js +0 -16
- package/dist/channel-base/index.js.map +0 -1
- package/dist/channel-core-enrichment.d.ts +0 -38
- package/dist/channel-core-enrichment.d.ts.map +0 -1
- package/dist/channel-core-enrichment.js +0 -217
- package/dist/channel-core-enrichment.js.map +0 -1
- package/dist/channel-core-test-support.d.ts +0 -75
- package/dist/channel-core-test-support.d.ts.map +0 -1
- package/dist/channel-core-test-support.js +0 -74
- package/dist/channel-core-test-support.js.map +0 -1
- package/dist/channel-core.d.ts +0 -306
- package/dist/channel-core.d.ts.map +0 -1
- package/dist/channel-core.js +0 -365
- package/dist/channel-core.js.map +0 -1
- package/dist/config.d.ts +0 -33
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -51
- package/dist/config.js.map +0 -1
- package/dist/config.test-utils.d.ts +0 -24
- package/dist/config.test-utils.d.ts.map +0 -1
- package/dist/config.test-utils.js +0 -57
- package/dist/config.test-utils.js.map +0 -1
- package/dist/harness/client-runtime.d.ts +0 -31
- package/dist/harness/client-runtime.d.ts.map +0 -1
- package/dist/harness/client-runtime.js +0 -121
- package/dist/harness/client-runtime.js.map +0 -1
- package/dist/harness/index.d.ts +0 -5
- package/dist/harness/index.d.ts.map +0 -1
- package/dist/harness/index.js +0 -5
- package/dist/harness/index.js.map +0 -1
- package/dist/harness/runtime.d.ts +0 -301
- package/dist/harness/runtime.d.ts.map +0 -1
- package/dist/harness/runtime.js +0 -165
- package/dist/harness/runtime.js.map +0 -1
- package/dist/harness-client.d.ts +0 -47
- package/dist/harness-client.d.ts.map +0 -1
- package/dist/harness-client.js +0 -76
- package/dist/harness-client.js.map +0 -1
- package/dist/harness-context-projection.d.ts +0 -35
- package/dist/harness-context-projection.d.ts.map +0 -1
- package/dist/harness-context-projection.js +0 -123
- package/dist/harness-context-projection.js.map +0 -1
- package/dist/harness-mcp-server.d.ts.map +0 -1
- package/dist/harness-mcp-server.js.map +0 -1
- package/dist/local-paths.d.ts +0 -11
- package/dist/local-paths.d.ts.map +0 -1
- package/dist/local-paths.js +0 -21
- package/dist/local-paths.js.map +0 -1
- package/dist/message-rendering.d.ts +0 -4
- package/dist/message-rendering.d.ts.map +0 -1
- package/dist/message-rendering.js +0 -8
- package/dist/message-rendering.js.map +0 -1
- package/dist/moltzapd-catalog.d.ts +0 -35
- package/dist/moltzapd-catalog.d.ts.map +0 -1
- package/dist/moltzapd-catalog.js +0 -117
- package/dist/moltzapd-catalog.js.map +0 -1
- package/dist/moltzapd-child-ipc.d.ts +0 -26
- package/dist/moltzapd-child-ipc.d.ts.map +0 -1
- package/dist/moltzapd-child-ipc.js +0 -31
- package/dist/moltzapd-child-ipc.js.map +0 -1
- package/dist/moltzapd-child.d.ts +0 -55
- package/dist/moltzapd-child.d.ts.map +0 -1
- package/dist/moltzapd-child.js +0 -225
- package/dist/moltzapd-child.js.map +0 -1
- package/dist/moltzapd-main.d.ts +0 -3
- package/dist/moltzapd-main.d.ts.map +0 -1
- package/dist/moltzapd-main.js +0 -18
- package/dist/moltzapd-main.js.map +0 -1
- package/dist/moltzapd-registration.d.ts +0 -40
- package/dist/moltzapd-registration.d.ts.map +0 -1
- package/dist/moltzapd-registration.js +0 -59
- package/dist/moltzapd-registration.js.map +0 -1
- package/dist/moltzapd.d.ts +0 -85
- package/dist/moltzapd.d.ts.map +0 -1
- package/dist/moltzapd.js +0 -150
- package/dist/moltzapd.js.map +0 -1
- package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts +0 -53
- package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts.map +0 -1
- package/dist/notification/__tests__/subscribe-signatures.types-check.js +0 -29
- package/dist/notification/__tests__/subscribe-signatures.types-check.js.map +0 -1
- package/dist/notification/errors.d.ts +0 -41
- package/dist/notification/errors.d.ts.map +0 -1
- package/dist/notification/errors.js +0 -24
- package/dist/notification/errors.js.map +0 -1
- package/dist/notification/index.d.ts +0 -6
- package/dist/notification/index.d.ts.map +0 -1
- package/dist/notification/index.js +0 -6
- package/dist/notification/index.js.map +0 -1
- package/dist/notification/stream.d.ts +0 -75
- package/dist/notification/stream.d.ts.map +0 -1
- package/dist/notification/stream.js +0 -30
- package/dist/notification/stream.js.map +0 -1
- package/dist/notification/trace.d.ts +0 -10
- package/dist/notification/trace.d.ts.map +0 -1
- package/dist/notification/trace.js +0 -34
- package/dist/notification/trace.js.map +0 -1
- package/dist/pagination.d.ts +0 -52
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pagination.js +0 -51
- package/dist/pagination.js.map +0 -1
- package/dist/presentation/index.d.ts +0 -3
- package/dist/presentation/index.d.ts.map +0 -1
- package/dist/presentation/index.js +0 -3
- package/dist/presentation/index.js.map +0 -1
- package/dist/presentation/state.d.ts +0 -77
- package/dist/presentation/state.d.ts.map +0 -1
- package/dist/presentation/state.js +0 -211
- package/dist/presentation/state.js.map +0 -1
- package/dist/profile.d.ts +0 -106
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js +0 -171
- package/dist/profile.js.map +0 -1
- package/dist/service-event-trace.d.ts +0 -15
- package/dist/service-event-trace.d.ts.map +0 -1
- package/dist/service-event-trace.js +0 -35
- package/dist/service-event-trace.js.map +0 -1
- package/dist/service.d.ts +0 -228
- package/dist/service.d.ts.map +0 -1
- package/dist/service.js +0 -485
- package/dist/service.js.map +0 -1
- package/dist/test-utils/channel-service-fixture.d.ts +0 -53
- package/dist/test-utils/channel-service-fixture.d.ts.map +0 -1
- package/dist/test-utils/channel-service-fixture.js +0 -178
- package/dist/test-utils/channel-service-fixture.js.map +0 -1
- package/dist/test-utils/fake-service.d.ts +0 -82
- package/dist/test-utils/fake-service.d.ts.map +0 -1
- package/dist/test-utils/fake-service.js +0 -108
- package/dist/test-utils/fake-service.js.map +0 -1
- package/dist/test-utils/harness.d.ts +0 -27
- package/dist/test-utils/harness.d.ts.map +0 -1
- package/dist/test-utils/harness.js +0 -33
- package/dist/test-utils/harness.js.map +0 -1
- package/dist/test-utils/ids.d.ts +0 -21
- package/dist/test-utils/ids.d.ts.map +0 -1
- package/dist/test-utils/ids.js +0 -68
- package/dist/test-utils/ids.js.map +0 -1
- package/dist/test-utils/index.d.ts +0 -56
- package/dist/test-utils/index.d.ts.map +0 -1
- package/dist/test-utils/index.js +0 -67
- package/dist/test-utils/index.js.map +0 -1
- package/dist/test-utils/process/reserve-port.d.ts +0 -20
- package/dist/test-utils/process/reserve-port.d.ts.map +0 -1
- package/dist/test-utils/process/reserve-port.js +0 -41
- package/dist/test-utils/process/reserve-port.js.map +0 -1
- package/dist/test-utils/standalone-provisioning.d.ts +0 -22
- package/dist/test-utils/standalone-provisioning.d.ts.map +0 -1
- package/dist/test-utils/standalone-provisioning.js +0 -17
- package/dist/test-utils/standalone-provisioning.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type canaries for the public notification subscription signatures.
|
|
3
|
-
*
|
|
4
|
-
* Runtime behavior is covered by `filter-equivalence.test.ts` and
|
|
5
|
-
* `snapshot-semantics.test.ts`; this file pins payload narrowing, error
|
|
6
|
-
* channels, and the absence of leaked Effect requirements.
|
|
7
|
-
*/
|
|
8
|
-
import { type Effect, Stream } from "effect";
|
|
9
|
-
import type { NotConnectedError, NotificationDelivery, NotificationParamsOf, NotificationSubscriberRegistry } from "@moltzap/protocol/rpc";
|
|
10
|
-
import type { AnyNotificationDefinition } from "@moltzap/protocol/socket/catalog";
|
|
11
|
-
import { messageReceivedNotificationDefinition } from "@moltzap/protocol/message";
|
|
12
|
-
import { subscribe, type subscribeAll } from "../stream.js";
|
|
13
|
-
type Equal<Left, Right> = [Left, Right] extends [Right, Left] ? true : false;
|
|
14
|
-
type Expect<Value extends true> = Value;
|
|
15
|
-
type ReceivedParams = NotificationParamsOf<typeof messageReceivedNotificationDefinition>;
|
|
16
|
-
type GroupReceived = ReceivedParams & {
|
|
17
|
-
readonly message: {
|
|
18
|
-
readonly conversationId: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
type GroupPredicate = (params: ReceivedParams) => params is GroupReceived;
|
|
22
|
-
/**
|
|
23
|
-
* Exercise the type-guard overload with concrete protocol types.
|
|
24
|
-
* @param registry Notification registry supplied by a connected client.
|
|
25
|
-
* @param isGroup Predicate that narrows received messages to group deliveries.
|
|
26
|
-
* @returns A stream narrowed to group message deliveries.
|
|
27
|
-
*/
|
|
28
|
-
export declare function subscribeNarrowedCanary(registry: NotificationSubscriberRegistry<NotConnectedError, AnyNotificationDefinition>, isGroup: GroupPredicate): Stream.Stream<GroupReceived, NotConnectedError, never>;
|
|
29
|
-
type NarrowedStream = ReturnType<typeof subscribeNarrowedCanary>;
|
|
30
|
-
/**
|
|
31
|
-
* Exercise Stream consumption against the real subscription return type.
|
|
32
|
-
* @param stream Subscription stream to consume.
|
|
33
|
-
* @param handler Handler for each decoded notification.
|
|
34
|
-
* @returns The Effect produced by consuming the stream.
|
|
35
|
-
*/
|
|
36
|
-
export declare function runSubscriptionCanary(stream: ReturnType<typeof subscribe<AnyNotificationDefinition>>, handler: (notification: NotificationParamsOf<AnyNotificationDefinition>) => Effect.Effect<void>): Effect.Effect<void, NotConnectedError, never>;
|
|
37
|
-
type SubscribeStreamShape = Expect<Equal<ReturnType<typeof subscribe<AnyNotificationDefinition>>, Stream.Stream<NotificationParamsOf<AnyNotificationDefinition>, NotConnectedError>>>;
|
|
38
|
-
type NarrowedOverloadResolves = Expect<Equal<NarrowedStream, Stream.Stream<GroupReceived, NotConnectedError>>>;
|
|
39
|
-
type NarrowedElementIsExact = Expect<Equal<Stream.Stream.Success<NarrowedStream>, GroupReceived>>;
|
|
40
|
-
type SubscribeAllStreamShape = Expect<Equal<ReturnType<typeof subscribeAll>, Stream.Stream<NotificationDelivery<AnyNotificationDefinition>, NotConnectedError>>>;
|
|
41
|
-
type RunForEachHasNoLeakedRequirements = Expect<Equal<Effect.Effect.Context<ReturnType<typeof runSubscriptionCanary>>, never>>;
|
|
42
|
-
type TypedErrorChannelIsExact = Expect<Equal<Stream.Stream.Error<ReturnType<typeof subscribe<AnyNotificationDefinition>>>, NotConnectedError>>;
|
|
43
|
-
/** Compile-time assertions for notification subscription contracts. */
|
|
44
|
-
export type NotificationSubscriptionCanaries = [
|
|
45
|
-
SubscribeStreamShape,
|
|
46
|
-
NarrowedOverloadResolves,
|
|
47
|
-
NarrowedElementIsExact,
|
|
48
|
-
SubscribeAllStreamShape,
|
|
49
|
-
RunForEachHasNoLeakedRequirements,
|
|
50
|
-
TypedErrorChannelIsExact
|
|
51
|
-
];
|
|
52
|
-
export {};
|
|
53
|
-
//# sourceMappingURL=subscribe-signatures.types-check.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscribe-signatures.types-check.d.ts","sourceRoot":"","sources":["../../../src/notification/__tests__/subscribe-signatures.types-check.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5D,KAAK,KAAK,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAC7E,KAAK,MAAM,CAAC,KAAK,SAAS,IAAI,IAAI,KAAK,CAAC;AAExC,KAAK,cAAc,GAAG,oBAAoB,CACxC,OAAO,qC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B,CAAC,EAC/C,iBAAiB,CAClB,CACF,CACF,CAAC;AACF,KAAK,iCAAiC,GAAG,MAAM,CAC7C,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,EAAE,KAAK,CAAC,CAC9E,CAAC;AACF,KAAK,wBAAwB,GAAG,MAAM,CACpC,KAAK,CACH,MAAM,CAAC,MAAM,CAAC,KAAK,CACjB,UAAU,CAAC,OAAO,SAAS,CAAC,yBAAyB,CAAC,CAAC,CACxD,EACD,iBAAiB,CAClB,CACF,CAAC;AAEF,uEAAuE;AACvE,MAAM,MAAM,gCAAgC,GAAG;IAC7C,oBAAoB;IACpB,wBAAwB;IACxB,sBAAsB;IACtB,uBAAuB;IACvB,iCAAiC;IACjC,wBAAwB;CACzB,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type canaries for the public notification subscription signatures.
|
|
3
|
-
*
|
|
4
|
-
* Runtime behavior is covered by `filter-equivalence.test.ts` and
|
|
5
|
-
* `snapshot-semantics.test.ts`; this file pins payload narrowing, error
|
|
6
|
-
* channels, and the absence of leaked Effect requirements.
|
|
7
|
-
*/
|
|
8
|
-
import { Stream } from "effect";
|
|
9
|
-
import { messageReceivedNotificationDefinition } from "@moltzap/protocol/message";
|
|
10
|
-
import { subscribe } from "../stream.js";
|
|
11
|
-
/**
|
|
12
|
-
* Exercise the type-guard overload with concrete protocol types.
|
|
13
|
-
* @param registry Notification registry supplied by a connected client.
|
|
14
|
-
* @param isGroup Predicate that narrows received messages to group deliveries.
|
|
15
|
-
* @returns A stream narrowed to group message deliveries.
|
|
16
|
-
*/
|
|
17
|
-
export function subscribeNarrowedCanary(registry, isGroup) {
|
|
18
|
-
return subscribe(registry, messageReceivedNotificationDefinition, isGroup);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Exercise Stream consumption against the real subscription return type.
|
|
22
|
-
* @param stream Subscription stream to consume.
|
|
23
|
-
* @param handler Handler for each decoded notification.
|
|
24
|
-
* @returns The Effect produced by consuming the stream.
|
|
25
|
-
*/
|
|
26
|
-
export function runSubscriptionCanary(stream, handler) {
|
|
27
|
-
return Stream.runForEach(stream, handler);
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=subscribe-signatures.types-check.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscribe-signatures.types-check.js","sourceRoot":"","sources":["../../../src/notification/__tests__/subscribe-signatures.types-check.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAe,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQ7C,OAAO,EAAE,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,SAAS,EAAqB,MAAM,cAAc,CAAC;AAa5D;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,QAGC,EACD,OAAuB;IAEvB,OAAO,SAAS,CAAC,QAAQ,EAAE,qCAAqC,EAAE,OAAO,CAAC,CAAC;AAC7E,CAAC;AAID;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAA+D,EAC/D,OAEwB;IAExB,OAAO,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
declare const NotificationTimeoutError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2
|
-
readonly _tag: "NotificationTimeoutError";
|
|
3
|
-
} & Readonly<A>;
|
|
4
|
-
/** Reports notification timeout failures. */
|
|
5
|
-
export declare class NotificationTimeoutError extends NotificationTimeoutError_base<{
|
|
6
|
-
readonly definition: string;
|
|
7
|
-
readonly durationMs: number;
|
|
8
|
-
}> {
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Why a notification Stream terminated without a `NotificationTimeoutError`:
|
|
12
|
-
*
|
|
13
|
-
* - `"client-closed"` — `MoltZapWsClient.close()` tore the transport down
|
|
14
|
-
* (the registry's `closeAll` fired each subscription's `onClose`).
|
|
15
|
-
* - `"stream-completed"` — the Stream source completed normally with no
|
|
16
|
-
* further frames pending (graceful end-of-stream, not an error condition).
|
|
17
|
-
* - `"transport-disconnected"` — the transport dropped. The current
|
|
18
|
-
* subscription is terminal even if its owner later starts a new connection.
|
|
19
|
-
*/
|
|
20
|
-
export type StreamCloseReason = "client-closed" | "stream-completed" | "transport-disconnected";
|
|
21
|
-
declare const StreamClosedError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
22
|
-
readonly _tag: "StreamClosedError";
|
|
23
|
-
} & Readonly<A>;
|
|
24
|
-
/** Reports stream closed failures. */
|
|
25
|
-
export declare class StreamClosedError extends StreamClosedError_base<{
|
|
26
|
-
readonly definition: string;
|
|
27
|
-
readonly reason: StreamCloseReason;
|
|
28
|
-
}> {
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Union of all notification consumer error tags. Catch sites use
|
|
32
|
-
* `Effect.catchTags({ NotificationTimeoutError: ..., StreamClosedError: ... })`
|
|
33
|
-
* for exhaustive handling, or accept this union in their typed error channel.
|
|
34
|
-
*
|
|
35
|
-
* NOT a class — Effect's `Data.TaggedError` classes do not inherit from
|
|
36
|
-
* a shared `Data.TaggedError` base in a way that preserves `_tag`
|
|
37
|
-
* discrimination. The union is the canonical shape.
|
|
38
|
-
*/
|
|
39
|
-
export type NotificationConsumerError = NotificationTimeoutError | StreamClosedError;
|
|
40
|
-
export {};
|
|
41
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/notification/errors.ts"],"names":[],"mappings":";;;AAkBA,6CAA6C;AAC7C,qBAAa,wBAAyB,SAAQ,8BAE5C;IACA,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;CAAG;AAEL;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GACzB,eAAe,GACf,kBAAkB,GAClB,wBAAwB,CAAC;;;;AAE7B,sCAAsC;AACtC,qBAAa,iBAAkB,SAAQ,uBAAsC;IAC3E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;CACpC,CAAC;CAAG;AAEL;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,GACjC,wBAAwB,GACxB,iBAAiB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tagged errors for the notification consumption surface.
|
|
3
|
-
*
|
|
4
|
-
* `Data.TaggedError` classes do NOT compose via class inheritance —
|
|
5
|
-
* extending one tagged class from another produces broken `_tag`
|
|
6
|
-
* discrimination at runtime. The shared abstraction is therefore a TYPE
|
|
7
|
-
* UNION (`NotificationConsumerError`) not a base class. Catch sites that
|
|
8
|
-
* want to handle "any notification consumer error" pattern-match on the
|
|
9
|
-
* union.
|
|
10
|
-
*
|
|
11
|
-
* `NotificationTimeoutError` carries the timeout duration so callers can
|
|
12
|
-
* log + retry with sane backoff. `StreamClosedError` fires when the
|
|
13
|
-
* consumer's Stream completes empty (e.g. The client transitioned to
|
|
14
|
-
* terminal closed state before a notification arrived); its `reason`
|
|
15
|
-
* discriminant names WHICH close-state ended the Stream.
|
|
16
|
-
*/
|
|
17
|
-
import { Data } from "effect";
|
|
18
|
-
/** Reports notification timeout failures. */
|
|
19
|
-
export class NotificationTimeoutError extends Data.TaggedError("NotificationTimeoutError") {
|
|
20
|
-
}
|
|
21
|
-
/** Reports stream closed failures. */
|
|
22
|
-
export class StreamClosedError extends Data.TaggedError("StreamClosedError") {
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/notification/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,6CAA6C;AAC7C,MAAM,OAAO,wBAAyB,SAAQ,IAAI,CAAC,WAAW,CAC5D,0BAA0B,CAI1B;CAAG;AAiBL,sCAAsC;AACtC,MAAM,OAAO,iBAAkB,SAAQ,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAGzE;CAAG"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Notification consumer helpers for `@moltzap/client/notification`.
|
|
3
|
-
*/
|
|
4
|
-
/** Re-exports the public API from `./errors.js`. */
|
|
5
|
-
export { NotificationTimeoutError, StreamClosedError as NotificationStreamClosedError, type StreamCloseReason, type NotificationConsumerError, } from "./errors.js";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notification/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,oDAAoD;AACpD,OAAO,EACL,wBAAwB,EACxB,iBAAiB,IAAI,6BAA6B,EAClD,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,GAC/B,MAAM,aAAa,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Notification consumer helpers for `@moltzap/client/notification`.
|
|
3
|
-
*/
|
|
4
|
-
/** Re-exports the public API from `./errors.js`. */
|
|
5
|
-
export { NotificationTimeoutError, StreamClosedError as NotificationStreamClosedError, } from "./errors.js";
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notification/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,oDAAoD;AACpD,OAAO,EACL,wBAAwB,EACxB,iBAAiB,IAAI,6BAA6B,GAGnD,MAAM,aAAa,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stream-returning constructors for `MoltZapAgentClient.subscribe` and
|
|
3
|
-
* `MoltZapAgentClient.subscribeAll`.
|
|
4
|
-
*
|
|
5
|
-
* `Stream.async` cancellation drives the registry-stored `unregister`
|
|
6
|
-
* finalizer. The registry's `dispatch` snapshots `subsRef` at iteration
|
|
7
|
-
* start, so the snapshot semantic holds by Ref atomicity without a
|
|
8
|
-
* per-sub cancelled-flag check.
|
|
9
|
-
*
|
|
10
|
-
* Stream construction uses `Stream.async<NotificationParamsOf<D>,
|
|
11
|
-
* NotConnectedError>` with the registry storing typed callback references — NOT
|
|
12
|
-
* `Queue` of `Take` items combined with `Stream.fromQueue`/`Stream.flattenTake`,
|
|
13
|
-
* which is racy under `Queue.offer(Take.fail); Queue.shutdown` and does not
|
|
14
|
-
* reliably propagate the typed failure to the consumer.
|
|
15
|
-
*
|
|
16
|
-
* Stream lifecycle:
|
|
17
|
-
* 1. `subscribe(def)` returns a Stream value. Pure; no I/O, no scope.
|
|
18
|
-
* 2. Materialization opens the `Stream.async` source: `registry.register`
|
|
19
|
-
* runs synchronously, callbacks are installed; consumer pulls suspend
|
|
20
|
-
* until `emit.single` fires from dispatch.
|
|
21
|
-
* 3. Pre-`connect()` consumer pulls suspend inside `Stream.async`'s
|
|
22
|
-
* internal queue. No `NotConnectedError` until terminal close.
|
|
23
|
-
* 4. A disconnect leaves registry callbacks intact; `subsRef` survives
|
|
24
|
-
* until the caller explicitly connects again. **Disconnected-window
|
|
25
|
-
* frame loss:** any server-originated notification frame that the
|
|
26
|
-
* transport drops while disconnected (between the socket dying and
|
|
27
|
-
* the next `hello` completing) is NOT replayed — the Stream API
|
|
28
|
-
* has no buffering or gap-fill across the disconnected window, so such
|
|
29
|
-
* frames are silently lost to the consumer. Subscriptions resume
|
|
30
|
-
* receiving frames after the next explicit connect; there is no error or
|
|
31
|
-
* sentinel marking the gap.
|
|
32
|
-
* 5. `MoltZapAgentClient.close` invokes `SubscriberRegistry.closeAll`, which
|
|
33
|
-
* calls each live `sub.onClose(new NotConnectedError(...))`. Each
|
|
34
|
-
* `Stream.async`-backed consumer fails with `NotConnectedError`
|
|
35
|
-
* via `emit.fail` deterministically (no Queue/shutdown race).
|
|
36
|
-
*/
|
|
37
|
-
import type { Stream } from "effect";
|
|
38
|
-
import { type NotConnectedError, type NotificationDelivery, type NotificationSubscriberRegistry, type NotificationParamsOf } from "@moltzap/protocol/rpc";
|
|
39
|
-
import type { AnyNotificationDefinition } from "@moltzap/protocol/socket/catalog";
|
|
40
|
-
type ClientNotificationDelivery = NotificationDelivery<AnyNotificationDefinition>;
|
|
41
|
-
/**
|
|
42
|
-
* Typed-payload subscribe. Returns a Stream of `NotificationParamsOf<D>`
|
|
43
|
-
* whose error channel is `NotConnectedError` and whose requirement set is
|
|
44
|
-
* `never` (the registry handle is bound at materialization time inside
|
|
45
|
-
* `Stream.async`'s register callback, so neither Scope nor any other
|
|
46
|
-
* requirement leaks to the consumer).
|
|
47
|
-
*
|
|
48
|
-
* `refinement` is a typed predicate over the definition's params. When the
|
|
49
|
-
* type-guard overload form is used, the Stream's payload narrows to `R`.
|
|
50
|
-
* @param registry Value supplied to the operation.
|
|
51
|
-
* @param definition Protocol definition to process.
|
|
52
|
-
* @param refinement Value supplied to the operation.
|
|
53
|
-
* @returns The subscribe result.
|
|
54
|
-
*/
|
|
55
|
-
export declare function subscribe<D extends AnyNotificationDefinition, R extends NotificationParamsOf<D>>(registry: NotificationSubscriberRegistry<NotConnectedError, AnyNotificationDefinition>, definition: D, refinement: (params: NotificationParamsOf<D>) => params is R): Stream.Stream<R, NotConnectedError>;
|
|
56
|
-
export declare function subscribe<D extends AnyNotificationDefinition>(registry: NotificationSubscriberRegistry<NotConnectedError, AnyNotificationDefinition>, definition: D, refinement?: (params: NotificationParamsOf<D>) => boolean): Stream.Stream<NotificationParamsOf<D>, NotConnectedError>;
|
|
57
|
-
/**
|
|
58
|
-
* Broad-union escape hatch. The only intended in-tree consumer is
|
|
59
|
-
* `MoltZapService.connect`, which uses this to fan every inbound
|
|
60
|
-
* notification through `MoltZapService.handleNotification`. Payload
|
|
61
|
-
* narrowing is intentionally lost; callers wanting typed payloads use
|
|
62
|
-
* `subscribe(def, refinement?)`.
|
|
63
|
-
*
|
|
64
|
-
* The registry has no "match all" subscription shape (`subscribe<D>` is
|
|
65
|
-
* per-definition). `subscribeAll` instead registers via
|
|
66
|
-
* `SubscriberRegistry.registerAll`, whose callbacks the dispatcher hits
|
|
67
|
-
* for every inbound frame regardless of definition. Same lifecycle as
|
|
68
|
-
* `register(def, …)`, no definition match.
|
|
69
|
-
* @param registry Value supplied to the operation.
|
|
70
|
-
* @param refinement Value supplied to the operation.
|
|
71
|
-
* @returns The subscribe all result.
|
|
72
|
-
*/
|
|
73
|
-
export declare function subscribeAll(registry: NotificationSubscriberRegistry<NotConnectedError, AnyNotificationDefinition>, refinement?: (definition: AnyNotificationDefinition, params: NotificationParamsOf<AnyNotificationDefinition>) => boolean): Stream.Stream<ClientNotificationDelivery, NotConnectedError>;
|
|
74
|
-
export {};
|
|
75
|
-
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/notification/stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAGzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAElF,KAAK,0BAA0B,GAC7B,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;AAElD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CACvB,CAAC,SAAS,yBAAyB,EACnC,CAAC,SAAS,oBAAoB,CAAC,CAAC,CAAC,EAEjC,QAAQ,EAAE,8BAA8B,CACtC,iBAAiB,EACjB,yBAAyB,CAC1B,EACD,UAAU,EAAE,CAAC,EACb,UAAU,EAAE,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,CAAC,GAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC;AACvC,wBAAgB,SAAS,CAAC,CAAC,SAAS,yBAAyB,EAC3D,QAAQ,EAAE,8BAA8B,CACtC,iBAAiB,EACjB,yBAAyB,CAC1B,EACD,UAAU,EAAE,CAAC,EACb,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,OAAO,GACxD,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAe7D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,8BAA8B,CACtC,iBAAiB,EACjB,yBAAyB,CAC1B,EACD,UAAU,CAAC,EAAE,CACX,UAAU,EAAE,yBAAyB,EACrC,MAAM,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,KACpD,OAAO,GACX,MAAM,CAAC,MAAM,CAAC,0BAA0B,EAAE,iBAAiB,CAAC,CAO9D"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { notificationSubscribe, notificationSubscribeAll, } from "@moltzap/protocol/rpc";
|
|
2
|
-
export function subscribe(registry, definition, refinement) {
|
|
3
|
-
if (refinement === undefined) {
|
|
4
|
-
return notificationSubscribe(registry, definition);
|
|
5
|
-
}
|
|
6
|
-
return notificationSubscribe(registry, definition, refinement);
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Broad-union escape hatch. The only intended in-tree consumer is
|
|
10
|
-
* `MoltZapService.connect`, which uses this to fan every inbound
|
|
11
|
-
* notification through `MoltZapService.handleNotification`. Payload
|
|
12
|
-
* narrowing is intentionally lost; callers wanting typed payloads use
|
|
13
|
-
* `subscribe(def, refinement?)`.
|
|
14
|
-
*
|
|
15
|
-
* The registry has no "match all" subscription shape (`subscribe<D>` is
|
|
16
|
-
* per-definition). `subscribeAll` instead registers via
|
|
17
|
-
* `SubscriberRegistry.registerAll`, whose callbacks the dispatcher hits
|
|
18
|
-
* for every inbound frame regardless of definition. Same lifecycle as
|
|
19
|
-
* `register(def, …)`, no definition match.
|
|
20
|
-
* @param registry Value supplied to the operation.
|
|
21
|
-
* @param refinement Value supplied to the operation.
|
|
22
|
-
* @returns The subscribe all result.
|
|
23
|
-
*/
|
|
24
|
-
export function subscribeAll(registry, refinement) {
|
|
25
|
-
if (refinement === undefined) {
|
|
26
|
-
return notificationSubscribeAll(registry);
|
|
27
|
-
}
|
|
28
|
-
return notificationSubscribeAll(registry, (delivery) => refinement(delivery.definition, delivery.params));
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=stream.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/notification/stream.ts"],"names":[],"mappings":"AAqCA,OAAO,EAGL,qBAAqB,EACrB,wBAAwB,GAGzB,MAAM,uBAAuB,CAAC;AAuC/B,MAAM,UAAU,SAAS,CACvB,QAGC,EACD,UAAa,EACb,UAAyD;IAEzD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,qBAAqB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,qBAAqB,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAC1B,QAGC,EACD,UAGY;IAEZ,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,wBAAwB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CACrD,UAAU,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CACjD,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { NotificationDelivery } from "@moltzap/protocol/rpc";
|
|
2
|
-
import type { AnyNotificationDefinition } from "@moltzap/protocol/socket/catalog";
|
|
3
|
-
/**
|
|
4
|
-
* Builds the stable diagnostic projection for one inbound notification.
|
|
5
|
-
* @param notification Notification delivered by the active socket client.
|
|
6
|
-
* @param agentId Agent receiving the notification when identity is available.
|
|
7
|
-
* @returns A JSON-safe trace record.
|
|
8
|
-
*/
|
|
9
|
-
export declare function notificationTraceRecord(notification: NotificationDelivery<AnyNotificationDefinition>, agentId?: string): Record<string, unknown>;
|
|
10
|
-
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/notification/trace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AA8BlF;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,EAC7D,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkBzB"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const isPlainRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2
|
-
const recordOrEmpty = (value) => isPlainRecord(value) ? value : {};
|
|
3
|
-
const recordProperty = (record, key) => {
|
|
4
|
-
const value = record[key];
|
|
5
|
-
return isPlainRecord(value) ? value : undefined;
|
|
6
|
-
};
|
|
7
|
-
const stringProperty = (record, key) => {
|
|
8
|
-
const value = record[key];
|
|
9
|
-
return typeof value === "string" ? value : undefined;
|
|
10
|
-
};
|
|
11
|
-
const traceConversationId = (conversation, fallback) => conversation === undefined ? fallback : (conversation.id ?? fallback);
|
|
12
|
-
/**
|
|
13
|
-
* Builds the stable diagnostic projection for one inbound notification.
|
|
14
|
-
* @param notification Notification delivered by the active socket client.
|
|
15
|
-
* @param agentId Agent receiving the notification when identity is available.
|
|
16
|
-
* @returns A JSON-safe trace record.
|
|
17
|
-
*/
|
|
18
|
-
export function notificationTraceRecord(notification, agentId) {
|
|
19
|
-
const params = recordOrEmpty(notification.params);
|
|
20
|
-
const message = recordProperty(params, "message");
|
|
21
|
-
const conversation = recordProperty(params, "conversation");
|
|
22
|
-
const notificationConversationId = stringProperty(params, "conversationId");
|
|
23
|
-
return {
|
|
24
|
-
ts: new Date().toISOString(),
|
|
25
|
-
agentId: agentId ?? "unknown",
|
|
26
|
-
notification: notification.method,
|
|
27
|
-
messageId: message?.id,
|
|
28
|
-
messageConversationId: message?.conversationId,
|
|
29
|
-
messageSenderId: message?.senderId,
|
|
30
|
-
conversationId: traceConversationId(conversation, notificationConversationId),
|
|
31
|
-
conversationName: conversation?.name,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=trace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../src/notification/trace.ts"],"names":[],"mappings":"AAGA,MAAM,aAAa,GAAG,CAAC,KAAc,EAAoC,EAAE,CACzE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,I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AAE;QAC5B,OAAO,EAAE,OAAO,IAAI,SAAS;QAC7B,YAAY,EAAE,YAAY,CAAC,MAAM;QACjC,SAAS,EAAE,OAAO,EAAE,EAAE;QACtB,qBAAqB,EAAE,OAAO,EAAE,cAAc;QAC9C,eAAe,EAAE,OAAO,EAAE,QAAQ;QAClC,cAAc,EAAE,mBAAmB,CACjC,YAAY,EACZ,0BAA0B,CAC3B;QACD,gBAAgB,EAAE,YAAY,EAAE,IAAI;KACrC,CAAC;AACJ,CAAC"}
|
package/dist/pagination.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/** @file Provides a generic drainer for cursor-paginated list RPCs. */
|
|
2
|
-
import type { ClientDefinitionPayload, ClientDefinitionSuccess, ClientRpcDefinition } from "@moltzap/protocol/socket";
|
|
3
|
-
import { Effect } from "effect";
|
|
4
|
-
declare const NonAdvancingCursorError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
5
|
-
readonly _tag: "NonAdvancingCursorError";
|
|
6
|
-
} & Readonly<A>;
|
|
7
|
-
/**
|
|
8
|
-
* A server that returns a non-advancing `nextCursor` (one already seen)
|
|
9
|
-
* would loop the drain forever; fail typed so the caller's `catchAll`
|
|
10
|
-
* can degrade gracefully instead of hanging. This is a cycle guard, NOT
|
|
11
|
-
* a page cap — a well-behaved server never trips it.
|
|
12
|
-
*/
|
|
13
|
-
export declare class NonAdvancingCursorError extends NonAdvancingCursorError_base<{
|
|
14
|
-
readonly method: string;
|
|
15
|
-
}> {
|
|
16
|
-
get message(): string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* The `sendRpc` shape every drain consumer provides: send one list-RPC
|
|
20
|
-
* page, decoding its typed result. Parameterized over the sender's error
|
|
21
|
-
* channel `E` so the helper stays decoupled from any one client's error
|
|
22
|
-
* union.
|
|
23
|
-
*/
|
|
24
|
-
type ClientDescriptor = ClientRpcDefinition & {
|
|
25
|
-
readonly name: string;
|
|
26
|
-
};
|
|
27
|
-
/** Represents send rpc fn values. */
|
|
28
|
-
export type SendRpcFn<E, Definition extends ClientDescriptor> = (definition: Definition, params: ClientDefinitionPayload<Definition>) => Effect.Effect<ClientDefinitionSuccess<Definition>, E>;
|
|
29
|
-
/** Configures drain paginated list. */
|
|
30
|
-
export interface DrainPaginatedListOptions<E, D extends ClientDescriptor, Row, Cursor extends string> {
|
|
31
|
-
readonly sendRpc: SendRpcFn<E, D>;
|
|
32
|
-
readonly definition: D;
|
|
33
|
-
readonly paramsForCursor: (cursor?: Cursor) => ClientDefinitionPayload<D>;
|
|
34
|
-
readonly rowsForPage: (page: ClientDefinitionSuccess<D>) => readonly Row[];
|
|
35
|
-
readonly nextCursorForPage: (page: ClientDefinitionSuccess<D>) => Cursor | undefined;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Drain every page of a cursor-paginated list RPC, echoing the opaque
|
|
39
|
-
* `nextCursor` back as the next page's `cursor`. Fails with
|
|
40
|
-
* {@link NonAdvancingCursorError} if the server returns a cursor it already
|
|
41
|
-
* emitted (cycle guard).
|
|
42
|
-
* @param root0 Value supplied to the operation.
|
|
43
|
-
* @param root0.sendRpc Value supplied to the operation.
|
|
44
|
-
* @param root0.definition Value supplied to the operation.
|
|
45
|
-
* @param root0.paramsForCursor Value supplied to the operation.
|
|
46
|
-
* @param root0.rowsForPage Value supplied to the operation.
|
|
47
|
-
* @param root0.nextCursorForPage Value supplied to the operation.
|
|
48
|
-
* @returns The drain paginated list result.
|
|
49
|
-
*/
|
|
50
|
-
export declare function drainPaginatedList<E, D extends ClientDescriptor, Row, Cursor extends string>({ sendRpc, definition, paramsForCursor, rowsForPage, nextCursorForPage, }: DrainPaginatedListOptions<E, D, Row, Cursor>): Effect.Effect<readonly Row[], E | NonAdvancingCursorError>;
|
|
51
|
-
export {};
|
|
52
|
-
//# sourceMappingURL=pagination.d.ts.map
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C,iBAAiB,EAAE,CAC1B,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC,KAC7B,MAAM,GAAG,SAAS,CAAC;CACzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,CAAC,EACD,CAAC,SAAS,gBAAgB,EAC1B,GAAG,EACH,MAAM,SAAS,MAAM,EACrB,EACA,OAAO,EACP,UAAU,EACV,eAAe,EACf,WAAW,EACX,iBAAiB,GAClB,EAAE,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAC7D,SAAS,GAAG,EAAE,EACd,CAAC,GAAG,uBAAuB,CAC5B,CAwBA"}
|
package/dist/pagination.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Data, Effect } from "effect";
|
|
2
|
-
/**
|
|
3
|
-
* A server that returns a non-advancing `nextCursor` (one already seen)
|
|
4
|
-
* would loop the drain forever; fail typed so the caller's `catchAll`
|
|
5
|
-
* can degrade gracefully instead of hanging. This is a cycle guard, NOT
|
|
6
|
-
* a page cap — a well-behaved server never trips it.
|
|
7
|
-
*/
|
|
8
|
-
export class NonAdvancingCursorError extends Data.TaggedError("NonAdvancingCursorError") {
|
|
9
|
-
get message() {
|
|
10
|
-
return `Pagination cursor for ${this.method} did not advance — refusing to loop`;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Drain every page of a cursor-paginated list RPC, echoing the opaque
|
|
15
|
-
* `nextCursor` back as the next page's `cursor`. Fails with
|
|
16
|
-
* {@link NonAdvancingCursorError} if the server returns a cursor it already
|
|
17
|
-
* emitted (cycle guard).
|
|
18
|
-
* @param root0 Value supplied to the operation.
|
|
19
|
-
* @param root0.sendRpc Value supplied to the operation.
|
|
20
|
-
* @param root0.definition Value supplied to the operation.
|
|
21
|
-
* @param root0.paramsForCursor Value supplied to the operation.
|
|
22
|
-
* @param root0.rowsForPage Value supplied to the operation.
|
|
23
|
-
* @param root0.nextCursorForPage Value supplied to the operation.
|
|
24
|
-
* @returns The drain paginated list result.
|
|
25
|
-
*/
|
|
26
|
-
export function drainPaginatedList({ sendRpc, definition, paramsForCursor, rowsForPage, nextCursorForPage, }) {
|
|
27
|
-
return Effect.gen(function* () {
|
|
28
|
-
const acc = [];
|
|
29
|
-
// Cycle guard, not a page cap: a repeated cursor means the server is
|
|
30
|
-
// not advancing, so fail typed rather than loop forever.
|
|
31
|
-
const seenCursors = new Set();
|
|
32
|
-
let cursor;
|
|
33
|
-
let more = true;
|
|
34
|
-
while (more) {
|
|
35
|
-
const params = paramsForCursor(cursor);
|
|
36
|
-
const page = yield* sendRpc(definition, params);
|
|
37
|
-
acc.push(...rowsForPage(page));
|
|
38
|
-
const nextCursor = nextCursorForPage(page);
|
|
39
|
-
if (nextCursor !== undefined && seenCursors.has(nextCursor)) {
|
|
40
|
-
return yield* new NonAdvancingCursorError({ method: definition.name });
|
|
41
|
-
}
|
|
42
|
-
if (nextCursor !== undefined) {
|
|
43
|
-
seenCursors.add(nextCursor);
|
|
44
|
-
}
|
|
45
|
-
cursor = nextCursor;
|
|
46
|
-
more = nextCursor !== undefined;
|
|
47
|
-
}
|
|
48
|
-
return acc;
|
|
49
|
-
}).pipe(Effect.withSpan("drainPaginatedList"));
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=pagination.js.map
|
package/dist/pagination.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,OAAO,uBAAwB,SAAQ,IAAI,CAAC,WAAW,CAC3D,yBAAyB,CAGzB;IACA,IAAa,OAAO;QAClB,OAAO,yBAAyB,IAAI,CAAC,MAAM,qCAAqC,CAAC;IACnF,CAAC;CACF;AAgCD;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/presentation/index.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,OAAO,EACL,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/presentation/index.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,OAAO,EACL,iBAAiB,GAIlB,MAAM,YAAY,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { ConversationCreatedNotification } from "@moltzap/protocol/conversation";
|
|
2
|
-
import type { Message } from "@moltzap/protocol/message";
|
|
3
|
-
import { Effect, HashMap } from "effect";
|
|
4
|
-
/** Describes conversation meta. */
|
|
5
|
-
export interface ConversationMeta {
|
|
6
|
-
id: string;
|
|
7
|
-
type: string;
|
|
8
|
-
name?: string;
|
|
9
|
-
participants: string[];
|
|
10
|
-
}
|
|
11
|
-
/** Structured summary of recent activity in one other conversation. */
|
|
12
|
-
export interface CrossConversationEntry {
|
|
13
|
-
conversationId: string;
|
|
14
|
-
conversationName?: string;
|
|
15
|
-
senderName: string;
|
|
16
|
-
text: string;
|
|
17
|
-
minutesAgo: number;
|
|
18
|
-
/** Messages in this summary (capped by maxMessagesPerConv). */
|
|
19
|
-
count: number;
|
|
20
|
-
}
|
|
21
|
-
/** Full message from another conversation, used by peekFullMessages(). */
|
|
22
|
-
export interface CrossConvMessage {
|
|
23
|
-
conversationId: string;
|
|
24
|
-
conversationName?: string;
|
|
25
|
-
senderName: string;
|
|
26
|
-
senderId: string;
|
|
27
|
-
text: string;
|
|
28
|
-
timestamp: string;
|
|
29
|
-
}
|
|
30
|
-
/** Immutable snapshots used while selecting cross-conversation context. */
|
|
31
|
-
export interface CrossConvState {
|
|
32
|
-
readonly messagesMap: HashMap.HashMap<string, readonly Message[]>;
|
|
33
|
-
readonly conversationsMap: HashMap.HashMap<string, ConversationMeta>;
|
|
34
|
-
readonly agentNamesMap: HashMap.HashMap<string, string>;
|
|
35
|
-
readonly viewMarkers: HashMap.HashMap<string, string>;
|
|
36
|
-
}
|
|
37
|
-
type MessageTextRenderer = (message: Message) => string;
|
|
38
|
-
interface AgentName {
|
|
39
|
-
readonly id: string;
|
|
40
|
-
readonly name: string;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Owns the service's in-memory presentation caches and viewer-scoped context
|
|
44
|
-
* markers. Network ingress and presentation rendering remain with the caller.
|
|
45
|
-
*/
|
|
46
|
-
export declare class PresentationState {
|
|
47
|
-
private readonly conversationsRef;
|
|
48
|
-
private readonly messagesRef;
|
|
49
|
-
private readonly agentNamesRef;
|
|
50
|
-
private readonly lastNotifiedRef;
|
|
51
|
-
reset(): Effect.Effect<void>;
|
|
52
|
-
getConversation(convId: string): ConversationMeta | undefined;
|
|
53
|
-
getConversations(): ConversationMeta[];
|
|
54
|
-
storeConversation(notification: ConversationCreatedNotification): void;
|
|
55
|
-
getHistory(convId: string, limit: number): Message[];
|
|
56
|
-
storeMessage(conversationId: string, message: Message): void;
|
|
57
|
-
getAgentName(agentId: string): string | undefined;
|
|
58
|
-
getAgentNames(): HashMap.HashMap<string, string>;
|
|
59
|
-
cacheAgentNames(agents: readonly AgentName[]): Effect.Effect<void>;
|
|
60
|
-
peekContextEntries(currentConvId: string, renderMessageText: MessageTextRenderer, opts: {
|
|
61
|
-
maxConversations?: number;
|
|
62
|
-
maxMessagesPerConv?: number;
|
|
63
|
-
}): {
|
|
64
|
-
entries: CrossConversationEntry[];
|
|
65
|
-
commit: () => void;
|
|
66
|
-
};
|
|
67
|
-
peekFullMessages(currentConvId: string, renderMessageText: MessageTextRenderer): {
|
|
68
|
-
messages: CrossConvMessage[];
|
|
69
|
-
commit: () => void;
|
|
70
|
-
};
|
|
71
|
-
private readCrossConvState;
|
|
72
|
-
private collectContextCandidates;
|
|
73
|
-
private iterNewMessagesByConv;
|
|
74
|
-
private advanceLastNotified;
|
|
75
|
-
}
|
|
76
|
-
export {};
|
|
77
|
-
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/presentation/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAe,MAAM,QAAQ,CAAC;AAqBtD,mCAAmC;AACnC,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,uEAAuE;AACvE,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC;IAClE,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,gBAAgB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