@lolkda/dsh-prompt-manager 3.0.0

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 (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +606 -0
  3. package/client/client.js +2320 -0
  4. package/cordis.patch.yml +20 -0
  5. package/environment.md +24 -0
  6. package/lib/entries.js +303 -0
  7. package/lib/entries.js.map +1 -0
  8. package/lib/guard.js +134 -0
  9. package/lib/guard.js.map +1 -0
  10. package/lib/index.js +959 -0
  11. package/lib/index.js.map +1 -0
  12. package/lib/net.js +179 -0
  13. package/lib/net.js.map +1 -0
  14. package/lib/pack.js +327 -0
  15. package/lib/pack.js.map +1 -0
  16. package/lib/probe.js +251 -0
  17. package/lib/probe.js.map +1 -0
  18. package/lib/routes.js +718 -0
  19. package/lib/routes.js.map +1 -0
  20. package/lib/scripts.js +803 -0
  21. package/lib/scripts.js.map +1 -0
  22. package/lib/source.js +308 -0
  23. package/lib/source.js.map +1 -0
  24. package/lib/store.js +223 -0
  25. package/lib/store.js.map +1 -0
  26. package/lib/subscriptions.js +269 -0
  27. package/lib/subscriptions.js.map +1 -0
  28. package/lib/sync.js +646 -0
  29. package/lib/sync.js.map +1 -0
  30. package/lib/types/entries.d.ts +194 -0
  31. package/lib/types/entries.d.ts.map +1 -0
  32. package/lib/types/guard.d.ts +63 -0
  33. package/lib/types/guard.d.ts.map +1 -0
  34. package/lib/types/index.d.ts +176 -0
  35. package/lib/types/index.d.ts.map +1 -0
  36. package/lib/types/net.d.ts +81 -0
  37. package/lib/types/net.d.ts.map +1 -0
  38. package/lib/types/pack.d.ts +298 -0
  39. package/lib/types/pack.d.ts.map +1 -0
  40. package/lib/types/probe.d.ts +150 -0
  41. package/lib/types/probe.d.ts.map +1 -0
  42. package/lib/types/routes.d.ts +85 -0
  43. package/lib/types/routes.d.ts.map +1 -0
  44. package/lib/types/scripts.d.ts +455 -0
  45. package/lib/types/scripts.d.ts.map +1 -0
  46. package/lib/types/source.d.ts +194 -0
  47. package/lib/types/source.d.ts.map +1 -0
  48. package/lib/types/store.d.ts +140 -0
  49. package/lib/types/store.d.ts.map +1 -0
  50. package/lib/types/subscriptions.d.ts +204 -0
  51. package/lib/types/subscriptions.d.ts.map +1 -0
  52. package/lib/types/sync.d.ts +248 -0
  53. package/lib/types/sync.d.ts.map +1 -0
  54. package/package.json +100 -0
@@ -0,0 +1,455 @@
1
+ /**
2
+ * User-authored scripts that supply prompt variables.
3
+ *
4
+ * One script is one file under `scripts/`, run as a child process, and one JSON
5
+ * object printed on stdout: its keys become the `{{name}}` references the
6
+ * prompt can use. A script therefore declares its own variables — there is no
7
+ * second place to register a name — and one script can supply many.
8
+ *
9
+ * Execution is deliberately out of process. A provider is evaluated
10
+ * synchronously for every assembly, so nothing that costs a subprocess can live
11
+ * there; more to the point, user code that hangs or crashes must not be able to
12
+ * take the host down with it. A run is bounded by a timeout, its output is
13
+ * bounded by a size cap, and every failure is a report rather than a throw.
14
+ *
15
+ * A script's values are cached after every successful run, so a profile start
16
+ * never has to execute anything to keep the prompt rendering the values it saw
17
+ * last: the cache is read synchronously at mount, and changed scripts are
18
+ * picked up by a refresh that runs behind the mount.
19
+ *
20
+ * @module @lolkda/dsh-prompt-manager/scripts
21
+ */
22
+ import { type ProbeRun, type ProbeTexts } from './probe.js';
23
+ /** Directory name, under the plugin's storage root, holding the scripts. */
24
+ export declare const SCRIPTS_DIR_NAME = "scripts";
25
+ /** Extension every script file carries. */
26
+ export declare const SCRIPT_EXTENSION = ".js";
27
+ /** Largest accepted script, in bytes. */
28
+ export declare const MAX_SCRIPT_BYTES: number;
29
+ /** At most this many scripts may live in the directory. */
30
+ export declare const MAX_SCRIPTS = 20;
31
+ /** At most this many variables may come from one script. */
32
+ export declare const MAX_SCRIPT_VARIABLES = 64;
33
+ /** Per-run timeout, used when a script's override sets none. */
34
+ export declare const DEFAULT_SCRIPT_TIMEOUT_MS = 3000;
35
+ /** Largest amount of output read back from one run, in bytes. */
36
+ export declare const MAX_SCRIPT_OUTPUT: number;
37
+ /** Default interpreter. An override replaces it, e.g. `python`. */
38
+ export declare const DEFAULT_SCRIPT_COMMAND = "node";
39
+ /** Placeholder an override's `args` may carry for the script's own path. */
40
+ export declare const SCRIPT_PLACEHOLDER = "{script}";
41
+ /** Bookkeeping file beside the scripts; dot-prefixed so no scan ever sees it. */
42
+ export declare const SCRIPT_STATE_FILE = ".state.json";
43
+ /** What a composition may override about one script's execution. */
44
+ export interface ScriptOverride {
45
+ /** Interpreter to run; defaults to {@link DEFAULT_SCRIPT_COMMAND}. */
46
+ command?: string | undefined;
47
+ /** Arguments; `{script}` becomes the script's absolute path. */
48
+ args?: string[] | undefined;
49
+ /** Timeout for this script alone, in milliseconds. */
50
+ timeoutMs?: number | undefined;
51
+ }
52
+ /** One resolved execution, ready for a runner. */
53
+ export interface ScriptSpec {
54
+ /** Interpreter name or absolute path. */
55
+ command: string;
56
+ /** Arguments, with the script's path already substituted in. */
57
+ args: string[];
58
+ /** Timeout for this run. */
59
+ timeoutMs: number;
60
+ }
61
+ /** Runs one script. Replaced in tests, so no interpreter is needed. */
62
+ export type ScriptRunner = (spec: ScriptSpec, options: {
63
+ cwd: string;
64
+ name: string;
65
+ }) => Promise<ProbeRun>;
66
+ /** One script's cached result, as persisted beside the scripts. */
67
+ export interface ScriptRecord {
68
+ /** sha1 of the script source that produced {@link ScriptRecord.variables}. */
69
+ sha1: string;
70
+ /** When the successful run happened, ISO-8601. */
71
+ ranAt: string;
72
+ /** Wall time of that run, in milliseconds. */
73
+ ms: number;
74
+ /** Exit code of that run, when it had one. */
75
+ exitCode?: number | undefined;
76
+ /** Variables it supplied, as registered. */
77
+ variables: Record<string, string>;
78
+ /** Why the most recent run after that one failed, when it did. */
79
+ error?: string | undefined;
80
+ }
81
+ /** Every script's bookkeeping, keyed by script name. */
82
+ export type ScriptState = Record<string, ScriptRecord>;
83
+ /** One script as the settings page sees it. */
84
+ export interface ScriptSummary {
85
+ /** Script name, which is also the file stem. */
86
+ name: string;
87
+ /** sha1 of the file on disk now, or `null` when it cannot be read. */
88
+ sha1: string | null;
89
+ /** Variables the last successful run supplied. */
90
+ variables: string[];
91
+ /** When that run happened. */
92
+ ranAt?: string | undefined;
93
+ /** Its exit code. */
94
+ exitCode?: number | undefined;
95
+ /** Its wall time, in milliseconds. */
96
+ ms?: number | undefined;
97
+ /** Why the most recent attempt failed, when it did. */
98
+ error?: string | undefined;
99
+ /** The file changed since the cached run, so its values are stale. */
100
+ pending: boolean;
101
+ }
102
+ /** What one run produced. */
103
+ export interface ScriptRunReport {
104
+ /** Script name; a draft run reports the name it was tested under. */
105
+ name: string;
106
+ /** Whether the run produced a usable variable set. */
107
+ ok: boolean;
108
+ /** Exit code, when the process ran. */
109
+ exitCode: number | undefined;
110
+ /** Wall time, in milliseconds. */
111
+ ms: number;
112
+ /** The variables the run supplies, when it succeeded. */
113
+ variables: Record<string, string>;
114
+ /** Variables whose value was cut to {@link MAX_PROBE_VALUE} characters. */
115
+ truncated: string[];
116
+ /** Everything that made the run unusable, in the order it was discovered. */
117
+ problems: string[];
118
+ /** Things worth showing that did not make the run unusable. */
119
+ warnings: string[];
120
+ /** Standard output, trimmed to a readable head for the page. */
121
+ stdout: string;
122
+ /** Standard error, trimmed to a readable tail for the page. */
123
+ stderr: string;
124
+ }
125
+ /** Why a script operation was refused. */
126
+ export type ScriptErrorReason =
127
+ /** The name is not a usable script name. */
128
+ 'invalid-name'
129
+ /** The source does not parse, or is too large. */
130
+ | 'invalid-source'
131
+ /** The script ran but produced no usable variable set. */
132
+ | 'invalid-output'
133
+ /** A variable name it wants belongs to something else. */
134
+ | 'conflict'
135
+ /** Too many scripts, or too many variables from one. */
136
+ | 'too-many'
137
+ /** The script file is not there. */
138
+ | 'unknown-script';
139
+ /** A script operation the caller should report, not retry blindly. */
140
+ export declare class ScriptError extends Error {
141
+ /** Machine-readable reason. */
142
+ readonly reason: ScriptErrorReason;
143
+ /** The run report, when the refusal came from running something. */
144
+ readonly report: ScriptRunReport | undefined;
145
+ /**
146
+ * @param reason - machine-readable reason.
147
+ * @param message - human-facing detail.
148
+ * @param report - the run that produced the refusal, when there was one.
149
+ */
150
+ constructor(reason: ScriptErrorReason, message: string, report?: ScriptRunReport);
151
+ }
152
+ /** What the script engine needs from the plugin. */
153
+ export interface ScriptHost {
154
+ /** Absolute directory holding `<name>.js`. */
155
+ dir(): string;
156
+ /** Per-script overrides, from composition config. */
157
+ overrides(): Record<string, ScriptOverride>;
158
+ /** Placeholder texts a value falls back to. */
159
+ texts(): ProbeTexts;
160
+ /**
161
+ * Offer one variable to the prompt registry.
162
+ * @param name - the `{{name}}` reference.
163
+ * @param value - the value to serve; never empty.
164
+ * @param detail - owning script name.
165
+ * @returns `assigned` when this script already owns the name, `declared` when
166
+ * it was free, `conflict` when another owner has it.
167
+ */
168
+ declare(name: string, value: string, detail: string): 'assigned' | 'declared' | 'conflict';
169
+ /**
170
+ * Who owns a variable name right now.
171
+ * @param name - the `{{name}}` reference.
172
+ * @returns the owning script name, or `undefined` when the name is free.
173
+ */
174
+ owner(name: string): string | undefined;
175
+ /**
176
+ * Whether any active entry still writes one reference.
177
+ *
178
+ * Letting go of a script means keeping its variables — a value that is not
179
+ * there makes every section referencing it fail to assemble — but only a
180
+ * reference justifies that, and this is how the engine knows whether there is
181
+ * one.
182
+ *
183
+ * @param name - the `{{name}}` reference.
184
+ * @returns `true` when some entry still writes that reference.
185
+ */
186
+ referenced(name: string): boolean;
187
+ /**
188
+ * Drop a variable this engine declared.
189
+ *
190
+ * Called for a variable nothing references any more, so the prompt stops
191
+ * carrying a value whose script is gone. A name that has since moved to
192
+ * another owner is left alone: only `<detail>`'s own declaration is dropped.
193
+ *
194
+ * @param name - the `{{name}}` reference.
195
+ * @param detail - the script that declared it.
196
+ */
197
+ forget(name: string, detail: string): void;
198
+ /** Report a non-fatal problem. */
199
+ warn(message: string): void;
200
+ }
201
+ /**
202
+ * Run one script and collect both streams.
203
+ *
204
+ * `spawn` rather than a synchronous runner, because a save or a test run is
205
+ * driven by a click and must not block the host's event loop for the length of
206
+ * the timeout. The timeout is enforced here, so a script that never exits is
207
+ * killed and reported as a timeout rather than held open.
208
+ *
209
+ * @param spec - resolved interpreter, arguments, and timeout.
210
+ * @param options - working directory, which is the script directory.
211
+ * @returns the normalized run.
212
+ */
213
+ export declare const defaultScriptRunner: ScriptRunner;
214
+ /**
215
+ * Resolve one script's execution from its override.
216
+ *
217
+ * An override with no `command` keeps the default interpreter; one that names a
218
+ * command replaces both the command and the arguments, with `{script}`
219
+ * substituted for the script's path — appended when the override does not
220
+ * mention the placeholder at all.
221
+ *
222
+ * @param scriptPath - absolute path of the script file.
223
+ * @param override - the script's configured override, when it has one.
224
+ * @returns the resolved spec.
225
+ */
226
+ export declare function resolveSpec(scriptPath: string, override: ScriptOverride | undefined): ScriptSpec;
227
+ /**
228
+ * Accept the `scripts` config value in whatever shape a composition delivers.
229
+ *
230
+ * Reports rather than throws: a malformed override is a composition mistake the
231
+ * caller fails the mount over, but the caller is the one that knows the mount is
232
+ * still happening.
233
+ *
234
+ * @param raw - the config value.
235
+ * @returns the usable overrides, plus one problem message per dropped entry.
236
+ */
237
+ export declare function normalizeScriptOverrides(raw: unknown): {
238
+ overrides: Record<string, ScriptOverride>;
239
+ problems: string[];
240
+ };
241
+ /**
242
+ * Whether a script's source parses.
243
+ *
244
+ * Compiling is not running: `new vm.Script()` reports a syntax error and
245
+ * executes nothing, which is what makes it safe to call on a draft.
246
+ *
247
+ * @param source - the script text.
248
+ * @returns the parser's complaint, or `undefined` when it is fine.
249
+ */
250
+ export declare function checkSyntax(source: string): string | undefined;
251
+ /**
252
+ * Turn one script's output into the variables it supplies.
253
+ *
254
+ * The output must be a flat JSON object; its keys are the variable names. A
255
+ * string is used as it stands, a finite number is stringified, and anything
256
+ * else is refused — a value that is not text cannot be interpolated into a
257
+ * prompt, and refusing it here is better than discovering it at assembly.
258
+ *
259
+ * @param raw - the script's standard output.
260
+ * @param texts - placeholder used for a value that came out empty.
261
+ * @returns the variables, plus every reason the output is unusable.
262
+ */
263
+ export declare function parseScriptOutput(raw: string, texts?: ProbeTexts): {
264
+ variables: Record<string, string>;
265
+ truncated: string[];
266
+ problems: string[];
267
+ };
268
+ /**
269
+ * Read the bookkeeping beside the scripts.
270
+ * @param dir - the script directory.
271
+ * @returns one record per script; an unreadable or malformed file reads as empty.
272
+ */
273
+ export declare function readScriptState(dir: string): ScriptState;
274
+ /**
275
+ * Persist the bookkeeping.
276
+ * @param dir - the script directory.
277
+ * @param state - the state to write.
278
+ */
279
+ export declare function writeScriptState(dir: string, state: ScriptState): void;
280
+ /**
281
+ * Remove draft files this module left behind, so an interrupted run cannot
282
+ * accumulate files in a directory a person reads.
283
+ * @param dir - the script directory.
284
+ */
285
+ export declare function cleanDrafts(dir: string): void;
286
+ /** The script engine: on-disk scripts, their runs, and their values. */
287
+ export declare class PromptScripts {
288
+ private readonly host;
289
+ /** `<root>/scripts`, from the plugin's resolved storage root. */
290
+ private readonly store;
291
+ /** How one script is executed; replaced in tests. */
292
+ private readonly runner;
293
+ /** Keep a run from writing its values into a prompt that has been torn down. */
294
+ private disposed;
295
+ /**
296
+ * @param host - the plugin side of the engine.
297
+ * @param options - the process runner; the real one by default.
298
+ */
299
+ constructor(host: ScriptHost, options?: {
300
+ run?: ScriptRunner | undefined;
301
+ });
302
+ /** Absolute directory holding the scripts. */
303
+ get dir(): string;
304
+ /** Stop accepting run results. */
305
+ dispose(): void;
306
+ /**
307
+ * Script names present on disk, in directory order.
308
+ * @returns the names, capped at {@link MAX_SCRIPTS}.
309
+ */
310
+ names(): string[];
311
+ /**
312
+ * Read one script's source.
313
+ *
314
+ * A lookup answers `undefined` rather than throwing: an unusable name is a
315
+ * script that is not there, and a file that cannot be read is reported and
316
+ * skipped, so neither can turn a page refresh into a failed request.
317
+ *
318
+ * @param name - script name.
319
+ * @returns the source and its hash, or `undefined` when there is no readable file.
320
+ */
321
+ read(name: string): {
322
+ source: string;
323
+ sha1: string;
324
+ } | undefined;
325
+ /**
326
+ * The scripts as the settings page sees them.
327
+ * @returns one summary per script on disk.
328
+ */
329
+ list(): ScriptSummary[];
330
+ /**
331
+ * Declare the values cached for every script whose file has not changed.
332
+ *
333
+ * Called at mount, synchronously, so a profile start serves the values it saw
334
+ * last without executing anything. A script with no cache, or one whose file
335
+ * changed while the profile was down, is left to {@link refresh}.
336
+ *
337
+ * @returns the names that still need a run.
338
+ */
339
+ mountDeclare(): string[];
340
+ /**
341
+ * Run every named script, or every script on disk, and publish the values.
342
+ * @param names - scripts to run; all of them when omitted.
343
+ * @returns one report per script, in the order they were run.
344
+ */
345
+ refresh(names?: readonly string[]): Promise<ScriptRunReport[]>;
346
+ /**
347
+ * Run one script from disk and publish whatever it supplies.
348
+ * @param name - script name.
349
+ * @returns the run report.
350
+ * @throws {ScriptError} when the script does not exist.
351
+ */
352
+ run(name: string): Promise<ScriptRunReport>;
353
+ /**
354
+ * Run a draft without touching the disk, the cache, or the prompt.
355
+ *
356
+ * This is the test button: the run is the same code path a saved script takes,
357
+ * so what it reports is what saving would produce — but nothing is registered,
358
+ * which is what makes it safe to try things out.
359
+ *
360
+ * @param name - the name the draft is being written under.
361
+ * @param source - the draft's source.
362
+ * @returns the run report.
363
+ * @throws {ScriptError} when the name or the source is unusable.
364
+ */
365
+ runSource(name: string, source: string): Promise<ScriptRunReport>;
366
+ /**
367
+ * Validate a draft, run it, and only then put it in place.
368
+ *
369
+ * Nothing is written until the script has produced a usable variable set and
370
+ * no name it wants is taken by something else, so a broken or conflicting
371
+ * script never becomes a file.
372
+ *
373
+ * @param name - script name.
374
+ * @param source - the source to save.
375
+ * @param fence - what the caller expects to find on disk.
376
+ * @returns the variables that are now in force, and the run that produced them.
377
+ * @throws {ScriptError} on any refusal, carrying the run report when there was one.
378
+ */
379
+ save(name: string, source: string, fence: {
380
+ kind: 'absent';
381
+ } | {
382
+ kind: 'sha1';
383
+ sha1: string;
384
+ } | {
385
+ kind: 'any';
386
+ }): Promise<{
387
+ name: string;
388
+ sha1: string;
389
+ variables: Record<string, string>;
390
+ report: ScriptRunReport;
391
+ }>;
392
+ /**
393
+ * Forget one script: its file and its cache entry.
394
+ *
395
+ * A variable an entry still references stays declared, frozen at the value it
396
+ * last held: a missing value would make every section that references it fail
397
+ * to assemble. One that nothing references is dropped outright — keeping it
398
+ * would leave the variables page showing a value for a script that is gone,
399
+ * which is what made a deleted script look undeletable.
400
+ *
401
+ * @param name - script name.
402
+ * @returns `true` when a file was removed.
403
+ */
404
+ remove(name: string): boolean;
405
+ /**
406
+ * Drop the cache entries and variables of scripts that are no longer on disk.
407
+ * @param onDisk - script names currently on disk.
408
+ */
409
+ private reconcile;
410
+ /**
411
+ * Let go of what one script supplied, keeping whatever is still referenced.
412
+ * @param name - the script that is gone.
413
+ * @param record - its cache entry, when it had one.
414
+ */
415
+ private release;
416
+ /**
417
+ * Record a successful run: its values reach the registry, its summary reaches
418
+ * the cache.
419
+ * @param name - owning script.
420
+ * @param sha1 - hash of the source that produced the values.
421
+ * @param report - the run that succeeded.
422
+ */
423
+ private recordSuccess;
424
+ /**
425
+ * Record a failed run.
426
+ *
427
+ * The values from the last success stay in force: a variable with no value
428
+ * would make every section referencing it fail to assemble, so a broken run
429
+ * costs the error message and nothing else. The hash of the success those
430
+ * values belong to is kept too, so the script still reads as needing a run.
431
+ *
432
+ * @param name - owning script.
433
+ * @param error - why the run failed.
434
+ */
435
+ private recordFailure;
436
+ /**
437
+ * Publish one variable, reporting a name another owner already holds.
438
+ * @param name - owning script.
439
+ * @param variable - the `{{name}}` reference.
440
+ * @param value - the value to serve.
441
+ */
442
+ private apply;
443
+ /**
444
+ * Execute a source without writing it: a draft file is used so that the script
445
+ * sees a real path, a real `__dirname`, and a real working directory, which is
446
+ * what makes a test run the same thing as a saved run.
447
+ *
448
+ * @param name - script name, for the report.
449
+ * @param source - the source to run.
450
+ * @param draft - whether to run from a throwaway file.
451
+ * @returns the report, never a throw for a script-level failure.
452
+ */
453
+ private execute;
454
+ }
455
+ //# sourceMappingURL=scripts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../src/scripts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH,OAAO,EAAwC,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAA;AAGjG,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,YAAY,CAAA;AAEzC,2CAA2C;AAC3C,eAAO,MAAM,gBAAgB,QAAQ,CAAA;AAErC,yCAAyC;AACzC,eAAO,MAAM,gBAAgB,QAAY,CAAA;AAEzC,2DAA2D;AAC3D,eAAO,MAAM,WAAW,KAAK,CAAA;AAE7B,4DAA4D;AAC5D,eAAO,MAAM,oBAAoB,KAAK,CAAA;AAEtC,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,OAAO,CAAA;AAE7C,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,QAAY,CAAA;AAE1C,mEAAmE;AACnE,eAAO,MAAM,sBAAsB,SAAS,CAAA;AAE5C,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,aAAa,CAAA;AAE5C,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,gBAAgB,CAAA;AAiB9C,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC3B,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC/B;AAED,kDAAkD;AAClD,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAA;IACf,gEAAgE;IAChE,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,uEAA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,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,GAC3E,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,MAAM,EAAE,eAAe,CAAA;KAAE,CAAC;IAsCtG;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAY7B;;;OAGG;IACH,OAAO,CAAC,SAAS;IAajB;;;;OAIG;IACH,OAAO,CAAC,OAAO;IAQf;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAcrB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,aAAa;IAerB;;;;;OAKG;IACH,OAAO,CAAC,KAAK;IAOb;;;;;;;;;OASG;YACW,OAAO;CAwDtB"}
@@ -0,0 +1,194 @@
1
+ /**
2
+ * Subscription sources: where a prompt set comes from, and what the repository
3
+ * manifest says is inside it.
4
+ *
5
+ * Everything in this module is pure: string and JSON work only. The network
6
+ * lives in `net.ts`, the files and their history live in `sync.ts`, and the two
7
+ * are joined by the engine in `subscriptions.ts`.
8
+ *
9
+ * @module @lolkda/dsh-prompt-manager/source
10
+ */
11
+ /** Manifest every subscribed repository must carry at its root. */
12
+ export declare const MANIFEST_FILE = "prompt-manager.json";
13
+ /** Largest manifest accepted, in bytes. */
14
+ export declare const MAX_MANIFEST_BYTES: number;
15
+ /** Largest single prompt body accepted, in bytes. Mirrors the store's limit. */
16
+ export declare const MAX_FILE_BYTES: number;
17
+ /** At most this many prompts may come from one source. */
18
+ export declare const MAX_SOURCE_FILES = 50;
19
+ /** At most this many sources may be configured. */
20
+ export declare const MAX_SOURCES = 20;
21
+ /** One prompt declared by a repository manifest. */
22
+ export interface ManifestPrompt {
23
+ /** Repository-relative path of the markdown body. */
24
+ file: string;
25
+ /** Id stem; defaults to the file name. */
26
+ id?: string;
27
+ /** Display title; defaults to the manifest id or file stem. */
28
+ title?: string;
29
+ /** Default placement; defaults to the importer's next free slot. */
30
+ order?: number;
31
+ /** Default enabled state; the importer overrides this to `false` on import. */
32
+ enabled?: boolean;
33
+ }
34
+ /** A configured subscription source. */
35
+ export interface PromptSource {
36
+ /** Local slug: entry-id prefix, workspace directory name. */
37
+ id: string;
38
+ /** `owner/name`. */
39
+ repo: string;
40
+ /** Branch, tag, or commit sha. */
41
+ ref: string;
42
+ /** URL-prefix mirror; empty means inherit the global one. */
43
+ mirror: string;
44
+ /** Whether this source takes part in a check. */
45
+ enabled: boolean;
46
+ }
47
+ /** A manifest that cannot be used, with the reason a person needs. */
48
+ export declare class ManifestError extends Error {
49
+ /** Machine-readable reason. */
50
+ readonly reason: 'not-json' | 'not-object' | 'no-prompts' | 'bad-entry' | 'too-large' | 'too-many';
51
+ /**
52
+ * @param reason - machine-readable reason.
53
+ * @param message - human-facing detail.
54
+ */
55
+ constructor(reason: ManifestError['reason'], message: string);
56
+ }
57
+ /**
58
+ * Whether a value is a usable `owner/name`.
59
+ * @param value - candidate repository.
60
+ * @returns `true` when the shape is acceptable.
61
+ */
62
+ export declare function isRepo(value: unknown): value is string;
63
+ /**
64
+ * Whether a value is a usable ref. Path-shaped refs (`release/notes`) are
65
+ * allowed; anything with `..`, a leading dash, or a scheme is not.
66
+ * @param value - candidate ref.
67
+ * @returns `true` when the shape is acceptable.
68
+ */
69
+ export declare function isRef(value: unknown): value is string;
70
+ /**
71
+ * Whether a value is a usable source slug.
72
+ * @param value - candidate slug.
73
+ * @returns `true` when the shape is acceptable.
74
+ */
75
+ export declare function isSourceId(value: unknown): value is string;
76
+ /**
77
+ * Derive a source slug from `owner/name`.
78
+ * @param repo - a validated `owner/name`.
79
+ * @returns a lowercase, hyphenated slug.
80
+ */
81
+ export declare function sourceSlug(repo: string): string;
82
+ /**
83
+ * The id stem of one manifest file: its basename without the extension.
84
+ * @param file - repository-relative path.
85
+ * @returns a lowercase slug.
86
+ */
87
+ export declare function stemOf(file: string): string;
88
+ /**
89
+ * The local entry id a manifest file becomes.
90
+ *
91
+ * The id is capped at {@link MAX_ID_LENGTH}, so the source half gives up exactly
92
+ * the room its stem needs. Truncating the tail instead would collapse every file
93
+ * of a long-named source onto one id, and the index would silently keep only the
94
+ * first of them.
95
+ *
96
+ * @param sourceId - owning source slug.
97
+ * @param file - repository-relative path.
98
+ * @returns `<sourceId>-<stem>`, within the entry-id grammar.
99
+ */
100
+ export declare function entryIdFor(sourceId: string, file: string): string;
101
+ /**
102
+ * The local entry id one stem becomes.
103
+ *
104
+ * Kept separate from {@link entryIdFor} because a manifest may declare the stem
105
+ * itself: `id` is the file's identity, not a label, so a file may be renamed in
106
+ * the repository while its local entry — and every preset naming it — stays put.
107
+ *
108
+ * @param sourceId - owning source slug.
109
+ * @param stem - declared id, or a file's own stem.
110
+ * @returns `<sourceId>-<stem>`, within the entry-id grammar.
111
+ */
112
+ export declare function entryIdForStem(sourceId: string, stem: string): string;
113
+ /**
114
+ * The entry id one manifest prompt becomes, its own declaration first.
115
+ *
116
+ * @param sourceId - owning source slug.
117
+ * @param prompt - the manifest entry.
118
+ * @returns the local entry id.
119
+ */
120
+ export declare function entryIdForPrompt(sourceId: string, prompt: ManifestPrompt): string;
121
+ /**
122
+ * Validate and normalize a repository manifest.
123
+ *
124
+ * The manifest is untrusted input from the internet: every field is checked,
125
+ * unknown fields are dropped, and a manifest that declares nothing usable is
126
+ * refused rather than silently producing an empty import.
127
+ *
128
+ * @param raw - parsed JSON from the repository.
129
+ * @returns the usable prompts, in manifest order.
130
+ * @throws {ManifestError} when the manifest cannot be used at all.
131
+ */
132
+ export declare function parseManifest(raw: unknown): ManifestPrompt[];
133
+ /**
134
+ * Normalize a URL-prefix mirror. Only an absolute `https` origin (plus an
135
+ * optional path) is accepted, with no query, fragment, or credentials — the
136
+ * same bar the market plugin applies to its `githubProxy`.
137
+ * @param value - the configured value.
138
+ * @returns the normalized mirror, or `undefined` when it is unusable.
139
+ */
140
+ export declare function normalizeMirror(value: unknown): string | undefined;
141
+ /**
142
+ * Rewrite an upstream URL for a mirror.
143
+ *
144
+ * Both shapes are accepted so an existing configuration keeps working: a
145
+ * template containing `{url}` gets the URL substituted, and anything else is
146
+ * treated as a prefix, giving `<prefix>/<url>` — exactly what the market plugin
147
+ * writes into its `githubProxy`.
148
+ *
149
+ * @param mirror - normalized mirror; empty means no rewrite.
150
+ * @param url - the absolute upstream URL.
151
+ * @returns the URL to request.
152
+ */
153
+ export declare function withMirror(mirror: string, url: string): string;
154
+ /**
155
+ * The raw-content URL of one repository file.
156
+ * @param repo - `owner/name`.
157
+ * @param ref - branch, tag, or commit.
158
+ * @param file - repository-relative path.
159
+ * @returns an absolute `raw.githubusercontent.com` URL.
160
+ */
161
+ export declare function rawUrl(repo: string, ref: string, file: string): string;
162
+ /**
163
+ * The commits feed that carries a branch's head sha without spending API quota.
164
+ * @param repo - `owner/name`.
165
+ * @param ref - branch name.
166
+ * @returns an absolute `github.com` atom URL.
167
+ */
168
+ export declare function headAtomUrl(repo: string, ref: string): string;
169
+ /**
170
+ * Read the newest commit sha out of a commits atom feed.
171
+ * @param atom - the feed's XML.
172
+ * @returns the sha, or `undefined` when the feed does not carry one.
173
+ */
174
+ export declare function parseHeadSha(atom: string): string | undefined;
175
+ /**
176
+ * Whether a ref is worth probing for changes: a branch moves, a tag or commit
177
+ * does not.
178
+ * @param ref - the configured ref.
179
+ * @returns `true` when the ref should be probed.
180
+ */
181
+ export declare function isMovableRef(ref: string): boolean;
182
+ /**
183
+ * Narrow one settings value into a source, dropping unknown fields.
184
+ * @param raw - a candidate from the `sources` array.
185
+ * @returns the source, or `undefined` when it is unusable.
186
+ */
187
+ export declare function parseSource(raw: unknown): PromptSource | undefined;
188
+ /**
189
+ * Narrow a settings value into a source list, dropping unusable entries.
190
+ * @param raw - the resolved `sources` field.
191
+ * @returns the usable sources, capped at {@link MAX_SOURCES}.
192
+ */
193
+ export declare function parseSources(raw: unknown): PromptSource[];
194
+ //# sourceMappingURL=source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,mEAAmE;AACnE,eAAO,MAAM,aAAa,wBAAwB,CAAA;AAElD,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB,QAAY,CAAA;AAE3C,gFAAgF;AAChF,eAAO,MAAM,cAAc,QAAa,CAAA;AAExC,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,mDAAmD;AACnD,eAAO,MAAM,WAAW,KAAK,CAAA;AAW7B,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAA;IACZ,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wCAAwC;AACxC,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,EAAE,EAAE,MAAM,CAAA;IACV,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,kCAAkC;IAClC,GAAG,EAAE,MAAM,CAAA;IACX,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAA;IACd,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,sEAAsE;AACtE,qBAAa,aAAc,SAAQ,KAAK;IACtC,+BAA+B;IAC/B,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG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