capable-kit 0.0.1-alpha.0 → 0.0.1-alpha.1

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.
Files changed (60) hide show
  1. package/README.md +42 -0
  2. package/dist/ai-sdk.d.mts +2 -2
  3. package/dist/ai-sdk.mjs +1 -1
  4. package/dist/app.d.mts +1 -1
  5. package/dist/app.mjs +1 -1
  6. package/dist/bin.mjs +395 -47
  7. package/dist/bin.mjs.map +1 -1
  8. package/dist/cli.d.mts +27 -2
  9. package/dist/cli.mjs +2 -2
  10. package/dist/core.d.mts +3 -3
  11. package/dist/core.mjs +1 -1
  12. package/dist/eve.d.mts +1 -1
  13. package/dist/eve.mjs +1 -1
  14. package/dist/http.d.mts +1 -1
  15. package/dist/http.mjs +1 -1
  16. package/dist/{index-DLcYNpfo.d.mts → index-BB5ogMv-.d.mts} +17 -14
  17. package/dist/{index-C9ZThFPN.d.mts → index-BxJhwhKm.d.mts} +2 -2
  18. package/dist/{index-BuXwkN8G.d.mts → index-CThfifn8.d.mts} +4 -4
  19. package/dist/{index-u9ZOETR5.d.mts → index-Dp-D73pf.d.mts} +3 -3
  20. package/dist/index.d.mts +3 -3
  21. package/dist/index.mjs +2 -2
  22. package/dist/mcp.d.mts +2 -2
  23. package/dist/mcp.mjs +1 -139
  24. package/dist/mount--YHrgRHJ.mjs +140 -0
  25. package/dist/mount--YHrgRHJ.mjs.map +1 -0
  26. package/dist/runtime-support.d.mts +20 -0
  27. package/dist/runtime-support.mjs +325 -0
  28. package/dist/runtime-support.mjs.map +1 -0
  29. package/dist/server.d.mts +1 -1
  30. package/dist/server.mjs +1 -81
  31. package/dist/{src-CT4fbWqb.mjs → src-3UaBqI8H.mjs} +26 -16
  32. package/dist/src-3UaBqI8H.mjs.map +1 -0
  33. package/dist/{src-DX-_J6l2.mjs → src-B53ZbNtC.mjs} +6 -7
  34. package/dist/src-B53ZbNtC.mjs.map +1 -0
  35. package/dist/{src-CvWOGyGW.mjs → src-BjBxOv7x.mjs} +148 -96
  36. package/dist/src-BjBxOv7x.mjs.map +1 -0
  37. package/dist/src-DpSA-hBO.mjs +82 -0
  38. package/dist/src-DpSA-hBO.mjs.map +1 -0
  39. package/dist/{src-DlSJtEhv.mjs → src-XRJ9hgYX.mjs} +7 -7
  40. package/dist/src-XRJ9hgYX.mjs.map +1 -0
  41. package/dist/{subscription-CBnnIU42.d.mts → subscription-McaLyHM2.d.mts} +2 -2
  42. package/package.json +59 -17
  43. package/src/ai-sdk.ts +1 -0
  44. package/src/app.ts +1 -0
  45. package/src/bin.ts +4 -0
  46. package/src/cli.ts +1 -0
  47. package/src/core.ts +1 -0
  48. package/src/eve.ts +1 -0
  49. package/src/http.ts +1 -0
  50. package/src/index.test.ts +56 -0
  51. package/src/index.ts +38 -0
  52. package/src/mcp.ts +2 -0
  53. package/src/runtime-support.ts +1 -0
  54. package/src/server.ts +1 -0
  55. package/dist/mcp.mjs.map +0 -1
  56. package/dist/server.mjs.map +0 -1
  57. package/dist/src-CT4fbWqb.mjs.map +0 -1
  58. package/dist/src-CvWOGyGW.mjs.map +0 -1
  59. package/dist/src-DX-_J6l2.mjs.map +0 -1
  60. package/dist/src-DlSJtEhv.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { a as TransportError, c as getAppRuntime } from "./src-CT4fbWqb.mjs";
1
+ import { a as TransportError, c as getAppRuntime } from "./src-3UaBqI8H.mjs";
2
2
  import { render } from "markdansi";
3
3
  //#region packages/cli/src/commands.ts
