@agent-deck/shared 1.4.4 → 1.5.1

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/dist/index.d.ts CHANGED
@@ -4,8 +4,10 @@ export * from './schemas/credential';
4
4
  export * from './schemas/oauth';
5
5
  export * from './schemas/playbook';
6
6
  export * from './schemas/playbook-patch';
7
+ export * from './schemas/feedback-signal';
7
8
  export * from './schemas/deck-display';
8
9
  export * from './schemas/export-bundle';
10
+ export * from './schemas/session-bootstrap';
9
11
  export * from './types/api';
10
12
  export { OAuthDiscoveryResult } from './types/oauth';
11
13
  export * from './utils';
@@ -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,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,uBAAuB,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"}
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,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAG5C,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,uBAAuB,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
@@ -22,8 +22,10 @@ __exportStar(require("./schemas/credential"), exports);
22
22
  __exportStar(require("./schemas/oauth"), exports);
23
23
  __exportStar(require("./schemas/playbook"), exports);
24
24
  __exportStar(require("./schemas/playbook-patch"), exports);
25
+ __exportStar(require("./schemas/feedback-signal"), exports);
25
26
  __exportStar(require("./schemas/deck-display"), exports);
26
27
  __exportStar(require("./schemas/export-bundle"), exports);
28
+ __exportStar(require("./schemas/session-bootstrap"), exports);
27
29
  // Additional types not covered by schemas
28
30
  __exportStar(require("./types/api"), exports);
