@lobu/client 9.4.0 → 10.0.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/client.js CHANGED
@@ -17,7 +17,7 @@ export class Lobu {
17
17
  createSession(input) {
18
18
  return this.rest
19
19
  .createSession(input)
20
- .then((response) => new AgentSession(this.rest, response));
20
+ .then((response) => new AgentSession(this.rest, response, input));
21
21
  }
22
22
  }
23
23
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,OAAO,IAAI;IACN,IAAI,CAAiB;IACrB,QAAQ,CAEf;IAEF,YAAY,OAA0B;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,cAAc,CAAC;YAC7B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;YACzD,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG;YACd,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;SAC7C,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,KAA2B;QACvC,OAAO,IAAI,CAAC,IAAI;aACb,aAAa,CAAC,KAAK,CAAC;aACpB,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC/D,CAAC;CACF"}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,OAAO,IAAI;IACN,IAAI,CAAiB;IACrB,QAAQ,CAEf;IAEF,YAAY,OAA0B;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,cAAc,CAAC;YAC7B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;YACzD,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG;YACd,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;SAC7C,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,KAA2B;QACvC,OAAO,IAAI,CAAC,IAAI;aACb,aAAa,CAAC,KAAK,CAAC;aACpB,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;IACtE,CAAC;CACF"}
package/dist/errors.d.ts CHANGED
@@ -4,4 +4,13 @@ export declare class LobuApiError extends Error {
4
4
  readonly response: Response;
5
5
  constructor(response: Response, body: unknown);
6
6
  }
7
+ /**
8
+ * Thrown by {@link AgentSession.ask} when the agent reports an error for the
9
+ * message being awaited (an `error`/`agent-error` SSE event). Distinct from
10
+ * {@link LobuApiError}, which signals an HTTP-transport failure.
11
+ */
12
+ export declare class LobuAgentError extends Error {
13
+ readonly messageId: string | undefined;
14
+ constructor(message: string, messageId?: string);
15
+ }
7
16
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAEhB,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO;CAc9C"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAEhB,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO;CAc9C;AAED;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;gBAE3B,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;CAKhD"}
package/dist/errors.js CHANGED
@@ -16,4 +16,17 @@ export class LobuApiError extends Error {
16
16
  this.response = response;
17
17
  }
18
18
  }
19
+ /**
20
+ * Thrown by {@link AgentSession.ask} when the agent reports an error for the
21
+ * message being awaited (an `error`/`agent-error` SSE event). Distinct from
22
+ * {@link LobuApiError}, which signals an HTTP-transport failure.
23
+ */
24
+ export class LobuAgentError extends Error {
25
+ messageId;
26
+ constructor(message, messageId) {
27
+ super(message);
28
+ this.name = "LobuAgentError";
29
+ this.messageId = messageId;
30
+ }
31
+ }
19
32
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC5B,MAAM,CAAS;IACf,IAAI,CAAU;IACd,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IAC9B,SAAS,CAAqB;IAEvC,YAAY,OAAe,EAAE,SAAkB;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * as generated from "./generated/index.js";
2
2
  export { Lobu } from "./client.js";
3
- export { LobuApiError } from "./errors.js";
3
+ export { LobuAgentError, LobuApiError } from "./errors.js";
4
4
  export { AgentSession } from "./session.js";
5
- export type { CreateSessionRequest, CreateSessionResponse, LobuClientOptions, LobuFetch, LobuHeaders, LobuSseEvent, SendMessageOptions, SendMessageResponse, StreamEventsOptions, TokenProvider, } from "./types.js";
5
+ export type { AskOptions, AskResult, CreateSessionRequest, CreateSessionResponse, LobuAgentEvent, LobuClientOptions, LobuCompleteData, LobuConnectedData, LobuErrorData, LobuFetch, LobuHeaders, LobuOutputData, LobuPingData, LobuSseEvent, SendMessageOptions, SendMessageResponse, StreamEventsOptions, TokenProvider, } from "./types.js";
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACd,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EACV,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,WAAW,EACX,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACd,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * as generated from "./generated/index.js";
2
2
  export { Lobu } from "./client.js";
3
- export { LobuApiError } from "./errors.js";
3
+ export { LobuAgentError, LobuApiError } from "./errors.js";
4
4
  export { AgentSession } from "./session.js";
