@moltzap/client 2026.811.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-http.d.ts +19 -0
- package/dist/harness-mcp-http.d.ts.map +1 -0
- package/dist/{harness-mcp-server.js → harness-mcp-http.js} +43 -71
- 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 +26 -19
- package/dist/harness-mcp-wire.d.ts.map +1 -1
- package/dist/harness-mcp-wire.js +380 -67
- package/dist/harness-mcp-wire.js.map +1 -1
- package/dist/index.d.ts +4 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -8
- 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 +45 -47
- 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 -13
- package/dist/channel-base/index.js.map +0 -1
- package/dist/channel-core-enrichment.d.ts +0 -14
- package/dist/channel-core-enrichment.d.ts.map +0 -1
- package/dist/channel-core-enrichment.js +0 -143
- 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 -304
- package/dist/channel-core.d.ts.map +0 -1
- package/dist/channel-core.js +0 -363
- package/dist/channel-core.js.map +0 -1
- package/dist/cli/adapters.d.ts +0 -21
- package/dist/cli/adapters.d.ts.map +0 -1
- package/dist/cli/adapters.js +0 -111
- package/dist/cli/adapters.js.map +0 -1
- package/dist/cli/commands/agents.d.ts +0 -11
- package/dist/cli/commands/agents.d.ts.map +0 -1
- package/dist/cli/commands/agents.js +0 -27
- package/dist/cli/commands/agents.js.map +0 -1
- package/dist/cli/commands/conversations.d.ts +0 -18
- package/dist/cli/commands/conversations.d.ts.map +0 -1
- package/dist/cli/commands/conversations.js +0 -33
- package/dist/cli/commands/conversations.js.map +0 -1
- package/dist/cli/commands/messages.d.ts +0 -41
- package/dist/cli/commands/messages.d.ts.map +0 -1
- package/dist/cli/commands/messages.js +0 -39
- package/dist/cli/commands/messages.js.map +0 -1
- package/dist/cli/commands/register.d.ts +0 -46
- package/dist/cli/commands/register.d.ts.map +0 -1
- package/dist/cli/commands/register.js +0 -103
- package/dist/cli/commands/register.js.map +0 -1
- package/dist/cli/commands/send.d.ts +0 -53
- package/dist/cli/commands/send.d.ts.map +0 -1
- package/dist/cli/commands/send.js +0 -57
- package/dist/cli/commands/send.js.map +0 -1
- package/dist/cli/commands/start.d.ts +0 -34
- package/dist/cli/commands/start.d.ts.map +0 -1
- package/dist/cli/commands/start.js +0 -59
- package/dist/cli/commands/start.js.map +0 -1
- package/dist/cli/commands/status.d.ts +0 -7
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js +0 -16
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/test-transport.d.ts +0 -28
- package/dist/cli/commands/test-transport.d.ts.map +0 -1
- package/dist/cli/commands/test-transport.js +0 -40
- package/dist/cli/commands/test-transport.js.map +0 -1
- package/dist/cli/index.d.ts +0 -3
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -105
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/output.d.ts +0 -14
- package/dist/cli/output.d.ts.map +0 -1
- package/dist/cli/output.js +0 -19
- package/dist/cli/output.js.map +0 -1
- package/dist/cli/socket-client.d.ts +0 -28
- package/dist/cli/socket-client.d.ts.map +0 -1
- package/dist/cli/socket-client.js +0 -63
- package/dist/cli/socket-client.js.map +0 -1
- package/dist/cli/transport.d.ts +0 -132
- package/dist/cli/transport.d.ts.map +0 -1
- package/dist/cli/transport.js +0 -127
- package/dist/cli/transport.js.map +0 -1
- package/dist/config.d.ts +0 -33
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -45
- package/dist/config.js.map +0 -1
- package/dist/config.test-utils.d.ts +0 -18
- package/dist/config.test-utils.d.ts.map +0 -1
- package/dist/config.test-utils.js +0 -53
- package/dist/config.test-utils.js.map +0 -1
- package/dist/harness/client-runtime.d.ts +0 -24
- package/dist/harness/client-runtime.d.ts.map +0 -1
- package/dist/harness/client-runtime.js +0 -107
- 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 -149
- package/dist/harness/runtime.d.ts.map +0 -1
- package/dist/harness/runtime.js +0 -68
- package/dist/harness/runtime.js.map +0 -1
- package/dist/harness-client.d.ts +0 -43
- package/dist/harness-client.d.ts.map +0 -1
- package/dist/harness-client.js +0 -21
- package/dist/harness-client.js.map +0 -1
- package/dist/harness-mcp-server.d.ts +0 -19
- package/dist/harness-mcp-server.d.ts.map +0 -1
- package/dist/harness-mcp-server.js.map +0 -1
- package/dist/local-daemon-rpc.d.ts +0 -1170
- package/dist/local-daemon-rpc.d.ts.map +0 -1
- package/dist/local-daemon-rpc.js +0 -178
- package/dist/local-daemon-rpc.js.map +0 -1
- package/dist/local-history.d.ts +0 -75
- package/dist/local-history.d.ts.map +0 -1
- package/dist/local-history.js +0 -82
- package/dist/local-history.js.map +0 -1
- package/dist/local-paths.d.ts +0 -22
- package/dist/local-paths.d.ts.map +0 -1
- package/dist/local-paths.js +0 -33
- package/dist/local-paths.js.map +0 -1
- package/dist/local-socket-server.d.ts +0 -33
- package/dist/local-socket-server.d.ts.map +0 -1
- package/dist/local-socket-server.js +0 -100
- package/dist/local-socket-server.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.d.ts +0 -38
- package/dist/moltzapd.d.ts.map +0 -1
- package/dist/moltzapd.js +0 -78
- 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/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/profile.d.ts +0 -104
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js +0 -163
- package/dist/profile.js.map +0 -1
- package/dist/refs.d.ts +0 -18
- package/dist/refs.d.ts.map +0 -1
- package/dist/refs.js +0 -18
- package/dist/refs.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-helpers.d.ts +0 -55
- package/dist/service-helpers.d.ts.map +0 -1
- package/dist/service-helpers.js +0 -108
- package/dist/service-helpers.js.map +0 -1
- package/dist/service-local-daemon.d.ts +0 -32
- package/dist/service-local-daemon.d.ts.map +0 -1
- package/dist/service-local-daemon.js +0 -153
- package/dist/service-local-daemon.js.map +0 -1
- package/dist/service.d.ts +0 -299
- package/dist/service.d.ts.map +0 -1
- package/dist/service.js +0 -789
- 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 -84
- 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 -54
- package/dist/test-utils/index.d.ts.map +0 -1
- package/dist/test-utils/index.js +0 -65
- package/dist/test-utils/index.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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-daemon-rpc.d.ts","sourceRoot":"","sources":["../src/local-daemon-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAuB,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAKnD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAsC3E,2CAA2C;AAC3C,eAAO,MAAM,UAAU;;UAiBtB,CAAC;AACF,qCAAqC;AACrC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAkB/D,sDAAsD;AACtD,eAAO,MAAM,gBAAgB;;;;;;;YAoC5B,CAAC;AACF,2CAA2C;AAC3C,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E,wDAAwD;AACxD,eAAO,MAAM,mBAAmB;aAC9B,MAAM,EAAE,eAAe;aACvB,OAAO,EAAE,gBAAgB;aACzB,UAAU,EAAE,iBAAiB;aAC7B,YAAY,EAAE,mBAAmB;aACjC,YAAY,EAAE,mBAAmB;aACjC,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,WAAW;CACV,CAAC;AAkBX,QAAA,MAAM,kBAAkB;;;;;EAGtB,CAAC;AACH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A+C;AAC/C,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,YAAY,CACrD,QAAQ,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC,CACtC,CAAC"}
|
package/dist/local-daemon-rpc.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { Rpc, RpcGroup } from "@effect/rpc";
|
|
2
|
-
import { Effect, ParseResult, Schema } from "effect";
|
|
3
|
-
import { agentId, agentsList } from "@moltzap/protocol/identity";
|
|
4
|
-
import { agentCallableMethods } from "@moltzap/protocol/socket/catalog";
|
|
5
|
-
import { conversationId, messageId } from "@moltzap/protocol/conversation";
|
|
6
|
-
import { messagesList } from "@moltzap/protocol/message";
|
|
7
|
-
import { NotConnectedError, RpcTimeoutError } from "@moltzap/protocol/rpc";
|
|
8
|
-
import { historyRequestSchema, historyResponseSchema, } from "./local-history.js";
|
|
9
|
-
const MAX_PAGE_LIMIT = 200;
|
|
10
|
-
const MAX_NAME_LOOKUP_BATCH = 100;
|
|
11
|
-
const UUID_V4_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
12
|
-
const CONVERSATION_TARGET_PREFIX = "conv:";
|
|
13
|
-
const PARTICIPANT_PREFIX = "agent:";
|
|
14
|
-
const emptyPayload = Schema.Struct({});
|
|
15
|
-
const localDaemonStatusResultSchema = Schema.Struct({
|
|
16
|
-
agentId: Schema.optional(agentId),
|
|
17
|
-
connected: Schema.Boolean,
|
|
18
|
-
conversations: Schema.Number.pipe(Schema.int(), Schema.nonNegative()),
|
|
19
|
-
});
|
|
20
|
-
const pageLimit = Schema.Number.pipe(Schema.int(), Schema.greaterThanOrEqualTo(1), Schema.lessThanOrEqualTo(MAX_PAGE_LIMIT));
|
|
21
|
-
const parseStringIssue = (ast, actual, message) => Effect.fail(new ParseResult.Type(ast, actual, message));
|
|
22
|
-
const sendTargetParts = Schema.Struct({
|
|
23
|
-
conversationId: conversationId,
|
|
24
|
-
});
|
|
25
|
-
const SEND_TARGET_EXPECTED = `expected ${CONVERSATION_TARGET_PREFIX}<conversationId>`;
|
|
26
|
-
/** A conversation is the whole address. */
|
|
27
|
-
export const sendTarget = Schema.transformOrFail(Schema.String, sendTargetParts, {
|
|
28
|
-
strict: true,
|
|
29
|
-
decode: (raw, ...[, ast]) => {
|
|
30
|
-
if (!raw.startsWith(CONVERSATION_TARGET_PREFIX)) {
|
|
31
|
-
return parseStringIssue(ast, raw, SEND_TARGET_EXPECTED);
|
|
32
|
-
}
|
|
33
|
-
const rest = raw.slice(CONVERSATION_TARGET_PREFIX.length);
|
|
34
|
-
return rest === "" || rest.includes(":")
|
|
35
|
-
? parseStringIssue(ast, raw, SEND_TARGET_EXPECTED)
|
|
36
|
-
: Effect.succeed({ conversationId: rest });
|
|
37
|
-
},
|
|
38
|
-
encode: (target) => Effect.succeed(`${CONVERSATION_TARGET_PREFIX}${target.conversationId}`),
|
|
39
|
-
});
|
|
40
|
-
const agentName = Schema.String.pipe(Schema.minLength(1), Schema.maxLength(32));
|
|
41
|
-
const startParticipantById = Schema.Struct({
|
|
42
|
-
kind: Schema.Literal("id"),
|
|
43
|
-
id: agentId,
|
|
44
|
-
});
|
|
45
|
-
const startParticipantByName = Schema.Struct({
|
|
46
|
-
kind: Schema.Literal("name"),
|
|
47
|
-
token: Schema.String,
|
|
48
|
-
name: agentName,
|
|
49
|
-
});
|
|
50
|
-
const startParticipantParts = Schema.Union(startParticipantById, startParticipantByName);
|
|
51
|
-
/** Validates and decodes start participant values. */
|
|
52
|
-
export const startParticipant = Schema.transformOrFail(Schema.String, startParticipantParts, {
|
|
53
|
-
strict: true,
|
|
54
|
-
decode: (raw, ...[, ast]) => {
|
|
55
|
-
const expected = `expected ${PARTICIPANT_PREFIX}<name-or-agent-id>`;
|
|
56
|
-
if (!raw.startsWith(PARTICIPANT_PREFIX)) {
|
|
57
|
-
return parseStringIssue(ast, raw, expected);
|
|
58
|
-
}
|
|
59
|
-
const rest = raw.slice(PARTICIPANT_PREFIX.length);
|
|
60
|
-
if (rest.length === 0) {
|
|
61
|
-
return parseStringIssue(ast, raw, expected);
|
|
62
|
-
}
|
|
63
|
-
if (UUID_V4_RE.test(rest)) {
|
|
64
|
-
return Schema.decodeUnknown(agentId)(rest).pipe(Effect.map((id) => ({ kind: "id", id })), Effect.mapError(() => new ParseResult.Type(ast, raw, expected)));
|
|
65
|
-
}
|
|
66
|
-
return Schema.decodeUnknown(agentName)(rest).pipe(Effect.map((name) => ({
|
|
67
|
-
kind: "name",
|
|
68
|
-
token: raw,
|
|
69
|
-
name,
|
|
70
|
-
})), Effect.mapError(() => new ParseResult.Type(ast, raw, expected)));
|
|
71
|
-
},
|
|
72
|
-
encode: (participant) => Effect.succeed(participant.kind === "id"
|
|
73
|
-
? `${PARTICIPANT_PREFIX}${participant.id}`
|
|
74
|
-
: participant.token),
|
|
75
|
-
});
|
|
76
|
-
/** Provides the local daemon commands runtime value. */
|
|
77
|
-
export const localDaemonCommands = {
|
|
78
|
-
status: "daemon/status",
|
|
79
|
-
history: "daemon/history",
|
|
80
|
-
agentsList: "cli/agents/list",
|
|
81
|
-
agentsSearch: "cli/agents/search",
|
|
82
|
-
messagesList: "cli/messages/list",
|
|
83
|
-
send: "cli/send",
|
|
84
|
-
start: "cli/start",
|
|
85
|
-
};
|
|
86
|
-
const agentsListCommandPayload = Schema.Struct({
|
|
87
|
-
limit: Schema.optional(pageLimit),
|
|
88
|
-
});
|
|
89
|
-
const agentsSearchCommandPayload = Schema.Struct({
|
|
90
|
-
names: Schema.Array(agentName).pipe(Schema.minItems(1), Schema.maxItems(MAX_NAME_LOOKUP_BATCH)),
|
|
91
|
-
});
|
|
92
|
-
const messagesListCommandPayload = Schema.Struct({
|
|
93
|
-
conversationId: conversationId,
|
|
94
|
-
limit: Schema.optional(pageLimit),
|
|
95
|
-
});
|
|
96
|
-
const sendCommandPayload = Schema.Struct({
|
|
97
|
-
target: sendTarget,
|
|
98
|
-
message: Schema.String.pipe(Schema.minLength(1)),
|
|
99
|
-
});
|
|
100
|
-
const sendCommandResult = Schema.Struct({
|
|
101
|
-
messageId: messageId,
|
|
102
|
-
});
|
|
103
|
-
const startCommandPayload = Schema.Struct({
|
|
104
|
-
name: Schema.String.pipe(Schema.minLength(1), Schema.maxLength(100)),
|
|
105
|
-
participants: Schema.Array(startParticipant),
|
|
106
|
-
message: Schema.optional(Schema.String),
|
|
107
|
-
});
|
|
108
|
-
const startCommandResult = Schema.Struct({
|
|
109
|
-
conversationId: conversationId,
|
|
110
|
-
sentMessageId: Schema.optional(messageId),
|
|
111
|
-
});
|
|
112
|
-
/** Reports local daemon input failures. */
|
|
113
|
-
export class LocalDaemonInputError extends Schema.TaggedError()("LocalDaemonInputError", { message: Schema.String }) {
|
|
114
|
-
}
|
|
115
|
-
/** Reports start usage failures. */
|
|
116
|
-
export class StartUsageError extends Schema.TaggedError()("StartUsageError", { message: Schema.String }) {
|
|
117
|
-
}
|
|
118
|
-
/** The conversation exists but its first message did not send. */
|
|
119
|
-
export class StartPartialFailure extends Schema.TaggedError()("StartPartialFailure", {
|
|
120
|
-
conversationId: conversationId,
|
|
121
|
-
message: Schema.String,
|
|
122
|
-
}) {
|
|
123
|
-
}
|
|
124
|
-
/** Reports service input failures. */
|
|
125
|
-
export class ServiceInputError extends Schema.TaggedError()("ServiceInputError", { message: Schema.String }) {
|
|
126
|
-
}
|
|
127
|
-
const localDaemonErrorSchema = Schema.Union(LocalDaemonInputError, StartUsageError, StartPartialFailure, ServiceInputError, NotConnectedError, RpcTimeoutError, ...agentCallableMethods.map((definition) => definition.errorSchema));
|
|
128
|
-
/** Validates and decodes is local daemon error values. */
|
|
129
|
-
export const isLocalDaemonError = Schema.is(localDaemonErrorSchema);
|
|
130
|
-
const errorMessage = (error) => error instanceof Error ? error.message : String(error);
|
|
131
|
-
/**
|
|
132
|
-
* Provides the to local daemon error runtime value.
|
|
133
|
-
* @param error Error to inspect.
|
|
134
|
-
* @returns The to local daemon error result.
|
|
135
|
-
*/
|
|
136
|
-
export const toLocalDaemonError = (error) => isLocalDaemonError(error)
|
|
137
|
-
? error
|
|
138
|
-
: new LocalDaemonInputError({ message: errorMessage(error) });
|
|
139
|
-
/** Provides the status command rpc runtime value. */
|
|
140
|
-
export const statusCommandRpc = Rpc.make(localDaemonCommands.status, {
|
|
141
|
-
payload: emptyPayload,
|
|
142
|
-
success: localDaemonStatusResultSchema,
|
|
143
|
-
error: localDaemonErrorSchema,
|
|
144
|
-
});
|
|
145
|
-
/** Provides the messages list command rpc runtime value. */
|
|
146
|
-
export const messagesListCommandRpc = Rpc.make(localDaemonCommands.messagesList, {
|
|
147
|
-
payload: messagesListCommandPayload,
|
|
148
|
-
success: messagesList.resultSchema,
|
|
149
|
-
error: localDaemonErrorSchema,
|
|
150
|
-
});
|
|
151
|
-
/** Provides the send command rpc runtime value. */
|
|
152
|
-
const sendCommandRpc = Rpc.make(localDaemonCommands.send, {
|
|
153
|
-
payload: sendCommandPayload,
|
|
154
|
-
success: sendCommandResult,
|
|
155
|
-
error: localDaemonErrorSchema,
|
|
156
|
-
});
|
|
157
|
-
/** Provides the start command rpc runtime value. */
|
|
158
|
-
export const startCommandRpc = Rpc.make(localDaemonCommands.start, {
|
|
159
|
-
payload: startCommandPayload,
|
|
160
|
-
success: startCommandResult,
|
|
161
|
-
error: localDaemonErrorSchema,
|
|
162
|
-
});
|
|
163
|
-
/** Implements local daemon rpcs. */
|
|
164
|
-
export class LocalDaemonRpcs extends RpcGroup.make(statusCommandRpc, Rpc.make(localDaemonCommands.history, {
|
|
165
|
-
payload: historyRequestSchema(),
|
|
166
|
-
success: historyResponseSchema(),
|
|
167
|
-
error: localDaemonErrorSchema,
|
|
168
|
-
}), Rpc.make(localDaemonCommands.agentsList, {
|
|
169
|
-
payload: agentsListCommandPayload,
|
|
170
|
-
success: agentsList.resultSchema,
|
|
171
|
-
error: localDaemonErrorSchema,
|
|
172
|
-
}), Rpc.make(localDaemonCommands.agentsSearch, {
|
|
173
|
-
payload: agentsSearchCommandPayload,
|
|
174
|
-
success: agentsList.resultSchema,
|
|
175
|
-
error: localDaemonErrorSchema,
|
|
176
|
-
}), messagesListCommandRpc, sendCommandRpc, startCommandRpc) {
|
|
177
|
-
}
|
|
178
|
-
//# sourceMappingURL=local-daemon-rpc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-daemon-rpc.js","sourceRoot":"","sources":["../src/local-daemon-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,MAAM,UAAU,GACd,wEAAwE,CAAC;AAC3E,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAC3C,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AAEpC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACvC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC,OAAO;IACzB,aAAa,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AI,CAChD,gBAAgB,EAChB,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE;IACpC,OAAO,EAAE,oBAAoB,EAAE;IAC/B,OAAO,EAAE,qBAAqB,EAAE;IAChC,KAAK,EAAE,sBAAsB;CAC9B,CAAC,EACF,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE;IACvC,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,UAAU,CAAC,YAAY;IAChC,KAAK,EAAE,sBAAsB;CAC9B,CAAC,EACF,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,YAAY,EAAE;IACzC,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,UAAU,CAAC,YAAY;IAChC,KAAK,EAAE,sBAAsB;CAC9B,CAAC,EACF,sBAAsB,EACtB,cAAc,EACd,eAAe,CAChB;CAAG"}
|
package/dist/local-history.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { Message } from "@moltzap/protocol/message";
|
|
2
|
-
import { HashMap, Schema } from "effect";
|
|
3
|
-
declare const historyRequestSchemaValue: Schema.Struct<{
|
|
4
|
-
conversationId: Schema.Schema<import("@moltzap/protocol/conversation").ConversationId, string, never>;
|
|
5
|
-
limit: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
6
|
-
default: () => number;
|
|
7
|
-
}>;
|
|
8
|
-
sessionKey: Schema.optional<typeof Schema.String>;
|
|
9
|
-
}>;
|
|
10
|
-
declare const historyMessageSummarySchema: Schema.Struct<{
|
|
11
|
-
id: Schema.Schema<import("@moltzap/protocol/conversation").MessageId, string, never>;
|
|
12
|
-
senderId: Schema.Schema<import("@moltzap/protocol/identity").AgentId, string, never>;
|
|
13
|
-
senderName: typeof Schema.String;
|
|
14
|
-
isOwn: typeof Schema.Boolean;
|
|
15
|
-
text: typeof Schema.String;
|
|
16
|
-
createdAt: typeof Schema.String;
|
|
17
|
-
isNew: typeof Schema.Boolean;
|
|
18
|
-
}>;
|
|
19
|
-
declare const historyResponseSchemaValue: Schema.Struct<{
|
|
20
|
-
messages: Schema.Array$<Schema.Struct<{
|
|
21
|
-
id: Schema.Schema<import("@moltzap/protocol/conversation").MessageId, string, never>;
|
|
22
|
-
senderId: Schema.Schema<import("@moltzap/protocol/identity").AgentId, string, never>;
|
|
23
|
-
senderName: typeof Schema.String;
|
|
24
|
-
isOwn: typeof Schema.Boolean;
|
|
25
|
-
text: typeof Schema.String;
|
|
26
|
-
createdAt: typeof Schema.String;
|
|
27
|
-
isNew: typeof Schema.Boolean;
|
|
28
|
-
}>>;
|
|
29
|
-
conversationMeta: Schema.optional<Schema.Struct<{
|
|
30
|
-
id: Schema.Schema<import("@moltzap/protocol/conversation").ConversationId, string, never>;
|
|
31
|
-
name: Schema.optional<typeof Schema.String>;
|
|
32
|
-
createdBy: Schema.Schema<import("@moltzap/protocol/identity").AgentId, string, never>;
|
|
33
|
-
createdAt: typeof Schema.String;
|
|
34
|
-
updatedAt: typeof Schema.String;
|
|
35
|
-
}>>;
|
|
36
|
-
newCount: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
37
|
-
}>;
|
|
38
|
-
/** Represents history request values. */
|
|
39
|
-
export type HistoryRequest = Schema.Schema.Type<typeof historyRequestSchemaValue>;
|
|
40
|
-
/** Represents history message summary values. */
|
|
41
|
-
export type HistoryMessageSummary = Schema.Schema.Type<typeof historyMessageSummarySchema>;
|
|
42
|
-
/** Represents history response values. */
|
|
43
|
-
export type HistoryResponse = Schema.Schema.Type<typeof historyResponseSchemaValue>;
|
|
44
|
-
/**
|
|
45
|
-
* Executes the history request schema operation.
|
|
46
|
-
* @returns The history request schema result.
|
|
47
|
-
*/
|
|
48
|
-
export declare function historyRequestSchema(): typeof historyRequestSchemaValue;
|
|
49
|
-
/**
|
|
50
|
-
* Executes the history response schema operation.
|
|
51
|
-
* @returns The history response schema result.
|
|
52
|
-
*/
|
|
53
|
-
export declare function historyResponseSchema(): typeof historyResponseSchemaValue;
|
|
54
|
-
interface FormatHistoryMessageOptions {
|
|
55
|
-
readonly agentNames: HashMap.HashMap<string, string>;
|
|
56
|
-
readonly ownAgentId?: string;
|
|
57
|
-
readonly lastReadIds: ReadonlySet<string>;
|
|
58
|
-
readonly hasSessionKey: boolean;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Formats history message.
|
|
62
|
-
* @param message Value supplied to the operation.
|
|
63
|
-
* @param options Options that control the operation.
|
|
64
|
-
* @returns The format history message result.
|
|
65
|
-
*/
|
|
66
|
-
export declare function formatHistoryMessage(message: Message, options: FormatHistoryMessageOptions): HistoryMessageSummary;
|
|
67
|
-
/**
|
|
68
|
-
* Executes the last read ids for session operation.
|
|
69
|
-
* @param lastReadMap Value supplied to the operation.
|
|
70
|
-
* @param request Value supplied to the operation.
|
|
71
|
-
* @returns The last read ids for session result.
|
|
72
|
-
*/
|
|
73
|
-
export declare function lastReadIdsForSession(lastReadMap: HashMap.HashMap<string, HashMap.HashMap<string, ReadonlySet<string>>>, request: HistoryRequest): ReadonlySet<string>;
|
|
74
|
-
export {};
|
|
75
|
-
//# sourceMappingURL=local-history.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-history.d.ts","sourceRoot":"","sources":["../src/local-history.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAWjD,QAAA,MAAM,yBAAyB;;;;;;EAM7B,CAAC;AAEH,QAAA,MAAM,2BAA2B;;;;;;;;EAQ/B,CAAC;AAUH,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;EAI9B,CAAC;AAEH,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAC7C,OAAO,yBAAyB,CACjC,CAAC;AACF,iDAAiD;AACjD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CACpD,OAAO,2BAA2B,CACnC,CAAC;AACF,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAC9C,OAAO,0BAA0B,CAClC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,yBAAyB,CAEvE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,0BAA0B,CAEzE;AAED,UAAU,2BAA2B;IACnC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,2BAA2B,GACnC,qBAAqB,CAevB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,OAAO,CAAC,OAAO,CAC1B,MAAM,EACN,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAC7C,EACD,OAAO,EAAE,cAAc,GACtB,WAAW,CAAC,MAAM,CAAC,CAWrB"}
|
package/dist/local-history.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { agentId } from "@moltzap/protocol/identity";
|
|
2
|
-
import { conversationId, messageId } from "@moltzap/protocol/conversation";
|
|
3
|
-
import { HashMap, Option, Schema } from "effect";
|
|
4
|
-
import { renderPart } from "./message-rendering.js";
|
|
5
|
-
const DEFAULT_HISTORY_LIMIT = 10;
|
|
6
|
-
const MAX_HISTORY_LIMIT = 100;
|
|
7
|
-
const historyLimit = Schema.Number.pipe(Schema.int(), Schema.between(1, MAX_HISTORY_LIMIT));
|
|
8
|
-
const historyRequestSchemaValue = Schema.Struct({
|
|
9
|
-
conversationId: conversationId,
|
|
10
|
-
limit: Schema.optionalWith(historyLimit, {
|
|
11
|
-
default: () => DEFAULT_HISTORY_LIMIT,
|
|
12
|
-
}),
|
|
13
|
-
sessionKey: Schema.optional(Schema.String),
|
|
14
|
-
});
|
|
15
|
-
const historyMessageSummarySchema = Schema.Struct({
|
|
16
|
-
id: messageId,
|
|
17
|
-
senderId: agentId,
|
|
18
|
-
senderName: Schema.String,
|
|
19
|
-
isOwn: Schema.Boolean,
|
|
20
|
-
text: Schema.String,
|
|
21
|
-
createdAt: Schema.String,
|
|
22
|
-
isNew: Schema.Boolean,
|
|
23
|
-
});
|
|
24
|
-
const historyConversationMetaSchema = Schema.Struct({
|
|
25
|
-
id: conversationId,
|
|
26
|
-
name: Schema.optional(Schema.String),
|
|
27
|
-
createdBy: agentId,
|
|
28
|
-
createdAt: Schema.String,
|
|
29
|
-
updatedAt: Schema.String,
|
|
30
|
-
});
|
|
31
|
-
const historyResponseSchemaValue = Schema.Struct({
|
|
32
|
-
messages: Schema.Array(historyMessageSummarySchema),
|
|
33
|
-
conversationMeta: Schema.optional(historyConversationMetaSchema),
|
|
34
|
-
newCount: Schema.Number.pipe(Schema.int(), Schema.nonNegative()),
|
|
35
|
-
});
|
|
36
|
-
/**
|
|
37
|
-
* Executes the history request schema operation.
|
|
38
|
-
* @returns The history request schema result.
|
|
39
|
-
*/
|
|
40
|
-
export function historyRequestSchema() {
|
|
41
|
-
return historyRequestSchemaValue;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Executes the history response schema operation.
|
|
45
|
-
* @returns The history response schema result.
|
|
46
|
-
*/
|
|
47
|
-
export function historyResponseSchema() {
|
|
48
|
-
return historyResponseSchemaValue;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Formats history message.
|
|
52
|
-
* @param message Value supplied to the operation.
|
|
53
|
-
* @param options Options that control the operation.
|
|
54
|
-
* @returns The format history message result.
|
|
55
|
-
*/
|
|
56
|
-
export function formatHistoryMessage(message, options) {
|
|
57
|
-
const senderName = Option.getOrElse(HashMap.get(options.agentNames, message.senderId), () => message.senderId);
|
|
58
|
-
const isOwn = message.senderId === options.ownAgentId;
|
|
59
|
-
return {
|
|
60
|
-
id: message.id,
|
|
61
|
-
senderId: message.senderId,
|
|
62
|
-
senderName: isOwn ? "you" : senderName,
|
|
63
|
-
isOwn,
|
|
64
|
-
text: message.parts.map(renderPart).join(" "),
|
|
65
|
-
createdAt: message.createdAt,
|
|
66
|
-
isNew: options.hasSessionKey ? !options.lastReadIds.has(message.id) : false,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Executes the last read ids for session operation.
|
|
71
|
-
* @param lastReadMap Value supplied to the operation.
|
|
72
|
-
* @param request Value supplied to the operation.
|
|
73
|
-
* @returns The last read ids for session result.
|
|
74
|
-
*/
|
|
75
|
-
export function lastReadIdsForSession(lastReadMap, request) {
|
|
76
|
-
if (request.sessionKey === undefined) {
|
|
77
|
-
return new Set();
|
|
78
|
-
}
|
|
79
|
-
return Option.getOrElse(Option.flatMap(HashMap.get(lastReadMap, request.sessionKey), (perConv) => HashMap.get(perConv, request.conversationId)), () =>
|
|
80
|
-
/* Safe because the surrounding invariant establishes this asserted shape. */ new Set());
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=local-history.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-history.js","sourceRoot":"","sources":["../src/local-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,UAAU,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O,IAAI,GAAG,EAAU,CAAC;IAC3B,CAAC;IACD,OAAO,MAAM,CAAC,SAAS,CACrB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CACvE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,CAC7C,EACD,GAAG,EAAE;IACH,6EAA6E,CAAC,IAAI,GAAG,EAAiC,CACzH,CAAC;AACJ,CAAC"}
|
package/dist/local-paths.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides the get molt zap config dir runtime value.
|
|
3
|
-
* @returns The get molt zap config dir result.
|
|
4
|
-
*/
|
|
5
|
-
export declare const getMoltZapConfigDir: () => string;
|
|
6
|
-
/**
|
|
7
|
-
* Provides the get molt zap config path runtime value.
|
|
8
|
-
* @returns The get molt zap config path result.
|
|
9
|
-
*/
|
|
10
|
-
export declare const getMoltZapConfigPath: () => string;
|
|
11
|
-
/**
|
|
12
|
-
* Provides the get molt zap service socket path runtime value.
|
|
13
|
-
* @returns The get molt zap service socket path result.
|
|
14
|
-
*/
|
|
15
|
-
export declare const getMoltZapServiceSocketPath: () => string;
|
|
16
|
-
/**
|
|
17
|
-
* Provides the get molt zap agent service socket path runtime value.
|
|
18
|
-
* @param agentId Identifier of the agent targeted by the operation.
|
|
19
|
-
* @returns The get molt zap agent service socket path result.
|
|
20
|
-
*/
|
|
21
|
-
export declare const getMoltZapAgentServiceSocketPath: (agentId: string) => string;
|
|
22
|
-
//# sourceMappingURL=local-paths.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-paths.d.ts","sourceRoot":"","sources":["../src/local-paths.ts"],"names":[],"mappings":"AA8BA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,MACK,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAO,MACgC,CAAC;AAEzE;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QAAO,MAG5C,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,YAAa,MAAM,KAAG,MAGhE,CAAC"}
|
package/dist/local-paths.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Path } from "@effect/platform";
|
|
2
|
-
import { Config, ConfigProvider, Effect, Option } from "effect";
|
|
3
|
-
const MOLTZAP_DIR_NAME = ".moltzap";
|
|
4
|
-
const CONFIG_FILE_NAME = "config.json";
|
|
5
|
-
const SERVICE_SOCKET_FILE_NAME = "service.sock";
|
|
6
|
-
const configHome = Config.option(Config.string("MOLTZAP_CONFIG_HOME"));
|
|
7
|
-
const homeDir = Config.string("HOME").pipe(Config.orElse(() => Config.string("USERPROFILE")));
|
|
8
|
-
const getConfigHomeSync = () => Option.getOrUndefined(Effect.runSync(configHome.pipe(Effect.withConfigProvider(ConfigProvider.fromEnv()))));
|
|
9
|
-
const getHomeDirSync = () => Effect.runSync(homeDir.pipe(Effect.withConfigProvider(ConfigProvider.fromEnv())));
|
|
10
|
-
const pathSync = (f) => Effect.runSync(Path.Path.pipe(Effect.map(f), Effect.provide(Path.layer)));
|
|
11
|
-
const getMoltZapHomeDir = () => pathSync((path) => path.join(getHomeDirSync(), MOLTZAP_DIR_NAME));
|
|
12
|
-
/**
|
|
13
|
-
* Provides the get molt zap config dir runtime value.
|
|
14
|
-
* @returns The get molt zap config dir result.
|
|
15
|
-
*/
|
|
16
|
-
export const getMoltZapConfigDir = () => getConfigHomeSync() ?? getMoltZapHomeDir();
|
|
17
|
-
/**
|
|
18
|
-
* Provides the get molt zap config path runtime value.
|
|
19
|
-
* @returns The get molt zap config path result.
|
|
20
|
-
*/
|
|
21
|
-
export const getMoltZapConfigPath = () => pathSync((path) => path.join(getMoltZapConfigDir(), CONFIG_FILE_NAME));
|
|
22
|
-
/**
|
|
23
|
-
* Provides the get molt zap service socket path runtime value.
|
|
24
|
-
* @returns The get molt zap service socket path result.
|
|
25
|
-
*/
|
|
26
|
-
export const getMoltZapServiceSocketPath = () => pathSync((path) => path.join(getMoltZapConfigDir(), SERVICE_SOCKET_FILE_NAME));
|
|
27
|
-
/**
|
|
28
|
-
* Provides the get molt zap agent service socket path runtime value.
|
|
29
|
-
* @param agentId Identifier of the agent targeted by the operation.
|
|
30
|
-
* @returns The get molt zap agent service socket path result.
|
|
31
|
-
*/
|
|
32
|
-
export const getMoltZapAgentServiceSocketPath = (agentId) => pathSync((path) => path.join(getMoltZapConfigDir(), `service-${agentId}.sock`));
|
|
33
|
-
//# sourceMappingURL=local-paths.js.map
|
package/dist/local-paths.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-paths.js","sourceRoot":"","sources":["../src/local-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhE,MAAM,gBAAgB,GAAG,UAAU,CAAC;AACpC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AACvC,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAEhD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC;AACvE,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CACxC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAClD,CAAC;AAEF,MAAM,iBAAiB,GAAG,GAAuB,EAAE,CACjD,MAAM,CAAC,cAAc,CACnB,MAAM,CAAC,OAAO,CACZ,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,OAAO,EAAE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,EAAE,WAAW,OAAO,OAAO,CAAC,CAC5D,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type RpcGroup } from "@effect/rpc";
|
|
2
|
-
import { Effect, Scope } from "effect";
|
|
3
|
-
import { LocalDaemonRpcs } from "./local-daemon-rpc.js";
|
|
4
|
-
type LocalDaemonHandlers = RpcGroup.HandlersFrom<RpcGroup.Rpcs<typeof LocalDaemonRpcs>>;
|
|
5
|
-
interface LocalSocketServerOptions<Handlers extends LocalDaemonHandlers = LocalDaemonHandlers> {
|
|
6
|
-
readonly socketPath: string;
|
|
7
|
-
readonly defaultSocketPath: string;
|
|
8
|
-
readonly handlers: Handlers;
|
|
9
|
-
}
|
|
10
|
-
/** Describes running local socket server. */
|
|
11
|
-
export interface RunningLocalSocketServer {
|
|
12
|
-
readonly socketScope: Scope.CloseableScope;
|
|
13
|
-
readonly socketPath: string;
|
|
14
|
-
}
|
|
15
|
-
interface StopLocalSocketServerOptions {
|
|
16
|
-
readonly socketScope: Scope.CloseableScope | null;
|
|
17
|
-
readonly socketPath: string;
|
|
18
|
-
readonly defaultSocketPath: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Executes the start local socket server operation.
|
|
22
|
-
* @param options Options that control the operation.
|
|
23
|
-
* @returns The start local socket server result.
|
|
24
|
-
*/
|
|
25
|
-
export declare function startLocalSocketServer<Handlers extends LocalDaemonHandlers>(options: LocalSocketServerOptions<Handlers>): Effect.Effect<RunningLocalSocketServer, unknown>;
|
|
26
|
-
/**
|
|
27
|
-
* Executes the stop local socket server operation.
|
|
28
|
-
* @param options Options that control the operation.
|
|
29
|
-
* @returns The stop local socket server result.
|
|
30
|
-
*/
|
|
31
|
-
export declare function stopLocalSocketServer(options: StopLocalSocketServerOptions): Effect.Effect<void>;
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=local-socket-server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-socket-server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
|
2
|
-
import * as SocketServer from "@effect/platform/SocketServer";
|
|
3
|
-
import { NodeContext } from "@effect/platform-node";
|
|
4
|
-
import * as NodeSocketServer from "@effect/platform-node/NodeSocketServer";
|
|
5
|
-
import { RpcSerialization, RpcServer } from "@effect/rpc";
|
|
6
|
-
import { Effect, Either, Exit, Layer, Scope } from "effect";
|
|
7
|
-
import { LocalDaemonRpcs, toLocalDaemonError } from "./local-daemon-rpc.js";
|
|
8
|
-
const SOCKET_FILE_MODE = 0o600;
|
|
9
|
-
function logFileSystemIssue(level, message, error) {
|
|
10
|
-
return (level === "warn" ? Effect.logWarning : Effect.logInfo)(message, error);
|
|
11
|
-
}
|
|
12
|
-
function closeScope(scope) {
|
|
13
|
-
return Scope.close(scope, Exit.succeed(undefined));
|
|
14
|
-
}
|
|
15
|
-
function prepareSocketPath(socketPath) {
|
|
16
|
-
return Effect.gen(function* () {
|
|
17
|
-
const fileSystem = yield* FileSystem.FileSystem;
|
|
18
|
-
const path = yield* Path.Path;
|
|
19
|
-
yield* fileSystem
|
|
20
|
-
.remove(socketPath, { force: true })
|
|
21
|
-
.pipe(Effect.catchAll((error) => logFileSystemIssue("warn", "unlink existing socket failed", error)));
|
|
22
|
-
yield* fileSystem.makeDirectory(path.dirname(socketPath), {
|
|
23
|
-
recursive: true,
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function makeSocketServer(socketPath, socketScope) {
|
|
28
|
-
return NodeSocketServer.make({ path: socketPath }).pipe(Scope.extend(socketScope), Effect.tapError(() => closeScope(socketScope)));
|
|
29
|
-
}
|
|
30
|
-
function buildSocketRpcLayer(server, socketScope, options) {
|
|
31
|
-
const rpcLayer = RpcServer.layer(LocalDaemonRpcs).pipe(Layer.provide(LocalDaemonRpcs.toLayer(LocalDaemonRpcs.of(options.handlers)).pipe(Layer.mapError(toLocalDaemonError))), Layer.provide(RpcServer.layerProtocolSocketServer), Layer.provide(RpcSerialization.layerNdjson), Layer.provide(Layer.succeed(SocketServer.SocketServer, server)));
|
|
32
|
-
return Layer.build(rpcLayer).pipe(Scope.extend(socketScope), Effect.tapError(() => closeScope(socketScope)));
|
|
33
|
-
}
|
|
34
|
-
function chmodSocketPath(socketPath) {
|
|
35
|
-
return FileSystem.FileSystem.pipe(Effect.flatMap((fileSystem) => fileSystem.chmod(socketPath, SOCKET_FILE_MODE)), Effect.catchAll((error) => logFileSystemIssue("warn", "chmod 0600 on socket failed", error)));
|
|
36
|
-
}
|
|
37
|
-
function installDefaultSocketSymlink(options) {
|
|
38
|
-
return Effect.gen(function* () {
|
|
39
|
-
const fileSystem = yield* FileSystem.FileSystem;
|
|
40
|
-
yield* fileSystem
|
|
41
|
-
.remove(options.defaultSocketPath, { force: true })
|
|
42
|
-
.pipe(Effect.catchAll((error) => logFileSystemIssue("info", "unlink default socket symlink", error)));
|
|
43
|
-
yield* fileSystem
|
|
44
|
-
.symlink(options.socketPath, options.defaultSocketPath)
|
|
45
|
-
.pipe(Effect.catchAll((error) => logFileSystemIssue("warn", "symlink default socket failed", error)));
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Executes the start local socket server operation.
|
|
50
|
-
* @param options Options that control the operation.
|
|
51
|
-
* @returns The start local socket server result.
|
|
52
|
-
*/
|
|
53
|
-
export function startLocalSocketServer(options) {
|
|
54
|
-
const effect = Effect.gen(function* () {
|
|
55
|
-
yield* prepareSocketPath(options.socketPath);
|
|
56
|
-
const socketScope = yield* Scope.make();
|
|
57
|
-
const server = yield* makeSocketServer(options.socketPath, socketScope);
|
|
58
|
-
yield* buildSocketRpcLayer(server, socketScope, options);
|
|
59
|
-
yield* chmodSocketPath(options.socketPath);
|
|
60
|
-
yield* installDefaultSocketSymlink(options);
|
|
61
|
-
return { socketScope, socketPath: options.socketPath };
|
|
62
|
-
}).pipe(Effect.withSpan("startLocalSocketServer"), Effect.provide(NodeContext.layer));
|
|
63
|
-
return /* Safe because the surrounding invariant establishes this asserted shape. */ effect;
|
|
64
|
-
}
|
|
65
|
-
function removeSocketPath(socketPath) {
|
|
66
|
-
return FileSystem.FileSystem.pipe(Effect.flatMap((fileSystem) => fileSystem.remove(socketPath, { force: true })), Effect.catchAll((error) => logFileSystemIssue("info", "unlink socket path", error)));
|
|
67
|
-
}
|
|
68
|
-
function removeDefaultSocketSymlinkIfOwned(options) {
|
|
69
|
-
return Effect.gen(function* () {
|
|
70
|
-
const fileSystem = yield* FileSystem.FileSystem;
|
|
71
|
-
const target = yield* fileSystem
|
|
72
|
-
.readLink(options.defaultSocketPath)
|
|
73
|
-
.pipe(Effect.either);
|
|
74
|
-
const shouldRemoveDefaultSocket = Either.match(target, {
|
|
75
|
-
onLeft: () => false,
|
|
76
|
-
onRight: (value) => value === options.socketPath,
|
|
77
|
-
});
|
|
78
|
-
if (!shouldRemoveDefaultSocket) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
yield* fileSystem
|
|
82
|
-
.remove(options.defaultSocketPath, { force: true })
|
|
83
|
-
.pipe(Effect.catchAll((error) => logFileSystemIssue("info", "cleanup default symlink", error)));
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Executes the stop local socket server operation.
|
|
88
|
-
* @param options Options that control the operation.
|
|
89
|
-
* @returns The stop local socket server result.
|
|
90
|
-
*/
|
|
91
|
-
export function stopLocalSocketServer(options) {
|
|
92
|
-
return Effect.gen(function* () {
|
|
93
|
-
if (options.socketScope !== null) {
|
|
94
|
-
yield* closeScope(options.socketScope);
|
|
95
|
-
}
|
|
96
|
-
yield* removeSocketPath(options.socketPath);
|
|
97
|
-
yield* removeDefaultSocketSymlinkIfOwned(options);
|
|
98
|
-
}).pipe(Effect.withSpan("stopLocalSocketServer"), Effect.provide(NodeContext.layer));
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=local-socket-server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-socket-server.js","sourceRoot":"","sources":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A,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAGtD,8CAA8C;AAC9C,eAAO,MAAM,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAMxC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Match } from "effect";
|
|
2
|
-
/** Provides the render part runtime value. */
|
|
3
|
-
export const renderPart = Match.type().pipe(Match.discriminatorsExhaustive("type")({
|
|
4
|
-
text: (text) => text.text,
|
|
5
|
-
image: () => "[image]",
|
|
6
|
-
file: (file) => `[file: ${file.name}]`,
|
|
7
|
-
}));
|
|
8
|
-
//# sourceMappingURL=message-rendering.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message-rendering.js","sourceRoot":"","sources":["../src/message-rendering.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,8CAA8C;AAC9C,MAAM,CAAC,MAAM,UAAU,GAA2B,KAAK,CAAC,IAAI,EAAQ,CAAC,IAAI,CACvE,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI;IACzB,KAAK,EAAE,GAAG,EAAE,CAAC,SAAS;IACtB,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,IAAI,CAAC,IAAI,GAAG;CACvC,CAAC,CACH,CAAC"}
|