@moltzap/client 2026.525.0 → 2026.528.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/cli/commands/agents.d.ts.map +1 -1
- package/dist/cli/commands/agents.js +8 -2
- package/dist/cli/commands/agents.js.map +1 -1
- package/dist/cli/commands/contacts.d.ts.map +1 -1
- package/dist/cli/commands/contacts.js +7 -1
- package/dist/cli/commands/contacts.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/pagination.d.ts +45 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +44 -0
- package/dist/pagination.js.map +1 -0
- package/dist/pagination.test.d.ts +2 -0
- package/dist/pagination.test.d.ts.map +1 -0
- package/dist/pagination.test.js +72 -0
- package/dist/pagination.test.js.map +1 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAW,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAW,MAAM,aAAa,CAAC;AA+FrD;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;EAMzB,CAAC"}
|
|
@@ -6,9 +6,11 @@ const jsonOption = Options.boolean("json").pipe(Options.withDescription("Output
|
|
|
6
6
|
const JSON_INDENT_SPACES = 2;
|
|
7
7
|
const listAgents = Command.make("list", { json: jsonOption }, ({ json }) => request(AgentsList, {}).pipe(Effect.tap((result) => Effect.sync(() => {
|
|
8
8
|
const r = result;
|
|
9
|
-
const entries =
|
|
9
|
+
const entries = r.agents;
|
|
10
10
|
if (json) {
|
|
11
|
-
|
|
11
|
+
// Emit the full result (incl. nextCursor) so a machine consumer
|
|
12
|
+
// can detect a truncated page; `r.agents` alone would hide it.
|
|
13
|
+
console.log(JSON.stringify(r, null, JSON_INDENT_SPACES));
|
|
12
14
|
return;
|
|
13
15
|
}
|
|
14
16
|
if (entries.length === 0) {
|
|
@@ -24,6 +26,10 @@ const listAgents = Command.make("list", { json: jsonOption }, ({ json }) => requ
|
|
|
24
26
|
line += `\n Description: ${agent.description}`;
|
|
25
27
|
console.log(line + "\n");
|
|
26
28
|
}
|
|
29
|
+
// Signal a truncated page so users don't mistake it for the full list.
|
|
30
|
+
if (r.nextCursor !== undefined) {
|
|
31
|
+
console.log(`Showing first ${entries.length} — more results available.`);
|
|
32
|
+
}
|
|
27
33
|
})), Effect.asVoid, Effect.catchAll((err) => Effect.sync(() => {
|
|
28
34
|
console.error(`Failed: ${err.message}`);
|
|
29
35
|
process.exit(1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/cli/commands/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/cli/commands/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAWnE,MAAM,UAA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C,CAAC,MAAM,EAAE,CAAC;QAC7B,IAAI,IAAI,GAAG,UAAU,KAAK,CAAC,IAAI,WAAW,KAAK,CAAC,EAAE,eAAe,KAAK,CAAC,MAAM,EAAE,CAAC;QAChF,IAAI,KAAK,CAAC,WAAW;YACnB,IAAI,IAAI,oBAAoB,KAAK,CAAC,WAAW,EAAE,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC,CAAC,CACH,EACD,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,EAAE,CACtB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;IACf,OAAO,CAAC,KAAK,CAAC,WAAW,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CACH,CACF,CACF,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE;AAC3D,gEAAgE;AAChE,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CACpC,CAAC,IAAI,CACJ,OAAO,CAAC,eAAe,CAAC,oCAAoC,CAAC,EAC7D,OAAO,CAAC,eAAe,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAW,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAW,MAAM,aAAa,CAAC;AA4FrD,eAAO,MAAM,eAAe;;;;;;;;EAK3B,CAAC"}
|
|
@@ -11,7 +11,9 @@ const wrap = (effect, onSuccess) => effect.pipe(Effect.tap((value) => Effect.syn
|
|
|
11
11
|
})));
|
|
12
12
|
const listContacts = Command.make("list", { json: jsonOption }, ({ json }) => wrap(request(ContactsList, {}), (r) => {
|
|
13
13
|
if (json) {
|
|
14
|
-
|
|
14
|
+
// Emit the full result (incl. nextCursor) so a machine consumer
|
|
15
|
+
// can detect a truncated page; `r.contacts` alone would hide it.
|
|
16
|
+
console.log(JSON.stringify(r, null, JSON_INDENT_SPACES));
|
|
15
17
|
return;
|
|
16
18
|
}
|
|
17
19
|
if (r.contacts.length === 0) {
|
|
@@ -22,6 +24,10 @@ const listContacts = Command.make("list", { json: jsonOption }, ({ json }) => wr
|
|
|
22
24
|
const rel = c.relationship ? ` (${c.relationship})` : "";
|
|
23
25
|
console.log(` ${c.id} ${c.contactUserId}${rel}`);
|
|
24
26
|
}
|
|
27
|
+
// Signal a truncated page so users don't mistake it for the full list.
|
|
28
|
+
if (r.nextCursor !== undefined) {
|
|
29
|
+
console.log(`Showing first ${r.contacts.length} — more results available.`);
|
|
30
|
+
}
|
|
25
31
|
})).pipe(Command.withDescription("List contacts"));
|
|
26
32
|
const userIdArg = Args.text({ name: "userId" }).pipe(Args.withDescription("User ID to add as a contact"));
|
|
27
33
|
const addContact = Command.make("add", { userId: userIdArg }, ({ userId: u }) => wrap(request(ContactsAdd, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../../src/cli/commands/contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAgB,MAAM,mBAAmB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,CAAC,CAAC,CAAC;AAE5D,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,IAAI,CACxD,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,IAAI,CACF,OAAO,CAAC,cAAc,EAAE;IACtB,SAAS,EAAE,SAAsB;CAClC,CAA+C,EAChD,CAAC,CAAC,EAAE,EAAE;IACJ,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;AACnD,CAAC,CACF,CACJ,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,0BAA0B,CAAC,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,EAAE,GAAG,EAAE,CAC/D,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CACtC,CAAC,IAAI,CACJ,OAAO,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAC1C,OAAO,CAAC,eAAe,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CACnE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export { MoltZapTMClient, type TMClientOptions, type TMHandlers, type TaskCallba
|
|
|
9
9
|
export type { CloseInfo } from "./runtime/close-info.js";
|
|
10
10
|
export { TimeoutError as NotificationTimeoutError, StreamClosedError as NotificationStreamClosedError, type NotificationConsumerError, } from "./notification/errors.js";
|
|
11
11
|
export { registerAgent, type RegisterAgentOptions, type RegisterResponse, } from "./auth.js";
|
|
12
|
+
export { drainPaginatedList, NonAdvancingCursorError, type SendRpcFn, } from "./pagination.js";
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,yBAAyB,EACzB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIzD,OAAO,EACL,YAAY,IAAI,wBAAwB,EACxC,iBAAiB,IAAI,6BAA6B,EAClD,KAAK,yBAAyB,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,yBAAyB,EACzB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIzD,OAAO,EACL,YAAY,IAAI,wBAAwB,EACxC,iBAAiB,IAAI,6BAA6B,EAClD,KAAK,yBAAyB,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -11,4 +11,7 @@ export { MoltZapTMClient, } from "./tm-client.js";
|
|
|
11
11
|
// header for rationale, codex review r1 finding #8).
|
|
12
12
|
export { TimeoutError as NotificationTimeoutError, StreamClosedError as NotificationStreamClosedError, } from "./notification/errors.js";
|
|
13
13
|
export { registerAgent, } from "./auth.js";
|
|
14
|
+
// Generic drainer for the cursor-paginated list RPCs (shared across
|
|
15
|
+
// channels/CLIs that need the complete result set, not just one page).
|
|
16
|
+
export { drainPaginatedList, NonAdvancingCursorError, } from "./pagination.js";
|
|
14
17
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,yBAAyB,GAO1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,kBAAkB,GAYnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAA2B,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,eAAe,GAKhB,MAAM,gBAAgB,CAAC;AAExB,wEAAwE;AACxE,0EAA0E;AAC1E,qDAAqD;AACrD,OAAO,EACL,YAAY,IAAI,wBAAwB,EACxC,iBAAiB,IAAI,6BAA6B,GAEnD,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,aAAa,GAGd,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,yBAAyB,GAO1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,kBAAkB,GAYnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAA2B,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,eAAe,GAKhB,MAAM,gBAAgB,CAAC;AAExB,wEAAwE;AACxE,0EAA0E;AAC1E,qDAAqD;AACrD,OAAO,EACL,YAAY,IAAI,wBAAwB,EACxC,iBAAiB,IAAI,6BAA6B,GAEnD,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,aAAa,GAGd,MAAM,WAAW,CAAC;AACnB,oEAAoE;AACpE,uEAAuE;AACvE,OAAO,EACL,kBAAkB,EAClB,uBAAuB,GAExB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Generic drainer for the cursor-paginated list RPCs.
|
|
3
|
+
*
|
|
4
|
+
* The list RPCs (`contacts/list`, `agents/list`, `task/list`, …) return a
|
|
5
|
+
* bounded page plus an opaque `nextCursor`. A consumer that needs the
|
|
6
|
+
* COMPLETE set must page through every cursor. {@link drainPaginatedList}
|
|
7
|
+
* does exactly that for any RPC whose result is `{ [K]: T[], nextCursor? }`,
|
|
8
|
+
* echoing the opaque `nextCursor` back as the next page's `cursor`.
|
|
9
|
+
*
|
|
10
|
+
* Lives in `@moltzap/client` because the logic is wire-generic: any
|
|
11
|
+
* channel or CLI that drains a list RPC reuses it (openclaw's directory
|
|
12
|
+
* is the first consumer).
|
|
13
|
+
*/
|
|
14
|
+
import type { ParamsOf, ResultOf, RpcDefinition } from "@moltzap/protocol";
|
|
15
|
+
import { Effect } from "effect";
|
|
16
|
+
declare const NonAdvancingCursorError_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 & {
|
|
17
|
+
readonly _tag: "NonAdvancingCursorError";
|
|
18
|
+
} & Readonly<A>;
|
|
19
|
+
/**
|
|
20
|
+
* A server that returns a non-advancing `nextCursor` (one already seen)
|
|
21
|
+
* would loop the drain forever; fail typed so the caller's `catchAll`
|
|
22
|
+
* can degrade gracefully instead of hanging. This is a cycle guard, NOT
|
|
23
|
+
* a page cap — a well-behaved server never trips it.
|
|
24
|
+
*/
|
|
25
|
+
export declare class NonAdvancingCursorError extends NonAdvancingCursorError_base<{
|
|
26
|
+
readonly method: string;
|
|
27
|
+
}> {
|
|
28
|
+
get message(): string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The `sendRpc` shape every drain consumer provides: send one list-RPC
|
|
32
|
+
* page, decoding its typed result. Parameterized over the sender's error
|
|
33
|
+
* channel `E` so the helper stays decoupled from any one client's error
|
|
34
|
+
* union.
|
|
35
|
+
*/
|
|
36
|
+
export type SendRpcFn<E> = <D extends RpcDefinition<string, any, any>>(definition: D, params: ParamsOf<D>) => Effect.Effect<ResultOf<D>, E>;
|
|
37
|
+
/**
|
|
38
|
+
* Drain every page of a cursor-paginated list RPC whose result is
|
|
39
|
+
* `{ [K]: T[], nextCursor? }`, echoing the opaque `nextCursor` back as the
|
|
40
|
+
* next page's `cursor`. Fails with {@link NonAdvancingCursorError} if the
|
|
41
|
+
* server returns a cursor it already emitted (cycle guard).
|
|
42
|
+
*/
|
|
43
|
+
export declare function drainPaginatedList<E, D extends RpcDefinition<string, any, any>, K extends keyof ResultOf<D>>(sendRpc: SendRpcFn<E>, definition: D, collectionKey: K): Effect.Effect<ResultOf<D>[K], E | NonAdvancingCursorError>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAQ,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;AAEtC;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,6BAE3C;IACA,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;AAED;;;;;GAKG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EACnE,UAAU,EAAE,CAAC,EACb,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,KAChB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,CAAC,EACD,CAAC,SAAS,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EACzC,CAAC,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,EAE3B,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EACrB,UAAU,EAAE,CAAC,EACb,aAAa,EAAE,CAAC,GACf,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,uBAAuB,CAAC,CA6B5D"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Data, Effect } from "effect";
|
|
2
|
+
/**
|
|
3
|
+
* A server that returns a non-advancing `nextCursor` (one already seen)
|
|
4
|
+
* would loop the drain forever; fail typed so the caller's `catchAll`
|
|
5
|
+
* can degrade gracefully instead of hanging. This is a cycle guard, NOT
|
|
6
|
+
* a page cap — a well-behaved server never trips it.
|
|
7
|
+
*/
|
|
8
|
+
export class NonAdvancingCursorError extends Data.TaggedError("NonAdvancingCursorError") {
|
|
9
|
+
get message() {
|
|
10
|
+
return `Pagination cursor for ${this.method} did not advance — refusing to loop`;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Drain every page of a cursor-paginated list RPC whose result is
|
|
15
|
+
* `{ [K]: T[], nextCursor? }`, echoing the opaque `nextCursor` back as the
|
|
16
|
+
* next page's `cursor`. Fails with {@link NonAdvancingCursorError} if the
|
|
17
|
+
* server returns a cursor it already emitted (cycle guard).
|
|
18
|
+
*/
|
|
19
|
+
export function drainPaginatedList(sendRpc, definition, collectionKey) {
|
|
20
|
+
return Effect.gen(function* () {
|
|
21
|
+
const acc = [];
|
|
22
|
+
// Cycle guard, not a page cap: a repeated cursor means the server is
|
|
23
|
+
// not advancing, so fail typed rather than loop forever.
|
|
24
|
+
const seenCursors = new Set();
|
|
25
|
+
let cursor;
|
|
26
|
+
let more = true;
|
|
27
|
+
while (more) {
|
|
28
|
+
const params = (cursor !== undefined ? { cursor } : {});
|
|
29
|
+
const page = yield* sendRpc(definition, params);
|
|
30
|
+
const rows = page[collectionKey];
|
|
31
|
+
acc.push(...rows);
|
|
32
|
+
const nextCursor = page.nextCursor;
|
|
33
|
+
if (nextCursor !== undefined && seenCursors.has(nextCursor)) {
|
|
34
|
+
return yield* Effect.fail(new NonAdvancingCursorError({ method: definition.name }));
|
|
35
|
+
}
|
|
36
|
+
if (nextCursor !== undefined)
|
|
37
|
+
seenCursors.add(nextCursor);
|
|
38
|
+
cursor = nextCursor;
|
|
39
|
+
more = nextCursor !== undefined;
|
|
40
|
+
}
|
|
41
|
+
return acc;
|
|
42
|
+
}).pipe(Effect.withSpan("drainPaginatedList"));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,OAAO,uBAAwB,SAAQ,IAAI,CAAC,WAAW,CAC3D,yBAAyB,CAGzB;IACA,IAAa,OAAO;QAClB,OAAO,yBAAyB,IAAI,CAAC,MAAM,qCAAqC,CAAC;IACnF,CAAC;CACF;AAaD;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAKh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d.ts","sourceRoot":"","sources":["../src/pagination.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { it as effectIt } from "@effect/vitest";
|
|
2
|
+
import { describe, expect } from "vitest";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
const it = effectIt.effect;
|
|
5
|
+
import { ContactsList, } from "@moltzap/protocol";
|
|
6
|
+
import { drainPaginatedList, NonAdvancingCursorError, } from "./pagination.js";
|
|
7
|
+
// The drainer is wire-generic; we exercise it through `contacts/list`
|
|
8
|
+
// because its result is the `{ contacts: T[], nextCursor? }` shape the
|
|
9
|
+
// drain enumerates. The fake `sendRpc` never fails (`SendRpcFn<never>`),
|
|
10
|
+
// so the ONLY error channel left is the cursor-cycle guard — keeping the
|
|
11
|
+
// non-advancing assertion non-vacuous.
|
|
12
|
+
const PAGE_SIZE = 2;
|
|
13
|
+
const TOTAL = 5;
|
|
14
|
+
const EXPECTED_PAGE_CALLS = Math.ceil(TOTAL / PAGE_SIZE);
|
|
15
|
+
const CONSTANT_CURSOR = "stuck-cursor";
|
|
16
|
+
const ALL_CONTACTS = Array.from({ length: TOTAL }, (_unused, i) => ({ id: `contact-${i}` }));
|
|
17
|
+
// Keyset paging over an opaque cursor: the cursor encodes the index of
|
|
18
|
+
// the first row of the NEXT page. `nextCursor` present iff more rows
|
|
19
|
+
// remain (Invariant 1: a present cursor means a further page exists).
|
|
20
|
+
function pagingSendRpc() {
|
|
21
|
+
let calls = 0;
|
|
22
|
+
const send = ((_definition, params) => {
|
|
23
|
+
calls++;
|
|
24
|
+
const cursor = params.cursor;
|
|
25
|
+
const start = cursor === undefined ? 0 : Number(cursor);
|
|
26
|
+
const slice = ALL_CONTACTS.slice(start, start + PAGE_SIZE);
|
|
27
|
+
const nextStart = start + PAGE_SIZE;
|
|
28
|
+
const hasMore = nextStart < ALL_CONTACTS.length;
|
|
29
|
+
return Effect.succeed((hasMore
|
|
30
|
+
? { contacts: slice, nextCursor: String(nextStart) }
|
|
31
|
+
: { contacts: slice }));
|
|
32
|
+
});
|
|
33
|
+
return { send, callCount: () => calls };
|
|
34
|
+
}
|
|
35
|
+
// Byzantine server: always claims "more" with the SAME cursor — the
|
|
36
|
+
// drain must terminate via the cycle guard rather than loop forever.
|
|
37
|
+
function nonAdvancingSendRpc() {
|
|
38
|
+
let calls = 0;
|
|
39
|
+
const send = ((_definition, _params) => {
|
|
40
|
+
calls++;
|
|
41
|
+
return Effect.succeed({
|
|
42
|
+
contacts: ALL_CONTACTS.slice(0, PAGE_SIZE),
|
|
43
|
+
nextCursor: CONSTANT_CURSOR,
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
return { send, callCount: () => calls };
|
|
47
|
+
}
|
|
48
|
+
function contactId(c) {
|
|
49
|
+
return c.id;
|
|
50
|
+
}
|
|
51
|
+
const EXPECTED_IDS = ALL_CONTACTS.map(contactId);
|
|
52
|
+
describe("drainPaginatedList", () => {
|
|
53
|
+
it("drains every page, following nextCursor to the tail", () => Effect.gen(function* () {
|
|
54
|
+
const fake = pagingSendRpc();
|
|
55
|
+
const contacts = yield* drainPaginatedList(fake.send, ContactsList, "contacts");
|
|
56
|
+
expect(contacts).toHaveLength(TOTAL);
|
|
57
|
+
const ids = contacts.map(contactId);
|
|
58
|
+
expect(ids).toEqual(EXPECTED_IDS);
|
|
59
|
+
// One RPC call per page — no over-fetch, no truncation.
|
|
60
|
+
expect(fake.callCount()).toBe(EXPECTED_PAGE_CALLS);
|
|
61
|
+
}));
|
|
62
|
+
it("fails with NonAdvancingCursorError on a repeated cursor (cycle guard)", () => Effect.gen(function* () {
|
|
63
|
+
const fake = nonAdvancingSendRpc();
|
|
64
|
+
const error = yield* drainPaginatedList(fake.send, ContactsList, "contacts").pipe(Effect.flip);
|
|
65
|
+
expect(error).toBeInstanceOf(NonAdvancingCursorError);
|
|
66
|
+
expect(error.method).toBe(ContactsList.name);
|
|
67
|
+
// Page 1 records cursor C; page 2 (sent with cursor=C) returns C
|
|
68
|
+
// again → already seen → typed fail. Bounded at 2 calls, no loop.
|
|
69
|
+
expect(fake.callCount()).toBe(2);
|
|
70
|
+
}));
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=pagination.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.test.js","sourceRoot":"","sources":["../src/pagination.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC;AAC3B,OAAO,EACL,YAAY,GAIb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,uBAAuB,GAExB,MAAM,iBAAiB,CAAC;AAEzB,sEAAsE;AACtE,uEAAuE;AACvE,yEAAyE;AACzE,yEAAyE;AACzE,uCAAuC;AAEvC,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,KAAK,GAAG,CAAC,CAAC;AAChB,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;AACzD,MAAM,eAAe,GAAG,cAAc,CAAC;AAMvC,MAAM,YAAY,GAA+B,KAAK,CAAC,IAAI,CACzD,EAAE,MAAM,EAAE,KAAK,EAAE,EACjB,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CACzC,CAAC;AAEF,uEAAuE;AACvE,qEAAqE;AACrE,sEAAsE;AACtE,SAAS,aAAa;IAIpB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,IAAI,GAAG,CAAC,CACZ,WAAc,EACd,MAAmB,EACgB,EAAE;QACrC,KAAK,EAAE,CAA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C,CAAC;AACR,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moltzap/client",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.528.0",
|
|
4
4
|
"description": "MoltZap client service — connection, conversation state, and cross-conversation context",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@effect/typeclass": "0.40.0",
|
|
49
49
|
"@sinclair/typebox": "^0.34.0",
|
|
50
50
|
"effect": "3.21.2",
|
|
51
|
-
"@moltzap/protocol": "2026.
|
|
51
|
+
"@moltzap/protocol": "2026.528.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@effect/vitest": "^0.29.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"tsx": "^4.19.0",
|
|
59
59
|
"typescript": "^5.7.0",
|
|
60
60
|
"vitest": "^3.0.0",
|
|
61
|
-
"@moltzap/server-core": "2026.
|
|
61
|
+
"@moltzap/server-core": "2026.528.0"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "tsc",
|