@ziggs-ai/ziggs-mcp 0.43.28 → 0.43.30

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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.43.30
6
+
7
+ - `ziggs_page_show` draws a page in the chat as an MCP Apps view. Forms and reads go through this assistant; hosts that do not draw a view still get the text.
8
+ - `ziggs_task_delegate` takes `agreementId` only when the child work is done under one.
9
+
10
+ ## 0.43.29
11
+
12
+ - The connect text says a workspace in a bucket's audience is everyone in it.
13
+
5
14
  ## 0.43.28
6
15
 
7
16
  ## 0.43.27
@@ -18,7 +18,7 @@ ziggs_message_read ziggs_message_send ziggs_message_replies ziggs_message_list z
18
18
  ziggs_task_create ziggs_task_set_result ziggs_task_replace_plan ziggs_task_update_steps
19
19
  ziggs_task_acknowledge_control ziggs_task_list ziggs_task_cancel ziggs_task_delegate ziggs_task_get
20
20
  ziggs_task_pass_on
21
- ziggs_bucket_create ziggs_bucket_insert ziggs_bucket_list ziggs_bucket_read ziggs_bucket_send ziggs_page_guide ziggs_page
21
+ ziggs_bucket_create ziggs_bucket_insert ziggs_bucket_list ziggs_bucket_read ziggs_bucket_send ziggs_page_guide ziggs_page ziggs_page_show
22
22
  ziggs_connection_list ziggs_agent_search ziggs_agent_get ziggs_people
23
23
  ziggs_message_send ziggs_context_delegate ziggs_access_request
24
24
  ziggs_link_propose ziggs_link_list ziggs_introduction_mint ziggs_introduction_redeem
