@lore-co/core 0.1.17 → 0.1.19
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/auth-schemas.d.ts +92 -4
- package/dist/auth-schemas.d.ts.map +1 -1
- package/dist/auth-schemas.js +77 -0
- package/dist/auth-schemas.js.map +1 -1
- package/dist/canonical-json.d.ts +19 -0
- package/dist/canonical-json.d.ts.map +1 -0
- package/dist/canonical-json.js +228 -0
- package/dist/canonical-json.js.map +1 -0
- package/dist/conflict-detector.d.ts.map +1 -1
- package/dist/conflict-detector.js +30 -14
- package/dist/conflict-detector.js.map +1 -1
- package/dist/engine.d.ts +38 -6
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +118 -25
- package/dist/engine.js.map +1 -1
- package/dist/guard-schemas.d.ts +217 -1
- package/dist/guard-schemas.d.ts.map +1 -1
- package/dist/guard-schemas.js +92 -11
- package/dist/guard-schemas.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/integration-contract.d.ts +612 -0
- package/dist/integration-contract.d.ts.map +1 -0
- package/dist/integration-contract.js +679 -0
- package/dist/integration-contract.js.map +1 -0
- package/dist/native-coding-agents.d.ts +1 -1
- package/dist/native-coding-agents.d.ts.map +1 -1
- package/dist/native-coding-agents.js +2 -0
- package/dist/native-coding-agents.js.map +1 -1
- package/dist/operational-metrics.d.ts +165 -0
- package/dist/operational-metrics.d.ts.map +1 -0
- package/dist/operational-metrics.js +216 -0
- package/dist/operational-metrics.js.map +1 -0
- package/dist/pilot-schemas.d.ts +80 -0
- package/dist/pilot-schemas.d.ts.map +1 -1
- package/dist/platform-admin-schemas.d.ts +171 -8
- package/dist/platform-admin-schemas.d.ts.map +1 -1
- package/dist/platform-admin-schemas.js +89 -1
- package/dist/platform-admin-schemas.js.map +1 -1
- package/dist/ports.d.ts +85 -8
- package/dist/ports.d.ts.map +1 -1
- package/dist/ports.js +231 -1
- package/dist/ports.js.map +1 -1
- package/dist/reliability-schemas.d.ts +723 -0
- package/dist/reliability-schemas.d.ts.map +1 -0
- package/dist/reliability-schemas.js +750 -0
- package/dist/reliability-schemas.js.map +1 -0
- package/dist/schemas.d.ts +205 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +166 -1
- package/dist/schemas.js.map +1 -1
- package/dist/session-schemas.d.ts +80 -0
- package/dist/session-schemas.d.ts.map +1 -1
- package/dist/snapshot-schemas.d.ts +3503 -0
- package/dist/snapshot-schemas.d.ts.map +1 -0
- package/dist/snapshot-schemas.js +507 -0
- package/dist/snapshot-schemas.js.map +1 -0
- package/package.json +21 -1
|
@@ -0,0 +1,679 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AgentReliabilityCapabilitiesSchema, RELIABILITY_CONTRACT_VERSION, } from "./reliability-schemas.js";
|
|
3
|
+
export const RELIABILITY_INTEGRATION_CONTRACT_VERSION = "reliability-integration-v1";
|
|
4
|
+
export const ReliabilityIntegrationIdSchema = z
|
|
5
|
+
.string()
|
|
6
|
+
.trim()
|
|
7
|
+
.min(1)
|
|
8
|
+
.max(100)
|
|
9
|
+
.regex(/^[a-z0-9](?:[a-z0-9._/-]*[a-z0-9])?$/u);
|
|
10
|
+
export const ReliabilityCaptureOperationSchema = z.enum([
|
|
11
|
+
"observation",
|
|
12
|
+
"paired_turn",
|
|
13
|
+
]);
|
|
14
|
+
export const ReliabilityInstallationMechanismSchema = z.enum([
|
|
15
|
+
"command_hooks",
|
|
16
|
+
"plugin",
|
|
17
|
+
"server_connector",
|
|
18
|
+
"library",
|
|
19
|
+
"mcp_stdio",
|
|
20
|
+
"mcp_remote",
|
|
21
|
+
]);
|
|
22
|
+
const InvocationEventSchema = z
|
|
23
|
+
.string()
|
|
24
|
+
.trim()
|
|
25
|
+
.min(1)
|
|
26
|
+
.max(100)
|
|
27
|
+
.regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/u);
|
|
28
|
+
export const ReliabilityIntegrationManifestSchema = z
|
|
29
|
+
.object({
|
|
30
|
+
integrationContractVersion: z.literal(RELIABILITY_INTEGRATION_CONTRACT_VERSION),
|
|
31
|
+
integrationId: ReliabilityIntegrationIdSchema,
|
|
32
|
+
displayName: z.string().trim().min(1).max(100),
|
|
33
|
+
capabilities: AgentReliabilityCapabilitiesSchema,
|
|
34
|
+
operations: z
|
|
35
|
+
.object({
|
|
36
|
+
capture: z.array(ReliabilityCaptureOperationSchema).max(2),
|
|
37
|
+
guard: z.boolean(),
|
|
38
|
+
})
|
|
39
|
+
.strict(),
|
|
40
|
+
installation: z
|
|
41
|
+
.object({
|
|
42
|
+
mechanism: ReliabilityInstallationMechanismSchema,
|
|
43
|
+
expectedUnits: z.number().int().positive().max(100).nullable(),
|
|
44
|
+
})
|
|
45
|
+
.strict(),
|
|
46
|
+
invocation: z
|
|
47
|
+
.object({
|
|
48
|
+
mode: z.enum(["event_driven", "polling", "host_managed"]),
|
|
49
|
+
events: z.array(InvocationEventSchema).max(20),
|
|
50
|
+
})
|
|
51
|
+
.strict(),
|
|
52
|
+
})
|
|
53
|
+
.strict()
|
|
54
|
+
.superRefine((manifest, context) => {
|
|
55
|
+
if (new Set(manifest.operations.capture).size !==
|
|
56
|
+
manifest.operations.capture.length) {
|
|
57
|
+
context.addIssue({
|
|
58
|
+
code: "custom",
|
|
59
|
+
path: ["operations", "capture"],
|
|
60
|
+
message: "Capture operations must be unique",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (new Set(manifest.invocation.events).size !==
|
|
64
|
+
manifest.invocation.events.length) {
|
|
65
|
+
context.addIssue({
|
|
66
|
+
code: "custom",
|
|
67
|
+
path: ["invocation", "events"],
|
|
68
|
+
message: "Invocation events must be unique",
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if ((manifest.operations.capture.length === 0) !==
|
|
72
|
+
(manifest.capabilities.captureDurability === "none")) {
|
|
73
|
+
context.addIssue({
|
|
74
|
+
code: "custom",
|
|
75
|
+
path: ["operations", "capture"],
|
|
76
|
+
message: "Capture operations and capture durability must describe the same support",
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (manifest.operations.guard !==
|
|
80
|
+
(manifest.capabilities.guardBoundaryCoverage !== "none")) {
|
|
81
|
+
context.addIssue({
|
|
82
|
+
code: "custom",
|
|
83
|
+
path: ["operations", "guard"],
|
|
84
|
+
message: "Guard operation support requires an integration-owned host boundary",
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const hookLike = manifest.installation.mechanism === "command_hooks" ||
|
|
88
|
+
manifest.installation.mechanism === "plugin";
|
|
89
|
+
if (hookLike !== (manifest.installation.expectedUnits !== null)) {
|
|
90
|
+
context.addIssue({
|
|
91
|
+
code: "custom",
|
|
92
|
+
path: ["installation", "expectedUnits"],
|
|
93
|
+
message: "Hook and plugin integrations must declare expected installation units",
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
export const ReliabilityInstallationUnitSchema = z
|
|
98
|
+
.object({
|
|
99
|
+
id: InvocationEventSchema,
|
|
100
|
+
state: z.enum(["exact", "missing", "drifted", "duplicate"]),
|
|
101
|
+
})
|
|
102
|
+
.strict();
|
|
103
|
+
export const ReliabilityInstallationHealthSchema = z
|
|
104
|
+
.object({
|
|
105
|
+
state: z.enum([
|
|
106
|
+
"complete",
|
|
107
|
+
"partial",
|
|
108
|
+
"missing",
|
|
109
|
+
"invalid",
|
|
110
|
+
"stale",
|
|
111
|
+
"not_applicable",
|
|
112
|
+
]),
|
|
113
|
+
configured: z.boolean(),
|
|
114
|
+
executable: z.boolean().nullable(),
|
|
115
|
+
installedUnits: z.number().int().nonnegative(),
|
|
116
|
+
expectedUnits: z.number().int().nonnegative(),
|
|
117
|
+
units: z.array(ReliabilityInstallationUnitSchema).max(100),
|
|
118
|
+
runtime: z.enum(["not_required", "installed", "missing", "stale"]),
|
|
119
|
+
runtimeVersion: z.string().trim().min(1).max(100).nullable(),
|
|
120
|
+
expectedRuntimeVersion: z.string().trim().min(1).max(100).nullable(),
|
|
121
|
+
issue: z.literal("invalid_configuration").nullable(),
|
|
122
|
+
})
|
|
123
|
+
.strict()
|
|
124
|
+
.superRefine((health, context) => {
|
|
125
|
+
const add = (path, message) => {
|
|
126
|
+
context.addIssue({ code: "custom", path, message });
|
|
127
|
+
};
|
|
128
|
+
if (health.state !== "invalid" &&
|
|
129
|
+
health.issue !== null) {
|
|
130
|
+
add(["issue"], "Only invalid installation state may include an issue");
|
|
131
|
+
}
|
|
132
|
+
if (health.state === "invalid" &&
|
|
133
|
+
health.issue !== "invalid_configuration") {
|
|
134
|
+
add(["issue"], "Invalid installation state requires its issue code");
|
|
135
|
+
}
|
|
136
|
+
if (health.state === "complete" &&
|
|
137
|
+
(health.installedUnits !== health.expectedUnits ||
|
|
138
|
+
health.units.length !== health.expectedUnits ||
|
|
139
|
+
health.units.some(({ state }) => state !== "exact") ||
|
|
140
|
+
(health.runtime !== "installed" &&
|
|
141
|
+
health.runtime !== "not_required"))) {
|
|
142
|
+
add(["state"], "Complete installation requires every unit and runtime to be exact");
|
|
143
|
+
}
|
|
144
|
+
if (health.state === "missing" &&
|
|
145
|
+
(health.installedUnits !== 0 ||
|
|
146
|
+
health.units.some(({ state }) => state !== "missing"))) {
|
|
147
|
+
add(["state"], "Missing installation cannot contain exact installation units");
|
|
148
|
+
}
|
|
149
|
+
if (health.state === "stale" && health.runtime !== "stale") {
|
|
150
|
+
add(["runtime"], "Stale installation requires a stale runtime");
|
|
151
|
+
}
|
|
152
|
+
if (health.state === "not_applicable" &&
|
|
153
|
+
(health.expectedUnits !== 0 ||
|
|
154
|
+
health.installedUnits !== 0 ||
|
|
155
|
+
health.units.length !== 0 ||
|
|
156
|
+
health.runtime !== "not_required")) {
|
|
157
|
+
add(["state"], "Not-applicable installation cannot declare units or a runtime");
|
|
158
|
+
}
|
|
159
|
+
if (health.runtime === "not_required" &&
|
|
160
|
+
(health.runtimeVersion !== null ||
|
|
161
|
+
health.expectedRuntimeVersion !== null)) {
|
|
162
|
+
add(["runtimeVersion"], "A runtime-free integration cannot declare runtime versions");
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
export const ReliabilityInvocationFailureCodeSchema = z.enum([
|
|
166
|
+
"invalid_input",
|
|
167
|
+
"runtime_error",
|
|
168
|
+
]);
|
|
169
|
+
const InvocationAttemptSchema = z
|
|
170
|
+
.object({
|
|
171
|
+
id: z.uuid(),
|
|
172
|
+
at: z.iso.datetime({ offset: true }),
|
|
173
|
+
runtimeVersion: z.string().trim().min(1).max(100).nullable(),
|
|
174
|
+
})
|
|
175
|
+
.strict();
|
|
176
|
+
const InvocationCompletionSchema = z.discriminatedUnion("outcome", [
|
|
177
|
+
z
|
|
178
|
+
.object({
|
|
179
|
+
attemptId: z.uuid(),
|
|
180
|
+
at: z.iso.datetime({ offset: true }),
|
|
181
|
+
outcome: z.literal("success"),
|
|
182
|
+
failureCode: z.null(),
|
|
183
|
+
})
|
|
184
|
+
.strict(),
|
|
185
|
+
z
|
|
186
|
+
.object({
|
|
187
|
+
attemptId: z.uuid(),
|
|
188
|
+
at: z.iso.datetime({ offset: true }),
|
|
189
|
+
outcome: z.literal("failure"),
|
|
190
|
+
failureCode: ReliabilityInvocationFailureCodeSchema,
|
|
191
|
+
})
|
|
192
|
+
.strict(),
|
|
193
|
+
]);
|
|
194
|
+
export const ReliabilityInvocationRecordSchema = z
|
|
195
|
+
.object({
|
|
196
|
+
version: z.literal(1),
|
|
197
|
+
integrationId: ReliabilityIntegrationIdSchema,
|
|
198
|
+
lastAttempt: InvocationAttemptSchema.nullable(),
|
|
199
|
+
lastCompletion: InvocationCompletionSchema.nullable(),
|
|
200
|
+
})
|
|
201
|
+
.strict()
|
|
202
|
+
.superRefine((record, context) => {
|
|
203
|
+
if (record.lastAttempt === null && record.lastCompletion !== null) {
|
|
204
|
+
context.addIssue({
|
|
205
|
+
code: "custom",
|
|
206
|
+
path: ["lastCompletion"],
|
|
207
|
+
message: "A completion requires an invocation attempt",
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
if (record.lastAttempt !== null &&
|
|
211
|
+
record.lastCompletion !== null) {
|
|
212
|
+
const attemptedAt = Date.parse(record.lastAttempt.at);
|
|
213
|
+
const completedAt = Date.parse(record.lastCompletion.at);
|
|
214
|
+
const invalidChronology = record.lastCompletion.attemptId === record.lastAttempt.id
|
|
215
|
+
? completedAt < attemptedAt
|
|
216
|
+
: completedAt > attemptedAt;
|
|
217
|
+
if (invalidChronology) {
|
|
218
|
+
context.addIssue({
|
|
219
|
+
code: "custom",
|
|
220
|
+
path: ["lastCompletion", "at"],
|
|
221
|
+
message: "Invocation completion chronology must match the latest attempt",
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
export const ReliabilityInvocationHealthSchema = z
|
|
227
|
+
.object({
|
|
228
|
+
state: z.enum([
|
|
229
|
+
"never_observed",
|
|
230
|
+
"successful",
|
|
231
|
+
"failed",
|
|
232
|
+
"incomplete",
|
|
233
|
+
"unknown",
|
|
234
|
+
]),
|
|
235
|
+
lastAttemptedAt: z.iso.datetime({ offset: true }).nullable(),
|
|
236
|
+
lastSuccessfulAt: z.iso.datetime({ offset: true }).nullable(),
|
|
237
|
+
runtimeVersion: z.string().trim().min(1).max(100).nullable(),
|
|
238
|
+
failureCode: ReliabilityInvocationFailureCodeSchema.nullable(),
|
|
239
|
+
})
|
|
240
|
+
.strict()
|
|
241
|
+
.superRefine((health, context) => {
|
|
242
|
+
const allNull = health.lastAttemptedAt === null &&
|
|
243
|
+
health.lastSuccessfulAt === null &&
|
|
244
|
+
health.runtimeVersion === null &&
|
|
245
|
+
health.failureCode === null;
|
|
246
|
+
if ((health.state === "never_observed" || health.state === "unknown") &&
|
|
247
|
+
!allNull) {
|
|
248
|
+
context.addIssue({
|
|
249
|
+
code: "custom",
|
|
250
|
+
path: ["state"],
|
|
251
|
+
message: `${health.state} invocation health cannot claim evidence`,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
if (health.state === "successful" &&
|
|
255
|
+
(health.lastAttemptedAt === null ||
|
|
256
|
+
health.lastSuccessfulAt === null ||
|
|
257
|
+
health.failureCode !== null)) {
|
|
258
|
+
context.addIssue({
|
|
259
|
+
code: "custom",
|
|
260
|
+
path: ["state"],
|
|
261
|
+
message: "Successful invocation health requires success timestamps",
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
if (health.state === "failed" &&
|
|
265
|
+
(health.lastAttemptedAt === null ||
|
|
266
|
+
health.lastSuccessfulAt !== null ||
|
|
267
|
+
health.failureCode === null)) {
|
|
268
|
+
context.addIssue({
|
|
269
|
+
code: "custom",
|
|
270
|
+
path: ["state"],
|
|
271
|
+
message: "Failed invocation health requires a fixed failure code",
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
if (health.state === "incomplete" &&
|
|
275
|
+
(health.lastAttemptedAt === null || health.failureCode !== null)) {
|
|
276
|
+
context.addIssue({
|
|
277
|
+
code: "custom",
|
|
278
|
+
path: ["state"],
|
|
279
|
+
message: "Incomplete invocation health requires an unmatched attempt",
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
export const ReliabilityIntegrationHealthSchema = z
|
|
284
|
+
.object({
|
|
285
|
+
integrationContractVersion: z.literal(RELIABILITY_INTEGRATION_CONTRACT_VERSION),
|
|
286
|
+
integrationId: ReliabilityIntegrationIdSchema,
|
|
287
|
+
observedAt: z.iso.datetime({ offset: true }),
|
|
288
|
+
installation: ReliabilityInstallationHealthSchema,
|
|
289
|
+
invocation: ReliabilityInvocationHealthSchema,
|
|
290
|
+
})
|
|
291
|
+
.strict();
|
|
292
|
+
export function deriveReliabilityInvocationHealth(value, integrationId) {
|
|
293
|
+
const parsed = ReliabilityInvocationRecordSchema.safeParse(value);
|
|
294
|
+
if (!parsed.success || parsed.data.integrationId !== integrationId) {
|
|
295
|
+
return {
|
|
296
|
+
state: value === null ? "never_observed" : "unknown",
|
|
297
|
+
lastAttemptedAt: null,
|
|
298
|
+
lastSuccessfulAt: null,
|
|
299
|
+
runtimeVersion: null,
|
|
300
|
+
failureCode: null,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
const { lastAttempt, lastCompletion } = parsed.data;
|
|
304
|
+
if (lastAttempt === null) {
|
|
305
|
+
return {
|
|
306
|
+
state: "never_observed",
|
|
307
|
+
lastAttemptedAt: null,
|
|
308
|
+
lastSuccessfulAt: null,
|
|
309
|
+
runtimeVersion: null,
|
|
310
|
+
failureCode: null,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
if (lastCompletion === null ||
|
|
314
|
+
lastCompletion.attemptId !== lastAttempt.id) {
|
|
315
|
+
return {
|
|
316
|
+
state: "incomplete",
|
|
317
|
+
lastAttemptedAt: lastAttempt.at,
|
|
318
|
+
lastSuccessfulAt: lastCompletion?.outcome === "success" ? lastCompletion.at : null,
|
|
319
|
+
runtimeVersion: lastAttempt.runtimeVersion,
|
|
320
|
+
failureCode: null,
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
return {
|
|
324
|
+
state: lastCompletion.outcome === "success" ? "successful" : "failed",
|
|
325
|
+
lastAttemptedAt: lastAttempt.at,
|
|
326
|
+
lastSuccessfulAt: lastCompletion.outcome === "success" ? lastCompletion.at : null,
|
|
327
|
+
runtimeVersion: lastAttempt.runtimeVersion,
|
|
328
|
+
failureCode: lastCompletion.failureCode,
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
function deepFreeze(value) {
|
|
332
|
+
if (typeof value === "object" && value !== null && !Object.isFrozen(value)) {
|
|
333
|
+
for (const nested of Object.values(value)) {
|
|
334
|
+
deepFreeze(nested);
|
|
335
|
+
}
|
|
336
|
+
Object.freeze(value);
|
|
337
|
+
}
|
|
338
|
+
return value;
|
|
339
|
+
}
|
|
340
|
+
function manifest(value) {
|
|
341
|
+
return deepFreeze(ReliabilityIntegrationManifestSchema.parse(value));
|
|
342
|
+
}
|
|
343
|
+
export const CLAUDE_RELIABILITY_INTEGRATION = manifest({
|
|
344
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
345
|
+
integrationId: "native/claude",
|
|
346
|
+
displayName: "Claude Code native hooks",
|
|
347
|
+
capabilities: {
|
|
348
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
349
|
+
agent: "claude",
|
|
350
|
+
contextDelivery: "pre_action",
|
|
351
|
+
captureDurability: "local_disk",
|
|
352
|
+
guardBoundaryCoverage: "partial",
|
|
353
|
+
guardedActions: ["edit", "command", "commit", "deploy"],
|
|
354
|
+
enforcement: "confirm",
|
|
355
|
+
stateDurability: "local_disk",
|
|
356
|
+
runtimeCoverage: ["local"],
|
|
357
|
+
},
|
|
358
|
+
operations: { capture: ["observation", "paired_turn"], guard: true },
|
|
359
|
+
installation: { mechanism: "command_hooks", expectedUnits: 4 },
|
|
360
|
+
invocation: {
|
|
361
|
+
mode: "event_driven",
|
|
362
|
+
events: ["UserPromptSubmit", "PreToolUse", "Stop", "SessionEnd"],
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
export const CODEX_RELIABILITY_INTEGRATION = manifest({
|
|
366
|
+
...CLAUDE_RELIABILITY_INTEGRATION,
|
|
367
|
+
integrationId: "native/codex",
|
|
368
|
+
displayName: "Codex native hooks",
|
|
369
|
+
capabilities: {
|
|
370
|
+
...CLAUDE_RELIABILITY_INTEGRATION.capabilities,
|
|
371
|
+
agent: "codex",
|
|
372
|
+
},
|
|
373
|
+
});
|
|
374
|
+
export const CURSOR_RELIABILITY_INTEGRATION = manifest({
|
|
375
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
376
|
+
integrationId: "native/cursor",
|
|
377
|
+
displayName: "Cursor native hooks",
|
|
378
|
+
capabilities: {
|
|
379
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
380
|
+
agent: "cursor",
|
|
381
|
+
contextDelivery: "prompt",
|
|
382
|
+
captureDurability: "local_disk",
|
|
383
|
+
guardBoundaryCoverage: "partial",
|
|
384
|
+
guardedActions: ["command", "commit", "deploy"],
|
|
385
|
+
enforcement: "deny",
|
|
386
|
+
stateDurability: "local_disk",
|
|
387
|
+
runtimeCoverage: ["local"],
|
|
388
|
+
},
|
|
389
|
+
operations: { capture: ["observation", "paired_turn"], guard: true },
|
|
390
|
+
installation: { mechanism: "command_hooks", expectedUnits: 4 },
|
|
391
|
+
invocation: {
|
|
392
|
+
mode: "event_driven",
|
|
393
|
+
events: [
|
|
394
|
+
"beforeSubmitPrompt",
|
|
395
|
+
"beforeShellExecution",
|
|
396
|
+
"afterAgentResponse",
|
|
397
|
+
"sessionEnd",
|
|
398
|
+
],
|
|
399
|
+
},
|
|
400
|
+
});
|
|
401
|
+
export const COPILOT_CLI_RELIABILITY_INTEGRATION = manifest({
|
|
402
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
403
|
+
integrationId: "native/copilot-cli",
|
|
404
|
+
displayName: "GitHub Copilot CLI native hooks",
|
|
405
|
+
capabilities: {
|
|
406
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
407
|
+
agent: "copilot-cli",
|
|
408
|
+
contextDelivery: "prompt",
|
|
409
|
+
captureDurability: "local_disk",
|
|
410
|
+
guardBoundaryCoverage: "partial",
|
|
411
|
+
guardedActions: ["edit", "command", "commit", "deploy"],
|
|
412
|
+
enforcement: "confirm",
|
|
413
|
+
stateDurability: "local_disk",
|
|
414
|
+
runtimeCoverage: ["local"],
|
|
415
|
+
},
|
|
416
|
+
operations: { capture: ["observation", "paired_turn"], guard: true },
|
|
417
|
+
installation: { mechanism: "command_hooks", expectedUnits: 4 },
|
|
418
|
+
invocation: {
|
|
419
|
+
mode: "event_driven",
|
|
420
|
+
events: [
|
|
421
|
+
"userPromptTransformed",
|
|
422
|
+
"preToolUse",
|
|
423
|
+
"agentStop",
|
|
424
|
+
"sessionEnd",
|
|
425
|
+
],
|
|
426
|
+
},
|
|
427
|
+
});
|
|
428
|
+
export const COPILOT_VSCODE_PREVIEW_RELIABILITY_INTEGRATION = manifest({
|
|
429
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
430
|
+
integrationId: "preview/copilot-vscode",
|
|
431
|
+
displayName: "GitHub Copilot in VS Code hooks (Preview)",
|
|
432
|
+
capabilities: {
|
|
433
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
434
|
+
agent: "copilot-vscode",
|
|
435
|
+
contextDelivery: "prompt",
|
|
436
|
+
captureDurability: "local_disk",
|
|
437
|
+
guardBoundaryCoverage: "partial",
|
|
438
|
+
guardedActions: ["edit", "command", "commit", "deploy"],
|
|
439
|
+
enforcement: "confirm",
|
|
440
|
+
stateDurability: "local_disk",
|
|
441
|
+
runtimeCoverage: ["local"],
|
|
442
|
+
},
|
|
443
|
+
operations: { capture: ["observation", "paired_turn"], guard: true },
|
|
444
|
+
installation: { mechanism: "command_hooks", expectedUnits: 4 },
|
|
445
|
+
invocation: {
|
|
446
|
+
mode: "event_driven",
|
|
447
|
+
events: ["UserPromptSubmit", "PreToolUse", "Stop", "SessionEnd"],
|
|
448
|
+
},
|
|
449
|
+
});
|
|
450
|
+
export const COPILOT_CLOUD_MCP_RELIABILITY_INTEGRATION = manifest({
|
|
451
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
452
|
+
integrationId: "mcp/copilot-cloud",
|
|
453
|
+
displayName: "GitHub Copilot cloud Lore MCP",
|
|
454
|
+
capabilities: {
|
|
455
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
456
|
+
agent: "copilot-cloud",
|
|
457
|
+
contextDelivery: "none",
|
|
458
|
+
captureDurability: "none",
|
|
459
|
+
guardBoundaryCoverage: "none",
|
|
460
|
+
guardedActions: [],
|
|
461
|
+
enforcement: "none",
|
|
462
|
+
stateDurability: "none",
|
|
463
|
+
runtimeCoverage: ["cloud"],
|
|
464
|
+
},
|
|
465
|
+
operations: { capture: [], guard: false },
|
|
466
|
+
installation: { mechanism: "mcp_remote", expectedUnits: null },
|
|
467
|
+
invocation: {
|
|
468
|
+
mode: "host_managed",
|
|
469
|
+
events: ["ask_lore", "search_learnings", "get_learning"],
|
|
470
|
+
},
|
|
471
|
+
});
|
|
472
|
+
export const POLYTOKEN_RELIABILITY_INTEGRATION = manifest({
|
|
473
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
474
|
+
integrationId: "native/polytoken",
|
|
475
|
+
displayName: "Polytoken native hooks",
|
|
476
|
+
capabilities: {
|
|
477
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
478
|
+
agent: "polytoken",
|
|
479
|
+
contextDelivery: "prompt",
|
|
480
|
+
captureDurability: "local_disk",
|
|
481
|
+
guardBoundaryCoverage: "none",
|
|
482
|
+
guardedActions: [],
|
|
483
|
+
enforcement: "context_only",
|
|
484
|
+
stateDurability: "local_disk",
|
|
485
|
+
runtimeCoverage: ["local"],
|
|
486
|
+
},
|
|
487
|
+
operations: { capture: ["observation", "paired_turn"], guard: false },
|
|
488
|
+
installation: { mechanism: "command_hooks", expectedUnits: 2 },
|
|
489
|
+
invocation: {
|
|
490
|
+
mode: "event_driven",
|
|
491
|
+
events: ["pre_user_prompt", "post_model_turn"],
|
|
492
|
+
},
|
|
493
|
+
});
|
|
494
|
+
export const OPENCODE_RELIABILITY_INTEGRATION = manifest({
|
|
495
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
496
|
+
integrationId: "plugin/opencode",
|
|
497
|
+
displayName: "OpenCode plugin",
|
|
498
|
+
capabilities: {
|
|
499
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
500
|
+
agent: "opencode",
|
|
501
|
+
contextDelivery: "prompt",
|
|
502
|
+
captureDurability: "local_disk",
|
|
503
|
+
guardBoundaryCoverage: "partial",
|
|
504
|
+
guardedActions: ["edit", "command", "commit", "deploy"],
|
|
505
|
+
enforcement: "deny",
|
|
506
|
+
stateDurability: "local_disk",
|
|
507
|
+
runtimeCoverage: ["local"],
|
|
508
|
+
},
|
|
509
|
+
operations: { capture: ["observation", "paired_turn"], guard: true },
|
|
510
|
+
installation: { mechanism: "plugin", expectedUnits: 1 },
|
|
511
|
+
invocation: {
|
|
512
|
+
mode: "event_driven",
|
|
513
|
+
events: [
|
|
514
|
+
"chat.message",
|
|
515
|
+
"experimental.chat.system.transform",
|
|
516
|
+
"tool.execute.before",
|
|
517
|
+
"session.idle",
|
|
518
|
+
"session.deleted",
|
|
519
|
+
],
|
|
520
|
+
},
|
|
521
|
+
});
|
|
522
|
+
export const DEVIN_RELIABILITY_INTEGRATION = manifest({
|
|
523
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
524
|
+
integrationId: "connector/devin",
|
|
525
|
+
displayName: "Devin cloud connector",
|
|
526
|
+
capabilities: {
|
|
527
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
528
|
+
agent: "devin",
|
|
529
|
+
contextDelivery: "prompt",
|
|
530
|
+
captureDurability: "server",
|
|
531
|
+
guardBoundaryCoverage: "none",
|
|
532
|
+
guardedActions: [],
|
|
533
|
+
enforcement: "context_only",
|
|
534
|
+
stateDurability: "server",
|
|
535
|
+
runtimeCoverage: ["cloud"],
|
|
536
|
+
},
|
|
537
|
+
operations: { capture: ["paired_turn"], guard: false },
|
|
538
|
+
installation: { mechanism: "server_connector", expectedUnits: null },
|
|
539
|
+
invocation: {
|
|
540
|
+
mode: "polling",
|
|
541
|
+
events: ["cli.start", "cli.prompt", "poller.messages"],
|
|
542
|
+
},
|
|
543
|
+
});
|
|
544
|
+
export const GENERIC_ADAPTER_RELIABILITY_INTEGRATION = manifest({
|
|
545
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
546
|
+
integrationId: "adapter/generic",
|
|
547
|
+
displayName: "Generic host adapter baseline",
|
|
548
|
+
capabilities: {
|
|
549
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
550
|
+
agent: "generic-adapter",
|
|
551
|
+
contextDelivery: "prompt",
|
|
552
|
+
captureDurability: "server",
|
|
553
|
+
guardBoundaryCoverage: "none",
|
|
554
|
+
guardedActions: [],
|
|
555
|
+
enforcement: "none",
|
|
556
|
+
stateDurability: "none",
|
|
557
|
+
runtimeCoverage: ["local", "cloud"],
|
|
558
|
+
},
|
|
559
|
+
operations: { capture: ["observation", "paired_turn"], guard: false },
|
|
560
|
+
installation: { mechanism: "library", expectedUnits: null },
|
|
561
|
+
invocation: {
|
|
562
|
+
mode: "host_managed",
|
|
563
|
+
events: [
|
|
564
|
+
"observeEventReliable",
|
|
565
|
+
"processTurnReliable",
|
|
566
|
+
"guardCheckReliable",
|
|
567
|
+
],
|
|
568
|
+
},
|
|
569
|
+
});
|
|
570
|
+
export const BEDROCK_RELIABILITY_INTEGRATION = manifest({
|
|
571
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
572
|
+
integrationId: "adapter/bedrock-agentcore",
|
|
573
|
+
displayName: "Amazon Bedrock AgentCore adapter",
|
|
574
|
+
capabilities: {
|
|
575
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
576
|
+
agent: "bedrock-agentcore",
|
|
577
|
+
contextDelivery: "prompt",
|
|
578
|
+
captureDurability: "server",
|
|
579
|
+
guardBoundaryCoverage: "none",
|
|
580
|
+
guardedActions: [],
|
|
581
|
+
enforcement: "none",
|
|
582
|
+
stateDurability: "none",
|
|
583
|
+
runtimeCoverage: ["cloud"],
|
|
584
|
+
},
|
|
585
|
+
operations: { capture: ["observation", "paired_turn"], guard: false },
|
|
586
|
+
installation: { mechanism: "library", expectedUnits: null },
|
|
587
|
+
invocation: {
|
|
588
|
+
mode: "host_managed",
|
|
589
|
+
events: ["prepareInvocationReliable"],
|
|
590
|
+
},
|
|
591
|
+
});
|
|
592
|
+
export const MCP_RELIABILITY_INTEGRATION = manifest({
|
|
593
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
594
|
+
integrationId: "mcp/stdio",
|
|
595
|
+
displayName: "Lore MCP server",
|
|
596
|
+
capabilities: {
|
|
597
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
598
|
+
agent: "mcp",
|
|
599
|
+
contextDelivery: "none",
|
|
600
|
+
captureDurability: "none",
|
|
601
|
+
guardBoundaryCoverage: "none",
|
|
602
|
+
guardedActions: [],
|
|
603
|
+
enforcement: "none",
|
|
604
|
+
stateDurability: "none",
|
|
605
|
+
runtimeCoverage: ["local"],
|
|
606
|
+
},
|
|
607
|
+
operations: { capture: [], guard: false },
|
|
608
|
+
installation: { mechanism: "mcp_stdio", expectedUnits: null },
|
|
609
|
+
invocation: {
|
|
610
|
+
mode: "event_driven",
|
|
611
|
+
events: [
|
|
612
|
+
"search_learnings",
|
|
613
|
+
"ask_lore",
|
|
614
|
+
"get_learning",
|
|
615
|
+
"remember_learning",
|
|
616
|
+
"correct_learning",
|
|
617
|
+
"forget_learning",
|
|
618
|
+
],
|
|
619
|
+
},
|
|
620
|
+
});
|
|
621
|
+
export const CLAUDE_COWORK_MCP_RELIABILITY_INTEGRATION = manifest({
|
|
622
|
+
integrationContractVersion: RELIABILITY_INTEGRATION_CONTRACT_VERSION,
|
|
623
|
+
integrationId: "plugin/claude-cowork",
|
|
624
|
+
displayName: "Claude Cowork Lore plugin",
|
|
625
|
+
capabilities: {
|
|
626
|
+
contractVersion: RELIABILITY_CONTRACT_VERSION,
|
|
627
|
+
agent: "claude-cowork",
|
|
628
|
+
contextDelivery: "none",
|
|
629
|
+
captureDurability: "none",
|
|
630
|
+
guardBoundaryCoverage: "none",
|
|
631
|
+
guardedActions: [],
|
|
632
|
+
enforcement: "none",
|
|
633
|
+
stateDurability: "none",
|
|
634
|
+
runtimeCoverage: ["local"],
|
|
635
|
+
},
|
|
636
|
+
operations: { capture: [], guard: false },
|
|
637
|
+
installation: { mechanism: "plugin", expectedUnits: 1 },
|
|
638
|
+
invocation: {
|
|
639
|
+
mode: "host_managed",
|
|
640
|
+
events: ["ask_lore", "search_learnings", "get_learning"],
|
|
641
|
+
},
|
|
642
|
+
});
|
|
643
|
+
export function createReliabilityIntegrationRegistry(values) {
|
|
644
|
+
const entries = values
|
|
645
|
+
.map((value) => ReliabilityIntegrationManifestSchema.parse(value))
|
|
646
|
+
.sort((left, right) => left.integrationId < right.integrationId
|
|
647
|
+
? -1
|
|
648
|
+
: left.integrationId > right.integrationId
|
|
649
|
+
? 1
|
|
650
|
+
: 0);
|
|
651
|
+
const byId = new Map();
|
|
652
|
+
for (const entry of entries) {
|
|
653
|
+
if (byId.has(entry.integrationId)) {
|
|
654
|
+
throw new Error(`Duplicate reliability integration: ${entry.integrationId}`);
|
|
655
|
+
}
|
|
656
|
+
byId.set(entry.integrationId, deepFreeze(entry));
|
|
657
|
+
}
|
|
658
|
+
const listed = Object.freeze([...byId.values()]);
|
|
659
|
+
return Object.freeze({
|
|
660
|
+
get: (integrationId) => byId.get(integrationId),
|
|
661
|
+
list: () => listed,
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
export const OFFICIAL_RELIABILITY_INTEGRATIONS = createReliabilityIntegrationRegistry([
|
|
665
|
+
BEDROCK_RELIABILITY_INTEGRATION,
|
|
666
|
+
CLAUDE_COWORK_MCP_RELIABILITY_INTEGRATION,
|
|
667
|
+
CLAUDE_RELIABILITY_INTEGRATION,
|
|
668
|
+
CODEX_RELIABILITY_INTEGRATION,
|
|
669
|
+
COPILOT_CLI_RELIABILITY_INTEGRATION,
|
|
670
|
+
COPILOT_CLOUD_MCP_RELIABILITY_INTEGRATION,
|
|
671
|
+
COPILOT_VSCODE_PREVIEW_RELIABILITY_INTEGRATION,
|
|
672
|
+
CURSOR_RELIABILITY_INTEGRATION,
|
|
673
|
+
DEVIN_RELIABILITY_INTEGRATION,
|
|
674
|
+
GENERIC_ADAPTER_RELIABILITY_INTEGRATION,
|
|
675
|
+
MCP_RELIABILITY_INTEGRATION,
|
|
676
|
+
OPENCODE_RELIABILITY_INTEGRATION,
|
|
677
|
+
POLYTOKEN_RELIABILITY_INTEGRATION,
|
|
678
|
+
]);
|
|
679
|
+
//# sourceMappingURL=integration-contract.js.map
|