@moltzap/client 2026.812.0 → 2026.902.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -21
- package/NOTICE +19 -0
- package/README.md +50 -0
- package/bin/moltzapd +9 -0
- package/dist/client-runtime.d.ts +10 -0
- package/dist/client-runtime.d.ts.map +1 -0
- package/dist/client-runtime.js +218 -0
- package/dist/client-runtime.js.map +1 -0
- package/dist/contract.d.ts +338 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +213 -0
- package/dist/contract.js.map +1 -0
- package/dist/contract.types-check.d.ts +99 -0
- package/dist/contract.types-check.d.ts.map +1 -0
- package/dist/contract.types-check.js +7 -0
- package/dist/contract.types-check.js.map +1 -0
- package/dist/daemon/configuration.d.ts +46 -0
- package/dist/daemon/configuration.d.ts.map +1 -0
- package/dist/daemon/configuration.js +69 -0
- package/dist/daemon/configuration.js.map +1 -0
- package/dist/daemon/management.d.ts +23 -0
- package/dist/daemon/management.d.ts.map +1 -0
- package/dist/daemon/management.js +489 -0
- package/dist/daemon/management.js.map +1 -0
- package/dist/daemon/registration.d.ts +72 -0
- package/dist/daemon/registration.d.ts.map +1 -0
- package/dist/daemon/registration.js +109 -0
- package/dist/daemon/registration.js.map +1 -0
- package/dist/daemon/runtime/activation.d.ts +95 -0
- package/dist/daemon/runtime/activation.d.ts.map +1 -0
- package/dist/daemon/runtime/activation.js +99 -0
- package/dist/daemon/runtime/activation.js.map +1 -0
- package/dist/daemon/runtime/controller.d.ts +34 -0
- package/dist/daemon/runtime/controller.d.ts.map +1 -0
- package/dist/daemon/runtime/controller.js +106 -0
- package/dist/daemon/runtime/controller.js.map +1 -0
- package/dist/daemon/runtime/history-export.d.ts +23 -0
- package/dist/daemon/runtime/history-export.d.ts.map +1 -0
- package/dist/daemon/runtime/history-export.js +47 -0
- package/dist/daemon/runtime/history-export.js.map +1 -0
- package/dist/daemon/runtime/index.d.ts +24 -0
- package/dist/daemon/runtime/index.d.ts.map +1 -0
- package/dist/daemon/runtime/index.js +65 -0
- package/dist/daemon/runtime/index.js.map +1 -0
- package/dist/daemon/runtime/protocol.d.ts +63 -0
- package/dist/daemon/runtime/protocol.d.ts.map +1 -0
- package/dist/daemon/runtime/protocol.js +133 -0
- package/dist/daemon/runtime/protocol.js.map +1 -0
- package/dist/endpoint/addressing/index.d.ts +39 -0
- package/dist/endpoint/addressing/index.d.ts.map +1 -0
- package/dist/endpoint/addressing/index.js +114 -0
- package/dist/endpoint/addressing/index.js.map +1 -0
- package/dist/endpoint/engine-dissemination.d.ts +11 -0
- package/dist/endpoint/engine-dissemination.d.ts.map +1 -0
- package/dist/endpoint/engine-dissemination.js +71 -0
- package/dist/endpoint/engine-dissemination.js.map +1 -0
- package/dist/endpoint/engine-durability.d.ts +69 -0
- package/dist/endpoint/engine-durability.d.ts.map +1 -0
- package/dist/endpoint/engine-durability.js +210 -0
- package/dist/endpoint/engine-durability.js.map +1 -0
- package/dist/endpoint/engine-send.d.ts +50 -0
- package/dist/endpoint/engine-send.d.ts.map +1 -0
- package/dist/endpoint/engine-send.js +422 -0
- package/dist/endpoint/engine-send.js.map +1 -0
- package/dist/endpoint/engine-types.d.ts +132 -0
- package/dist/endpoint/engine-types.d.ts.map +1 -0
- package/dist/endpoint/engine-types.js +13 -0
- package/dist/endpoint/engine-types.js.map +1 -0
- package/dist/endpoint/engine.d.ts +14 -0
- package/dist/endpoint/engine.d.ts.map +1 -0
- package/dist/endpoint/engine.js +280 -0
- package/dist/endpoint/engine.js.map +1 -0
- package/dist/endpoint/protocol/evidence.d.ts +37 -0
- package/dist/endpoint/protocol/evidence.d.ts.map +1 -0
- package/dist/endpoint/protocol/evidence.js +80 -0
- package/dist/endpoint/protocol/evidence.js.map +1 -0
- package/dist/endpoint/protocol/index.d.ts +26 -0
- package/dist/endpoint/protocol/index.d.ts.map +1 -0
- package/dist/endpoint/protocol/index.js +543 -0
- package/dist/endpoint/protocol/index.js.map +1 -0
- package/dist/endpoint/recovery/barrier.d.ts +23 -0
- package/dist/endpoint/recovery/barrier.d.ts.map +1 -0
- package/dist/endpoint/recovery/barrier.js +47 -0
- package/dist/endpoint/recovery/barrier.js.map +1 -0
- package/dist/endpoint/recovery/index.d.ts +29 -0
- package/dist/endpoint/recovery/index.d.ts.map +1 -0
- package/dist/endpoint/recovery/index.js +489 -0
- package/dist/endpoint/recovery/index.js.map +1 -0
- package/dist/endpoint/recovery/reanchor/empty.d.ts +22 -0
- package/dist/endpoint/recovery/reanchor/empty.d.ts.map +1 -0
- package/dist/endpoint/recovery/reanchor/empty.js +163 -0
- package/dist/endpoint/recovery/reanchor/empty.js.map +1 -0
- package/dist/endpoint/recovery/reanchor/index.d.ts +30 -0
- package/dist/endpoint/recovery/reanchor/index.d.ts.map +1 -0
- package/dist/endpoint/recovery/reanchor/index.js +479 -0
- package/dist/endpoint/recovery/reanchor/index.js.map +1 -0
- package/dist/endpoint/recovery/state.d.ts +130 -0
- package/dist/endpoint/recovery/state.d.ts.map +1 -0
- package/dist/endpoint/recovery/state.js +296 -0
- package/dist/endpoint/recovery/state.js.map +1 -0
- package/dist/endpoint/recovery/store-evidence.d.ts +17 -0
- package/dist/endpoint/recovery/store-evidence.d.ts.map +1 -0
- package/dist/endpoint/recovery/store-evidence.js +79 -0
- package/dist/endpoint/recovery/store-evidence.js.map +1 -0
- package/dist/endpoint/recovery/store.d.ts +56 -0
- package/dist/endpoint/recovery/store.d.ts.map +1 -0
- package/dist/endpoint/recovery/store.js +499 -0
- package/dist/endpoint/recovery/store.js.map +1 -0
- package/dist/endpoint/representation-canonical.d.ts +17 -0
- package/dist/endpoint/representation-canonical.d.ts.map +1 -0
- package/dist/endpoint/representation-canonical.js +48 -0
- package/dist/endpoint/representation-canonical.js.map +1 -0
- package/dist/endpoint/representation-codec.d.ts +51 -0
- package/dist/endpoint/representation-codec.d.ts.map +1 -0
- package/dist/endpoint/representation-codec.js +159 -0
- package/dist/endpoint/representation-codec.js.map +1 -0
- package/dist/endpoint/representation-schemas.d.ts +1831 -0
- package/dist/endpoint/representation-schemas.d.ts.map +1 -0
- package/dist/endpoint/representation-schemas.js +195 -0
- package/dist/endpoint/representation-schemas.js.map +1 -0
- package/dist/endpoint/representation-verification.d.ts +79 -0
- package/dist/endpoint/representation-verification.d.ts.map +1 -0
- package/dist/endpoint/representation-verification.js +420 -0
- package/dist/endpoint/representation-verification.js.map +1 -0
- package/dist/endpoint/representation.d.ts +6 -0
- package/dist/endpoint/representation.d.ts.map +1 -0
- package/dist/endpoint/representation.js +8 -0
- package/dist/endpoint/representation.js.map +1 -0
- package/dist/endpoint/router-worker/index.d.ts +16 -0
- package/dist/endpoint/router-worker/index.d.ts.map +1 -0
- package/dist/endpoint/router-worker/index.js +547 -0
- package/dist/endpoint/router-worker/index.js.map +1 -0
- package/dist/endpoint/router-worker/types.d.ts +183 -0
- package/dist/endpoint/router-worker/types.d.ts.map +1 -0
- package/dist/endpoint/router-worker/types.js +31 -0
- package/dist/endpoint/router-worker/types.js.map +1 -0
- package/dist/endpoint/store/anchors.d.ts +83 -0
- package/dist/endpoint/store/anchors.d.ts.map +1 -0
- package/dist/endpoint/store/anchors.js +471 -0
- package/dist/endpoint/store/anchors.js.map +1 -0
- package/dist/endpoint/store/database/index.d.ts +6 -0
- package/dist/endpoint/store/database/index.d.ts.map +1 -0
- package/dist/endpoint/store/database/index.js +6 -0
- package/dist/endpoint/store/database/index.js.map +1 -0
- package/dist/endpoint/store/database/schema.d.ts +44 -0
- package/dist/endpoint/store/database/schema.d.ts.map +1 -0
- package/dist/endpoint/store/database/schema.js +345 -0
- package/dist/endpoint/store/database/schema.js.map +1 -0
- package/dist/endpoint/store/database/values.d.ts +119 -0
- package/dist/endpoint/store/database/values.d.ts.map +1 -0
- package/dist/endpoint/store/database/values.js +194 -0
- package/dist/endpoint/store/database/values.js.map +1 -0
- package/dist/endpoint/store/deliveries.d.ts +38 -0
- package/dist/endpoint/store/deliveries.d.ts.map +1 -0
- package/dist/endpoint/store/deliveries.js +124 -0
- package/dist/endpoint/store/deliveries.js.map +1 -0
- package/dist/endpoint/store/dissemination.d.ts +27 -0
- package/dist/endpoint/store/dissemination.d.ts.map +1 -0
- package/dist/endpoint/store/dissemination.js +139 -0
- package/dist/endpoint/store/dissemination.js.map +1 -0
- package/dist/endpoint/store/index.d.ts +15 -0
- package/dist/endpoint/store/index.d.ts.map +1 -0
- package/dist/endpoint/store/index.js +76 -0
- package/dist/endpoint/store/index.js.map +1 -0
- package/dist/endpoint/store/management.d.ts +42 -0
- package/dist/endpoint/store/management.d.ts.map +1 -0
- package/dist/endpoint/store/management.js +259 -0
- package/dist/endpoint/store/management.js.map +1 -0
- package/dist/endpoint/store/outbound.d.ts +62 -0
- package/dist/endpoint/store/outbound.d.ts.map +1 -0
- package/dist/endpoint/store/outbound.js +278 -0
- package/dist/endpoint/store/outbound.js.map +1 -0
- package/dist/endpoint/store/records.d.ts +56 -0
- package/dist/endpoint/store/records.d.ts.map +1 -0
- package/dist/endpoint/store/records.js +352 -0
- package/dist/endpoint/store/records.js.map +1 -0
- package/dist/endpoint/store/rows/index.d.ts +138 -0
- package/dist/endpoint/store/rows/index.d.ts.map +1 -0
- package/dist/endpoint/store/rows/index.js +307 -0
- package/dist/endpoint/store/rows/index.js.map +1 -0
- package/dist/endpoint/store/types.d.ts +223 -0
- package/dist/endpoint/store/types.d.ts.map +1 -0
- package/dist/endpoint/store/types.js +15 -0
- package/dist/endpoint/store/types.js.map +1 -0
- package/dist/endpoint/store.d.ts +10 -0
- package/dist/endpoint/store.d.ts.map +1 -0
- package/dist/endpoint/store.js +6 -0
- package/dist/endpoint/store.js.map +1 -0
- package/dist/harness-mcp-contract.d.ts +101 -0
- package/dist/harness-mcp-contract.d.ts.map +1 -0
- package/dist/harness-mcp-contract.js +61 -0
- package/dist/harness-mcp-contract.js.map +1 -0
- package/dist/{harness-mcp-server.d.ts → harness-mcp-http.d.ts} +9 -8
- package/dist/harness-mcp-http.d.ts.map +1 -0
- package/dist/{harness-mcp-server.js → harness-mcp-http.js} +38 -60
- package/dist/harness-mcp-http.js.map +1 -0
- package/dist/harness-mcp-subscription.d.ts +12 -7
- package/dist/harness-mcp-subscription.d.ts.map +1 -1
- package/dist/harness-mcp-subscription.js +113 -100
- package/dist/harness-mcp-subscription.js.map +1 -1
- package/dist/harness-mcp-wire.d.ts +24 -49
- package/dist/harness-mcp-wire.d.ts.map +1 -1
- package/dist/harness-mcp-wire.js +381 -124
- package/dist/harness-mcp-wire.js.map +1 -1
- package/dist/index.d.ts +4 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -10
- package/dist/index.js.map +1 -1
- package/dist/management-runtime.d.ts +217 -0
- package/dist/management-runtime.d.ts.map +1 -0
- package/dist/management-runtime.js +127 -0
- package/dist/management-runtime.js.map +1 -0
- package/dist/server.d.ts +16 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +46 -0
- package/dist/server.js.map +1 -0
- package/dist/server.types-check.d.ts +23 -0
- package/dist/server.types-check.d.ts.map +1 -0
- package/dist/server.types-check.js +7 -0
- package/dist/server.types-check.js.map +1 -0
- package/package.json +24 -52
- package/dist/agent-client.d.ts +0 -5
- package/dist/agent-client.d.ts.map +0 -1
- package/dist/agent-client.js +0 -3
- package/dist/agent-client.js.map +0 -1
- package/dist/auth.d.ts +0 -37
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js +0 -79
- package/dist/auth.js.map +0 -1
- package/dist/bounded-map.d.ts +0 -32
- package/dist/bounded-map.d.ts.map +0 -1
- package/dist/bounded-map.js +0 -79
- package/dist/bounded-map.js.map +0 -1
- package/dist/channel-base/format-cross-conv.d.ts +0 -43
- package/dist/channel-base/format-cross-conv.d.ts.map +0 -1
- package/dist/channel-base/format-cross-conv.js +0 -65
- package/dist/channel-base/format-cross-conv.js.map +0 -1
- package/dist/channel-base/format-group-block.d.ts +0 -48
- package/dist/channel-base/format-group-block.d.ts.map +0 -1
- package/dist/channel-base/format-group-block.js +0 -62
- package/dist/channel-base/format-group-block.js.map +0 -1
- package/dist/channel-base/index.d.ts +0 -12
- package/dist/channel-base/index.d.ts.map +0 -1
- package/dist/channel-base/index.js +0 -16
- package/dist/channel-base/index.js.map +0 -1
- package/dist/channel-core-enrichment.d.ts +0 -38
- package/dist/channel-core-enrichment.d.ts.map +0 -1
- package/dist/channel-core-enrichment.js +0 -217
- package/dist/channel-core-enrichment.js.map +0 -1
- package/dist/channel-core-test-support.d.ts +0 -75
- package/dist/channel-core-test-support.d.ts.map +0 -1
- package/dist/channel-core-test-support.js +0 -74
- package/dist/channel-core-test-support.js.map +0 -1
- package/dist/channel-core.d.ts +0 -306
- package/dist/channel-core.d.ts.map +0 -1
- package/dist/channel-core.js +0 -365
- package/dist/channel-core.js.map +0 -1
- package/dist/config.d.ts +0 -33
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -51
- package/dist/config.js.map +0 -1
- package/dist/config.test-utils.d.ts +0 -24
- package/dist/config.test-utils.d.ts.map +0 -1
- package/dist/config.test-utils.js +0 -57
- package/dist/config.test-utils.js.map +0 -1
- package/dist/harness/client-runtime.d.ts +0 -31
- package/dist/harness/client-runtime.d.ts.map +0 -1
- package/dist/harness/client-runtime.js +0 -121
- package/dist/harness/client-runtime.js.map +0 -1
- package/dist/harness/index.d.ts +0 -5
- package/dist/harness/index.d.ts.map +0 -1
- package/dist/harness/index.js +0 -5
- package/dist/harness/index.js.map +0 -1
- package/dist/harness/runtime.d.ts +0 -301
- package/dist/harness/runtime.d.ts.map +0 -1
- package/dist/harness/runtime.js +0 -165
- package/dist/harness/runtime.js.map +0 -1
- package/dist/harness-client.d.ts +0 -47
- package/dist/harness-client.d.ts.map +0 -1
- package/dist/harness-client.js +0 -76
- package/dist/harness-client.js.map +0 -1
- package/dist/harness-context-projection.d.ts +0 -35
- package/dist/harness-context-projection.d.ts.map +0 -1
- package/dist/harness-context-projection.js +0 -123
- package/dist/harness-context-projection.js.map +0 -1
- package/dist/harness-mcp-server.d.ts.map +0 -1
- package/dist/harness-mcp-server.js.map +0 -1
- package/dist/local-paths.d.ts +0 -11
- package/dist/local-paths.d.ts.map +0 -1
- package/dist/local-paths.js +0 -21
- package/dist/local-paths.js.map +0 -1
- package/dist/message-rendering.d.ts +0 -4
- package/dist/message-rendering.d.ts.map +0 -1
- package/dist/message-rendering.js +0 -8
- package/dist/message-rendering.js.map +0 -1
- package/dist/moltzapd-catalog.d.ts +0 -35
- package/dist/moltzapd-catalog.d.ts.map +0 -1
- package/dist/moltzapd-catalog.js +0 -117
- package/dist/moltzapd-catalog.js.map +0 -1
- package/dist/moltzapd-child-ipc.d.ts +0 -26
- package/dist/moltzapd-child-ipc.d.ts.map +0 -1
- package/dist/moltzapd-child-ipc.js +0 -31
- package/dist/moltzapd-child-ipc.js.map +0 -1
- package/dist/moltzapd-child.d.ts +0 -55
- package/dist/moltzapd-child.d.ts.map +0 -1
- package/dist/moltzapd-child.js +0 -225
- package/dist/moltzapd-child.js.map +0 -1
- package/dist/moltzapd-main.d.ts +0 -3
- package/dist/moltzapd-main.d.ts.map +0 -1
- package/dist/moltzapd-main.js +0 -18
- package/dist/moltzapd-main.js.map +0 -1
- package/dist/moltzapd-registration.d.ts +0 -40
- package/dist/moltzapd-registration.d.ts.map +0 -1
- package/dist/moltzapd-registration.js +0 -59
- package/dist/moltzapd-registration.js.map +0 -1
- package/dist/moltzapd.d.ts +0 -85
- package/dist/moltzapd.d.ts.map +0 -1
- package/dist/moltzapd.js +0 -150
- package/dist/moltzapd.js.map +0 -1
- package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts +0 -53
- package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts.map +0 -1
- package/dist/notification/__tests__/subscribe-signatures.types-check.js +0 -29
- package/dist/notification/__tests__/subscribe-signatures.types-check.js.map +0 -1
- package/dist/notification/errors.d.ts +0 -41
- package/dist/notification/errors.d.ts.map +0 -1
- package/dist/notification/errors.js +0 -24
- package/dist/notification/errors.js.map +0 -1
- package/dist/notification/index.d.ts +0 -6
- package/dist/notification/index.d.ts.map +0 -1
- package/dist/notification/index.js +0 -6
- package/dist/notification/index.js.map +0 -1
- package/dist/notification/stream.d.ts +0 -75
- package/dist/notification/stream.d.ts.map +0 -1
- package/dist/notification/stream.js +0 -30
- package/dist/notification/stream.js.map +0 -1
- package/dist/notification/trace.d.ts +0 -10
- package/dist/notification/trace.d.ts.map +0 -1
- package/dist/notification/trace.js +0 -34
- package/dist/notification/trace.js.map +0 -1
- package/dist/pagination.d.ts +0 -52
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pagination.js +0 -51
- package/dist/pagination.js.map +0 -1
- package/dist/presentation/index.d.ts +0 -3
- package/dist/presentation/index.d.ts.map +0 -1
- package/dist/presentation/index.js +0 -3
- package/dist/presentation/index.js.map +0 -1
- package/dist/presentation/state.d.ts +0 -77
- package/dist/presentation/state.d.ts.map +0 -1
- package/dist/presentation/state.js +0 -211
- package/dist/presentation/state.js.map +0 -1
- package/dist/profile.d.ts +0 -106
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js +0 -171
- package/dist/profile.js.map +0 -1
- package/dist/service-event-trace.d.ts +0 -15
- package/dist/service-event-trace.d.ts.map +0 -1
- package/dist/service-event-trace.js +0 -35
- package/dist/service-event-trace.js.map +0 -1
- package/dist/service.d.ts +0 -228
- package/dist/service.d.ts.map +0 -1
- package/dist/service.js +0 -485
- package/dist/service.js.map +0 -1
- package/dist/test-utils/channel-service-fixture.d.ts +0 -53
- package/dist/test-utils/channel-service-fixture.d.ts.map +0 -1
- package/dist/test-utils/channel-service-fixture.js +0 -178
- package/dist/test-utils/channel-service-fixture.js.map +0 -1
- package/dist/test-utils/fake-service.d.ts +0 -82
- package/dist/test-utils/fake-service.d.ts.map +0 -1
- package/dist/test-utils/fake-service.js +0 -108
- package/dist/test-utils/fake-service.js.map +0 -1
- package/dist/test-utils/harness.d.ts +0 -27
- package/dist/test-utils/harness.d.ts.map +0 -1
- package/dist/test-utils/harness.js +0 -33
- package/dist/test-utils/harness.js.map +0 -1
- package/dist/test-utils/ids.d.ts +0 -21
- package/dist/test-utils/ids.d.ts.map +0 -1
- package/dist/test-utils/ids.js +0 -68
- package/dist/test-utils/ids.js.map +0 -1
- package/dist/test-utils/index.d.ts +0 -56
- package/dist/test-utils/index.d.ts.map +0 -1
- package/dist/test-utils/index.js +0 -67
- package/dist/test-utils/index.js.map +0 -1
- package/dist/test-utils/process/reserve-port.d.ts +0 -20
- package/dist/test-utils/process/reserve-port.d.ts.map +0 -1
- package/dist/test-utils/process/reserve-port.js +0 -41
- package/dist/test-utils/process/reserve-port.js.map +0 -1
- package/dist/test-utils/standalone-provisioning.d.ts +0 -22
- package/dist/test-utils/standalone-provisioning.d.ts.map +0 -1
- package/dist/test-utils/standalone-provisioning.js +0 -17
- package/dist/test-utils/standalone-provisioning.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/agent-client.js
DELETED
package/dist/agent-client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-client.js","sourceRoot":"","sources":["../src/agent-client.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/auth.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import { register } from "@moltzap/protocol/identity";
|
|
3
|
-
import type { ResultOf } from "@moltzap/protocol/rpc";
|
|
4
|
-
/**
|
|
5
|
-
* HTTP response from the agent registration endpoints
|
|
6
|
-
* (`/api/v1/auth/register`).
|
|
7
|
-
*/
|
|
8
|
-
export type RegisterResponse = ResultOf<typeof register>;
|
|
9
|
-
/** Options for {@link registerAgent}. */
|
|
10
|
-
export interface RegisterAgentOptions {
|
|
11
|
-
description?: string;
|
|
12
|
-
inviteCode?: string;
|
|
13
|
-
}
|
|
14
|
-
declare const RegisterAgentError_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 & {
|
|
15
|
-
readonly _tag: "RegisterAgentError";
|
|
16
|
-
} & Readonly<A>;
|
|
17
|
-
/** Reports register agent failures. */
|
|
18
|
-
export declare class RegisterAgentError extends RegisterAgentError_base<{
|
|
19
|
-
readonly message: string;
|
|
20
|
-
readonly cause?: unknown;
|
|
21
|
-
}> {
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Register a new agent via HTTP. Thin wrapper around the agent-registration
|
|
25
|
-
* endpoints — the WebSocket dance is `MoltZapAgentClient`'s job; this just
|
|
26
|
-
* returns the credentials the caller feeds it as `agentKey` at construction.
|
|
27
|
-
*
|
|
28
|
-
* Uses the public `/api/v1/auth/register` endpoint. Server boot policy owns
|
|
29
|
-
* the registered agent immediately and returns the credential once.
|
|
30
|
-
* @param baseUrl Value supplied to the operation.
|
|
31
|
-
* @param name Name of the operation.
|
|
32
|
-
* @param opts Value supplied to the operation.
|
|
33
|
-
* @returns The register agent request result.
|
|
34
|
-
*/
|
|
35
|
-
export declare const registerAgent: (baseUrl: string, name: string, opts?: RegisterAgentOptions) => Effect.Effect<RegisterResponse, RegisterAgentError>;
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=auth.d.ts.map
|
package/dist/auth.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAMA,OAAO,EAAQ,MAAM,EAAkB,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEzD,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;;;;AASD,uCAAuC;AACvC,qBAAa,kBAAmB,SAAQ,wBAAuC;IAC7E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;CAAG;AAOL;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,YACf,MAAM,QACT,MAAM,SACN,oBAAoB,KACzB,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,CAgBlD,CAAC"}
|
package/dist/auth.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { HttpClient, HttpClientRequest, } from "@effect/platform";
|
|
2
|
-
import { NodeHttpClient } from "@effect/platform-node";
|
|
3
|
-
import { Data, Effect, Either, Schema } from "effect";
|
|
4
|
-
import { register } from "@moltzap/protocol/identity";
|
|
5
|
-
const PUBLIC_PATH = "/api/v1/auth/register";
|
|
6
|
-
const HTTP_SUCCESS_STATUS_MIN = 200;
|
|
7
|
-
const HTTP_REDIRECT_STATUS_MIN = 300;
|
|
8
|
-
const decodeRegisterBody = Schema.decodeUnknown(register.paramsSchema);
|
|
9
|
-
const encodeRegisterBody = Schema.encode(register.paramsSchema);
|
|
10
|
-
const decodeRegisterResult = Schema.decodeUnknown(register.resultSchema);
|
|
11
|
-
/** Reports register agent failures. */
|
|
12
|
-
export class RegisterAgentError extends Data.TaggedError("RegisterAgentError") {
|
|
13
|
-
}
|
|
14
|
-
const registerAgentError = (message, cause) => new RegisterAgentError({ message, cause });
|
|
15
|
-
/**
|
|
16
|
-
* Register a new agent via HTTP. Thin wrapper around the agent-registration
|
|
17
|
-
* endpoints — the WebSocket dance is `MoltZapAgentClient`'s job; this just
|
|
18
|
-
* returns the credentials the caller feeds it as `agentKey` at construction.
|
|
19
|
-
*
|
|
20
|
-
* Uses the public `/api/v1/auth/register` endpoint. Server boot policy owns
|
|
21
|
-
* the registered agent immediately and returns the credential once.
|
|
22
|
-
* @param baseUrl Value supplied to the operation.
|
|
23
|
-
* @param name Name of the operation.
|
|
24
|
-
* @param opts Value supplied to the operation.
|
|
25
|
-
* @returns The register agent request result.
|
|
26
|
-
*/
|
|
27
|
-
export const registerAgent = (baseUrl, name, opts = {}) => registerAgentRequest(baseUrl, name, opts).pipe(Effect.provide(NodeHttpClient.layer), Effect.either, Effect.flatMap(Either.match({
|
|
28
|
-
onLeft: (cause) => Effect.fail(cause instanceof RegisterAgentError
|
|
29
|
-
? cause
|
|
30
|
-
: registerAgentError("Register request failed", cause)),
|
|
31
|
-
onRight: (value) => Effect.succeed(value),
|
|
32
|
-
})), Effect.withSpan("registerAgent"));
|
|
33
|
-
function registerAgentRequest(baseUrl, name, opts) {
|
|
34
|
-
return Effect.gen(function* () {
|
|
35
|
-
const client = yield* HttpClient.HttpClient;
|
|
36
|
-
const body = yield* registerAgentBody(name, opts);
|
|
37
|
-
const request = registerHttpRequest(baseUrl, PUBLIC_PATH, body);
|
|
38
|
-
const response = yield* client
|
|
39
|
-
.execute(request)
|
|
40
|
-
.pipe(Effect.mapError((cause) => registerAgentError("Register request failed", cause)));
|
|
41
|
-
return yield* isSuccessStatus(response.status)
|
|
42
|
-
? decodeRegisterResponse(response)
|
|
43
|
-
: failRegisterStatus(response);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function registerAgentBody(name, opts) {
|
|
47
|
-
return decodeRegisterBody({
|
|
48
|
-
name,
|
|
49
|
-
...(opts?.description !== undefined
|
|
50
|
-
? { description: opts.description }
|
|
51
|
-
: {}),
|
|
52
|
-
...(opts?.inviteCode !== undefined ? { inviteCode: opts.inviteCode } : {}),
|
|
53
|
-
}).pipe(Effect.flatMap(encodeRegisterBody), Effect.mapError((cause) => registerAgentError("Register request body decode failed", cause)));
|
|
54
|
-
}
|
|
55
|
-
function registerHttpRequest(baseUrl, path, body) {
|
|
56
|
-
return HttpClientRequest.post(`${baseUrl}${path}`).pipe(HttpClientRequest.setHeader("Content-Type", "application/json"), HttpClientRequest.bodyUnsafeJson(body));
|
|
57
|
-
}
|
|
58
|
-
function isSuccessStatus(status) {
|
|
59
|
-
return status >= HTTP_SUCCESS_STATUS_MIN && status < HTTP_REDIRECT_STATUS_MIN;
|
|
60
|
-
}
|
|
61
|
-
function failRegisterStatus(response) {
|
|
62
|
-
return Effect.gen(function* () {
|
|
63
|
-
const text = yield* decodeResponseText(response);
|
|
64
|
-
return yield* registerAgentError(`Register failed: ${response.status} ${text}`);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function decodeResponseText(response) {
|
|
68
|
-
return response.text.pipe(Effect.either, Effect.flatMap(Either.match({
|
|
69
|
-
onLeft: (cause) => Effect.fail(registerAgentError("Register error response read failed", cause)),
|
|
70
|
-
onRight: Effect.succeed,
|
|
71
|
-
})));
|
|
72
|
-
}
|
|
73
|
-
function decodeRegisterResponse(response) {
|
|
74
|
-
return response.json.pipe(Effect.either, Effect.flatMap(Either.match({
|
|
75
|
-
onLeft: (cause) => Effect.fail(registerAgentError("Register response decode failed", cause)),
|
|
76
|
-
onRight: (value) => decodeRegisterResult(value).pipe(Effect.mapError((cause) => registerAgentError("Register response decode failed", cause))),
|
|
77
|
-
})));
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=auth.js.map
|
package/dist/auth.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,iBAAiB,GAElB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AA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AO,CACZ,MAAM,CAAC,KAAK,CAAC;QACX,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAChB,MAAM,CAAC,IAAI,CACT,kBAAkB,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAC7D;QACH,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,oBAAoB,CAAC,KAAK,CAAC,CAAC,IAAI,CAC9B,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CACxB,kBAAkB,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAC7D,CACF;KACJ,CAAC,CACH,CACF,CAAC;AACJ,CAAC"}
|
package/dist/bounded-map.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Bounded insertion-ordered map backing the client's per-key caches.
|
|
3
|
-
*
|
|
4
|
-
* The service dedup window and channel adapters' own per-host tables need the
|
|
5
|
-
* same fixed-capacity store. It sits at the package root rather than in
|
|
6
|
-
* `channel-base/` because
|
|
7
|
-
* that barrel re-exports the root modules, so owning it there would close a
|
|
8
|
-
* folder cycle; `channel-base` re-exports it for adapters instead.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Insertion-ordered map with a fixed entry capacity.
|
|
12
|
-
*
|
|
13
|
-
* Setting an existing key refreshes its position without evicting another
|
|
14
|
-
* entry. Reads preserve insertion order.
|
|
15
|
-
*/
|
|
16
|
-
export declare class BoundedMap<K, V> implements ReadonlyMap<K, V> {
|
|
17
|
-
private readonly entriesStore;
|
|
18
|
-
readonly capacity: number;
|
|
19
|
-
constructor(capacity: number);
|
|
20
|
-
get size(): number;
|
|
21
|
-
get(key: K): V | undefined;
|
|
22
|
-
has(key: K): boolean;
|
|
23
|
-
delete(key: K): boolean;
|
|
24
|
-
clear(): void;
|
|
25
|
-
set(key: K, value: V): readonly [K, V] | undefined;
|
|
26
|
-
entries(): MapIterator<[K, V]>;
|
|
27
|
-
keys(): MapIterator<K>;
|
|
28
|
-
values(): MapIterator<V>;
|
|
29
|
-
forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: unknown): void;
|
|
30
|
-
[Symbol.iterator](): MapIterator<[K, V]>;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=bounded-map.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bounded-map.d.ts","sourceRoot":"","sources":["../src/bounded-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH;;;;;GAKG;AACH,qBAAa,UAAU,CAAC,CAAC,EAAE,CAAC,CAAE,YAAW,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;IACxD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAmB;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,YAAY,QAAQ,EAAE,MAAM,EAK3B;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAEzB;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAEnB;IAED,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAEtB;IAED,KAAK,IAAI,IAAI,CAEZ;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAejD;IAED,OAAO,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAE7B;IAED,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC,CAErB;IAED,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,CAEvB;IAED,OAAO,CACL,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAC9D,OAAO,CAAC,EAAE,OAAO,GAChB,IAAI,CAIN;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAEvC;CACF"}
|
package/dist/bounded-map.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Bounded insertion-ordered map backing the client's per-key caches.
|
|
3
|
-
*
|
|
4
|
-
* The service dedup window and channel adapters' own per-host tables need the
|
|
5
|
-
* same fixed-capacity store. It sits at the package root rather than in
|
|
6
|
-
* `channel-base/` because
|
|
7
|
-
* that barrel re-exports the root modules, so owning it there would close a
|
|
8
|
-
* folder cycle; `channel-base` re-exports it for adapters instead.
|
|
9
|
-
*/
|
|
10
|
-
import { Data } from "effect";
|
|
11
|
-
class InvalidBoundedMapCapacity extends Data.TaggedError("InvalidBoundedMapCapacity") {
|
|
12
|
-
get message() {
|
|
13
|
-
return `BoundedMap capacity must be a positive safe integer: ${this.capacity}`;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Insertion-ordered map with a fixed entry capacity.
|
|
18
|
-
*
|
|
19
|
-
* Setting an existing key refreshes its position without evicting another
|
|
20
|
-
* entry. Reads preserve insertion order.
|
|
21
|
-
*/
|
|
22
|
-
export class BoundedMap {
|
|
23
|
-
entriesStore = new Map();
|
|
24
|
-
capacity;
|
|
25
|
-
constructor(capacity) {
|
|
26
|
-
if (!Number.isSafeInteger(capacity) || capacity <= 0) {
|
|
27
|
-
throw new InvalidBoundedMapCapacity({ capacity });
|
|
28
|
-
}
|
|
29
|
-
this.capacity = capacity;
|
|
30
|
-
}
|
|
31
|
-
get size() {
|
|
32
|
-
return this.entriesStore.size;
|
|
33
|
-
}
|
|
34
|
-
get(key) {
|
|
35
|
-
return this.entriesStore.get(key);
|
|
36
|
-
}
|
|
37
|
-
has(key) {
|
|
38
|
-
return this.entriesStore.has(key);
|
|
39
|
-
}
|
|
40
|
-
delete(key) {
|
|
41
|
-
return this.entriesStore.delete(key);
|
|
42
|
-
}
|
|
43
|
-
clear() {
|
|
44
|
-
this.entriesStore.clear();
|
|
45
|
-
}
|
|
46
|
-
set(key, value) {
|
|
47
|
-
if (this.entriesStore.has(key)) {
|
|
48
|
-
this.entriesStore.delete(key);
|
|
49
|
-
}
|
|
50
|
-
this.entriesStore.set(key, value);
|
|
51
|
-
let evicted;
|
|
52
|
-
if (this.entriesStore.size > this.capacity) {
|
|
53
|
-
const oldest = this.entriesStore.entries().next();
|
|
54
|
-
if (!oldest.done) {
|
|
55
|
-
this.entriesStore.delete(oldest.value[0]);
|
|
56
|
-
evicted = oldest.value;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return evicted;
|
|
60
|
-
}
|
|
61
|
-
entries() {
|
|
62
|
-
return this.entriesStore.entries();
|
|
63
|
-
}
|
|
64
|
-
keys() {
|
|
65
|
-
return this.entriesStore.keys();
|
|
66
|
-
}
|
|
67
|
-
values() {
|
|
68
|
-
return this.entriesStore.values();
|
|
69
|
-
}
|
|
70
|
-
forEach(callbackfn, thisArg) {
|
|
71
|
-
this.entriesStore.forEach((value, key) => {
|
|
72
|
-
callbackfn.call(thisArg, value, key, this);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
[Symbol.iterator]() {
|
|
76
|
-
return this.entries();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=bounded-map.js.map
|
package/dist/bounded-map.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bounded-map.js","sourceRoot":"","sources":["../src/bounded-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,yBAA0B,SAAQ,IAAI,CAAC,WAAW,CACtD,2BAA2B,CACG;IAC9B,IAAa,OAAO;QAClB,OAAO,wDAAwD,IAAI,CAAC,QAAQ,EA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,EAAE,CAAC,IAAI,EAAE,CAAC;YAClD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBACjB,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC1C,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;YACzB,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;IACrC,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAClC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;IACpC,CAAC;IAED,OAAO,CACL,UAA8D,EAC9D,OAAiB;QAEjB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YACvC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC;QACf,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Channel-base `formatCrossConv` — shared cross-conversation message
|
|
3
|
-
* formatter parameterized by markup variant or per-channel formatter
|
|
4
|
-
* callback.
|
|
5
|
-
*
|
|
6
|
-
* Used by the openclaw channel (markup variant `"json-header"`) and the
|
|
7
|
-
* nanoclaw channel (markup variant `"xml-system-reminder"`). Behavioral
|
|
8
|
-
* parity across both is locked via golden-snapshot fixtures.
|
|
9
|
-
*/
|
|
10
|
-
import { type CrossConvMessage } from "../service.js";
|
|
11
|
-
/** Re-exports the public API from `current module`. */
|
|
12
|
-
export type { CrossConvMessage };
|
|
13
|
-
/** Represents cross conv markup values. */
|
|
14
|
-
export type CrossConvMarkup = "json-header" | "xml-system-reminder";
|
|
15
|
-
/** Represents cross conv formatter values. */
|
|
16
|
-
export type CrossConvFormatter = (messages: readonly CrossConvMessage[], opts: {
|
|
17
|
-
readonly ownAgentId: string;
|
|
18
|
-
}) => string;
|
|
19
|
-
/**
|
|
20
|
-
* Format messages from conversations other than the active conversation.
|
|
21
|
-
*
|
|
22
|
-
* Markup variants:
|
|
23
|
-
* - `"json-header"`: openclaw output. Header is
|
|
24
|
-
* `"Messages (untrusted metadata):"` followed by a fenced JSON array.
|
|
25
|
-
* - `"xml-system-reminder"`: nanoclaw output. `<messages>` wrapper
|
|
26
|
-
* around `<message>` entries with `sender`/`conversation`/`time`
|
|
27
|
-
* attributes; sender/conv/time/text all run through
|
|
28
|
-
* `sanitizeForSystemReminder`.
|
|
29
|
-
*
|
|
30
|
-
* Or pass a custom `formatter` callback — channel-base owns the empty-check
|
|
31
|
-
* + ownAgentId disambiguation; the callback owns the markup.
|
|
32
|
-
* @param messages Messages eligible for cross-conversation rendering.
|
|
33
|
-
* @param opts Markup selection or custom formatter with the current agent id.
|
|
34
|
-
* @returns The formatted block, or `null` when `messages` is empty.
|
|
35
|
-
*/
|
|
36
|
-
export declare function formatCrossConv(messages: readonly CrossConvMessage[], opts: {
|
|
37
|
-
readonly ownAgentId: string;
|
|
38
|
-
readonly markup: CrossConvMarkup;
|
|
39
|
-
} | {
|
|
40
|
-
readonly ownAgentId: string;
|
|
41
|
-
readonly formatter: CrossConvFormatter;
|
|
42
|
-
}): string | null;
|
|
43
|
-
//# sourceMappingURL=format-cross-conv.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-cross-conv.d.ts","sourceRoot":"","sources":["../../src/channel-base/format-cross-conv.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,eAAe,CAAC;AAEvB,uDAAuD;AACvD,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC,2CAA2C;AAC3C,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,qBAAqB,CAAC;AAEpE,8CAA8C;AAC9C,MAAM,MAAM,kBAAkB,GAAG,CAC/B,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EACrC,IAAI,EAAE;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,KAClC,MAAM,CAAC;AAmDZ;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EACrC,IAAI,EACA;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;CAAE,GACjE;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAA;CAAE,GAC1E,MAAM,GAAG,IAAI,CAWf"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Channel-base `formatCrossConv` — shared cross-conversation message
|
|
3
|
-
* formatter parameterized by markup variant or per-channel formatter
|
|
4
|
-
* callback.
|
|
5
|
-
*
|
|
6
|
-
* Used by the openclaw channel (markup variant `"json-header"`) and the
|
|
7
|
-
* nanoclaw channel (markup variant `"xml-system-reminder"`). Behavioral
|
|
8
|
-
* parity across both is locked via golden-snapshot fixtures.
|
|
9
|
-
*/
|
|
10
|
-
import { sanitizeForSystemReminder, } from "../service.js";
|
|
11
|
-
const CROSS_CONV_HEADER_JSON = "Messages (untrusted metadata):";
|
|
12
|
-
const JSON_INDENT_SPACES = 2;
|
|
13
|
-
function normalizeMessage(message, opts) {
|
|
14
|
-
return {
|
|
15
|
-
conversation: message.conversationName ?? `DM with @${message.senderName}`,
|
|
16
|
-
sender: message.senderId === opts.ownAgentId ? "You" : message.senderName,
|
|
17
|
-
text: message.text,
|
|
18
|
-
timestamp: message.timestamp,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function formatJsonHeader(messages, opts) {
|
|
22
|
-
const items = messages.map((m) => normalizeMessage(m, opts));
|
|
23
|
-
return `${CROSS_CONV_HEADER_JSON}\n\`\`\`json\n${JSON.stringify(items, null, JSON_INDENT_SPACES)}\n\`\`\``;
|
|
24
|
-
}
|
|
25
|
-
function formatXmlSystemReminder(messages, opts) {
|
|
26
|
-
const lines = messages.map((m) => {
|
|
27
|
-
const item = normalizeMessage(m, opts);
|
|
28
|
-
const sender = sanitizeForSystemReminder(item.sender);
|
|
29
|
-
const conv = sanitizeForSystemReminder(item.conversation);
|
|
30
|
-
const text = sanitizeForSystemReminder(item.text);
|
|
31
|
-
const time = sanitizeForSystemReminder(item.timestamp);
|
|
32
|
-
return `<message sender="${sender}" conversation="${conv}" time="${time}">${text}</message>`;
|
|
33
|
-
});
|
|
34
|
-
return ["<messages>", ...lines, "</messages>"].join("\n");
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Format messages from conversations other than the active conversation.
|
|
38
|
-
*
|
|
39
|
-
* Markup variants:
|
|
40
|
-
* - `"json-header"`: openclaw output. Header is
|
|
41
|
-
* `"Messages (untrusted metadata):"` followed by a fenced JSON array.
|
|
42
|
-
* - `"xml-system-reminder"`: nanoclaw output. `<messages>` wrapper
|
|
43
|
-
* around `<message>` entries with `sender`/`conversation`/`time`
|
|
44
|
-
* attributes; sender/conv/time/text all run through
|
|
45
|
-
* `sanitizeForSystemReminder`.
|
|
46
|
-
*
|
|
47
|
-
* Or pass a custom `formatter` callback — channel-base owns the empty-check
|
|
48
|
-
* + ownAgentId disambiguation; the callback owns the markup.
|
|
49
|
-
* @param messages Messages eligible for cross-conversation rendering.
|
|
50
|
-
* @param opts Markup selection or custom formatter with the current agent id.
|
|
51
|
-
* @returns The formatted block, or `null` when `messages` is empty.
|
|
52
|
-
*/
|
|
53
|
-
export function formatCrossConv(messages, opts) {
|
|
54
|
-
if (messages.length === 0) {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
if ("formatter" in opts) {
|
|
58
|
-
return opts.formatter(messages, { ownAgentId: opts.ownAgentId });
|
|
59
|
-
}
|
|
60
|
-
if (opts.markup === "json-header") {
|
|
61
|
-
return formatJsonHeader(messages, { ownAgentId: opts.ownAgentId });
|
|
62
|
-
}
|
|
63
|
-
return formatXmlSystemReminder(messages, { ownAgentId: opts.ownAgentId });
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=format-cross-conv.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-cross-conv.js","sourceRoot":"","sources":["../../src/channel-base/format-cross-conv.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAcvB,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;AAChE,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAS7B,SAAS,gBAAgB,CACvB,OAAyB,EACzB,IAAqC;IAErC,OAAO;QACL,YAAY,EAAE,OAAO,CAAC,gBAAgB,IAAI,YAAY,OAAO,CAAC,UAAU,EAAE;QAC1E,MAAM,EAAE,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU;QACzE,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CACvB,QAAqC,EACrC,IAAqC;IAErC,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IAC7D,OAAO,GAAG,sBAAsB,iBAAiB,IAAI,CAAC,SAAS,CAC7D,KAAK,EACL,IAAI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C,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Channel-base group-block helpers.
|
|
3
|
-
*
|
|
4
|
-
* `formatGroupBlock` renders the group block for nanoclaw. The shared
|
|
5
|
-
* type-narrowing predicate `getGroupFields` is consumed by openclaw
|
|
6
|
-
* (deriving `groupSubject` / `groupMembers` for the OpenClaw context) and
|
|
7
|
-
* nanoclaw (gating the group-block render).
|
|
8
|
-
*/
|
|
9
|
-
import type { EnrichedConversationMeta } from "../channel-core.js";
|
|
10
|
-
import type { CrossConvMarkup } from "./format-cross-conv.js";
|
|
11
|
-
/** Describes group fields. */
|
|
12
|
-
export interface GroupFields {
|
|
13
|
-
readonly name?: string;
|
|
14
|
-
readonly participants: readonly string[];
|
|
15
|
-
}
|
|
16
|
-
/** Represents group formatter values. */
|
|
17
|
-
export type GroupFormatter = (fields: GroupFields) => string;
|
|
18
|
-
/**
|
|
19
|
-
* Returns `{ name, participants }` when `meta?.type === "group"`; else `null`.
|
|
20
|
-
* Pure narrowing helper — callers use the non-null return to drive
|
|
21
|
-
* `formatGroupBlock` or per-channel field extraction (openclaw's
|
|
22
|
-
* `groupSubject` + `groupMembers`).
|
|
23
|
-
* @param meta Value supplied to the operation.
|
|
24
|
-
* @returns The get group fields result.
|
|
25
|
-
*/
|
|
26
|
-
export declare function getGroupFields(meta?: EnrichedConversationMeta): GroupFields | null;
|
|
27
|
-
/**
|
|
28
|
-
* Returns the formatted group block.
|
|
29
|
-
*
|
|
30
|
-
* Markup variants:
|
|
31
|
-
* - `"xml-system-reminder"`: a `<system-reminder>` block with group
|
|
32
|
-
* name + participants (nanoclaw output).
|
|
33
|
-
* - `"json-header"`: empty string. Openclaw does not render a group block;
|
|
34
|
-
* it consumes `getGroupFields` directly to derive its OpenClaw-side
|
|
35
|
-
* `groupSubject` / `groupMembers` fields. The empty-string return makes
|
|
36
|
-
* "openclaw renders no group block" an explicit, fixtured output.
|
|
37
|
-
*
|
|
38
|
-
* Or pass a custom `formatter` callback.
|
|
39
|
-
* @param fields Value supplied to the operation.
|
|
40
|
-
* @param opts Value supplied to the operation.
|
|
41
|
-
* @returns The format group block result.
|
|
42
|
-
*/
|
|
43
|
-
export declare function formatGroupBlock(fields: GroupFields, opts: {
|
|
44
|
-
readonly markup: CrossConvMarkup;
|
|
45
|
-
} | {
|
|
46
|
-
readonly formatter: GroupFormatter;
|
|
47
|
-
}): string;
|
|
48
|
-
//# sourceMappingURL=format-group-block.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-group-block.d.ts","sourceRoot":"","sources":["../../src/channel-base/format-group-block.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,8BAA8B;AAC9B,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,WAAW,KAAK,MAAM,CAAC;AAK7D;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,IAAI,CAAC,EAAE,wBAAwB,GAC9B,WAAW,GAAG,IAAI,CAKpB;AAgBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,IAAI,EACA;IAAE,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;CAAE,GACpC;IAAE,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAA;CAAE,GACzC,MAAM,CAQR"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Channel-base group-block helpers.
|
|
3
|
-
*
|
|
4
|
-
* `formatGroupBlock` renders the group block for nanoclaw. The shared
|
|
5
|
-
* type-narrowing predicate `getGroupFields` is consumed by openclaw
|
|
6
|
-
* (deriving `groupSubject` / `groupMembers` for the OpenClaw context) and
|
|
7
|
-
* nanoclaw (gating the group-block render).
|
|
8
|
-
*/
|
|
9
|
-
import { sanitizeForSystemReminder } from "../service.js";
|
|
10
|
-
const UNNAMED_GROUP_FALLBACK = "(unnamed)";
|
|
11
|
-
const NO_PARTICIPANTS_FALLBACK = "(none listed)";
|
|
12
|
-
/**
|
|
13
|
-
* Returns `{ name, participants }` when `meta?.type === "group"`; else `null`.
|
|
14
|
-
* Pure narrowing helper — callers use the non-null return to drive
|
|
15
|
-
* `formatGroupBlock` or per-channel field extraction (openclaw's
|
|
16
|
-
* `groupSubject` + `groupMembers`).
|
|
17
|
-
* @param meta Value supplied to the operation.
|
|
18
|
-
* @returns The get group fields result.
|
|
19
|
-
*/
|
|
20
|
-
export function getGroupFields(meta) {
|
|
21
|
-
if (meta?.type !== "group") {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
return { name: meta.name, participants: meta.participants };
|
|
25
|
-
}
|
|
26
|
-
function formatXmlSystemReminder(fields) {
|
|
27
|
-
const safeName = sanitizeForSystemReminder(fields.name ?? UNNAMED_GROUP_FALLBACK);
|
|
28
|
-
const safeParticipants = fields.participants.map(sanitizeForSystemReminder);
|
|
29
|
-
return [
|
|
30
|
-
"<system-reminder>",
|
|
31
|
-
"This is a group conversation.",
|
|
32
|
-
`Group name: ${safeName}`,
|
|
33
|
-
`Participants (${fields.participants.length}): ${safeParticipants.join(", ") || NO_PARTICIPANTS_FALLBACK}`,
|
|
34
|
-
"</system-reminder>",
|
|
35
|
-
].join("\n");
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Returns the formatted group block.
|
|
39
|
-
*
|
|
40
|
-
* Markup variants:
|
|
41
|
-
* - `"xml-system-reminder"`: a `<system-reminder>` block with group
|
|
42
|
-
* name + participants (nanoclaw output).
|
|
43
|
-
* - `"json-header"`: empty string. Openclaw does not render a group block;
|
|
44
|
-
* it consumes `getGroupFields` directly to derive its OpenClaw-side
|
|
45
|
-
* `groupSubject` / `groupMembers` fields. The empty-string return makes
|
|
46
|
-
* "openclaw renders no group block" an explicit, fixtured output.
|
|
47
|
-
*
|
|
48
|
-
* Or pass a custom `formatter` callback.
|
|
49
|
-
* @param fields Value supplied to the operation.
|
|
50
|
-
* @param opts Value supplied to the operation.
|
|
51
|
-
* @returns The format group block result.
|
|
52
|
-
*/
|
|
53
|
-
export function formatGroupBlock(fields, opts) {
|
|
54
|
-
if ("formatter" in opts) {
|
|
55
|
-
return opts.formatter(fields);
|
|
56
|
-
}
|
|
57
|
-
if (opts.markup === "xml-system-reminder") {
|
|
58
|
-
return formatXmlSystemReminder(fields);
|
|
59
|
-
}
|
|
60
|
-
return "";
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=format-group-block.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-group-block.js","sourceRoot":"","sources":["../../src/channel-base/format-group-block.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAa1D,MAAM,sBAAsB,GAAG,WAAW,CAAC;AAC3C,MAAM,wBAAwB,GAAG,eAAe,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,IAA+B;IAE/B,IAAI,IAAI,EAAE,IAAI,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;AAC9D,CAAC;AAED,SAAS,uBAAuB,CAAC,MAAmB;IAClD,MAAM,QAAQ,GAAG,yBAAyB,CACxC,MAAM,CAAC,IAAI,IAAI,sBAAsB,CACtC,CAAC;IACF,MAAM,gBAAgB,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAC5E,OAAO;QACL,mBAAmB;QACnB,+BAA+B;QAC/B,eAAe,QAAQ,EAAE;QACzB,iBAAiB,MAAM,CAAC,YAAY,CAAC,MAAM,MAAM,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,wBAAwB,EAAE;QAC1G,oBAAoB;KACrB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAmB,EACnB,IAE0C;IAE1C,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,KAAK,qBAAqB,EAAE,CAAC;QAC1C,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @file Shared channel-adapter primitives for `@moltzap/client/channel-base`. */
|
|
2
|
-
/** Re-exports the public API from `../bounded-map.js`. */
|
|
3
|
-
export { BoundedMap } from "../bounded-map.js";
|
|
4
|
-
/** Re-exports the public API from `./format-cross-conv.js`. */
|
|
5
|
-
export { formatCrossConv } from "./format-cross-conv.js";
|
|
6
|
-
/** Re-exports the public API from `./format-group-block.js`. */
|
|
7
|
-
export { formatGroupBlock, getGroupFields, type GroupFields, } from "./format-group-block.js";
|
|
8
|
-
/** Re-exports the public API from `../channel-core.js`. */
|
|
9
|
-
export { type EnrichedConversationMeta } from "../channel-core.js";
|
|
10
|
-
/** Re-exports the public API from `../service.js`. */
|
|
11
|
-
export { type CrossConvMessage } from "../service.js";
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channel-base/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAGlF,0DAA0D;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,+DAA+D;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,gEAAgE;AAChE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,KAAK,WAAW,GACjB,MAAM,yBAAyB,CAAC;AAKjC,2DAA2D;AAC3D,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,sDAAsD;AACtD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** @file Shared channel-adapter primitives for `@moltzap/client/channel-base`. */
|
|
2
|
-
// Channel adapters import per-key store primitives through channel-base.
|
|
3
|
-
/** Re-exports the public API from `../bounded-map.js`. */
|
|
4
|
-
export { BoundedMap } from "../bounded-map.js";
|
|
5
|
-
/** Re-exports the public API from `./format-cross-conv.js`. */
|
|
6
|
-
export { formatCrossConv } from "./format-cross-conv.js";
|
|
7
|
-
/** Re-exports the public API from `./format-group-block.js`. */
|
|
8
|
-
export { formatGroupBlock, getGroupFields, } from "./format-group-block.js";
|
|
9
|
-
// Presentation shapes only. `MoltZapChannelCore` and `ChannelService` are
|
|
10
|
-
// daemon-side machinery: an adapter that reached them would be building its own
|
|
11
|
-
// transport instead of talking to one through HarnessClient.
|
|
12
|
-
/** Re-exports the public API from `../channel-core.js`. */
|
|
13
|
-
export {} from "../channel-core.js";
|
|
14
|
-
/** Re-exports the public API from `../service.js`. */
|
|
15
|
-
export {} from "../service.js";
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/channel-base/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAElF,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,+DAA+D;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,gEAAgE;AAChE,OAAO,EACL,gBAAgB,EAChB,cAAc,GAEf,MAAM,yBAAyB,CAAC;AAEjC,0EAA0E;AAC1E,gFAAgF;AAChF,6DAA6D;AAC7D,2DAA2D;AAC3D,OAAO,EAAiC,MAAM,oBAAoB,CAAC;AAEnE,sDAAsD;AACtD,OAAO,EAAyB,MAAM,eAAe,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import type { Conversation } from "@moltzap/protocol/conversation";
|
|
3
|
-
import type { AgentCard, AgentId } from "@moltzap/protocol/identity";
|
|
4
|
-
import type { Message } from "@moltzap/protocol/message";
|
|
5
|
-
import type { ChannelService, EnrichedInboundMessage } from "./channel-core.js";
|
|
6
|
-
type ConversationWithParticipants = Conversation & {
|
|
7
|
-
readonly participants: readonly AgentId[];
|
|
8
|
-
};
|
|
9
|
-
interface HarnessTurnProjectionInput {
|
|
10
|
-
readonly context: {
|
|
11
|
-
readonly conversations: readonly ConversationWithParticipants[];
|
|
12
|
-
readonly currentMessages: readonly [Message, ...Message[]];
|
|
13
|
-
readonly crossConversationMessages: readonly Message[];
|
|
14
|
-
};
|
|
15
|
-
readonly agents: readonly AgentCard[];
|
|
16
|
-
readonly ownAgentId: AgentId;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Projects MCP-reconstructed context into the channel-owned enriched shape.
|
|
20
|
-
* @param input Reconstructed messages plus resolved identity information.
|
|
21
|
-
* @param input.context Current and cross-conversation message context.
|
|
22
|
-
* @param input.agents Agent cards used for presentation names.
|
|
23
|
-
* @param input.ownAgentId Active identity used to mark self-authored content.
|
|
24
|
-
* @returns The enriched inbound message exposed by a harness turn.
|
|
25
|
-
*/
|
|
26
|
-
export declare const projectHarnessTurn: ({ context, agents, ownAgentId, }: HarnessTurnProjectionInput) => EnrichedInboundMessage;
|
|
27
|
-
/**
|
|
28
|
-
* Executes the enrich channel message operation.
|
|
29
|
-
* @param service Value supplied to the operation.
|
|
30
|
-
* @param messageOrMessages Value supplied to the operation.
|
|
31
|
-
* @returns The enrich channel message result.
|
|
32
|
-
*/
|
|
33
|
-
export declare function enrichChannelMessage(service: ChannelService, messageOrMessages: Message | readonly Message[]): Effect.Effect<{
|
|
34
|
-
enriched: EnrichedInboundMessage;
|
|
35
|
-
commitContext?: () => void;
|
|
36
|
-
}>;
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=channel-core-enrichment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channel-core-enrichment.d.ts","sourceRoot":"","sources":["../src/channel-core-enrichment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EACV,YAAY,EAEb,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EACV,cAAc,EAGd,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAmM3B,KAAK,4BAA4B,GAAG,YAAY,GAAG;IACjD,QAAQ,CAAC,YAAY,EAAE,SAAS,OAAO,EAAE,CAAC;CAC3C,CAAC;AAEF,UAAU,0BAA0B;IAClC,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,aAAa,EAAE,SAAS,4BAA4B,EAAE,CAAC;QAChE,QAAQ,CAAC,eAAe,EAAE,SAAS,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAC3D,QA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