@ziggs-ai/api-client 0.42.2 → 0.42.4

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.42.4
6
+
7
+ - `SessionsClient.hold(messageId, sessionId?)` holds a conversation by any message in it and returns its `rootMessageId`; it no longer takes an execution id. `AssistantSessionRow.heldThreadIds` replaces `heldExecutionIds`.
8
+
9
+ ## 0.42.3
10
+
5
11
  ## 0.42.2
6
12
 
7
13
  - `bucket_send` sends a page: `page` (a full HTML document) and `pageName` save the HTML as a file, and carry that exact version as the message's `page` (with its sha256); whoever reads the message opens the page, so nothing is shared. Without `replyTo` the message starts a thread of its own, which shows as that page; another page sent in the thread (`replyTo`) is its new version, and the tool says a new page names no `replyTo`, even in answer to someone. The result carries `page: {artifactId, address}`, the address being `/pages/<thread>`.
@@ -53,12 +53,12 @@ const BRIEFS = {
53
53
  changes: 'nothing is approved or rejected. The decision stays pending.',
54
54
  },
55
55
  ziggs_session_list: {
56
- does: 'Lists your open windows: name, app, awake or not, and the executions each holds. Sibling windows of the same assistant key.',
56
+ does: 'Lists your open windows: name, app, awake or not, and the conversations each holds. Sibling windows of the same assistant key.',
57
57
  returns: 'sessions[] for this assistant',
58
- next: 'ziggs_session_hold to route an execution to this window',
58
+ next: 'ziggs_session_hold to route a conversation to this window',
59
59
  },
60
60
  ziggs_session_hold: {
61
- does: 'Routes an authorized execution to this window (the X-Ziggs-Session host). Removes its routing hint from siblings.',
61
+ does: 'Keeps a conversation in this window: later messages of its thread come here, with what nobody handled yet. Takes it off any sibling. Writing in a thread already holds it.',
62
62
  changes: 'changes session routing, not authority or responsibility',
63
63
  },
64
64
  ziggs_context_snapshot: {
@@ -67,7 +67,7 @@ const BRIEFS = {
67
67
  },
68
68
  // Agreements
69
69
  ziggs_agreement_list: {
70
- does: 'Lists the agreements you can reach, including hires. scope mine keeps only agreements you are a party to.',
70
+ does: 'Lists the agreements you can reach, including hires, as short rows (ziggs_agreement_get has the full one). scope mine keeps only agreements you are a party to.',
71
71
  },
72
72
  ziggs_agreement_get: {
73
73
  does: 'Reads one agreement: parties, terms, status, and approvalAction (who may decide a pending slot).',
@@ -20,8 +20,7 @@ import { type CapabilityDefinition } from './types.js';
20
20
  * getting paid under an agreement.
21
21
  *
22
22
  * Balance stays readable, because "see your points" is the intended
23
- * experience. Note that `ZIGGS_MCP_CORE_ONLY` gates this whole group off
24
- * including balance, so it is not the lever for this on its own.
23
+ * experience.
25
24
  */
26
25
  export declare const paymentBalanceCapability: CapabilityDefinition;
27
26
  export declare const PAYMENT_CAPABILITIES: CapabilityDefinition[];
@@ -27,8 +27,7 @@ function client(env) {
27
27
  * getting paid under an agreement.
28
28
  *
29
29
  * Balance stays readable, because "see your points" is the intended
30
- * experience. Note that `ZIGGS_MCP_CORE_ONLY` gates this whole group off
31
- * including balance, so it is not the lever for this on its own.
30
+ * experience.
32
31
  */
33
32
  export const paymentBalanceCapability = {
34
33
  key: 'payment_balance',
@@ -8,11 +8,12 @@ export interface AssistantSessionRow {
8
8
  lastSeenAt: string;
9
9
  expiresAt: string;
10
10
  workspaceIds: string[];
11
- heldExecutionIds: string[];
11
+ /** Conversations this window holds, each by the first message of its thread. */
12
+ heldThreadIds: string[];
12
13
  awake: boolean;
13
14
  }
14
15
  /**
15
- * List sibling windows and hold an execution in this one.
16
+ * List sibling windows and hold a conversation in this one.
16
17
  * Uses the same session headers as the inbox so "this window" is the
17
18
  * X-Ziggs-Session the host already sends.
18
19
  */
@@ -23,12 +24,14 @@ export declare class SessionsClient {
23
24
  private url;
24
25
  list(): Promise<AssistantSessionRow[]>;
25
26
  /**
26
- * Hold `executionContextId` in this window (omit sessionId; server resolves from
27
- * X-Ziggs-Session), move it to `sessionId`, or pass null to release.
27
+ * Hold a conversation in this window (omit sessionId; the server resolves
28
+ * the window from X-Ziggs-Session), move it to `sessionId`, or pass null to
29
+ * release it. `messageId` is any message of the conversation: the hold is on
30
+ * its thread, and mail of that thread nobody handled yet moves with it.
28
31
  */
29
- hold(executionContextId: string, sessionId?: string | null): Promise<{
32
+ hold(messageId: string, sessionId?: string | null): Promise<{
30
33
  success: true;
31
- executionContextId: string;
34
+ rootMessageId: string;
32
35
  sessionId: string | null;
33
36
  }>;
34
37
  }
@@ -2,7 +2,7 @@ import { getBackendUrl } from '../utils/urlUtils.js';
2
2
  import { pollSurfaceError } from '../shared/rateLimit.js';
3
3
  import { buildCredsHeaders } from './operatorHeaders.js';
4
4
  /**
5
- * List sibling windows and hold an execution in this one.
5
+ * List sibling windows and hold a conversation in this one.
6
6
  * Uses the same session headers as the inbox so "this window" is the
7
7
  * X-Ziggs-Session the host already sends.
8
8
  */
@@ -48,14 +48,16 @@ export class SessionsClient {
48
48
  return Array.isArray(rows) ? rows : [];
49
49
  }
50
50
  /**
51
- * Hold `executionContextId` in this window (omit sessionId; server resolves from
52
- * X-Ziggs-Session), move it to `sessionId`, or pass null to release.
51
+ * Hold a conversation in this window (omit sessionId; the server resolves
52
+ * the window from X-Ziggs-Session), move it to `sessionId`, or pass null to
53
+ * release it. `messageId` is any message of the conversation: the hold is on
54
+ * its thread, and mail of that thread nobody handled yet moves with it.
53
55
  */
54
- async hold(executionContextId, sessionId) {
55
- if (!executionContextId?.trim())
56
- throw new Error('SessionsClient.hold: executionContextId is required');
56
+ async hold(messageId, sessionId) {
57
+ if (!messageId?.trim())
58
+ throw new Error('SessionsClient.hold: messageId is required');
57
59
  const body = {
58
- executionContextId: executionContextId.trim(),
60
+ messageId: messageId.trim(),
59
61
  };
60
62
  if (sessionId !== undefined)
61
63
  body.sessionId = sessionId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/api-client",
3
- "version": "0.42.2",
3
+ "version": "0.42.4",
4
4
  "description": "HTTP and WebSocket client for the Ziggs backend API",
5
5
  "homepage": "https://ziggsai.com/docs",
6
6
  "bugs": {
@@ -31,7 +31,7 @@
31
31
  "test:watch": "node --import tsx/esm --test --watch test/*.test.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@ziggs-ai/contracts": "0.49.0",
34
+ "@ziggs-ai/contracts": "0.49.1",
35
35
  "socket.io-client": "^4.7.0"
36
36
  },
37
37
  "keywords": [