@claudexor/policy 1.0.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 +7 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/policy.d.ts +20 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +36 -0
- package/dist/policy.js.map +1 -0
- package/dist/risk.d.ts +26 -0
- package/dist/risk.d.ts.map +1 -0
- package/dist/risk.js +87 -0
- package/dist/risk.js.map +1 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 joi-lab
|
|
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,7 @@
|
|
|
1
|
+
# @claudexor/policy
|
|
2
|
+
|
|
3
|
+
Internal package of [Claudexor](https://github.com/razzant/claudexor) — Typed risk classifier + thin policy (path guard, require-human, deny lists). No keyword-regex governance.
|
|
4
|
+
|
|
5
|
+
Published as part of the Claudexor toolchain; it follows the monorepo's
|
|
6
|
+
lockstep version and has no separate semver contract. Use the `claudexor`
|
|
7
|
+
CLI (or `@claudexor/cli`) as the supported entry point.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
package/dist/policy.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Default path globs whose changes require human approval. */
|
|
2
|
+
export declare const DEFAULT_REQUIRE_HUMAN_PATHS: string[];
|
|
3
|
+
export interface PathGuardResult {
|
|
4
|
+
allowed: boolean;
|
|
5
|
+
reason?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Confine writes to the workspace root (defense-in-depth on top of the native
|
|
9
|
+
* harness sandbox).
|
|
10
|
+
*/
|
|
11
|
+
export declare function pathGuard(workspaceRoot: string, targetPath: string): PathGuardResult;
|
|
12
|
+
export interface RequireHumanResult {
|
|
13
|
+
required: boolean;
|
|
14
|
+
reasons: string[];
|
|
15
|
+
/** The changed paths that matched a human-approval pattern (structured evidence,
|
|
16
|
+
* never reconstructed by substring-matching the reason prose). */
|
|
17
|
+
matchedPaths: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare function requireHuman(changedPaths: string[], patterns?: string[]): RequireHumanResult;
|
|
20
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAGA,+DAA+D;AAC/D,eAAO,MAAM,2BAA2B,UAOvC,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CAQpF;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;sEACkE;IAClE,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAgB,YAAY,CAC1B,YAAY,EAAE,MAAM,EAAE,EACtB,QAAQ,GAAE,MAAM,EAAgC,GAC/C,kBAAkB,CAUpB"}
|
package/dist/policy.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { isAbsolute, relative, resolve } from "node:path";
|
|
2
|
+
import { matchAny } from "@claudexor/context";
|
|
3
|
+
/** Default path globs whose changes require human approval. */
|
|
4
|
+
export const DEFAULT_REQUIRE_HUMAN_PATHS = [
|
|
5
|
+
"**/auth/**",
|
|
6
|
+
"**/payment*/**",
|
|
7
|
+
"**/billing/**",
|
|
8
|
+
"**/migrations/**",
|
|
9
|
+
"**/secrets/**",
|
|
10
|
+
"**/.github/workflows/**",
|
|
11
|
+
];
|
|
12
|
+
/**
|
|
13
|
+
* Confine writes to the workspace root (defense-in-depth on top of the native
|
|
14
|
+
* harness sandbox).
|
|
15
|
+
*/
|
|
16
|
+
export function pathGuard(workspaceRoot, targetPath) {
|
|
17
|
+
const root = resolve(workspaceRoot);
|
|
18
|
+
const target = isAbsolute(targetPath) ? resolve(targetPath) : resolve(root, targetPath);
|
|
19
|
+
const rel = relative(root, target);
|
|
20
|
+
if (rel === "" || rel.startsWith("..") || isAbsolute(rel)) {
|
|
21
|
+
return { allowed: false, reason: `write to '${targetPath}' resolves outside workspace '${workspaceRoot}'` };
|
|
22
|
+
}
|
|
23
|
+
return { allowed: true };
|
|
24
|
+
}
|
|
25
|
+
export function requireHuman(changedPaths, patterns = DEFAULT_REQUIRE_HUMAN_PATHS) {
|
|
26
|
+
const reasons = [];
|
|
27
|
+
const matchedPaths = [];
|
|
28
|
+
for (const p of changedPaths) {
|
|
29
|
+
if (matchAny(p, patterns)) {
|
|
30
|
+
reasons.push(`change to ${p} requires human approval`);
|
|
31
|
+
matchedPaths.push(p);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return { required: reasons.length > 0, reasons, matchedPaths };
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,kBAAkB;IAClB,eAAe;IACf,yBAAyB;CAC1B,CAAC;AAOF;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,aAAqB,EAAE,UAAkB;IACjE,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACxF,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACnC,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1D,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,UAAU,iCAAiC,aAAa,GAAG,EAAE,CAAC;IAC9G,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAUD,MAAM,UAAU,YAAY,CAC1B,YAAsB,EACtB,WAAqB,2BAA2B;IAEhD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,KAAK,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC;QAC7B,IAAI,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;YACvD,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;AACjE,CAAC"}
|
package/dist/risk.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RiskLevel } from "@claudexor/schema";
|
|
2
|
+
/**
|
|
3
|
+
* Risk is classified from typed diff/path metadata (and optional LLM judgment
|
|
4
|
+
* layered on top by callers) — never from keyword regex over human text.
|
|
5
|
+
*/
|
|
6
|
+
export interface DiffMeta {
|
|
7
|
+
changedPaths: string[];
|
|
8
|
+
additions?: number;
|
|
9
|
+
deletions?: number;
|
|
10
|
+
protectedPaths?: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface RiskAssessment {
|
|
13
|
+
level: RiskLevel;
|
|
14
|
+
reasons: string[];
|
|
15
|
+
/** The actual changed paths that triggered this risk level (structured
|
|
16
|
+
* evidence for the human gate — never reconstructed by string-matching prose). */
|
|
17
|
+
matchedPaths: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare function classifyRisk(meta: DiffMeta): RiskAssessment;
|
|
20
|
+
/** Review depth implied by risk (callers may still override). */
|
|
21
|
+
export declare function reviewDepthForRisk(level: RiskLevel): {
|
|
22
|
+
reviewers: number;
|
|
23
|
+
crossFamily: boolean;
|
|
24
|
+
humanApproval: boolean;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=risk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk.d.ts","sourceRoot":"","sources":["../src/risk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;sFACkF;IAClF,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAsCD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,cAAc,CAsC3D;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;CACxB,CAWA"}
|
package/dist/risk.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { matchAny } from "@claudexor/context";
|
|
2
|
+
const CRITICAL_PATTERNS = [
|
|
3
|
+
"**/secrets/**",
|
|
4
|
+
"**/.env",
|
|
5
|
+
"**/.env.*",
|
|
6
|
+
"**/*.pem",
|
|
7
|
+
"**/credentials*",
|
|
8
|
+
"**/deploy/**/prod*",
|
|
9
|
+
"**/terraform/**",
|
|
10
|
+
"**/.github/workflows/release*",
|
|
11
|
+
];
|
|
12
|
+
const HIGH_PATTERNS = [
|
|
13
|
+
"**/auth/**",
|
|
14
|
+
"**/payment*/**",
|
|
15
|
+
"**/billing/**",
|
|
16
|
+
"**/security/**",
|
|
17
|
+
"**/migrations/**",
|
|
18
|
+
"**/*migration*",
|
|
19
|
+
"**/crypto/**",
|
|
20
|
+
"**/.github/workflows/**",
|
|
21
|
+
"**/Dockerfile",
|
|
22
|
+
"**/k8s/**",
|
|
23
|
+
"**/charts/**",
|
|
24
|
+
];
|
|
25
|
+
const DEP_PATTERNS = [
|
|
26
|
+
"**/package.json",
|
|
27
|
+
"package.json",
|
|
28
|
+
"**/pnpm-lock.yaml",
|
|
29
|
+
"pnpm-lock.yaml",
|
|
30
|
+
"**/requirements*.txt",
|
|
31
|
+
"**/Cargo.toml",
|
|
32
|
+
"**/go.mod",
|
|
33
|
+
];
|
|
34
|
+
const LARGE_DIFF_FILES = 20;
|
|
35
|
+
const LARGE_DIFF_LINES = 500;
|
|
36
|
+
export function classifyRisk(meta) {
|
|
37
|
+
const reasons = [];
|
|
38
|
+
const paths = meta.changedPaths;
|
|
39
|
+
const churn = (meta.additions ?? 0) + (meta.deletions ?? 0);
|
|
40
|
+
const protectedHit = paths.filter((p) => matchAny(p, meta.protectedPaths ?? []));
|
|
41
|
+
if (protectedHit.length > 0)
|
|
42
|
+
reasons.push(`touches protected paths: ${protectedHit.slice(0, 3).join(", ")}`);
|
|
43
|
+
const criticalHit = paths.filter((p) => matchAny(p, CRITICAL_PATTERNS));
|
|
44
|
+
if (criticalHit.length > 0 || protectedHit.length > 0) {
|
|
45
|
+
reasons.unshift(criticalHit.length > 0
|
|
46
|
+
? `critical paths: ${criticalHit.slice(0, 3).join(", ")}`
|
|
47
|
+
: "protected-path change");
|
|
48
|
+
return { level: "critical", reasons, matchedPaths: [...new Set([...criticalHit, ...protectedHit])] };
|
|
49
|
+
}
|
|
50
|
+
const highHit = paths.filter((p) => matchAny(p, HIGH_PATTERNS));
|
|
51
|
+
if (highHit.length > 0) {
|
|
52
|
+
reasons.unshift(`high-risk paths: ${highHit.slice(0, 3).join(", ")}`);
|
|
53
|
+
return { level: "high", reasons, matchedPaths: highHit };
|
|
54
|
+
}
|
|
55
|
+
const depHit = paths.filter((p) => matchAny(p, DEP_PATTERNS));
|
|
56
|
+
const large = paths.length >= LARGE_DIFF_FILES || churn >= LARGE_DIFF_LINES;
|
|
57
|
+
if (depHit.length > 0)
|
|
58
|
+
reasons.push(`dependency/manifest change: ${depHit.slice(0, 2).join(", ")}`);
|
|
59
|
+
if (large)
|
|
60
|
+
reasons.push(`large diff (${paths.length} files, ${churn} lines)`);
|
|
61
|
+
if (depHit.length > 0 && large)
|
|
62
|
+
return { level: "high", reasons, matchedPaths: depHit };
|
|
63
|
+
if (depHit.length > 0 || large)
|
|
64
|
+
return { level: "medium", reasons, matchedPaths: depHit };
|
|
65
|
+
if (paths.length === 0)
|
|
66
|
+
return { level: "low", reasons: ["no file changes"], matchedPaths: [] };
|
|
67
|
+
if (paths.length <= 2 && churn <= 50) {
|
|
68
|
+
reasons.push(`small change (${paths.length} files, ${churn} lines)`);
|
|
69
|
+
return { level: "low", reasons, matchedPaths: [] };
|
|
70
|
+
}
|
|
71
|
+
reasons.push(`normal change (${paths.length} files, ${churn} lines)`);
|
|
72
|
+
return { level: "medium", reasons, matchedPaths: [] };
|
|
73
|
+
}
|
|
74
|
+
/** Review depth implied by risk (callers may still override). */
|
|
75
|
+
export function reviewDepthForRisk(level) {
|
|
76
|
+
switch (level) {
|
|
77
|
+
case "low":
|
|
78
|
+
return { reviewers: 1, crossFamily: false, humanApproval: false };
|
|
79
|
+
case "medium":
|
|
80
|
+
return { reviewers: 1, crossFamily: false, humanApproval: false };
|
|
81
|
+
case "high":
|
|
82
|
+
return { reviewers: 2, crossFamily: true, humanApproval: false };
|
|
83
|
+
case "critical":
|
|
84
|
+
return { reviewers: 2, crossFamily: true, humanApproval: true };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=risk.js.map
|
package/dist/risk.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk.js","sourceRoot":"","sources":["../src/risk.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAqB9C,MAAM,iBAAiB,GAAG;IACxB,eAAe;IACf,SAAS;IACT,WAAW;IACX,UAAU;IACV,iBAAiB;IACjB,oBAAoB;IACpB,iBAAiB;IACjB,+BAA+B;CAChC,CAAC;AACF,MAAM,aAAa,GAAG;IACpB,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,yBAAyB;IACzB,eAAe;IACf,WAAW;IACX,cAAc;CACf,CAAC;AACF,MAAM,YAAY,GAAG;IACnB,iBAAiB;IACjB,cAAc;IACd,mBAAmB;IACnB,gBAAgB;IAChB,sBAAsB;IACtB,eAAe;IACf,WAAW;CACZ,CAAC;AAEF,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,MAAM,UAAU,YAAY,CAAC,IAAc;IACzC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;IAChC,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC;IAE5D,MAAM,YAAY,GA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AO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IACrD,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,kBAAkB,KAAK,CAAC,MAAM,WAAW,KAAK,SAAS,CAAC,CAAC;IACtE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;AACxD,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,kBAAkB,CAAC,KAAgB;IAKjD,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,KAAK;YACR,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QACpE,KAAK,QAAQ;YACX,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QACpE,KAAK,MAAM;YACT,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QACnE,KAAK,UAAU;YACb,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IACpE,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@claudexor/policy",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Typed risk classifier + thin policy (path guard, require-human, deny lists). No keyword-regex governance.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@claudexor/context": "1.0.0",
|
|
20
|
+
"@claudexor/schema": "1.0.0"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/razzant/claudexor.git",
|
|
25
|
+
"directory": "packages/policy"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/razzant/claudexor#readme",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/razzant/claudexor/issues"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=20.19"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc",
|
|
39
|
+
"typecheck": "tsc --noEmit"
|
|
40
|
+
}
|
|
41
|
+
}
|