@carfiedli/runtime-guardrail 0.1.19
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.fe.md +256 -0
- package/README.hooks-security.md +1017 -0
- package/README.md +1316 -0
- package/dist/adapters/index.d.ts +1 -0
- package/dist/adapters/persistence/file-store.d.ts +18 -0
- package/dist/adapters/persistence/index.d.ts +4 -0
- package/dist/adapters/persistence/json-event-log.d.ts +31 -0
- package/dist/adapters/persistence/queue-store.d.ts +19 -0
- package/dist/adapters/persistence/snapshot-store.d.ts +14 -0
- package/dist/approval/approval-service.d.ts +27 -0
- package/dist/approval/approval-state-machine.d.ts +5 -0
- package/dist/approval/hitl/hitl-connector.d.ts +9 -0
- package/dist/approval/index.d.ts +4 -0
- package/dist/approval/run-hold-service.d.ts +16 -0
- package/dist/audit/audit-event-store.d.ts +12 -0
- package/dist/audit/audit-read-model-builder.d.ts +17 -0
- package/dist/audit/audit-service.d.ts +18 -0
- package/dist/audit/incident-query-service.d.ts +7 -0
- package/dist/audit/index.d.ts +5 -0
- package/dist/audit/metrics-projection.d.ts +10 -0
- package/dist/bootstrap/create-runtime-guardrail-plugin.d.ts +3 -0
- package/dist/bootstrap/dependency-container.d.ts +2 -0
- package/dist/bootstrap/index.d.ts +3 -0
- package/dist/bootstrap/runtime-facade.d.ts +31 -0
- package/dist/compat/index.d.ts +1 -0
- package/dist/compat/legacy-types.d.ts +29 -0
- package/dist/contracts/core.d.ts +277 -0
- package/dist/contracts/events.d.ts +35 -0
- package/dist/contracts/host.d.ts +239 -0
- package/dist/contracts/index.d.ts +6 -0
- package/dist/contracts/operator.d.ts +110 -0
- package/dist/execution/egress-mediator.d.ts +7 -0
- package/dist/execution/execution-broker.d.ts +13 -0
- package/dist/execution/execution-plan-builder.d.ts +12 -0
- package/dist/execution/index.d.ts +4 -0
- package/dist/execution/model-governance-service.d.ts +7 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +23 -0
- package/dist/openclaw/hooks/egress-adapter.d.ts +9 -0
- package/dist/openclaw/hooks/hook-registry.d.ts +21 -0
- package/dist/openclaw/hooks/hook-result-mapper.d.ts +43 -0
- package/dist/openclaw/hooks/hook-types.d.ts +31 -0
- package/dist/openclaw/hooks/index.d.ts +8 -0
- package/dist/openclaw/hooks/ingress-adapter.d.ts +14 -0
- package/dist/openclaw/hooks/llm-request-adapter.d.ts +9 -0
- package/dist/openclaw/hooks/persist-adapter.d.ts +30 -0
- package/dist/openclaw/hooks/tool-call-adapter.d.ts +7 -0
- package/dist/openclaw/index.d.ts +4 -0
- package/dist/openclaw/plugin-runtime.d.ts +103 -0
- package/dist/openclaw/rpc-handlers.d.ts +20 -0
- package/dist/openclaw/skills-availability.d.ts +10 -0
- package/dist/openclaw/skills-upload.d.ts +17 -0
- package/dist/openclaw/testing/index.d.ts +1 -0
- package/dist/openclaw/testing/mock-openclaw-api.d.ts +74 -0
- package/dist/operator/cli/register-cli.d.ts +4 -0
- package/dist/operator/command-service.d.ts +15 -0
- package/dist/operator/index.d.ts +5 -0
- package/dist/operator/query-service.d.ts +21 -0
- package/dist/operator/reporting/report-service.d.ts +9 -0
- package/dist/operator/rpc/register-rpc.d.ts +5 -0
- package/dist/policy/detectors/detector-port.d.ts +23 -0
- package/dist/policy/finding-normalizer.d.ts +3 -0
- package/dist/policy/index.d.ts +4 -0
- package/dist/policy/policy-engine.d.ts +8 -0
- package/dist/policy/stage-resolver.d.ts +7 -0
- package/dist/runtime-core/device-id.d.ts +15 -0
- package/dist/runtime-core/evaluate-service.d.ts +91 -0
- package/dist/runtime-core/index.d.ts +10 -0
- package/dist/runtime-core/memory-audit-logger.d.ts +55 -0
- package/dist/runtime-core/memory-store.d.ts +141 -0
- package/dist/runtime-core/remote-guard-request-builder.d.ts +15 -0
- package/dist/runtime-core/remote-guard-transport.d.ts +79 -0
- package/dist/runtime-core/remote-guard-types.d.ts +183 -0
- package/dist/runtime-core/remote-policy-evaluator.d.ts +51 -0
- package/dist/runtime-core/skill-name-resolver.d.ts +31 -0
- package/dist/runtime-core/sync-remote-evaluate.d.ts +29 -0
- package/dist/runtime-core/sync-remote-worker.d.ts +14 -0
- package/dist/runtime-core/sync-remote-worker.js +2 -0
- package/dist/runtime-core/telemetry-service.d.ts +94 -0
- package/dist/runtime-core/telemetry-types.d.ts +181 -0
- package/dist/types.d.ts +224 -0
- package/dist/version.d.ts +1 -0
- package/openclaw.plugin.json +76 -0
- package/package.json +71 -0
- package/remote-guard-config.json +30 -0
- package/scripts/runtime-guardrailctl.mjs +864 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/** 护盾阶段:observe=仅观察 | shadow=影子模式 | enforce_high=仅拦截高危 | enforce_all=全量拦截 */
|
|
2
|
+
export type ShieldStage = "observe" | "shadow" | "enforce_high" | "enforce_all";
|
|
3
|
+
/** 失败模式:open=失败时放行 | closed=失败时拦截 */
|
|
4
|
+
export type ShieldFailMode = "open" | "closed";
|
|
5
|
+
/** 检测面(触发钩子的位置):ingress=入口 | llm=大模型请求 | tool=工具调用 | egress=出口 | persist=持久化 */
|
|
6
|
+
export type ShieldSurface = "ingress" | "llm" | "tool" | "egress" | "persist";
|
|
7
|
+
/** 严重等级:low=低 | medium=中 | high=高 | critical=严重 */
|
|
8
|
+
export type ShieldSeverity = "low" | "medium" | "high" | "critical";
|
|
9
|
+
/** 规则动作:allow=放行 | redact=脱敏 | block=拦截 */
|
|
10
|
+
export type ShieldRuleAction = "allow" | "redact" | "block";
|
|
11
|
+
/** 钩子动作:在规则动作基础上增加 hold=暂停等待审批 */
|
|
12
|
+
export type ShieldHookAction = ShieldRuleAction | "hold";
|
|
13
|
+
/** 审批状态:pending=待审批 | approved=已批准 | rejected=已拒绝 | expired=已过期 | cancelled=已取消 */
|
|
14
|
+
export type ShieldApprovalStatus = "pending" | "approved" | "rejected" | "expired" | "cancelled";
|
|
15
|
+
/** 审批决策:approved=批准 | rejected=拒绝 */
|
|
16
|
+
export type ShieldApprovalDecision = "approved" | "rejected";
|
|
17
|
+
/** 审批类别:external-send=外发 | deploy=部署 | permission-change=权限变更 | model-override=模型覆盖 | unknown=未知 */
|
|
18
|
+
export type ShieldApprovalCategory = "external-send" | "deploy" | "permission-change" | "model-override" | "unknown";
|
|
19
|
+
/** 运行暂停状态:pending=等待中 | approved_waiting_resume=已批准待恢复 | resumed=已恢复 | rejected/expired/cancelled */
|
|
20
|
+
export type ShieldRunHoldStatus = "pending" | "approved_waiting_resume" | "resumed" | "rejected" | "expired" | "cancelled";
|
|
21
|
+
/** 规则命中记录:记录哪条规则被触发、执行了什么动作、严重等级和原因 */
|
|
22
|
+
export type ShieldMatch = {
|
|
23
|
+
ruleId: string;
|
|
24
|
+
action: Exclude<ShieldRuleAction, "allow">;
|
|
25
|
+
severity: ShieldSeverity;
|
|
26
|
+
reason?: string;
|
|
27
|
+
};
|
|
28
|
+
/** 脱敏操作描述:指定哪个字段被替换成什么值 */
|
|
29
|
+
export type ShieldRedaction = {
|
|
30
|
+
ruleId?: string;
|
|
31
|
+
/** 被脱敏的字段路径 */
|
|
32
|
+
field: string;
|
|
33
|
+
/** 脱敏后的替换值 */
|
|
34
|
+
replacement: string;
|
|
35
|
+
};
|
|
36
|
+
/** 钩子级别的脱敏修改描述 */
|
|
37
|
+
export type ShieldHookModification = {
|
|
38
|
+
type: "redact";
|
|
39
|
+
/** 被修改的目标字段 */
|
|
40
|
+
target: string;
|
|
41
|
+
/** 替换后的值 */
|
|
42
|
+
replacement: string;
|
|
43
|
+
ruleId?: string;
|
|
44
|
+
};
|
|
45
|
+
/** 编译后的护盾规则:完整描述一条安全规则的匹配条件和执行动作 */
|
|
46
|
+
export type CompiledShieldRule = {
|
|
47
|
+
id: string;
|
|
48
|
+
action: Exclude<ShieldRuleAction, "allow">;
|
|
49
|
+
severity: ShieldSeverity;
|
|
50
|
+
/** 生效的检测面,"any" 表示全部 */
|
|
51
|
+
surface: ShieldSurface | "any";
|
|
52
|
+
/** 匹配目标(字段路径或模式) */
|
|
53
|
+
target: string;
|
|
54
|
+
/** 脱敏替换值 */
|
|
55
|
+
replacement: string;
|
|
56
|
+
reason?: string;
|
|
57
|
+
};
|
|
58
|
+
/** 策略评估发现项:一条检测器发现的安全问题 */
|
|
59
|
+
export type ShieldPolicyFinding = {
|
|
60
|
+
/** 检测器名称 */
|
|
61
|
+
detector: string;
|
|
62
|
+
/** 原因代码(如 prompt_injection, sensitive_action 等) */
|
|
63
|
+
reasonCode: string;
|
|
64
|
+
severity: ShieldSeverity;
|
|
65
|
+
/** 问题摘要 */
|
|
66
|
+
summary: string;
|
|
67
|
+
/** 标签 */
|
|
68
|
+
tags: string[];
|
|
69
|
+
/** 证据数据 */
|
|
70
|
+
evidence?: Record<string, unknown>;
|
|
71
|
+
/** 关联的规则 ID 列表 */
|
|
72
|
+
ruleIds?: string[];
|
|
73
|
+
};
|
|
74
|
+
/** 策略评估输入:传给策略评估器的上下文信息,包含检测面、Agent 信息、请求内容等 */
|
|
75
|
+
export type ShieldPolicyInput = {
|
|
76
|
+
surface: ShieldSurface;
|
|
77
|
+
agentId?: string;
|
|
78
|
+
runId?: string;
|
|
79
|
+
sessionId?: string;
|
|
80
|
+
sessionKey?: string;
|
|
81
|
+
/** LLM 提供商 */
|
|
82
|
+
provider?: string;
|
|
83
|
+
/** 模型名称 */
|
|
84
|
+
model?: string;
|
|
85
|
+
/** 用户提示词 */
|
|
86
|
+
prompt?: string;
|
|
87
|
+
/** 系统提示词 */
|
|
88
|
+
systemPrompt?: string;
|
|
89
|
+
/** 历史消息列表 */
|
|
90
|
+
historyMessages?: unknown[];
|
|
91
|
+
/** 消息内容 */
|
|
92
|
+
message?: unknown;
|
|
93
|
+
/** 工具名称 */
|
|
94
|
+
toolName?: string;
|
|
95
|
+
/** 工具参数 */
|
|
96
|
+
toolParams?: Record<string, unknown>;
|
|
97
|
+
/** 工具返回结果 */
|
|
98
|
+
toolResult?: unknown;
|
|
99
|
+
/** 技能名称列表 */
|
|
100
|
+
skillNames?: string[];
|
|
101
|
+
};
|
|
102
|
+
/** 审批请求:当策略需要人工审批时创建的请求记录 */
|
|
103
|
+
export type ShieldApprovalRequest = {
|
|
104
|
+
approvalId: string;
|
|
105
|
+
incidentId: string;
|
|
106
|
+
createdAt: number;
|
|
107
|
+
status: ShieldApprovalStatus;
|
|
108
|
+
category: ShieldApprovalCategory;
|
|
109
|
+
severity: ShieldSeverity;
|
|
110
|
+
reason: string;
|
|
111
|
+
tags: string[];
|
|
112
|
+
agentId?: string;
|
|
113
|
+
runId?: string;
|
|
114
|
+
sessionId?: string;
|
|
115
|
+
toolName?: string;
|
|
116
|
+
resolvedAt?: number;
|
|
117
|
+
note?: string;
|
|
118
|
+
resolvedBy?: string;
|
|
119
|
+
/** 审批来源(如外部系统) */
|
|
120
|
+
source?: string;
|
|
121
|
+
/** 外部审批系统的审批 ID */
|
|
122
|
+
externalApprovalId?: string;
|
|
123
|
+
};
|
|
124
|
+
/** 运行暂停记录:当工具调用需要审批时暂停执行的完整记录 */
|
|
125
|
+
export type ShieldRunHold = {
|
|
126
|
+
holdId: string;
|
|
127
|
+
approvalId: string;
|
|
128
|
+
incidentId: string;
|
|
129
|
+
createdAt: number;
|
|
130
|
+
status: ShieldRunHoldStatus;
|
|
131
|
+
category: ShieldApprovalCategory;
|
|
132
|
+
severity: ShieldSeverity;
|
|
133
|
+
reason: string;
|
|
134
|
+
agentId?: string;
|
|
135
|
+
runId?: string;
|
|
136
|
+
sessionId?: string;
|
|
137
|
+
/** 被暂停的工具名称 */
|
|
138
|
+
toolName: string;
|
|
139
|
+
/** 被暂停的工具参数 */
|
|
140
|
+
toolParams?: Record<string, unknown>;
|
|
141
|
+
/** 工具参数的哈希值(用于唯一标识) */
|
|
142
|
+
toolParamsHash: string;
|
|
143
|
+
/** 暂停时所处的护盾阶段 */
|
|
144
|
+
stageAtHold: ShieldStage;
|
|
145
|
+
/** 暂停时的失败模式 */
|
|
146
|
+
failModeAtHold: ShieldFailMode;
|
|
147
|
+
source?: string;
|
|
148
|
+
externalApprovalId?: string;
|
|
149
|
+
resolvedAt?: number;
|
|
150
|
+
expiredAt?: number;
|
|
151
|
+
cancelledAt?: number;
|
|
152
|
+
cancelledBy?: string;
|
|
153
|
+
resumedAt?: number;
|
|
154
|
+
resumeRequestedAt?: number;
|
|
155
|
+
resumedBy?: string;
|
|
156
|
+
note?: string;
|
|
157
|
+
};
|
|
158
|
+
/** 安全事件记录:每次策略评估产生的安全事件 */
|
|
159
|
+
export type ShieldIncident = {
|
|
160
|
+
id: string;
|
|
161
|
+
timestamp: number;
|
|
162
|
+
surface: ShieldSurface;
|
|
163
|
+
agentId?: string;
|
|
164
|
+
runId?: string;
|
|
165
|
+
sessionId?: string;
|
|
166
|
+
/** 原始动作(策略评估的原始结果) */
|
|
167
|
+
rawAction: ShieldRuleAction;
|
|
168
|
+
/** 生效动作(考虑模拟模式等因素后的实际动作) */
|
|
169
|
+
effectiveAction: ShieldRuleAction;
|
|
170
|
+
blockReason?: string;
|
|
171
|
+
severity: ShieldSeverity;
|
|
172
|
+
tags: string[];
|
|
173
|
+
/** 采样数据(用于调试/审计) */
|
|
174
|
+
sample?: Record<string, unknown>;
|
|
175
|
+
};
|
|
176
|
+
/** 策略评估结果:策略评估器返回的完整结果,包含动作、脱敏、匹配规则、审批请求等 */
|
|
177
|
+
export type ShieldPolicyResult = {
|
|
178
|
+
/** 原始动作(策略原始判定) */
|
|
179
|
+
rawAction: ShieldRuleAction;
|
|
180
|
+
/** 生效动作(考虑阶段/模拟后的实际动作) */
|
|
181
|
+
effectiveAction: ShieldRuleAction;
|
|
182
|
+
severity: ShieldSeverity;
|
|
183
|
+
blockReason?: string;
|
|
184
|
+
/** 是否为模拟拦截(仅记录不实际拦截) */
|
|
185
|
+
simulatedBlock: boolean;
|
|
186
|
+
/** 是否为模拟脱敏 */
|
|
187
|
+
simulatedRedaction: boolean;
|
|
188
|
+
/** 脱敏操作列表 */
|
|
189
|
+
redactions: ShieldRedaction[];
|
|
190
|
+
/** 各字段脱敏后的完整值,供宿主侧真正改写消息/持久化内容 */
|
|
191
|
+
redactedTexts?: Record<string, string>;
|
|
192
|
+
/** 命中的规则列表 */
|
|
193
|
+
matched: ShieldMatch[];
|
|
194
|
+
/** 已应用的例外规则 ID 列表 */
|
|
195
|
+
appliedExceptions: string[];
|
|
196
|
+
/** 脱敏规则列表 */
|
|
197
|
+
redactionRules: CompiledShieldRule[];
|
|
198
|
+
tags: string[];
|
|
199
|
+
/** 评估耗时(毫秒) */
|
|
200
|
+
durationMs: number;
|
|
201
|
+
/** 检测发现列表 */
|
|
202
|
+
findings?: ShieldPolicyFinding[];
|
|
203
|
+
/** 钩子修改列表 */
|
|
204
|
+
modifications?: ShieldHookModification[];
|
|
205
|
+
/** 审批请求(如需人工审批) */
|
|
206
|
+
approvalRequest?: ShieldApprovalRequest;
|
|
207
|
+
/** 运行暂停请求 */
|
|
208
|
+
runHold?: ShieldRunHold;
|
|
209
|
+
};
|
|
210
|
+
/** 钩子结果:返回给宿主平台的最终结果,包含动作、修改、发现和审计日志 */
|
|
211
|
+
export type ShieldHookResult = {
|
|
212
|
+
/** 最终动作 */
|
|
213
|
+
action: ShieldHookAction;
|
|
214
|
+
/** 需要应用的修改(如脱敏) */
|
|
215
|
+
modifications: ShieldHookModification[];
|
|
216
|
+
/** 决策动作(与 action 一致) */
|
|
217
|
+
decision: ShieldHookAction;
|
|
218
|
+
/** 决策原因描述 */
|
|
219
|
+
reason: string;
|
|
220
|
+
/** 检测发现列表 */
|
|
221
|
+
findings: ShieldPolicyFinding[];
|
|
222
|
+
/** 审计日志数据 */
|
|
223
|
+
auditLog: Record<string, unknown> | null;
|
|
224
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RUNTIME_GUARDRAIL_VERSION = "0.1.19";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "runtime-guardrail",
|
|
3
|
+
"name": "Runtime Guardrail",
|
|
4
|
+
"description": "OpenClaw runtime guardrail plugin with remote policy, bundled guardrail config, skills upload, and telemetry.",
|
|
5
|
+
"version": "0.1.19",
|
|
6
|
+
"configSchema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"skillsUpload": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"properties": {
|
|
14
|
+
"enabled": {
|
|
15
|
+
"type": "boolean"
|
|
16
|
+
},
|
|
17
|
+
"force": {
|
|
18
|
+
"type": "boolean"
|
|
19
|
+
},
|
|
20
|
+
"timeoutMs": {
|
|
21
|
+
"type": "number"
|
|
22
|
+
},
|
|
23
|
+
"contentType": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"remoteGuard": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"additionalProperties": false,
|
|
31
|
+
"properties": {
|
|
32
|
+
"configPath": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"minLength": 1
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"uiHints": {
|
|
41
|
+
"skillsUpload.enabled": {
|
|
42
|
+
"label": "启用 Skills 上传",
|
|
43
|
+
"group": "Skills 上传",
|
|
44
|
+
"order": 10
|
|
45
|
+
},
|
|
46
|
+
"skillsUpload.force": {
|
|
47
|
+
"label": "强制上传",
|
|
48
|
+
"help": "忽略本地去重缓存,强制重新打包并上传。",
|
|
49
|
+
"group": "Skills 上传",
|
|
50
|
+
"order": 20,
|
|
51
|
+
"advanced": true
|
|
52
|
+
},
|
|
53
|
+
"skillsUpload.timeoutMs": {
|
|
54
|
+
"label": "上传超时(毫秒)",
|
|
55
|
+
"group": "Skills 上传",
|
|
56
|
+
"order": 30,
|
|
57
|
+
"advanced": true,
|
|
58
|
+
"placeholder": "10000"
|
|
59
|
+
},
|
|
60
|
+
"skillsUpload.contentType": {
|
|
61
|
+
"label": "上传 Content-Type",
|
|
62
|
+
"group": "Skills 上传",
|
|
63
|
+
"order": 40,
|
|
64
|
+
"advanced": true,
|
|
65
|
+
"placeholder": "application/zip"
|
|
66
|
+
},
|
|
67
|
+
"remoteGuard.configPath": {
|
|
68
|
+
"label": "远端配置文件路径",
|
|
69
|
+
"help": "默认读取插件随包发布的 remote-guard-config.json;仅在需要覆盖基础静态配置时再指定自定义路径。",
|
|
70
|
+
"group": "远端配置",
|
|
71
|
+
"order": 100,
|
|
72
|
+
"advanced": true,
|
|
73
|
+
"placeholder": "/absolute/path/to/remote-guard-config.json"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@carfiedli/runtime-guardrail",
|
|
3
|
+
"version": "0.1.19",
|
|
4
|
+
"description": "OpenClaw runtime guardrail plugin with remote policy, bundled guardrail config, skills upload, and telemetry.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"runtime-guardrailctl": "scripts/runtime-guardrailctl.mjs"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"openclaw.plugin.json",
|
|
14
|
+
"remote-guard-config.json",
|
|
15
|
+
"scripts/runtime-guardrailctl.mjs",
|
|
16
|
+
"README.md",
|
|
17
|
+
"README.hooks-security.md"
|
|
18
|
+
],
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"registry": "https://registry.npmjs.org/",
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"openclaw": {
|
|
27
|
+
"extensions": [
|
|
28
|
+
"./dist/index.js"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "node build.mjs",
|
|
33
|
+
"build:tsc": "tsc -p tsconfig.json",
|
|
34
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
35
|
+
"clean": "rm -rf dist",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"test:watch": "vitest",
|
|
38
|
+
"sync:plugin-version": "node scripts/sync-plugin-version.mjs",
|
|
39
|
+
"verify:plugin-version": "node scripts/sync-plugin-version.mjs --check",
|
|
40
|
+
"verify:release": "npm run sync:plugin-version && npm run clean && npm run check && npm run build",
|
|
41
|
+
"prepack": "npm run sync:plugin-version && npm run clean && npm run build",
|
|
42
|
+
"prepublishOnly": "npm run verify:release",
|
|
43
|
+
"publish": "node scripts/publish-internal.mjs",
|
|
44
|
+
"publish:dry-run": "node scripts/publish-internal.mjs --dry-run",
|
|
45
|
+
"publish:public": "npm run build && node scripts/publish-public.mjs",
|
|
46
|
+
"publish:public:dry-run": "npm run build && node scripts/publish-public.mjs --dry-run",
|
|
47
|
+
"demo": "RUNTIME_GUARDRAIL_POLICY_MODE=remote npx tsx demo/run.ts",
|
|
48
|
+
"smoke:openclaw": "npm run smoke:openclaw:remote",
|
|
49
|
+
"smoke:openclaw:remote": "openclaw gateway call shield.status --json | cat",
|
|
50
|
+
"openclaw:install:global": "node scripts/runtime-guardrailctl.mjs install --global",
|
|
51
|
+
"openclaw:update:global": "node scripts/runtime-guardrailctl.mjs update --global",
|
|
52
|
+
"openclaw:set-api-key:global": "node scripts/runtime-guardrailctl.mjs set-api-key --global",
|
|
53
|
+
"sync:openclaw": "bash scripts/sync-openclaw-extension.sh",
|
|
54
|
+
"sync:openclaw:current": "bash scripts/sync-openclaw-current.sh",
|
|
55
|
+
"sync:openclaw:current:restart": "bash scripts/sync-openclaw-current.sh --restart",
|
|
56
|
+
"fe": "cd frontend && npm run dev",
|
|
57
|
+
"build:fe": "cd frontend && tea build",
|
|
58
|
+
"fe:simple": "browser-sync start --server 'frontend/vanilla' --files 'frontend/vanilla/**/*' --port 8080"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"json5": "^2.2.3"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@types/node": "^25.5.0",
|
|
65
|
+
"browser-sync": "^3.0.4",
|
|
66
|
+
"esbuild": "^0.27.4",
|
|
67
|
+
"tsx": "^4.21.0",
|
|
68
|
+
"typescript": "^5.6.3",
|
|
69
|
+
"vitest": "^4.0.18"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"enabled": true,
|
|
3
|
+
"server": {
|
|
4
|
+
"ip": "116.31.68.64",
|
|
5
|
+
"port": 80,
|
|
6
|
+
"path": "/v1/ai-guard",
|
|
7
|
+
"corPresignPath": "/v1/upload/presign",
|
|
8
|
+
"detectPath": "/v1/skill-detection/submit"
|
|
9
|
+
},
|
|
10
|
+
"websocket": {
|
|
11
|
+
"port": 80,
|
|
12
|
+
"protocol": "ws"
|
|
13
|
+
},
|
|
14
|
+
"auth": {
|
|
15
|
+
"key": ""
|
|
16
|
+
},
|
|
17
|
+
"identity": {
|
|
18
|
+
"agentId": "carfiedli_agent_001"
|
|
19
|
+
},
|
|
20
|
+
"telemetry": {
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"heartbeatIntervalMs": 60000,
|
|
23
|
+
"dataReportIntervalMs": 600000
|
|
24
|
+
},
|
|
25
|
+
"options": {
|
|
26
|
+
"timeoutMs": 60000,
|
|
27
|
+
"syncHookTimeoutMs": 500,
|
|
28
|
+
"skillsStateDir": ".tmp-skills-state"
|
|
29
|
+
}
|
|
30
|
+
}
|