@treeseed/sdk 0.13.0-rc.23 → 0.13.0-rc.25

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.
@@ -727,9 +727,9 @@ export declare function validatePortableContentData(model: string, value: unknow
727
727
  agentSlug: import("zod").ZodOptional<import("zod").ZodString>;
728
728
  }, "strict", import("zod").ZodTypeAny, {
729
729
  kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
730
+ teamId?: string | undefined;
730
731
  projectId?: string | undefined;
731
732
  agentSlug?: string | undefined;
732
- teamId?: string | undefined;
733
733
  requiredRoles?: string[] | undefined;
734
734
  allowedRoles?: string[] | undefined;
735
735
  allowedAgentIds?: string[] | undefined;
@@ -738,9 +738,9 @@ export declare function validatePortableContentData(model: string, value: unknow
738
738
  teamMemberId?: string | undefined;
739
739
  }, {
740
740
  kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
741
+ teamId?: string | undefined;
741
742
  projectId?: string | undefined;
742
743
  agentSlug?: string | undefined;
743
- teamId?: string | undefined;
744
744
  requiredRoles?: string[] | undefined;
745
745
  allowedRoles?: string[] | undefined;
746
746
  allowedAgentIds?: string[] | undefined;
@@ -751,9 +751,9 @@ export declare function validatePortableContentData(model: string, value: unknow
751
751
  }, "strict", import("zod").ZodTypeAny, {
752
752
  defaultAnswerPolicy?: {
753
753
  kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
754
+ teamId?: string | undefined;
754
755
  projectId?: string | undefined;
755
756
  agentSlug?: string | undefined;
756
- teamId?: string | undefined;
757
757
  requiredRoles?: string[] | undefined;
758
758
  allowedRoles?: string[] | undefined;
759
759
  allowedAgentIds?: string[] | undefined;
@@ -765,9 +765,9 @@ export declare function validatePortableContentData(model: string, value: unknow
765
765
  }, {
766
766
  defaultAnswerPolicy?: {
767
767
  kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
768
+ teamId?: string | undefined;
768
769
  projectId?: string | undefined;
769
770
  agentSlug?: string | undefined;
770
- teamId?: string | undefined;
771
771
  requiredRoles?: string[] | undefined;
772
772
  allowedRoles?: string[] | undefined;
773
773
  allowedAgentIds?: string[] | undefined;
@@ -1010,9 +1010,9 @@ export declare function validatePortableContentData(model: string, value: unknow
1010
1010
  questionPolicy?: {
1011
1011
  defaultAnswerPolicy?: {
1012
1012
  kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
1013
+ teamId?: string | undefined;
1013
1014
  projectId?: string | undefined;
1014
1015
  agentSlug?: string | undefined;
1015
- teamId?: string | undefined;
1016
1016
  requiredRoles?: string[] | undefined;
1017
1017
  allowedRoles?: string[] | undefined;
1018
1018
  allowedAgentIds?: string[] | undefined;
@@ -1183,9 +1183,9 @@ export declare function validatePortableContentData(model: string, value: unknow
1183
1183
  questionPolicy?: {
1184
1184
  defaultAnswerPolicy?: {
1185
1185
  kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
1186
+ teamId?: string | undefined;
1186
1187
  projectId?: string | undefined;
1187
1188
  agentSlug?: string | undefined;
1188
- teamId?: string | undefined;
1189
1189
  requiredRoles?: string[] | undefined;
1190
1190
  allowedRoles?: string[] | undefined;
1191
1191
  allowedAgentIds?: string[] | undefined;
@@ -1356,9 +1356,9 @@ export declare function validatePortableContentData(model: string, value: unknow
1356
1356
  questionPolicy?: {
1357
1357
  defaultAnswerPolicy?: {
1358
1358
  kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
1359
+ teamId?: string | undefined;
1359
1360
  projectId?: string | undefined;
1360
1361
  agentSlug?: string | undefined;
1361
- teamId?: string | undefined;
1362
1362
  requiredRoles?: string[] | undefined;
1363
1363
  allowedRoles?: string[] | undefined;
1364
1364
  allowedAgentIds?: string[] | undefined;
@@ -1529,9 +1529,9 @@ export declare function validatePortableContentData(model: string, value: unknow
1529
1529
  questionPolicy?: {
1530
1530
  defaultAnswerPolicy?: {
1531
1531
  kind: "team-human" | "human-or-agent" | "specific-human" | "specific-agent";
1532
+ teamId?: string | undefined;
1532
1533
  projectId?: string | undefined;
1533
1534
  agentSlug?: string | undefined;
1534
- teamId?: string | undefined;
1535
1535
  requiredRoles?: string[] | undefined;
1536
1536
  allowedRoles?: string[] | undefined;
1537
1537
  allowedAgentIds?: string[] | undefined;
@@ -1583,8 +1583,8 @@ export declare function validatePortableContentData(model: string, value: unknow
1583
1583
  changedFiles: string[];
1584
1584
  type?: string | undefined;
1585
1585
  completedAt?: Date | undefined;
1586
- priority?: number | undefined;
1587
1586
  createdAt?: Date | undefined;
1587
+ priority?: number | undefined;
1588
1588
  startedAt?: Date | undefined;
1589
1589
  agentId?: string | undefined;
1590
1590
  state?: string | undefined;
@@ -1762,17 +1762,17 @@ export declare function validatePortableContentData(model: string, value: unknow
1762
1762
  } | {
1763
1763
  id: string;
1764
1764
  status: "active" | "completed" | "ready" | "superseded" | "draft";
1765
- projectId: string;
1766
1765
  teamId: string;
1766
+ projectId: string;
1767
1767
  objective: string;
1768
1768
  completed: {
1769
1769
  id: string;
1770
1770
  description: string;
1771
1771
  title: string;
1772
1772
  }[];
1773
+ createdAt: Date;
1773
1774
  title: string;
1774
1775
  revision: number;
1775
- createdAt: Date;
1776
1776
  remaining: {
1777
1777
  id: string;
1778
1778
  description: string;
@@ -1796,11 +1796,11 @@ export declare function validatePortableContentData(model: string, value: unknow
1796
1796
  } | undefined;
1797
1797
  } | {
1798
1798
  id: string;
1799
- status: "completed" | "cancelled" | "failed" | "admitted" | "running" | "suspended" | "pending" | "waiting" | "leased";
1800
- projectId: string;
1799
+ status: "completed" | "cancelled" | "failed" | "running" | "admitted" | "suspended" | "pending" | "waiting" | "leased";
1801
1800
  teamId: string;
1802
- title: string;
1801
+ projectId: string;
1803
1802
  createdAt: Date;
1803
+ title: string;
1804
1804
  sequence: number;
1805
1805
  phase: string;
1806
1806
  description?: string | undefined;
@@ -1818,10 +1818,10 @@ export declare function validatePortableContentData(model: string, value: unknow
1818
1818
  summary: string;
1819
1819
  status: "completed" | "cancelled" | "failed" | "suspended";
1820
1820
  blockers: string[];
1821
- projectId: string;
1822
1821
  teamId: string;
1823
- title: string;
1822
+ projectId: string;
1824
1823
  createdAt: Date;
1824
+ title: string;
1825
1825
  artifactRefs: string[];
1826
1826
  lessons: string[];
1827
1827
  performance: {
@@ -1841,10 +1841,10 @@ export declare function validatePortableContentData(model: string, value: unknow
1841
1841
  } | {
1842
1842
  id: string;
1843
1843
  status: string;
1844
- projectId: string;
1845
1844
  teamId: string;
1846
- title: string;
1845
+ projectId: string;
1847
1846
  createdAt: Date;
1847
+ title: string;
1848
1848
  contextQueryRefs: {
1849
1849
  id: string;
1850
1850
  revision: number;
@@ -2037,10 +2037,10 @@ export declare function validatePortableContentData(model: string, value: unknow
2037
2037
  } | {
2038
2038
  title: string;
2039
2039
  status?: "active" | "archived" | undefined;
2040
+ topic?: string | undefined;
2040
2041
  created_at?: Date | undefined;
2041
2042
  updated_at?: Date | undefined;
2042
2043
  group_ids?: string[] | undefined;
2043
- topic?: string | undefined;
2044
2044
  team_id?: string | undefined;
2045
2045
  project_id?: string | undefined;
2046
2046
  participant_ids?: string[] | undefined;
@@ -12,6 +12,7 @@ const operationBindings = {
12
12
  "auth login": protocol("protocol.oauth.device.login"),
13
13
  "auth logout": protocol("protocol.oauth.revoke"),
14
14
  "auth status": operation("accounts.current.show"),
15
+ "send": operation("communications.send", [field("path", "teamId", "context", "team", true), field("path", "channel", "argument", "channel", true), field("body", "message", "argument", "message", true), field("body", "projectId", "context", "project"), field("body", "recipients", "option", "to"), field("body", "topic", "option"), field("body", "waitSeconds", "option", "wait", false, "integer")]),
15
16
  "secrets list": local("local.secrets.list"),
16
17
  "secrets status": local("local.secrets.status"),
17
18
  "secrets unlock": local("local.secrets.unlock"),
@@ -91,6 +92,7 @@ const commandTree = {
91
92
  schemaVersion: "treeseed.command-tree/v1",
92
93
  executable: "trsd",
93
94
  commands: [
95
+ { nodeType: "leaf", segment: "send", description: "Send a message to project agents through a team discussion channel.", kind: "mutation", arguments: [{ name: "channel", description: "Team discussion channel.", required: true }, { name: "message", description: "Markdown message to send.", required: true }], options: [planOption, { name: "--team", description: "Team identity or slug.", type: "string" }, { name: "--project", description: "Default project for unqualified agent names.", type: "string" }, { name: "--to", description: "Agent target; use project/agent when names may be ambiguous.", type: "string[]" }, { name: "--topic", description: "Optional discussion topic.", type: "string" }, { name: "--wait", description: "Seconds to wait for durable responses.", type: "number", defaultValue: 0 }], authorization: { capability: "agents.execute", confirmation: "never" }, resultSchemaId: "treeseed.communication-send-receipt/v1", execution: unavailable() },
94
96
  branch("auth", [leaf("login", "mutation", void 0, "credential"), leaf("logout", "mutation"), leaf("status")]),
95
97
  branch("secrets", [leaf("list"), leaf("status"), leaf("unlock", "mutation", void 0, "credential"), leaf("lock", "mutation"), leaf("rotate", "mutation", void 0, "credential")]),
96
98
  branch("agents", [
@@ -0,0 +1,90 @@
1
+ export declare function communicationOperations(): {
2
+ send: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
3
+ teamId: string;
4
+ channel: string;
5
+ }, {}, {
6
+ message: string;
7
+ projectId?: string | undefined;
8
+ recipients?: string[] | undefined;
9
+ topic?: string | undefined;
10
+ waitSeconds?: number | undefined;
11
+ }, {
12
+ schemaVersion: "treeseed.communication-send-receipt/v1";
13
+ responses: {
14
+ status: "cancelled" | "failed" | "responded";
15
+ projectId: string;
16
+ agentSlug: string;
17
+ assignmentId: string | null;
18
+ invocationId: string;
19
+ messageRef: string;
20
+ markdown: string;
21
+ createdAt: string;
22
+ }[];
23
+ status: "failed" | "queued" | "running" | "complete" | "partial";
24
+ teamId: string;
25
+ channel: string;
26
+ topic: string | null;
27
+ messageRef: string;
28
+ createdAt: string;
29
+ sendId: string;
30
+ discussionId: string;
31
+ targets: {
32
+ status: "cancelled" | "failed" | "queued" | "running" | "responded";
33
+ projectId: string;
34
+ agentSlug: string;
35
+ projectSlug: string;
36
+ definitionRevision: string;
37
+ invocationId: string | null;
38
+ }[];
39
+ updatedAt: string;
40
+ }>;
41
+ sendStatus: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
42
+ teamId: string;
43
+ sendId: string;
44
+ }, {}, undefined, {
45
+ schemaVersion: "treeseed.communication-send-receipt/v1";
46
+ responses: {
47
+ status: "cancelled" | "failed" | "responded";
48
+ projectId: string;
49
+ agentSlug: string;
50
+ assignmentId: string | null;
51
+ invocationId: string;
52
+ messageRef: string;
53
+ markdown: string;
54
+ createdAt: string;
55
+ }[];
56
+ status: "failed" | "queued" | "running" | "complete" | "partial";
57
+ teamId: string;
58
+ channel: string;
59
+ topic: string | null;
60
+ messageRef: string;
61
+ createdAt: string;
62
+ sendId: string;
63
+ discussionId: string;
64
+ targets: {
65
+ status: "cancelled" | "failed" | "queued" | "running" | "responded";
66
+ projectId: string;
67
+ agentSlug: string;
68
+ projectSlug: string;
69
+ definitionRevision: string;
70
+ invocationId: string | null;
71
+ }[];
72
+ updatedAt: string;
73
+ }>;
74
+ };
75
+ export declare function providerDiscussionResponseOperation(): import("../control-plane-operation.js").ControlPlaneOperationBinding<{
76
+ assignmentId: string;
77
+ }, {}, {
78
+ markdown: string;
79
+ leaseToken: string;
80
+ runnerId: string;
81
+ summary?: string | undefined;
82
+ usage?: Record<string, unknown> | undefined;
83
+ }, {
84
+ schemaVersion: "treeseed.provider-discussion-response-receipt/v1";
85
+ status: "responded";
86
+ assignmentId: string;
87
+ invocationId: string;
88
+ messageRef: string;
89
+ settledAt: string;
90
+ }>;
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import { defineOperation } from "../operation-builder.js";
3
+ import {
4
+ communicationSendReceiptSchema,
5
+ communicationSendRequestSchema,
6
+ providerDiscussionResponseReceiptSchema,
7
+ providerDiscussionResponseRequestSchema
8
+ } from "../communication/contracts.js";
9
+ const empty = z.object({}).strict();
10
+ const none = z.undefined();
11
+ function communicationOperations() {
12
+ return {
13
+ send: defineOperation({ operationId: "communications.send", description: "Post a team-channel message and admit the selected project agents to the communication lane.", rest: { method: "POST", path: "/v1/teams/{teamId}/channels/{channel}/messages" }, parameters: "treeseed.communications.send.parameters/v1", capability: "agents.execute", authentication: "oauth", oauthScopes: ["treeseed:execution"], kind: "mutation", riskClass: "ordinary", confirmation: "never", surfaces: ["rest", "cli", "mcp_tool"], cacheScope: "none", pagination: "none" }, {
14
+ path: z.object({ teamId: z.string().min(1), channel: z.string().trim().min(1).max(120) }).strict(),
15
+ query: empty,
16
+ body: communicationSendRequestSchema,
17
+ output: communicationSendReceiptSchema
18
+ }),
19
+ sendStatus: defineOperation({ operationId: "communications.sends.show", description: "Read a communication send and its durable agent responses.", rest: { method: "GET", path: "/v1/teams/{teamId}/communication-sends/{sendId}" }, parameters: "treeseed.communications.sends.show.parameters/v1", capability: "agents.read", authentication: "oauth", oauthScopes: ["treeseed:read"], kind: "read", riskClass: "ordinary", confirmation: "never", surfaces: ["rest", "mcp_tool", "mcp_resource"], cacheScope: "principal", pagination: "none" }, {
20
+ path: z.object({ teamId: z.string().min(1), sendId: z.string().min(1) }).strict(),
21
+ query: empty,
22
+ body: none,
23
+ output: communicationSendReceiptSchema
24
+ })
25
+ };
26
+ }
27
+ function providerDiscussionResponseOperation() {
28
+ return defineOperation({ operationId: "providers.assignments.discussion.respond", description: "Commit and settle an assignment-scoped discussion response.", rest: { method: "POST", path: "/v1/provider/assignments/{assignmentId}/discussion-response" }, parameters: "treeseed.providers.assignments.discussion.respond.parameters/v1", capability: "providers.execute", authentication: "provider", oauthScopes: [], kind: "mutation", riskClass: "ordinary", confirmation: "never", surfaces: ["rest"], cacheScope: "none", pagination: "none" }, {
29
+ path: z.object({ assignmentId: z.string().min(1) }).strict(),
30
+ query: empty,
31
+ body: providerDiscussionResponseRequestSchema,
32
+ output: providerDiscussionResponseReceiptSchema
33
+ });
34
+ }
35
+ export {
36
+ communicationOperations,
37
+ providerDiscussionResponseOperation
38
+ };
@@ -0,0 +1,250 @@
1
+ import { z } from 'zod';
2
+ export declare const communicationRecipientSchema: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ agentSlug: z.ZodString;
5
+ }, "strict", z.ZodTypeAny, {
6
+ projectId: string;
7
+ agentSlug: string;
8
+ }, {
9
+ projectId: string;
10
+ agentSlug: string;
11
+ }>;
12
+ export declare const communicationSendRequestSchema: z.ZodObject<{
13
+ message: z.ZodString;
14
+ topic: z.ZodOptional<z.ZodString>;
15
+ projectId: z.ZodOptional<z.ZodString>;
16
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
17
+ waitSeconds: z.ZodOptional<z.ZodNumber>;
18
+ }, "strict", z.ZodTypeAny, {
19
+ message: string;
20
+ projectId?: string | undefined;
21
+ recipients?: string[] | undefined;
22
+ topic?: string | undefined;
23
+ waitSeconds?: number | undefined;
24
+ }, {
25
+ message: string;
26
+ projectId?: string | undefined;
27
+ recipients?: string[] | undefined;
28
+ topic?: string | undefined;
29
+ waitSeconds?: number | undefined;
30
+ }>;
31
+ export declare const communicationTargetSchema: z.ZodObject<{
32
+ projectId: z.ZodString;
33
+ agentSlug: z.ZodString;
34
+ } & {
35
+ projectSlug: z.ZodString;
36
+ definitionRevision: z.ZodString;
37
+ invocationId: z.ZodNullable<z.ZodString>;
38
+ status: z.ZodEnum<["queued", "running", "responded", "failed", "cancelled"]>;
39
+ }, "strict", z.ZodTypeAny, {
40
+ status: "cancelled" | "failed" | "queued" | "running" | "responded";
41
+ projectId: string;
42
+ agentSlug: string;
43
+ projectSlug: string;
44
+ definitionRevision: string;
45
+ invocationId: string | null;
46
+ }, {
47
+ status: "cancelled" | "failed" | "queued" | "running" | "responded";
48
+ projectId: string;
49
+ agentSlug: string;
50
+ projectSlug: string;
51
+ definitionRevision: string;
52
+ invocationId: string | null;
53
+ }>;
54
+ export declare const communicationResponseSchema: z.ZodObject<{
55
+ projectId: z.ZodString;
56
+ agentSlug: z.ZodString;
57
+ } & {
58
+ invocationId: z.ZodString;
59
+ assignmentId: z.ZodNullable<z.ZodString>;
60
+ messageRef: z.ZodString;
61
+ markdown: z.ZodString;
62
+ status: z.ZodEnum<["responded", "failed", "cancelled"]>;
63
+ createdAt: z.ZodString;
64
+ }, "strict", z.ZodTypeAny, {
65
+ status: "cancelled" | "failed" | "responded";
66
+ projectId: string;
67
+ agentSlug: string;
68
+ assignmentId: string | null;
69
+ invocationId: string;
70
+ messageRef: string;
71
+ markdown: string;
72
+ createdAt: string;
73
+ }, {
74
+ status: "cancelled" | "failed" | "responded";
75
+ projectId: string;
76
+ agentSlug: string;
77
+ assignmentId: string | null;
78
+ invocationId: string;
79
+ messageRef: string;
80
+ markdown: string;
81
+ createdAt: string;
82
+ }>;
83
+ export declare const communicationSendReceiptSchema: z.ZodObject<{
84
+ schemaVersion: z.ZodLiteral<"treeseed.communication-send-receipt/v1">;
85
+ sendId: z.ZodString;
86
+ teamId: z.ZodString;
87
+ channel: z.ZodString;
88
+ topic: z.ZodNullable<z.ZodString>;
89
+ discussionId: z.ZodString;
90
+ messageRef: z.ZodString;
91
+ status: z.ZodEnum<["queued", "running", "complete", "partial", "failed"]>;
92
+ targets: z.ZodArray<z.ZodObject<{
93
+ projectId: z.ZodString;
94
+ agentSlug: z.ZodString;
95
+ } & {
96
+ projectSlug: z.ZodString;
97
+ definitionRevision: z.ZodString;
98
+ invocationId: z.ZodNullable<z.ZodString>;
99
+ status: z.ZodEnum<["queued", "running", "responded", "failed", "cancelled"]>;
100
+ }, "strict", z.ZodTypeAny, {
101
+ status: "cancelled" | "failed" | "queued" | "running" | "responded";
102
+ projectId: string;
103
+ agentSlug: string;
104
+ projectSlug: string;
105
+ definitionRevision: string;
106
+ invocationId: string | null;
107
+ }, {
108
+ status: "cancelled" | "failed" | "queued" | "running" | "responded";
109
+ projectId: string;
110
+ agentSlug: string;
111
+ projectSlug: string;
112
+ definitionRevision: string;
113
+ invocationId: string | null;
114
+ }>, "many">;
115
+ responses: z.ZodArray<z.ZodObject<{
116
+ projectId: z.ZodString;
117
+ agentSlug: z.ZodString;
118
+ } & {
119
+ invocationId: z.ZodString;
120
+ assignmentId: z.ZodNullable<z.ZodString>;
121
+ messageRef: z.ZodString;
122
+ markdown: z.ZodString;
123
+ status: z.ZodEnum<["responded", "failed", "cancelled"]>;
124
+ createdAt: z.ZodString;
125
+ }, "strict", z.ZodTypeAny, {
126
+ status: "cancelled" | "failed" | "responded";
127
+ projectId: string;
128
+ agentSlug: string;
129
+ assignmentId: string | null;
130
+ invocationId: string;
131
+ messageRef: string;
132
+ markdown: string;
133
+ createdAt: string;
134
+ }, {
135
+ status: "cancelled" | "failed" | "responded";
136
+ projectId: string;
137
+ agentSlug: string;
138
+ assignmentId: string | null;
139
+ invocationId: string;
140
+ messageRef: string;
141
+ markdown: string;
142
+ createdAt: string;
143
+ }>, "many">;
144
+ createdAt: z.ZodString;
145
+ updatedAt: z.ZodString;
146
+ }, "strict", z.ZodTypeAny, {
147
+ schemaVersion: "treeseed.communication-send-receipt/v1";
148
+ responses: {
149
+ status: "cancelled" | "failed" | "responded";
150
+ projectId: string;
151
+ agentSlug: string;
152
+ assignmentId: string | null;
153
+ invocationId: string;
154
+ messageRef: string;
155
+ markdown: string;
156
+ createdAt: string;
157
+ }[];
158
+ status: "failed" | "queued" | "running" | "complete" | "partial";
159
+ teamId: string;
160
+ channel: string;
161
+ topic: string | null;
162
+ messageRef: string;
163
+ createdAt: string;
164
+ sendId: string;
165
+ discussionId: string;
166
+ targets: {
167
+ status: "cancelled" | "failed" | "queued" | "running" | "responded";
168
+ projectId: string;
169
+ agentSlug: string;
170
+ projectSlug: string;
171
+ definitionRevision: string;
172
+ invocationId: string | null;
173
+ }[];
174
+ updatedAt: string;
175
+ }, {
176
+ schemaVersion: "treeseed.communication-send-receipt/v1";
177
+ responses: {
178
+ status: "cancelled" | "failed" | "responded";
179
+ projectId: string;
180
+ agentSlug: string;
181
+ assignmentId: string | null;
182
+ invocationId: string;
183
+ messageRef: string;
184
+ markdown: string;
185
+ createdAt: string;
186
+ }[];
187
+ status: "failed" | "queued" | "running" | "complete" | "partial";
188
+ teamId: string;
189
+ channel: string;
190
+ topic: string | null;
191
+ messageRef: string;
192
+ createdAt: string;
193
+ sendId: string;
194
+ discussionId: string;
195
+ targets: {
196
+ status: "cancelled" | "failed" | "queued" | "running" | "responded";
197
+ projectId: string;
198
+ agentSlug: string;
199
+ projectSlug: string;
200
+ definitionRevision: string;
201
+ invocationId: string | null;
202
+ }[];
203
+ updatedAt: string;
204
+ }>;
205
+ export declare const providerDiscussionResponseRequestSchema: z.ZodObject<{
206
+ leaseToken: z.ZodString;
207
+ runnerId: z.ZodString;
208
+ markdown: z.ZodString;
209
+ summary: z.ZodOptional<z.ZodString>;
210
+ usage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
211
+ }, "strict", z.ZodTypeAny, {
212
+ markdown: string;
213
+ leaseToken: string;
214
+ runnerId: string;
215
+ summary?: string | undefined;
216
+ usage?: Record<string, unknown> | undefined;
217
+ }, {
218
+ markdown: string;
219
+ leaseToken: string;
220
+ runnerId: string;
221
+ summary?: string | undefined;
222
+ usage?: Record<string, unknown> | undefined;
223
+ }>;
224
+ export declare const providerDiscussionResponseReceiptSchema: z.ZodObject<{
225
+ schemaVersion: z.ZodLiteral<"treeseed.provider-discussion-response-receipt/v1">;
226
+ assignmentId: z.ZodString;
227
+ invocationId: z.ZodString;
228
+ messageRef: z.ZodString;
229
+ status: z.ZodLiteral<"responded">;
230
+ settledAt: z.ZodString;
231
+ }, "strict", z.ZodTypeAny, {
232
+ schemaVersion: "treeseed.provider-discussion-response-receipt/v1";
233
+ status: "responded";
234
+ assignmentId: string;
235
+ invocationId: string;
236
+ messageRef: string;
237
+ settledAt: string;
238
+ }, {
239
+ schemaVersion: "treeseed.provider-discussion-response-receipt/v1";
240
+ status: "responded";
241
+ assignmentId: string;
242
+ invocationId: string;
243
+ messageRef: string;
244
+ settledAt: string;
245
+ }>;
246
+ export type CommunicationSendRequest = z.infer<typeof communicationSendRequestSchema>;
247
+ export type CommunicationSendReceipt = z.infer<typeof communicationSendReceiptSchema>;
248
+ export type CommunicationResponse = z.infer<typeof communicationResponseSchema>;
249
+ export type ProviderDiscussionResponseRequest = z.infer<typeof providerDiscussionResponseRequestSchema>;
250
+ export type ProviderDiscussionResponseReceipt = z.infer<typeof providerDiscussionResponseReceiptSchema>;
@@ -0,0 +1,64 @@
1
+ import { z } from "zod";
2
+ const communicationRecipientSchema = z.object({
3
+ projectId: z.string().min(1),
4
+ agentSlug: z.string().min(1)
5
+ }).strict();
6
+ const communicationSendRequestSchema = z.object({
7
+ message: z.string().trim().min(1).max(1e5),
8
+ topic: z.string().trim().min(1).max(240).optional(),
9
+ projectId: z.string().min(1).optional(),
10
+ recipients: z.array(z.string().trim().min(1)).max(100).optional(),
11
+ waitSeconds: z.number().int().min(0).max(3600).optional()
12
+ }).strict();
13
+ const communicationTargetSchema = communicationRecipientSchema.extend({
14
+ projectSlug: z.string().min(1),
15
+ definitionRevision: z.string().min(1),
16
+ invocationId: z.string().min(1).nullable(),
17
+ status: z.enum(["queued", "running", "responded", "failed", "cancelled"])
18
+ });
19
+ const communicationResponseSchema = communicationRecipientSchema.extend({
20
+ invocationId: z.string().min(1),
21
+ assignmentId: z.string().min(1).nullable(),
22
+ messageRef: z.string().min(1),
23
+ markdown: z.string(),
24
+ status: z.enum(["responded", "failed", "cancelled"]),
25
+ createdAt: z.string().datetime()
26
+ });
27
+ const communicationSendReceiptSchema = z.object({
28
+ schemaVersion: z.literal("treeseed.communication-send-receipt/v1"),
29
+ sendId: z.string().min(1),
30
+ teamId: z.string().min(1),
31
+ channel: z.string().min(1),
32
+ topic: z.string().nullable(),
33
+ discussionId: z.string().min(1),
34
+ messageRef: z.string().min(1),
35
+ status: z.enum(["queued", "running", "complete", "partial", "failed"]),
36
+ targets: z.array(communicationTargetSchema),
37
+ responses: z.array(communicationResponseSchema),
38
+ createdAt: z.string().datetime(),
39
+ updatedAt: z.string().datetime()
40
+ }).strict();
41
+ const providerDiscussionResponseRequestSchema = z.object({
42
+ leaseToken: z.string().min(1),
43
+ runnerId: z.string().min(1),
44
+ markdown: z.string().trim().min(1).max(1e5),
45
+ summary: z.string().trim().min(1).max(4e3).optional(),
46
+ usage: z.record(z.unknown()).optional()
47
+ }).strict();
48
+ const providerDiscussionResponseReceiptSchema = z.object({
49
+ schemaVersion: z.literal("treeseed.provider-discussion-response-receipt/v1"),
50
+ assignmentId: z.string().min(1),
51
+ invocationId: z.string().min(1),
52
+ messageRef: z.string().min(1),
53
+ status: z.literal("responded"),
54
+ settledAt: z.string().datetime()
55
+ }).strict();
56
+ export {
57
+ communicationRecipientSchema,
58
+ communicationResponseSchema,
59
+ communicationSendReceiptSchema,
60
+ communicationSendRequestSchema,
61
+ communicationTargetSchema,
62
+ providerDiscussionResponseReceiptSchema,
63
+ providerDiscussionResponseRequestSchema
64
+ };