@moltzap/client 2026.414.0 → 2026.425.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/channel-core.d.ts +28 -15
- package/dist/channel-core.d.ts.map +1 -1
- package/dist/channel-core.js +113 -74
- package/dist/channel-core.js.map +1 -1
- package/dist/channel-core.test.js +126 -34
- package/dist/channel-core.test.js.map +1 -1
- package/dist/cli/__tests__/cli-multi-agent.int.test.d.ts +2 -0
- package/dist/cli/__tests__/cli-multi-agent.int.test.d.ts.map +1 -0
- package/dist/cli/__tests__/cli-multi-agent.int.test.js +26 -0
- package/dist/cli/__tests__/cli-multi-agent.int.test.js.map +1 -0
- package/dist/cli/commands/agents.d.ts +13 -2
- package/dist/cli/commands/agents.d.ts.map +1 -1
- package/dist/cli/commands/agents.js +30 -18
- package/dist/cli/commands/agents.js.map +1 -1
- package/dist/cli/commands/apps.d.ts +96 -0
- package/dist/cli/commands/apps.d.ts.map +1 -0
- package/dist/cli/commands/apps.js +193 -0
- package/dist/cli/commands/apps.js.map +1 -0
- package/dist/cli/commands/apps.test.d.ts +2 -0
- package/dist/cli/commands/apps.test.d.ts.map +1 -0
- package/dist/cli/commands/apps.test.js +220 -0
- package/dist/cli/commands/apps.test.js.map +1 -0
- package/dist/cli/commands/contacts.d.ts +18 -2
- package/dist/cli/commands/contacts.d.ts.map +1 -1
- package/dist/cli/commands/contacts.js +44 -52
- package/dist/cli/commands/contacts.js.map +1 -1
- package/dist/cli/commands/conversations-v2.test.d.ts +2 -0
- package/dist/cli/commands/conversations-v2.test.d.ts.map +1 -0
- package/dist/cli/commands/conversations-v2.test.js +92 -0
- package/dist/cli/commands/conversations-v2.test.js.map +1 -0
- package/dist/cli/commands/conversations.d.ts +73 -3
- package/dist/cli/commands/conversations.d.ts.map +1 -1
- package/dist/cli/commands/conversations.js +157 -108
- package/dist/cli/commands/conversations.js.map +1 -1
- package/dist/cli/commands/invite.d.ts +6 -2
- package/dist/cli/commands/invite.d.ts.map +1 -1
- package/dist/cli/commands/invite.js +8 -6
- package/dist/cli/commands/invite.js.map +1 -1
- package/dist/cli/commands/messages.d.ts +48 -0
- package/dist/cli/commands/messages.d.ts.map +1 -0
- package/dist/cli/commands/messages.js +68 -0
- package/dist/cli/commands/messages.js.map +1 -0
- package/dist/cli/commands/messages.test.d.ts +2 -0
- package/dist/cli/commands/messages.test.d.ts.map +1 -0
- package/dist/cli/commands/messages.test.js +73 -0
- package/dist/cli/commands/messages.test.js.map +1 -0
- package/dist/cli/commands/permissions.d.ts +66 -0
- package/dist/cli/commands/permissions.d.ts.map +1 -0
- package/dist/cli/commands/permissions.js +101 -0
- package/dist/cli/commands/permissions.js.map +1 -0
- package/dist/cli/commands/permissions.test.d.ts +2 -0
- package/dist/cli/commands/permissions.test.d.ts.map +1 -0
- package/dist/cli/commands/permissions.test.js +126 -0
- package/dist/cli/commands/permissions.test.js.map +1 -0
- package/dist/cli/commands/ping.d.ts +6 -2
- package/dist/cli/commands/ping.d.ts.map +1 -1
- package/dist/cli/commands/ping.js +21 -20
- package/dist/cli/commands/ping.js.map +1 -1
- package/dist/cli/commands/presence.d.ts +10 -2
- package/dist/cli/commands/presence.d.ts.map +1 -1
- package/dist/cli/commands/presence.js +27 -15
- package/dist/cli/commands/presence.js.map +1 -1
- package/dist/cli/commands/register.d.ts +24 -2
- package/dist/cli/commands/register.d.ts.map +1 -1
- package/dist/cli/commands/register.js +123 -47
- package/dist/cli/commands/register.js.map +1 -1
- package/dist/cli/commands/register.test.js +45 -27
- package/dist/cli/commands/register.test.js.map +1 -1
- package/dist/cli/commands/send.d.ts +43 -2
- package/dist/cli/commands/send.d.ts.map +1 -1
- package/dist/cli/commands/send.js +55 -13
- package/dist/cli/commands/send.js.map +1 -1
- package/dist/cli/commands/send.test.js +20 -19
- package/dist/cli/commands/send.test.js.map +1 -1
- package/dist/cli/commands/status.d.ts +6 -2
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +16 -10
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/whoami.d.ts +7 -2
- package/dist/cli/commands/whoami.d.ts.map +1 -1
- package/dist/cli/commands/whoami.js +13 -7
- package/dist/cli/commands/whoami.js.map +1 -1
- package/dist/cli/config.d.ts +24 -8
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +65 -39
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/config.test.js +12 -10
- package/dist/cli/config.test.js.map +1 -1
- package/dist/cli/http-client.d.ts +6 -2
- package/dist/cli/http-client.d.ts.map +1 -1
- package/dist/cli/http-client.js +25 -24
- package/dist/cli/http-client.js.map +1 -1
- package/dist/cli/index.d.ts +16 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +160 -27
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/profile.d.ts +134 -0
- package/dist/cli/profile.d.ts.map +1 -0
- package/dist/cli/profile.js +217 -0
- package/dist/cli/profile.js.map +1 -0
- package/dist/cli/profile.test.d.ts +2 -0
- package/dist/cli/profile.test.d.ts.map +1 -0
- package/dist/cli/profile.test.js +263 -0
- package/dist/cli/profile.test.js.map +1 -0
- package/dist/cli/runtime.d.ts +34 -0
- package/dist/cli/runtime.d.ts.map +1 -0
- package/dist/cli/runtime.js +94 -0
- package/dist/cli/runtime.js.map +1 -0
- package/dist/cli/socket-client.d.ts +15 -12
- package/dist/cli/socket-client.d.ts.map +1 -1
- package/dist/cli/socket-client.js +72 -75
- package/dist/cli/socket-client.js.map +1 -1
- package/dist/cli/transport.d.ts +181 -0
- package/dist/cli/transport.d.ts.map +1 -0
- package/dist/cli/transport.js +324 -0
- package/dist/cli/transport.js.map +1 -0
- package/dist/cli/transport.test.d.ts +2 -0
- package/dist/cli/transport.test.d.ts.map +1 -0
- package/dist/cli/transport.test.js +197 -0
- package/dist/cli/transport.test.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime/close-info.d.ts +94 -0
- package/dist/runtime/close-info.d.ts.map +1 -0
- package/dist/runtime/close-info.js +109 -0
- package/dist/runtime/close-info.js.map +1 -0
- package/dist/runtime/close-info.test.d.ts +2 -0
- package/dist/runtime/close-info.test.d.ts.map +1 -0
- package/dist/runtime/close-info.test.js +102 -0
- package/dist/runtime/close-info.test.js.map +1 -0
- package/dist/runtime/errors.d.ts +47 -0
- package/dist/runtime/errors.d.ts.map +1 -0
- package/dist/runtime/errors.js +20 -0
- package/dist/runtime/errors.js.map +1 -0
- package/dist/runtime/errors.test.d.ts +2 -0
- package/dist/runtime/errors.test.d.ts.map +1 -0
- package/dist/runtime/errors.test.js +66 -0
- package/dist/runtime/errors.test.js.map +1 -0
- package/dist/runtime/frame.d.ts +25 -0
- package/dist/runtime/frame.d.ts.map +1 -0
- package/dist/runtime/frame.js +106 -0
- package/dist/runtime/frame.js.map +1 -0
- package/dist/runtime/frame.test.d.ts +2 -0
- package/dist/runtime/frame.test.d.ts.map +1 -0
- package/dist/runtime/frame.test.js +32 -0
- package/dist/runtime/frame.test.js.map +1 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +3 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/refs.d.ts +10 -0
- package/dist/runtime/refs.d.ts.map +1 -0
- package/dist/runtime/refs.js +10 -0
- package/dist/runtime/refs.js.map +1 -0
- package/dist/runtime/runtime.test.d.ts +2 -0
- package/dist/runtime/runtime.test.d.ts.map +1 -0
- package/dist/runtime/runtime.test.js +29 -0
- package/dist/runtime/runtime.test.js.map +1 -0
- package/dist/runtime/subscribers.d.ts +157 -0
- package/dist/runtime/subscribers.d.ts.map +1 -0
- package/dist/runtime/subscribers.js +131 -0
- package/dist/runtime/subscribers.js.map +1 -0
- package/dist/runtime/subscribers.test.d.ts +2 -0
- package/dist/runtime/subscribers.test.d.ts.map +1 -0
- package/dist/runtime/subscribers.test.js +155 -0
- package/dist/runtime/subscribers.test.js.map +1 -0
- package/dist/service.d.ts +68 -17
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +461 -307
- package/dist/service.js.map +1 -1
- package/dist/service.test.js +266 -77
- package/dist/service.test.js.map +1 -1
- package/dist/test/index.d.ts +33 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +44 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test-utils/channel-service-fixture.d.ts +2 -1
- package/dist/test-utils/channel-service-fixture.d.ts.map +1 -1
- package/dist/test-utils/channel-service-fixture.js +31 -11
- package/dist/test-utils/channel-service-fixture.js.map +1 -1
- package/dist/test-utils/conformance-adapter.d.ts +50 -0
- package/dist/test-utils/conformance-adapter.d.ts.map +1 -0
- package/dist/test-utils/conformance-adapter.js +206 -0
- package/dist/test-utils/conformance-adapter.js.map +1 -0
- package/dist/test-utils/fake-service.d.ts +85 -0
- package/dist/test-utils/fake-service.d.ts.map +1 -0
- package/dist/test-utils/fake-service.js +103 -0
- package/dist/test-utils/fake-service.js.map +1 -0
- package/dist/test-utils/index.d.ts +2 -0
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/index.js +3 -2
- package/dist/test-utils/index.js.map +1 -1
- package/dist/ws-client.d.ts +157 -18
- package/dist/ws-client.d.ts.map +1 -1
- package/dist/ws-client.js +432 -94
- package/dist/ws-client.js.map +1 -1
- package/dist/ws-client.test.d.ts +2 -0
- package/dist/ws-client.test.d.ts.map +1 -0
- package/dist/ws-client.test.js +672 -0
- package/dist/ws-client.test.js.map +1 -0
- package/package.json +23 -14
- package/LICENSE +0 -21
- package/dist/__tests__/service.integration.test.d.ts +0 -2
- package/dist/__tests__/service.integration.test.d.ts.map +0 -1
- package/dist/__tests__/service.integration.test.js +0 -1087
- package/dist/__tests__/service.integration.test.js.map +0 -1
- package/dist/cli/commands/delete.d.ts +0 -3
- package/dist/cli/commands/delete.d.ts.map +0 -1
- package/dist/cli/commands/delete.js +0 -10
- package/dist/cli/commands/delete.js.map +0 -1
- package/dist/cli/commands/react.d.ts +0 -3
- package/dist/cli/commands/react.d.ts.map +0 -1
- package/dist/cli/commands/react.js +0 -18
- package/dist/cli/commands/react.js.map +0 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `moltzap permissions <subcommand>` — handlers for spec sbd#177 rev 3 §5.4.
|
|
3
|
+
*
|
|
4
|
+
* Three subcommands, one RPC each:
|
|
5
|
+
*
|
|
6
|
+
* permissions grant → permissions/grant
|
|
7
|
+
* permissions list → permissions/list
|
|
8
|
+
* permissions revoke → permissions/revoke
|
|
9
|
+
*
|
|
10
|
+
* Auth model: Assumption §6.2 — agent-scoped (not admin-only). Architect
|
|
11
|
+
* verified against the server handler during impl (Q-PG-1 RESOLVED HIGH).
|
|
12
|
+
*/
|
|
13
|
+
import { Command } from "@effect/cli";
|
|
14
|
+
import { Effect, Option } from "effect";
|
|
15
|
+
import { type Transport, type TransportError } from "../transport.js";
|
|
16
|
+
/** Exhaustive error union for the permissions surface. */
|
|
17
|
+
export type PermissionsCommandError = TransportError | PermissionsInputError;
|
|
18
|
+
export declare class PermissionsInputError extends Error {
|
|
19
|
+
readonly reason: string;
|
|
20
|
+
readonly _tag: "PermissionsInputError";
|
|
21
|
+
constructor(reason: string);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* `moltzap permissions grant --session <id> --agent <id> --resource <r>
|
|
25
|
+
* --access <a>...` — spec §5.4 bullet 1. `access` is `--access` repeated
|
|
26
|
+
* per Assumption §6.4.
|
|
27
|
+
*/
|
|
28
|
+
export interface PermissionsGrantArgs {
|
|
29
|
+
readonly sessionId: string;
|
|
30
|
+
readonly agentId: string;
|
|
31
|
+
readonly resource: string;
|
|
32
|
+
readonly access: ReadonlyArray<string>;
|
|
33
|
+
}
|
|
34
|
+
/** `moltzap permissions list [--app <id>]` — spec §5.4 bullet 2. */
|
|
35
|
+
export interface PermissionsListArgs {
|
|
36
|
+
readonly appId?: string;
|
|
37
|
+
}
|
|
38
|
+
/** `moltzap permissions revoke --app <id> --resource <r>` — spec §5.4 bullet 3. */
|
|
39
|
+
export interface PermissionsRevokeArgs {
|
|
40
|
+
readonly appId: string;
|
|
41
|
+
readonly resource: string;
|
|
42
|
+
}
|
|
43
|
+
/** Wraps `permissions/grant`. Emits a success marker to stdout. */
|
|
44
|
+
export declare const permissionsGrantHandler: (args: PermissionsGrantArgs) => Effect.Effect<void, PermissionsCommandError, Transport>;
|
|
45
|
+
/**
|
|
46
|
+
* Wraps `permissions/list`. Emits one grant per line (appId, resource,
|
|
47
|
+
* access[], grantedAt).
|
|
48
|
+
*/
|
|
49
|
+
export declare const permissionsListHandler: (args: PermissionsListArgs) => Effect.Effect<void, PermissionsCommandError, Transport>;
|
|
50
|
+
/** Wraps `permissions/revoke`. Emits a success marker to stdout. */
|
|
51
|
+
export declare const permissionsRevokeHandler: (args: PermissionsRevokeArgs) => Effect.Effect<void, PermissionsCommandError, Transport>;
|
|
52
|
+
/** `moltzap permissions [grant|list|revoke]` subcommand group. */
|
|
53
|
+
export declare const permissionsCommand: Command.Command<"permissions", Transport, never, {
|
|
54
|
+
readonly subcommand: Option.Option<{
|
|
55
|
+
readonly session: string;
|
|
56
|
+
readonly agent: string;
|
|
57
|
+
readonly resource: string;
|
|
58
|
+
readonly access: string[];
|
|
59
|
+
} | {
|
|
60
|
+
readonly app: Option.Option<string>;
|
|
61
|
+
} | {
|
|
62
|
+
readonly app: string;
|
|
63
|
+
readonly resource: string;
|
|
64
|
+
}>;
|
|
65
|
+
}>;
|
|
66
|
+
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,OAAO,EAAW,MAAM,aAAa,CAAC;AAC/C,OAAO,E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AAmEL,kEAAkE;AAClE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAe9B,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `moltzap permissions <subcommand>` — handlers for spec sbd#177 rev 3 §5.4.
|
|
3
|
+
*
|
|
4
|
+
* Three subcommands, one RPC each:
|
|
5
|
+
*
|
|
6
|
+
* permissions grant → permissions/grant
|
|
7
|
+
* permissions list → permissions/list
|
|
8
|
+
* permissions revoke → permissions/revoke
|
|
9
|
+
*
|
|
10
|
+
* Auth model: Assumption §6.2 — agent-scoped (not admin-only). Architect
|
|
11
|
+
* verified against the server handler during impl (Q-PG-1 RESOLVED HIGH).
|
|
12
|
+
*/
|
|
13
|
+
import { Command, Options } from "@effect/cli";
|
|
14
|
+
import { Effect, Option } from "effect";
|
|
15
|
+
import { rpc, runHandler, } from "../transport.js";
|
|
16
|
+
export class PermissionsInputError extends Error {
|
|
17
|
+
reason;
|
|
18
|
+
_tag = "PermissionsInputError";
|
|
19
|
+
constructor(reason) {
|
|
20
|
+
super(reason);
|
|
21
|
+
this.reason = reason;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// ─── Handlers ──────────────────────────────────────────────────────────────
|
|
25
|
+
/** Wraps `permissions/grant`. Emits a success marker to stdout. */
|
|
26
|
+
export const permissionsGrantHandler = (args) => Effect.gen(function* () {
|
|
27
|
+
if (args.access.length === 0) {
|
|
28
|
+
return yield* Effect.fail(new PermissionsInputError("--access requires at least one value (e.g. --access read)"));
|
|
29
|
+
}
|
|
30
|
+
yield* rpc("permissions/grant", {
|
|
31
|
+
sessionId: args.sessionId,
|
|
32
|
+
agentId: args.agentId,
|
|
33
|
+
resource: args.resource,
|
|
34
|
+
access: [...args.access],
|
|
35
|
+
});
|
|
36
|
+
yield* Effect.sync(() => {
|
|
37
|
+
console.log(`granted: agent=${args.agentId} resource=${args.resource} access=${args.access.join(",")}`);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Wraps `permissions/list`. Emits one grant per line (appId, resource,
|
|
42
|
+
* access[], grantedAt).
|
|
43
|
+
*/
|
|
44
|
+
export const permissionsListHandler = (args) => Effect.gen(function* () {
|
|
45
|
+
const params = {};
|
|
46
|
+
if (args.appId !== undefined)
|
|
47
|
+
params.appId = args.appId;
|
|
48
|
+
const result = yield* rpc("permissions/list", params);
|
|
49
|
+
yield* Effect.sync(() => {
|
|
50
|
+
for (const g of result.grants) {
|
|
51
|
+
console.log(`${g.appId}\t${g.resource}\t${g.access.join(",")}\t${g.grantedAt}`);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
/** Wraps `permissions/revoke`. Emits a success marker to stdout. */
|
|
56
|
+
export const permissionsRevokeHandler = (args) => Effect.gen(function* () {
|
|
57
|
+
yield* rpc("permissions/revoke", {
|
|
58
|
+
appId: args.appId,
|
|
59
|
+
resource: args.resource,
|
|
60
|
+
});
|
|
61
|
+
yield* Effect.sync(() => {
|
|
62
|
+
console.log(`revoked: app=${args.appId} resource=${args.resource}`);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
// ─── CLI commands ──────────────────────────────────────────────────────────
|
|
66
|
+
const sessionOption = Options.text("session").pipe(Options.withDescription("Session id"));
|
|
67
|
+
const agentOption = Options.text("agent").pipe(Options.withDescription("Agent id"));
|
|
68
|
+
const resourceOption = Options.text("resource").pipe(Options.withDescription("Resource identifier"));
|
|
69
|
+
const accessOption = Options.text("access").pipe(Options.withDescription("Access kind (repeatable)"), Options.repeated);
|
|
70
|
+
const permissionsGrantCommand = Command.make("grant", {
|
|
71
|
+
session: sessionOption,
|
|
72
|
+
agent: agentOption,
|
|
73
|
+
resource: resourceOption,
|
|
74
|
+
access: accessOption,
|
|
75
|
+
}, ({ session, agent, resource, access }) => runHandler(permissionsGrantHandler({
|
|
76
|
+
sessionId: session,
|
|
77
|
+
agentId: agent,
|
|
78
|
+
resource,
|
|
79
|
+
access,
|
|
80
|
+
}))).pipe(Command.withDescription("Grant permissions on a session resource"));
|
|
81
|
+
const permAppOption = Options.text("app").pipe(Options.withDescription("Filter by app id"), Options.optional);
|
|
82
|
+
const permissionsListCommand = Command.make("list", { app: permAppOption }, ({ app }) => {
|
|
83
|
+
const args = Option.isSome(app)
|
|
84
|
+
? { appId: app.value }
|
|
85
|
+
: {};
|
|
86
|
+
return runHandler(permissionsListHandler(args));
|
|
87
|
+
}).pipe(Command.withDescription("List active permission grants"));
|
|
88
|
+
const revokeAppOption = Options.text("app").pipe(Options.withDescription("App id"));
|
|
89
|
+
const revokeResourceOption = Options.text("resource").pipe(Options.withDescription("Resource identifier"));
|
|
90
|
+
const permissionsRevokeCommand = Command.make("revoke", { app: revokeAppOption, resource: revokeResourceOption }, ({ app, resource }) => runHandler(permissionsRevokeHandler({ appId: app, resource }))).pipe(Command.withDescription("Revoke a permission"));
|
|
91
|
+
/** `moltzap permissions [grant|list|revoke]` subcommand group. */
|
|
92
|
+
export const permissionsCommand = Command.make("permissions", {}, () => Effect.sync(() => {
|
|
93
|
+
console.log("Usage: moltzap permissions <grant|list|revoke> [options]");
|
|
94
|
+
})).pipe(Command.withDescription("Manage session permissions. Runs as the identity selected by the " +
|
|
95
|
+
"global --as / --profile flags (see `moltzap --help`); grants/revokes " +
|
|
96
|
+
"are scoped to that caller's owner id."), Command.withSubcommands([
|
|
97
|
+
permissionsGrantCommand,
|
|
98
|
+
permissionsListCommand,
|
|
99
|
+
permissionsRevokeCommand,
|
|
100
|
+
]));
|
|
101
|
+
//# sourceMappingURL=permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../src/cli/commands/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,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"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for `moltzap permissions <subcommand>` handlers. Spec
|
|
3
|
+
* test-coverage floor: one success + one RPC-failure per handler.
|
|
4
|
+
*/
|
|
5
|
+
import { Effect } from "effect";
|
|
6
|
+
import { afterEach, beforeEach, describe, expect, it, vi, } from "vitest";
|
|
7
|
+
import { permissionsGrantHandler, permissionsListHandler, permissionsRevokeHandler, } from "./permissions.js";
|
|
8
|
+
import { Transport, TransportRpcError, } from "../transport.js";
|
|
9
|
+
const makeFakeTransport = (respond) => {
|
|
10
|
+
const calls = [];
|
|
11
|
+
const transport = {
|
|
12
|
+
kind: "test",
|
|
13
|
+
rpc: (method, params) => {
|
|
14
|
+
calls.push({ method, params });
|
|
15
|
+
const out = respond({ method, params });
|
|
16
|
+
if (out instanceof Error) {
|
|
17
|
+
return Effect.fail(new TransportRpcError({ method, code: -32000, message: out.message }));
|
|
18
|
+
}
|
|
19
|
+
return Effect.succeed(out);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
return { calls, transport };
|
|
23
|
+
};
|
|
24
|
+
describe("permissions grant", () => {
|
|
25
|
+
let stdout;
|
|
26
|
+
beforeEach(() => {
|
|
27
|
+
stdout = vi.spyOn(console, "log").mockImplementation(() => { });
|
|
28
|
+
});
|
|
29
|
+
afterEach(() => stdout.mockRestore());
|
|
30
|
+
it("calls permissions/grant with { sessionId, agentId, resource, access[] }", async () => {
|
|
31
|
+
const { calls, transport } = makeFakeTransport(() => ({}));
|
|
32
|
+
await Effect.runPromise(permissionsGrantHandler({
|
|
33
|
+
sessionId: "sess-1",
|
|
34
|
+
agentId: "agent-a",
|
|
35
|
+
resource: "res-1",
|
|
36
|
+
access: ["read", "write"],
|
|
37
|
+
}).pipe(Effect.provideService(Transport, transport)));
|
|
38
|
+
expect(calls).toEqual([
|
|
39
|
+
{
|
|
40
|
+
method: "permissions/grant",
|
|
41
|
+
params: {
|
|
42
|
+
sessionId: "sess-1",
|
|
43
|
+
agentId: "agent-a",
|
|
44
|
+
resource: "res-1",
|
|
45
|
+
access: ["read", "write"],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
]);
|
|
49
|
+
});
|
|
50
|
+
it("rejects empty access with PermissionsInputError", async () => {
|
|
51
|
+
const { transport } = makeFakeTransport(() => ({}));
|
|
52
|
+
const result = await Effect.runPromiseExit(permissionsGrantHandler({
|
|
53
|
+
sessionId: "s",
|
|
54
|
+
agentId: "a",
|
|
55
|
+
resource: "r",
|
|
56
|
+
access: [],
|
|
57
|
+
}).pipe(Effect.provideService(Transport, transport)));
|
|
58
|
+
expect(result._tag).toBe("Failure");
|
|
59
|
+
});
|
|
60
|
+
it("surfaces TransportRpcError", async () => {
|
|
61
|
+
const { transport } = makeFakeTransport(() => new Error("denied"));
|
|
62
|
+
const result = await Effect.runPromiseExit(permissionsGrantHandler({
|
|
63
|
+
sessionId: "s",
|
|
64
|
+
agentId: "a",
|
|
65
|
+
resource: "r",
|
|
66
|
+
access: ["read"],
|
|
67
|
+
}).pipe(Effect.provideService(Transport, transport)));
|
|
68
|
+
expect(result._tag).toBe("Failure");
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
describe("permissions list", () => {
|
|
72
|
+
let stdout;
|
|
73
|
+
beforeEach(() => {
|
|
74
|
+
stdout = vi.spyOn(console, "log").mockImplementation(() => { });
|
|
75
|
+
});
|
|
76
|
+
afterEach(() => stdout.mockRestore());
|
|
77
|
+
it("calls permissions/list with optional appId filter and prints one grant per line", async () => {
|
|
78
|
+
const { calls, transport } = makeFakeTransport(() => ({
|
|
79
|
+
grants: [
|
|
80
|
+
{
|
|
81
|
+
appId: "app-1",
|
|
82
|
+
resource: "r1",
|
|
83
|
+
access: ["read"],
|
|
84
|
+
grantedAt: "2026-01-01T00:00:00Z",
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
}));
|
|
88
|
+
await Effect.runPromise(permissionsListHandler({ appId: "app-1" }).pipe(Effect.provideService(Transport, transport)));
|
|
89
|
+
expect(calls[0]).toEqual({
|
|
90
|
+
method: "permissions/list",
|
|
91
|
+
params: { appId: "app-1" },
|
|
92
|
+
});
|
|
93
|
+
expect(stdout).toHaveBeenCalledTimes(1);
|
|
94
|
+
});
|
|
95
|
+
it("omits appId when absent", async () => {
|
|
96
|
+
const { calls, transport } = makeFakeTransport(() => ({ grants: [] }));
|
|
97
|
+
await Effect.runPromise(permissionsListHandler({}).pipe(Effect.provideService(Transport, transport)));
|
|
98
|
+
expect(calls[0]?.params).toEqual({});
|
|
99
|
+
});
|
|
100
|
+
it("surfaces TransportRpcError", async () => {
|
|
101
|
+
const { transport } = makeFakeTransport(() => new Error("fail"));
|
|
102
|
+
const result = await Effect.runPromiseExit(permissionsListHandler({}).pipe(Effect.provideService(Transport, transport)));
|
|
103
|
+
expect(result._tag).toBe("Failure");
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
describe("permissions revoke", () => {
|
|
107
|
+
let stdout;
|
|
108
|
+
beforeEach(() => {
|
|
109
|
+
stdout = vi.spyOn(console, "log").mockImplementation(() => { });
|
|
110
|
+
});
|
|
111
|
+
afterEach(() => stdout.mockRestore());
|
|
112
|
+
it("calls permissions/revoke with { appId, resource }", async () => {
|
|
113
|
+
const { calls, transport } = makeFakeTransport(() => ({}));
|
|
114
|
+
await Effect.runPromise(permissionsRevokeHandler({ appId: "app-1", resource: "r1" }).pipe(Effect.provideService(Transport, transport)));
|
|
115
|
+
expect(calls[0]).toEqual({
|
|
116
|
+
method: "permissions/revoke",
|
|
117
|
+
params: { appId: "app-1", resource: "r1" },
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
it("surfaces TransportRpcError", async () => {
|
|
121
|
+
const { transport } = makeFakeTransport(() => new Error("fail"));
|
|
122
|
+
const result = await Effect.runPromiseExit(permissionsRevokeHandler({ appId: "a", resource: "r" }).pipe(Effect.provideService(Transport, transport)));
|
|
123
|
+
expect(result._tag).toBe("Failure");
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
//# sourceMappingURL=permissions.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.test.js","sourceRoot":"","sources":["../../../src/cli/commands/permissions.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,EAAE,EACF,EAAE,GAEH,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,iBAAiB,GAGlB,MAAM,iBAAiB,CAAC;AAIzB,MAAM,iBAAiB,GAAG,CACxB,OAAwC,EACa,EAAE;IACvD,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAqB;QAClC,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,CACH,MAAc,EACd,MAA+B,EACQ,EAAE;YACzC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YACxC,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;gBACzB,OAAO,MAAM,CAAC,IAAI,CAChB,IAAI,iBAAiB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CACtE,CAAC;YACJ,CAAC;YACD,OAAO,MAAM,CAAC,OAAO,CAAC,GAAa,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AAC9B,CAAC,CAAC;AAEF,QAAQ,CAAC,mBAAmB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AE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,EAAE,SAAS,EAAE,GAAG,iBAAiB,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CACxC,wBAAwB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAC1D,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAC5C,CACF,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { Command } from "
|
|
2
|
-
|
|
1
|
+
import { Command } from "@effect/cli";
|
|
2
|
+
/**
|
|
3
|
+
* `moltzap ping` — hit /health on the configured server URL. Exit 0 on
|
|
4
|
+
* 2xx, 1 otherwise (message to stderr via the caught Error surface).
|
|
5
|
+
*/
|
|
6
|
+
export declare const pingCommand: Command.Command<"ping", never, never, {}>;
|
|
3
7
|
//# sourceMappingURL=ping.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ping.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ping.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAyBtC;;;GAGG;AACH,eAAO,MAAM,WAAW,2CAcmD,CAAC"}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { Command } from "
|
|
1
|
+
import { Command } from "@effect/cli";
|
|
2
|
+
import { HttpClient, HttpClientRequest } from "@effect/platform";
|
|
3
|
+
import { NodeHttpClient } from "@effect/platform-node";
|
|
4
|
+
import { Effect } from "effect";
|
|
2
5
|
import { getHttpUrl } from "../config.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (res.ok) {
|
|
10
|
-
console.log("Server reachable");
|
|
11
|
-
process.exit(0);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
console.error(`Server unreachable: HTTP ${res.status}`);
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
6
|
+
const pingEffect = Effect.gen(function* () {
|
|
7
|
+
const baseUrl = yield* getHttpUrl;
|
|
8
|
+
const client = yield* HttpClient.HttpClient;
|
|
9
|
+
const response = yield* client.execute(HttpClientRequest.get(`${baseUrl}/health`));
|
|
10
|
+
if (response.status < 200 || response.status >= 300) {
|
|
11
|
+
return yield* Effect.fail(new Error(`Server unreachable: HTTP ${response.status}`));
|
|
17
12
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
}).pipe(Effect.timeout("5 seconds"), Effect.provide(NodeHttpClient.layer), Effect.catchAll((err) => Effect.fail(err instanceof Error ? err : new Error(String(err)))));
|
|
14
|
+
/**
|
|
15
|
+
* `moltzap ping` — hit /health on the configured server URL. Exit 0 on
|
|
16
|
+
* 2xx, 1 otherwise (message to stderr via the caught Error surface).
|
|
17
|
+
*/
|
|
18
|
+
export const pingCommand = Command.make("ping", {}, () => pingEffect.pipe(Effect.tap(() => Effect.sync(() => {
|
|
19
|
+
console.log("Server reachable");
|
|
20
|
+
})), Effect.catchAll((err) => Effect.sync(() => {
|
|
21
|
+
console.error(`Server unreachable: ${err.message}`);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
})))).pipe(Command.withDescription("Check if the MoltZap server is reachable"));
|
|
23
24
|
//# sourceMappingURL=ping.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ping.js","sourceRoot":"","sources":["../../../src/cli/commands/ping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ping.js","sourceRoot":"","sources":["../../../src/cli/commands/ping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,UAAU,GAA+B,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IACjE,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;IAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CACpC,iBAAiB,CAAC,GAAG,CAAC,GAAG,OAAO,SAAS,CAAC,CAC3C,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;QACpD,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CACvB,IAAI,KAAK,CAAC,4BAA4B,QAAQ,CAAC,MAAM,EAAE,CAAC,CACzD,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC,IAAI,CACL,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAC3B,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,EACpC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,EAAE,CACtB,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CACjE,CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,CACvD,UAAU,CAAC,IAAI,CACb,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CACd,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;IACf,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAClC,CAAC,CAAC,CACH,EACD,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,EAAE,CACtB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;IACf,OAAO,CAAC,KAAK,CAAC,uBAAuB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CACH,CACF,CACF,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,0CAA0C,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { Command } from "
|
|
2
|
-
|
|
1
|
+
import { Command } from "@effect/cli";
|
|
2
|
+
import { Option } from "effect";
|
|
3
|
+
/**
|
|
4
|
+
* `moltzap presence <status>` — pushes a presence update through the local
|
|
5
|
+
* Unix socket. Status argument is optional; missing → prints usage. Unknown
|
|
6
|
+
* values exit 1 after a stderr message.
|
|
7
|
+
*/
|
|
8
|
+
export declare const presenceCommand: Command.Command<"presence", never, never, {
|
|
9
|
+
readonly status: Option.Option<string>;
|
|
10
|
+
}>;
|
|
3
11
|
//# sourceMappingURL=presence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presence.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/presence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"presence.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/presence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQxC;;;;GAIG;AACH,eAAO,MAAM,eAAe;;EAsC3B,CAAC"}
|
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
import { Command } from "
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Args, Command } from "@effect/cli";
|
|
2
|
+
import { Effect, Option } from "effect";
|
|
3
|
+
import { request } from "../socket-client.js";
|
|
4
|
+
const statusArg = Args.text({ name: "status" }).pipe(Args.withDescription("Status to set: online, offline, or away"), Args.optional);
|
|
5
|
+
/**
|
|
6
|
+
* `moltzap presence <status>` — pushes a presence update through the local
|
|
7
|
+
* Unix socket. Status argument is optional; missing → prints usage. Unknown
|
|
8
|
+
* values exit 1 after a stderr message.
|
|
9
|
+
*/
|
|
10
|
+
export const presenceCommand = Command.make("presence", { status: statusArg }, ({ status }) => {
|
|
11
|
+
if (Option.isNone(status)) {
|
|
12
|
+
return Effect.sync(() => {
|
|
13
|
+
console.log("Usage: moltzap presence <online|offline|away>");
|
|
14
|
+
});
|
|
10
15
|
}
|
|
16
|
+
const value = status.value;
|
|
11
17
|
const valid = ["online", "offline", "away"];
|
|
12
|
-
if (!valid.includes(
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
if (!valid.includes(value)) {
|
|
19
|
+
return Effect.sync(() => {
|
|
20
|
+
console.error(`Invalid status "${value}". Must be one of: ${valid.join(", ")}`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
});
|
|
15
23
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}))
|
|
24
|
+
return request("presence/update", { status: value }).pipe(Effect.tap(() => Effect.sync(() => {
|
|
25
|
+
console.log(`Presence set to ${value}.`);
|
|
26
|
+
})), Effect.asVoid, Effect.catchAll((err) => Effect.sync(() => {
|
|
27
|
+
console.error(`Failed: ${err.message}`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
})));
|
|
30
|
+
}).pipe(Command.withDescription("Update or show presence status (online, offline, away)"));
|
|
19
31
|
//# sourceMappingURL=presence.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presence.js","sourceRoot":"","sources":["../../../src/cli/commands/presence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"presence.js","sourceRoot":"","sources":["../../../src/cli/commands/presence.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,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,CAClD,IAAI,CAAC,eAAe,CAAC,yCAAyC,CAAC,EAC/D,IAAI,CAAC,QAAQ,CACd,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CACzC,UAAU,EACV,EAAE,MAAM,EAAE,SAAS,EAAE,EACrB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;IACb,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;YACtB,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACL,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC3B,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;YACtB,OAAO,CAAC,KAAK,CACX,mBAAmB,KAAK,sBAAsB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACjE,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,CACvD,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CACd,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,GAAG,CAAC,CAAC;IAC3C,CAAC,CAAC,CACH,EACD,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,EAAE,CACtB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;QACf,OAAO,CAAC,KAAK,CAAC,WAAW,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CACH,CACF,CAAC;AACJ,CAAC,CACF,CAAC,IAAI,CACJ,OAAO,CAAC,eAAe,CACrB,wDAAwD,CACzD,CACF,CAAC"}
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
import { Command } from "
|
|
2
|
-
|
|
1
|
+
import { Command } from "@effect/cli";
|
|
2
|
+
import { Option } from "effect";
|
|
3
|
+
/**
|
|
4
|
+
* `moltzap register <name> <invite-code> [-d description] [--profile <name>] [--no-persist]`
|
|
5
|
+
*
|
|
6
|
+
* POST /api/v1/auth/register, then (by default) persist the result into
|
|
7
|
+
* both `~/.moltzap/config.json` and the OpenClaw channel config so the
|
|
8
|
+
* channel picks it up on its next file-watcher cycle.
|
|
9
|
+
*
|
|
10
|
+
* Spec §5.2 extensions:
|
|
11
|
+
* --profile <name> write under `profiles.<name>` instead of legacy top-level
|
|
12
|
+
* --no-persist print result to stdout only; NO writes to either tree
|
|
13
|
+
*
|
|
14
|
+
* `--no-persist` gates BOTH the `~/.moltzap/config.json` write AND the
|
|
15
|
+
* `~/.openclaw/openclaw.json` write (Invariant §4.4 as revised in architect
|
|
16
|
+
* design doc rev 4 finding 2).
|
|
17
|
+
*/
|
|
18
|
+
export declare const registerCommand: Command.Command<"register", never, never, {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly inviteCode: string;
|
|
21
|
+
readonly description: Option.Option<string>;
|
|
22
|
+
readonly profile: Option.Option<string>;
|
|
23
|
+
readonly noPersist: boolean;
|
|
24
|
+
}>;
|
|
3
25
|
//# sourceMappingURL=register.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/register.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/register.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,OAAO,EAAW,MAAM,aAAa,CAAC;AACrD,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAsHxC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe;;;;;;EAoF3B,CAAC"}
|