5
5
  //# 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,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
package/dist/session.d.ts CHANGED
@@ -1,23 +1,54 @@
1
1
  import type { LobuRestClient } from "./rest.js";
2
- import type { CreateSessionResponse, LobuSseEvent, SendMessageOptions, SendMessageResponse, StreamEventsOptions } from "./types.js";
2
+ import type { AskOptions, AskResult, CreateSessionRequest, CreateSessionResponse, LobuAgentEvent, LobuSseEvent, SendMessageOptions, SendMessageResponse, StreamEventsOptions } from "./types.js";
3
3
  export declare class AgentSession {
4
4
  private readonly rest;
5
- readonly agentId: string;
6
- readonly token: string;
7
- readonly expiresAt: number;
8
5
  /**
9
- * The send/stream endpoints the server advertised for this session. `send`
10
- * and `events` below route through the configured `baseUrl` + this session's
11
- * `agentId` (the generated REST client is path-templated), which matches the
12
- * server's same-origin URLs. These fields are surfaced for callers that need
13
- * the exact server-advertised endpoints (e.g. a different public origin); a
14
- * future server that advertised a divergent origin/path would require routing
15
- * through them directly — tracked as a follow-up.
6
+ * Server-side conversation/routing id (`${agentId}_${userId}_${thread}`).
7
+ * `send`/`events`/`ask` route on this. It is **not** the logical agent id you
8
+ * passed to `createSession` that one is echoed back in the `connected`
9
+ * event's `data.agentId`.
10
+ */
11
+ readonly conversationId: string;
12
+ /**
13
+ * SSE/messages endpoints the server advertised for this session (stable
14
+ * across refresh). `send`/`events`/`ask` route through `baseUrl` +
15
+ * `conversationId` (the generated client is path-templated), which matches
16
+ * the server's same-origin URLs. These are surfaced for callers that need the
17
+ * exact advertised endpoints (e.g. a server on a different public origin);
18
+ * routing through a divergent origin directly is a follow-up.
16
19
  */
17
20
  readonly sseUrl: string;
18
21
  readonly messagesUrl: string;
19
- constructor(rest: LobuRestClient, response: CreateSessionResponse);
22
+ private _token;
23
+ private _expiresAt;
24
+ private readonly request;
25
+ constructor(rest: LobuRestClient, response: CreateSessionResponse, request: CreateSessionRequest);
26
+ /** Current session (worker) token. Updated in place by {@link refresh}. */
27
+ get token(): string;
28
+ /** Unix epoch ms when {@link token} expires (24h TTL). */
29
+ get expiresAt(): number;
20
30
  send(content: string, options?: SendMessageOptions): Promise<SendMessageResponse>;
21
- events<TData = unknown>(options?: StreamEventsOptions): AsyncIterable<LobuSseEvent<TData>>;
31
+ events(options?: StreamEventsOptions): AsyncIterable<LobuAgentEvent>;
32
+ events<TData>(options?: StreamEventsOptions): AsyncIterable<LobuSseEvent<TData>>;
33
+ /**
34
+ * Re-mint this session's token without losing the conversation. Re-runs the
35
+ * original create-session request against the resume path (`forceNew: false`)
36
+ * and updates {@link token}/{@link expiresAt} in place. Tokens have a 24h TTL;
37
+ * call this before {@link expiresAt} for a long-lived chat. Manual by
38
+ * design — there is no background auto-renew.
39
+ */
40
+ refresh(): Promise<this>;
41
+ /**
42
+ * Send a message and await the agent's reply. Resolves with the concatenated
43
+ * text on the `complete` event for this message; rejects with
44
+ * {@link LobuAgentError} on `error`/`agent-error`. Convenience over
45
+ * `send` + `events` for request/response use.
46
+ *
47
+ * Delivery rides the SSE stream. Under a multi-replica deployment where
48
+ * API/SSE events are not owner-routed, `ask` can time out even though the
49
+ * agent finished — single-replica and local runs are reliable. Use
50
+ * `send` + your own `events` consumer if you need finer control.
51
+ */
52
+ ask(content: string, options?: AskOptions): Promise<AskResult>;
22
53
  }
