@moltzap/client 2026.529.0 → 2026.718.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 +49 -27
- 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/profile.d.ts
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { Brand, Effect } from "effect";
|
|
2
|
-
/**
|
|
3
|
-
* Branded profile name. Enforces the same NAME_PATTERN already gated by
|
|
4
|
-
* `commands/register.ts`: `/^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$/`.
|
|
5
|
-
*/
|
|
6
|
-
export type ProfileName = string & Brand.Brand<"ProfileName">;
|
|
7
|
-
/** Sentinel used when the caller addresses the legacy top-level record. */
|
|
8
|
-
export type DefaultProfileId = "default";
|
|
9
|
-
/**
|
|
10
|
-
* One profile's auth record. Shape mirrors the singleton's auth subset.
|
|
11
|
-
* `registeredAt` is OPTIONAL — legacy configs produced by pre-v2 `moltzap
|
|
12
|
-
* register` never wrote the field. The profile layer tolerates its absence
|
|
13
|
-
* so existing `~/.moltzap/config.json` files decode into `LayeredConfig`
|
|
14
|
-
* without rewrite (Invariant §4.3).
|
|
15
|
-
*/
|
|
16
|
-
export interface ProfileRecord {
|
|
17
|
-
readonly apiKey: string;
|
|
18
|
-
readonly agentName: string;
|
|
19
|
-
readonly serverUrl: string;
|
|
20
|
-
readonly registeredAt?: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Layered view of config.json. The legacy top-level keys populate
|
|
24
|
-
* `default`; named records live under `profiles.<name>`. `serverUrl`
|
|
25
|
-
* is surfaced at the top because it is shared across profiles unless
|
|
26
|
-
* a profile overrides it.
|
|
27
|
-
*/
|
|
28
|
-
export interface LayeredConfig {
|
|
29
|
-
readonly default: ProfileRecord | undefined;
|
|
30
|
-
readonly profiles: ReadonlyMap<ProfileName, ProfileRecord>;
|
|
31
|
-
readonly serverUrl: string;
|
|
32
|
-
}
|
|
33
|
-
/** Exhaustive error union for the profile surface. */
|
|
34
|
-
export type ProfileError = ProfileNotFoundError | ProfileAlreadyExistsError | ProfileInvalidNameError | ProfileConfigReadError | ProfileConfigWriteError;
|
|
35
|
-
declare const ProfileNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
36
|
-
readonly _tag: "ProfileNotFoundError";
|
|
37
|
-
} & Readonly<A>;
|
|
38
|
-
export declare class ProfileNotFoundError extends ProfileNotFoundError_base<{
|
|
39
|
-
readonly name: string;
|
|
40
|
-
}> {
|
|
41
|
-
}
|
|
42
|
-
declare const ProfileAlreadyExistsError_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 & {
|
|
43
|
-
readonly _tag: "ProfileAlreadyExistsError";
|
|
44
|
-
} & Readonly<A>;
|
|
45
|
-
declare class ProfileAlreadyExistsError extends ProfileAlreadyExistsError_base<{
|
|
46
|
-
readonly name: string;
|
|
47
|
-
}> {
|
|
48
|
-
}
|
|
49
|
-
declare const ProfileInvalidNameError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
50
|
-
readonly _tag: "ProfileInvalidNameError";
|
|
51
|
-
} & Readonly<A>;
|
|
52
|
-
export declare class ProfileInvalidNameError extends ProfileInvalidNameError_base<{
|
|
53
|
-
readonly name: string;
|
|
54
|
-
readonly reason: string;
|
|
55
|
-
}> {
|
|
56
|
-
}
|
|
57
|
-
declare const ProfileConfigReadError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
58
|
-
readonly _tag: "ProfileConfigReadError";
|
|
59
|
-
} & Readonly<A>;
|
|
60
|
-
export declare class ProfileConfigReadError extends ProfileConfigReadError_base<{
|
|
61
|
-
readonly path: string;
|
|
62
|
-
readonly cause: unknown;
|
|
63
|
-
}> {
|
|
64
|
-
}
|
|
65
|
-
declare const ProfileConfigWriteError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
66
|
-
readonly _tag: "ProfileConfigWriteError";
|
|
67
|
-
} & Readonly<A>;
|
|
68
|
-
export declare class ProfileConfigWriteError extends ProfileConfigWriteError_base<{
|
|
69
|
-
readonly path: string;
|
|
70
|
-
readonly cause: unknown;
|
|
71
|
-
}> {
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Parse and brand a raw profile name. Rejects the empty string and any
|
|
75
|
-
* string that fails NAME_PATTERN.
|
|
76
|
-
*/
|
|
77
|
-
export declare const parseProfileName: (raw: string) => Effect.Effect<ProfileName, ProfileInvalidNameError>;
|
|
78
|
-
/**
|
|
79
|
-
* Load the full layered config view. Missing file resolves to an empty
|
|
80
|
-
* view; malformed file surfaces as ProfileConfigReadError. No silent
|
|
81
|
-
* defaults on parse error.
|
|
82
|
-
*
|
|
83
|
-
* Unknown-key tolerance: the decoder accepts extra top-level keys (e.g.
|
|
84
|
-
* future experimental fields) without failing. This keeps forward and
|
|
85
|
-
* backward compatibility explicit rather than implicit.
|
|
86
|
-
*/
|
|
87
|
-
export declare const loadLayeredConfig: Effect.Effect<LayeredConfig, ProfileConfigReadError>;
|
|
88
|
-
/**
|
|
89
|
-
* Resolve the auth record for a given profile name.
|
|
90
|
-
*
|
|
91
|
-
* When `name` is `undefined`, the `default` record is returned (legacy
|
|
92
|
-
* behavior for users who never pass `--profile`). When `name` is supplied
|
|
93
|
-
* and no matching record exists, fails with ProfileNotFoundError — do not
|
|
94
|
-
* silently fall back to `default`; that would violate Invariant §4.3's
|
|
95
|
-
* "takes precedence" clause in the opposite direction.
|
|
96
|
-
*/
|
|
97
|
-
export declare const resolveProfileAuth: (name: ProfileName | undefined) => Effect.Effect<ProfileRecord, ProfileNotFoundError | ProfileConfigReadError>;
|
|
98
|
-
/**
|
|
99
|
-
* Persist a new profile record under `profiles.<name>`, or replace the
|
|
100
|
-
* legacy top-level record when `name` is `"default"`.
|
|
101
|
-
*
|
|
102
|
-
* When called with `"default"`, writes the legacy top-level `apiKey` /
|
|
103
|
-
* `agentName` fields (not under `profiles`) so pre-profile-aware readers
|
|
104
|
-
* keep working (Invariant §4.3).
|
|
105
|
-
*/
|
|
106
|
-
export declare const writeProfile: (name: ProfileName | DefaultProfileId, record: ProfileRecord) => Effect.Effect<void, ProfileConfigWriteError | ProfileConfigReadError>;
|
|
107
|
-
/**
|
|
108
|
-
* `--no-persist` contract for `moltzap register`. Revised Invariant §4.4
|
|
109
|
-
* per architect design doc rev 4 finding 2: no file under `$HOME/.moltzap/`
|
|
110
|
-
* OR `$HOME/.openclaw/` is created or modified. Returns the record so the
|
|
111
|
-
* caller can print it; does no I/O under either tree.
|
|
112
|
-
*
|
|
113
|
-
* The register command invokes either `writeProfile` + the existing
|
|
114
|
-
* `writeOpenClawChannelConfig` (default) or `emitNoPersist` (when the flag
|
|
115
|
-
* is set) — both side effects are gated by the single flag. The register
|
|
116
|
-
* handler NEVER calls both paths on the same invocation.
|
|
117
|
-
*
|
|
118
|
-
* The register command pipes the returned record through the printer,
|
|
119
|
-
* which writes agentId / apiKey / serverUrl / claimUrl to stdout (so
|
|
120
|
-
* callers can `$(moltzap register --no-persist ...)` into env).
|
|
121
|
-
*/
|
|
122
|
-
export declare const emitNoPersist: (record: ProfileRecord) => Effect.Effect<{
|
|
123
|
-
readonly record: ProfileRecord;
|
|
124
|
-
}, never>;
|
|
125
|
-
export {};
|
|
126
|
-
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/cli/profile.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,EAAQ,MAAM,EAAU,MAAM,QAAQ,CAAC;AAKrD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;AAG9D,2EAA2E;AAC3E,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAYzC;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;;;GAKG;AACH,MAAM,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,MAAM,WAAW,GAAG,SAAS,KAC5B,MAAM,CAAC,MAAM,CACd,aAAa,EACb,oBAAoB,GAAG,sBAAsB,CAiBC,CAAC;AAmEjD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GACvB,MAAM,WAAW,GAAG,gBAAgB,EACpC,QAAQ,aAAa,KACpB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,uBAAuB,GAAG,sBAAsB,CAI7B,CAAC;AAE3C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,aAAa,KACpB,MAAM,CAAC,MAAM,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;CAAE,EAAE,KAAK,CAC9B,CAAC"}
|
package/dist/cli/profile.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Profile layer over `~/.moltzap/config.json`.
|
|
3
|
-
*
|
|
4
|
-
* Backward-compatible extension of the existing singleton: the top-level
|
|
5
|
-
* `apiKey` / `agentName` fields (see cli/config.ts) remain the "default"
|
|
6
|
-
* record; named profiles live under a new top-level `profiles` key.
|
|
7
|
-
*
|
|
8
|
-
* Spec sbd#177 rev 3 §5.2 (`--profile <name>`, `--no-persist`),
|
|
9
|
-
* Invariants §4.3 (coexistence) and §4.4 (no-disk-write guarantee).
|
|
10
|
-
*
|
|
11
|
-
* Architect note. The existing `cli/config.ts` pre-dates this branch and is
|
|
12
|
-
* not edited here (architect rule: no edits to pre-dating files beyond one
|
|
13
|
-
* barrel). `loadLayeredConfig` therefore reads the file directly for the
|
|
14
|
-
* profile-aware path; impl-staff may collapse this back into `config.ts`
|
|
15
|
-
* during implementation, at which point the profile module becomes a
|
|
16
|
-
* named export of `config.ts`. The public interface defined below is the
|
|
17
|
-
* contract impl-staff preserves regardless of layout.
|
|
18
|
-
*/
|
|
19
|
-
import { FileSystem } from "@effect/platform";
|
|
20
|
-
import { NodeFileSystem } from "@effect/platform-node";
|
|
21
|
-
import { Brand, Data, Effect, Either } from "effect";
|
|
22
|
-
import { getMoltZapConfigDir, getMoltZapConfigPath } from "../local-paths.js";
|
|
23
|
-
const ProfileNameBrand = Brand.nominal();
|
|
24
|
-
const NAME_PATTERN = /^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$/;
|
|
25
|
-
const DEFAULT_SERVER_URL = "wss://api.moltzap.xyz";
|
|
26
|
-
const CONFIG_FILE_MODE = 0o600;
|
|
27
|
-
const JSON_INDENT_SPACES = 2;
|
|
28
|
-
const getConfigDir = getMoltZapConfigDir;
|
|
29
|
-
const getConfigFilePathSync = getMoltZapConfigPath;
|
|
30
|
-
export class ProfileNotFoundError extends Data.TaggedError("ProfileNotFoundError") {
|
|
31
|
-
}
|
|
32
|
-
class ProfileAlreadyExistsError extends Data.TaggedError("ProfileAlreadyExistsError") {
|
|
33
|
-
}
|
|
34
|
-
export class ProfileInvalidNameError extends Data.TaggedError("ProfileInvalidNameError") {
|
|
35
|
-
}
|
|
36
|
-
export class ProfileConfigReadError extends Data.TaggedError("ProfileConfigReadError") {
|
|
37
|
-
}
|
|
38
|
-
export class ProfileConfigWriteError extends Data.TaggedError("ProfileConfigWriteError") {
|
|
39
|
-
}
|
|
40
|
-
// ─── Public API ────────────────────────────────────────────────────────────
|
|
41
|
-
/**
|
|
42
|
-
* Parse and brand a raw profile name. Rejects the empty string and any
|
|
43
|
-
* string that fails NAME_PATTERN.
|
|
44
|
-
*/
|
|
45
|
-
export const parseProfileName = (raw) => {
|
|
46
|
-
if (raw.length === 0) {
|
|
47
|
-
return Effect.fail(new ProfileInvalidNameError({ name: raw, reason: "empty string" }));
|
|
48
|
-
}
|
|
49
|
-
if (!NAME_PATTERN.test(raw)) {
|
|
50
|
-
return Effect.fail(new ProfileInvalidNameError({
|
|
51
|
-
name: raw,
|
|
52
|
-
reason: "must be 3-32 chars, lowercase alphanumeric and hyphens, cannot start or end with a hyphen",
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
return Effect.succeed(ProfileNameBrand(raw));
|
|
56
|
-
};
|
|
57
|
-
const isRecord = (x) => typeof x === "object" && x !== null && !Array.isArray(x);
|
|
58
|
-
const decodeProfileRecord = (raw, fallbackServerUrl) => {
|
|
59
|
-
if (!isRecord(raw))
|
|
60
|
-
return undefined;
|
|
61
|
-
const { apiKey, agentName } = raw;
|
|
62
|
-
if (typeof apiKey !== "string" || typeof agentName !== "string") {
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
|
-
const serverUrl = typeof raw.serverUrl === "string" ? raw.serverUrl : fallbackServerUrl;
|
|
66
|
-
const record = { apiKey, agentName, serverUrl };
|
|
67
|
-
if (typeof raw.registeredAt === "string") {
|
|
68
|
-
return { ...record, registeredAt: raw.registeredAt };
|
|
69
|
-
}
|
|
70
|
-
return record;
|
|
71
|
-
};
|
|
72
|
-
const readRawConfigText = (configPath) => FileSystem.FileSystem.pipe(Effect.flatMap((fileSystem) => fileSystem
|
|
73
|
-
.exists(configPath)
|
|
74
|
-
.pipe(Effect.flatMap((exists) => exists
|
|
75
|
-
? fileSystem.readFileString(configPath, "utf-8")
|
|
76
|
-
: Effect.succeed(null)))), Effect.provide(NodeFileSystem.layer), Effect.either, Effect.flatMap(Either.match({
|
|
77
|
-
onLeft: (cause) => Effect.fail(new ProfileConfigReadError({ path: configPath, cause })),
|
|
78
|
-
onRight: (value) => Effect.succeed(value),
|
|
79
|
-
})));
|
|
80
|
-
const parseRawConfig = (configPath, text) => Effect.try({
|
|
81
|
-
try: () => JSON.parse(text),
|
|
82
|
-
catch: (err) => new ProfileConfigReadError({ path: configPath, cause: err }),
|
|
83
|
-
});
|
|
84
|
-
const requireRawConfigRecord = (configPath, parsed) => isRecord(parsed)
|
|
85
|
-
? Effect.succeed(parsed)
|
|
86
|
-
: Effect.fail(new ProfileConfigReadError({
|
|
87
|
-
path: configPath,
|
|
88
|
-
cause: "config root is not a JSON object",
|
|
89
|
-
}));
|
|
90
|
-
const readRawConfig = () => Effect.gen(function* () {
|
|
91
|
-
const configPath = getConfigFilePathSync();
|
|
92
|
-
const text = yield* readRawConfigText(configPath);
|
|
93
|
-
if (text === null) {
|
|
94
|
-
return { raw: {}, existed: false };
|
|
95
|
-
}
|
|
96
|
-
const parsed = yield* parseRawConfig(configPath, text);
|
|
97
|
-
const raw = yield* requireRawConfigRecord(configPath, parsed);
|
|
98
|
-
return { raw, existed: true };
|
|
99
|
-
});
|
|
100
|
-
function defaultProfileFromRaw(raw, serverUrl) {
|
|
101
|
-
if (typeof raw.apiKey !== "string" || typeof raw.agentName !== "string") {
|
|
102
|
-
return undefined;
|
|
103
|
-
}
|
|
104
|
-
return {
|
|
105
|
-
apiKey: raw.apiKey,
|
|
106
|
-
agentName: raw.agentName,
|
|
107
|
-
serverUrl,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
function profilesFromRaw(raw, serverUrl) {
|
|
111
|
-
const profiles = new Map();
|
|
112
|
-
if (!isRecord(raw.profiles))
|
|
113
|
-
return profiles;
|
|
114
|
-
for (const [name, value] of Object.entries(raw.profiles)) {
|
|
115
|
-
if (!NAME_PATTERN.test(name))
|
|
116
|
-
continue; // tolerate malformed entries
|
|
117
|
-
const record = decodeProfileRecord(value, serverUrl);
|
|
118
|
-
if (record !== undefined) {
|
|
119
|
-
profiles.set(ProfileNameBrand(name), record);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return profiles;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Load the full layered config view. Missing file resolves to an empty
|
|
126
|
-
* view; malformed file surfaces as ProfileConfigReadError. No silent
|
|
127
|
-
* defaults on parse error.
|
|
128
|
-
*
|
|
129
|
-
* Unknown-key tolerance: the decoder accepts extra top-level keys (e.g.
|
|
130
|
-
* future experimental fields) without failing. This keeps forward and
|
|
131
|
-
* backward compatibility explicit rather than implicit.
|
|
132
|
-
*/
|
|
133
|
-
export const loadLayeredConfig = Effect.gen(function* () {
|
|
134
|
-
const { raw } = yield* readRawConfig();
|
|
135
|
-
const serverUrl = typeof raw.serverUrl === "string" ? raw.serverUrl : DEFAULT_SERVER_URL;
|
|
136
|
-
return {
|
|
137
|
-
default: defaultProfileFromRaw(raw, serverUrl),
|
|
138
|
-
profiles: profilesFromRaw(raw, serverUrl),
|
|
139
|
-
serverUrl,
|
|
140
|
-
};
|
|
141
|
-
}).pipe(Effect.withSpan("loadLayeredConfig"));
|
|
142
|
-
/**
|
|
143
|
-
* Resolve the auth record for a given profile name.
|
|
144
|
-
*
|
|
145
|
-
* When `name` is `undefined`, the `default` record is returned (legacy
|
|
146
|
-
* behavior for users who never pass `--profile`). When `name` is supplied
|
|
147
|
-
* and no matching record exists, fails with ProfileNotFoundError — do not
|
|
148
|
-
* silently fall back to `default`; that would violate Invariant §4.3's
|
|
149
|
-
* "takes precedence" clause in the opposite direction.
|
|
150
|
-
*/
|
|
151
|
-
export const resolveProfileAuth = (name) => Effect.gen(function* () {
|
|
152
|
-
const layered = yield* loadLayeredConfig;
|
|
153
|
-
if (name === undefined) {
|
|
154
|
-
if (layered.default === undefined) {
|
|
155
|
-
return yield* Effect.fail(new ProfileNotFoundError({ name: "default" }));
|
|
156
|
-
}
|
|
157
|
-
return layered.default;
|
|
158
|
-
}
|
|
159
|
-
const found = layered.profiles.get(name);
|
|
160
|
-
if (found === undefined) {
|
|
161
|
-
return yield* Effect.fail(new ProfileNotFoundError({ name }));
|
|
162
|
-
}
|
|
163
|
-
return found;
|
|
164
|
-
}).pipe(Effect.withSpan("resolveProfileAuth"));
|
|
165
|
-
function profileBodyFromRecord(record) {
|
|
166
|
-
return {
|
|
167
|
-
apiKey: record.apiKey,
|
|
168
|
-
agentName: record.agentName,
|
|
169
|
-
serverUrl: record.serverUrl,
|
|
170
|
-
...(record.registeredAt !== undefined
|
|
171
|
-
? { registeredAt: record.registeredAt }
|
|
172
|
-
: {}),
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
function nextProfileConfig(raw, name, record) {
|
|
176
|
-
const next = { ...raw };
|
|
177
|
-
if (name === "default") {
|
|
178
|
-
next.serverUrl = record.serverUrl;
|
|
179
|
-
next.apiKey = record.apiKey;
|
|
180
|
-
next.agentName = record.agentName;
|
|
181
|
-
return next;
|
|
182
|
-
}
|
|
183
|
-
const existingProfiles = isRecord(next.profiles) ? next.profiles : {};
|
|
184
|
-
next.profiles = {
|
|
185
|
-
...existingProfiles,
|
|
186
|
-
[name]: profileBodyFromRecord(record),
|
|
187
|
-
};
|
|
188
|
-
if (typeof next.serverUrl !== "string") {
|
|
189
|
-
next.serverUrl = record.serverUrl;
|
|
190
|
-
}
|
|
191
|
-
return next;
|
|
192
|
-
}
|
|
193
|
-
const writeRawConfig = (next) => {
|
|
194
|
-
const configDir = getConfigDir();
|
|
195
|
-
const configPath = getConfigFilePathSync();
|
|
196
|
-
return FileSystem.FileSystem.pipe(Effect.flatMap((fileSystem) => fileSystem
|
|
197
|
-
.makeDirectory(configDir, { recursive: true })
|
|
198
|
-
.pipe(Effect.zipRight(fileSystem.writeFileString(configPath, JSON.stringify(next, null, JSON_INDENT_SPACES) + "\n", { mode: CONFIG_FILE_MODE })))), Effect.provide(NodeFileSystem.layer), Effect.either, Effect.flatMap(Either.match({
|
|
199
|
-
onLeft: (cause) => Effect.fail(new ProfileConfigWriteError({ path: configPath, cause })),
|
|
200
|
-
onRight: (value) => Effect.succeed(value),
|
|
201
|
-
})));
|
|
202
|
-
};
|
|
203
|
-
/**
|
|
204
|
-
* Persist a new profile record under `profiles.<name>`, or replace the
|
|
205
|
-
* legacy top-level record when `name` is `"default"`.
|
|
206
|
-
*
|
|
207
|
-
* When called with `"default"`, writes the legacy top-level `apiKey` /
|
|
208
|
-
* `agentName` fields (not under `profiles`) so pre-profile-aware readers
|
|
209
|
-
* keep working (Invariant §4.3).
|
|
210
|
-
*/
|
|
211
|
-
export const writeProfile = (name, record) => Effect.gen(function* () {
|
|
212
|
-
const { raw } = yield* readRawConfig();
|
|
213
|
-
yield* writeRawConfig(nextProfileConfig(raw, name, record));
|
|
214
|
-
}).pipe(Effect.withSpan("writeProfile"));
|
|
215
|
-
/**
|
|
216
|
-
* `--no-persist` contract for `moltzap register`. Revised Invariant §4.4
|
|
217
|
-
* per architect design doc rev 4 finding 2: no file under `$HOME/.moltzap/`
|
|
218
|
-
* OR `$HOME/.openclaw/` is created or modified. Returns the record so the
|
|
219
|
-
* caller can print it; does no I/O under either tree.
|
|
220
|
-
*
|
|
221
|
-
* The register command invokes either `writeProfile` + the existing
|
|
222
|
-
* `writeOpenClawChannelConfig` (default) or `emitNoPersist` (when the flag
|
|
223
|
-
* is set) — both side effects are gated by the single flag. The register
|
|
224
|
-
* handler NEVER calls both paths on the same invocation.
|
|
225
|
-
*
|
|
226
|
-
* The register command pipes the returned record through the printer,
|
|
227
|
-
* which writes agentId / apiKey / serverUrl / claimUrl to stdout (so
|
|
228
|
-
* callers can `$(moltzap register --no-persist ...)` into env).
|
|
229
|
-
*/
|
|
230
|
-
export const emitNoPersist = (record) => Effect.succeed({ record });
|
|
231
|
-
//# sourceMappingURL=profile.js.map
|
package/dist/cli/profile.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/cli/profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAS9E,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,EAAe,CAAC;AAKtD,MAAM,YAAY,GAAG,mCAAmC,CAAC;AAEzD,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AACnD,MAAM,gBAAgB,GAAG,KAA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