@almightygpt/core 0.2.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/dist/adapters/claude.d.ts +31 -0
- package/dist/adapters/claude.d.ts.map +1 -0
- package/dist/adapters/claude.js +90 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/adapters/gemini.d.ts +42 -0
- package/dist/adapters/gemini.d.ts.map +1 -0
- package/dist/adapters/gemini.js +133 -0
- package/dist/adapters/gemini.js.map +1 -0
- package/dist/adapters/index.d.ts +16 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +15 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/mock.d.ts +23 -0
- package/dist/adapters/mock.d.ts.map +1 -0
- package/dist/adapters/mock.js +107 -0
- package/dist/adapters/mock.js.map +1 -0
- package/dist/adapters/openai.d.ts +38 -0
- package/dist/adapters/openai.d.ts.map +1 -0
- package/dist/adapters/openai.js +105 -0
- package/dist/adapters/openai.js.map +1 -0
- package/dist/adapters/types.d.ts +65 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +26 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/config/load.d.ts +15 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/load.js +46 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/schema.d.ts +260 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +58 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/context/manifest.d.ts +58 -0
- package/dist/context/manifest.d.ts.map +1 -0
- package/dist/context/manifest.js +49 -0
- package/dist/context/manifest.js.map +1 -0
- package/dist/context/redact.d.ts +26 -0
- package/dist/context/redact.d.ts.map +1 -0
- package/dist/context/redact.js +67 -0
- package/dist/context/redact.js.map +1 -0
- package/dist/git/status.d.ts +48 -0
- package/dist/git/status.d.ts.map +1 -0
- package/dist/git/status.js +79 -0
- package/dist/git/status.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/review/budget.d.ts +46 -0
- package/dist/review/budget.d.ts.map +1 -0
- package/dist/review/budget.js +83 -0
- package/dist/review/budget.js.map +1 -0
- package/dist/review/diff.d.ts +21 -0
- package/dist/review/diff.d.ts.map +1 -0
- package/dist/review/diff.js +55 -0
- package/dist/review/diff.js.map +1 -0
- package/dist/review/events.d.ts +76 -0
- package/dist/review/events.d.ts.map +1 -0
- package/dist/review/events.js +13 -0
- package/dist/review/events.js.map +1 -0
- package/dist/review/memory.d.ts +23 -0
- package/dist/review/memory.d.ts.map +1 -0
- package/dist/review/memory.js +42 -0
- package/dist/review/memory.js.map +1 -0
- package/dist/review/prompts.d.ts +34 -0
- package/dist/review/prompts.d.ts.map +1 -0
- package/dist/review/prompts.js +174 -0
- package/dist/review/prompts.js.map +1 -0
- package/dist/review/run-diff-review.d.ts +52 -0
- package/dist/review/run-diff-review.d.ts.map +1 -0
- package/dist/review/run-diff-review.js +258 -0
- package/dist/review/run-diff-review.js.map +1 -0
- package/dist/review/run-worker-reviewer.d.ts +72 -0
- package/dist/review/run-worker-reviewer.d.ts.map +1 -0
- package/dist/review/run-worker-reviewer.js +407 -0
- package/dist/review/run-worker-reviewer.js.map +1 -0
- package/dist/review/write.d.ts +44 -0
- package/dist/review/write.d.ts.map +1 -0
- package/dist/review/write.js +152 -0
- package/dist/review/write.js.map +1 -0
- package/dist/runs/decide.d.ts +45 -0
- package/dist/runs/decide.d.ts.map +1 -0
- package/dist/runs/decide.js +93 -0
- package/dist/runs/decide.js.map +1 -0
- package/dist/runs/folder.d.ts +42 -0
- package/dist/runs/folder.d.ts.map +1 -0
- package/dist/runs/folder.js +82 -0
- package/dist/runs/folder.js.map +1 -0
- package/dist/runs/list.d.ts +58 -0
- package/dist/runs/list.d.ts.map +1 -0
- package/dist/runs/list.js +117 -0
- package/dist/runs/list.js.map +1 -0
- package/dist/runs/types.d.ts +96 -0
- package/dist/runs/types.d.ts.map +1 -0
- package/dist/runs/types.js +13 -0
- package/dist/runs/types.js.map +1 -0
- package/dist/templates/install.d.ts +49 -0
- package/dist/templates/install.d.ts.map +1 -0
- package/dist/templates/install.js +154 -0
- package/dist/templates/install.js.map +1 -0
- package/package.json +34 -0
- package/src/adapters/claude.ts +133 -0
- package/src/adapters/gemini.ts +183 -0
- package/src/adapters/index.ts +21 -0
- package/src/adapters/mock.ts +125 -0
- package/src/adapters/openai.ts +150 -0
- package/src/adapters/types.ts +73 -0
- package/src/config/load.ts +61 -0
- package/src/config/schema.ts +64 -0
- package/src/context/manifest.ts +94 -0
- package/src/context/redact.ts +93 -0
- package/src/git/status.ts +108 -0
- package/src/index.ts +127 -0
- package/src/review/budget.ts +116 -0
- package/src/review/diff.ts +85 -0
- package/src/review/events.ts +86 -0
- package/src/review/memory.ts +57 -0
- package/src/review/prompts.ts +208 -0
- package/src/review/run-diff-review.ts +353 -0
- package/src/review/run-worker-reviewer.ts +528 -0
- package/src/review/write.ts +208 -0
- package/src/runs/decide.ts +153 -0
- package/src/runs/folder.ts +137 -0
- package/src/runs/list.ts +152 -0
- package/src/runs/types.ts +98 -0
- package/src/templates/install.ts +198 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/adapters/openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAuD,MAAM,YAAY,CAAC;AAE/F,oDAAoD;AACpD,MAAM,kBAAkB,GAAsD;IAC5E,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IACtC,aAAa,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;IAC3C,aAAa,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,E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65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapter interface — every provider implementation satisfies this.
|
|
3
|
+
*
|
|
4
|
+
* Memory files (CLAUDE.md, CODEX_AGENT.md, AGENTS.md) and rule files
|
|
5
|
+
* (.almightygpt/rules.md) are assembled by the review pipeline into the
|
|
6
|
+
* `systemPrompt` field. Adapters do not read filesystem state themselves;
|
|
7
|
+
* they take a fully-assembled prompt and return a fully-typed result.
|
|
8
|
+
*
|
|
9
|
+
* This keeps adapters thin and testable, and means swapping providers is
|
|
10
|
+
* a single-file change.
|
|
11
|
+
*/
|
|
12
|
+
export type AgentRole = "worker" | "reviewer";
|
|
13
|
+
export interface AdapterInput {
|
|
14
|
+
/** worker | reviewer — drives the default system framing if a custom prompt is not supplied. */
|
|
15
|
+
role: AgentRole;
|
|
16
|
+
/** Fully assembled system prompt (memory file + rules + role framing). */
|
|
17
|
+
systemPrompt: string;
|
|
18
|
+
/** The actual task or critique target. */
|
|
19
|
+
userMessage: string;
|
|
20
|
+
/** Optional structured output mode. Defaults to text. */
|
|
21
|
+
responseFormat?: "text" | "json_object";
|
|
22
|
+
/** Optional override of the model name. Falls back to the adapter's default. */
|
|
23
|
+
model?: string;
|
|
24
|
+
/** Hard upper bound on response tokens. Adapters should pass this through. */
|
|
25
|
+
maxOutputTokens?: number;
|
|
26
|
+
/** Hard wall-clock timeout in ms. Adapter aborts if exceeded. */
|
|
27
|
+
timeoutMs?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface AdapterOutput {
|
|
30
|
+
/** The model's text response. */
|
|
31
|
+
content: string;
|
|
32
|
+
/** Input token count (prompt). */
|
|
33
|
+
tokensIn: number;
|
|
34
|
+
/** Output token count (completion). */
|
|
35
|
+
tokensOut: number;
|
|
36
|
+
/** Estimated USD cost based on the model's published rates. */
|
|
37
|
+
costUsd: number;
|
|
38
|
+
/** Wall-clock latency in milliseconds. */
|
|
39
|
+
latencyMs: number;
|
|
40
|
+
/** Concrete model name used (e.g. "gpt-4o-2024-08-06"). */
|
|
41
|
+
modelUsed: string;
|
|
42
|
+
/** Provider name (e.g. "openai", "anthropic"). */
|
|
43
|
+
provider: string;
|
|
44
|
+
}
|
|
45
|
+
export interface Adapter {
|
|
46
|
+
/** Identifier used in config.yaml (e.g. "codex", "claude", "mock"). */
|
|
47
|
+
readonly name: string;
|
|
48
|
+
/** Underlying provider family (e.g. "openai", "anthropic", "mock"). */
|
|
49
|
+
readonly provider: string;
|
|
50
|
+
/** True if credentials are available and the adapter can be invoked. */
|
|
51
|
+
isAvailable(): Promise<boolean>;
|
|
52
|
+
/** Execute one model call. */
|
|
53
|
+
execute(input: AdapterInput): Promise<AdapterOutput>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Thrown when an adapter cannot complete the call. Callers should treat this
|
|
57
|
+
* as a recoverable run failure (record the error, do not crash the orchestrator).
|
|
58
|
+
*/
|
|
59
|
+
export declare class AdapterError extends Error {
|
|
60
|
+
readonly adapterName: string;
|
|
61
|
+
readonly cause?: unknown | undefined;
|
|
62
|
+
readonly name = "AdapterError";
|
|
63
|
+
constructor(message: string, adapterName: string, cause?: unknown | undefined);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/adapters/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,gGAAgG;IAChG,IAAI,EAAE,SAAS,CAAC;IAChB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IACxC,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,8BAA8B;IAC9B,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACtD;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,KAAK;aAInB,WAAW,EAAE,MAAM;aACV,KAAK,CAAC,EAAE,OAAO;IAJ1C,SAAkB,IAAI,kBAAkB;gBAEtC,OAAO,EAAE,MAAM,EACC,WAAW,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,OAAO,YAAA;CAI3C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapter interface — every provider implementation satisfies this.
|
|
3
|
+
*
|
|
4
|
+
* Memory files (CLAUDE.md, CODEX_AGENT.md, AGENTS.md) and rule files
|
|
5
|
+
* (.almightygpt/rules.md) are assembled by the review pipeline into the
|
|
6
|
+
* `systemPrompt` field. Adapters do not read filesystem state themselves;
|
|
7
|
+
* they take a fully-assembled prompt and return a fully-typed result.
|
|
8
|
+
*
|
|
9
|
+
* This keeps adapters thin and testable, and means swapping providers is
|
|
10
|
+
* a single-file change.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Thrown when an adapter cannot complete the call. Callers should treat this
|
|
14
|
+
* as a recoverable run failure (record the error, do not crash the orchestrator).
|
|
15
|
+
*/
|
|
16
|
+
export class AdapterError extends Error {
|
|
17
|
+
adapterName;
|
|
18
|
+
cause;
|
|
19
|
+
name = "AdapterError";
|
|
20
|
+
constructor(message, adapterName, cause) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.adapterName = adapterName;
|
|
23
|
+
this.cause = cause;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/adapters/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAiDH;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAInB;IACS;IAJT,IAAI,GAAG,cAAc,CAAC;IACxC,YACE,OAAe,EACC,WAAmB,EACV,KAAe;QAExC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,gBAAW,GAAX,WAAW,CAAQ;QACV,UAAK,GAAL,KAAK,CAAU;IAG1C,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load and validate .almightygpt/config.yaml from a repo root.
|
|
3
|
+
*
|
|
4
|
+
* Returns a fully-typed Config object. Throws a ConfigError with a useful
|
|
5
|
+
* message if the file is missing, malformed, or fails schema validation.
|
|
6
|
+
*/
|
|
7
|
+
import { type Config } from "./schema.js";
|
|
8
|
+
export declare class ConfigError extends Error {
|
|
9
|
+
readonly path: string;
|
|
10
|
+
readonly cause?: unknown | undefined;
|
|
11
|
+
readonly name = "ConfigError";
|
|
12
|
+
constructor(message: string, path: string, cause?: unknown | undefined);
|
|
13
|
+
}
|
|
14
|
+
export declare function loadConfig(repoRoot: string): Promise<Config>;
|
|
15
|
+
//# sourceMappingURL=load.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAExD,qBAAa,WAAY,SAAQ,KAAK;aAIlB,IAAI,EAAE,MAAM;aACH,KAAK,CAAC,EAAE,OAAO;IAJ1C,SAAkB,IAAI,iBAAiB;gBAErC,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACH,KAAK,CAAC,EAAE,OAAO,YAAA;CAI3C;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqClE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load and validate .almightygpt/config.yaml from a repo root.
|
|
3
|
+
*
|
|
4
|
+
* Returns a fully-typed Config object. Throws a ConfigError with a useful
|
|
5
|
+
* message if the file is missing, malformed, or fails schema validation.
|
|
6
|
+
*/
|
|
7
|
+
import { readFile } from "node:fs/promises";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { parse as parseYaml } from "yaml";
|
|
10
|
+
import { ConfigSchema } from "./schema.js";
|
|
11
|
+
export class ConfigError extends Error {
|
|
12
|
+
path;
|
|
13
|
+
cause;
|
|
14
|
+
name = "ConfigError";
|
|
15
|
+
constructor(message, path, cause) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.path = path;
|
|
18
|
+
this.cause = cause;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export async function loadConfig(repoRoot) {
|
|
22
|
+
const path = join(repoRoot, ".almightygpt", "config.yaml");
|
|
23
|
+
let raw;
|
|
24
|
+
try {
|
|
25
|
+
raw = await readFile(path, "utf8");
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
throw new ConfigError(`Could not read AlmightyGPT config. Run \`almightygpt init\` first.`, path, err);
|
|
29
|
+
}
|
|
30
|
+
let parsed;
|
|
31
|
+
try {
|
|
32
|
+
parsed = parseYaml(raw);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
throw new ConfigError(`Config YAML is malformed: ${err instanceof Error ? err.message : String(err)}`, path, err);
|
|
36
|
+
}
|
|
37
|
+
const result = ConfigSchema.safeParse(parsed);
|
|
38
|
+
if (!result.success) {
|
|
39
|
+
const issues = result.error.issues
|
|
40
|
+
.map((i) => ` - ${i.path.join(".")}: ${i.message}`)
|
|
41
|
+
.join("\n");
|
|
42
|
+
throw new ConfigError(`Config validation failed:\n${issues}`, path, result.error);
|
|
43
|
+
}
|
|
44
|
+
return result.data;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAe,MAAM,aAAa,CAAC;AAExD,MAAM,OAAO,WAAY,SAAQ,KAAK;IAIlB;IACS;IAJT,IAAI,GAAG,aAAa,CAAC;IACvC,YACE,OAAe,EACC,IAAY,EACH,KAAe;QAExC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAQ;QACH,UAAK,GAAL,KAAK,CAAU;IAG1C,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB;IAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;IAC3D,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,WAAW,CACnB,oEAAoE,EACpE,IAAI,EACJ,GAAG,CACJ,CAAC;IACJ,CAAC;IAED,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,WAAW,CACnB,6BAA6B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAC/E,IAAI,EACJ,GAAG,CACJ,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM;aAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;aACnD,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,MAAM,IAAI,WAAW,CACnB,8BAA8B,MAAM,EAAE,EACtC,IAAI,EACJ,MAAM,CAAC,KAAK,CACb,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for .almightygpt/config.yaml.
|
|
3
|
+
*
|
|
4
|
+
* The schema is intentionally permissive on unknown fields (passthrough) so
|
|
5
|
+
* future features can land without forcing a config-bump. Required fields
|
|
6
|
+
* are minimal — most behavior has sensible defaults.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
export declare const AgentRoleSchema: z.ZodEnum<["worker", "reviewer", "both", "optional"]>;
|
|
10
|
+
export declare const AgentConfigSchema: z.ZodObject<{
|
|
11
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
12
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
13
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
14
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
15
|
+
memoryFile: z.ZodString;
|
|
16
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
17
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
19
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
20
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
21
|
+
memoryFile: z.ZodString;
|
|
22
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
23
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
25
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
26
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
27
|
+
memoryFile: z.ZodString;
|
|
28
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
29
|
+
export declare const ConfigSchema: z.ZodObject<{
|
|
30
|
+
version: z.ZodLiteral<1>;
|
|
31
|
+
reviewsDir: z.ZodDefault<z.ZodString>;
|
|
32
|
+
runsDir: z.ZodDefault<z.ZodString>;
|
|
33
|
+
agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
34
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
35
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
36
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
37
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
38
|
+
memoryFile: z.ZodString;
|
|
39
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
40
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
42
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
43
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
44
|
+
memoryFile: z.ZodString;
|
|
45
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
46
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
48
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
49
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
50
|
+
memoryFile: z.ZodString;
|
|
51
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
52
|
+
defaults: z.ZodDefault<z.ZodObject<{
|
|
53
|
+
worker: z.ZodOptional<z.ZodString>;
|
|
54
|
+
reviewer: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
worker?: string | undefined;
|
|
57
|
+
reviewer?: string | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
worker?: string | undefined;
|
|
60
|
+
reviewer?: string | undefined;
|
|
61
|
+
}>>;
|
|
62
|
+
context: z.ZodDefault<z.ZodObject<{
|
|
63
|
+
include: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
64
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
65
|
+
maxFileBytes: z.ZodDefault<z.ZodNumber>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
include: string[];
|
|
68
|
+
exclude: string[];
|
|
69
|
+
maxFileBytes: number;
|
|
70
|
+
}, {
|
|
71
|
+
include?: string[] | undefined;
|
|
72
|
+
exclude?: string[] | undefined;
|
|
73
|
+
maxFileBytes?: number | undefined;
|
|
74
|
+
}>>;
|
|
75
|
+
security: z.ZodDefault<z.ZodObject<{
|
|
76
|
+
redactSecrets: z.ZodDefault<z.ZodBoolean>;
|
|
77
|
+
requireExternalProviderConfirmation: z.ZodDefault<z.ZodBoolean>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
redactSecrets: boolean;
|
|
80
|
+
requireExternalProviderConfirmation: boolean;
|
|
81
|
+
}, {
|
|
82
|
+
redactSecrets?: boolean | undefined;
|
|
83
|
+
requireExternalProviderConfirmation?: boolean | undefined;
|
|
84
|
+
}>>;
|
|
85
|
+
budget: z.ZodDefault<z.ZodObject<{
|
|
86
|
+
maxCostPerRunUsd: z.ZodDefault<z.ZodNumber>;
|
|
87
|
+
maxTokensPerRun: z.ZodDefault<z.ZodNumber>;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
maxCostPerRunUsd: number;
|
|
90
|
+
maxTokensPerRun: number;
|
|
91
|
+
}, {
|
|
92
|
+
maxCostPerRunUsd?: number | undefined;
|
|
93
|
+
maxTokensPerRun?: number | undefined;
|
|
94
|
+
}>>;
|
|
95
|
+
review: z.ZodDefault<z.ZodObject<{
|
|
96
|
+
requireConcreteWeaknesses: z.ZodDefault<z.ZodNumber>;
|
|
97
|
+
warnOnZeroFileReferences: z.ZodDefault<z.ZodBoolean>;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
requireConcreteWeaknesses: number;
|
|
100
|
+
warnOnZeroFileReferences: boolean;
|
|
101
|
+
}, {
|
|
102
|
+
requireConcreteWeaknesses?: number | undefined;
|
|
103
|
+
warnOnZeroFileReferences?: boolean | undefined;
|
|
104
|
+
}>>;
|
|
105
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
106
|
+
version: z.ZodLiteral<1>;
|
|
107
|
+
reviewsDir: z.ZodDefault<z.ZodString>;
|
|
108
|
+
runsDir: z.ZodDefault<z.ZodString>;
|
|
109
|
+
agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
110
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
111
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
112
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
113
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
114
|
+
memoryFile: z.ZodString;
|
|
115
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
116
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
117
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
118
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
119
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
120
|
+
memoryFile: z.ZodString;
|
|
121
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
122
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
123
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
124
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
125
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
126
|
+
memoryFile: z.ZodString;
|
|
127
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
128
|
+
defaults: z.ZodDefault<z.ZodObject<{
|
|
129
|
+
worker: z.ZodOptional<z.ZodString>;
|
|
130
|
+
reviewer: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, "strip", z.ZodTypeAny, {
|
|
132
|
+
worker?: string | undefined;
|
|
133
|
+
reviewer?: string | undefined;
|
|
134
|
+
}, {
|
|
135
|
+
worker?: string | undefined;
|
|
136
|
+
reviewer?: string | undefined;
|
|
137
|
+
}>>;
|
|
138
|
+
context: z.ZodDefault<z.ZodObject<{
|
|
139
|
+
include: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
140
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
141
|
+
maxFileBytes: z.ZodDefault<z.ZodNumber>;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
include: string[];
|
|
144
|
+
exclude: string[];
|
|
145
|
+
maxFileBytes: number;
|
|
146
|
+
}, {
|
|
147
|
+
include?: string[] | undefined;
|
|
148
|
+
exclude?: string[] | undefined;
|
|
149
|
+
maxFileBytes?: number | undefined;
|
|
150
|
+
}>>;
|
|
151
|
+
security: z.ZodDefault<z.ZodObject<{
|
|
152
|
+
redactSecrets: z.ZodDefault<z.ZodBoolean>;
|
|
153
|
+
requireExternalProviderConfirmation: z.ZodDefault<z.ZodBoolean>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
redactSecrets: boolean;
|
|
156
|
+
requireExternalProviderConfirmation: boolean;
|
|
157
|
+
}, {
|
|
158
|
+
redactSecrets?: boolean | undefined;
|
|
159
|
+
requireExternalProviderConfirmation?: boolean | undefined;
|
|
160
|
+
}>>;
|
|
161
|
+
budget: z.ZodDefault<z.ZodObject<{
|
|
162
|
+
maxCostPerRunUsd: z.ZodDefault<z.ZodNumber>;
|
|
163
|
+
maxTokensPerRun: z.ZodDefault<z.ZodNumber>;
|
|
164
|
+
}, "strip", z.ZodTypeAny, {
|
|
165
|
+
maxCostPerRunUsd: number;
|
|
166
|
+
maxTokensPerRun: number;
|
|
167
|
+
}, {
|
|
168
|
+
maxCostPerRunUsd?: number | undefined;
|
|
169
|
+
maxTokensPerRun?: number | undefined;
|
|
170
|
+
}>>;
|
|
171
|
+
review: z.ZodDefault<z.ZodObject<{
|
|
172
|
+
requireConcreteWeaknesses: z.ZodDefault<z.ZodNumber>;
|
|
173
|
+
warnOnZeroFileReferences: z.ZodDefault<z.ZodBoolean>;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
requireConcreteWeaknesses: number;
|
|
176
|
+
warnOnZeroFileReferences: boolean;
|
|
177
|
+
}, {
|
|
178
|
+
requireConcreteWeaknesses?: number | undefined;
|
|
179
|
+
warnOnZeroFileReferences?: boolean | undefined;
|
|
180
|
+
}>>;
|
|
181
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
182
|
+
version: z.ZodLiteral<1>;
|
|
183
|
+
reviewsDir: z.ZodDefault<z.ZodString>;
|
|
184
|
+
runsDir: z.ZodDefault<z.ZodString>;
|
|
185
|
+
agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
186
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
187
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
188
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
189
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
190
|
+
memoryFile: z.ZodString;
|
|
191
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
192
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
193
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
194
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
195
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
196
|
+
memoryFile: z.ZodString;
|
|
197
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
198
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
199
|
+
provider: z.ZodEnum<["openai", "anthropic", "google", "mock"]>;
|
|
200
|
+
mode: z.ZodDefault<z.ZodEnum<["api", "cli"]>>;
|
|
201
|
+
role: z.ZodDefault<z.ZodEnum<["worker", "reviewer", "both", "optional"]>>;
|
|
202
|
+
memoryFile: z.ZodString;
|
|
203
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
204
|
+
defaults: z.ZodDefault<z.ZodObject<{
|
|
205
|
+
worker: z.ZodOptional<z.ZodString>;
|
|
206
|
+
reviewer: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, "strip", z.ZodTypeAny, {
|
|
208
|
+
worker?: string | undefined;
|
|
209
|
+
reviewer?: string | undefined;
|
|
210
|
+
}, {
|
|
211
|
+
worker?: string | undefined;
|
|
212
|
+
reviewer?: string | undefined;
|
|
213
|
+
}>>;
|
|
214
|
+
context: z.ZodDefault<z.ZodObject<{
|
|
215
|
+
include: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
216
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
217
|
+
maxFileBytes: z.ZodDefault<z.ZodNumber>;
|
|
218
|
+
}, "strip", z.ZodTypeAny, {
|
|
219
|
+
include: string[];
|
|
220
|
+
exclude: string[];
|
|
221
|
+
maxFileBytes: number;
|
|
222
|
+
}, {
|
|
223
|
+
include?: string[] | undefined;
|
|
224
|
+
exclude?: string[] | undefined;
|
|
225
|
+
maxFileBytes?: number | undefined;
|
|
226
|
+
}>>;
|
|
227
|
+
security: z.ZodDefault<z.ZodObject<{
|
|
228
|
+
redactSecrets: z.ZodDefault<z.ZodBoolean>;
|
|
229
|
+
requireExternalProviderConfirmation: z.ZodDefault<z.ZodBoolean>;
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
redactSecrets: boolean;
|
|
232
|
+
requireExternalProviderConfirmation: boolean;
|
|
233
|
+
}, {
|
|
234
|
+
redactSecrets?: boolean | undefined;
|
|
235
|
+
requireExternalProviderConfirmation?: boolean | undefined;
|
|
236
|
+
}>>;
|
|
237
|
+
budget: z.ZodDefault<z.ZodObject<{
|
|
238
|
+
maxCostPerRunUsd: z.ZodDefault<z.ZodNumber>;
|
|
239
|
+
maxTokensPerRun: z.ZodDefault<z.ZodNumber>;
|
|
240
|
+
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
maxCostPerRunUsd: number;
|
|
242
|
+
maxTokensPerRun: number;
|
|
243
|
+
}, {
|
|
244
|
+
maxCostPerRunUsd?: number | undefined;
|
|
245
|
+
maxTokensPerRun?: number | undefined;
|
|
246
|
+
}>>;
|
|
247
|
+
review: z.ZodDefault<z.ZodObject<{
|
|
248
|
+
requireConcreteWeaknesses: z.ZodDefault<z.ZodNumber>;
|
|
249
|
+
warnOnZeroFileReferences: z.ZodDefault<z.ZodBoolean>;
|
|
250
|
+
}, "strip", z.ZodTypeAny, {
|
|
251
|
+
requireConcreteWeaknesses: number;
|
|
252
|
+
warnOnZeroFileReferences: boolean;
|
|
253
|
+
}, {
|
|
254
|
+
requireConcreteWeaknesses?: number | undefined;
|
|
255
|
+
warnOnZeroFileReferences?: boolean | undefined;
|
|
256
|
+
}>>;
|
|
257
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
258
|
+
export type AgentConfig = z.infer<typeof AgentConfigSchema>;
|
|
259
|
+
export type Config = z.infer<typeof ConfigSchema>;
|
|
260
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,uDAAqD,CAAC;AAElF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;gCAQd,CAAC;AAEjB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAsCT,CAAC;AAEjB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for .almightygpt/config.yaml.
|
|
3
|
+
*
|
|
4
|
+
* The schema is intentionally permissive on unknown fields (passthrough) so
|
|
5
|
+
* future features can land without forcing a config-bump. Required fields
|
|
6
|
+
* are minimal — most behavior has sensible defaults.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
export const AgentRoleSchema = z.enum(["worker", "reviewer", "both", "optional"]);
|
|
10
|
+
export const AgentConfigSchema = z
|
|
11
|
+
.object({
|
|
12
|
+
enabled: z.boolean().default(true),
|
|
13
|
+
provider: z.enum(["openai", "anthropic", "google", "mock"]),
|
|
14
|
+
mode: z.enum(["api", "cli"]).default("api"),
|
|
15
|
+
role: AgentRoleSchema.default("optional"),
|
|
16
|
+
memoryFile: z.string().min(1),
|
|
17
|
+
})
|
|
18
|
+
.passthrough();
|
|
19
|
+
export const ConfigSchema = z
|
|
20
|
+
.object({
|
|
21
|
+
version: z.literal(1),
|
|
22
|
+
reviewsDir: z.string().min(1).default("docs/codex-reviews"),
|
|
23
|
+
runsDir: z.string().min(1).default(".almightygpt/runs"),
|
|
24
|
+
agents: z.record(z.string(), AgentConfigSchema).default({}),
|
|
25
|
+
defaults: z
|
|
26
|
+
.object({
|
|
27
|
+
worker: z.string().min(1).optional(),
|
|
28
|
+
reviewer: z.string().min(1).optional(),
|
|
29
|
+
})
|
|
30
|
+
.default({}),
|
|
31
|
+
context: z
|
|
32
|
+
.object({
|
|
33
|
+
include: z.array(z.string()).default([]),
|
|
34
|
+
exclude: z.array(z.string()).default([]),
|
|
35
|
+
maxFileBytes: z.number().int().positive().default(120_000),
|
|
36
|
+
})
|
|
37
|
+
.default({}),
|
|
38
|
+
security: z
|
|
39
|
+
.object({
|
|
40
|
+
redactSecrets: z.boolean().default(true),
|
|
41
|
+
requireExternalProviderConfirmation: z.boolean().default(true),
|
|
42
|
+
})
|
|
43
|
+
.default({}),
|
|
44
|
+
budget: z
|
|
45
|
+
.object({
|
|
46
|
+
maxCostPerRunUsd: z.number().positive().default(0.5),
|
|
47
|
+
maxTokensPerRun: z.number().int().positive().default(100_000),
|
|
48
|
+
})
|
|
49
|
+
.default({}),
|
|
50
|
+
review: z
|
|
51
|
+
.object({
|
|
52
|
+
requireConcreteWeaknesses: z.number().int().nonnegative().default(3),
|
|
53
|
+
warnOnZeroFileReferences: z.boolean().default(true),
|
|
54
|
+
})
|
|
55
|
+
.default({}),
|
|
56
|
+
})
|
|
57
|
+
.passthrough();
|
|
58
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAElF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CA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sent to the model:
|
|
5
|
+
* - which files were included,
|
|
6
|
+
* - which were skipped and why,
|
|
7
|
+
* - file content hashes (so re-runs against unchanged files can be
|
|
8
|
+
* short-circuited later — caching is task #14+ scope but the hashes are
|
|
9
|
+
* captured now to keep the format stable),
|
|
10
|
+
* - redaction counts so the user can see how many secrets were filtered.
|
|
11
|
+
*
|
|
12
|
+
* For MVP 1 diff review, the "files" are the files in the diff; the manifest
|
|
13
|
+
* does not currently re-read full file contents (that's task #13 expansion
|
|
14
|
+
* for path review). Token estimates are 4-char heuristics.
|
|
15
|
+
*/
|
|
16
|
+
import type { RedactionMatch } from "./redact.js";
|
|
17
|
+
export interface ManifestFile {
|
|
18
|
+
path: string;
|
|
19
|
+
bytes: number;
|
|
20
|
+
sha256: string;
|
|
21
|
+
/** Why this file was excluded, if so. Undefined means included. */
|
|
22
|
+
skippedReason?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ContextManifest {
|
|
25
|
+
generatedAt: string;
|
|
26
|
+
inputSource: "diff" | "diff-range" | "path" | "requirement-file" | "ask";
|
|
27
|
+
filesIncluded: ManifestFile[];
|
|
28
|
+
filesSkipped: ManifestFile[];
|
|
29
|
+
redaction: {
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
totalCount: number;
|
|
32
|
+
byKind: RedactionMatch[];
|
|
33
|
+
};
|
|
34
|
+
totalTokensEstimate: number;
|
|
35
|
+
diffBytes: number;
|
|
36
|
+
}
|
|
37
|
+
export interface BuildManifestOptions {
|
|
38
|
+
inputSource: ContextManifest["inputSource"];
|
|
39
|
+
filesIncluded: {
|
|
40
|
+
path: string;
|
|
41
|
+
bytes: number;
|
|
42
|
+
content?: string;
|
|
43
|
+
}[];
|
|
44
|
+
filesSkipped: {
|
|
45
|
+
path: string;
|
|
46
|
+
bytes: number;
|
|
47
|
+
skippedReason: string;
|
|
48
|
+
}[];
|
|
49
|
+
diffText: string;
|
|
50
|
+
redaction: {
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
totalCount: number;
|
|
53
|
+
byKind: RedactionMatch[];
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export declare function buildContextManifest(opts: BuildManifestOptions): ContextManifest;
|
|
57
|
+
export declare function writeContextManifest(runFolderAbsPath: string, manifest: ContextManifest): Promise<string>;
|
|
58
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/context/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,kBAAkB,GAAG,KAAK,CAAC;IACzE,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,SAAS,EAAE;QACT,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,cAAc,EAAE,CAAC;KAC1B,CAAC;IACF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;IAC5C,aAAa,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnE,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC;CAC/E;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,oBAAoB,GACzB,eAAe,CAuBjB;AAED,wBAAsB,oBAAoB,CACxC,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,MAAM,CAAC,CAQjB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the context-manifest.json that accompanies every run.
|
|
3
|
+
*
|
|
4
|
+
* The manifest is the auditable record of what was sent to the model:
|
|
5
|
+
* - which files were included,
|
|
6
|
+
* - which were skipped and why,
|
|
7
|
+
* - file content hashes (so re-runs against unchanged files can be
|
|
8
|
+
* short-circuited later — caching is task #14+ scope but the hashes are
|
|
9
|
+
* captured now to keep the format stable),
|
|
10
|
+
* - redaction counts so the user can see how many secrets were filtered.
|
|
11
|
+
*
|
|
12
|
+
* For MVP 1 diff review, the "files" are the files in the diff; the manifest
|
|
13
|
+
* does not currently re-read full file contents (that's task #13 expansion
|
|
14
|
+
* for path review). Token estimates are 4-char heuristics.
|
|
15
|
+
*/
|
|
16
|
+
import { writeFile } from "node:fs/promises";
|
|
17
|
+
import { createHash } from "node:crypto";
|
|
18
|
+
import { join } from "node:path";
|
|
19
|
+
export function buildContextManifest(opts) {
|
|
20
|
+
const included = opts.filesIncluded.map((f) => ({
|
|
21
|
+
path: f.path,
|
|
22
|
+
bytes: f.bytes,
|
|
23
|
+
sha256: f.content ? sha256(f.content) : "",
|
|
24
|
+
}));
|
|
25
|
+
const skipped = opts.filesSkipped.map((f) => ({
|
|
26
|
+
path: f.path,
|
|
27
|
+
bytes: f.bytes,
|
|
28
|
+
sha256: "",
|
|
29
|
+
skippedReason: f.skippedReason,
|
|
30
|
+
}));
|
|
31
|
+
return {
|
|
32
|
+
generatedAt: new Date().toISOString(),
|
|
33
|
+
inputSource: opts.inputSource,
|
|
34
|
+
filesIncluded: included,
|
|
35
|
+
filesSkipped: skipped,
|
|
36
|
+
redaction: opts.redaction,
|
|
37
|
+
totalTokensEstimate: Math.ceil(opts.diffText.length / 4),
|
|
38
|
+
diffBytes: opts.diffText.length,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export async function writeContextManifest(runFolderAbsPath, manifest) {
|
|
42
|
+
const relPath = "context-manifest.json";
|
|
43
|
+
await writeFile(join(runFolderAbsPath, relPath), JSON.stringify(manifest, null, 2) + "\n", "utf8");
|
|
44
|
+
return relPath;
|
|
45
|
+
}
|
|
46
|
+
function sha256(s) {
|
|
47
|
+
return createHash("sha256").update(s).digest("hex");
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/context/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAiCjC,MAAM,UAAU,oBAAoB,CAClC,IAA0B;IAE1B,MAAM,QAAQ,GAAmB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9D,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAA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:<kind>:<short-hash>]` placeholder. The hash lets the user
|
|
6
|
+
* confirm two redactions refer to the same secret (useful for audit) without
|
|
7
|
+
* leaking the value.
|
|
8
|
+
*
|
|
9
|
+
* This is a defense-in-depth measure. The first line of defense is the
|
|
10
|
+
* `.almightyignore` file which prevents secret-bearing files from being
|
|
11
|
+
* included in the first place. Redaction catches what slips through.
|
|
12
|
+
*
|
|
13
|
+
* Patterns are deliberately conservative — false positives are better than
|
|
14
|
+
* leaking real secrets. Users can disable redaction via config if needed.
|
|
15
|
+
*/
|
|
16
|
+
export interface RedactionMatch {
|
|
17
|
+
kind: string;
|
|
18
|
+
count: number;
|
|
19
|
+
}
|
|
20
|
+
export interface RedactionResult {
|
|
21
|
+
text: string;
|
|
22
|
+
redactions: RedactionMatch[];
|
|
23
|
+
totalCount: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function redactSecrets(text: string): RedactionResult;
|
|
26
|
+
//# sourceMappingURL=redact.d.ts.map
|