@ziggs-ai/contracts 0.33.0 → 0.34.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.
@@ -4,6 +4,8 @@ export interface WorkExecutionContext {
4
4
  actorId: string;
5
5
  principalId: string;
6
6
  agreementId: string | null;
7
+ /** Task assignment isolates retained execution state, including recursive delegation. */
8
+ taskId?: string | null;
7
9
  position: 'payer' | 'provider' | 'participant';
8
10
  /** Delivery destination. Its readers constrain execution; it grants no authority. */
9
11
  chatId: string | null;
@@ -25,7 +27,14 @@ export interface ContributionTarget {
25
27
  kind: 'chat' | 'agreement';
26
28
  id: string;
27
29
  }
30
+ /** Authority over an input whose information may be released in one exact output. */
31
+ export interface ContributionSource {
32
+ kind: 'artifact' | 'agreement' | 'chat' | 'task' | 'connection-grant';
33
+ id: string;
34
+ }
28
35
  export interface ContextContribution {
36
+ /** Absent for the output owner's consent. Does not grant access to this source. */
37
+ releaseSource?: ContributionSource;
29
38
  target: ContributionTarget;
30
39
  /** Frozen, expanded audience approved by the owner; joining does not expand it. */
31
40
  audienceIds: string[];
@@ -113,6 +113,11 @@ export type AgreementRead = {
113
113
  grantRequest?: {
114
114
  primitive?: "context";
115
115
  kind?: "access-request" | "author-share";
116
+ contributionTo?: {
117
+ kind: "chat" | "agreement";
118
+ id: string;
119
+ };
120
+ releaseSourceKind?: "artifact" | "agreement" | "chat" | "task" | "connection-grant";
116
121
  holderId?: string;
117
122
  holders?: Array<{
118
123
  kind: "agent" | "user" | "org";
package/dist/inbox.d.ts CHANGED
@@ -65,6 +65,7 @@ export interface DecisionRef {
65
65
  export interface AccessAsk {
66
66
  /** Explicit use consent, in addition to the readers' access. */
67
67
  contributionTo?: import('./execution').ContributionTarget;
68
+ releaseSourceKind?: import('./execution').ContributionSource['kind'];
68
69
  /**
69
70
  * A reply grant includes reading and writing in this one conversation.
70
71
  * `list` (ZIG-2170) is asked of a person scope: which rooms they are in,
@@ -266,3 +267,32 @@ export interface InboxRequestChannel {
266
267
  /** Unacked requests, separated from generic deliveries for exact-match triage. */
267
268
  openRequestsAwaitingMe: InboxOpenRequestRef[];
268
269
  }
270
+ /**
271
+ * A task whose plan is waiting on the reader's acknowledgement.
272
+ *
273
+ * The acknowledgement belongs to whoever pays for the work, so this lists
274
+ * tasks under agreements the reader's side pays for. A plan on work the reader
275
+ * was hired to do is the hirer's to acknowledge and does not appear here, even
276
+ * though the task itself is in `tasksAwaitingMe`. A task can be in both lists
277
+ * when a person hired their own assistant: the work is the assistant's, the
278
+ * acknowledgement is the person's.
279
+ *
280
+ * Acknowledge with `POST /tasks/:taskId/plan/acknowledge`.
281
+ */
282
+ export interface InboxPlanAckRef {
283
+ taskId: string;
284
+ agreementId: string;
285
+ title: string;
286
+ /**
287
+ * Which gate is waiting. `execution`: the plan must be acknowledged before
288
+ * the work starts. `mid_work`: the plan changed during the work.
289
+ */
290
+ scope: 'execution' | 'mid_work';
291
+ updatedAt: string | null;
292
+ }
293
+ export interface InboxPlanAckChannel {
294
+ /** Tasks whose plan waits on the reader's acknowledgement, newest first. */
295
+ planAcksAwaitingMe: InboxPlanAckRef[];
296
+ /** How many more the cap left off. */
297
+ truncatedPlanAcks: number;
298
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/contracts",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "description": "Wire contracts for the Ziggs API — response shapes, error body, and socket events, shared by every client.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",