@pythonluvr/openwar 0.4.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 +21 -0
- package/README.md +297 -0
- package/bin/openwar +45 -0
- package/dist/adapters/anthropic.d.ts +15 -0
- package/dist/adapters/anthropic.d.ts.map +1 -0
- package/dist/adapters/anthropic.js +179 -0
- package/dist/adapters/anthropic.js.map +1 -0
- package/dist/adapters/gemini.d.ts +15 -0
- package/dist/adapters/gemini.d.ts.map +1 -0
- package/dist/adapters/gemini.js +141 -0
- package/dist/adapters/gemini.js.map +1 -0
- package/dist/adapters/grok.d.ts +6 -0
- package/dist/adapters/grok.d.ts.map +1 -0
- package/dist/adapters/grok.js +15 -0
- package/dist/adapters/grok.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 +35 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/mock.d.ts +17 -0
- package/dist/adapters/mock.d.ts.map +1 -0
- package/dist/adapters/mock.js +33 -0
- package/dist/adapters/mock.js.map +1 -0
- package/dist/adapters/openai-compat.d.ts +6 -0
- package/dist/adapters/openai-compat.d.ts.map +1 -0
- package/dist/adapters/openai-compat.js +19 -0
- package/dist/adapters/openai-compat.js.map +1 -0
- package/dist/adapters/openai.d.ts +23 -0
- package/dist/adapters/openai.d.ts.map +1 -0
- package/dist/adapters/openai.js +176 -0
- package/dist/adapters/openai.js.map +1 -0
- package/dist/adapters/sse.d.ts +6 -0
- package/dist/adapters/sse.d.ts.map +1 -0
- package/dist/adapters/sse.js +45 -0
- package/dist/adapters/sse.js.map +1 -0
- package/dist/adapters/types.d.ts +7 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +2 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/auth/categories.d.ts +13 -0
- package/dist/auth/categories.d.ts.map +1 -0
- package/dist/auth/categories.js +47 -0
- package/dist/auth/categories.js.map +1 -0
- package/dist/auth/check.d.ts +31 -0
- package/dist/auth/check.d.ts.map +1 -0
- package/dist/auth/check.js +59 -0
- package/dist/auth/check.js.map +1 -0
- package/dist/auth/role-scope.d.ts +18 -0
- package/dist/auth/role-scope.d.ts.map +1 -0
- package/dist/auth/role-scope.js +62 -0
- package/dist/auth/role-scope.js.map +1 -0
- package/dist/auth/wildcards.d.ts +5 -0
- package/dist/auth/wildcards.d.ts.map +1 -0
- package/dist/auth/wildcards.js +36 -0
- package/dist/auth/wildcards.js.map +1 -0
- package/dist/brief.d.ts +9 -0
- package/dist/brief.d.ts.map +1 -0
- package/dist/brief.js +514 -0
- package/dist/brief.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +585 -0
- package/dist/cli.js.map +1 -0
- package/dist/coordinator/cost-tracker.d.ts +14 -0
- package/dist/coordinator/cost-tracker.d.ts.map +1 -0
- package/dist/coordinator/cost-tracker.js +63 -0
- package/dist/coordinator/cost-tracker.js.map +1 -0
- package/dist/coordinator/driver.d.ts +37 -0
- package/dist/coordinator/driver.d.ts.map +1 -0
- package/dist/coordinator/driver.js +644 -0
- package/dist/coordinator/driver.js.map +1 -0
- package/dist/coordinator/index.d.ts +14 -0
- package/dist/coordinator/index.d.ts.map +1 -0
- package/dist/coordinator/index.js +8 -0
- package/dist/coordinator/index.js.map +1 -0
- package/dist/coordinator/plan-parser.d.ts +17 -0
- package/dist/coordinator/plan-parser.d.ts.map +1 -0
- package/dist/coordinator/plan-parser.js +44 -0
- package/dist/coordinator/plan-parser.js.map +1 -0
- package/dist/coordinator/result-aggregator.d.ts +21 -0
- package/dist/coordinator/result-aggregator.d.ts.map +1 -0
- package/dist/coordinator/result-aggregator.js +58 -0
- package/dist/coordinator/result-aggregator.js.map +1 -0
- package/dist/coordinator/retry-policy.d.ts +7 -0
- package/dist/coordinator/retry-policy.d.ts.map +1 -0
- package/dist/coordinator/retry-policy.js +17 -0
- package/dist/coordinator/retry-policy.js.map +1 -0
- package/dist/coordinator/state-machine.d.ts +63 -0
- package/dist/coordinator/state-machine.d.ts.map +1 -0
- package/dist/coordinator/state-machine.js +242 -0
- package/dist/coordinator/state-machine.js.map +1 -0
- package/dist/coordinator/types.d.ts +3 -0
- package/dist/coordinator/types.d.ts.map +1 -0
- package/dist/coordinator/types.js +5 -0
- package/dist/coordinator/types.js.map +1 -0
- package/dist/detectors/banned-phrases.d.ts +3 -0
- package/dist/detectors/banned-phrases.d.ts.map +1 -0
- package/dist/detectors/banned-phrases.js +33 -0
- package/dist/detectors/banned-phrases.js.map +1 -0
- package/dist/detectors/blocker.d.ts +3 -0
- package/dist/detectors/blocker.d.ts.map +1 -0
- package/dist/detectors/blocker.js +62 -0
- package/dist/detectors/blocker.js.map +1 -0
- package/dist/detectors/completion.d.ts +3 -0
- package/dist/detectors/completion.d.ts.map +1 -0
- package/dist/detectors/completion.js +17 -0
- package/dist/detectors/completion.js.map +1 -0
- package/dist/detectors/confirmation-summary.d.ts +3 -0
- package/dist/detectors/confirmation-summary.d.ts.map +1 -0
- package/dist/detectors/confirmation-summary.js +76 -0
- package/dist/detectors/confirmation-summary.js.map +1 -0
- package/dist/detectors/destructive.d.ts +3 -0
- package/dist/detectors/destructive.d.ts.map +1 -0
- package/dist/detectors/destructive.js +96 -0
- package/dist/detectors/destructive.js.map +1 -0
- package/dist/detectors/index.d.ts +12 -0
- package/dist/detectors/index.d.ts.map +1 -0
- package/dist/detectors/index.js +19 -0
- package/dist/detectors/index.js.map +1 -0
- package/dist/detectors/phase-marker.d.ts +3 -0
- package/dist/detectors/phase-marker.d.ts.map +1 -0
- package/dist/detectors/phase-marker.js +25 -0
- package/dist/detectors/phase-marker.js.map +1 -0
- package/dist/framework.d.ts +2 -0
- package/dist/framework.d.ts.map +1 -0
- package/dist/framework.js +34 -0
- package/dist/framework.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/io.d.ts +25 -0
- package/dist/io.d.ts.map +1 -0
- package/dist/io.js +83 -0
- package/dist/io.js.map +1 -0
- package/dist/mcp/client.d.ts +22 -0
- package/dist/mcp/client.d.ts.map +1 -0
- package/dist/mcp/client.js +44 -0
- package/dist/mcp/client.js.map +1 -0
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +6 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/registry.d.ts +16 -0
- package/dist/mcp/registry.d.ts.map +1 -0
- package/dist/mcp/registry.js +53 -0
- package/dist/mcp/registry.js.map +1 -0
- package/dist/mcp/transport-stdio.d.ts +26 -0
- package/dist/mcp/transport-stdio.d.ts.map +1 -0
- package/dist/mcp/transport-stdio.js +138 -0
- package/dist/mcp/transport-stdio.js.map +1 -0
- package/dist/mcp/types.d.ts +90 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +23 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/orchestration/handoff.d.ts +27 -0
- package/dist/orchestration/handoff.d.ts.map +1 -0
- package/dist/orchestration/handoff.js +322 -0
- package/dist/orchestration/handoff.js.map +1 -0
- package/dist/phases/blocker.d.ts +8 -0
- package/dist/phases/blocker.d.ts.map +1 -0
- package/dist/phases/blocker.js +11 -0
- package/dist/phases/blocker.js.map +1 -0
- package/dist/phases/completion.d.ts +10 -0
- package/dist/phases/completion.d.ts.map +1 -0
- package/dist/phases/completion.js +47 -0
- package/dist/phases/completion.js.map +1 -0
- package/dist/phases/destructive.d.ts +10 -0
- package/dist/phases/destructive.d.ts.map +1 -0
- package/dist/phases/destructive.js +31 -0
- package/dist/phases/destructive.js.map +1 -0
- package/dist/phases/execute.d.ts +30 -0
- package/dist/phases/execute.d.ts.map +1 -0
- package/dist/phases/execute.js +222 -0
- package/dist/phases/execute.js.map +1 -0
- package/dist/phases/intake.d.ts +16 -0
- package/dist/phases/intake.d.ts.map +1 -0
- package/dist/phases/intake.js +105 -0
- package/dist/phases/intake.js.map +1 -0
- package/dist/roles/critic.d.ts +3 -0
- package/dist/roles/critic.d.ts.map +1 -0
- package/dist/roles/critic.js +35 -0
- package/dist/roles/critic.js.map +1 -0
- package/dist/roles/executor.d.ts +3 -0
- package/dist/roles/executor.d.ts.map +1 -0
- package/dist/roles/executor.js +46 -0
- package/dist/roles/executor.js.map +1 -0
- package/dist/roles/index.d.ts +8 -0
- package/dist/roles/index.d.ts.map +1 -0
- package/dist/roles/index.js +8 -0
- package/dist/roles/index.js.map +1 -0
- package/dist/roles/planner.d.ts +3 -0
- package/dist/roles/planner.d.ts.map +1 -0
- package/dist/roles/planner.js +50 -0
- package/dist/roles/planner.js.map +1 -0
- package/dist/roles/prompt-overlay.d.ts +9 -0
- package/dist/roles/prompt-overlay.d.ts.map +1 -0
- package/dist/roles/prompt-overlay.js +25 -0
- package/dist/roles/prompt-overlay.js.map +1 -0
- package/dist/roles/registry.d.ts +8 -0
- package/dist/roles/registry.d.ts.map +1 -0
- package/dist/roles/registry.js +45 -0
- package/dist/roles/registry.js.map +1 -0
- package/dist/roles/reviewer.d.ts +3 -0
- package/dist/roles/reviewer.d.ts.map +1 -0
- package/dist/roles/reviewer.js +46 -0
- package/dist/roles/reviewer.js.map +1 -0
- package/dist/roles/types.d.ts +2 -0
- package/dist/roles/types.d.ts.map +1 -0
- package/dist/roles/types.js +4 -0
- package/dist/roles/types.js.map +1 -0
- package/dist/runner.d.ts +3 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +473 -0
- package/dist/runner.js.map +1 -0
- package/dist/sandbox/host-allowlist.d.ts +13 -0
- package/dist/sandbox/host-allowlist.d.ts.map +1 -0
- package/dist/sandbox/host-allowlist.js +85 -0
- package/dist/sandbox/host-allowlist.js.map +1 -0
- package/dist/sandbox/output-cap.d.ts +9 -0
- package/dist/sandbox/output-cap.d.ts.map +1 -0
- package/dist/sandbox/output-cap.js +66 -0
- package/dist/sandbox/output-cap.js.map +1 -0
- package/dist/sandbox/timeout.d.ts +7 -0
- package/dist/sandbox/timeout.d.ts.map +1 -0
- package/dist/sandbox/timeout.js +52 -0
- package/dist/sandbox/timeout.js.map +1 -0
- package/dist/sandbox/types.d.ts +18 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/sandbox/types.js +27 -0
- package/dist/sandbox/types.js.map +1 -0
- package/dist/sandbox/workdir.d.ts +9 -0
- package/dist/sandbox/workdir.d.ts.map +1 -0
- package/dist/sandbox/workdir.js +83 -0
- package/dist/sandbox/workdir.js.map +1 -0
- package/dist/state/index.d.ts +4 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +4 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/paths.d.ts +5 -0
- package/dist/state/paths.d.ts.map +1 -0
- package/dist/state/paths.js +18 -0
- package/dist/state/paths.js.map +1 -0
- package/dist/state/persist.d.ts +14 -0
- package/dist/state/persist.d.ts.map +1 -0
- package/dist/state/persist.js +146 -0
- package/dist/state/persist.js.map +1 -0
- package/dist/state/transcript.d.ts +9 -0
- package/dist/state/transcript.d.ts.map +1 -0
- package/dist/state/transcript.js +34 -0
- package/dist/state/transcript.js.map +1 -0
- package/dist/tools/native/apply_patch.d.ts +18 -0
- package/dist/tools/native/apply_patch.d.ts.map +1 -0
- package/dist/tools/native/apply_patch.js +245 -0
- package/dist/tools/native/apply_patch.js.map +1 -0
- package/dist/tools/native/http_fetch.d.ts +6 -0
- package/dist/tools/native/http_fetch.d.ts.map +1 -0
- package/dist/tools/native/http_fetch.js +168 -0
- package/dist/tools/native/http_fetch.js.map +1 -0
- package/dist/tools/native/index.d.ts +9 -0
- package/dist/tools/native/index.d.ts.map +1 -0
- package/dist/tools/native/index.js +22 -0
- package/dist/tools/native/index.js.map +1 -0
- package/dist/tools/native/list_dir.d.ts +4 -0
- package/dist/tools/native/list_dir.d.ts.map +1 -0
- package/dist/tools/native/list_dir.js +175 -0
- package/dist/tools/native/list_dir.js.map +1 -0
- package/dist/tools/native/read_file.d.ts +4 -0
- package/dist/tools/native/read_file.d.ts.map +1 -0
- package/dist/tools/native/read_file.js +91 -0
- package/dist/tools/native/read_file.js.map +1 -0
- package/dist/tools/native/shell_exec.d.ts +4 -0
- package/dist/tools/native/shell_exec.d.ts.map +1 -0
- package/dist/tools/native/shell_exec.js +180 -0
- package/dist/tools/native/shell_exec.js.map +1 -0
- package/dist/tools/native/write_file.d.ts +4 -0
- package/dist/tools/native/write_file.d.ts.map +1 -0
- package/dist/tools/native/write_file.js +101 -0
- package/dist/tools/native/write_file.js.map +1 -0
- package/dist/tools/types.d.ts +48 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +10 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/types.d.ts +385 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/examples/README.md +73 -0
- package/examples/creative-brief.md +34 -0
- package/examples/critic-disagreement-brief.md +42 -0
- package/examples/engineering-brief.md +35 -0
- package/examples/file-editing-brief.md +33 -0
- package/examples/mcp-brief.md +34 -0
- package/examples/multi-agent-brief.md +43 -0
- package/examples/research-brief.md +35 -0
- package/openwar.md +248 -0
- package/package.json +76 -0
- package/templates/brief.md +62 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { AuthCategory } from "../auth/categories.js";
|
|
2
|
+
import type { SandboxContext } from "../sandbox/types.js";
|
|
3
|
+
export type ToolOrigin = "native" | "mcp";
|
|
4
|
+
export interface JsonSchema {
|
|
5
|
+
type?: string;
|
|
6
|
+
properties?: Record<string, JsonSchema>;
|
|
7
|
+
required?: string[];
|
|
8
|
+
items?: JsonSchema;
|
|
9
|
+
description?: string;
|
|
10
|
+
enum?: unknown[];
|
|
11
|
+
[k: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface ToolDefinition {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
input_schema: JsonSchema;
|
|
17
|
+
origin: ToolOrigin;
|
|
18
|
+
authorization_categories: AuthCategory[];
|
|
19
|
+
mcp_server_name?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ToolCall {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
arguments: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface ToolError {
|
|
27
|
+
code: string;
|
|
28
|
+
message: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ToolResultMeta {
|
|
31
|
+
duration_ms?: number;
|
|
32
|
+
truncated?: boolean;
|
|
33
|
+
bytes?: number;
|
|
34
|
+
exit_code?: number;
|
|
35
|
+
signal?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ToolResult {
|
|
38
|
+
call_id: string;
|
|
39
|
+
success: boolean;
|
|
40
|
+
content: string;
|
|
41
|
+
error?: ToolError;
|
|
42
|
+
meta?: ToolResultMeta;
|
|
43
|
+
}
|
|
44
|
+
export interface ToolExecutor {
|
|
45
|
+
(call: ToolCall, ctx: ToolExecutionContext): Promise<ToolResult>;
|
|
46
|
+
}
|
|
47
|
+
export type ToolExecutionContext = SandboxContext;
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;AAK1C,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC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src/tools/native/*)
|
|
3
|
+
// - MCP tools (src/mcp/*)
|
|
4
|
+
// - Adapter tool-call translation (src/adapters/*)
|
|
5
|
+
// - Runtime integration (src/runner.ts, src/phases/execute.ts)
|
|
6
|
+
// - Authorization gate (src/auth/check.ts)
|
|
7
|
+
//
|
|
8
|
+
// These types are the contract every tool path must honor. Changes here ripple.
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,iDAAiD;AACjD,4BAA4B;AAC5B,qDAAqD;AACrD,iEAAiE;AACjE,6CAA6C;AAC7C,EAAE;AACF,gFAAgF"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import type { ToolDefinition, ToolCall } from "./tools/types.js";
|
|
2
|
+
export type { ToolDefinition, ToolCall, ToolResult, ToolError, ToolResultMeta, ToolExecutor, JsonSchema, ToolOrigin } from "./tools/types.js";
|
|
3
|
+
export type ExecutionMode = "gated" | "auto";
|
|
4
|
+
export interface BriefFrontmatter {
|
|
5
|
+
project: string;
|
|
6
|
+
brief_id?: string;
|
|
7
|
+
deadline?: string;
|
|
8
|
+
scope_locked: boolean;
|
|
9
|
+
mode?: ExecutionMode;
|
|
10
|
+
authorized_costs: string[];
|
|
11
|
+
workdir?: string;
|
|
12
|
+
mcp_servers?: {
|
|
13
|
+
name: string;
|
|
14
|
+
command: string;
|
|
15
|
+
cwd?: string;
|
|
16
|
+
}[];
|
|
17
|
+
roles?: string[];
|
|
18
|
+
budgets?: Partial<{
|
|
19
|
+
max_tokens: number;
|
|
20
|
+
max_wall_clock_minutes: number;
|
|
21
|
+
max_tool_calls_per_subtask: number;
|
|
22
|
+
max_retries_per_subtask: number;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export interface BriefSections {
|
|
26
|
+
objective: string;
|
|
27
|
+
deliverables: string;
|
|
28
|
+
constraints: string;
|
|
29
|
+
tools_required: string;
|
|
30
|
+
notes: string;
|
|
31
|
+
extra: Record<string, string>;
|
|
32
|
+
}
|
|
33
|
+
export interface Brief {
|
|
34
|
+
frontmatter: BriefFrontmatter;
|
|
35
|
+
sections: BriefSections;
|
|
36
|
+
raw: string;
|
|
37
|
+
source_path?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ValidationIssue {
|
|
40
|
+
field: string;
|
|
41
|
+
message: string;
|
|
42
|
+
severity: "error" | "warning";
|
|
43
|
+
}
|
|
44
|
+
export interface ValidationResult {
|
|
45
|
+
valid: boolean;
|
|
46
|
+
issues: ValidationIssue[];
|
|
47
|
+
}
|
|
48
|
+
export type Phase = "intake" | "execute" | "blocker" | "destructive" | "completion" | "done";
|
|
49
|
+
export interface PhaseTransition {
|
|
50
|
+
from: Phase;
|
|
51
|
+
to: Phase;
|
|
52
|
+
at: string;
|
|
53
|
+
reason: string;
|
|
54
|
+
}
|
|
55
|
+
export type MessageRole = "system" | "user" | "assistant";
|
|
56
|
+
/** @deprecated Use MessageRole. Will be removed in a future minor. */
|
|
57
|
+
export type Role = MessageRole;
|
|
58
|
+
export interface Message {
|
|
59
|
+
role: MessageRole;
|
|
60
|
+
content: string;
|
|
61
|
+
at: string;
|
|
62
|
+
meta?: {
|
|
63
|
+
phase?: Phase;
|
|
64
|
+
step_index?: number;
|
|
65
|
+
detectors?: DetectorSnapshot;
|
|
66
|
+
orch_role?: RoleId | null;
|
|
67
|
+
subtask_id?: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface ConfirmationDetection {
|
|
71
|
+
found: boolean;
|
|
72
|
+
sections: {
|
|
73
|
+
objective?: string;
|
|
74
|
+
deliverables?: string;
|
|
75
|
+
constraints?: string;
|
|
76
|
+
tools_required?: string;
|
|
77
|
+
unknowns?: string;
|
|
78
|
+
};
|
|
79
|
+
asked_for_mode: boolean;
|
|
80
|
+
}
|
|
81
|
+
export interface BlockerDetection {
|
|
82
|
+
blocked: boolean;
|
|
83
|
+
reason: string | null;
|
|
84
|
+
matched_pattern?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface DestructiveDetection {
|
|
87
|
+
destructive: boolean;
|
|
88
|
+
action: string | null;
|
|
89
|
+
authorized: boolean;
|
|
90
|
+
matched_pattern?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface BannedPhraseDetection {
|
|
93
|
+
count: number;
|
|
94
|
+
phrases: string[];
|
|
95
|
+
}
|
|
96
|
+
export interface PhaseMarkerDetection {
|
|
97
|
+
declared: Phase[];
|
|
98
|
+
last?: Phase;
|
|
99
|
+
}
|
|
100
|
+
export interface CompletionDetection {
|
|
101
|
+
complete: boolean;
|
|
102
|
+
matched_pattern?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface DetectorSnapshot {
|
|
105
|
+
confirmation?: ConfirmationDetection;
|
|
106
|
+
blocker?: BlockerDetection;
|
|
107
|
+
destructive?: DestructiveDetection;
|
|
108
|
+
banned_phrases?: BannedPhraseDetection;
|
|
109
|
+
phase_marker?: PhaseMarkerDetection;
|
|
110
|
+
completion?: CompletionDetection;
|
|
111
|
+
}
|
|
112
|
+
export interface SendMessageOptions {
|
|
113
|
+
system: string;
|
|
114
|
+
messages: Message[];
|
|
115
|
+
tools?: ToolDefinition[];
|
|
116
|
+
prior_tool_calls?: ToolCall[];
|
|
117
|
+
prior_tool_results?: ToolResultForRound[];
|
|
118
|
+
signal?: AbortSignal;
|
|
119
|
+
}
|
|
120
|
+
export interface ToolResultForRound {
|
|
121
|
+
call_id: string;
|
|
122
|
+
content: string;
|
|
123
|
+
is_error?: boolean;
|
|
124
|
+
}
|
|
125
|
+
export type StreamEvent = {
|
|
126
|
+
type: "text_delta";
|
|
127
|
+
delta: string;
|
|
128
|
+
} | {
|
|
129
|
+
type: "tool_call_arg_delta";
|
|
130
|
+
tool_call_id: string;
|
|
131
|
+
name: string;
|
|
132
|
+
arg_delta: string;
|
|
133
|
+
} | {
|
|
134
|
+
type: "tool_call_complete";
|
|
135
|
+
call: ToolCall;
|
|
136
|
+
} | {
|
|
137
|
+
type: "done";
|
|
138
|
+
message: string;
|
|
139
|
+
tool_calls?: ToolCall[];
|
|
140
|
+
} | {
|
|
141
|
+
type: "error";
|
|
142
|
+
error: Error;
|
|
143
|
+
};
|
|
144
|
+
export interface AgentAdapter {
|
|
145
|
+
readonly id: string;
|
|
146
|
+
readonly name: string;
|
|
147
|
+
readonly model: string;
|
|
148
|
+
isConfigured(): boolean;
|
|
149
|
+
sendMessage(opts: SendMessageOptions): AsyncIterable<StreamEvent>;
|
|
150
|
+
}
|
|
151
|
+
export interface AdapterConfig {
|
|
152
|
+
id: string;
|
|
153
|
+
model?: string;
|
|
154
|
+
apiKey?: string;
|
|
155
|
+
baseUrl?: string;
|
|
156
|
+
extra?: Record<string, unknown>;
|
|
157
|
+
}
|
|
158
|
+
export interface SessionMeta {
|
|
159
|
+
brief_id: string;
|
|
160
|
+
project: string;
|
|
161
|
+
started_at: string;
|
|
162
|
+
updated_at: string;
|
|
163
|
+
phase: Phase;
|
|
164
|
+
mode: ExecutionMode | null;
|
|
165
|
+
destructive_approvals: DestructiveApproval[];
|
|
166
|
+
transitions: PhaseTransition[];
|
|
167
|
+
schema_version?: number;
|
|
168
|
+
session_approved_categories?: string[];
|
|
169
|
+
tool_calls?: ToolCallRecord[];
|
|
170
|
+
}
|
|
171
|
+
export interface ToolCallRecord {
|
|
172
|
+
call_id: string;
|
|
173
|
+
name: string;
|
|
174
|
+
arguments: unknown;
|
|
175
|
+
at: string;
|
|
176
|
+
authorized: boolean;
|
|
177
|
+
auth_note?: string;
|
|
178
|
+
result?: {
|
|
179
|
+
success: boolean;
|
|
180
|
+
content: string;
|
|
181
|
+
meta?: unknown;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export interface DestructiveApproval {
|
|
185
|
+
at: string;
|
|
186
|
+
action: string;
|
|
187
|
+
approved: boolean;
|
|
188
|
+
session_categories?: string[];
|
|
189
|
+
}
|
|
190
|
+
export interface SessionState {
|
|
191
|
+
meta: SessionMeta;
|
|
192
|
+
brief: Brief;
|
|
193
|
+
messages: Message[];
|
|
194
|
+
}
|
|
195
|
+
export interface RunOptions {
|
|
196
|
+
briefPath?: string;
|
|
197
|
+
briefSource?: string;
|
|
198
|
+
adapter: AgentAdapter;
|
|
199
|
+
mode?: ExecutionMode;
|
|
200
|
+
json?: boolean;
|
|
201
|
+
ephemeral?: boolean;
|
|
202
|
+
sessionId?: string;
|
|
203
|
+
io?: RunnerIO;
|
|
204
|
+
resume?: boolean;
|
|
205
|
+
workdir?: string;
|
|
206
|
+
disableShell?: boolean;
|
|
207
|
+
mcpServers?: {
|
|
208
|
+
name: string;
|
|
209
|
+
command: string;
|
|
210
|
+
cwd?: string;
|
|
211
|
+
}[];
|
|
212
|
+
disableNativeTools?: boolean;
|
|
213
|
+
runtimeRoles?: string[];
|
|
214
|
+
runtimeBudgets?: Partial<{
|
|
215
|
+
max_tokens: number;
|
|
216
|
+
max_wall_clock_minutes: number;
|
|
217
|
+
max_tool_calls_per_subtask: number;
|
|
218
|
+
max_retries_per_subtask: number;
|
|
219
|
+
}>;
|
|
220
|
+
}
|
|
221
|
+
export interface RunResult {
|
|
222
|
+
session_id: string;
|
|
223
|
+
final_phase: Phase;
|
|
224
|
+
completed: boolean;
|
|
225
|
+
halted: boolean;
|
|
226
|
+
halt_reason?: string;
|
|
227
|
+
messages: Message[];
|
|
228
|
+
}
|
|
229
|
+
export interface RunnerIO {
|
|
230
|
+
write(text: string): void;
|
|
231
|
+
banner(text: string): void;
|
|
232
|
+
warn(text: string): void;
|
|
233
|
+
prompt(question: string): Promise<string>;
|
|
234
|
+
confirm(question: string): Promise<boolean>;
|
|
235
|
+
}
|
|
236
|
+
export type BuiltInRoleId = "planner" | "executor" | "reviewer" | "critic";
|
|
237
|
+
export type RoleId = string;
|
|
238
|
+
export interface RoleDefinition {
|
|
239
|
+
id: RoleId;
|
|
240
|
+
description: string;
|
|
241
|
+
prompt_overlay: string;
|
|
242
|
+
tool_categories: string[];
|
|
243
|
+
allow_read_file?: boolean;
|
|
244
|
+
}
|
|
245
|
+
export interface RoleContext {
|
|
246
|
+
brief: Brief;
|
|
247
|
+
history: Message[];
|
|
248
|
+
subtask: SubTask | null;
|
|
249
|
+
execution_handoff?: ExecutionHandoff;
|
|
250
|
+
adapter: AgentAdapter;
|
|
251
|
+
system: string;
|
|
252
|
+
io: RunnerIO;
|
|
253
|
+
signal?: AbortSignal;
|
|
254
|
+
toolDefinitions?: ToolDefinition[];
|
|
255
|
+
toolExecutors?: Map<string, import("./tools/types.js").ToolExecutor>;
|
|
256
|
+
sandbox?: import("./sandbox/types.js").SandboxContext;
|
|
257
|
+
sessionApproved?: string[];
|
|
258
|
+
}
|
|
259
|
+
export interface RoleResult {
|
|
260
|
+
role: RoleId;
|
|
261
|
+
text: string;
|
|
262
|
+
history: Message[];
|
|
263
|
+
plan?: PlanHandoff;
|
|
264
|
+
execution?: ExecutionHandoff;
|
|
265
|
+
review?: ReviewHandoff;
|
|
266
|
+
escalation?: EscalationHandoff;
|
|
267
|
+
blocked?: boolean;
|
|
268
|
+
blocker_reason?: string;
|
|
269
|
+
cost?: RoleCost;
|
|
270
|
+
}
|
|
271
|
+
export interface RoleCost {
|
|
272
|
+
tokens_used: number;
|
|
273
|
+
tool_calls: number;
|
|
274
|
+
wall_clock_ms: number;
|
|
275
|
+
}
|
|
276
|
+
export type CoordinatorState = "init" | "plan" | "dispatch" | "execute" | "review_step" | "next_subtask" | "retry" | "block" | "escalate" | "complete";
|
|
277
|
+
export interface SubTask {
|
|
278
|
+
id: string;
|
|
279
|
+
title: string;
|
|
280
|
+
instruction: string;
|
|
281
|
+
acceptance_criteria: string[];
|
|
282
|
+
order: number;
|
|
283
|
+
depends_on?: string[];
|
|
284
|
+
}
|
|
285
|
+
export type SubTaskStatus = "pending" | "executing" | "reviewing" | "passed" | "failed" | "retrying" | "escalated" | "skipped";
|
|
286
|
+
export interface SubTaskState {
|
|
287
|
+
id: string;
|
|
288
|
+
status: SubTaskStatus;
|
|
289
|
+
attempts: number;
|
|
290
|
+
last_handoff?: ExecutionHandoff;
|
|
291
|
+
last_review?: ReviewHandoff;
|
|
292
|
+
escalation?: EscalationHandoff;
|
|
293
|
+
started_at?: string;
|
|
294
|
+
finished_at?: string;
|
|
295
|
+
}
|
|
296
|
+
export type CoordinatorEvent = {
|
|
297
|
+
type: "state_enter";
|
|
298
|
+
state: CoordinatorState;
|
|
299
|
+
at: string;
|
|
300
|
+
subtask_id?: string;
|
|
301
|
+
} | {
|
|
302
|
+
type: "role_invoked";
|
|
303
|
+
role: RoleId;
|
|
304
|
+
subtask_id?: string;
|
|
305
|
+
at: string;
|
|
306
|
+
} | {
|
|
307
|
+
type: "subtask_result";
|
|
308
|
+
subtask_id: string;
|
|
309
|
+
status: SubTaskStatus;
|
|
310
|
+
at: string;
|
|
311
|
+
} | {
|
|
312
|
+
type: "budget_warn";
|
|
313
|
+
metric: "tokens" | "wall_clock_ms" | "tool_calls";
|
|
314
|
+
used: number;
|
|
315
|
+
limit: number;
|
|
316
|
+
} | {
|
|
317
|
+
type: "budget_halt";
|
|
318
|
+
metric: "tokens" | "wall_clock_ms" | "tool_calls";
|
|
319
|
+
used: number;
|
|
320
|
+
limit: number;
|
|
321
|
+
at: string;
|
|
322
|
+
} | {
|
|
323
|
+
type: "escalated";
|
|
324
|
+
subtask_id: string;
|
|
325
|
+
reason: string;
|
|
326
|
+
at: string;
|
|
327
|
+
};
|
|
328
|
+
export interface PlanNode {
|
|
329
|
+
subtasks: SubTask[];
|
|
330
|
+
created_at: string;
|
|
331
|
+
rationale: string;
|
|
332
|
+
}
|
|
333
|
+
export interface PlanHandoff {
|
|
334
|
+
kind: "plan";
|
|
335
|
+
subtasks: SubTask[];
|
|
336
|
+
rationale: string;
|
|
337
|
+
}
|
|
338
|
+
export interface ExecutionHandoff {
|
|
339
|
+
kind: "execution";
|
|
340
|
+
subtask_id: string;
|
|
341
|
+
output: string;
|
|
342
|
+
tool_calls: ToolCallRecord[];
|
|
343
|
+
notes: string;
|
|
344
|
+
}
|
|
345
|
+
export interface ReviewHandoff {
|
|
346
|
+
kind: "review";
|
|
347
|
+
subtask_id: string;
|
|
348
|
+
verdict: "pass" | "fail" | "needs_retry";
|
|
349
|
+
rationale: string;
|
|
350
|
+
suggested_revision?: string;
|
|
351
|
+
}
|
|
352
|
+
export interface EscalationHandoff {
|
|
353
|
+
kind: "escalation";
|
|
354
|
+
severity: "info" | "warn" | "error";
|
|
355
|
+
role: RoleId;
|
|
356
|
+
reason: string;
|
|
357
|
+
context: string;
|
|
358
|
+
budget_metric?: "tokens" | "wall_clock_ms" | "tool_calls";
|
|
359
|
+
}
|
|
360
|
+
export interface Budgets {
|
|
361
|
+
max_tokens: number;
|
|
362
|
+
max_wall_clock_minutes: number;
|
|
363
|
+
max_tool_calls_per_subtask: number;
|
|
364
|
+
max_retries_per_subtask: number;
|
|
365
|
+
}
|
|
366
|
+
export declare const DEFAULT_BUDGETS: Budgets;
|
|
367
|
+
export interface CostUsage {
|
|
368
|
+
tokens_used: number;
|
|
369
|
+
wall_clock_ms: number;
|
|
370
|
+
tool_calls: number;
|
|
371
|
+
tool_calls_by_subtask: Record<string, number>;
|
|
372
|
+
started_at: string;
|
|
373
|
+
}
|
|
374
|
+
export type RoleTranscripts = Record<RoleId, Message[]>;
|
|
375
|
+
export interface SessionMetaV3 extends SessionMeta {
|
|
376
|
+
coordinator_state?: CoordinatorState;
|
|
377
|
+
plan?: PlanNode | null;
|
|
378
|
+
subtask_states?: Record<string, SubTaskState>;
|
|
379
|
+
role_transcripts?: RoleTranscripts;
|
|
380
|
+
cost?: CostUsage;
|
|
381
|
+
active_roles?: RoleId[];
|
|
382
|
+
budgets?: Budgets;
|
|
383
|
+
coordinator_events?: CoordinatorEvent[];
|
|
384
|
+
}
|
|
385
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 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gB,EAAE,CAAC;CACzC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Public type surface for OpenWar runtime.
|
|
2
|
+
// Anything exported from src/index.ts ultimately roots here.
|
|
3
|
+
export const DEFAULT_BUDGETS = {
|
|
4
|
+
max_tokens: 50_000,
|
|
5
|
+
max_wall_clock_minutes: 20,
|
|
6
|
+
max_tool_calls_per_subtask: 15,
|
|
7
|
+
max_retries_per_subtask: 3,
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,6DAA6D;AAihB7D,MAAM,CAAC,MAAM,eAAe,GAAY;IACtC,UAAU,EAAE,MAAM;IAClB,sBAAsB,EAAE,EAAE;IAC1B,0BAA0B,EAAE,EAAE;IAC9B,uBAAuB,EAAE,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# OpenWar example briefs
|
|
2
|
+
|
|
3
|
+
Seven reference briefs you can run end-to-end against any configured adapter.
|
|
4
|
+
|
|
5
|
+
## creative-brief.md
|
|
6
|
+
|
|
7
|
+
A copywriting task with gated execution. Demonstrates frontmatter with `scope_locked: false`, `mode: gated`, and a soft `generation_credits` pre-approval.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @pythonluvr/openwar run examples/creative-brief.md --adapter anthropic
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## engineering-brief.md
|
|
14
|
+
|
|
15
|
+
A code task with auto-pilot execution and a locked scope. Demonstrates `scope_locked: true`, `mode: auto`, and `filesystem_write` pre-approved.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @pythonluvr/openwar run examples/engineering-brief.md --adapter openai --model gpt-4o
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## file-editing-brief.md (v0.3+, requires tools)
|
|
22
|
+
|
|
23
|
+
A real refactor: rename a symbol across every `.ts` file in the workdir. Demonstrates `read_file`, `list_dir`, and `apply_patch` native tools with `filesystem_write` pre-approved.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx @pythonluvr/openwar run examples/file-editing-brief.md --adapter anthropic --workdir ./your-project
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## research-brief.md (v0.3+, requires tools + network)
|
|
30
|
+
|
|
31
|
+
Fetch three GitHub README files and save them locally. Demonstrates `http_fetch` and `write_file`. If you have `~/.openwar/http-allow.json` configured, allow `*.githubusercontent.com` first.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx @pythonluvr/openwar run examples/research-brief.md --adapter anthropic
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## mcp-brief.md (v0.3+, requires MCP)
|
|
38
|
+
|
|
39
|
+
Survey the workdir through the official Filesystem MCP server. Demonstrates `mcp_servers` in frontmatter and the `mcp_tool:filesystem:*` wildcard.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx @pythonluvr/openwar run examples/mcp-brief.md --adapter anthropic
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## multi-agent-brief.md (v0.4+, multi-agent)
|
|
46
|
+
|
|
47
|
+
A small static-site generator built with the three default roles (planner, executor, reviewer). The planner decomposes the brief into linear sub-tasks, the executor runs each, and the reviewer evaluates against each sub-task's acceptance criteria. Demonstrates `roles:` and `budgets:` frontmatter.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Dry-run the plan first (no execution, no spending).
|
|
51
|
+
npx @pythonluvr/openwar plan examples/multi-agent-brief.md --adapter anthropic
|
|
52
|
+
|
|
53
|
+
# Full run.
|
|
54
|
+
npx @pythonluvr/openwar run examples/multi-agent-brief.md --adapter anthropic
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## critic-disagreement-brief.md (v0.4+, four-role)
|
|
58
|
+
|
|
59
|
+
A tiny leap-year function with all four roles enabled (planner, executor, reviewer, critic). When the critic disagrees with the reviewer the coordinator halts on Phase 2 and asks the operator to pick a verdict.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npx @pythonluvr/openwar run examples/critic-disagreement-brief.md --adapter anthropic
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Inspecting after the run
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
openwar list # show recent sessions
|
|
69
|
+
openwar inspect <brief_id> # show session metadata
|
|
70
|
+
openwar inspect <brief_id> --transcript # full back-and-forth
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Sessions persist to `~/.openwar/sessions/`. Resume with `openwar resume <brief_id>` (multi-agent or single-agent; the runtime detects which).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
project: launch-anthem
|
|
3
|
+
brief_id: 2026-01-15-A1
|
|
4
|
+
scope_locked: false
|
|
5
|
+
mode: gated
|
|
6
|
+
authorized_costs:
|
|
7
|
+
- generation_credits
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Objective
|
|
11
|
+
|
|
12
|
+
Draft three competing 30-second voiceover scripts for a product launch anthem. Tone should land between "we built this" pride and "you are seen" warmth. The product is a self-hosted journaling app for people who write longhand. The audience is everyone who has tried five productivity tools and quit them.
|
|
13
|
+
|
|
14
|
+
# Deliverables
|
|
15
|
+
|
|
16
|
+
- Three voiceover scripts of 60 to 80 words each
|
|
17
|
+
- For each script: a one-line tonal description and a single sentence about who it targets
|
|
18
|
+
- A recommendation at the end with which to film first and why
|
|
19
|
+
|
|
20
|
+
# Constraints
|
|
21
|
+
|
|
22
|
+
- No em dashes in any of the output
|
|
23
|
+
- No filler openers like "in a world where" or "what if"
|
|
24
|
+
- Do not write more than three options; do not pad with a fourth weaker variant
|
|
25
|
+
- Stay vendor-neutral; do not name competing products
|
|
26
|
+
|
|
27
|
+
# Tools required
|
|
28
|
+
|
|
29
|
+
- None beyond text generation
|
|
30
|
+
|
|
31
|
+
# Notes / unknowns
|
|
32
|
+
|
|
33
|
+
- The product name has not been finalized. Use the placeholder "the app" instead of inventing one.
|
|
34
|
+
- A second pass for VO timing markers is out of scope for this brief.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
project: critic-disagree-demo
|
|
3
|
+
brief_id: 2026-02-01-C1
|
|
4
|
+
scope_locked: true
|
|
5
|
+
mode: auto
|
|
6
|
+
authorized_costs:
|
|
7
|
+
- filesystem_read
|
|
8
|
+
- filesystem_write
|
|
9
|
+
roles:
|
|
10
|
+
- planner
|
|
11
|
+
- executor
|
|
12
|
+
- reviewer
|
|
13
|
+
- critic
|
|
14
|
+
budgets:
|
|
15
|
+
max_tokens: 60000
|
|
16
|
+
max_wall_clock_minutes: 20
|
|
17
|
+
max_tool_calls_per_subtask: 10
|
|
18
|
+
max_retries_per_subtask: 2
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Objective
|
|
22
|
+
|
|
23
|
+
Write a function that returns whether a year is a leap year in the Gregorian calendar. Provide three small unit tests covering common edge cases.
|
|
24
|
+
|
|
25
|
+
# Deliverables
|
|
26
|
+
|
|
27
|
+
- `src/leap.ts` exporting `isLeap(year: number): boolean`.
|
|
28
|
+
- `tests/leap.test.ts` covering at least: divisible-by-4-but-not-100, divisible-by-100-but-not-400, divisible-by-400.
|
|
29
|
+
|
|
30
|
+
# Constraints
|
|
31
|
+
|
|
32
|
+
- Single-file implementation. No date library imports.
|
|
33
|
+
- No mutation. The function is pure.
|
|
34
|
+
|
|
35
|
+
# Tools required
|
|
36
|
+
|
|
37
|
+
- Filesystem read and write.
|
|
38
|
+
|
|
39
|
+
# Notes / unknowns
|
|
40
|
+
|
|
41
|
+
- This brief is intentionally small so that the four-role flow is easy to follow end-to-end. The reviewer and critic should agree most of the time. When they disagree, the coordinator halts on Phase 2 and asks you which verdict to accept.
|
|
42
|
+
- Negative years (BCE) are out of scope; the function may assume `year >= 0`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
project: rate-limiter
|
|
3
|
+
brief_id: 2026-01-15-E1
|
|
4
|
+
scope_locked: true
|
|
5
|
+
mode: auto
|
|
6
|
+
authorized_costs:
|
|
7
|
+
- filesystem_write
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Objective
|
|
11
|
+
|
|
12
|
+
Add a token-bucket rate limiter to an existing Node HTTP service. The limiter must be per-IP, configurable, and survive process restart without losing the in-flight bucket state.
|
|
13
|
+
|
|
14
|
+
# Deliverables
|
|
15
|
+
|
|
16
|
+
- A `src/middleware/rateLimit.ts` module exporting a factory function `createRateLimit(options)`
|
|
17
|
+
- Unit tests at `tests/middleware/rateLimit.test.ts` covering happy path, exhaustion, refill, and restart-state recovery
|
|
18
|
+
- A short README section under `docs/rate-limit.md` documenting how to wire it up and what the configuration knobs do
|
|
19
|
+
|
|
20
|
+
# Constraints
|
|
21
|
+
|
|
22
|
+
- Zero new runtime dependencies. Use only Node stdlib.
|
|
23
|
+
- Persistence must be file-backed under `./.cache/ratelimit/`. No external store.
|
|
24
|
+
- Default config: 60 requests per minute per IP, burst of 10.
|
|
25
|
+
- Public API of the existing service must not change.
|
|
26
|
+
|
|
27
|
+
# Tools required
|
|
28
|
+
|
|
29
|
+
- Filesystem (read / write)
|
|
30
|
+
- Node test runner via `node --test`
|
|
31
|
+
|
|
32
|
+
# Notes / unknowns
|
|
33
|
+
|
|
34
|
+
- The existing service entry is at `src/server.ts`; the middleware should plug in there but the wiring change is part of the deliverable.
|
|
35
|
+
- Clock-skew handling: assume monotonic clock from `performance.now()` is acceptable.
|