@osdlc/wayfinder 0.7.4 → 0.8.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 (121) hide show
  1. package/CHANGELOG.md +214 -0
  2. package/CONTRIBUTING.md +6 -0
  3. package/README.md +295 -150
  4. package/SECURITY.md +19 -5
  5. package/dist/actions.d.ts +23 -0
  6. package/dist/actions.js +97 -0
  7. package/dist/app.d.ts +1 -13
  8. package/dist/app.js +1 -13
  9. package/dist/args.d.ts +11 -6
  10. package/dist/args.js +25 -7
  11. package/dist/cache.d.ts +2 -4
  12. package/dist/cache.js +5 -10
  13. package/dist/catalog.d.ts +30 -3
  14. package/dist/catalog.js +87 -11
  15. package/dist/clean-command.d.ts +65 -36
  16. package/dist/clean-command.js +372 -226
  17. package/dist/cli.d.ts +24 -57
  18. package/dist/cli.js +139 -568
  19. package/dist/commands/browse.d.ts +128 -0
  20. package/dist/commands/browse.js +151 -0
  21. package/dist/commands/index.d.ts +25 -0
  22. package/dist/commands/index.js +71 -0
  23. package/dist/commands/list.d.ts +208 -0
  24. package/dist/commands/list.js +127 -0
  25. package/dist/commands/query.d.ts +166 -0
  26. package/dist/commands/query.js +73 -0
  27. package/dist/commands/run.d.ts +114 -0
  28. package/dist/commands/run.js +139 -0
  29. package/dist/commands/shared.d.ts +152 -0
  30. package/dist/commands/shared.js +209 -0
  31. package/dist/config-command.d.ts +27 -43
  32. package/dist/config-command.js +129 -330
  33. package/dist/config-keys.d.ts +25 -0
  34. package/dist/config-keys.js +29 -0
  35. package/dist/config.d.ts +271 -257
  36. package/dist/config.js +610 -460
  37. package/dist/core/copy-text.d.ts +30 -0
  38. package/dist/core/copy-text.js +50 -0
  39. package/dist/core/filter.d.ts +55 -0
  40. package/dist/core/filter.js +59 -0
  41. package/dist/core/run.d.ts +22 -0
  42. package/dist/core/run.js +59 -0
  43. package/dist/core/saved-view.d.ts +59 -0
  44. package/dist/core/saved-view.js +119 -0
  45. package/dist/core/session.d.ts +262 -0
  46. package/dist/core/session.js +589 -0
  47. package/dist/core/skills.d.ts +53 -0
  48. package/dist/core/skills.js +54 -0
  49. package/dist/core/unknowns.d.ts +72 -0
  50. package/dist/core/unknowns.js +68 -0
  51. package/dist/devlink.d.ts +3 -0
  52. package/dist/devlink.js +5 -2
  53. package/dist/document-schemas.generated.d.ts +22 -0
  54. package/dist/document-schemas.generated.js +916 -0
  55. package/dist/documents.d.ts +432 -0
  56. package/dist/documents.js +163 -0
  57. package/dist/groups.d.ts +22 -26
  58. package/dist/groups.js +13 -29
  59. package/dist/guide.d.ts +26 -13
  60. package/dist/guide.js +119 -103
  61. package/dist/index.d.ts +112 -0
  62. package/dist/index.js +58 -0
  63. package/dist/keys.d.ts +51 -0
  64. package/dist/keys.js +273 -0
  65. package/dist/page.d.ts +18 -8
  66. package/dist/page.js +28 -17
  67. package/dist/providers-command.d.ts +81 -20
  68. package/dist/providers-command.js +33 -75
  69. package/dist/schema.d.ts +48 -0
  70. package/dist/schema.js +61 -0
  71. package/dist/serve/auth.d.ts +46 -0
  72. package/dist/serve/auth.js +82 -0
  73. package/dist/serve/catalog-share.d.ts +51 -0
  74. package/dist/serve/catalog-share.js +116 -0
  75. package/dist/serve/index.d.ts +98 -0
  76. package/dist/serve/index.js +251 -0
  77. package/dist/serve/routes.d.ts +60 -0
  78. package/dist/serve/routes.js +186 -0
  79. package/dist/serve/terminal-input.d.ts +50 -0
  80. package/dist/serve/terminal-input.js +108 -0
  81. package/dist/skills.d.ts +19 -0
  82. package/dist/skills.js +54 -0
  83. package/dist/terminal-text.d.ts +8 -0
  84. package/dist/terminal-text.js +19 -6
  85. package/dist/tool-info.d.ts +24 -0
  86. package/dist/tool-info.js +17 -0
  87. package/dist/trust-command.d.ts +15 -27
  88. package/dist/trust-command.js +110 -208
  89. package/dist/trust-store.d.ts +5 -10
  90. package/dist/trust-store.js +9 -42
  91. package/dist/tui/app.d.ts +180 -0
  92. package/dist/tui/app.js +1278 -0
  93. package/dist/tui/copy.d.ts +29 -0
  94. package/dist/tui/copy.js +39 -0
  95. package/dist/tui/index.d.ts +33 -0
  96. package/dist/tui/index.js +97 -0
  97. package/dist/tui/keys-input.d.ts +27 -0
  98. package/dist/tui/keys-input.js +87 -0
  99. package/dist/tui/settings.d.ts +94 -0
  100. package/dist/tui/settings.js +198 -0
  101. package/dist/tui/style.d.ts +62 -0
  102. package/dist/tui/style.js +77 -0
  103. package/dist/version.d.ts +6 -0
  104. package/dist/version.js +7 -0
  105. package/dist/vocabulary.d.ts +89 -0
  106. package/dist/vocabulary.js +153 -0
  107. package/dist/web/main.js +1965 -568
  108. package/dist/web/page.html +39 -33
  109. package/dist/web/styles.css +457 -329
  110. package/dist/xdg.d.ts +76 -4
  111. package/dist/xdg.js +77 -5
  112. package/package.json +28 -9
  113. package/schema/config.json +133 -0
  114. package/dist/http.d.ts +0 -22
  115. package/dist/http.js +0 -149
  116. package/dist/origin-owner.d.ts +0 -19
  117. package/dist/origin-owner.js +0 -85
  118. package/dist/serve.d.ts +0 -98
  119. package/dist/serve.js +0 -671
  120. package/dist/tui.d.ts +0 -177
  121. package/dist/tui.js +0 -840
