@ziggs-ai/api-client 0.19.0 → 0.20.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.
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Who this session is, who it represents, and whether it can continue
3
+ * unattended. Built from the binding the caller already has. Does not
4
+ * read mail and does not take the inbox lease.
5
+ */
6
+ const PEEK = {
7
+ tool: 'ziggs_inbox_peek',
8
+ http: { method: 'GET', path: '/inbox/peek' },
9
+ };
10
+ /**
11
+ * Facts a cold entry needs that `session.ownerId` never labelled: the
12
+ * represented person, whether this host can arm a wake, and who drives ack.
13
+ */
14
+ export function sessionOrientation(input) {
15
+ const mcp = input.surface === 'mcp';
16
+ return {
17
+ representedPerson: {
18
+ id: input.ownerUserId,
19
+ kind: 'user',
20
+ },
21
+ continuation: mcp
22
+ ? {
23
+ kind: 'manual',
24
+ canScheduleWake: false,
25
+ summary: 'This MCP session has no wake_at. Continue by calling ziggs_inbox again — a scheduler in the host is the only unattended path.',
26
+ }
27
+ : {
28
+ kind: 'scheduled',
29
+ canScheduleWake: true,
30
+ summary: 'The hosted runtime can arm wake_at. The brain does not ack; the host owns the inbox loop.',
31
+ },
32
+ inboxHandling: {
33
+ ackDriver: mcp ? 'agent' : 'host',
34
+ readAcquiresHost: true,
35
+ peekDoesNotAcquire: true,
36
+ peek: PEEK,
37
+ },
38
+ identity: {
39
+ agentId: input.agentId,
40
+ distinctFromBackgroundWorker: true,
41
+ },
42
+ };
43
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/api-client",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "HTTP and WebSocket client for the Ziggs backend API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",