auto-mode 0.19.0 → 0.19.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/README.md +10 -2
- package/dist/cli.js +60 -590
- package/dist/index.d.ts +4536 -219
- package/dist/index.js +2 -2
- package/dist/{render-verdict-CcVLBFKT.js → render-verdict-aWHhUzvw.js} +1282 -576
- package/mods/auto-mode/contract/types.ts +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -50,7 +50,12 @@ Read [the rules](./policy/rules.md) before you enable the mod.
|
|
|
50
50
|
|
|
51
51
|
## Library
|
|
52
52
|
|
|
53
|
-
You can call auto-mode's core APIs from your own code
|
|
53
|
+
You can call auto-mode's core APIs from your own code. `parseActionRequest` reads the request the
|
|
54
|
+
mod sends the CLI ([the contract](./docs/architecture/mod.md#the-contract)), and `classifyAction`
|
|
55
|
+
runs it through [the stages](./docs/architecture/overview.md#the-path-of-a-prompted-call) from the
|
|
56
|
+
local rules to the judge. The two options in the example apply the denial budget and write the
|
|
57
|
+
action log, as the CLI does, and `recordScope` adds what a finished Bash call created to the
|
|
58
|
+
session's scope.
|
|
54
59
|
|
|
55
60
|
```ts
|
|
56
61
|
import { classifyAction, loadConfig, parseActionRequest } from 'auto-mode';
|
|
@@ -58,7 +63,10 @@ import { classifyAction, loadConfig, parseActionRequest } from 'auto-mode';
|
|
|
58
63
|
const request = parseActionRequest(body);
|
|
59
64
|
|
|
60
65
|
if (request !== null) {
|
|
61
|
-
const outcome = await classifyAction(request, await loadConfig()
|
|
66
|
+
const outcome = await classifyAction(request, await loadConfig(), {
|
|
67
|
+
budget: true,
|
|
68
|
+
actionLog: true,
|
|
69
|
+
});
|
|
62
70
|
}
|
|
63
71
|
```
|
|
64
72
|
|