opencode-command-hooks 0.3.0 → 0.4.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.
- package/README.md +69 -17
- package/dist/config/global.d.ts +20 -8
- package/dist/config/global.d.ts.map +1 -1
- package/dist/config/global.js +189 -71
- package/dist/config/global.js.map +1 -1
- package/dist/config/markdown.d.ts.map +1 -1
- package/dist/config/markdown.js +35 -10
- package/dist/config/markdown.js.map +1 -1
- package/dist/config/merge.d.ts.map +1 -1
- package/dist/config/merge.js +87 -34
- package/dist/config/merge.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.ts +87 -12
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +17 -2
- package/dist/schemas.js.map +1 -1
- package/dist/types/hooks.d.ts +11 -0
- package/dist/types/hooks.d.ts.map +1 -1
- package/package.json +3 -2
package/dist/schemas.d.ts
CHANGED
|
@@ -13,16 +13,60 @@ declare const ToolHookWhenSchema: z.ZodObject<{
|
|
|
13
13
|
tool: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
14
14
|
callingAgent: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
15
15
|
slashCommand: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
16
|
+
toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
16
17
|
}, "strip", z.ZodTypeAny, {
|
|
17
18
|
phase: "before" | "after";
|
|
18
19
|
tool?: string | string[] | undefined;
|
|
19
20
|
callingAgent?: string | string[] | undefined;
|
|
20
21
|
slashCommand?: string | string[] | undefined;
|
|
22
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
21
23
|
}, {
|
|
22
24
|
phase: "before" | "after";
|
|
23
25
|
tool?: string | string[] | undefined;
|
|
24
26
|
callingAgent?: string | string[] | undefined;
|
|
25
27
|
slashCommand?: string | string[] | undefined;
|
|
28
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Simplified hook entry schema for markdown frontmatter `hooks` format
|
|
32
|
+
*/
|
|
33
|
+
export declare const SimplifiedHookEntrySchema: z.ZodObject<{
|
|
34
|
+
run: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
35
|
+
inject: z.ZodOptional<z.ZodString>;
|
|
36
|
+
toast: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
title: z.ZodOptional<z.ZodString>;
|
|
38
|
+
message: z.ZodString;
|
|
39
|
+
variant: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
|
|
40
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
message: string;
|
|
43
|
+
title?: string | undefined;
|
|
44
|
+
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
45
|
+
duration?: number | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
message: string;
|
|
48
|
+
title?: string | undefined;
|
|
49
|
+
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
50
|
+
duration?: number | undefined;
|
|
51
|
+
}>>;
|
|
52
|
+
}, "strict", z.ZodTypeAny, {
|
|
53
|
+
run: string | string[];
|
|
54
|
+
inject?: string | undefined;
|
|
55
|
+
toast?: {
|
|
56
|
+
message: string;
|
|
57
|
+
title?: string | undefined;
|
|
58
|
+
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
59
|
+
duration?: number | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
run: string | string[];
|
|
63
|
+
inject?: string | undefined;
|
|
64
|
+
toast?: {
|
|
65
|
+
message: string;
|
|
66
|
+
title?: string | undefined;
|
|
67
|
+
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
68
|
+
duration?: number | undefined;
|
|
69
|
+
} | undefined;
|
|
26
70
|
}>;
|
|
27
71
|
/**
|
|
28
72
|
* Tool hook configuration
|
|
@@ -38,16 +82,19 @@ export declare const ToolHookSchema: z.ZodObject<{
|
|
|
38
82
|
tool: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
39
83
|
callingAgent: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
40
84
|
slashCommand: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
85
|
+
toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
41
86
|
}, "strip", z.ZodTypeAny, {
|
|
42
87
|
phase: "before" | "after";
|
|
43
88
|
tool?: string | string[] | undefined;
|
|
44
89
|
callingAgent?: string | string[] | undefined;
|
|
45
90
|
slashCommand?: string | string[] | undefined;
|
|
91
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
46
92
|
}, {
|
|
47
93
|
phase: "before" | "after";
|
|
48
94
|
tool?: string | string[] | undefined;
|
|
49
95
|
callingAgent?: string | string[] | undefined;
|
|
50
96
|
slashCommand?: string | string[] | undefined;
|
|
97
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
51
98
|
}>;
|
|
52
99
|
run: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
53
100
|
inject: z.ZodOptional<z.ZodString>;
|
|
@@ -67,15 +114,17 @@ export declare const ToolHookSchema: z.ZodObject<{
|
|
|
67
114
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
68
115
|
duration?: number | undefined;
|
|
69
116
|
}>>;
|
|
117
|
+
overrideGlobal: z.ZodOptional<z.ZodBoolean>;
|
|
70
118
|
}, "strip", z.ZodTypeAny, {
|
|
71
119
|
id: string;
|
|
120
|
+
run: string | string[];
|
|
72
121
|
when: {
|
|
73
122
|
phase: "before" | "after";
|
|
74
123
|
tool?: string | string[] | undefined;
|
|
75
124
|
callingAgent?: string | string[] | undefined;
|
|
76
125
|
slashCommand?: string | string[] | undefined;
|
|
126
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
77
127
|
};
|
|
78
|
-
run: string | string[];
|
|
79
128
|
inject?: string | undefined;
|
|
80
129
|
toast?: {
|
|
81
130
|
message: string;
|
|
@@ -83,15 +132,17 @@ export declare const ToolHookSchema: z.ZodObject<{
|
|
|
83
132
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
84
133
|
duration?: number | undefined;
|
|
85
134
|
} | undefined;
|
|
135
|
+
overrideGlobal?: boolean | undefined;
|
|
86
136
|
}, {
|
|
87
137
|
id: string;
|
|
138
|
+
run: string | string[];
|
|
88
139
|
when: {
|
|
89
140
|
phase: "before" | "after";
|
|
90
141
|
tool?: string | string[] | undefined;
|
|
91
142
|
callingAgent?: string | string[] | undefined;
|
|
92
143
|
slashCommand?: string | string[] | undefined;
|
|
144
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
93
145
|
};
|
|
94
|
-
run: string | string[];
|
|
95
146
|
inject?: string | undefined;
|
|
96
147
|
toast?: {
|
|
97
148
|
message: string;
|
|
@@ -99,6 +150,7 @@ export declare const ToolHookSchema: z.ZodObject<{
|
|
|
99
150
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
100
151
|
duration?: number | undefined;
|
|
101
152
|
} | undefined;
|
|
153
|
+
overrideGlobal?: boolean | undefined;
|
|
102
154
|
}>;
|
|
103
155
|
/**
|
|
104
156
|
* Matching conditions for session hooks
|
|
@@ -150,13 +202,14 @@ export declare const SessionHookSchema: z.ZodObject<{
|
|
|
150
202
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
151
203
|
duration?: number | undefined;
|
|
152
204
|
}>>;
|
|
205
|
+
overrideGlobal: z.ZodOptional<z.ZodBoolean>;
|
|
153
206
|
}, "strip", z.ZodTypeAny, {
|
|
154
207
|
id: string;
|
|
208
|
+
run: string | string[];
|
|
155
209
|
when: {
|
|
156
210
|
event: "session.created" | "session.idle" | "session.end" | "session.start";
|
|
157
211
|
agent?: string | string[] | undefined;
|
|
158
212
|
};
|
|
159
|
-
run: string | string[];
|
|
160
213
|
inject?: string | undefined;
|
|
161
214
|
toast?: {
|
|
162
215
|
message: string;
|
|
@@ -164,13 +217,14 @@ export declare const SessionHookSchema: z.ZodObject<{
|
|
|
164
217
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
165
218
|
duration?: number | undefined;
|
|
166
219
|
} | undefined;
|
|
220
|
+
overrideGlobal?: boolean | undefined;
|
|
167
221
|
}, {
|
|
168
222
|
id: string;
|
|
223
|
+
run: string | string[];
|
|
169
224
|
when: {
|
|
170
225
|
event: "session.created" | "session.idle" | "session.end" | "session.start";
|
|
171
226
|
agent?: string | string[] | undefined;
|
|
172
227
|
};
|
|
173
|
-
run: string | string[];
|
|
174
228
|
inject?: string | undefined;
|
|
175
229
|
toast?: {
|
|
176
230
|
message: string;
|
|
@@ -178,6 +232,7 @@ export declare const SessionHookSchema: z.ZodObject<{
|
|
|
178
232
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
179
233
|
duration?: number | undefined;
|
|
180
234
|
} | undefined;
|
|
235
|
+
overrideGlobal?: boolean | undefined;
|
|
181
236
|
}>;
|
|
182
237
|
/**
|
|
183
238
|
* Top-level command hooks configuration
|
|
@@ -187,6 +242,7 @@ export declare const SessionHookSchema: z.ZodObject<{
|
|
|
187
242
|
*/
|
|
188
243
|
export declare const ConfigSchema: z.ZodObject<{
|
|
189
244
|
truncationLimit: z.ZodOptional<z.ZodNumber>;
|
|
245
|
+
ignoreGlobalConfig: z.ZodOptional<z.ZodBoolean>;
|
|
190
246
|
tool: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
191
247
|
id: z.ZodString;
|
|
192
248
|
when: z.ZodObject<{
|
|
@@ -194,16 +250,19 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
194
250
|
tool: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
195
251
|
callingAgent: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
196
252
|
slashCommand: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
253
|
+
toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
197
254
|
}, "strip", z.ZodTypeAny, {
|
|
198
255
|
phase: "before" | "after";
|
|
199
256
|
tool?: string | string[] | undefined;
|
|
200
257
|
callingAgent?: string | string[] | undefined;
|
|
201
258
|
slashCommand?: string | string[] | undefined;
|
|
259
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
202
260
|
}, {
|
|
203
261
|
phase: "before" | "after";
|
|
204
262
|
tool?: string | string[] | undefined;
|
|
205
263
|
callingAgent?: string | string[] | undefined;
|
|
206
264
|
slashCommand?: string | string[] | undefined;
|
|
265
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
207
266
|
}>;
|
|
208
267
|
run: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
209
268
|
inject: z.ZodOptional<z.ZodString>;
|
|
@@ -223,15 +282,17 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
223
282
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
224
283
|
duration?: number | undefined;
|
|
225
284
|
}>>;
|
|
285
|
+
overrideGlobal: z.ZodOptional<z.ZodBoolean>;
|
|
226
286
|
}, "strip", z.ZodTypeAny, {
|
|
227
287
|
id: string;
|
|
288
|
+
run: string | string[];
|
|
228
289
|
when: {
|
|
229
290
|
phase: "before" | "after";
|
|
230
291
|
tool?: string | string[] | undefined;
|
|
231
292
|
callingAgent?: string | string[] | undefined;
|
|
232
293
|
slashCommand?: string | string[] | undefined;
|
|
294
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
233
295
|
};
|
|
234
|
-
run: string | string[];
|
|
235
296
|
inject?: string | undefined;
|
|
236
297
|
toast?: {
|
|
237
298
|
message: string;
|
|
@@ -239,15 +300,17 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
239
300
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
240
301
|
duration?: number | undefined;
|
|
241
302
|
} | undefined;
|
|
303
|
+
overrideGlobal?: boolean | undefined;
|
|
242
304
|
}, {
|
|
243
305
|
id: string;
|
|
306
|
+
run: string | string[];
|
|
244
307
|
when: {
|
|
245
308
|
phase: "before" | "after";
|
|
246
309
|
tool?: string | string[] | undefined;
|
|
247
310
|
callingAgent?: string | string[] | undefined;
|
|
248
311
|
slashCommand?: string | string[] | undefined;
|
|
312
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
249
313
|
};
|
|
250
|
-
run: string | string[];
|
|
251
314
|
inject?: string | undefined;
|
|
252
315
|
toast?: {
|
|
253
316
|
message: string;
|
|
@@ -255,6 +318,7 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
255
318
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
256
319
|
duration?: number | undefined;
|
|
257
320
|
} | undefined;
|
|
321
|
+
overrideGlobal?: boolean | undefined;
|
|
258
322
|
}>, "many">>;
|
|
259
323
|
session: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
260
324
|
id: z.ZodString;
|
|
@@ -286,13 +350,14 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
286
350
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
287
351
|
duration?: number | undefined;
|
|
288
352
|
}>>;
|
|
353
|
+
overrideGlobal: z.ZodOptional<z.ZodBoolean>;
|
|
289
354
|
}, "strip", z.ZodTypeAny, {
|
|
290
355
|
id: string;
|
|
356
|
+
run: string | string[];
|
|
291
357
|
when: {
|
|
292
358
|
event: "session.created" | "session.idle" | "session.end" | "session.start";
|
|
293
359
|
agent?: string | string[] | undefined;
|
|
294
360
|
};
|
|
295
|
-
run: string | string[];
|
|
296
361
|
inject?: string | undefined;
|
|
297
362
|
toast?: {
|
|
298
363
|
message: string;
|
|
@@ -300,13 +365,14 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
300
365
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
301
366
|
duration?: number | undefined;
|
|
302
367
|
} | undefined;
|
|
368
|
+
overrideGlobal?: boolean | undefined;
|
|
303
369
|
}, {
|
|
304
370
|
id: string;
|
|
371
|
+
run: string | string[];
|
|
305
372
|
when: {
|
|
306
373
|
event: "session.created" | "session.idle" | "session.end" | "session.start";
|
|
307
374
|
agent?: string | string[] | undefined;
|
|
308
375
|
};
|
|
309
|
-
run: string | string[];
|
|
310
376
|
inject?: string | undefined;
|
|
311
377
|
toast?: {
|
|
312
378
|
message: string;
|
|
@@ -314,17 +380,19 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
314
380
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
315
381
|
duration?: number | undefined;
|
|
316
382
|
} | undefined;
|
|
383
|
+
overrideGlobal?: boolean | undefined;
|
|
317
384
|
}>, "many">>;
|
|
318
385
|
}, "strip", z.ZodTypeAny, {
|
|
319
386
|
tool?: {
|
|
320
387
|
id: string;
|
|
388
|
+
run: string | string[];
|
|
321
389
|
when: {
|
|
322
390
|
phase: "before" | "after";
|
|
323
391
|
tool?: string | string[] | undefined;
|
|
324
392
|
callingAgent?: string | string[] | undefined;
|
|
325
393
|
slashCommand?: string | string[] | undefined;
|
|
394
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
326
395
|
};
|
|
327
|
-
run: string | string[];
|
|
328
396
|
inject?: string | undefined;
|
|
329
397
|
toast?: {
|
|
330
398
|
message: string;
|
|
@@ -332,14 +400,15 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
332
400
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
333
401
|
duration?: number | undefined;
|
|
334
402
|
} | undefined;
|
|
403
|
+
overrideGlobal?: boolean | undefined;
|
|
335
404
|
}[] | undefined;
|
|
336
405
|
session?: {
|
|
337
406
|
id: string;
|
|
407
|
+
run: string | string[];
|
|
338
408
|
when: {
|
|
339
409
|
event: "session.created" | "session.idle" | "session.end" | "session.start";
|
|
340
410
|
agent?: string | string[] | undefined;
|
|
341
411
|
};
|
|
342
|
-
run: string | string[];
|
|
343
412
|
inject?: string | undefined;
|
|
344
413
|
toast?: {
|
|
345
414
|
message: string;
|
|
@@ -347,18 +416,21 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
347
416
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
348
417
|
duration?: number | undefined;
|
|
349
418
|
} | undefined;
|
|
419
|
+
overrideGlobal?: boolean | undefined;
|
|
350
420
|
}[] | undefined;
|
|
351
421
|
truncationLimit?: number | undefined;
|
|
422
|
+
ignoreGlobalConfig?: boolean | undefined;
|
|
352
423
|
}, {
|
|
353
424
|
tool?: {
|
|
354
425
|
id: string;
|
|
426
|
+
run: string | string[];
|
|
355
427
|
when: {
|
|
356
428
|
phase: "before" | "after";
|
|
357
429
|
tool?: string | string[] | undefined;
|
|
358
430
|
callingAgent?: string | string[] | undefined;
|
|
359
431
|
slashCommand?: string | string[] | undefined;
|
|
432
|
+
toolArgs?: Record<string, string | string[]> | undefined;
|
|
360
433
|
};
|
|
361
|
-
run: string | string[];
|
|
362
434
|
inject?: string | undefined;
|
|
363
435
|
toast?: {
|
|
364
436
|
message: string;
|
|
@@ -366,14 +438,15 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
366
438
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
367
439
|
duration?: number | undefined;
|
|
368
440
|
} | undefined;
|
|
441
|
+
overrideGlobal?: boolean | undefined;
|
|
369
442
|
}[] | undefined;
|
|
370
443
|
session?: {
|
|
371
444
|
id: string;
|
|
445
|
+
run: string | string[];
|
|
372
446
|
when: {
|
|
373
447
|
event: "session.created" | "session.idle" | "session.end" | "session.start";
|
|
374
448
|
agent?: string | string[] | undefined;
|
|
375
449
|
};
|
|
376
|
-
run: string | string[];
|
|
377
450
|
inject?: string | undefined;
|
|
378
451
|
toast?: {
|
|
379
452
|
message: string;
|
|
@@ -381,8 +454,10 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
381
454
|
variant?: "info" | "success" | "warning" | "error" | undefined;
|
|
382
455
|
duration?: number | undefined;
|
|
383
456
|
} | undefined;
|
|
457
|
+
overrideGlobal?: boolean | undefined;
|
|
384
458
|
}[] | undefined;
|
|
385
459
|
truncationLimit?: number | undefined;
|
|
460
|
+
ignoreGlobalConfig?: boolean | undefined;
|
|
386
461
|
}>;
|
|
387
462
|
/**
|
|
388
463
|
* Inferred TypeScript types from Zod schemas
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB;;GAEG;AACH,QAAA,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB;;GAEG;AACH,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;EAMtB,CAAC;AAcH;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM3B,CAAC;AAEZ;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;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,KAAG,WAAW,GAAG,IAG/D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GACpC,OAAO,OAAO,KACb,CAAC,CAAC,QAAQ,GAAG,IAGf,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,GACpC,OAAO,OAAO,KACb,KAAK,IAAI,kBAiBX,CAAA"}
|
package/dist/schemas.js
CHANGED
|
@@ -32,16 +32,28 @@ const ToolHookWhenSchema = z.object({
|
|
|
32
32
|
tool: StringOrArray.optional(),
|
|
33
33
|
callingAgent: StringOrArray.optional(),
|
|
34
34
|
slashCommand: StringOrArray.optional(),
|
|
35
|
+
toolArgs: z.record(StringOrArray).optional(),
|
|
35
36
|
});
|
|
36
37
|
/**
|
|
37
38
|
* Toast notification configuration
|
|
38
39
|
*/
|
|
39
|
-
const
|
|
40
|
+
const ToastBodySchema = z.object({
|
|
40
41
|
title: z.string().optional(),
|
|
41
42
|
message: z.string(),
|
|
42
43
|
variant: z.enum(["info", "success", "warning", "error"]).optional(),
|
|
43
44
|
duration: z.number().optional(),
|
|
44
|
-
})
|
|
45
|
+
});
|
|
46
|
+
const ToastSchema = ToastBodySchema.optional();
|
|
47
|
+
/**
|
|
48
|
+
* Simplified hook entry schema for markdown frontmatter `hooks` format
|
|
49
|
+
*/
|
|
50
|
+
export const SimplifiedHookEntrySchema = z
|
|
51
|
+
.object({
|
|
52
|
+
run: z.union([z.string(), z.array(z.string())]),
|
|
53
|
+
inject: z.string().optional(),
|
|
54
|
+
toast: ToastBodySchema.optional(),
|
|
55
|
+
})
|
|
56
|
+
.strict();
|
|
45
57
|
/**
|
|
46
58
|
* Tool hook configuration
|
|
47
59
|
*
|
|
@@ -55,6 +67,7 @@ export const ToolHookSchema = z.object({
|
|
|
55
67
|
run: z.union([z.string(), z.array(z.string())]),
|
|
56
68
|
inject: z.string().optional(),
|
|
57
69
|
toast: ToastSchema,
|
|
70
|
+
overrideGlobal: z.boolean().optional(),
|
|
58
71
|
});
|
|
59
72
|
// ============================================================================
|
|
60
73
|
// SESSION HOOK SCHEMAS
|
|
@@ -79,6 +92,7 @@ export const SessionHookSchema = z.object({
|
|
|
79
92
|
run: z.union([z.string(), z.array(z.string())]),
|
|
80
93
|
inject: z.string().optional(),
|
|
81
94
|
toast: ToastSchema,
|
|
95
|
+
overrideGlobal: z.boolean().optional(),
|
|
82
96
|
});
|
|
83
97
|
// ============================================================================
|
|
84
98
|
// CONFIGURATION SCHEMAS
|
|
@@ -91,6 +105,7 @@ export const SessionHookSchema = z.object({
|
|
|
91
105
|
*/
|
|
92
106
|
export const ConfigSchema = z.object({
|
|
93
107
|
truncationLimit: z.number().int().positive().optional(),
|
|
108
|
+
ignoreGlobalConfig: z.boolean().optional(),
|
|
94
109
|
tool: z.array(ToolHookSchema).optional(),
|
|
95
110
|
session: z.array(SessionHookSchema).optional(),
|
|
96
111
|
});
|
package/dist/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAEhD;;;GAGG;AACH,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC;AAEvG,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;G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,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,GAAG,GAAG,KAAgC,CAAC;IAE7C,qCAAqC;IACrC,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACvD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAA"}
|
package/dist/types/hooks.d.ts
CHANGED
|
@@ -69,6 +69,11 @@ export interface ToolHook {
|
|
|
69
69
|
/** Duration in milliseconds. */
|
|
70
70
|
duration?: number;
|
|
71
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* When true, prevents global hooks with matching phase+tool from running.
|
|
74
|
+
* If tool is "*", overrides ALL global hooks for that phase.
|
|
75
|
+
*/
|
|
76
|
+
overrideGlobal?: boolean;
|
|
72
77
|
}
|
|
73
78
|
/**
|
|
74
79
|
* Matching conditions for tool hooks
|
|
@@ -122,6 +127,10 @@ export interface SessionHook {
|
|
|
122
127
|
/** Duration in milliseconds. */
|
|
123
128
|
duration?: number;
|
|
124
129
|
};
|
|
130
|
+
/**
|
|
131
|
+
* When true, prevents global hooks with matching event from running.
|
|
132
|
+
*/
|
|
133
|
+
overrideGlobal?: boolean;
|
|
125
134
|
}
|
|
126
135
|
/**
|
|
127
136
|
* Matching conditions for session hooks
|
|
@@ -150,6 +159,8 @@ export interface SessionHookWhen {
|
|
|
150
159
|
export interface CommandHooksConfig {
|
|
151
160
|
/** Truncation limit for command output in characters. Defaults to 30,000. */
|
|
152
161
|
truncationLimit?: number;
|
|
162
|
+
/** When true, ignore ~/.config/opencode/command-hooks.jsonc entirely. */
|
|
163
|
+
ignoreGlobalConfig?: boolean;
|
|
153
164
|
/** Array of tool execution hooks. */
|
|
154
165
|
tool?: ToolHook[];
|
|
155
166
|
/** Array of session lifecycle hooks. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/types/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,cAAc,EAAE,CAAA;IAEzB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,cAAc,EAAE,CAAA;CACzB;AAED,6DAA6D;AAC7D,MAAM,WAAW,cAAc;IAC7B,sDAAsD;IACtD,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAEtB,wGAAwG;IACxG,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,sEAAsE;IACtE,KAAK,CAAC,EAAE;QACN,yDAAyD;QACzD,KAAK,CAAC,EAAE,MAAM,CAAA;QAEd,uDAAuD;QACvD,OAAO,EAAE,MAAM,CAAA;QAEf,+DAA+D;QAC/D,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;QAElD,gCAAgC;QAChC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,CAAA;CACF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,mEAAmE;IACnE,EAAE,EAAE,MAAM,CAAA;IAEV,oEAAoE;IACpE,IAAI,EAAE,YAAY,CAAA;IAElB,4EAA4E;IAC5E,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAEtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,sEAAsE;IACtE,KAAK,CAAC,EAAE;QACN,yDAAyD;QACzD,KAAK,CAAC,EAAE,MAAM,CAAA;QAEd,uDAAuD;QACvD,OAAO,EAAE,MAAM,CAAA;QAEf,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CAAA;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,+BAA+B;IAC/B,IAAI,EACA,YAAY,GACZ,cAAc,GACd,aAAa,GACb,eAAe,GACf,eAAe,GACf,0BAA0B,GAC1B,sBAAsB,GACtB,cAAc,GACd,SAAS,CAAA;IAEb,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAA;IAEf,qBAAqB;IACrB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAA;IAEjB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAA;IAEb,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-command-hooks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "OpenCode plugin for declaratively attaching shell commands to agent/tool/slash-command lifecycle events",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "tsc",
|
|
20
20
|
"test": "bun test",
|
|
21
|
-
"lint": "eslint src --ext .ts",
|
|
21
|
+
"lint": "eslint src tests --ext .ts",
|
|
22
22
|
"typecheck": "tsc --noEmit",
|
|
23
|
+
"ci:check": "npm run lint && npm run typecheck && (command -v bun >/dev/null 2>&1 && bun test || echo \"bun not found; skipping tests\")",
|
|
23
24
|
"typecheck:bun": "bun --bun tsc --noEmit",
|
|
24
25
|
"typecheck:bun-build": "bun build src/index.ts --target=bun",
|
|
25
26
|
"typecheck:bun-run": "bun run src/index.ts",
|