clawposture-core 0.1.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/dist/constants.d.ts +14 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +39 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +89 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +31 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Severity order, categories, and score weights.
|
|
3
|
+
*/
|
|
4
|
+
import type { Severity } from "./types.js";
|
|
5
|
+
export declare const SEVERITY_ORDER: Severity[];
|
|
6
|
+
export declare const CATEGORIES: readonly ["auth", "exposure", "permissions", "tool-blast", "logging", "webhooks", "control-ui"];
|
|
7
|
+
/** Points deducted from 100 per finding by severity */
|
|
8
|
+
export declare const SCORE_DEDUCTIONS: Record<Severity, number>;
|
|
9
|
+
export declare const SCORE_MAX = 100;
|
|
10
|
+
export declare const SCORE_MIN = 0;
|
|
11
|
+
/** Dimension ids for transparent score (optional) */
|
|
12
|
+
export declare const SCORE_DIMENSION_IDS: readonly ["tool-breadth", "external-access", "data-sensitivity", "autonomy"];
|
|
13
|
+
export declare const SCORE_DIMENSION_WEIGHTS: Record<string, number>;
|
|
14
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,cAAc,EAAE,QAAQ,EAA0C,CAAC;AAEhF,eAAO,MAAM,UAAU,iGAQb,CAAC;AAEX,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAKrD,CAAC;AAEF,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B,qDAAqD;AACrD,eAAO,MAAM,mBAAmB,8EAKtB,CAAC;AAEX,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK1D,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Severity order, categories, and score weights.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SCORE_DIMENSION_WEIGHTS = exports.SCORE_DIMENSION_IDS = exports.SCORE_MIN = exports.SCORE_MAX = exports.SCORE_DEDUCTIONS = exports.CATEGORIES = exports.SEVERITY_ORDER = void 0;
|
|
7
|
+
exports.SEVERITY_ORDER = ["critical", "high", "medium", "low"];
|
|
8
|
+
exports.CATEGORIES = [
|
|
9
|
+
"auth",
|
|
10
|
+
"exposure",
|
|
11
|
+
"permissions",
|
|
12
|
+
"tool-blast",
|
|
13
|
+
"logging",
|
|
14
|
+
"webhooks",
|
|
15
|
+
"control-ui",
|
|
16
|
+
];
|
|
17
|
+
/** Points deducted from 100 per finding by severity */
|
|
18
|
+
exports.SCORE_DEDUCTIONS = {
|
|
19
|
+
critical: 15,
|
|
20
|
+
high: 8,
|
|
21
|
+
medium: 3,
|
|
22
|
+
low: 1,
|
|
23
|
+
};
|
|
24
|
+
exports.SCORE_MAX = 100;
|
|
25
|
+
exports.SCORE_MIN = 0;
|
|
26
|
+
/** Dimension ids for transparent score (optional) */
|
|
27
|
+
exports.SCORE_DIMENSION_IDS = [
|
|
28
|
+
"tool-breadth",
|
|
29
|
+
"external-access",
|
|
30
|
+
"data-sensitivity",
|
|
31
|
+
"autonomy",
|
|
32
|
+
];
|
|
33
|
+
exports.SCORE_DIMENSION_WEIGHTS = {
|
|
34
|
+
"tool-breadth": 0.25,
|
|
35
|
+
"external-access": 0.25,
|
|
36
|
+
"data-sensitivity": 0.25,
|
|
37
|
+
autonomy: 0.25,
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIU,QAAA,cAAc,GAAe,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAEnE,QAAA,UAAU,GAAG;IACxB,MAAM;IACN,UAAU;IACV,aAAa;IACb,YAAY;IACZ,SAAS;IACT,UAAU;IACV,YAAY;CACJ,CAAC;AAEX,uDAAuD;AAC1C,QAAA,gBAAgB,GAA6B;IACxD,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC;CACP,CAAC;AAEW,QAAA,SAAS,GAAG,GAAG,CAAC;AAChB,QAAA,SAAS,GAAG,CAAC,CAAC;AAE3B,qDAAqD;AACxC,QAAA,mBAAmB,GAAG;IACjC,cAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,UAAU;CACF,CAAC;AAEE,QAAA,uBAAuB,GAA2B;IAC7D,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE,IAAI;CACf,CAAC"}
|
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,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types.js"), exports);
|
|
18
|
+
__exportStar(require("./constants.js"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,iDAA+B"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for posture report and environment snapshot.
|
|
3
|
+
* Contract between CLI and UI.
|
|
4
|
+
*/
|
|
5
|
+
export type Severity = "critical" | "high" | "medium" | "low";
|
|
6
|
+
export type Category = "auth" | "exposure" | "permissions" | "tool-blast" | "logging" | "webhooks" | "control-ui";
|
|
7
|
+
export interface Attribution {
|
|
8
|
+
repo?: string;
|
|
9
|
+
file?: string;
|
|
10
|
+
lastModified?: string;
|
|
11
|
+
configPath?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Finding {
|
|
14
|
+
id: string;
|
|
15
|
+
severity: Severity;
|
|
16
|
+
category: Category;
|
|
17
|
+
message: string;
|
|
18
|
+
recommendation: string;
|
|
19
|
+
agentId?: string;
|
|
20
|
+
attribution?: Attribution;
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface HighRiskAgent {
|
|
24
|
+
agentId: string;
|
|
25
|
+
label: string;
|
|
26
|
+
reason: string;
|
|
27
|
+
findingIds: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface ScoreDimension {
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
score: number;
|
|
33
|
+
weight: number;
|
|
34
|
+
description?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface PostureReport {
|
|
37
|
+
postureScore: number;
|
|
38
|
+
scoreDimensions?: ScoreDimension[];
|
|
39
|
+
summary: {
|
|
40
|
+
critical: number;
|
|
41
|
+
high: number;
|
|
42
|
+
medium: number;
|
|
43
|
+
low: number;
|
|
44
|
+
};
|
|
45
|
+
findings: Finding[];
|
|
46
|
+
highRiskAgents: HighRiskAgent[];
|
|
47
|
+
discoveredAt: string;
|
|
48
|
+
environmentId?: string;
|
|
49
|
+
stateDir?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface AgentInfo {
|
|
52
|
+
id: string;
|
|
53
|
+
tools: string[];
|
|
54
|
+
sandbox?: {
|
|
55
|
+
mode?: string;
|
|
56
|
+
scope?: string;
|
|
57
|
+
};
|
|
58
|
+
channels?: string[];
|
|
59
|
+
}
|
|
60
|
+
export interface EnvironmentSnapshot {
|
|
61
|
+
stateDir: string;
|
|
62
|
+
config: Record<string, unknown>;
|
|
63
|
+
agents: AgentInfo[];
|
|
64
|
+
bind?: string;
|
|
65
|
+
auth?: {
|
|
66
|
+
mode?: string;
|
|
67
|
+
token?: string;
|
|
68
|
+
password?: boolean;
|
|
69
|
+
};
|
|
70
|
+
permissions?: {
|
|
71
|
+
stateDirMode?: number;
|
|
72
|
+
configFileMode?: number;
|
|
73
|
+
credentialsDirMode?: number;
|
|
74
|
+
agentAuthPathsMode?: number;
|
|
75
|
+
};
|
|
76
|
+
logging?: {
|
|
77
|
+
redactSensitive?: string;
|
|
78
|
+
};
|
|
79
|
+
hooks?: {
|
|
80
|
+
enabled?: boolean;
|
|
81
|
+
token?: boolean;
|
|
82
|
+
};
|
|
83
|
+
controlUi?: {
|
|
84
|
+
allowInsecureAuth?: boolean;
|
|
85
|
+
dangerouslyDisableDeviceAuth?: boolean;
|
|
86
|
+
};
|
|
87
|
+
channels?: string[];
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,UAAU,GACV,aAAa,GACb,YAAY,GACZ,SAAS,GACT,UAAU,GACV,YAAY,CAAC;AAEjB,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAA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AA;KAAE,CAAC;IAC7D,WAAW,CAAC,EAAE;QACZ,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;IACF,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC/C,SAAS,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAAC,4BAA4B,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACpF,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "clawposture-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Core types and constants for ClawPosture - security posture for OpenClaw",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": ["dist"],
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"test": "vitest run",
|
|
19
|
+
"prepublishOnly": "pnpm run build"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"typescript": "^5.3.0",
|
|
23
|
+
"vitest": "^2.0.0"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/agentguard-works/clawposture.git"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/agentguard-works/clawposture#readme",
|
|
30
|
+
"bugs": "https://github.com/agentguard-works/clawposture/issues"
|
|
31
|
+
}
|