@openagentsy/hooks 0.0.0-stage → 0.2.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 +674 -0
- package/README.md +32 -2
- package/dist/accountability.d.ts +29 -0
- package/dist/accountability.d.ts.map +1 -0
- package/dist/accountability.js +21 -0
- package/dist/accountability.js.map +1 -0
- package/dist/accountability.test.d.ts +2 -0
- package/dist/accountability.test.d.ts.map +1 -0
- package/dist/accountability.test.js +42 -0
- package/dist/accountability.test.js.map +1 -0
- package/dist/approvals.d.ts +110 -0
- package/dist/approvals.d.ts.map +1 -0
- package/dist/approvals.js +464 -0
- package/dist/approvals.js.map +1 -0
- package/dist/approvals.test.d.ts +2 -0
- package/dist/approvals.test.d.ts.map +1 -0
- package/dist/approvals.test.js +307 -0
- package/dist/approvals.test.js.map +1 -0
- package/dist/base-tool.d.ts +26 -0
- package/dist/base-tool.d.ts.map +1 -0
- package/dist/base-tool.js +37 -0
- package/dist/base-tool.js.map +1 -0
- package/dist/base-tool.test.d.ts +2 -0
- package/dist/base-tool.test.d.ts.map +1 -0
- package/dist/base-tool.test.js +34 -0
- package/dist/base-tool.test.js.map +1 -0
- package/dist/eval/index.d.ts +3 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +3 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/eval/runner.d.ts +179 -0
- package/dist/eval/runner.d.ts.map +1 -0
- package/dist/eval/runner.js +616 -0
- package/dist/eval/runner.js.map +1 -0
- package/dist/eval/runner.test.d.ts +2 -0
- package/dist/eval/runner.test.d.ts.map +1 -0
- package/dist/eval/runner.test.js +431 -0
- package/dist/eval/runner.test.js.map +1 -0
- package/dist/eval/types.d.ts +173 -0
- package/dist/eval/types.d.ts.map +1 -0
- package/dist/eval/types.js +104 -0
- package/dist/eval/types.js.map +1 -0
- package/dist/event.d.ts +59 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/event.js +178 -0
- package/dist/event.js.map +1 -0
- package/dist/event.test.d.ts +2 -0
- package/dist/event.test.d.ts.map +1 -0
- package/dist/event.test.js +49 -0
- package/dist/event.test.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/lessons/capture.d.ts +66 -0
- package/dist/lessons/capture.d.ts.map +1 -0
- package/dist/lessons/capture.js +166 -0
- package/dist/lessons/capture.js.map +1 -0
- package/dist/lessons/capture.test.d.ts +2 -0
- package/dist/lessons/capture.test.d.ts.map +1 -0
- package/dist/lessons/capture.test.js +200 -0
- package/dist/lessons/capture.test.js.map +1 -0
- package/dist/lessons/decide.d.ts +90 -0
- package/dist/lessons/decide.d.ts.map +1 -0
- package/dist/lessons/decide.js +334 -0
- package/dist/lessons/decide.js.map +1 -0
- package/dist/lessons/decide.test.d.ts +2 -0
- package/dist/lessons/decide.test.d.ts.map +1 -0
- package/dist/lessons/decide.test.js +527 -0
- package/dist/lessons/decide.test.js.map +1 -0
- package/dist/lessons/id.d.ts +5 -0
- package/dist/lessons/id.d.ts.map +1 -0
- package/dist/lessons/id.js +20 -0
- package/dist/lessons/id.js.map +1 -0
- package/dist/lessons/index.d.ts +5 -0
- package/dist/lessons/index.d.ts.map +1 -0
- package/dist/lessons/index.js +5 -0
- package/dist/lessons/index.js.map +1 -0
- package/dist/lessons/model.d.ts +163 -0
- package/dist/lessons/model.d.ts.map +1 -0
- package/dist/lessons/model.js +181 -0
- package/dist/lessons/model.js.map +1 -0
- package/dist/lessons/model.test.d.ts +2 -0
- package/dist/lessons/model.test.d.ts.map +1 -0
- package/dist/lessons/model.test.js +178 -0
- package/dist/lessons/model.test.js.map +1 -0
- package/dist/lessons/permissions.test.d.ts +2 -0
- package/dist/lessons/permissions.test.d.ts.map +1 -0
- package/dist/lessons/permissions.test.js +88 -0
- package/dist/lessons/permissions.test.js.map +1 -0
- package/dist/lessons/store.d.ts +74 -0
- package/dist/lessons/store.d.ts.map +1 -0
- package/dist/lessons/store.js +231 -0
- package/dist/lessons/store.js.map +1 -0
- package/dist/output-checks.d.ts +64 -0
- package/dist/output-checks.d.ts.map +1 -0
- package/dist/output-checks.js +248 -0
- package/dist/output-checks.js.map +1 -0
- package/dist/output-checks.test.d.ts +2 -0
- package/dist/output-checks.test.d.ts.map +1 -0
- package/dist/output-checks.test.js +58 -0
- package/dist/output-checks.test.js.map +1 -0
- package/dist/paths.d.ts +37 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +70 -0
- package/dist/paths.js.map +1 -0
- package/dist/paths.test.d.ts +2 -0
- package/dist/paths.test.d.ts.map +1 -0
- package/dist/paths.test.js +36 -0
- package/dist/paths.test.js.map +1 -0
- package/dist/policies/agi-framing.d.ts +12 -0
- package/dist/policies/agi-framing.d.ts.map +1 -0
- package/dist/policies/agi-framing.js +33 -0
- package/dist/policies/agi-framing.js.map +1 -0
- package/dist/policies/anti-anthropomorphism.d.ts +13 -0
- package/dist/policies/anti-anthropomorphism.d.ts.map +1 -0
- package/dist/policies/anti-anthropomorphism.js +34 -0
- package/dist/policies/anti-anthropomorphism.js.map +1 -0
- package/dist/policies/anti-dependence.d.ts +12 -0
- package/dist/policies/anti-dependence.d.ts.map +1 -0
- package/dist/policies/anti-dependence.js +33 -0
- package/dist/policies/anti-dependence.js.map +1 -0
- package/dist/policies/anti-sycophancy.d.ts +13 -0
- package/dist/policies/anti-sycophancy.d.ts.map +1 -0
- package/dist/policies/anti-sycophancy.js +34 -0
- package/dist/policies/anti-sycophancy.js.map +1 -0
- package/dist/policies/dark-pattern.d.ts +14 -0
- package/dist/policies/dark-pattern.d.ts.map +1 -0
- package/dist/policies/dark-pattern.js +44 -0
- package/dist/policies/dark-pattern.js.map +1 -0
- package/dist/policies/destructive-needs-approval.d.ts +14 -0
- package/dist/policies/destructive-needs-approval.d.ts.map +1 -0
- package/dist/policies/destructive-needs-approval.js +31 -0
- package/dist/policies/destructive-needs-approval.js.map +1 -0
- package/dist/policies/discovery.d.ts +12 -0
- package/dist/policies/discovery.d.ts.map +1 -0
- package/dist/policies/discovery.js +130 -0
- package/dist/policies/discovery.js.map +1 -0
- package/dist/policies/high-risk.d.ts +25 -0
- package/dist/policies/high-risk.d.ts.map +1 -0
- package/dist/policies/high-risk.js +105 -0
- package/dist/policies/high-risk.js.map +1 -0
- package/dist/policies/human-only-decisions.d.ts +14 -0
- package/dist/policies/human-only-decisions.d.ts.map +1 -0
- package/dist/policies/human-only-decisions.js +33 -0
- package/dist/policies/human-only-decisions.js.map +1 -0
- package/dist/policies/index.d.ts +29 -0
- package/dist/policies/index.d.ts.map +1 -0
- package/dist/policies/index.js +82 -0
- package/dist/policies/index.js.map +1 -0
- package/dist/policies/no-skip-git-hooks.d.ts +14 -0
- package/dist/policies/no-skip-git-hooks.d.ts.map +1 -0
- package/dist/policies/no-skip-git-hooks.js +31 -0
- package/dist/policies/no-skip-git-hooks.js.map +1 -0
- package/dist/policies/package-manager.d.ts +12 -0
- package/dist/policies/package-manager.d.ts.map +1 -0
- package/dist/policies/package-manager.js +29 -0
- package/dist/policies/package-manager.js.map +1 -0
- package/dist/policies/patterns.d.ts +17 -0
- package/dist/policies/patterns.d.ts.map +1 -0
- package/dist/policies/patterns.js +30 -0
- package/dist/policies/patterns.js.map +1 -0
- package/dist/policies/policies.test.d.ts +2 -0
- package/dist/policies/policies.test.d.ts.map +1 -0
- package/dist/policies/policies.test.js +210 -0
- package/dist/policies/policies.test.js.map +1 -0
- package/dist/policies/privacy-transparency.d.ts +14 -0
- package/dist/policies/privacy-transparency.d.ts.map +1 -0
- package/dist/policies/privacy-transparency.js +50 -0
- package/dist/policies/privacy-transparency.js.map +1 -0
- package/dist/policies/professional-displacement.d.ts +15 -0
- package/dist/policies/professional-displacement.d.ts.map +1 -0
- package/dist/policies/professional-displacement.js +45 -0
- package/dist/policies/professional-displacement.js.map +1 -0
- package/dist/policies/protect-policy.d.ts +14 -0
- package/dist/policies/protect-policy.d.ts.map +1 -0
- package/dist/policies/protect-policy.js +35 -0
- package/dist/policies/protect-policy.js.map +1 -0
- package/dist/policies/scope-enforcement.d.ts +14 -0
- package/dist/policies/scope-enforcement.d.ts.map +1 -0
- package/dist/policies/scope-enforcement.js +34 -0
- package/dist/policies/scope-enforcement.js.map +1 -0
- package/dist/policies/secret-scan-writes.d.ts +13 -0
- package/dist/policies/secret-scan-writes.d.ts.map +1 -0
- package/dist/policies/secret-scan-writes.js +38 -0
- package/dist/policies/secret-scan-writes.js.map +1 -0
- package/dist/policies/selection.d.ts +20 -0
- package/dist/policies/selection.d.ts.map +1 -0
- package/dist/policies/selection.js +93 -0
- package/dist/policies/selection.js.map +1 -0
- package/dist/policies/structural-bias.d.ts +14 -0
- package/dist/policies/structural-bias.d.ts.map +1 -0
- package/dist/policies/structural-bias.js +41 -0
- package/dist/policies/structural-bias.js.map +1 -0
- package/dist/policies/third-party-impact.d.ts +13 -0
- package/dist/policies/third-party-impact.d.ts.map +1 -0
- package/dist/policies/third-party-impact.js +38 -0
- package/dist/policies/third-party-impact.js.map +1 -0
- package/dist/policies/tool-call.d.ts +38 -0
- package/dist/policies/tool-call.d.ts.map +1 -0
- package/dist/policies/tool-call.js +53 -0
- package/dist/policies/tool-call.js.map +1 -0
- package/dist/policies/truthfulness-uncertainty.d.ts +13 -0
- package/dist/policies/truthfulness-uncertainty.d.ts.map +1 -0
- package/dist/policies/truthfulness-uncertainty.js +45 -0
- package/dist/policies/truthfulness-uncertainty.js.map +1 -0
- package/dist/policies/workspace-writes-only.d.ts +25 -0
- package/dist/policies/workspace-writes-only.d.ts.map +1 -0
- package/dist/policies/workspace-writes-only.js +54 -0
- package/dist/policies/workspace-writes-only.js.map +1 -0
- package/dist/policy-engine.d.ts +69 -0
- package/dist/policy-engine.d.ts.map +1 -0
- package/dist/policy-engine.js +145 -0
- package/dist/policy-engine.js.map +1 -0
- package/dist/policy-registry.d.ts +62 -0
- package/dist/policy-registry.d.ts.map +1 -0
- package/dist/policy-registry.js +63 -0
- package/dist/policy-registry.js.map +1 -0
- package/dist/policy-registry.test.d.ts +2 -0
- package/dist/policy-registry.test.d.ts.map +1 -0
- package/dist/policy-registry.test.js +79 -0
- package/dist/policy-registry.test.js.map +1 -0
- package/dist/policy-release.d.ts +44 -0
- package/dist/policy-release.d.ts.map +1 -0
- package/dist/policy-release.js +65 -0
- package/dist/policy-release.js.map +1 -0
- package/dist/policy.d.ts +141 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +22 -0
- package/dist/policy.js.map +1 -0
- package/dist/quality/audit.d.ts +56 -0
- package/dist/quality/audit.d.ts.map +1 -0
- package/dist/quality/audit.js +52 -0
- package/dist/quality/audit.js.map +1 -0
- package/dist/quality/findings.d.ts +34 -0
- package/dist/quality/findings.d.ts.map +1 -0
- package/dist/quality/findings.js +121 -0
- package/dist/quality/findings.js.map +1 -0
- package/dist/quality/findings.test.d.ts +2 -0
- package/dist/quality/findings.test.d.ts.map +1 -0
- package/dist/quality/findings.test.js +79 -0
- package/dist/quality/findings.test.js.map +1 -0
- package/dist/quality/index.d.ts +20 -0
- package/dist/quality/index.d.ts.map +1 -0
- package/dist/quality/index.js +20 -0
- package/dist/quality/index.js.map +1 -0
- package/dist/quality/rule.d.ts +43 -0
- package/dist/quality/rule.d.ts.map +1 -0
- package/dist/quality/rule.js +162 -0
- package/dist/quality/rule.js.map +1 -0
- package/dist/quality/rule.test.d.ts +2 -0
- package/dist/quality/rule.test.d.ts.map +1 -0
- package/dist/quality/rule.test.js +187 -0
- package/dist/quality/rule.test.js.map +1 -0
- package/dist/quality/tools.d.ts +30 -0
- package/dist/quality/tools.d.ts.map +1 -0
- package/dist/quality/tools.js +33 -0
- package/dist/quality/tools.js.map +1 -0
- package/dist/quality/tools.test.d.ts +2 -0
- package/dist/quality/tools.test.d.ts.map +1 -0
- package/dist/quality/tools.test.js +41 -0
- package/dist/quality/tools.test.js.map +1 -0
- package/dist/quality/waive.d.ts +37 -0
- package/dist/quality/waive.d.ts.map +1 -0
- package/dist/quality/waive.js +39 -0
- package/dist/quality/waive.js.map +1 -0
- package/dist/quality/waivers.d.ts +63 -0
- package/dist/quality/waivers.d.ts.map +1 -0
- package/dist/quality/waivers.js +132 -0
- package/dist/quality/waivers.js.map +1 -0
- package/dist/quality/waivers.test.d.ts +2 -0
- package/dist/quality/waivers.test.d.ts.map +1 -0
- package/dist/quality/waivers.test.js +138 -0
- package/dist/quality/waivers.test.js.map +1 -0
- package/dist/registry.d.ts +86 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +92 -0
- package/dist/registry.js.map +1 -0
- package/dist/registry.test.d.ts +2 -0
- package/dist/registry.test.d.ts.map +1 -0
- package/dist/registry.test.js +117 -0
- package/dist/registry.test.js.map +1 -0
- package/dist/rules.d.ts +107 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +632 -0
- package/dist/rules.js.map +1 -0
- package/dist/rules.test.d.ts +2 -0
- package/dist/rules.test.d.ts.map +1 -0
- package/dist/rules.test.js +488 -0
- package/dist/rules.test.js.map +1 -0
- package/dist/secrets.d.ts +17 -0
- package/dist/secrets.d.ts.map +1 -0
- package/dist/secrets.js +17 -0
- package/dist/secrets.js.map +1 -0
- package/dist/secrets.test.d.ts +2 -0
- package/dist/secrets.test.d.ts.map +1 -0
- package/dist/secrets.test.js +20 -0
- package/dist/secrets.test.js.map +1 -0
- package/dist/shell-env.d.ts +23 -0
- package/dist/shell-env.d.ts.map +1 -0
- package/dist/shell-env.js +34 -0
- package/dist/shell-env.js.map +1 -0
- package/dist/shell-env.test.d.ts +2 -0
- package/dist/shell-env.test.d.ts.map +1 -0
- package/dist/shell-env.test.js +45 -0
- package/dist/shell-env.test.js.map +1 -0
- package/package.json +49 -4
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The eval artifacts: the executable proof that a lesson is real.
|
|
4
|
+
*
|
|
5
|
+
* An artifact is a list of scenarios. A baseline scenario says what the
|
|
6
|
+
* behaviour is today, and a candidate scenario says what it should be. The
|
|
7
|
+
* runner executes them and writes a result that holds the verdicts and never
|
|
8
|
+
* the output, so a result can be kept without keeping what the run printed.
|
|
9
|
+
*/
|
|
10
|
+
/** The longest a scenario may run, in milliseconds. */
|
|
11
|
+
export const MAX_TIMEOUT_MS = 300_000;
|
|
12
|
+
/** The timeout a scenario gets when it names none. */
|
|
13
|
+
export const DEFAULT_TIMEOUT_MS = 30_000;
|
|
14
|
+
/** The most scenarios an artifact may hold. */
|
|
15
|
+
export const MAX_SCENARIOS = 20;
|
|
16
|
+
/**
|
|
17
|
+
* What a scenario asserts about the run.
|
|
18
|
+
*
|
|
19
|
+
* Every field is optional, and a field that is absent is not asserted: a
|
|
20
|
+
* scenario that only names an exit code does not care what was printed.
|
|
21
|
+
*/
|
|
22
|
+
export const EvalExpectation = z.object({
|
|
23
|
+
exit_code: z.number().int().optional(),
|
|
24
|
+
stdout_includes: z.array(z.string()).optional(),
|
|
25
|
+
stdout_excludes: z.array(z.string()).optional(),
|
|
26
|
+
stderr_includes: z.array(z.string()).optional(),
|
|
27
|
+
stderr_excludes: z.array(z.string()).optional(),
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* One scenario: a command, a place to run it, and what it must show.
|
|
31
|
+
*
|
|
32
|
+
* The command is an argv, never a shell string. The schema says so by
|
|
33
|
+
* holding an array, and the runner says it again before it spawns, because a
|
|
34
|
+
* shell string is the one shape that turns a proof into an injection.
|
|
35
|
+
*/
|
|
36
|
+
export const EvalScenario = z.object({
|
|
37
|
+
id: z.string().min(1),
|
|
38
|
+
phase: z.enum(['baseline', 'candidate']),
|
|
39
|
+
cwd: z.string().min(1),
|
|
40
|
+
command: z.array(z.string()).min(1),
|
|
41
|
+
timeout_ms: z.number().int().max(MAX_TIMEOUT_MS).default(DEFAULT_TIMEOUT_MS),
|
|
42
|
+
expect: EvalExpectation,
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* The artifact.
|
|
46
|
+
*
|
|
47
|
+
* It needs at least one candidate scenario, because an artifact that only
|
|
48
|
+
* shows the current behaviour proves nothing, and the scenario ids have to be
|
|
49
|
+
* unique, because a result names its scenarios by id.
|
|
50
|
+
*/
|
|
51
|
+
export const EvalArtifact = z.object({
|
|
52
|
+
schema_version: z.literal('1'),
|
|
53
|
+
lesson_id: z.string().min(1),
|
|
54
|
+
name: z.string().min(1),
|
|
55
|
+
scenarios: z
|
|
56
|
+
.array(EvalScenario)
|
|
57
|
+
.min(1)
|
|
58
|
+
.max(MAX_SCENARIOS)
|
|
59
|
+
.refine((scenarios) => scenarios.some((scenario) => scenario.phase === 'candidate'), {
|
|
60
|
+
message: 'needs a candidate scenario',
|
|
61
|
+
})
|
|
62
|
+
.refine((scenarios) => new Set(scenarios.map((scenario) => scenario.id)).size === scenarios.length, { message: 'scenario ids must be unique' }),
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* The shape of a result, for a result that came from somewhere else.
|
|
66
|
+
*
|
|
67
|
+
* The runner builds its own results, so the type is enough for it. A result
|
|
68
|
+
* that arrives from a person or from a file has to be checked, because a
|
|
69
|
+
* result that is not one is not a proof.
|
|
70
|
+
*/
|
|
71
|
+
export const EvalResultShape = z.object({
|
|
72
|
+
schema_version: z.literal('1'),
|
|
73
|
+
lesson_id: z.string().min(1),
|
|
74
|
+
artifact_sha256: z.string().min(1),
|
|
75
|
+
started_at: z.string().min(1),
|
|
76
|
+
finished_at: z.string().min(1),
|
|
77
|
+
passed: z.boolean(),
|
|
78
|
+
runs: z.number().int().min(1),
|
|
79
|
+
scenarios: z.array(z.object({
|
|
80
|
+
id: z.string().min(1),
|
|
81
|
+
phase: z.enum(['baseline', 'candidate']),
|
|
82
|
+
command_sha256: z.string().min(1),
|
|
83
|
+
exit_code: z.number().int().nullable(),
|
|
84
|
+
timed_out: z.boolean(),
|
|
85
|
+
duration_ms: z.number().int(),
|
|
86
|
+
assertions: z.record(z.string(), z.boolean()),
|
|
87
|
+
passed: z.boolean(),
|
|
88
|
+
})),
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* The error the proof raises.
|
|
92
|
+
*
|
|
93
|
+
* It carries a hint, like every other error in this repository: the message
|
|
94
|
+
* says what happened, the hint says what to do next.
|
|
95
|
+
*/
|
|
96
|
+
export class ProofError extends Error {
|
|
97
|
+
hint;
|
|
98
|
+
constructor(message, hint) {
|
|
99
|
+
super(message);
|
|
100
|
+
this.name = 'ProofError';
|
|
101
|
+
this.hint = hint;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/eval/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC,sDAAsD;AACtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC,+CAA+C;AAC/C,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC/C,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC/C,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC/C,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,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C,GAAG,EAAE;QAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QAC7C,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;KACpB,CAAC,CACH;CACF,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IAC1B,IAAI,CAAS;IAEtB,YAAY,OAAe,EAAE,IAAY;QACvC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
|
package/dist/event.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The event a tool call arrives as.
|
|
3
|
+
*
|
|
4
|
+
* The host hands a tool call over in its own shape: the tool name, the
|
|
5
|
+
* arguments, and the files the call touches are somewhere in the arguments.
|
|
6
|
+
* The rules are written against this shape instead, so a rule reads the
|
|
7
|
+
* same field whichever host called.
|
|
8
|
+
*/
|
|
9
|
+
/** A file a call touches. */
|
|
10
|
+
export interface FileRef {
|
|
11
|
+
/** The path the call writes to, when it names one. */
|
|
12
|
+
path?: string;
|
|
13
|
+
/** The path the call moves from, when it names one. */
|
|
14
|
+
fromPath?: string;
|
|
15
|
+
}
|
|
16
|
+
/** The event a tool call arrives as. */
|
|
17
|
+
export interface PreToolCallEvent {
|
|
18
|
+
/** The base name of the tool: `write`, `bash`, `oa_task_list`. */
|
|
19
|
+
toolName: string;
|
|
20
|
+
/** The arguments the call was made with. */
|
|
21
|
+
args: Record<string, unknown>;
|
|
22
|
+
/** The files the call touches. */
|
|
23
|
+
files: FileRef[];
|
|
24
|
+
/** The command, for a shell call. */
|
|
25
|
+
command?: string;
|
|
26
|
+
/** The call id, for the approval gate. */
|
|
27
|
+
callID?: string;
|
|
28
|
+
/** The role the call is made for. */
|
|
29
|
+
role?: string;
|
|
30
|
+
/** The session the call is made in. */
|
|
31
|
+
sessionID?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Whether a tool only reads.
|
|
35
|
+
*
|
|
36
|
+
* A reader names a file as well, and a read of a policy file has to stay
|
|
37
|
+
* possible, so the write rules are about the tools that are not readers.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isReaderTool(toolName: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether a tool writes a file.
|
|
42
|
+
*
|
|
43
|
+
* The name is read on its token boundaries, in either direction: the
|
|
44
|
+
* built-in names (write, edit, multi_edit, patch, apply_patch) and the
|
|
45
|
+
* names a host composes (write_file, create_file) are the same thing.
|
|
46
|
+
*/
|
|
47
|
+
export declare function isWritingTool(toolName: string): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The event, when it is a tool call.
|
|
50
|
+
*
|
|
51
|
+
* The host hands the raw arguments over, and the rules read the normalised
|
|
52
|
+
* fields. So the normalisation happens here: a command that is named in the
|
|
53
|
+
* arguments is the command, and a file that is named in the arguments is
|
|
54
|
+
* the file the call touches. A host that already normalises (the adapter
|
|
55
|
+
* does) is not contradicted: the files it supplies are kept, and the
|
|
56
|
+
* arguments are the fallback.
|
|
57
|
+
*/
|
|
58
|
+
export declare function readPreToolCall(event: unknown): PreToolCallEvent | undefined;
|
|
59
|
+
//# sourceMappingURL=event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,6BAA6B;AAC7B,MAAM,WAAW,OAAO;IACtB,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wCAAwC;AACxC,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,kCAAkC;IAClC,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8DD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGtD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAYvD;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,GAAG,SAAS,CAmB5E"}
|
package/dist/event.js
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The event a tool call arrives as.
|
|
3
|
+
*
|
|
4
|
+
* The host hands a tool call over in its own shape: the tool name, the
|
|
5
|
+
* arguments, and the files the call touches are somewhere in the arguments.
|
|
6
|
+
* The rules are written against this shape instead, so a rule reads the
|
|
7
|
+
* same field whichever host called.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The argument names a write tool names its file with.
|
|
11
|
+
*
|
|
12
|
+
* The names are the ones the host uses: `filePath` is OpenCode's, `path`
|
|
13
|
+
* and `file` are the ones other tools use.
|
|
14
|
+
*/
|
|
15
|
+
const PATH_ARGS = ['filePath', 'file_path', 'path', 'file'];
|
|
16
|
+
/**
|
|
17
|
+
* The tools that write, by their exact name.
|
|
18
|
+
*/
|
|
19
|
+
const WRITING_TOOLS = ['write', 'edit', 'multi_edit', 'patch', 'apply_patch'];
|
|
20
|
+
/**
|
|
21
|
+
* The verbs that say a tool writes, on their own.
|
|
22
|
+
*/
|
|
23
|
+
const WRITING_VERBS_ALWAYS = ['move', 'delete', 'rename'];
|
|
24
|
+
/**
|
|
25
|
+
* The verbs that say a tool writes a file.
|
|
26
|
+
*/
|
|
27
|
+
const WRITING_VERBS = [
|
|
28
|
+
'write',
|
|
29
|
+
'edit',
|
|
30
|
+
'patch',
|
|
31
|
+
'create',
|
|
32
|
+
'update',
|
|
33
|
+
'remove',
|
|
34
|
+
'copy',
|
|
35
|
+
'upload',
|
|
36
|
+
'save',
|
|
37
|
+
'push',
|
|
38
|
+
'truncate',
|
|
39
|
+
'replace',
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* The nouns that say a tool touches a file.
|
|
43
|
+
*/
|
|
44
|
+
const FILE_NOUNS = ['file', 'files', 'directory', 'dir'];
|
|
45
|
+
/**
|
|
46
|
+
* The tools that only read.
|
|
47
|
+
*/
|
|
48
|
+
const READER_TOOLS = [
|
|
49
|
+
'read',
|
|
50
|
+
'grep',
|
|
51
|
+
'glob',
|
|
52
|
+
'list',
|
|
53
|
+
'ls',
|
|
54
|
+
'search',
|
|
55
|
+
'find',
|
|
56
|
+
'cat',
|
|
57
|
+
'view',
|
|
58
|
+
'open',
|
|
59
|
+
'fetch',
|
|
60
|
+
'webfetch',
|
|
61
|
+
'websearch',
|
|
62
|
+
];
|
|
63
|
+
/**
|
|
64
|
+
* Whether a tool only reads.
|
|
65
|
+
*
|
|
66
|
+
* A reader names a file as well, and a read of a policy file has to stay
|
|
67
|
+
* possible, so the write rules are about the tools that are not readers.
|
|
68
|
+
*/
|
|
69
|
+
export function isReaderTool(toolName) {
|
|
70
|
+
const lower = toolName.toLowerCase();
|
|
71
|
+
return READER_TOOLS.some((tool) => lower === tool || lower.endsWith(`_${tool}`));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Whether a tool writes a file.
|
|
75
|
+
*
|
|
76
|
+
* The name is read on its token boundaries, in either direction: the
|
|
77
|
+
* built-in names (write, edit, multi_edit, patch, apply_patch) and the
|
|
78
|
+
* names a host composes (write_file, create_file) are the same thing.
|
|
79
|
+
*/
|
|
80
|
+
export function isWritingTool(toolName) {
|
|
81
|
+
const lower = toolName.toLowerCase();
|
|
82
|
+
if (WRITING_TOOLS.some((tool) => lower === tool || lower.endsWith(`_${tool}`)))
|
|
83
|
+
return true;
|
|
84
|
+
const tokens = toolName
|
|
85
|
+
.split(/[^A-Za-z0-9]+|(?=[a-z0-9][A-Z])/)
|
|
86
|
+
.filter((token) => token.length > 0)
|
|
87
|
+
.map((token) => token.toLowerCase());
|
|
88
|
+
if (WRITING_TOOLS.includes(tokens.join('_')))
|
|
89
|
+
return true;
|
|
90
|
+
if (tokens.some((token) => WRITING_VERBS_ALWAYS.includes(token)))
|
|
91
|
+
return true;
|
|
92
|
+
const verb = tokens.some((token) => WRITING_VERBS.includes(token));
|
|
93
|
+
const noun = tokens.some((token) => FILE_NOUNS.includes(token));
|
|
94
|
+
return verb && noun;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The event, when it is a tool call.
|
|
98
|
+
*
|
|
99
|
+
* The host hands the raw arguments over, and the rules read the normalised
|
|
100
|
+
* fields. So the normalisation happens here: a command that is named in the
|
|
101
|
+
* arguments is the command, and a file that is named in the arguments is
|
|
102
|
+
* the file the call touches. A host that already normalises (the adapter
|
|
103
|
+
* does) is not contradicted: the files it supplies are kept, and the
|
|
104
|
+
* arguments are the fallback.
|
|
105
|
+
*/
|
|
106
|
+
export function readPreToolCall(event) {
|
|
107
|
+
if (typeof event !== 'object' || event === null)
|
|
108
|
+
return undefined;
|
|
109
|
+
const candidate = event;
|
|
110
|
+
if (typeof candidate.toolName !== 'string')
|
|
111
|
+
return undefined;
|
|
112
|
+
const args = isArgs(candidate.args) ? candidate.args : {};
|
|
113
|
+
const files = fileRefs(candidate.files);
|
|
114
|
+
const command = readString(candidate.command) ?? readString(args['command']);
|
|
115
|
+
// The file is read out of the arguments for the tools that write. A
|
|
116
|
+
// read names a file as well, and that is not a write.
|
|
117
|
+
const inferred = isWritingTool(candidate.toolName) ? filesFromArgs(args) : [];
|
|
118
|
+
return {
|
|
119
|
+
toolName: candidate.toolName,
|
|
120
|
+
args,
|
|
121
|
+
files: files.length > 0 ? files : inferred,
|
|
122
|
+
...(command !== undefined ? { command } : {}),
|
|
123
|
+
...(typeof candidate.callID === 'string' ? { callID: candidate.callID } : {}),
|
|
124
|
+
...(typeof candidate.role === 'string' ? { role: candidate.role } : {}),
|
|
125
|
+
...(typeof candidate.sessionID === 'string' ? { sessionID: candidate.sessionID } : {}),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The arguments, when they are an object.
|
|
130
|
+
*
|
|
131
|
+
* The host hands unknown shapes over, and an array is not a set of named
|
|
132
|
+
* arguments, so an array is not one either.
|
|
133
|
+
*/
|
|
134
|
+
function isArgs(value) {
|
|
135
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* A string, when the field is one.
|
|
139
|
+
*/
|
|
140
|
+
function readString(value) {
|
|
141
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* The files, when they are files.
|
|
145
|
+
*
|
|
146
|
+
* A path that is not a string is not a path, so it is dropped rather than
|
|
147
|
+
* carried into a rule that would compare it as one.
|
|
148
|
+
*/
|
|
149
|
+
function fileRefs(value) {
|
|
150
|
+
if (!Array.isArray(value))
|
|
151
|
+
return [];
|
|
152
|
+
const refs = [];
|
|
153
|
+
for (const entry of value) {
|
|
154
|
+
if (typeof entry !== 'object' || entry === null)
|
|
155
|
+
continue;
|
|
156
|
+
const record = entry;
|
|
157
|
+
refs.push({
|
|
158
|
+
...(typeof record.path === 'string' ? { path: record.path } : {}),
|
|
159
|
+
...(typeof record.fromPath === 'string' ? { fromPath: record.fromPath } : {}),
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
return refs;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The file a call writes to, when the arguments name one.
|
|
166
|
+
*
|
|
167
|
+
* The arguments are the raw shape of the host, so this is where a path
|
|
168
|
+
* that was never normalised is found.
|
|
169
|
+
*/
|
|
170
|
+
function filesFromArgs(args) {
|
|
171
|
+
for (const key of PATH_ARGS) {
|
|
172
|
+
const path = readString(args[key]);
|
|
173
|
+
if (path !== undefined)
|
|
174
|
+
return [{ path }];
|
|
175
|
+
}
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA4BH;;;;;GAKG;AACH,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE5D;;GAEG;AACH,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,aAAa,GAAG;IACpB,OAAO;IACP,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,MAAM;IACN,MAAM;IACN,UAAU;IACV,SAAS;CACV,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,YAAY,GAAG;IACnB,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,U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AM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9E,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAS,aAAa,CAAC,IAA6B;IAClD,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACnC,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.test.d.ts","sourceRoot":"","sources":["../src/event.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { readPreToolCall } from './event.js';
|
|
3
|
+
describe('readPreToolCall', () => {
|
|
4
|
+
it('keeps the files the host normalised', () => {
|
|
5
|
+
const event = readPreToolCall({
|
|
6
|
+
toolName: 'write',
|
|
7
|
+
args: { filePath: '/repo/src/a.ts' },
|
|
8
|
+
files: [{ path: '/repo/src/a.ts', fromPath: '/repo/src/b.ts' }],
|
|
9
|
+
});
|
|
10
|
+
expect(event?.files).toEqual([{ path: '/repo/src/a.ts', fromPath: '/repo/src/b.ts' }]);
|
|
11
|
+
});
|
|
12
|
+
it('reads the command out of the raw arguments', () => {
|
|
13
|
+
const event = readPreToolCall({ toolName: 'bash', args: { command: 'ls -la' }, files: [] });
|
|
14
|
+
expect(event?.command).toBe('ls -la');
|
|
15
|
+
});
|
|
16
|
+
it('reads the file out of the raw arguments', () => {
|
|
17
|
+
const event = readPreToolCall({
|
|
18
|
+
toolName: 'write',
|
|
19
|
+
args: { filePath: '/repo/src/a.ts' },
|
|
20
|
+
files: [],
|
|
21
|
+
});
|
|
22
|
+
expect(event?.files).toEqual([{ path: '/repo/src/a.ts' }]);
|
|
23
|
+
});
|
|
24
|
+
it('prefers the command the host normalised', () => {
|
|
25
|
+
const event = readPreToolCall({
|
|
26
|
+
toolName: 'bash',
|
|
27
|
+
command: 'ls',
|
|
28
|
+
args: { command: 'rm -rf /' },
|
|
29
|
+
files: [],
|
|
30
|
+
});
|
|
31
|
+
expect(event?.command).toBe('ls');
|
|
32
|
+
});
|
|
33
|
+
it('carries the call id and the role', () => {
|
|
34
|
+
const event = readPreToolCall({
|
|
35
|
+
toolName: 'bash',
|
|
36
|
+
args: {},
|
|
37
|
+
files: [],
|
|
38
|
+
callID: 'call-1',
|
|
39
|
+
role: 'builder',
|
|
40
|
+
});
|
|
41
|
+
expect(event?.callID).toBe('call-1');
|
|
42
|
+
expect(event?.role).toBe('builder');
|
|
43
|
+
});
|
|
44
|
+
it('says nothing about an event that is not a tool call', () => {
|
|
45
|
+
expect(readPreToolCall({})).toBeUndefined();
|
|
46
|
+
expect(readPreToolCall('not an event')).toBeUndefined();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=event.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.test.js","sourceRoot":"","sources":["../src/event.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,KAAK,GAAG,eAAe,CAAC;YAC5B,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE;YACpC,KAAK,EAAE,CAAC,EAAE,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kC,EAAE,GAAG,EAAE;QAC1C,MAAM,KAAK,GAAG,eAAe,CAAC;YAC5B,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,SAAS;SAChB,CAAC,CAAC;QACH,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QAC5C,MAAM,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @openagentsy/hooks
|
|
3
|
+
*
|
|
4
|
+
* The deterministic guardrails: the rule registry, the default rules, the
|
|
5
|
+
* output checks, the shell environment policy, the redaction wrapper and
|
|
6
|
+
* the approval gate.
|
|
7
|
+
*
|
|
8
|
+
* It is a library. The adapter (the OpenCode plugin) calls it; OpenCode
|
|
9
|
+
* never loads it, and nothing here decides on its own what a person
|
|
10
|
+
* decided.
|
|
11
|
+
*/
|
|
12
|
+
export * from './accountability.js';
|
|
13
|
+
export * from './approvals.js';
|
|
14
|
+
export * from './base-tool.js';
|
|
15
|
+
export * from './eval/index.js';
|
|
16
|
+
export * from './event.js';
|
|
17
|
+
export * from './lessons/index.js';
|
|
18
|
+
export * from './output-checks.js';
|
|
19
|
+
export * from './paths.js';
|
|
20
|
+
export { discoverPolicyModules, FIRST_PARTY_POLICY_IDS, firstPartyPolicyModules, type PolicyCatalogueOptions, } from './policies/index.js';
|
|
21
|
+
export type { FileChange, PolicyContext, PolicyFinding, PolicyLayer, PolicyModule, PolicyMoment, PolicyOutcome, PolicyResult, } from './policy.js';
|
|
22
|
+
export * from './policy-engine.js';
|
|
23
|
+
export * from './policy-registry.js';
|
|
24
|
+
export * from './policy-release.js';
|
|
25
|
+
export * from './quality/index.js';
|
|
26
|
+
export * from './registry.js';
|
|
27
|
+
export * from './rules.js';
|
|
28
|
+
export * from './secrets.js';
|
|
29
|
+
export * from './shell-env.js';
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,UAAU,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @openagentsy/hooks
|
|
3
|
+
*
|
|
4
|
+
* The deterministic guardrails: the rule registry, the default rules, the
|
|
5
|
+
* output checks, the shell environment policy, the redaction wrapper and
|
|
6
|
+
* the approval gate.
|
|
7
|
+
*
|
|
8
|
+
* It is a library. The adapter (the OpenCode plugin) calls it; OpenCode
|
|
9
|
+
* never loads it, and nothing here decides on its own what a person
|
|
10
|
+
* decided.
|
|
11
|
+
*/
|
|
12
|
+
export * from './accountability.js';
|
|
13
|
+
export * from './approvals.js';
|
|
14
|
+
export * from './base-tool.js';
|
|
15
|
+
export * from './eval/index.js';
|
|
16
|
+
export * from './event.js';
|
|
17
|
+
export * from './lessons/index.js';
|
|
18
|
+
export * from './output-checks.js';
|
|
19
|
+
export * from './paths.js';
|
|
20
|
+
export { discoverPolicyModules, FIRST_PARTY_POLICY_IDS, firstPartyPolicyModules, } from './policies/index.js';
|
|
21
|
+
export * from './policy-engine.js';
|
|
22
|
+
export * from './policy-registry.js';
|
|
23
|
+
export * from './policy-release.js';
|
|
24
|
+
export * from './quality/index.js';
|
|
25
|
+
export * from './registry.js';
|
|
26
|
+
export * from './rules.js';
|
|
27
|
+
export * from './secrets.js';
|
|
28
|
+
export * from './shell-env.js';
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,GAExB,MAAM,qBAAqB,CAAC;AAW7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type Lesson, type StartPacket } from './model.js';
|
|
2
|
+
/**
|
|
3
|
+
* The capture.
|
|
4
|
+
*
|
|
5
|
+
* The archivist watches for the same kind of waste again and again, and it
|
|
6
|
+
* turns that into a candidate. It does so in two cases only:
|
|
7
|
+
*
|
|
8
|
+
* - the same waste kind with a similar detail shows up in three or more
|
|
9
|
+
* sessions, which is a pattern rather than an accident;
|
|
10
|
+
* - a person corrects the agent outright, which is a lesson whatever the
|
|
11
|
+
* count is.
|
|
12
|
+
*
|
|
13
|
+
* The observations are kept before there is a candidate, because the rule is
|
|
14
|
+
* about sessions: the third session is only a pattern if the first two are
|
|
15
|
+
* remembered. A candidate is deduplicated by its normalised summary, and
|
|
16
|
+
* every sighting of the same summary raises the count. The count is a
|
|
17
|
+
* priority, not evidence: a lesson that happened often is still only a claim
|
|
18
|
+
* until a person has decided it.
|
|
19
|
+
*/
|
|
20
|
+
/** How many sessions make a pattern. */
|
|
21
|
+
export declare const SESSION_THRESHOLD = 3;
|
|
22
|
+
/** One waste, as the archivist saw it. */
|
|
23
|
+
export type WasteObservation = {
|
|
24
|
+
/** The waste kind. */
|
|
25
|
+
kind: string;
|
|
26
|
+
/** The detail the waste carried. */
|
|
27
|
+
detail: string;
|
|
28
|
+
/** The session it was seen in. */
|
|
29
|
+
session: string;
|
|
30
|
+
};
|
|
31
|
+
/** What the archivist saw. */
|
|
32
|
+
export type CaptureInput = {
|
|
33
|
+
/** What happened, in one sentence. */
|
|
34
|
+
summary: string;
|
|
35
|
+
/** The waste, once per sighting. */
|
|
36
|
+
observations: WasteObservation[];
|
|
37
|
+
/** Whether a person corrected the agent outright. */
|
|
38
|
+
explicitCorrection?: boolean;
|
|
39
|
+
/** The evidence the lesson rests on. */
|
|
40
|
+
evidence?: string[];
|
|
41
|
+
/** The start packet, as far as the archivist can fill it. */
|
|
42
|
+
packet?: Partial<StartPacket>;
|
|
43
|
+
};
|
|
44
|
+
/** What the capture did. */
|
|
45
|
+
export type CaptureOutcome = {
|
|
46
|
+
ok: true;
|
|
47
|
+
lesson: Lesson;
|
|
48
|
+
created: boolean;
|
|
49
|
+
redactions: number;
|
|
50
|
+
} | {
|
|
51
|
+
ok: false;
|
|
52
|
+
reason: 'not_enough_sessions';
|
|
53
|
+
redactions: number;
|
|
54
|
+
sessions: number;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Capture a lesson.
|
|
58
|
+
*
|
|
59
|
+
* Nothing is written to the lesson store until there is something to write:
|
|
60
|
+
* a waste that has been seen once is not a pattern, and the archivist says
|
|
61
|
+
* so instead of filling the store with candidates nobody will read. The
|
|
62
|
+
* observations are kept either way, because the third session is only a
|
|
63
|
+
* pattern if the first two are remembered.
|
|
64
|
+
*/
|
|
65
|
+
export declare function captureCandidate(root: string, input: CaptureInput, now?: () => Date): Promise<CaptureOutcome>;
|
|
66
|
+
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/lessons/capture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAA6B,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAUtF;;;;;;;;;;;;;;;;;GAiBG;AAEH,wCAAwC;AACxC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,0CAA0C;AAC1C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,8BAA8B;AAC9B,MAAM,MAAM,YA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