29
31
  // Utils
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,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"}
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,4DAA0C;AAC1C,yDAAuC;AACvC,0DAAwC;AACxC,8DAA4C;AAE5C,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"}
@@ -38,9 +38,9 @@ export declare const LiveBindingSchema: z.ZodObject<{
38
38
  }, "strip", z.ZodTypeAny, {
39
39
  updatedAt: string;
40
40
  deckId: string;
41
+ source: "env" | "session_override";
41
42
  badge: string;
42
43
  deckName: string;
43
- source: "env" | "session_override";
44
44
  workspaceRoot: string;
45
45
  cardCounts: {
46
46
  mcp: number;
@@ -52,9 +52,9 @@ export declare const LiveBindingSchema: z.ZodObject<{
52
52
  }, {
53
53
  updatedAt: string;
54
54
  deckId: string;
55
+ source: "env" | "session_override";
55
56
  badge: string;
56
57
  deckName: string;
57
- source: "env" | "session_override";
58
58
  workspaceRoot: string;
59
59
  cardCounts: {
60
60
  mcp: number;
@@ -89,8 +89,8 @@ export declare const DeckDisplaySchema: z.ZodObject<{
89
89
  displayLine: z.ZodString;
90
90
  }, "strip", z.ZodTypeAny, {
91
91
  deckId: string | null;
92
- deckName: string | null;
93
92
  source: "env" | "session_override" | "unbound";
93
+ deckName: string | null;
94
94
  workspaceRoot: string;
95
95
  cardCounts: {
96
96
  mcp: number;
@@ -104,8 +104,8 @@ export declare const DeckDisplaySchema: z.ZodObject<{
104
104
  mcpOnline?: boolean | undefined;
105
105
  }, {
106
106
  deckId: string | null;
107
- deckName: string | null;
108
107
  source: "env" | "session_override" | "unbound";
108
+ deckName: string | null;
109
109
  workspaceRoot: string;
110
110
  cardCounts: {
111
111
  mcp: number;
@@ -0,0 +1,208 @@
1
+ import { z } from 'zod';
2
+ export declare const FeedbackSignalIdSchema: z.ZodString;
3
+ export declare const FeedbackSignalSourceSchema: z.ZodEnum<["ide", "dealer", "backfill"]>;
4
+ export declare const FeedbackSignalStatusSchema: z.ZodEnum<["open", "actioned", "discarded"]>;
5
+ export declare const FeedbackSignalSchema: z.ZodObject<{
6
+ id: z.ZodString;
7
+ source: z.ZodEnum<["ide", "dealer", "backfill"]>;
8
+ sourceRef: z.ZodNullable<z.ZodString>;
9
+ failureSummary: z.ZodString;
10
+ userFeedbackExcerpt: z.ZodString;
11
+ correctedOutputHint: z.ZodNullable<z.ZodString>;
12
+ candidatePlaybookId: z.ZodNullable<z.ZodString>;
13
+ candidateDeckId: z.ZodNullable<z.ZodString>;
14
+ linkedPatchId: z.ZodNullable<z.ZodString>;
15
+ status: z.ZodEnum<["open", "actioned", "discarded"]>;
16
+ createdAt: z.ZodString;
17
+ }, "strip", z.ZodTypeAny, {
18
+ id: string;
19
+ status: "open" | "actioned" | "discarded";
20
+ createdAt: string;
21
+ source: "ide" | "dealer" | "backfill";
22
+ sourceRef: string | null;
23
+ failureSummary: string;
24
+ userFeedbackExcerpt: string;
25
+ correctedOutputHint: string | null;
26
+ candidatePlaybookId: string | null;
27
+ candidateDeckId: string | null;
28
+ linkedPatchId: string | null;
29
+ }, {
30
+ id: string;
31
+ status: "open" | "actioned" | "discarded";
32
+ createdAt: string;
33
+ source: "ide" | "dealer" | "backfill";
34
+ sourceRef: string | null;
35
+ failureSummary: string;
36
+ userFeedbackExcerpt: string;
37
+ correctedOutputHint: string | null;
38
+ candidatePlaybookId: string | null;
39
+ candidateDeckId: string | null;
40
+ linkedPatchId: string | null;
41
+ }>;
42
+ export type FeedbackSignal = z.infer<typeof FeedbackSignalSchema>;
43
+ export type FeedbackSignalSource = z.infer<typeof FeedbackSignalSourceSchema>;
44
+ export type FeedbackSignalStatus = z.infer<typeof FeedbackSignalStatusSchema>;
45
+ export declare const FeedbackSignalCountSchema: z.ZodObject<{
46
+ /** Count of matching rows; badge uses available-open (see available query). */
47
+ open: z.ZodNumber;
48
+ }, "strip", z.ZodTypeAny, {
49
+ open: number;
50
+ }, {
51
+ open: number;
52
+ }>;
53
+ export type FeedbackSignalCount = z.infer<typeof FeedbackSignalCountSchema>;
54
+ export declare const ListFeedbackSignalsQuerySchema: z.ZodObject<{
55
+ status: z.ZodOptional<z.ZodEnum<["open", "actioned", "discarded"]>>;
56
+ playbookId: z.ZodOptional<z.ZodString>;
57
+ deckId: z.ZodOptional<z.ZodString>;
58
+ /** When true, omit rows linked to a still-proposed patch. */
59
+ excludeInProposal: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["true", "false", "1", "0"]>]>>, boolean, boolean | "0" | "1" | "true" | "false" | undefined>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ excludeInProposal: boolean;
62
+ status?: "open" | "actioned" | "discarded" | undefined;
63
+ deckId?: string | undefined;
64
+ playbookId?: string | undefined;
65
+ }, {
66
+ status?: "open" | "actioned" | "discarded" | undefined;
67
+ deckId?: string | undefined;
68
+ playbookId?: string | undefined;
69
+ excludeInProposal?: boolean | "0" | "1" | "true" | "false" | undefined;
70
+ }>;
71
+ export type ListFeedbackSignalsQuery = z.infer<typeof ListFeedbackSignalsQuerySchema>;
72
+ export declare const DiscardFeedbackSignalsSchema: z.ZodObject<{
73
+ signalIds: z.ZodArray<z.ZodString, "many">;
74
+ }, "strip", z.ZodTypeAny, {
75
+ signalIds: string[];
76
+ }, {
77
+ signalIds: string[];
78
+ }>;
79
+ export type DiscardFeedbackSignalsInput = z.infer<typeof DiscardFeedbackSignalsSchema>;
80
+ export declare const DiscardFeedbackSignalsResultSchema: z.ZodObject<{
81
+ discarded: z.ZodNumber;
82
+ ids: z.ZodArray<z.ZodString, "many">;
83
+ }, "strip", z.ZodTypeAny, {
84
+ discarded: number;
85
+ ids: string[];
86
+ }, {
87
+ discarded: number;
88
+ ids: string[];
89
+ }>;
90
+ export type DiscardFeedbackSignalsResult = z.infer<typeof DiscardFeedbackSignalsResultSchema>;
91
+ export declare const ImportFeedbackSignalItemSchema: z.ZodObject<{
92
+ source: z.ZodDefault<z.ZodLiteral<"backfill">>;
93
+ sourceRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
94
+ failureSummary: z.ZodString;
95
+ userFeedbackExcerpt: z.ZodString;
96
+ correctedOutputHint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
97
+ candidatePlaybookId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
98
+ candidateDeckId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ source: "backfill";
101
+ failureSummary: string;
102
+ userFeedbackExcerpt: string;
103
+ sourceRef?: string | null | undefined;
104
+ correctedOutputHint?: string | null | undefined;
105
+ candidatePlaybookId?: string | null | undefined;
106
+ candidateDeckId?: string | null | undefined;
107
+ }, {
108
+ failureSummary: string;
109
+ userFeedbackExcerpt: string;
110
+ source?: "backfill" | undefined;
111
+ sourceRef?: string | null | undefined;
112
+ correctedOutputHint?: string | null | undefined;
113
+ candidatePlaybookId?: string | null | undefined;
114
+ candidateDeckId?: string | null | undefined;
115
+ }>;
116
+ export declare const ImportFeedbackSignalsSchema: z.ZodObject<{
117
+ signals: z.ZodArray<z.ZodObject<{
118
+ source: z.ZodDefault<z.ZodLiteral<"backfill">>;
119
+ sourceRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
120
+ failureSummary: z.ZodString;
121
+ userFeedbackExcerpt: z.ZodString;
122
+ correctedOutputHint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
123
+ candidatePlaybookId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
124
+ candidateDeckId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ source: "backfill";
127
+ failureSummary: string;
128
+ userFeedbackExcerpt: string;
129
+ sourceRef?: string | null | undefined;
130
+ correctedOutputHint?: string | null | undefined;
131
+ candidatePlaybookId?: string | null | undefined;
132
+ candidateDeckId?: string | null | undefined;
133
+ }, {
134
+ failureSummary: string;
135
+ userFeedbackExcerpt: string;
136
+ source?: "backfill" | undefined;
137
+ sourceRef?: string | null | undefined;
138
+ correctedOutputHint?: string | null | undefined;
139
+ candidatePlaybookId?: string | null | undefined;
140
+ candidateDeckId?: string | null | undefined;
141
+ }>, "many">;
142
+ }, "strip", z.ZodTypeAny, {
143
+ signals: {
144
+ source: "backfill";
145
+ failureSummary: string;
146
+ userFeedbackExcerpt: string;
147
+ sourceRef?: string | null | undefined;
148
+ correctedOutputHint?: string | null | undefined;
149
+ candidatePlaybookId?: string | null | undefined;
150
+ candidateDeckId?: string | null | undefined;
151
+ }[];
152
+ }, {
153
+ signals: {
154
+ failureSummary: string;
155
+ userFeedbackExcerpt: string;
156
+ source?: "backfill" | undefined;
157
+ sourceRef?: string | null | undefined;
158
+ correctedOutputHint?: string | null | undefined;
159
+ candidatePlaybookId?: string | null | undefined;
160
+ candidateDeckId?: string | null | undefined;
161
+ }[];
162
+ }>;
163
+ export type ImportFeedbackSignalItem = z.infer<typeof ImportFeedbackSignalItemSchema>;
164
+ export type ImportFeedbackSignalsInput = z.infer<typeof ImportFeedbackSignalsSchema>;
165
+ export declare const ImportFeedbackSignalsResultSchema: z.ZodObject<{
166
+ inserted: z.ZodNumber;
167
+ errors: z.ZodArray<z.ZodObject<{
168
+ index: z.ZodNumber;
169
+ error: z.ZodString;
170
+ }, "strip", z.ZodTypeAny, {
171
+ error: string;
172
+ index: number;
173
+ }, {
174
+ error: string;
175
+ index: number;
176
+ }>, "many">;
177
+ ids: z.ZodArray<z.ZodString, "many">;
178
+ }, "strip", z.ZodTypeAny, {
179
+ ids: string[];
180
+ inserted: number;
181
+ errors: {
182
+ error: string;
183
+ index: number;
184
+ }[];
185
+ }, {
186
+ ids: string[];
187
+ inserted: number;
188
+ errors: {
189
+ error: string;
190
+ index: number;
191
+ }[];
192
+ }>;
193
+ export type ImportFeedbackSignalsResult = z.infer<typeof ImportFeedbackSignalsResultSchema>;
194
+ /** Evidence required for signal capture (shared with patch evidence shape). */
195
+ export declare const SignalEvidenceSchema: z.ZodObject<{
196
+ failure_summary: z.ZodString;
197
+ user_feedback_excerpt: z.ZodString;
198
+ corrected_output_hint: z.ZodOptional<z.ZodString>;
199
+ }, "strip", z.ZodTypeAny, {
200
+ failure_summary: string;
201
+ user_feedback_excerpt: string;
202
+ corrected_output_hint?: string | undefined;
203
+ }, {
204
+ failure_summary: string;
205
+ user_feedback_excerpt: string;
206
+ corrected_output_hint?: string | undefined;
207
+ }>;
208
+ //# sourceMappingURL=feedback-signal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback-signal.d.ts","sourceRoot":"","sources":["../../src/schemas/feedback-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,sBAAsB,aAE0B,CAAC;AAE9D,eAAO,MAAM,0BAA0B,0CAAwC,CAAC;AAEhF,eAAO,MAAM,0BAA0B,8CAA4C,CAAC;AAEpF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,yBAAyB;IACpC,+EAA+E;;;;;;EAE/E,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,8BAA8B;;;;IAIzC,6DAA6D;;;;;;;;;;;;EAK7D,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEvF,eAAO,MAAM,kCAAkC;;;;;;;;;EAG7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;EAQzC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEtC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAErF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS5C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F,+EAA+E;AAC/E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAAsB,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignalEvidenceSchema = exports.ImportFeedbackSignalsResultSchema = exports.ImportFeedbackSignalsSchema = exports.ImportFeedbackSignalItemSchema = exports.DiscardFeedbackSignalsResultSchema = exports.DiscardFeedbackSignalsSchema = exports.ListFeedbackSignalsQuerySchema = exports.FeedbackSignalCountSchema = exports.FeedbackSignalSchema = exports.FeedbackSignalStatusSchema = exports.FeedbackSignalSourceSchema = exports.FeedbackSignalIdSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const playbook_patch_1 = require("./playbook-patch");
6
+ exports.FeedbackSignalIdSchema = zod_1.z
7
+ .string()
8
+ .regex(/^fs_[a-z0-9_]+$/, 'Signal id must match fs_<slug>');
9
+ exports.FeedbackSignalSourceSchema = zod_1.z.enum(['ide', 'dealer', 'backfill']);
10
+ exports.FeedbackSignalStatusSchema = zod_1.z.enum(['open', 'actioned', 'discarded']);
11
+ exports.FeedbackSignalSchema = zod_1.z.object({
12
+ id: exports.FeedbackSignalIdSchema,
13
+ source: exports.FeedbackSignalSourceSchema,
14
+ sourceRef: zod_1.z.string().nullable(),
15
+ failureSummary: zod_1.z.string().min(1),
16
+ userFeedbackExcerpt: zod_1.z.string().min(1),
17
+ correctedOutputHint: zod_1.z.string().nullable(),
18
+ candidatePlaybookId: zod_1.z.string().nullable(),
19
+ candidateDeckId: zod_1.z.string().uuid().nullable(),
20
+ linkedPatchId: zod_1.z.string().nullable(),
21
+ status: exports.FeedbackSignalStatusSchema,
22
+ createdAt: zod_1.z.string(),
23
+ });
24
+ exports.FeedbackSignalCountSchema = zod_1.z.object({
25
+ /** Count of matching rows; badge uses available-open (see available query). */
26
+ open: zod_1.z.number().int().nonnegative(),
27
+ });
28
+ exports.ListFeedbackSignalsQuerySchema = zod_1.z.object({
29
+ status: exports.FeedbackSignalStatusSchema.optional(),
30
+ playbookId: zod_1.z.string().optional(),
31
+ deckId: zod_1.z.string().uuid().optional(),
32
+ /** When true, omit rows linked to a still-proposed patch. */
33
+ excludeInProposal: zod_1.z
34
+ .union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false', '1', '0'])])
35
+ .optional()
36
+ .transform((v) => v === true || v === 'true' || v === '1'),
37
+ });
38
+ exports.DiscardFeedbackSignalsSchema = zod_1.z.object({
39
+ signalIds: zod_1.z.array(exports.FeedbackSignalIdSchema).min(1),
40
+ });
41
+ exports.DiscardFeedbackSignalsResultSchema = zod_1.z.object({
42
+ discarded: zod_1.z.number().int().nonnegative(),
43
+ ids: zod_1.z.array(exports.FeedbackSignalIdSchema),
44
+ });
45
+ exports.ImportFeedbackSignalItemSchema = zod_1.z.object({
46
+ source: zod_1.z.literal('backfill').default('backfill'),
47
+ sourceRef: zod_1.z.string().nullable().optional(),
48
+ failureSummary: zod_1.z.string().min(1),
49
+ userFeedbackExcerpt: zod_1.z.string().min(1),
50
+ correctedOutputHint: zod_1.z.string().nullable().optional(),
51
+ candidatePlaybookId: zod_1.z.string().nullable().optional(),
52
+ candidateDeckId: zod_1.z.string().uuid().nullable().optional(),
53
+ });
54
+ exports.ImportFeedbackSignalsSchema = zod_1.z.object({
55
+ signals: zod_1.z.array(exports.ImportFeedbackSignalItemSchema).min(1),
56
+ });
57
+ exports.ImportFeedbackSignalsResultSchema = zod_1.z.object({
58
+ inserted: zod_1.z.number().int().nonnegative(),
59
+ errors: zod_1.z.array(zod_1.z.object({
60
+ index: zod_1.z.number().int().nonnegative(),
61
+ error: zod_1.z.string(),
62
+ })),
63
+ ids: zod_1.z.array(exports.FeedbackSignalIdSchema),
64
+ });
65
+ /** Evidence required for signal capture (shared with patch evidence shape). */
66
+ exports.SignalEvidenceSchema = playbook_patch_1.PatchEvidenceSchema;
67
+ //# sourceMappingURL=feedback-signal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback-signal.js","sourceRoot":"","sources":["../../src/schemas/feedback-signal.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,qDAAuD;AAE1C,QAAA,sBAAsB,GAAG,OAAC;KACpC,MAAM,EAAE;KACR,KAAK,CAAC,iBAAiB,EAAE,gCAAgC,CAAC,CAAC;AAEjD,QAAA,0BAA0B,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,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Ae,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACzD,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,sCAA8B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CACxD,CAAC,CAAC;AAKU,QAAA,iCAAiC,GAAG,OAAC,CAAC,MAAM,CAAC;IACxD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACxC,MAAM,EAAE,OAAC,CAAC,KAAK,CACb,OAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;QACrC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;KAClB,CAAC,CACH;IACD,GAAG,EAAE,OAAC,CAAC,KAAK,CAAC,8BAAsB,CAAC;CACrC,CAAC,CAAC;AAIH,+EAA+E;AAClE,QAAA,oBAAoB,GAAG,oCAAmB,CAAC"}
@@ -1,10 +1,14 @@
1
1
  import { z } from 'zod';
2
2
  import type { TriggerConflict } from '../utils/trigger-hygiene';
3
3
  export declare const PlaybookPatchIdSchema: z.ZodString;
4
+ /** Stored on `playbook_patches` rows — never includes signal_only. */
4
5
  export declare const PlaybookPatchKindSchema: z.ZodEnum<["create", "update", "merge", "retire"]>;
6
+ /** Propose MCP/API kinds — includes signal_only (no patch row). */
7
+ export declare const ProposePlaybookPatchKindSchema: z.ZodEnum<["create", "update", "merge", "retire", "signal_only"]>;
5
8
  export declare const PlaybookPatchStatusSchema: z.ZodEnum<["proposed", "accepted", "rejected", "stale"]>;
6
9
  export declare const PlaybookPatchSourceSchema: z.ZodEnum<["ide", "dealer", "hook", "harvester"]>;
7
10
  export type PlaybookPatchSource = z.infer<typeof PlaybookPatchSourceSchema>;
11
+ export type ProposePlaybookPatchKind = z.infer<typeof ProposePlaybookPatchKindSchema>;
8
12
  export declare const PatchEvidenceSchema: z.ZodObject<{
9
13
  failure_summary: z.ZodString;
10
14
  user_feedback_excerpt: z.ZodString;
@@ -209,8 +213,8 @@ export declare const CreatePlaybookPatchFieldsSchema: z.ZodObject<{
209
213
  exec?: string | undefined;
210
214
  skill?: string | undefined;
211
215
  }>;
212
- export declare const ProposePlaybookPatchSchema: z.ZodObject<{
213
- kind: z.ZodEnum<["create", "update", "merge", "retire"]>;
216
+ export declare const ProposePlaybookPatchSchema: z.ZodEffects<z.ZodObject<{
217
+ kind: z.ZodEnum<["create", "update", "merge", "retire", "signal_only"]>;
214
218
  playbook_id: z.ZodOptional<z.ZodString>;
215
219
  ops: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
216
220
  op: z.ZodLiteral<"add_item">;
@@ -306,8 +310,10 @@ export declare const ProposePlaybookPatchSchema: z.ZodObject<{
306
310
  user_feedback_excerpt: string;
307
311
  corrected_output_hint?: string | undefined;
308
312
  }>>;
313
+ /** When submitting a curated revision, link these open signals to the new patch (actioned on accept). */
314
+ signal_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
309
315
  }, "strip", z.ZodTypeAny, {
310
- kind: "merge" | "create" | "update" | "retire";
316
+ kind: "merge" | "create" | "update" | "retire" | "signal_only";
311
317
  rationale: string;
312
318
  playbook_id?: string | undefined;
313
319
  ops?: ({
@@ -343,8 +349,9 @@ export declare const ProposePlaybookPatchSchema: z.ZodObject<{
343
349
  user_feedback_excerpt: string;
344
350
  corrected_output_hint?: string | undefined;
345
351
  } | undefined;
352
+ signal_ids?: string[] | undefined;
346
353
  }, {
347
- kind: "merge" | "create" | "update" | "retire";
354
+ kind: "merge" | "create" | "update" | "retire" | "signal_only";
348
355
  rationale: string;
349
356
  playbook_id?: string | undefined;
350
357
  ops?: ({
@@ -380,6 +387,83 @@ export declare const ProposePlaybookPatchSchema: z.ZodObject<{
380
387
  user_feedback_excerpt: string;
381
388
  corrected_output_hint?: string | undefined;
382
389
  } | undefined;
390
+ signal_ids?: string[] | undefined;
391
+ }>, {
392
+ kind: "merge" | "create" | "update" | "retire" | "signal_only";
393
+ rationale: string;
394
+ playbook_id?: string | undefined;
395
+ ops?: ({
396
+ op: "add_item";
397
+ section: string;
398
+ text: string;
399
+ } | {
400
+ op: "amend_item";
401
+ section: string;
402
+ text: string;
403
+ anchor: string;
404
+ } | {
405
+ op: "remove_item";
406
+ section: string;
407
+ anchor: string;
408
+ } | {
409
+ triggers: string[];
410
+ op: "set_triggers";
411
+ } | {
412
+ op: "rewrite_body";
413
+ text: string;
414
+ })[] | undefined;
415
+ new_playbook?: {
416
+ title: string;
417
+ body: string;
418
+ triggers: string[];
419
+ deck_id: string;
420
+ exec?: string | undefined;
421
+ skill?: string | undefined;
422
+ } | undefined;
423
+ evidence?: {
424
+ failure_summary: string;
425
+ user_feedback_excerpt: string;
426
+ corrected_output_hint?: string | undefined;
427
+ } | undefined;
428
+ signal_ids?: string[] | undefined;
429
+ }, {
430
+ kind: "merge" | "create" | "update" | "retire" | "signal_only";
431
+ rationale: string;
432
+ playbook_id?: string | undefined;
433
+ ops?: ({
434
+ op: "add_item";
435
+ section: string;
436
+ text: string;
437
+ } | {
438
+ op: "amend_item";
439
+ section: string;
440
+ text: string;
441
+ anchor: string;
442
+ } | {
443
+ op: "remove_item";
444
+ section: string;
445
+ anchor: string;
446
+ } | {
447
+ op: "set_triggers";
448
+ triggers?: string[] | undefined;
449
+ } | {
450
+ op: "rewrite_body";
451
+ text: string;
452
+ })[] | undefined;
453
+ new_playbook?: {
454
+ title: string;
455
+ deck_id: string;
456
+ body?: string | undefined;
457
+ triggers?: string[] | undefined;
458
+ exec?: string | undefined;
459
+ skill?: string | undefined;
460
+ } | undefined;
461
+ evidence?: {
462
+ failure_summary: string;
463
+ user_feedback_excerpt: string;
464
+ corrected_output_hint?: string | undefined;
465
+ } | undefined;
466
+ signal_ids?: string[] | undefined;
383
467
  }>;
384
468
  export declare const RejectPlaybookPatchSchema: z.ZodObject<{
385
469
  reason: z.ZodString;
@@ -408,6 +492,19 @@ export type PlaybookPatch = {
408
492
  createdAt: string;
409
493
  resolvedAt: string | null;
410
494
  };
495
+ /** Result of propose when kind is signal_only (no playbook_patches row). */
496
+ export type ProposeSignalOnlyResult = {
497
+ kind: 'signal_only';
498
+ signal: import('./feedback-signal').FeedbackSignal;
499
+ };
500
+ /** Result of propose when a patch row was created. */
501
+ export type ProposePatchResult = {
502
+ kind: Exclude<ProposePlaybookPatchKind, 'signal_only'>;
503
+ patch: PlaybookPatch;
504
+ /** Null when curation submit (`signal_ids`); otherwise new signal still `open` + linked. */
505
+ signal: import('./feedback-signal').FeedbackSignal | null;
506
+ };
507
+ export type ProposePlaybookPatchResult = ProposeSignalOnlyResult | ProposePatchResult;
411
508
  /** Dashboard list row — human title + decks referencing the playbook. */
412
509
  export type PlaybookPatchListItem = PlaybookPatch & {
413
510
  displayTitle: string;
@@ -1 +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;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,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;;;;;;;;;;;;;;;EAK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AE,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;IAC3D,iBAAiB,CAAC,EAAE,eAAe,EAAE,CAAC;CACvC,CAAC"}
@@ -1,12 +1,21 @@
1
1
  "use strict";
2
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;
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.ProposePlaybookPatchKindSchema = exports.PlaybookPatchKindSchema = exports.PlaybookPatchIdSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const playbook_1 = require("./playbook");
6
6
  exports.PlaybookPatchIdSchema = zod_1.z
7
7
  .string()
8
8
  .regex(/^pp_[a-z0-9_]+$/, 'Patch id must match pp_<slug>');
9
+ /** Stored on `playbook_patches` rows — never includes signal_only. */
9
10
  exports.PlaybookPatchKindSchema = zod_1.z.enum(['create', 'update', 'merge', 'retire']);
11
+ /** Propose MCP/API kinds — includes signal_only (no patch row). */
12
+ exports.ProposePlaybookPatchKindSchema = zod_1.z.enum([
13
+ 'create',
14
+ 'update',
15
+ 'merge',
16
+ 'retire',
17
+ 'signal_only',
18
+ ]);
10
19
  exports.PlaybookPatchStatusSchema = zod_1.z.enum(['proposed', 'accepted', 'rejected', 'stale']);
11
20
  exports.PlaybookPatchSourceSchema = zod_1.z.enum(['ide', 'dealer', 'hook', 'harvester']);
12
21
  exports.PatchEvidenceSchema = zod_1.z.object({
@@ -61,13 +70,48 @@ exports.CreatePlaybookPatchFieldsSchema = zod_1.z.object({
61
70
  exec: zod_1.z.string().optional(),
62
71
  skill: zod_1.z.string().optional(),
63
72
  });
64
- exports.ProposePlaybookPatchSchema = zod_1.z.object({
65
- kind: exports.PlaybookPatchKindSchema,
73
+ exports.ProposePlaybookPatchSchema = zod_1.z
74
+ .object({
75
+ kind: exports.ProposePlaybookPatchKindSchema,
66
76
  playbook_id: playbook_1.PlaybookIdSchema.optional(),
67
77
  ops: zod_1.z.array(exports.PatchOpSchema).optional(),
68
78
  new_playbook: exports.CreatePlaybookPatchFieldsSchema.optional(),
69
79
  rationale: zod_1.z.string().min(1),
70
80
  evidence: exports.PatchEvidenceSchema.optional(),
81
+ /** When submitting a curated revision, link these open signals to the new patch (actioned on accept). */
82
+ signal_ids: zod_1.z.array(zod_1.z.string().regex(/^fs_[a-z0-9_]+$/)).optional(),
83
+ })
84
+ .superRefine((val, ctx) => {
85
+ if (val.kind === 'signal_only') {
86
+ if (!val.evidence) {
87
+ ctx.addIssue({
88
+ code: zod_1.z.ZodIssueCode.custom,
89
+ message: 'evidence is required for signal_only',
90
+ path: ['evidence'],
91
+ });
92
+ }
93
+ if (val.ops !== undefined && val.ops.length > 0) {
94
+ ctx.addIssue({
95
+ code: zod_1.z.ZodIssueCode.custom,
96
+ message: 'ops must not be set for signal_only',
97
+ path: ['ops'],
98
+ });
99
+ }
100
+ if (val.new_playbook !== undefined) {
101
+ ctx.addIssue({
102
+ code: zod_1.z.ZodIssueCode.custom,
103
+ message: 'new_playbook must not be set for signal_only',
104
+ path: ['new_playbook'],
105
+ });
106
+ }
107
+ if (val.signal_ids !== undefined && val.signal_ids.length > 0) {
108
+ ctx.addIssue({
109
+ code: zod_1.z.ZodIssueCode.custom,
110
+ message: 'signal_ids must not be set for signal_only',
111
+ path: ['signal_ids'],
112
+ });
113
+ }
114
+ }
71
115
  });
72
116
  exports.RejectPlaybookPatchSchema = zod_1.z.object({
73
117
  reason: zod_1.z.string().min(1),
@@ -1 +1 @@
1
- {"version":3,"file":"playbook-patch.js","sourceRoot":"","sources":["../../src/schemas/playbook-patch.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,yCAAsE;AAGzD,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,yBAAyB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAElF,QAAA,yBAAyB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CA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1B,CAAC,CAAC"}
@@ -0,0 +1,387 @@
1
+ import { z } from 'zod';
2
+ export declare const PolarityHintSchema: z.ZodEnum<["negative", "positive", "mixed", "unknown"]>;
3
+ export declare const OutcomeSignalSchema: z.ZodEnum<["pr_opened", "committed", "unknown"]>;
4
+ export declare const BootstrapHostSchema: z.ZodEnum<["claude", "cursor"]>;
5
+ export declare const FeedbackMomentSchema: z.ZodObject<{
6
+ agentAction: z.ZodString;
7
+ userReaction: z.ZodString;
8
+ polarityHint: z.ZodEnum<["negative", "positive", "mixed", "unknown"]>;
9
+ markers: z.ZodArray<z.ZodString, "many">;
10
+ followupChange: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ at: z.ZodOptional<z.ZodString>;
12
+ }, "strict", z.ZodTypeAny, {
13
+ agentAction: string;
14
+ userReaction: string;
15
+ polarityHint: "unknown" | "negative" | "positive" | "mixed";
16
+ markers: string[];
17
+ at?: string | undefined;
18
+ followupChange?: string | null | undefined;
19
+ }, {
20
+ agentAction: string;
21
+ userReaction: string;
22
+ polarityHint: "unknown" | "negative" | "positive" | "mixed";
23
+ markers: string[];
24
+ at?: string | undefined;
25
+ followupChange?: string | null | undefined;
26
+ }>;
27
+ export declare const IntentItemSchema: z.ZodObject<{
28
+ text: z.ZodString;
29
+ at: z.ZodOptional<z.ZodString>;
30
+ }, "strict", z.ZodTypeAny, {
31
+ text: string;
32
+ at?: string | undefined;
33
+ }, {
34
+ text: string;
35
+ at?: string | undefined;
36
+ }>;
37
+ export declare const CommandItemSchema: z.ZodObject<{
38
+ command: z.ZodString;
39
+ count: z.ZodNumber;
40
+ }, "strict", z.ZodTypeAny, {
41
+ command: string;
42
+ count: number;
43
+ }, {
44
+ command: string;
45
+ count: number;
46
+ }>;
47
+ export declare const ToolItemSchema: z.ZodObject<{
48
+ name: z.ZodString;
49
+ count: z.ZodNumber;
50
+ }, "strict", z.ZodTypeAny, {
51
+ name: string;
52
+ count: number;
53
+ }, {
54
+ name: string;
55
+ count: number;
56
+ }>;
57
+ export declare const SkillItemSchema: z.ZodObject<{
58
+ name: z.ZodString;
59
+ count: z.ZodNumber;
60
+ }, "strict", z.ZodTypeAny, {
61
+ name: string;
62
+ count: number;
63
+ }, {
64
+ name: string;
65
+ count: number;
66
+ }>;
67
+ export declare const TopFileItemSchema: z.ZodObject<{
68
+ path: z.ZodString;
69
+ edits: z.ZodNumber;
70
+ }, "strict", z.ZodTypeAny, {
71
+ path: string;
72
+ edits: number;
73
+ }, {
74
+ path: string;
75
+ edits: number;
76
+ }>;
77
+ export declare const OutcomeSchema: z.ZodObject<{
78
+ signal: z.ZodEnum<["pr_opened", "committed", "unknown"]>;
79
+ evidence: z.ZodOptional<z.ZodString>;
80
+ }, "strict", z.ZodTypeAny, {
81
+ signal: "unknown" | "pr_opened" | "committed";
82
+ evidence?: string | undefined;
83
+ }, {
84
+ signal: "unknown" | "pr_opened" | "committed";
85
+ evidence?: string | undefined;
86
+ }>;
87
+ export declare const SessionDigestSchema: z.ZodObject<{
88
+ schemaVersion: z.ZodLiteral<1>;
89
+ /** Missing on pre-M2b digests — treat as claude (PRD §12 compat). */
90
+ host: z.ZodDefault<z.ZodEnum<["claude", "cursor"]>>;
91
+ sessionId: z.ZodString;
92
+ workspaceRoot: z.ZodString;
93
+ workspaceLabel: z.ZodOptional<z.ZodString>;
94
+ /**
95
+ * Host-agnostic workspace match key (encodeCursorProjectSlug of abs path, or Cursor project dir).
96
+ * Use for cross-host grouping / bound-deck matching; keep workspaceRoot as display when absolute.
97
+ */
98
+ workspaceSlug: z.ZodOptional<z.ZodString>;
99
+ gitBranch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
100
+ startedAt: z.ZodString;
101
+ endedAt: z.ZodOptional<z.ZodString>;
102
+ durationMinutes: z.ZodOptional<z.ZodNumber>;
103
+ turnCount: z.ZodNumber;
104
+ skippedLineCount: z.ZodOptional<z.ZodNumber>;
105
+ intents: z.ZodArray<z.ZodObject<{
106
+ text: z.ZodString;
107
+ at: z.ZodOptional<z.ZodString>;
108
+ }, "strict", z.ZodTypeAny, {
109
+ text: string;
110
+ at?: string | undefined;
111
+ }, {
112
+ text: string;
113
+ at?: string | undefined;
114
+ }>, "many">;
115
+ commands: z.ZodDefault<z.ZodArray<z.ZodObject<{
116
+ command: z.ZodString;
117
+ count: z.ZodNumber;
118
+ }, "strict", z.ZodTypeAny, {
119
+ command: string;
120
+ count: number;
121
+ }, {
122
+ command: string;
123
+ count: number;
124
+ }>, "many">>;
125
+ tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
126
+ name: z.ZodString;
127
+ count: z.ZodNumber;
128
+ }, "strict", z.ZodTypeAny, {
129
+ name: string;
130
+ count: number;
131
+ }, {
132
+ name: string;
133
+ count: number;
134
+ }>, "many">>;
135
+ skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
136
+ name: z.ZodString;
137
+ count: z.ZodNumber;
138
+ }, "strict", z.ZodTypeAny, {
139
+ name: string;
140
+ count: number;
141
+ }, {
142
+ name: string;
143
+ count: number;
144
+ }>, "many">>;
145
+ topFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
146
+ path: z.ZodString;
147
+ edits: z.ZodNumber;
148
+ }, "strict", z.ZodTypeAny, {
149
+ path: string;
150
+ edits: number;
151
+ }, {
152
+ path: string;
153
+ edits: number;
154
+ }>, "many">>;
155
+ feedbackMoments: z.ZodArray<z.ZodObject<{
156
+ agentAction: z.ZodString;
157
+ userReaction: z.ZodString;
158
+ polarityHint: z.ZodEnum<["negative", "positive", "mixed", "unknown"]>;
159
+ markers: z.ZodArray<z.ZodString, "many">;
160
+ followupChange: z.ZodOptional<z.ZodNullable<z.ZodString>>;
161
+ at: z.ZodOptional<z.ZodString>;
162
+ }, "strict", z.ZodTypeAny, {
163
+ agentAction: string;
164
+ userReaction: string;
165
+ polarityHint: "unknown" | "negative" | "positive" | "mixed";
166
+ markers: string[];
167
+ at?: string | undefined;
168
+ followupChange?: string | null | undefined;
169
+ }, {
170
+ agentAction: string;
171
+ userReaction: string;
172
+ polarityHint: "unknown" | "negative" | "positive" | "mixed";
173
+ markers: string[];
174
+ at?: string | undefined;
175
+ followupChange?: string | null | undefined;
176
+ }>, "many">;
177
+ outcome: z.ZodObject<{
178
+ signal: z.ZodEnum<["pr_opened", "committed", "unknown"]>;
179
+ evidence: z.ZodOptional<z.ZodString>;
180
+ }, "strict", z.ZodTypeAny, {
181
+ signal: "unknown" | "pr_opened" | "committed";
182
+ evidence?: string | undefined;
183
+ }, {
184
+ signal: "unknown" | "pr_opened" | "committed";
185
+ evidence?: string | undefined;
186
+ }>;
187
+ }, "strict", z.ZodTypeAny, {
188
+ tools: {
189
+ name: string;
190
+ count: number;
191
+ }[];
192
+ startedAt: string;
193
+ workspaceRoot: string;
194
+ schemaVersion: 1;
195
+ host: "claude" | "cursor";
196
+ sessionId: string;
197
+ turnCount: number;
198
+ intents: {
199
+ text: string;
200
+ at?: string | undefined;
201
+ }[];
202
+ commands: {
203
+ command: string;
204
+ count: number;
205
+ }[];
206
+ skills: {
207
+ name: string;
208
+ count: number;
209
+ }[];
210
+ topFiles: {
211
+ path: string;
212
+ edits: number;
213
+ }[];
214
+ feedbackMoments: {
215
+ agentAction: string;
216
+ userReaction: string;
217
+ polarityHint: "unknown" | "negative" | "positive" | "mixed";
218
+ markers: string[];
219
+ at?: string | undefined;
220
+ followupChange?: string | null | undefined;
221
+ }[];
222
+ outcome: {
223
+ signal: "unknown" | "pr_opened" | "committed";
224
+ evidence?: string | undefined;
225
+ };
226
+ workspaceLabel?: string | undefined;
227
+ workspaceSlug?: string | undefined;
228
+ gitBranch?: string | null | undefined;
229
+ endedAt?: string | undefined;
230
+ durationMinutes?: number | undefined;
231
+ skippedLineCount?: number | undefined;
232
+ }, {
233
+ startedAt: string;
234
+ workspaceRoot: string;
235
+ schemaVersion: 1;
236
+ sessionId: string;
237
+ turnCount: number;
238
+ intents: {
239
+ text: string;
240
+ at?: string | undefined;
241
+ }[];
242
+ feedbackMoments: {
243
+ agentAction: string;
244
+ userReaction: string;
245
+ polarityHint: "unknown" | "negative" | "positive" | "mixed";
246
+ markers: string[];
247
+ at?: string | undefined;
248
+ followupChange?: string | null | undefined;
249
+ }[];
250
+ outcome: {
251
+ signal: "unknown" | "pr_opened" | "committed";
252
+ evidence?: string | undefined;
253
+ };
254
+ tools?: {
255
+ name: string;
256
+ count: number;
257
+ }[] | undefined;
258
+ host?: "claude" | "cursor" | undefined;
259
+ workspaceLabel?: string | undefined;
260
+ workspaceSlug?: string | undefined;
261
+ gitBranch?: string | null | undefined;
262
+ endedAt?: string | undefined;
263
+ durationMinutes?: number | undefined;
264
+ skippedLineCount?: number | undefined;
265
+ commands?: {
266
+ command: string;
267
+ count: number;
268
+ }[] | undefined;
269
+ skills?: {
270
+ name: string;
271
+ count: number;
272
+ }[] | undefined;
273
+ topFiles?: {
274
+ path: string;
275
+ edits: number;
276
+ }[] | undefined;
277
+ }>;
278
+ export declare const BootstrapWorkspaceSchema: z.ZodObject<{
279
+ workspaceRoot: z.ZodString;
280
+ label: z.ZodString;
281
+ /** Shared across Claude abs + Cursor slug digests for the same repo. */
282
+ workspaceSlug: z.ZodOptional<z.ZodString>;
283
+ sessionCount: z.ZodNumber;
284
+ digestPaths: z.ZodArray<z.ZodString, "many">;
285
+ }, "strict", z.ZodTypeAny, {
286
+ label: string;
287
+ workspaceRoot: string;
288
+ sessionCount: number;
289
+ digestPaths: string[];
290
+ workspaceSlug?: string | undefined;
291
+ }, {
292
+ label: string;
293
+ workspaceRoot: string;
294
+ sessionCount: number;
295
+ digestPaths: string[];
296
+ workspaceSlug?: string | undefined;
297
+ }>;
298
+ export declare const BootstrapHostCountsSchema: z.ZodObject<{
299
+ claude: z.ZodNumber;
300
+ cursor: z.ZodNumber;
301
+ }, "strict", z.ZodTypeAny, {
302
+ claude: number;
303
+ cursor: number;
304
+ }, {
305
+ claude: number;
306
+ cursor: number;
307
+ }>;
308
+ export declare const BootstrapManifestSchema: z.ZodObject<{
309
+ schemaVersion: z.ZodLiteral<1>;
310
+ generatedAt: z.ZodString;
311
+ digestDir: z.ZodString;
312
+ guideRef: z.ZodString;
313
+ totalSessions: z.ZodNumber;
314
+ /** Missing on pre-M2b manifests — default zeros. */
315
+ hosts: z.ZodDefault<z.ZodObject<{
316
+ claude: z.ZodNumber;
317
+ cursor: z.ZodNumber;
318
+ }, "strict", z.ZodTypeAny, {
319
+ claude: number;
320
+ cursor: number;
321
+ }, {
322
+ claude: number;
323
+ cursor: number;
324
+ }>>;
325
+ workspaces: z.ZodArray<z.ZodObject<{
326
+ workspaceRoot: z.ZodString;
327
+ label: z.ZodString;
328
+ /** Shared across Claude abs + Cursor slug digests for the same repo. */
329
+ workspaceSlug: z.ZodOptional<z.ZodString>;
330
+ sessionCount: z.ZodNumber;
331
+ digestPaths: z.ZodArray<z.ZodString, "many">;
332
+ }, "strict", z.ZodTypeAny, {
333
+ label: string;
334
+ workspaceRoot: string;
335
+ sessionCount: number;
336
+ digestPaths: string[];
337
+ workspaceSlug?: string | undefined;
338
+ }, {
339
+ label: string;
340
+ workspaceRoot: string;
341
+ sessionCount: number;
342
+ digestPaths: string[];
343
+ workspaceSlug?: string | undefined;
344
+ }>, "many">;
345
+ }, "strict", z.ZodTypeAny, {
346
+ schemaVersion: 1;
347
+ generatedAt: string;
348
+ digestDir: string;
349
+ guideRef: string;
350
+ totalSessions: number;
351
+ hosts: {
352
+ claude: number;
353
+ cursor: number;
354
+ };
355
+ workspaces: {
356
+ label: string;
357
+ workspaceRoot: string;
358
+ sessionCount: number;
359
+ digestPaths: string[];
360
+ workspaceSlug?: string | undefined;
361
+ }[];
362
+ }, {
363
+ schemaVersion: 1;
364
+ generatedAt: string;
365
+ digestDir: string;
366
+ guideRef: string;
367
+ totalSessions: number;
368
+ workspaces: {
369
+ label: string;
370
+ workspaceRoot: string;
371
+ sessionCount: number;
372
+ digestPaths: string[];
373
+ workspaceSlug?: string | undefined;
374
+ }[];
375
+ hosts?: {
376
+ claude: number;
377
+ cursor: number;
378
+ } | undefined;
379
+ }>;
380
+ export type PolarityHint = z.infer<typeof PolarityHintSchema>;
381
+ export type OutcomeSignal = z.infer<typeof OutcomeSignalSchema>;
382
+ export type BootstrapHost = z.infer<typeof BootstrapHostSchema>;
383
+ export type FeedbackMoment = z.infer<typeof FeedbackMomentSchema>;
384
+ export type SessionDigest = z.infer<typeof SessionDigestSchema>;
385
+ export type BootstrapManifest = z.infer<typeof BootstrapManifestSchema>;
386
+ export type BootstrapHostCounts = z.infer<typeof BootstrapHostCountsSchema>;
387
+ //# sourceMappingURL=session-bootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-bootstrap.d.ts","sourceRoot":"","sources":["../../src/schemas/session-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB,yDAAuD,CAAC;AAEvF,eAAO,MAAM,mBAAmB,kDAAgD,CAAC;AAEjF,eAAO,MAAM,mBAAmB,iCAA+B,CAAC;AAEhE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;EAStB,CAAC;AAEZ,eAAO,MAAM,gBAAgB;;;;;;;;;EAKlB,CAAC;AAEZ,eAAO,MAAM,iBAAiB;;;;;;;;;EAKnB,CAAC;AAEZ,eAAO,MAAM,cAAc;;;;;;;;;EAKhB,CAAC;AAEZ,eAAO,MAAM,eAAe;;;;;;;;;EAKjB,CAAC;AAEZ,eAAO,MAAM,iBAAiB;;;;;;;;;EAKnB,CAAC;AAEZ,eAAO,MAAM,aAAa;;;;;;;;;EAKf,CAAC;AAEZ,eAAO,MAAM,mBAAmB;;IAG5B,qEAAqE;;;;;IAKrE;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBI,CAAC;AAEZ,eAAO,MAAM,wBAAwB;;;IAIjC,wEAAwE;;;;;;;;;;;;;;;;EAKjE,CAAC;AAEZ,eAAO,MAAM,yBAAyB;;;;;;;;;EAK3B,CAAC;AAEZ,eAAO,MAAM,uBAAuB;;;;;;IAOhC,oDAAoD;;;;;;;;;;;;;;QArBpD,wEAAwE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBjE,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BootstrapManifestSchema = exports.BootstrapHostCountsSchema = exports.BootstrapWorkspaceSchema = exports.SessionDigestSchema = exports.OutcomeSchema = exports.TopFileItemSchema = exports.SkillItemSchema = exports.ToolItemSchema = exports.CommandItemSchema = exports.IntentItemSchema = exports.FeedbackMomentSchema = exports.BootstrapHostSchema = exports.OutcomeSignalSchema = exports.PolarityHintSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.PolarityHintSchema = zod_1.z.enum(['negative', 'positive', 'mixed', 'unknown']);
6
+ exports.OutcomeSignalSchema = zod_1.z.enum(['pr_opened', 'committed', 'unknown']);
7
+ exports.BootstrapHostSchema = zod_1.z.enum(['claude', 'cursor']);
8
+ exports.FeedbackMomentSchema = zod_1.z
9
+ .object({
10
+ agentAction: zod_1.z.string().max(400),
11
+ userReaction: zod_1.z.string().max(600),
12
+ polarityHint: exports.PolarityHintSchema,
13
+ markers: zod_1.z.array(zod_1.z.string()),
14
+ followupChange: zod_1.z.string().max(400).nullable().optional(),
15
+ at: zod_1.z.string().datetime().optional(),
16
+ })
17
+ .strict();
18
+ exports.IntentItemSchema = zod_1.z
19
+ .object({
20
+ text: zod_1.z.string().max(280),
21
+ at: zod_1.z.string().datetime().optional(),
22
+ })
23
+ .strict();
24
+ exports.CommandItemSchema = zod_1.z
25
+ .object({
26
+ command: zod_1.z.string().max(160),
27
+ count: zod_1.z.number().int().min(1),
28
+ })
29
+ .strict();
30
+ exports.ToolItemSchema = zod_1.z
31
+ .object({
32
+ name: zod_1.z.string(),
33
+ count: zod_1.z.number().int().min(1),
34
+ })
35
+ .strict();
36
+ exports.SkillItemSchema = zod_1.z
37
+ .object({
38
+ name: zod_1.z.string(),
39
+ count: zod_1.z.number().int().min(1),
40
+ })
41
+ .strict();
42
+ exports.TopFileItemSchema = zod_1.z
43
+ .object({
44
+ path: zod_1.z.string(),
45
+ edits: zod_1.z.number().int().min(1),
46
+ })
47
+ .strict();
48
+ exports.OutcomeSchema = zod_1.z
49
+ .object({
50
+ signal: exports.OutcomeSignalSchema,
51
+ evidence: zod_1.z.string().optional(),
52
+ })
53
+ .strict();
54
+ exports.SessionDigestSchema = zod_1.z
55
+ .object({
56
+ schemaVersion: zod_1.z.literal(1),
57
+ /** Missing on pre-M2b digests — treat as claude (PRD §12 compat). */
58
+ host: exports.BootstrapHostSchema.default('claude'),
59
+ sessionId: zod_1.z.string(),
60
+ workspaceRoot: zod_1.z.string(),
61
+ workspaceLabel: zod_1.z.string().optional(),
62
+ /**
63
+ * Host-agnostic workspace match key (encodeCursorProjectSlug of abs path, or Cursor project dir).
64
+ * Use for cross-host grouping / bound-deck matching; keep workspaceRoot as display when absolute.
65
+ */
66
+ workspaceSlug: zod_1.z.string().optional(),
67
+ gitBranch: zod_1.z.string().nullable().optional(),
68
+ startedAt: zod_1.z.string().datetime(),
69
+ endedAt: zod_1.z.string().datetime().optional(),
70
+ durationMinutes: zod_1.z.number().min(0).optional(),
71
+ turnCount: zod_1.z.number().int().min(0),
72
+ skippedLineCount: zod_1.z.number().int().min(0).optional(),
73
+ intents: zod_1.z.array(exports.IntentItemSchema).max(40),
74
+ commands: zod_1.z.array(exports.CommandItemSchema).max(40).default([]),
75
+ tools: zod_1.z.array(exports.ToolItemSchema).max(40).default([]),
76
+ skills: zod_1.z.array(exports.SkillItemSchema).max(40).default([]),
77
+ topFiles: zod_1.z.array(exports.TopFileItemSchema).max(20).default([]),
78
+ feedbackMoments: zod_1.z.array(exports.FeedbackMomentSchema).max(30),
79
+ outcome: exports.OutcomeSchema,
80
+ })
81
+ .strict();
82
+ exports.BootstrapWorkspaceSchema = zod_1.z
83
+ .object({
84
+ workspaceRoot: zod_1.z.string(),
85
+ label: zod_1.z.string(),
86
+ /** Shared across Claude abs + Cursor slug digests for the same repo. */
87
+ workspaceSlug: zod_1.z.string().optional(),
88
+ sessionCount: zod_1.z.number().int().min(0),
89
+ digestPaths: zod_1.z.array(zod_1.z.string()),
90
+ })
91
+ .strict();
92
+ exports.BootstrapHostCountsSchema = zod_1.z
93
+ .object({
94
+ claude: zod_1.z.number().int().min(0),
95
+ cursor: zod_1.z.number().int().min(0),
96
+ })
97
+ .strict();
98
+ exports.BootstrapManifestSchema = zod_1.z
99
+ .object({
100
+ schemaVersion: zod_1.z.literal(1),
101
+ generatedAt: zod_1.z.string().datetime(),
102
+ digestDir: zod_1.z.string(),
103
+ guideRef: zod_1.z.string(),
104
+ totalSessions: zod_1.z.number().int().min(0),
105
+ /** Missing on pre-M2b manifests — default zeros. */
106
+ hosts: exports.BootstrapHostCountsSchema.default({ claude: 0, cursor: 0 }),
107
+ workspaces: zod_1.z.array(exports.BootstrapWorkspaceSchema),
108
+ })
109
+ .strict();
110
+ //# sourceMappingURL=session-bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-bootstrap.js","sourceRoot":"","sources":["../../src/schemas/session-bootstrap.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,kBAAkB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAE1E,QAAA,mBAAmB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;AAEpE,QAAA,mBAAmB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEnD,QAAA,oBAAoB,GAAG,OAAC;KAClC,MAAM,CAAC;IACN,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;IACjC,YAAY,EAAE,0BAAkB;IAChC,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IAC5B,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACzD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC;KACD,MAAM,EAAE,CAAC;AAEC,QAAA,gBAAgB,GAAG,OAAC;KAC9B,MAAM,CAAC;IACN,IAAI,EAAE,OAAC,CAAC,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SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtC,oDAAoD;IACpD,KAAK,EAAE,iCAAyB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAClE,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,gCAAwB,CAAC;CAC9C,CAAC;KACD,MAAM,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-deck/shared",
3
- "version": "1.4.4",
3
+ "version": "1.5.1",
4
4
  "description": "Shared types, schemas, and utilities for Agent Deck",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",