@osdlc/wayfinder 0.7.4 → 0.9.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 +240 -0
  2. package/CONTRIBUTING.md +6 -0
  3. package/README.md +310 -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 +45 -4
  14. package/dist/catalog.js +134 -13
  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 +153 -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 +224 -0
  24. package/dist/commands/list.js +178 -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 +272 -257
  36. package/dist/config.js +611 -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 +282 -0
  46. package/dist/core/session.js +602 -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 +508 -0
  56. package/dist/documents.js +181 -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 +118 -0
  62. package/dist/index.js +61 -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 +63 -0
  74. package/dist/serve/catalog-share.js +155 -0
  75. package/dist/serve/index.d.ts +100 -0
  76. package/dist/serve/index.js +259 -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 +193 -0
  92. package/dist/tui/app.js +1400 -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 +91 -0
  106. package/dist/vocabulary.js +155 -0
  107. package/dist/web/main.js +2232 -582
  108. package/dist/web/page.html +41 -33
  109. package/dist/web/styles.css +513 -329
  110. package/dist/xdg.d.ts +76 -4
  111. package/dist/xdg.js +77 -5
  112. package/package.json +27 -8
  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,508 @@
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
+ /**
228
+ * One line `list --progress` sends while it probes, before the catalog
229
+ * document: which runners have not answered, and the one that just did.
230
+ */
231
+ export declare const CatalogProgressOutput: z.ZodObject<{
232
+ pending: z.ZodArray<z.ZodString>;
233
+ total: z.ZodNumber;
234
+ report: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
235
+ omitted: z.ZodOptional<z.ZodString>;
236
+ cache: z.ZodOptional<z.ZodObject<{
237
+ runner: z.ZodString;
238
+ state: z.ZodEnum<{
239
+ fresh: "fresh";
240
+ stale: "stale";
241
+ miss: "miss";
242
+ }>;
243
+ reason: z.ZodOptional<z.ZodEnum<{
244
+ changed: "changed";
245
+ "max-age": "max-age";
246
+ excludes: "excludes";
247
+ exec: "exec";
248
+ version: "version";
249
+ tool: "tool";
250
+ }>>;
251
+ ageMs: z.ZodOptional<z.ZodNumber>;
252
+ estimateMs: z.ZodNullable<z.ZodNumber>;
253
+ slow: z.ZodBoolean;
254
+ cost: z.ZodOptional<z.ZodEnum<{
255
+ slow: "slow";
256
+ cheap: "cheap";
257
+ }>>;
258
+ probeMs: z.ZodOptional<z.ZodNumber>;
259
+ }, z.core.$strip>>;
260
+ unknowns: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
261
+ kind: z.ZodLiteral<"withheld">;
262
+ runner: z.ZodString;
263
+ reason: z.ZodEnum<{
264
+ untrusted: "untrusted";
265
+ "tool-untrusted": "tool-untrusted";
266
+ "exec-off": "exec-off";
267
+ }>;
268
+ missing: z.ZodOptional<z.ZodArray<z.ZodString>>;
269
+ label: z.ZodString;
270
+ }, z.core.$strip>, z.ZodObject<{
271
+ kind: z.ZodLiteral<"parameters">;
272
+ runner: z.ZodString;
273
+ reason: z.ZodEnum<{
274
+ "exec-withheld": "exec-withheld";
275
+ "tool-missing": "tool-missing";
276
+ "tool-failed": "tool-failed";
277
+ "not-read": "not-read";
278
+ "editor-variable": "editor-variable";
279
+ }>;
280
+ tasks: z.ZodArray<z.ZodString>;
281
+ label: z.ZodString;
282
+ }, z.core.$strip>, z.ZodObject<{
283
+ kind: z.ZodLiteral<"stale">;
284
+ runner: z.ZodString;
285
+ reason: z.ZodOptional<z.ZodEnum<{
286
+ changed: "changed";
287
+ "max-age": "max-age";
288
+ excludes: "excludes";
289
+ exec: "exec";
290
+ version: "version";
291
+ tool: "tool";
292
+ }>>;
293
+ ageMs: z.ZodOptional<z.ZodNumber>;
294
+ label: z.ZodString;
295
+ }, z.core.$strip>, z.ZodObject<{
296
+ kind: z.ZodLiteral<"binary">;
297
+ runner: z.ZodString;
298
+ binary: z.ZodString;
299
+ label: z.ZodString;
300
+ }, z.core.$strip>], "kind">>>;
301
+ }, z.core.$strip>;
302
+ /** The catalog document's `schemaVersion`: the catalog's own. */
303
+ export declare const CATALOG_DOCUMENT_VERSION = 1;
304
+ /** `way query --json`: the matching tasks, best first. */
305
+ export declare const QueryOutput: z.ZodObject<{
306
+ root: z.ZodString;
307
+ filter: z.ZodObject<{
308
+ query: z.ZodOptional<z.ZodString>;
309
+ mode: z.ZodOptional<z.ZodEnum<{
310
+ exact: "exact";
311
+ fuzzy: "fuzzy";
312
+ }>>;
313
+ servicesOnly: z.ZodOptional<z.ZodBoolean>;
314
+ declaredOnly: z.ZodOptional<z.ZodBoolean>;
315
+ maxDepth: z.ZodOptional<z.ZodNumber>;
316
+ }, z.core.$strip>;
317
+ source: z.ZodEnum<{
318
+ fresh: "fresh";
319
+ cached: "cached";
320
+ }>;
321
+ storedAt: z.ZodNullable<z.ZodString>;
322
+ tasks: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
323
+ skills: z.ZodArray<z.ZodObject<{
324
+ id: z.ZodString;
325
+ name: z.ZodString;
326
+ description: z.ZodNullable<z.ZodString>;
327
+ argumentHint: z.ZodNullable<z.ZodString>;
328
+ path: z.ZodString;
329
+ scope: z.ZodString;
330
+ origin: z.ZodString;
331
+ harnesses: z.ZodArray<z.ZodString>;
332
+ invoke: z.ZodString;
333
+ }, z.core.$strip>>;
334
+ cache: z.ZodArray<z.ZodObject<{
335
+ runner: z.ZodString;
336
+ state: z.ZodEnum<{
337
+ fresh: "fresh";
338
+ stale: "stale";
339
+ miss: "miss";
340
+ }>;
341
+ reason: z.ZodOptional<z.ZodEnum<{
342
+ changed: "changed";
343
+ "max-age": "max-age";
344
+ excludes: "excludes";
345
+ exec: "exec";
346
+ version: "version";
347
+ tool: "tool";
348
+ }>>;
349
+ ageMs: z.ZodOptional<z.ZodNumber>;
350
+ estimateMs: z.ZodNullable<z.ZodNumber>;
351
+ slow: z.ZodBoolean;
352
+ cost: z.ZodOptional<z.ZodEnum<{
353
+ slow: "slow";
354
+ cheap: "cheap";
355
+ }>>;
356
+ probeMs: z.ZodOptional<z.ZodNumber>;
357
+ }, z.core.$strip>>;
358
+ unknowns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
359
+ kind: z.ZodLiteral<"withheld">;
360
+ runner: z.ZodString;
361
+ reason: z.ZodEnum<{
362
+ untrusted: "untrusted";
363
+ "tool-untrusted": "tool-untrusted";
364
+ "exec-off": "exec-off";
365
+ }>;
366
+ missing: z.ZodOptional<z.ZodArray<z.ZodString>>;
367
+ label: z.ZodString;
368
+ }, z.core.$strip>, z.ZodObject<{
369
+ kind: z.ZodLiteral<"parameters">;
370
+ runner: z.ZodString;
371
+ reason: z.ZodEnum<{
372
+ "exec-withheld": "exec-withheld";
373
+ "tool-missing": "tool-missing";
374
+ "tool-failed": "tool-failed";
375
+ "not-read": "not-read";
376
+ "editor-variable": "editor-variable";
377
+ }>;
378
+ tasks: z.ZodArray<z.ZodString>;
379
+ label: z.ZodString;
380
+ }, z.core.$strip>, z.ZodObject<{
381
+ kind: z.ZodLiteral<"stale">;
382
+ runner: z.ZodString;
383
+ reason: z.ZodOptional<z.ZodEnum<{
384
+ changed: "changed";
385
+ "max-age": "max-age";
386
+ excludes: "excludes";
387
+ exec: "exec";
388
+ version: "version";
389
+ tool: "tool";
390
+ }>>;
391
+ ageMs: z.ZodOptional<z.ZodNumber>;
392
+ label: z.ZodString;
393
+ }, z.core.$strip>, z.ZodObject<{
394
+ kind: z.ZodLiteral<"binary">;
395
+ runner: z.ZodString;
396
+ binary: z.ZodString;
397
+ label: z.ZodString;
398
+ }, z.core.$strip>], "kind">>;
399
+ }, z.core.$strip>;
400
+ /** One registered tool. */
401
+ export declare const ProviderZ: z.ZodObject<{
402
+ id: z.ZodString;
403
+ roles: z.ZodArray<z.ZodEnum<{
404
+ runner: "runner";
405
+ packageManager: "packageManager";
406
+ toolManager: "toolManager";
407
+ hookManager: "hookManager";
408
+ }>>;
409
+ kind: z.ZodNullable<z.ZodEnum<{
410
+ exec: "exec";
411
+ parse: "parse";
412
+ }>>;
413
+ binary: z.ZodNullable<z.ZodString>;
414
+ onPath: z.ZodNullable<z.ZodBoolean>;
415
+ source: z.ZodEnum<{
416
+ custom: "custom";
417
+ "built-in": "built-in";
418
+ }>;
419
+ module: z.ZodOptional<z.ZodString>;
420
+ homepage: z.ZodNullable<z.ZodString>;
421
+ description: z.ZodNullable<z.ZodString>;
422
+ ecosystem: z.ZodNullable<z.ZodString>;
423
+ language: z.ZodString;
424
+ }, z.core.$strip>;
425
+ /** `way providers --json`. */
426
+ export declare const ProvidersOutput: z.ZodObject<{
427
+ providers: z.ZodArray<z.ZodObject<{
428
+ id: z.ZodString;
429
+ roles: z.ZodArray<z.ZodEnum<{
430
+ runner: "runner";
431
+ packageManager: "packageManager";
432
+ toolManager: "toolManager";
433
+ hookManager: "hookManager";
434
+ }>>;
435
+ kind: z.ZodNullable<z.ZodEnum<{
436
+ exec: "exec";
437
+ parse: "parse";
438
+ }>>;
439
+ binary: z.ZodNullable<z.ZodString>;
440
+ onPath: z.ZodNullable<z.ZodBoolean>;
441
+ source: z.ZodEnum<{
442
+ custom: "custom";
443
+ "built-in": "built-in";
444
+ }>;
445
+ module: z.ZodOptional<z.ZodString>;
446
+ homepage: z.ZodNullable<z.ZodString>;
447
+ description: z.ZodNullable<z.ZodString>;
448
+ ecosystem: z.ZodNullable<z.ZodString>;
449
+ language: z.ZodString;
450
+ }, z.core.$strip>>;
451
+ }, z.core.$strip>;
452
+ /** `way run --json`: what ran, or with `--dry-run` what would run. */
453
+ export declare const RunOutput: z.ZodObject<{
454
+ task: z.ZodString;
455
+ display: z.ZodString;
456
+ argv: z.ZodArray<z.ZodString>;
457
+ command: z.ZodString;
458
+ cwd: z.ZodString;
459
+ env: z.ZodRecord<z.ZodString, z.ZodString>;
460
+ ran: z.ZodBoolean;
461
+ exit: z.ZodNullable<z.ZodNumber>;
462
+ unknowns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
463
+ kind: z.ZodLiteral<"withheld">;
464
+ runner: z.ZodString;
465
+ reason: z.ZodEnum<{
466
+ untrusted: "untrusted";
467
+ "tool-untrusted": "tool-untrusted";
468
+ "exec-off": "exec-off";
469
+ }>;
470
+ missing: z.ZodOptional<z.ZodArray<z.ZodString>>;
471
+ label: z.ZodString;
472
+ }, z.core.$strip>, z.ZodObject<{
473
+ kind: z.ZodLiteral<"parameters">;
474
+ runner: z.ZodString;
475
+ reason: z.ZodEnum<{
476
+ "exec-withheld": "exec-withheld";
477
+ "tool-missing": "tool-missing";
478
+ "tool-failed": "tool-failed";
479
+ "not-read": "not-read";
480
+ "editor-variable": "editor-variable";
481
+ }>;
482
+ tasks: z.ZodArray<z.ZodString>;
483
+ label: z.ZodString;
484
+ }, z.core.$strip>, z.ZodObject<{
485
+ kind: z.ZodLiteral<"stale">;
486
+ runner: z.ZodString;
487
+ reason: z.ZodOptional<z.ZodEnum<{
488
+ changed: "changed";
489
+ "max-age": "max-age";
490
+ excludes: "excludes";
491
+ exec: "exec";
492
+ version: "version";
493
+ tool: "tool";
494
+ }>>;
495
+ ageMs: z.ZodOptional<z.ZodNumber>;
496
+ label: z.ZodString;
497
+ }, z.core.$strip>, z.ZodObject<{
498
+ kind: z.ZodLiteral<"binary">;
499
+ runner: z.ZodString;
500
+ binary: z.ZodString;
501
+ label: z.ZodString;
502
+ }, z.core.$strip>], "kind">>;
503
+ }, z.core.$strip>;
504
+ export type CatalogDocumentBody = z.input<typeof CatalogOutput>;
505
+ export type CatalogProgressBody = z.input<typeof CatalogProgressOutput>;
506
+ export type QueryDocumentBody = z.input<typeof QueryOutput>;
507
+ export type ProvidersDocumentBody = z.input<typeof ProvidersOutput>;
508
+ export type RunDocumentBody = z.input<typeof RunOutput>;
@@ -0,0 +1,181 @@
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
+ /**
117
+ * One line `list --progress` sends while it probes, before the catalog
118
+ * document: which runners have not answered, and the one that just did.
119
+ */
120
+ export const CatalogProgressOutput = z.object({
121
+ pending: z.array(z.string()).describe('The runners that have not answered yet, in report order.'),
122
+ total: z.number().int().describe('How many runners the probe reports.'),
123
+ report: RunnerReportZ.optional().describe('The runner that answered. Absent on the first line, which only names the runners, and when omitted is set.'),
124
+ omitted: z
125
+ .string()
126
+ .optional()
127
+ .describe('A runner that answered with a report too large for one line. Its rows come with the catalog document.'),
128
+ cache: CacheStateZ.optional().describe("The answered runner's cache verdict."),
129
+ unknowns: z
130
+ .array(UnknownZ)
131
+ .optional()
132
+ .describe('What could not be read about the answered runner.'),
133
+ });
134
+ /** The catalog document's `schemaVersion`: the catalog's own. */
135
+ export const CATALOG_DOCUMENT_VERSION = CATALOG_SCHEMA_VERSION;
136
+ /** `way query --json`: the matching tasks, best first. */
137
+ export const QueryOutput = z.object({
138
+ root: z.string(),
139
+ filter: FilterZ,
140
+ source: z
141
+ .enum(['fresh', 'cached'])
142
+ .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.'),
143
+ storedAt: z
144
+ .string()
145
+ .nullable()
146
+ .describe('With source cached, when the oldest stored rows were probed (ISO 8601). Null when fresh.'),
147
+ tasks: z.array(TaskZ),
148
+ skills: z.array(SkillZ).describe('The matching agent skills, best first.'),
149
+ cache: z.array(CacheStateZ),
150
+ unknowns: z.array(UnknownZ),
151
+ });
152
+ /** One registered tool. */
153
+ export const ProviderZ = z.object({
154
+ id: z.string(),
155
+ roles: z.array(z.enum(['runner', 'packageManager', 'toolManager', 'hookManager'])),
156
+ kind: z.enum(['parse', 'exec']).nullable().describe("The runner role's kind; null with none."),
157
+ binary: z.string().nullable(),
158
+ onPath: z.boolean().nullable().describe('Whether binary is on the PATH; null with no binary.'),
159
+ source: z.enum(['built-in', 'custom']),
160
+ module: z.string().optional().describe('The module a custom tool came from.'),
161
+ homepage: z.string().nullable().describe("The tool's site, http or https only."),
162
+ description: z.string().nullable(),
163
+ ecosystem: z.string().nullable(),
164
+ language: z.string().describe('The language label, or "any language".'),
165
+ });
166
+ /** `way providers --json`. */
167
+ export const ProvidersOutput = z.object({ providers: z.array(ProviderZ) });
168
+ /** `way run --json`: what ran, or with `--dry-run` what would run. */
169
+ export const RunOutput = z.object({
170
+ task: z.string().describe('The task id.'),
171
+ display: z.string(),
172
+ argv: z.array(z.string()).min(1),
173
+ command: z
174
+ .string()
175
+ .describe('argv as one shell line, after a cd for a task with its own directory: what the text form prints.'),
176
+ cwd: z.string().describe('Absolute.'),
177
+ env: z.record(z.string(), z.string()).describe('Variables the arguments set.'),
178
+ ran: z.boolean(),
179
+ exit: z.number().int().nullable().describe("The task's exit code; null when it did not run."),
180
+ unknowns: z.array(UnknownZ),
181
+ });