@oh-my-matrix/autopilot 2.1.1
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 +36 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1034 -0
- package/dist/index.js.map +1 -0
- package/dist/src/audit-persister.d.ts +25 -0
- package/dist/src/audit-persister.d.ts.map +1 -0
- package/dist/src/audit-persister.js +162 -0
- package/dist/src/audit-persister.js.map +1 -0
- package/dist/src/autopilot-state.d.ts +35 -0
- package/dist/src/autopilot-state.d.ts.map +1 -0
- package/dist/src/autopilot-state.js +121 -0
- package/dist/src/autopilot-state.js.map +1 -0
- package/dist/src/command-runner.d.ts +13 -0
- package/dist/src/command-runner.d.ts.map +1 -0
- package/dist/src/command-runner.js +148 -0
- package/dist/src/command-runner.js.map +1 -0
- package/dist/src/completion-detector.d.ts +21 -0
- package/dist/src/completion-detector.d.ts.map +1 -0
- package/dist/src/completion-detector.js +104 -0
- package/dist/src/completion-detector.js.map +1 -0
- package/dist/src/continuation-engine.d.ts +9 -0
- package/dist/src/continuation-engine.d.ts.map +1 -0
- package/dist/src/continuation-engine.js +76 -0
- package/dist/src/continuation-engine.js.map +1 -0
- package/dist/src/effort-injection.d.ts +9 -0
- package/dist/src/effort-injection.d.ts.map +1 -0
- package/dist/src/effort-injection.js +17 -0
- package/dist/src/effort-injection.js.map +1 -0
- package/dist/src/evidence-gate.d.ts +24 -0
- package/dist/src/evidence-gate.d.ts.map +1 -0
- package/dist/src/evidence-gate.js +86 -0
- package/dist/src/evidence-gate.js.map +1 -0
- package/dist/src/goal-manager.d.ts +5 -0
- package/dist/src/goal-manager.d.ts.map +1 -0
- package/dist/src/goal-manager.js +22 -0
- package/dist/src/goal-manager.js.map +1 -0
- package/dist/src/logger.d.ts +27 -0
- package/dist/src/logger.d.ts.map +1 -0
- package/dist/src/logger.js +90 -0
- package/dist/src/logger.js.map +1 -0
- package/dist/src/orchestrator.d.ts +16 -0
- package/dist/src/orchestrator.d.ts.map +1 -0
- package/dist/src/orchestrator.js +252 -0
- package/dist/src/orchestrator.js.map +1 -0
- package/dist/src/permission-policy.d.ts +36 -0
- package/dist/src/permission-policy.d.ts.map +1 -0
- package/dist/src/permission-policy.js +265 -0
- package/dist/src/permission-policy.js.map +1 -0
- package/dist/src/project-detector.d.ts +8 -0
- package/dist/src/project-detector.d.ts.map +1 -0
- package/dist/src/project-detector.js +130 -0
- package/dist/src/project-detector.js.map +1 -0
- package/dist/src/projection.d.ts +47 -0
- package/dist/src/projection.d.ts.map +1 -0
- package/dist/src/projection.js +58 -0
- package/dist/src/projection.js.map +1 -0
- package/dist/src/retry-queue.d.ts +25 -0
- package/dist/src/retry-queue.d.ts.map +1 -0
- package/dist/src/retry-queue.js +77 -0
- package/dist/src/retry-queue.js.map +1 -0
- package/dist/src/stall-detector.d.ts +22 -0
- package/dist/src/stall-detector.d.ts.map +1 -0
- package/dist/src/stall-detector.js +26 -0
- package/dist/src/stall-detector.js.map +1 -0
- package/dist/src/tool-error-tracker.d.ts +4 -0
- package/dist/src/tool-error-tracker.d.ts.map +1 -0
- package/dist/src/tool-error-tracker.js +18 -0
- package/dist/src/tool-error-tracker.js.map +1 -0
- package/dist/src/types.d.ts +223 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +55 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/workflow-config.d.ts +13 -0
- package/dist/src/workflow-config.d.ts.map +1 -0
- package/dist/src/workflow-config.js +422 -0
- package/dist/src/workflow-config.js.map +1 -0
- package/openclaw.plugin.json +62 -0
- package/package.json +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 oh-my-matrix contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @oh-my-matrix/autopilot
|
|
2
|
+
|
|
3
|
+
OpenClaw-native plugin for **continuous, long-running task execution**. Keeps a task
|
|
4
|
+
running across turns and enters explainable states on tool errors, stalls, missing
|
|
5
|
+
evidence, permission denials, or token-budget exhaustion — instead of silently drifting.
|
|
6
|
+
|
|
7
|
+
Part of the [oh-my-matrix](https://github.com/TeFuirnever/oh-my-matrix) runtime stack.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @oh-my-matrix/autopilot
|
|
13
|
+
# peer dependencies
|
|
14
|
+
npm install openclaw@">=2026.5.28" @oh-my-matrix/permission-policy
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Use
|
|
18
|
+
|
|
19
|
+
Registers as an OpenClaw plugin (`openclaw.plugin.json`) with hooks including
|
|
20
|
+
`before_tool_call`, `after_tool_call`, `before_compaction`, `agent_turn_prepare`,
|
|
21
|
+
`before_agent_run`, and `llm_output`. Enable it in your OpenClaw runtime and configure
|
|
22
|
+
behaviour via `WORKFLOW.md` (destructive-git policy, retry, evidence gates).
|
|
23
|
+
|
|
24
|
+
## What it does
|
|
25
|
+
|
|
26
|
+
- **Continuation engine** — resumes long tasks across turns with a retry queue.
|
|
27
|
+
- **Stall / completion detection** — surfaces when a run is stuck or genuinely done.
|
|
28
|
+
- **Evidence gate** — blocks completion until success criteria are verified.
|
|
29
|
+
- **Projection + goal manager** — preserves run state and goal across compaction.
|
|
30
|
+
- **Permission-policy integration** — coordinates the run-scoped policy with
|
|
31
|
+
[`@oh-my-matrix/permission-policy`](../permission-policy).
|
|
32
|
+
|
|
33
|
+
## Status
|
|
34
|
+
|
|
35
|
+
v2.1.1. Tested with `vitest` (500+ tests). See the project
|
|
36
|
+
[changelog](https://github.com/TeFuirnever/oh-my-matrix/blob/master/CHANGELOG.md).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AutopilotState } from './src/types';
|
|
2
|
+
import type { OpenClawPluginApi } from 'openclaw/dist/plugin-sdk/plugin-runtime';
|
|
3
|
+
export declare const id = "autopilot";
|
|
4
|
+
export declare const name = "Autopilot Continuous Mode";
|
|
5
|
+
export declare const version = "2.0.0";
|
|
6
|
+
export declare function _resetForTest(): void;
|
|
7
|
+
/** Test-only: inject a mock audit_setMode so the closed-over _auditSetMode reference is replaceable. */
|
|
8
|
+
export declare function _setAuditSetModeForTest(fn: ((mode: 'active' | 'monitor' | 'passive') => void) | null): void;
|
|
9
|
+
export declare function _getInternalStateForTest(): {
|
|
10
|
+
stateByRunSize: number;
|
|
11
|
+
sessionIdToKeySize: number;
|
|
12
|
+
sessionKeyToRunIdSize: number;
|
|
13
|
+
canaryFiredSize: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Test helper: inject a partial state for a session and immediately run the
|
|
17
|
+
* retry_due check logic, returning the resulting state.
|
|
18
|
+
* Only available in test environments — do NOT call from production code.
|
|
19
|
+
*/
|
|
20
|
+
export declare function _triggerRetryCheckForTest(overrides: {
|
|
21
|
+
sessionKey: string;
|
|
22
|
+
orchestrationState: AutopilotState['orchestrationState'];
|
|
23
|
+
retry?: AutopilotState['retry'];
|
|
24
|
+
}): AutopilotState | undefined;
|
|
25
|
+
/** Generate a unique run ID using crypto.randomUUID (exported for testing). */
|
|
26
|
+
export declare function _generateRunIdForTest(): string;
|
|
27
|
+
export declare function register(api: OpenClawPluginApi): void;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,cAAc,EAA+B,MAAM,aAAa,CAAC;AAC/E,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,yCAAyC,CAAC;AA+BlG,eAAO,MAAM,EAAE,cAAc,CAAC;AAC9B,eAAO,MAAM,IAAI,8BAA8B,CAAC;AAChD,eAAO,MAAM,OAAO,UAAU,CAAC;AAgD/B,wBAAgB,aAAa,IAAI,IAAI,CASpC;AAED,wGAAwG;AACxG,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAK3G;AAED,wBAAgB,wBAAwB;;;;;EAOvC;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAC;IACzD,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CACjC,GAAG,cAAc,GAAG,SAAS,CAiD7B;AAyDD,+EAA+E;AAC/E,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAMD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,iBAAiB,GAAG,IAAI,CAwyBrD"}
|