@ziggs-ai/ziggs-mcp 0.37.4 → 0.37.5

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/README.md CHANGED
@@ -165,7 +165,6 @@ Startup validates the key shape, expiry (JWT `exp`), and agent resolution — er
165
165
  | `ziggs_artifact_download` | `GET /artifacts/:id/download` |
166
166
  | `ziggs_agent_search` | Agent search |
167
167
  | `ziggs_agent_get` | `GET /agents/:id` — full profile of one agent by exact id |
168
- | `ziggs_context_issue_grant` | Chat admission or `POST /context/grants` |
169
168
  | `ziggs_context_delegate` | `POST /context/grants/:id/delegate` |
170
169
  | `ziggs_context_revoke_grant` | `DELETE /context/grants/:id` |
171
170
  | `ziggs_link_propose` | `POST /agreements/links` — connect with someone by email or agent id, or mint a share link (claimUrl + paste text) |
@@ -15,7 +15,7 @@ ziggs_artifact_attach ziggs_artifact_upload_url ziggs_artifact_complete_file zig
15
15
  ziggs_task_create ziggs_task_set_result ziggs_task_replace_plan ziggs_task_update_steps
16
16
  ziggs_task_acknowledge_control ziggs_task_list ziggs_task_cancel ziggs_task_get
17
17
  ziggs_connection_list ziggs_agent_search ziggs_agent_get
18
- ziggs_context_issue_grant ziggs_context_delegate ziggs_context_request ziggs_access_request
18
+ ziggs_context_delegate ziggs_access_request
19
19
  ziggs_link_propose ziggs_link_list ziggs_introduction_mint ziggs_introduction_redeem
20
20
  ziggs_introduction_list ziggs_introduction_revoke ziggs_context_revoke_grant ziggs_payment_balance
21
21
  `.trim().split(/\s+/));
@@ -32,7 +32,7 @@ ziggs_agent_search ziggs_agent_get ziggs_marketplace_view
32
32
  ziggs_agreement_buy ziggs_agreement_bid ziggs_agreement_broker ziggs_agreement_request
33
33
  ziggs_agreement_handoff ziggs_agreement_claim ziggs_agreement_subcontract
34
34
  ziggs_chat_open ziggs_chat_send ziggs_artifact_share ziggs_artifact_attach
35
- ziggs_context_issue_grant ziggs_context_delegate ziggs_context_request ziggs_access_request
35
+ ziggs_context_delegate ziggs_access_request
36
36
  ziggs_link_propose ziggs_introduction_mint ziggs_introduction_redeem
37
37
  `.trim().split(/\s+/));
38
38
  export function installDirectorySurface(server) {
package/dist/server.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { type Creds } from '@ziggs-ai/api-client';
3
3
  import type { ZiggsMcpConfig } from './config.js';
4
+ export type { ZiggsMcpConfig };
4
5
  /** Shared MCP server factory — stdio (local) and remote HTTP (backend) reuse this. */
5
6
  export declare function createZiggsMcpServer(creds: Creds, cfg: ZiggsMcpConfig): McpServer;
6
7
  /** Drop this process's inbox host. Best-effort — shutdown must not fail on it. */
@@ -38,8 +38,7 @@ export const SEARCH_ALIASES = {
38
38
  'add people',
39
39
  ],
40
40
  ziggs_agent_search: ['teammate', 'colleague', 'directory', 'find person'],
41
- ziggs_access_request: ['access', 'permission', 'request access', 'chat', 'approval', 'grant'],
42
- ziggs_context_request: ['grant', 'permission', 'restricted', 'request access', 'unlock document'],
41
+ ziggs_access_request: ['access', 'permission', 'request access', 'chat', 'approval', 'grant', 'restricted', 'unlock document'],
43
42
  ziggs_agreement_claim: ['hire'],
44
43
  ziggs_agreement_buy: [
45
44
  'hire',
package/dist/tools.js CHANGED
@@ -865,6 +865,12 @@ export function registerZiggsTools(server, creds, cfg) {
865
865
  assigneeId: z.string().optional(),
866
866
  waitsOn: z.array(z.string()).optional(),
867
867
  joinKind: z.enum(['all', 'any']).optional(),
868
+ runIf: z
869
+ .string()
870
+ .min(1)
871
+ .max(500)
872
+ .optional()
873
+ .describe('A yes/no question over the results of the nodes this one waits on, such as "Does the review report at least one bug?". On yes the node runs; on no it is skipped, and nodes waiting on it go ahead. When the answer is unclear it waits for the buyer. Needs waitsOn.'),
868
874
  }))
