@lore-co/core 0.2.29 → 0.2.31
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/approaches.d.ts +135 -12
- package/dist/approaches.d.ts.map +1 -1
- package/dist/approaches.js +98 -17
- package/dist/approaches.js.map +1 -1
- package/dist/auth-schemas.d.ts +38 -8
- package/dist/auth-schemas.d.ts.map +1 -1
- package/dist/auth-schemas.js +14 -2
- package/dist/auth-schemas.js.map +1 -1
- package/dist/builtin-skills.d.ts +1 -1
- package/dist/builtin-skills.d.ts.map +1 -1
- package/dist/builtin-skills.js +1 -1
- package/dist/builtin-skills.js.map +1 -1
- package/dist/chat-schemas.d.ts +1 -0
- package/dist/chat-schemas.d.ts.map +1 -1
- package/dist/connector-review.d.ts +2 -1
- package/dist/connector-review.d.ts.map +1 -1
- package/dist/connector-review.js +18 -2
- package/dist/connector-review.js.map +1 -1
- package/dist/draft-learnings.d.ts +6 -0
- package/dist/draft-learnings.d.ts.map +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +3 -1
- package/dist/engine.js.map +1 -1
- package/dist/guard-schemas.d.ts +2 -0
- package/dist/guard-schemas.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/learning-governance.js +1 -1
- package/dist/learning-governance.js.map +1 -1
- package/dist/learning-line.d.ts +5 -0
- package/dist/learning-line.d.ts.map +1 -1
- package/dist/learning-line.js +10 -0
- package/dist/learning-line.js.map +1 -1
- package/dist/learning-promotions.d.ts +479 -0
- package/dist/learning-promotions.d.ts.map +1 -0
- package/dist/learning-promotions.js +193 -0
- package/dist/learning-promotions.js.map +1 -0
- package/dist/learning-sources.d.ts +43 -0
- package/dist/learning-sources.d.ts.map +1 -1
- package/dist/learning-sources.js +14 -1
- package/dist/learning-sources.js.map +1 -1
- package/dist/pilot-schemas.d.ts +17 -0
- package/dist/pilot-schemas.d.ts.map +1 -1
- package/dist/platform-admin-schemas.d.ts +12 -3
- package/dist/platform-admin-schemas.d.ts.map +1 -1
- package/dist/platform-admin-schemas.js +12 -0
- package/dist/platform-admin-schemas.js.map +1 -1
- package/dist/prepared-context.d.ts +2 -0
- package/dist/prepared-context.d.ts.map +1 -1
- package/dist/prepared-context.js +9 -5
- package/dist/prepared-context.js.map +1 -1
- package/dist/product-usage.d.ts +146 -3
- package/dist/product-usage.d.ts.map +1 -1
- package/dist/product-usage.js +75 -2
- package/dist/product-usage.js.map +1 -1
- package/dist/redaction.d.ts.map +1 -1
- package/dist/redaction.js +52 -2
- package/dist/redaction.js.map +1 -1
- package/dist/rejected-idea-backfill.d.ts +59 -0
- package/dist/rejected-idea-backfill.d.ts.map +1 -0
- package/dist/rejected-idea-backfill.js +54 -0
- package/dist/rejected-idea-backfill.js.map +1 -0
- package/dist/reliability-schemas.d.ts +2 -0
- package/dist/reliability-schemas.d.ts.map +1 -1
- package/dist/reliability-schemas.js +1 -0
- package/dist/reliability-schemas.js.map +1 -1
- package/dist/schemas.d.ts +54 -1
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +8 -1
- package/dist/schemas.js.map +1 -1
- package/dist/session-schemas.d.ts +6 -0
- package/dist/session-schemas.d.ts.map +1 -1
- package/dist/snapshot-schemas.d.ts +21 -0
- package/dist/snapshot-schemas.d.ts.map +1 -1
- package/package.json +13 -1
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ApproachCitation } from "./approaches.js";
|
|
3
|
+
import { type Memory } from "./schemas.js";
|
|
4
|
+
/**
|
|
5
|
+
* A learning people keep re-teaching is a candidate for something agents
|
|
6
|
+
* cannot skip. Lore only suggests; an owner or admin decides.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PROMOTION_SESSION_THRESHOLD = 3;
|
|
9
|
+
/** One correction after the learning was already delivered is enough. */
|
|
10
|
+
export declare const PROMOTION_NOT_FOLLOWED_THRESHOLD = 1;
|
|
11
|
+
/**
|
|
12
|
+
* At most this many learnings per repository go into every prompt, newest
|
|
13
|
+
* decision first, so matched learnings keep most of the context budget.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ALWAYS_INCLUDE_LIMIT = 3;
|
|
16
|
+
/** A runbook draft takes at most this many source sessions (the prepare limit in approaches.ts). */
|
|
17
|
+
export declare const PROMOTION_RUNBOOK_SESSION_LIMIT = 10;
|
|
18
|
+
/**
|
|
19
|
+
* `approval_rule` sets `enforcement: "required"`, which Lore accepts only for
|
|
20
|
+
* learnings that compile to a supported Guard rule. `skill` and `runbook`
|
|
21
|
+
* both promote a procedure: `runbook` when captured sessions taught it, so
|
|
22
|
+
* the draft has sources and recorded runs; `skill` when none did. Each
|
|
23
|
+
* prepares a draft and is accepted only when that draft is saved.
|
|
24
|
+
* `always_include` delivers a plain repository rule with every prompt in its
|
|
25
|
+
* repository, not only when retrieval matches it.
|
|
26
|
+
*/
|
|
27
|
+
export declare const LearningPromotionKindSchema: z.ZodEnum<{
|
|
28
|
+
skill: "skill";
|
|
29
|
+
approval_rule: "approval_rule";
|
|
30
|
+
always_include: "always_include";
|
|
31
|
+
runbook: "runbook";
|
|
32
|
+
}>;
|
|
33
|
+
export type LearningPromotionKind = z.infer<typeof LearningPromotionKindSchema>;
|
|
34
|
+
/** Whether a kind promotes a procedure. A learning gets one of these, never both. */
|
|
35
|
+
export declare function procedurePromotionKind(kind: LearningPromotionKind): boolean;
|
|
36
|
+
export declare const LearningPromotionStatusSchema: z.ZodEnum<{
|
|
37
|
+
declined: "declined";
|
|
38
|
+
pending: "pending";
|
|
39
|
+
accepted: "accepted";
|
|
40
|
+
}>;
|
|
41
|
+
export type LearningPromotionStatus = z.infer<typeof LearningPromotionStatusSchema>;
|
|
42
|
+
/** One session that taught the learning, as the viewer may see it. */
|
|
43
|
+
export declare const LearningTeachingSessionSchema: z.ZodObject<{
|
|
44
|
+
sessionId: z.ZodUUID;
|
|
45
|
+
title: z.ZodNullable<z.ZodString>;
|
|
46
|
+
taughtAt: z.ZodISODateTime;
|
|
47
|
+
deliveredBefore: z.ZodBoolean;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
export type LearningTeachingSession = z.infer<typeof LearningTeachingSessionSchema>;
|
|
50
|
+
export declare const LearningTeachingsSchema: z.ZodObject<{
|
|
51
|
+
learningId: z.ZodUUID;
|
|
52
|
+
sessionCount: z.ZodNumber;
|
|
53
|
+
lastTaughtAt: z.ZodNullable<z.ZodISODateTime>;
|
|
54
|
+
notFollowedCount: z.ZodNumber;
|
|
55
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
56
|
+
sessionId: z.ZodUUID;
|
|
57
|
+
title: z.ZodNullable<z.ZodString>;
|
|
58
|
+
taughtAt: z.ZodISODateTime;
|
|
59
|
+
deliveredBefore: z.ZodBoolean;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
alwaysIncluded: z.ZodNullable<z.ZodObject<{
|
|
62
|
+
since: z.ZodISODateTime;
|
|
63
|
+
delivered: z.ZodBoolean;
|
|
64
|
+
}, z.core.$strict>>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
export type LearningTeachings = z.infer<typeof LearningTeachingsSchema>;
|
|
67
|
+
export declare const LearningPromotionSchema: z.ZodObject<{
|
|
68
|
+
id: z.ZodUUID;
|
|
69
|
+
kind: z.ZodEnum<{
|
|
70
|
+
skill: "skill";
|
|
71
|
+
approval_rule: "approval_rule";
|
|
72
|
+
always_include: "always_include";
|
|
73
|
+
runbook: "runbook";
|
|
74
|
+
}>;
|
|
75
|
+
status: z.ZodEnum<{
|
|
76
|
+
declined: "declined";
|
|
77
|
+
pending: "pending";
|
|
78
|
+
accepted: "accepted";
|
|
79
|
+
}>;
|
|
80
|
+
createdAt: z.ZodISODateTime;
|
|
81
|
+
decidedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
82
|
+
learning: z.ZodObject<{
|
|
83
|
+
id: z.ZodUUID;
|
|
84
|
+
workspaceId: z.ZodOptional<z.ZodUUID>;
|
|
85
|
+
content: z.ZodString;
|
|
86
|
+
scope: z.ZodObject<{
|
|
87
|
+
agent: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
88
|
+
organization: z.ZodOptional<z.ZodString>;
|
|
89
|
+
project: z.ZodOptional<z.ZodString>;
|
|
90
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
91
|
+
path: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>;
|
|
92
|
+
component: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
category: z.ZodEnum<{
|
|
95
|
+
architecture: "architecture";
|
|
96
|
+
convention: "convention";
|
|
97
|
+
correction: "correction";
|
|
98
|
+
gotcha: "gotcha";
|
|
99
|
+
known_gotcha: "known_gotcha";
|
|
100
|
+
deprecated: "deprecated";
|
|
101
|
+
rejected: "rejected";
|
|
102
|
+
behavior: "behavior";
|
|
103
|
+
review_feedback: "review_feedback";
|
|
104
|
+
other: "other";
|
|
105
|
+
}>;
|
|
106
|
+
status: z.ZodEnum<{
|
|
107
|
+
active: "active";
|
|
108
|
+
proposed: "proposed";
|
|
109
|
+
suppressed: "suppressed";
|
|
110
|
+
superseded: "superseded";
|
|
111
|
+
deleted: "deleted";
|
|
112
|
+
}>;
|
|
113
|
+
source: z.ZodObject<{
|
|
114
|
+
agent: z.ZodString;
|
|
115
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
116
|
+
messageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
117
|
+
rawText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
|
+
workspaceId: z.ZodOptional<z.ZodUUID>;
|
|
119
|
+
eventId: z.ZodOptional<z.ZodUUID>;
|
|
120
|
+
userId: z.ZodOptional<z.ZodUUID>;
|
|
121
|
+
redacted: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
}, z.core.$strict>;
|
|
123
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
confirmation: z.ZodOptional<z.ZodEnum<{
|
|
125
|
+
unconfirmed: "unconfirmed";
|
|
126
|
+
implicit: "implicit";
|
|
127
|
+
explicit: "explicit";
|
|
128
|
+
}>>;
|
|
129
|
+
enforcement: z.ZodOptional<z.ZodEnum<{
|
|
130
|
+
required: "required";
|
|
131
|
+
advisory: "advisory";
|
|
132
|
+
}>>;
|
|
133
|
+
guardRule: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
134
|
+
version: z.ZodLiteral<1>;
|
|
135
|
+
action: z.ZodLiteral<"push">;
|
|
136
|
+
branches: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
137
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
138
|
+
version: z.ZodLiteral<1>;
|
|
139
|
+
action: z.ZodLiteral<"edit">;
|
|
140
|
+
path: z.ZodString;
|
|
141
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
142
|
+
version: z.ZodLiteral<1>;
|
|
143
|
+
action: z.ZodEnum<{
|
|
144
|
+
shell: "shell";
|
|
145
|
+
deploy: "deploy";
|
|
146
|
+
commit: "commit";
|
|
147
|
+
}>;
|
|
148
|
+
}, z.core.$strict>], "action">>>;
|
|
149
|
+
reconciliationKey: z.ZodOptional<z.ZodString>;
|
|
150
|
+
fingerprint: z.ZodString;
|
|
151
|
+
supersedesMemoryId: z.ZodNullable<z.ZodUUID>;
|
|
152
|
+
createdAt: z.ZodISODateTime;
|
|
153
|
+
updatedAt: z.ZodISODateTime;
|
|
154
|
+
suppressedAt: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
|
|
155
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
156
|
+
}, z.core.$strict>;
|
|
157
|
+
teachings: z.ZodObject<{
|
|
158
|
+
learningId: z.ZodUUID;
|
|
159
|
+
sessionCount: z.ZodNumber;
|
|
160
|
+
lastTaughtAt: z.ZodNullable<z.ZodISODateTime>;
|
|
161
|
+
notFollowedCount: z.ZodNumber;
|
|
162
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
163
|
+
sessionId: z.ZodUUID;
|
|
164
|
+
title: z.ZodNullable<z.ZodString>;
|
|
165
|
+
taughtAt: z.ZodISODateTime;
|
|
166
|
+
deliveredBefore: z.ZodBoolean;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
alwaysIncluded: z.ZodNullable<z.ZodObject<{
|
|
169
|
+
since: z.ZodISODateTime;
|
|
170
|
+
delivered: z.ZodBoolean;
|
|
171
|
+
}, z.core.$strict>>;
|
|
172
|
+
}, z.core.$strict>;
|
|
173
|
+
repositoryAlwaysIncluded: z.ZodNumber;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
export type LearningPromotion = z.infer<typeof LearningPromotionSchema>;
|
|
176
|
+
export declare const ListLearningPromotionsResponseSchema: z.ZodObject<{
|
|
177
|
+
promotions: z.ZodArray<z.ZodObject<{
|
|
178
|
+
id: z.ZodUUID;
|
|
179
|
+
kind: z.ZodEnum<{
|
|
180
|
+
skill: "skill";
|
|
181
|
+
approval_rule: "approval_rule";
|
|
182
|
+
always_include: "always_include";
|
|
183
|
+
runbook: "runbook";
|
|
184
|
+
}>;
|
|
185
|
+
status: z.ZodEnum<{
|
|
186
|
+
declined: "declined";
|
|
187
|
+
pending: "pending";
|
|
188
|
+
accepted: "accepted";
|
|
189
|
+
}>;
|
|
190
|
+
createdAt: z.ZodISODateTime;
|
|
191
|
+
decidedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
192
|
+
learning: z.ZodObject<{
|
|
193
|
+
id: z.ZodUUID;
|
|
194
|
+
workspaceId: z.ZodOptional<z.ZodUUID>;
|
|
195
|
+
content: z.ZodString;
|
|
196
|
+
scope: z.ZodObject<{
|
|
197
|
+
agent: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
198
|
+
organization: z.ZodOptional<z.ZodString>;
|
|
199
|
+
project: z.ZodOptional<z.ZodString>;
|
|
200
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
201
|
+
path: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>;
|
|
202
|
+
component: z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
category: z.ZodEnum<{
|
|
205
|
+
architecture: "architecture";
|
|
206
|
+
convention: "convention";
|
|
207
|
+
correction: "correction";
|
|
208
|
+
gotcha: "gotcha";
|
|
209
|
+
known_gotcha: "known_gotcha";
|
|
210
|
+
deprecated: "deprecated";
|
|
211
|
+
rejected: "rejected";
|
|
212
|
+
behavior: "behavior";
|
|
213
|
+
review_feedback: "review_feedback";
|
|
214
|
+
other: "other";
|
|
215
|
+
}>;
|
|
216
|
+
status: z.ZodEnum<{
|
|
217
|
+
active: "active";
|
|
218
|
+
proposed: "proposed";
|
|
219
|
+
suppressed: "suppressed";
|
|
220
|
+
superseded: "superseded";
|
|
221
|
+
deleted: "deleted";
|
|
222
|
+
}>;
|
|
223
|
+
source: z.ZodObject<{
|
|
224
|
+
agent: z.ZodString;
|
|
225
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
226
|
+
messageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
227
|
+
rawText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
|
+
workspaceId: z.ZodOptional<z.ZodUUID>;
|
|
229
|
+
eventId: z.ZodOptional<z.ZodUUID>;
|
|
230
|
+
userId: z.ZodOptional<z.ZodUUID>;
|
|
231
|
+
redacted: z.ZodOptional<z.ZodBoolean>;
|
|
232
|
+
}, z.core.$strict>;
|
|
233
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
234
|
+
confirmation: z.ZodOptional<z.ZodEnum<{
|
|
235
|
+
unconfirmed: "unconfirmed";
|
|
236
|
+
implicit: "implicit";
|
|
237
|
+
explicit: "explicit";
|
|
238
|
+
}>>;
|
|
239
|
+
enforcement: z.ZodOptional<z.ZodEnum<{
|
|
240
|
+
required: "required";
|
|
241
|
+
advisory: "advisory";
|
|
242
|
+
}>>;
|
|
243
|
+
guardRule: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
244
|
+
version: z.ZodLiteral<1>;
|
|
245
|
+
action: z.ZodLiteral<"push">;
|
|
246
|
+
branches: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
247
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
248
|
+
version: z.ZodLiteral<1>;
|
|
249
|
+
action: z.ZodLiteral<"edit">;
|
|
250
|
+
path: z.ZodString;
|
|
251
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
252
|
+
version: z.ZodLiteral<1>;
|
|
253
|
+
action: z.ZodEnum<{
|
|
254
|
+
shell: "shell";
|
|
255
|
+
deploy: "deploy";
|
|
256
|
+
commit: "commit";
|
|
257
|
+
}>;
|
|
258
|
+
}, z.core.$strict>], "action">>>;
|
|
259
|
+
reconciliationKey: z.ZodOptional<z.ZodString>;
|
|
260
|
+
fingerprint: z.ZodString;
|
|
261
|
+
supersedesMemoryId: z.ZodNullable<z.ZodUUID>;
|
|
262
|
+
createdAt: z.ZodISODateTime;
|
|
263
|
+
updatedAt: z.ZodISODateTime;
|
|
264
|
+
suppressedAt: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
|
|
265
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
266
|
+
}, z.core.$strict>;
|
|
267
|
+
teachings: z.ZodObject<{
|
|
268
|
+
learningId: z.ZodUUID;
|
|
269
|
+
sessionCount: z.ZodNumber;
|
|
270
|
+
lastTaughtAt: z.ZodNullable<z.ZodISODateTime>;
|
|
271
|
+
notFollowedCount: z.ZodNumber;
|
|
272
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
273
|
+
sessionId: z.ZodUUID;
|
|
274
|
+
title: z.ZodNullable<z.ZodString>;
|
|
275
|
+
taughtAt: z.ZodISODateTime;
|
|
276
|
+
deliveredBefore: z.ZodBoolean;
|
|
277
|
+
}, z.core.$strict>>;
|
|
278
|
+
alwaysIncluded: z.ZodNullable<z.ZodObject<{
|
|
279
|
+
since: z.ZodISODateTime;
|
|
280
|
+
delivered: z.ZodBoolean;
|
|
281
|
+
}, z.core.$strict>>;
|
|
282
|
+
}, z.core.$strict>;
|
|
283
|
+
repositoryAlwaysIncluded: z.ZodNumber;
|
|
284
|
+
}, z.core.$strict>>;
|
|
285
|
+
total: z.ZodNumber;
|
|
286
|
+
}, z.core.$strict>;
|
|
287
|
+
export type ListLearningPromotionsResponse = z.infer<typeof ListLearningPromotionsResponseSchema>;
|
|
288
|
+
export declare const DecideLearningPromotionInputSchema: z.ZodObject<{
|
|
289
|
+
decision: z.ZodEnum<{
|
|
290
|
+
approve: "approve";
|
|
291
|
+
decline: "decline";
|
|
292
|
+
}>;
|
|
293
|
+
}, z.core.$strict>;
|
|
294
|
+
export type DecideLearningPromotionInput = z.infer<typeof DecideLearningPromotionInputSchema>;
|
|
295
|
+
export declare const PromotionSkillDraftSchema: z.ZodObject<{
|
|
296
|
+
name: z.ZodString;
|
|
297
|
+
description: z.ZodString;
|
|
298
|
+
instructions: z.ZodString;
|
|
299
|
+
}, z.core.$strict>;
|
|
300
|
+
export type PromotionSkillDraft = z.infer<typeof PromotionSkillDraftSchema>;
|
|
301
|
+
/** The start of a runbook document: the learning's steps, each citing the learning. */
|
|
302
|
+
export interface PromotionRunbookDraft {
|
|
303
|
+
name: string;
|
|
304
|
+
purpose: string;
|
|
305
|
+
steps: string[];
|
|
306
|
+
citations: ApproachCitation[];
|
|
307
|
+
}
|
|
308
|
+
export declare const DecideLearningPromotionResponseSchema: z.ZodObject<{
|
|
309
|
+
promotion: z.ZodObject<{
|
|
310
|
+
id: z.ZodUUID;
|
|
311
|
+
kind: z.ZodEnum<{
|
|
312
|
+
skill: "skill";
|
|
313
|
+
approval_rule: "approval_rule";
|
|
314
|
+
always_include: "always_include";
|
|
315
|
+
runbook: "runbook";
|
|
316
|
+
}>;
|
|
317
|
+
status: z.ZodEnum<{
|
|
318
|
+
declined: "declined";
|
|
319
|
+
pending: "pending";
|
|
320
|
+
accepted: "accepted";
|
|
321
|
+
}>;
|
|
322
|
+
createdAt: z.ZodISODateTime;
|
|
323
|
+
decidedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
324
|
+
learning: z.ZodObject<{
|
|
325
|
+
id: z.ZodUUID;
|
|
326
|
+
workspaceId: z.ZodOptional<z.ZodUUID>;
|
|
327
|
+
content: z.ZodString;
|
|
328
|
+
scope: z.ZodObject<{
|
|
329
|
+
agent: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
330
|
+
organization: z.ZodOptional<z.ZodString>;
|
|
331
|
+
project: z.ZodOptional<z.ZodString>;
|
|
332
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
333
|
+
path: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>;
|
|
334
|
+
component: z.ZodOptional<z.ZodString>;
|
|
335
|
+
}, z.core.$strict>;
|
|
336
|
+
category: z.ZodEnum<{
|
|
337
|
+
architecture: "architecture";
|
|
338
|
+
convention: "convention";
|
|
339
|
+
correction: "correction";
|
|
340
|
+
gotcha: "gotcha";
|
|
341
|
+
known_gotcha: "known_gotcha";
|
|
342
|
+
deprecated: "deprecated";
|
|
343
|
+
rejected: "rejected";
|
|
344
|
+
behavior: "behavior";
|
|
345
|
+
review_feedback: "review_feedback";
|
|
346
|
+
other: "other";
|
|
347
|
+
}>;
|
|
348
|
+
status: z.ZodEnum<{
|
|
349
|
+
active: "active";
|
|
350
|
+
proposed: "proposed";
|
|
351
|
+
suppressed: "suppressed";
|
|
352
|
+
superseded: "superseded";
|
|
353
|
+
deleted: "deleted";
|
|
354
|
+
}>;
|
|
355
|
+
source: z.ZodObject<{
|
|
356
|
+
agent: z.ZodString;
|
|
357
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
358
|
+
messageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
359
|
+
rawText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
360
|
+
workspaceId: z.ZodOptional<z.ZodUUID>;
|
|
361
|
+
eventId: z.ZodOptional<z.ZodUUID>;
|
|
362
|
+
userId: z.ZodOptional<z.ZodUUID>;
|
|
363
|
+
redacted: z.ZodOptional<z.ZodBoolean>;
|
|
364
|
+
}, z.core.$strict>;
|
|
365
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
366
|
+
confirmation: z.ZodOptional<z.ZodEnum<{
|
|
367
|
+
unconfirmed: "unconfirmed";
|
|
368
|
+
implicit: "implicit";
|
|
369
|
+
explicit: "explicit";
|
|
370
|
+
}>>;
|
|
371
|
+
enforcement: z.ZodOptional<z.ZodEnum<{
|
|
372
|
+
required: "required";
|
|
373
|
+
advisory: "advisory";
|
|
374
|
+
}>>;
|
|
375
|
+
guardRule: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
376
|
+
version: z.ZodLiteral<1>;
|
|
377
|
+
action: z.ZodLiteral<"push">;
|
|
378
|
+
branches: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
379
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
380
|
+
version: z.ZodLiteral<1>;
|
|
381
|
+
action: z.ZodLiteral<"edit">;
|
|
382
|
+
path: z.ZodString;
|
|
383
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
384
|
+
version: z.ZodLiteral<1>;
|
|
385
|
+
action: z.ZodEnum<{
|
|
386
|
+
shell: "shell";
|
|
387
|
+
deploy: "deploy";
|
|
388
|
+
commit: "commit";
|
|
389
|
+
}>;
|
|
390
|
+
}, z.core.$strict>], "action">>>;
|
|
391
|
+
reconciliationKey: z.ZodOptional<z.ZodString>;
|
|
392
|
+
fingerprint: z.ZodString;
|
|
393
|
+
supersedesMemoryId: z.ZodNullable<z.ZodUUID>;
|
|
394
|
+
createdAt: z.ZodISODateTime;
|
|
395
|
+
updatedAt: z.ZodISODateTime;
|
|
396
|
+
suppressedAt: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
|
|
397
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
398
|
+
}, z.core.$strict>;
|
|
399
|
+
teachings: z.ZodObject<{
|
|
400
|
+
learningId: z.ZodUUID;
|
|
401
|
+
sessionCount: z.ZodNumber;
|
|
402
|
+
lastTaughtAt: z.ZodNullable<z.ZodISODateTime>;
|
|
403
|
+
notFollowedCount: z.ZodNumber;
|
|
404
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
405
|
+
sessionId: z.ZodUUID;
|
|
406
|
+
title: z.ZodNullable<z.ZodString>;
|
|
407
|
+
taughtAt: z.ZodISODateTime;
|
|
408
|
+
deliveredBefore: z.ZodBoolean;
|
|
409
|
+
}, z.core.$strict>>;
|
|
410
|
+
alwaysIncluded: z.ZodNullable<z.ZodObject<{
|
|
411
|
+
since: z.ZodISODateTime;
|
|
412
|
+
delivered: z.ZodBoolean;
|
|
413
|
+
}, z.core.$strict>>;
|
|
414
|
+
}, z.core.$strict>;
|
|
415
|
+
repositoryAlwaysIncluded: z.ZodNumber;
|
|
416
|
+
}, z.core.$strict>;
|
|
417
|
+
}, z.core.$strict>;
|
|
418
|
+
export type DecideLearningPromotionResponse = z.infer<typeof DecideLearningPromotionResponseSchema>;
|
|
419
|
+
export declare function promotionDue(teachings: Pick<LearningTeachings, "sessionCount" | "notFollowedCount">): boolean;
|
|
420
|
+
/** Steps, not a single rule: two or more list items, or two sequencing words. */
|
|
421
|
+
export declare function describesProcedure(content: string): boolean;
|
|
422
|
+
/** Scoped to one whole repository, so "every prompt in that repository" means the same as retrieval scope. */
|
|
423
|
+
export declare function repositoryWideScope(scope: Memory["scope"]): boolean;
|
|
424
|
+
export interface PromotionContext {
|
|
425
|
+
/** The learning already goes into every prompt in its repository. */
|
|
426
|
+
alwaysIncluded?: boolean;
|
|
427
|
+
/** Captured sessions that taught the learning, which a runbook draft can draw on as sources. */
|
|
428
|
+
teachingSessions?: number;
|
|
429
|
+
}
|
|
430
|
+
/** The one promotion that fits this learning now, or null when none does. */
|
|
431
|
+
export declare function promotionKind(memory: Pick<Memory, "status" | "content" | "scope" | "guardRule" | "enforcement">, context?: PromotionContext): LearningPromotionKind | null;
|
|
432
|
+
/**
|
|
433
|
+
* Whether a stored suggestion still fits its learning. A procedure's suggestion
|
|
434
|
+
* stays as it was made, skill or runbook, when the sessions a viewer can read
|
|
435
|
+
* change; it leaves the list only when the learning stops being a procedure.
|
|
436
|
+
*/
|
|
437
|
+
export declare function promotionStillFits(stored: LearningPromotionKind, current: LearningPromotionKind | null): boolean;
|
|
438
|
+
/** A starting point for the written-skill form; the person edits it before saving. */
|
|
439
|
+
export declare function promotionSkillDraft(memory: Pick<Memory, "content" | "scope">, title?: string | null): PromotionSkillDraft;
|
|
440
|
+
/** The learning's steps: its list items, or its sentences when it reads as prose. */
|
|
441
|
+
export declare function promotionRunbookSteps(content: string): string[];
|
|
442
|
+
/** The starting procedure for a runbook drafted from the learning; every step cites it. The person edits it before saving. */
|
|
443
|
+
export declare function promotionRunbookDraft(memory: Pick<Memory, "id" | "content" | "scope">, title?: string | null): PromotionRunbookDraft;
|
|
444
|
+
/** What the suggestion would do, for terminal and agent output. */
|
|
445
|
+
export declare function promotionActionLabel(kind: LearningPromotionKind): string;
|
|
446
|
+
/** The evidence in one line: "taught in 3 sessions, last 2026-10-24; delivered and not followed in 1 session". */
|
|
447
|
+
export declare function promotionEvidenceText(teachings: Pick<LearningTeachings, "sessionCount" | "lastTaughtAt" | "notFollowedCount">): string;
|
|
448
|
+
/** Said before approving an every-prompt suggestion for a repository already at the limit; null below it. */
|
|
449
|
+
export declare function alwaysIncludeLimitNote(repo: string | undefined, alreadyIncluded: number): string | null;
|
|
450
|
+
/** The dashboard's written-skill form, filled in from the suggestion; saving it there approves the suggestion. */
|
|
451
|
+
export declare function promotionSkillPath(promotion: {
|
|
452
|
+
id: string;
|
|
453
|
+
learning: {
|
|
454
|
+
id: string;
|
|
455
|
+
scope: {
|
|
456
|
+
repo?: string | undefined;
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
}): string;
|
|
460
|
+
/**
|
|
461
|
+
* The dashboard's runbook draft page, with the learning and the sessions that
|
|
462
|
+
* taught it (newest first, within the runbook's limit) as sources. Saving the
|
|
463
|
+
* runbook there approves the suggestion; keeping it a draft decides nothing.
|
|
464
|
+
*/
|
|
465
|
+
export declare function promotionRunbookPath(promotion: {
|
|
466
|
+
id: string;
|
|
467
|
+
learning: {
|
|
468
|
+
id: string;
|
|
469
|
+
scope: {
|
|
470
|
+
repo?: string | undefined;
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
teachings: {
|
|
474
|
+
sessions: readonly {
|
|
475
|
+
sessionId: string;
|
|
476
|
+
}[];
|
|
477
|
+
};
|
|
478
|
+
}): string;
|
|
479
|
+
//# sourceMappingURL=learning-promotions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learning-promotions.d.ts","sourceRoot":"","sources":["../src/learning-promotions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,yEAAyE;AACzE,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAClD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,oGAAoG;AACpG,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAElD;;;;;;;;GAQG;AACH,eAAO,MAAM,2BA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