@ziggs-ai/contracts 0.50.10 → 0.50.12

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/dist/buckets.d.ts CHANGED
@@ -65,6 +65,37 @@ export interface BucketAddMembersResult {
65
65
  items: BucketItemRef[];
66
66
  } | null;
67
67
  }
68
+ /** What to do when someone being added cannot read everything in a bucket. */
69
+ export type BucketMisfitChoice = 'share' | 'split';
70
+ /**
71
+ * The 409 body when someone would be in a bucket without reading everything
72
+ * in it (`code: BUCKET_MEMBERS_CANNOT_READ`). Nothing changed; the caller
73
+ * picks one of `choices`.
74
+ */
75
+ export interface BucketMisfitRefusal {
76
+ code: 'BUCKET_MEMBERS_CANNOT_READ';
77
+ message: string;
78
+ choices: BucketMisfitChoice[];
79
+ impact: {
80
+ misfits: BucketMisfit[];
81
+ shared: BucketShare[];
82
+ };
83
+ }
84
+ /** POST /buckets/:id/join — another bucket's people and items brought in. */
85
+ export interface BucketJoinResult {
86
+ bucket: BucketView;
87
+ added: string[];
88
+ joined: BucketItemRef[];
89
+ shared: BucketShare[];
90
+ /** With share: who is not in yet, waiting on owners (ZIG-2457). */
91
+ waiting?: string[];
92
+ }
93
+ /** GET /buckets/:id/my-shares — one of your items shared with someone here. */
94
+ export type MyShare = {
95
+ holderId: string;
96
+ item: BucketItemRef;
97
+ thread?: string;
98
+ };
68
99
  export type BucketThread = {
69
100
  rootMessageId: string;
70
101
  title: string;
@@ -44,9 +44,10 @@ export interface ContextContribution {
44
44
  /** Display of the selected position. References are viewer-safe, not authority tokens. */
45
45
  export interface WorkPositionView {
46
46
  state: 'execution' | 'view';
47
+ /** ZIG-2409 — `person` is the old word for `user`, no longer sent. */
47
48
  actor: {
48
49
  ref: string;
49
- kind: 'agent' | 'person' | 'chatter';
50
+ kind: 'agent' | 'user' | 'chatter' | 'person';
50
51
  };
51
52
  accountable: {
52
53
  ref: string;
@@ -82,7 +83,11 @@ export interface WorkPositionView {
82
83
  export interface ExecutionBoundaryParty {
83
84
  ref: string;
84
85
  name: string | null;
85
- kind: 'person' | 'agent' | 'workspace' | null;
86
+ /**
87
+ * ZIG-2409 — `user`, `chatter`, `agent` or `org`. `person` and `workspace`
88
+ * are the old words, no longer sent; kept so older clients build.
89
+ */
90
+ kind: 'user' | 'chatter' | 'agent' | 'org' | 'person' | 'workspace' | null;
86
91
  }
87
92
  /** One input a run used. Ids and labels appear only when this viewer can read it now. */
88
93
  export interface ExecutionBoundaryRead {
@@ -128,7 +128,7 @@ export type AgreementRead = {
128
128
  }>;
129
129
  };
130
130
  holders?: Array<{
131
- kind: "agent" | "user" | "org";
131
+ kind: "agent" | "user" | "chatter" | "org";
132
132
  id: string;
133
133
  }>;
134
134
  scope?: {
@@ -27,7 +27,7 @@ export type GrantView = {
27
27
  expiresAt: string | null;
28
28
  createdAt: string;
29
29
  health: "active" | "expired" | "revoked";
30
- holderKind?: "user" | "org" | "agent";
30
+ holderKind?: "user" | "chatter" | "org" | "agent";
31
31
  access?: "list" | "read" | "write" | "admit";
32
32
  basis?: GrantBasis;
33
33
  };
package/dist/inbox.d.ts CHANGED
@@ -98,7 +98,7 @@ export interface AccessAsk {
98
98
  * never ids. Absent on an ask for the asking agent alone.
99
99
  */
100
100
  readers?: Array<{
101
- kind: 'agent' | 'user' | 'org';
101
+ kind: 'agent' | 'user' | 'chatter' | 'org';
102
102
  displayName: string | null;
103
103
  }>;
104
104
  /** Why, in the requester's own words. */
@@ -252,7 +252,11 @@ export interface MessageReadState {
252
252
  recipients: Array<{
253
253
  /** Scoped to this message, never a raw principal identity. */
254
254
  recipientRef: string;
255
- kind: 'human' | 'agent' | 'workspace';
255
+ /**
256
+ * ZIG-2409 — `user`, `agent` or `org`. `human` and `workspace` are the
257
+ * old words, no longer sent; kept so older clients build.
258
+ */
259
+ kind: 'user' | 'agent' | 'org' | 'human' | 'workspace';
256
260
  seen: boolean;
257
261
  seenAt: string | null;
258
262
  pickedUpAt: string | null;
@@ -33,12 +33,16 @@ export type ResourceKind = (typeof RESOURCE_KINDS)[number];
33
33
  * was answerable all along and simply never reached this list.
34
34
  */
35
35
  export type DecisionKind = 'proposal' | 'connection_request' | 'chat_admission';
36
- /** Which mailbox a delivery copy lives in. */
37
- export type InboxPartyKind = 'human' | 'org';
36
+ /**
37
+ * Which mailbox a delivery copy lives in. ZIG-2409: a person is `user`.
38
+ * @deprecated value `human` — the old word, no longer sent; kept so clients
39
+ * that still compare against it build.
40
+ */
41
+ export type InboxPartyKind = 'user' | 'org' | 'human';
38
42
  /** How a principal is party to an agreement. */
39
43
  export type PartyRole = 'payer' | 'provider' | 'creator' | 'proposedTo' | 'providerPrincipal';
40
44
  /** What kind of principal sent a message. */
41
- export type MessageSenderType = 'user' | 'agent' | 'service' | 'system';
45
+ export type MessageSenderType = 'user' | 'chatter' | 'agent' | 'service' | 'system';
42
46
  /**
43
47
  * The file formats a file artifact can carry (not its semantic content type).
44
48
  * The server stores and validates against this list; clients offer it as a
@@ -146,7 +150,7 @@ export type AccessRequestScopeKind = (typeof ACCESS_REQUEST_SCOPE_KINDS)[number]
146
150
  * Who an artifact access request may ask a grant FOR. Each reader is named
147
151
  * with its kind; the kind is never inferred from an id or a display name.
148
152
  */
149
- export declare const ACCESS_REQUEST_HOLDER_KINDS: readonly ["agent", "user", "org"];
153
+ export declare const ACCESS_REQUEST_HOLDER_KINDS: readonly ["agent", "user", "chatter", "org"];
150
154
  export type AccessRequestHolderKind = (typeof ACCESS_REQUEST_HOLDER_KINDS)[number];
151
155
  /** How many readers one access request may name. */
152
156
  export declare const MAX_ACCESS_REQUEST_HOLDERS = 20;
@@ -164,3 +168,11 @@ export declare const MESSAGE_CONTENT_TYPE: {
164
168
  };
165
169
  export type MessageContentType = (typeof MESSAGE_CONTENT_TYPE)[keyof typeof MESSAGE_CONTENT_TYPE];
166
170
  export declare const MESSAGE_CONTENT_TYPES: readonly MessageContentType[];
171
+ /**
172
+ * The four kinds of party, one word each, in stored fields and on the wire.
173
+ * `user` is a person with an account, `chatter` a person without one (a
174
+ * visitor, or someone a workspace reached by mail or Slack), `agent` an agent
175
+ * and `org` a workspace.
176
+ */
177
+ export declare const PARTY_KINDS: readonly ["user", "chatter", "agent", "org"];
178
+ export type PartyKind = (typeof PARTY_KINDS)[number];
@@ -7,7 +7,7 @@
7
7
  * enum, a switch a consumer needs to make exhaustive.
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.MESSAGE_CONTENT_TYPES = exports.MESSAGE_CONTENT_TYPE = exports.MAX_ACCESS_REQUEST_HOLDERS = exports.ACCESS_REQUEST_HOLDER_KINDS = exports.ACCESS_REQUEST_SCOPE_KINDS = exports.GRANT_SCOPE_KINDS = exports.CONTEXT_GRANT_SCOPE_KINDS = exports.AGREEMENT_TERMINAL_STATES = exports.AGREEMENT_STATUSES = exports.AGREEMENT_STATUS = exports.TERMINAL_TASK_STATES = exports.TASK_UPDATE_STATES = exports.TASK_STATES = exports.TASK_STATE = exports.AGREEMENT_ENGAGEMENT_KIND = exports.BROADCAST_TARGETS = exports.COMPANY_AGREEMENT_TARGET = exports.ORG_AGREEMENT_TARGET = exports.OPEN_AGREEMENT_TARGET = exports.AGREEMENT_PARTY_SIDES = exports.ARTIFACT_FILE_FORMATS = exports.ARTIFACT_FILE_FORMAT = exports.RESOURCE_KINDS = exports.GRANT_ACCESS_KINDS = void 0;
10
+ exports.PARTY_KINDS = exports.MESSAGE_CONTENT_TYPES = exports.MESSAGE_CONTENT_TYPE = exports.MAX_ACCESS_REQUEST_HOLDERS = exports.ACCESS_REQUEST_HOLDER_KINDS = exports.ACCESS_REQUEST_SCOPE_KINDS = exports.GRANT_SCOPE_KINDS = exports.CONTEXT_GRANT_SCOPE_KINDS = exports.AGREEMENT_TERMINAL_STATES = exports.AGREEMENT_STATUSES = exports.AGREEMENT_STATUS = exports.TERMINAL_TASK_STATES = exports.TASK_UPDATE_STATES = exports.TASK_STATES = exports.TASK_STATE = exports.AGREEMENT_ENGAGEMENT_KIND = exports.BROADCAST_TARGETS = exports.COMPANY_AGREEMENT_TARGET = exports.ORG_AGREEMENT_TARGET = exports.OPEN_AGREEMENT_TARGET = exports.AGREEMENT_PARTY_SIDES = exports.ARTIFACT_FILE_FORMATS = exports.ARTIFACT_FILE_FORMAT = exports.RESOURCE_KINDS = exports.GRANT_ACCESS_KINDS = void 0;
11
11
  exports.isBroadcastTarget = isBroadcastTarget;
12
12
  exports.partySideIds = partySideIds;
13
13
  exports.partyActorIds = partyActorIds;
@@ -186,7 +186,12 @@ exports.ACCESS_REQUEST_SCOPE_KINDS = [
186
186
  * Who an artifact access request may ask a grant FOR. Each reader is named
187
187
  * with its kind; the kind is never inferred from an id or a display name.
188
188
  */
189
- exports.ACCESS_REQUEST_HOLDER_KINDS = ['agent', 'user', 'org'];
189
+ exports.ACCESS_REQUEST_HOLDER_KINDS = [
190
+ 'agent',
191
+ 'user',
192
+ 'chatter',
193
+ 'org',
194
+ ];
190
195
  /** How many readers one access request may name. */
191
196
  exports.MAX_ACCESS_REQUEST_HOLDERS = 20;
192
197
  /** What a chat entry's contentType may be. */
@@ -202,3 +207,10 @@ exports.MESSAGE_CONTENT_TYPE = {
202
207
  PROPOSAL: 'proposal',
203
208
  };
204
209
  exports.MESSAGE_CONTENT_TYPES = Object.values(exports.MESSAGE_CONTENT_TYPE);
210
+ /**
211
+ * The four kinds of party, one word each, in stored fields and on the wire.
212
+ * `user` is a person with an account, `chatter` a person without one (a
213
+ * visitor, or someone a workspace reached by mail or Slack), `agent` an agent
214
+ * and `org` a workspace.
215
+ */
216
+ exports.PARTY_KINDS = ['user', 'chatter', 'agent', 'org'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/contracts",
3
- "version": "0.50.10",
3
+ "version": "0.50.12",
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",