@@ -0,0 +1,432 @@
1
+ /**
2
+ * The JSON documents wayfinder prints, as Zod schemas. Each command declares
3
+ * one as its output; `schema.ts` turns them into the JSON Schemas the
4
+ * `./schema` entry exports. The task and report shapes come from
5
+ * `@osdlc/system-model/schema`, so they cannot drift from the library.
6
+ */
7
+ import { z } from 'zod';
8
+ /** A `Task` from system-model. */
9
+ export declare const TaskZ: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
10
+ /** A `RunnerReport` from system-model. */
11
+ export declare const RunnerReportZ: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
12
+ /** A `Catalog` from system-model: what a probe returns. */
13
+ export declare const CatalogZ: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
14
+ /** One row group and the runners in it. */
15
+ export declare const GroupZ: z.ZodObject<{
16
+ id: z.ZodEnum<{
17
+ tools: "tools";
18
+ skills: "skills";
19
+ tasks: "tasks";
20
+ dependencies: "dependencies";
21
+ hooks: "hooks";
22
+ }>;
23
+ title: z.ZodString;
24
+ runners: z.ZodArray<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ /** One agent skill. Its text comes from files, so filter it before a terminal shows it. */
27
+ export declare const SkillZ: z.ZodObject<{
28
+ id: z.ZodString;
29
+ name: z.ZodString;
30
+ description: z.ZodNullable<z.ZodString>;
31
+ argumentHint: z.ZodNullable<z.ZodString>;
32
+ path: z.ZodString;
33
+ scope: z.ZodString;
34
+ origin: z.ZodString;
35
+ harnesses: z.ZodArray<z.ZodString>;
36
+ invoke: z.ZodString;
37
+ }, z.core.$strip>;
38
+ /** One runner's cache verdict. */
39
+ export declare const CacheStateZ: z.ZodObject<{
40
+ runner: z.ZodString;
41
+ state: z.ZodEnum<{
42
+ fresh: "fresh";
43
+ stale: "stale";
44
+ miss: "miss";
45
+ }>;
46
+ reason: z.ZodOptional<z.ZodEnum<{
47
+ changed: "changed";
48
+ "max-age": "max-age";
49
+ excludes: "excludes";
50
+ exec: "exec";
51
+ version: "version";
52
+ tool: "tool";
53
+ }>>;
54
+ ageMs: z.ZodOptional<z.ZodNumber>;
55
+ estimateMs: z.ZodNullable<z.ZodNumber>;
56
+ slow: z.ZodBoolean;
57
+ cost: z.ZodOptional<z.ZodEnum<{
58
+ slow: "slow";
59
+ cheap: "cheap";
60
+ }>>;
61
+ probeMs: z.ZodOptional<z.ZodNumber>;
62
+ }, z.core.$strip>;
63
+ /** One thing wayfinder could not know, with the label every surface shows. */
64
+ export declare const UnknownZ: z.ZodDiscriminatedUnion<[z.ZodObject<{
65
+ kind: z.ZodLiteral<"withheld">;
66
+ runner: z.ZodString;
67
+ reason: z.ZodEnum<{
68
+ untrusted: "untrusted";
69
+ "tool-untrusted": "tool-untrusted";
70
+ "exec-off": "exec-off";
71
+ }>;
72
+ missing: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
+ label: z.ZodString;
74
+ }, z.core.$strip>, z.ZodObject<{
75
+ kind: z.ZodLiteral<"parameters">;
76
+ runner: z.ZodString;
77
+ reason: z.ZodEnum<{
78
+ "exec-withheld": "exec-withheld";
79
+ "tool-missing": "tool-missing";
80
+ "tool-failed": "tool-failed";
81
+ "not-read": "not-read";
82
+ "editor-variable": "editor-variable";
83
+ }>;
84
+ tasks: z.ZodArray<z.ZodString>;
85
+ label: z.ZodString;
86
+ }, z.core.$strip>, z.ZodObject<{
87
+ kind: z.ZodLiteral<"stale">;
88
+ runner: z.ZodString;
89
+ reason: z.ZodOptional<z.ZodEnum<{
90
+ changed: "changed";
91
+ "max-age": "max-age";
92
+ excludes: "excludes";
93
+ exec: "exec";
94
+ version: "version";
95
+ tool: "tool";
96
+ }>>;
97
+ ageMs: z.ZodOptional<z.ZodNumber>;
98
+ label: z.ZodString;
99
+ }, z.core.$strip>, z.ZodObject<{
100
+ kind: z.ZodLiteral<"binary">;
101
+ runner: z.ZodString;
102
+ binary: z.ZodString;
103
+ label: z.ZodString;
104
+ }, z.core.$strip>], "kind">;
105
+ /** The filter a listing applied. Absent fields were not given. */
106
+ export declare const FilterZ: z.ZodObject<{
107
+ query: z.ZodOptional<z.ZodString>;
108
+ mode: z.ZodOptional<z.ZodEnum<{
109
+ exact: "exact";
110
+ fuzzy: "fuzzy";
111
+ }>>;
112
+ servicesOnly: z.ZodOptional<z.ZodBoolean>;
113
+ declaredOnly: z.ZodOptional<z.ZodBoolean>;
114
+ maxDepth: z.ZodOptional<z.ZodNumber>;
115
+ }, z.core.$strip>;
116
+ /** `way list --json`: the catalog with its groups, cache verdicts and unknowns. */
117
+ export declare const CatalogOutput: z.ZodObject<{
118
+ root: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
119
+ generatedAt: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
120
+ discovery: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
121
+ allowExec: z.ZodBoolean;
122
+ source: z.ZodEnum<{
123
+ fresh: "fresh";
124
+ cached: "cached";
125
+ }>;
126
+ storedAt: z.ZodNullable<z.ZodString>;
127
+ reports: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
128
+ groups: z.ZodArray<z.ZodObject<{
129
+ id: z.ZodEnum<{
130
+ tools: "tools";
131
+ skills: "skills";
132
+ tasks: "tasks";
133
+ dependencies: "dependencies";
134
+ hooks: "hooks";
135
+ }>;
136
+ title: z.ZodString;
137
+ runners: z.ZodArray<z.ZodString>;
138
+ }, z.core.$strip>>;
139
+ skills: z.ZodArray<z.ZodObject<{
140
+ id: z.ZodString;
141
+ name: z.ZodString;
142
+ description: z.ZodNullable<z.ZodString>;
143
+ argumentHint: z.ZodNullable<z.ZodString>;
144
+ path: z.ZodString;
145
+ scope: z.ZodString;
146
+ origin: z.ZodString;
147
+ harnesses: z.ZodArray<z.ZodString>;
148
+ invoke: z.ZodString;
149
+ }, z.core.$strip>>;
150
+ cache: z.ZodArray<z.ZodObject<{
151
+ runner: z.ZodString;
152
+ state: z.ZodEnum<{
153
+ fresh: "fresh";
154
+ stale: "stale";
155
+ miss: "miss";
156
+ }>;
157
+ reason: z.ZodOptional<z.ZodEnum<{
158
+ changed: "changed";
159
+ "max-age": "max-age";
160
+ excludes: "excludes";
161
+ exec: "exec";
162
+ version: "version";
163
+ tool: "tool";
164
+ }>>;
165
+ ageMs: z.ZodOptional<z.ZodNumber>;
166
+ estimateMs: z.ZodNullable<z.ZodNumber>;
167
+ slow: z.ZodBoolean;
168
+ cost: z.ZodOptional<z.ZodEnum<{
169
+ slow: "slow";
170
+ cheap: "cheap";
171
+ }>>;
172
+ probeMs: z.ZodOptional<z.ZodNumber>;
173
+ }, z.core.$strip>>;
174
+ unknowns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
175
+ kind: z.ZodLiteral<"withheld">;
176
+ runner: z.ZodString;
177
+ reason: z.ZodEnum<{
178
+ untrusted: "untrusted";
179
+ "tool-untrusted": "tool-untrusted";
180
+ "exec-off": "exec-off";
181
+ }>;
182
+ missing: z.ZodOptional<z.ZodArray<z.ZodString>>;
183
+ label: z.ZodString;
184
+ }, z.core.$strip>, z.ZodObject<{
185
+ kind: z.ZodLiteral<"parameters">;
186
+ runner: z.ZodString;
187
+ reason: z.ZodEnum<{
188
+ "exec-withheld": "exec-withheld";
189
+ "tool-missing": "tool-missing";
190
+ "tool-failed": "tool-failed";
191
+ "not-read": "not-read";
192
+ "editor-variable": "editor-variable";
193
+ }>;
194
+ tasks: z.ZodArray<z.ZodString>;
195
+ label: z.ZodString;
196
+ }, z.core.$strip>, z.ZodObject<{
197
+ kind: z.ZodLiteral<"stale">;
198
+ runner: z.ZodString;
199
+ reason: z.ZodOptional<z.ZodEnum<{
200
+ changed: "changed";
201
+ "max-age": "max-age";
202
+ excludes: "excludes";
203
+ exec: "exec";
204
+ version: "version";
205
+ tool: "tool";
206
+ }>>;
207
+ ageMs: z.ZodOptional<z.ZodNumber>;
208
+ label: z.ZodString;
209
+ }, z.core.$strip>, z.ZodObject<{
210
+ kind: z.ZodLiteral<"binary">;
211
+ runner: z.ZodString;
212
+ binary: z.ZodString;
213
+ label: z.ZodString;
214
+ }, z.core.$strip>], "kind">>;
215
+ trustedTools: z.ZodArray<z.ZodString>;
216
+ filter: z.ZodObject<{
217
+ query: z.ZodOptional<z.ZodString>;
218
+ mode: z.ZodOptional<z.ZodEnum<{
219
+ exact: "exact";
220
+ fuzzy: "fuzzy";
221
+ }>>;
222
+ servicesOnly: z.ZodOptional<z.ZodBoolean>;
223
+ declaredOnly: z.ZodOptional<z.ZodBoolean>;
224
+ maxDepth: z.ZodOptional<z.ZodNumber>;
225
+ }, z.core.$strip>;
226
+ }, z.core.$strip>;
227
+ /** The catalog document's `schemaVersion`: the catalog's own. */
228
+ export declare const CATALOG_DOCUMENT_VERSION = 1;
229
+ /** `way query --json`: the matching tasks, best first. */
230
+ export declare const QueryOutput: z.ZodObject<{
231
+ root: z.ZodString;
232
+ filter: z.ZodObject<{
233
+ query: z.ZodOptional<z.ZodString>;
234
+ mode: z.ZodOptional<z.ZodEnum<{
235
+ exact: "exact";
236
+ fuzzy: "fuzzy";
237
+ }>>;
238
+ servicesOnly: z.ZodOptional<z.ZodBoolean>;
239
+ declaredOnly: z.ZodOptional<z.ZodBoolean>;
240
+ maxDepth: z.ZodOptional<z.ZodNumber>;
241
+ }, z.core.$strip>;
242
+ source: z.ZodEnum<{
243
+ fresh: "fresh";
244
+ cached: "cached";
245
+ }>;
246
+ storedAt: z.ZodNullable<z.ZodString>;
247
+ tasks: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
248
+ skills: z.ZodArray<z.ZodObject<{
249
+ id: z.ZodString;
250
+ name: z.ZodString;
251
+ description: z.ZodNullable<z.ZodString>;
252
+ argumentHint: z.ZodNullable<z.ZodString>;
253
+ path: z.ZodString;
254
+ scope: z.ZodString;
255
+ origin: z.ZodString;
256
+ harnesses: z.ZodArray<z.ZodString>;
257
+ invoke: z.ZodString;
258
+ }, z.core.$strip>>;
259
+ cache: z.ZodArray<z.ZodObject<{
260
+ runner: z.ZodString;
261
+ state: z.ZodEnum<{
262
+ fresh: "fresh";
263
+ stale: "stale";
264
+ miss: "miss";
265
+ }>;
266
+ reason: z.ZodOptional<z.ZodEnum<{
267
+ changed: "changed";
268
+ "max-age": "max-age";
269
+ excludes: "excludes";
270
+ exec: "exec";
271
+ version: "version";
272
+ tool: "tool";
273
+ }>>;
274
+ ageMs: z.ZodOptional<z.ZodNumber>;
275
+ estimateMs: z.ZodNullable<z.ZodNumber>;
276
+ slow: z.ZodBoolean;
277
+ cost: z.ZodOptional<z.ZodEnum<{
278
+ slow: "slow";
279
+ cheap: "cheap";
280
+ }>>;
281
+ probeMs: z.ZodOptional<z.ZodNumber>;
282
+ }, z.core.$strip>>;
283
+ unknowns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
284
+ kind: z.ZodLiteral<"withheld">;
285
+ runner: z.ZodString;
286
+ reason: z.ZodEnum<{
287
+ untrusted: "untrusted";
288
+ "tool-untrusted": "tool-untrusted";
289
+ "exec-off": "exec-off";
290
+ }>;
291
+ missing: z.ZodOptional<z.ZodArray<z.ZodString>>;
292
+ label: z.ZodString;
293
+ }, z.core.$strip>, z.ZodObject<{
294
+ kind: z.ZodLiteral<"parameters">;
295
+ runner: z.ZodString;
296
+ reason: z.ZodEnum<{
297
+ "exec-withheld": "exec-withheld";
298
+ "tool-missing": "tool-missing";
299
+ "tool-failed": "tool-failed";
300
+ "not-read": "not-read";
301
+ "editor-variable": "editor-variable";
302
+ }>;
303
+ tasks: z.ZodArray<z.ZodString>;
304
+ label: z.ZodString;
305
+ }, z.core.$strip>, z.ZodObject<{
306
+ kind: z.ZodLiteral<"stale">;
307
+ runner: z.ZodString;
308
+ reason: z.ZodOptional<z.ZodEnum<{
309
+ changed: "changed";
310
+ "max-age": "max-age";
311
+ excludes: "excludes";
312
+ exec: "exec";
313
+ version: "version";
314
+ tool: "tool";
315
+ }>>;
316
+ ageMs: z.ZodOptional<z.ZodNumber>;
317
+ label: z.ZodString;
318
+ }, z.core.$strip>, z.ZodObject<{
319
+ kind: z.ZodLiteral<"binary">;
320
+ runner: z.ZodString;
321
+ binary: z.ZodString;
322
+ label: z.ZodString;
323
+ }, z.core.$strip>], "kind">>;
324
+ }, z.core.$strip>;
325
+ /** One registered tool. */
326
+ export declare const ProviderZ: z.ZodObject<{
327
+ id: z.ZodString;
328
+ roles: z.ZodArray<z.ZodEnum<{
329
+ runner: "runner";
330
+ packageManager: "packageManager";
331
+ toolManager: "toolManager";
332
+ hookManager: "hookManager";
333
+ }>>;
334
+ kind: z.ZodNullable<z.ZodEnum<{
335
+ exec: "exec";
336
+ parse: "parse";
337
+ }>>;
338
+ binary: z.ZodNullable<z.ZodString>;
339
+ onPath: z.ZodNullable<z.ZodBoolean>;
340
+ source: z.ZodEnum<{
341
+ custom: "custom";
342
+ "built-in": "built-in";
343
+ }>;
344
+ module: z.ZodOptional<z.ZodString>;
345
+ homepage: z.ZodNullable<z.ZodString>;
346
+ description: z.ZodNullable<z.ZodString>;
347
+ ecosystem: z.ZodNullable<z.ZodString>;
348
+ language: z.ZodString;
349
+ }, z.core.$strip>;
350
+ /** `way providers --json`. */
351
+ export declare const ProvidersOutput: z.ZodObject<{
352
+ providers: z.ZodArray<z.ZodObject<{
353
+ id: z.ZodString;
354
+ roles: z.ZodArray<z.ZodEnum<{
355
+ runner: "runner";
356
+ packageManager: "packageManager";
357
+ toolManager: "toolManager";
358
+ hookManager: "hookManager";
359
+ }>>;
360
+ kind: z.ZodNullable<z.ZodEnum<{
361
+ exec: "exec";
362
+ parse: "parse";
363
+ }>>;
364
+ binary: z.ZodNullable<z.ZodString>;
365
+ onPath: z.ZodNullable<z.ZodBoolean>;
366
+ source: z.ZodEnum<{
367
+ custom: "custom";
368
+ "built-in": "built-in";
369
+ }>;
370
+ module: z.ZodOptional<z.ZodString>;
371
+ homepage: z.ZodNullable<z.ZodString>;
372
+ description: z.ZodNullable<z.ZodString>;
373
+ ecosystem: z.ZodNullable<z.ZodString>;
374
+ language: z.ZodString;
375
+ }, z.core.$strip>>;
376
+ }, z.core.$strip>;
377
+ /** `way run --json`: what ran, or with `--dry-run` what would run. */
378
+ export declare const RunOutput: z.ZodObject<{
379
+ task: z.ZodString;
380
+ display: z.ZodString;
381
+ argv: z.ZodArray<z.ZodString>;
382
+ command: z.ZodString;
383
+ cwd: z.ZodString;
384
+ env: z.ZodRecord<z.ZodString, z.ZodString>;
385
+ ran: z.ZodBoolean;
386
+ exit: z.ZodNullable<z.ZodNumber>;
387
+ unknowns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
388
+ kind: z.ZodLiteral<"withheld">;
389
+ runner: z.ZodString;
390
+ reason: z.ZodEnum<{
391
+ untrusted: "untrusted";
392
+ "tool-untrusted": "tool-untrusted";
393
+ "exec-off": "exec-off";
394
+ }>;
395
+ missing: z.ZodOptional<z.ZodArray<z.ZodString>>;
396
+ label: z.ZodString;
397
+ }, z.core.$strip>, z.ZodObject<{
398
+ kind: z.ZodLiteral<"parameters">;
399
+ runner: z.ZodString;
400
+ reason: z.ZodEnum<{
401
+ "exec-withheld": "exec-withheld";
402
+ "tool-missing": "tool-missing";
403
+ "tool-failed": "tool-failed";
404
+ "not-read": "not-read";
405
+ "editor-variable": "editor-variable";
406
+ }>;
407
+ tasks: z.ZodArray<z.ZodString>;
408
+ label: z.ZodString;
409
+ }, z.core.$strip>, z.ZodObject<{
410
+ kind: z.ZodLiteral<"stale">;
411
+ runner: z.ZodString;
412
+ reason: z.ZodOptional<z.ZodEnum<{
413
+ changed: "changed";
414
+ "max-age": "max-age";
415
+ excludes: "excludes";
416
+ exec: "exec";
417
+ version: "version";
418
+ tool: "tool";
419
+ }>>;
420
+ ageMs: z.ZodOptional<z.ZodNumber>;
421
+ label: z.ZodString;
422
+ }, z.core.$strip>, z.ZodObject<{
423
+ kind: z.ZodLiteral<"binary">;
424
+ runner: z.ZodString;
425
+ binary: z.ZodString;
426
+ label: z.ZodString;
427
+ }, z.core.$strip>], "kind">>;
428
+ }, z.core.$strip>;
429
+ export type CatalogDocumentBody = z.input<typeof CatalogOutput>;
430
+ export type QueryDocumentBody = z.input<typeof QueryOutput>;
431
+ export type ProvidersDocumentBody = z.input<typeof ProvidersOutput>;
432
+ export type RunDocumentBody = z.input<typeof RunOutput>;
@@ -0,0 +1,163 @@
1
+ /**
2
+ * The JSON documents wayfinder prints, as Zod schemas. Each command declares
3
+ * one as its output; `schema.ts` turns them into the JSON Schemas the
4
+ * `./schema` entry exports. The task and report shapes come from
5
+ * `@osdlc/system-model/schema`, so they cannot drift from the library.
6
+ */
7
+ import { z } from 'zod';
8
+ import { CATALOG_SCHEMA_VERSION, catalogSchema, runnerReportSchema, taskSchema, } from '@osdlc/system-model/schema';
9
+ /** A schema embedded in another one: without its own `$schema`. */
10
+ function embedded(schema) {
11
+ const { $schema: _, ...rest } = schema;
12
+ return z.fromJSONSchema(rest);
13
+ }
14
+ const catalogProperties = catalogSchema.properties;
15
+ /** A `Task` from system-model. */
16
+ export const TaskZ = embedded(taskSchema);
17
+ /** A `RunnerReport` from system-model. */
18
+ export const RunnerReportZ = embedded(runnerReportSchema);
19
+ /** A `Catalog` from system-model: what a probe returns. */
20
+ export const CatalogZ = embedded(catalogSchema);
21
+ /** One row group and the runners in it. */
22
+ export const GroupZ = z.object({
23
+ id: z.enum(['tasks', 'dependencies', 'tools', 'hooks', 'skills']),
24
+ title: z.string(),
25
+ runners: z.array(z.string()).describe('The runners whose reports fill it. Empty for skills.'),
26
+ });
27
+ /** One agent skill. Its text comes from files, so filter it before a terminal shows it. */
28
+ export const SkillZ = z.object({
29
+ id: z.string(),
30
+ name: z.string(),
31
+ description: z.string().nullable(),
32
+ argumentHint: z.string().nullable().describe('What to type after /<name>.'),
33
+ path: z.string().describe('The skill file: relative to the root inside it, else absolute.'),
34
+ scope: z.string(),
35
+ origin: z.string().describe('project, user, local, managed, or plugin:<id>.'),
36
+ harnesses: z.array(z.string()).describe('The agents that read this skill file.'),
37
+ invoke: z.string().describe('What the run action copies: /<name>.'),
38
+ });
39
+ /** One runner's cache verdict. */
40
+ export const CacheStateZ = z.object({
41
+ runner: z.string(),
42
+ state: z.enum(['fresh', 'stale', 'miss']),
43
+ reason: z.enum(['changed', 'max-age', 'excludes', 'exec', 'version', 'tool']).optional(),
44
+ ageMs: z.number().optional().describe('Age of the stored probe. 0 when probed just now.'),
45
+ estimateMs: z.number().nullable().describe('Expected refresh time. Null when never measured.'),
46
+ slow: z.boolean(),
47
+ cost: z.enum(['cheap', 'slow']).optional(),
48
+ probeMs: z.number().optional().describe('How long the probe took, when it ran in this call.'),
49
+ });
50
+ /** One thing wayfinder could not know, with the label every surface shows. */
51
+ export const UnknownZ = z.discriminatedUnion('kind', [
52
+ z.object({
53
+ kind: z.literal('withheld'),
54
+ runner: z.string(),
55
+ reason: z.enum(['untrusted', 'tool-untrusted', 'exec-off']),
56
+ missing: z
57
+ .array(z.string())
58
+ .optional()
59
+ .describe('The trust scopes the runner still needs: way trust --scope <id> for each.'),
60
+ label: z.string(),
61
+ }),
62
+ z.object({
63
+ kind: z.literal('parameters'),
64
+ runner: z.string(),
65
+ reason: z.enum(['exec-withheld', 'tool-missing', 'tool-failed', 'not-read', 'editor-variable']),
66
+ tasks: z.array(z.string()),
67
+ label: z.string(),
68
+ }),
69
+ z.object({
70
+ kind: z.literal('stale'),
71
+ runner: z.string(),
72
+ reason: z.enum(['changed', 'max-age', 'excludes', 'exec', 'version', 'tool']).optional(),
73
+ ageMs: z.number().optional(),
74
+ label: z.string(),
75
+ }),
76
+ z.object({
77
+ kind: z.literal('binary'),
78
+ runner: z.string(),
79
+ binary: z.string(),
80
+ label: z.string(),
81
+ }),
82
+ ]);
83
+ /** The filter a listing applied. Absent fields were not given. */
84
+ export const FilterZ = z.object({
85
+ query: z.string().optional(),
86
+ mode: z.enum(['fuzzy', 'exact']).optional(),
87
+ servicesOnly: z.boolean().optional(),
88
+ declaredOnly: z.boolean().optional(),
89
+ maxDepth: z.number().int().optional(),
90
+ });
91
+ /** `way list --json`: the catalog with its groups, cache verdicts and unknowns. */
92
+ export const CatalogOutput = z.object({
93
+ root: embedded(catalogProperties['root']),
94
+ generatedAt: embedded(catalogProperties['generatedAt']),
95
+ discovery: embedded(catalogProperties['discovery']),
96
+ allowExec: z.boolean(),
97
+ source: z
98
+ .enum(['fresh', 'cached'])
99
+ .describe('fresh: every runner was probed in this call. cached: under --cached, the rows came from the last saved listing, which checks no files, or else from the stored probes, where cache[] says which runners were stale or probed now.'),
100
+ storedAt: z
101
+ .string()
102
+ .nullable()
103
+ .describe('With source cached, when the oldest stored rows were probed (ISO 8601). Null when fresh.'),
104
+ reports: z.array(RunnerReportZ),
105
+ groups: z.array(GroupZ),
106
+ skills: z
107
+ .array(SkillZ)
108
+ .describe('Agent skills, the Skills group. The skills setting chooses which.'),
109
+ cache: z.array(CacheStateZ),
110
+ unknowns: z.array(UnknownZ),
111
+ trustedTools: z
112
+ .array(z.string())
113
+ .describe('The tool ids trusted on their own here. Empty when the repository is trusted as a whole.'),
114
+ filter: FilterZ,
115
+ });
116
+ /** The catalog document's `schemaVersion`: the catalog's own. */
117
+ export const CATALOG_DOCUMENT_VERSION = CATALOG_SCHEMA_VERSION;
118
+ /** `way query --json`: the matching tasks, best first. */
119
+ export const QueryOutput = z.object({
120
+ root: z.string(),
121
+ filter: FilterZ,
122
+ source: z
123
+ .enum(['fresh', 'cached'])
124
+ .describe('fresh: every runner was probed in this call. cached: under --cached, the rows came from the last saved listing, which checks no files, or else from the stored probes, where cache[] says which runners were stale or probed now.'),
125
+ storedAt: z
126
+ .string()
127
+ .nullable()
128
+ .describe('With source cached, when the oldest stored rows were probed (ISO 8601). Null when fresh.'),
129
+ tasks: z.array(TaskZ),
130
+ skills: z.array(SkillZ).describe('The matching agent skills, best first.'),
131
+ cache: z.array(CacheStateZ),
132
+ unknowns: z.array(UnknownZ),
133
+ });
134
+ /** One registered tool. */
135
+ export const ProviderZ = z.object({
136
+ id: z.string(),
137
+ roles: z.array(z.enum(['runner', 'packageManager', 'toolManager', 'hookManager'])),
138
+ kind: z.enum(['parse', 'exec']).nullable().describe("The runner role's kind; null with none."),
139
+ binary: z.string().nullable(),
140
+ onPath: z.boolean().nullable().describe('Whether binary is on the PATH; null with no binary.'),
141
+ source: z.enum(['built-in', 'custom']),
142
+ module: z.string().optional().describe('The module a custom tool came from.'),
143
+ homepage: z.string().nullable().describe("The tool's site, http or https only."),
144
+ description: z.string().nullable(),
145
+ ecosystem: z.string().nullable(),
146
+ language: z.string().describe('The language label, or "any language".'),
147
+ });
148
+ /** `way providers --json`. */
149
+ export const ProvidersOutput = z.object({ providers: z.array(ProviderZ) });
150
+ /** `way run --json`: what ran, or with `--dry-run` what would run. */
151
+ export const RunOutput = z.object({
152
+ task: z.string().describe('The task id.'),
153
+ display: z.string(),
154
+ argv: z.array(z.string()).min(1),
155
+ command: z
156
+ .string()
157
+ .describe('argv as one shell line, after a cd for a task with its own directory: what the text form prints.'),
158
+ cwd: z.string().describe('Absolute.'),
159
+ env: z.record(z.string(), z.string()).describe('Variables the arguments set.'),
160
+ ran: z.boolean(),
161
+ exit: z.number().int().nullable().describe("The task's exit code; null when it did not run."),
162
+ unknowns: z.array(UnknownZ),
163
+ });
package/dist/groups.d.ts CHANGED
@@ -1,34 +1,30 @@
1
1
  /**
2
2
  * The row groups every surface shows: tasks from runners, then the actions
3
3
  * system-model synthesizes from package managers, tool managers and hook
4
- * managers. Each synthesized group is one runner id, so grouping is a
5
- * property of the report. Browser-safe: the page imports it.
4
+ * managers, then agent skills. The report groups are
5
+ * `@osdlc/system-model/groups`; this module adds the order wayfinder sorts
6
+ * reports by and the Skills group, whose rows are `CatalogSnapshot.skills`
7
+ * rather than a report. Browser-safe: the page imports it.
6
8
  */
