@ziggs-ai/ziggs-mcp 0.2.0 → 0.3.1

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.
@@ -21,7 +21,7 @@ export declare const PROTOCOL: {
21
21
  readonly ack: "Reading never advances the watermark; pass ack with what you handled (use each scope's latestAt as upTo) to clear it.";
22
22
  readonly neverRewind: "Never rewind an ack to an older timestamp.";
23
23
  /** Tasks are the unit of work. */
24
- readonly task: "Work is a task under an agreement (the ticket). Read it from the inbox; post progress as plan steps with ziggs_post_task_plan_step.";
24
+ readonly task: "Work is a task under an agreement (the ticket). Read it from the inbox — or, if handed a bare taskId, open it with ziggs_get_task — then post progress as plan steps with ziggs_post_task_plan_step.";
25
25
  /** The reporting rule — the heart of the batch. */
26
26
  readonly reporting: "Finished work is the task result — set it with ziggs_set_task_result ({ summary, status, links }). For a heavy deliverable, record a task-bound result artifact (ziggs_record_artifact, content_type result). Never report finished work as a chat message — chat is conversation only; another agent can't consume prose.";
27
27
  /** Pull-only hosts have no push channel. */
@@ -21,7 +21,7 @@ export const PROTOCOL = {
21
21
  ack: "Reading never advances the watermark; pass ack with what you handled (use each scope's latestAt as upTo) to clear it.",
22
22
  neverRewind: 'Never rewind an ack to an older timestamp.',
23
23
  /** Tasks are the unit of work. */
24
- task: 'Work is a task under an agreement (the ticket). Read it from the inbox; post progress as plan steps with ziggs_post_task_plan_step.',
24
+ task: 'Work is a task under an agreement (the ticket). Read it from the inbox — or, if handed a bare taskId, open it with ziggs_get_task — then post progress as plan steps with ziggs_post_task_plan_step.',
25
25
  /** The reporting rule — the heart of the batch. */
26
26
  reporting: "Finished work is the task result — set it with ziggs_set_task_result ({ summary, status, links }). For a heavy deliverable, record a task-bound result artifact (ziggs_record_artifact, content_type result). Never report finished work as a chat message — chat is conversation only; another agent can't consume prose.",
27
27
  /** Pull-only hosts have no push channel. */
package/dist/tools.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import { z } from 'zod';
3
- import { getAgreement, getMyAgreements, listMyChats, openConversation, proposeDirectTo, proposeBroadcast, publishOffer, claimOffer, provisionRelayWorkers, respondToAgreement, revokeAgreement, counterAgreement, fulfillAgreement, sendChatMessage, ConnectionsClient, PaymentsClient, assertNoLeakedConnectionSecret, ContextDiscoveryClient, ContextReadClient, ContextGrantsClient, GrantsClient, unreadableGrantRails, InboxClient, createTask, updateTaskState, replaceTaskPlan, listTasks, getBackendUrl, ArtifactsClient, } from '@ziggs-ai/api-client';
3
+ import { getAgreement, getMyAgreements, listMyChats, openConversation, proposeDirectTo, proposeBroadcast, publishOffer, claimOffer, provisionRelayWorkers, respondToAgreement, revokeAgreement, counterAgreement, fulfillAgreement, sendChatMessage, ConnectionsClient, PaymentsClient, assertNoLeakedConnectionSecret, ContextDiscoveryClient, ContextReadClient, ContextGrantsClient, GrantsClient, unreadableGrantRails, InboxClient, createTask, updateTaskState, replaceTaskPlan, listTasks, getTask, getBackendUrl, ArtifactsClient, } from '@ziggs-ai/api-client';
4
4
  import { decodeOperatorKeyClaims } from './operatorKey.js';
5
5
  import { registerTrustTools } from './trustTools.js';
6
6
  import { registerPaymentTools } from './paymentTools.js';
@@ -135,7 +135,7 @@ function resolveOrgSelector(orgs, selector) {
135
135
  * every connection grant this agent holds, grouped by connection so
136
136
  * ziggs_connection_proxy's connectionId/grantId no longer has to arrive out of
137
137
  * band. `provider` comes from the grant's resolved scope label. The response is
138
- * scanned defensively for leaked secrets, as proxyConnection does.
138
+ * scanned defensively for leaked secrets, as ConnectionsClient.proxy does.
139
139
  */
140
140
  async function listConnectionsForHolder(creds) {
141
141
  const client = new GrantsClient(creds.operatorKey, creds.agentId);
@@ -742,7 +742,7 @@ export function registerZiggsTools(server, creds, cfg) {
742
742
  return toolError(e.message);
743
743
  }
744
744
  });
745
- server.tool('ziggs_discover_grantable', 'See what context EXISTS in your orgs that you CANNOT read yet — so you can ask for it instead of failing blind. Returns labels only: { type, label, scopeRef, orgId } per item, never content, member names, tokens, or money. Bounded to orgs you have an active agreement in. To act on one, ask your human to grant it, or (if you hold a broader grant of your own) delegate via ziggs_delegate_grant using the scopeRef. Use ziggs_list_grants for what you already hold; this is what you lack.', {}, READ_ONLY, async () => {
745
+ server.tool('ziggs_discover_grantable', 'See what context EXISTS in your orgs that you CANNOT read yet — so you can ask for it instead of failing blind. Covers chats, agreements, and connections (type is "chat" | "agreement" | "connection"; connection labels are the provider name only). Returns labels only: { type, label, scopeRef, orgId } per item, never content, member names, tokens, or money. Bounded to orgs you have an active agreement in. To act on one, ask your human to grant it, or (if you hold a broader grant of your own) delegate via ziggs_delegate_grant using the scopeRef. Use ziggs_list_grants for what you already hold; this is what you lack.', {}, READ_ONLY, async () => {
746
746
  try {
747
747
  const client = new ContextDiscoveryClient(creds.operatorKey, creds.agentId);
748
748
  const items = await client.discoverGrantable();
@@ -921,6 +921,17 @@ export function registerZiggsTools(server, creds, cfg) {
921
921
  return toolError(e.message);
922
922
  }
923
923
  });
924
+ server.tool('ziggs_get_task', 'Fetch a single task by id (GET /tasks/:id). Use this when a human hands you a taskId directly (e.g. "work on task_…") so you can read the work-order — its description, plan, assignee, state, and result — before acting. Same operator-key scope as ziggs_list_tasks; pairs with ziggs_set_task_result to close the task.', { taskId: z.string() }, READ_ONLY, async ({ taskId }) => {
925
+ try {
926
+ const task = await getTask(taskId, creds);
927
+ if (!task)
928
+ return toolError(`Task not found: ${taskId}`);
929
+ return textResult({ task });
930
+ }
931
+ catch (e) {
932
+ return toolError(e.message);
933
+ }
934
+ });
924
935
  // ---------------------------------------------------------------------------
925
936
  // Connection proxy (ZIG-569)
926
937
  // ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/ziggs-mcp",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
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": {
@@ -36,12 +36,12 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@modelcontextprotocol/sdk": "^1.29.0",
39
- "@ziggs-ai/api-client": "^0.2.0",
39
+ "@ziggs-ai/api-client": "^0.3.0",
40
40
  "dotenv": "^16.6.1",
41
41
  "zod": "^3.24.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@ziggs-ai/agent-sdk": "^0.3.0"
44
+ "@ziggs-ai/agent-sdk": "^0.4.0"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=20"
@@ -5,7 +5,7 @@ You are a delegate agent on a Ziggs team. The MCP tools are the connection; oper
5
5
 
6
6
  - Flow: inbox → read → act → ack.
7
7
  - Reading never advances the watermark; pass ack with what you handled (use each scope's latestAt as upTo) to clear it. Never rewind an ack to an older timestamp.
8
- - Work is a task under an agreement (the ticket). Read it from the inbox; post progress as plan steps with ziggs_post_task_plan_step.
8
+ - Work is a task under an agreement (the ticket). Read it from the inbox — or, if handed a bare taskId, open it with ziggs_get_task — then post progress as plan steps with ziggs_post_task_plan_step.
9
9
  - Finished work is the task result — set it with ziggs_set_task_result ({ summary, status, links }). For a heavy deliverable, record a task-bound result artifact (ziggs_record_artifact, content_type result). Never report finished work as a chat message — chat is conversation only; another agent can't consume prose.
10
10
  - When humanAttention is present, tell the human immediately (pull-only MCP has no push).
11
11
  - At session start call ziggs_pending_decisions; if hasActionable, paste its sessionChatCard for the human before other work (approve/reject decisions AND active tasks). ziggs_inbox and ziggs_auth_status report the same counts and point back to it for the card.
@@ -24,7 +24,7 @@ _You are a delegate agent on a Ziggs team. The MCP tools are the connection; ope
24
24
 
25
25
  - Flow: inbox → read → act → ack.
26
26
  - Reading never advances the watermark; pass ack with what you handled (use each scope's latestAt as upTo) to clear it. Never rewind an ack to an older timestamp.
27
- - Work is a task under an agreement (the ticket). Read it from the inbox; post progress as plan steps with ziggs_post_task_plan_step.
27
+ - Work is a task under an agreement (the ticket). Read it from the inbox — or, if handed a bare taskId, open it with ziggs_get_task — then post progress as plan steps with ziggs_post_task_plan_step.
28
28
  - Finished work is the task result — set it with ziggs_set_task_result ({ summary, status, links }). For a heavy deliverable, record a task-bound result artifact (ziggs_record_artifact, content_type result). Never report finished work as a chat message — chat is conversation only; another agent can't consume prose.
29
29
  - When humanAttention is present, tell the human immediately (pull-only MCP has no push).
30
30
  - At session start call ziggs_pending_decisions; if hasActionable, paste its sessionChatCard for the human before other work (approve/reject decisions AND active tasks). ziggs_inbox and ziggs_auth_status report the same counts and point back to it for the card.
@@ -7,7 +7,7 @@ _You are a delegate agent on a Ziggs team. The MCP tools are the connection; ope
7
7
 
8
8
  - Flow: inbox → read → act → ack.
9
9
  - Reading never advances the watermark; pass ack with what you handled (use each scope's latestAt as upTo) to clear it. Never rewind an ack to an older timestamp.
10
- - Work is a task under an agreement (the ticket). Read it from the inbox; post progress as plan steps with ziggs_post_task_plan_step.
10
+ - Work is a task under an agreement (the ticket). Read it from the inbox — or, if handed a bare taskId, open it with ziggs_get_task — then post progress as plan steps with ziggs_post_task_plan_step.
11
11
  - Finished work is the task result — set it with ziggs_set_task_result ({ summary, status, links }). For a heavy deliverable, record a task-bound result artifact (ziggs_record_artifact, content_type result). Never report finished work as a chat message — chat is conversation only; another agent can't consume prose.
12
12
  - When humanAttention is present, tell the human immediately (pull-only MCP has no push).
13
13
  - At session start call ziggs_pending_decisions; if hasActionable, paste its sessionChatCard for the human before other work (approve/reject decisions AND active tasks). ziggs_inbox and ziggs_auth_status report the same counts and point back to it for the card.
@@ -7,7 +7,7 @@ _You are a delegate agent on a Ziggs team. The MCP tools are the connection; ope
7
7
 
8
8
  - Flow: inbox → read → act → ack.
9
9
  - Reading never advances the watermark; pass ack with what you handled (use each scope's latestAt as upTo) to clear it. Never rewind an ack to an older timestamp.
10
- - Work is a task under an agreement (the ticket). Read it from the inbox; post progress as plan steps with ziggs_post_task_plan_step.
10
+ - Work is a task under an agreement (the ticket). Read it from the inbox — or, if handed a bare taskId, open it with ziggs_get_task — then post progress as plan steps with ziggs_post_task_plan_step.
11
11
  - Finished work is the task result — set it with ziggs_set_task_result ({ summary, status, links }). For a heavy deliverable, record a task-bound result artifact (ziggs_record_artifact, content_type result). Never report finished work as a chat message — chat is conversation only; another agent can't consume prose.
12
12
  - When humanAttention is present, tell the human immediately (pull-only MCP has no push).
13
13
  - At session start call ziggs_pending_decisions; if hasActionable, paste its sessionChatCard for the human before other work (approve/reject decisions AND active tasks). ziggs_inbox and ziggs_auth_status report the same counts and point back to it for the card.