869
875
  .min(1)
870
876
  .max(100),
@@ -872,7 +878,7 @@ export function registerZiggsTools(server, creds, cfg) {
872
878
  review: z.literal('before_execution').optional(),
873
879
  })
874
880
  .optional()
875
- .describe('Native atomic graph. waitsOn values name nodeId values in this payload; all nodes are created or none are. Root nodes receive graph inputArtifactIds. review holds every node until the root acknowledgement.'),
881
+ .describe('Native atomic graph. waitsOn values name nodeId values in this payload; all nodes are created or none are. Root nodes receive graph inputArtifactIds. review holds every node until the root acknowledgement. runIf makes a node conditional on what the nodes before it found.'),
876
882
  // POST /tasks and the SDK's task_create have always taken
877
883
  // these three; only this surface hid them, so an agent on MCP had to
878
884
  // create-then-replace_plan even when it already knew the steps.
@@ -954,7 +960,8 @@ export function registerZiggsTools(server, creds, cfg) {
954
960
  });
955
961
  registerStrictTool(server, 'ziggs_task_set_result', {
956
962
  taskId: z.string(),
957
- state: z.enum(['completed', 'failed', 'cancelled']),
963
+ // Cancelling has its own tool, ziggs_task_cancel.
964
+ state: z.enum(['completed', 'failed']),
958
965
  result: z
959
966
  .object({
960
967
  summary: z.string().optional(),
@@ -3,6 +3,8 @@ import { type Creds } from '@ziggs-ai/api-client';
3
3
  import type { ZiggsMcpConfig } from './config.js';
4
4
  /** agent search + context grant management through MCP.
5
5
  * The SDK-twin tools (search/get, links, delegate) come from the shared
6
- * capability layer; only the human-authority grant tools (issue/revoke) stay
7
- * MCP-local. */
6
+ * capability layer; only revoking a grant stays MCP-local. Issuing one is a
7
+ * person's act (POST /context/grants takes a signed-in session), so there is
8
+ * no agent tool for it: an agent shares with artifact_share, a chat_open
9
+ * invite, or context_delegate. */
8
10
  export declare function registerTrustTools(server: McpServer, creds: Creds, cfg?: ZiggsMcpConfig): void;
@@ -1,103 +1,20 @@
1
1
  import { z } from 'zod';
2
- import { CONTEXT_GRANT_SCOPE_KINDS, ContextGrantsClient, addChatMember, contextBounds, resolveOrgScopeId, LINK_CAPABILITIES, INTRODUCTION_CAPABILITIES, DISCOVERY_CAPABILITIES, contextDelegateCapability, contextRequestCapability, accessRequestCapability, } from '@ziggs-ai/api-client';
3
- import { write, destructive } from './toolAnnotations.js';
2
+ import { ContextGrantsClient, LINK_CAPABILITIES, INTRODUCTION_CAPABILITIES, DISCOVERY_CAPABILITIES, contextDelegateCapability, accessRequestCapability, } from '@ziggs-ai/api-client';
3
+ import { destructive } from './toolAnnotations.js';
4
4
  import { registerStrictTool } from './strictParams.js';
5
5
  import { toolError } from './toolError.js';
6
6
  import { registerCapabilities, registerCapability, textResult } from './capabilityAdapter.js';
7
- // `artifact` is the narrowest context scope — one specific artifact, shared
8
- // without sharing any container it sits in. `task` is a branch of a work graph:
9
- // the named task and everything under it. Kept in step with the rail's own list
10
- // (`CONTEXT_GRANT_SCOPE_KINDS`) rather than written out again — a literal subset
11
- // still typechecks, which is how `task` was unaskable here after the server had
12
- // it.
13
- const grantScopeKindSchema = z.enum(CONTEXT_GRANT_SCOPE_KINDS);
14
- const contextTemporalSchema = z.enum(['from-now', 'from-start']);
15
7
  const DEFAULT_WEB_URL = 'https://ziggsai.com';
16
8
  /** agent search + context grant management through MCP.
17
9
  * The SDK-twin tools (search/get, links, delegate) come from the shared
18
- * capability layer; only the human-authority grant tools (issue/revoke) stay
19
- * MCP-local. */
10
+ * capability layer; only revoking a grant stays MCP-local. Issuing one is a
11
+ * person's act (POST /context/grants takes a signed-in session), so there is
12
+ * no agent tool for it: an agent shares with artifact_share, a chat_open
13
+ * invite, or context_delegate. */
20
14
  export function registerTrustTools(server, creds, cfg) {
21
15
  const webUrl = cfg?.ZIGGS_WEB_URL?.replace(/\/$/, '') ?? DEFAULT_WEB_URL;
22
16
  registerCapabilities(server, DISCOVERY_CAPABILITIES, creds);
23
- registerStrictTool(server, 'ziggs_context_issue_grant', {
24
- holderId: z.string().describe('Bare agent id receiving the grant'),
25
- scopeKind: grantScopeKindSchema,
26
- scopeId: z.string().describe('chatId, agreementId, orgId, artifactId, or taskId'),
27
- temporal: contextTemporalSchema
28
- .optional()
29
- .describe('from-now (default) or from-start (approval-gated on chat). Artifact ' +
30
- 'scope defaults to from-start and rejects from-now.'),
31
- expiresAt: z
32
- .string()
33
- .optional()
34
- .nullable()
35
- .describe('ISO-8601 expiry; omit for platform default TTL'),
36
- }, write('Give another agent access'), async ({ holderId, scopeKind, scopeId, temporal, expiresAt }) => {
37
- // An artifact predates any watermark you could set, so from-now would
38
- // validate and then read empty — the server refuses it outright. Defaulting
39
- // artifact scope to from-now here made the tool's own default invocation
40
- // fail, while the description promised it was always from-start. An
41
- // EXPLICIT from-now still goes through and is refused loudly: silently
42
- // rewriting what the caller asked for would hide the mistake.
43
- const resolvedTemporal = temporal ?? (scopeKind === 'artifact' ? 'from-start' : 'from-now');
44
- try {
45
- if (scopeKind === 'chat') {
46
- const result = await addChatMember({
47
- chatId: scopeId,
48
- memberId: holderId,
49
- memberType: 'agent',
50
- temporal: resolvedTemporal,
51
- }, creds);
52
- if ('status' in result && result.status === 'pending') {
53
- return textResult({
54
- status: 'pending_approval',
55
- outcome: 'pending',
56
- message: 'Human approval required before the grant is issued. Surface this to the user — do not treat as success.',
57
- scope: { kind: 'chat', id: scopeId },
58
- holderId,
59
- temporal: resolvedTemporal,
60
- pendingAdmission: result.pendingAdmission,
61
- });
62
- }
63
- return textResult({
64
- status: 'granted',
65
- scope: { kind: 'chat', id: scopeId },
66
- holderId,
67
- temporal: resolvedTemporal,
68
- bounds: {
69
- temporal: resolvedTemporal,
70
- note: 'from-now: readable content starts at grant watermark; from-start requires unanimous approval',
71
- },
72
- chat: 'chat' in result ? result.chat : undefined,
73
- });
74
- }
75
- // #6 — an org scope may be named rather than pasted as org_… id.
76
- let resolvedScopeId = scopeId;
77
- if (scopeKind === 'org') {
78
- resolvedScopeId = await resolveOrgScopeId({ creds, surface: 'mcp' }, scopeId);
79
- }
80
- const client = new ContextGrantsClient(creds.operatorKey, creds.agentId);
81
- const grant = await client.issueGrant({
82
- holderId,
83
- // This tool only ever hands access to another agent.
84
- holderKind: 'agent',
85
- scope: { kind: scopeKind, id: resolvedScopeId },
86
- temporal: resolvedTemporal,
87
- expiresAt,
88
- });
89
- return textResult({
90
- status: 'granted',
91
- grant,
92
- bounds: contextBounds(grant),
93
- });
94
- }
95
- catch (e) {
96
- return toolError(e);
97
- }
98
- });
99
17
  registerCapability(server, contextDelegateCapability, creds);
100
- registerCapability(server, contextRequestCapability, creds, { webUrl });
101
18
  registerCapability(server, accessRequestCapability, creds, { webUrl });
102
19
  if (!cfg?.coreOnly) {
103
20
  // #7 — the link tool group is skipped by the lean session-start
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/ziggs-mcp",
3
- "version": "0.37.4",
3
+ "version": "0.37.5",
4
4
  "description": "MCP server for Claude Code, Cursor, and other MCP hosts \u2014 act as your Ziggs delegate agent",
5
5
  "type": "module",
6
6
  "bin": {
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@modelcontextprotocol/sdk": "^1.29.0",
50
- "@ziggs-ai/api-client": "0.37.4",
50
+ "@ziggs-ai/api-client": "0.37.5",
51
51
  "dotenv": "^16.6.1",
52
52
  "zod": "^3.24.2",
53
53
  "zod-to-json-schema": "^3.25.1"
@@ -85,8 +85,8 @@ See [references/inbox-rhythm.md](references/inbox-rhythm.md) for a full catch-up
85
85
  - **`ziggs_inbox`** (cold, no `waitSeconds`): at session start, if anything awaits approve/reject, show **`sessionChatCard`** (includes app links + exact respond commands). Do not auto-approve.
86
86
  - **`pending_approval`** (grants, admissions, from-start history, agreement steps): **stop and show the human** — do not auto-approve on their behalf unless they explicitly asked for that action in this session.
87
87
  - **`humanAttention` on inbox**: when present, **tell the human immediately** — list each pending agreement proposal and ask approve/reject before other work.
88
- - Before **`ziggs_context_issue_grant`**, **`ziggs_context_delegate`**, or any grant that exposes **existing** org/chat/agreement context: **ask the human** what scope and temporal bound they want (`from-now` vs `from-start`).
89
- - Trust tools (`ziggs_agent_search`, grant issue/delegate/revoke): use for cross-org collaboration only when the human’s goal requires it.
88
+ - Before **`ziggs_context_delegate`**, a **`ziggs_chat_open`** invite into an existing room, or any grant that exposes **existing** org/chat/agreement context: **ask the human** what scope and temporal bound they want (`from-now` vs `from-start`).
89
+ - Trust tools (`ziggs_agent_search`, grant delegate/revoke): use for cross-org collaboration only when the human’s goal requires it.
90
90
 
91
91
  See [references/grants-and-approvals.md](references/grants-and-approvals.md).
92
92
 
@@ -51,7 +51,7 @@ counterparty owner approves it, and unpublished delegates can then reach each ot
51
51
  3. Target human approves via **`ziggs_agreement_respond`** (action `approve`) when the
52
52
  pending link agreement shows in their inbox / `ziggs_link_list`. This is the same generic
53
53
  approval tool used for hire and service proposals — there is no separate link-response tool.
54
- 4. **`ziggs_chat_open`** with the person to talk; **`ziggs_context_issue_grant`** only to let them read your context.
54
+ 4. **`ziggs_chat_open`** with the person to talk. To let them read existing context: **`ziggs_artifact_share`** for one artifact, a **`ziggs_chat_open`** invite (chatId plus participantIds) for a room, or **`ziggs_context_delegate`** for a slice of a grant you hold.
55
55
  5. To read their context, they grant it or you ask with **`ziggs_access_request`**.
56
56
  6. `ziggs_context_revoke_grant` when context access should end; **`ziggs_agreement_revoke`** when
57
57
  the agreement should end — any kind: hire, service, request, offer, or link.
@@ -61,4 +61,4 @@ counterparty owner approves it, and unpublished delegates can then reach each ot
61
61
  ## Web UI (Settings → Connections)
62
62
 
63
63
  Confusingly named after the *other* "connection" (this is the agent-link handshake UI, not
64
- `ziggs_connection_proxy` third-party connections). After an agent link appears under **Connected**, use your Claude delegate (MCP) for **`ziggs_chat_open`** or **`ziggs_context_issue_grant`**. The web UI manages handshake only — not chat or context grants.
64
+ `ziggs_connection_proxy` third-party connections). After an agent link appears under **Connected**, use your Claude delegate (MCP) for **`ziggs_chat_open`**, **`ziggs_artifact_share`** or **`ziggs_context_delegate`**. The web UI manages handshake only — not chat or context grants.