@treeseed/sdk 0.13.0-rc.52 → 0.13.0-rc.54

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.
Files changed (25) hide show
  1. package/README.md +4 -0
  2. package/dist/agent-capacity/authority/agent-authority-presets.js +2 -1
  3. package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +2 -2
  4. package/dist/capacity-provider/client.d.ts +15 -0
  5. package/dist/capacity-provider/client.js +6 -0
  6. package/dist/content/validation/agent-operational-content-schemas.d.ts +14 -14
  7. package/dist/content/validation/auxiliary-content-schemas.d.ts +4 -4
  8. package/dist/content/validation/content-model-schemas.d.ts +28 -28
  9. package/dist/content/validation/portable-content-data.d.ts +5 -5
  10. package/dist/deployment/schemas.js +1 -1
  11. package/dist/operator-contracts/canonical-command-tree.js +26 -5
  12. package/dist/operator-contracts/catalog/communication-operations.d.ts +286 -19
  13. package/dist/operator-contracts/catalog/communication-operations.js +56 -2
  14. package/dist/operator-contracts/catalog/inbox-operations.d.ts +261 -0
  15. package/dist/operator-contracts/catalog/inbox-operations.js +36 -0
  16. package/dist/operator-contracts/communication/contracts.d.ts +1223 -33
  17. package/dist/operator-contracts/communication/contracts.js +99 -7
  18. package/dist/operator-contracts/control-plane-operations.d.ts +577 -51
  19. package/dist/operator-contracts/control-plane-operations.js +4 -1
  20. package/dist/operator-contracts/inbox/contracts.d.ts +1099 -0
  21. package/dist/operator-contracts/inbox/contracts.js +134 -0
  22. package/dist/operator-contracts/index.d.ts +1 -0
  23. package/dist/operator-contracts/index.js +1 -0
  24. package/dist/operator-contracts/mcp.js +1 -1
  25. package/package.json +1 -1
