thoth-agents 0.12.0 → 0.13.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 (43) hide show
  1. package/README.md +11 -2
  2. package/dist/{chunk-SEF6PFM6.js → chunk-5MYXVRZZ.js} +132 -157
  3. package/dist/chunk-6O4GKDS7.js +207 -0
  4. package/dist/{chunk-QOA2AETX.js → chunk-NOLDFT7O.js} +3 -3
  5. package/dist/{chunk-7F33WUSD.js → chunk-VVYAQTYE.js} +2 -2
  6. package/dist/{chunk-NY2IPJ7V.js → chunk-YCWGTDFE.js} +531 -233
  7. package/dist/cli/index.js +6 -6
  8. package/dist/cli/opencode-profiles.d.ts +10 -0
  9. package/dist/cli/tui/index.js +3 -3
  10. package/dist/config/loader.d.ts +1 -4
  11. package/dist/config/schema.d.ts +0 -22
  12. package/dist/index.js +824 -30
  13. package/dist/opencode/context.d.ts +16 -0
  14. package/dist/opencode/profile-rpc-handlers.d.ts +3 -0
  15. package/dist/opencode/profile-rpc.d.ts +688 -0
  16. package/dist/opencode/profile-runtime.d.ts +3 -0
  17. package/dist/opencode/profile-sessions.d.ts +18 -0
  18. package/dist/opencode/profiles/editor.d.ts +44 -0
  19. package/dist/opencode/profiles/index.d.ts +18 -0
  20. package/dist/opencode/profiles/resolver.d.ts +12 -0
  21. package/dist/opencode/profiles/store.d.ts +63 -0
  22. package/dist/opencode/profiles/types.d.ts +26 -0
  23. package/dist/opencode/tool-overrides/evaluator.d.ts +13 -0
  24. package/dist/opencode/tool-overrides/index.d.ts +5 -0
  25. package/dist/opencode/tool-overrides/store.d.ts +38 -0
  26. package/dist/opencode/tool-overrides/types.d.ts +32 -0
  27. package/dist/opencode/tool-overrides/validation.d.ts +5 -0
  28. package/dist/opencode/tool-overrides/wildcard.d.ts +3 -0
  29. package/dist/opencode/tool-rpc-handlers.d.ts +3 -0
  30. package/dist/opencode/tool-rpc.d.ts +428 -0
  31. package/dist/pi.js +2 -2
  32. package/dist/tui/fixtures.d.ts +2 -0
  33. package/dist/tui/flow.d.ts +16 -0
  34. package/dist/tui/index.d.ts +7 -0
  35. package/dist/tui/index.js +1384 -0
  36. package/dist/tui/model.d.ts +84 -0
  37. package/dist/tui/tools/fixtures.d.ts +3 -0
  38. package/dist/tui/tools/flow.d.ts +11 -0
  39. package/dist/tui/tools/model.d.ts +97 -0
  40. package/package.json +5 -1
  41. package/plugin/.claude-plugin/plugin.json +1 -1
  42. package/plugin/.codex-plugin/plugin.json +1 -1
  43. package/thoth-agents.schema.json +0 -70
