fascicle 0.12.11 → 0.12.12

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.
@@ -0,0 +1,239 @@
1
+ import { D as is_step, E as describe } from "./core-BVCVUMmH.js";
2
+ import { createRequire } from "node:module";
3
+ import { resolve } from "node:path";
4
+ import { fileURLToPath, pathToFileURL } from "node:url";
5
+ import { parseArgs } from "node:util";
6
+ //#region src/diagram_cli.ts
7
+ /**
8
+ * fascicle-diagram CLI.
9
+ *
10
+ * fascicle-diagram <module> print the diagram of the module's `flow`
11
+ * fascicle-diagram <module> --export <name> read another export instead
12
+ *
13
+ * Flags: --export <name> --width <n> --prefix <text> --help
14
+ *
15
+ * The export is a Step, or a function that builds one with no arguments,
16
+ * which is where an app wires its flow to stub dependencies so that drawing
17
+ * it needs no credentials. The diagram is `describe.diagram` of that Step, so
18
+ * it is what the code builds today and can be compared with the header in
19
+ * `flow.ts` at a glance.
20
+ *
21
+ * This file holds every decision the command makes and touches nothing of
22
+ * the process: output and module loading arrive through `DiagramCliIo`.
23
+ * diagram_bin.ts binds that io to the real streams and to the project's
24
+ * `tsx`, and is the entry that the package's bin shim runs.
25
+ */
26
+ const HELP = `\
27
+ fascicle-diagram prints a flow as an annotated box-drawing tree.
28
+
29
+ Usage:
30
+ fascicle-diagram <module> draw the module's \`flow\` export
31
+ fascicle-diagram <module> --export <name> draw another export instead
32
+
33
+ The export is a Step, or a function that builds one with no arguments.
34
+
35
+ Options:
36
+ --export <name> the export to draw (default flow)
37
+ --width <n> wrap descriptions so no line runs wider than n
38
+ --prefix <text> start every line with text, for example ' * '
39
+ --help show this message
40
+ `;
41
+ /**
42
+ * Run the CLI over `argv` and resolve to its exit code: 0 once the diagram is
43
+ * printed, 1 when the module cannot be loaded or holds no Step, and 2 for a
44
+ * usage error. Output and loading go through `io`, so the caller owns the
45
+ * process.
46
+ */
47
+ async function run_diagram_cli(argv, io) {
48
+ const parsed = parse(argv);
49
+ if (parsed.kind === "help") {
50
+ io.out(HELP);
51
+ return 0;
52
+ }
53
+ if (parsed.kind === "usage") {
54
+ io.err(`fascicle-diagram: ${parsed.message}\n\n${HELP}`);
55
+ return 2;
56
+ }
57
+ const { module, export_name, options } = parsed.args;
58
+ const path = resolve(module);
59
+ let exports;
60
+ try {
61
+ exports = await io.load(path);
62
+ } catch (err) {
63
+ io.err(`fascicle-diagram: could not load ${module}: ${message_of(err)}\n`);
64
+ return 1;
65
+ }
66
+ if (!(export_name in exports)) {
67
+ const names = Object.keys(exports).join(", ") || "nothing";
68
+ io.err(`fascicle-diagram: ${module} has no export named ${export_name}: pass --export <name> (it exports ${names})\n`);
69
+ return 1;
70
+ }
71
+ let flow;
72
+ try {
73
+ flow = await build(exports[export_name]);
74
+ } catch (err) {
75
+ io.err(`fascicle-diagram: calling ${export_name}() in ${module} threw: ${message_of(err)}\nExport a function that builds the flow with no arguments, wired to stub dependencies.
76
+ `);
77
+ return 1;
78
+ }
79
+ if (!is_step(flow)) {
80
+ io.err(`fascicle-diagram: ${export_name} in ${module} is not a Step: export the flow itself, or a function that builds it with no arguments\n`);
81
+ return 1;
82
+ }
83
+ io.out(`${describe.diagram(flow, options)}\n`);
84
+ return 0;
85
+ }
86
+ /**
87
+ * Parse argv into a run request, a help request, or a usage error. Unknown
88
+ * flags and a missing module are usage errors, and so is a width that is not
89
+ * a positive integer.
90
+ */
91
+ function parse(argv) {
92
+ let parsed;
93
+ try {
94
+ parsed = parse_flags(argv);
95
+ } catch (err) {
96
+ return {
97
+ kind: "usage",
98
+ message: message_of(err)
99
+ };
100
+ }
101
+ const { values, positionals } = parsed;
102
+ if (values.help === true) return { kind: "help" };
103
+ const [module, ...extra] = positionals;
104
+ if (module === void 0) return {
105
+ kind: "usage",
106
+ message: "a <module> to draw is required"
107
+ };
108
+ if (extra.length > 0) return {
109
+ kind: "usage",
110
+ message: `expected one <module>, got ${positionals.join(" ")}`
111
+ };
112
+ const options = {};
113
+ if (values.width !== void 0) {
114
+ const width = Number(values.width);
115
+ if (!Number.isInteger(width) || width <= 0) return {
116
+ kind: "usage",
117
+ message: `invalid --width '${values.width}': expected a positive integer`
118
+ };
119
+ options.width = width;
120
+ }
121
+ if (values.prefix !== void 0) options.prefix = values.prefix;
122
+ return {
123
+ kind: "run",
124
+ args: {
125
+ module,
126
+ export_name: values.export ?? "flow",
127
+ options
128
+ }
129
+ };
130
+ }
131
+ /**
132
+ * Read the CLI's flags with `node:util`'s strict parser, which throws on a
133
+ * flag it does not know.
134
+ */
135
+ function parse_flags(argv) {
136
+ return parseArgs({
137
+ args: [...argv],
138
+ allowPositionals: true,
139
+ options: {
140
+ export: { type: "string" },
141
+ width: { type: "string" },
142
+ prefix: { type: "string" },
143
+ help: { type: "boolean" }
144
+ }
145
+ });
146
+ }
147
+ /**
148
+ * The Step an export stands for: the export itself, or what calling it with
149
+ * no arguments returns (awaited, so an async builder works too).
150
+ */
151
+ async function build(value) {
152
+ return typeof value === "function" ? await value() : value;
153
+ }
154
+ /**
155
+ * Render a thrown value as its message.
156
+ */
157
+ function message_of(err) {
158
+ return err instanceof Error ? err.message : String(err);
159
+ }
160
+ //#endregion
161
+ //#region src/diagram_bin.ts
162
+ /**
163
+ * The process side of the fascicle-diagram bin: the real streams, and module
164
+ * loading through the project's own `tsx`.
165
+ *
166
+ * Every decision the command makes lives in diagram_cli.ts, which is unit
167
+ * tested through an injected io. This file only binds that io to the process,
168
+ * so it is exercised by spawning it (__tests__/diagram_bin.test.ts) and kept
169
+ * out of mutation testing, which cannot see a spawned child's coverage.
170
+ *
171
+ * A TypeScript module loads through `tsx` because Node's built-in type
172
+ * stripping cannot follow the `./flow.js` specifiers that point at `.ts`
173
+ * files under NodeNext resolution. Anything else, or a project without
174
+ * `tsx`, goes through a plain `import()`.
175
+ */
176
+ const TS_MODULE = /\.[cm]?tsx?$/;
177
+ /**
178
+ * Run the fascicle-diagram command over `argv` against the real process, and
179
+ * leave its exit code on `process.exitCode`. A reader that closes the pipe
180
+ * early (`| head`) ends the output quietly instead of crashing the command on
181
+ * an unhandled EPIPE.
182
+ */
183
+ async function run_diagram_bin(argv) {
184
+ process.stdout.once("error", (err) => {
185
+ if (err.code !== "EPIPE") throw err;
186
+ });
187
+ process.exitCode = await run_diagram_cli(argv, {
188
+ out: (text) => process.stdout.write(text),
189
+ err: (text) => process.stderr.write(text),
190
+ load: load_module
191
+ });
192
+ }
193
+ /**
194
+ * Import the module at `path`. A TypeScript module goes through the `tsx`
195
+ * that the project installs, looked up from the module's own directory and
196
+ * then from the working directory. Everything else is a plain dynamic import.
197
+ */
198
+ async function load_module(path) {
199
+ const url = pathToFileURL(path).href;
200
+ if (!TS_MODULE.test(path)) return as_record(await import(url));
201
+ const tsx = find_tsx([path, resolve("package.json")]);
202
+ if (tsx === void 0) return import_without_tsx(url);
203
+ const ts_import = as_record(await import(pathToFileURL(tsx).href))["tsImport"];
204
+ if (typeof ts_import !== "function") return as_record(await import(url));
205
+ return as_record(await ts_import(url, import.meta.url));
206
+ }
207
+ /**
208
+ * Import a TypeScript module with Node's own type stripping, which handles
209
+ * only erasable syntax and specifiers that name real files. A failure says
210
+ * that tsx is the fix, since this path is taken only when none was found.
211
+ */
212
+ async function import_without_tsx(url) {
213
+ try {
214
+ return as_record(await import(url));
215
+ } catch (err) {
216
+ const reason = err instanceof Error ? err.message : String(err);
217
+ throw new Error(`${reason} (no tsx was found to load TypeScript: install it with pnpm add -D tsx)`, { cause: err });
218
+ }
219
+ }
220
+ /**
221
+ * Resolve tsx's programmatic API from the first of `origins` that can see it,
222
+ * or `undefined` when none can.
223
+ */
224
+ function find_tsx(origins) {
225
+ for (const origin of origins) try {
226
+ return createRequire(origin).resolve("tsx/esm/api");
227
+ } catch {}
228
+ }
229
+ /**
230
+ * View a loaded module namespace as a record of its exports.
231
+ */
232
+ function as_record(value) {
233
+ return typeof value === "object" && value !== null ? { ...value } : {};
234
+ }
235
+ if (process.argv[1] !== void 0 && process.argv[1] === fileURLToPath(import.meta.url)) run_diagram_bin(process.argv.slice(2));
236
+ //#endregion
237
+ export { run_diagram_bin };
238
+
239
+ //# sourceMappingURL=diagram_bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagram_bin.js","names":[],"sources":["../src/diagram_cli.ts","../src/diagram_bin.ts"],"sourcesContent":["/**\n * fascicle-diagram CLI.\n *\n * fascicle-diagram <module> print the diagram of the module's `flow`\n * fascicle-diagram <module> --export <name> read another export instead\n *\n * Flags: --export <name> --width <n> --prefix <text> --help\n *\n * The export is a Step, or a function that builds one with no arguments,\n * which is where an app wires its flow to stub dependencies so that drawing\n * it needs no credentials. The diagram is `describe.diagram` of that Step, so\n * it is what the code builds today and can be compared with the header in\n * `flow.ts` at a glance.\n *\n * This file holds every decision the command makes and touches nothing of\n * the process: output and module loading arrive through `DiagramCliIo`.\n * diagram_bin.ts binds that io to the real streams and to the project's\n * `tsx`, and is the entry that the package's bin shim runs.\n */\n\nimport { resolve } from 'node:path'\nimport { parseArgs } from 'node:util'\nimport { describe, is_step } from '#core'\nimport type { DiagramOptions } from '#core'\n\nexport type DiagramCliIo = {\n readonly out: (text: string) => void\n readonly err: (text: string) => void\n /** Import the module at an absolute path and return its exports. */\n readonly load: (path: string) => Promise<Readonly<Record<string, unknown>>>\n}\n\ntype CliArgs = {\n readonly module: string\n readonly export_name: string\n readonly options: DiagramOptions\n}\n\ntype Parsed =\n | { readonly kind: 'help' }\n | { readonly kind: 'usage'; readonly message: string }\n | { readonly kind: 'run'; readonly args: CliArgs }\n\nconst HELP = `\\\nfascicle-diagram prints a flow as an annotated box-drawing tree.\n\nUsage:\n fascicle-diagram <module> draw the module's \\`flow\\` export\n fascicle-diagram <module> --export <name> draw another export instead\n\nThe export is a Step, or a function that builds one with no arguments.\n\nOptions:\n --export <name> the export to draw (default flow)\n --width <n> wrap descriptions so no line runs wider than n\n --prefix <text> start every line with text, for example ' * '\n --help show this message\n`\n\n\n/**\n * Run the CLI over `argv` and resolve to its exit code: 0 once the diagram is\n * printed, 1 when the module cannot be loaded or holds no Step, and 2 for a\n * usage error. Output and loading go through `io`, so the caller owns the\n * process.\n */\nexport async function run_diagram_cli(argv: readonly string[], io: DiagramCliIo): Promise<number> {\n const parsed = parse(argv)\n if (parsed.kind === 'help') {\n io.out(HELP)\n return 0\n }\n if (parsed.kind === 'usage') {\n io.err(`fascicle-diagram: ${parsed.message}\\n\\n${HELP}`)\n return 2\n }\n const { module, export_name, options } = parsed.args\n const path = resolve(module)\n let exports: Readonly<Record<string, unknown>>\n try {\n exports = await io.load(path)\n } catch (err) {\n io.err(`fascicle-diagram: could not load ${module}: ${message_of(err)}\\n`)\n return 1\n }\n if (!(export_name in exports)) {\n const names = Object.keys(exports).join(', ') || 'nothing'\n io.err(\n `fascicle-diagram: ${module} has no export named ${export_name}: pass --export <name> (it exports ${names})\\n`,\n )\n return 1\n }\n let flow: unknown\n try {\n flow = await build(exports[export_name])\n } catch (err) {\n io.err(\n `fascicle-diagram: calling ${export_name}() in ${module} threw: ${message_of(err)}\\n` +\n 'Export a function that builds the flow with no arguments, wired to stub dependencies.\\n',\n )\n return 1\n }\n if (!is_step(flow)) {\n io.err(\n `fascicle-diagram: ${export_name} in ${module} is not a Step: export the flow itself, or a function that builds it with no arguments\\n`,\n )\n return 1\n }\n io.out(`${describe.diagram(flow, options)}\\n`)\n return 0\n}\n\n/**\n * Parse argv into a run request, a help request, or a usage error. Unknown\n * flags and a missing module are usage errors, and so is a width that is not\n * a positive integer.\n */\nfunction parse(argv: readonly string[]): Parsed {\n let parsed: ReturnType<typeof parse_flags>\n try {\n parsed = parse_flags(argv)\n } catch (err) {\n return { kind: 'usage', message: message_of(err) }\n }\n const { values, positionals } = parsed\n if (values.help === true) return { kind: 'help' }\n const [module, ...extra] = positionals\n if (module === undefined) return { kind: 'usage', message: 'a <module> to draw is required' }\n if (extra.length > 0) return { kind: 'usage', message: `expected one <module>, got ${positionals.join(' ')}` }\n const options: { width?: number; prefix?: string } = {}\n if (values.width !== undefined) {\n const width = Number(values.width)\n if (!Number.isInteger(width) || width <= 0) {\n return { kind: 'usage', message: `invalid --width '${values.width}': expected a positive integer` }\n }\n options.width = width\n }\n if (values.prefix !== undefined) options.prefix = values.prefix\n return { kind: 'run', args: { module, export_name: values.export ?? 'flow', options } }\n}\n\n/**\n * Read the CLI's flags with `node:util`'s strict parser, which throws on a\n * flag it does not know.\n */\nfunction parse_flags(argv: readonly string[]) {\n return parseArgs({\n args: [...argv],\n allowPositionals: true,\n options: {\n export: { type: 'string' },\n width: { type: 'string' },\n prefix: { type: 'string' },\n help: { type: 'boolean' },\n },\n })\n}\n\n/**\n * The Step an export stands for: the export itself, or what calling it with\n * no arguments returns (awaited, so an async builder works too).\n */\nasync function build(value: unknown): Promise<unknown> {\n return typeof value === 'function' ? await value() : value\n}\n\n/**\n * Render a thrown value as its message.\n */\nfunction message_of(err: unknown): string {\n return err instanceof Error ? err.message : String(err)\n}\n","/**\n * The process side of the fascicle-diagram bin: the real streams, and module\n * loading through the project's own `tsx`.\n *\n * Every decision the command makes lives in diagram_cli.ts, which is unit\n * tested through an injected io. This file only binds that io to the process,\n * so it is exercised by spawning it (__tests__/diagram_bin.test.ts) and kept\n * out of mutation testing, which cannot see a spawned child's coverage.\n *\n * A TypeScript module loads through `tsx` because Node's built-in type\n * stripping cannot follow the `./flow.js` specifiers that point at `.ts`\n * files under NodeNext resolution. Anything else, or a project without\n * `tsx`, goes through a plain `import()`.\n */\n\nimport { createRequire } from 'node:module'\nimport { resolve } from 'node:path'\nimport { fileURLToPath, pathToFileURL } from 'node:url'\nimport { run_diagram_cli } from './diagram_cli.js'\n\nconst TS_MODULE = /\\.[cm]?tsx?$/\n\n/**\n * Run the fascicle-diagram command over `argv` against the real process, and\n * leave its exit code on `process.exitCode`. A reader that closes the pipe\n * early (`| head`) ends the output quietly instead of crashing the command on\n * an unhandled EPIPE.\n */\nexport async function run_diagram_bin(argv: readonly string[]): Promise<void> {\n process.stdout.once('error', (err: NodeJS.ErrnoException) => {\n if (err.code !== 'EPIPE') throw err\n })\n process.exitCode = await run_diagram_cli(argv, {\n out: (text) => process.stdout.write(text),\n err: (text) => process.stderr.write(text),\n load: load_module,\n })\n}\n\n/**\n * Import the module at `path`. A TypeScript module goes through the `tsx`\n * that the project installs, looked up from the module's own directory and\n * then from the working directory. Everything else is a plain dynamic import.\n */\nasync function load_module(path: string): Promise<Readonly<Record<string, unknown>>> {\n const url = pathToFileURL(path).href\n if (!TS_MODULE.test(path)) return as_record(await import(url))\n const tsx = find_tsx([path, resolve('package.json')])\n if (tsx === undefined) return import_without_tsx(url)\n const api: unknown = await import(pathToFileURL(tsx).href)\n const ts_import = as_record(api)['tsImport']\n if (typeof ts_import !== 'function') return as_record(await import(url))\n return as_record(await ts_import(url, import.meta.url))\n}\n\n/**\n * Import a TypeScript module with Node's own type stripping, which handles\n * only erasable syntax and specifiers that name real files. A failure says\n * that tsx is the fix, since this path is taken only when none was found.\n */\nasync function import_without_tsx(url: string): Promise<Readonly<Record<string, unknown>>> {\n try {\n return as_record(await import(url))\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err)\n throw new Error(`${reason} (no tsx was found to load TypeScript: install it with pnpm add -D tsx)`, {\n cause: err,\n })\n }\n}\n\n/**\n * Resolve tsx's programmatic API from the first of `origins` that can see it,\n * or `undefined` when none can.\n */\nfunction find_tsx(origins: readonly string[]): string | undefined {\n for (const origin of origins) {\n try {\n return createRequire(origin).resolve('tsx/esm/api')\n } catch {\n // Not installed where this origin looks; try the next one.\n }\n }\n return undefined\n}\n\n/**\n * View a loaded module namespace as a record of its exports.\n */\nfunction as_record(value: unknown): Readonly<Record<string, unknown>> {\n return typeof value === 'object' && value !== null ? { ...value } : {}\n}\n\n// Auto-run only when this file is the entry script (`tsx src/diagram_bin.ts`),\n// never when the bundle that contains it is imported. The path comparison is\n// the same guard the viewer CLI uses.\nconst invoked_directly =\n process.argv[1] !== undefined && process.argv[1] === fileURLToPath(import.meta.url)\n\nif (invoked_directly) void run_diagram_bin(process.argv.slice(2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qB,QAAQ,KAAK,MAAM,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
- import { h as wait_with_abort, k as aborted_error, m as compute_backoff, o as format_schema_issues, s as validate_schema } from "./core-BClsJ3h0.js";
2
- import { S as turn_timeout_error, _ as provider_required_error, a as normalize_local_usage, b as tool_approval_denied_error, c as engine_config_error, d as model_required_error, f as on_chunk_error, g as provider_not_configured_error, h as provider_error, i as missing_peer_error, l as engine_disposed_error, m as provider_capability_error, n as default_normalize_usage, o as resolve_transport, p as provider_auth_error, r as load_optional_peer, s as claude_cli_error, t as split_leading_system_run, u as incomplete_generation_error, v as rate_limit_error, x as tool_error, y as schema_validation_error } from "./leading_system-B6hsYN90.js";
1
+ import { O as aborted_error, h as wait_with_abort, m as compute_backoff, o as format_schema_issues, s as validate_schema } from "./core-BVCVUMmH.js";
2
+ import { S as turn_timeout_error, _ as provider_required_error, a as normalize_local_usage, b as tool_approval_denied_error, c as engine_config_error, d as model_required_error, f as on_chunk_error, g as provider_not_configured_error, h as provider_error, i as missing_peer_error, l as engine_disposed_error, m as provider_capability_error, n as default_normalize_usage, o as resolve_transport, p as provider_auth_error, r as load_optional_peer, s as claude_cli_error, t as split_leading_system_run, u as incomplete_generation_error, v as rate_limit_error, x as tool_error, y as schema_validation_error } from "./leading_system-CfOIc5fi.js";
3
3
  import { join } from "node:path";
4
4
  import { mkdtempSync, writeFileSync } from "node:fs";
5
5
  import { tmpdir } from "node:os";
@@ -6634,7 +6634,7 @@ async function build_ai_sdk_transport(cfg) {
6634
6634
  const provider_options = combined_provider_options !== void 0 && Object.keys(combined_provider_options).length > 0 ? combined_provider_options : void 0;
6635
6635
  let ai_sdk_invoke_mod;
6636
6636
  try {
6637
- ai_sdk_invoke_mod = await import("./invoke-dc5DdrrJ.js");
6637
+ ai_sdk_invoke_mod = await import("./invoke-BcPDqE5C.js");
6638
6638
  } catch (err) {
6639
6639
  throw missing_peer_error("ai", err);
6640
6640
  }
@@ -7200,4 +7200,4 @@ function create_engine(config) {
7200
7200
  //#endregion
7201
7201
  export { create_engine as t };
7202
7202
 
7203
- //# sourceMappingURL=engine-Djq7EH9x.js.map
7203
+ //# sourceMappingURL=engine-Ct4LBzb9.js.map