7
- /** A group's stable id, as `--json` prints it. */
8
- export type GroupId = 'tasks' | 'dependencies' | 'tools' | 'hooks';
9
- export interface Group {
10
- id: GroupId;
11
- title: string;
12
- /** The synthesized runner that fills it; absent for tasks, which every other runner fills. */
13
- runner?: string;
14
- }
15
- /**
16
- * In display order. The runner ids are `SYNTHESIZED_RUNNERS` from
17
- * `@osdlc/system-model/detect`, restated because that entry is not
18
- * browser-safe; a test checks they agree.
19
- */
20
- export declare const GROUPS: readonly Group[];
21
- /** The group a runner's report belongs to. */
22
- export declare function groupOf(runner: string): Group;
9
+ import { type GroupId } from '@osdlc/system-model/groups';
10
+ export { GROUPS, catalogGroups, groupOf } from '@osdlc/system-model/groups';
11
+ export type { Group, GroupId } from '@osdlc/system-model/groups';
12
+ export { runnerLabel } from './vocabulary.ts';
23
13
  /** Position of a runner's group in {@link GROUPS}. */
24
14
  export declare function groupRank(runner: string): number;
25
- /** What a tab shows for a runner: the group's name for a synthesized group, else the runner id. */
26
- export declare function runnerLabel(runner: string): string;
27
- /** The groups that have at least one report, each with its runners in report order. */
28
- export declare function catalogGroups(reports: readonly {
29
- runner: string;
30
- }[]): Array<{
31
- id: GroupId;
15
+ /** The Skills group. Its rows are skills, not a runner's tasks, so it names no runner. */
16
+ export declare const SKILLS_GROUP: {
17
+ readonly id: "skills";
18
+ readonly title: "Skills";
19
+ };
20
+ /** A group as a document lists it. */
21
+ export interface DocumentGroup {
22
+ id: GroupId | typeof SKILLS_GROUP.id;
32
23
  title: string;
24
+ /** The runners whose reports fill it. Empty for Skills. */
33
25
  runners: string[];
34
- }>;
26
+ }
27
+ /** The groups with rows, in display order: the report groups, then Skills when there are skills. */
28
+ export declare function documentGroups(reports: readonly {
29
+ runner: string;
30
+ }[], skillCount: number): DocumentGroup[];