@moltzap/client 2026.1001.2 → 2026.1004.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/README.md +11 -6
- package/bin/moltzapd +2 -2
- package/dist/{harness-mcp-contract.d.ts → delivery/history-export.d.ts} +94 -136
- package/dist/delivery/history-export.d.ts.map +1 -0
- package/dist/{daemon/runtime → delivery}/history-export.js +36 -3
- package/dist/delivery/history-export.js.map +1 -0
- package/dist/delivery/host-delivery.d.ts +51 -0
- package/dist/delivery/host-delivery.d.ts.map +1 -0
- package/dist/delivery/host-delivery.js +109 -0
- package/dist/delivery/host-delivery.js.map +1 -0
- package/dist/delivery/inbox.d.ts +141 -0
- package/dist/delivery/inbox.d.ts.map +1 -0
- package/dist/delivery/inbox.js +129 -0
- package/dist/delivery/inbox.js.map +1 -0
- package/dist/delivery/index.d.ts +4 -0
- package/dist/delivery/index.d.ts.map +1 -0
- package/dist/delivery/index.js +4 -0
- package/dist/delivery/index.js.map +1 -0
- package/dist/delivery/operations.d.ts +789 -0
- package/dist/delivery/operations.d.ts.map +1 -0
- package/dist/delivery/operations.js +162 -0
- package/dist/delivery/operations.js.map +1 -0
- package/dist/delivery/pass.d.ts +91 -0
- package/dist/delivery/pass.d.ts.map +1 -0
- package/dist/{daemon/runtime/pending-delivery.js → delivery/pass.js} +61 -34
- package/dist/delivery/pass.js.map +1 -0
- package/dist/delivery/send-invocations.d.ts +106 -0
- package/dist/delivery/send-invocations.d.ts.map +1 -0
- package/dist/delivery/send-invocations.js +109 -0
- package/dist/delivery/send-invocations.js.map +1 -0
- package/dist/endpoint/harness-endpoint/capability.d.ts +39 -0
- package/dist/endpoint/harness-endpoint/capability.d.ts.map +1 -0
- package/dist/endpoint/harness-endpoint/capability.js +9 -0
- package/dist/endpoint/harness-endpoint/capability.js.map +1 -0
- package/dist/endpoint/harness-endpoint/events.d.ts +12 -0
- package/dist/endpoint/harness-endpoint/events.d.ts.map +1 -0
- package/dist/endpoint/harness-endpoint/events.js +199 -0
- package/dist/endpoint/harness-endpoint/events.js.map +1 -0
- package/dist/{client-runtime.d.ts → endpoint/harness-endpoint/index.d.ts} +4 -2
- package/dist/endpoint/harness-endpoint/index.d.ts.map +1 -0
- package/dist/{client-runtime.js → endpoint/harness-endpoint/index.js} +115 -115
- package/dist/endpoint/harness-endpoint/index.js.map +1 -0
- package/dist/endpoint/implementation.d.ts +4 -0
- package/dist/endpoint/implementation.d.ts.map +1 -0
- package/dist/endpoint/implementation.js +5 -0
- package/dist/endpoint/implementation.js.map +1 -0
- package/dist/endpoint/mcp/auth.d.ts +31 -0
- package/dist/endpoint/mcp/auth.d.ts.map +1 -0
- package/dist/endpoint/mcp/auth.js +42 -0
- package/dist/endpoint/mcp/auth.js.map +1 -0
- package/dist/endpoint/mcp/event-schemas.d.ts +151 -0
- package/dist/endpoint/mcp/event-schemas.d.ts.map +1 -0
- package/dist/endpoint/mcp/event-schemas.js +72 -0
- package/dist/endpoint/mcp/event-schemas.js.map +1 -0
- package/dist/endpoint/mcp/event-signing.d.ts +62 -0
- package/dist/endpoint/mcp/event-signing.d.ts.map +1 -0
- package/dist/endpoint/mcp/event-signing.js +185 -0
- package/dist/endpoint/mcp/event-signing.js.map +1 -0
- package/dist/endpoint/mcp/events.d.ts +45 -0
- package/dist/endpoint/mcp/events.d.ts.map +1 -0
- package/dist/endpoint/mcp/events.js +296 -0
- package/dist/endpoint/mcp/events.js.map +1 -0
- package/dist/{harness-mcp-http.d.ts → endpoint/mcp/http.d.ts} +1 -1
- package/dist/endpoint/mcp/http.d.ts.map +1 -0
- package/dist/{harness-mcp-http.js → endpoint/mcp/http.js} +1 -1
- package/dist/endpoint/mcp/http.js.map +1 -0
- package/dist/endpoint/mcp/index.d.ts +10 -0
- package/dist/endpoint/mcp/index.d.ts.map +1 -0
- package/dist/endpoint/mcp/index.js +8 -0
- package/dist/endpoint/mcp/index.js.map +1 -0
- package/dist/{management-runtime.d.ts → endpoint/mcp/owner-tools.d.ts} +7 -7
- package/dist/endpoint/mcp/owner-tools.d.ts.map +1 -0
- package/dist/{management-runtime.js → endpoint/mcp/owner-tools.js} +3 -4
- package/dist/endpoint/mcp/owner-tools.js.map +1 -0
- package/dist/endpoint/mcp/schemas.d.ts +60 -0
- package/dist/endpoint/mcp/schemas.d.ts.map +1 -0
- package/dist/endpoint/mcp/schemas.js +116 -0
- package/dist/endpoint/mcp/schemas.js.map +1 -0
- package/dist/{harness-mcp-wire.d.ts → endpoint/mcp/tools.d.ts} +17 -14
- package/dist/endpoint/mcp/tools.d.ts.map +1 -0
- package/dist/{harness-mcp-wire.js → endpoint/mcp/tools.js} +229 -110
- package/dist/endpoint/mcp/tools.js.map +1 -0
- package/dist/endpoint/mcp/webhook.d.ts +15 -0
- package/dist/endpoint/mcp/webhook.d.ts.map +1 -0
- package/dist/endpoint/mcp/webhook.js +359 -0
- package/dist/endpoint/mcp/webhook.js.map +1 -0
- package/dist/identity/credentials.d.ts +46 -0
- package/dist/identity/credentials.d.ts.map +1 -0
- package/dist/identity/credentials.js +55 -0
- package/dist/identity/credentials.js.map +1 -0
- package/dist/identity/index.d.ts +4 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +4 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +19 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/{contract.types-check.d.ts → index.types-check.d.ts} +21 -18
- package/dist/index.types-check.d.ts.map +1 -0
- package/dist/{contract.types-check.js → index.types-check.js} +6 -3
- package/dist/index.types-check.js.map +1 -0
- package/dist/{daemon/runtime → service}/activation.d.ts +9 -12
- package/dist/service/activation.d.ts.map +1 -0
- package/dist/{daemon/runtime → service}/activation.js +3 -3
- package/dist/service/activation.js.map +1 -0
- package/dist/{daemon → service}/configuration.d.ts +8 -7
- package/dist/service/configuration.d.ts.map +1 -0
- package/dist/{daemon → service}/configuration.js +30 -28
- package/dist/service/configuration.js.map +1 -0
- package/dist/{daemon/runtime → service}/controller.d.ts +8 -6
- package/dist/service/controller.d.ts.map +1 -0
- package/dist/service/controller.js +106 -0
- package/dist/service/controller.js.map +1 -0
- package/dist/{server.d.ts → service/index.d.ts} +7 -4
- package/dist/service/index.d.ts.map +1 -0
- package/dist/{server.js → service/index.js} +17 -15
- package/dist/service/index.js.map +1 -0
- package/dist/{server.types-check.d.ts → service/index.types-check.d.ts} +7 -7
- package/dist/service/index.types-check.d.ts.map +1 -0
- package/dist/{server.types-check.js → service/index.types-check.js} +1 -1
- package/dist/service/index.types-check.js.map +1 -0
- package/dist/{daemon/runtime/index.d.ts → service/lifecycle.d.ts} +3 -3
- package/dist/service/lifecycle.d.ts.map +1 -0
- package/dist/{daemon/runtime/index.js → service/lifecycle.js} +28 -25
- package/dist/service/lifecycle.js.map +1 -0
- package/dist/{daemon → service}/management.d.ts +2 -2
- package/dist/service/management.d.ts.map +1 -0
- package/dist/{daemon → service}/management.js +2 -13
- package/dist/service/management.js.map +1 -0
- package/dist/{daemon → service}/registration.d.ts +1 -1
- package/dist/service/registration.d.ts.map +1 -0
- package/dist/{daemon → service}/registration.js +1 -2
- package/dist/service/registration.js.map +1 -0
- package/dist/{daemon/runtime/protocol.d.ts → service/supervision.d.ts} +16 -24
- package/dist/service/supervision.d.ts.map +1 -0
- package/dist/{daemon/runtime/protocol.js → service/supervision.js} +33 -36
- package/dist/service/supervision.js.map +1 -0
- package/dist/store/anchors.d.ts.map +1 -0
- package/dist/store/anchors.js.map +1 -0
- package/dist/store/database/index.d.ts.map +1 -0
- package/dist/store/database/index.js.map +1 -0
- package/dist/store/database/schema.d.ts.map +1 -0
- package/dist/{endpoint/store → store}/database/schema.js +42 -6
- package/dist/store/database/schema.js.map +1 -0
- package/dist/store/database/values.d.ts.map +1 -0
- package/dist/store/database/values.js.map +1 -0
- package/dist/{endpoint/store → store}/deliveries.d.ts +8 -0
- package/dist/store/deliveries.d.ts.map +1 -0
- package/dist/{endpoint/store → store}/deliveries.js +16 -0
- package/dist/store/deliveries.js.map +1 -0
- package/dist/store/dissemination.d.ts.map +1 -0
- package/dist/store/dissemination.js.map +1 -0
- package/dist/store/inbox.d.ts +86 -0
- package/dist/store/inbox.d.ts.map +1 -0
- package/dist/store/inbox.js +269 -0
- package/dist/store/inbox.js.map +1 -0
- package/dist/store/index.d.ts +12 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +8 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/outbound.d.ts.map +1 -0
- package/dist/store/outbound.js.map +1 -0
- package/dist/{endpoint/store/management.d.ts → store/reads.d.ts} +1 -1
- package/dist/store/reads.d.ts.map +1 -0
- package/dist/{endpoint/store/management.js → store/reads.js} +1 -1
- package/dist/store/reads.js.map +1 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js.map +1 -0
- package/dist/store/rows/index.d.ts.map +1 -0
- package/dist/store/rows/index.js.map +1 -0
- package/dist/store/runtime-codec.d.ts +17 -0
- package/dist/store/runtime-codec.d.ts.map +1 -0
- package/dist/store/runtime-codec.js +32 -0
- package/dist/store/runtime-codec.js.map +1 -0
- package/dist/{endpoint/store/index.d.ts → store/store.d.ts} +2 -2
- package/dist/store/store.d.ts.map +1 -0
- package/dist/{endpoint/store/index.js → store/store.js} +33 -4
- package/dist/store/store.js.map +1 -0
- package/dist/{endpoint/store → store}/types.d.ts +41 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js.map +1 -0
- package/dist/transport/collectives/answer-check.d.ts +22 -0
- package/dist/transport/collectives/answer-check.d.ts.map +1 -0
- package/dist/transport/collectives/answer-check.js +166 -0
- package/dist/transport/collectives/answer-check.js.map +1 -0
- package/dist/transport/collectives/answer-formats.d.ts +21 -0
- package/dist/transport/collectives/answer-formats.d.ts.map +1 -0
- package/dist/transport/collectives/answer-formats.js +127 -0
- package/dist/transport/collectives/answer-formats.js.map +1 -0
- package/dist/transport/collectives/failures.d.ts +34 -0
- package/dist/transport/collectives/failures.d.ts.map +1 -0
- package/dist/transport/collectives/failures.js +40 -0
- package/dist/transport/collectives/failures.js.map +1 -0
- package/dist/transport/collectives/form-grammar.d.ts +175 -0
- package/dist/transport/collectives/form-grammar.d.ts.map +1 -0
- package/dist/transport/collectives/form-grammar.js +226 -0
- package/dist/transport/collectives/form-grammar.js.map +1 -0
- package/dist/transport/collectives/forms.d.ts +224 -0
- package/dist/transport/collectives/forms.d.ts.map +1 -0
- package/dist/transport/collectives/forms.js +183 -0
- package/dist/transport/collectives/forms.js.map +1 -0
- package/dist/transport/collectives/inbound.d.ts +130 -0
- package/dist/transport/collectives/inbound.d.ts.map +1 -0
- package/dist/transport/collectives/inbound.js +80 -0
- package/dist/transport/collectives/inbound.js.map +1 -0
- package/dist/transport/collectives/index.d.ts +10 -0
- package/dist/transport/collectives/index.d.ts.map +1 -0
- package/dist/transport/collectives/index.js +8 -0
- package/dist/transport/collectives/index.js.map +1 -0
- package/dist/transport/collectives/message-text.d.ts +52 -0
- package/dist/transport/collectives/message-text.d.ts.map +1 -0
- package/dist/transport/collectives/message-text.js +118 -0
- package/dist/transport/collectives/message-text.js.map +1 -0
- package/dist/{endpoint/collective → transport/collectives}/operation.d.ts +30 -21
- package/dist/transport/collectives/operation.d.ts.map +1 -0
- package/dist/{endpoint/collective → transport/collectives}/operation.js +135 -143
- package/dist/transport/collectives/operation.js.map +1 -0
- package/dist/transport/collectives/received-request.d.ts +41 -0
- package/dist/transport/collectives/received-request.d.ts.map +1 -0
- package/dist/transport/collectives/received-request.js +56 -0
- package/dist/transport/collectives/received-request.js.map +1 -0
- package/dist/transport/collectives/request-sends.d.ts +42 -0
- package/dist/transport/collectives/request-sends.d.ts.map +1 -0
- package/dist/transport/collectives/request-sends.js +46 -0
- package/dist/transport/collectives/request-sends.js.map +1 -0
- package/dist/{endpoint/collective → transport/collectives}/shared-answers.d.ts +3 -2
- package/dist/transport/collectives/shared-answers.d.ts.map +1 -0
- package/dist/transport/collectives/shared-answers.js.map +1 -0
- package/dist/{endpoint/collective → transport/collectives}/validation.d.ts +8 -10
- package/dist/transport/collectives/validation.d.ts.map +1 -0
- package/dist/{endpoint/collective → transport/collectives}/validation.js +10 -21
- package/dist/transport/collectives/validation.js.map +1 -0
- package/dist/{endpoint/collective → transport/collectives}/wire.d.ts +18 -13
- package/dist/transport/collectives/wire.d.ts.map +1 -0
- package/dist/{endpoint/collective → transport/collectives}/wire.js +19 -38
- package/dist/transport/collectives/wire.js.map +1 -0
- package/dist/{endpoint/addressing/index.d.ts → transport/messaging/address.d.ts} +38 -5
- package/dist/transport/messaging/address.d.ts.map +1 -0
- package/dist/{endpoint/addressing/index.js → transport/messaging/address.js} +100 -21
- package/dist/transport/messaging/address.js.map +1 -0
- package/dist/{endpoint/protocol/index.d.ts → transport/messaging/certification.d.ts} +4 -4
- package/dist/transport/messaging/certification.d.ts.map +1 -0
- package/dist/{endpoint/protocol/index.js → transport/messaging/certification.js} +7 -5
- package/dist/transport/messaging/certification.js.map +1 -0
- package/dist/{endpoint/engine-dissemination.d.ts → transport/messaging/dissemination.d.ts} +3 -3
- package/dist/transport/messaging/dissemination.d.ts.map +1 -0
- package/dist/{endpoint/engine-dissemination.js → transport/messaging/dissemination.js} +5 -5
- package/dist/transport/messaging/dissemination.js.map +1 -0
- package/dist/{endpoint/engine-durability.d.ts → transport/messaging/durability.d.ts} +4 -4
- package/dist/{endpoint/engine-durability.d.ts.map → transport/messaging/durability.d.ts.map} +1 -1
- package/dist/{endpoint/engine-durability.js → transport/messaging/durability.js} +4 -13
- package/dist/transport/messaging/durability.js.map +1 -0
- package/dist/transport/messaging/errors.d.ts +50 -0
- package/dist/transport/messaging/errors.d.ts.map +1 -0
- package/dist/transport/messaging/errors.js +64 -0
- package/dist/transport/messaging/errors.js.map +1 -0
- package/dist/{endpoint/protocol → transport/messaging}/evidence.d.ts +3 -3
- package/dist/{endpoint/protocol → transport/messaging}/evidence.d.ts.map +1 -1
- package/dist/{endpoint/protocol → transport/messaging}/evidence.js +1 -1
- package/dist/transport/messaging/evidence.js.map +1 -0
- package/dist/{endpoint/engine.d.ts → transport/messaging/index.d.ts} +4 -4
- package/dist/transport/messaging/index.d.ts.map +1 -0
- package/dist/{endpoint/engine.js → transport/messaging/index.js} +14 -9
- package/dist/transport/messaging/index.js.map +1 -0
- package/dist/transport/messaging/message.d.ts +112 -0
- package/dist/transport/messaging/message.d.ts.map +1 -0
- package/dist/transport/messaging/message.js +39 -0
- package/dist/transport/messaging/message.js.map +1 -0
- package/dist/{endpoint → transport/messaging}/recovery/barrier.d.ts +1 -1
- package/dist/transport/messaging/recovery/barrier.d.ts.map +1 -0
- package/dist/transport/messaging/recovery/barrier.js.map +1 -0
- package/dist/{endpoint/recovery/store-evidence.d.ts → transport/messaging/recovery/evidence.d.ts} +5 -5
- package/dist/transport/messaging/recovery/evidence.d.ts.map +1 -0
- package/dist/{endpoint/recovery/store-evidence.js → transport/messaging/recovery/evidence.js} +3 -3
- package/dist/transport/messaging/recovery/evidence.js.map +1 -0
- package/dist/{endpoint → transport/messaging}/recovery/index.d.ts +4 -4
- package/dist/transport/messaging/recovery/index.d.ts.map +1 -0
- package/dist/{endpoint → transport/messaging}/recovery/index.js +29 -25
- package/dist/transport/messaging/recovery/index.js.map +1 -0
- package/dist/{endpoint/recovery/store.d.ts → transport/messaging/recovery/persistence.d.ts} +5 -5
- package/dist/transport/messaging/recovery/persistence.d.ts.map +1 -0
- package/dist/{endpoint/recovery/store.js → transport/messaging/recovery/persistence.js} +4 -4
- package/dist/transport/messaging/recovery/persistence.js.map +1 -0
- package/dist/{endpoint/recovery/reanchor/empty.d.ts → transport/messaging/recovery/reanchor-empty.d.ts} +6 -6
- package/dist/transport/messaging/recovery/reanchor-empty.d.ts.map +1 -0
- package/dist/{endpoint/recovery/reanchor/empty.js → transport/messaging/recovery/reanchor-empty.js} +4 -4
- package/dist/transport/messaging/recovery/reanchor-empty.js.map +1 -0
- package/dist/{endpoint/recovery/reanchor/index.d.ts → transport/messaging/recovery/reanchor.d.ts} +4 -4
- package/dist/transport/messaging/recovery/reanchor.d.ts.map +1 -0
- package/dist/{endpoint/recovery/reanchor/index.js → transport/messaging/recovery/reanchor.js} +29 -14
- package/dist/transport/messaging/recovery/reanchor.js.map +1 -0
- package/dist/{endpoint → transport/messaging}/recovery/state.d.ts +5 -5
- package/dist/transport/messaging/recovery/state.d.ts.map +1 -0
- package/dist/{endpoint → transport/messaging}/recovery/state.js +2 -2
- package/dist/transport/messaging/recovery/state.js.map +1 -0
- package/dist/{endpoint/engine-send.d.ts → transport/messaging/send.d.ts} +5 -4
- package/dist/transport/messaging/send.d.ts.map +1 -0
- package/dist/{endpoint/engine-send.js → transport/messaging/send.js} +4 -4
- package/dist/transport/messaging/send.js.map +1 -0
- package/dist/{endpoint/engine-types.d.ts → transport/messaging/types.d.ts} +7 -5
- package/dist/transport/messaging/types.d.ts.map +1 -0
- package/dist/{endpoint/engine-types.js → transport/messaging/types.js} +1 -1
- package/dist/{endpoint/engine-types.js.map → transport/messaging/types.js.map} +1 -1
- package/dist/transport/router/index.d.ts.map +1 -0
- package/dist/{endpoint/router-worker → transport/router}/index.js +1 -1
- package/dist/transport/router/index.js.map +1 -0
- package/dist/transport/router/outage.d.ts.map +1 -0
- package/dist/transport/router/outage.js.map +1 -0
- package/dist/{endpoint/router-worker → transport/router}/types.d.ts +2 -2
- package/dist/transport/router/types.d.ts.map +1 -0
- package/dist/transport/router/types.js.map +1 -0
- package/dist/{endpoint/representation-canonical.d.ts → transport/wire/canonical.d.ts} +1 -1
- package/dist/transport/wire/canonical.d.ts.map +1 -0
- package/dist/{endpoint/representation-canonical.js → transport/wire/canonical.js} +1 -1
- package/dist/transport/wire/canonical.js.map +1 -0
- package/dist/{endpoint/representation-codec.d.ts → transport/wire/codec.d.ts} +5 -6
- package/dist/transport/wire/codec.d.ts.map +1 -0
- package/dist/{endpoint/representation-codec.js → transport/wire/codec.js} +5 -24
- package/dist/transport/wire/codec.js.map +1 -0
- package/dist/transport/wire/index.d.ts +7 -0
- package/dist/transport/wire/index.d.ts.map +1 -0
- package/dist/transport/wire/index.js +10 -0
- package/dist/transport/wire/index.js.map +1 -0
- package/dist/{endpoint/representation-schemas.d.ts → transport/wire/schemas.d.ts} +76 -98
- package/dist/transport/wire/schemas.d.ts.map +1 -0
- package/dist/{endpoint/representation-schemas.js → transport/wire/schemas.js} +7 -19
- package/dist/transport/wire/schemas.js.map +1 -0
- package/dist/transport/wire/values.d.ts +79 -0
- package/dist/transport/wire/values.d.ts.map +1 -0
- package/dist/transport/wire/values.js +115 -0
- package/dist/transport/wire/values.js.map +1 -0
- package/dist/{endpoint/representation-verification.d.ts → transport/wire/verification.d.ts} +4 -4
- package/dist/transport/wire/verification.d.ts.map +1 -0
- package/dist/{endpoint/representation-verification.js → transport/wire/verification.js} +5 -4
- package/dist/transport/wire/verification.js.map +1 -0
- package/package.json +6 -6
- package/dist/client-runtime.d.ts.map +0 -1
- package/dist/client-runtime.js.map +0 -1
- package/dist/contract.d.ts +0 -721
- package/dist/contract.d.ts.map +0 -1
- package/dist/contract.js +0 -451
- package/dist/contract.js.map +0 -1
- package/dist/contract.types-check.d.ts.map +0 -1
- package/dist/contract.types-check.js.map +0 -1
- package/dist/daemon/configuration.d.ts.map +0 -1
- package/dist/daemon/configuration.js.map +0 -1
- package/dist/daemon/management.d.ts.map +0 -1
- package/dist/daemon/management.js.map +0 -1
- package/dist/daemon/registration.d.ts.map +0 -1
- package/dist/daemon/registration.js.map +0 -1
- package/dist/daemon/runtime/activation.d.ts.map +0 -1
- package/dist/daemon/runtime/activation.js.map +0 -1
- package/dist/daemon/runtime/controller.d.ts.map +0 -1
- package/dist/daemon/runtime/controller.js +0 -140
- package/dist/daemon/runtime/controller.js.map +0 -1
- package/dist/daemon/runtime/history-export.d.ts +0 -33
- package/dist/daemon/runtime/history-export.d.ts.map +0 -1
- package/dist/daemon/runtime/history-export.js.map +0 -1
- package/dist/daemon/runtime/index.d.ts.map +0 -1
- package/dist/daemon/runtime/index.js.map +0 -1
- package/dist/daemon/runtime/pending-delivery.d.ts +0 -49
- package/dist/daemon/runtime/pending-delivery.d.ts.map +0 -1
- package/dist/daemon/runtime/pending-delivery.js.map +0 -1
- package/dist/daemon/runtime/protocol.d.ts.map +0 -1
- package/dist/daemon/runtime/protocol.js.map +0 -1
- package/dist/endpoint/addressing/index.d.ts.map +0 -1
- package/dist/endpoint/addressing/index.js.map +0 -1
- package/dist/endpoint/collective/operation.d.ts.map +0 -1
- package/dist/endpoint/collective/operation.js.map +0 -1
- package/dist/endpoint/collective/shared-answers.d.ts.map +0 -1
- package/dist/endpoint/collective/shared-answers.js.map +0 -1
- package/dist/endpoint/collective/validation.d.ts.map +0 -1
- package/dist/endpoint/collective/validation.js.map +0 -1
- package/dist/endpoint/collective/wire.d.ts.map +0 -1
- package/dist/endpoint/collective/wire.js.map +0 -1
- package/dist/endpoint/engine-dissemination.d.ts.map +0 -1
- package/dist/endpoint/engine-dissemination.js.map +0 -1
- package/dist/endpoint/engine-durability.js.map +0 -1
- package/dist/endpoint/engine-send.d.ts.map +0 -1
- package/dist/endpoint/engine-send.js.map +0 -1
- package/dist/endpoint/engine-types.d.ts.map +0 -1
- package/dist/endpoint/engine.d.ts.map +0 -1
- package/dist/endpoint/engine.js.map +0 -1
- package/dist/endpoint/protocol/evidence.js.map +0 -1
- package/dist/endpoint/protocol/index.d.ts.map +0 -1
- package/dist/endpoint/protocol/index.js.map +0 -1
- package/dist/endpoint/recovery/barrier.d.ts.map +0 -1
- package/dist/endpoint/recovery/barrier.js.map +0 -1
- package/dist/endpoint/recovery/index.d.ts.map +0 -1
- package/dist/endpoint/recovery/index.js.map +0 -1
- package/dist/endpoint/recovery/reanchor/empty.d.ts.map +0 -1
- package/dist/endpoint/recovery/reanchor/empty.js.map +0 -1
- package/dist/endpoint/recovery/reanchor/index.d.ts.map +0 -1
- package/dist/endpoint/recovery/reanchor/index.js.map +0 -1
- package/dist/endpoint/recovery/state.d.ts.map +0 -1
- package/dist/endpoint/recovery/state.js.map +0 -1
- package/dist/endpoint/recovery/store-evidence.d.ts.map +0 -1
- package/dist/endpoint/recovery/store-evidence.js.map +0 -1
- package/dist/endpoint/recovery/store.d.ts.map +0 -1
- package/dist/endpoint/recovery/store.js.map +0 -1
- package/dist/endpoint/representation-canonical.d.ts.map +0 -1
- package/dist/endpoint/representation-canonical.js.map +0 -1
- package/dist/endpoint/representation-codec.d.ts.map +0 -1
- package/dist/endpoint/representation-codec.js.map +0 -1
- package/dist/endpoint/representation-schemas.d.ts.map +0 -1
- package/dist/endpoint/representation-schemas.js.map +0 -1
- package/dist/endpoint/representation-verification.d.ts.map +0 -1
- package/dist/endpoint/representation-verification.js.map +0 -1
- package/dist/endpoint/representation.d.ts +0 -6
- package/dist/endpoint/representation.d.ts.map +0 -1
- package/dist/endpoint/representation.js +0 -8
- package/dist/endpoint/representation.js.map +0 -1
- package/dist/endpoint/router-worker/index.d.ts.map +0 -1
- package/dist/endpoint/router-worker/index.js.map +0 -1
- package/dist/endpoint/router-worker/outage.d.ts.map +0 -1
- package/dist/endpoint/router-worker/outage.js.map +0 -1
- package/dist/endpoint/router-worker/types.d.ts.map +0 -1
- package/dist/endpoint/router-worker/types.js.map +0 -1
- package/dist/endpoint/store/anchors.d.ts.map +0 -1
- package/dist/endpoint/store/anchors.js.map +0 -1
- package/dist/endpoint/store/database/index.d.ts.map +0 -1
- package/dist/endpoint/store/database/index.js.map +0 -1
- package/dist/endpoint/store/database/schema.d.ts.map +0 -1
- package/dist/endpoint/store/database/schema.js.map +0 -1
- package/dist/endpoint/store/database/values.d.ts.map +0 -1
- package/dist/endpoint/store/database/values.js.map +0 -1
- package/dist/endpoint/store/deliveries.d.ts.map +0 -1
- package/dist/endpoint/store/deliveries.js.map +0 -1
- package/dist/endpoint/store/dissemination.d.ts.map +0 -1
- package/dist/endpoint/store/dissemination.js.map +0 -1
- package/dist/endpoint/store/index.d.ts.map +0 -1
- package/dist/endpoint/store/index.js.map +0 -1
- package/dist/endpoint/store/management.d.ts.map +0 -1
- package/dist/endpoint/store/management.js.map +0 -1
- package/dist/endpoint/store/outbound.d.ts.map +0 -1
- package/dist/endpoint/store/outbound.js.map +0 -1
- package/dist/endpoint/store/records.d.ts.map +0 -1
- package/dist/endpoint/store/records.js.map +0 -1
- package/dist/endpoint/store/rows/index.d.ts.map +0 -1
- package/dist/endpoint/store/rows/index.js.map +0 -1
- package/dist/endpoint/store/types.d.ts.map +0 -1
- package/dist/endpoint/store/types.js.map +0 -1
- package/dist/endpoint/store.d.ts +0 -10
- package/dist/endpoint/store.d.ts.map +0 -1
- package/dist/endpoint/store.js +0 -6
- package/dist/endpoint/store.js.map +0 -1
- package/dist/harness-mcp-contract.d.ts.map +0 -1
- package/dist/harness-mcp-contract.js +0 -113
- package/dist/harness-mcp-contract.js.map +0 -1
- package/dist/harness-mcp-http.d.ts.map +0 -1
- package/dist/harness-mcp-http.js.map +0 -1
- package/dist/harness-mcp-subscription.d.ts +0 -30
- package/dist/harness-mcp-subscription.d.ts.map +0 -1
- package/dist/harness-mcp-subscription.js +0 -361
- package/dist/harness-mcp-subscription.js.map +0 -1
- package/dist/harness-mcp-wire.d.ts.map +0 -1
- package/dist/harness-mcp-wire.js.map +0 -1
- package/dist/management-runtime.d.ts.map +0 -1
- package/dist/management-runtime.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/server.types-check.d.ts.map +0 -1
- package/dist/server.types-check.js.map +0 -1
- /package/dist/{endpoint/store → store}/anchors.d.ts +0 -0
- /package/dist/{endpoint/store → store}/anchors.js +0 -0
- /package/dist/{endpoint/store → store}/database/index.d.ts +0 -0
- /package/dist/{endpoint/store → store}/database/index.js +0 -0
- /package/dist/{endpoint/store → store}/database/schema.d.ts +0 -0
- /package/dist/{endpoint/store → store}/database/values.d.ts +0 -0
- /package/dist/{endpoint/store → store}/database/values.js +0 -0
- /package/dist/{endpoint/store → store}/dissemination.d.ts +0 -0
- /package/dist/{endpoint/store → store}/dissemination.js +0 -0
- /package/dist/{endpoint/store → store}/outbound.d.ts +0 -0
- /package/dist/{endpoint/store → store}/outbound.js +0 -0
- /package/dist/{endpoint/store → store}/records.d.ts +0 -0
- /package/dist/{endpoint/store → store}/records.js +0 -0
- /package/dist/{endpoint/store → store}/rows/index.d.ts +0 -0
- /package/dist/{endpoint/store → store}/rows/index.js +0 -0
- /package/dist/{endpoint/store → store}/types.js +0 -0
- /package/dist/{endpoint/collective → transport/collectives}/shared-answers.js +0 -0
- /package/dist/{endpoint → transport/messaging}/recovery/barrier.js +0 -0
- /package/dist/{endpoint/router-worker → transport/router}/index.d.ts +0 -0
- /package/dist/{endpoint/router-worker → transport/router}/outage.d.ts +0 -0
- /package/dist/{endpoint/router-worker → transport/router}/outage.js +0 -0
- /package/dist/{endpoint/router-worker → transport/router}/types.js +0 -0
package/dist/index.js
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
/** @file Public barrel for the final endpoint runtime capability. */
|
|
2
|
+
// safer-arch-ignore no-folder-cycle: Importing package.json for the MCP implementation version places the package root in the endpoint's dependencies, while this facade re-exports from endpoint/harness-endpoint.
|
|
3
|
+
// safer-arch-ignore require-curated-public-facade: Each re-export names one domain's adapter-facing values; the root re-exports them from their owners instead of from a shared contract module.
|
|
2
4
|
// safer-arch-ignore no-large-public-surface: The root is the one adapter-facing boundary, and each operation and inbound item is a closed schema its adapters decode; splitting them behind narrower entrypoints would give adapters a second import path for one contract.
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
+
/** The endpoint capability a host acquires, and its connect and delivery types. */
|
|
6
|
+
export { ConnectError, } from "./endpoint/harness-endpoint/index.js";
|
|
5
7
|
/** Acquire the structural endpoint for one loopback daemon endpoint. */
|
|
6
8
|
// safer-arch-ignore no-public-vendor-type-leak: URL is the platform-standard endpoint locator required by the public acquisition contract.
|
|
7
|
-
export { acquireHarnessEndpoint } from "./
|
|
9
|
+
export { acquireHarnessEndpoint } from "./endpoint/harness-endpoint/index.js";
|
|
10
|
+
/** One line of the daemon's optional history export. */
|
|
11
|
+
export { HistoryExportRecord } from "./delivery/history-export.js";
|
|
12
|
+
/** Send input and the closed error of a refused collective send. */
|
|
13
|
+
export { CollectiveError, SendInput, } from "./transport/collectives/forms.js";
|
|
14
|
+
/** The items an endpoint delivers to its host. */
|
|
15
|
+
export { InboundItem } from "./transport/collectives/inbound.js";
|
|
16
|
+
/** The operation a native host's message text states. */
|
|
17
|
+
export { MessageTextError, parseMessageText, } from "./transport/collectives/message-text.js";
|
|
18
|
+
/** Explicit direct and group addresses. */
|
|
19
|
+
export { AgentAddress, GroupAddress, MessageAddressInput, } from "./transport/messaging/address.js";
|
|
20
|
+
/** The closed errors of sending, listening, and acknowledging delivery. */
|
|
21
|
+
export { DeliveryAcknowledgeError, ListenError, SendError, } from "./transport/messaging/errors.js";
|
|
22
|
+
/** Certified inbound messages, direct or to a fixed group. */
|
|
23
|
+
export { InboundMessage, } from "./transport/messaging/message.js";
|
|
24
|
+
/** Post ids and the closed semantic content of a message. */
|
|
25
|
+
export { Content, ContentPart, JsonValue, PostId, } from "./transport/wire/values.js";
|
|
8
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,4QAA4Q;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,oNAAoN;AACpN,iMAAiM;AACjM,4QAA4Q;AAE5Q,mFAAmF;AACnF,OAAO,EACL,YAAY,GAGb,MAAM,sCAAsC,CAAC;AAC9C,wEAAwE;AACxE,2IAA2I;AAC3I,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,wDAAwD;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,oEAAoE;AACpE,OAAO,EACL,eAAe,EACf,SAAS,GAEV,MAAM,kCAAkC,CAAC;AAC1C,kDAAkD;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,yDAAyD;AACzD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,yCAAyC,CAAC;AACjD,2CAA2C;AAC3C,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,mBAAmB,GACpB,MAAM,kCAAkC,CAAC;AAC1C,2EAA2E;AAC3E,OAAO,EACL,wBAAwB,EACxB,WAAW,EACX,SAAS,GACV,MAAM,iCAAiC,CAAC;AACzC,8DAA8D;AAC9D,OAAO,EAGL,cAAc,GACf,MAAM,kCAAkC,CAAC;AAC1C,6DAA6D;AAC7D,OAAO,EACL,OAAO,EACP,WAAW,EACX,SAAS,EACT,MAAM,GACP,MAAM,4BAA4B,CAAC"}
|
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
* operations or collective responses and whose inbound deliveries are tagged
|
|
4
4
|
* items. An operation carries an address, text and an optional collective
|
|
5
5
|
* operation, multicast by default or a gather or all_gather with its deadline
|
|
6
|
-
* and schema; a response names
|
|
6
|
+
* and schema; a response names the conversation whose open request it
|
|
7
|
+
* answers and no request id. One parser reads either from a message's text,
|
|
8
|
+
* so the native channel adapters accept the same text. Each inbound
|
|
7
9
|
* delivery carries one item plus transport-only acknowledgment: a multicast
|
|
8
10
|
* with the certified direct or complete-group message, a collective request
|
|
9
11
|
* naming the conversation it arrived in, a collective result that names an
|
|
10
12
|
* all_gather's close post, or an operation failure. A send returns a
|
|
11
13
|
* collecting operation's id and fails with a closed send reason or a
|
|
12
|
-
* collective failure.
|
|
14
|
+
* collective failure. Optional invocation identity preserves a retried send without
|
|
15
|
+
* executing a new collective operation.
|
|
13
16
|
*/
|
|
14
|
-
import type { DateTime, Effect, Scope, Stream } from "effect";
|
|
15
|
-
import type { acquireHarnessEndpoint, AgentAddress, CollectiveError,
|
|
17
|
+
import type { DateTime, Effect, Either, Scope, Stream } from "effect";
|
|
18
|
+
import type { acquireHarnessEndpoint, AgentAddress, CollectiveError, ConnectError, Content, ContentPart, DeliveryAcknowledgeError, DirectMessage, GroupAddress, GroupMessage, HarnessEndpoint, HistoryExportRecord, InboundDelivery, InboundItem, InboundMessage, JsonValue, ListenError, MessageAddressInput, MessageTextError, parseMessageText, PostId, SendError, SendInput, SendResult } from "./index.js";
|
|
16
19
|
type Equal<Left, Right> = [Left, Right] extends [Right, Left] ? true : false;
|
|
17
20
|
type Expect<Value extends true> = Value;
|
|
18
21
|
type CollectiveId = CollectiveError["id"];
|
|
@@ -31,19 +34,18 @@ type ExpectedCollectiveOperation = Readonly<{
|
|
|
31
34
|
requestedSchema: ExpectedRequestedSchema;
|
|
32
35
|
}>;
|
|
33
36
|
type ExpectedCollectiveResponse = Readonly<{
|
|
34
|
-
id: CollectiveId;
|
|
35
37
|
action: "accept";
|
|
36
38
|
content: ExpectedAnswerContent;
|
|
37
39
|
}> | Readonly<{
|
|
38
|
-
|
|
39
|
-
action: "decline" | "cancel";
|
|
40
|
+
action: "decline";
|
|
40
41
|
}>;
|
|
41
42
|
type ExpectedSendInput = Readonly<{
|
|
42
43
|
to: MessageAddressInput;
|
|
43
44
|
text: string;
|
|
44
|
-
collective?:
|
|
45
|
+
collective?: ExpectedCollectiveOperation;
|
|
45
46
|
}> | Readonly<{
|
|
46
|
-
|
|
47
|
+
to: MessageAddressInput;
|
|
48
|
+
collectiveResponse: ExpectedCollectiveResponse;
|
|
47
49
|
}>;
|
|
48
50
|
type ExpectedSendResult = Readonly<{
|
|
49
51
|
operationId?: CollectiveId;
|
|
@@ -73,8 +75,6 @@ type ExpectedMemberOutcome = Readonly<{
|
|
|
73
75
|
content: ExpectedAnswerContent;
|
|
74
76
|
}> | Readonly<{
|
|
75
77
|
kind: "declined";
|
|
76
|
-
}> | Readonly<{
|
|
77
|
-
kind: "cancelled";
|
|
78
78
|
}> | Readonly<{
|
|
79
79
|
kind: "invalid";
|
|
80
80
|
reason: string;
|
|
@@ -122,18 +122,20 @@ type ExpectedDelivery = Readonly<{
|
|
|
122
122
|
type ExpectedEndpoint = Readonly<{
|
|
123
123
|
send: (input: SendInput, options?: Readonly<{
|
|
124
124
|
failureDelivery?: "result" | "inbound";
|
|
125
|
+
idempotencyKey?: string;
|
|
125
126
|
}>) => Effect.Effect<SendResult, SendError | CollectiveError>;
|
|
126
127
|
messages: Stream.Stream<InboundDelivery, ListenError>;
|
|
127
128
|
}>;
|
|
128
|
-
type CollectiveOperationIsExact = Expect<Equal<CollectiveOperation, ExpectedCollectiveOperation>>;
|
|
129
|
-
type CollectiveResponseIsExact = Expect<Equal<CollectiveResponse, ExpectedCollectiveResponse>>;
|
|
130
129
|
type SendInputIsExact = Expect<Equal<SendInput, ExpectedSendInput>>;
|
|
130
|
+
type MessageTextParserIsExact = Expect<Equal<typeof parseMessageText, (to: MessageAddressInput, text: string) => Either.Either<SendInput, MessageTextError>>>;
|
|
131
131
|
type SendResultIsExact = Expect<Equal<SendResult, ExpectedSendResult>>;
|
|
132
|
+
type SendResultKeysAreExact = Expect<Equal<keyof SendResult, keyof ExpectedSendResult>>;
|
|
132
133
|
type InboundItemIsExact = Expect<Equal<InboundItem, ExpectedInboundItem>>;
|
|
133
134
|
type DirectMessageIsExact = Expect<Equal<DirectMessage, ExpectedDirectMessage>>;
|
|
134
135
|
type GroupMessageIsExact = Expect<Equal<GroupMessage, ExpectedGroupMessage>>;
|
|
135
136
|
type InboundMessageIsExact = Expect<Equal<InboundMessage, DirectMessage | GroupMessage>>;
|
|
136
137
|
type DeliveryIsExact = Expect<Equal<InboundDelivery, ExpectedDelivery>>;
|
|
138
|
+
type SendOptionsAreExact = Expect<Equal<NonNullable<Parameters<HarnessEndpoint["send"]>[1]>, NonNullable<Parameters<ExpectedEndpoint["send"]>[1]>>>;
|
|
137
139
|
type EndpointIsExact = Expect<Equal<HarnessEndpoint, ExpectedEndpoint>>;
|
|
138
140
|
type ExpectedHistoryExportRecord = Readonly<{
|
|
139
141
|
kind: "inbound";
|
|
@@ -160,8 +162,8 @@ type HistoryExportRecordIsExact = Expect<Equal<HistoryExportRecord, ExpectedHist
|
|
|
160
162
|
type ContentIsNonempty = Expect<Content extends readonly [ContentPart, ...ContentPart[]] ? true : false>;
|
|
161
163
|
type AgentAddressIsInput = Expect<AgentAddress extends MessageAddressInput ? true : false>;
|
|
162
164
|
type GroupAddressIsInput = Expect<GroupAddress extends MessageAddressInput ? true : false>;
|
|
163
|
-
type SendReasonsAreExact = Expect<Equal<SendError["reason"], "invalid-address" | "unknown-agent" | "membership-invalid" | "content-invalid" | "not-registered" | "version-mismatch" | "certification-unavailable" | "persistence-failed" | "network-unavailable">>;
|
|
164
|
-
type CollectiveFailureKindsAreExact = Expect<Equal<CollectiveError["failure"]["kind"], "members-unreachable" | "schema-invalid" | "answer-invalid" | "request-
|
|
165
|
+
type SendReasonsAreExact = Expect<Equal<SendError["reason"], "invalid-address" | "unknown-agent" | "membership-invalid" | "content-invalid" | "not-registered" | "version-mismatch" | "certification-unavailable" | "persistence-failed" | "network-unavailable" | "idempotency-conflict" | "outcome-unknown">>;
|
|
166
|
+
type CollectiveFailureKindsAreExact = Expect<Equal<CollectiveError["failure"]["kind"], "members-unreachable" | "schema-invalid" | "answer-invalid" | "request-none" | "request-ambiguous" | "request-answered" | "request-expired">>;
|
|
165
167
|
type ListenReasonsAreExact = Expect<Equal<ListenError["reason"], "already-listening" | "incompatible-daemon" | "transport-failed" | "decode-failed">>;
|
|
166
168
|
type AcknowledgeReasonsAreExact = Expect<Equal<DeliveryAcknowledgeError["reason"], "unknown-delivery" | "delivery-conflict" | "persistence-failed" | "transport-failed">>;
|
|
167
169
|
type ConnectReasonsAreExact = Expect<Equal<ConnectError["reason"], "transport-failed" | "decode-failed" | "incompatible-daemon">>;
|
|
@@ -169,16 +171,17 @@ type AcquisitionIsScoped = Expect<Equal<Parameters<typeof acquireHarnessEndpoint
|
|
|
169
171
|
type AcquisitionResultIsExact = Expect<Equal<ReturnType<typeof acquireHarnessEndpoint>, Effect.Effect<HarnessEndpoint, ConnectError, Scope.Scope>>>;
|
|
170
172
|
/** Compile-time witnesses for the accepted public Client boundary. */
|
|
171
173
|
export type HarnessEndpointCanaries = [
|
|
172
|
-
CollectiveOperationIsExact,
|
|
173
|
-
CollectiveResponseIsExact,
|
|
174
174
|
SendInputIsExact,
|
|
175
|
+
MessageTextParserIsExact,
|
|
175
176
|
SendResultIsExact,
|
|
177
|
+
SendResultKeysAreExact,
|
|
176
178
|
InboundItemIsExact,
|
|
177
179
|
DirectMessageIsExact,
|
|
178
180
|
GroupMessageIsExact,
|
|
179
181
|
InboundMessageIsExact,
|
|
180
182
|
DeliveryIsExact,
|
|
181
183
|
EndpointIsExact,
|
|
184
|
+
SendOptionsAreExact,
|
|
182
185
|
ContentIsNonempty,
|
|
183
186
|
AgentAddressIsInput,
|
|
184
187
|
GroupAddressIsInput,
|
|
@@ -192,4 +195,4 @@ export type HarnessEndpointCanaries = [
|
|
|
192
195
|
AcquisitionResultIsExact
|
|
193
196
|
];
|
|
194
197
|
export {};
|
|
195
|
-
//# sourceMappingURL=
|
|
198
|
+
//# sourceMappingURL=index.types-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.types-check.d.ts","sourceRoot":"","sources":["../src/index.types-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtE,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,OAAO,EACP,WAAW,EACX,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,cAAc,EACd,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,gBAAg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AAe,EAAE,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,CAC1D,CACF,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,uBAAuB,GAAG;IACpC,gBAAgB;IAChB,wBAAwB;IACxB,iBAAiB;IACjB,sBAAsB;IACtB,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;IACnB,qBAAqB;IACrB,eAAe;IACf,eAAe;IACf,mBAAmB;IACnB,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,8BAA8B;IAC9B,0BAA0B;IAC1B,qBAAqB;IACrB,0BAA0B;IAC1B,sBAAsB;IACtB,mBAAmB;IACnB,wBAAwB;CACzB,CAAC"}
|
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
* operations or collective responses and whose inbound deliveries are tagged
|
|
4
4
|
* items. An operation carries an address, text and an optional collective
|
|
5
5
|
* operation, multicast by default or a gather or all_gather with its deadline
|
|
6
|
-
* and schema; a response names
|
|
6
|
+
* and schema; a response names the conversation whose open request it
|
|
7
|
+
* answers and no request id. One parser reads either from a message's text,
|
|
8
|
+
* so the native channel adapters accept the same text. Each inbound
|
|
7
9
|
* delivery carries one item plus transport-only acknowledgment: a multicast
|
|
8
10
|
* with the certified direct or complete-group message, a collective request
|
|
9
11
|
* naming the conversation it arrived in, a collective result that names an
|
|
10
12
|
* all_gather's close post, or an operation failure. A send returns a
|
|
11
13
|
* collecting operation's id and fails with a closed send reason or a
|
|
12
|
-
* collective failure.
|
|
14
|
+
* collective failure. Optional invocation identity preserves a retried send without
|
|
15
|
+
* executing a new collective operation.
|
|
13
16
|
*/
|
|
14
17
|
export {};
|
|
15
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=index.types-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.types-check.js","sourceRoot":"","sources":["../src/index.types-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -3,17 +3,14 @@ import type { Registry } from "@moltzap/identity/registry";
|
|
|
3
3
|
import type { Router } from "@moltzap/router";
|
|
4
4
|
import { type VerifiedAgentCard } from "@moltzap/identity";
|
|
5
5
|
import { Deferred, Effect, type Scope } from "effect";
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type { EndpointStore } from "
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
-
import type
|
|
13
|
-
import type
|
|
14
|
-
import { type DaemonManagementOperations } from "../management.js";
|
|
15
|
-
import { type DaemonRegistrationState } from "../registration.js";
|
|
16
|
-
type SubscriptionHandler = HarnessMcpSubscriptionHandler<HarnessMessageReadyEvent>;
|
|
6
|
+
import type { HistoryExportPort } from "../delivery/history-export.js";
|
|
7
|
+
import type { HarnessMcpEventHandler, makeHarnessMcpHttpHandler } from "../endpoint/mcp/index.js";
|
|
8
|
+
import type { EndpointStore } from "../store/index.js";
|
|
9
|
+
import type { EndpointEngine, EndpointEngineInput, EngineInitializationError } from "../transport/messaging/index.js";
|
|
10
|
+
import type { RouterWorker, RouterWorkerInput, RouterWorkerProtocolError, RouterWorkerTransportError } from "../transport/router/index.js";
|
|
11
|
+
import type { DaemonBootstrap } from "./configuration.js";
|
|
12
|
+
import { type DaemonManagementOperations } from "./management.js";
|
|
13
|
+
import { type DaemonRegistrationState } from "./registration.js";
|
|
17
14
|
declare const DaemonRuntimeError_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 & {
|
|
18
15
|
readonly _tag: "DaemonRuntimeError";
|
|
19
16
|
} & Readonly<A>;
|
|
@@ -37,7 +34,7 @@ export interface DaemonRuntimeDependencies {
|
|
|
37
34
|
readonly makeHandler: typeof makeHarnessMcpHttpHandler;
|
|
38
35
|
readonly acquireListener: (input: {
|
|
39
36
|
readonly port: number;
|
|
40
|
-
readonly handler:
|
|
37
|
+
readonly handler: HarnessMcpEventHandler;
|
|
41
38
|
}) => Effect.Effect<void, Error, Scope.Scope>;
|
|
42
39
|
/** Opens the operator-configured history export against one file. */
|
|
43
40
|
readonly makeHistoryExport: (path: string) => Effect.Effect<HistoryExportPort>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activation.d.ts","sourceRoot":"","sources":["../../src/service/activation.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAQ,QAAQ,EAAE,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAO1D,OAAO,EACL,KAAK,0BAA0B,EAEhC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,mBAAmB,CAAC;;;;AAE3B,8EAA8E;AAC9E,qBAAa,kBAAmB,SAAQ,wBAAuC;IAC7E,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CAAC;CACxC,CAAC;CAAG;;;;AAE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M,CAAC,OAAO,CACpD,UAAU,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC,CACnD,CAAC;AAoFF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,UAAW;IAC9C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,cAAc,EAAE,iBAAiB,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;CACrC,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,iBAAiB,EAAE,EAAE,qBAAqB,CAiBf,CAAC;AAYvD;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,UACtB;IACL,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;IAC7D,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;CACzC,UACO,kBAAkB,KACzB,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAoBzD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,UAAW;IAC7C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;CACrC,KAAG,MAAM,CAAC,MAAM,CAAC,2BAA2B,EAAE,kBAAkB,EAAE,QAAQ,CAOtB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @file Private daemon activation, recovery, and registration preparation. */
|
|
2
2
|
import { AgentCard, } from "@moltzap/identity";
|
|
3
3
|
import { Data, Deferred, Effect } from "effect";
|
|
4
|
-
import { decodeCanonical, encodeCanonical, MembershipDescriptor, verifyMembershipDescriptor, } from "
|
|
5
|
-
import { makeDaemonManagementOperations, } from "
|
|
6
|
-
import { readDaemonRegistrationState, } from "
|
|
4
|
+
import { decodeCanonical, encodeCanonical, MembershipDescriptor, verifyMembershipDescriptor, } from "../transport/wire/index.js";
|
|
5
|
+
import { makeDaemonManagementOperations, } from "./management.js";
|
|
6
|
+
import { readDaemonRegistrationState, } from "./registration.js";
|
|
7
7
|
/** Closed private daemon failure projected onto the public startup phases. */
|
|
8
8
|
export class DaemonRuntimeError extends Data.TaggedError("DaemonRuntimeError") {
|
|
9
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activation.js","sourceRoot":"","sources":["../../src/service/activation.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAI/E,OAAO,EACL,SAAS,GAGV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAc,MAAM,QAAQ,CAAC;AAmB5D,OAAO,EACL,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAE3B,8EAA8E;AAC9E,MAAM,OAAO,kBAAmB,SAAQ,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAE3E;CAAG;AAEL,6EAA6E;AAC7E,MAAM,OAAO,qBAAsB,SAAQ,IAAI,CAAC,WAAW,CACzD,uBAAuB,CAGvB;CAAG;AAyCL,MAAM,SAAS,GAAG,CAAC,IAAgB,EAAE,KAAiB,EAAW,EAAE,CACjE,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;IAC5B,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAErD,MAAM,iBAAiB,GAAG,CACxB,MAAuC,EAChB,EAAE,CAAC,IAAI,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AAElE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yBAAyB,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/** @file Exact daemon process configuration and redacted bootstrap material. */
|
|
2
2
|
import { AgentSigningAuthority, type Ed25519PublicKey as Ed25519PublicKeyValue } from "@moltzap/identity";
|
|
3
3
|
import { Effect, Redacted } from "effect";
|
|
4
|
+
import { type HarnessMcpCredentials } from "../endpoint/mcp/index.js";
|
|
4
5
|
/** Closed reason that daemon configuration cannot become startup authority. */
|
|
5
|
-
export type DaemonConfigurationFailure = "environment" | "agent-private-key-file" | "agent-private-key" | "admission-credential-file" | "admission-credential";
|
|
6
|
+
export type DaemonConfigurationFailure = "environment" | "agent-private-key-file" | "agent-private-key" | "admission-credential-file" | "admission-credential" | "mcp-runtime-credential-file" | "mcp-owner-credential-file" | "mcp-credential";
|
|
6
7
|
declare const DaemonConfigurationError_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 & {
|
|
7
8
|
readonly _tag: "DaemonConfigurationError";
|
|
8
9
|
} & Readonly<A>;
|
|
@@ -30,6 +31,8 @@ export interface DaemonProcessConfiguration {
|
|
|
30
31
|
* line each, when the operator asks for that record.
|
|
31
32
|
*/
|
|
32
33
|
readonly historyExport?: string;
|
|
34
|
+
readonly mcpRuntimeCredentialFile?: Redacted.Redacted;
|
|
35
|
+
readonly mcpOwnerCredentialFile?: Redacted.Redacted;
|
|
33
36
|
}
|
|
34
37
|
/** Loaded private authority required by daemon registration and network calls. */
|
|
35
38
|
export interface DaemonBootstrap {
|
|
@@ -41,17 +44,15 @@ export interface DaemonBootstrap {
|
|
|
41
44
|
* replays that outcome. Loading the bootstrap never reads the file.
|
|
42
45
|
*/
|
|
43
46
|
readonly admissionCredential: Effect.Effect<Redacted.Redacted, DaemonConfigurationError>;
|
|
47
|
+
readonly mcpCredentials?: HarnessMcpCredentials;
|
|
44
48
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Loads exactly the six required daemon process inputs, the optional
|
|
47
|
-
* admission credential file, and the optional export.
|
|
48
|
-
*/
|
|
49
|
+
/** Loads explicit daemon inputs with optional export and MCP authority separation. */
|
|
49
50
|
export declare const loadDaemonProcessConfiguration: Effect.Effect<DaemonProcessConfiguration, DaemonConfigurationError>;
|
|
50
51
|
/**
|
|
51
52
|
* Reads the agent private key and constructs the configured Ed25519 authority.
|
|
52
53
|
*
|
|
53
|
-
* @param configuration Validated process configuration.
|
|
54
|
-
* @returns Opaque
|
|
54
|
+
* @param configuration Validated process configuration and optional authority paths.
|
|
55
|
+
* @returns Opaque signing authority, MCP credentials, and deferred admission credential.
|
|
55
56
|
*/
|
|
56
57
|
export declare const loadDaemonBootstrap: (configuration: DaemonProcessConfiguration) => Effect.Effect<DaemonBootstrap, DaemonConfigurationError>;
|
|
57
58
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/service/configuration.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EACL,qBAAqB,EAErB,KAAK,gBAAgB,IAAI,qBAAqB,EAC/C,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAgB,MAAM,EAAE,QAAQ,EAAU,MAAM,QAAQ,CAAC;AAChE,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,0BAA0B,CAAC;AAyElC,+EAA+E;AAC/E,MAAM,MAAM,0BAA0B,GAClC,aAAa,GACb,wBAAwB,GACxB,mBAAmB,GACnB,2BAA2B,GAC3B,sBAAsB,GACtB,6BAA6B,GAC7B,2BAA2B,GAC3B,gBAAgB,CAAC;;;;AAErB,uDAAuD;AACvD,qBAAa,wBAAyB,SAAQ,8BAE5C;IACA,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;CAC7C,CAAC;CAAG;AAEL,iFAAiF;AACjF,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,cAA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519PublicKey, } from "@moltzap/identity";
|
|
3
3
|
import { Config, Data, Effect, Redacted, Schema } from "effect";
|
|
4
|
-
|
|
5
|
-
import {
|
|
4
|
+
import { credentialMatches, } from "../endpoint/mcp/index.js";
|
|
5
|
+
import { credentialText, loadAdmissionCredential, loadSigningAuthority, readCredential, } from "../identity/index.js";
|
|
6
6
|
const canonicalUnsignedDecimal = Schema.String.pipe(Schema.pattern(/^(?:0|[1-9]\d*)$/u));
|
|
7
7
|
const port = canonicalUnsignedDecimal.pipe(Schema.compose(Schema.NumberFromString), Schema.int(), Schema.between(1, 65_535));
|
|
8
8
|
const configuredPath = Schema.String.pipe(Schema.minLength(1), Schema.filter((value) => !value.includes("\u0000")));
|
|
@@ -17,7 +17,6 @@ const isSerializedOrigin = (value) => {
|
|
|
17
17
|
};
|
|
18
18
|
const origin = Schema.String.pipe(Schema.filter(isSerializedOrigin), Schema.compose(Schema.URL));
|
|
19
19
|
const compactPublicKeyJson = Schema.String.pipe(Schema.pattern(/^\{"crv":"Ed25519","kty":"OKP","x":"[A-Za-z0-9_-]{43}"\}$/u), Schema.compose(Schema.parseJson(Ed25519PublicKey)));
|
|
20
|
-
const admissionCredential = Schema.String.pipe(Schema.minLength(8), Schema.maxLength(512), Schema.pattern(/^[A-Za-z0-9\-._~+/]+=*$/u));
|
|
21
20
|
const configuredValues = Config.all({
|
|
22
21
|
stateDirectory: Schema.Config("MOLTZAPD_STATE_DIRECTORY", configuredPath),
|
|
23
22
|
mcpPort: Schema.Config("MOLTZAPD_MCP_PORT", port),
|
|
@@ -27,49 +26,52 @@ const configuredValues = Config.all({
|
|
|
27
26
|
agentPrivateKeyFile: Config.redacted(Schema.Config("MOLTZAPD_AGENT_PRIVATE_KEY_FILE", configuredPath)),
|
|
28
27
|
admissionCredentialFile: Schema.Config("MOLTZAPD_ADMISSION_CREDENTIAL_FILE", optionalConfiguredPath).pipe(Config.withDefault(""), Config.map((path) => (path === "" ? undefined : Redacted.make(path)))),
|
|
29
28
|
historyExport: Schema.Config("MOLTZAPD_HISTORY_EXPORT", configuredPath).pipe(Config.withDefault(undefined)),
|
|
29
|
+
mcpRuntimeCredentialFile: Config.redacted(Schema.Config("MOLTZAPD_MCP_RUNTIME_CREDENTIAL_FILE", configuredPath)).pipe(Config.withDefault(undefined)),
|
|
30
|
+
mcpOwnerCredentialFile: Config.redacted(Schema.Config("MOLTZAPD_MCP_OWNER_CREDENTIAL_FILE", configuredPath)).pipe(Config.withDefault(undefined)),
|
|
30
31
|
});
|
|
31
32
|
/** One non-diagnostic daemon configuration failure. */
|
|
32
33
|
export class DaemonConfigurationError extends Data.TaggedError("DaemonConfigurationError") {
|
|
33
34
|
}
|
|
34
35
|
const configurationError = (reason) => new DaemonConfigurationError({ reason });
|
|
35
|
-
/**
|
|
36
|
-
* Loads exactly the six required daemon process inputs, the optional
|
|
37
|
-
* admission credential file, and the optional export.
|
|
38
|
-
*/
|
|
36
|
+
/** Loads explicit daemon inputs with optional export and MCP authority separation. */
|
|
39
37
|
export const loadDaemonProcessConfiguration = configuredValues.pipe(Effect.map((configuration) => configuration), Effect.mapError(() => configurationError("environment")), Effect.withSpan("loadDaemonProcessConfiguration"));
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
const credentialFailure = (fileReason, valueReason) => (error) => configurationError(error.stage === "file" ? fileReason : valueReason);
|
|
39
|
+
const mcpCredential = credentialText.pipe(Schema.minLength(32));
|
|
40
|
+
const loadMcpCredentials = (configuration) => Effect.gen(function* () {
|
|
41
|
+
const runtimePath = configuration.mcpRuntimeCredentialFile;
|
|
42
|
+
const ownerPath = configuration.mcpOwnerCredentialFile;
|
|
43
|
+
if (runtimePath === undefined && ownerPath === undefined) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
if (runtimePath === undefined || ownerPath === undefined) {
|
|
47
|
+
return yield* Effect.fail(configurationError("mcp-credential"));
|
|
48
|
+
}
|
|
49
|
+
const runtime = yield* readCredential(runtimePath, mcpCredential).pipe(Effect.mapError(credentialFailure("mcp-runtime-credential-file", "mcp-credential")));
|
|
50
|
+
const owner = yield* readCredential(ownerPath, mcpCredential).pipe(Effect.mapError(credentialFailure("mcp-owner-credential-file", "mcp-credential")));
|
|
51
|
+
if (credentialMatches(Redacted.value(runtime), owner)) {
|
|
52
|
+
return yield* Effect.fail(configurationError("mcp-credential"));
|
|
53
|
+
}
|
|
54
|
+
return { runtime, owner };
|
|
43
55
|
});
|
|
44
|
-
const
|
|
45
|
-
try: () => readFile(Redacted.value(path)),
|
|
46
|
-
catch: () => configurationError(reason),
|
|
47
|
-
}).pipe(Effect.flatMap((bytes) => Effect.try({
|
|
48
|
-
try: () => utf8Decoder.decode(bytes),
|
|
49
|
-
catch: () => configurationError(reason),
|
|
50
|
-
})));
|
|
51
|
-
const loadSigningAuthority = (configuration) => readExactUtf8(configuration.agentPrivateKeyFile, "agent-private-key-file").pipe(Effect.flatMap((privateKey) => AgentSigningAuthority.fromPkcs8(Redacted.make(privateKey))), Effect.mapError((error) => error._tag === "DaemonConfigurationError"
|
|
52
|
-
? error
|
|
53
|
-
: configurationError("agent-private-key")));
|
|
54
|
-
const loadAdmissionCredential = (configuration) => (configuration.admissionCredentialFile === undefined
|
|
56
|
+
const loadConfiguredAdmissionCredential = (configuration) => configuration.admissionCredentialFile === undefined
|
|
55
57
|
? Effect.fail(configurationError("admission-credential-file"))
|
|
56
|
-
:
|
|
57
|
-
? error
|
|
58
|
-
: configurationError("admission-credential")));
|
|
58
|
+
: loadAdmissionCredential(configuration.admissionCredentialFile).pipe(Effect.mapError(credentialFailure("admission-credential-file", "admission-credential")));
|
|
59
59
|
/**
|
|
60
60
|
* Reads the agent private key and constructs the configured Ed25519 authority.
|
|
61
61
|
*
|
|
62
|
-
* @param configuration Validated process configuration.
|
|
63
|
-
* @returns Opaque
|
|
62
|
+
* @param configuration Validated process configuration and optional authority paths.
|
|
63
|
+
* @returns Opaque signing authority, MCP credentials, and deferred admission credential.
|
|
64
64
|
*/
|
|
65
65
|
export const loadDaemonBootstrap = (configuration) => Effect.gen(function* () {
|
|
66
|
-
const signingAuthority = yield* loadSigningAuthority(configuration);
|
|
67
|
-
const admissionCredential = yield* Effect.cached(
|
|
66
|
+
const signingAuthority = yield* loadSigningAuthority(configuration.agentPrivateKeyFile).pipe(Effect.mapError(credentialFailure("agent-private-key-file", "agent-private-key")));
|
|
67
|
+
const admissionCredential = yield* Effect.cached(loadConfiguredAdmissionCredential(configuration));
|
|
68
|
+
const mcpCredentials = yield* loadMcpCredentials(configuration);
|
|
68
69
|
return Object.freeze({
|
|
69
70
|
configuration,
|
|
70
71
|
signingAuthority,
|
|
71
72
|
agentPublicKey: AgentSigningAuthority.publicKey(signingAuthority),
|
|
72
73
|
admissionCredential,
|
|
74
|
+
...(mcpCredentials === undefined ? {} : { mcpCredentials }),
|
|
73
75
|
});
|
|
74
76
|
}).pipe(Effect.withSpan("loadDaemonBootstrap"));
|
|
75
77
|
//# sourceMappingURL=configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../src/service/configuration.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GAEjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChE,OAAO,EACL,iBAAiB,GAElB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAE9B,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CACjD,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CACpC,CAAC;AACF,MAAM,IAAI,GAAG,wBAAwB,CAAC,IAAI,CACxC,MAAM,CAAC,OAAO,CAAC,MAAM,C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QAAQ,CACb,iBAAiB,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,CACjE,CACF,CAAC;IACF,MAAM,mBAAmB,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAC9C,iCAAiC,CAAC,aAAa,CAAC,CACjD,CAAC;IACF,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAChE,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,aAAa;QACb,gBAAgB;QAChB,cAAc,EAAE,qBAAqB,CAAC,SAAS,CAAC,gBAAgB,CAAC;QACjE,mBAAmB;QACnB,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC;KAC5D,CAAC,CAAC;AACL,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAAC"}
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import { Registry } from "@moltzap/identity/registry";
|
|
3
3
|
import { Router } from "@moltzap/router";
|
|
4
4
|
import { Effect, Scope } from "effect";
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
5
|
+
import type { HistoryExportPort } from "../delivery/history-export.js";
|
|
6
|
+
import type { EventStore } from "../delivery/operations.js";
|
|
7
|
+
import type { HarnessMcpOperations } from "../endpoint/mcp/index.js";
|
|
8
|
+
import type { EndpointStore } from "../store/index.js";
|
|
9
|
+
import type { DaemonBootstrap } from "./configuration.js";
|
|
9
10
|
import { type DaemonActivationPreparation, type DaemonRuntimeDependencies, DaemonRuntimeError } from "./activation.js";
|
|
10
|
-
import { type RuntimeSubscriptionHandler } from "./
|
|
11
|
+
import { type RuntimeSubscriptionHandler } from "./supervision.js";
|
|
11
12
|
interface DaemonControllerInput {
|
|
12
13
|
readonly store: EndpointStore;
|
|
13
14
|
readonly bootstrap: DaemonBootstrap;
|
|
@@ -18,6 +19,7 @@ interface DaemonControllerInput {
|
|
|
18
19
|
/** Controller operations consumed by the daemon composition root. */
|
|
19
20
|
export interface DaemonController {
|
|
20
21
|
readonly operations: HarnessMcpOperations;
|
|
22
|
+
readonly eventStore: EventStore;
|
|
21
23
|
readonly subscriptionChanged: (active: boolean) => void;
|
|
22
24
|
readonly installHandler: (handler: RuntimeSubscriptionHandler) => Effect.Effect<void>;
|
|
23
25
|
readonly runSubscriptions: Effect.Effect<never, DaemonRuntimeError>;
|
|
@@ -29,6 +31,6 @@ export interface DaemonController {
|
|
|
29
31
|
* @param input Durable store, bootstrap configuration, and process dependencies.
|
|
30
32
|
* @returns Controller operations and supervised lifecycle effects.
|
|
31
33
|
*/
|
|
32
|
-
export declare const makeDaemonController: (input: DaemonControllerInput) => Effect.Effect<DaemonController,
|
|
34
|
+
export declare const makeDaemonController: (input: DaemonControllerInput) => Effect.Effect<DaemonController, DaemonRuntimeError, Registry | Router | Scope.Scope>;
|
|
33
35
|
export {};
|
|
34
36
|
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/service/controller.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAG7E,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAY,MAAM,EAAS,KAAK,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM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CAAC,KAAK,CAsCiB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** @file MCP operations and subscription state for one daemon controller. */
|
|
2
|
+
import { Registry } from "@moltzap/identity/registry";
|
|
3
|
+
import { Router } from "@moltzap/router";
|
|
4
|
+
import { Deferred, Effect, Queue, Scope } from "effect";
|
|
5
|
+
import { makeHostDelivery } from "../delivery/index.js";
|
|
6
|
+
import { DaemonRuntimeError, finishRegistration, } from "./activation.js";
|
|
7
|
+
import { failFromBackgroundCause, initializeProtocol, publishPendingMessages, } from "./supervision.js";
|
|
8
|
+
const runtimeFailure = (phase) => new DaemonRuntimeError({ phase });
|
|
9
|
+
const activationRuntimeFailure = (error) => runtimeFailure(error.reason === "upstream" ? "listener" : "storage");
|
|
10
|
+
/**
|
|
11
|
+
* The register tool's closed reason for an activation failure: a local
|
|
12
|
+
* storage fault is persistence-failed; an upstream or representation fault
|
|
13
|
+
* is dependency-unavailable.
|
|
14
|
+
*/
|
|
15
|
+
const registerFailureReason = (reason) => {
|
|
16
|
+
switch (reason) {
|
|
17
|
+
case "persistence":
|
|
18
|
+
return "persistence-failed";
|
|
19
|
+
case "upstream":
|
|
20
|
+
case "representation":
|
|
21
|
+
return "dependency-unavailable";
|
|
22
|
+
default: {
|
|
23
|
+
const exhaustive = reason;
|
|
24
|
+
return exhaustive;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const makeRegisterOperation = (environment, management, initialize) => (request) => Effect.uninterruptible(management.register(request).pipe(Effect.flatMap((result) => finishRegistration({
|
|
29
|
+
store: environment.store,
|
|
30
|
+
bootstrap: environment.bootstrap,
|
|
31
|
+
fatal: environment.fatal,
|
|
32
|
+
initialize,
|
|
33
|
+
}, result)), Effect.catchTag("DaemonActivationError", (error) => Effect.fail({ reason: registerFailureReason(error.reason) }))));
|
|
34
|
+
const runSubscriptionChanges = (environment, changes, reconciler) => Queue.take(changes).pipe(Effect.flatMap((active) => Effect.sync(() => {
|
|
35
|
+
environment.state.subscriptionActive = active;
|
|
36
|
+
}).pipe(Effect.zipRight(active ? Effect.void : environment.delivery.detach), Effect.zipRight(Effect.ignore(reconciler)))), Effect.forever, Effect.catchAllCause((cause) => failFromBackgroundCause(environment.fatal, cause)));
|
|
37
|
+
const initializeAtStart = (initialize, state) => {
|
|
38
|
+
if (state.kind === "unregistered") {
|
|
39
|
+
return Effect.void;
|
|
40
|
+
}
|
|
41
|
+
return initialize(state.agentCard).pipe(Effect.mapError(activationRuntimeFailure));
|
|
42
|
+
};
|
|
43
|
+
const controllerOperations = (input) => {
|
|
44
|
+
const register = makeRegisterOperation(input.environment, input.management, input.initialize);
|
|
45
|
+
return Object.freeze({
|
|
46
|
+
...input.management,
|
|
47
|
+
register,
|
|
48
|
+
...input.environment.delivery.operations,
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const assembleDaemonController = (input) => ({
|
|
52
|
+
operations: controllerOperations(input),
|
|
53
|
+
eventStore: input.environment.delivery.eventStore,
|
|
54
|
+
subscriptionChanged: (active) => {
|
|
55
|
+
input.changes.unsafeOffer(active);
|
|
56
|
+
},
|
|
57
|
+
installHandler: (handler) => Effect.sync(() => {
|
|
58
|
+
input.environment.state.handler = handler;
|
|
59
|
+
input.changes.unsafeOffer(handler.hasActiveSubscription());
|
|
60
|
+
}),
|
|
61
|
+
runSubscriptions: runSubscriptionChanges(input.environment, input.changes, input.reconciler),
|
|
62
|
+
awaitFailure: Deferred.await(input.environment.fatal),
|
|
63
|
+
initializeAtStart: (state) => initializeAtStart(input.initialize, state),
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* Acquire the daemon's protocol controller without starting the MCP listener.
|
|
67
|
+
* @param input Durable store, bootstrap configuration, and process dependencies.
|
|
68
|
+
* @returns Controller operations and supervised lifecycle effects.
|
|
69
|
+
*/
|
|
70
|
+
export const makeDaemonController = (input) => Effect.gen(function* () {
|
|
71
|
+
const registry = yield* Registry;
|
|
72
|
+
const router = yield* Router;
|
|
73
|
+
const daemonScope = yield* Scope.Scope;
|
|
74
|
+
const activationGate = yield* Effect.makeSemaphore(1);
|
|
75
|
+
const changes = yield* Queue.unbounded();
|
|
76
|
+
const fatal = yield* Deferred.make();
|
|
77
|
+
const state = { subscriptionActive: false };
|
|
78
|
+
const delivery = yield* makeHostDelivery({
|
|
79
|
+
store: input.store,
|
|
80
|
+
historyExport: input.historyExport,
|
|
81
|
+
collectives: () => state.activeProtocol?.collectives,
|
|
82
|
+
scope: daemonScope,
|
|
83
|
+
}).pipe(Effect.mapError(() => runtimeFailure("storage")));
|
|
84
|
+
const environment = {
|
|
85
|
+
store: input.store,
|
|
86
|
+
bootstrap: input.bootstrap,
|
|
87
|
+
historyExport: input.historyExport,
|
|
88
|
+
dependencies: input.dependencies,
|
|
89
|
+
registry,
|
|
90
|
+
router,
|
|
91
|
+
daemonScope,
|
|
92
|
+
fatal,
|
|
93
|
+
state,
|
|
94
|
+
delivery,
|
|
95
|
+
};
|
|
96
|
+
const reconciler = publishPendingMessages(environment);
|
|
97
|
+
const initialize = (agentCard) => initializeProtocol(environment, activationGate, reconciler, agentCard);
|
|
98
|
+
return assembleDaemonController({
|
|
99
|
+
environment,
|
|
100
|
+
management: input.management,
|
|
101
|
+
changes,
|
|
102
|
+
reconciler,
|
|
103
|
+
initialize,
|
|
104
|
+
});
|
|
105
|
+
}).pipe(Effect.withSpan("makeDaemonController"));
|
|
106
|
+
//# sourceMappingURL=controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/service/controller.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAG7E,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAMxD,OAAO,EAAE,g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