4
4
  function collectCommands(nodes, parent = []) {
@@ -37,6 +37,13 @@ function groupFrom(node, command) {
37
37
  }
38
38
  //#endregion
39
39
  //#region packages/cli/src/style.ts
40
+ /** Every help line hangs off this margin. */
41
+ const MARGIN = " ";
42
+ /** Rows sit one step inside their section heading. */
43
+ const ROW_INDENT = " ";
44
+ /** Widest label that still keeps descriptions in a single column. */
45
+ const MAX_LABEL_WIDTH = 30;
46
+ const LABEL_GAP = 2;
40
47
  function createCliStyle(color) {
41
48
  const enabled = color ?? supportsColor();
42
49
  return {
@@ -50,129 +57,174 @@ function supportsColor(env = process.env, isTTY = Boolean(process.stdout.isTTY))
50
57
  if (env.FORCE_COLOR !== void 0) return env.FORCE_COLOR !== "0";
51
58
  return isTTY && env.TERM !== "dumb";
52
59
  }
53
- function renderRows(rows, style) {
54
- const width = Math.max(0, ...rows.map(({ label }) => label.length));
60
+ function renderRows(rows, style, options = {}) {
61
+ const indent = options.indent ?? " ";
62
+ const width = Math.max(0, (options.column ?? descriptionColumn(rows, indent)) - indent.length - LABEL_GAP);
55
63
  return rows.map(({ label, description }) => {
56
- const styledLabel = style.accent(label);
57
- return description ? ` ${styledLabel}${" ".repeat(width - label.length + 3)}${style.dim(description)}` : ` ${styledLabel}`;
64
+ const line = `${indent}${style.accent(label)}`;
65
+ if (!description) return line;
66
+ return label.length > width ? `${line}\n${indent}${" ".repeat(width + LABEL_GAP)}${style.dim(description)}` : `${line}${" ".repeat(width - label.length + LABEL_GAP)}${style.dim(description)}`;
58
67
  }).join("\n");
59
68
  }
69
+ /** Shared description column so sibling sections stay visually aligned. */
70
+ function descriptionColumn(rows, indent = ROW_INDENT) {
71
+ const labels = rows.filter(({ description }) => description !== void 0).map(({ label }) => label.length).filter((length) => length <= MAX_LABEL_WIDTH);
72
+ return indent.length + LABEL_GAP + Math.max(0, ...labels);
73
+ }
60
74
  function renderSection(title, body, style) {
61
- return `${style.bold(title)}\n${body}`;
75
+ return ` ${style.bold(title)}\n\n${body}`;
62
76
  }
63
77
  function identity(text) {
64
78
  return text;
65
79
  }
66
80
  //#endregion
67
81
  //#region packages/cli/src/help.ts
68
- function renderRootHelp(manifest, commands, invocationName, style) {
82
+ const GLOBAL_OPTIONS = [{
83
+ label: "--json",
84
+ description: "Print canonical JSON"
85
+ }, {
86
+ label: "-h, --help",
87
+ description: "Show help"
88
+ }];
89
+ function renderRootHelp(manifest, commands, groups, invocationName, style) {
90
+ const sections = commandSections(commands, groups);
91
+ const nested = sections.some((section) => section.title !== void 0);
92
+ const column = Math.max(descriptionColumn(sections.flatMap((section) => section.rows), nested ? `${ROW_INDENT} ` : ROW_INDENT), descriptionColumn(GLOBAL_OPTIONS));
69
93
  return renderHelp([
70
- heading(manifest.name, manifest.description, style),
71
- renderSection("Usage", ` ${style.accent(invocationName)} <command> [options]`, style),
72
- renderSection("Commands", renderRows(commands.map((command) => ({
73
- label: commandLabel(command),
74
- ...command.capability.title ? { description: command.capability.title } : {}
75
- })), style), style),
76
- globalOptions(style)
94
+ banner({
95
+ title: manifest.name,
96
+ ...manifest.description ? { description: manifest.description } : {},
97
+ usage: `${invocationName} <command> [options]`,
98
+ style
99
+ }),
100
+ renderSection("Commands", sections.map((section) => [section.title ? `${ROW_INDENT}${style.dim(section.title)}` : void 0, renderRows(section.rows, style, {
101
+ column,
102
+ ...section.title ? { indent: `${ROW_INDENT} ` } : {}
103
+ })].filter(Boolean).join("\n")).join("\n\n"), style),
104
+ renderSection("Options", renderRows(GLOBAL_OPTIONS, style, { column }), style),
105
+ hint(`Run \`${invocationName} <command> --help\` for details on a command.`, style)
77
106
  ]);
78
107
  }
79
108
  function renderGroupHelp(group, commands, invocationName, style) {
80
- const children = commands.filter((candidate) => startsWith(candidate.command, group.command)).map((candidate) => {
81
- const suffix = candidate.command.slice(group.command.length);
82
- const positionals = candidate.meta.positional ?? [];
83
- return {
84
- label: [...suffix, ...positionals.map((name) => `<${name}>`)].join(" "),
85
- ...candidate.capability.title ? { description: candidate.capability.title } : {}
86
- };
87
- });
109
+ const prefix = group.command.join(" ");
110
+ const rows = commands.filter((candidate) => startsWith(candidate.command, group.command)).map((candidate) => ({
111
+ label: signature(candidate, candidate.command.slice(group.command.length)),
112
+ ...describe(candidate)
113
+ }));
114
+ const column = descriptionColumn([...rows, ...GLOBAL_OPTIONS]);
88
115
  return renderHelp([
89
- heading(group.title ?? group.command.at(-1), group.description, style),
90
- renderSection("Usage", ` ${style.accent(`${invocationName} ${group.command.join(" ")}`)} <command> [options]`, style),
91
- renderSection("Commands", renderRows(children, style), style),
92
- globalOptions(style)
116
+ banner({
117
+ ...group.title ? { title: group.title } : {},
118
+ ...group.description ? { description: group.description } : {},
119
+ usage: `${invocationName} ${prefix} <command> [options]`,
120
+ style
121
+ }),
122
+ renderSection("Commands", renderRows(rows, style, { column }), style),
123
+ renderSection("Options", renderRows(GLOBAL_OPTIONS, style, { column }), style),
124
+ hint(`Run \`${invocationName} ${prefix} <command> --help\` for details on a command.`, style)
93
125
  ]);
94
126
  }
95
127
  function renderCommandHelp(command, invocationName, style) {
128
+ const properties = fields(command);
129
+ const required = requiredFields(command);
96
130
  const positionals = command.meta.positional ?? [];
97
- const properties = command.capability.input?.properties;
98
- const required = new Set(command.capability.input?.required);
99
- const argumentsRows = positionals.map((name) => ({
100
- label: `<${name}>`,
101
- description: describeField(properties?.[name], required.has(name))
131
+ const argumentRows = positionals.map((name) => ({
132
+ label: placeholder(name, required.has(name)),
133
+ ...description(properties[name], { choices: true })
102
134
  }));
103
- const optionRows = Object.entries(properties ?? {}).filter(([name]) => !positionals.includes(name)).map(([name, schema]) => ({
135
+ const optionRows = [...Object.entries(properties).filter(([name]) => !positionals.includes(name)).map(([name, schema]) => ({
104
136
  label: optionLabel(name, schema),
105
- description: describeField(schema, required.has(name))
106
- }));
107
- const usage = [
108
- invocationName,
109
- ...command.command,
110
- ...positionals.map((name) => `<${name}>`),
111
- "[options]"
112
- ].join(" ");
137
+ ...description(schema, { required: required.has(name) })
138
+ })), ...command.capability.subscription ? [{
139
+ label: "--watch",
140
+ description: "Stream updates until interrupted"
141
+ }] : []];
142
+ const column = descriptionColumn([
143
+ ...argumentRows,
144
+ ...optionRows,
145
+ ...GLOBAL_OPTIONS
146
+ ]);
113
147
  return renderHelp([
114
- heading(command.capability.title ?? command.command.join(" "), command.capability.description, style),
115
- renderSection("Usage", ` ${style.accent(usage)}`, style),
116
- argumentsRows.length ? renderSection("Arguments", renderRows(argumentsRows, style), style) : void 0,
117
- renderSection("Options", renderRows([
118
- ...optionRows,
119
- ...command.capability.subscription ? [{
120
- label: "--watch",
121
- description: "Stream updates until interrupted"
122
- }] : [],
123
- {
124
- label: "--json",
125
- description: "Print canonical JSON"
126
- },
127
- {
128
- label: "-h, --help",
129
- description: "Show command help"
130
- }
131
- ], style), style)
148
+ banner({
149
+ ...command.capability.title ? { title: command.capability.title } : {},
150
+ ...command.capability.description ? { description: command.capability.description } : {},
151
+ usage: [
152
+ invocationName,
153
+ signature(command),
154
+ "[options]"
155
+ ].join(" "),
156
+ style
157
+ }),
158
+ argumentRows.length ? renderSection("Arguments", renderRows(argumentRows, style, { column }), style) : void 0,
159
+ optionRows.length ? renderSection("Options", renderRows(optionRows, style, { column }), style) : void 0,
160
+ renderSection(optionRows.length ? "Global Options" : "Options", renderRows(GLOBAL_OPTIONS, style, { column }), style)
132
161
  ]);
133
162
  }
134
- function globalOptions(style) {
135
- return renderSection("Options", renderRows([{
136
- label: "--json",
137
- description: "Print canonical JSON"
138
- }, {
139
- label: "-h, --help",
140
- description: "Show help"
141
- }], style), style);
163
+ /** Root commands are grouped under their top-level group, Vercel style. */
164
+ function commandSections(commands, groups) {
165
+ const roots = groups.filter((group) => group.command.length === 1);
166
+ const loose = commands.filter((command) => !roots.some((group) => startsWith(command.command, group.command)));
167
+ const sections = roots.map((group) => ({
168
+ ...roots.length > 1 || loose.length ? { title: group.title ?? group.command.join(" ") } : {},
169
+ rows: commands.filter((command) => startsWith(command.command, group.command)).map(row)
170
+ })).filter((section) => section.rows.length > 0);
171
+ return [...sections, ...loose.length ? [{
172
+ ...sections.length ? { title: "General" } : {},
173
+ rows: loose.map(row)
174
+ }] : []];
175
+ }
176
+ function row(command) {
177
+ return {
178
+ label: signature(command),
179
+ ...describe(command)
180
+ };
181
+ }
182
+ function describe(command) {
183
+ const text = command.capability.title ?? command.capability.description;
184
+ return text ? { description: text } : {};
185
+ }
186
+ /** `todo delete <todoId>` — command path plus its positional slots. */
187
+ function signature(command, path = command.command) {
188
+ const required = requiredFields(command);
189
+ return [...path, ...(command.meta.positional ?? []).map((name) => placeholder(name, required.has(name)))].join(" ");
190
+ }
191
+ function placeholder(name, required) {
192
+ return required ? `<${name}>` : `[${name}]`;
142
193
  }
143
- function heading(title, description, style) {
144
- return description ? `${style.bold(title)}\n\n${style.dim(description)}` : style.bold(title);
194
+ /** Title, prose, then the invocation line. No heading needed above it. */
195
+ function banner(options) {
196
+ const { style } = options;
197
+ return [[options.title ? ` ${style.bold(options.title)}` : void 0, options.description ? ` ${style.dim(options.description)}` : void 0].filter(Boolean).join("\n"), ` ${style.accent(options.usage)}`].filter(Boolean).join("\n\n");
145
198
  }
146
- function commandLabel(command) {
147
- const positionals = (command.meta.positional ?? []).map((name) => `<${name}>`);
148
- return [...command.command, ...positionals].join(" ");
199
+ function hint(text, style) {
200
+ return ` ${style.dim(text)}`;
201
+ }
202
+ function fields(command) {
203
+ return command.capability.input?.properties ?? {};
204
+ }
205
+ function requiredFields(command) {
206
+ return new Set(command.capability.input?.required);
149
207
  }
150
208
  function optionLabel(name, schema) {
151
209
  const flag = `--${kebabCase$1(name)}`;
152
210
  if (schema.type === "boolean") return flag;
211
+ if (Array.isArray(schema.enum)) return `${flag} <${schema.enum.map(String).join("|")}>`;
153
212
  if (schema.type === "array" || schema.type === "object") return `${flag} <json>`;
154
213
  return `${flag} <${String(schema.type ?? "value")}>`;
155
214
  }
156
- function describeField(schema, required) {
157
- const description = typeof schema?.description === "string" ? schema.description : void 0;
158
- const type = describeSchema(schema);
159
- return [
160
- description ? `${description} (${type})` : type,
161
- required ? "required" : void 0,
162
- schema?.default !== void 0 ? `default: ${String(schema.default)}` : void 0
163
- ].filter(Boolean).join(", ");
164
- }
165
- function describeSchema(schema) {
166
- if (!schema) return "value";
167
- const type = schema.type === "array" ? `array<${String(schema.items?.type ?? "value")}>` : schema.type === "object" ? `object { ${Object.keys(schema.properties ?? {}).join(", ")} }` : String(schema.type ?? "value");
168
- const constraints = [];
169
- if (Array.isArray(schema.enum)) constraints.push(`one of ${schema.enum.map(String).join(", ")}`);
170
- if (typeof schema.minLength === "number") constraints.push(`minimum ${schema.minLength} characters`);
171
- if (typeof schema.maxLength === "number") constraints.push(`maximum ${schema.maxLength} characters`);
172
- if (typeof schema.minimum === "number") constraints.push(`minimum ${schema.minimum}`);
173
- if (typeof schema.maximum === "number") constraints.push(`maximum ${schema.maximum}`);
174
- if (typeof schema.format === "string") constraints.push(`format ${schema.format}`);
175
- return [type, ...constraints].join(", ");
215
+ /**
216
+ * Descriptions stay one short line: prose first, then only the facts a reader
217
+ * cannot guess from the label (requiredness, defaults, choices).
218
+ */
219
+ function description(schema, options = {}) {
220
+ const prose = typeof schema?.description === "string" ? schema.description : void 0;
221
+ const notes = [
222
+ options.choices && Array.isArray(schema?.enum) ? `one of ${schema.enum.map(String).join(", ")}` : void 0,
223
+ schema?.default !== void 0 ? `default: ${String(schema.default)}` : void 0,
224
+ options.required ? "required" : void 0
225
+ ].filter(Boolean);
226
+ const text = [prose, notes.length ? `(${notes.join(", ")})` : void 0].filter(Boolean).join(" ");
227
+ return text ? { description: text } : {};
176
228
  }
177
229
  function startsWith(value, prefix) {
178
230
  return prefix.every((part, index) => value[index] === part);
@@ -181,7 +233,7 @@ function kebabCase$1(value) {
181
233
  return value.replace(/[A-Z]/g, (character) => `-${character.toLowerCase()}`);
182
234
  }
183
235
  function renderHelp(sections) {
184
- return `${sections.filter(Boolean).join("\n\n")}\n`;
236
+ return `\n${sections.filter(Boolean).join("\n\n")}\n`;
185
237
  }
186
238
  //#endregion
187
239
  //#region packages/cli/src/index.ts
@@ -203,7 +255,7 @@ async function runCli(options) {
203
255
  stdout: options.io?.stdout ?? ((text) => process.stdout.write(withTrailingNewline(text))),
204
256
  stderr: options.io?.stderr ?? ((text) => process.stderr.write(withTrailingNewline(text)))
205
257
  };
206
- const invocationName = options.invocationName ?? "capable";
258
+ const invocationName = options.invocationName ?? "cap";
207
259
  const isTTY = options.isTTY ?? Boolean(process.stdout.isTTY);
208
260
  const color = options.color ?? supportsColor(process.env, isTTY);
209
261
  const columns = options.columns ?? process.stdout.columns ?? 80;
@@ -227,7 +279,7 @@ async function runCli(options) {
227
279
  "-h"
228
280
  ].includes(argument));
229
281
  if (argv.length === 0) {
230
- io.stdout(renderRootHelp(manifest, catalog.commands, invocationName, style));
282
+ io.stdout(renderRootHelp(manifest, catalog.commands, catalog.groups, invocationName, style));
231
283
  return 0;
232
284
  }
233
285
  const command = matchCommand(argv, catalog.commands);
@@ -433,6 +485,6 @@ function kebabCase(value) {
433
485
  return value.replace(/[A-Z]/g, (character) => `-${character.toLowerCase()}`);
434
486
  }
435
487
  //#endregion
436
- export { runCli as n, createCli as t };
488
+ export { createCliStyle as a, renderSection as c, ROW_INDENT as i, supportsColor as l, runCli as n, descriptionColumn as o, MARGIN as r, renderRows as s, createCli as t };
437
489
 
438
- //# sourceMappingURL=src-CvWOGyGW.mjs.map
490
+ //# sourceMappingURL=src-BjBxOv7x.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-BjBxOv7x.mjs","names":["kebabCase","renderMarkdown"],"sources":["../../cli/src/commands.ts","../../cli/src/style.ts","../../cli/src/help.ts","../../cli/src/index.ts"],"sourcesContent":["import type {\n ManifestGroup,\n ManifestNode,\n ManifestCapability,\n} from \"@capable/app\";\nimport type {\n CliGroupMeta,\n CliCapabilityMeta,\n} from \"./index.ts\";\n\nexport type CliCommand = {\n readonly command: readonly string[];\n readonly capability: ManifestCapability;\n readonly meta: Exclude<CliCapabilityMeta, false>;\n};\n\nexport type CliCommandGroup = {\n readonly command: readonly string[];\n readonly title?: string;\n readonly description?: string;\n};\n\nexport type CliCommandCatalog = {\n readonly commands: readonly CliCommand[];\n readonly groups: readonly CliCommandGroup[];\n};\n\nexport function collectCommands(\n nodes: readonly ManifestNode[],\n parent: readonly string[] = [],\n): CliCommandCatalog {\n const commands: CliCommand[] = [];\n const groups: CliCommandGroup[] = [];\n\n for (const node of nodes) {\n if (node.type === \"group\") {\n const meta = (node.meta.cli ?? {}) as CliGroupMeta;\n const command = [...parent, meta.name ?? node.key];\n groups.push(groupFrom(node, command));\n const children = collectCommands(node.children, command);\n commands.push(...children.commands);\n groups.push(...children.groups);\n continue;\n }\n\n const rawMeta = node.meta.cli as CliCapabilityMeta | undefined;\n if (rawMeta === false) continue;\n const meta = rawMeta ?? {};\n commands.push({\n command: meta.command ?? [...parent, meta.name ?? node.path.at(-1)!],\n capability: node,\n meta,\n });\n }\n\n return {\n commands: Object.freeze(commands),\n groups: Object.freeze(groups),\n };\n}\n\nfunction groupFrom(\n node: ManifestGroup,\n command: readonly string[],\n): CliCommandGroup {\n return Object.freeze({\n command: Object.freeze(command),\n ...(node.title ? { title: node.title } : {}),\n ...(node.description ? { description: node.description } : {}),\n });\n}\n","export type CliStyle = {\n readonly bold: (text: string) => string;\n readonly accent: (text: string) => string;\n readonly dim: (text: string) => string;\n};\n\nexport type CliRow = {\n readonly label: string;\n readonly description?: string;\n};\n\n/** Every help line hangs off this margin. */\nexport const MARGIN = \" \";\n\n/** Rows sit one step inside their section heading. */\nexport const ROW_INDENT = \" \";\n\n/** Widest label that still keeps descriptions in a single column. */\nconst MAX_LABEL_WIDTH = 30;\n\nconst LABEL_GAP = 2;\n\nexport function createCliStyle(color?: boolean): CliStyle {\n const enabled = color ?? supportsColor();\n return {\n bold: enabled ? (text) => `\\u001B[1m${text}\\u001B[22m` : identity,\n accent: enabled ? (text) => `\\u001B[36m${text}\\u001B[39m` : identity,\n dim: enabled ? (text) => `\\u001B[2m${text}\\u001B[22m` : identity,\n };\n}\n\nexport function supportsColor(\n env: Record<string, string | undefined> = process.env,\n isTTY = Boolean(process.stdout.isTTY),\n): boolean {\n if (\"NO_COLOR\" in env) return false;\n if (env.FORCE_COLOR !== undefined) return env.FORCE_COLOR !== \"0\";\n return isTTY && env.TERM !== \"dumb\";\n}\n\nexport function renderRows(\n rows: readonly CliRow[],\n style: CliStyle,\n options: {\n readonly indent?: string;\n /** Absolute column for descriptions, so sibling sections stay aligned. */\n readonly column?: number;\n } = {},\n): string {\n const indent = options.indent ?? ROW_INDENT;\n const width = Math.max(\n 0,\n (options.column ?? descriptionColumn(rows, indent)) - indent.length -\n LABEL_GAP,\n );\n return rows.map(({ label, description }) => {\n const line = `${indent}${style.accent(label)}`;\n if (!description) return line;\n return label.length > width\n ? `${line}\\n${indent}${\" \".repeat(width + LABEL_GAP)}${style.dim(description)}`\n : `${line}${\" \".repeat(width - label.length + LABEL_GAP)}${\n style.dim(description)\n }`;\n }).join(\"\\n\");\n}\n\n/** Shared description column so sibling sections stay visually aligned. */\nexport function descriptionColumn(\n rows: readonly CliRow[],\n indent: string = ROW_INDENT,\n): number {\n const labels = rows\n .filter(({ description }) => description !== undefined)\n .map(({ label }) => label.length)\n .filter((length) => length <= MAX_LABEL_WIDTH);\n return indent.length + LABEL_GAP + Math.max(0, ...labels);\n}\n\nexport function renderSection(\n title: string,\n body: string,\n style: CliStyle,\n): string {\n return `${MARGIN}${style.bold(title)}\\n\\n${body}`;\n}\n\nfunction identity(text: string): string {\n return text;\n}\n","import type {\n ApplicationManifest,\n JsonSchema,\n} from \"@capable/app\";\nimport type {\n CliCommand,\n CliCommandGroup,\n} from \"./commands.ts\";\nimport {\n descriptionColumn,\n MARGIN,\n renderRows,\n renderSection,\n ROW_INDENT,\n type CliRow,\n type CliStyle,\n} from \"./style.ts\";\n\nconst GLOBAL_OPTIONS: readonly CliRow[] = [\n { label: \"--json\", description: \"Print canonical JSON\" },\n { label: \"-h, --help\", description: \"Show help\" },\n];\n\nexport function renderRootHelp(\n manifest: Pick<ApplicationManifest, \"name\" | \"description\">,\n commands: readonly CliCommand[],\n groups: readonly CliCommandGroup[],\n invocationName: string,\n style: CliStyle,\n): string {\n const sections = commandSections(commands, groups);\n const nested = sections.some((section) => section.title !== undefined);\n const column = Math.max(\n descriptionColumn(\n sections.flatMap((section) => section.rows),\n nested ? `${ROW_INDENT}${MARGIN}` : ROW_INDENT,\n ),\n descriptionColumn(GLOBAL_OPTIONS),\n );\n return renderHelp([\n banner({\n title: manifest.name,\n ...(manifest.description ? { description: manifest.description } : {}),\n usage: `${invocationName} <command> [options]`,\n style,\n }),\n renderSection(\n \"Commands\",\n sections\n .map((section) =>\n [\n section.title ? `${ROW_INDENT}${style.dim(section.title)}` : undefined,\n renderRows(section.rows, style, {\n column,\n ...(section.title ? { indent: `${ROW_INDENT}${MARGIN}` } : {}),\n }),\n ].filter(Boolean).join(\"\\n\")\n )\n .join(\"\\n\\n\"),\n style,\n ),\n renderSection(\"Options\", renderRows(GLOBAL_OPTIONS, style, { column }), style),\n hint(`Run \\`${invocationName} <command> --help\\` for details on a command.`, style),\n ]);\n}\n\nexport function renderGroupHelp(\n group: CliCommandGroup,\n commands: readonly CliCommand[],\n invocationName: string,\n style: CliStyle,\n): string {\n const prefix = group.command.join(\" \");\n const rows = commands\n .filter((candidate) => startsWith(candidate.command, group.command))\n .map((candidate) => ({\n label: signature(candidate, candidate.command.slice(group.command.length)),\n ...describe(candidate),\n }));\n const column = descriptionColumn([...rows, ...GLOBAL_OPTIONS]);\n return renderHelp([\n banner({\n ...(group.title ? { title: group.title } : {}),\n ...(group.description ? { description: group.description } : {}),\n usage: `${invocationName} ${prefix} <command> [options]`,\n style,\n }),\n renderSection(\"Commands\", renderRows(rows, style, { column }), style),\n renderSection(\"Options\", renderRows(GLOBAL_OPTIONS, style, { column }), style),\n hint(\n `Run \\`${invocationName} ${prefix} <command> --help\\` for details on a command.`,\n style,\n ),\n ]);\n}\n\nexport function renderCommandHelp(\n command: CliCommand,\n invocationName: string,\n style: CliStyle,\n): string {\n const properties = fields(command);\n const required = requiredFields(command);\n const positionals = command.meta.positional ?? [];\n const argumentRows = positionals.map((name) => ({\n label: placeholder(name, required.has(name)),\n ...description(properties[name], { choices: true }),\n }));\n const optionRows = [\n ...Object.entries(properties)\n .filter(([name]) => !positionals.includes(name))\n .map(([name, schema]) => ({\n label: optionLabel(name, schema),\n ...description(schema, { required: required.has(name) }),\n })),\n ...(command.capability.subscription\n ? [{ label: \"--watch\", description: \"Stream updates until interrupted\" }]\n : []),\n ];\n const column = descriptionColumn([\n ...argumentRows,\n ...optionRows,\n ...GLOBAL_OPTIONS,\n ]);\n\n return renderHelp([\n banner({\n ...(command.capability.title ? { title: command.capability.title } : {}),\n ...(command.capability.description\n ? { description: command.capability.description }\n : {}),\n usage: [invocationName, signature(command), \"[options]\"].join(\" \"),\n style,\n }),\n argumentRows.length\n ? renderSection(\n \"Arguments\",\n renderRows(argumentRows, style, { column }),\n style,\n )\n : undefined,\n optionRows.length\n ? renderSection(\"Options\", renderRows(optionRows, style, { column }), style)\n : undefined,\n renderSection(\n optionRows.length ? \"Global Options\" : \"Options\",\n renderRows(GLOBAL_OPTIONS, style, { column }),\n style,\n ),\n ]);\n}\n\n/** Root commands are grouped under their top-level group, Vercel style. */\nfunction commandSections(\n commands: readonly CliCommand[],\n groups: readonly CliCommandGroup[],\n): readonly { readonly title?: string; readonly rows: readonly CliRow[] }[] {\n const roots = groups.filter((group) => group.command.length === 1);\n const loose = commands.filter((command) =>\n !roots.some((group) => startsWith(command.command, group.command))\n );\n const sections = roots.map((group) => ({\n ...(roots.length > 1 || loose.length\n ? { title: group.title ?? group.command.join(\" \") }\n : {}),\n rows: commands\n .filter((command) => startsWith(command.command, group.command))\n .map(row),\n })).filter((section) => section.rows.length > 0);\n return [\n ...sections,\n ...(loose.length\n ? [{\n ...(sections.length ? { title: \"General\" } : {}),\n rows: loose.map(row),\n }]\n : []),\n ];\n}\n\nfunction row(command: CliCommand): CliRow {\n return { label: signature(command), ...describe(command) };\n}\n\nfunction describe(command: CliCommand): { description?: string } {\n const text = command.capability.title ?? command.capability.description;\n return text ? { description: text } : {};\n}\n\n/** `todo delete <todoId>` — command path plus its positional slots. */\nfunction signature(\n command: CliCommand,\n path: readonly string[] = command.command,\n): string {\n const required = requiredFields(command);\n return [\n ...path,\n ...(command.meta.positional ?? []).map((name) =>\n placeholder(name, required.has(name))\n ),\n ].join(\" \");\n}\n\nfunction placeholder(name: string, required: boolean): string {\n return required ? `<${name}>` : `[${name}]`;\n}\n\n/** Title, prose, then the invocation line. No heading needed above it. */\nfunction banner(options: {\n readonly title?: string;\n readonly description?: string;\n readonly usage: string;\n readonly style: CliStyle;\n}): string {\n const { style } = options;\n return [\n [\n options.title ? `${MARGIN}${style.bold(options.title)}` : undefined,\n options.description\n ? `${MARGIN}${style.dim(options.description)}`\n : undefined,\n ].filter(Boolean).join(\"\\n\"),\n `${MARGIN}${style.accent(options.usage)}`,\n ].filter(Boolean).join(\"\\n\\n\");\n}\n\nfunction hint(text: string, style: CliStyle): string {\n return `${MARGIN}${style.dim(text)}`;\n}\n\nfunction fields(command: CliCommand): Record<string, JsonSchema> {\n return (command.capability.input?.properties as\n | Record<string, JsonSchema>\n | undefined) ?? {};\n}\n\nfunction requiredFields(command: CliCommand): ReadonlySet<string> {\n return new Set(\n command.capability.input?.required as readonly string[] | undefined,\n );\n}\n\nfunction optionLabel(name: string, schema: JsonSchema): string {\n const flag = `--${kebabCase(name)}`;\n if (schema.type === \"boolean\") return flag;\n if (Array.isArray(schema.enum)) {\n return `${flag} <${schema.enum.map(String).join(\"|\")}>`;\n }\n if (schema.type === \"array\" || schema.type === \"object\") {\n return `${flag} <json>`;\n }\n return `${flag} <${String(schema.type ?? \"value\")}>`;\n}\n\n/**\n * Descriptions stay one short line: prose first, then only the facts a reader\n * cannot guess from the label (requiredness, defaults, choices).\n */\nfunction description(\n schema: JsonSchema | undefined,\n options: { readonly required?: boolean; readonly choices?: boolean } = {},\n): { description?: string } {\n const prose = typeof schema?.description === \"string\"\n ? schema.description\n : undefined;\n const notes = [\n options.choices && Array.isArray(schema?.enum)\n ? `one of ${schema.enum.map(String).join(\", \")}`\n : undefined,\n schema?.default !== undefined\n ? `default: ${String(schema.default)}`\n : undefined,\n options.required ? \"required\" : undefined,\n ].filter(Boolean);\n const text = [prose, notes.length ? `(${notes.join(\", \")})` : undefined]\n .filter(Boolean)\n .join(\" \");\n return text ? { description: text } : {};\n}\n\nfunction startsWith(\n value: readonly string[],\n prefix: readonly string[],\n): boolean {\n return prefix.every((part, index) => value[index] === part);\n}\n\nfunction kebabCase(value: string): string {\n return value.replace(/[A-Z]/g, (character) => `-${character.toLowerCase()}`);\n}\n\nfunction renderHelp(sections: readonly (string | undefined)[]): string {\n return `\\n${sections.filter(Boolean).join(\"\\n\\n\")}\\n`;\n}\n","import type {\n GroupMetaRegistry,\n CapabilityMetaRegistry,\n} from \"@capable/core\";\nimport {\n getAppRuntime,\n TransportError,\n type AnyApp,\n type JsonSchema,\n type CapabilityResult,\n} from \"@capable/app\";\nimport { render as renderMarkdown } from \"markdansi\";\nimport {\n collectCommands,\n type CliCommand,\n type CliCommandGroup,\n} from \"./commands.ts\";\nimport {\n renderCommandHelp,\n renderGroupHelp,\n renderRootHelp,\n} from \"./help.ts\";\nimport {\n createCliStyle,\n supportsColor,\n} from \"./style.ts\";\n\n/** Shared help layout, so every Capable surface prints the same shape. */\nexport {\n createCliStyle,\n descriptionColumn,\n MARGIN,\n renderRows,\n renderSection,\n ROW_INDENT,\n supportsColor,\n type CliRow,\n type CliStyle,\n} from \"./style.ts\";\n\nexport type CliCapabilityMeta =\n | false\n | {\n readonly name?: string;\n readonly command?: readonly string[];\n readonly positional?: readonly string[];\n };\n\nexport type CliGroupMeta = {\n readonly name?: string;\n};\n\ndeclare module \"@capable/core\" {\n interface CapabilityMetaRegistry {\n readonly cli?: CliCapabilityMeta;\n }\n\n interface GroupMetaRegistry {\n readonly cli?: CliGroupMeta;\n }\n}\n\nexport type CliIo = {\n readonly stdout: (text: string) => void;\n readonly stderr: (text: string) => void;\n};\n\nexport type CreateCliOptions = {\n readonly invocationName?: string;\n readonly color?: boolean;\n readonly isTTY?: boolean;\n readonly columns?: number;\n};\n\nexport function createCli(\n app: AnyApp,\n cliOptions: CreateCliOptions = {},\n): {\n run(\n argv: readonly string[],\n options?: { readonly io?: Partial<CliIo> },\n ): Promise<number>;\n} {\n return Object.freeze({\n run(argv, options = {}) {\n return runCli({\n app,\n argv,\n ...(cliOptions.invocationName\n ? { invocationName: cliOptions.invocationName }\n : {}),\n ...(cliOptions.color !== undefined ? { color: cliOptions.color } : {}),\n ...(cliOptions.isTTY !== undefined ? { isTTY: cliOptions.isTTY } : {}),\n ...(cliOptions.columns !== undefined\n ? { columns: cliOptions.columns }\n : {}),\n ...(options.io ? { io: options.io } : {}),\n });\n },\n });\n}\n\nexport async function runCli(options: {\n readonly app: AnyApp;\n readonly argv: readonly string[];\n readonly invocationName?: string;\n readonly color?: boolean;\n readonly isTTY?: boolean;\n readonly columns?: number;\n readonly io?: Partial<CliIo>;\n}): Promise<number> {\n const io: CliIo = {\n stdout: options.io?.stdout ??\n ((text) => process.stdout.write(withTrailingNewline(text))),\n stderr: options.io?.stderr ??\n ((text) => process.stderr.write(withTrailingNewline(text))),\n };\n const invocationName = options.invocationName ?? \"cap\";\n const isTTY = options.isTTY ?? Boolean(process.stdout.isTTY);\n const color = options.color ?? supportsColor(process.env, isTTY);\n const columns = options.columns ?? process.stdout.columns ?? 80;\n const style = createCliStyle(color);\n const runtime = getAppRuntime(options.app);\n let manifest;\n try {\n manifest = await runtime.manifest();\n } catch (error) {\n io.stderr(renderRuntimeError(error));\n return 1;\n }\n const catalog = collectCommands(manifest.capabilities);\n const json = options.argv.includes(\"--json\");\n const watch = options.argv.includes(\"--watch\");\n const wantsHelp = options.argv.includes(\"--help\") ||\n options.argv.includes(\"-h\");\n const argv = options.argv.filter((argument) =>\n ![\"--json\", \"--watch\", \"--help\", \"-h\"].includes(argument)\n );\n\n if (argv.length === 0) {\n io.stdout(renderRootHelp(\n manifest,\n catalog.commands,\n catalog.groups,\n invocationName,\n style,\n ));\n return 0;\n }\n\n const command = matchCommand(argv, catalog.commands);\n const group = exactGroup(argv, catalog.groups);\n if (wantsHelp) {\n if (command) {\n io.stdout(renderCommandHelp(command, invocationName, style));\n return 0;\n }\n if (group) {\n io.stdout(renderGroupHelp(\n group,\n catalog.commands,\n invocationName,\n style,\n ));\n return 0;\n }\n io.stderr(unknownCommand(argv, catalog.commands, invocationName));\n return 2;\n }\n\n if (!command) {\n if (group) {\n io.stderr(\n `Missing command after ${group.command.join(\" \")}\\n` +\n `Run \\`${invocationName} ${group.command.join(\" \")} --help\\` to list available commands.`,\n );\n return 2;\n }\n io.stderr(unknownCommand(argv, catalog.commands, invocationName));\n return 2;\n }\n\n try {\n if (watch && !command.capability.subscription) {\n throw new CliUsageError(\n `Option --watch is only available for subscribable Capabilities`,\n );\n }\n const input = parseArguments(\n argv.slice(command.command.length),\n command,\n invocationName,\n );\n if (watch) {\n return await runWatchedCommand({\n runtime,\n command,\n input,\n json,\n io,\n color,\n isTTY,\n columns,\n });\n }\n const result = await runtime.call({\n id: command.capability.id,\n input,\n });\n io.stdout(\n json\n ? JSON.stringify(result.output, null, 2)\n : renderCapabilityResult(result, {\n color,\n isTTY,\n columns,\n }),\n );\n return 0;\n } catch (error) {\n if (error instanceof CliUsageError) {\n io.stderr(error.message);\n return 2;\n }\n if (error instanceof TransportError) {\n io.stderr(renderRuntimeError(error));\n return 1;\n }\n io.stderr(error instanceof Error ? error.message : String(error));\n return 1;\n }\n}\n\nfunction withTrailingNewline(value: string): string {\n return value.endsWith(\"\\n\") ? value : `${value}\\n`;\n}\n\nasync function runWatchedCommand(options: {\n readonly runtime: ReturnType<typeof getAppRuntime>;\n readonly command: CliCommand;\n readonly input: Record<string, unknown>;\n readonly json: boolean;\n readonly io: CliIo;\n readonly color: boolean;\n readonly isTTY: boolean;\n readonly columns: number;\n}): Promise<number> {\n const controller = new AbortController();\n const abort = () => controller.abort();\n process.once(\"SIGINT\", abort);\n const stream = options.runtime.subscribe({\n id: options.command.capability.id,\n input: options.input,\n signal: controller.signal,\n });\n\n try {\n let frame = 0;\n let previousFrameLines = 0;\n for await (const result of stream) {\n if (options.json) {\n options.io.stdout(`${JSON.stringify(result.output)}\\n`);\n continue;\n }\n const presentation = renderCapabilityResult(result, options);\n options.io.stdout(formatWatchFrame(\n presentation,\n frame++,\n options.isTTY,\n previousFrameLines,\n ));\n previousFrameLines = countFrameLines(presentation);\n }\n return 0;\n } catch (error) {\n if (controller.signal.aborted || isAbortError(error)) return 0;\n throw error;\n } finally {\n process.off(\"SIGINT\", abort);\n await stream.return?.();\n }\n}\n\nfunction renderCapabilityResult(\n result: CapabilityResult,\n options: {\n readonly color: boolean;\n readonly isTTY: boolean;\n readonly columns: number;\n },\n): string {\n if (result.markdown !== undefined) {\n return options.isTTY\n ? renderMarkdown(result.markdown, {\n color: options.color,\n width: options.columns,\n })\n : result.markdown;\n }\n return typeof result.output === \"string\"\n ? result.output\n : JSON.stringify(result.output, null, 2);\n}\n\nfunction formatWatchFrame(\n value: string,\n index: number,\n isTTY: boolean,\n previousFrameLines: number,\n): string {\n const frame = value.endsWith(\"\\n\") ? value : `${value}\\n`;\n if (isTTY) {\n return index === 0\n ? frame\n : `\\u001B[${previousFrameLines}A\\r\\u001B[0J${frame}`;\n }\n return index === 0 ? frame : `\\n---\\n\\n${frame}`;\n}\n\nfunction countFrameLines(value: string): number {\n const frame = value.endsWith(\"\\n\") ? value : `${value}\\n`;\n return frame.split(\"\\n\").length - 1;\n}\n\nfunction isAbortError(error: unknown): boolean {\n return error instanceof DOMException && error.name === \"AbortError\";\n}\n\nfunction parseArguments(\n argv: readonly string[],\n command: CliCommand,\n invocationName: string,\n): Record<string, unknown> {\n const capability = command.capability;\n const positional = command.meta.positional ?? [];\n const commandName = `${invocationName} ${command.command.join(\" \")}`;\n const schema = capability.input;\n const properties = schema?.properties as\n | Record<string, JsonSchema>\n | undefined;\n const input: Record<string, unknown> = {};\n let position = 0;\n\n for (let index = 0; index < argv.length; index++) {\n const token = argv[index]!;\n if (token.startsWith(\"--\")) {\n const [rawName, inline] = token.slice(2).split(\"=\", 2);\n const name = camelCase(rawName!);\n const field = properties?.[name];\n if (!field || positional.includes(name)) {\n const suggestion = nearest(\n rawName!,\n Object.keys(properties ?? {})\n .filter((candidate) => !positional.includes(candidate))\n .map(kebabCase),\n );\n throw new CliUsageError([\n `Unknown option --${rawName}`,\n ...(suggestion ? [`Did you mean \\`--${suggestion}\\`?`] : []),\n `Run \\`${commandName} --help\\` to inspect accepted input.`,\n ].join(\"\\n\"));\n }\n const boolean = field.type === \"boolean\";\n const raw = inline ?? (boolean ? \"true\" : argv[++index]);\n if (raw === undefined) {\n throw new CliUsageError(\n `Option --${rawName} requires a value\\n` +\n `Run \\`${commandName} --help\\` to inspect accepted input.`,\n );\n }\n input[name] = coerce(raw, field, `--${rawName}`, commandName);\n continue;\n }\n const name = positional[position++];\n if (!name) {\n throw new CliUsageError(\n `Unexpected argument \"${token}\"\\n` +\n `Run \\`${commandName} --help\\` to inspect accepted input.`,\n );\n }\n const field = properties?.[name];\n if (!field) {\n throw new CliUsageError(\n `CLI positional field \"${name}\" is not present in the input schema`,\n );\n }\n input[name] = coerce(token, field, `<${name}>`, commandName);\n }\n\n const required = schema?.required as readonly string[] | undefined;\n for (const name of required ?? []) {\n if (!(name in input)) {\n const label = positional.includes(name)\n ? `positional argument <${name}>`\n : `required option --${kebabCase(name)}`;\n throw new CliUsageError(\n `Missing ${label}\\n` +\n `Run \\`${commandName} --help\\` to inspect accepted input.`,\n );\n }\n }\n return input;\n}\n\nfunction coerce(\n value: string,\n schema: JsonSchema,\n label: string,\n commandName: string,\n): unknown {\n if (schema.type === \"boolean\") return value !== \"false\";\n if (schema.type === \"integer\" || schema.type === \"number\") {\n const number = Number(value);\n if (!Number.isFinite(number)) {\n throw new CliUsageError(\n `Expected a number for ${label}, received \"${value}\"\\n` +\n `Run \\`${commandName} --help\\` to inspect accepted input.`,\n );\n }\n return number;\n }\n return value;\n}\n\nclass CliUsageError extends Error {}\n\nfunction renderRuntimeError(error: unknown): string {\n return error instanceof TransportError\n ? `${error.code}: ${error.message}`\n : error instanceof Error\n ? error.message\n : String(error);\n}\n\nfunction matchCommand(\n argv: readonly string[],\n commands: readonly CliCommand[],\n): CliCommand | undefined {\n return commands\n .filter((candidate) =>\n candidate.command.every((token, index) => argv[index] === token)\n )\n .sort((left, right) => right.command.length - left.command.length)[0];\n}\n\nfunction exactGroup(\n argv: readonly string[],\n groups: readonly CliCommandGroup[],\n): CliCommandGroup | undefined {\n return groups.find((group) =>\n group.command.length === argv.length &&\n group.command.every((token, index) => argv[index] === token)\n );\n}\n\nfunction unknownCommand(\n argv: readonly string[],\n commands: readonly CliCommand[],\n invocationName: string,\n): string {\n const entered = argv.join(\" \");\n const suggestion = nearest(\n entered,\n commands.map((command) => command.command.join(\" \")),\n );\n return [\n `Unknown command: ${entered}`,\n ...(suggestion ? [`Did you mean \\`${suggestion}\\`?`] : []),\n `Run \\`${invocationName} --help\\` to list available commands.`,\n ].join(\"\\n\");\n}\n\nfunction nearest(\n value: string,\n candidates: readonly string[],\n): string | undefined {\n let match: { readonly candidate: string; readonly distance: number } | undefined;\n for (const candidate of new Set(candidates)) {\n const distance = editDistance(value, candidate);\n if (!match || distance < match.distance) {\n match = { candidate, distance };\n }\n }\n if (!match) return undefined;\n return match.distance <= Math.max(2, Math.floor(match.candidate.length / 3))\n ? match.candidate\n : undefined;\n}\n\nfunction editDistance(left: string, right: string): number {\n const previous = Array.from(\n { length: right.length + 1 },\n (_, index) => index,\n );\n for (let leftIndex = 1; leftIndex <= left.length; leftIndex++) {\n const current = [leftIndex];\n for (let rightIndex = 1; rightIndex <= right.length; rightIndex++) {\n current[rightIndex] = Math.min(\n current[rightIndex - 1]! + 1,\n previous[rightIndex]! + 1,\n previous[rightIndex - 1]! +\n (left[leftIndex - 1] === right[rightIndex - 1] ? 0 : 1),\n );\n }\n previous.splice(0, previous.length, ...current);\n }\n return previous[right.length]!;\n}\n\nfunction camelCase(value: string): string {\n return value.replace(/-([a-z])/g, (_, character: string) =>\n character.toUpperCase()\n );\n}\n\nfunction kebabCase(value: string): string {\n return value.replace(/[A-Z]/g, (character) => `-${character.toLowerCase()}`);\n}\n"],"mappings":";;;AA2BA,SAAgB,gBACd,OACA,SA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a,MACnB,KAAK,YAAY,OAAO,MAAM,aAAa,KAAK,IAAI,EACzD;EAEF,SAAS,OAAO,GAAG,SAAS,QAAQ,GAAG,OAAO;CAChD;CACA,OAAO,SAAS,MAAM;AACxB;AAEA,SAAS,UAAU,OAAuB;CACxC,OAAO,MAAM,QAAQ,cAAc,GAAG,cACpC,UAAU,YAAY,CACxB;AACF;AAEA,SAAS,UAAU,OAAuB;CACxC,OAAO,MAAM,QAAQ,WAAW,cAAc,IAAI,UAAU,YAAY,GAAG;AAC7E"}
@@ -0,0 +1,82 @@
1
+ import { n as selectApp, o as createApp } from "./src-3UaBqI8H.mjs";
2
+ import { r as createProtocolHandler, t as createHttpHandler } from "./src-XRJ9hgYX.mjs";
3
+ //#region packages/server/src/index.ts
4
+ function standard(options = {}) {
5
+ return {
6
+ kind: "capable.server.mount",
7
+ compile(app, context) {
8
+ const protocol = createProtocolHandler((request) => {
9
+ const executable = createApp(app, context ? { context: () => context({ request }) } : void 0);
10
+ return options.selection ? selectApp(executable, options.selection) : executable;
11
+ }, { ...options.path ? { basePath: options.path } : {} });
12
+ const base = normalizePath(options.path ?? "/_capable");
13
+ return {
14
+ name: "standard",
15
+ async fetch(request) {
16
+ if (!new URL(request.url).pathname.startsWith(`${base}/`)) return;
17
+ return protocol.fetch(request);
18
+ }
19
+ };
20
+ }
21
+ };
22
+ }
23
+ function http(options = {}) {
24
+ return {
25
+ kind: "capable.server.mount",
26
+ compile(app, context) {
27
+ const handler = createHttpHandler(app, {
28
+ ...context ? { context } : {},
29
+ ...options.path ? { basePath: options.path } : {},
30
+ ...options.openapiPath !== void 0 ? { openapiPath: options.openapiPath } : {},
31
+ ...options.requireExplicitRoutes !== void 0 ? { requireExplicitRoutes: options.requireExplicitRoutes } : {},
32
+ ...options.selection ? { selection: options.selection } : {}
33
+ });
34
+ const base = normalizePath(options.path ?? "/api");
35
+ const openapiPath = options.openapiPath === false ? void 0 : normalizePath(options.openapiPath ?? "/openapi.json");
36
+ return {
37
+ name: "http",
38
+ async fetch(request) {
39
+ const pathname = new URL(request.url).pathname;
40
+ if (!pathname.startsWith(`${base}/`) && pathname !== base && pathname !== openapiPath) return;
41
+ return handler.fetch(request);
42
+ }
43
+ };
44
+ }
45
+ };
46
+ }
47
+ function createServer(app, ...[providedOptions]) {
48
+ const options = providedOptions ?? {};
49
+ const mounts = (options.mounts ?? [standard(), http()]).map((mount) => mount.compile(app, options.context));
50
+ async function dispatch(request) {
51
+ for (const mount of mounts) {
52
+ const response = await mount.fetch(request);
53
+ if (response) return response;
54
+ }
55
+ return new Response("Not Found", { status: 404 });
56
+ }
57
+ return Object.freeze({ async fetch(request) {
58
+ try {
59
+ return options.middleware ? await options.middleware({
60
+ request,
61
+ next: (nextRequest = request) => dispatch(nextRequest)
62
+ }) : await dispatch(request);
63
+ } catch (error) {
64
+ options.onError?.(error);
65
+ return Response.json({
66
+ ok: false,
67
+ error: {
68
+ code: "INTERNAL_SERVER_ERROR",
69
+ message: "Internal Server Error",
70
+ status: 500
71
+ }
72
+ }, { status: 500 });
73
+ }
74
+ } });
75
+ }
76
+ function normalizePath(value) {
77
+ return `/${value.split("/").filter(Boolean).join("/")}`;
78
+ }
79
+ //#endregion
80
+ export { http as n, standard as r, createServer as t };
81
+
82
+ //# sourceMappingURL=src-DpSA-hBO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-DpSA-hBO.mjs","names":[],"sources":["../../server/src/index.ts"],"sourcesContent":["import type {\n AppDefinition,\n MaybePromise,\n} from \"@capable/core\";\nimport {\n createHttpHandler,\n createProtocolHandler,\n type ContextProvider,\n type CapabilitySelection,\n} from \"@capable/fetch\";\nimport {\n createApp,\n selectApp,\n type ApplicationSelection,\n} from \"@capable/app\";\n\nexport type ServerMount<TContext> = {\n readonly kind: \"capable.server.mount\";\n compile(\n app: AppDefinition<any, TContext>,\n context: ContextProvider<TContext> | undefined,\n ): CompiledServerMount;\n};\n\nexport type CompiledServerMount = {\n readonly name: string;\n readonly fetch: (request: Request) => MaybePromise<Response | undefined>;\n};\n\nexport function standard<TContext = any>(\n options: {\n readonly path?: string;\n readonly selection?: ApplicationSelection;\n } = {},\n): ServerMount<TContext> {\n return {\n kind: \"capable.server.mount\",\n compile(app, context) {\n const protocol = createProtocolHandler(\n (request) => {\n const executable = createApp(\n app,\n context\n ? { context: () => context({ request }) }\n : undefined as never,\n );\n return options.selection\n ? selectApp(executable, options.selection)\n : executable;\n },\n {\n ...(options.path ? { basePath: options.path } : {}),\n },\n );\n const base = normalizePath(options.path ?? \"/_capable\");\n return {\n name: \"standard\",\n async fetch(request) {\n if (!new URL(request.url).pathname.startsWith(`${base}/`)) {\n return undefined;\n }\n return protocol.fetch(request);\n },\n };\n },\n };\n}\n\nexport function http<TContext = any>(\n options: {\n readonly path?: string;\n readonly openapiPath?: string | false;\n readonly requireExplicitRoutes?: boolean;\n readonly selection?: CapabilitySelection;\n } = {},\n): ServerMount<TContext> {\n return {\n kind: \"capable.server.mount\",\n compile(app, context) {\n const handler = createHttpHandler(app, {\n ...(context ? { context } : {}),\n ...(options.path ? { basePath: options.path } : {}),\n ...(options.openapiPath !== undefined\n ? { openapiPath: options.openapiPath }\n : {}),\n ...(options.requireExplicitRoutes !== undefined\n ? { requireExplicitRoutes: options.requireExplicitRoutes }\n : {}),\n ...(options.selection ? { selection: options.selection } : {}),\n });\n const base = normalizePath(options.path ?? \"/api\");\n const openapiPath = options.openapiPath === false\n ? undefined\n : normalizePath(options.openapiPath ?? \"/openapi.json\");\n return {\n name: \"http\",\n async fetch(request) {\n const pathname = new URL(request.url).pathname;\n if (\n !pathname.startsWith(`${base}/`) &&\n pathname !== base &&\n pathname !== openapiPath\n ) {\n return undefined;\n }\n return handler.fetch(request);\n },\n };\n },\n };\n}\n\nexport type CapableServer = {\n readonly fetch: (request: Request) => Promise<Response>;\n};\n\nexport type ServerMiddleware = (args: {\n readonly request: Request;\n readonly next: (request?: Request) => Promise<Response>;\n}) => MaybePromise<Response>;\n\ntype CreateServerOptions<TContext> = {\n readonly context?: ContextProvider<TContext>;\n readonly mounts?: readonly ServerMount<TContext>[];\n readonly middleware?: ServerMiddleware;\n readonly onError?: (error: unknown) => void;\n};\n\ntype CreateServerArgs<TContext> = [TContext] extends [undefined]\n ? [options?: CreateServerOptions<TContext>]\n : [options: CreateServerOptions<TContext> & {\n readonly context: ContextProvider<TContext>;\n }];\n\nexport function createServer<TContext>(\n app: AppDefinition<any, TContext>,\n ...[providedOptions]: CreateServerArgs<TContext>\n): CapableServer {\n const options = (providedOptions ?? {}) as CreateServerOptions<TContext>;\n const mounts = (options.mounts ?? [standard(), http()])\n .map((mount) => mount.compile(app, options.context));\n\n async function dispatch(request: Request): Promise<Response> {\n for (const mount of mounts) {\n const response = await mount.fetch(request);\n if (response) return response;\n }\n return new Response(\"Not Found\", { status: 404 });\n }\n\n return Object.freeze({\n async fetch(request: Request) {\n try {\n return options.middleware\n ? await options.middleware({\n request,\n next: (nextRequest = request) => dispatch(nextRequest),\n })\n : await dispatch(request);\n } catch (error) {\n options.onError?.(error);\n return Response.json({\n ok: false,\n error: {\n code: \"INTERNAL_SERVER_ERROR\",\n message: \"Internal Server Error\",\n status: 500,\n },\n }, { status: 500 });\n }\n },\n });\n}\n\nfunction normalizePath(value: string): string {\n return `/${value.split(\"/\").filter(Boolean).join(\"/\")}`;\n}\n"],"mappings":";;;AA6BA,SAAgB,SACd,UAGI,CAAC,GACkB;CACvB,OAAO;EACL,MAAM;EACN,QAAQ,KAAK,SAAS;GACpB,MAAM,WAAW,uBACd,YAAY;IACX,MAAM,aAAa,UACjB,KACA,UACI,EAAE,eAAe,QAAQ,EAAE,QAAQ,CAAC,EAAE,IACtC,KAAA,CACN;IACA,OAAO,QAAQ,YACX,UAAU,YAAY,QAAQ,SAAS,IACvC;GACN,GACA,EACE,GAAI,QAAQ,OAAO,EAAE,UAAU,QAAQ,KAAK,IAAI,CAAC,EACnD,CACF;GACA,MAAM,OAAO,cAAc,QAAQ,QAAQ,WAAW;GACtD,OAAO;I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SAAS,QAAQ;GAC1B,MAAM,WAAW,MAAM,MAAM,MAAM,OAAO;GAC1C,IAAI,UAAU,OAAO;EACvB;EACA,OAAO,IAAI,SAAS,aAAa,EAAE,QAAQ,IAAI,CAAC;CAClD;CAEA,OAAO,OAAO,OAAO,EACnB,MAAM,MAAM,SAAkB;EAC5B,IAAI;GACF,OAAO,QAAQ,aACX,MAAM,QAAQ,WAAW;IACzB;IACA,OAAO,cAAc,YAAY,SAAS,WAAW;GACvD,CAAC,IACC,MAAM,SAAS,OAAO;EAC5B,SAAS,OAAO;GACd,QAAQ,UAAU,KAAK;GACvB,OAAO,SAAS,KAAK;IACnB,IAAI;IACJ,OAAO;KACL,MAAM;KACN,SAAS;KACT,QAAQ;IACV;GACF,GAAG,EAAE,QAAQ,IAAI,CAAC;EACpB;CACF,EACF,CAAC;AACH;AAEA,SAAS,cAAc,OAAuB;CAC5C,OAAO,IAAI,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACtD"}
@@ -1,5 +1,5 @@
1
- import { h as schemaToJsonSchema, l as executeLocatedCapability, v as CapableError } from "./src-DX-_J6l2.mjs";
2
- import { a as TransportError, c as getAppRuntime, l as isApp } from "./src-CT4fbWqb.mjs";
1
+ import { h as schemaToJsonSchema, l as executeLocatedCapability, v as CapableError } from "./src-B53ZbNtC.mjs";
2
+ import { a as TransportError, c as getAppRuntime, l as isApp } from "./src-3UaBqI8H.mjs";
3
3
  //#region packages/fetch/src/error-response.ts
4
4
  function capabilityErrorData(error, fallbackStatus = 500) {
5
5
  const capable = error instanceof CapableError || error instanceof TransportError ? error : new CapableError("INTERNAL_SERVER_ERROR", { cause: error });
@@ -314,7 +314,7 @@ function httpSuccessStatus(entry) {
314
314
  }
315
315
  async function readHttpInput(request, params, schema) {
316
316
  const url = new URL(request.url);
317
- const properties = (schema ? schemaToJsonSchema(schema) : void 0)?.properties;
317
+ const properties = (schema ? schemaToJsonSchema(schema, "input") : void 0)?.properties;
318
318
  const coerceEntries = (entries) => Object.fromEntries([...entries].map(([key, value]) => [key, coerceHttpValue(value, properties?.[key])]));
319
319
  return {
320
320
  ...request.method === "GET" ? coerceEntries(url.searchParams) : request.headers.get("content-type")?.includes("application/json") ? await request.json() : {},
@@ -332,7 +332,7 @@ function coerceHttpValue(value, schema) {
332
332
  function assertPathParameters(entry, path) {
333
333
  const parameters = [...path.matchAll(/:([^/]+)/g)].map((match) => match[1]);
334
334
  if (parameters.length === 0) return;
335
- const properties = (entry.capability.input ? schemaToJsonSchema(entry.capability.input) : void 0)?.properties;
335
+ const properties = (entry.capability.input ? schemaToJsonSchema(entry.capability.input, "input") : void 0)?.properties;
336
336
  for (const parameter of parameters) if (!properties?.[parameter]) throw new Error(`HTTP path parameter ":${parameter}" is not present in Capability "${entry.capability.id}" input`);
337
337
  }
338
338
  function matchPath(pattern, pathname) {
@@ -354,7 +354,7 @@ function createOpenApi(app, routes) {
354
354
  const method = route.method.toLowerCase();
355
355
  const path = route.path.replace(/:([^/]+)/g, "{$1}");
356
356
  const capability = route.capability.capability;
357
- const input = capability.input ? schemaToJsonSchema(capability.input) : void 0;
357
+ const input = capability.input ? schemaToJsonSchema(capability.input, "input") : void 0;
358
358
  const properties = input?.properties ?? {};
359
359
  const required = new Set(input?.required ?? []);
360
360
  const pathNames = new Set([...route.path.matchAll(/:([^/]+)/g)].map((match) => match[1]));
@@ -373,7 +373,7 @@ function createOpenApi(app, routes) {
373
373
  })));
374
374
  const responses = { [String(httpSuccessStatus(route.capability))]: {
375
375
  description: "Successful response",
376
- content: { "application/json": { schema: capability.output ? schemaToJsonSchema(capability.output) : {} } }
376
+ content: { "application/json": { schema: capability.output ? schemaToJsonSchema(capability.output, "output") : {} } }
377
377
  } };
378
378
  for (const [code, error] of Object.entries(route.capability.errors)) {
379
379
  const status = typeof error.status === "number" ? String(error.status) : "default";
@@ -438,4 +438,4 @@ function joinPath(...parts) {
438
438
  //#endregion
439
439
  export { createHttpTransport as n, createProtocolHandler as r, createHttpHandler as t };
440
440
 
441
- //# sourceMappingURL=src-DlSJtEhv.mjs.map
441
+ //# sourceMappingURL=src-XRJ9hgYX.mjs.map