@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
package/dist/profile.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { Effect, Schema } from "effect";
|
|
2
|
-
/** Validates and decodes profile name values. */
|
|
3
|
-
export declare const profileName: Schema.brand<Schema.filter<typeof Schema.String>, "ProfileName">;
|
|
4
|
-
/**
|
|
5
|
-
* Branded profile name shared by profile lookup and CLI registration.
|
|
6
|
-
*/
|
|
7
|
-
export type ProfileName = Schema.Schema.Type<typeof profileName>;
|
|
8
|
-
declare const profileRecordSchema: Schema.Struct<{
|
|
9
|
-
agentId: Schema.Schema<import("@moltzap/protocol/identity").AgentId, string, never>;
|
|
10
|
-
apiKey: Schema.Schema<import("@moltzap/protocol/identity").AgentKey, string, never>;
|
|
11
|
-
agentName: typeof Schema.String;
|
|
12
|
-
}>;
|
|
13
|
-
/** One profile's persisted auth record. */
|
|
14
|
-
export type ProfileRecord = Schema.Schema.Type<typeof profileRecordSchema>;
|
|
15
|
-
/** Named profile view of config.json. */
|
|
16
|
-
export interface LayeredConfig {
|
|
17
|
-
readonly profiles: ReadonlyMap<ProfileName, ProfileRecord>;
|
|
18
|
-
}
|
|
19
|
-
/** Exhaustive error union for the profile surface. */
|
|
20
|
-
export type ProfileError = ProfileNotFoundError | ProfileInvalidNameError | ProfileConfigReadError | ProfileConfigWriteError;
|
|
21
|
-
declare const ProfileNotFoundError_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: "ProfileNotFoundError";
|
|
23
|
-
} & Readonly<A>;
|
|
24
|
-
/** Reports profile not found failures. */
|
|
25
|
-
export declare class ProfileNotFoundError extends ProfileNotFoundError_base<{
|
|
26
|
-
readonly name: string;
|
|
27
|
-
}> {
|
|
28
|
-
}
|
|
29
|
-
declare const ProfileInvalidNameError_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 & {
|
|
30
|
-
readonly _tag: "ProfileInvalidNameError";
|
|
31
|
-
} & Readonly<A>;
|
|
32
|
-
/** Reports profile invalid name failures. */
|
|
33
|
-
export declare class ProfileInvalidNameError extends ProfileInvalidNameError_base<{
|
|
34
|
-
readonly name: string;
|
|
35
|
-
readonly reason: string;
|
|
36
|
-
}> {
|
|
37
|
-
}
|
|
38
|
-
declare const ProfileConfigReadError_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 & {
|
|
39
|
-
readonly _tag: "ProfileConfigReadError";
|
|
40
|
-
} & Readonly<A>;
|
|
41
|
-
/** Reports profile config read failures. */
|
|
42
|
-
export declare class ProfileConfigReadError extends ProfileConfigReadError_base<{
|
|
43
|
-
readonly path: string;
|
|
44
|
-
readonly cause: unknown;
|
|
45
|
-
}> {
|
|
46
|
-
}
|
|
47
|
-
declare const ProfileConfigWriteError_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 & {
|
|
48
|
-
readonly _tag: "ProfileConfigWriteError";
|
|
49
|
-
} & Readonly<A>;
|
|
50
|
-
/** Reports profile config write failures. */
|
|
51
|
-
export declare class ProfileConfigWriteError extends ProfileConfigWriteError_base<{
|
|
52
|
-
readonly path: string;
|
|
53
|
-
readonly cause: unknown;
|
|
54
|
-
}> {
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Parse and brand a raw profile name. Rejects the empty string and any
|
|
58
|
-
* string that fails NAME_PATTERN.
|
|
59
|
-
* @param raw Value supplied to the operation.
|
|
60
|
-
* @returns The decoded profile name.
|
|
61
|
-
*/
|
|
62
|
-
export declare const parseProfileName: (raw: string) => Effect.Effect<ProfileName, ProfileInvalidNameError>;
|
|
63
|
-
/**
|
|
64
|
-
* Load the full layered config view. Missing file resolves to an empty
|
|
65
|
-
* view; malformed file surfaces as ProfileConfigReadError. No silent
|
|
66
|
-
* defaults on parse error.
|
|
67
|
-
*
|
|
68
|
-
* The file schema is strict: stale fields and malformed profile entries fail
|
|
69
|
-
* decode instead of being silently ignored.
|
|
70
|
-
*/
|
|
71
|
-
export declare const loadLayeredConfig: Effect.Effect<LayeredConfig, ProfileConfigReadError>;
|
|
72
|
-
/**
|
|
73
|
-
* Resolve a named profile record. CLI transport selection uses only
|
|
74
|
-
* `agentId`; daemon startup consumes the redacted `apiKey`.
|
|
75
|
-
* @param name Name of the operation.
|
|
76
|
-
* @returns The next profile file result.
|
|
77
|
-
*/
|
|
78
|
-
export declare const resolveProfileRecord: (name: ProfileName) => Effect.Effect<ProfileRecord, ProfileNotFoundError | ProfileConfigReadError>;
|
|
79
|
-
/**
|
|
80
|
-
* Persist a new profile record under `profiles.<name>`.
|
|
81
|
-
* @param name Name of the operation.
|
|
82
|
-
* @param record Value supplied to the operation.
|
|
83
|
-
* @returns The write profile result.
|
|
84
|
-
*/
|
|
85
|
-
export declare const writeProfile: (name: ProfileName, record: ProfileRecord) => Effect.Effect<void, ProfileConfigWriteError | ProfileConfigReadError>;
|
|
86
|
-
/**
|
|
87
|
-
* `--no-persist` contract for `moltzap register`: no file under
|
|
88
|
-
* `$HOME/.moltzap/` is created or modified. Returns the record so the caller
|
|
89
|
-
* can print it; does no I/O under that tree.
|
|
90
|
-
*
|
|
91
|
-
* The register command invokes either `writeProfile` (default) or
|
|
92
|
-
* `emitNoPersist` (when the flag is set). The register handler never calls
|
|
93
|
-
* both paths on the same invocation.
|
|
94
|
-
*
|
|
95
|
-
* The register command pipes the returned record through the printer,
|
|
96
|
-
* which writes non-secret registration details to stdout.
|
|
97
|
-
* @param record Value supplied to the operation.
|
|
98
|
-
* @returns The emit no persist result.
|
|
99
|
-
*/
|
|
100
|
-
export declare const emitNoPersist: (record: ProfileRecord) => Effect.Effect<{
|
|
101
|
-
readonly record: ProfileRecord;
|
|
102
|
-
}>;
|
|
103
|
-
export {};
|
|
104
|
-
//# sourceMappingURL=profile.d.ts.map
|
package/dist/profile.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAQA,OAAO,EAAQ,MAAM,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAkBtD,iDAAiD;AACjD,eAAO,MAAM,WAAW,kEAGvB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE,QAAA,MAAM,mBAAmB;;;;EAIvB,CAAC;AAEH,2CAA2C;AAC3C,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAe3E,yCAAyC;AACzC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;CAC5D;AAID,sDAAsD;AACtD,MAAM,MAAM,YAAY,GACpB,oBAAoB,GACpB,uBAAuB,GACvB,sBAAsB,GACtB,uBAAuB,CAAC;;;;AAE5B,0CAA0C;AAC1C,qBAAa,oBAAqB,SAAQ,0BAExC;IACA,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;CAAG;;;;AAEL,6CAA6C;AAC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
|
-
* Named profiles live under a top-level `profiles` key. There is no singleton
|
|
5
|
-
* credential fallback; every persisted identity is selected by profile name.
|
|
6
|
-
*/
|
|
7
|
-
import { FileSystem } from "@effect/platform";
|
|
8
|
-
import { NodeFileSystem } from "@effect/platform-node";
|
|
9
|
-
import { Data, Effect, Either, Schema } from "effect";
|
|
10
|
-
import { agentId, agentKey } from "@moltzap/protocol/identity";
|
|
11
|
-
import { getMoltZapConfigDir, getMoltZapConfigPath } from "./local-paths.js";
|
|
12
|
-
// ─── Branded names ─────────────────────────────────────────────────────────
|
|
13
|
-
const NAME_PATTERN = /^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$/;
|
|
14
|
-
const PROFILE_NAME_REASON = "must be 3-32 chars, lowercase alphanumeric and hyphens, cannot start or end with a hyphen";
|
|
15
|
-
const CONFIG_FILE_MODE = 0o600;
|
|
16
|
-
const JSON_INDENT_SPACES = 2;
|
|
17
|
-
const getConfigDir = getMoltZapConfigDir;
|
|
18
|
-
const getConfigFilePathSync = getMoltZapConfigPath;
|
|
19
|
-
const STRICT_PARSE_OPTIONS = { onExcessProperty: "error" };
|
|
20
|
-
// ─── Records ───────────────────────────────────────────────────────────────
|
|
21
|
-
/** Validates and decodes profile name values. */
|
|
22
|
-
export const profileName = Schema.String.pipe(Schema.pattern(NAME_PATTERN), Schema.brand("ProfileName"));
|
|
23
|
-
const profileRecordSchema = Schema.Struct({
|
|
24
|
-
agentId: agentId,
|
|
25
|
-
apiKey: agentKey,
|
|
26
|
-
agentName: Schema.String,
|
|
27
|
-
});
|
|
28
|
-
const profileMapSchema = Schema.Record({
|
|
29
|
-
key: profileName,
|
|
30
|
-
value: profileRecordSchema,
|
|
31
|
-
});
|
|
32
|
-
const profileFileSchema = Schema.Struct({
|
|
33
|
-
profiles: Schema.optional(profileMapSchema),
|
|
34
|
-
});
|
|
35
|
-
const profileFileTextSchema = Schema.parseJson(profileFileSchema, {
|
|
36
|
-
space: JSON_INDENT_SPACES,
|
|
37
|
-
});
|
|
38
|
-
/** Reports profile not found failures. */
|
|
39
|
-
export class ProfileNotFoundError extends Data.TaggedError("ProfileNotFoundError") {
|
|
40
|
-
}
|
|
41
|
-
/** Reports profile invalid name failures. */
|
|
42
|
-
export class ProfileInvalidNameError extends Data.TaggedError("ProfileInvalidNameError") {
|
|
43
|
-
}
|
|
44
|
-
/** Reports profile config read failures. */
|
|
45
|
-
export class ProfileConfigReadError extends Data.TaggedError("ProfileConfigReadError") {
|
|
46
|
-
}
|
|
47
|
-
/** Reports profile config write failures. */
|
|
48
|
-
export class ProfileConfigWriteError extends Data.TaggedError("ProfileConfigWriteError") {
|
|
49
|
-
}
|
|
50
|
-
// ─── Public API ────────────────────────────────────────────────────────────
|
|
51
|
-
/**
|
|
52
|
-
* Parse and brand a raw profile name. Rejects the empty string and any
|
|
53
|
-
* string that fails NAME_PATTERN.
|
|
54
|
-
* @param raw Value supplied to the operation.
|
|
55
|
-
* @returns The decoded profile name.
|
|
56
|
-
*/
|
|
57
|
-
export const parseProfileName = (raw) => {
|
|
58
|
-
return Schema.decodeUnknown(profileName)(raw).pipe(Effect.catchTag("ParseError", () => Effect.fail(new ProfileInvalidNameError({
|
|
59
|
-
name: raw,
|
|
60
|
-
reason: raw.length === 0 ? "empty string" : PROFILE_NAME_REASON,
|
|
61
|
-
}))));
|
|
62
|
-
};
|
|
63
|
-
const readProfileFileText = (configPath) => FileSystem.FileSystem.pipe(Effect.flatMap((fileSystem) => fileSystem
|
|
64
|
-
.exists(configPath)
|
|
65
|
-
.pipe(Effect.flatMap((exists) => exists
|
|
66
|
-
? fileSystem.readFileString(configPath, "utf-8")
|
|
67
|
-
: Effect.succeed(null)))), Effect.provide(NodeFileSystem.layer), Effect.either, Effect.flatMap(Either.match({
|
|
68
|
-
onLeft: (cause) => Effect.fail(new ProfileConfigReadError({ path: configPath, cause })),
|
|
69
|
-
onRight: (value) => Effect.succeed(value),
|
|
70
|
-
})));
|
|
71
|
-
const decodeProfileFileText = (configPath, text) => Schema.decodeUnknown(profileFileTextSchema, STRICT_PARSE_OPTIONS)(text).pipe(Effect.either, Effect.flatMap(Either.match({
|
|
72
|
-
onLeft: (cause) => Effect.fail(new ProfileConfigReadError({ path: configPath, cause })),
|
|
73
|
-
onRight: Effect.succeed,
|
|
74
|
-
})));
|
|
75
|
-
const readProfileFile = () => Effect.gen(function* () {
|
|
76
|
-
const configPath = getConfigFilePathSync();
|
|
77
|
-
const text = yield* readProfileFileText(configPath);
|
|
78
|
-
if (text === null) {
|
|
79
|
-
return { file: {}, existed: false };
|
|
80
|
-
}
|
|
81
|
-
const file = yield* decodeProfileFileText(configPath, text);
|
|
82
|
-
return { file, existed: true };
|
|
83
|
-
});
|
|
84
|
-
function profilesFromFile(file) {
|
|
85
|
-
return new Map(
|
|
86
|
-
/* Safe because the surrounding invariant establishes this asserted shape. */ Object.entries(file.profiles ?? {}));
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Load the full layered config view. Missing file resolves to an empty
|
|
90
|
-
* view; malformed file surfaces as ProfileConfigReadError. No silent
|
|
91
|
-
* defaults on parse error.
|
|
92
|
-
*
|
|
93
|
-
* The file schema is strict: stale fields and malformed profile entries fail
|
|
94
|
-
* decode instead of being silently ignored.
|
|
95
|
-
*/
|
|
96
|
-
export const loadLayeredConfig = Effect.gen(function* () {
|
|
97
|
-
const { file } = yield* readProfileFile();
|
|
98
|
-
return {
|
|
99
|
-
profiles: profilesFromFile(file),
|
|
100
|
-
};
|
|
101
|
-
}).pipe(Effect.withSpan("loadLayeredConfig"));
|
|
102
|
-
/**
|
|
103
|
-
* Resolve a named profile record. CLI transport selection uses only
|
|
104
|
-
* `agentId`; daemon startup consumes the redacted `apiKey`.
|
|
105
|
-
* @param name Name of the operation.
|
|
106
|
-
* @returns The next profile file result.
|
|
107
|
-
*/
|
|
108
|
-
export const resolveProfileRecord = (name) => Effect.gen(function* () {
|
|
109
|
-
const layered = yield* loadLayeredConfig;
|
|
110
|
-
const found = layered.profiles.get(name);
|
|
111
|
-
if (found === undefined) {
|
|
112
|
-
return yield* new ProfileNotFoundError({ name });
|
|
113
|
-
}
|
|
114
|
-
return found;
|
|
115
|
-
}).pipe(Effect.withSpan("resolveProfileRecord"));
|
|
116
|
-
function nextProfileFile(file, name, record) {
|
|
117
|
-
return {
|
|
118
|
-
profiles: {
|
|
119
|
-
...file.profiles,
|
|
120
|
-
[name]: record,
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
const encodeProfileFileText = (configPath, file) => Schema.encode(profileFileTextSchema, STRICT_PARSE_OPTIONS)(file).pipe(Effect.either, Effect.flatMap(Either.match({
|
|
125
|
-
onLeft: (cause) => Effect.fail(new ProfileConfigWriteError({ path: configPath, cause })),
|
|
126
|
-
onRight: Effect.succeed,
|
|
127
|
-
})));
|
|
128
|
-
const writeProfileFile = (next) => {
|
|
129
|
-
const configDir = getConfigDir();
|
|
130
|
-
const configPath = getConfigFilePathSync();
|
|
131
|
-
return FileSystem.FileSystem.pipe(Effect.flatMap((fileSystem) => encodeProfileFileText(configPath, next).pipe(Effect.flatMap((text) => fileSystem.makeDirectory(configDir, { recursive: true }).pipe(Effect.zipRight(fileSystem.writeFileString(configPath, `${text}\n`, {
|
|
132
|
-
mode: CONFIG_FILE_MODE,
|
|
133
|
-
})))))), Effect.provide(NodeFileSystem.layer), Effect.either, Effect.flatMap(Either.match({
|
|
134
|
-
onLeft: (cause) => Effect.fail(new ProfileConfigWriteError({ path: configPath, cause })),
|
|
135
|
-
onRight: (value) => Effect.succeed(value),
|
|
136
|
-
})));
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* Persist a new profile record under `profiles.<name>`.
|
|
140
|
-
* @param name Name of the operation.
|
|
141
|
-
* @param record Value supplied to the operation.
|
|
142
|
-
* @returns The write profile result.
|
|
143
|
-
*/
|
|
144
|
-
export const writeProfile = (name, record) => Effect.gen(function* () {
|
|
145
|
-
const { file } = yield* readProfileFile();
|
|
146
|
-
yield* writeProfileFile(nextProfileFile(file, name, record));
|
|
147
|
-
}).pipe(Effect.withSpan("writeProfile"));
|
|
148
|
-
/**
|
|
149
|
-
* `--no-persist` contract for `moltzap register`: no file under
|
|
150
|
-
* `$HOME/.moltzap/` is created or modified. Returns the record so the caller
|
|
151
|
-
* can print it; does no I/O under that tree.
|
|
152
|
-
*
|
|
153
|
-
* The register command invokes either `writeProfile` (default) or
|
|
154
|
-
* `emitNoPersist` (when the flag is set). The register handler never calls
|
|
155
|
-
* both paths on the same invocation.
|
|
156
|
-
*
|
|
157
|
-
* The register command pipes the returned record through the printer,
|
|
158
|
-
* which writes non-secret registration details to stdout.
|
|
159
|
-
* @param record Value supplied to the operation.
|
|
160
|
-
* @returns The emit no persist result.
|
|
161
|
-
*/
|
|
162
|
-
export const emitNoPersist = (record) => Effect.succeed({ record });
|
|
163
|
-
//# sourceMappingURL=profile.js.map
|
package/dist/profile.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7E,8EAA8E;AAE9E,MAAM,YAAY,GAAG,mCAAmC,CAAC;AACzD,MAAM,mBAAmB,GACvB,2FAA2F,CAAC;AAE9F,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,YAAY,GAAG,mBAAmB,CAAC;AACzC,MAAM,qBAA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AAC,CAAC,eAAe,EAAE,CAAC;IAC1C,KAAK,CAAC,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/D,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;AAE3C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,MAAqB,EAC8B,EAAE,CACrD,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC"}
|
package/dist/refs.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { HashMap, Ref } from "effect";
|
|
2
|
-
/**
|
|
3
|
-
* Read a `Ref` synchronously outside an Effect scope. Only safe for `Ref`s
|
|
4
|
-
* that never fiber-park (the stock `Ref.Ref<A>` never does). Use from
|
|
5
|
-
* object methods or sync code paths that hold a `Ref` set up at construction.
|
|
6
|
-
* @param ref Value supplied to the operation.
|
|
7
|
-
* @returns The snapshot result.
|
|
8
|
-
*/
|
|
9
|
-
export declare const snapshot: <A>(ref: Ref.Ref<A>) => A;
|
|
10
|
-
/**
|
|
11
|
-
* Lookup `key` in `m`, falling back to `dflt()` if absent. Lazy default.
|
|
12
|
-
* @param m Value supplied to the operation.
|
|
13
|
-
* @param key Value supplied to the operation.
|
|
14
|
-
* @param dflt Value supplied to the operation.
|
|
15
|
-
* @returns The get or result.
|
|
16
|
-
*/
|
|
17
|
-
export declare const getOr: <K, V>(m: HashMap.HashMap<K, V>, key: K, dflt: () => V) => V;
|
|
18
|
-
//# sourceMappingURL=refs.d.ts.map
|
package/dist/refs.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../src/refs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,OAAO,EAAU,GAAG,EAAE,MAAM,QAAQ,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,KAAG,CAAiC,CAAC;AAEhF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,CAAC,KACrB,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,OACnB,CAAC,QACA,MAAM,CAAC,KACZ,CAAgD,CAAC"}
|
package/dist/refs.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Effect, HashMap, Option, Ref } from "effect";
|
|
2
|
-
/**
|
|
3
|
-
* Read a `Ref` synchronously outside an Effect scope. Only safe for `Ref`s
|
|
4
|
-
* that never fiber-park (the stock `Ref.Ref<A>` never does). Use from
|
|
5
|
-
* object methods or sync code paths that hold a `Ref` set up at construction.
|
|
6
|
-
* @param ref Value supplied to the operation.
|
|
7
|
-
* @returns The snapshot result.
|
|
8
|
-
*/
|
|
9
|
-
export const snapshot = (ref) => Effect.runSync(Ref.get(ref));
|
|
10
|
-
/**
|
|
11
|
-
* Lookup `key` in `m`, falling back to `dflt()` if absent. Lazy default.
|
|
12
|
-
* @param m Value supplied to the operation.
|
|
13
|
-
* @param key Value supplied to the operation.
|
|
14
|
-
* @param dflt Value supplied to the operation.
|
|
15
|
-
* @returns The get or result.
|
|
16
|
-
*/
|
|
17
|
-
export const getOr = (m, key, dflt) => Option.getOrElse(HashMap.get(m, key), dflt);
|
|
18
|
-
//# sourceMappingURL=refs.js.map
|
package/dist/refs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"refs.js","sourceRoot":"","sources":["../src/refs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAI,GAAe,EAAK,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAEhF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,CAAwB,EACxB,GAAM,EACN,IAAa,EACV,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/** @file Best-effort client event trace persistence. */
|
|
2
|
-
import { ConfigProvider, Effect } from "effect";
|
|
3
|
-
/**
|
|
4
|
-
* Resolve the configured trace directory while preserving empty-as-disabled.
|
|
5
|
-
* @param configProvider Source used to resolve the environment-backed config.
|
|
6
|
-
* @returns A nonempty configured directory, or `undefined` when disabled.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getClientEventLogDir(configProvider?: ConfigProvider.ConfigProvider): string | undefined;
|
|
9
|
-
/**
|
|
10
|
-
* Append one client event trace when trace persistence is configured.
|
|
11
|
-
* @param record Structured event fields to persist.
|
|
12
|
-
* @returns A best-effort write Effect that logs and absorbs storage failures.
|
|
13
|
-
*/
|
|
14
|
-
export declare function appendClientEventTrace(record: Record<string, unknown>): Effect.Effect<void>;
|
|
15
|
-
//# sourceMappingURL=service-event-trace.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-event-trace.d.ts","sourceRoot":"","sources":["../src/service-event-trace.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAIxD,OAAO,EAAU,cAAc,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAMhE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,GAC7C,MAAM,GAAG,SAAS,CAMpB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CA0BrB"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** @file Best-effort client event trace persistence. */
|
|
2
|
-
import { FileSystem, Path } from "@effect/platform";
|
|
3
|
-
import { NodeContext } from "@effect/platform-node";
|
|
4
|
-
import { Config, ConfigProvider, Effect, Option } from "effect";
|
|
5
|
-
const clientEventLogDir = Config.option(Config.string("MOLTZAP_CLIENT_EVENT_LOG_DIR"));
|
|
6
|
-
/**
|
|
7
|
-
* Resolve the configured trace directory while preserving empty-as-disabled.
|
|
8
|
-
* @param configProvider Source used to resolve the environment-backed config.
|
|
9
|
-
* @returns A nonempty configured directory, or `undefined` when disabled.
|
|
10
|
-
*/
|
|
11
|
-
export function getClientEventLogDir(configProvider) {
|
|
12
|
-
const provider = configProvider ?? ConfigProvider.fromEnv();
|
|
13
|
-
const directory = Option.getOrUndefined(Effect.runSync(clientEventLogDir.pipe(Effect.withConfigProvider(provider))));
|
|
14
|
-
return directory === "" ? undefined : directory;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Append one client event trace when trace persistence is configured.
|
|
18
|
-
* @param record Structured event fields to persist.
|
|
19
|
-
* @returns A best-effort write Effect that logs and absorbs storage failures.
|
|
20
|
-
*/
|
|
21
|
-
export function appendClientEventTrace(record) {
|
|
22
|
-
const dir = getClientEventLogDir();
|
|
23
|
-
if (dir === undefined) {
|
|
24
|
-
return Effect.void;
|
|
25
|
-
}
|
|
26
|
-
return Effect.gen(function* () {
|
|
27
|
-
const fileSystem = yield* FileSystem.FileSystem;
|
|
28
|
-
const path = yield* Path.Path;
|
|
29
|
-
const agentId = typeof record.agentId === "string" ? record.agentId : "unknown";
|
|
30
|
-
const safeAgentId = /^[A-Za-z0-9_-]+$/.test(agentId) ? agentId : "unknown";
|
|
31
|
-
yield* Effect.zipRight(fileSystem.makeDirectory(dir, { recursive: true }), fileSystem.writeFileString(path.join(dir, `client-events-${safeAgentId}.jsonl`), `${JSON.stringify(record)}\n`, { flag: "a" }));
|
|
32
|
-
}).pipe(Effect.withSpan("appendClientEventTrace"), Effect.provide(NodeContext.layer), Effect.catchAll((error) => Effect.logWarning("moltzap client event trace write failed", error)));
|
|
33
|
-
}
|
|
34
|
-
// safer-arch-ignore no-trivial-sink-file: Event-trace lifecycle is isolated to keep the public service implementation within the normative function and file-size limits.
|
|
35
|
-
//# sourceMappingURL=service-event-trace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-event-trace.js","sourceRoot":"","sources":["../src/service-event-trace.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhE,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CACrC,MAAM,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAC9C,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,cAA8C;IAE9C,MAAM,QAAQ,GAAG,cAAc,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;IAC5D,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CACrC,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC5E,CAAC;IACF,OAAO,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAA+B;IAE/B,MAAM,GAAG,GAAG,oBAAoB,EAAE,CAAC;IACnC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACzB,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;QAChD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9B,MAAM,OAAO,GACX,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QAClE,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3E,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CACpB,UAAU,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAClD,UAAU,CAAC,eAAe,CACxB,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,WAAW,QAAQ,CAAC,EACpD,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAC7B,EAAE,IAAI,EAAE,GAAG,EAAE,CACd,CACF,CAAC;IACJ,CAAC,CAAC,CAAC,IAAI,CACL,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,EACzC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,EACjC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CACxB,MAAM,CAAC,UAAU,CAAC,yCAAyC,EAAE,KAAK,CAAC,CACpE,CACF,CAAC;AACJ,CAAC;AACD,0KAA0K"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { NotificationDelivery } from "@moltzap/protocol/rpc";
|
|
2
|
-
import type { AnyNotificationDefinition } from "@moltzap/protocol/socket/catalog";
|
|
3
|
-
import type { Message } from "@moltzap/protocol/message";
|
|
4
|
-
import { HashMap } from "effect";
|
|
5
|
-
import type { ConversationMeta, CrossConversationEntry } from "./service.js";
|
|
6
|
-
/** Describes cross conv state. */
|
|
7
|
-
export interface CrossConvState {
|
|
8
|
-
readonly messagesMap: HashMap.HashMap<string, readonly Message[]>;
|
|
9
|
-
readonly conversationsMap: HashMap.HashMap<string, ConversationMeta>;
|
|
10
|
-
readonly agentNamesMap: HashMap.HashMap<string, string>;
|
|
11
|
-
readonly viewMarkers: HashMap.HashMap<string, string>;
|
|
12
|
-
}
|
|
13
|
-
/** Describes context candidate. */
|
|
14
|
-
export interface ContextCandidate {
|
|
15
|
-
readonly convId: string;
|
|
16
|
-
readonly newMsgs: readonly Message[];
|
|
17
|
-
readonly lastTs: number;
|
|
18
|
-
}
|
|
19
|
-
interface BuiltContextEntries {
|
|
20
|
-
readonly entries: CrossConversationEntry[];
|
|
21
|
-
readonly pendingAdvances: ReadonlyArray<readonly [string, string]>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Creates messages for conversation.
|
|
25
|
-
* @param convId Value supplied to the operation.
|
|
26
|
-
* @param messages Value supplied to the operation.
|
|
27
|
-
* @param viewMarkers Value supplied to the operation.
|
|
28
|
-
* @param currentConvId Value supplied to the operation.
|
|
29
|
-
* @returns The new messages for conversation result.
|
|
30
|
-
*/
|
|
31
|
-
export declare function newMessagesForConversation(convId: string, messages: readonly Message[], viewMarkers: HashMap.HashMap<string, string>, currentConvId: string): readonly Message[];
|
|
32
|
-
/**
|
|
33
|
-
* Creates context candidate.
|
|
34
|
-
* @param convId Value supplied to the operation.
|
|
35
|
-
* @param newMsgs Value supplied to the operation.
|
|
36
|
-
* @returns The created context candidate.
|
|
37
|
-
*/
|
|
38
|
-
export declare function makeContextCandidate(convId: string, newMsgs: readonly Message[]): ContextCandidate;
|
|
39
|
-
/**
|
|
40
|
-
* Creates context entries.
|
|
41
|
-
* @param candidates Value supplied to the operation.
|
|
42
|
-
* @param state Value supplied to the operation.
|
|
43
|
-
* @param maxMessagesPerConv Value supplied to the operation.
|
|
44
|
-
* @returns The created context entries.
|
|
45
|
-
*/
|
|
46
|
-
export declare function buildContextEntries(candidates: readonly ContextCandidate[], state: CrossConvState, maxMessagesPerConv: number): BuiltContextEntries;
|
|
47
|
-
/**
|
|
48
|
-
* Executes the notification trace record operation.
|
|
49
|
-
* @param notification Value supplied to the operation.
|
|
50
|
-
* @param agentId Identifier of the agent targeted by the operation.
|
|
51
|
-
* @returns The notification trace record result.
|
|
52
|
-
*/
|
|
53
|
-
export declare function notificationTraceRecord(notification: NotificationDelivery<AnyNotificationDefinition>, agentId?: string): Record<string, unknown>;
|
|
54
|
-
export {};
|
|
55
|
-
//# sourceMappingURL=service-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-helpers.d.ts","sourceRoot":"","sources":["../src/service-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAU,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAM7E,kCAAkC;AAClC,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,CAAC,CAAC;IACrE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvD;AAED,mCAAmC;AACnC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,OAAO,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAC3C,QAAQ,CAAC,eAAe,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACpE;AAwBD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5C,aAAa,EAAE,MAAM,GACpB,SAAS,OAAO,EAAE,CAUpB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,SAAS,OAAO,EAAE,GAC1B,gBAAgB,CAUlB;AA4CD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,SAAS,gBAAgB,EAAE,EACvC,KAAK,EAAE,cAAc,EACrB,kBAAkB,EAAE,MAAM,GACzB,mBAAmB,CAarB;AAQD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,EAC7D,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkBzB"}
|
package/dist/service-helpers.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { HashMap, Option } from "effect";
|
|
2
|
-
import { renderPart } from "./message-rendering.js";
|
|
3
|
-
import { getOr } from "./refs.js";
|
|
4
|
-
const MILLISECONDS_PER_MINUTE = 60_000;
|
|
5
|
-
const isPlainRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6
|
-
const recordOrEmpty = (value) => isPlainRecord(value) ? value : {};
|
|
7
|
-
const recordProperty = (record, key) => {
|
|
8
|
-
const value = record[key];
|
|
9
|
-
return isPlainRecord(value) ? value : undefined;
|
|
10
|
-
};
|
|
11
|
-
const stringProperty = (record, key) => {
|
|
12
|
-
const value = record[key];
|
|
13
|
-
return typeof value === "string" ? value : undefined;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Creates messages for conversation.
|
|
17
|
-
* @param convId Value supplied to the operation.
|
|
18
|
-
* @param messages Value supplied to the operation.
|
|
19
|
-
* @param viewMarkers Value supplied to the operation.
|
|
20
|
-
* @param currentConvId Value supplied to the operation.
|
|
21
|
-
* @returns The new messages for conversation result.
|
|
22
|
-
*/
|
|
23
|
-
export function newMessagesForConversation(convId, messages, viewMarkers, currentConvId) {
|
|
24
|
-
if (convId === currentConvId || messages.length === 0) {
|
|
25
|
-
return [];
|
|
26
|
-
}
|
|
27
|
-
const lastSeenId = Option.getOrUndefined(HashMap.get(viewMarkers, convId));
|
|
28
|
-
const lastSeenIndex = lastSeenId !== undefined
|
|
29
|
-
? messages.findIndex((message) => message.id === lastSeenId)
|
|
30
|
-
: -1;
|
|
31
|
-
return messages.slice(lastSeenIndex + 1);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Creates context candidate.
|
|
35
|
-
* @param convId Value supplied to the operation.
|
|
36
|
-
* @param newMsgs Value supplied to the operation.
|
|
37
|
-
* @returns The created context candidate.
|
|
38
|
-
*/
|
|
39
|
-
export function makeContextCandidate(convId, newMsgs) {
|
|
40
|
-
const last =
|
|
41
|
-
/* Safe because the surrounding invariant establishes this asserted shape. */ newMsgs[newMsgs.length - 1];
|
|
42
|
-
return {
|
|
43
|
-
convId,
|
|
44
|
-
newMsgs,
|
|
45
|
-
lastTs: new Date(last.createdAt).getTime(),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function minutesSince(timestamp) {
|
|
49
|
-
return Math.max(0, Math.round((Date.now() - new Date(timestamp).getTime()) / MILLISECONDS_PER_MINUTE));
|
|
50
|
-
}
|
|
51
|
-
function contextEntryForCandidate(candidate, state, maxMessagesPerConv) {
|
|
52
|
-
const reportable = candidate.newMsgs.slice(-maxMessagesPerConv);
|
|
53
|
-
const last =
|
|
54
|
-
/* Safe because the surrounding invariant establishes this asserted shape. */ reportable[reportable.length - 1];
|
|
55
|
-
const senderName = getOr(state.agentNamesMap, last.senderId, () => last.senderId);
|
|
56
|
-
return {
|
|
57
|
-
entry: {
|
|
58
|
-
conversationId: candidate.convId,
|
|
59
|
-
conversationName: Option.getOrUndefined(HashMap.get(state.conversationsMap, candidate.convId))?.name,
|
|
60
|
-
senderName,
|
|
61
|
-
text: last.parts.map(renderPart).join(" "),
|
|
62
|
-
minutesAgo: minutesSince(last.createdAt),
|
|
63
|
-
count: reportable.length,
|
|
64
|
-
},
|
|
65
|
-
advance: [candidate.convId, last.id],
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Creates context entries.
|
|
70
|
-
* @param candidates Value supplied to the operation.
|
|
71
|
-
* @param state Value supplied to the operation.
|
|
72
|
-
* @param maxMessagesPerConv Value supplied to the operation.
|
|
73
|
-
* @returns The created context entries.
|
|
74
|
-
*/
|
|
75
|
-
export function buildContextEntries(candidates, state, maxMessagesPerConv) {
|
|
76
|
-
const entries = [];
|
|
77
|
-
const pendingAdvances = [];
|
|
78
|
-
for (const candidate of candidates) {
|
|
79
|
-
const { entry, advance } = contextEntryForCandidate(candidate, state, maxMessagesPerConv);
|
|
80
|
-
entries.push(entry);
|
|
81
|
-
pendingAdvances.push(advance);
|
|
82
|
-
}
|
|
83
|
-
return { entries, pendingAdvances };
|
|
84
|
-
}
|
|
85
|
-
const traceConversationId = (conversation, fallback) => conversation === undefined ? fallback : (conversation.id ?? fallback);
|
|
86
|
-
/**
|
|
87
|
-
* Executes the notification trace record operation.
|
|
88
|
-
* @param notification Value supplied to the operation.
|
|
89
|
-
* @param agentId Identifier of the agent targeted by the operation.
|
|
90
|
-
* @returns The notification trace record result.
|
|
91
|
-
*/
|
|
92
|
-
export function notificationTraceRecord(notification, agentId) {
|
|
93
|
-
const params = recordOrEmpty(notification.params);
|
|
94
|
-
const message = recordProperty(params, "message");
|
|
95
|
-
const conversation = recordProperty(params, "conversation");
|
|
96
|
-
const notificationConversationId = stringProperty(params, "conversationId");
|
|
97
|
-
return {
|
|
98
|
-
ts: new Date().toISOString(),
|
|
99
|
-
agentId: agentId ?? "unknown",
|
|
100
|
-
notification: notification.method,
|
|
101
|
-
messageId: message?.id,
|
|
102
|
-
messageConversationId: message?.conversationId,
|
|
103
|
-
messageSenderId: message?.senderId,
|
|
104
|
-
conversationId: traceConversationId(conversation, notificationConversationId),
|
|
105
|
-
conversationName: conversation?.name,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=service-helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-helpers.js","sourceRoot":"","sources":["../src/service-helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAsBvC,MAAM,aAAa,GAAG,CAAC,KAAc,EAAoC,EAAE,CACzE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEvE,MAAM,aAAa,GAAG,CAAC,KAAc,EAA2B,EAAE,CAChE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,E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AE,QAAQ;QAClC,cAAc,EAAE,mBAAmB,CACjC,YAAY,EACZ,0BAA0B,CAC3B;QACD,gBAAgB,EAAE,YAAY,EAAE,IAAI;KACrC,CAAC;AACJ,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { RpcGroup } from "@effect/rpc";
|
|
2
|
-
import { Effect } from "effect";
|
|
3
|
-
import { type AgentId } from "@moltzap/protocol/identity";
|
|
4
|
-
import type { agentCallableGroup } from "@moltzap/protocol/socket/catalog";
|
|
5
|
-
import type { PayloadForTag, SuccessForTag } from "@moltzap/protocol/rpc";
|
|
6
|
-
import type { RpcCallOptions } from "./agent-client.js";
|
|
7
|
-
import type { ServiceRpcError } from "./service.js";
|
|
8
|
-
import type { HistoryRequest, HistoryResponse } from "./local-history.js";
|
|
9
|
-
import { type LocalDaemonHandlers } from "./local-daemon-rpc.js";
|
|
10
|
-
type AgentCallableRpcs = RpcGroup.Rpcs<typeof agentCallableGroup>;
|
|
11
|
-
type AgentCallableTag = AgentCallableRpcs["_tag"];
|
|
12
|
-
type ServiceCall = <Tag extends AgentCallableTag>(tag: Tag, payload: PayloadForTag<AgentCallableRpcs, Tag>, opts?: RpcCallOptions) => Effect.Effect<SuccessForTag<AgentCallableRpcs, Tag>, ServiceRpcError>;
|
|
13
|
-
interface LocalDaemonHandlerOptions {
|
|
14
|
-
readonly ownAgentId: AgentId;
|
|
15
|
-
readonly connected: () => boolean;
|
|
16
|
-
readonly conversationCount: () => number;
|
|
17
|
-
readonly call: ServiceCall;
|
|
18
|
-
readonly handleHistoryRequest: (request: HistoryRequest) => Effect.Effect<HistoryResponse, ServiceRpcError>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Creates local daemon handlers.
|
|
22
|
-
* @param root0 Value supplied to the operation.
|
|
23
|
-
* @param root0.handleHistoryRequest Value supplied to the operation.
|
|
24
|
-
* @param root0.call Value supplied to the operation.
|
|
25
|
-
* @param root0.conversationCount Value supplied to the operation.
|
|
26
|
-
* @param root0.connected Value supplied to the operation.
|
|
27
|
-
* @param root0.ownAgentId Value supplied to the operation.
|
|
28
|
-
* @returns The created local daemon handlers.
|
|
29
|
-
*/
|
|
30
|
-
export declare function makeLocalDaemonHandlers({ ownAgentId, connected, conversationCount, call, handleHistoryRequest, }: LocalDaemonHandlerOptions): LocalDaemonHandlers;
|
|
31
|
-
export {};
|
|
32
|
-
//# sourceMappingURL=service-local-daemon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-local-daemon.d.ts","sourceRoot":"","sources":["../src/service-local-daemon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAO3E,OAAO,KAAK,EAEV,aAAa,EAEb,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAIL,KAAK,mBAAmB,EAKzB,MAAM,uBAAuB,CAAC;AAE/B,KAAK,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAClE,KAAK,gBAAgB,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAElD,KAAK,WAAW,GAAG,CAAC,GAAG,SAAS,gBAAgB,EAC9C,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,aAAa,CAAC,iBAAiB,EAAE,GAAG,CAAC,EAC9C,IAAI,CAAC,EAAE,cAAc,KAClB,MA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