Repository navigation
Expand file tree
/
Copy pathschema.ts
More file actions
118 lines (99 loc) · 3.01 KB
/
Copy pathschema.ts
File metadata and controls
118 lines (99 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/**
* Skills extension wire types for specification/beta/skills.mdx.
* The released specification remains normative.
* Keep these declarations in sync with its TypeScript blocks (npm run check:schema).
*/
import type {
MetaObject,
JSONRPCRequest,
JSONRPCResultResponse,
RequestParams,
PaginatedRequest,
PaginatedRequestParams,
PaginatedResult,
CacheableResult,
Resource,
} from "./spec.types.js";
/**
* A file belonging to a skill, with the digest and size of its content.
*/
export interface SkillResource {
/** Resource URI of the file. */
uri: string;
/**
* SHA-256 digest of the file's raw bytes, formatted as `sha256:{hex}`
* where {hex} is 64 lowercase hexadecimal characters.
*/
digest: string;
/**
* Length in bytes of the file's raw content (the same bytes that `digest` covers).
*/
size: number;
}
/**
* The entry for a single skill.
*/
export interface Skill {
/** Resource URI of the skill's SKILL.md, readable via resources/read. */
uri: string;
/**
* The skill's SKILL.md YAML frontmatter, rendered verbatim as a JSON object.
* `name` and `description` are always present; every other field the author
* wrote passes through unchanged.
*/
frontmatter: {
name: string;
description: string;
[key: string]: unknown;
};
/**
* The skill's files: a complete enumeration of SKILL.md and every supporting
* file, or the string "dynamic" when the skill's content is generated such
* that stable digests cannot be published.
*/
resources: SkillResource[] | "dynamic";
/**
* See the base protocol's notes on `_meta` usage. Keys defined by this
* extension use the `io.modelcontextprotocol.skills/` prefix.
*/
_meta?: MetaObject;
}
export interface ListSkillsRequest extends PaginatedRequest {
method: "skills/list";
}
export interface ListSkillsResult extends PaginatedResult, CacheableResult {
skills: Skill[];
}
export interface ListSkillsResultResponse extends JSONRPCResultResponse {
result: ListSkillsResult;
}
export interface GetSkillRequestParams extends RequestParams {
/** URI of the skill's SKILL.md. */
uri: string;
}
export interface GetSkillRequest extends JSONRPCRequest {
method: "skills/get";
params: GetSkillRequestParams;
}
export interface GetSkillResult extends CacheableResult {
skill: Skill;
}
export interface GetSkillResultResponse extends JSONRPCResultResponse {
result: GetSkillResult;
}
export interface ReadResourceDirectoryRequestParams extends PaginatedRequestParams {
/** URI of the directory resource to read. */
uri: string;
}
export interface ReadResourceDirectoryRequest extends PaginatedRequest {
method: "resources/directory/read";
params: ReadResourceDirectoryRequestParams;
}
export interface ReadResourceDirectoryResult
extends PaginatedResult, CacheableResult {
/** Resource metadata of the directory's direct children. */
resources: Resource[];
}
export interface ReadResourceDirectoryResultResponse extends JSONRPCResultResponse {
result: ReadResourceDirectoryResult;
}