@ziggs-ai/api-client 0.38.0 → 0.39.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.
- package/CHANGELOG.md +34 -0
- package/README.md +14 -36
- package/dist/capabilities/agreementVerbs.js +13 -21
- package/dist/capabilities/agreements.d.ts +2 -3
- package/dist/capabilities/agreements.js +8 -43
- package/dist/capabilities/artifacts.d.ts +6 -0
- package/dist/capabilities/artifacts.js +84 -43
- package/dist/capabilities/connections.js +10 -7
- package/dist/capabilities/context.d.ts +1 -1
- package/dist/capabilities/context.js +52 -45
- package/dist/capabilities/discovery.js +5 -5
- package/dist/capabilities/everyday.d.ts +1 -1
- package/dist/capabilities/everyday.js +1 -2
- package/dist/capabilities/index.d.ts +3 -4
- package/dist/capabilities/index.js +3 -4
- package/dist/capabilities/introductions.d.ts +1 -0
- package/dist/capabilities/introductions.js +64 -17
- package/dist/capabilities/links.d.ts +1 -9
- package/dist/capabilities/links.js +40 -39
- package/dist/capabilities/mcpBriefs.js +41 -34
- package/dist/capabilities/messaging.d.ts +9 -0
- package/dist/capabilities/messaging.js +11 -0
- package/dist/capabilities/nextCall.js +8 -17
- package/dist/capabilities/sources.d.ts +2 -3
- package/dist/capabilities/sources.js +1 -2
- package/dist/capabilities/tasks.d.ts +1 -0
- package/dist/capabilities/tasks.js +43 -2
- package/dist/capabilities/toolLane.js +2 -2
- package/dist/engagementGuide.d.ts +2 -2
- package/dist/engagementGuide.js +6 -6
- package/dist/handles.d.ts +1 -1
- package/dist/handles.js +2 -2
- package/dist/http/AgreementClient.d.ts +25 -63
- package/dist/http/AgreementClient.js +14 -65
- package/dist/http/ArtifactsClient.d.ts +31 -19
- package/dist/http/ArtifactsClient.js +43 -62
- package/dist/http/ConnectionsClient.d.ts +6 -7
- package/dist/http/ConnectionsClient.js +5 -3
- package/dist/http/ContextDiscoveryClient.d.ts +2 -2
- package/dist/http/ContextGrantsClient.d.ts +9 -15
- package/dist/http/ContextGrantsClient.js +3 -5
- package/dist/http/ContextOpenClient.d.ts +5 -6
- package/dist/http/ContextOpenClient.js +11 -4
- package/dist/http/ContextReadClient.d.ts +23 -27
- package/dist/http/ContextReadClient.js +24 -23
- package/dist/http/ExecutionContextClient.d.ts +5 -1
- package/dist/http/ExecutionContextClient.js +48 -1
- package/dist/http/IntroductionsClient.d.ts +33 -4
- package/dist/http/IntroductionsClient.js +6 -2
- package/dist/http/MessageRecordsClient.d.ts +36 -0
- package/dist/http/MessageRecordsClient.js +30 -0
- package/dist/http/SessionsClient.d.ts +5 -5
- package/dist/http/SessionsClient.js +6 -6
- package/dist/http/TaskClient.d.ts +35 -6
- package/dist/http/TaskClient.js +38 -36
- package/dist/http/agreementFlows.d.ts +2 -3
- package/dist/http/agreementFlows.js +5 -5
- package/dist/http/index.d.ts +3 -5
- package/dist/http/index.js +3 -4
- package/dist/http/operatorHeaders.d.ts +3 -0
- package/dist/http/operatorHeaders.js +14 -5
- package/dist/inboxAck.d.ts +2 -2
- package/dist/inboxAck.js +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/types.d.ts +25 -55
- package/package.json +2 -2
- package/dist/capabilities/chat.d.ts +0 -43
- package/dist/capabilities/chat.js +0 -196
- package/dist/capabilities/chatListFields.d.ts +0 -14
- package/dist/capabilities/chatListFields.js +0 -61
- package/dist/http/ChatClient.d.ts +0 -187
- package/dist/http/ChatClient.js +0 -219
- package/dist/http/MessagesClient.d.ts +0 -40
- package/dist/http/MessagesClient.js +0 -81
|
@@ -104,7 +104,6 @@ async function recordFileArtifact(args, env, visibility) {
|
|
|
104
104
|
byteSize,
|
|
105
105
|
format: args['format'],
|
|
106
106
|
visibility,
|
|
107
|
-
chatId: args['chatId'],
|
|
108
107
|
agreementId: args['agreementId'],
|
|
109
108
|
serviceAgreementId: args['serviceAgreementId'] ?? (!taskId && !args['agreementId'] ? env.serviceAgreementId : undefined),
|
|
110
109
|
taskId,
|
|
@@ -123,7 +122,6 @@ async function recordFileArtifact(args, env, visibility) {
|
|
|
123
122
|
artifactId: uploaded.artifactId,
|
|
124
123
|
artifact,
|
|
125
124
|
visibility,
|
|
126
|
-
chatId: args['chatId'],
|
|
127
125
|
agreementId: args['agreementId'],
|
|
128
126
|
taskId,
|
|
129
127
|
byteSize,
|
|
@@ -154,7 +152,7 @@ export const recordArtifactCapability = {
|
|
|
154
152
|
title: 'Record an artifact',
|
|
155
153
|
descriptions: {
|
|
156
154
|
sdk: 'Write an artifact — text (text) or a file (filename + mime + contentBase64; the upload ' +
|
|
157
|
-
'happens inside this call). Scope is optional: pass agreementId
|
|
155
|
+
'happens inside this call). Scope is optional: pass agreementId to record it there, ' +
|
|
158
156
|
'or pass no scope at all to record it as yours alone and attach it somewhere later. ' +
|
|
159
157
|
'Set visibility explicitly. For a finished deliverable, set contentType=result and pass ' +
|
|
160
158
|
'taskId to bind it to the task. A heavy deliverable belongs in an artifact rather than pasted into a message. ' +
|
|
@@ -168,7 +166,7 @@ export const recordArtifactCapability = {
|
|
|
168
166
|
},
|
|
169
167
|
contentBase64: {
|
|
170
168
|
type: 'string',
|
|
171
|
-
description: '
|
|
169
|
+
description: 'File bytes; requires filename and mime. Handles upload/checksum. Over ~1MB: use artifact_upload_url.',
|
|
172
170
|
},
|
|
173
171
|
name: {
|
|
174
172
|
type: 'string',
|
|
@@ -190,15 +188,14 @@ export const recordArtifactCapability = {
|
|
|
190
188
|
visibility: {
|
|
191
189
|
type: 'string',
|
|
192
190
|
required: true,
|
|
193
|
-
enum: ['
|
|
194
|
-
description: '
|
|
191
|
+
enum: ['address', 'agent-private'],
|
|
192
|
+
description: 'address = eligible for authorized work readers; agent-private = not shared with other agents. Discussion references grant no access. ' +
|
|
195
193
|
'Neither is permanent: you can share any artifact later with a specific agent.',
|
|
196
194
|
},
|
|
197
195
|
serviceAgreementId: { type: 'string', description: 'Agreement authorizing this work, separate from the destination chat. Defaults to the SDK wake agreement when no task/agreement scope is supplied.' },
|
|
198
|
-
chatId: { type: 'string', description: 'Optional chat scope' },
|
|
199
196
|
agreementId: {
|
|
200
197
|
type: 'string',
|
|
201
|
-
description: 'Optional agreement scope — for a hire deliverable, prefer this.
|
|
198
|
+
description: 'Optional agreement scope — for a hire deliverable, prefer this. This names work, not a discussion.',
|
|
202
199
|
},
|
|
203
200
|
taskId: {
|
|
204
201
|
type: 'string',
|
|
@@ -222,21 +219,22 @@ export const recordArtifactCapability = {
|
|
|
222
219
|
},
|
|
223
220
|
needsAgentId: true,
|
|
224
221
|
handler: async (args, env) => {
|
|
222
|
+
if ('addressId' in args)
|
|
223
|
+
throw new Error('addressId is retired; use explicit work or an exact message artifact reference');
|
|
225
224
|
const agreementId = args['agreementId'];
|
|
226
|
-
// Both containers is refused, not resolved. This used to drop
|
|
225
|
+
// Both containers is refused, not resolved. This used to drop addressId and
|
|
227
226
|
// call agreement the winner — two answers to one call, and the silent one
|
|
228
227
|
// was worse: the artifact landed somewhere the caller had just been told it
|
|
229
228
|
// would also appear. The refusal itself lives in ArtifactsClient, the one
|
|
230
229
|
// gate every writer goes through, so this surface cannot drift from the
|
|
231
230
|
// others by wording its own verdict.
|
|
232
|
-
const chatId = args['chatId'];
|
|
233
231
|
// no scope is legal. The throw that used to live here ("Pass
|
|
234
|
-
//
|
|
232
|
+
// addressId or agreementId") is the exact failure this ticket removed — it cost
|
|
235
233
|
// a live agent a turn mid-delivery for naming no container, when the record
|
|
236
234
|
// itself never needed one.
|
|
237
235
|
const visibility = args['visibility'];
|
|
238
|
-
if (visibility !== '
|
|
239
|
-
throw new Error('visibility must be
|
|
236
|
+
if (visibility !== 'address' && visibility !== 'agent-private') {
|
|
237
|
+
throw new Error('visibility must be address or agent-private');
|
|
240
238
|
}
|
|
241
239
|
// One tool, two body forms. Both at once is refused rather
|
|
242
240
|
// than resolved: which one won would be invisible in the response.
|
|
@@ -259,7 +257,6 @@ export const recordArtifactCapability = {
|
|
|
259
257
|
text,
|
|
260
258
|
name: args['name']?.trim() || undefined,
|
|
261
259
|
visibility,
|
|
262
|
-
chatId,
|
|
263
260
|
agreementId,
|
|
264
261
|
taskId,
|
|
265
262
|
serviceAgreementId: args['serviceAgreementId'] ?? (!taskId && !agreementId ? env.serviceAgreementId : undefined),
|
|
@@ -272,7 +269,6 @@ export const recordArtifactCapability = {
|
|
|
272
269
|
ok: true,
|
|
273
270
|
artifactId,
|
|
274
271
|
visibility,
|
|
275
|
-
chatId,
|
|
276
272
|
agreementId,
|
|
277
273
|
taskId,
|
|
278
274
|
reportingHint: reportingHint(env, contentType, taskId),
|
|
@@ -304,6 +300,8 @@ export const listArtifactsCapability = {
|
|
|
304
300
|
},
|
|
305
301
|
needsAgentId: true,
|
|
306
302
|
handler: async (args, env) => {
|
|
303
|
+
if ('addressId' in args)
|
|
304
|
+
throw new Error('addressId is retired; use explicit work or an exact message artifact reference');
|
|
307
305
|
const creds = fullCreds(env);
|
|
308
306
|
const listed = await new ArtifactsClient(creds.operatorKey, creds.agentId).list({ authoredBy: 'me' }, {
|
|
309
307
|
after: args['after'],
|
|
@@ -325,7 +323,7 @@ const UNSEARCHED_NOTE = 'These were NOT searched. You hold no grant on them, so
|
|
|
325
323
|
'root grant. A human issues the grant; this never widens the scope to the ' +
|
|
326
324
|
'chat, agreement, or org around one artifact.';
|
|
327
325
|
const OPEN_ID_FIELD = {
|
|
328
|
-
|
|
326
|
+
address: 'addressId',
|
|
329
327
|
agreement: 'agreementId',
|
|
330
328
|
artifact: 'artifactId',
|
|
331
329
|
task: 'taskId',
|
|
@@ -422,12 +420,14 @@ export const findArtifactsCapability = {
|
|
|
422
420
|
},
|
|
423
421
|
includeUnreadable: {
|
|
424
422
|
type: 'boolean',
|
|
425
|
-
description: '
|
|
423
|
+
description: 'Include unreadable labels, never bodies. Default: only when no matches. true: alongside matches; false: omit.',
|
|
426
424
|
},
|
|
427
425
|
fields: LIST_FIELDS_PARAM,
|
|
428
426
|
},
|
|
429
427
|
needsAgentId: true,
|
|
430
428
|
handler: async (args, env) => {
|
|
429
|
+
if ('addressId' in args)
|
|
430
|
+
throw new Error('addressId is retired; use explicit work or an exact message artifact reference');
|
|
431
431
|
const creds = fullCreds(env);
|
|
432
432
|
const found = await new ArtifactsClient(creds.operatorKey, creds.agentId).find(args['q'], {
|
|
433
433
|
limit: typeof args['limit'] === 'number' ? args['limit'] : undefined,
|
|
@@ -478,10 +478,6 @@ export const shareArtifactCapability = {
|
|
|
478
478
|
type: 'string',
|
|
479
479
|
description: 'ISO-8601 expiry; omit for the default grant lifetime',
|
|
480
480
|
},
|
|
481
|
-
chatId: {
|
|
482
|
-
type: 'string',
|
|
483
|
-
description: 'Chat to surface the approval request in, when the receiver’s owner has to approve',
|
|
484
|
-
},
|
|
485
481
|
idempotencyKey: {
|
|
486
482
|
type: 'string',
|
|
487
483
|
description: 'Replay the same share. Same key and payload recover the original request; the same key with a different payload is a conflict, not a second share.',
|
|
@@ -489,6 +485,8 @@ export const shareArtifactCapability = {
|
|
|
489
485
|
},
|
|
490
486
|
needsAgentId: true,
|
|
491
487
|
handler: async (args, env) => {
|
|
488
|
+
if ('addressId' in args)
|
|
489
|
+
throw new Error('addressId is retired; use explicit work or an exact message artifact reference');
|
|
492
490
|
const creds = fullCreds(env);
|
|
493
491
|
const artifactId = args['artifactId'];
|
|
494
492
|
if (!artifactId)
|
|
@@ -499,7 +497,6 @@ export const shareArtifactCapability = {
|
|
|
499
497
|
const result = await new ContextGrantsClient(creds.operatorKey, creds.agentId, env.baseUrl).shareArtifact(artifactId, {
|
|
500
498
|
holderId,
|
|
501
499
|
expiresAt: args['expiresAt'],
|
|
502
|
-
chatId: args['chatId'],
|
|
503
500
|
}, {
|
|
504
501
|
idempotencyKey: typeof args['idempotencyKey'] === 'string'
|
|
505
502
|
? args['idempotencyKey']
|
|
@@ -531,14 +528,13 @@ export const shareArtifactCapability = {
|
|
|
531
528
|
export const attachArtifactCapability = {
|
|
532
529
|
key: 'artifact_attach',
|
|
533
530
|
names: { sdk: 'artifact_attach', mcp: 'ziggs_artifact_attach' },
|
|
534
|
-
title: 'Attach to a
|
|
531
|
+
title: 'Attach to a task or agreement',
|
|
535
532
|
descriptions: {
|
|
536
|
-
sdk: 'Attach an artifact you can read to a
|
|
533
|
+
sdk: 'Attach an artifact you can read to a task or agreement. To reference it in a message use message_send with an exact artifact reference; that reference grants no access. Task/agreement links remain subject to their work and source-disclosure policies. Use artifact_share to give it to one specific agent instead.',
|
|
537
534
|
},
|
|
538
535
|
annotation: 'destructive',
|
|
539
536
|
params: {
|
|
540
537
|
artifactId: { type: 'string', required: true, description: 'Artifact to attach' },
|
|
541
|
-
chatId: { type: 'string', description: 'Chat to attach it to' },
|
|
542
538
|
taskId: { type: 'string', description: 'Task to attach it to' },
|
|
543
539
|
agreementId: {
|
|
544
540
|
type: 'string',
|
|
@@ -553,15 +549,16 @@ export const attachArtifactCapability = {
|
|
|
553
549
|
},
|
|
554
550
|
needsAgentId: true,
|
|
555
551
|
handler: async (args, env) => {
|
|
552
|
+
if ('addressId' in args)
|
|
553
|
+
throw new Error('addressId is retired; use explicit work or an exact message artifact reference');
|
|
556
554
|
const artifactId = args['artifactId'];
|
|
557
555
|
if (!artifactId)
|
|
558
556
|
throw new Error('artifactId is required');
|
|
559
|
-
const chatId = args['chatId'];
|
|
560
557
|
const taskId = args['taskId'];
|
|
561
558
|
const agreementId = args['agreementId'];
|
|
562
|
-
const named = [
|
|
559
|
+
const named = [taskId, agreementId].filter(Boolean).length;
|
|
563
560
|
if (named !== 1) {
|
|
564
|
-
throw new Error('Pass exactly one of
|
|
561
|
+
throw new Error('Pass exactly one of taskId or agreementId');
|
|
565
562
|
}
|
|
566
563
|
const role = args['role'] ?? 'output';
|
|
567
564
|
if (role !== 'input' && role !== 'output') {
|
|
@@ -569,15 +566,6 @@ export const attachArtifactCapability = {
|
|
|
569
566
|
}
|
|
570
567
|
const creds = fullCreds(env);
|
|
571
568
|
const client = new ArtifactsClient(creds.operatorKey, creds.agentId);
|
|
572
|
-
if (chatId) {
|
|
573
|
-
await client.attachToChat(artifactId, chatId);
|
|
574
|
-
return {
|
|
575
|
-
ok: true,
|
|
576
|
-
artifactId,
|
|
577
|
-
chatId,
|
|
578
|
-
note: `Everyone in chat ${chatId} can now read artifact ${artifactId}.`,
|
|
579
|
-
};
|
|
580
|
-
}
|
|
581
569
|
if (agreementId) {
|
|
582
570
|
await client.attachToAgreement(artifactId, agreementId);
|
|
583
571
|
return {
|
|
@@ -634,13 +622,12 @@ export const uploadArtifactUrlCapability = {
|
|
|
634
622
|
},
|
|
635
623
|
visibility: {
|
|
636
624
|
type: 'string',
|
|
637
|
-
enum: ['
|
|
625
|
+
enum: ['address', 'agent-private'],
|
|
638
626
|
description: 'Defaults server-side when omitted',
|
|
639
627
|
},
|
|
640
|
-
chatId: { type: 'string', description: 'Optional chat scope' },
|
|
641
628
|
agreementId: {
|
|
642
629
|
type: 'string',
|
|
643
|
-
description: 'Optional agreement scope
|
|
630
|
+
description: 'Optional agreement scope',
|
|
644
631
|
},
|
|
645
632
|
serviceAgreementId: { type: 'string', description: 'Agreement authorizing this work, separate from the destination chat.' },
|
|
646
633
|
taskId: { type: 'string', description: 'Optional task binding' },
|
|
@@ -655,6 +642,8 @@ export const uploadArtifactUrlCapability = {
|
|
|
655
642
|
},
|
|
656
643
|
needsAgentId: true,
|
|
657
644
|
handler: async (args, env) => {
|
|
645
|
+
if ('addressId' in args)
|
|
646
|
+
throw new Error('addressId is retired; use explicit work or an exact message artifact reference');
|
|
658
647
|
const filename = args['filename'];
|
|
659
648
|
const mime = args['mime'];
|
|
660
649
|
const byteSize = args['byteSize'];
|
|
@@ -667,9 +656,9 @@ export const uploadArtifactUrlCapability = {
|
|
|
667
656
|
}
|
|
668
657
|
const visibility = args['visibility'];
|
|
669
658
|
if (visibility != null &&
|
|
670
|
-
visibility !== '
|
|
659
|
+
visibility !== 'address' &&
|
|
671
660
|
visibility !== 'agent-private') {
|
|
672
|
-
throw new Error('visibility must be
|
|
661
|
+
throw new Error('visibility must be address or agent-private');
|
|
673
662
|
}
|
|
674
663
|
const creds = fullCreds(env);
|
|
675
664
|
const result = await new ArtifactsClient(creds.operatorKey, creds.agentId).uploadUrl({
|
|
@@ -678,7 +667,6 @@ export const uploadArtifactUrlCapability = {
|
|
|
678
667
|
byteSize: Math.trunc(byteSize),
|
|
679
668
|
format: args['format'],
|
|
680
669
|
visibility,
|
|
681
|
-
chatId: args['chatId'],
|
|
682
670
|
agreementId: args['agreementId'],
|
|
683
671
|
taskId: args['taskId'],
|
|
684
672
|
serviceAgreementId: args['serviceAgreementId'] ?? (!args['taskId'] && !args['agreementId'] ? env.serviceAgreementId : undefined),
|
|
@@ -715,6 +703,8 @@ export const completeArtifactFileCapability = {
|
|
|
715
703
|
},
|
|
716
704
|
needsAgentId: true,
|
|
717
705
|
handler: async (args, env) => {
|
|
706
|
+
if ('addressId' in args)
|
|
707
|
+
throw new Error('addressId is retired; use explicit work or an exact message artifact reference');
|
|
718
708
|
const artifactId = args['artifactId'];
|
|
719
709
|
const checksum = args['checksum'];
|
|
720
710
|
if (!artifactId)
|
|
@@ -745,6 +735,8 @@ export const downloadArtifactCapability = {
|
|
|
745
735
|
},
|
|
746
736
|
needsAgentId: true,
|
|
747
737
|
handler: async (args, env) => {
|
|
738
|
+
if ('addressId' in args)
|
|
739
|
+
throw new Error('addressId is retired; use explicit work or an exact message artifact reference');
|
|
748
740
|
const artifactId = args['artifactId'];
|
|
749
741
|
if (!artifactId)
|
|
750
742
|
throw new Error('artifactId is required');
|
|
@@ -767,6 +759,8 @@ export const reextractArtifactCapability = {
|
|
|
767
759
|
},
|
|
768
760
|
needsAgentId: true,
|
|
769
761
|
handler: async (args, env) => {
|
|
762
|
+
if ('addressId' in args)
|
|
763
|
+
throw new Error('addressId is retired; use explicit work or an exact message artifact reference');
|
|
770
764
|
const artifactId = args['artifactId'];
|
|
771
765
|
if (!artifactId)
|
|
772
766
|
throw new Error('artifactId is required');
|
|
@@ -775,12 +769,59 @@ export const reextractArtifactCapability = {
|
|
|
775
769
|
return { ok: true, artifact };
|
|
776
770
|
},
|
|
777
771
|
};
|
|
772
|
+
const CONTRIBUTION_PARAMS = {
|
|
773
|
+
artifactId: { type: 'string', required: true, description: 'The output' },
|
|
774
|
+
agreementId: { type: 'string', required: true, description: 'Where it goes' },
|
|
775
|
+
};
|
|
776
|
+
function contributionTarget(args) {
|
|
777
|
+
if (typeof args.artifactId !== 'string' || !args.artifactId.trim() || typeof args.agreementId !== 'string' || !args.agreementId.trim())
|
|
778
|
+
throw new Error('artifactId and agreementId are required');
|
|
779
|
+
return { artifactId: args.artifactId, agreementId: args.agreementId };
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* The read half of a contribution, its own tool: a directory listing may not
|
|
783
|
+
* put a safe read and an unsafe write under one annotation.
|
|
784
|
+
*/
|
|
785
|
+
export const reviewArtifactContributionCapability = {
|
|
786
|
+
key: 'artifact_contribution_review',
|
|
787
|
+
names: { sdk: 'artifact_contribution_review', mcp: 'ziggs_artifact_contribution_review' },
|
|
788
|
+
title: 'Review a contribution',
|
|
789
|
+
descriptions: { sdk: 'Review the approvals one immutable artifact needs before artifact_contribute delivers it to another agreement. Keep the producing execution selected. Returns source releases you can identify and a privateSourceCount for hidden upstream inputs; if that count is nonzero, the original source authority must arrange any further release. Request them with access_request using scopeId=output artifact, contributionTo=destination and releaseSource from the review. Also obtain ordinary output-owner contribution consent.' },
|
|
790
|
+
annotation: 'read-only',
|
|
791
|
+
needsAgentId: true,
|
|
792
|
+
params: CONTRIBUTION_PARAMS,
|
|
793
|
+
handler: async (args, env) => {
|
|
794
|
+
if ('addressId' in args)
|
|
795
|
+
throw new Error('addressId is retired; use explicit work or an exact message artifact reference');
|
|
796
|
+
const { artifactId, agreementId } = contributionTarget(args);
|
|
797
|
+
const creds = fullCreds(env);
|
|
798
|
+
return new ArtifactsClient(creds.operatorKey, creds.agentId).reviewContribution(artifactId, agreementId);
|
|
799
|
+
},
|
|
800
|
+
};
|
|
801
|
+
export const contributeArtifactCapability = {
|
|
802
|
+
key: 'artifact_contribute',
|
|
803
|
+
names: { sdk: 'artifact_contribute', mcp: 'ziggs_artifact_contribute' },
|
|
804
|
+
title: 'Contribute an output',
|
|
805
|
+
descriptions: { sdk: 'Deliver one immutable artifact to another agreement once artifact_contribution_review shows it ready. Keep the producing execution selected. Delivery requires all live approvals, imports no private sources or model memory, and is idempotent. Never retry without execution context.' },
|
|
806
|
+
annotation: 'destructive',
|
|
807
|
+
needsAgentId: true,
|
|
808
|
+
params: CONTRIBUTION_PARAMS,
|
|
809
|
+
handler: async (args, env) => {
|
|
810
|
+
if ('addressId' in args)
|
|
811
|
+
throw new Error('addressId is retired; use explicit work or an exact message artifact reference');
|
|
812
|
+
const { artifactId, agreementId } = contributionTarget(args);
|
|
813
|
+
const creds = fullCreds(env);
|
|
814
|
+
return new ArtifactsClient(creds.operatorKey, creds.agentId).contribute(artifactId, agreementId);
|
|
815
|
+
},
|
|
816
|
+
};
|
|
778
817
|
export const ARTIFACT_CAPABILITIES = [
|
|
779
818
|
recordArtifactCapability,
|
|
780
819
|
listArtifactsCapability,
|
|
781
820
|
findArtifactsCapability,
|
|
782
821
|
shareArtifactCapability,
|
|
783
822
|
attachArtifactCapability,
|
|
823
|
+
reviewArtifactContributionCapability,
|
|
824
|
+
contributeArtifactCapability,
|
|
784
825
|
uploadArtifactUrlCapability,
|
|
785
826
|
completeArtifactFileCapability,
|
|
786
827
|
downloadArtifactCapability,
|
|
@@ -67,15 +67,15 @@ export const requestConnectionCapability = {
|
|
|
67
67
|
descriptions: {
|
|
68
68
|
sdk: "Ask a person to connect a remote MCP server and grant you the listed tools. " +
|
|
69
69
|
"Name who to ask in recipientId: your work brief offers them for this wake — workBrief.actingFor.customer.id (the customer of the hire you are working in, for their own accounts and resources) or workBrief.actingFor.operator.id (your operator, for tools you bring). Anyone else is refused, and the refusal lists who you can ask. " +
|
|
70
|
-
"
|
|
70
|
+
"Creates a connection-consent request for the explicit message, task or agreement context. Task/agreement context must match the selected execution. The answer names its recipient and inbox approval location. " +
|
|
71
71
|
"On approval the server is connected (browser OAuth if needed) and you are granted the tools; call them with mcp_tool_call / mcp_tools_list (not connection_proxy).",
|
|
72
72
|
},
|
|
73
73
|
annotation: "destructive",
|
|
74
74
|
params: {
|
|
75
|
-
|
|
76
|
-
type: "
|
|
75
|
+
context: {
|
|
76
|
+
type: "object",
|
|
77
77
|
required: true,
|
|
78
|
-
description: "
|
|
78
|
+
description: 'Explicit {kind: "message" | "task" | "agreement", id}. Work context must match selected execution; both parties must have access.',
|
|
79
79
|
},
|
|
80
80
|
serverUrl: {
|
|
81
81
|
type: "string",
|
|
@@ -100,8 +100,11 @@ export const requestConnectionCapability = {
|
|
|
100
100
|
},
|
|
101
101
|
needsAgentId: true,
|
|
102
102
|
handler: async (args, env) => {
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
const context = args["context"];
|
|
104
|
+
if (args["addressId"] !== undefined)
|
|
105
|
+
throw new Error("addressId is retired; provide explicit context");
|
|
106
|
+
if (!context || !["message", "task", "agreement"].includes(context.kind) || typeof context.id !== 'string' || !context.id.trim())
|
|
107
|
+
throw new Error("context is required");
|
|
105
108
|
if (!args["serverUrl"])
|
|
106
109
|
throw new Error("serverUrl is required");
|
|
107
110
|
const tools = args["tools"];
|
|
@@ -112,7 +115,7 @@ export const requestConnectionCapability = {
|
|
|
112
115
|
throw new Error("recipientId is required: who to ask, from your work brief");
|
|
113
116
|
try {
|
|
114
117
|
const result = await client(env).requestMcpConnection({
|
|
115
|
-
|
|
118
|
+
context,
|
|
116
119
|
serverUrl: args["serverUrl"],
|
|
117
120
|
tools: tools,
|
|
118
121
|
reason: args["reason"],
|
|
@@ -47,7 +47,7 @@ export interface RefusedRead {
|
|
|
47
47
|
}
|
|
48
48
|
export declare const RESOURCE_HIDDEN_MESSAGE = "Not found, or not available to you. The two look the same.";
|
|
49
49
|
export declare const RESOURCE_UNREADABLE_MESSAGE = "This exists and you cannot read it yet. actions has the request to make.";
|
|
50
|
-
export declare function explainRefusedRead(kind: 'agreement' | 'task' | '
|
|
50
|
+
export declare function explainRefusedRead(kind: 'agreement' | 'task' | 'artifact', id: string, env: CapabilityEnv): Promise<RefusedRead | null>;
|
|
51
51
|
export declare const openCapability: CapabilityDefinition;
|
|
52
52
|
export declare const accessExplainCapability: CapabilityDefinition;
|
|
53
53
|
export declare const accessRequestCapability: CapabilityDefinition;
|