@bpinternal/overwatch 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 +21 -0
- package/README.md +451 -0
- package/dist/actuators/actuator.d.ts +13 -0
- package/dist/actuators/actuator.js +30 -0
- package/dist/actuators/actuator.js.map +7 -0
- package/dist/actuators/agent-pr.d.ts +25 -0
- package/dist/actuators/agent-pr.js +119 -0
- package/dist/actuators/agent-pr.js.map +7 -0
- package/dist/actuators/comments.d.ts +3 -0
- package/dist/actuators/comments.js +42 -0
- package/dist/actuators/comments.js.map +7 -0
- package/dist/actuators/index.d.ts +54 -0
- package/dist/actuators/index.js +40 -0
- package/dist/actuators/index.js.map +7 -0
- package/dist/actuators/instructions.d.ts +9 -0
- package/dist/actuators/instructions.js +62 -0
- package/dist/actuators/instructions.js.map +7 -0
- package/dist/actuators.d.ts +72 -0
- package/dist/actuators.js +173 -0
- package/dist/actuators.js.map +7 -0
- package/dist/agents.d.ts +53 -0
- package/dist/agents.js +107 -0
- package/dist/agents.js.map +7 -0
- package/dist/claims.d.ts +16 -0
- package/dist/claims.js +51 -0
- package/dist/claims.js.map +7 -0
- package/dist/cli.d.ts +13 -0
- package/dist/cli.js +94 -0
- package/dist/cli.js.map +7 -0
- package/dist/control-loop.d.ts +50 -0
- package/dist/control-loop.js +285 -0
- package/dist/control-loop.js.map +7 -0
- package/dist/github.d.ts +98 -0
- package/dist/github.js +258 -0
- package/dist/github.js.map +7 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +69 -0
- package/dist/index.js.map +7 -0
- package/dist/log.d.ts +22 -0
- package/dist/log.js +87 -0
- package/dist/log.js.map +7 -0
- package/dist/pickers/busiest-file.d.ts +9 -0
- package/dist/pickers/busiest-file.js +48 -0
- package/dist/pickers/busiest-file.js.map +7 -0
- package/dist/pickers/count.d.ts +6 -0
- package/dist/pickers/count.js +29 -0
- package/dist/pickers/count.js.map +7 -0
- package/dist/pickers/index.d.ts +12 -0
- package/dist/pickers/index.js +41 -0
- package/dist/pickers/index.js.map +7 -0
- package/dist/pickers.d.ts +21 -0
- package/dist/pickers.js +61 -0
- package/dist/pickers.js.map +7 -0
- package/dist/repo-handle.d.ts +35 -0
- package/dist/repo-handle.js +75 -0
- package/dist/repo-handle.js.map +7 -0
- package/dist/sandbox.d.ts +33 -0
- package/dist/sandbox.js +91 -0
- package/dist/sandbox.js.map +7 -0
- package/dist/sensors/ast-grep.d.ts +41 -0
- package/dist/sensors/ast-grep.js +65 -0
- package/dist/sensors/ast-grep.js.map +7 -0
- package/dist/sensors/grep.d.ts +31 -0
- package/dist/sensors/grep.js +39 -0
- package/dist/sensors/grep.js.map +7 -0
- package/dist/sensors/index.d.ts +27 -0
- package/dist/sensors/index.js +38 -0
- package/dist/sensors/index.js.map +7 -0
- package/dist/sensors/react-doctor.d.ts +43 -0
- package/dist/sensors/react-doctor.js +71 -0
- package/dist/sensors/react-doctor.js.map +7 -0
- package/dist/sensors/script.d.ts +7 -0
- package/dist/sensors/script.js +32 -0
- package/dist/sensors/script.js.map +7 -0
- package/dist/sensors.d.ts +117 -0
- package/dist/sensors.js +126 -0
- package/dist/sensors.js.map +7 -0
- package/dist/types.d.ts +119 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +7 -0
- package/package.json +64 -0
package/dist/types.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
17
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Agent } from \"./agents\";\nimport type { Actuator, CommentActuator } from \"./actuators\";\nimport type { Sensor } from \"./sensors\";\nimport type { Picker } from \"./pickers\";\nimport type { GitSource, PrComment } from \"./github\";\n\nexport type SignalPriority = \"low\" | \"medium\" | \"high\";\n\n/**\n * An anomaly detected by the sensor.\n *\n * Identity note: after a fix, line numbers shift, so a signal is considered \"the same\"\n * across sensor runs when its `location.file` and `message` match \u2014 `location.line` is\n * informational only. Keep `message` stable for a given anomaly (don't embed line numbers\n * or timestamps in it).\n */\nexport interface Signal<TData = unknown> {\n /**\n * Where the anomaly lives. Optional \u2014 some anomalies are repo-wide or not tied to a\n * single place. When present, `file` anchors the signal's identity (see note above).\n */\n location?: { file: string; line?: number };\n message: string;\n /** Optional; treated as unset (rather than a default) wherever no priority is given. */\n priority?: SignalPriority;\n /**\n * Anything the sensor wants to carry through to the picker and actuator untouched.\n * `TData` is inferred from the sensor, so an actuator paired with it sees this exact\n * type on `signal.data` (see {@link ControlLoopOptions}).\n */\n data?: TData;\n}\n\n/**\n * Constructor argument of ControlLoop: identity and static settings, behavior alongside them.\n *\n * `TData` is inferred from the `sensor` and flows to the `picker` and `actuator`, so the\n * `data` a sensor attaches to its signals reaches the actuator with the same static type.\n */\nexport interface ControlLoopOptions<TData = unknown> {\n /**\n * Human-readable name of the loop. Its slug (e.g. \"My Loop\" -> \"my-loop\") is applied\n * as a label on every PR the loop opens, and is what `config.maxOpenPrCount` counts\n * against.\n */\n label: string;\n config: ControlLoopConfig;\n sensor: Sensor<TData>;\n /** Defaults to `pickers.count(1)`. */\n picker?: Picker<TData>;\n actuator: Actuator<TData>;\n /** Customizes the instructions built from PR comments in `applyPrComments`. */\n commentActuator?: CommentActuator;\n}\n\nexport interface ControlLoopConfig {\n /** Skip the run entirely if this many PRs with the loop's label are already open. */\n maxOpenPrCount?: number;\n /**\n * Prefix of the branches the loop pushes, e.g. \"bots/cleanup\" ->\n * \"bots/cleanup/<label-slug>-<run-id>\". Default \"control-loop\".\n */\n branchPrefix?: string;\n git: GitSource;\n agent: Agent;\n /** Shell commands the loop runs inside the sandbox, all from the repo root. */\n hooks?: {\n /**\n * Run right after cloning, before the sensor and agent (e.g. \"bun install\" to set\n * up dependencies). The run aborts if it exits non-zero.\n */\n setup?: string;\n /**\n * Run after the agent finishes and before committing \u2014 typically the repo's\n * auto-fix formatter (e.g. \"bun run fix:format\"). It normalizes everything the\n * loop commits (agent edits and lib-generated files alike) so the PR passes repo\n * formatting checks. The run aborts if it exits non-zero.\n */\n preCommit?: string;\n };\n /** Environment variables set on the sandbox at creation. */\n env?: Record<string, string>;\n /** Max agent attempts per signal before the run is declared failed. Default 3. */\n maxFixAttempts?: number;\n sandbox?: {\n /**\n * Daytona snapshot to create the sandbox from. Pre-bake your toolchain and the\n * agent's CLI into it to skip per-run installs. Defaults to Daytona's typescript\n * sandbox, with the agent CLI installed at run start.\n */\n snapshot?: string;\n };\n}\n\nexport type ControlLoopRunResult<TData = unknown> =\n | { status: \"skipped\"; reason: string }\n | { status: \"clean\" }\n | { status: \"fix-failed\"; unresolved: Signal<TData>[] }\n | { status: \"pr-opened\"; prUrl: string; fixed: Signal<TData>[] };\n\nexport type ApplyCommentsResult =\n /** Every comment predates the PR's head commit \u2014 nothing new to address. */\n | { status: \"no-new-comments\" }\n /** The agent ran but left the working tree untouched, so nothing was pushed. */\n | { status: \"no-changes\"; comments: PrComment[] }\n | { status: \"comments-applied\"; branch: string; comments: PrComment[] };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bpinternal/overwatch",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Headless library for building control loops: scheduled bots that scan a repo for a class of anomaly, fix a few instances with a coding agent, and open a PR — no server, UI, or persistent process.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"control-loop",
|
|
7
|
+
"coding-agent",
|
|
8
|
+
"automation",
|
|
9
|
+
"codemod",
|
|
10
|
+
"github",
|
|
11
|
+
"pull-request",
|
|
12
|
+
"ci",
|
|
13
|
+
"daytona",
|
|
14
|
+
"claude",
|
|
15
|
+
"codex"
|
|
16
|
+
],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"homepage": "https://github.com/botpress/overwatch#readme",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/botpress/overwatch.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/botpress/overwatch/issues"
|
|
25
|
+
},
|
|
26
|
+
"main": "dist/index.js",
|
|
27
|
+
"types": "dist/index.d.ts",
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"packageManager": "pnpm@10.29.3",
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18",
|
|
35
|
+
"pnpm": ">=9"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "pnpm run build:types && pnpm run bundle",
|
|
39
|
+
"build:types": "tsc -p ./tsconfig.build.json",
|
|
40
|
+
"bundle": "ts-node -T build.ts",
|
|
41
|
+
"check:type": "tsc --noEmit",
|
|
42
|
+
"test": "vitest --run",
|
|
43
|
+
"prepublishOnly": "pnpm run check:type && pnpm run build"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^22.9.0",
|
|
50
|
+
"esbuild": "^0.25.10",
|
|
51
|
+
"glob": "^9.3.4",
|
|
52
|
+
"ts-node": "^10.9.2",
|
|
53
|
+
"typescript": "^5.6.3",
|
|
54
|
+
"vitest": "^2.1.4"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"typescript": "^5"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@daytona/sdk": "^0.195.0",
|
|
61
|
+
"commander": "^15.0.0",
|
|
62
|
+
"octokit": "^5.0.5"
|
|
63
|
+
}
|
|
64
|
+
}
|