23
54
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,qBAAa,YAAY;IAiBrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAhBvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,EAAE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AAM,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,aAAa,CAAC,cAAc,CAAC;IACpE,MAAM,CAAC,KAAK,EACV,OAAO,CAAC,EAAE,mBAAmB,GAC5B,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAOrC;;;;;;OAMG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAU9B;;;;;;;;;;OAUG;IACG,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,SAAS,CAAC;CAqDzE"}
package/dist/session.js CHANGED
@@ -1,32 +1,133 @@
1
+ import { LobuAgentError } from "./errors.js";
2
+ function newMessageId() {
3
+ return (globalThis.crypto?.randomUUID?.() ??
4
+ `msg_${Date.now()}_${Math.random().toString(36).slice(2)}`);
5
+ }
1
6
  export class AgentSession {
2
7
  rest;
3
- agentId;
4
- token;
5
- expiresAt;
6
8
  /**
7
- * The send/stream endpoints the server advertised for this session. `send`
8
- * and `events` below route through the configured `baseUrl` + this session's
9
- * `agentId` (the generated REST client is path-templated), which matches the
10
- * server's same-origin URLs. These fields are surfaced for callers that need
11
- * the exact server-advertised endpoints (e.g. a different public origin); a
12
- * future server that advertised a divergent origin/path would require routing
13
- * through them directly — tracked as a follow-up.
9
+ * Server-side conversation/routing id (`${agentId}_${userId}_${thread}`).
10
+ * `send`/`events`/`ask` route on this. It is **not** the logical agent id you
11
+ * passed to `createSession` that one is echoed back in the `connected`
12
+ * event's `data.agentId`.
13
+ */
14
+ conversationId;
15
+ /**
16
+ * SSE/messages endpoints the server advertised for this session (stable
17
+ * across refresh). `send`/`events`/`ask` route through `baseUrl` +
18
+ * `conversationId` (the generated client is path-templated), which matches
19
+ * the server's same-origin URLs. These are surfaced for callers that need the
20
+ * exact advertised endpoints (e.g. a server on a different public origin);
21
+ * routing through a divergent origin directly is a follow-up.
14
22
  */
15
23
  sseUrl;
16
24
  messagesUrl;
17
- constructor(rest, response) {
25
+ _token;
26
+ _expiresAt;
27
+ request;
28
+ constructor(rest, response, request) {
18
29
  this.rest = rest;
19
- this.agentId = response.agentId;
20
- this.token = response.token;
21
- this.expiresAt = response.expiresAt;
30
+ this.conversationId = response.agentId;
31
+ this._token = response.token;
32
+ this._expiresAt = response.expiresAt;
22
33
  this.sseUrl = response.sseUrl;
23
34
  this.messagesUrl = response.messagesUrl;
35
+ // Defensive deep copy: refresh replays this request, so the caller mutating
36
+ // their object afterwards must not change what we re-send.
37
+ this.request = structuredClone(request);
38
+ }
39
+ /** Current session (worker) token. Updated in place by {@link refresh}. */
40
+ get token() {
41
+ return this._token;
42
+ }
43
+ /** Unix epoch ms when {@link token} expires (24h TTL). */
44
+ get expiresAt() {
45
+ return this._expiresAt;
24
46
  }
25
47
  send(content, options) {
26
- return this.rest.sendMessage(this.agentId, this.token, content, options);
48
+ return this.rest.sendMessage(this.conversationId, this._token, content, options);
27
49
  }
28
50
  events(options = {}) {
29
- return this.rest.streamEvents(this.agentId, this.token, options);
51
+ return this.rest.streamEvents(this.conversationId, this._token, options);
52
+ }
53
+ /**
54
+ * Re-mint this session's token without losing the conversation. Re-runs the
55
+ * original create-session request against the resume path (`forceNew: false`)
56
+ * and updates {@link token}/{@link expiresAt} in place. Tokens have a 24h TTL;
57
+ * call this before {@link expiresAt} for a long-lived chat. Manual by
58
+ * design — there is no background auto-renew.
59
+ */
60
+ async refresh() {
61
+ const response = await this.rest.createSession({
62
+ ...this.request,
63
+ forceNew: false,
64
+ });
65
+ this._token = response.token;
66
+ this._expiresAt = response.expiresAt;
67
+ return this;
68
+ }
69
+ /**
70
+ * Send a message and await the agent's reply. Resolves with the concatenated
71
+ * text on the `complete` event for this message; rejects with
72
+ * {@link LobuAgentError} on `error`/`agent-error`. Convenience over
73
+ * `send` + `events` for request/response use.
74
+ *
75
+ * Delivery rides the SSE stream. Under a multi-replica deployment where
76
+ * API/SSE events are not owner-routed, `ask` can time out even though the
77
+ * agent finished — single-replica and local runs are reliable. Use
78
+ * `send` + your own `events` consumer if you need finer control.
79
+ */
80
+ async ask(content, options = {}) {
81
+ const messageId = options.messageId ?? newMessageId();
82
+ const controller = new AbortController();
83
+ const onAbort = () => controller.abort();
84
+ options.signal?.addEventListener("abort", onAbort, { once: true });
85
+ if (options.signal?.aborted)
86
+ controller.abort();
87
+ const timeoutMs = options.timeoutMs ?? 120_000;
88
+ let timedOut = false;
89
+ const timer = setTimeout(() => {
90
+ timedOut = true;
91
+ controller.abort();
92
+ }, timeoutMs);
93
+ let text = "";
94
+ let sent = false;
95
+ try {
96
+ for await (const event of this.events({ signal: controller.signal })) {
97
+ // Send only after the `connected` handshake so the SSE request is open
98
+ // before the message is enqueued — otherwise the reply can outrun our
99
+ // subscription. Backlog replay only covers the same pod (see JSDoc).
100
+ if (event.event === "connected") {
101
+ if (!sent) {
102
+ sent = true;
103
+ await this.send(content, { messageId });
104
+ }
105
+ continue;
106
+ }
107
+ if (event.event === "output" && event.data.messageId === messageId) {
108
+ text += event.data.content;
109
+ }
110
+ else if (event.event === "complete" &&
111
+ (event.data.messageId === messageId ||
112
+ event.data.processedMessageIds?.includes(messageId))) {
113
+ return { text, messageId };
114
+ }
115
+ else if ((event.event === "error" || event.event === "agent-error") &&
116
+ event.data.messageId === messageId) {
117
+ throw new LobuAgentError(event.data.error, messageId);
118
+ }
119
+ }
120
+ if (options.signal?.aborted)
121
+ throw new Error("ask() aborted");
122
+ if (timedOut)
123
+ throw new Error(`ask() timed out after ${timeoutMs}ms`);
124
+ throw new Error("ask() stream ended before completion");
125
+ }
126
+ finally {
127
+ clearTimeout(timer);
128
+ controller.abort();
129
+ options.signal?.removeEventListener("abort", onAbort);
130
+ }
30
131
  }
31
132
  }
32
133
  //# sourceMappingURL=session.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,YAAY;IAiBJ;IAhBV,OAAO,CAAS;IAChB,KAAK,CAAS;IACd,SAAS,CAAS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equest {
15
15
  model?: string;
16
16
  forceNew?: boolean;
17
17
  dryRun?: boolean;
18
+ /**
19
+ * Server-trusted: the worker's egress allowlist/blocklist. Mint sessions
20
+ * **server-side** — do not let an untrusted browser pick its own network
21
+ * policy.
22
+ */
18
23
  networkConfig?: {
19
24
  allowedDomains?: string[];
20
25
  deniedDomains?: string[];
21
26
  };
27
+ /**
28
+ * Server-trusted: MCP servers the worker may reach. Mint sessions
29
+ * **server-side** — do not let an untrusted browser inject MCP servers.
30
+ */
22
31
  mcpServers?: Record<string, {
23
32
  url?: string;
24
33
  type?: "sse" | "streamable-http" | "stdio";
@@ -28,6 +37,10 @@ export interface CreateSessionRequest {
28
37
  headers?: Record<string, string>;
29
38
  description?: string;
30
39
  }>;
40
+ /**
41
+ * Server-trusted: nix packages provisioned into the worker runtime. Mint
42
+ * sessions **server-side** — do not let an untrusted browser pick packages.
43
+ */
31
44
  nix?: {
32
45
  flakeUrl?: string;
33
46
  packages?: string[];
@@ -59,6 +72,89 @@ export interface LobuSseEvent<TData = unknown> {
59
72
  id?: string;
60
73
  retry?: number;
61
74
  }
75
+ /** `connected` payload. `agentId` is the *logical* agent id, not the session's conversation id. */
76
+ export interface LobuConnectedData {
77
+ agentId: string;
78
+ timestamp: number;
79
+ }
80
+ /** `output` payload: an incremental text delta from the agent. */
81
+ export interface LobuOutputData {
82
+ type: "delta";
83
+ content: string;
84
+ timestamp: number;
85
+ messageId?: string;
86
+ }
87
+ /** `complete` payload: the agent finished a turn. May settle several messages at once. */
88
+ export interface LobuCompleteData {
89
+ type: "complete";
90
+ messageId?: string;
91
+ processedMessageIds?: string[];
92
+ timestamp: number;
93
+ }
94
+ /** `error`/`agent-error` payload. */
95
+ export interface LobuErrorData {
96
+ type: "error";
97
+ error: string;
98
+ messageId?: string;
99
+ timestamp: number;
100
+ }
101
+ /** `ping` heartbeat payload. */
102
+ export interface LobuPingData {
103
+ timestamp: number;
104
+ }
105
+ interface LobuSseEnvelope {
106
+ id?: string;
107
+ retry?: number;
108
+ }
109
+ /**
110
+ * Discriminated union of the agent SSE stream. The union is **closed** so that
111
+ * matching on `event` narrows `data`. The richer interactive events
112
+ * (`question`, `tool-approval`, …) are present by name with `unknown` data; to
113
+ * type one yourself, pass an explicit payload type to `events<TData>()`.
114
+ */
115
+ export type LobuAgentEvent = (LobuSseEnvelope & {
116
+ event: "connected";
117
+ data: LobuConnectedData;
118
+ }) | (LobuSseEnvelope & {
119
+ event: "output";
120
+ data: LobuOutputData;
121
+ }) | (LobuSseEnvelope & {
122
+ event: "complete";
123
+ data: LobuCompleteData;
124
+ }) | (LobuSseEnvelope & {
125
+ event: "error";
126
+ data: LobuErrorData;
127
+ }) | (LobuSseEnvelope & {
128
+ event: "agent-error";
129
+ data: LobuErrorData;
130
+ }) | (LobuSseEnvelope & {
131
+ event: "ping";
132
+ data: LobuPingData;
133
+ }) | (LobuSseEnvelope & {
134
+ event: "status" | "ephemeral" | "question" | "link-button" | "tool-approval" | "suggestion" | "closed" | "stale";
135
+ data: unknown;
136
+ });
137
+ export interface AskOptions {
138
+ /**
139
+ * Correlation id for this turn. Defaults to a fresh random id. Must be unique
140
+ * per call — `ask` resolves/rejects only on the terminal event carrying this
141
+ * id, so reusing an id can resolve from a prior turn replayed via backlog.
142
+ */
143
+ messageId?: string;
144
+ /** Abort the wait (and the underlying message send) early. */
145
+ signal?: AbortSignal;
146
+ /**
147
+ * Reject if no terminal `complete` for this message arrives within this many
148
+ * milliseconds. Defaults to 120000 (2 minutes).
149
+ */
150
+ timeoutMs?: number;
151
+ }
152
+ export interface AskResult {
153
+ /** Concatenated `output` deltas for this message. */
154
+ text: string;
155
+ /** The correlation id used (echo of `AskOptions.messageId` or the generated one). */
156
+ messageId: string;
157
+ }
62
158
  export interface StreamEventsOptions {
63
159
  signal?: AbortSignal;
64
160
  headers?: LobuHeaders;
@@ -70,4 +166,5 @@ export interface StreamEventsOptions {
70
166
  */
71
167
  maxRetryAttempts?: number;
72
168
  }
169
+ export {};
73
170
  //#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IACZ,IAAI,EAAE,OAAO,CAAC;CACf,CAAC,CAAC;AAEP,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/client",
3
- "version": "9.4.0",
3
+ "version": "10.0.0",
4
4
  "description": "TypeScript client for the Lobu Agent API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",