@lore-co/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +110 -0
- package/README.md +218 -0
- package/dist/cli.d.ts +28 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +792 -0
- package/dist/cli.js.map +1 -0
- package/dist/devin-client.d.ts +63 -0
- package/dist/devin-client.d.ts.map +1 -0
- package/dist/devin-client.js +231 -0
- package/dist/devin-client.js.map +1 -0
- package/dist/devin.d.ts +2 -0
- package/dist/devin.d.ts.map +1 -0
- package/dist/devin.js +479 -0
- package/dist/devin.js.map +1 -0
- package/dist/generated-assets.d.ts +7 -0
- package/dist/generated-assets.d.ts.map +1 -0
- package/dist/generated-assets.js +8 -0
- package/dist/generated-assets.js.map +1 -0
- package/dist/github.d.ts +13 -0
- package/dist/github.d.ts.map +1 -0
- package/dist/github.js +559 -0
- package/dist/github.js.map +1 -0
- package/dist/host.d.ts +24 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +337 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +10 -0
- package/dist/main.js.map +1 -0
- package/dist/repository.d.ts +3 -0
- package/dist/repository.d.ts.map +1 -0
- package/dist/repository.js +60 -0
- package/dist/repository.js.map +1 -0
- package/dist/review-output.d.ts +59 -0
- package/dist/review-output.d.ts.map +1 -0
- package/dist/review-output.js +112 -0
- package/dist/review-output.js.map +1 -0
- package/dist/runtime.d.ts +63 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +612 -0
- package/dist/runtime.js.map +1 -0
- package/dist/update.d.ts +2 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +97 -0
- package/dist/update.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/package.json +47 -0
package/dist/host.js
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { ContextDeliveryRequestSchema, GENERIC_LORE_CONTEXT_DELIMITERS, ObservationRequestSchema, PairedTurnRequestSchema, } from "@lore-co/core";
|
|
5
|
+
import { SharedMemoryClient } from "@lore-co/sdk";
|
|
6
|
+
import { ZodError } from "zod";
|
|
7
|
+
const MAX_INPUT_BYTES = 5 * 1024 * 1024;
|
|
8
|
+
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
9
|
+
const MIN_TIMEOUT_MS = 250;
|
|
10
|
+
const MAX_TIMEOUT_MS = 10_000;
|
|
11
|
+
export const HOST_HELP = `lore host
|
|
12
|
+
Call Lore's auditable host APIs from services, CI, and webhook handlers.
|
|
13
|
+
|
|
14
|
+
Usage:
|
|
15
|
+
lore host <command> [options]
|
|
16
|
+
|
|
17
|
+
Commands:
|
|
18
|
+
deliver Retrieve context and record a delivery receipt
|
|
19
|
+
observe Record a stable host event for later learning
|
|
20
|
+
turn Process an assistant/user pair and retrieve context
|
|
21
|
+
|
|
22
|
+
Discover:
|
|
23
|
+
lore host deliver --help
|
|
24
|
+
lore host observe --help
|
|
25
|
+
lore host turn --help
|
|
26
|
+
|
|
27
|
+
Examples:
|
|
28
|
+
lore host deliver --input request.json --output prompt
|
|
29
|
+
cat observation.json | lore host observe --input -
|
|
30
|
+
lore host turn --input turn.json --idempotency-key incident-42:reply-3
|
|
31
|
+
`;
|
|
32
|
+
export const HOST_DELIVER_HELP = `lore host deliver
|
|
33
|
+
Send exact POST /v1/context/deliveries JSON and print its audited result.
|
|
34
|
+
|
|
35
|
+
Usage:
|
|
36
|
+
lore host deliver --input <file|-> [--output json|context|prompt]
|
|
37
|
+
|
|
38
|
+
Options:
|
|
39
|
+
--input <file|-> Strict endpoint JSON file, or - for standard input
|
|
40
|
+
--output <format> json (default), context, or prompt
|
|
41
|
+
--help Show this command's help
|
|
42
|
+
|
|
43
|
+
Examples:
|
|
44
|
+
lore host deliver --input delivery.json --output json
|
|
45
|
+
cat delivery.json | lore host deliver --input - --output prompt
|
|
46
|
+
`;
|
|
47
|
+
export const HOST_OBSERVE_HELP = `lore host observe
|
|
48
|
+
Send exact POST /v1/observations JSON and print its audited event.
|
|
49
|
+
|
|
50
|
+
Usage:
|
|
51
|
+
lore host observe --input <file|-> [--output json]
|
|
52
|
+
|
|
53
|
+
Options:
|
|
54
|
+
--input <file|-> Strict endpoint JSON file, or - for standard input
|
|
55
|
+
--output json Print the JSON response (default)
|
|
56
|
+
--help Show this command's help
|
|
57
|
+
|
|
58
|
+
Examples:
|
|
59
|
+
lore host observe --input webhook-observation.json
|
|
60
|
+
cat observation.json | lore host observe --input -
|
|
61
|
+
`;
|
|
62
|
+
export const HOST_TURN_HELP = `lore host turn
|
|
63
|
+
Send exact POST /v1/turns JSON and print its audited result.
|
|
64
|
+
|
|
65
|
+
Usage:
|
|
66
|
+
lore host turn --input <file|-> [--output json|context|prompt] [--idempotency-key value]
|
|
67
|
+
|
|
68
|
+
Options:
|
|
69
|
+
--input <file|-> Strict endpoint JSON file, or - for standard input
|
|
70
|
+
--output <format> json (default), context, or prompt
|
|
71
|
+
--idempotency-key <value> Forward a retry-safe Idempotency-Key header
|
|
72
|
+
--help Show this command's help
|
|
73
|
+
|
|
74
|
+
Examples:
|
|
75
|
+
lore host turn --input turn.json --output prompt
|
|
76
|
+
cat turn.json | lore host turn --input - --idempotency-key incident-42:reply-3
|
|
77
|
+
`;
|
|
78
|
+
function valueAfter(args, index, flag) {
|
|
79
|
+
const value = args[index + 1];
|
|
80
|
+
if (value === undefined) {
|
|
81
|
+
throw new Error(`Missing value for ${flag}`);
|
|
82
|
+
}
|
|
83
|
+
return [value, index + 1];
|
|
84
|
+
}
|
|
85
|
+
function commandExample(command) {
|
|
86
|
+
return `lore host ${command} --input request.json`;
|
|
87
|
+
}
|
|
88
|
+
function parseHostArguments(command, args) {
|
|
89
|
+
let input;
|
|
90
|
+
let output = "json";
|
|
91
|
+
let idempotencyKey;
|
|
92
|
+
const seen = new Set();
|
|
93
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
94
|
+
const flag = args[index];
|
|
95
|
+
if (flag !== "--input" &&
|
|
96
|
+
flag !== "--output" &&
|
|
97
|
+
flag !== "--idempotency-key") {
|
|
98
|
+
throw new Error(`Unknown host ${command} option: ${flag ?? ""}\nTry: lore host ${command} --help`);
|
|
99
|
+
}
|
|
100
|
+
if (seen.has(flag)) {
|
|
101
|
+
throw new Error(`Host ${command} option may be provided once: ${flag}`);
|
|
102
|
+
}
|
|
103
|
+
seen.add(flag);
|
|
104
|
+
const [value, valueIndex] = valueAfter(args, index, flag);
|
|
105
|
+
index = valueIndex;
|
|
106
|
+
if (flag === "--input") {
|
|
107
|
+
input = value;
|
|
108
|
+
}
|
|
109
|
+
else if (flag === "--output") {
|
|
110
|
+
if (value !== "json" && value !== "context" && value !== "prompt") {
|
|
111
|
+
throw new Error("--output must be json, context, or prompt");
|
|
112
|
+
}
|
|
113
|
+
output = value;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
idempotencyKey = value;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (input === undefined || input.trim() === "") {
|
|
120
|
+
throw new Error(`--input <file|-> is required; no interactive fallback is available.\nExample: ${commandExample(command)}`);
|
|
121
|
+
}
|
|
122
|
+
if (command === "observe" && output !== "json") {
|
|
123
|
+
throw new Error("lore host observe supports only --output json");
|
|
124
|
+
}
|
|
125
|
+
if (command !== "turn" && idempotencyKey !== undefined) {
|
|
126
|
+
throw new Error("--idempotency-key is available only for lore host turn");
|
|
127
|
+
}
|
|
128
|
+
if (idempotencyKey === "") {
|
|
129
|
+
throw new Error("--idempotency-key must not be empty");
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
input,
|
|
133
|
+
output,
|
|
134
|
+
...(idempotencyKey === undefined ? {} : { idempotencyKey }),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function normalizeApiUrl(value) {
|
|
138
|
+
let url;
|
|
139
|
+
try {
|
|
140
|
+
url = new URL(value);
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
throw new Error(`Invalid Lore API URL: ${value}`);
|
|
144
|
+
}
|
|
145
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
146
|
+
throw new Error("Lore API URL must use http or https");
|
|
147
|
+
}
|
|
148
|
+
if (url.username !== "" || url.password !== "") {
|
|
149
|
+
throw new Error("Lore API URL must not contain credentials");
|
|
150
|
+
}
|
|
151
|
+
url.hash = "";
|
|
152
|
+
url.search = "";
|
|
153
|
+
return url.href.replace(/\/+$/u, "");
|
|
154
|
+
}
|
|
155
|
+
function requiredCredential(value, name) {
|
|
156
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
157
|
+
throw new Error(`${name} is missing`);
|
|
158
|
+
}
|
|
159
|
+
return value.trim();
|
|
160
|
+
}
|
|
161
|
+
function boundedTimeout(value) {
|
|
162
|
+
if (typeof value !== "number" ||
|
|
163
|
+
!Number.isInteger(value) ||
|
|
164
|
+
value < MIN_TIMEOUT_MS ||
|
|
165
|
+
value > MAX_TIMEOUT_MS) {
|
|
166
|
+
return DEFAULT_TIMEOUT_MS;
|
|
167
|
+
}
|
|
168
|
+
return value;
|
|
169
|
+
}
|
|
170
|
+
export async function readHostConnection(env = process.env, home = env.HOME ?? homedir()) {
|
|
171
|
+
const environmentUrl = env.LORE_API_URL?.trim();
|
|
172
|
+
const environmentToken = (env.LORE_WORKSPACE_TOKEN ?? env.LORE_TOKEN)?.trim();
|
|
173
|
+
if (environmentUrl !== undefined || environmentToken !== undefined) {
|
|
174
|
+
if (environmentUrl === undefined || environmentUrl === "") {
|
|
175
|
+
throw new Error("LORE_API_URL is required when a Lore token environment variable is set");
|
|
176
|
+
}
|
|
177
|
+
if (environmentToken === undefined || environmentToken === "") {
|
|
178
|
+
throw new Error("LORE_WORKSPACE_TOKEN or LORE_TOKEN is required with LORE_API_URL");
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
apiUrl: normalizeApiUrl(environmentUrl),
|
|
182
|
+
token: environmentToken,
|
|
183
|
+
timeoutMs: DEFAULT_TIMEOUT_MS,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
const configPath = resolve(home, ".lore", "config.json");
|
|
187
|
+
let parsed;
|
|
188
|
+
try {
|
|
189
|
+
parsed = JSON.parse(await readFile(configPath, "utf8"));
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
const detail = error instanceof Error ? `: ${error.message}` : "";
|
|
193
|
+
throw new Error(`Lore credentials are required. Set LORE_API_URL plus LORE_WORKSPACE_TOKEN/LORE_TOKEN, or configure ${configPath}${detail}`);
|
|
194
|
+
}
|
|
195
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
196
|
+
throw new Error(`Invalid Lore connector config: ${configPath}`);
|
|
197
|
+
}
|
|
198
|
+
const config = parsed;
|
|
199
|
+
return {
|
|
200
|
+
apiUrl: normalizeApiUrl(requiredCredential(config.apiUrl, "Lore API URL")),
|
|
201
|
+
token: requiredCredential(config.token, "Lore workspace token"),
|
|
202
|
+
timeoutMs: boundedTimeout(config.timeoutMs),
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
async function readStdin(stream) {
|
|
206
|
+
const chunks = [];
|
|
207
|
+
let totalBytes = 0;
|
|
208
|
+
for await (const chunk of stream) {
|
|
209
|
+
const buffer = typeof chunk === "string" ? Buffer.from(chunk, "utf8") : Buffer.from(chunk);
|
|
210
|
+
totalBytes += buffer.byteLength;
|
|
211
|
+
if (totalBytes > MAX_INPUT_BYTES) {
|
|
212
|
+
throw new Error(`Standard input exceeds ${MAX_INPUT_BYTES} bytes`);
|
|
213
|
+
}
|
|
214
|
+
chunks.push(buffer);
|
|
215
|
+
}
|
|
216
|
+
return Buffer.concat(chunks, totalBytes);
|
|
217
|
+
}
|
|
218
|
+
async function readInput(input, stdin) {
|
|
219
|
+
const buffer = input === "-" ? await readStdin(stdin) : await readFile(input);
|
|
220
|
+
if (buffer.byteLength > MAX_INPUT_BYTES) {
|
|
221
|
+
throw new Error(`Input exceeds ${MAX_INPUT_BYTES} bytes: ${input}`);
|
|
222
|
+
}
|
|
223
|
+
const text = buffer.toString("utf8");
|
|
224
|
+
if (text.trim() === "") {
|
|
225
|
+
throw new Error(`Input is empty: ${input === "-" ? "standard input" : input}`);
|
|
226
|
+
}
|
|
227
|
+
try {
|
|
228
|
+
return JSON.parse(text);
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
232
|
+
throw new Error(`Input is not valid JSON (${input === "-" ? "standard input" : input}): ${detail}`);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function parseEndpointInput(label, parse) {
|
|
236
|
+
try {
|
|
237
|
+
return parse();
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
if (!(error instanceof ZodError)) {
|
|
241
|
+
throw error;
|
|
242
|
+
}
|
|
243
|
+
const details = error.issues
|
|
244
|
+
.map((issue) => `${issue.path.join(".") || "<root>"}: ${issue.message}`)
|
|
245
|
+
.join("; ");
|
|
246
|
+
throw new Error(`Invalid ${label} endpoint JSON: ${details}`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function withTimeout(implementation, timeoutMs) {
|
|
250
|
+
return async (input, init) => {
|
|
251
|
+
const timeout = AbortSignal.timeout(timeoutMs);
|
|
252
|
+
const signal = init?.signal === undefined || init.signal === null
|
|
253
|
+
? timeout
|
|
254
|
+
: AbortSignal.any([init.signal, timeout]);
|
|
255
|
+
return implementation(input, { ...init, signal });
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
function escapedContext(context) {
|
|
259
|
+
return context
|
|
260
|
+
.replaceAll(GENERIC_LORE_CONTEXT_DELIMITERS.start, "[Lore context start marker omitted]")
|
|
261
|
+
.replaceAll(GENERIC_LORE_CONTEXT_DELIMITERS.end, "[Lore context end marker omitted]");
|
|
262
|
+
}
|
|
263
|
+
export function injectHostContext(original, context) {
|
|
264
|
+
const normalized = context.trim();
|
|
265
|
+
if (normalized === "") {
|
|
266
|
+
return original;
|
|
267
|
+
}
|
|
268
|
+
return `${GENERIC_LORE_CONTEXT_DELIMITERS.start}\n${escapedContext(normalized)}\n${GENERIC_LORE_CONTEXT_DELIMITERS.end}\n\n${original}`;
|
|
269
|
+
}
|
|
270
|
+
function writeJson(stdout, value) {
|
|
271
|
+
stdout.write(`${JSON.stringify(value)}\n`);
|
|
272
|
+
}
|
|
273
|
+
function writeText(stdout, value) {
|
|
274
|
+
stdout.write(`${value}\n`);
|
|
275
|
+
}
|
|
276
|
+
export async function runHostCommand(args, options = {}) {
|
|
277
|
+
const command = args[0];
|
|
278
|
+
if (command === undefined || command === "--help" || command === "-h") {
|
|
279
|
+
(options.stdout ?? process.stdout).write(HOST_HELP);
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (command !== "deliver" && command !== "observe" && command !== "turn") {
|
|
283
|
+
throw new Error(`Unknown host command: ${command}\nTry: lore host --help`);
|
|
284
|
+
}
|
|
285
|
+
const help = command === "deliver"
|
|
286
|
+
? HOST_DELIVER_HELP
|
|
287
|
+
: command === "observe"
|
|
288
|
+
? HOST_OBSERVE_HELP
|
|
289
|
+
: HOST_TURN_HELP;
|
|
290
|
+
const commandArgs = args.slice(1);
|
|
291
|
+
if (commandArgs.includes("--help") || commandArgs.includes("-h")) {
|
|
292
|
+
(options.stdout ?? process.stdout).write(help);
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
const parsed = parseHostArguments(command, commandArgs);
|
|
296
|
+
const stdin = options.stdin ??
|
|
297
|
+
process.stdin;
|
|
298
|
+
const stdout = options.stdout ?? process.stdout;
|
|
299
|
+
const input = await readInput(parsed.input, stdin);
|
|
300
|
+
const connection = await readHostConnection(options.env, options.home);
|
|
301
|
+
const client = new SharedMemoryClient({
|
|
302
|
+
baseUrl: connection.apiUrl,
|
|
303
|
+
fetch: withTimeout(options.fetch ?? globalThis.fetch, connection.timeoutMs),
|
|
304
|
+
headers: { authorization: `Bearer ${connection.token}` },
|
|
305
|
+
});
|
|
306
|
+
if (command === "observe") {
|
|
307
|
+
const request = parseEndpointInput("POST /v1/observations", () => ObservationRequestSchema.parse(input));
|
|
308
|
+
writeJson(stdout, await client.observeEvent(request));
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
if (command === "deliver") {
|
|
312
|
+
const request = parseEndpointInput("POST /v1/context/deliveries", () => ContextDeliveryRequestSchema.parse(input));
|
|
313
|
+
const result = await client.deliverContext(request);
|
|
314
|
+
if (parsed.output === "json") {
|
|
315
|
+
writeJson(stdout, result);
|
|
316
|
+
}
|
|
317
|
+
else if (parsed.output === "context") {
|
|
318
|
+
writeText(stdout, result.context);
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
writeText(stdout, injectHostContext(request.task.task, result.context));
|
|
322
|
+
}
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
const request = parseEndpointInput("POST /v1/turns", () => PairedTurnRequestSchema.parse(input));
|
|
326
|
+
const result = await client.processTurn(request, parsed.idempotencyKey);
|
|
327
|
+
if (parsed.output === "json") {
|
|
328
|
+
writeJson(stdout, result);
|
|
329
|
+
}
|
|
330
|
+
else if (parsed.output === "context") {
|
|
331
|
+
writeText(stdout, result.context.text);
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
writeText(stdout, injectHostContext(request.currentUser.content, result.context.text));
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
//# sourceMappingURL=host.js.map
|
package/dist/host.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1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IACxE,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAC7B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;SAAM,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACvC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;SAAM,CAAC;QACN,SAAS,CACP,MAAM,EACN,iBAAiB,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CACpE,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { countLoreHooks, getLorePaths, mergeLoreHooks, removeLoreHooks, runCli, type ConnectorConfig, type LorePaths, } from "./cli.js";
|
|
2
|
+
export { createTurnRequest, handleHookEvent, redactSecrets, runHook, type AgentName, type HookResult, type HookRuntimeOptions, type TurnRequest, } from "./runtime.js";
|
|
3
|
+
export { connectGithub, reviewEventKey, reviewMarker, runGithubCommand, type ReviewIdentity, } from "./github.js";
|
|
4
|
+
export { parseReviewOutput, REVIEW_OUTPUT_SCHEMA, validateReviewOutput, type ReviewFinding, type ReviewOutput, type ReviewSeverity, } from "./review-output.js";
|
|
5
|
+
export { runDevinCommand } from "./devin.js";
|
|
6
|
+
export { DevinApiClient, type CreateDevinSessionInput, type DevinApiClientOptions, type DevinMessage, type DevinSession, } from "./devin-client.js";
|
|
7
|
+
export { HOST_DELIVER_HELP, HOST_HELP, HOST_OBSERVE_HELP, HOST_TURN_HELP, injectHostContext, readHostConnection, runHostCommand, type HostCommand, type HostCommandOptions, type HostConnection, type HostOutput, } from "./host.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,eAAe,EACf,MAAM,EACN,KAAK,eAAe,EACpB,KAAK,SAAS,GACf,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,OAAO,EACP,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,WAAW,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,cAAc,EACd,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { countLoreHooks, getLorePaths, mergeLoreHooks, removeLoreHooks, runCli, } from "./cli.js";
|
|
2
|
+
export { createTurnRequest, handleHookEvent, redactSecrets, runHook, } from "./runtime.js";
|
|
3
|
+
export { connectGithub, reviewEventKey, reviewMarker, runGithubCommand, } from "./github.js";
|
|
4
|
+
export { parseReviewOutput, REVIEW_OUTPUT_SCHEMA, validateReviewOutput, } from "./review-output.js";
|
|
5
|
+
export { runDevinCommand } from "./devin.js";
|
|
6
|
+
export { DevinApiClient, } from "./devin-client.js";
|
|
7
|
+
export { HOST_DELIVER_HELP, HOST_HELP, HOST_OBSERVE_HELP, HOST_TURN_HELP, injectHostContext, readHostConnection, runHostCommand, } from "./host.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,eAAe,EACf,MAAM,GAGP,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,OAAO,GAKR,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,gBAAgB,GAEjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,GAIrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,cAAc,GAKf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,GAKf,MAAM,WAAW,CAAC"}
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":""}
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { runCli } from "./cli.js";
|
|
2
|
+
try {
|
|
3
|
+
await runCli();
|
|
4
|
+
}
|
|
5
|
+
catch (error) {
|
|
6
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
7
|
+
process.stderr.write(`Error: ${message}\n`);
|
|
8
|
+
process.exitCode = 1;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,IAAI,CAAC;IACH,MAAM,MAAM,EAAE,CAAC;AACjB,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,OAAO,IAAI,CAAC,CAAC;IAC5C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../src/repository.ts"],"names":[],"mappings":"AAGA,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA6B9D;AAgBD,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAWjB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { basename, resolve } from "node:path";
|
|
3
|
+
export function canonicalRepositoryScope(value) {
|
|
4
|
+
const trimmed = value.trim().replace(/\/+$/u, "");
|
|
5
|
+
if (trimmed === "") {
|
|
6
|
+
throw new Error("Repository scope cannot be empty");
|
|
7
|
+
}
|
|
8
|
+
const scp = /^[^@\s]+@[^:\s]+:(.+)$/u.exec(trimmed);
|
|
9
|
+
const candidate = scp?.[1] ?? trimmed;
|
|
10
|
+
try {
|
|
11
|
+
const url = new URL(candidate);
|
|
12
|
+
if (url.hostname.toLowerCase() === "github.com") {
|
|
13
|
+
const path = url.pathname.replace(/^\/+|\/+$/gu, "").replace(/\.git$/u, "");
|
|
14
|
+
const parts = path.split("/").filter(Boolean);
|
|
15
|
+
if (parts.length >= 2) {
|
|
16
|
+
return `${parts[0]}/${parts[1]}`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// SCP-style URLs and owner/repository values are handled below.
|
|
22
|
+
}
|
|
23
|
+
const normalized = candidate
|
|
24
|
+
.replace(/^https?:\/\/github\.com\//iu, "")
|
|
25
|
+
.replace(/^ssh:\/\/git@github\.com\//iu, "")
|
|
26
|
+
.replace(/^git:\/\/github\.com\//iu, "")
|
|
27
|
+
.replace(/^\/+|\/+$/gu, "")
|
|
28
|
+
.replace(/\.git$/u, "");
|
|
29
|
+
const parts = normalized.split("/").filter(Boolean);
|
|
30
|
+
return parts.length >= 2
|
|
31
|
+
? `${parts.at(-2)}/${parts.at(-1)}`
|
|
32
|
+
: normalized;
|
|
33
|
+
}
|
|
34
|
+
function originUrl(config) {
|
|
35
|
+
const sections = config.split(/^\s*\[/gmu);
|
|
36
|
+
for (const section of sections) {
|
|
37
|
+
if (!/^remote\s+"origin"\]/u.test(section.trimStart())) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
const match = /^\s*url\s*=\s*(.+?)\s*$/mu.exec(section);
|
|
41
|
+
if (match?.[1] !== undefined) {
|
|
42
|
+
return match[1];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
export async function repositoryScopeFromGitRoot(root) {
|
|
48
|
+
try {
|
|
49
|
+
const config = await readFile(resolve(root, ".git", "config"), "utf8");
|
|
50
|
+
const remote = originUrl(config);
|
|
51
|
+
if (remote !== undefined) {
|
|
52
|
+
return canonicalRepositoryScope(remote);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// Worktrees and repositories without an origin use the directory fallback.
|
|
57
|
+
}
|
|
58
|
+
return basename(root);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.js","sourceRoot":"","sources":["../src/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAClD,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IACD,MAAM,GAAG,GAAG,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;IACtC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;QAC/B,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,YAAY,EAAE,CAAC;YAChD,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YAC5E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC9C,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;gBACtB,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACnC,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP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C,EAAE,MAAM,CAAC,CAAC;QACvE,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,wBAAwB,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,2EAA2E;IAC7E,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export declare const REVIEW_OUTPUT_SCHEMA: {
|
|
2
|
+
readonly type: "object";
|
|
3
|
+
readonly additionalProperties: false;
|
|
4
|
+
readonly required: readonly ["summary", "findings"];
|
|
5
|
+
readonly properties: {
|
|
6
|
+
readonly summary: {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
readonly minLength: 1;
|
|
9
|
+
readonly pattern: "\\S";
|
|
10
|
+
};
|
|
11
|
+
readonly findings: {
|
|
12
|
+
readonly type: "array";
|
|
13
|
+
readonly items: {
|
|
14
|
+
readonly type: "object";
|
|
15
|
+
readonly additionalProperties: false;
|
|
16
|
+
readonly required: readonly ["severity", "title", "body", "path", "line"];
|
|
17
|
+
readonly properties: {
|
|
18
|
+
readonly severity: {
|
|
19
|
+
readonly enum: readonly ["critical", "high", "medium", "low"];
|
|
20
|
+
};
|
|
21
|
+
readonly title: {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly minLength: 1;
|
|
24
|
+
readonly pattern: "\\S";
|
|
25
|
+
};
|
|
26
|
+
readonly body: {
|
|
27
|
+
readonly type: "string";
|
|
28
|
+
readonly minLength: 1;
|
|
29
|
+
readonly pattern: "\\S";
|
|
30
|
+
};
|
|
31
|
+
readonly path: {
|
|
32
|
+
readonly type: readonly ["string", "null"];
|
|
33
|
+
readonly minLength: 1;
|
|
34
|
+
readonly pattern: "\\S";
|
|
35
|
+
};
|
|
36
|
+
readonly line: {
|
|
37
|
+
readonly type: readonly ["integer", "null"];
|
|
38
|
+
readonly minimum: 1;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export type ReviewSeverity = "critical" | "high" | "medium" | "low";
|
|
46
|
+
export interface ReviewFinding {
|
|
47
|
+
severity: ReviewSeverity;
|
|
48
|
+
title: string;
|
|
49
|
+
body: string;
|
|
50
|
+
path: string | null;
|
|
51
|
+
line: number | null;
|
|
52
|
+
}
|
|
53
|
+
export interface ReviewOutput {
|
|
54
|
+
summary: string;
|
|
55
|
+
findings: ReviewFinding[];
|
|
56
|
+
}
|
|
57
|
+
export declare function validateReviewOutput(value: unknown): ReviewOutput;
|
|
58
|
+
export declare function parseReviewOutput(raw: string): ReviewOutput;
|
|
59
|
+
//# sourceMappingURL=review-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-output.d.ts","sourceRoot":"","sources":["../src/review-output.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BvB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEpE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAgCD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CA4DjE;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAW3D"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export const REVIEW_OUTPUT_SCHEMA = {
|
|
2
|
+
type: "object",
|
|
3
|
+
additionalProperties: false,
|
|
4
|
+
required: ["summary", "findings"],
|
|
5
|
+
properties: {
|
|
6
|
+
summary: { type: "string", minLength: 1, pattern: "\\S" },
|
|
7
|
+
findings: {
|
|
8
|
+
type: "array",
|
|
9
|
+
items: {
|
|
10
|
+
type: "object",
|
|
11
|
+
additionalProperties: false,
|
|
12
|
+
required: ["severity", "title", "body", "path", "line"],
|
|
13
|
+
properties: {
|
|
14
|
+
severity: { enum: ["critical", "high", "medium", "low"] },
|
|
15
|
+
title: { type: "string", minLength: 1, pattern: "\\S" },
|
|
16
|
+
body: { type: "string", minLength: 1, pattern: "\\S" },
|
|
17
|
+
path: {
|
|
18
|
+
type: ["string", "null"],
|
|
19
|
+
minLength: 1,
|
|
20
|
+
pattern: "\\S",
|
|
21
|
+
},
|
|
22
|
+
line: { type: ["integer", "null"], minimum: 1 },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
const REVIEW_SEVERITIES = new Set([
|
|
29
|
+
"critical",
|
|
30
|
+
"high",
|
|
31
|
+
"medium",
|
|
32
|
+
"low",
|
|
33
|
+
]);
|
|
34
|
+
function isRecord(value) {
|
|
35
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
36
|
+
}
|
|
37
|
+
function hasExactlyKeys(value, expected) {
|
|
38
|
+
const keys = Object.keys(value);
|
|
39
|
+
return (keys.length === expected.length &&
|
|
40
|
+
expected.every((key) => Object.hasOwn(value, key)));
|
|
41
|
+
}
|
|
42
|
+
function nonBlankString(value) {
|
|
43
|
+
return typeof value === "string" && value.trim() !== "";
|
|
44
|
+
}
|
|
45
|
+
function invalid(detail) {
|
|
46
|
+
throw new Error(`Review output does not match the required schema: ${detail}`);
|
|
47
|
+
}
|
|
48
|
+
export function validateReviewOutput(value) {
|
|
49
|
+
if (!isRecord(value) || !hasExactlyKeys(value, ["summary", "findings"])) {
|
|
50
|
+
invalid("expected only summary and findings");
|
|
51
|
+
}
|
|
52
|
+
if (!nonBlankString(value.summary)) {
|
|
53
|
+
invalid("summary must be a non-blank string");
|
|
54
|
+
}
|
|
55
|
+
if (!Array.isArray(value.findings)) {
|
|
56
|
+
invalid("findings must be an array");
|
|
57
|
+
}
|
|
58
|
+
const findings = value.findings.map((finding, index) => {
|
|
59
|
+
if (!isRecord(finding) ||
|
|
60
|
+
!hasExactlyKeys(finding, [
|
|
61
|
+
"severity",
|
|
62
|
+
"title",
|
|
63
|
+
"body",
|
|
64
|
+
"path",
|
|
65
|
+
"line",
|
|
66
|
+
])) {
|
|
67
|
+
invalid(`findings[${index}] has missing or additional properties`);
|
|
68
|
+
}
|
|
69
|
+
if (typeof finding.severity !== "string" ||
|
|
70
|
+
!REVIEW_SEVERITIES.has(finding.severity)) {
|
|
71
|
+
invalid(`findings[${index}].severity is invalid`);
|
|
72
|
+
}
|
|
73
|
+
if (!nonBlankString(finding.title)) {
|
|
74
|
+
invalid(`findings[${index}].title must be a non-blank string`);
|
|
75
|
+
}
|
|
76
|
+
if (!nonBlankString(finding.body)) {
|
|
77
|
+
invalid(`findings[${index}].body must be a non-blank string`);
|
|
78
|
+
}
|
|
79
|
+
if (finding.path !== null &&
|
|
80
|
+
!nonBlankString(finding.path)) {
|
|
81
|
+
invalid(`findings[${index}].path must be null or a non-blank string`);
|
|
82
|
+
}
|
|
83
|
+
if (finding.line !== null &&
|
|
84
|
+
(typeof finding.line !== "number" ||
|
|
85
|
+
!Number.isInteger(finding.line) ||
|
|
86
|
+
finding.line < 1)) {
|
|
87
|
+
invalid(`findings[${index}].line must be null or a positive integer`);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
severity: finding.severity,
|
|
91
|
+
title: finding.title,
|
|
92
|
+
body: finding.body,
|
|
93
|
+
path: finding.path,
|
|
94
|
+
line: finding.line,
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
return { summary: value.summary, findings };
|
|
98
|
+
}
|
|
99
|
+
export function parseReviewOutput(raw) {
|
|
100
|
+
if (raw.trim() === "") {
|
|
101
|
+
throw new Error("Review output is blank");
|
|
102
|
+
}
|
|
103
|
+
let parsed;
|
|
104
|
+
try {
|
|
105
|
+
parsed = JSON.parse(raw);
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
throw new Error("Review output must be valid JSON");
|
|
109
|
+
}
|
|
110
|
+
return validateReviewOutput(parsed);
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=review-output.js.map
|