@ziggs-ai/ziggs-mcp 0.36.2 → 0.36.3

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/config.d.ts CHANGED
@@ -30,6 +30,17 @@ declare const envSchema: z.ZodObject<{
30
30
  * its process is its host.
31
31
  */
32
32
  ZIGGS_INSTANCE_ID: z.ZodOptional<z.ZodString>;
33
+ /**
34
+ * Workspaces this window reads, comma-separated org ids. Sent as
35
+ * `X-Ziggs-Workspaces`. Unset reads everything the assistant may read.
36
+ * A hosted connection sets the header on the MCP request instead; this
37
+ * process serves every window, so it must not take the list from the env.
38
+ */
39
+ ZIGGS_WORKSPACES: z.ZodOptional<z.ZodString>;
40
+ /** Label on the assistant page, such as "Claude Code". */
41
+ ZIGGS_APP: z.ZodOptional<z.ZodString>;
42
+ /** Person-readable window name. Unset becomes the app plus the time. */
43
+ ZIGGS_SESSION_NAME: z.ZodOptional<z.ZodString>;
33
44
  /** Set to 1/true/yes to register internal/debug-only MCP tools. */
34
45
  ZIGGS_MCP_DEBUG: z.ZodOptional<z.ZodString>;
35
46
  /**
@@ -47,6 +58,9 @@ declare const envSchema: z.ZodObject<{
47
58
  ZIGGS_OWNER_USER_ID?: string | undefined;
48
59
  ZIGGS_LANE_ID?: string | undefined;
49
60
  ZIGGS_INSTANCE_ID?: string | undefined;
61
+ ZIGGS_WORKSPACES?: string | undefined;
62
+ ZIGGS_APP?: string | undefined;
63
+ ZIGGS_SESSION_NAME?: string | undefined;
50
64
  ZIGGS_MCP_DEBUG?: string | undefined;
51
65
  ZIGGS_MCP_CORE_ONLY?: string | undefined;
52
66
  }, {
@@ -58,6 +72,9 @@ declare const envSchema: z.ZodObject<{
58
72
  ZIGGS_OWNER_USER_ID?: string | undefined;
59
73
  ZIGGS_LANE_ID?: string | undefined;
60
74
  ZIGGS_INSTANCE_ID?: string | undefined;
75
+ ZIGGS_WORKSPACES?: string | undefined;
76
+ ZIGGS_APP?: string | undefined;
77
+ ZIGGS_SESSION_NAME?: string | undefined;
61
78
  ZIGGS_MCP_DEBUG?: string | undefined;
62
79
  ZIGGS_MCP_CORE_ONLY?: string | undefined;
63
80
  }>;
package/dist/config.js CHANGED
@@ -32,6 +32,17 @@ const envSchema = z.object({
32
32
  * its process is its host.
33
33
  */
34
34
  ZIGGS_INSTANCE_ID: z.string().optional(),
35
+ /**
36
+ * Workspaces this window reads, comma-separated org ids. Sent as
37
+ * `X-Ziggs-Workspaces`. Unset reads everything the assistant may read.
38
+ * A hosted connection sets the header on the MCP request instead; this
39
+ * process serves every window, so it must not take the list from the env.
40
+ */
41
+ ZIGGS_WORKSPACES: z.string().optional(),
42
+ /** Label on the assistant page, such as "Claude Code". */
43
+ ZIGGS_APP: z.string().optional(),
44
+ /** Person-readable window name. Unset becomes the app plus the time. */
45
+ ZIGGS_SESSION_NAME: z.string().optional(),
35
46
  /** Set to 1/true/yes to register internal/debug-only MCP tools. */
36
47
  ZIGGS_MCP_DEBUG: z.string().optional(),
37
48
  /**
@@ -59,6 +70,9 @@ export function loadConfig() {
59
70
  ZIGGS_OWNER_USER_ID: process.env.ZIGGS_OWNER_USER_ID,
60
71
  ZIGGS_LANE_ID: process.env.ZIGGS_LANE_ID,
61
72
  ZIGGS_INSTANCE_ID: process.env.ZIGGS_INSTANCE_ID,
73
+ ZIGGS_WORKSPACES: process.env.ZIGGS_WORKSPACES,
74
+ ZIGGS_APP: process.env.ZIGGS_APP,
75
+ ZIGGS_SESSION_NAME: process.env.ZIGGS_SESSION_NAME,
62
76
  ZIGGS_MCP_DEBUG: process.env.ZIGGS_MCP_DEBUG,
63
77
  ZIGGS_MCP_CORE_ONLY: process.env.ZIGGS_MCP_CORE_ONLY,
64
78
  };
@@ -10,7 +10,12 @@ export declare function parseBearerAuthorization(header: string | string[] | und
10
10
  * a person who pasted their key, wrong for a delegate holding grants its
11
11
  * customer gave.
12
12
  */
13
- export declare function connectionFromBearer(bearer: string, httpBaseUrl: string, ownerUserId?: string, laneId?: string): {
13
+ export declare function connectionFromBearer(bearer: string, httpBaseUrl: string, ownerUserId?: string, laneId?: string, session?: {
14
+ clientSessionId?: string;
15
+ workspaceIds?: string;
16
+ app?: string;
17
+ sessionName?: string;
18
+ }): {
14
19
  creds: Creds;
15
20
  cfg: ZiggsMcpConfig;
16
21
  };
@@ -20,7 +20,7 @@ export function parseBearerAuthorization(header) {
20
20
  * a person who pasted their key, wrong for a delegate holding grants its
21
21
  * customer gave.
22
22
  */
23
- export function connectionFromBearer(bearer, httpBaseUrl, ownerUserId, laneId) {
23
+ export function connectionFromBearer(bearer, httpBaseUrl, ownerUserId, laneId, session) {
24
24
  const resolvedAgentId = resolveDelegateAgentId(bearer, undefined);
25
25
  if (httpBaseUrl) {
26
26
  process.env.HTTP_URL = httpBaseUrl;
@@ -61,6 +61,10 @@ export function connectionFromBearer(bearer, httpBaseUrl, ownerUserId, laneId) {
61
61
  agentId: resolvedAgentId,
62
62
  ...(laneId ? { laneId } : {}),
63
63
  ...(instanceId ? { instanceId } : {}),
64
+ ...(session?.clientSessionId ? { clientSessionId: session.clientSessionId } : {}),
65
+ ...(session?.workspaceIds ? { workspaceIds: session.workspaceIds } : {}),
66
+ ...(session?.app ? { app: session.app } : {}),
67
+ ...(session?.sessionName ? { sessionName: session.sessionName } : {}),
64
68
  },
65
69
  cfg,
66
70
  };
package/dist/creds.js CHANGED
@@ -10,5 +10,8 @@ export function credsFromConfig(cfg) {
10
10
  // stays up and wrong for one a scheduler respawns per run — that one pins
11
11
  // ZIGGS_INSTANCE_ID so every run is the same host.
12
12
  ...(cfg.ZIGGS_INSTANCE_ID ? { instanceId: cfg.ZIGGS_INSTANCE_ID } : {}),
13
+ ...(cfg.ZIGGS_WORKSPACES ? { workspaceIds: cfg.ZIGGS_WORKSPACES } : {}),
14
+ ...(cfg.ZIGGS_APP ? { app: cfg.ZIGGS_APP } : {}),
15
+ ...(cfg.ZIGGS_SESSION_NAME ? { sessionName: cfg.ZIGGS_SESSION_NAME } : {}),
13
16
  };
14
17
  }
package/dist/tools.js CHANGED
@@ -237,6 +237,14 @@ function registerConnectionTools(server, creds, cfg) {
237
237
  });
238
238
  registerCapability(server, requestConnectionCapability, creds);
239
239
  }
240
+ function inboxFor(creds) {
241
+ return new InboxClient(creds.operatorKey, creds.agentId, undefined, creds.instanceId, {
242
+ clientSessionId: creds.clientSessionId,
243
+ workspaceIds: creds.workspaceIds,
244
+ app: creds.app,
245
+ sessionName: creds.sessionName,
246
+ });
247
+ }
240
248
  export function registerZiggsTools(server, creds, cfg) {
241
249
  // A binding check and nothing else. This used to also report the
242
250
  // pending/active counts and point at a separate decisions tool for the card,
@@ -548,7 +556,7 @@ export function registerZiggsTools(server, creds, cfg) {
548
556
  .describe('Hold up to this many seconds (the server clamps a hold at about 110) and return as soon as assigned mail exists. Omit for an immediate count. Still does not take the lease. To wait for a reply your person asked about, call ziggs_inbox with waitSeconds: 55 instead, since only the full read returns the mail.'),
549
557
  }, readOnly('Peek inbox count without taking the mailbox'), async ({ waitSeconds }) => {
550
558
  try {
551
- const client = new InboxClient(creds.operatorKey, creds.agentId, undefined, creds.instanceId);
559
+ const client = inboxFor(creds);
552
560
  const [bindingSettled, readsSettled, peekSettled] = await Promise.allSettled([
553
561
  loadSessionBinding(creds, cfg),
554
562
  loadSessionReads(creds),
@@ -609,7 +617,7 @@ export function registerZiggsTools(server, creds, cfg) {
609
617
  try {
610
618
  // Unset on stdio: that process IS the host, and a scheduler that
611
619
  // respawns it per run pins ZIGGS_INSTANCE_ID instead.
612
- const client = new InboxClient(creds.operatorKey, creds.agentId, undefined, creds.instanceId);
620
+ const client = inboxFor(creds);
613
621
  // A cold call is the session start, and its extra reads — the binding
614
622
  // and the active-task rows — take nothing from the envelope. Started
615
623
  // here, they ride the same wave as the inbox fetch
@@ -707,7 +715,7 @@ export function registerZiggsTools(server, creds, cfg) {
707
715
  if (isDirectorySurface(server)) {
708
716
  registerStrictTool(server, 'ziggs_inbox_claim', {}, destructive('Claim the inbox for this worker'), async () => {
709
717
  try {
710
- const client = new InboxClient(creds.operatorKey, creds.agentId, undefined, creds.instanceId);
718
+ const client = inboxFor(creds);
711
719
  return compactTextResult(await client.getInbox());
712
720
  }
713
721
  catch (e) {
@@ -732,7 +740,7 @@ export function registerZiggsTools(server, creds, cfg) {
732
740
  try {
733
741
  // Same host identity as the read: acking renews an owner, and only a
734
742
  // read acquires one.
735
- const client = new InboxClient(creds.operatorKey, creds.agentId, undefined, creds.instanceId);
743
+ const client = inboxFor(creds);
736
744
  const acked = await client.ackOrTakeHost(ack, {
737
745
  handledResourceIds: handledResourceIds ?? [],
738
746
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/ziggs-mcp",
3
- "version": "0.36.2",
3
+ "version": "0.36.3",
4
4
  "description": "MCP server for Claude Code, Cursor, and other MCP hosts — act as your Ziggs delegate agent",
5
5
  "type": "module",
6
6
  "bin": {
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@modelcontextprotocol/sdk": "^1.29.0",
43
- "@ziggs-ai/api-client": "0.36.0",
43
+ "@ziggs-ai/api-client": "0.36.1",
44
44
  "dotenv": "^16.6.1",
45
45
  "zod": "^3.24.2",
46
46
  "zod-to-json-schema": "^3.25.1"