@@ -0,0 +1,261 @@
1
+ export declare function inboxOperations(): {
2
+ list: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
3
+ teamId: string;
4
+ }, {
5
+ kind?: "all" | "proposal" | "question" | undefined;
6
+ projectId?: string | undefined;
7
+ state?: "all" | "outstanding" | undefined;
8
+ cursor?: string | undefined;
9
+ limit?: number | undefined;
10
+ }, undefined, {
11
+ schemaVersion: "treeseed.inbox-page/v1";
12
+ items: {
13
+ status: "approved" | "rejected" | "outstanding" | "answered" | "closed" | "deleted";
14
+ kind: "proposal" | "question";
15
+ id: string;
16
+ projectId: string;
17
+ createdAt: string;
18
+ version: number;
19
+ teamId: string;
20
+ projectSlug: string;
21
+ updatedAt: string;
22
+ authorId: string;
23
+ authorLabel: string;
24
+ title: string;
25
+ etag: string;
26
+ }[];
27
+ cursor: string | null;
28
+ }>;
29
+ show: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
30
+ teamId: string;
31
+ itemId: string;
32
+ }, {}, undefined, {
33
+ status: "approved" | "rejected" | "outstanding" | "answered" | "closed" | "deleted";
34
+ kind: "proposal" | "question";
35
+ id: string;
36
+ schemaVersion: "treeseed.inbox-item/v1";
37
+ projectId: string;
38
+ createdAt: string;
39
+ provenance: {
40
+ digest: string | null;
41
+ repositoryId: string | null;
42
+ contentPath: string | null;
43
+ commitSha: string | null;
44
+ };
45
+ version: number;
46
+ teamId: string;
47
+ projectSlug: string;
48
+ updatedAt: string;
49
+ markdown: string;
50
+ discussionId: string | null;
51
+ authorId: string;
52
+ authorLabel: string;
53
+ title: string;
54
+ availableActions: {
55
+ reason: string | null;
56
+ enabled: boolean;
57
+ action: "approve" | "reject" | "publish_revision" | "comment" | "answer" | "reply" | "reopen";
58
+ confirmation: "never" | "input_required";
59
+ label: string;
60
+ requiresFeedback: boolean;
61
+ }[];
62
+ comments: {
63
+ kind: "comment" | "answer" | "reply";
64
+ id: string;
65
+ createdAt: string;
66
+ provenance: {
67
+ digest: string | null;
68
+ repositoryId: string | null;
69
+ contentPath: string | null;
70
+ commitSha: string | null;
71
+ };
72
+ markdown: string;
73
+ parentId: string | null;
74
+ authorId: string;
75
+ authorLabel: string;
76
+ }[];
77
+ etag: string;
78
+ }>;
79
+ events: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
80
+ teamId: string;
81
+ }, {
82
+ limit?: number | undefined;
83
+ after?: string | undefined;
84
+ waitSeconds?: number | undefined;
85
+ }, undefined, {
86
+ cursor: string;
87
+ events: {
88
+ type: "item.created" | "item.updated" | "item.deleted" | "draft.updated" | "comment.created" | "question.answered" | "question.reopened" | "proposal.revised" | "proposal.decided";
89
+ id: string;
90
+ schemaVersion: "treeseed.inbox-event/v1";
91
+ summary: string;
92
+ teamId: string;
93
+ sequence: string;
94
+ occurredAt: string;
95
+ payload: Record<string, unknown>;
96
+ itemId: string | null;
97
+ actorId: string;
98
+ }[];
99
+ }>;
100
+ createQuestion: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
101
+ teamId: string;
102
+ }, {}, {
103
+ projectId: string;
104
+ markdown: string;
105
+ title: string;
106
+ recipients?: string[] | undefined;
107
+ relatedObjectives?: string[] | undefined;
108
+ }, {
109
+ schemaVersion: "treeseed.inbox-mutation-receipt/v1";
110
+ replayed: boolean;
111
+ item: {
112
+ status: "approved" | "rejected" | "outstanding" | "answered" | "closed" | "deleted";
113
+ kind: "proposal" | "question";
114
+ id: string;
115
+ schemaVersion: "treeseed.inbox-item/v1";
116
+ projectId: string;
117
+ createdAt: string;
118
+ provenance: {
119
+ digest: string | null;
120
+ repositoryId: string | null;
121
+ contentPath: string | null;
122
+ commitSha: string | null;
123
+ };
124
+ version: number;
125
+ teamId: string;
126
+ projectSlug: string;
127
+ updatedAt: string;
128
+ markdown: string;
129
+ discussionId: string | null;
130
+ authorId: string;
131
+ authorLabel: string;
132
+ title: string;
133
+ availableActions: {
134
+ reason: string | null;
135
+ enabled: boolean;
136
+ action: "approve" | "reject" | "publish_revision" | "comment" | "answer" | "reply" | "reopen";
137
+ confirmation: "never" | "input_required";
138
+ label: string;
139
+ requiresFeedback: boolean;
140
+ }[];
141
+ comments: {
142
+ kind: "comment" | "answer" | "reply";
143
+ id: string;
144
+ createdAt: string;
145
+ provenance: {
146
+ digest: string | null;
147
+ repositoryId: string | null;
148
+ contentPath: string | null;
149
+ commitSha: string | null;
150
+ };
151
+ markdown: string;
152
+ parentId: string | null;
153
+ authorId: string;
154
+ authorLabel: string;
155
+ }[];
156
+ etag: string;
157
+ };
158
+ action?: "approve" | "reject" | "publish_revision" | "comment" | "answer" | "reply" | "reopen" | undefined;
159
+ receipts?: Record<string, unknown>[] | undefined;
160
+ }>;
161
+ getDraft: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
162
+ teamId: string;
163
+ itemId: string;
164
+ purpose: "feedback" | "proposal_revision";
165
+ }, {}, undefined, {
166
+ schemaVersion: "treeseed.inbox-draft/v1";
167
+ revision: number;
168
+ updatedAt: string;
169
+ markdown: string;
170
+ etag: string;
171
+ itemId: string;
172
+ purpose: "feedback" | "proposal_revision";
173
+ baseVersion: number;
174
+ } | null>;
175
+ putDraft: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
176
+ teamId: string;
177
+ itemId: string;
178
+ purpose: "feedback" | "proposal_revision";
179
+ }, {}, {
180
+ markdown: string;
181
+ baseVersion: number;
182
+ }, {
183
+ schemaVersion: "treeseed.inbox-draft/v1";
184
+ revision: number;
185
+ updatedAt: string;
186
+ markdown: string;
187
+ etag: string;
188
+ itemId: string;
189
+ purpose: "feedback" | "proposal_revision";
190
+ baseVersion: number;
191
+ }>;
192
+ deleteDraft: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
193
+ teamId: string;
194
+ itemId: string;
195
+ purpose: "feedback" | "proposal_revision";
196
+ }, {}, {}, {
197
+ deleted: boolean;
198
+ }>;
199
+ action: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
200
+ teamId: string;
201
+ itemId: string;
202
+ }, {}, {
203
+ action: "approve" | "reject" | "publish_revision" | "comment" | "answer" | "reply" | "reopen";
204
+ markdown?: string | undefined;
205
+ parentId?: string | undefined;
206
+ changeReason?: string | undefined;
207
+ draftRevision?: number | undefined;
208
+ }, {
209
+ schemaVersion: "treeseed.inbox-mutation-receipt/v1";
210
+ replayed: boolean;
211
+ item: {
212
+ status: "approved" | "rejected" | "outstanding" | "answered" | "closed" | "deleted";
213
+ kind: "proposal" | "question";
214
+ id: string;
215
+ schemaVersion: "treeseed.inbox-item/v1";
216
+ projectId: string;
217
+ createdAt: string;
218
+ provenance: {
219
+ digest: string | null;
220
+ repositoryId: string | null;
221
+ contentPath: string | null;
222
+ commitSha: string | null;
223
+ };
224
+ version: number;
225
+ teamId: string;
226
+ projectSlug: string;
227
+ updatedAt: string;
228
+ markdown: string;
229
+ discussionId: string | null;
230
+ authorId: string;
231
+ authorLabel: string;
232
+ title: string;
233
+ availableActions: {
234
+ reason: string | null;
235
+ enabled: boolean;
236
+ action: "approve" | "reject" | "publish_revision" | "comment" | "answer" | "reply" | "reopen";
237
+ confirmation: "never" | "input_required";
238
+ label: string;
239
+ requiresFeedback: boolean;
240
+ }[];
241
+ comments: {
242
+ kind: "comment" | "answer" | "reply";
243
+ id: string;
244
+ createdAt: string;
245
+ provenance: {
246
+ digest: string | null;
247
+ repositoryId: string | null;
248
+ contentPath: string | null;
249
+ commitSha: string | null;
250
+ };
251
+ markdown: string;
252
+ parentId: string | null;
253
+ authorId: string;
254
+ authorLabel: string;
255
+ }[];
256
+ etag: string;
257
+ };
258
+ action?: "approve" | "reject" | "publish_revision" | "comment" | "answer" | "reply" | "reopen" | undefined;
259
+ receipts?: Record<string, unknown>[] | undefined;
260
+ }>;
261
+ };
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ import { defineOperation } from "../operation-builder.js";
3
+ import {
4
+ inboxActionRequestSchema,
5
+ inboxDraftPurposeSchema,
6
+ inboxDraftSchema,
7
+ inboxDraftWriteSchema,
8
+ inboxItemPageSchema,
9
+ inboxItemSchema,
10
+ inboxMutationReceiptSchema,
11
+ inboxQuestionCreateSchema,
12
+ inboxTimelineSchema
13
+ } from "../inbox/contracts.js";
14
+ const empty = z.object({}).strict();
15
+ const none = z.undefined();
16
+ const itemPath = z.object({ teamId: z.string().min(1), itemId: z.string().min(1) }).strict();
17
+ function inboxOperations() {
18
+ return {
19
+ list: defineOperation({ operationId: "inbox.items.list", description: "List the active team governance inbox.", rest: { method: "GET", path: "/v1/teams/{teamId}/inbox/items" }, parameters: "treeseed.inbox.items.list.parameters/v1", capability: "governance.read", authentication: "oauth", oauthScopes: ["treeseed:read"], kind: "read", riskClass: "ordinary", confirmation: "never", surfaces: ["rest", "cli", "mcp_tool", "mcp_resource"], cacheScope: "principal", pagination: "cursor" }, {
20
+ path: z.object({ teamId: z.string().min(1) }).strict(),
21
+ query: z.object({ projectId: z.string().optional(), kind: z.enum(["proposal", "question", "all"]).optional(), state: z.enum(["outstanding", "all"]).optional(), limit: z.coerce.number().int().min(1).max(500).optional(), cursor: z.string().optional() }).strict(),
22
+ body: none,
23
+ output: inboxItemPageSchema
24
+ }),
25
+ show: defineOperation({ operationId: "inbox.items.show", description: "Read one inbox item and its thread.", rest: { method: "GET", path: "/v1/teams/{teamId}/inbox/items/{itemId}" }, parameters: "treeseed.inbox.items.show.parameters/v1", capability: "governance.read", authentication: "oauth", oauthScopes: ["treeseed:read"], kind: "read", riskClass: "ordinary", confirmation: "never", surfaces: ["rest", "cli", "mcp_resource"], cacheScope: "principal", pagination: "none" }, { path: itemPath, query: empty, body: none, output: inboxItemSchema }),
26
+ events: defineOperation({ operationId: "inbox.events.list", description: "Long-poll ordered inbox events.", rest: { method: "GET", path: "/v1/teams/{teamId}/inbox/events" }, parameters: "treeseed.inbox.events.list.parameters/v1", capability: "governance.read", authentication: "oauth", oauthScopes: ["treeseed:read"], kind: "read", riskClass: "ordinary", confirmation: "never", surfaces: ["rest", "cli", "mcp_resource"], cacheScope: "principal", pagination: "cursor" }, { path: z.object({ teamId: z.string() }).strict(), query: z.object({ after: z.string().optional(), waitSeconds: z.coerce.number().int().min(0).max(30).optional(), limit: z.coerce.number().int().min(1).max(500).optional() }).strict(), body: none, output: inboxTimelineSchema }),
27
+ createQuestion: defineOperation({ operationId: "inbox.questions.create", description: "Create and route a TreeDX-backed project question.", rest: { method: "POST", path: "/v1/teams/{teamId}/inbox/questions" }, parameters: "treeseed.inbox.questions.create.parameters/v1", capability: "governance.write", authentication: "oauth", oauthScopes: ["treeseed:knowledge:write", "treeseed:execution"], kind: "mutation", riskClass: "ordinary", confirmation: "never", surfaces: ["rest", "cli", "mcp_tool"], cacheScope: "none", pagination: "none" }, { path: z.object({ teamId: z.string() }).strict(), query: empty, body: inboxQuestionCreateSchema, output: inboxMutationReceiptSchema }),
28
+ getDraft: defineOperation({ operationId: "inbox.drafts.show", description: "Read the current principal private inbox draft.", rest: { method: "GET", path: "/v1/teams/{teamId}/inbox/items/{itemId}/drafts/{purpose}" }, parameters: "treeseed.inbox.drafts.show.parameters/v1", capability: "governance.read", authentication: "oauth", oauthScopes: ["treeseed:read"], kind: "read", riskClass: "ordinary", confirmation: "never", surfaces: ["rest", "cli"], cacheScope: "principal", pagination: "none" }, { path: itemPath.extend({ purpose: inboxDraftPurposeSchema }), query: empty, body: none, output: inboxDraftSchema.nullable() }),
29
+ putDraft: defineOperation({ operationId: "inbox.drafts.put", description: "Save a private inbox draft.", rest: { method: "PUT", path: "/v1/teams/{teamId}/inbox/items/{itemId}/drafts/{purpose}" }, parameters: "treeseed.inbox.drafts.put.parameters/v1", capability: "governance.write", authentication: "oauth", oauthScopes: ["treeseed:governance:write"], kind: "mutation", riskClass: "ordinary", confirmation: "never", surfaces: ["rest", "cli"], cacheScope: "none", pagination: "none", concurrencyRequired: true }, { path: itemPath.extend({ purpose: inboxDraftPurposeSchema }), query: empty, body: inboxDraftWriteSchema, output: inboxDraftSchema }),
30
+ deleteDraft: defineOperation({ operationId: "inbox.drafts.delete", description: "Delete a private inbox draft.", rest: { method: "DELETE", path: "/v1/teams/{teamId}/inbox/items/{itemId}/drafts/{purpose}" }, parameters: "treeseed.inbox.drafts.delete.parameters/v1", capability: "governance.write", authentication: "oauth", oauthScopes: ["treeseed:governance:write"], kind: "mutation", riskClass: "ordinary", confirmation: "never", surfaces: ["rest", "cli"], cacheScope: "none", pagination: "none" }, { path: itemPath.extend({ purpose: inboxDraftPurposeSchema }), query: empty, body: empty, output: z.object({ deleted: z.boolean() }).strict() }),
31
+ action: defineOperation({ operationId: "inbox.items.action", description: "Apply an exact-version inbox action.", rest: { method: "POST", path: "/v1/teams/{teamId}/inbox/items/{itemId}/actions" }, parameters: "treeseed.inbox.items.action.parameters/v1", capability: "governance.write", authentication: "oauth", oauthScopes: ["treeseed:governance:write"], kind: "mutation", riskClass: "ordinary", confirmation: "never", surfaces: ["rest", "cli", "mcp_tool"], cacheScope: "none", pagination: "none", concurrencyRequired: true }, { path: itemPath, query: empty, body: inboxActionRequestSchema, output: inboxMutationReceiptSchema })
32
+ };
33
+ }
34
+ export {
35
+ inboxOperations
36
+ };