@treeseed/sdk 0.13.0-rc.36 → 0.13.0-rc.38

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.
@@ -45,7 +45,7 @@ export declare class ProviderProtocolClient {
45
45
  startAssignmentCloseout(assignmentId: string, request: Record<string, unknown>): Promise<Record<string, unknown>>;
46
46
  preflightAssignmentCompletion(assignmentId: string, request: Record<string, unknown>): Promise<Record<string, unknown>>;
47
47
  respondToAssignmentDiscussion(assignmentId: string, request: ProviderDiscussionResponseRequest, idempotencyKey: string): Promise<{
48
- status: "responded";
48
+ status: "responded" | "abstained";
49
49
  schemaVersion: "treeseed.provider-discussion-response-receipt/v1";
50
50
  assignmentId: string;
51
51
  invocationId: string;
@@ -45,6 +45,7 @@ export declare const agentContextQueryContentSchema: z.ZodObject<{
45
45
  revision: number;
46
46
  description: string;
47
47
  query: string;
48
+ depth: number;
48
49
  title: string;
49
50
  filters: Record<string, unknown>;
50
51
  target: {
@@ -52,7 +53,6 @@ export declare const agentContextQueryContentSchema: z.ZodObject<{
52
53
  paths?: string[] | undefined;
53
54
  models?: string[] | undefined;
54
55
  };
55
- depth: number;
56
56
  purpose: string;
57
57
  maturity: "draft" | "validated" | "simulated" | "proven";
58
58
  relations: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[];
@@ -85,9 +85,9 @@ export declare const agentContextQueryContentSchema: z.ZodObject<{
85
85
  };
86
86
  tokenBudget: number;
87
87
  required?: boolean | undefined;
88
+ depth?: number | undefined;
88
89
  scope?: string | undefined;
89
90
  filters?: Record<string, unknown> | undefined;
90
- depth?: number | undefined;
91
91
  codeScopes?: string[] | undefined;
92
92
  relations?: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[] | undefined;
93
93
  format?: "map" | "summary" | "list" | "brief" | "full" | "sources" | undefined;
@@ -597,6 +597,7 @@ export declare const agentEvaluationContentSchema: z.ZodObject<{
597
597
  createdAt: Date;
598
598
  teamId: string;
599
599
  projectId: string;
600
+ outcome: "failed" | "passed" | "needs-revision";
600
601
  title: string;
601
602
  contextQueryRefs: {
602
603
  id: string;
@@ -611,7 +612,6 @@ export declare const agentEvaluationContentSchema: z.ZodObject<{
611
612
  revision: number;
612
613
  }[];
613
614
  agentId: string;
614
- outcome: "failed" | "passed" | "needs-revision";
615
615
  agentDefinitionRef: {
616
616
  id: string;
617
617
  revision: number;
@@ -635,9 +635,9 @@ export declare const agentEvaluationContentSchema: z.ZodObject<{
635
635
  createdAt: Date;
636
636
  teamId: string;
637
637
  projectId: string;
638
+ outcome: "failed" | "passed" | "needs-revision";
638
639
  title: string;
639
640
  agentId: string;
640
- outcome: "failed" | "passed" | "needs-revision";
641
641
  agentDefinitionRef: {
642
642
  id: string;
643
643
  revision: number;
@@ -715,6 +715,7 @@ export declare const agentOperationalContentSchemas: {
715
715
  revision: number;
716
716
  description: string;
717
717
  query: string;
718
+ depth: number;
718
719
  title: string;
719
720
  filters: Record<string, unknown>;
720
721
  target: {
@@ -722,7 +723,6 @@ export declare const agentOperationalContentSchemas: {
722
723
  paths?: string[] | undefined;
723
724
  models?: string[] | undefined;
724
725
  };
725
- depth: number;
726
726
  purpose: string;
727
727
  maturity: "draft" | "validated" | "simulated" | "proven";
728
728
  relations: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[];
@@ -755,9 +755,9 @@ export declare const agentOperationalContentSchemas: {
755
755
  };
756
756
  tokenBudget: number;
757
757
  required?: boolean | undefined;
758
+ depth?: number | undefined;
758
759
  scope?: string | undefined;
759
760
  filters?: Record<string, unknown> | undefined;
760
- depth?: number | undefined;
761
761
  codeScopes?: string[] | undefined;
762
762
  relations?: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[] | undefined;
763
763
  format?: "map" | "summary" | "list" | "brief" | "full" | "sources" | undefined;
@@ -1267,6 +1267,7 @@ export declare const agentOperationalContentSchemas: {
1267
1267
  createdAt: Date;
1268
1268
  teamId: string;
1269
1269
  projectId: string;
1270
+ outcome: "failed" | "passed" | "needs-revision";
1270
1271
  title: string;
1271
1272
  contextQueryRefs: {
1272
1273
  id: string;
@@ -1281,7 +1282,6 @@ export declare const agentOperationalContentSchemas: {
1281
1282
  revision: number;
1282
1283
  }[];
1283
1284
  agentId: string;
1284
- outcome: "failed" | "passed" | "needs-revision";
1285
1285
  agentDefinitionRef: {
1286
1286
  id: string;
1287
1287
  revision: number;
@@ -1305,9 +1305,9 @@ export declare const agentOperationalContentSchemas: {
1305
1305
  createdAt: Date;
1306
1306
  teamId: string;
1307
1307
  projectId: string;
1308
+ outcome: "failed" | "passed" | "needs-revision";
1308
1309
  title: string;
1309
1310
  agentId: string;
1310
- outcome: "failed" | "passed" | "needs-revision";
1311
1311
  agentDefinitionRef: {
1312
1312
  id: string;
1313
1313
  revision: number;
@@ -48,6 +48,7 @@ declare const schemas: {
48
48
  revision: number;
49
49
  description: string;
50
50
  query: string;
51
+ depth: number;
51
52
  title: string;
52
53
  filters: Record<string, unknown>;
53
54
  target: {
@@ -55,7 +56,6 @@ declare const schemas: {
55
56
  paths?: string[] | undefined;
56
57
  models?: string[] | undefined;
57
58
  };
58
- depth: number;
59
59
  purpose: string;
60
60
  maturity: "draft" | "validated" | "simulated" | "proven";
61
61
  relations: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[];
@@ -88,9 +88,9 @@ declare const schemas: {
88
88
  };
89
89
  tokenBudget: number;
90
90
  required?: boolean | undefined;
91
+ depth?: number | undefined;
91
92
  scope?: string | undefined;
92
93
  filters?: Record<string, unknown> | undefined;
93
- depth?: number | undefined;
94
94
  codeScopes?: string[] | undefined;
95
95
  relations?: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[] | undefined;
96
96
  format?: "map" | "summary" | "list" | "brief" | "full" | "sources" | undefined;
@@ -600,6 +600,7 @@ declare const schemas: {
600
600
  createdAt: Date;
601
601
  teamId: string;
602
602
  projectId: string;
603
+ outcome: "failed" | "passed" | "needs-revision";
603
604
  title: string;
604
605
  contextQueryRefs: {
605
606
  id: string;
@@ -614,7 +615,6 @@ declare const schemas: {
614
615
  revision: number;
615
616
  }[];
616
617
  agentId: string;
617
- outcome: "failed" | "passed" | "needs-revision";
618
618
  agentDefinitionRef: {
619
619
  id: string;
620
620
  revision: number;
@@ -638,9 +638,9 @@ declare const schemas: {
638
638
  createdAt: Date;
639
639
  teamId: string;
640
640
  projectId: string;
641
+ outcome: "failed" | "passed" | "needs-revision";
641
642
  title: string;
642
643
  agentId: string;
643
- outcome: "failed" | "passed" | "needs-revision";
644
644
  agentDefinitionRef: {
645
645
  id: string;
646
646
  revision: number;
@@ -11529,6 +11529,7 @@ export declare function validateContentFrontmatter(model: PortableContentModel,
11529
11529
  revision: number;
11530
11530
  description: string;
11531
11531
  query: string;
11532
+ depth: number;
11532
11533
  title: string;
11533
11534
  filters: Record<string, unknown>;
11534
11535
  target: {
@@ -11536,7 +11537,6 @@ export declare function validateContentFrontmatter(model: PortableContentModel,
11536
11537
  paths?: string[] | undefined;
11537
11538
  models?: string[] | undefined;
11538
11539
  };
11539
- depth: number;
11540
11540
  purpose: string;
11541
11541
  maturity: "draft" | "validated" | "simulated" | "proven";
11542
11542
  relations: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[];
@@ -11662,6 +11662,7 @@ export declare function validateContentFrontmatter(model: PortableContentModel,
11662
11662
  createdAt: Date;
11663
11663
  teamId: string;
11664
11664
  projectId: string;
11665
+ outcome: "failed" | "passed" | "needs-revision";
11665
11666
  title: string;
11666
11667
  contextQueryRefs: {
11667
11668
  id: string;
@@ -11676,7 +11677,6 @@ export declare function validateContentFrontmatter(model: PortableContentModel,
11676
11677
  revision: number;
11677
11678
  }[];
11678
11679
  agentId: string;
11679
- outcome: "failed" | "passed" | "needs-revision";
11680
11680
  agentDefinitionRef: {
11681
11681
  id: string;
11682
11682
  revision: number;
@@ -20422,6 +20422,7 @@ export declare function describeContentFrontmatterSchema(model: PortableContentM
20422
20422
  revision: number;
20423
20423
  description: string;
20424
20424
  query: string;
20425
+ depth: number;
20425
20426
  title: string;
20426
20427
  filters: Record<string, unknown>;
20427
20428
  target: {
@@ -20429,7 +20430,6 @@ export declare function describeContentFrontmatterSchema(model: PortableContentM
20429
20430
  paths?: string[] | undefined;
20430
20431
  models?: string[] | undefined;
20431
20432
  };
20432
- depth: number;
20433
20433
  purpose: string;
20434
20434
  maturity: "draft" | "validated" | "simulated" | "proven";
20435
20435
  relations: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[];
@@ -20462,9 +20462,9 @@ export declare function describeContentFrontmatterSchema(model: PortableContentM
20462
20462
  };
20463
20463
  tokenBudget: number;
20464
20464
  required?: boolean | undefined;
20465
+ depth?: number | undefined;
20465
20466
  scope?: string | undefined;
20466
20467
  filters?: Record<string, unknown> | undefined;
20467
- depth?: number | undefined;
20468
20468
  codeScopes?: string[] | undefined;
20469
20469
  relations?: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[] | undefined;
20470
20470
  format?: "map" | "summary" | "list" | "brief" | "full" | "sources" | undefined;
@@ -20967,6 +20967,7 @@ export declare function describeContentFrontmatterSchema(model: PortableContentM
20967
20967
  createdAt: Date;
20968
20968
  teamId: string;
20969
20969
  projectId: string;
20970
+ outcome: "failed" | "passed" | "needs-revision";
20970
20971
  title: string;
20971
20972
  contextQueryRefs: {
20972
20973
  id: string;
@@ -20981,7 +20982,6 @@ export declare function describeContentFrontmatterSchema(model: PortableContentM
20981
20982
  revision: number;
20982
20983
  }[];
20983
20984
  agentId: string;
20984
- outcome: "failed" | "passed" | "needs-revision";
20985
20985
  agentDefinitionRef: {
20986
20986
  id: string;
20987
20987
  revision: number;
@@ -21005,9 +21005,9 @@ export declare function describeContentFrontmatterSchema(model: PortableContentM
21005
21005
  createdAt: Date;
21006
21006
  teamId: string;
21007
21007
  projectId: string;
21008
+ outcome: "failed" | "passed" | "needs-revision";
21008
21009
  title: string;
21009
21010
  agentId: string;
21010
- outcome: "failed" | "passed" | "needs-revision";
21011
21011
  agentDefinitionRef: {
21012
21012
  id: string;
21013
21013
  revision: number;
@@ -1711,6 +1711,7 @@ export declare function validatePortableContentData(model: string, value: unknow
1711
1711
  revision: number;
1712
1712
  description: string;
1713
1713
  query: string;
1714
+ depth: number;
1714
1715
  title: string;
1715
1716
  filters: Record<string, unknown>;
1716
1717
  target: {
@@ -1718,7 +1719,6 @@ export declare function validatePortableContentData(model: string, value: unknow
1718
1719
  paths?: string[] | undefined;
1719
1720
  models?: string[] | undefined;
1720
1721
  };
1721
- depth: number;
1722
1722
  purpose: string;
1723
1723
  maturity: "draft" | "validated" | "simulated" | "proven";
1724
1724
  relations: import("../../sdk-types/support/sdk-search-request.js").SdkGraphDslRelation[];
@@ -1844,6 +1844,7 @@ export declare function validatePortableContentData(model: string, value: unknow
1844
1844
  createdAt: Date;
1845
1845
  teamId: string;
1846
1846
  projectId: string;
1847
+ outcome: "failed" | "passed" | "needs-revision";
1847
1848
  title: string;
1848
1849
  contextQueryRefs: {
1849
1850
  id: string;
@@ -1858,7 +1859,6 @@ export declare function validatePortableContentData(model: string, value: unknow
1858
1859
  revision: number;
1859
1860
  }[];
1860
1861
  agentId: string;
1861
- outcome: "failed" | "passed" | "needs-revision";
1862
1862
  agentDefinitionRef: {
1863
1863
  id: string;
1864
1864
  revision: number;
@@ -15,6 +15,11 @@ export interface ControlPlaneServerSession {
15
15
  refreshToken?: string;
16
16
  expiresAt?: string;
17
17
  principal?: ApiPrincipal | null;
18
+ activeTeam?: {
19
+ id: string;
20
+ slug: string;
21
+ name: string;
22
+ } | null;
18
23
  }
19
24
  export interface ControlPlaneServerRegistry {
20
25
  version: 1;
@@ -13,7 +13,10 @@ const operationBindings = {
13
13
  "auth logout": protocol("protocol.oauth.revoke"),
14
14
  "auth status": operation("accounts.current.show"),
15
15
  "users create": protocol("protocol.accounts.create"),
16
- "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")]),
16
+ "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", true), field("body", "recipients", "option", "to"), field("body", "timeoutSeconds", "option", "timeout", false, "integer")]),
17
+ "teams list": operation("teams.list", page()),
18
+ "teams current": local("local.teams.current"),
19
+ "teams use": local("local.teams.use"),
17
20
  "secrets list": local("local.secrets.list"),
18
21
  "secrets status": local("local.secrets.status"),
19
22
  "secrets unlock": local("local.secrets.unlock"),
@@ -192,9 +195,10 @@ const commandTree = {
192
195
  schemaVersion: "treeseed.command-tree/v1",
193
196
  executable: "trsd",
194
197
  commands: [
195
- { 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() },
198
+ { nodeType: "leaf", segment: "send", description: "Send a message to addressed project agents in a team discussion topic.", kind: "mutation", arguments: [{ name: "channel", description: "Team discussion-topic channel.", required: true }, { name: "message", description: "Markdown message containing agent addresses.", required: true }], options: [planOption, { name: "--team", description: "One-command team override.", type: "string" }, { name: "--project", description: "Project for agent resolution and the topic stream.", type: "string", required: true }, { name: "--to", description: "Deprecated validation-only address list.", type: "string[]" }, { name: "--timeout", description: "Maximum seconds to wait for the complete response chain.", type: "number", defaultValue: 1800 }, { name: "--no-wait", description: "Return immediately after durable admission.", type: "boolean" }, { name: "--wait", description: "Deprecated wait duration in seconds.", type: "number" }], authorization: { capability: "agents.execute", confirmation: "never" }, resultSchemaId: "treeseed.communication-send-receipt/v2", execution: unavailable() },
196
199
  branch("auth", [authLogin(), leaf("logout", "mutation"), leaf("status")]),
197
200
  branch("users", [userCreate()]),
201
+ branch("teams", [leaf("list"), { nodeType: "leaf", segment: "current", description: "Show the active team for this authenticated server session.", kind: "read", resultSchemaId: "treeseed.command.teams.current/v1", execution: unavailable() }, { nodeType: "leaf", segment: "use", description: "Select the active team for this authenticated server session.", kind: "mutation", arguments: [{ name: "team", description: "Team UUID or unambiguous slug.", required: true }], options: [planOption], authorization: { capability: "teams.read", confirmation: "never" }, resultSchemaId: "treeseed.command.teams.use/v1", execution: unavailable() }]),
198
202
  branch("secrets", [leaf("list"), leaf("status"), leaf("unlock", "mutation", void 0, "credential"), leaf("lock", "mutation"), leaf("rotate", "mutation", void 0, "credential")]),
199
203
  branch("host", [
200
204
  leaf("status"),
@@ -4,84 +4,164 @@ export declare function communicationOperations(): {
4
4
  channel: string;
5
5
  }, {}, {
6
6
  message: string;
7
- projectId?: string | undefined;
7
+ projectId: string;
8
+ timeoutSeconds?: number | undefined;
8
9
  recipients?: string[] | undefined;
9
- topic?: string | undefined;
10
- waitSeconds?: number | undefined;
11
10
  }, {
12
11
  status: "partial" | "failed" | "complete" | "running" | "queued";
13
- schemaVersion: "treeseed.communication-send-receipt/v1";
12
+ schemaVersion: "treeseed.communication-send-receipt/v2";
14
13
  createdAt: string;
15
14
  responses: {
16
- status: "failed" | "cancelled" | "responded";
15
+ status: "failed" | "cancelled" | "responded" | "abstained";
17
16
  createdAt: string;
18
17
  projectId: string;
19
18
  agentSlug: string;
20
19
  assignmentId: string | null;
21
20
  invocationId: string;
21
+ requirement: "required" | "optional";
22
22
  messageRef: string;
23
23
  markdown: string;
24
24
  }[];
25
25
  teamId: string;
26
26
  channel: string;
27
- topic: string | null;
27
+ updatedAt: string;
28
28
  messageRef: string;
29
29
  sendId: string;
30
+ topic: {
31
+ id: string;
32
+ slug: string;
33
+ };
34
+ projectStream: {
35
+ id: string;
36
+ projectId: string;
37
+ projectSlug: string;
38
+ };
30
39
  discussionId: string;
40
+ sourceMessage: string;
31
41
  targets: {
32
- status: "failed" | "running" | "cancelled" | "queued" | "responded";
42
+ status: "failed" | "running" | "cancelled" | "queued" | "responded" | "abstained";
43
+ completedAt: string | null;
33
44
  projectId: string;
34
45
  agentSlug: string;
46
+ capacity: {
47
+ status: string | null;
48
+ completedAt: string | null;
49
+ providerId: string | null;
50
+ assignmentId: string | null;
51
+ executionProviderId: string | null;
52
+ laneId: string | null;
53
+ lanePurpose: string | null;
54
+ assignedAt: string | null;
55
+ claimedAt: string | null;
56
+ returnedAt: string | null;
57
+ failedAt: string | null;
58
+ };
35
59
  projectSlug: string;
36
60
  definitionRevision: string;
61
+ revisions: {
62
+ project: string;
63
+ library: string;
64
+ agentDefinition: string;
65
+ chatProfile: string;
66
+ };
37
67
  invocationId: string | null;
68
+ requirement: "required" | "optional";
69
+ parentInvocationId: string | null;
70
+ depth: number;
71
+ requestedAt: string;
72
+ updatedAt: string;
73
+ failure: {
74
+ code: string;
75
+ message: string | null;
76
+ } | null;
38
77
  }[];
39
- updatedAt: string;
78
+ replayed: boolean;
40
79
  }>;
41
80
  sendStatus: import("../control-plane-operation.js").ControlPlaneOperationBinding<{
42
81
  teamId: string;
43
82
  sendId: string;
44
83
  }, {}, undefined, {
45
84
  status: "partial" | "failed" | "complete" | "running" | "queued";
46
- schemaVersion: "treeseed.communication-send-receipt/v1";
85
+ schemaVersion: "treeseed.communication-send-receipt/v2";
47
86
  createdAt: string;
48
87
  responses: {
49
- status: "failed" | "cancelled" | "responded";
88
+ status: "failed" | "cancelled" | "responded" | "abstained";
50
89
  createdAt: string;
51
90
  projectId: string;
52
91
  agentSlug: string;
53
92
  assignmentId: string | null;
54
93
  invocationId: string;
94
+ requirement: "required" | "optional";
55
95
  messageRef: string;
56
96
  markdown: string;
57
97
  }[];
58
98
  teamId: string;
59
99
  channel: string;
60
- topic: string | null;
100
+ updatedAt: string;
61
101
  messageRef: string;
62
102
  sendId: string;
103
+ topic: {
104
+ id: string;
105
+ slug: string;
106
+ };
107
+ projectStream: {
108
+ id: string;
109
+ projectId: string;
110
+ projectSlug: string;
111
+ };
63
112
  discussionId: string;
113
+ sourceMessage: string;
64
114
  targets: {
65
- status: "failed" | "running" | "cancelled" | "queued" | "responded";
115
+ status: "failed" | "running" | "cancelled" | "queued" | "responded" | "abstained";
116
+ completedAt: string | null;
66
117
  projectId: string;
67
118
  agentSlug: string;
119
+ capacity: {
120
+ status: string | null;
121
+ completedAt: string | null;
122
+ providerId: string | null;
123
+ assignmentId: string | null;
124
+ executionProviderId: string | null;
125
+ laneId: string | null;
126
+ lanePurpose: string | null;
127
+ assignedAt: string | null;
128
+ claimedAt: string | null;
129
+ returnedAt: string | null;
130
+ failedAt: string | null;
131
+ };
68
132
  projectSlug: string;
69
133
  definitionRevision: string;
134
+ revisions: {
135
+ project: string;
136
+ library: string;
137
+ agentDefinition: string;
138
+ chatProfile: string;
139
+ };
70
140
  invocationId: string | null;
141
+ requirement: "required" | "optional";
142
+ parentInvocationId: string | null;
143
+ depth: number;
144
+ requestedAt: string;
145
+ updatedAt: string;
146
+ failure: {
147
+ code: string;
148
+ message: string | null;
149
+ } | null;
71
150
  }[];
72
- updatedAt: string;
151
+ replayed: boolean;
73
152
  }>;
74
153
  };
75
154
  export declare function providerDiscussionResponseOperation(): import("../control-plane-operation.js").ControlPlaneOperationBinding<{
76
155
  assignmentId: string;
77
156
  }, {}, {
78
- markdown: string;
79
157
  leaseToken: string;
80
158
  runnerId: string;
81
159
  summary?: string | undefined;
82
160
  usage?: Record<string, unknown> | undefined;
161
+ markdown?: string | undefined;
162
+ outcome?: "responded" | "abstained" | undefined;
83
163
  }, {
84
- status: "responded";
164
+ status: "responded" | "abstained";
85
165
  schemaVersion: "treeseed.provider-discussion-response-receipt/v1";
86
166
  assignmentId: string;
87
167
  invocationId: string;
@@ -10,7 +10,7 @@ const empty = z.object({}).strict();
10
10
  const none = z.undefined();
11
11
  function communicationOperations() {
12
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" }, {
13
+ send: defineOperation({ operationId: "communications.send", description: "Post a team discussion-topic message and admit its addressed project agents to the communication lane.", rest: { method: "POST", path: "/v1/teams/{teamId}/discussion-topics/{channel}/messages" }, parameters: "treeseed.communications.send.parameters/v2", capability: "agents.execute", authentication: "oauth", oauthScopes: ["treeseed:execution"], kind: "mutation", riskClass: "ordinary", confirmation: "never", surfaces: ["rest", "cli", "mcp_tool"], cacheScope: "none", pagination: "none" }, {
14
14
  path: z.object({ teamId: z.string().min(1), channel: z.string().trim().min(1).max(120) }).strict(),
15
15
  query: empty,
16
16
  body: communicationSendRequestSchema,
@@ -0,0 +1,8 @@
1
+ export type CommunicationAddressRequirement = 'required' | 'optional';
2
+ export interface CommunicationAddress {
3
+ projectSlug: string | null;
4
+ agentSlug: string;
5
+ requirement: CommunicationAddressRequirement;
6
+ address: string;
7
+ }
8
+ export declare function parseCommunicationAddresses(markdown: string): CommunicationAddress[];
@@ -0,0 +1,57 @@
1
+ const ADDRESS = /(^|[^\p{L}\p{N}._%+-])@([a-z0-9][a-z0-9-]*)(?:\/([a-z0-9][a-z0-9-]*))?/giu;
2
+ function visibleMarkdown(markdown) {
3
+ const lines = markdown.replace(/\r\n?/gu, "\n").split("\n");
4
+ let fenced = false;
5
+ return lines.map((line) => {
6
+ if (/^\s*```/u.test(line)) {
7
+ fenced = !fenced;
8
+ return "";
9
+ }
10
+ if (fenced || /^\s*>/u.test(line)) return "";
11
+ return line.replace(/`[^`]*`/gu, "").replace(/!?\[[^\]]*\]\([^)]*\)/gu, "").replace(/\b[\w.+-]+@[\w.-]+\.[a-z]{2,}\b/giu, "");
12
+ }).join("\n");
13
+ }
14
+ function initialAddressLines(markdown) {
15
+ const lines = visibleMarkdown(markdown).split("\n");
16
+ let started = false;
17
+ const requiredThrough = /* @__PURE__ */ new Map();
18
+ for (let index = 0; index < lines.length; index += 1) {
19
+ const source = lines[index];
20
+ const line = source.trim();
21
+ if (!line && !started) continue;
22
+ if (!line) break;
23
+ started = true;
24
+ const leading = source.match(/^\s*(?:@[a-z0-9][a-z0-9-]*(?:\/[a-z0-9][a-z0-9-]*)?[\s,;:—–-]*)+/iu);
25
+ if (!leading) break;
26
+ requiredThrough.set(index, leading[0].length);
27
+ if (source.slice(leading[0].length).trim()) break;
28
+ }
29
+ return { markdown: visibleMarkdown(markdown), requiredThrough };
30
+ }
31
+ function parseCommunicationAddresses(markdown) {
32
+ const visible = initialAddressLines(markdown);
33
+ const addresses = /* @__PURE__ */ new Map();
34
+ for (const [lineIndex, line] of visible.markdown.split("\n").entries()) {
35
+ ADDRESS.lastIndex = 0;
36
+ for (const match of line.matchAll(ADDRESS)) {
37
+ const first = match[2].toLowerCase();
38
+ const second = match[3]?.toLowerCase() ?? null;
39
+ const projectSlug = second ? first : null;
40
+ const agentSlug = second ?? first;
41
+ const key = `${projectSlug ?? ""}/${agentSlug}`;
42
+ const addressIndex = (match.index ?? 0) + match[1].length;
43
+ const requirement = addressIndex < (visible.requiredThrough.get(lineIndex) ?? 0) ? "required" : "optional";
44
+ const existing = addresses.get(key);
45
+ if (!existing || requirement === "required") addresses.set(key, {
46
+ projectSlug,
47
+ agentSlug,
48
+ requirement,
49
+ address: `@${projectSlug ? `${projectSlug}/` : ""}${agentSlug}`
50
+ });
51
+ }
52
+ }
53
+ return [...addresses.values()];
54
+ }
55
+ export {
56
+ parseCommunicationAddresses
57
+ };