@moltzap/client 2026.529.0 → 2026.717.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/dist/agent-client.d.ts +2 -65
- package/dist/agent-client.d.ts.map +1 -1
- package/dist/agent-client.js +1 -286
- package/dist/agent-client.js.map +1 -1
- package/dist/app-client.d.ts +3 -0
- package/dist/app-client.d.ts.map +1 -0
- package/dist/app-client.js +2 -0
- package/dist/app-client.js.map +1 -0
- package/dist/auth.d.ts +6 -15
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +12 -16
- package/dist/auth.js.map +1 -1
- package/dist/channel-base/format-cross-conv.d.ts +10 -15
- package/dist/channel-base/format-cross-conv.d.ts.map +1 -1
- package/dist/channel-base/format-cross-conv.js +10 -15
- package/dist/channel-base/format-cross-conv.js.map +1 -1
- package/dist/channel-base/format-group-block.d.ts +8 -10
- package/dist/channel-base/format-group-block.d.ts.map +1 -1
- package/dist/channel-base/format-group-block.js +8 -10
- package/dist/channel-base/format-group-block.js.map +1 -1
- package/dist/channel-base/index.d.ts +3 -62
- package/dist/channel-base/index.d.ts.map +1 -1
- package/dist/channel-base/index.js +2 -65
- package/dist/channel-base/index.js.map +1 -1
- package/dist/channel-base/lease-guard.d.ts +0 -2
- package/dist/channel-base/lease-guard.d.ts.map +1 -1
- package/dist/channel-base/lease-guard.js +0 -2
- package/dist/channel-base/lease-guard.js.map +1 -1
- package/dist/channel-base/lease-store.d.ts +2 -3
- package/dist/channel-base/lease-store.d.ts.map +1 -1
- package/dist/channel-base/lease-store.js +2 -3
- package/dist/channel-base/lease-store.js.map +1 -1
- package/dist/channel-base/lease.d.ts +25 -31
- package/dist/channel-base/lease.d.ts.map +1 -1
- package/dist/channel-base/lease.js +29 -45
- package/dist/channel-base/lease.js.map +1 -1
- package/dist/channel-core-enrichment.d.ts +1 -1
- package/dist/channel-core-enrichment.d.ts.map +1 -1
- package/dist/channel-core-test-support.d.ts +17 -11
- package/dist/channel-core-test-support.d.ts.map +1 -1
- package/dist/channel-core-test-support.js +5 -6
- package/dist/channel-core-test-support.js.map +1 -1
- package/dist/channel-core.d.ts +24 -29
- package/dist/channel-core.d.ts.map +1 -1
- package/dist/channel-core.js +18 -42
- package/dist/channel-core.js.map +1 -1
- package/dist/cli/commands/agents.d.ts +3 -6
- package/dist/cli/commands/agents.d.ts.map +1 -1
- package/dist/cli/commands/agents.js +14 -50
- package/dist/cli/commands/agents.js.map +1 -1
- package/dist/cli/commands/contacts.d.ts +5 -6
- package/dist/cli/commands/contacts.d.ts.map +1 -1
- package/dist/cli/commands/contacts.js +15 -43
- package/dist/cli/commands/contacts.js.map +1 -1
- package/dist/cli/commands/conversations.d.ts +8 -18
- package/dist/cli/commands/conversations.d.ts.map +1 -1
- package/dist/cli/commands/conversations.js +14 -65
- package/dist/cli/commands/conversations.js.map +1 -1
- package/dist/cli/commands/messages.d.ts +13 -35
- package/dist/cli/commands/messages.d.ts.map +1 -1
- package/dist/cli/commands/messages.js +21 -46
- package/dist/cli/commands/messages.js.map +1 -1
- package/dist/cli/commands/register.d.ts +10 -12
- package/dist/cli/commands/register.d.ts.map +1 -1
- package/dist/cli/commands/register.js +47 -133
- package/dist/cli/commands/register.js.map +1 -1
- package/dist/cli/commands/send.d.ts +23 -36
- package/dist/cli/commands/send.d.ts.map +1 -1
- package/dist/cli/commands/send.js +25 -72
- package/dist/cli/commands/send.js.map +1 -1
- package/dist/cli/commands/start.d.ts +10 -124
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +28 -510
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/status.d.ts +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +8 -9
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/test-transport.d.ts +12 -5
- package/dist/cli/commands/test-transport.d.ts.map +1 -1
- package/dist/cli/commands/test-transport.js +15 -15
- package/dist/cli/commands/test-transport.js.map +1 -1
- package/dist/cli/index.js +13 -40
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts +4 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +9 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/socket-client.d.ts +7 -14
- package/dist/cli/socket-client.d.ts.map +1 -1
- package/dist/cli/socket-client.js +15 -38
- package/dist/cli/socket-client.js.map +1 -1
- package/dist/cli/transport.d.ts +53 -116
- package/dist/cli/transport.d.ts.map +1 -1
- package/dist/cli/transport.js +45 -295
- package/dist/cli/transport.js.map +1 -1
- package/dist/config.d.ts +24 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +35 -0
- package/dist/config.js.map +1 -0
- package/dist/config.test-utils.d.ts +13 -0
- package/dist/config.test-utils.d.ts.map +1 -0
- package/dist/config.test-utils.js +46 -0
- package/dist/config.test-utils.js.map +1 -0
- package/dist/index.d.ts +3 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -12
- package/dist/index.js.map +1 -1
- package/dist/local-daemon-rpc.d.ts +259 -8
- package/dist/local-daemon-rpc.d.ts.map +1 -1
- package/dist/local-daemon-rpc.js +189 -12
- package/dist/local-daemon-rpc.js.map +1 -1
- package/dist/{runtime/local-history.d.ts → local-history.d.ts} +16 -21
- package/dist/local-history.d.ts.map +1 -0
- package/dist/{runtime/local-history.js → local-history.js} +16 -21
- package/dist/local-history.js.map +1 -0
- package/dist/local-paths.d.ts +0 -2
- package/dist/local-paths.d.ts.map +1 -1
- package/dist/local-paths.js +0 -4
- package/dist/local-paths.js.map +1 -1
- package/dist/local-socket-server.d.ts +22 -0
- package/dist/local-socket-server.d.ts.map +1 -0
- package/dist/{runtime/local-socket-server.js → local-socket-server.js} +4 -9
- package/dist/local-socket-server.js.map +1 -0
- package/dist/message-rendering.d.ts +3 -0
- package/dist/message-rendering.d.ts.map +1 -0
- package/dist/message-rendering.js +7 -0
- package/dist/message-rendering.js.map +1 -0
- package/dist/notification/__tests__/{snapshot-semantics.types-check.d.ts → subscribe-signatures.types-check.d.ts} +1 -1
- package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts.map +1 -0
- package/dist/notification/__tests__/subscribe-signatures.types-check.js +55 -0
- package/dist/notification/__tests__/subscribe-signatures.types-check.js.map +1 -0
- package/dist/notification/errors.d.ts +18 -6
- package/dist/notification/errors.d.ts.map +1 -1
- package/dist/notification/errors.js +13 -15
- package/dist/notification/errors.js.map +1 -1
- package/dist/notification/index.d.ts +5 -0
- package/dist/notification/index.d.ts.map +1 -0
- package/dist/notification/index.js +5 -0
- package/dist/notification/index.js.map +1 -0
- package/dist/notification/stream.d.ts +33 -49
- package/dist/notification/stream.d.ts.map +1 -1
- package/dist/notification/stream.js +33 -76
- package/dist/notification/stream.js.map +1 -1
- package/dist/pagination.d.ts +20 -10
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +8 -9
- package/dist/pagination.js.map +1 -1
- package/dist/profile.d.ts +92 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +149 -0
- package/dist/profile.js.map +1 -0
- package/dist/refs.d.ts.map +1 -0
- package/dist/refs.js.map +1 -0
- package/dist/service-archive-purge.d.ts +2 -1
- package/dist/service-archive-purge.d.ts.map +1 -1
- package/dist/service-archive-purge.js.map +1 -1
- package/dist/{runtime/service-helpers.d.ts → service-helpers.d.ts} +5 -11
- package/dist/service-helpers.d.ts.map +1 -0
- package/dist/{runtime/service-helpers.js → service-helpers.js} +2 -9
- package/dist/service-helpers.js.map +1 -0
- package/dist/service-local-daemon.d.ts +22 -0
- package/dist/service-local-daemon.d.ts.map +1 -0
- package/dist/service-local-daemon.js +185 -0
- package/dist/service-local-daemon.js.map +1 -0
- package/dist/service.d.ts +65 -57
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +205 -156
- package/dist/service.js.map +1 -1
- package/dist/test-utils/channel-service-fixture.d.ts +3 -2
- package/dist/test-utils/channel-service-fixture.d.ts.map +1 -1
- package/dist/test-utils/channel-service-fixture.js.map +1 -1
- package/dist/test-utils/fake-service.d.ts +26 -18
- package/dist/test-utils/fake-service.d.ts.map +1 -1
- package/dist/test-utils/fake-service.js +28 -42
- package/dist/test-utils/fake-service.js.map +1 -1
- package/dist/test-utils/ids.d.ts +3 -1
- package/dist/test-utils/ids.d.ts.map +1 -1
- package/dist/test-utils/ids.js.map +1 -1
- package/dist/test-utils/index.d.ts +9 -2
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/index.js +8 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/standalone-provisioning.d.ts +17 -0
- package/dist/test-utils/standalone-provisioning.d.ts.map +1 -0
- package/dist/test-utils/standalone-provisioning.js +14 -0
- package/dist/test-utils/standalone-provisioning.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +39 -17
- package/dist/auth.test.d.ts +0 -2
- package/dist/auth.test.d.ts.map +0 -1
- package/dist/auth.test.js +0 -121
- package/dist/auth.test.js.map +0 -1
- package/dist/channel-core-context.test.d.ts +0 -2
- package/dist/channel-core-context.test.d.ts.map +0 -1
- package/dist/channel-core-context.test.js +0 -342
- package/dist/channel-core-context.test.js.map +0 -1
- package/dist/channel-core-dispatch.test.d.ts +0 -2
- package/dist/channel-core-dispatch.test.d.ts.map +0 -1
- package/dist/channel-core-dispatch.test.js +0 -557
- package/dist/channel-core-dispatch.test.js.map +0 -1
- package/dist/channel-core.test.d.ts +0 -2
- package/dist/channel-core.test.d.ts.map +0 -1
- package/dist/channel-core.test.js +0 -232
- package/dist/channel-core.test.js.map +0 -1
- package/dist/cli/__tests__/cli-multi-agent.int.test.d.ts +0 -2
- package/dist/cli/__tests__/cli-multi-agent.int.test.d.ts.map +0 -1
- package/dist/cli/__tests__/cli-multi-agent.int.test.js +0 -132
- package/dist/cli/__tests__/cli-multi-agent.int.test.js.map +0 -1
- package/dist/cli/commands/invite.d.ts +0 -7
- package/dist/cli/commands/invite.d.ts.map +0 -1
- package/dist/cli/commands/invite.js +0 -11
- package/dist/cli/commands/invite.js.map +0 -1
- package/dist/cli/commands/messages.test.d.ts +0 -2
- package/dist/cli/commands/messages.test.d.ts.map +0 -1
- package/dist/cli/commands/messages.test.js +0 -99
- package/dist/cli/commands/messages.test.js.map +0 -1
- package/dist/cli/commands/ping.d.ts +0 -7
- package/dist/cli/commands/ping.d.ts.map +0 -1
- package/dist/cli/commands/ping.js +0 -37
- package/dist/cli/commands/ping.js.map +0 -1
- package/dist/cli/commands/register.test.d.ts +0 -2
- package/dist/cli/commands/register.test.d.ts.map +0 -1
- package/dist/cli/commands/register.test.js +0 -91
- package/dist/cli/commands/register.test.js.map +0 -1
- package/dist/cli/commands/send.test.d.ts +0 -2
- package/dist/cli/commands/send.test.d.ts.map +0 -1
- package/dist/cli/commands/send.test.js +0 -59
- package/dist/cli/commands/send.test.js.map +0 -1
- package/dist/cli/commands/start.test.d.ts +0 -2
- package/dist/cli/commands/start.test.d.ts.map +0 -1
- package/dist/cli/commands/start.test.js +0 -624
- package/dist/cli/commands/start.test.js.map +0 -1
- package/dist/cli/commands/whoami.d.ts +0 -8
- package/dist/cli/commands/whoami.d.ts.map +0 -1
- package/dist/cli/commands/whoami.js +0 -28
- package/dist/cli/commands/whoami.js.map +0 -1
- package/dist/cli/config.d.ts +0 -66
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js +0 -148
- package/dist/cli/config.js.map +0 -1
- package/dist/cli/config.test.d.ts +0 -2
- package/dist/cli/config.test.d.ts.map +0 -1
- package/dist/cli/config.test.js +0 -89
- package/dist/cli/config.test.js.map +0 -1
- package/dist/cli/http-client.d.ts +0 -17
- package/dist/cli/http-client.d.ts.map +0 -1
- package/dist/cli/http-client.js +0 -38
- package/dist/cli/http-client.js.map +0 -1
- package/dist/cli/profile.d.ts +0 -126
- package/dist/cli/profile.d.ts.map +0 -1
- package/dist/cli/profile.js +0 -231
- package/dist/cli/profile.js.map +0 -1
- package/dist/cli/profile.test.d.ts +0 -2
- package/dist/cli/profile.test.d.ts.map +0 -1
- package/dist/cli/profile.test.js +0 -369
- package/dist/cli/profile.test.js.map +0 -1
- package/dist/cli/transport.test.d.ts +0 -2
- package/dist/cli/transport.test.d.ts.map +0 -1
- package/dist/cli/transport.test.js +0 -312
- package/dist/cli/transport.test.js.map +0 -1
- package/dist/notification/__tests__/filter-equivalence.test.d.ts +0 -2
- package/dist/notification/__tests__/filter-equivalence.test.d.ts.map +0 -1
- package/dist/notification/__tests__/filter-equivalence.test.js +0 -123
- package/dist/notification/__tests__/filter-equivalence.test.js.map +0 -1
- package/dist/notification/__tests__/snapshot-semantics.test.d.ts +0 -2
- package/dist/notification/__tests__/snapshot-semantics.test.d.ts.map +0 -1
- package/dist/notification/__tests__/snapshot-semantics.test.js +0 -261
- package/dist/notification/__tests__/snapshot-semantics.test.js.map +0 -1
- package/dist/notification/__tests__/snapshot-semantics.types-check.d.ts.map +0 -1
- package/dist/notification/__tests__/snapshot-semantics.types-check.js +0 -62
- package/dist/notification/__tests__/snapshot-semantics.types-check.js.map +0 -1
- package/dist/pagination.test.d.ts +0 -2
- package/dist/pagination.test.d.ts.map +0 -1
- package/dist/pagination.test.js +0 -72
- package/dist/pagination.test.js.map +0 -1
- package/dist/runtime/close-info.d.ts +0 -84
- package/dist/runtime/close-info.d.ts.map +0 -1
- package/dist/runtime/close-info.js +0 -102
- package/dist/runtime/close-info.js.map +0 -1
- package/dist/runtime/close-info.test.d.ts +0 -2
- package/dist/runtime/close-info.test.d.ts.map +0 -1
- package/dist/runtime/close-info.test.js +0 -109
- package/dist/runtime/close-info.test.js.map +0 -1
- package/dist/runtime/errors.d.ts +0 -11
- package/dist/runtime/errors.d.ts.map +0 -1
- package/dist/runtime/errors.js +0 -41
- package/dist/runtime/errors.js.map +0 -1
- package/dist/runtime/errors.test.d.ts +0 -2
- package/dist/runtime/errors.test.d.ts.map +0 -1
- package/dist/runtime/errors.test.js +0 -79
- package/dist/runtime/errors.test.js.map +0 -1
- package/dist/runtime/frame.d.ts +0 -8
- package/dist/runtime/frame.d.ts.map +0 -1
- package/dist/runtime/frame.js +0 -12
- package/dist/runtime/frame.js.map +0 -1
- package/dist/runtime/frame.test.d.ts +0 -2
- package/dist/runtime/frame.test.d.ts.map +0 -1
- package/dist/runtime/frame.test.js +0 -59
- package/dist/runtime/frame.test.js.map +0 -1
- package/dist/runtime/index.d.ts +0 -10
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js +0 -9
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/local-history.d.ts.map +0 -1
- package/dist/runtime/local-history.js.map +0 -1
- package/dist/runtime/local-service-commands.d.ts +0 -26
- package/dist/runtime/local-service-commands.d.ts.map +0 -1
- package/dist/runtime/local-service-commands.js +0 -29
- package/dist/runtime/local-service-commands.js.map +0 -1
- package/dist/runtime/local-socket-server.d.ts +0 -20
- package/dist/runtime/local-socket-server.d.ts.map +0 -1
- package/dist/runtime/local-socket-server.js.map +0 -1
- package/dist/runtime/refs.d.ts.map +0 -1
- package/dist/runtime/refs.js.map +0 -1
- package/dist/runtime/runtime.test.d.ts +0 -2
- package/dist/runtime/runtime.test.d.ts.map +0 -1
- package/dist/runtime/runtime.test.js +0 -37
- package/dist/runtime/runtime.test.js.map +0 -1
- package/dist/runtime/service-helpers.d.ts.map +0 -1
- package/dist/runtime/service-helpers.js.map +0 -1
- package/dist/runtime/service-teardown.d.ts +0 -5
- package/dist/runtime/service-teardown.d.ts.map +0 -1
- package/dist/runtime/service-teardown.js +0 -36
- package/dist/runtime/service-teardown.js.map +0 -1
- package/dist/runtime/service-teardown.test.d.ts +0 -2
- package/dist/runtime/service-teardown.test.d.ts.map +0 -1
- package/dist/runtime/service-teardown.test.js +0 -80
- package/dist/runtime/service-teardown.test.js.map +0 -1
- package/dist/runtime/subscribers.d.ts +0 -152
- package/dist/runtime/subscribers.d.ts.map +0 -1
- package/dist/runtime/subscribers.js +0 -222
- package/dist/runtime/subscribers.js.map +0 -1
- package/dist/service-socket-path.test.d.ts +0 -2
- package/dist/service-socket-path.test.d.ts.map +0 -1
- package/dist/service-socket-path.test.js +0 -87
- package/dist/service-socket-path.test.js.map +0 -1
- package/dist/service.test.d.ts +0 -2
- package/dist/service.test.d.ts.map +0 -1
- package/dist/service.test.js +0 -796
- package/dist/service.test.js.map +0 -1
- package/dist/test/index.d.ts +0 -47
- package/dist/test/index.d.ts.map +0 -1
- package/dist/test/index.js +0 -39
- package/dist/test/index.js.map +0 -1
- package/dist/test-utils/conformance-adapter.d.ts +0 -40
- package/dist/test-utils/conformance-adapter.d.ts.map +0 -1
- package/dist/test-utils/conformance-adapter.js +0 -250
- package/dist/test-utils/conformance-adapter.js.map +0 -1
- package/dist/tm-client-test-support.d.ts +0 -184
- package/dist/tm-client-test-support.d.ts.map +0 -1
- package/dist/tm-client-test-support.js +0 -466
- package/dist/tm-client-test-support.js.map +0 -1
- package/dist/tm-client.d.ts +0 -269
- package/dist/tm-client.d.ts.map +0 -1
- package/dist/tm-client.js +0 -518
- package/dist/tm-client.js.map +0 -1
- package/dist/tm-client.test.d.ts +0 -2
- package/dist/tm-client.test.d.ts.map +0 -1
- package/dist/tm-client.test.js +0 -490
- package/dist/tm-client.test.js.map +0 -1
- /package/dist/{runtime/refs.d.ts → refs.d.ts} +0 -0
- /package/dist/{runtime/refs.js → refs.js} +0 -0
package/dist/cli/transport.d.ts
CHANGED
|
@@ -1,16 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI transport layer — the single boundary between the command handlers and
|
|
3
|
+
* the local daemon socket.
|
|
4
|
+
*
|
|
5
|
+
* Command handlers pull `Transport` from Effect context; they do NOT open
|
|
6
|
+
* sockets or construct clients themselves. The kind of
|
|
7
|
+
* transport in effect is decided once at CLI boot by {@link makeTransportLayer}
|
|
8
|
+
* and is immutable for the lifetime of the process.
|
|
9
|
+
*
|
|
10
|
+
* Test seam: integration tests swap {@link makeTransportLayer} for a layer
|
|
11
|
+
* that provides a recording `Transport`; unit tests provide `Transport`
|
|
12
|
+
* directly via `Effect.provideService`.
|
|
13
|
+
*/
|
|
1
14
|
import { Context, Effect, Layer } from "effect";
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
15
|
+
import type { RpcGroup } from "@effect/rpc";
|
|
16
|
+
import { type LocalDaemonError, LocalDaemonRpcs } from "../local-daemon-rpc.js";
|
|
17
|
+
import { type ProfileError, type ProfileName } from "../profile.js";
|
|
18
|
+
import type { PayloadForTag, SuccessForTag } from "@moltzap/protocol/rpc";
|
|
19
|
+
/** The local daemon command group's member `Rpc`s. */
|
|
20
|
+
type DaemonRpcs = RpcGroup.Rpcs<typeof LocalDaemonRpcs>;
|
|
21
|
+
/** The local command tags the CLI may originate. */
|
|
22
|
+
type DaemonCommand = DaemonRpcs["_tag"];
|
|
4
23
|
/** Errors any Transport.rpc call may surface. Exhaustive. */
|
|
5
|
-
export type TransportError = ServiceUnreachableError | TransportTimeoutError | TransportRpcError | TransportDecodeError |
|
|
24
|
+
export type TransportError = ServiceUnreachableError | TransportTimeoutError | TransportRpcError | TransportDecodeError | LocalDaemonError;
|
|
6
25
|
declare const ServiceUnreachableError_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
26
|
readonly _tag: "ServiceUnreachableError";
|
|
8
27
|
} & Readonly<A>;
|
|
9
28
|
/**
|
|
10
29
|
* The daemon socket path did not exist or refused connection. Only raised
|
|
11
|
-
* by the daemon
|
|
30
|
+
* by the daemon path.
|
|
12
31
|
*/
|
|
13
|
-
|
|
32
|
+
declare class ServiceUnreachableError extends ServiceUnreachableError_base<{
|
|
14
33
|
readonly socketPath: string;
|
|
15
34
|
readonly cause: unknown;
|
|
16
35
|
}> {
|
|
@@ -19,7 +38,7 @@ declare const TransportTimeoutError_base: new <A extends Record<string, any> = {
|
|
|
19
38
|
readonly _tag: "TransportTimeoutError";
|
|
20
39
|
} & Readonly<A>;
|
|
21
40
|
/** RPC exceeded the per-call deadline without a response frame. */
|
|
22
|
-
|
|
41
|
+
declare class TransportTimeoutError extends TransportTimeoutError_base<{
|
|
23
42
|
readonly method: string;
|
|
24
43
|
readonly timeoutMs: number;
|
|
25
44
|
}> {
|
|
@@ -28,12 +47,13 @@ declare const TransportRpcError_base: new <A extends Record<string, any> = {}>(a
|
|
|
28
47
|
readonly _tag: "TransportRpcError";
|
|
29
48
|
} & Readonly<A>;
|
|
30
49
|
/**
|
|
31
|
-
* Server returned a
|
|
32
|
-
*
|
|
50
|
+
* Server returned a typed wire `error` for a request. `tag` is the failing
|
|
51
|
+
* method's tagged-error discriminant (e.g. `"TaskRejected"`, `"Forbidden"`) —
|
|
52
|
+
* the `_tag` the engine decoded the error against, not a numeric code.
|
|
33
53
|
*/
|
|
34
54
|
export declare class TransportRpcError extends TransportRpcError_base<{
|
|
35
55
|
readonly method: string;
|
|
36
|
-
readonly
|
|
56
|
+
readonly tag: string;
|
|
37
57
|
readonly message: string;
|
|
38
58
|
readonly data?: unknown;
|
|
39
59
|
}> {
|
|
@@ -42,141 +62,58 @@ declare const TransportDecodeError_base: new <A extends Record<string, any> = {}
|
|
|
42
62
|
readonly _tag: "TransportDecodeError";
|
|
43
63
|
} & Readonly<A>;
|
|
44
64
|
/** Response frame failed to parse or did not match the expected RPC result shape. */
|
|
45
|
-
|
|
65
|
+
declare class TransportDecodeError extends TransportDecodeError_base<{
|
|
46
66
|
readonly method: string;
|
|
47
67
|
readonly cause: unknown;
|
|
48
68
|
}> {
|
|
49
69
|
}
|
|
50
|
-
declare const TransportConfigError_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 & {
|
|
51
|
-
readonly _tag: "TransportConfigError";
|
|
52
|
-
} & Readonly<A>;
|
|
53
|
-
/**
|
|
54
|
-
* Transport inputs were self-inconsistent (e.g., `--as` set with no
|
|
55
|
-
* `serverUrl` resolvable). Surfaces at Layer construction, not at RPC time.
|
|
56
|
-
*/
|
|
57
|
-
export declare class TransportConfigError extends TransportConfigError_base<{
|
|
58
|
-
readonly reason: string;
|
|
59
|
-
}> {
|
|
60
|
-
}
|
|
61
70
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*/
|
|
65
|
-
export declare const DIRECT_TRANSPORT_KIND = "direct";
|
|
66
|
-
type TransportKind = "daemon" | typeof DIRECT_TRANSPORT_KIND | "test";
|
|
67
|
-
/**
|
|
68
|
-
* Transport surface used by every CLI command. One generic RPC call; the
|
|
69
|
-
* `kind` is for logs/tests. Commands never branch on `kind`.
|
|
71
|
+
* Transport surface used by every CLI command. One typed per-command call keyed
|
|
72
|
+
* by local daemon command.
|
|
70
73
|
*/
|
|
71
74
|
export interface Transport {
|
|
72
|
-
readonly
|
|
73
|
-
readonly rpc: <D extends RpcDefinition<string, any, any>>(definition: D, params: ParamsOf<D>) => Effect.Effect<ResultOf<D>, TransportError>;
|
|
75
|
+
readonly command: <Tag extends DaemonCommand>(tag: Tag, payload: PayloadForTag<DaemonRpcs, Tag>) => Effect.Effect<SuccessForTag<DaemonRpcs, Tag>, TransportError>;
|
|
74
76
|
}
|
|
75
77
|
export declare const Transport: Context.Tag<Transport, Transport>;
|
|
76
78
|
/**
|
|
77
79
|
* Inputs shaping the transport for one CLI invocation. Assembled from
|
|
78
|
-
* parsed CLI options
|
|
79
|
-
* `impersonateKey` wins over `profileKey` wins over daemon.
|
|
80
|
+
* parsed CLI options and profile config by the CLI entrypoint.
|
|
80
81
|
*/
|
|
81
82
|
export interface TransportOptions {
|
|
82
|
-
/**
|
|
83
|
-
readonly impersonateKey?: string;
|
|
84
|
-
/** Resolved profile apiKey if `--profile <name>` supplied. */
|
|
85
|
-
readonly profileKey?: string;
|
|
86
|
-
/** Resolved MOLTZAP_API_KEY for the legacy direct fallback branch. */
|
|
87
|
-
readonly envFallbackKey?: string;
|
|
88
|
-
/** Server URL resolved from config + env (wss:// or http://). */
|
|
89
|
-
readonly serverUrl: string;
|
|
90
|
-
/** Daemon socket path (absent only in tests that don't set it). */
|
|
91
|
-
readonly socketPath?: string;
|
|
92
|
-
/**
|
|
93
|
-
* Lazy probe: called ONLY on the env-fallback branch (step 2 below).
|
|
94
|
-
* The as-flag branch never invokes it (Invariant §4.2: --as must not
|
|
95
|
-
* touch the daemon socket, not even to check reachability). Passed as
|
|
96
|
-
* a thunk so the probe is a side effect of the fall-through branch,
|
|
97
|
-
* not of the decision input.
|
|
98
|
-
*/
|
|
99
|
-
readonly probeDaemon?: () => Effect.Effect<boolean, never>;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Decision of which branch {@link makeTransportLayer} selected, exported for
|
|
103
|
-
* log annotations and assertion in tests.
|
|
104
|
-
*/
|
|
105
|
-
export type TransportDecision = {
|
|
106
|
-
readonly _tag: "UseDaemon";
|
|
83
|
+
/** Selected daemon socket path for this invocation. */
|
|
107
84
|
readonly socketPath: string;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
} | {
|
|
112
|
-
readonly _tag: "UseTest";
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Decision function — Effect-returning because the env-fallback branch
|
|
116
|
-
* may invoke the `probeDaemon` thunk. The as-flag branch short-circuits
|
|
117
|
-
* BEFORE any probe: `impersonateKey` present ⇒ returns
|
|
118
|
-
* `UseDirect{as-flag}` without calling `probeDaemon`, without reading
|
|
119
|
-
* env, without any side effect (Invariant §4.2).
|
|
120
|
-
*/
|
|
121
|
-
export declare const decideTransport: (options: TransportOptions) => Effect.Effect<TransportDecision, never>;
|
|
122
|
-
/**
|
|
123
|
-
* Exported for decoder-fixture tests only (sbd#198).
|
|
124
|
-
* @internal
|
|
125
|
-
*/
|
|
126
|
-
export declare const tagWsError: (method: string, err: unknown) => TransportError;
|
|
127
|
-
/**
|
|
128
|
-
* Build the Layer that provides {@link Transport} for the current invocation.
|
|
129
|
-
*
|
|
130
|
-
* Branch points (in priority order):
|
|
131
|
-
* 1. `options.impersonateKey` → direct WS, Invariant §4.2 isolation guaranteed.
|
|
132
|
-
* 2. `process.env.MOLTZAP_API_KEY` present AND daemon unreachable → direct WS.
|
|
133
|
-
* 3. `options.profileKey` set → direct WS with that key.
|
|
134
|
-
* 4. otherwise → daemon transport over `options.socketPath`.
|
|
135
|
-
*
|
|
136
|
-
* The direct branch must NOT open the daemon socket, mutate
|
|
137
|
-
* `~/.moltzap/config.json`, or share any Effect fiber with the daemon.
|
|
138
|
-
* Integration test §7 of the design doc verifies this with a two-agent
|
|
139
|
-
* concurrent roster.
|
|
140
|
-
*/
|
|
141
|
-
export declare const makeTransportLayer: (options: TransportOptions) => Layer.Layer<Transport, TransportConfigError>;
|
|
85
|
+
}
|
|
86
|
+
/** Build the Layer that provides {@link Transport} for the current invocation. */
|
|
87
|
+
export declare const makeTransportLayer: (options: TransportOptions) => Layer.Layer<Transport>;
|
|
142
88
|
/**
|
|
143
|
-
* Convenience for command handlers: pull the Transport tag and call
|
|
144
|
-
*
|
|
145
|
-
*
|
|
89
|
+
* Convenience for command handlers: pull the Transport tag and call a daemon
|
|
90
|
+
* command.
|
|
91
|
+
* Every subcommand routes through this helper; command handlers do not
|
|
92
|
+
* import `socket-client` directly.
|
|
146
93
|
*/
|
|
147
|
-
export declare const
|
|
94
|
+
export declare const command: <Tag extends DaemonCommand>(tag: Tag, payload: PayloadForTag<DaemonRpcs, Tag>) => Effect.Effect<SuccessForTag<DaemonRpcs, Tag>, TransportError, Transport>;
|
|
148
95
|
/**
|
|
149
96
|
* Uniform error-to-exit adapter for subcommand handlers. Catches every error
|
|
150
97
|
* channel, prints `Failed: <msg>` to stderr, and exits non-zero. Uses the
|
|
151
98
|
* tagged-error `message` field if present, otherwise the `_tag`, otherwise
|
|
152
|
-
* a generic fallback. Shared across every
|
|
153
|
-
* exit-code contract
|
|
99
|
+
* a generic fallback. Shared across every subcommand wrapper so the
|
|
100
|
+
* exit-code contract has a single implementation.
|
|
154
101
|
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* the event loop (sbd#198 / moltzap#228 Bug-2 fix). No forced
|
|
158
|
-
* `process.exit(0)` — that would truncate piped stdout on large payloads.
|
|
102
|
+
* No forced `process.exit(0)` — that would truncate piped stdout on large
|
|
103
|
+
* payloads.
|
|
159
104
|
*/
|
|
160
105
|
export declare const runHandler: <E extends {
|
|
161
106
|
readonly message?: string;
|
|
162
107
|
readonly _tag?: string;
|
|
163
|
-
}>(effect: Effect.Effect<void, E,
|
|
108
|
+
}, R>(effect: Effect.Effect<void, E, R>) => Effect.Effect<void, never, R>;
|
|
164
109
|
/**
|
|
165
110
|
* Lazy resolver invoked by the CLI entrypoint BEFORE constructing the
|
|
166
|
-
* transport layer.
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* does NOT open `~/.moltzap/config.json`. The only resolution performed on
|
|
170
|
-
* the as-flag branch is `MOLTZAP_SERVER_URL` (or the hard-coded default).
|
|
171
|
-
*
|
|
172
|
-
* This function is the true CLI-boundary gate on Invariant §4.2 — without
|
|
173
|
-
* it, eager config-read side effects leak even when `decideTransport` is
|
|
174
|
-
* later short-circuited. Unit tests assert on `fs.open` and `env` read
|
|
175
|
-
* spies that zero calls happen on the `impersonateKey` branch.
|
|
111
|
+
* transport layer. With `profileName` set, this resolves the named profile
|
|
112
|
+
* into the profile agent's daemon socket; otherwise it uses the default
|
|
113
|
+
* daemon socket.
|
|
176
114
|
*/
|
|
177
115
|
export declare const resolveTransportInputs: (parsed: {
|
|
178
|
-
readonly
|
|
179
|
-
|
|
180
|
-
}) => Effect.Effect<TransportOptions, TransportConfigError | ProfileError>;
|
|
116
|
+
readonly profileName?: ProfileName;
|
|
117
|
+
}) => Effect.Effect<TransportOptions, ProfileError>;
|
|
181
118
|
export {};
|
|
182
119
|
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/cli/transport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/cli/transport.ts"],"names":[],"mappings":"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"}
|