@alpacakit/channels 0.1.0-beta.19
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/LICENSE +21 -0
- package/README.md +772 -0
- package/dist/binding-compiler.d.ts +29 -0
- package/dist/binding-compiler.d.ts.map +1 -0
- package/dist/binding-compiler.js +40 -0
- package/dist/cli-coercion.d.ts +5 -0
- package/dist/cli-coercion.d.ts.map +1 -0
- package/dist/cli-coercion.js +51 -0
- package/dist/cli-compiler.d.ts +46 -0
- package/dist/cli-compiler.d.ts.map +1 -0
- package/dist/cli-compiler.js +213 -0
- package/dist/cli-executor.d.ts +25 -0
- package/dist/cli-executor.d.ts.map +1 -0
- package/dist/cli-executor.js +44 -0
- package/dist/cli-help-projection.d.ts +13 -0
- package/dist/cli-help-projection.d.ts.map +1 -0
- package/dist/cli-help-projection.js +159 -0
- package/dist/cli-model.d.ts +240 -0
- package/dist/cli-model.d.ts.map +1 -0
- package/dist/cli-model.js +89 -0
- package/dist/cli-presentation.d.ts +23 -0
- package/dist/cli-presentation.d.ts.map +1 -0
- package/dist/cli-presentation.js +265 -0
- package/dist/cli-schema.d.ts +4 -0
- package/dist/cli-schema.d.ts.map +1 -0
- package/dist/cli-schema.js +7 -0
- package/dist/cli-tree.d.ts +4 -0
- package/dist/cli-tree.d.ts.map +1 -0
- package/dist/cli-tree.js +421 -0
- package/dist/cli-values.d.ts +24 -0
- package/dist/cli-values.d.ts.map +1 -0
- package/dist/cli-values.js +40 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +5 -0
- package/dist/codecs.d.ts +25 -0
- package/dist/codecs.d.ts.map +1 -0
- package/dist/codecs.js +74 -0
- package/dist/contract.d.ts +12 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +28 -0
- package/dist/factory.d.ts +16 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +188 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/internal.d.ts +3 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +3 -0
- package/dist/introspection.d.ts +40 -0
- package/dist/introspection.d.ts.map +1 -0
- package/dist/introspection.js +56 -0
- package/dist/mcp.d.ts +26 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +84 -0
- package/dist/model.d.ts +166 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +22 -0
- package/dist/runtime.d.ts +47 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +140 -0
- package/dist/schema.d.ts +14 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +70 -0
- package/dist/tree-internal.d.ts +14 -0
- package/dist/tree-internal.d.ts.map +1 -0
- package/dist/tree-internal.js +20 -0
- package/dist/values.d.ts +32 -0
- package/dist/values.d.ts.map +1 -0
- package/dist/values.js +30 -0
- package/package.json +47 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EACV,sBAAsB,EAEtB,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAW3C,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,mBAAmB,CAExE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,yBAAyB,CAAC;IACnD,QAAQ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ISSUE = {
|
|
3
|
+
conflictingDocumentation: "conflicting node documentation",
|
|
4
|
+
};
|
|
5
|
+
const EMPTY_COMMAND_DOCUMENTATION = {
|
|
6
|
+
remarks: [],
|
|
7
|
+
relatedDocs: [],
|
|
8
|
+
};
|
|
9
|
+
export function defineEntryTree(root) {
|
|
10
|
+
return { root };
|
|
11
|
+
}
|
|
12
|
+
export function defineEntryNode(input) {
|
|
13
|
+
return {
|
|
14
|
+
name: input.name,
|
|
15
|
+
description: input.description,
|
|
16
|
+
documentation: normalizeCommandDocumentation(input.documentation),
|
|
17
|
+
segments: input.segments ?? [],
|
|
18
|
+
endpoints: input.endpoints ?? [],
|
|
19
|
+
children: input.children ?? [],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function mergeEntryTreeNodes(nodes) {
|
|
23
|
+
const rootFrames = groupNodes(nodes).map((group) => createMergeFrame(group, ""));
|
|
24
|
+
const pending = rootFrames
|
|
25
|
+
.map((frame) => ({ frame, expanded: false }))
|
|
26
|
+
.reverse();
|
|
27
|
+
const merged = new Map();
|
|
28
|
+
while (pending.length > 0) {
|
|
29
|
+
const item = pending.pop();
|
|
30
|
+
if (!item) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (!item.expanded) {
|
|
34
|
+
const first = firstNode(item.frame);
|
|
35
|
+
const issues = item.frame.nodes
|
|
36
|
+
.slice(1)
|
|
37
|
+
.filter((node) => node.description !== first.description)
|
|
38
|
+
.map(() => `${item.frame.path}: conflicting node descriptions`);
|
|
39
|
+
item.frame.documentation = mergeCommandDocumentation(item.frame.nodes, item.frame.path, issues);
|
|
40
|
+
item.frame.segments = mergeSegments(item.frame.nodes, item.frame.path, issues);
|
|
41
|
+
if (issues.length > 0) {
|
|
42
|
+
throw new EntryTreeDefinitionError(issues);
|
|
43
|
+
}
|
|
44
|
+
item.frame.children = groupNodes(item.frame.nodes.flatMap((node) => node.children)).map((group) => createMergeFrame(group, item.frame.path));
|
|
45
|
+
pending.push({ frame: item.frame, expanded: true });
|
|
46
|
+
for (const child of [...item.frame.children].reverse()) {
|
|
47
|
+
pending.push({ frame: child, expanded: false });
|
|
48
|
+
}
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const first = firstNode(item.frame);
|
|
52
|
+
const segments = item.frame.segments;
|
|
53
|
+
const documentation = item.frame.documentation;
|
|
54
|
+
if (!segments || !documentation) {
|
|
55
|
+
throw new EntryTreeDefinitionError([
|
|
56
|
+
`${item.frame.path}: node was not prepared for merging`,
|
|
57
|
+
]);
|
|
58
|
+
}
|
|
59
|
+
merged.set(item.frame, defineEntryNode({
|
|
60
|
+
name: first.name,
|
|
61
|
+
description: first.description,
|
|
62
|
+
documentation,
|
|
63
|
+
segments,
|
|
64
|
+
endpoints: [
|
|
65
|
+
...new Set(item.frame.nodes.flatMap((node) => node.endpoints)),
|
|
66
|
+
],
|
|
67
|
+
children: item.frame.children.map((child) => {
|
|
68
|
+
const node = merged.get(child);
|
|
69
|
+
if (!node) {
|
|
70
|
+
throw new EntryTreeDefinitionError([
|
|
71
|
+
`${child.path}: child node was not merged`,
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
return node;
|
|
75
|
+
}),
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
return rootFrames.map((frame) => {
|
|
79
|
+
const node = merged.get(frame);
|
|
80
|
+
if (!node) {
|
|
81
|
+
throw new EntryTreeDefinitionError([
|
|
82
|
+
`${frame.path}: node was not merged`,
|
|
83
|
+
]);
|
|
84
|
+
}
|
|
85
|
+
return node;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function createMergeFrame(nodes, parentPath) {
|
|
89
|
+
const first = nodes[0];
|
|
90
|
+
if (!first) {
|
|
91
|
+
throw new EntryTreeDefinitionError(["cannot merge an empty node group"]);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
nodes,
|
|
95
|
+
path: parentPath ? `${parentPath}/${first.name}` : first.name,
|
|
96
|
+
segments: null,
|
|
97
|
+
documentation: null,
|
|
98
|
+
children: [],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function normalizeCommandDocumentation(input) {
|
|
102
|
+
if (input === undefined) {
|
|
103
|
+
return EMPTY_COMMAND_DOCUMENTATION;
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
remarks: input.remarks ?? [],
|
|
107
|
+
relatedDocs: input.relatedDocs ?? [],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function mergeCommandDocumentation(nodes, path, issues) {
|
|
111
|
+
const claims = nodes
|
|
112
|
+
.map((node) => node.documentation)
|
|
113
|
+
.filter(hasCommandDocumentationClaim);
|
|
114
|
+
const first = claims[0] ?? EMPTY_COMMAND_DOCUMENTATION;
|
|
115
|
+
if (claims.slice(1).some((claim) => !sameCommandDocumentation(first, claim))) {
|
|
116
|
+
issues.push(`${path}: ${ENTRY_TREE_MERGE_ISSUE.conflictingDocumentation}`);
|
|
117
|
+
}
|
|
118
|
+
return first;
|
|
119
|
+
}
|
|
120
|
+
function hasCommandDocumentationClaim(documentation) {
|
|
121
|
+
return (documentation.remarks.length > 0 || documentation.relatedDocs.length > 0);
|
|
122
|
+
}
|
|
123
|
+
function sameCommandDocumentation(left, right) {
|
|
124
|
+
return (sameStringList(left.remarks, right.remarks) &&
|
|
125
|
+
sameStringList(left.relatedDocs, right.relatedDocs));
|
|
126
|
+
}
|
|
127
|
+
function sameStringList(left, right) {
|
|
128
|
+
return (left.length === right.length &&
|
|
129
|
+
left.every((value, index) => value === right[index]));
|
|
130
|
+
}
|
|
131
|
+
function sameChannelPayload(left, right) {
|
|
132
|
+
if (left === right) {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
if (Array.isArray(left) && Array.isArray(right)) {
|
|
136
|
+
return (left.length === right.length &&
|
|
137
|
+
left.every((value, index) => sameChannelPayload(value, right[index])));
|
|
138
|
+
}
|
|
139
|
+
if (typeof left !== "object" ||
|
|
140
|
+
left === null ||
|
|
141
|
+
typeof right !== "object" ||
|
|
142
|
+
right === null ||
|
|
143
|
+
Array.isArray(left) ||
|
|
144
|
+
Array.isArray(right)) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
const leftKeys = Object.keys(left);
|
|
148
|
+
const rightKeys = Object.keys(right);
|
|
149
|
+
return (leftKeys.length === rightKeys.length &&
|
|
150
|
+
leftKeys.every((key) => Object.hasOwn(right, key) &&
|
|
151
|
+
sameChannelPayload(Reflect.get(left, key), Reflect.get(right, key))));
|
|
152
|
+
}
|
|
153
|
+
function groupNodes(nodes) {
|
|
154
|
+
const grouped = new Map();
|
|
155
|
+
for (const node of nodes) {
|
|
156
|
+
const group = grouped.get(node.name);
|
|
157
|
+
if (group) {
|
|
158
|
+
group.push(node);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
grouped.set(node.name, [node]);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return [...grouped.values()];
|
|
165
|
+
}
|
|
166
|
+
function firstNode(frame) {
|
|
167
|
+
const first = frame.nodes[0];
|
|
168
|
+
if (!first) {
|
|
169
|
+
throw new EntryTreeDefinitionError(["cannot merge an empty node group"]);
|
|
170
|
+
}
|
|
171
|
+
return first;
|
|
172
|
+
}
|
|
173
|
+
function mergeSegments(nodes, path, issues) {
|
|
174
|
+
const byChannel = new Map();
|
|
175
|
+
for (const segment of nodes.flatMap((node) => node.segments)) {
|
|
176
|
+
const existing = byChannel.get(segment.channel);
|
|
177
|
+
if (existing !== undefined &&
|
|
178
|
+
!sameChannelPayload(existing.segment, segment.segment)) {
|
|
179
|
+
issues.push(`${path}: conflicting ${segment.channel} segment overrides`);
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
byChannel.set(segment.channel, segment);
|
|
183
|
+
}
|
|
184
|
+
return [...byChannel.values()];
|
|
185
|
+
}
|
|
186
|
+
export function defineEntryEndpoint(entry, ...channels) {
|
|
187
|
+
return { entry, channels };
|
|
188
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./codecs.js";
|
|
2
|
+
export * from "./contract.js";
|
|
3
|
+
export * from "./factory.js";
|
|
4
|
+
export * from "./introspection.js";
|
|
5
|
+
export * from "./model.js";
|
|
6
|
+
export { EntryInputError, type EntryInputTarget } from "./runtime.js";
|
|
7
|
+
export { EntryTreeDefinitionError } from "./schema.js";
|
|
8
|
+
export * from "./values.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./codecs.js";
|
|
2
|
+
export * from "./contract.js";
|
|
3
|
+
export * from "./factory.js";
|
|
4
|
+
export * from "./introspection.js";
|
|
5
|
+
export * from "./model.js";
|
|
6
|
+
export { EntryInputError } from "./runtime.js";
|
|
7
|
+
export { EntryTreeDefinitionError } from "./schema.js";
|
|
8
|
+
export * from "./values.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,wBAAgB,aAAa,CAAC,KAAK,CAAC,UAAU,SAAS,YAAY,EACjE,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,MAAM,GACX,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI,CAE3B"}
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { JsonValue } from "@alpacakit/core";
|
|
2
|
+
import type { CommandDocumentation, EntryTreeDefinition, ErasedEntryDefinition, ValueShape } from "./model.js";
|
|
3
|
+
import { ENTRY_OUTPUT_DESCRIPTION_KIND, type PARAMETER_REQUIREMENT_KIND } from "./values.js";
|
|
4
|
+
export type CommandPath = readonly string[];
|
|
5
|
+
export type ParameterRequirementDescription = {
|
|
6
|
+
readonly kind: typeof PARAMETER_REQUIREMENT_KIND.required;
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: typeof PARAMETER_REQUIREMENT_KIND.optional;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: typeof PARAMETER_REQUIREMENT_KIND.optionalWithDefault;
|
|
11
|
+
readonly defaultValue: JsonValue;
|
|
12
|
+
};
|
|
13
|
+
export type ParameterDescription = {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly requirement: ParameterRequirementDescription;
|
|
17
|
+
readonly shape: ValueShape;
|
|
18
|
+
};
|
|
19
|
+
export type EntryOutputDescription = {
|
|
20
|
+
readonly kind: typeof ENTRY_OUTPUT_DESCRIPTION_KIND.typed;
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: typeof ENTRY_OUTPUT_DESCRIPTION_KIND.none;
|
|
23
|
+
};
|
|
24
|
+
export type EntryDescription = {
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly parameters: readonly ParameterDescription[];
|
|
27
|
+
readonly output: EntryOutputDescription;
|
|
28
|
+
};
|
|
29
|
+
export type CommandDescription = {
|
|
30
|
+
readonly path: CommandPath;
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly description: string;
|
|
33
|
+
readonly documentation: CommandDocumentation;
|
|
34
|
+
readonly endpoints: readonly EntryDescription[];
|
|
35
|
+
readonly children: readonly CommandDescription[];
|
|
36
|
+
};
|
|
37
|
+
export declare function describeEntry(entry: ErasedEntryDefinition): EntryDescription;
|
|
38
|
+
export declare function describeEntryTree(tree: EntryTreeDefinition): CommandDescription;
|
|
39
|
+
export declare function describeParameterRequirement(requirement: ErasedEntryDefinition["parameters"][number]["requirement"]): ParameterRequirementDescription;
|
|
40
|
+
//# sourceMappingURL=introspection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"introspection.d.ts","sourceRoot":"","sources":["../src/introspection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EAEnB,qBAAqB,EACrB,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,6BAA6B,EAC7B,KAAK,0BAA0B,EAChC,MAAM,aAAa,CAAC;AAOrB,MAAM,MAAM,WAAW,GAAG,SAAS,MAAM,EAAE,CAAC;AAE5C,MAAM,MAAM,+BAA+B,GACvC;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,0BAA0B,CAAC,QAAQ,CAAA;CAAE,GAC7D;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,0BAA0B,CAAC,QAAQ,CAAC;CAC3D,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,0BAA0B,CAAC,mBAAmB,CAAC;IACrE,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC;CAClC,CAAC;AAEN,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,+BAA+B,CAAC;IACtD,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,6BAA6B,CAAC,KAAK,CAAA;CAAE,GAC7D;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,6BAA6B,CAAC,IAAI,CAAA;CAAE,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACrD,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC;IAC7C,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAClD,CAAC;AAOF,wBAAgB,aAAa,CAAC,KAAK,EAAE,qBAAqB,GAAG,gBAAgB,CAgB5E;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,mBAAmB,GACxB,kBAAkB,CAiCpB;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,GACtE,+BAA+B,CAEjC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { visitEntryTree } from "./schema.js";
|
|
2
|
+
import { ENTRY_OUTPUT_DESCRIPTION_KIND, } from "./values.js";
|
|
3
|
+
const ENTRY_INTROSPECTION_ERROR = {
|
|
4
|
+
missingChild: "Entry tree child could not be described",
|
|
5
|
+
missingRoot: "Entry tree root could not be described",
|
|
6
|
+
};
|
|
7
|
+
export function describeEntry(entry) {
|
|
8
|
+
return {
|
|
9
|
+
name: entry.name,
|
|
10
|
+
parameters: entry.parameters.map((parameter) => ({
|
|
11
|
+
name: parameter.name,
|
|
12
|
+
description: parameter.description,
|
|
13
|
+
requirement: describeParameterRequirement(parameter.requirement),
|
|
14
|
+
shape: parameter.codec.shape,
|
|
15
|
+
})),
|
|
16
|
+
output: {
|
|
17
|
+
kind: entry.output === null
|
|
18
|
+
? ENTRY_OUTPUT_DESCRIPTION_KIND.none
|
|
19
|
+
: ENTRY_OUTPUT_DESCRIPTION_KIND.typed,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function describeEntryTree(tree) {
|
|
24
|
+
const frames = new Map();
|
|
25
|
+
const entries = [];
|
|
26
|
+
visitEntryTree(tree, {
|
|
27
|
+
visitNode(node, path) {
|
|
28
|
+
entries.push({ node, path: path.slice(1) });
|
|
29
|
+
},
|
|
30
|
+
visitEndpoint() { },
|
|
31
|
+
});
|
|
32
|
+
for (const current of entries.reverse()) {
|
|
33
|
+
frames.set(current.node, {
|
|
34
|
+
path: current.path,
|
|
35
|
+
name: current.node.name,
|
|
36
|
+
description: current.node.description,
|
|
37
|
+
documentation: current.node.documentation,
|
|
38
|
+
endpoints: current.node.endpoints.map((endpoint) => describeEntry(endpoint.entry)),
|
|
39
|
+
children: current.node.children.map((child) => {
|
|
40
|
+
const description = frames.get(child);
|
|
41
|
+
if (description === undefined) {
|
|
42
|
+
throw new Error(ENTRY_INTROSPECTION_ERROR.missingChild);
|
|
43
|
+
}
|
|
44
|
+
return description;
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const root = frames.get(tree.root);
|
|
49
|
+
if (root === undefined) {
|
|
50
|
+
throw new Error(ENTRY_INTROSPECTION_ERROR.missingRoot);
|
|
51
|
+
}
|
|
52
|
+
return root;
|
|
53
|
+
}
|
|
54
|
+
export function describeParameterRequirement(requirement) {
|
|
55
|
+
return requirement;
|
|
56
|
+
}
|
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { JsonObject } from "@alpacakit/core";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import type { EntryChannelBinding, EntryDefinitionWithOutput, EntryTreeEndpoint, ParameterSet, RawValueMap } from "./model.js";
|
|
4
|
+
import { type EntryDecodeResult } from "./runtime.js";
|
|
5
|
+
import { CHANNEL, ENTRY_DECODE_RESULT_KIND } from "./values.js";
|
|
6
|
+
export type McpBinding<Parameters extends ParameterSet = ParameterSet> = readonly Parameters[number]["name"][];
|
|
7
|
+
export declare function bindMcpEntry<const ParameterNames extends readonly string[]>(...parameterNames: ParameterNames): EntryChannelBinding<typeof CHANNEL.mcp, ParameterNames[number]>;
|
|
8
|
+
export type McpEntryParseResult<Entry extends EntryTreeEndpoint["entry"]> = EntryDecodeResult<ReturnType<Entry["project"]>>;
|
|
9
|
+
export type McpResolvedEntry<Entry extends EntryTreeEndpoint["entry"]> = Extract<McpEntryParseResult<Entry>, {
|
|
10
|
+
readonly kind: typeof ENTRY_DECODE_RESULT_KIND.resolved;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* A compiled MCP endpoint. The binding is validated and compiled once by
|
|
14
|
+
* `createMcpEndpoint()`, so definition errors surface eagerly (like the CLI
|
|
15
|
+
* router) and `parse()` does no per-invocation recompilation.
|
|
16
|
+
*/
|
|
17
|
+
export interface McpEndpoint<Entry extends EntryTreeEndpoint["entry"]> {
|
|
18
|
+
/** Raw Zod object shape for MCP tool registration. */
|
|
19
|
+
readonly inputSchema: Record<string, z.ZodType>;
|
|
20
|
+
/** Decode and project one MCP invocation through the endpoint. */
|
|
21
|
+
parse(raw: RawValueMap): McpEntryParseResult<Entry>;
|
|
22
|
+
}
|
|
23
|
+
export declare function createMcpEndpoint<const Entry extends EntryTreeEndpoint["entry"]>(endpoint: EntryTreeEndpoint<Entry>): McpEndpoint<Entry>;
|
|
24
|
+
export declare function isMcpResolved<Entry extends EntryTreeEndpoint["entry"]>(result: McpEntryParseResult<Entry>): result is McpResolvedEntry<Entry>;
|
|
25
|
+
export declare function createMcpOutputSchema<const Name extends string, const Parameters extends ParameterSet, Projection, Output extends JsonObject>(endpoint: EntryTreeEndpoint<EntryDefinitionWithOutput<Name, Parameters, Projection, Output>>): z.ZodType<Output>;
|
|
26
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQ7B,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAQxE,OAAO,EACL,OAAO,EACP,wBAAwB,EAEzB,MAAM,aAAa,CAAC;AAOrB,MAAM,MAAM,UAAU,CAAC,UAAU,SAAS,YAAY,GAAG,YAAY,IACnE,SAAS,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;AAExC,wBAAgB,YAAY,CAAC,KAAK,CAAC,cAAc,SAAS,SAAS,MAAM,EAAE,EACzE,GAAG,cAAc,EAAE,cAAc,GAChC,mBAAmB,CAAC,OAAO,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAGjE;AAED,MAAM,MAAM,mBAAmB,CAAC,KAAK,SAAS,iBAAiB,CAAC,OAAO,CAAC,IACtE,iBAAiB,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAElD,MAAM,MAAM,gBAAgB,CAAC,KAAK,SAAS,iBAAiB,CAAC,OAAO,CAAC,IACnE,OAAO,CACL,mBAAmB,CAAC,KAAK,CAAC,EAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,wBAAwB,CAAC,QAAQ,CAAA;CAAE,CAC5D,CAAC;AAEJ;;;;GAIG;AACH,MAAM,WAAW,WAAW,CAAC,KAAK,SAAS,iBAAiB,CAAC,OAAO,CAAC;IACnE,sDAAsD;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IAChD,kEAAkE;IAClE,KAAK,CAAC,GAAG,EAAE,WAAW,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;CACrD;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,KAAK,SAAS,iBAAiB,CAAC,OAAO,CAAC,EAC9C,QAAQ,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAaxD;AAED,wBAAgB,aAAa,CAAC,KAAK,SAAS,iBAAiB,CAAC,OAAO,CAAC,EACpE,MAAM,EAAE,mBAAmB,CAAC,KAAK,CAAC,GACjC,MAAM,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAEnC;AAmED,wBAAgB,qBAAqB,CACnC,KAAK,CAAC,IAAI,SAAS,MAAM,EACzB,KAAK,CAAC,UAAU,SAAS,YAAY,EACrC,UAAU,EACV,MAAM,SAAS,UAAU,EAEzB,QAAQ,EAAE,iBAAiB,CACzB,yBAAyB,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAChE,GACA,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAWnB"}
|
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { compileParameterBindings, PARAMETER_BINDING_ISSUE_KIND, } from "./binding-compiler.js";
|
|
2
|
+
import { requireEntryOutput } from "./contract.js";
|
|
3
|
+
import { decodeEntryInput } from "./runtime.js";
|
|
4
|
+
import { EntryTreeDefinitionError, findChannelBinding } from "./schema.js";
|
|
5
|
+
import { createEntryChannelBinding, isChannelPayload, PAYLOAD_KIND, registerChannelPayload, } from "./tree-internal.js";
|
|
6
|
+
import { CHANNEL, ENTRY_DECODE_RESULT_KIND, PARAMETER_REQUIREMENT_KIND, } from "./values.js";
|
|
7
|
+
const ZOD_SCHEMA_TYPE = {
|
|
8
|
+
object: "object",
|
|
9
|
+
readonly: "readonly",
|
|
10
|
+
};
|
|
11
|
+
export function bindMcpEntry(...parameterNames) {
|
|
12
|
+
registerChannelPayload(PAYLOAD_KIND.mcpBinding, parameterNames);
|
|
13
|
+
return createEntryChannelBinding(CHANNEL.mcp, parameterNames);
|
|
14
|
+
}
|
|
15
|
+
export function createMcpEndpoint(endpoint) {
|
|
16
|
+
const bindings = resolveMcpBindings(endpoint);
|
|
17
|
+
const parameterNames = bindings.map((binding) => binding.parameter.name);
|
|
18
|
+
const inputSchema = buildMcpInputSchema(bindings);
|
|
19
|
+
return {
|
|
20
|
+
inputSchema,
|
|
21
|
+
parse: (raw) => decodeEntryInput({
|
|
22
|
+
entry: endpoint.entry,
|
|
23
|
+
parameterNames,
|
|
24
|
+
raw,
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function isMcpResolved(result) {
|
|
29
|
+
return result.kind === ENTRY_DECODE_RESULT_KIND.resolved;
|
|
30
|
+
}
|
|
31
|
+
function buildMcpInputSchema(bindings) {
|
|
32
|
+
const shape = {};
|
|
33
|
+
for (const binding of bindings) {
|
|
34
|
+
const { parameter } = binding;
|
|
35
|
+
const describedSchema = parameter.codec.schema.describe(parameter.description);
|
|
36
|
+
shape[parameter.name] =
|
|
37
|
+
parameter.requirement.kind !== PARAMETER_REQUIREMENT_KIND.required
|
|
38
|
+
? describedSchema.optional()
|
|
39
|
+
: describedSchema;
|
|
40
|
+
}
|
|
41
|
+
return shape;
|
|
42
|
+
}
|
|
43
|
+
function resolveMcpBindings(endpoint) {
|
|
44
|
+
const channelBindings = endpoint.channels.filter((candidate) => candidate.channel === CHANNEL.mcp);
|
|
45
|
+
const channelBinding = findChannelBinding(endpoint, CHANNEL.mcp);
|
|
46
|
+
if (channelBindings.length !== 1 ||
|
|
47
|
+
!channelBinding ||
|
|
48
|
+
!isMcpBinding(channelBinding.binding)) {
|
|
49
|
+
throw new EntryTreeDefinitionError([
|
|
50
|
+
`${endpoint.entry.name}: endpoint must have exactly one valid MCP binding`,
|
|
51
|
+
]);
|
|
52
|
+
}
|
|
53
|
+
const compilation = compileParameterBindings(endpoint.entry, channelBinding.binding.map((parameterName) => ({ parameterName })));
|
|
54
|
+
if (compilation.issues.length > 0) {
|
|
55
|
+
throw new EntryTreeDefinitionError(compilation.issues.map((issue) => formatMcpParameterBindingIssue(endpoint.entry.name, issue)));
|
|
56
|
+
}
|
|
57
|
+
return compilation.bindings;
|
|
58
|
+
}
|
|
59
|
+
function formatMcpParameterBindingIssue(entryName, issue) {
|
|
60
|
+
switch (issue.kind) {
|
|
61
|
+
case PARAMETER_BINDING_ISSUE_KIND.duplicate:
|
|
62
|
+
return `${entryName}: duplicate MCP binding for parameter ${issue.parameterName}`;
|
|
63
|
+
case PARAMETER_BINDING_ISSUE_KIND.nonexistent:
|
|
64
|
+
return `${entryName}: MCP binding names nonexistent parameter ${issue.parameterName}`;
|
|
65
|
+
case PARAMETER_BINDING_ISSUE_KIND.requiredUnreachable:
|
|
66
|
+
return `${entryName}: required parameter ${issue.parameterName} is unreachable from MCP`;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function isMcpBinding(value) {
|
|
70
|
+
return isChannelPayload(PAYLOAD_KIND.mcpBinding, value);
|
|
71
|
+
}
|
|
72
|
+
export function createMcpOutputSchema(endpoint) {
|
|
73
|
+
resolveMcpBindings(endpoint);
|
|
74
|
+
const schema = requireEntryOutput(endpoint.entry).schema;
|
|
75
|
+
const normalized = schema.type === ZOD_SCHEMA_TYPE.readonly ? unwrapZodSchema(schema) : schema;
|
|
76
|
+
if (normalized.type !== ZOD_SCHEMA_TYPE.object) {
|
|
77
|
+
throw new Error(`Entry ${endpoint.entry.name} output contract must use a Zod object schema`);
|
|
78
|
+
}
|
|
79
|
+
return normalized;
|
|
80
|
+
}
|
|
81
|
+
function unwrapZodSchema(schema) {
|
|
82
|
+
const wrapper = schema;
|
|
83
|
+
return wrapper.unwrap();
|
|
84
|
+
}
|
package/dist/model.d.ts
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { CodecDecodeResult, JsonValue, RuntimeCodec } from "@alpacakit/core";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import { type Channel, PARAMETER_REQUIREMENT_KIND, type VALUE_SHAPE_KIND } from "./values.js";
|
|
4
|
+
declare const EntryTreeDefinitionBrand: unique symbol;
|
|
5
|
+
declare const EntryTreeNodeBrand: unique symbol;
|
|
6
|
+
declare const EntryTreeEndpointBrand: unique symbol;
|
|
7
|
+
declare const ChannelSegmentOverrideBrand: unique symbol;
|
|
8
|
+
declare const EntryChannelBindingBrand: unique symbol;
|
|
9
|
+
declare const EntryChannelBindingParameterNames: unique symbol;
|
|
10
|
+
export type StringValueShape = {
|
|
11
|
+
readonly kind: typeof VALUE_SHAPE_KIND.string;
|
|
12
|
+
};
|
|
13
|
+
export type BooleanValueShape = {
|
|
14
|
+
readonly kind: typeof VALUE_SHAPE_KIND.boolean;
|
|
15
|
+
};
|
|
16
|
+
export type PositiveIntegerValueShape = {
|
|
17
|
+
readonly kind: typeof VALUE_SHAPE_KIND.positiveInteger;
|
|
18
|
+
};
|
|
19
|
+
export type StringEnumValueShape<Values extends readonly string[] = readonly string[]> = {
|
|
20
|
+
readonly kind: typeof VALUE_SHAPE_KIND.stringEnum;
|
|
21
|
+
readonly values: Values;
|
|
22
|
+
};
|
|
23
|
+
export type ScalarValueShape = StringValueShape | BooleanValueShape | PositiveIntegerValueShape | StringEnumValueShape;
|
|
24
|
+
export type ArrayValueShape<Element extends ScalarValueShape = ScalarValueShape> = {
|
|
25
|
+
readonly kind: typeof VALUE_SHAPE_KIND.array;
|
|
26
|
+
readonly element: Element;
|
|
27
|
+
};
|
|
28
|
+
export type ValueShape = ScalarValueShape | ArrayValueShape;
|
|
29
|
+
type ScalarJsonValue = string | number | boolean;
|
|
30
|
+
type ScalarValueShapeFor<Value extends JsonValue> = [Value] extends [boolean] ? BooleanValueShape : [Value] extends [number] ? PositiveIntegerValueShape : [Value] extends [string] ? StringValueShape | StringEnumValueShape<readonly Value[]> : never;
|
|
31
|
+
export type ValueShapeFor<Value extends JsonValue> = [Value] extends [
|
|
32
|
+
ScalarJsonValue
|
|
33
|
+
] ? ScalarValueShapeFor<Value> : [Value] extends [readonly (infer Element extends JsonValue)[]] ? ArrayValueShape<ScalarValueShapeFor<Element>> : JsonValue extends Value ? ValueShape : never;
|
|
34
|
+
export type ValueForShape<Shape extends ValueShape> = Shape extends BooleanValueShape ? boolean : Shape extends PositiveIntegerValueShape ? number : Shape extends StringEnumValueShape<infer Values> ? Values[number] : Shape extends StringValueShape ? string : Shape extends ArrayValueShape<infer Element> ? readonly ValueForShape<Element>[] : never;
|
|
35
|
+
export interface ValueCodec<Value extends JsonValue> extends RuntimeCodec<Value> {
|
|
36
|
+
readonly schema: z.ZodType<Value>;
|
|
37
|
+
readonly shape: ValueShapeFor<Value>;
|
|
38
|
+
}
|
|
39
|
+
export type ErasedValueCodec = {
|
|
40
|
+
readonly schema: z.ZodType;
|
|
41
|
+
readonly shape: ValueShape;
|
|
42
|
+
decode(input: unknown): CodecDecodeResult<JsonValue>;
|
|
43
|
+
};
|
|
44
|
+
export interface OutputContract<Value extends JsonValue> {
|
|
45
|
+
readonly schema: z.ZodType<Value>;
|
|
46
|
+
decode(input: unknown): CodecDecodeResult<Value>;
|
|
47
|
+
}
|
|
48
|
+
export type RequiredParameterRequirement = {
|
|
49
|
+
readonly kind: typeof PARAMETER_REQUIREMENT_KIND.required;
|
|
50
|
+
};
|
|
51
|
+
export type OptionalParameterRequirement = {
|
|
52
|
+
readonly kind: typeof PARAMETER_REQUIREMENT_KIND.optional;
|
|
53
|
+
};
|
|
54
|
+
export type OptionalWithDefaultParameterRequirement<Value extends JsonValue> = {
|
|
55
|
+
readonly kind: typeof PARAMETER_REQUIREMENT_KIND.optionalWithDefault;
|
|
56
|
+
readonly defaultValue: Value;
|
|
57
|
+
};
|
|
58
|
+
export type ParameterRequirement<Value extends JsonValue> = RequiredParameterRequirement | OptionalParameterRequirement | OptionalWithDefaultParameterRequirement<Value>;
|
|
59
|
+
export type ParameterDefinition<Name extends string, Value extends JsonValue, Requirement extends ParameterRequirement<Value> = ParameterRequirement<Value>> = {
|
|
60
|
+
readonly name: Name;
|
|
61
|
+
readonly codec: ValueCodec<Value>;
|
|
62
|
+
readonly requirement: Requirement;
|
|
63
|
+
readonly description: string;
|
|
64
|
+
};
|
|
65
|
+
export type ErasedParameterDefinition = {
|
|
66
|
+
readonly name: string;
|
|
67
|
+
readonly codec: ErasedValueCodec;
|
|
68
|
+
readonly requirement: ParameterRequirement<JsonValue>;
|
|
69
|
+
readonly description: string;
|
|
70
|
+
};
|
|
71
|
+
export type ParameterSet = readonly ErasedParameterDefinition[];
|
|
72
|
+
export type RawValueMap = {
|
|
73
|
+
readonly [key: string]: unknown;
|
|
74
|
+
};
|
|
75
|
+
type ParameterValue<Parameter extends ErasedParameterDefinition> = Parameter extends ParameterDefinition<string, infer Value> ? Value : never;
|
|
76
|
+
type ParameterMaterialization<Parameter extends ParameterSet[number]> = Parameter["requirement"]["kind"] extends typeof PARAMETER_REQUIREMENT_KIND.required | typeof PARAMETER_REQUIREMENT_KIND.optionalWithDefault ? true : false;
|
|
77
|
+
type MaterializedParameter<Parameter extends ParameterSet[number]> = ParameterMaterialization<Parameter> extends true ? Parameter : never;
|
|
78
|
+
type OmittedParameter<Parameter extends ParameterSet[number]> = ParameterMaterialization<Parameter> extends false ? Parameter : never;
|
|
79
|
+
export type ParameterValues<Parameters extends ParameterSet> = {
|
|
80
|
+
readonly [Parameter in Parameters[number] as MaterializedParameter<Parameter>["name"]]-?: ParameterValue<Parameter>;
|
|
81
|
+
} & {
|
|
82
|
+
readonly [Parameter in Parameters[number] as OmittedParameter<Parameter>["name"]]?: ParameterValue<Parameter>;
|
|
83
|
+
};
|
|
84
|
+
type EntryDefinitionBase<Name extends string, Parameters extends ParameterSet, Projection> = {
|
|
85
|
+
readonly name: Name;
|
|
86
|
+
readonly parameters: Parameters;
|
|
87
|
+
readonly project: (input: {
|
|
88
|
+
readonly values: ParameterValues<Parameters>;
|
|
89
|
+
}) => Projection;
|
|
90
|
+
};
|
|
91
|
+
export type EntryDefinitionInput<Name extends string, Parameters extends ParameterSet, Projection, Output extends JsonValue = JsonValue> = EntryDefinitionBase<Name, Parameters, Projection> & {
|
|
92
|
+
readonly output?: OutputContract<Output>;
|
|
93
|
+
};
|
|
94
|
+
export type EntryDefinition<Name extends string, Parameters extends ParameterSet, Projection, Output extends JsonValue = JsonValue> = (EntryDefinitionBase<Name, Parameters, Projection> & {
|
|
95
|
+
readonly output: null;
|
|
96
|
+
}) | (EntryDefinitionBase<Name, Parameters, Projection> & {
|
|
97
|
+
readonly output: OutputContract<Output>;
|
|
98
|
+
});
|
|
99
|
+
export type ErasedOutputContract = {
|
|
100
|
+
readonly schema: z.ZodType;
|
|
101
|
+
decode(input: unknown): CodecDecodeResult<JsonValue>;
|
|
102
|
+
};
|
|
103
|
+
export type ErasedEntryDefinition = {
|
|
104
|
+
readonly name: string;
|
|
105
|
+
readonly parameters: ParameterSet;
|
|
106
|
+
readonly project: (input: never) => unknown;
|
|
107
|
+
readonly output: null;
|
|
108
|
+
} | {
|
|
109
|
+
readonly name: string;
|
|
110
|
+
readonly parameters: ParameterSet;
|
|
111
|
+
readonly project: (input: never) => unknown;
|
|
112
|
+
readonly output: ErasedOutputContract;
|
|
113
|
+
};
|
|
114
|
+
export type EntryTreeDefinition = {
|
|
115
|
+
readonly root: EntryTreeNode;
|
|
116
|
+
readonly [EntryTreeDefinitionBrand]: true;
|
|
117
|
+
};
|
|
118
|
+
export type CommandDocumentation = {
|
|
119
|
+
readonly remarks: readonly string[];
|
|
120
|
+
readonly relatedDocs: readonly string[];
|
|
121
|
+
};
|
|
122
|
+
export type CommandDocumentationInput = {
|
|
123
|
+
readonly remarks?: readonly string[];
|
|
124
|
+
readonly relatedDocs?: readonly string[];
|
|
125
|
+
};
|
|
126
|
+
export type EntryTreeNode = {
|
|
127
|
+
readonly name: string;
|
|
128
|
+
readonly description: string;
|
|
129
|
+
readonly documentation: CommandDocumentation;
|
|
130
|
+
readonly segments: readonly ChannelSegmentOverride[];
|
|
131
|
+
readonly endpoints: readonly EntryTreeEndpoint[];
|
|
132
|
+
readonly children: readonly EntryTreeNode[];
|
|
133
|
+
readonly [EntryTreeNodeBrand]: true;
|
|
134
|
+
};
|
|
135
|
+
export type EntryTreeEndpoint<Entry extends ErasedEntryDefinition = ErasedEntryDefinition> = {
|
|
136
|
+
readonly entry: Entry;
|
|
137
|
+
readonly channels: readonly EntryChannelBinding[];
|
|
138
|
+
readonly [EntryTreeEndpointBrand]: true;
|
|
139
|
+
};
|
|
140
|
+
export type ChannelSegmentOverride = {
|
|
141
|
+
readonly channel: Channel;
|
|
142
|
+
readonly segment: unknown;
|
|
143
|
+
readonly [ChannelSegmentOverrideBrand]: true;
|
|
144
|
+
};
|
|
145
|
+
export type EntryChannelBinding<ChannelName extends Channel = Channel, ParameterName extends string = string> = {
|
|
146
|
+
readonly channel: ChannelName;
|
|
147
|
+
readonly binding: unknown;
|
|
148
|
+
readonly [EntryChannelBindingBrand]: true;
|
|
149
|
+
readonly [EntryChannelBindingParameterNames]: ParameterName;
|
|
150
|
+
};
|
|
151
|
+
export type EntryDefinitionWithOutput<Name extends string, Parameters extends ParameterSet, Projection, Output extends JsonValue> = Extract<EntryDefinition<Name, Parameters, Projection, Output>, {
|
|
152
|
+
readonly output: OutputContract<Output>;
|
|
153
|
+
}>;
|
|
154
|
+
export type EntryDefinitionInputWithOutput<Name extends string, Parameters extends ParameterSet, Projection, Output extends JsonValue> = EntryDefinitionInput<Name, Parameters, Projection, Output> & {
|
|
155
|
+
readonly output: OutputContract<Output>;
|
|
156
|
+
};
|
|
157
|
+
export declare function defineParameter<const Name extends string, Value extends JsonValue, const Requirement extends ParameterRequirement<Value>>(parameter: ParameterDefinition<Name, Value, Requirement>): ParameterDefinition<Name, Value, Requirement>;
|
|
158
|
+
export declare function defineEntry<const Name extends string, const Parameters extends ParameterSet, Projection, Output extends JsonValue>(entry: EntryDefinitionInputWithOutput<Name, Parameters, Projection, Output>): EntryDefinitionWithOutput<Name, Parameters, Projection, Output>;
|
|
159
|
+
export declare function defineEntry<const Name extends string, const Parameters extends ParameterSet, Projection, Output extends JsonValue = JsonValue>(entry: EntryDefinitionInput<Name, Parameters, Projection, Output>): EntryDefinition<Name, Parameters, Projection, Output>;
|
|
160
|
+
export declare function required(): RequiredParameterRequirement;
|
|
161
|
+
export declare function optional<_Value extends JsonValue>(): OptionalParameterRequirement;
|
|
162
|
+
export declare function optional<Value extends JsonValue>(input: {
|
|
163
|
+
readonly default: Value;
|
|
164
|
+
}): OptionalWithDefaultParameterRequirement<Value>;
|
|
165
|
+
export {};
|
|
166
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,SAAS,EACT,YAAY,EACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EACL,KAAK,OAAO,EACZ,0BAA0B,EAC1B,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAErB,OAAO,CAAC,MAAM,wBAAwB,EAAE,OAAO,MAAM,CAAC;AACtD,OAAO,CAAC,MAAM,kBAAkB,EAAE,OAAO,MAAM,CAAC;AAChD,OAAO,CAAC,MAAM,sBAAsB,EAAE,OAAO,MAAM,CAAC;AACpD,OAAO,CAAC,MAAM,2BAA2B,EAAE,OAAO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