@agent-corpus/policy-manager 0.5.0 → 0.7.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/README.md +64 -12
- package/dist/adapters.d.ts +11 -1
- package/dist/adapters.js +60 -4
- package/dist/audit.js +16 -2
- package/dist/cli.js +11 -4
- package/dist/config.js +7 -1
- package/dist/created.d.ts +44 -0
- package/dist/created.js +236 -0
- package/dist/evidence.d.ts +53 -1
- package/dist/evidence.js +202 -7
- package/dist/flow.d.ts +2 -1
- package/dist/flow.js +891 -77
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/permissive.d.ts +11 -3
- package/dist/permissive.js +1043 -35
- package/dist/policy.d.ts +5 -1
- package/dist/policy.js +78 -35
- package/dist/principle.d.ts +8 -0
- package/dist/principle.js +8 -0
- package/dist/profile.d.ts +8 -0
- package/dist/profile.js +26 -0
- package/dist/recoverable.d.ts +41 -0
- package/dist/recoverable.js +391 -0
- package/dist/script.d.ts +35 -1
- package/dist/script.js +215 -17
- package/dist/service.d.ts +1 -1
- package/dist/service.js +4 -4
- package/dist/session.d.ts +16 -2
- package/dist/session.js +77 -16
- package/dist/types.d.ts +9 -3
- package/dist/types.js +12 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { executionReport, hookResponse, normalize } from "./adapters.js";
|
|
1
|
+
export { executionReport, hookOutput, hookResponse, normalize } from "./adapters.js";
|
|
2
2
|
export { branchEvidence, pathEvidence } from "./evidence.js";
|
|
3
3
|
export { mergedEvidence } from "./merged.js";
|
|
4
|
-
export { evaluate, hash, words } from "./policy.js";
|
|
4
|
+
export { evaluate, hash, requestHash, words } from "./policy.js";
|
|
5
|
+
export { HUMAN_ONLY_FOR, HUMAN_REVIEW_PRINCIPLE } from "./principle.js";
|
|
5
6
|
export type { Profile } from "./profile.js";
|
|
6
7
|
export { defaultProfilePath, loadProfile, ProfileError, parseProfile, strictProfile, } from "./profile.js";
|
|
7
8
|
export type { ReplayReport } from "./replay.js";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { executionReport, hookResponse, normalize } from "./adapters.js";
|
|
1
|
+
export { executionReport, hookOutput, hookResponse, normalize } from "./adapters.js";
|
|
2
2
|
export { branchEvidence, pathEvidence } from "./evidence.js";
|
|
3
3
|
export { mergedEvidence } from "./merged.js";
|
|
4
|
-
export { evaluate, hash, words } from "./policy.js";
|
|
4
|
+
export { evaluate, hash, requestHash, words } from "./policy.js";
|
|
5
|
+
export { HUMAN_ONLY_FOR, HUMAN_REVIEW_PRINCIPLE } from "./principle.js";
|
|
5
6
|
export { defaultProfilePath, loadProfile, ProfileError, parseProfile, strictProfile, } from "./profile.js";
|
|
6
7
|
export { replayTranscripts } from "./replay.js";
|
|
7
8
|
export { PolicySession } from "./session.js";
|
package/dist/permissive.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Fill } from "./evidence.js";
|
|
1
2
|
import { commandDecision } from "./flow.js";
|
|
2
3
|
import type { Profile } from "./profile.js";
|
|
3
4
|
import { type Redirect, type SimpleCommand } from "./shell.js";
|
|
@@ -13,10 +14,15 @@ export declare function permissiveRead(cwd: string, input: string): {
|
|
|
13
14
|
category: "code-read";
|
|
14
15
|
reason: string;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
+
/** Temp and scratch writes are trusted only before anything could plant a symlink (see `Fill`). */
|
|
18
|
+
export declare function permissiveWrite(cwd: string, input: string, profile: Profile, fill?: Fill): {
|
|
17
19
|
allowed: boolean;
|
|
18
20
|
category: "code-read" | "worktree-write" | "sensitive";
|
|
19
21
|
reason: string;
|
|
22
|
+
} | {
|
|
23
|
+
allowed: boolean;
|
|
24
|
+
category: "temp-write";
|
|
25
|
+
reason: string;
|
|
20
26
|
};
|
|
21
27
|
interface Unwrapped {
|
|
22
28
|
argv: string[];
|
|
@@ -25,8 +31,10 @@ interface Unwrapped {
|
|
|
25
31
|
refusal?: string;
|
|
26
32
|
}
|
|
27
33
|
export declare function unwrap(argv: string[]): Unwrapped;
|
|
34
|
+
/** The one destructive reason the session classifier may decide; every other stays a person's. */
|
|
35
|
+
export declare const WORKTREE_DELETION = "Deleting files inside a linked feature worktree";
|
|
28
36
|
/** Judges one redirection's target in `cwd`; undefined means it is acceptable. */
|
|
29
|
-
export declare function redirectDecision(request: Request, redirect: Redirect, profile: Profile, cwd: string): Decision | undefined;
|
|
30
|
-
export declare function simpleDecision(request: Request, command: SimpleCommand, profile: Profile, depth: number, stageIndex: number, cwd: string): Decision;
|
|
37
|
+
export declare function redirectDecision(request: Request, redirect: Redirect, profile: Profile, cwd: string, fill?: Fill): Decision | undefined;
|
|
38
|
+
export declare function simpleDecision(request: Request, command: SimpleCommand, profile: Profile, depth: number, stageIndex: number, cwd: string, fill?: Fill): Decision;
|
|
31
39
|
export { commandDecision };
|
|
32
40
|
//# sourceMappingURL=permissive.d.ts.map
|