@treeseed/sdk 0.13.0-rc.16 → 0.13.0-rc.17
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/content/validation/agent-operational-content-schemas.d.ts +6 -6
- package/dist/content/validation/content-model-schemas.d.ts +13 -13
- package/dist/content/validation/portable-content-data.d.ts +3 -3
- package/dist/operator-contracts/mcp.d.ts +4 -0
- package/dist/operator-contracts/mcp.js +54 -0
- package/package.json +1 -1
|
@@ -141,7 +141,7 @@ export declare const agentInstructionTemplateContentSchema: z.ZodObject<{
|
|
|
141
141
|
appliesToProfiles: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
142
142
|
}, "strict", z.ZodTypeAny, {
|
|
143
143
|
id: string;
|
|
144
|
-
kind: "message" | "summary" | "
|
|
144
|
+
kind: "message" | "summary" | "status" | "plan";
|
|
145
145
|
description: string;
|
|
146
146
|
title: string;
|
|
147
147
|
revision: number;
|
|
@@ -151,7 +151,7 @@ export declare const agentInstructionTemplateContentSchema: z.ZodObject<{
|
|
|
151
151
|
outputSkeleton?: string | undefined;
|
|
152
152
|
}, {
|
|
153
153
|
id: string;
|
|
154
|
-
kind: "message" | "summary" | "
|
|
154
|
+
kind: "message" | "summary" | "status" | "plan";
|
|
155
155
|
description: string;
|
|
156
156
|
title: string;
|
|
157
157
|
revision: number;
|
|
@@ -470,8 +470,8 @@ export declare const assignmentSummaryContentSchema: z.ZodObject<{
|
|
|
470
470
|
}, "strict", z.ZodTypeAny, {
|
|
471
471
|
id: string;
|
|
472
472
|
summary: string;
|
|
473
|
-
blockers: string[];
|
|
474
473
|
status: "completed" | "cancelled" | "failed" | "suspended";
|
|
474
|
+
blockers: string[];
|
|
475
475
|
projectId: string;
|
|
476
476
|
teamId: string;
|
|
477
477
|
title: string;
|
|
@@ -811,7 +811,7 @@ export declare const agentOperationalContentSchemas: {
|
|
|
811
811
|
appliesToProfiles: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
812
812
|
}, "strict", z.ZodTypeAny, {
|
|
813
813
|
id: string;
|
|
814
|
-
kind: "message" | "summary" | "
|
|
814
|
+
kind: "message" | "summary" | "status" | "plan";
|
|
815
815
|
description: string;
|
|
816
816
|
title: string;
|
|
817
817
|
revision: number;
|
|
@@ -821,7 +821,7 @@ export declare const agentOperationalContentSchemas: {
|
|
|
821
821
|
outputSkeleton?: string | undefined;
|
|
822
822
|
}, {
|
|
823
823
|
id: string;
|
|
824
|
-
kind: "message" | "summary" | "
|
|
824
|
+
kind: "message" | "summary" | "status" | "plan";
|
|
825
825
|
description: string;
|
|
826
826
|
title: string;
|
|
827
827
|
revision: number;
|
|
@@ -1140,8 +1140,8 @@ export declare const agentOperationalContentSchemas: {
|
|
|
1140
1140
|
}, "strict", z.ZodTypeAny, {
|
|
1141
1141
|
id: string;
|
|
1142
1142
|
summary: string;
|
|
1143
|
-
blockers: string[];
|
|
1144
1143
|
status: "completed" | "cancelled" | "failed" | "suspended";
|
|
1144
|
+
blockers: string[];
|
|
1145
1145
|
projectId: string;
|
|
1146
1146
|
teamId: string;
|
|
1147
1147
|
title: string;
|
|
@@ -144,7 +144,7 @@ declare const schemas: {
|
|
|
144
144
|
appliesToProfiles: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
145
145
|
}, "strict", z.ZodTypeAny, {
|
|
146
146
|
id: string;
|
|
147
|
-
kind: "message" | "summary" | "
|
|
147
|
+
kind: "message" | "summary" | "status" | "plan";
|
|
148
148
|
description: string;
|
|
149
149
|
title: string;
|
|
150
150
|
revision: number;
|
|
@@ -154,7 +154,7 @@ declare const schemas: {
|
|
|
154
154
|
outputSkeleton?: string | undefined;
|
|
155
155
|
}, {
|
|
156
156
|
id: string;
|
|
157
|
-
kind: "message" | "summary" | "
|
|
157
|
+
kind: "message" | "summary" | "status" | "plan";
|
|
158
158
|
description: string;
|
|
159
159
|
title: string;
|
|
160
160
|
revision: number;
|
|
@@ -473,8 +473,8 @@ declare const schemas: {
|
|
|
473
473
|
}, "strict", z.ZodTypeAny, {
|
|
474
474
|
id: string;
|
|
475
475
|
summary: string;
|
|
476
|
-
blockers: string[];
|
|
477
476
|
status: "completed" | "cancelled" | "failed" | "suspended";
|
|
477
|
+
blockers: string[];
|
|
478
478
|
projectId: string;
|
|
479
479
|
teamId: string;
|
|
480
480
|
title: string;
|
|
@@ -9799,8 +9799,8 @@ declare const schemas: {
|
|
|
9799
9799
|
description: string;
|
|
9800
9800
|
slug: string;
|
|
9801
9801
|
contract: "treeseed.group/v1";
|
|
9802
|
-
aliases?: string[] | undefined;
|
|
9803
9802
|
status?: "active" | "archived" | undefined;
|
|
9803
|
+
aliases?: string[] | undefined;
|
|
9804
9804
|
}, {
|
|
9805
9805
|
id: string;
|
|
9806
9806
|
classification: string;
|
|
@@ -9808,8 +9808,8 @@ declare const schemas: {
|
|
|
9808
9808
|
description: string;
|
|
9809
9809
|
slug: string;
|
|
9810
9810
|
contract: "treeseed.group/v1";
|
|
9811
|
-
aliases?: string[] | undefined;
|
|
9812
9811
|
status?: "active" | "archived" | undefined;
|
|
9812
|
+
aliases?: string[] | undefined;
|
|
9813
9813
|
}>;
|
|
9814
9814
|
group_edge: z.ZodObject<{
|
|
9815
9815
|
contract: z.ZodLiteral<"treeseed.group-edge/v1">;
|
|
@@ -11561,7 +11561,7 @@ export declare function validateContentFrontmatter(model: PortableContentModel,
|
|
|
11561
11561
|
mergePolicy: "replace" | "append";
|
|
11562
11562
|
} | {
|
|
11563
11563
|
id: string;
|
|
11564
|
-
kind: "message" | "summary" | "
|
|
11564
|
+
kind: "message" | "summary" | "status" | "plan";
|
|
11565
11565
|
description: string;
|
|
11566
11566
|
title: string;
|
|
11567
11567
|
revision: number;
|
|
@@ -11634,8 +11634,8 @@ export declare function validateContentFrontmatter(model: PortableContentModel,
|
|
|
11634
11634
|
} | {
|
|
11635
11635
|
id: string;
|
|
11636
11636
|
summary: string;
|
|
11637
|
-
blockers: string[];
|
|
11638
11637
|
status: "completed" | "cancelled" | "failed" | "suspended";
|
|
11638
|
+
blockers: string[];
|
|
11639
11639
|
projectId: string;
|
|
11640
11640
|
teamId: string;
|
|
11641
11641
|
title: string;
|
|
@@ -11896,8 +11896,8 @@ export declare function validateContentFrontmatter(model: PortableContentModel,
|
|
|
11896
11896
|
description: string;
|
|
11897
11897
|
slug: string;
|
|
11898
11898
|
contract: "treeseed.group/v1";
|
|
11899
|
-
aliases?: string[] | undefined;
|
|
11900
11899
|
status?: "active" | "archived" | undefined;
|
|
11900
|
+
aliases?: string[] | undefined;
|
|
11901
11901
|
} | {
|
|
11902
11902
|
id: string;
|
|
11903
11903
|
contract: "treeseed.group-edge/v1";
|
|
@@ -20516,7 +20516,7 @@ export declare function describeContentFrontmatterSchema(model: PortableContentM
|
|
|
20516
20516
|
appliesToProfiles: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
20517
20517
|
}, "strict", z.ZodTypeAny, {
|
|
20518
20518
|
id: string;
|
|
20519
|
-
kind: "message" | "summary" | "
|
|
20519
|
+
kind: "message" | "summary" | "status" | "plan";
|
|
20520
20520
|
description: string;
|
|
20521
20521
|
title: string;
|
|
20522
20522
|
revision: number;
|
|
@@ -20526,7 +20526,7 @@ export declare function describeContentFrontmatterSchema(model: PortableContentM
|
|
|
20526
20526
|
outputSkeleton?: string | undefined;
|
|
20527
20527
|
}, {
|
|
20528
20528
|
id: string;
|
|
20529
|
-
kind: "message" | "summary" | "
|
|
20529
|
+
kind: "message" | "summary" | "status" | "plan";
|
|
20530
20530
|
description: string;
|
|
20531
20531
|
title: string;
|
|
20532
20532
|
revision: number;
|
|
@@ -20841,8 +20841,8 @@ export declare function describeContentFrontmatterSchema(model: PortableContentM
|
|
|
20841
20841
|
}, "strict", z.ZodTypeAny, {
|
|
20842
20842
|
id: string;
|
|
20843
20843
|
summary: string;
|
|
20844
|
-
blockers: string[];
|
|
20845
20844
|
status: "completed" | "cancelled" | "failed" | "suspended";
|
|
20845
|
+
blockers: string[];
|
|
20846
20846
|
projectId: string;
|
|
20847
20847
|
teamId: string;
|
|
20848
20848
|
title: string;
|
|
@@ -21686,8 +21686,8 @@ export declare function describeContentFrontmatterSchema(model: PortableContentM
|
|
|
21686
21686
|
description: string;
|
|
21687
21687
|
slug: string;
|
|
21688
21688
|
contract: "treeseed.group/v1";
|
|
21689
|
-
aliases?: string[] | undefined;
|
|
21690
21689
|
status?: "active" | "archived" | undefined;
|
|
21690
|
+
aliases?: string[] | undefined;
|
|
21691
21691
|
}, {
|
|
21692
21692
|
id: string;
|
|
21693
21693
|
classification: string;
|
|
@@ -21695,8 +21695,8 @@ export declare function describeContentFrontmatterSchema(model: PortableContentM
|
|
|
21695
21695
|
description: string;
|
|
21696
21696
|
slug: string;
|
|
21697
21697
|
contract: "treeseed.group/v1";
|
|
21698
|
-
aliases?: string[] | undefined;
|
|
21699
21698
|
status?: "active" | "archived" | undefined;
|
|
21699
|
+
aliases?: string[] | undefined;
|
|
21700
21700
|
}> | z.ZodObject<{
|
|
21701
21701
|
contract: z.ZodLiteral<"treeseed.group-edge/v1">;
|
|
21702
21702
|
id: z.ZodString;
|
|
@@ -1743,7 +1743,7 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1743
1743
|
mergePolicy: "replace" | "append";
|
|
1744
1744
|
} | {
|
|
1745
1745
|
id: string;
|
|
1746
|
-
kind: "message" | "summary" | "
|
|
1746
|
+
kind: "message" | "summary" | "status" | "plan";
|
|
1747
1747
|
description: string;
|
|
1748
1748
|
title: string;
|
|
1749
1749
|
revision: number;
|
|
@@ -1816,8 +1816,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
1816
1816
|
} | {
|
|
1817
1817
|
id: string;
|
|
1818
1818
|
summary: string;
|
|
1819
|
-
blockers: string[];
|
|
1820
1819
|
status: "completed" | "cancelled" | "failed" | "suspended";
|
|
1820
|
+
blockers: string[];
|
|
1821
1821
|
projectId: string;
|
|
1822
1822
|
teamId: string;
|
|
1823
1823
|
title: string;
|
|
@@ -2078,8 +2078,8 @@ export declare function validatePortableContentData(model: string, value: unknow
|
|
|
2078
2078
|
description: string;
|
|
2079
2079
|
slug: string;
|
|
2080
2080
|
contract: "treeseed.group/v1";
|
|
2081
|
-
aliases?: string[] | undefined;
|
|
2082
2081
|
status?: "active" | "archived" | undefined;
|
|
2082
|
+
aliases?: string[] | undefined;
|
|
2083
2083
|
} | {
|
|
2084
2084
|
id: string;
|
|
2085
2085
|
contract: "treeseed.group-edge/v1";
|
|
@@ -74,5 +74,9 @@ export interface McpCatalog {
|
|
|
74
74
|
resourceSubscriptions: true;
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
+
export declare const TREESEED_MCP_PROMPTS: readonly McpPromptDescriptor[];
|
|
78
|
+
export declare function operationToMcpResource(operation: ControlPlaneOperationDescriptor): McpResourceDescriptor | null;
|
|
77
79
|
export declare function operationToMcpTool(operation: ControlPlaneOperationDescriptor): McpToolDescriptor | null;
|
|
78
80
|
export declare function buildMcpTools(operations: readonly ControlPlaneOperationDescriptor[]): McpToolDescriptor[];
|
|
81
|
+
export declare function buildMcpResources(operations: readonly ControlPlaneOperationDescriptor[]): McpResourceDescriptor[];
|
|
82
|
+
export declare function buildMcpCatalog(operations: readonly ControlPlaneOperationDescriptor[]): McpCatalog;
|
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
const MCP_PROTOCOL_VERSION = "2026-07-28";
|
|
2
|
+
const TREESEED_MCP_PROMPTS = [
|
|
3
|
+
{ name: "operate", description: "Operate TreeSeed through currently discoverable capabilities.", argumentSchemaId: "treeseed.prompt.objective/v1", requiredScopes: ["treeseed:read"] },
|
|
4
|
+
{ name: "research", description: "Research a governed TreeSeed question and accumulate knowledge.", argumentSchemaId: "treeseed.prompt.objective/v1", requiredScopes: ["treeseed:read"] },
|
|
5
|
+
{ name: "governance-review", description: "Review a proposal or decision using current governance evidence.", argumentSchemaId: "treeseed.prompt.objective/v1", requiredScopes: ["treeseed:read"] },
|
|
6
|
+
{ name: "workday-planning", description: "Plan a time-based workday without bypassing API authority.", argumentSchemaId: "treeseed.prompt.objective/v1", requiredScopes: ["treeseed:read"] },
|
|
7
|
+
{ name: "project-agent-chat", description: "Prepare an explicit governed project-agent chat invocation.", argumentSchemaId: "treeseed.prompt.objective/v1", requiredScopes: ["treeseed:read"] }
|
|
8
|
+
];
|
|
9
|
+
function resourcePath(restPath) {
|
|
10
|
+
const [root, version, ...segments] = restPath.split("/");
|
|
11
|
+
if (root !== "" || version !== "v1" || segments.length === 0) throw new Error(`MCP resource requires a versioned control-plane REST path: ${restPath}`);
|
|
12
|
+
const path = segments.join("/");
|
|
13
|
+
if (path === "me") return "accounts/current";
|
|
14
|
+
return path.replace(/^platform\/operations(?=\/|$)/u, "operations").replace(/^capacity-plans(?=\/|$)/u, "plans").replace(/\/workday-runs(?=\/|$)/u, "/workdays").replace(/\/capacity\/assignments(?=\/|$)/u, "/assignments");
|
|
15
|
+
}
|
|
16
|
+
function operationToMcpResource(operation) {
|
|
17
|
+
if (!operation.surfaces.includes("mcp_resource")) return null;
|
|
18
|
+
if (operation.kind !== "read" || operation.rest.method !== "GET") {
|
|
19
|
+
throw new Error(`MCP resource operation ${operation.operationId} must be a read-only GET operation.`);
|
|
20
|
+
}
|
|
21
|
+
const uriTemplate = `treeseed://${resourcePath(operation.rest.path)}`;
|
|
22
|
+
const parameters = (value) => [...value.matchAll(/\{([^}]+)\}/gu)].map((match) => match[1]).sort();
|
|
23
|
+
if (JSON.stringify(parameters(uriTemplate)) !== JSON.stringify(parameters(operation.rest.path))) {
|
|
24
|
+
throw new Error(`MCP resource ${operation.operationId} must preserve its REST path parameter names.`);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
uriTemplate,
|
|
28
|
+
name: operation.operationId,
|
|
29
|
+
description: operation.description,
|
|
30
|
+
mimeType: "application/json",
|
|
31
|
+
operationId: operation.operationId,
|
|
32
|
+
subscribable: true,
|
|
33
|
+
...operation.operationId === "status.show" ? { cacheTtlSeconds: 10 } : {}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
2
36
|
function operationToMcpTool(operation) {
|
|
3
37
|
if (!operation.surfaces.includes("mcp_tool")) return null;
|
|
4
38
|
return {
|
|
@@ -16,8 +50,28 @@ function operationToMcpTool(operation) {
|
|
|
16
50
|
function buildMcpTools(operations) {
|
|
17
51
|
return operations.map(operationToMcpTool).filter((tool) => tool !== null).sort((left, right) => left.name.localeCompare(right.name));
|
|
18
52
|
}
|
|
53
|
+
function buildMcpResources(operations) {
|
|
54
|
+
const resources = operations.map(operationToMcpResource).filter((resource) => resource !== null).sort((left, right) => left.uriTemplate.localeCompare(right.uriTemplate));
|
|
55
|
+
const uriTemplates = new Set(resources.map(({ uriTemplate }) => uriTemplate));
|
|
56
|
+
if (uriTemplates.size !== resources.length) throw new Error("MCP resource URI templates must be unique.");
|
|
57
|
+
return resources;
|
|
58
|
+
}
|
|
59
|
+
function buildMcpCatalog(operations) {
|
|
60
|
+
return {
|
|
61
|
+
schemaVersion: "treeseed.mcp-catalog/v1",
|
|
62
|
+
protocolVersion: MCP_PROTOCOL_VERSION,
|
|
63
|
+
tools: buildMcpTools(operations),
|
|
64
|
+
resources: buildMcpResources(operations),
|
|
65
|
+
prompts: [...TREESEED_MCP_PROMPTS],
|
|
66
|
+
capabilities: { completion: true, progress: true, cancellation: true, inputRequired: true, resourceSubscriptions: true }
|
|
67
|
+
};
|
|
68
|
+
}
|
|
19
69
|
export {
|
|
20
70
|
MCP_PROTOCOL_VERSION,
|
|
71
|
+
TREESEED_MCP_PROMPTS,
|
|
72
|
+
buildMcpCatalog,
|
|
73
|
+
buildMcpResources,
|
|
21
74
|
buildMcpTools,
|
|
75
|
+
operationToMcpResource,
|
|
22
76
|
operationToMcpTool
|
|
23
77
|
};
|