@moltzap/client 2026.729.0 → 2026.730.1
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 -0
- package/dist/agent-client.d.ts.map +1 -1
- package/dist/agent-client.js +1 -0
- package/dist/agent-client.js.map +1 -1
- package/dist/app-client.d.ts +2 -0
- package/dist/app-client.d.ts.map +1 -1
- package/dist/app-client.js +1 -0
- package/dist/app-client.js.map +1 -1
- package/dist/auth.d.ts +7 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +10 -5
- package/dist/auth.js.map +1 -1
- package/dist/channel-base/format-cross-conv.d.ts +8 -3
- package/dist/channel-base/format-cross-conv.d.ts.map +1 -1
- package/dist/channel-base/format-cross-conv.js +10 -9
- package/dist/channel-base/format-cross-conv.js.map +1 -1
- package/dist/channel-base/format-group-block.d.ts +9 -2
- package/dist/channel-base/format-group-block.d.ts.map +1 -1
- package/dist/channel-base/format-group-block.js +12 -7
- package/dist/channel-base/format-group-block.js.map +1 -1
- package/dist/channel-base/index.d.ts +8 -0
- package/dist/channel-base/index.d.ts.map +1 -1
- package/dist/channel-base/index.js +8 -0
- package/dist/channel-base/index.js.map +1 -1
- package/dist/channel-base/lease-guard.d.ts +6 -3
- package/dist/channel-base/lease-guard.d.ts.map +1 -1
- package/dist/channel-base/lease-guard.js +10 -4
- package/dist/channel-base/lease-guard.js.map +1 -1
- package/dist/channel-base/lease-store.d.ts +29 -10
- package/dist/channel-base/lease-store.d.ts.map +1 -1
- package/dist/channel-base/lease-store.js +33 -13
- package/dist/channel-base/lease-store.js.map +1 -1
- package/dist/channel-base/lease.d.ts +9 -1
- package/dist/channel-base/lease.d.ts.map +1 -1
- package/dist/channel-base/lease.js +16 -4
- package/dist/channel-base/lease.js.map +1 -1
- package/dist/channel-core-enrichment.d.ts +9 -2
- package/dist/channel-core-enrichment.d.ts.map +1 -1
- package/dist/channel-core-enrichment.js +17 -5
- package/dist/channel-core-enrichment.js.map +1 -1
- package/dist/channel-core-test-support.d.ts +46 -0
- package/dist/channel-core-test-support.d.ts.map +1 -1
- package/dist/channel-core-test-support.js +67 -13
- package/dist/channel-core-test-support.js.map +1 -1
- package/dist/channel-core.d.ts +37 -19
- package/dist/channel-core.d.ts.map +1 -1
- package/dist/channel-core.js +45 -30
- package/dist/channel-core.js.map +1 -1
- package/dist/cli/adapters.d.ts +4 -1
- package/dist/cli/adapters.d.ts.map +1 -1
- package/dist/cli/adapters.js +11 -4
- package/dist/cli/adapters.js.map +1 -1
- package/dist/cli/commands/agents.js +3 -3
- package/dist/cli/commands/contacts.d.ts +3 -3
- package/dist/cli/commands/contacts.d.ts.map +1 -1
- package/dist/cli/commands/contacts.js +13 -9
- package/dist/cli/commands/contacts.js.map +1 -1
- package/dist/cli/commands/conversations.d.ts +3 -2
- package/dist/cli/commands/conversations.d.ts.map +1 -1
- package/dist/cli/commands/conversations.js +7 -6
- package/dist/cli/commands/conversations.js.map +1 -1
- package/dist/cli/commands/messages.d.ts +6 -2
- package/dist/cli/commands/messages.d.ts.map +1 -1
- package/dist/cli/commands/messages.js +8 -5
- package/dist/cli/commands/messages.js.map +1 -1
- package/dist/cli/commands/register.d.ts +1 -1
- package/dist/cli/commands/register.js +4 -4
- package/dist/cli/commands/send.d.ts +7 -6
- package/dist/cli/commands/send.d.ts.map +1 -1
- package/dist/cli/commands/send.js +7 -6
- package/dist/cli/commands/send.js.map +1 -1
- package/dist/cli/commands/start.d.ts +15 -7
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +12 -5
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/status.js +2 -2
- package/dist/cli/commands/test-transport.d.ts +9 -1
- package/dist/cli/commands/test-transport.d.ts.map +1 -1
- package/dist/cli/commands/test-transport.js +5 -1
- package/dist/cli/commands/test-transport.js.map +1 -1
- package/dist/cli/index.js +8 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts +10 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +10 -0
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/socket-client.d.ts +13 -3
- package/dist/cli/socket-client.d.ts.map +1 -1
- package/dist/cli/socket-client.js +16 -5
- package/dist/cli/socket-client.js.map +1 -1
- package/dist/cli/transport.d.ts +16 -3
- package/dist/cli/transport.d.ts.map +1 -1
- package/dist/cli/transport.js +19 -6
- package/dist/cli/transport.js.map +1 -1
- package/dist/config.d.ts +9 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -3
- package/dist/config.js.map +1 -1
- package/dist/config.test-utils.d.ts +7 -2
- package/dist/config.test-utils.d.ts.map +1 -1
- package/dist/config.test-utils.js +8 -1
- package/dist/config.test-utils.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/local-daemon-rpc.d.ts +116 -93
- package/dist/local-daemon-rpc.d.ts.map +1 -1
- package/dist/local-daemon-rpc.js +128 -108
- package/dist/local-daemon-rpc.js.map +1 -1
- package/dist/local-history.d.ts +40 -20
- package/dist/local-history.d.ts.map +1 -1
- package/dist/local-history.js +45 -23
- package/dist/local-history.js.map +1 -1
- package/dist/local-paths.d.ts +17 -0
- package/dist/local-paths.d.ts.map +1 -1
- package/dist/local-paths.js +21 -4
- package/dist/local-paths.js.map +1 -1
- package/dist/local-socket-server.d.ts +13 -2
- package/dist/local-socket-server.d.ts.map +1 -1
- package/dist/local-socket-server.js +13 -2
- package/dist/local-socket-server.js.map +1 -1
- package/dist/message-rendering.d.ts +1 -0
- package/dist/message-rendering.d.ts.map +1 -1
- package/dist/message-rendering.js +1 -0
- package/dist/message-rendering.js.map +1 -1
- package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts +50 -2
- package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts.map +1 -1
- package/dist/notification/__tests__/subscribe-signatures.types-check.js +22 -48
- package/dist/notification/__tests__/subscribe-signatures.types-check.js.map +1 -1
- package/dist/notification/errors.d.ts +2 -0
- package/dist/notification/errors.d.ts.map +1 -1
- package/dist/notification/errors.js +3 -1
- package/dist/notification/errors.js.map +1 -1
- package/dist/notification/index.d.ts +1 -0
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1 -0
- package/dist/notification/index.js.map +1 -1
- package/dist/notification/stream.d.ts +11 -4
- package/dist/notification/stream.d.ts.map +1 -1
- package/dist/notification/stream.js +5 -38
- package/dist/notification/stream.js.map +1 -1
- package/dist/pagination.d.ts +13 -16
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +9 -1
- package/dist/pagination.js.map +1 -1
- package/dist/profile.d.ts +21 -9
- package/dist/profile.d.ts.map +1 -1
- package/dist/profile.js +30 -16
- package/dist/profile.js.map +1 -1
- package/dist/refs.d.ts +9 -1
- package/dist/refs.d.ts.map +1 -1
- package/dist/refs.js +9 -1
- package/dist/refs.js.map +1 -1
- package/dist/service-archive-purge.d.ts +18 -0
- package/dist/service-archive-purge.d.ts.map +1 -1
- package/dist/service-archive-purge.js +18 -0
- package/dist/service-archive-purge.js.map +1 -1
- package/dist/service-event-trace.d.ts +15 -0
- package/dist/service-event-trace.d.ts.map +1 -0
- package/dist/service-event-trace.js +35 -0
- package/dist/service-event-trace.js.map +1 -0
- package/dist/service-helpers.d.ts +35 -6
- package/dist/service-helpers.d.ts.map +1 -1
- package/dist/service-helpers.js +38 -8
- package/dist/service-helpers.js.map +1 -1
- package/dist/service-local-daemon.d.ts +12 -2
- package/dist/service-local-daemon.d.ts.map +1 -1
- package/dist/service-local-daemon.js +38 -25
- package/dist/service-local-daemon.js.map +1 -1
- package/dist/service.d.ts +62 -22
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +135 -80
- package/dist/service.js.map +1 -1
- package/dist/test-utils/channel-service-fixture.d.ts +8 -0
- package/dist/test-utils/channel-service-fixture.d.ts.map +1 -1
- package/dist/test-utils/channel-service-fixture.js +31 -13
- package/dist/test-utils/channel-service-fixture.js.map +1 -1
- package/dist/test-utils/fake-service.d.ts +20 -7
- package/dist/test-utils/fake-service.d.ts.map +1 -1
- package/dist/test-utils/fake-service.js +18 -4
- package/dist/test-utils/fake-service.js.map +1 -1
- package/dist/test-utils/harness.d.ts +5 -1
- package/dist/test-utils/harness.d.ts.map +1 -1
- package/dist/test-utils/harness.js +3 -0
- package/dist/test-utils/harness.js.map +1 -1
- package/dist/test-utils/ids.d.ts +25 -0
- package/dist/test-utils/ids.d.ts.map +1 -1
- package/dist/test-utils/ids.js +27 -1
- package/dist/test-utils/ids.js.map +1 -1
- package/dist/test-utils/index.d.ts +7 -1
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/index.js +7 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/standalone-provisioning.d.ts +5 -0
- package/dist/test-utils/standalone-provisioning.d.ts.map +1 -1
- package/dist/test-utils/standalone-provisioning.js +3 -0
- package/dist/test-utils/standalone-provisioning.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Args, Command } from "@effect/cli";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
-
import {
|
|
3
|
+
import { localDaemonCommands } from "../../local-daemon-rpc.js";
|
|
4
4
|
import { command, runHandler } from "../transport.js";
|
|
5
5
|
import { logJson, logLines } from "../output.js";
|
|
6
6
|
// safer-arch-ignore folder-explicit-api-required: the CLI entrypoint deliberately composes private one-command-per-file leaves; this folder is not a reusable API.
|
|
7
7
|
// safer-arch-ignore no-trivial-sink-file: this command is a private one-command-per-file leaf consistent with the CLI commands folder convention.
|
|
8
|
-
const listAgents = Command.make("list", {}, () => runHandler(command(
|
|
8
|
+
const listAgents = Command.make("list", {}, () => runHandler(command(localDaemonCommands.agentsList, {}).pipe(Effect.flatMap(logJson), Effect.asVoid))).pipe(Command.withDescription("List agents (default)"));
|
|
9
9
|
const namesArg = Args.text({ name: "name" }).pipe(Args.withDescription("Agent names to look up"), Args.repeated);
|
|
10
|
-
const lookupAgents = Command.make("lookup", { names: namesArg }, ({ names }) => runHandler(command(
|
|
10
|
+
const lookupAgents = Command.make("lookup", { names: namesArg }, ({ names }) => runHandler(command(localDaemonCommands.agentsSearch, { names }).pipe(Effect.flatMap((result) => {
|
|
11
11
|
if (result.agents.length === 0) {
|
|
12
12
|
return Effect.log("No agents found.");
|
|
13
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command } from "@effect/cli";
|
|
2
|
-
|
|
2
|
+
/** Provides the contacts command runtime value. */
|
|
3
3
|
export declare const contactsCommand: Command.Command<"contacts", import("../transport.js").Transport, never, {
|
|
4
4
|
readonly subcommand: import("effect/Option").Option<{} | {
|
|
5
|
-
readonly userId: UserId;
|
|
5
|
+
readonly userId: import("@moltzap/protocol/identity").UserId;
|
|
6
6
|
} | {
|
|
7
|
-
readonly contactId: ContactId;
|
|
7
|
+
readonly contactId: import("@moltzap/protocol/identity").ContactId;
|
|
8
8
|
}>;
|
|
9
9
|
}>;
|
|
10
10
|
//# sourceMappingURL=contacts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,MAAM,aAAa,CAAC;AAoD5C,mDAAmD;AACnD,eAAO,MAAM,eAAe;;;;;;EAK3B,CAAC"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { Args, Command } from "@effect/cli";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { contactId, userId } from "@moltzap/protocol/identity";
|
|
4
|
+
import { localDaemonCommands } from "../../local-daemon-rpc.js";
|
|
5
5
|
import { command, runHandler } from "../transport.js";
|
|
6
6
|
import { logJson } from "../output.js";
|
|
7
|
-
const listContacts = Command.make("list", {}, () => runHandler(command(
|
|
8
|
-
const userIdArg = Args.text({ name: "userId" }).pipe(Args.withSchema(
|
|
9
|
-
const addContact = Command.make("add", { userId: userIdArg }, (
|
|
10
|
-
userId
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const listContacts = Command.make("list", {}, () => runHandler(command(localDaemonCommands.contactsList, {}).pipe(Effect.flatMap(logJson), Effect.asVoid))).pipe(Command.withDescription("List contacts"));
|
|
8
|
+
const userIdArg = Args.text({ name: "userId" }).pipe(Args.withSchema(userId), Args.withDescription("User ID to add as a contact"));
|
|
9
|
+
const addContact = Command.make("add", { userId: userIdArg }, (args) => {
|
|
10
|
+
const userIdValue = args.userId;
|
|
11
|
+
return runHandler(command(localDaemonCommands.contactsAdd, {
|
|
12
|
+
userId: userIdValue,
|
|
13
|
+
}).pipe(Effect.flatMap((r) => Effect.log(`Contact added (id: ${r.contact.id})`)), Effect.asVoid));
|
|
14
|
+
}).pipe(Command.withDescription("Add a contact by user ID"));
|
|
15
|
+
const contactIdArg = Args.text({ name: "contactId" }).pipe(Args.withSchema(contactId), Args.withDescription("Contact ID"));
|
|
16
|
+
const acceptContact = Command.make("accept", { contactId: contactIdArg }, ({ contactId }) => runHandler(command(localDaemonCommands.contactsAccept, {
|
|
14
17
|
contactId,
|
|
15
18
|
}).pipe(Effect.flatMap((r) => Effect.log(`Contact accepted: ${r.contact.id}`)), Effect.asVoid))).pipe(Command.withDescription("Accept a contact request"));
|
|
19
|
+
/** Provides the contacts command runtime value. */
|
|
16
20
|
export const contactsCommand = Command.make("contacts", {}, () => listContacts.handler({})).pipe(Command.withDescription("Manage contacts"), Command.withSubcommands([listContacts, addContact, acceptContact]));
|
|
17
21
|
//# sourceMappingURL=contacts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../../src/cli/commands/contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,CACjD,UAAU,CACR,OAAO,CAAC,mBAAmB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,IAAI,CAChD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EACvB,MAAM,CAAC,MAAM,CACd,CACF,CACF,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CAAC;AAEjD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,CAClD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EACvB,IAAI,CAAC,eAAe,CAAC,6BAA6B,CAAC,CACpD,CAAC;AAEF,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../../src/cli/commands/contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C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CAAC;AACJ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,0BAA0B,CAAC,CAAC,CAAC;AAE7D,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,IAAI,CACxD,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAC1B,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CACnC,CAAC;AAEF,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAChC,QAAQ,EACR,EAAE,SAAS,EAAE,YAAY,EAAE,EAC3B,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAChB,UAAU,CACR,OAAO,CAAC,mBAAmB,CAAC,cAAc,EAAE;IAC1C,SAAS;CACV,CAAC,CAAC,IAAI,CACL,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EACtE,MAAM,CAAC,MAAM,CACd,CACF,CACJ,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,0BAA0B,CAAC,CAAC,CAAC;AAE5D,mDAAmD;AACnD,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,EAAE,GAAG,EAAE,CAC/D,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CACzB,CAAC,IAAI,CACJ,OAAO,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAC1C,OAAO,CAAC,eAAe,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CACnE,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Command } from "@effect/cli";
|
|
2
2
|
import { Option } from "effect";
|
|
3
|
-
import { ConversationId } from "@moltzap/protocol/conversation";
|
|
4
|
-
import { TaskId } from "@moltzap/protocol/task";
|
|
3
|
+
import { type ConversationId } from "@moltzap/protocol/conversation";
|
|
4
|
+
import { type TaskId } from "@moltzap/protocol/task";
|
|
5
|
+
/** Provides the conversations command runtime value. */
|
|
5
6
|
export declare const conversationsCommand: Command.Command<"conversations", import("../transport.js").Transport, never, {
|
|
6
7
|
readonly subcommand: Option.Option<{
|
|
7
8
|
readonly taskId: TaskId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAW,MAAM,aAAa,CAAC;AACrD,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAW,MAAM,aAAa,CAAC;AACrD,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,KAAK,MAAM,EAAU,MAAM,wBAAwB,CAAC;AA6D7D,wDAAwD;AACxD,eAAO,MAAM,oBAAoB;;;;;;;EAQhC,CAAC;AAEF,0GAA0G;AAC1G,eAAO,MAAM,cAAc;;;;;EAS+C,CAAC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Args, Command, Options } from "@effect/cli";
|
|
2
2
|
import { Effect, Option } from "effect";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { conversationId, } from "@moltzap/protocol/conversation";
|
|
4
|
+
import { taskId } from "@moltzap/protocol/task";
|
|
5
|
+
import { localDaemonCommands } from "../../local-daemon-rpc.js";
|
|
6
6
|
import { command, runHandler } from "../transport.js";
|
|
7
7
|
import { logJson, logLines } from "../output.js";
|
|
8
8
|
const DEFAULT_HISTORY_LIMIT = 50;
|
|
9
9
|
const historyLimitOption = Options.integer("limit").pipe(Options.withDefault(DEFAULT_HISTORY_LIMIT), Options.withDescription("Max messages to show"));
|
|
10
10
|
const sessionKeyOption = Options.text("session-key").pipe(Options.withDescription("Session key for cross-conversation context"), Options.optional);
|
|
11
|
-
const taskIdArg = Args.text({ name: "taskId" }).pipe(Args.withSchema(
|
|
12
|
-
const conversationIdArg = Args.text({ name: "conversationId" }).pipe(Args.withSchema(
|
|
11
|
+
const taskIdArg = Args.text({ name: "taskId" }).pipe(Args.withSchema(taskId), Args.withDescription("Task ID"));
|
|
12
|
+
const conversationIdArg = Args.text({ name: "conversationId" }).pipe(Args.withSchema(conversationId), Args.withDescription("Conversation ID"));
|
|
13
13
|
const historyHandler = ({ taskId, conversationId, limit, sessionKey, }) => {
|
|
14
14
|
const params = Option.isSome(sessionKey)
|
|
15
15
|
? { taskId, conversationId, limit, sessionKey: sessionKey.value }
|
|
16
16
|
: { taskId, conversationId, limit };
|
|
17
|
-
return runHandler(command(
|
|
17
|
+
return runHandler(command(localDaemonCommands.history, params).pipe(Effect.flatMap(logJson), Effect.asVoid));
|
|
18
18
|
};
|
|
19
19
|
const historySubcommand = Command.make("history", {
|
|
20
20
|
taskId: taskIdArg,
|
|
@@ -22,6 +22,7 @@ const historySubcommand = Command.make("history", {
|
|
|
22
22
|
limit: historyLimitOption,
|
|
23
23
|
sessionKey: sessionKeyOption,
|
|
24
24
|
}, historyHandler).pipe(Command.withDescription("Show message history for a conversation"));
|
|
25
|
+
/** Provides the conversations command runtime value. */
|
|
25
26
|
export const conversationsCommand = Command.make("conversations", {}, () => logLines([
|
|
26
27
|
"moltzap conversations: only `history` is supported in this release.",
|
|
27
28
|
"See `moltzap conversations history --help`.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../../src/cli/commands/conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,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CAAC,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CACxC,SAAS,EACT;IACE,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE,iBAAiB;IACjC,KAAK,EAAE,kBAAkB;IACzB,UAAU,EAAE,gBAAgB;CAC7B,EACD,cAAc,CACf,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,yCAAyC,CAAC,CAAC,CAAC"}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `moltzap messages <subcommand>` — subcommand group.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Messages list → agent/message/list.
|
|
5
5
|
*
|
|
6
6
|
* `messages` is a subcommand group, distinct from the one-shot top-level
|
|
7
7
|
* `send` command.
|
|
8
8
|
*/
|
|
9
9
|
import { Command } from "@effect/cli";
|
|
10
|
-
import { Effect, Schema } from "effect";
|
|
10
|
+
import { Effect, type Schema } from "effect";
|
|
11
11
|
import { type Transport, type TransportError } from "../transport.js";
|
|
12
12
|
declare const messagesListPayload: Schema.Struct<{
|
|
13
13
|
taskId: Schema.Schema<import("@moltzap/protocol/task").TaskId, string, never>;
|
|
14
14
|
conversationId: Schema.Schema<import("@moltzap/protocol/conversation").ConversationId, string, never>;
|
|
15
15
|
limit: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.Number>>>>;
|
|
16
16
|
}>;
|
|
17
|
+
/** Represents messages command error conditions. */
|
|
17
18
|
export type MessagesCommandError = TransportError;
|
|
18
19
|
/** `moltzap messages list --conversation <id> [--limit N]`. */
|
|
19
20
|
export type MessagesListArgs = Schema.Schema.Type<typeof messagesListPayload>;
|
|
20
21
|
/**
|
|
21
22
|
* Wraps `agent/message/list` and emits the full daemon result as JSON.
|
|
23
|
+
* @param args Value supplied to the operation.
|
|
24
|
+
* @returns The messages list handler result.
|
|
22
25
|
*/
|
|
23
26
|
export declare const messagesListHandler: (args: MessagesListArgs) => Effect.Effect<void, MessagesCommandError, Transport>;
|
|
27
|
+
/** Provides the messages list options runtime value. */
|
|
24
28
|
export declare const messagesListOptions: import("@effect/cli/Options").Options<{
|
|
25
29
|
readonly taskId: import("@moltzap/protocol/task").TaskId;
|
|
26
30
|
readonly conversationId: import("@moltzap/protocol/conversation").ConversationId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AASzB,QAAA,MAAM,mBAAmB;;;;EAAuC,CAAC;AAIjE,oDAAoD;AACpD,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAIlD,kEAAkE;AAClE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAI9E;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,gBAAgB,KACrB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,SAAS,CAIL,CAAC;AAIlD,wDAAwD;AACxD,eAAO,MAAM,mBAAmB;;;;EAM9B,CAAC;AAQH,kDAAkD;AAClD,eAAO,MAAM,eAAe;;;;;;;;EAW3B,CAAC"}
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `moltzap messages <subcommand>` — subcommand group.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Messages list → agent/message/list.
|
|
5
5
|
*
|
|
6
6
|
* `messages` is a subcommand group, distinct from the one-shot top-level
|
|
7
7
|
* `send` command.
|
|
8
8
|
*/
|
|
9
9
|
import { Command } from "@effect/cli";
|
|
10
|
-
import { Effect
|
|
10
|
+
import { Effect } from "effect";
|
|
11
11
|
import { command, runHandler, } from "../transport.js";
|
|
12
12
|
import { logJson, logLines } from "../output.js";
|
|
13
|
-
import {
|
|
13
|
+
import { localDaemonCommands, messagesListCommandRpc, } from "../../local-daemon-rpc.js";
|
|
14
14
|
import { optionsFromSchema } from "../adapters.js";
|
|
15
|
-
const messagesListPayload =
|
|
15
|
+
const messagesListPayload = messagesListCommandRpc.payloadSchema;
|
|
16
16
|
// ─── Handlers ──────────────────────────────────────────────────────────────
|
|
17
17
|
/**
|
|
18
18
|
* Wraps `agent/message/list` and emits the full daemon result as JSON.
|
|
19
|
+
* @param args Value supplied to the operation.
|
|
20
|
+
* @returns The messages list handler result.
|
|
19
21
|
*/
|
|
20
22
|
export const messagesListHandler = (args) => Effect.gen(function* () {
|
|
21
|
-
const result = yield* command(
|
|
23
|
+
const result = yield* command(localDaemonCommands.messagesList, args);
|
|
22
24
|
yield* logJson(result);
|
|
23
25
|
}).pipe(Effect.withSpan("messagesListHandler"));
|
|
24
26
|
// ─── CLI commands ──────────────────────────────────────────────────────────
|
|
27
|
+
/** Provides the messages list options runtime value. */
|
|
25
28
|
export const messagesListOptions = optionsFromSchema(messagesListPayload, {
|
|
26
29
|
taskId: { name: "task", description: "Task id" },
|
|
27
30
|
conversationId: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/cli/commands/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,
|
|
1
|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EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CACxD,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;AAEnE,kDAAkD;AAClD,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,EAAE,GAAG,EAAE,CAC/D,QAAQ,CAAC;IACP,0EAA0E;CAC3E,CAAC,CACH,CAAC,IAAI,CACJ,OAAO,CAAC,eAAe,CACrB,qEAAqE;IACnE,8DAA8D;IAC9D,+CAA+C,CAClD,EACD,OAAO,CAAC,eAAe,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAC/C,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from "@effect/cli";
|
|
2
2
|
import { Option } from "effect";
|
|
3
3
|
/**
|
|
4
|
-
* `moltzap register <name> <invite-code> [-d description] [--profile <name>] [--no-persist]
|
|
4
|
+
* `moltzap register <name> <invite-code> [-d description] [--profile <name>] [--no-persist]`.
|
|
5
5
|
*
|
|
6
6
|
* POST /api/v1/auth/register, then (by default) persist the result into
|
|
7
7
|
* `~/.moltzap/config.json`.
|
|
@@ -2,16 +2,16 @@ import { Args, Command, Options } from "@effect/cli";
|
|
|
2
2
|
import { Effect, Option } from "effect";
|
|
3
3
|
import { getHttpUrl, getServerUrl } from "../../config.js";
|
|
4
4
|
import { registerAgent } from "../../auth.js";
|
|
5
|
-
import { emitNoPersist,
|
|
5
|
+
import { emitNoPersist, profileName, writeProfile, } from "../../profile.js";
|
|
6
6
|
import { logLines } from "../output.js";
|
|
7
|
-
const nameArg = Args.text({ name: "name" }).pipe(Args.withSchema(
|
|
7
|
+
const nameArg = Args.text({ name: "name" }).pipe(Args.withSchema(profileName), Args.withDescription("Agent name (lowercase alphanumeric, 3-32 chars)"));
|
|
8
8
|
const inviteCodeArg = Args.text({ name: "invite-code" }).pipe(Args.withDescription("Invite code from your invite URL"));
|
|
9
9
|
const descriptionOption = Options.text("description").pipe(Options.withAlias("d"), Options.withDescription("Agent description"), Options.optional);
|
|
10
10
|
// `register` consumes `--profile` locally because it writes a NEW profile.
|
|
11
11
|
// Parent-level `moltzap --profile <name>` means "load an existing profile"
|
|
12
12
|
// for transport selection, and would reject the new profile before this
|
|
13
13
|
// command could create it.
|
|
14
|
-
const profileOption = Options.text("profile").pipe(Options.withSchema(
|
|
14
|
+
const profileOption = Options.text("profile").pipe(Options.withSchema(profileName), Options.withDescription("Named profile to register under. Writes the new apiKey to " +
|
|
15
15
|
"`profiles.<name>` in ~/.moltzap/config.json. Omit to use the " +
|
|
16
16
|
"agent name as the profile name. Other subcommands " +
|
|
17
17
|
"select an existing profile via the global `--profile` flag (see " +
|
|
@@ -36,7 +36,7 @@ function persistRegistration({ profile, record, name, }) {
|
|
|
36
36
|
return writeProfile(Option.getOrElse(profile, () => name), record);
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* `moltzap register <name> <invite-code> [-d description] [--profile <name>] [--no-persist]
|
|
39
|
+
* `moltzap register <name> <invite-code> [-d description] [--profile <name>] [--no-persist]`.
|
|
40
40
|
*
|
|
41
41
|
* POST /api/v1/auth/register, then (by default) persist the result into
|
|
42
42
|
* `~/.moltzap/config.json`.
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { Command } from "@effect/cli";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { type SendTarget as SendTargetValue } from "../../local-daemon-rpc.js";
|
|
4
|
-
import type
|
|
5
|
-
|
|
4
|
+
import { type Transport } from "../transport.js";
|
|
5
|
+
interface SendCommandParsed {
|
|
6
6
|
readonly target: SendTargetValue;
|
|
7
7
|
readonly message: string;
|
|
8
|
-
readonly options: Schema.Schema.Type<typeof
|
|
9
|
-
}
|
|
10
|
-
declare const
|
|
8
|
+
readonly options: Schema.Schema.Type<typeof sendOptionsSchema>;
|
|
9
|
+
}
|
|
10
|
+
declare const sendOptionsSchema: Schema.SchemaClass<{
|
|
11
11
|
readonly replyToId?: import("@moltzap/protocol/conversation").MessageId | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
readonly replyToId?: string | undefined;
|
|
14
14
|
}, never>;
|
|
15
|
+
/** Provides the send options runtime value. */
|
|
15
16
|
export declare const sendOptions: import("@effect/cli/Options").Options<{
|
|
16
17
|
readonly replyToId?: import("@moltzap/protocol/conversation").MessageId | undefined;
|
|
17
18
|
}>;
|
|
@@ -33,7 +34,7 @@ export declare const sendOptions: import("@effect/cli/Options").Options<{
|
|
|
33
34
|
*
|
|
34
35
|
* Examples:
|
|
35
36
|
* moltzap send task:$TID:$CID "hello" # default identity
|
|
36
|
-
* moltzap --profile alice send task:$TID:$CID "hello" # send as alice
|
|
37
|
+
* moltzap --profile alice send task:$TID:$CID "hello" # send as alice.
|
|
37
38
|
*
|
|
38
39
|
* Default path delegates to the local channel daemon via a
|
|
39
40
|
* Unix-socket RPC; it does NOT mint its own `MoltZapAgentClient`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAIL,KAAK,UAAU,IAAI,eAAe,EACnC,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAIL,KAAK,UAAU,IAAI,eAAe,EACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGtE,UAAU,iBAAiB;IACzB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAC;CAChE;AAWD,QAAA,MAAM,iBAAiB;;;;SAEtB,CAAC;AACF,+CAA+C;AAC/C,eAAO,MAAM,WAAW;;EAKtB,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,OAAO,CACvC,MAAM,EACN,SAAS,EACT,KAAK,EACL,iBAAiB,CAuBlB,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Args, Command } from "@effect/cli";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
|
-
import {
|
|
3
|
+
import { localDaemonCommands, sendCommandRpc, sendTarget, } from "../../local-daemon-rpc.js";
|
|
4
4
|
import { command, runHandler } from "../transport.js";
|
|
5
5
|
import { optionsFromSchema } from "../adapters.js";
|
|
6
|
-
const targetArg = Args.text({ name: "target" }).pipe(Args.withSchema(
|
|
6
|
+
const targetArg = Args.text({ name: "target" }).pipe(Args.withSchema(sendTarget), Args.withDescription("Target task+conversation as task:<taskId>:<convId>"));
|
|
7
7
|
const messageArg = Args.text({ name: "message" }).pipe(Args.withDescription("Message text"));
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const sendOptionsSchema = sendCommandRpc.payloadSchema.pipe(Schema.omit("target", "message"));
|
|
9
|
+
/** Provides the send options runtime value. */
|
|
10
|
+
export const sendOptions = optionsFromSchema(sendOptionsSchema, {
|
|
10
11
|
replyToId: {
|
|
11
12
|
name: "reply-to",
|
|
12
13
|
description: "Reply to a specific message",
|
|
@@ -30,7 +31,7 @@ export const sendOptions = optionsFromSchema(SendOptionsSchema, {
|
|
|
30
31
|
*
|
|
31
32
|
* Examples:
|
|
32
33
|
* moltzap send task:$TID:$CID "hello" # default identity
|
|
33
|
-
* moltzap --profile alice send task:$TID:$CID "hello" # send as alice
|
|
34
|
+
* moltzap --profile alice send task:$TID:$CID "hello" # send as alice.
|
|
34
35
|
*
|
|
35
36
|
* Default path delegates to the local channel daemon via a
|
|
36
37
|
* Unix-socket RPC; it does NOT mint its own `MoltZapAgentClient`.
|
|
@@ -58,7 +59,7 @@ export const sendOptions = optionsFromSchema(SendOptionsSchema, {
|
|
|
58
59
|
* by the running MoltZapService.
|
|
59
60
|
*/
|
|
60
61
|
export const sendCommand = Command.make("send", { target: targetArg, message: messageArg, options: sendOptions }, ({ target, message, options }) => {
|
|
61
|
-
return runHandler(command(
|
|
62
|
+
return runHandler(command(localDaemonCommands.send, {
|
|
62
63
|
target,
|
|
63
64
|
message,
|
|
64
65
|
...options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/cli/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,UAAU,GAEX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/cli/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,UAAU,GAEX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAkB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,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AM,CACd,CACF,CAAC;AACJ,CAAC,CACF,CAAC,IAAI,CACJ,OAAO,CAAC,eAAe,CACrB,oDAAoD;IAClD,6CAA6C,CAChD,CACF,CAAC"}
|
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
import { Command } from "@effect/cli";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
|
-
import { AppIdV4, type StartParticipant as StartParticipantType } from "../../local-daemon-rpc.js";
|
|
3
|
+
import { type AppIdV4, type StartParticipant as StartParticipantType } from "../../local-daemon-rpc.js";
|
|
4
4
|
import { type Transport } from "../transport.js";
|
|
5
|
+
/** Describes start command args. */
|
|
5
6
|
export interface StartCommandArgs {
|
|
6
7
|
readonly name: string;
|
|
7
8
|
readonly participants: readonly StartParticipantType[];
|
|
8
|
-
readonly message
|
|
9
|
-
readonly appId
|
|
9
|
+
readonly message?: string;
|
|
10
|
+
readonly appId?: AppIdV4;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
interface StartCommandParsed {
|
|
12
13
|
readonly name: string;
|
|
13
14
|
readonly participants: StartParticipantType[];
|
|
14
|
-
readonly options: Schema.Schema.Type<typeof
|
|
15
|
-
}
|
|
16
|
-
declare const
|
|
15
|
+
readonly options: Schema.Schema.Type<typeof startOptionsSchema>;
|
|
16
|
+
}
|
|
17
|
+
declare const startOptionsSchema: Schema.SchemaClass<{
|
|
17
18
|
readonly message?: string | undefined;
|
|
18
19
|
readonly appId?: import("@moltzap/protocol/identity").AppId | undefined;
|
|
19
20
|
}, {
|
|
20
21
|
readonly message?: string | undefined;
|
|
21
22
|
readonly appId?: string | undefined;
|
|
22
23
|
}, never>;
|
|
24
|
+
/** Provides the start options runtime value. */
|
|
23
25
|
export declare const startOptions: import("@effect/cli/Options").Options<{
|
|
24
26
|
readonly message?: string | undefined;
|
|
25
27
|
readonly appId?: import("@moltzap/protocol/identity").AppId | undefined;
|
|
26
28
|
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Provides the run start handler runtime value.
|
|
31
|
+
* @param args Value supplied to the operation.
|
|
32
|
+
* @returns The run start handler result.
|
|
33
|
+
*/
|
|
27
34
|
export declare const runStartHandler: (args: StartCommandArgs) => Effect.Effect<void, never, Transport>;
|
|
35
|
+
/** Provides the start command runtime value. */
|
|
28
36
|
export declare const startCommand: Command.Command<"start", Transport, never, StartCommandParsed>;
|
|
29
37
|
export {};
|
|
30
38
|
//# sourceMappingURL=start.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EACL,OAAO,
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EACL,KAAK,OAAO,EAMZ,KAAK,gBAAgB,IAAI,oBAAoB,EAE9C,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAW,KAAK,SAAS,EAAuB,MAAM,iBAAiB,CAAC;AAY/E,oCAAoC;AACpC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAID,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,oBAAoB,EAAE,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;CACjE;AA4ED,QAAA,MAAM,kBAAkB;;;;;;SAEvB,CAAC;AACF,gDAAgD;AAChD,eAAO,MAAM,YAAY;;;EAGvB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,MAAM,gBAAgB,KACrB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CACK,CAAC;AAE7C,gDAAgD;AAChD,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,OAAO,CACxC,OAAO,EACP,SAAS,EACT,KAAK,EACL,kBAAkB,CAyBnB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Args, Command } from "@effect/cli";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
|
-
import {
|
|
3
|
+
import { localDaemonCommands, startParticipant, startTaskCommandRpc, } from "../../local-daemon-rpc.js";
|
|
4
4
|
import { command } from "../transport.js";
|
|
5
5
|
import { optionsFromSchema } from "../adapters.js";
|
|
6
6
|
const EXIT_CODES = {
|
|
@@ -15,7 +15,7 @@ const startMessage = (outcome) => outcome.reusedConversation
|
|
|
15
15
|
const logStartResult = (result) => Effect.zipRight(Effect.log(startMessage(result)), result.sentMessageId === undefined
|
|
16
16
|
? Effect.void
|
|
17
17
|
: Effect.log(`Message sent: ${result.sentMessageId}`));
|
|
18
|
-
const startCommandHandler = (args) => command(
|
|
18
|
+
const startCommandHandler = (args) => command(localDaemonCommands.startTask, {
|
|
19
19
|
name: args.name,
|
|
20
20
|
participants: args.participants,
|
|
21
21
|
...(args.message === undefined ? {} : { message: args.message }),
|
|
@@ -28,13 +28,20 @@ const runStartCommand = (effect) => effect.pipe(Effect.catchTag("StartTaskUsageE
|
|
|
28
28
|
return Effect.logError(`Failed: ${msg}`).pipe(Effect.zipRight(Effect.sync(() => process.exit(EXIT_CODES.TASK_CREATE_FAILED))));
|
|
29
29
|
}));
|
|
30
30
|
const nameArg = Args.text({ name: "name" }).pipe(Args.withDescription("Conversation name"));
|
|
31
|
-
const participantsArg = Args.text({ name: "participant" }).pipe(Args.withSchema(
|
|
32
|
-
const
|
|
33
|
-
|
|
31
|
+
const participantsArg = Args.text({ name: "participant" }).pipe(Args.withSchema(startParticipant), Args.withDescription("Participant token (for example agent:bob)."), Args.repeated);
|
|
32
|
+
const startOptionsSchema = startTaskCommandRpc.payloadSchema.pipe(Schema.omit("name", "participants"));
|
|
33
|
+
/** Provides the start options runtime value. */
|
|
34
|
+
export const startOptions = optionsFromSchema(startOptionsSchema, {
|
|
34
35
|
message: { description: "First message body" },
|
|
35
36
|
appId: { description: "App UUID v4. Defaults to the MoltZap app." },
|
|
36
37
|
});
|
|
38
|
+
/**
|
|
39
|
+
* Provides the run start handler runtime value.
|
|
40
|
+
* @param args Value supplied to the operation.
|
|
41
|
+
* @returns The run start handler result.
|
|
42
|
+
*/
|
|
37
43
|
export const runStartHandler = (args) => runStartCommand(startCommandHandler(args));
|
|
44
|
+
/** Provides the start command runtime value. */
|
|
38
45
|
export const startCommand = Command.make("start", {
|
|
39
46
|
name: nameArg,
|
|
40
47
|
participants: participantsArg,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/cli/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/cli/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAEL,mBAAmB,EACnB,gBAAgB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IAAI;IACJ,YAAY;IACZ,OAAO,EAAE,OAAO,CAAC,OAAO;IACxB,KAAK,EAAE,OAAO,CAAC,KAAK;CACrB,CAAC,CACL,CAAC,IAAI,CACJ,OAAO,CAAC,eAAe,CACrB,+EAA+E;IAC7E,IAAI;IACJ,eAAe;IACf,KAAK,UAAU,CAAC,OAAO,cAAc;IACrC,KAAK,UAAU,CAAC,kBAAkB,qCAAqC;IACvE,KAAK,UAAU,CAAC,eAAe,yCAAyC;IACxE,KAAK,UAAU,CAAC,WAAW,eAAe,CAC7C,CACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from "@effect/cli";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
-
import {
|
|
3
|
+
import { localDaemonCommands } from "../../local-daemon-rpc.js";
|
|
4
4
|
import { command, runHandler } from "../transport.js";
|
|
5
5
|
import { logLines } from "../output.js";
|
|
6
6
|
// safer-arch-ignore no-trivial-sink-file: this command is a private one-command-per-file leaf consistent with the CLI commands folder convention.
|
|
@@ -8,7 +8,7 @@ import { logLines } from "../output.js";
|
|
|
8
8
|
* `moltzap status` — calls the local service's `status` RPC and prints
|
|
9
9
|
* agent id, live connection state, and conversation count.
|
|
10
10
|
*/
|
|
11
|
-
export const statusCommand = Command.make("status", {}, () => runHandler(command(
|
|
11
|
+
export const statusCommand = Command.make("status", {}, () => runHandler(command(localDaemonCommands.status, {}).pipe(Effect.flatMap((result) => logLines([
|
|
12
12
|
`Agent ID: ${result.agentId ?? "none"}`,
|
|
13
13
|
`Connected: ${result.connected}`,
|
|
14
14
|
`Conversations: ${result.conversations}`,
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import type { RpcGroup } from "@effect/rpc";
|
|
2
2
|
import { type Transport as TransportSurface, type TransportError } from "../transport.js";
|
|
3
|
-
import { LocalDaemonRpcs } from "../../local-daemon-rpc.js";
|
|
3
|
+
import type { LocalDaemonRpcs } from "../../local-daemon-rpc.js";
|
|
4
4
|
import type { PayloadForTag, SuccessForTag } from "@moltzap/protocol/rpc";
|
|
5
5
|
type DaemonRpcs = RpcGroup.Rpcs<typeof LocalDaemonRpcs>;
|
|
6
6
|
type DaemonCommand = DaemonRpcs["_tag"];
|
|
7
|
+
/** Describes test transport call. */
|
|
7
8
|
export interface TestTransportCall<Tag extends DaemonCommand = DaemonCommand> {
|
|
8
9
|
readonly method: Tag;
|
|
9
10
|
readonly params: PayloadForTag<DaemonRpcs, Tag>;
|
|
10
11
|
}
|
|
12
|
+
/** Represents test transport responder values. */
|
|
11
13
|
export type TestTransportResponder<Tag extends DaemonCommand> = (call: TestTransportCall<Tag>) => SuccessForTag<DaemonRpcs, Tag> | TransportError | Error;
|
|
14
|
+
/** Represents test transport responders values. */
|
|
12
15
|
export type TestTransportResponders = {
|
|
13
16
|
readonly [Tag in DaemonCommand]?: TestTransportResponder<Tag>;
|
|
14
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Provides the make fake transport runtime value.
|
|
20
|
+
* @param responders Value supplied to the operation.
|
|
21
|
+
* @returns The created fake transport.
|
|
22
|
+
*/
|
|
15
23
|
export declare const makeFakeTransport: (responders: TestTransportResponders) => {
|
|
16
24
|
readonly calls: TestTransportCall[];
|
|
17
25
|
readonly transport: TransportSurface;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-transport.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/test-transport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAEL,KAAK,SAAS,IAAI,gBAAgB,EAClC,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"test-transport.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/test-transport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAEL,KAAK,SAAS,IAAI,gBAAgB,EAClC,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE1E,KAAK,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,KAAK,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAExC,qCAAqC;AACrC,MAAM,WAAW,iBAAiB,CAAC,GAAG,SAAS,aAAa,GAAG,aAAa;IAC1E,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;CACjD;AAED,kDAAkD;AAClD,MAAM,MAAM,sBAAsB,CAAC,GAAG,SAAS,aAAa,IAAI,CAC9D,IAAI,EAAE,iBAAiB,CAAC,GAAG,CAAC,KACzB,aAAa,CAAC,UAAU,EAAE,GAAG,CAAC,GAAG,cAAc,GAAG,KAAK,CAAC;AAE7D,mDAAmD;AACnD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,GAAG,IAAI,aAAa,CAAC,CAAC,EAAE,sBAAsB,CAAC,GAAG,CAAC;CAC9D,CAAC;AAWF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,uBAAuB,KAClC;IACD,QAAQ,CAAC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;CA+BtC,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { TransportRpcError, } from "../transport.js";
|
|
3
|
-
import { LocalDaemonRpcs } from "../../local-daemon-rpc.js";
|
|
4
3
|
const isTransportError = (value) => typeof value === "object" &&
|
|
5
4
|
value !== null &&
|
|
6
5
|
"_tag" in value &&
|
|
7
6
|
"message" in value;
|
|
8
7
|
const isError = (value) => value instanceof Error;
|
|
9
8
|
const errorMessage = (error) => error.message;
|
|
9
|
+
/**
|
|
10
|
+
* Provides the make fake transport runtime value.
|
|
11
|
+
* @param responders Value supplied to the operation.
|
|
12
|
+
* @returns The created fake transport.
|
|
13
|
+
*/
|
|
10
14
|
export const makeFakeTransport = (responders) => {
|
|
11
15
|
const calls = [];
|
|
12
16
|
const transport = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-transport.js","sourceRoot":"","sources":["../../../src/cli/commands/test-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,iBAAiB,GAGlB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"test-transport.js","sourceRoot":"","sources":["../../../src/cli/commands/test-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,iBAAiB,GAGlB,MAAM,iBAAiB,CAAC;AAuBzB,MAAM,gBAAgB,GAAG,CAAC,KAAc,EAA2B,EAAE,CACnE,OAAO,KAAK,KAAK,QAAQ;IACzB,KAAK,KAAK,IAAI;IACd,MAAM,IAAI,KAAK;IACf,SAAS,IAAI,KAAK,CAAC;AAErB,MAAM,OAAO,GAAG,CAAC,KAAc,EAAkB,EAAE,CAAC,KAAK,YAAY,KAAK,CAAC;AAC3E,MAAM,YAAY,GAAG,CAAC,KAAY,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;AAE7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,UAAmC,EAInC,EAAE;IACF,MAAM,KAAK,GAAwB,EAAE,CAAC;IACtC,MAAM,SAAS,GAAqB;QAClC,OAAO,EAAE,CACP,GAAQ,EACR,OAAuC,EAC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