@ziggs-ai/contracts 0.50.11 → 0.50.20
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/execution.d.ts +7 -2
- package/dist/generated/agreements.d.ts +22 -4
- package/dist/generated/grants.d.ts +3 -3
- package/dist/inbox.d.ts +1 -1
- package/dist/messaging.d.ts +5 -1
- package/dist/vocabulary.d.ts +52 -20
- package/dist/vocabulary.js +74 -12
- package/package.json +1 -1
package/dist/execution.d.ts
CHANGED
|
@@ -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' | '
|
|
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
|
-
|
|
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 {
|
|
@@ -109,11 +109,17 @@ export type AgreementRead = {
|
|
|
109
109
|
publishedService?: boolean;
|
|
110
110
|
claimSeats: AgreementClaimSeats | null;
|
|
111
111
|
listingPausedAt?: string | null;
|
|
112
|
-
|
|
112
|
+
isSelfHire?: boolean;
|
|
113
|
+
isAssistantHire?: boolean;
|
|
114
|
+
ownedAgentSelfHire?: boolean;
|
|
115
|
+
counterOfAgreementId?: string;
|
|
116
|
+
counterDepth?: number;
|
|
117
|
+
identityMigration?: string;
|
|
113
118
|
connectionRequest?: AgreementConnectionRequest;
|
|
114
119
|
grantRequest?: {
|
|
115
|
-
primitive?: "context";
|
|
116
|
-
kind?: "access-request" | "author-share";
|
|
120
|
+
primitive?: "context" | "connection" | "task";
|
|
121
|
+
kind?: "access-request" | "author-share" | "re-delegate" | "task-delegation" | "task-hand-over";
|
|
122
|
+
parentGrantId?: string;
|
|
117
123
|
contributionTo?: {
|
|
118
124
|
kind: "message" | "agreement";
|
|
119
125
|
id: string;
|
|
@@ -128,7 +134,7 @@ export type AgreementRead = {
|
|
|
128
134
|
}>;
|
|
129
135
|
};
|
|
130
136
|
holders?: Array<{
|
|
131
|
-
kind: "agent" | "user" | "org";
|
|
137
|
+
kind: "agent" | "user" | "chatter" | "org";
|
|
132
138
|
id: string;
|
|
133
139
|
}>;
|
|
134
140
|
scope?: {
|
|
@@ -141,6 +147,18 @@ export type AgreementRead = {
|
|
|
141
147
|
durationHours?: number;
|
|
142
148
|
reason?: string;
|
|
143
149
|
expiresAt?: string | null;
|
|
150
|
+
delegation?: {
|
|
151
|
+
parentTaskId: string | null;
|
|
152
|
+
agreementId: string;
|
|
153
|
+
assigneeId: string;
|
|
154
|
+
title: string | null;
|
|
155
|
+
description: string | null;
|
|
156
|
+
};
|
|
157
|
+
files?: Array<{
|
|
158
|
+
artifactId: string;
|
|
159
|
+
readers: Array<string>;
|
|
160
|
+
}>;
|
|
161
|
+
taskId?: string | null;
|
|
144
162
|
};
|
|
145
163
|
createdAt: string;
|
|
146
164
|
updatedAt: string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Family: grants. Regenerate: backend 'pnpm docs:generate' then this script.
|
|
4
4
|
*/
|
|
5
5
|
export type GrantScopeView = {
|
|
6
|
-
kind: "message" | "address" | "agreement" | "org" | "artifact" | "task" | "person" | "contact" | "connection" | "wallet" | "consent" | "inbox";
|
|
6
|
+
kind: "message" | "address" | "agreement" | "org" | "artifact" | "task" | "person" | "contact" | "thread" | "agent" | "workspace" | "connection" | "wallet" | "platform" | "consent" | "inbox";
|
|
7
7
|
id: string;
|
|
8
8
|
label?: string;
|
|
9
9
|
};
|
|
@@ -26,8 +26,8 @@ export type GrantView = {
|
|
|
26
26
|
revoked: boolean;
|
|
27
27
|
expiresAt: string | null;
|
|
28
28
|
createdAt: string;
|
|
29
|
-
health: "active" | "expired" | "revoked";
|
|
30
|
-
holderKind?: "user" | "org" | "agent";
|
|
29
|
+
health: "active" | "expired" | "revoked" | "inactive";
|
|
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. */
|
package/dist/messaging.d.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/dist/vocabulary.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
37
|
-
|
|
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
|
|
@@ -61,16 +65,21 @@ export declare const ARTIFACT_FILE_FORMATS: readonly ArtifactFileFormat[];
|
|
|
61
65
|
export declare const AGREEMENT_PARTY_SIDES: readonly ["payer", "provider", "proposedTo", "creator"];
|
|
62
66
|
export type AgreementPartySideName = (typeof AGREEMENT_PARTY_SIDES)[number];
|
|
63
67
|
/**
|
|
64
|
-
*
|
|
65
|
-
* `
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
+
* @deprecated ZIG-2491 — an offer's open side is empty now (`isOpenSide`,
|
|
69
|
+
* `offerOpenSide`), and who may take it is a grant. Kept only until the web
|
|
70
|
+
* app and the SDK stop reading these; the backend never compares a party to
|
|
71
|
+
* them (agreements/no-placeholder-party.spec.ts).
|
|
68
72
|
*/
|
|
69
73
|
export declare const OPEN_AGREEMENT_TARGET = "everyone";
|
|
74
|
+
/** @deprecated ZIG-2491 — see OPEN_AGREEMENT_TARGET. */
|
|
70
75
|
export declare const ORG_AGREEMENT_TARGET = "org";
|
|
76
|
+
/** @deprecated ZIG-2491 — see OPEN_AGREEMENT_TARGET. */
|
|
71
77
|
export declare const COMPANY_AGREEMENT_TARGET = "company";
|
|
78
|
+
/** @deprecated ZIG-2491 — see OPEN_AGREEMENT_TARGET. */
|
|
72
79
|
export declare const BROADCAST_TARGETS: readonly ["everyone", "org", "company"];
|
|
80
|
+
/** @deprecated ZIG-2491 — see OPEN_AGREEMENT_TARGET. */
|
|
73
81
|
export type BroadcastAudience = (typeof BROADCAST_TARGETS)[number];
|
|
82
|
+
/** @deprecated ZIG-2491 — use `isOpenSide` on the side. */
|
|
74
83
|
export declare function isBroadcastTarget(id: string | null | undefined): id is BroadcastAudience;
|
|
75
84
|
/** One side, as ids only. Callers may pass the stored row. */
|
|
76
85
|
export interface PartySideRef {
|
|
@@ -79,6 +88,28 @@ export interface PartySideRef {
|
|
|
79
88
|
}
|
|
80
89
|
/** Both ids on a side, principal then actor, blanks dropped. */
|
|
81
90
|
export declare function partySideIds(side: PartySideRef | null | undefined): string[];
|
|
91
|
+
/**
|
|
92
|
+
* ZIG-2491 — an offer leaves one side empty: no principal and no actor. The
|
|
93
|
+
* paying side when it sells, the proposed-to side when it asks for work. Who may take it is a grant on the offer, never a word in
|
|
94
|
+
* the empty side.
|
|
95
|
+
*/
|
|
96
|
+
export declare function isOpenSide(side: PartySideRef | null | undefined): boolean;
|
|
97
|
+
/** Which side of an offer is empty, or null for a deal or a link. */
|
|
98
|
+
export type OfferOpenSide = 'payer' | 'provider';
|
|
99
|
+
/**
|
|
100
|
+
* An offer is a template others take: it carries `claimSeats` (how many may
|
|
101
|
+
* hold an agreement made from it). An empty side alone does not make one: a
|
|
102
|
+
* link has no payer, and other agreements leave sides unwritten.
|
|
103
|
+
*/
|
|
104
|
+
export declare function isOfferRow(row: {
|
|
105
|
+
engagementKind?: string | null;
|
|
106
|
+
claimSeats?: unknown;
|
|
107
|
+
} | null | undefined): boolean;
|
|
108
|
+
export declare function offerOpenSide(row: {
|
|
109
|
+
engagementKind?: string | null;
|
|
110
|
+
claimSeats?: unknown;
|
|
111
|
+
parties?: Partial<Record<AgreementPartySideName, PartySideRef | null>> | null;
|
|
112
|
+
} | null | undefined): OfferOpenSide | null;
|
|
82
113
|
/** The agents that acted on any side, deduped. */
|
|
83
114
|
export declare function partyActorIds(parties: Partial<Record<AgreementPartySideName, PartySideRef | null>> | null | undefined): string[];
|
|
84
115
|
/**
|
|
@@ -94,17 +125,10 @@ export declare const AGREEMENT_ENGAGEMENT_KIND: {
|
|
|
94
125
|
};
|
|
95
126
|
export type AgreementEngagementKind = (typeof AGREEMENT_ENGAGEMENT_KIND)[keyof typeof AGREEMENT_ENGAGEMENT_KIND];
|
|
96
127
|
/**
|
|
97
|
-
* A seller's standing offer: the
|
|
98
|
-
*
|
|
128
|
+
* A seller's standing offer: the paying side is empty, and the paper is not a
|
|
129
|
+
* reach link. Any status — a paused listing is still a listing.
|
|
99
130
|
*/
|
|
100
|
-
export declare function isSellerListing(row:
|
|
101
|
-
engagementKind?: string | null;
|
|
102
|
-
parties?: {
|
|
103
|
-
payer?: {
|
|
104
|
-
principal?: string | null;
|
|
105
|
-
} | null;
|
|
106
|
-
} | null;
|
|
107
|
-
} | null | undefined): boolean;
|
|
131
|
+
export declare function isSellerListing(row: Parameters<typeof offerOpenSide>[0]): boolean;
|
|
108
132
|
/** A task is born active. Negotiation lives on the agreement, not here. */
|
|
109
133
|
export declare const TASK_STATE: {
|
|
110
134
|
readonly ACTIVE: "active";
|
|
@@ -135,8 +159,8 @@ export declare const AGREEMENT_TERMINAL_STATES: readonly AgreementStatusValue[];
|
|
|
135
159
|
* Context-rail scopes, then the other rails a grant can name.
|
|
136
160
|
* Order is the order the grants read and the OpenAPI enum publish.
|
|
137
161
|
*/
|
|
138
|
-
export declare const CONTEXT_GRANT_SCOPE_KINDS: readonly ["message", "address", "agreement", "org", "artifact", "task", "person", "contact"];
|
|
139
|
-
export declare const GRANT_SCOPE_KINDS: readonly ["message", "address", "agreement", "org", "artifact", "task", "person", "contact", "connection", "wallet", "consent", "inbox"];
|
|
162
|
+
export declare const CONTEXT_GRANT_SCOPE_KINDS: readonly ["message", "address", "agreement", "org", "artifact", "task", "person", "contact", "thread", "agent", "workspace", "connection", "wallet", "platform"];
|
|
163
|
+
export declare const GRANT_SCOPE_KINDS: readonly ["message", "address", "agreement", "org", "artifact", "task", "person", "contact", "thread", "agent", "workspace", "connection", "wallet", "platform", "consent", "inbox"];
|
|
140
164
|
export type GrantScopeKind = (typeof GRANT_SCOPE_KINDS)[number];
|
|
141
165
|
export type ContextGrantScopeKind = (typeof CONTEXT_GRANT_SCOPE_KINDS)[number];
|
|
142
166
|
/** What an access request may name. Always one resource. */
|
|
@@ -146,7 +170,7 @@ export type AccessRequestScopeKind = (typeof ACCESS_REQUEST_SCOPE_KINDS)[number]
|
|
|
146
170
|
* Who an artifact access request may ask a grant FOR. Each reader is named
|
|
147
171
|
* with its kind; the kind is never inferred from an id or a display name.
|
|
148
172
|
*/
|
|
149
|
-
export declare const ACCESS_REQUEST_HOLDER_KINDS: readonly ["agent", "user", "org"];
|
|
173
|
+
export declare const ACCESS_REQUEST_HOLDER_KINDS: readonly ["agent", "user", "chatter", "org"];
|
|
150
174
|
export type AccessRequestHolderKind = (typeof ACCESS_REQUEST_HOLDER_KINDS)[number];
|
|
151
175
|
/** How many readers one access request may name. */
|
|
152
176
|
export declare const MAX_ACCESS_REQUEST_HOLDERS = 20;
|
|
@@ -164,3 +188,11 @@ export declare const MESSAGE_CONTENT_TYPE: {
|
|
|
164
188
|
};
|
|
165
189
|
export type MessageContentType = (typeof MESSAGE_CONTENT_TYPE)[keyof typeof MESSAGE_CONTENT_TYPE];
|
|
166
190
|
export declare const MESSAGE_CONTENT_TYPES: readonly MessageContentType[];
|
|
191
|
+
/**
|
|
192
|
+
* The four kinds of party, one word each, in stored fields and on the wire.
|
|
193
|
+
* `user` is a person with an account, `chatter` a person without one (a
|
|
194
|
+
* visitor, or someone a workspace reached by mail or Slack), `agent` an agent
|
|
195
|
+
* and `org` a workspace.
|
|
196
|
+
*/
|
|
197
|
+
export declare const PARTY_KINDS: readonly ["user", "chatter", "agent", "org"];
|
|
198
|
+
export type PartyKind = (typeof PARTY_KINDS)[number];
|
package/dist/vocabulary.js
CHANGED
|
@@ -7,9 +7,12 @@
|
|
|
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
|
+
exports.isOpenSide = isOpenSide;
|
|
14
|
+
exports.isOfferRow = isOfferRow;
|
|
15
|
+
exports.offerOpenSide = offerOpenSide;
|
|
13
16
|
exports.partyActorIds = partyActorIds;
|
|
14
17
|
exports.isSellerListing = isSellerListing;
|
|
15
18
|
exports.isTerminalTaskState = isTerminalTaskState;
|
|
@@ -64,19 +67,23 @@ exports.AGREEMENT_PARTY_SIDES = [
|
|
|
64
67
|
'creator',
|
|
65
68
|
];
|
|
66
69
|
/**
|
|
67
|
-
*
|
|
68
|
-
* `
|
|
69
|
-
*
|
|
70
|
-
*
|
|
70
|
+
* @deprecated ZIG-2491 — an offer's open side is empty now (`isOpenSide`,
|
|
71
|
+
* `offerOpenSide`), and who may take it is a grant. Kept only until the web
|
|
72
|
+
* app and the SDK stop reading these; the backend never compares a party to
|
|
73
|
+
* them (agreements/no-placeholder-party.spec.ts).
|
|
71
74
|
*/
|
|
72
75
|
exports.OPEN_AGREEMENT_TARGET = 'everyone';
|
|
76
|
+
/** @deprecated ZIG-2491 — see OPEN_AGREEMENT_TARGET. */
|
|
73
77
|
exports.ORG_AGREEMENT_TARGET = 'org';
|
|
78
|
+
/** @deprecated ZIG-2491 — see OPEN_AGREEMENT_TARGET. */
|
|
74
79
|
exports.COMPANY_AGREEMENT_TARGET = 'company';
|
|
80
|
+
/** @deprecated ZIG-2491 — see OPEN_AGREEMENT_TARGET. */
|
|
75
81
|
exports.BROADCAST_TARGETS = [
|
|
76
82
|
exports.OPEN_AGREEMENT_TARGET,
|
|
77
83
|
exports.ORG_AGREEMENT_TARGET,
|
|
78
84
|
exports.COMPANY_AGREEMENT_TARGET,
|
|
79
85
|
];
|
|
86
|
+
/** @deprecated ZIG-2491 — use `isOpenSide` on the side. */
|
|
80
87
|
function isBroadcastTarget(id) {
|
|
81
88
|
return exports.BROADCAST_TARGETS.includes(id ?? '');
|
|
82
89
|
}
|
|
@@ -84,6 +91,37 @@ function isBroadcastTarget(id) {
|
|
|
84
91
|
function partySideIds(side) {
|
|
85
92
|
return [side?.principal, side?.actor].filter((id) => typeof id === 'string' && id.length > 0);
|
|
86
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* ZIG-2491 — an offer leaves one side empty: no principal and no actor. The
|
|
96
|
+
* paying side when it sells, the proposed-to side when it asks for work. Who may take it is a grant on the offer, never a word in
|
|
97
|
+
* the empty side.
|
|
98
|
+
*/
|
|
99
|
+
function isOpenSide(side) {
|
|
100
|
+
// A side that is not written at all says nothing: an offer writes its open
|
|
101
|
+
// side as `{ principal: null, actor: null }`.
|
|
102
|
+
return !!side && partySideIds(side).length === 0;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* An offer is a template others take: it carries `claimSeats` (how many may
|
|
106
|
+
* hold an agreement made from it). An empty side alone does not make one: a
|
|
107
|
+
* link has no payer, and other agreements leave sides unwritten.
|
|
108
|
+
*/
|
|
109
|
+
function isOfferRow(row) {
|
|
110
|
+
return (!!row &&
|
|
111
|
+
row.claimSeats != null &&
|
|
112
|
+
row.engagementKind !== exports.AGREEMENT_ENGAGEMENT_KIND.LINK);
|
|
113
|
+
}
|
|
114
|
+
function offerOpenSide(row) {
|
|
115
|
+
if (!row?.parties || !isOfferRow(row))
|
|
116
|
+
return null;
|
|
117
|
+
if (isOpenSide(row.parties.payer))
|
|
118
|
+
return 'payer';
|
|
119
|
+
// Asking for work: nobody is named to do it yet. The provider may still
|
|
120
|
+
// carry who the work is for (a hire request names the agent to be hired).
|
|
121
|
+
if (isOpenSide(row.parties.proposedTo))
|
|
122
|
+
return 'provider';
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
87
125
|
/** The agents that acted on any side, deduped. */
|
|
88
126
|
function partyActorIds(parties) {
|
|
89
127
|
const p = parties ?? {};
|
|
@@ -103,12 +141,11 @@ exports.AGREEMENT_ENGAGEMENT_KIND = {
|
|
|
103
141
|
MEMBERSHIP: 'membership',
|
|
104
142
|
};
|
|
105
143
|
/**
|
|
106
|
-
* A seller's standing offer: the
|
|
107
|
-
*
|
|
144
|
+
* A seller's standing offer: the paying side is empty, and the paper is not a
|
|
145
|
+
* reach link. Any status — a paused listing is still a listing.
|
|
108
146
|
*/
|
|
109
147
|
function isSellerListing(row) {
|
|
110
|
-
return (
|
|
111
|
-
row?.engagementKind !== exports.AGREEMENT_ENGAGEMENT_KIND.LINK);
|
|
148
|
+
return offerOpenSide(row) === 'payer';
|
|
112
149
|
}
|
|
113
150
|
/** A task is born active. Negotiation lives on the agreement, not here. */
|
|
114
151
|
exports.TASK_STATE = {
|
|
@@ -164,11 +201,24 @@ exports.CONTEXT_GRANT_SCOPE_KINDS = [
|
|
|
164
201
|
// principal (scope id). Held at write only, never delegated, and minted only
|
|
165
202
|
// by an approved access request.
|
|
166
203
|
'contact',
|
|
204
|
+
// ZIG-2471 — every message of one thread, from the grant's watermark on.
|
|
205
|
+
// The scope id is the thread's access id (`Message.accessThreadId`).
|
|
206
|
+
'thread',
|
|
207
|
+
// ZIG-2471 — an agent. Its root holds an `admit` grant on it: running it.
|
|
208
|
+
'agent',
|
|
209
|
+
// ZIG-2471 — membership of a workspace; the grant's side is the role.
|
|
210
|
+
'workspace',
|
|
211
|
+
// ZIG-2471 — owning a wallet (its workspace) or a connection (whoever
|
|
212
|
+
// connected it): an `admit` grant on it. Spending and using grants stay in
|
|
213
|
+
// their own collections, under the same kinds.
|
|
214
|
+
'connection',
|
|
215
|
+
'wallet',
|
|
216
|
+
// ZIG-2471 — platform staff: side `admin` or `developer`, kept from the
|
|
217
|
+
// user row. Never issued or passed on.
|
|
218
|
+
'platform',
|
|
167
219
|
];
|
|
168
220
|
exports.GRANT_SCOPE_KINDS = [
|
|
169
221
|
...exports.CONTEXT_GRANT_SCOPE_KINDS,
|
|
170
|
-
'connection',
|
|
171
|
-
'wallet',
|
|
172
222
|
'consent',
|
|
173
223
|
'inbox',
|
|
174
224
|
];
|
|
@@ -186,7 +236,12 @@ exports.ACCESS_REQUEST_SCOPE_KINDS = [
|
|
|
186
236
|
* Who an artifact access request may ask a grant FOR. Each reader is named
|
|
187
237
|
* with its kind; the kind is never inferred from an id or a display name.
|
|
188
238
|
*/
|
|
189
|
-
exports.ACCESS_REQUEST_HOLDER_KINDS = [
|
|
239
|
+
exports.ACCESS_REQUEST_HOLDER_KINDS = [
|
|
240
|
+
'agent',
|
|
241
|
+
'user',
|
|
242
|
+
'chatter',
|
|
243
|
+
'org',
|
|
244
|
+
];
|
|
190
245
|
/** How many readers one access request may name. */
|
|
191
246
|
exports.MAX_ACCESS_REQUEST_HOLDERS = 20;
|
|
192
247
|
/** What a chat entry's contentType may be. */
|
|
@@ -202,3 +257,10 @@ exports.MESSAGE_CONTENT_TYPE = {
|
|
|
202
257
|
PROPOSAL: 'proposal',
|
|
203
258
|
};
|
|
204
259
|
exports.MESSAGE_CONTENT_TYPES = Object.values(exports.MESSAGE_CONTENT_TYPE);
|
|
260
|
+
/**
|
|
261
|
+
* The four kinds of party, one word each, in stored fields and on the wire.
|
|
262
|
+
* `user` is a person with an account, `chatter` a person without one (a
|
|
263
|
+
* visitor, or someone a workspace reached by mail or Slack), `agent` an agent
|
|
264
|
+
* and `org` a workspace.
|
|
265
|
+
*/
|
|
266
|
+
exports.PARTY_KINDS = ['user', 'chatter', 'agent', 'org'];
|
package/package.json
CHANGED