@agent-deck/shared 1.3.3 → 1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 @not-so-fat
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './schemas/deck';
3
3
  export * from './schemas/credential';
4
4
  export * from './schemas/oauth';
5
5
  export * from './schemas/playbook';
6
+ export * from './schemas/playbook-patch';
6
7
  export * from './schemas/deck-display';
7
8
  export * from './schemas/export-bundle';
8
9
  export * from './types/api';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc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GACxB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ __exportStar(require("./schemas/deck"), exports);
21
21
  __exportStar(require("./schemas/credential"), exports);
22
22
  __exportStar(require("./schemas/oauth"), exports);
23
23
  __exportStar(require("./schemas/playbook"), exports);
24
+ __exportStar(require("./schemas/playbook-patch"), exports);
24
25
  __exportStar(require("./schemas/deck-display"), exports);
25
26
  __exportStar(require("./schemas/export-bundle"), exports);
26
27
  // Additional types not covered by schemas
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wCAAwC;AACxC,oDAAkC;AAClC,iDAA+B;AAC/B,uDAAqC;AACrC,kDAAgC;AAChC,qDAAmC;AACnC,yDAAuC;AACvC,0DAAwC;AAExC,0CAA0C;AAC1C,8CAA4B;AAG5B,QAAQ;AACR,0CAAwB;AACxB,mEAQqC;AAPnC,kIAAA,2BAA2B,OAAA;AAC3B,yHAAA,kBAAkB,OAAA;AAClB,4HAAA,qBAAqB,OAAA;AACrB,0HAAA,mBAAmB,OAAA;AACnB,+HAAA,wBAAwB,OAAA;AAI1B,iEAIoC;AAHlC,oIAAA,8BAA8B,OAAA;AAC9B,+HAAA,yBAAyB,OAAA;AACzB,6HAAA,uBAAuB,OAAA;AAGzB,YAAY;AACZ,yDAMkC;AALhC,wHAAA,wBAAwB,OAAA;AACxB,2HAAA,2BAA2B,OAAA;AAC3B,uHAAA,uBAAuB,OAAA;AACvB,2HAAA,2BAA2B,OAAA;AAC3B,yHAAA,yBAAyB,OAAA;AAE3B,uDAAuH;AAA9G,6GAAA,cAAc,OAAA;AAAE,iHAAA,kBAAkB,OAAA;AAAE,kHAAA,mBAAmB,OAAA;AAAE,kHAAA,mBAAmB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wCAAwC;AACxC,oDAAkC;AAClC,iDAA+B;AAC/B,uDAAqC;AACrC,kDAAgC;AAChC,qDAAmC;AACnC,2DAAyC;AACzC,yDAAuC;AACvC,0DAAwC;AAExC,0CAA0C;AAC1C,8CAA4B;AAG5B,QAAQ;AACR,0CAAwB;AACxB,mEAQqC;AAPnC,kIAAA,2BAA2B,OAAA;AAC3B,yHAAA,kBAAkB,OAAA;AAClB,4HAAA,qBAAqB,OAAA;AACrB,0HAAA,mBAAmB,OAAA;AACnB,+HAAA,wBAAwB,OAAA;AAI1B,iEAIoC;AAHlC,oIAAA,8BAA8B,OAAA;AAC9B,+HAAA,yBAAyB,OAAA;AACzB,6HAAA,uBAAuB,OAAA;AAGzB,YAAY;AACZ,yDAMkC;AALhC,wHAAA,wBAAwB,OAAA;AACxB,2HAAA,2BAA2B,OAAA;AAC3B,uHAAA,uBAAuB,OAAA;AACvB,2HAAA,2BAA2B,OAAA;AAC3B,yHAAA,yBAAyB,OAAA;AAE3B,uDAAuH;AAA9G,6GAAA,cAAc,OAAA;AAAE,iHAAA,kBAAkB,OAAA;AAAE,kHAAA,mBAAmB,OAAA;AAAE,kHAAA,mBAAmB,OAAA"}
@@ -0,0 +1,438 @@
1
+ import { z } from 'zod';
2
+ export declare const PlaybookPatchIdSchema: z.ZodString;
3
+ export declare const PlaybookPatchKindSchema: z.ZodEnum<["create", "update", "merge", "retire"]>;
4
+ export declare const PlaybookPatchStatusSchema: z.ZodEnum<["proposed", "accepted", "rejected", "stale"]>;
5
+ export declare const PlaybookPatchSourceSchema: z.ZodEnum<["ide", "dealer", "hook", "harvester"]>;
6
+ export type PlaybookPatchSource = z.infer<typeof PlaybookPatchSourceSchema>;
7
+ export declare const PatchEvidenceSchema: z.ZodObject<{
8
+ failure_summary: z.ZodString;
9
+ user_feedback_excerpt: z.ZodString;
10
+ corrected_output_hint: z.ZodOptional<z.ZodString>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ failure_summary: string;
13
+ user_feedback_excerpt: string;
14
+ corrected_output_hint?: string | undefined;
15
+ }, {
16
+ failure_summary: string;
17
+ user_feedback_excerpt: string;
18
+ corrected_output_hint?: string | undefined;
19
+ }>;
20
+ export declare const AddItemOpSchema: z.ZodObject<{
21
+ op: z.ZodLiteral<"add_item">;
22
+ section: z.ZodString;
23
+ text: z.ZodString;
24
+ }, "strip", z.ZodTypeAny, {
25
+ op: "add_item";
26
+ section: string;
27
+ text: string;
28
+ }, {
29
+ op: "add_item";
30
+ section: string;
31
+ text: string;
32
+ }>;
33
+ export declare const AmendItemOpSchema: z.ZodObject<{
34
+ op: z.ZodLiteral<"amend_item">;
35
+ section: z.ZodString;
36
+ anchor: z.ZodString;
37
+ text: z.ZodString;
38
+ }, "strip", z.ZodTypeAny, {
39
+ op: "amend_item";
40
+ section: string;
41
+ text: string;
42
+ anchor: string;
43
+ }, {
44
+ op: "amend_item";
45
+ section: string;
46
+ text: string;
47
+ anchor: string;
48
+ }>;
49
+ export declare const RemoveItemOpSchema: z.ZodObject<{
50
+ op: z.ZodLiteral<"remove_item">;
51
+ section: z.ZodString;
52
+ anchor: z.ZodString;
53
+ }, "strip", z.ZodTypeAny, {
54
+ op: "remove_item";
55
+ section: string;
56
+ anchor: string;
57
+ }, {
58
+ op: "remove_item";
59
+ section: string;
60
+ anchor: string;
61
+ }>;
62
+ export declare const SetTriggersOpSchema: z.ZodObject<{
63
+ op: z.ZodLiteral<"set_triggers">;
64
+ triggers: z.ZodArray<z.ZodString, "many">;
65
+ }, "strip", z.ZodTypeAny, {
66
+ triggers: string[];
67
+ op: "set_triggers";
68
+ }, {
69
+ triggers: string[];
70
+ op: "set_triggers";
71
+ }>;
72
+ export declare const RewriteBodyOpSchema: z.ZodObject<{
73
+ op: z.ZodLiteral<"rewrite_body">;
74
+ text: z.ZodString;
75
+ }, "strip", z.ZodTypeAny, {
76
+ op: "rewrite_body";
77
+ text: string;
78
+ }, {
79
+ op: "rewrite_body";
80
+ text: string;
81
+ }>;
82
+ export declare const BodyPatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
83
+ op: z.ZodLiteral<"add_item">;
84
+ section: z.ZodString;
85
+ text: z.ZodString;
86
+ }, "strip", z.ZodTypeAny, {
87
+ op: "add_item";
88
+ section: string;
89
+ text: string;
90
+ }, {
91
+ op: "add_item";
92
+ section: string;
93
+ text: string;
94
+ }>, z.ZodObject<{
95
+ op: z.ZodLiteral<"amend_item">;
96
+ section: z.ZodString;
97
+ anchor: z.ZodString;
98
+ text: z.ZodString;
99
+ }, "strip", z.ZodTypeAny, {
100
+ op: "amend_item";
101
+ section: string;
102
+ text: string;
103
+ anchor: string;
104
+ }, {
105
+ op: "amend_item";
106
+ section: string;
107
+ text: string;
108
+ anchor: string;
109
+ }>, z.ZodObject<{
110
+ op: z.ZodLiteral<"remove_item">;
111
+ section: z.ZodString;
112
+ anchor: z.ZodString;
113
+ }, "strip", z.ZodTypeAny, {
114
+ op: "remove_item";
115
+ section: string;
116
+ anchor: string;
117
+ }, {
118
+ op: "remove_item";
119
+ section: string;
120
+ anchor: string;
121
+ }>, z.ZodObject<{
122
+ op: z.ZodLiteral<"rewrite_body">;
123
+ text: z.ZodString;
124
+ }, "strip", z.ZodTypeAny, {
125
+ op: "rewrite_body";
126
+ text: string;
127
+ }, {
128
+ op: "rewrite_body";
129
+ text: string;
130
+ }>]>;
131
+ export declare const PatchOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
132
+ op: z.ZodLiteral<"add_item">;
133
+ section: z.ZodString;
134
+ text: z.ZodString;
135
+ }, "strip", z.ZodTypeAny, {
136
+ op: "add_item";
137
+ section: string;
138
+ text: string;
139
+ }, {
140
+ op: "add_item";
141
+ section: string;
142
+ text: string;
143
+ }>, z.ZodObject<{
144
+ op: z.ZodLiteral<"amend_item">;
145
+ section: z.ZodString;
146
+ anchor: z.ZodString;
147
+ text: z.ZodString;
148
+ }, "strip", z.ZodTypeAny, {
149
+ op: "amend_item";
150
+ section: string;
151
+ text: string;
152
+ anchor: string;
153
+ }, {
154
+ op: "amend_item";
155
+ section: string;
156
+ text: string;
157
+ anchor: string;
158
+ }>, z.ZodObject<{
159
+ op: z.ZodLiteral<"remove_item">;
160
+ section: z.ZodString;
161
+ anchor: z.ZodString;
162
+ }, "strip", z.ZodTypeAny, {
163
+ op: "remove_item";
164
+ section: string;
165
+ anchor: string;
166
+ }, {
167
+ op: "remove_item";
168
+ section: string;
169
+ anchor: string;
170
+ }>, z.ZodObject<{
171
+ op: z.ZodLiteral<"set_triggers">;
172
+ triggers: z.ZodArray<z.ZodString, "many">;
173
+ }, "strip", z.ZodTypeAny, {
174
+ triggers: string[];
175
+ op: "set_triggers";
176
+ }, {
177
+ triggers: string[];
178
+ op: "set_triggers";
179
+ }>, z.ZodObject<{
180
+ op: z.ZodLiteral<"rewrite_body">;
181
+ text: z.ZodString;
182
+ }, "strip", z.ZodTypeAny, {
183
+ op: "rewrite_body";
184
+ text: string;
185
+ }, {
186
+ op: "rewrite_body";
187
+ text: string;
188
+ }>]>;
189
+ export declare const CreatePlaybookPatchFieldsSchema: z.ZodObject<{
190
+ title: z.ZodString;
191
+ body: z.ZodDefault<z.ZodString>;
192
+ triggers: z.ZodArray<z.ZodString, "many">;
193
+ deck_id: z.ZodString;
194
+ exec: z.ZodOptional<z.ZodString>;
195
+ skill: z.ZodOptional<z.ZodString>;
196
+ }, "strip", z.ZodTypeAny, {
197
+ title: string;
198
+ body: string;
199
+ triggers: string[];
200
+ deck_id: string;
201
+ exec?: string | undefined;
202
+ skill?: string | undefined;
203
+ }, {
204
+ title: string;
205
+ triggers: string[];
206
+ deck_id: string;
207
+ body?: string | undefined;
208
+ exec?: string | undefined;
209
+ skill?: string | undefined;
210
+ }>;
211
+ export declare const ProposePlaybookPatchSchema: z.ZodObject<{
212
+ kind: z.ZodEnum<["create", "update", "merge", "retire"]>;
213
+ playbook_id: z.ZodOptional<z.ZodString>;
214
+ ops: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
215
+ op: z.ZodLiteral<"add_item">;
216
+ section: z.ZodString;
217
+ text: z.ZodString;
218
+ }, "strip", z.ZodTypeAny, {
219
+ op: "add_item";
220
+ section: string;
221
+ text: string;
222
+ }, {
223
+ op: "add_item";
224
+ section: string;
225
+ text: string;
226
+ }>, z.ZodObject<{
227
+ op: z.ZodLiteral<"amend_item">;
228
+ section: z.ZodString;
229
+ anchor: z.ZodString;
230
+ text: z.ZodString;
231
+ }, "strip", z.ZodTypeAny, {
232
+ op: "amend_item";
233
+ section: string;
234
+ text: string;
235
+ anchor: string;
236
+ }, {
237
+ op: "amend_item";
238
+ section: string;
239
+ text: string;
240
+ anchor: string;
241
+ }>, z.ZodObject<{
242
+ op: z.ZodLiteral<"remove_item">;
243
+ section: z.ZodString;
244
+ anchor: z.ZodString;
245
+ }, "strip", z.ZodTypeAny, {
246
+ op: "remove_item";
247
+ section: string;
248
+ anchor: string;
249
+ }, {
250
+ op: "remove_item";
251
+ section: string;
252
+ anchor: string;
253
+ }>, z.ZodObject<{
254
+ op: z.ZodLiteral<"set_triggers">;
255
+ triggers: z.ZodArray<z.ZodString, "many">;
256
+ }, "strip", z.ZodTypeAny, {
257
+ triggers: string[];
258
+ op: "set_triggers";
259
+ }, {
260
+ triggers: string[];
261
+ op: "set_triggers";
262
+ }>, z.ZodObject<{
263
+ op: z.ZodLiteral<"rewrite_body">;
264
+ text: z.ZodString;
265
+ }, "strip", z.ZodTypeAny, {
266
+ op: "rewrite_body";
267
+ text: string;
268
+ }, {
269
+ op: "rewrite_body";
270
+ text: string;
271
+ }>]>, "many">>;
272
+ new_playbook: z.ZodOptional<z.ZodObject<{
273
+ title: z.ZodString;
274
+ body: z.ZodDefault<z.ZodString>;
275
+ triggers: z.ZodArray<z.ZodString, "many">;
276
+ deck_id: z.ZodString;
277
+ exec: z.ZodOptional<z.ZodString>;
278
+ skill: z.ZodOptional<z.ZodString>;
279
+ }, "strip", z.ZodTypeAny, {
280
+ title: string;
281
+ body: string;
282
+ triggers: string[];
283
+ deck_id: string;
284
+ exec?: string | undefined;
285
+ skill?: string | undefined;
286
+ }, {
287
+ title: string;
288
+ triggers: string[];
289
+ deck_id: string;
290
+ body?: string | undefined;
291
+ exec?: string | undefined;
292
+ skill?: string | undefined;
293
+ }>>;
294
+ rationale: z.ZodString;
295
+ evidence: z.ZodOptional<z.ZodObject<{
296
+ failure_summary: z.ZodString;
297
+ user_feedback_excerpt: z.ZodString;
298
+ corrected_output_hint: z.ZodOptional<z.ZodString>;
299
+ }, "strip", z.ZodTypeAny, {
300
+ failure_summary: string;
301
+ user_feedback_excerpt: string;
302
+ corrected_output_hint?: string | undefined;
303
+ }, {
304
+ failure_summary: string;
305
+ user_feedback_excerpt: string;
306
+ corrected_output_hint?: string | undefined;
307
+ }>>;
308
+ }, "strip", z.ZodTypeAny, {
309
+ kind: "merge" | "create" | "update" | "retire";
310
+ rationale: string;
311
+ playbook_id?: string | undefined;
312
+ ops?: ({
313
+ op: "add_item";
314
+ section: string;
315
+ text: string;
316
+ } | {
317
+ op: "amend_item";
318
+ section: string;
319
+ text: string;
320
+ anchor: string;
321
+ } | {
322
+ op: "remove_item";
323
+ section: string;
324
+ anchor: string;
325
+ } | {
326
+ triggers: string[];
327
+ op: "set_triggers";
328
+ } | {
329
+ op: "rewrite_body";
330
+ text: string;
331
+ })[] | undefined;
332
+ new_playbook?: {
333
+ title: string;
334
+ body: string;
335
+ triggers: string[];
336
+ deck_id: string;
337
+ exec?: string | undefined;
338
+ skill?: string | undefined;
339
+ } | undefined;
340
+ evidence?: {
341
+ failure_summary: string;
342
+ user_feedback_excerpt: string;
343
+ corrected_output_hint?: string | undefined;
344
+ } | undefined;
345
+ }, {
346
+ kind: "merge" | "create" | "update" | "retire";
347
+ rationale: string;
348
+ playbook_id?: string | undefined;
349
+ ops?: ({
350
+ op: "add_item";
351
+ section: string;
352
+ text: string;
353
+ } | {
354
+ op: "amend_item";
355
+ section: string;
356
+ text: string;
357
+ anchor: string;
358
+ } | {
359
+ op: "remove_item";
360
+ section: string;
361
+ anchor: string;
362
+ } | {
363
+ triggers: string[];
364
+ op: "set_triggers";
365
+ } | {
366
+ op: "rewrite_body";
367
+ text: string;
368
+ })[] | undefined;
369
+ new_playbook?: {
370
+ title: string;
371
+ triggers: string[];
372
+ deck_id: string;
373
+ body?: string | undefined;
374
+ exec?: string | undefined;
375
+ skill?: string | undefined;
376
+ } | undefined;
377
+ evidence?: {
378
+ failure_summary: string;
379
+ user_feedback_excerpt: string;
380
+ corrected_output_hint?: string | undefined;
381
+ } | undefined;
382
+ }>;
383
+ export declare const RejectPlaybookPatchSchema: z.ZodObject<{
384
+ reason: z.ZodString;
385
+ }, "strip", z.ZodTypeAny, {
386
+ reason: string;
387
+ }, {
388
+ reason: string;
389
+ }>;
390
+ export type PatchEvidence = z.infer<typeof PatchEvidenceSchema>;
391
+ export type PatchOp = z.infer<typeof PatchOpSchema>;
392
+ export type BodyPatchOp = z.infer<typeof BodyPatchOpSchema>;
393
+ export type CreatePlaybookPatchFields = z.infer<typeof CreatePlaybookPatchFieldsSchema>;
394
+ export type ProposePlaybookPatchInput = z.infer<typeof ProposePlaybookPatchSchema>;
395
+ export type PlaybookPatch = {
396
+ id: string;
397
+ kind: z.infer<typeof PlaybookPatchKindSchema>;
398
+ playbookId: string | null;
399
+ opsJson: string;
400
+ rationale: string;
401
+ source: z.infer<typeof PlaybookPatchSourceSchema>;
402
+ sourceRef: string | null;
403
+ evidenceJson: string | null;
404
+ status: z.infer<typeof PlaybookPatchStatusSchema>;
405
+ rejectionReason: string | null;
406
+ createdAt: string;
407
+ resolvedAt: string | null;
408
+ };
409
+ export type PlaybookVersion = {
410
+ id: string;
411
+ playbookId: string;
412
+ title: string;
413
+ body: string;
414
+ triggers: string[];
415
+ patchId: string | null;
416
+ actor: 'user' | 'agent';
417
+ createdAt: string;
418
+ };
419
+ export type PlaybookEvent = {
420
+ id: string;
421
+ playbookId: string;
422
+ event: 'fetched';
423
+ source: string;
424
+ createdAt: string;
425
+ };
426
+ export type PatchPreview = {
427
+ before: {
428
+ title: string;
429
+ body: string;
430
+ triggers: string[];
431
+ };
432
+ after: {
433
+ title: string;
434
+ body: string;
435
+ triggers: string[];
436
+ };
437
+ };
438
+ //# sourceMappingURL=playbook-patch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playbook-patch.d.ts","sourceRoot":"","sources":["../../src/schemas/playbook-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,qBAAqB,aAE0B,CAAC;AAE7D,eAAO,MAAM,uBAAuB,oDAAkD,CAAC;AAEvF,eAAO,MAAM,yBAAyB,0DAAwD,CAAC;AAE/F,eAAO,MAAM,yBAAyB,mDAAiD,CAAC;AAExF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;EAI1B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK5B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;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AM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;IAClD,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC5D,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC5D,CAAC"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RejectPlaybookPatchSchema = exports.ProposePlaybookPatchSchema = exports.CreatePlaybookPatchFieldsSchema = exports.PatchOpSchema = exports.BodyPatchOpSchema = exports.RewriteBodyOpSchema = exports.SetTriggersOpSchema = exports.RemoveItemOpSchema = exports.AmendItemOpSchema = exports.AddItemOpSchema = exports.PatchEvidenceSchema = exports.PlaybookPatchSourceSchema = exports.PlaybookPatchStatusSchema = exports.PlaybookPatchKindSchema = exports.PlaybookPatchIdSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const playbook_1 = require("./playbook");
6
+ exports.PlaybookPatchIdSchema = zod_1.z
7
+ .string()
8
+ .regex(/^pp_[a-z0-9_]+$/, 'Patch id must match pp_<slug>');
9
+ exports.PlaybookPatchKindSchema = zod_1.z.enum(['create', 'update', 'merge', 'retire']);
10
+ exports.PlaybookPatchStatusSchema = zod_1.z.enum(['proposed', 'accepted', 'rejected', 'stale']);
11
+ exports.PlaybookPatchSourceSchema = zod_1.z.enum(['ide', 'dealer', 'hook', 'harvester']);
12
+ exports.PatchEvidenceSchema = zod_1.z.object({
13
+ failure_summary: zod_1.z.string().min(1),
14
+ user_feedback_excerpt: zod_1.z.string().min(1),
15
+ corrected_output_hint: zod_1.z.string().optional(),
16
+ });
17
+ exports.AddItemOpSchema = zod_1.z.object({
18
+ op: zod_1.z.literal('add_item'),
19
+ section: zod_1.z.string().min(1),
20
+ text: zod_1.z.string().min(1),
21
+ });
22
+ exports.AmendItemOpSchema = zod_1.z.object({
23
+ op: zod_1.z.literal('amend_item'),
24
+ section: zod_1.z.string().min(1),
25
+ anchor: zod_1.z.string().min(1),
26
+ text: zod_1.z.string().min(1),
27
+ });
28
+ exports.RemoveItemOpSchema = zod_1.z.object({
29
+ op: zod_1.z.literal('remove_item'),
30
+ section: zod_1.z.string().min(1),
31
+ anchor: zod_1.z.string().min(1),
32
+ });
33
+ exports.SetTriggersOpSchema = zod_1.z.object({
34
+ op: zod_1.z.literal('set_triggers'),
35
+ triggers: zod_1.z.array(zod_1.z.string()),
36
+ });
37
+ exports.RewriteBodyOpSchema = zod_1.z.object({
38
+ op: zod_1.z.literal('rewrite_body'),
39
+ text: zod_1.z.string(),
40
+ });
41
+ exports.BodyPatchOpSchema = zod_1.z.discriminatedUnion('op', [
42
+ exports.AddItemOpSchema,
43
+ exports.AmendItemOpSchema,
44
+ exports.RemoveItemOpSchema,
45
+ exports.RewriteBodyOpSchema,
46
+ ]);
47
+ exports.PatchOpSchema = zod_1.z.discriminatedUnion('op', [
48
+ exports.AddItemOpSchema,
49
+ exports.AmendItemOpSchema,
50
+ exports.RemoveItemOpSchema,
51
+ exports.SetTriggersOpSchema,
52
+ exports.RewriteBodyOpSchema,
53
+ ]);
54
+ exports.CreatePlaybookPatchFieldsSchema = zod_1.z.object({
55
+ title: zod_1.z.string().min(1),
56
+ body: zod_1.z.string().default(''),
57
+ triggers: zod_1.z.array(zod_1.z.string()).min(1, 'Genesis playbooks need at least one trigger'),
58
+ deck_id: zod_1.z.string().uuid(),
59
+ exec: zod_1.z.string().optional(),
60
+ skill: zod_1.z.string().optional(),
61
+ });
62
+ exports.ProposePlaybookPatchSchema = zod_1.z.object({
63
+ kind: exports.PlaybookPatchKindSchema,
64
+ playbook_id: playbook_1.PlaybookIdSchema.optional(),
65
+ ops: zod_1.z.array(exports.PatchOpSchema).optional(),
66
+ new_playbook: exports.CreatePlaybookPatchFieldsSchema.optional(),
67
+ rationale: zod_1.z.string().min(1),
68
+ evidence: exports.PatchEvidenceSchema.optional(),
69
+ });
70
+ exports.RejectPlaybookPatchSchema = zod_1.z.object({
71
+ reason: zod_1.z.string().min(1),
72
+ });
73
+ //# sourceMappingURL=playbook-patch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playbook-patch.js","sourceRoot":"","sources":["../../src/schemas/playbook-patch.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,yCAA8C;AAEjC,QAAA,qBAAqB,GAAG,OAAC;KACnC,MAAM,EAAE;KACR,KAAK,CAAC,iBAAiB,EAAE,+BAA+B,CAAC,CAAC;AAEhD,QAAA,uBAAuB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE1E,QAAA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,QAAQ,EAAE;IAC3B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,+BAAuB;IAC7B,WAAW,EAAE,2BAAgB,CAAC,QAAQ,EAAE;IACxC,GAAG,EAAE,OAAC,CAAC,KAAK,CAAC,qBAAa,CAAC,CAAC,QAAQ,EAAE;IACtC,YAAY,EAAE,uCAA+B,CAAC,QAAQ,EAAE;IACxD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,QAAQ,EAAE,2BAAmB,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC1B,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@agent-deck/shared",
3
- "version": "1.3.3",
3
+ "version": "1.4.0",
4
4
  "description": "Shared types, schemas, and utilities for Agent Deck",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [
8
- "dist"
8
+ "dist",
9
+ "LICENSE"
9
10
  ],
10
11
  "engines": {
11
12
  "node": ">=20.0.0"
@@ -29,5 +30,6 @@
29
30
  },
30
31
  "publishConfig": {
31
32
  "access": "public"
32
- }
33
+ },
34
+ "license": "MIT"
33
35
  }