@@ -0,0 +1,428 @@
1
+ /** Portable server/TUI contract: Zod only, no host or filesystem dependencies. */
2
+ import { z } from 'zod';
3
+ export declare const ToolRoleSchema: z.ZodEnum<{
4
+ explorer: "explorer";
5
+ librarian: "librarian";
6
+ oracle: "oracle";
7
+ designer: "designer";
8
+ worker: "worker";
9
+ }>;
10
+ export declare const ToolScopeSchema: z.ZodEnum<{
11
+ global: "global";
12
+ project: "project";
13
+ }>;
14
+ export declare const ToolEffectSchema: z.ZodEnum<{
15
+ allow: "allow";
16
+ ask: "ask";
17
+ deny: "deny";
18
+ }>;
19
+ export declare const ToolOriginSchema: z.ZodEnum<{
20
+ default: "default";
21
+ global: "global";
22
+ project: "project";
23
+ }>;
24
+ export declare const ActionOverrideSchema: z.ZodObject<{
25
+ action: z.ZodString;
26
+ effect: z.ZodEnum<{
27
+ allow: "allow";
28
+ ask: "ask";
29
+ deny: "deny";
30
+ }>;
31
+ }, z.core.$strip>;
32
+ export declare const ToolStateSchema: z.ZodObject<{
33
+ specialists: z.ZodArray<z.ZodEnum<{
34
+ explorer: "explorer";
35
+ librarian: "librarian";
36
+ oracle: "oracle";
37
+ designer: "designer";
38
+ worker: "worker";
39
+ }>>;
40
+ inventory: z.ZodArray<z.ZodObject<{
41
+ action: z.ZodString;
42
+ tools: z.ZodArray<z.ZodString>;
43
+ locked: z.ZodBoolean;
44
+ }, z.core.$strip>>;
45
+ roles: z.ZodArray<z.ZodObject<{
46
+ role: z.ZodEnum<{
47
+ explorer: "explorer";
48
+ librarian: "librarian";
49
+ oracle: "oracle";
50
+ designer: "designer";
51
+ worker: "worker";
52
+ }>;
53
+ effectiveScope: z.ZodEnum<{
54
+ default: "default";
55
+ global: "global";
56
+ project: "project";
57
+ }>;
58
+ global: z.ZodObject<{
59
+ present: z.ZodBoolean;
60
+ revision: z.ZodString;
61
+ overrides: z.ZodArray<z.ZodObject<{
62
+ action: z.ZodString;
63
+ effect: z.ZodEnum<{
64
+ allow: "allow";
65
+ ask: "ask";
66
+ deny: "deny";
67
+ }>;
68
+ matchCount: z.ZodNumber;
69
+ }, z.core.$strip>>;
70
+ }, z.core.$strip>;
71
+ project: z.ZodObject<{
72
+ present: z.ZodBoolean;
73
+ revision: z.ZodString;
74
+ overrides: z.ZodArray<z.ZodObject<{
75
+ action: z.ZodString;
76
+ effect: z.ZodEnum<{
77
+ allow: "allow";
78
+ ask: "ask";
79
+ deny: "deny";
80
+ }>;
81
+ matchCount: z.ZodNumber;
82
+ }, z.core.$strip>>;
83
+ }, z.core.$strip>;
84
+ actions: z.ZodArray<z.ZodObject<{
85
+ action: z.ZodString;
86
+ effect: z.ZodEnum<{
87
+ allow: "allow";
88
+ ask: "ask";
89
+ deny: "deny";
90
+ }>;
91
+ baseEffect: z.ZodEnum<{
92
+ allow: "allow";
93
+ ask: "ask";
94
+ deny: "deny";
95
+ }>;
96
+ origin: z.ZodEnum<{
97
+ default: "default";
98
+ global: "global";
99
+ project: "project";
100
+ }>;
101
+ locked: z.ZodBoolean;
102
+ }, z.core.$strip>>;
103
+ }, z.core.$strip>>;
104
+ warnings: z.ZodArray<z.ZodString>;
105
+ }, z.core.$strip>;
106
+ export declare const ToolErrorSchema: z.ZodObject<{
107
+ code: z.ZodEnum<{
108
+ TOOLS_CONFLICT: "TOOLS_CONFLICT";
109
+ INVALID_REQUEST: "INVALID_REQUEST";
110
+ OPERATION_FAILED: "OPERATION_FAILED";
111
+ }>;
112
+ message: z.ZodString;
113
+ }, z.core.$strip>;
114
+ export declare const toolRpc: {
115
+ readonly id: "thoth-tool-permissions";
116
+ readonly methods: {
117
+ readonly state: {
118
+ readonly input: z.ZodObject<{}, z.core.$strip>;
119
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
120
+ ok: z.ZodLiteral<true>;
121
+ value: z.ZodObject<{
122
+ specialists: z.ZodArray<z.ZodEnum<{
123
+ explorer: "explorer";
124
+ librarian: "librarian";
125
+ oracle: "oracle";
126
+ designer: "designer";
127
+ worker: "worker";
128
+ }>>;
129
+ inventory: z.ZodArray<z.ZodObject<{
130
+ action: z.ZodString;
131
+ tools: z.ZodArray<z.ZodString>;
132
+ locked: z.ZodBoolean;
133
+ }, z.core.$strip>>;
134
+ roles: z.ZodArray<z.ZodObject<{
135
+ role: z.ZodEnum<{
136
+ explorer: "explorer";
137
+ librarian: "librarian";
138
+ oracle: "oracle";
139
+ designer: "designer";
140
+ worker: "worker";
141
+ }>;
142
+ effectiveScope: z.ZodEnum<{
143
+ default: "default";
144
+ global: "global";
145
+ project: "project";
146
+ }>;
147
+ global: z.ZodObject<{
148
+ present: z.ZodBoolean;
149
+ revision: z.ZodString;
150
+ overrides: z.ZodArray<z.ZodObject<{
151
+ action: z.ZodString;
152
+ effect: z.ZodEnum<{
153
+ allow: "allow";
154
+ ask: "ask";
155
+ deny: "deny";
156
+ }>;
157
+ matchCount: z.ZodNumber;
158
+ }, z.core.$strip>>;
159
+ }, z.core.$strip>;
160
+ project: z.ZodObject<{
161
+ present: z.ZodBoolean;
162
+ revision: z.ZodString;
163
+ overrides: z.ZodArray<z.ZodObject<{
164
+ action: z.ZodString;
165
+ effect: z.ZodEnum<{
166
+ allow: "allow";
167
+ ask: "ask";
168
+ deny: "deny";
169
+ }>;
170
+ matchCount: z.ZodNumber;
171
+ }, z.core.$strip>>;
172
+ }, z.core.$strip>;
173
+ actions: z.ZodArray<z.ZodObject<{
174
+ action: z.ZodString;
175
+ effect: z.ZodEnum<{
176
+ allow: "allow";
177
+ ask: "ask";
178
+ deny: "deny";
179
+ }>;
180
+ baseEffect: z.ZodEnum<{
181
+ allow: "allow";
182
+ ask: "ask";
183
+ deny: "deny";
184
+ }>;
185
+ origin: z.ZodEnum<{
186
+ default: "default";
187
+ global: "global";
188
+ project: "project";
189
+ }>;
190
+ locked: z.ZodBoolean;
191
+ }, z.core.$strip>>;
192
+ }, z.core.$strip>>;
193
+ warnings: z.ZodArray<z.ZodString>;
194
+ }, z.core.$strip>;
195
+ }, z.core.$strip>, z.ZodObject<{
196
+ ok: z.ZodLiteral<false>;
197
+ error: z.ZodObject<{
198
+ code: z.ZodEnum<{
199
+ TOOLS_CONFLICT: "TOOLS_CONFLICT";
200
+ INVALID_REQUEST: "INVALID_REQUEST";
201
+ OPERATION_FAILED: "OPERATION_FAILED";
202
+ }>;
203
+ message: z.ZodString;
204
+ }, z.core.$strip>;
205
+ }, z.core.$strip>], "ok">;
206
+ };
207
+ readonly save: {
208
+ readonly input: z.ZodObject<{
209
+ scope: z.ZodEnum<{
210
+ global: "global";
211
+ project: "project";
212
+ }>;
213
+ role: z.ZodEnum<{
214
+ explorer: "explorer";
215
+ librarian: "librarian";
216
+ oracle: "oracle";
217
+ designer: "designer";
218
+ worker: "worker";
219
+ }>;
220
+ baseRevision: z.ZodString;
221
+ overrides: z.ZodArray<z.ZodObject<{
222
+ action: z.ZodString;
223
+ effect: z.ZodEnum<{
224
+ allow: "allow";
225
+ ask: "ask";
226
+ deny: "deny";
227
+ }>;
228
+ }, z.core.$strip>>;
229
+ }, z.core.$strip>;
230
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
231
+ ok: z.ZodLiteral<true>;
232
+ value: z.ZodObject<{
233
+ specialists: z.ZodArray<z.ZodEnum<{
234
+ explorer: "explorer";
235
+ librarian: "librarian";
236
+ oracle: "oracle";
237
+ designer: "designer";
238
+ worker: "worker";
239
+ }>>;
240
+ inventory: z.ZodArray<z.ZodObject<{
241
+ action: z.ZodString;
242
+ tools: z.ZodArray<z.ZodString>;
243
+ locked: z.ZodBoolean;
244
+ }, z.core.$strip>>;
245
+ roles: z.ZodArray<z.ZodObject<{
246
+ role: z.ZodEnum<{
247
+ explorer: "explorer";
248
+ librarian: "librarian";
249
+ oracle: "oracle";
250
+ designer: "designer";
251
+ worker: "worker";
252
+ }>;
253
+ effectiveScope: z.ZodEnum<{
254
+ default: "default";
255
+ global: "global";
256
+ project: "project";
257
+ }>;
258
+ global: z.ZodObject<{
259
+ present: z.ZodBoolean;
260
+ revision: z.ZodString;
261
+ overrides: z.ZodArray<z.ZodObject<{
262
+ action: z.ZodString;
263
+ effect: z.ZodEnum<{
264
+ allow: "allow";
265
+ ask: "ask";
266
+ deny: "deny";
267
+ }>;
268
+ matchCount: z.ZodNumber;
269
+ }, z.core.$strip>>;
270
+ }, z.core.$strip>;
271
+ project: z.ZodObject<{
272
+ present: z.ZodBoolean;
273
+ revision: z.ZodString;
274
+ overrides: z.ZodArray<z.ZodObject<{
275
+ action: z.ZodString;
276
+ effect: z.ZodEnum<{
277
+ allow: "allow";
278
+ ask: "ask";
279
+ deny: "deny";
280
+ }>;
281
+ matchCount: z.ZodNumber;
282
+ }, z.core.$strip>>;
283
+ }, z.core.$strip>;
284
+ actions: z.ZodArray<z.ZodObject<{
285
+ action: z.ZodString;
286
+ effect: z.ZodEnum<{
287
+ allow: "allow";
288
+ ask: "ask";
289
+ deny: "deny";
290
+ }>;
291
+ baseEffect: z.ZodEnum<{
292
+ allow: "allow";
293
+ ask: "ask";
294
+ deny: "deny";
295
+ }>;
296
+ origin: z.ZodEnum<{
297
+ default: "default";
298
+ global: "global";
299
+ project: "project";
300
+ }>;
301
+ locked: z.ZodBoolean;
302
+ }, z.core.$strip>>;
303
+ }, z.core.$strip>>;
304
+ warnings: z.ZodArray<z.ZodString>;
305
+ }, z.core.$strip>;
306
+ }, z.core.$strip>, z.ZodObject<{
307
+ ok: z.ZodLiteral<false>;
308
+ error: z.ZodObject<{
309
+ code: z.ZodEnum<{
310
+ TOOLS_CONFLICT: "TOOLS_CONFLICT";
311
+ INVALID_REQUEST: "INVALID_REQUEST";
312
+ OPERATION_FAILED: "OPERATION_FAILED";
313
+ }>;
314
+ message: z.ZodString;
315
+ }, z.core.$strip>;
316
+ }, z.core.$strip>], "ok">;
317
+ };
318
+ readonly reset: {
319
+ readonly input: z.ZodObject<{
320
+ scope: z.ZodEnum<{
321
+ global: "global";
322
+ project: "project";
323
+ }>;
324
+ role: z.ZodEnum<{
325
+ explorer: "explorer";
326
+ librarian: "librarian";
327
+ oracle: "oracle";
328
+ designer: "designer";
329
+ worker: "worker";
330
+ }>;
331
+ baseRevision: z.ZodString;
332
+ }, z.core.$strip>;
333
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
334
+ ok: z.ZodLiteral<true>;
335
+ value: z.ZodObject<{
336
+ specialists: z.ZodArray<z.ZodEnum<{
337
+ explorer: "explorer";
338
+ librarian: "librarian";
339
+ oracle: "oracle";
340
+ designer: "designer";
341
+ worker: "worker";
342
+ }>>;
343
+ inventory: z.ZodArray<z.ZodObject<{
344
+ action: z.ZodString;
345
+ tools: z.ZodArray<z.ZodString>;
346
+ locked: z.ZodBoolean;
347
+ }, z.core.$strip>>;
348
+ roles: z.ZodArray<z.ZodObject<{
349
+ role: z.ZodEnum<{
350
+ explorer: "explorer";
351
+ librarian: "librarian";
352
+ oracle: "oracle";
353
+ designer: "designer";
354
+ worker: "worker";
355
+ }>;
356
+ effectiveScope: z.ZodEnum<{
357
+ default: "default";
358
+ global: "global";
359
+ project: "project";
360
+ }>;
361
+ global: z.ZodObject<{
362
+ present: z.ZodBoolean;
363
+ revision: z.ZodString;
364
+ overrides: z.ZodArray<z.ZodObject<{
365
+ action: z.ZodString;
366
+ effect: z.ZodEnum<{
367
+ allow: "allow";
368
+ ask: "ask";
369
+ deny: "deny";
370
+ }>;
371
+ matchCount: z.ZodNumber;
372
+ }, z.core.$strip>>;
373
+ }, z.core.$strip>;
374
+ project: z.ZodObject<{
375
+ present: z.ZodBoolean;
376
+ revision: z.ZodString;
377
+ overrides: z.ZodArray<z.ZodObject<{
378
+ action: z.ZodString;
379
+ effect: z.ZodEnum<{
380
+ allow: "allow";
381
+ ask: "ask";
382
+ deny: "deny";
383
+ }>;
384
+ matchCount: z.ZodNumber;
385
+ }, z.core.$strip>>;
386
+ }, z.core.$strip>;
387
+ actions: z.ZodArray<z.ZodObject<{
388
+ action: z.ZodString;
389
+ effect: z.ZodEnum<{
390
+ allow: "allow";
391
+ ask: "ask";
392
+ deny: "deny";
393
+ }>;
394
+ baseEffect: z.ZodEnum<{
395
+ allow: "allow";
396
+ ask: "ask";
397
+ deny: "deny";
398
+ }>;
399
+ origin: z.ZodEnum<{
400
+ default: "default";
401
+ global: "global";
402
+ project: "project";
403
+ }>;
404
+ locked: z.ZodBoolean;
405
+ }, z.core.$strip>>;
406
+ }, z.core.$strip>>;
407
+ warnings: z.ZodArray<z.ZodString>;
408
+ }, z.core.$strip>;
409
+ }, z.core.$strip>, z.ZodObject<{
410
+ ok: z.ZodLiteral<false>;
411
+ error: z.ZodObject<{
412
+ code: z.ZodEnum<{
413
+ TOOLS_CONFLICT: "TOOLS_CONFLICT";
414
+ INVALID_REQUEST: "INVALID_REQUEST";
415
+ OPERATION_FAILED: "OPERATION_FAILED";
416
+ }>;
417
+ message: z.ZodString;
418
+ }, z.core.$strip>;
419
+ }, z.core.$strip>], "ok">;
420
+ };
421
+ };
422
+ readonly events: {};
423
+ };
424
+ export type ToolState = z.infer<typeof ToolStateSchema>;
425
+ export type ToolError = z.infer<typeof ToolErrorSchema>;
426
+ export type ToolRpcMethod = keyof typeof toolRpc.methods;
427
+ export type ToolRpcInput<M extends ToolRpcMethod> = z.infer<(typeof toolRpc.methods)[M]['input']>;
428
+ export type ToolRpcOutput<M extends ToolRpcMethod> = z.infer<(typeof toolRpc.methods)[M]['output']>;
package/dist/pi.js CHANGED
@@ -8,10 +8,10 @@ import {
8
8
  createPiToolsPanelAdapter,
9
9
  renderPiRootInstructions,
10
10
  syncPiSpecialists
11
- } from "./chunk-7F33WUSD.js";
11
+ } from "./chunk-VVYAQTYE.js";
12
12
  import {
13
13
  findPackageRoot
14
- } from "./chunk-NY2IPJ7V.js";
14
+ } from "./chunk-YCWGTDFE.js";
15
15
 
