@ziggs-ai/ziggs-mcp 0.1.35 → 0.3.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.
Files changed (2) hide show
  1. package/dist/tools.js +20 -8
  2. package/package.json +3 -3
package/dist/tools.js CHANGED
@@ -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);
@@ -649,11 +649,15 @@ export function registerZiggsTools(server, creds, cfg) {
649
649
  }))
650
650
  .optional()
651
651
  .describe('Scopes you finished handling — acked before fetching, monotonic'),
652
- }, READ_ONLY, async ({ ack }) => {
652
+ waitSeconds: z
653
+ .number()
654
+ .optional()
655
+ .describe('Long-poll: hold up to this many seconds (server-clamped, ~25 max) and return as soon as something new arrives — same response shape, no busy re-polling. Omit for an immediate snapshot.'),
656
+ }, READ_ONLY, async ({ ack, waitSeconds }) => {
653
657
  try {
654
658
  const client = new InboxClient(creds.operatorKey, creds.agentId);
655
659
  const acked = ack?.length ? await client.ack(ack) : null;
656
- const inbox = await client.getInbox();
660
+ const inbox = await client.getInbox(waitSeconds != null ? { waitSeconds } : {});
657
661
  let activeTasks = [];
658
662
  let activeTasksError;
659
663
  try {
@@ -738,7 +742,7 @@ export function registerZiggsTools(server, creds, cfg) {
738
742
  return toolError(e.message);
739
743
  }
740
744
  });
741
- 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 () => {
742
746
  try {
743
747
  const client = new ContextDiscoveryClient(creds.operatorKey, creds.agentId);
744
748
  const items = await client.discoverGrantable();
@@ -800,12 +804,16 @@ export function registerZiggsTools(server, creds, cfg) {
800
804
  .optional()
801
805
  .describe('Optional task — creates a TaskArtifactLink alongside the primary scope link'),
802
806
  content_type: z.string().optional().describe('Default text'),
803
- }, WRITE, async ({ text, visibility, chatId, agreementId, taskId, content_type }) => {
807
+ idempotencyKey: z
808
+ .string()
809
+ .optional()
810
+ .describe('Optional dedup key: a redelivered record with the same key no-ops and returns the original artifact. Derive it deterministically (e.g. from the source event + step) — not a random value — so a crash-replay reproduces it.'),
811
+ }, WRITE, async ({ text, visibility, chatId, agreementId, taskId, content_type, idempotencyKey }) => {
804
812
  try {
805
813
  if ((chatId && agreementId) || (!chatId && !agreementId)) {
806
814
  return toolError('Pass exactly one of chatId or agreementId');
807
815
  }
808
- const { artifactId } = await new ArtifactsClient(creds.operatorKey, creds.agentId).writeStrict({ text, visibility, chatId, agreementId, taskId, content_type });
816
+ const { artifactId } = await new ArtifactsClient(creds.operatorKey, creds.agentId).writeStrict({ text, visibility, chatId, agreementId, taskId, content_type, idempotencyKey });
809
817
  return textResult({
810
818
  ok: true,
811
819
  artifactId,
@@ -857,9 +865,13 @@ export function registerZiggsTools(server, creds, cfg) {
857
865
  .optional()
858
866
  .describe('Outcome payload (summary, status, links, …)'),
859
867
  errorMessage: z.string().optional().describe('Required when state=failed'),
860
- }, WRITE, async ({ taskId, state, result, errorMessage }) => {
868
+ idempotencyKey: z
869
+ .string()
870
+ .optional()
871
+ .describe('Optional dedup key: a redelivered transition with the same key no-ops (returns the task) instead of erroring on an already-terminal task. Derive it deterministically (e.g. from taskId + target state) so a crash-replay reproduces it.'),
872
+ }, WRITE, async ({ taskId, state, result, errorMessage, idempotencyKey }) => {
861
873
  try {
862
- const task = await updateTaskState(taskId, state, { result, errorMessage }, creds);
874
+ const task = await updateTaskState(taskId, state, { result, errorMessage, idempotencyKey }, creds);
863
875
  return textResult({ ok: true, task });
864
876
  }
865
877
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/ziggs-mcp",
3
- "version": "0.1.35",
3
+ "version": "0.3.0",
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.1.30",
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.2.2"
44
+ "@ziggs-ai/agent-sdk": "^0.4.0"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=20"