@@ -0,0 +1,48 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ /**
3
+ * A live page drawn inside the chat by hosts that render MCP Apps views
4
+ * (Claude, ChatGPT, Cursor). A host that does not still gets the text result.
5
+ *
6
+ * Reads and form entries go through this assistant: the view calls the same
7
+ * Ziggs tools the model uses (`ziggs_message_list`, `ziggs_task_list`,
8
+ * `ziggs_message_send`, …). The host's own confirm is the confirm. Nothing
9
+ * sends the person to the website to sign in.
10
+ */
11
+ export declare const PAGE_CARD_URI = "ui://ziggs/page";
12
+ export declare const PAGE_CARD_MIME = "text/html;profile=mcp-app";
13
+ export declare const PAGE_CARD_TOOL_META: {
14
+ ui: {
15
+ resourceUri: string;
16
+ };
17
+ };
18
+ export interface PageCardViewer {
19
+ principalId: string;
20
+ activeOrgId: string | null;
21
+ userId: string;
22
+ username: string | null;
23
+ orgId: string | null;
24
+ }
25
+ export interface PageCardData {
26
+ title: string;
27
+ html: string;
28
+ rootMessageId: string;
29
+ versionMessageId: string;
30
+ artifactId: string;
31
+ authorId: string;
32
+ authorName: string;
33
+ viewer: PageCardViewer;
34
+ }
35
+ export declare function pageCardResult(data: PageCardData): {
36
+ content: {
37
+ type: "text";
38
+ text: string;
39
+ }[];
40
+ structuredContent: Record<string, unknown>;
41
+ };
42
+ export declare function registerPageCardResource(server: McpServer): void;
43
+ /**
44
+ * Host wrapper. Speaks MCP Apps with the chat host, and ziggs-page-v1 with a
45
+ * sandboxed inner frame that runs the page. Page HTML is never parsed as this
46
+ * document's HTML: it is assigned to iframe.srcdoc.
47
+ */
48
+ export declare const PAGE_CARD_HTML = "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>Ziggs page</title>\n<style>\n :root { --fg:#1d1a20; --muted:#6b6470; --line:#e7e2ea; --bg:#ffffff; }\n @media (prefers-color-scheme: dark) { :root { --fg:#f2eef4; --muted:#a59cab; --line:#332d38; --bg:#1b171e; } }\n * { box-sizing: border-box; }\n html, body { margin:0; height:100%; background:var(--bg); color:var(--fg); font:14px/1.45 system-ui,-apple-system,\"Segoe UI\",sans-serif; }\n #status { padding:12px 16px; color:var(--muted); }\n #frame { display:block; width:100%; min-height:480px; height:100%; border:0; background:#fff; }\n #open { display:none; position:absolute; inset:0; background:rgba(0,0,0,.45); align-items:center; justify-content:center; padding:16px; }\n #open.show { display:flex; }\n #open .card { max-width:480px; max-height:80%; overflow:auto; background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:12px; padding:16px; }\n #open pre { white-space:pre-wrap; font-size:12px; }\n #open button { margin-top:12px; min-height:32px; padding:0 12px; }\n</style>\n</head>\n<body>\n<p id=\"status\">Opening page\u2026</p>\n<iframe id=\"frame\" sandbox=\"allow-scripts\" referrerpolicy=\"no-referrer\" title=\"Ziggs page\" hidden></iframe>\n<div id=\"open\"><div class=\"card\"><pre id=\"open-body\"></pre><button type=\"button\" id=\"open-close\">Close</button></div></div>\n<script>\n(function () {\n var nextId = 1, pending = {}, remeasure = null, page = null, channel = \"c\" + Math.random().toString(36).slice(2);\n function send(method, params) {\n var id = nextId++;\n window.parent.postMessage({ jsonrpc: \"2.0\", id: id, method: method, params: params || {} }, \"*\");\n return new Promise(function (resolve, reject) { pending[id] = { resolve: resolve, reject: reject }; });\n }\n function notify(method, params) {\n window.parent.postMessage({ jsonrpc: \"2.0\", method: method, params: params || {} }, \"*\");\n }\n function toolText(result) {\n if (!result) return null;\n if (result.structuredContent) return result.structuredContent;\n var block = result.content && result.content[0];\n var text = block && block.text;\n if (typeof text !== \"string\") return result;\n try { return JSON.parse(text); } catch (e) { return { text: text }; }\n }\n function callTool(name, args) {\n return send(\"tools/call\", { name: name, arguments: args || {} }).then(function (result) {\n if (result && result.isError) {\n var err = toolText(result);\n var message = (err && (err.message || err.error || err.text)) || \"This call did not go through.\";\n throw new Error(typeof message === \"string\" ? message : JSON.stringify(message));\n }\n return toolText(result);\n });\n }\n function listCall(kind, filters) {\n filters = filters || {};\n if (kind === \"message\") {\n if (filters.id && (filters.replies === true || filters.replies === 1 || filters.replies === \"1\"))\n return callTool(\"ziggs_message_replies\", { messageId: filters.id, before: filters.before, limit: filters.limit });\n if (filters.id) return callTool(\"ziggs_message_read\", { messageId: filters.id });\n return callTool(\"ziggs_message_list\", {\n conversationOf: page.rootMessageId,\n agreementId: filters.agreementId,\n taskId: filters.taskId,\n participantIds: filters.participantIds,\n before: filters.before,\n limit: filters.limit || 30\n }).then(function (result) {\n return { page: { rootMessageId: page.rootMessageId, messageId: page.versionMessageId, artifactId: page.artifactId }, messages: (result && result.messages) || [], nextCursor: result && result.nextCursor };\n });\n }\n if (kind === \"task\") {\n if (filters.id) return callTool(\"ziggs_task_get\", { taskId: filters.id });\n return callTool(\"ziggs_task_list\", { state: filters.state, assigneeId: filters.assigneeId, limit: filters.limit });\n }\n if (kind === \"agreement\") {\n if (filters.id) return callTool(\"ziggs_agreement_get\", { agreementId: filters.id });\n return callTool(\"ziggs_agreement_list\", {});\n }\n if (kind === \"artifact\" && filters.id) return callTool(\"ziggs_open\", { artifactId: filters.id, html: true });\n if (kind === \"person\") return callTool(\"ziggs_people\", filters.q ? { q: filters.q } : {});\n if (kind === \"agent\") return callTool(\"ziggs_agent_search\", filters.q ? { q: filters.q } : {});\n if (kind === \"bucket\") return callTool(\"ziggs_bucket_list\", {});\n throw new Error(\"This read is not available.\");\n }\n function uuid() {\n if (crypto.randomUUID) return crypto.randomUUID();\n return \"page-\" + Date.now().toString(36) + \"-\" + Math.random().toString(36).slice(2);\n }\n function actCall(action, label) {\n if (action && action.action === \"submit\") {\n return callTool(\"ziggs_message_send\", {\n command: {\n operationId: uuid(),\n content: { text: \"Filled in \" + action.form },\n audience: { kind: \"explicit\", principalIds: [] },\n deliveries: { kind: \"explicit\", principalIds: [page.authorId] },\n intent: \"request\",\n relationships: { replyToMessageId: page.versionMessageId },\n formEntry: { form: action.form, fields: action.fields }\n }\n });\n }\n if (action && action.action === \"send\" && action.command) return callTool(\"ziggs_message_send\", { command: action.command });\n throw new Error(\"This action is not available from a page.\");\n }\n function showOpen(data) {\n var body = document.getElementById(\"open-body\");\n body.textContent = typeof data === \"string\" ? data : JSON.stringify(data, null, 2);\n document.getElementById(\"open\").className = \"show\";\n if (remeasure) remeasure();\n }\n function pageDocument(source) {\n var helper = \"(function(){var protocol='ziggs-page-v1';var channel=\" + JSON.stringify(channel) + \";var pending=new Map();var sequence=0;var listeners=new Map();addEventListener('message',function(event){var data=event.data;if(event.source!==parent||!data||data.protocol!==protocol||data.channel!==channel)return;if(typeof data.event==='string'){for(var fn of (listeners.get(data.event)||[])){try{fn(data.detail||{})}catch(e){}}return;}var entry=pending.get(data.id);if(!entry)return;pending.delete(data.id);clearTimeout(entry.timer);if(data.ok===true)entry.resolve(data.result);else entry.reject(new Error(data.error||'This read is not available.'));});function call(method,args){return new Promise(function(resolve,reject){if(pending.size>=16)return reject(new Error('Too many pending reads.'));var id='r'+(++sequence);var timer=setTimeout(function(){pending.delete(id);reject(new Error('The page request timed out.'));}, method==='act'?300000:15000);pending.set(id,{resolve:resolve,reject:reject,timer:timer});parent.postMessage({protocol:protocol,channel:channel,id:id,method:method,args:args||{}},'*');});}Object.defineProperty(window,'ziggs',{value:Object.freeze({me:function(){return call('me');},list:function(kind,filters){return call('list',Object.assign({kind:kind},filters||{}));},open:function(kind,id){return call('open',{kind:kind,id:id});},act:function(action,label){return call('act',label?{action:action,label:label}:{action:action});},on:function(event,fn){if(!listeners.has(event))listeners.set(event,new Set());listeners.get(event).add(fn);return function(){listeners.get(event).delete(fn);};}}),writable:false,configurable:false});parent.postMessage({protocol:protocol,channel:channel,ready:true},'*');})();\";\n return \"<!DOCTYPE html><html><head><meta charset=\\\"utf-8\\\"><meta http-equiv=\\\"Content-Security-Policy\\\" content=\\\"default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; connect-src 'none'; font-src 'none'; media-src 'none'; frame-src 'none'; worker-src 'none'; object-src 'none'; form-action 'none'; base-uri 'none'\\\"><script>\" + helper + \"</script></head>\" + source;\n }\n function runPage(request) {\n if (request.method === \"me\") return Promise.resolve(page.viewer);\n if (request.method === \"list\") return listCall(String(request.args.kind), request.args);\n if (request.method === \"open\") return callTool(\"ziggs_open\", { ref: request.args.id }).then(function (result) { showOpen(result); return { opened: true }; });\n if (request.method === \"act\") return actCall(request.args.action, request.args.label);\n return Promise.reject(new Error(\"Unknown method\"));\n }\n function bindFrame(frame) {\n window.addEventListener(\"message\", function (event) {\n if (event.source !== frame.contentWindow) return;\n var data = event.data;\n if (!data || data.protocol !== \"ziggs-page-v1\" || data.channel !== channel) return;\n if (data.ready === true) { document.getElementById(\"status\").hidden = true; if (remeasure) remeasure(); return; }\n if (!data.id || !data.method) return;\n runPage(data).then(function (result) {\n frame.contentWindow.postMessage({ protocol: \"ziggs-page-v1\", channel: channel, id: data.id, ok: true, result: result }, \"*\");\n }, function (error) {\n frame.contentWindow.postMessage({ protocol: \"ziggs-page-v1\", channel: channel, id: data.id, ok: false, error: error && error.message ? error.message : \"This read is not available.\" }, \"*\");\n });\n });\n }\n function render(data) {\n page = data;\n var status = document.getElementById(\"status\");\n var frame = document.getElementById(\"frame\");\n if (!data || !data.html) { status.hidden = false; status.textContent = \"No page to show.\"; return; }\n status.textContent = \"Opening \u201C\" + data.title + \"\u201D\u2026\";\n bindFrame(frame);\n frame.srcdoc = pageDocument(data.html);\n frame.hidden = false;\n if (remeasure) remeasure();\n }\n window.addEventListener(\"message\", function (event) {\n if (event.source !== window.parent) return;\n var msg = event.data;\n if (!msg || msg.jsonrpc !== \"2.0\") return;\n if (msg.id != null && pending[msg.id] && !msg.method) {\n var waiter = pending[msg.id];\n delete pending[msg.id];\n if (msg.error) waiter.reject(msg.error); else waiter.resolve(msg.result);\n return;\n }\n if (msg.method === \"ui/notifications/tool-result\") render((msg.params || {}).structuredContent);\n });\n document.getElementById(\"open-close\").addEventListener(\"click\", function () {\n document.getElementById(\"open\").className = \"\";\n if (remeasure) remeasure();\n });\n function reportSize() {\n var lastWidth = 0, lastHeight = 0, queued = false;\n function measure() {\n if (queued) return;\n queued = true;\n var next = typeof requestAnimationFrame === \"function\" ? requestAnimationFrame : function (fn) { setTimeout(fn, 16); };\n next(function () {\n queued = false;\n var doc = document.documentElement, previous = doc.style.height;\n doc.style.height = \"max-content\";\n var height = Math.max(480, Math.ceil(doc.getBoundingClientRect().height));\n doc.style.height = previous;\n var width = Math.ceil(window.innerWidth);\n if (width === lastWidth && height === lastHeight) return;\n lastWidth = width; lastHeight = height;\n notify(\"ui/notifications/size-changed\", { width: width, height: height });\n });\n }\n remeasure = measure;\n measure();\n if (typeof ResizeObserver === \"function\") {\n var observer = new ResizeObserver(measure);\n observer.observe(document.documentElement);\n observer.observe(document.body);\n }\n }\n send(\"ui/initialize\", {\n protocolVersion: \"2026-01-26\",\n appInfo: { name: \"Ziggs page\", version: \"1\" },\n appCapabilities: {}\n }).then(function () {\n notify(\"ui/notifications/initialized\", {});\n reportSize();\n }, function () {});\n})();\n</script>\n</body>\n</html>\n";
@@ -0,0 +1,247 @@
1
+ /**
2
+ * A live page drawn inside the chat by hosts that render MCP Apps views
3
+ * (Claude, ChatGPT, Cursor). A host that does not still gets the text result.
4
+ *
5
+ * Reads and form entries go through this assistant: the view calls the same
6
+ * Ziggs tools the model uses (`ziggs_message_list`, `ziggs_task_list`,
7
+ * `ziggs_message_send`, …). The host's own confirm is the confirm. Nothing
8
+ * sends the person to the website to sign in.
9
+ */
10
+ export const PAGE_CARD_URI = 'ui://ziggs/page';
11
+ export const PAGE_CARD_MIME = 'text/html;profile=mcp-app';
12
+ export const PAGE_CARD_TOOL_META = { ui: { resourceUri: PAGE_CARD_URI } };
13
+ export function pageCardResult(data) {
14
+ return {
15
+ content: [
16
+ {
17
+ type: 'text',
18
+ text: `Showing “${data.title}” in this chat. Fill it here — it does not open the website.`,
19
+ },
20
+ ],
21
+ structuredContent: data,
22
+ };
23
+ }
24
+ export function registerPageCardResource(server) {
25
+ server.registerResource('ziggs-page', PAGE_CARD_URI, {
26
+ title: 'Ziggs page',
27
+ description: 'A live Ziggs page drawn in this chat.',
28
+ mimeType: PAGE_CARD_MIME,
29
+ _meta: { ui: { prefersBorder: true } },
30
+ }, async () => ({
31
+ contents: [
32
+ {
33
+ uri: PAGE_CARD_URI,
34
+ mimeType: PAGE_CARD_MIME,
35
+ text: PAGE_CARD_HTML,
36
+ _meta: { ui: { prefersBorder: true } },
37
+ },
38
+ ],
39
+ }));
40
+ }
41
+ /**
42
+ * Host wrapper. Speaks MCP Apps with the chat host, and ziggs-page-v1 with a
43
+ * sandboxed inner frame that runs the page. Page HTML is never parsed as this
44
+ * document's HTML: it is assigned to iframe.srcdoc.
45
+ */
46
+ export const PAGE_CARD_HTML = `<!doctype html>
47
+ <html lang="en">
48
+ <head>
49
+ <meta charset="utf-8">
50
+ <meta name="viewport" content="width=device-width, initial-scale=1">
51
+ <title>Ziggs page</title>
52
+ <style>
53
+ :root { --fg:#1d1a20; --muted:#6b6470; --line:#e7e2ea; --bg:#ffffff; }
54
+ @media (prefers-color-scheme: dark) { :root { --fg:#f2eef4; --muted:#a59cab; --line:#332d38; --bg:#1b171e; } }
55
+ * { box-sizing: border-box; }
56
+ html, body { margin:0; height:100%; background:var(--bg); color:var(--fg); font:14px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif; }
57
+ #status { padding:12px 16px; color:var(--muted); }
58
+ #frame { display:block; width:100%; min-height:480px; height:100%; border:0; background:#fff; }
59
+ #open { display:none; position:absolute; inset:0; background:rgba(0,0,0,.45); align-items:center; justify-content:center; padding:16px; }
60
+ #open.show { display:flex; }
61
+ #open .card { max-width:480px; max-height:80%; overflow:auto; background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:12px; padding:16px; }
62
+ #open pre { white-space:pre-wrap; font-size:12px; }
63
+ #open button { margin-top:12px; min-height:32px; padding:0 12px; }
64
+ </style>
65
+ </head>
66
+ <body>
67
+ <p id="status">Opening page…</p>
68
+ <iframe id="frame" sandbox="allow-scripts" referrerpolicy="no-referrer" title="Ziggs page" hidden></iframe>
69
+ <div id="open"><div class="card"><pre id="open-body"></pre><button type="button" id="open-close">Close</button></div></div>
70
+ <script>
71
+ (function () {
72
+ var nextId = 1, pending = {}, remeasure = null, page = null, channel = "c" + Math.random().toString(36).slice(2);
73
+ function send(method, params) {
74
+ var id = nextId++;
75
+ window.parent.postMessage({ jsonrpc: "2.0", id: id, method: method, params: params || {} }, "*");
76
+ return new Promise(function (resolve, reject) { pending[id] = { resolve: resolve, reject: reject }; });
77
+ }
78
+ function notify(method, params) {
79
+ window.parent.postMessage({ jsonrpc: "2.0", method: method, params: params || {} }, "*");
80
+ }
81
+ function toolText(result) {
82
+ if (!result) return null;
83
+ if (result.structuredContent) return result.structuredContent;
84
+ var block = result.content && result.content[0];
85
+ var text = block && block.text;
86
+ if (typeof text !== "string") return result;
87
+ try { return JSON.parse(text); } catch (e) { return { text: text }; }
88
+ }
89
+ function callTool(name, args) {
90
+ return send("tools/call", { name: name, arguments: args || {} }).then(function (result) {
91
+ if (result && result.isError) {
92
+ var err = toolText(result);
93
+ var message = (err && (err.message || err.error || err.text)) || "This call did not go through.";
94
+ throw new Error(typeof message === "string" ? message : JSON.stringify(message));
95
+ }
96
+ return toolText(result);
97
+ });
98
+ }
99
+ function listCall(kind, filters) {
100
+ filters = filters || {};
101
+ if (kind === "message") {
102
+ if (filters.id && (filters.replies === true || filters.replies === 1 || filters.replies === "1"))
103
+ return callTool("ziggs_message_replies", { messageId: filters.id, before: filters.before, limit: filters.limit });
104
+ if (filters.id) return callTool("ziggs_message_read", { messageId: filters.id });
105
+ return callTool("ziggs_message_list", {
106
+ conversationOf: page.rootMessageId,
107
+ agreementId: filters.agreementId,
108
+ taskId: filters.taskId,
109
+ participantIds: filters.participantIds,
110
+ before: filters.before,
111
+ limit: filters.limit || 30
112
+ }).then(function (result) {
113
+ return { page: { rootMessageId: page.rootMessageId, messageId: page.versionMessageId, artifactId: page.artifactId }, messages: (result && result.messages) || [], nextCursor: result && result.nextCursor };
114
+ });
115
+ }
116
+ if (kind === "task") {
117
+ if (filters.id) return callTool("ziggs_task_get", { taskId: filters.id });
118
+ return callTool("ziggs_task_list", { state: filters.state, assigneeId: filters.assigneeId, limit: filters.limit });
119
+ }
120
+ if (kind === "agreement") {
121
+ if (filters.id) return callTool("ziggs_agreement_get", { agreementId: filters.id });
122
+ return callTool("ziggs_agreement_list", {});
123
+ }
124
+ if (kind === "artifact" && filters.id) return callTool("ziggs_open", { artifactId: filters.id, html: true });
125
+ if (kind === "person") return callTool("ziggs_people", filters.q ? { q: filters.q } : {});
126
+ if (kind === "agent") return callTool("ziggs_agent_search", filters.q ? { q: filters.q } : {});
127
+ if (kind === "bucket") return callTool("ziggs_bucket_list", {});
128
+ throw new Error("This read is not available.");
129
+ }
130
+ function uuid() {
131
+ if (crypto.randomUUID) return crypto.randomUUID();
132
+ return "page-" + Date.now().toString(36) + "-" + Math.random().toString(36).slice(2);
133
+ }
134
+ function actCall(action, label) {
135
+ if (action && action.action === "submit") {
136
+ return callTool("ziggs_message_send", {
137
+ command: {
138
+ operationId: uuid(),
139
+ content: { text: "Filled in " + action.form },
140
+ audience: { kind: "explicit", principalIds: [] },
141
+ deliveries: { kind: "explicit", principalIds: [page.authorId] },
142
+ intent: "request",
143
+ relationships: { replyToMessageId: page.versionMessageId },
144
+ formEntry: { form: action.form, fields: action.fields }
145
+ }
146
+ });
147
+ }
148
+ if (action && action.action === "send" && action.command) return callTool("ziggs_message_send", { command: action.command });
149
+ throw new Error("This action is not available from a page.");
150
+ }
151
+ function showOpen(data) {
152
+ var body = document.getElementById("open-body");
153
+ body.textContent = typeof data === "string" ? data : JSON.stringify(data, null, 2);
154
+ document.getElementById("open").className = "show";
155
+ if (remeasure) remeasure();
156
+ }
157
+ function pageDocument(source) {
158
+ var helper = "(function(){var protocol='ziggs-page-v1';var channel=" + JSON.stringify(channel) + ";var pending=new Map();var sequence=0;var listeners=new Map();addEventListener('message',function(event){var data=event.data;if(event.source!==parent||!data||data.protocol!==protocol||data.channel!==channel)return;if(typeof data.event==='string'){for(var fn of (listeners.get(data.event)||[])){try{fn(data.detail||{})}catch(e){}}return;}var entry=pending.get(data.id);if(!entry)return;pending.delete(data.id);clearTimeout(entry.timer);if(data.ok===true)entry.resolve(data.result);else entry.reject(new Error(data.error||'This read is not available.'));});function call(method,args){return new Promise(function(resolve,reject){if(pending.size>=16)return reject(new Error('Too many pending reads.'));var id='r'+(++sequence);var timer=setTimeout(function(){pending.delete(id);reject(new Error('The page request timed out.'));}, method==='act'?300000:15000);pending.set(id,{resolve:resolve,reject:reject,timer:timer});parent.postMessage({protocol:protocol,channel:channel,id:id,method:method,args:args||{}},'*');});}Object.defineProperty(window,'ziggs',{value:Object.freeze({me:function(){return call('me');},list:function(kind,filters){return call('list',Object.assign({kind:kind},filters||{}));},open:function(kind,id){return call('open',{kind:kind,id:id});},act:function(action,label){return call('act',label?{action:action,label:label}:{action:action});},on:function(event,fn){if(!listeners.has(event))listeners.set(event,new Set());listeners.get(event).add(fn);return function(){listeners.get(event).delete(fn);};}}),writable:false,configurable:false});parent.postMessage({protocol:protocol,channel:channel,ready:true},'*');})();";
159
+ return "<!DOCTYPE html><html><head><meta charset=\\"utf-8\\"><meta http-equiv=\\"Content-Security-Policy\\" content=\\"default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; connect-src 'none'; font-src 'none'; media-src 'none'; frame-src 'none'; worker-src 'none'; object-src 'none'; form-action 'none'; base-uri 'none'\\"><script>" + helper + "</script></head>" + source;
160
+ }
161
+ function runPage(request) {
162
+ if (request.method === "me") return Promise.resolve(page.viewer);
163
+ if (request.method === "list") return listCall(String(request.args.kind), request.args);
164
+ if (request.method === "open") return callTool("ziggs_open", { ref: request.args.id }).then(function (result) { showOpen(result); return { opened: true }; });
165
+ if (request.method === "act") return actCall(request.args.action, request.args.label);
166
+ return Promise.reject(new Error("Unknown method"));
167
+ }
168
+ function bindFrame(frame) {
169
+ window.addEventListener("message", function (event) {
170
+ if (event.source !== frame.contentWindow) return;
171
+ var data = event.data;
172
+ if (!data || data.protocol !== "ziggs-page-v1" || data.channel !== channel) return;
173
+ if (data.ready === true) { document.getElementById("status").hidden = true; if (remeasure) remeasure(); return; }
174
+ if (!data.id || !data.method) return;
175
+ runPage(data).then(function (result) {
176
+ frame.contentWindow.postMessage({ protocol: "ziggs-page-v1", channel: channel, id: data.id, ok: true, result: result }, "*");
177
+ }, function (error) {
178
+ frame.contentWindow.postMessage({ protocol: "ziggs-page-v1", channel: channel, id: data.id, ok: false, error: error && error.message ? error.message : "This read is not available." }, "*");
179
+ });
180
+ });
181
+ }
182
+ function render(data) {
183
+ page = data;
184
+ var status = document.getElementById("status");
185
+ var frame = document.getElementById("frame");
186
+ if (!data || !data.html) { status.hidden = false; status.textContent = "No page to show."; return; }
187
+ status.textContent = "Opening “" + data.title + "”…";
188
+ bindFrame(frame);
189
+ frame.srcdoc = pageDocument(data.html);
190
+ frame.hidden = false;
191
+ if (remeasure) remeasure();
192
+ }
193
+ window.addEventListener("message", function (event) {
194
+ if (event.source !== window.parent) return;
195
+ var msg = event.data;
196
+ if (!msg || msg.jsonrpc !== "2.0") return;
197
+ if (msg.id != null && pending[msg.id] && !msg.method) {
198
+ var waiter = pending[msg.id];
199
+ delete pending[msg.id];
200
+ if (msg.error) waiter.reject(msg.error); else waiter.resolve(msg.result);
201
+ return;
202
+ }
203
+ if (msg.method === "ui/notifications/tool-result") render((msg.params || {}).structuredContent);
204
+ });
205
+ document.getElementById("open-close").addEventListener("click", function () {
206
+ document.getElementById("open").className = "";
207
+ if (remeasure) remeasure();
208
+ });
209
+ function reportSize() {
210
+ var lastWidth = 0, lastHeight = 0, queued = false;
211
+ function measure() {
212
+ if (queued) return;
213
+ queued = true;
214
+ var next = typeof requestAnimationFrame === "function" ? requestAnimationFrame : function (fn) { setTimeout(fn, 16); };
215
+ next(function () {
216
+ queued = false;
217
+ var doc = document.documentElement, previous = doc.style.height;
218
+ doc.style.height = "max-content";
219
+ var height = Math.max(480, Math.ceil(doc.getBoundingClientRect().height));
220
+ doc.style.height = previous;
221
+ var width = Math.ceil(window.innerWidth);
222
+ if (width === lastWidth && height === lastHeight) return;
223
+ lastWidth = width; lastHeight = height;
224
+ notify("ui/notifications/size-changed", { width: width, height: height });
225
+ });
226
+ }
227
+ remeasure = measure;
228
+ measure();
229
+ if (typeof ResizeObserver === "function") {
230
+ var observer = new ResizeObserver(measure);
231
+ observer.observe(document.documentElement);
232
+ observer.observe(document.body);
233
+ }
234
+ }
235
+ send("ui/initialize", {
236
+ protocolVersion: "2026-01-26",
237
+ appInfo: { name: "Ziggs page", version: "1" },
238
+ appCapabilities: {}
239
+ }).then(function () {
240
+ notify("ui/notifications/initialized", {});
241
+ reportSize();
242
+ }, function () {});
243
+ })();
244
+ </script>
245
+ </body>
246
+ </html>
247
+ `;
@@ -0,0 +1,28 @@
1
+ import { type Creds } from '@ziggs-ai/api-client';
2
+ /**
3
+ * Load the page a message carries, as HTML, plus who is looking, so the view
4
+ * can draw it in the chat and answer window.ziggs through this assistant.
5
+ */
6
+ export declare function loadPageCard(ref: string, creds: Creds): Promise<{
7
+ content: {
8
+ type: "text";
9
+ text: string;
10
+ }[];
11
+ structuredContent: Record<string, unknown>;
12
+ }>;
13
+ export declare function pageShowToolResult(ref: unknown, creds: Creds): Promise<{
14
+ structuredContent: {
15
+ error: import("@ziggs-ai/api-client").OperationError;
16
+ };
17
+ content: {
18
+ type: "text";
19
+ text: string;
20
+ }[];
21
+ isError: boolean;
22
+ } | {
23
+ content: {
24
+ type: "text";
25
+ text: string;
26
+ }[];
27
+ structuredContent: Record<string, unknown>;
28
+ }>;
@@ -0,0 +1,95 @@
1
+ import { CallerContextClient, ContextOpenClient, MessageRecordsClient, } from '@ziggs-ai/api-client';
2
+ import { pageCardResult } from './pageCard.js';
3
+ import { toolError } from './toolError.js';
4
+ const HTML_DOCUMENT = /^\s*(?:<!doctype\s+html|<html)(?:\s|>)/i;
5
+ function messageIdOf(ref) {
6
+ const trimmed = ref.trim();
7
+ if (!trimmed)
8
+ return null;
9
+ const pages = trimmed.match(/\/pages\/([^/?#]+)/i);
10
+ if (pages?.[1])
11
+ return decodeURIComponent(pages[1]);
12
+ if (/^https?:\/\//i.test(trimmed))
13
+ return null;
14
+ return trimmed;
15
+ }
16
+ function htmlOf(opened) {
17
+ const first = opened.page?.items?.[0];
18
+ if (!first || typeof first !== 'object' || Array.isArray(first))
19
+ return null;
20
+ const text = first.text;
21
+ if (typeof text !== 'string' || !HTML_DOCUMENT.test(text))
22
+ return null;
23
+ return text;
24
+ }
25
+ function viewerOf(callers) {
26
+ const user = callers.session?.user;
27
+ const username = user && typeof user === 'object' && typeof user.username === 'string'
28
+ ? user.username
29
+ : null;
30
+ const userId = user && typeof user === 'object' && typeof user.id === 'string'
31
+ ? user.id
32
+ : callers.principalId;
33
+ const activeOrgId = callers.activeOrgId ?? callers.workspaces?.activeOrgId ?? null;
34
+ return {
35
+ principalId: callers.principalId,
36
+ activeOrgId,
37
+ userId,
38
+ username,
39
+ orgId: activeOrgId,
40
+ };
41
+ }
42
+ function asCard(message, html, viewer) {
43
+ const page = message.page;
44
+ if (!page?.id) {
45
+ throw Object.assign(new Error('That message does not carry a page.'), { code: 'NOT_A_PAGE' });
46
+ }
47
+ return {
48
+ title: message.content.text.trim() || 'Page',
49
+ html,
50
+ rootMessageId: message.rootMessageId,
51
+ versionMessageId: message.messageId,
52
+ artifactId: page.id,
53
+ authorId: message.sender.ref,
54
+ authorName: message.sender.name,
55
+ viewer,
56
+ };
57
+ }
58
+ /**
59
+ * Load the page a message carries, as HTML, plus who is looking, so the view
60
+ * can draw it in the chat and answer window.ziggs through this assistant.
61
+ */
62
+ export async function loadPageCard(ref, creds) {
63
+ const messageId = messageIdOf(ref);
64
+ if (!messageId) {
65
+ throw Object.assign(new Error('Name the message or /pages/ address that carries the page.'), { code: 'INVALID_INPUT' });
66
+ }
67
+ const agentId = creds.agentId ?? '';
68
+ const messages = new MessageRecordsClient(creds.operatorKey, agentId);
69
+ const open = new ContextOpenClient(creds.operatorKey, agentId);
70
+ const callers = new CallerContextClient(creds.operatorKey, agentId);
71
+ const message = await messages.get(messageId);
72
+ if (!message.page?.id) {
73
+ throw Object.assign(new Error('That message does not carry a page.'), { code: 'NOT_A_PAGE' });
74
+ }
75
+ const [opened, who] = await Promise.all([
76
+ open.open({ artifactId: message.page.id, html: true }),
77
+ callers.getCallers(),
78
+ ]);
79
+ const html = htmlOf(opened);
80
+ if (!html) {
81
+ throw Object.assign(new Error('That page has no HTML to show.'), { code: 'NOT_A_PAGE' });
82
+ }
83
+ return pageCardResult(asCard(message, html, viewerOf(who)));
84
+ }
85
+ export async function pageShowToolResult(ref, creds) {
86
+ try {
87
+ if (typeof ref !== 'string' || !ref.trim()) {
88
+ throw Object.assign(new Error('Name the message or /pages/ address that carries the page.'), { code: 'INVALID_INPUT' });
89
+ }
90
+ return await loadPageCard(ref, creds);
91
+ }
92
+ catch (error) {
93
+ return toolError(error);
94
+ }
95
+ }
@@ -29,7 +29,7 @@ const ACCESS = 'Missing access: use ziggs_access_request for that resource. Choo
29
29
  * What to make from a person's ask. Without it an assistant sends a message
30
30
  * for everything, because sending is the one write every session uses.
31
31
  */
32
- const MAKE = 'Make what is asked: work for someone (your person too) is a task; a view, tracker or form, a page; a subject kept with people, a bucket; talk, a message. Answer by its reply action.';
32
+ const MAKE = 'Make what is asked: work for someone (your person too) is a task; a view, tracker or form, a page — show with ziggs_page_show, not a website; a subject kept with people, a bucket (a workspace in its audience is everyone in it); talk, a message. Answer by its reply action.';
33
33
  const GROUNDING = 'Ground summaries in records: tie dates to named milestones; distinguish inquiries, approvals and completed actions. Verify completion.';
34
34
  const RULES = [
35
35
  WAIT,
@@ -56,7 +56,7 @@ export function sessionRules(door) {
56
56
  * budget the tests enforce, rather than appended by the backend after the
57
57
  * text was already sized: that append is what cut the text mid-word.
58
58
  */
59
- const EVENTS = 'Inbox events: a host may subscribe to ziggs.inbox.updated per workspace; promise alerts only once it confirms. An event carries only orgId: read that inbox and follow its rules.';
59
+ const EVENTS = 'Inbox events: ziggs.inbox.updated per workspace carries only orgId; read that inbox.';
60
60
  /**
61
61
  * Compact door only, when the local server rings a Claude Code session. The
62
62
  * event says that mail arrived, never what it says.
@@ -42,7 +42,7 @@ export declare const PROTOCOL: {
42
42
  */
43
43
  readonly workOrder: "A brief from the principal under a hire is a work order: create a task on yourself under that agreement (ziggs_task_create). A stranger's brief is not a work order: they hire you through your store listing, or through an agreement you draft when you have no listing, and until then it is conversation. workBrief.work.state listing is that conversation under your listing: answer with the reply action, never another conversation, and when they want something the listing does not cover use the propose_terms action (ziggs_agreement_bid to them), and describe only the terms of the proposal that went through. Do not invent worker_next, a wake store, or a blocked task state. Waiting-on-person is a receipt. A held graph is not your work until dependencies release; failed or cancelled deps are not inputs. Withdraw a held graph by cancelling the root (ziggs_task_cancel). A live hire does not take a second hire or an in-place amend.";
44
44
  /** What to make from a person's ask: the same rule as the connect text. */
45
- readonly make: "Make what your person asks for: work someone must do (them too) is a task with an assignee (ziggs_task_create); a teammate, your person or an agent they run needs no agreement. A view, tracker or form is a page (ziggs_page_guide, then ziggs_page). A subject kept with people is a bucket, called a brain in the app (ziggs_bucket_create). Talk is a message.";
45
+ readonly make: "Make what your person asks for: work someone must do (them too) is a task with an assignee (ziggs_task_create); a teammate, your person or an agent they run needs no agreement. A view, tracker or form is a page (ziggs_page_guide, then ziggs_page). Show a page in this chat with ziggs_page_show, not a website link. A subject kept with people is a bucket, called a brain in the app (ziggs_bucket_create); a workspace in its audience is everyone in it. Talk is a message.";
46
46
  /** posted-first: how ANY engagement starts. */
47
47
  readonly engage: "Engaging any counterparty follows the ladder: (1) REUSE an active agreement that already covers the work on matching terms; (2) CLAIM their posted listing (browse ziggs_marketplace_view; check listings after ziggs_agent_search) — listings are take-it-or-leave-it, never counter one; (3) POST a request (ziggs_agreement_request) when nothing listed fits, and supply claims you; (4) go direct only for bespoke terms, renegotiation, or a named counterparty with no listing — ziggs_agreement_buy when they do the work, ziggs_agreement_bid when you do — most published agents are claim-only and refuse direct proposals with a pointer at their listing. Subcontracting under an active parent is its own rail, unaffected. LINK proposals (connect requests) are the exception to claim-only: they carry draft terms and are always negotiable — counter freely; the authorized parties approve the final terms.";
48
48
  /**
@@ -43,7 +43,7 @@ export const PROTOCOL = {
43
43
  */
44
44
  workOrder: 'A brief from the principal under a hire is a work order: create a task on yourself under that agreement (ziggs_task_create). A stranger\'s brief is not a work order: they hire you through your store listing, or through an agreement you draft when you have no listing, and until then it is conversation. workBrief.work.state listing is that conversation under your listing: answer with the reply action, never another conversation, and when they want something the listing does not cover use the propose_terms action (ziggs_agreement_bid to them), and describe only the terms of the proposal that went through. Do not invent worker_next, a wake store, or a blocked task state. Waiting-on-person is a receipt. A held graph is not your work until dependencies release; failed or cancelled deps are not inputs. Withdraw a held graph by cancelling the root (ziggs_task_cancel). A live hire does not take a second hire or an in-place amend.',
45
45
  /** What to make from a person's ask: the same rule as the connect text. */
46
- make: 'Make what your person asks for: work someone must do (them too) is a task with an assignee (ziggs_task_create); a teammate, your person or an agent they run needs no agreement. A view, tracker or form is a page (ziggs_page_guide, then ziggs_page). A subject kept with people is a bucket, called a brain in the app (ziggs_bucket_create). Talk is a message.',
46
+ make: 'Make what your person asks for: work someone must do (them too) is a task with an assignee (ziggs_task_create); a teammate, your person or an agent they run needs no agreement. A view, tracker or form is a page (ziggs_page_guide, then ziggs_page). Show a page in this chat with ziggs_page_show, not a website link. A subject kept with people is a bucket, called a brain in the app (ziggs_bucket_create); a workspace in its audience is everyone in it. Talk is a message.',
47
47
  /** posted-first: how ANY engagement starts. */
48
48
  engage: 'Engaging any counterparty follows the ladder: (1) REUSE an active agreement that already covers the work on matching terms; (2) CLAIM their posted listing (browse ziggs_marketplace_view; check listings after ziggs_agent_search) — listings are take-it-or-leave-it, never counter one; (3) POST a request (ziggs_agreement_request) when nothing listed fits, and supply claims you; (4) go direct only for bespoke terms, renegotiation, or a named counterparty with no listing — ziggs_agreement_buy when they do the work, ziggs_agreement_bid when you do — most published agents are claim-only and refuse direct proposals with a pointer at their listing. Subcontracting under an active parent is its own rail, unaffected. LINK proposals (connect requests) are the exception to claim-only: they carry draft terms and are always negotiable — counter freely; the authorized parties approve the final terms.',
49
49
  /**
package/dist/tools.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import { MESSAGING_CAPABILITIES } from '@ziggs-ai/api-client';
2
2
  import { isDirectorySurface } from './directorySurface.js';
3
3
  import { INBOX_CARD_TOOL_META, inboxCardResult, registerInboxCardResource, } from './inboxCard.js';
4
+ import { PAGE_CARD_TOOL_META, registerPageCardResource } from './pageCard.js';
5
+ import { pageShowToolResult } from './pageShow.js';
4
6
  import { z } from 'zod';
5
7
  import { presentResourceActions, getAgreement, getMyAgreements, respondToAgreement, revokeAgreement, counterAgreement, fulfillAgreement, ConnectionsClient, ContextReadClient, GrantsClient, InboxClient, SessionsClient, AssistantConnectionClient, createTask, isHeldTaskCreate, updateTaskState, acknowledgeTaskControl, replaceTaskPlan, updateTaskPlanSteps, listTasks, getTask, getBackendUrl, fetchMyOrgs, fetchSessionAccess, CallerContextClient, isMcpOAuthDelegateSession, GRANTS_CAPABILITIES, BUCKET_CAPABILITIES, AGREEMENT_TERMS_PARAMS, AGREEMENT_VERB_CAPABILITIES, LISTING_DOOR_CAPABILITIES, CONTEXT_GRANT_SCOPE_KINDS, contextCallersCapability, contextReadCapability, openCapability, accessExplainCapability, contextExpandReachCapability, contextDiscoverGrantableCapability, recordArtifactCapability, listArtifactsCapability, findArtifactsCapability, attachArtifactCapability, reviewArtifactContributionCapability, contributeArtifactCapability, uploadArtifactUrlCapability, completeArtifactFileCapability, downloadArtifactCapability, connectionProxyCapability, requestConnectionCapability, agreementClaimCapability, agreementSubcontractCapability, listTasksCapability, cancelTaskCapability, passTaskOnCapability, delegateTaskCapability, marketplaceViewCapability, parseListFields, pickListedRows, listedFieldNote, sessionOrientation, presentTaskOutcome, explainRefusedRead, RESOURCE_HIDDEN_MESSAGE, SOURCES_DESCRIPTION, } from '@ziggs-ai/api-client';
6
8
  import { decodeOperatorKeyClaims } from './operatorKey.js';
@@ -800,6 +802,12 @@ export function registerZiggsTools(server, creds, cfg) {
800
802
  }
801
803
  }, INBOX_CARD_TOOL_META);
802
804
  registerInboxCardResource(server);
805
+ registerStrictTool(server, 'ziggs_page_show', {
806
+ ref: z
807
+ .string()
808
+ .describe('The message that carries the page, or its /pages/ address.'),
809
+ }, readOnly('Show a page in this chat'), async ({ ref }) => pageShowToolResult(ref, creds), PAGE_CARD_TOOL_META);
810
+ registerPageCardResource(server);
803
811
  /**
804
812
  * The ack, split out of the read.
805
813
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/ziggs-mcp",
3
- "version": "0.43.28",
3
+ "version": "0.43.30",
4
4
  "description": "MCP server for Claude Code, Cursor, and other MCP hosts — act as your Ziggs delegate agent",
5
5
  "homepage": "https://ziggsai.com/docs",
6
6
  "bugs": {
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@modelcontextprotocol/sdk": "^1.29.0",
54
- "@ziggs-ai/api-client": "0.42.23",
54
+ "@ziggs-ai/api-client": "0.42.24",
55
55
  "dotenv": "^16.6.1",
56
56
  "zod": "^3.24.2",
57
57
  "zod-to-json-schema": "^3.25.1"
@@ -8,7 +8,7 @@ You are a delegate agent on a Ziggs team. Read workBrief for the current work an
8
8
  - Flow: inbox → read → act → ack. Use the workspace your human named. If they didn't, ask them. Never guess.
9
9
  - All communication uses ziggs_message_send with command:{operationId,content:{text},audience:{kind:"explicit",principalIds:[...]},deliveries:{kind:"explicit",principalIds:[...]},intent}. Every message carries one flag: intent "request" wakes the agents it is delivered to; intent "fyi" is delivered and filed, never woken on. Nothing records whether a request was answered: a reply is ziggs_message_send with your text and relationships.replyToMessageId naming the message it answers, and that link is the only link. Select command.mandate:{agreementId,taskId?} for work; a message carrying relationships.taskIds or a task mandate is that task's input. relationships.replyToMessageId is causal only, never access, delivery or completion. Reuse the exact operationId and command after an uncertain response; conflicts are refusals. ziggs_message_replies reads authorized durable replies, independently of receipts. Pages invoke these same operations. Reading never advances the watermark. Pass ackTo VERBATIM to ziggs_inbox_ack to record observation. Complete assigned work separately with handledDeliveryIds containing only successfully handled receiptId values. Failed or inaccessible assignments stay pending. A resource ID is not a receipt. Carry executionContext.contextId as executionContextId on every read and action for that assignment, and isolate model state between execution contexts. Rows without your assignment are observations, never your completion receipts. Never rewind an ack to an older value.
10
10
  - Honor task.control when opening work or handling a task change. For pause or stop, stop starting actions for that task, settle in-flight work, then call ziggs_task_acknowledge_control with its current requestId and supported=true. If you cannot honor it, report supported=false. Never attest that another runtime stopped. Continue unrelated conversation and tasks. Resume allows this task to run again. Work is a task (the ticket), under an agreement only when it is done under one. Read it from the inbox — or, if handed a bare taskId, open it with ziggs_task_get — then post progress by naming the steps that changed with ziggs_task_update_steps. Restructure the checklist with ziggs_task_replace_plan (full list).
11
- - Make what your person asks for: work someone must do (them too) is a task with an assignee (ziggs_task_create); a teammate, your person or an agent they run needs no agreement. A view, tracker or form is a page (ziggs_page_guide, then ziggs_page). A subject kept with people is a bucket, called a brain in the app (ziggs_bucket_create). Talk is a message.
11
+ - Make what your person asks for: work someone must do (them too) is a task with an assignee (ziggs_task_create); a teammate, your person or an agent they run needs no agreement. A view, tracker or form is a page (ziggs_page_guide, then ziggs_page). Show a page in this chat with ziggs_page_show, not a website link. A subject kept with people is a bucket, called a brain in the app (ziggs_bucket_create); a workspace in its audience is everyone in it. Talk is a message.
12
12
  - A brief from the principal under a hire is a work order: create a task on yourself under that agreement (ziggs_task_create). A stranger's brief is not a work order: they hire you through your store listing, or through an agreement you draft when you have no listing, and until then it is conversation. workBrief.work.state listing is that conversation under your listing: answer with the reply action, never another conversation, and when they want something the listing does not cover use the propose_terms action (ziggs_agreement_bid to them), and describe only the terms of the proposal that went through. Do not invent worker_next, a wake store, or a blocked task state. Waiting-on-person is a receipt. A held graph is not your work until dependencies release; failed or cancelled deps are not inputs. Withdraw a held graph by cancelling the root (ziggs_task_cancel). A live hire does not take a second hire or an in-place amend.
13
13
  - Engaging any counterparty follows the ladder: (1) REUSE an active agreement that already covers the work on matching terms; (2) CLAIM their posted listing (browse ziggs_marketplace_view; check listings after ziggs_agent_search) — listings are take-it-or-leave-it, never counter one; (3) POST a request (ziggs_agreement_request) when nothing listed fits, and supply claims you; (4) go direct only for bespoke terms, renegotiation, or a named counterparty with no listing — ziggs_agreement_buy when they do the work, ziggs_agreement_bid when you do — most published agents are claim-only and refuse direct proposals with a pointer at their listing. Subcontracting under an active parent is its own rail, unaffected. LINK proposals (connect requests) are the exception to claim-only: they carry draft terms and are always negotiable — counter freely; the authorized parties approve the final terms.
14
14
  - ziggs_agreement_list with no scope returns the agreements you can reach, including hires. scope mine is only agreements you are a party to. ziggs_agent_search says already hired and names the agreement and workspace when you already hire that agent.
@@ -27,7 +27,7 @@ _You are a delegate agent on a Ziggs team. Read workBrief for the current work a
27
27
  - Flow: inbox → read → act → ack. Use the workspace your human named. If they didn't, ask them. Never guess.
28
28
  - All communication uses ziggs_message_send with command:{operationId,content:{text},audience:{kind:"explicit",principalIds:[...]},deliveries:{kind:"explicit",principalIds:[...]},intent}. Every message carries one flag: intent "request" wakes the agents it is delivered to; intent "fyi" is delivered and filed, never woken on. Nothing records whether a request was answered: a reply is ziggs_message_send with your text and relationships.replyToMessageId naming the message it answers, and that link is the only link. Select command.mandate:{agreementId,taskId?} for work; a message carrying relationships.taskIds or a task mandate is that task's input. relationships.replyToMessageId is causal only, never access, delivery or completion. Reuse the exact operationId and command after an uncertain response; conflicts are refusals. ziggs_message_replies reads authorized durable replies, independently of receipts. Pages invoke these same operations. Reading never advances the watermark. Pass ackTo VERBATIM to ziggs_inbox_ack to record observation. Complete assigned work separately with handledDeliveryIds containing only successfully handled receiptId values. Failed or inaccessible assignments stay pending. A resource ID is not a receipt. Carry executionContext.contextId as executionContextId on every read and action for that assignment, and isolate model state between execution contexts. Rows without your assignment are observations, never your completion receipts. Never rewind an ack to an older value.
29
29
  - Honor task.control when opening work or handling a task change. For pause or stop, stop starting actions for that task, settle in-flight work, then call ziggs_task_acknowledge_control with its current requestId and supported=true. If you cannot honor it, report supported=false. Never attest that another runtime stopped. Continue unrelated conversation and tasks. Resume allows this task to run again. Work is a task (the ticket), under an agreement only when it is done under one. Read it from the inbox — or, if handed a bare taskId, open it with ziggs_task_get — then post progress by naming the steps that changed with ziggs_task_update_steps. Restructure the checklist with ziggs_task_replace_plan (full list).
30
- - Make what your person asks for: work someone must do (them too) is a task with an assignee (ziggs_task_create); a teammate, your person or an agent they run needs no agreement. A view, tracker or form is a page (ziggs_page_guide, then ziggs_page). A subject kept with people is a bucket, called a brain in the app (ziggs_bucket_create). Talk is a message.
30
+ - Make what your person asks for: work someone must do (them too) is a task with an assignee (ziggs_task_create); a teammate, your person or an agent they run needs no agreement. A view, tracker or form is a page (ziggs_page_guide, then ziggs_page). Show a page in this chat with ziggs_page_show, not a website link. A subject kept with people is a bucket, called a brain in the app (ziggs_bucket_create); a workspace in its audience is everyone in it. Talk is a message.
31
31
  - A brief from the principal under a hire is a work order: create a task on yourself under that agreement (ziggs_task_create). A stranger's brief is not a work order: they hire you through your store listing, or through an agreement you draft when you have no listing, and until then it is conversation. workBrief.work.state listing is that conversation under your listing: answer with the reply action, never another conversation, and when they want something the listing does not cover use the propose_terms action (ziggs_agreement_bid to them), and describe only the terms of the proposal that went through. Do not invent worker_next, a wake store, or a blocked task state. Waiting-on-person is a receipt. A held graph is not your work until dependencies release; failed or cancelled deps are not inputs. Withdraw a held graph by cancelling the root (ziggs_task_cancel). A live hire does not take a second hire or an in-place amend.
32
32
  - Engaging any counterparty follows the ladder: (1) REUSE an active agreement that already covers the work on matching terms; (2) CLAIM their posted listing (browse ziggs_marketplace_view; check listings after ziggs_agent_search) — listings are take-it-or-leave-it, never counter one; (3) POST a request (ziggs_agreement_request) when nothing listed fits, and supply claims you; (4) go direct only for bespoke terms, renegotiation, or a named counterparty with no listing — ziggs_agreement_buy when they do the work, ziggs_agreement_bid when you do — most published agents are claim-only and refuse direct proposals with a pointer at their listing. Subcontracting under an active parent is its own rail, unaffected. LINK proposals (connect requests) are the exception to claim-only: they carry draft terms and are always negotiable — counter freely; the authorized parties approve the final terms.
33
33
  - ziggs_agreement_list with no scope returns the agreements you can reach, including hires. scope mine is only agreements you are a party to. ziggs_agent_search says already hired and names the agreement and workspace when you already hire that agent.