16
16
  // src/pi.ts
17
17
  import { homedir } from "os";
@@ -0,0 +1,2 @@
1
+ import type { ProfileState } from '../opencode/profile-rpc';
2
+ export declare function makeState(overrides?: Partial<ProfileState>): ProfileState;
@@ -0,0 +1,16 @@
1
+ /** `/subagents-model` flow. Talks only to injected UI and RPC ports. */
2
+ import type { Plugin } from '@opencode/plugin/tui';
3
+ import type { ProfileRpcInput, ProfileRpcMethod, ProfileRpcOutput } from '../opencode/profile-rpc';
4
+ export type Ui = Pick<Plugin.Context['ui']['dialog'], 'select' | 'prompt' | 'confirm' | 'alert'> & {
5
+ toast: Pick<Plugin.Context['ui']['toast'], 'show'>;
6
+ };
7
+ export type RpcPort = {
8
+ [M in ProfileRpcMethod]: (input: ProfileRpcInput<M>) => Promise<ProfileRpcOutput<M>>;
9
+ };
10
+ export interface FlowPorts {
11
+ ui: Ui;
12
+ rpc: RpcPort;
13
+ /** Current session, if the TUI is showing one. */
14
+ sessionID: () => string | undefined;
15
+ }
16
+ export declare function runModelProfilesFlow(ports: FlowPorts): Promise<void>;
@@ -0,0 +1,7 @@
1
+ import type { Plugin } from '@opencode/plugin/tui';
2
+ /**
3
+ * `Plugin.define` is an identity helper, so the definition is exported as a typed
4
+ * object; that keeps the bundle free of the host's UI runtime dependencies.
5
+ */
6
+ declare const plugin: Plugin.Definition;
7
+ export default plugin;