principles-disciple 2.5.0 → 2.6.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/dist/bundle.js +493 -481
- package/dist/config/defaults/runtime.d.ts +0 -4
- package/dist/core/config.d.ts +0 -35
- package/dist/core/pain.d.ts +0 -1
- package/dist/core/session-tracker.d.ts +3 -51
- package/dist/core/signal-collector-host.d.ts +5 -13
- package/dist/core/signal-keyword-store.d.ts +2 -2
- package/dist/core/trajectory.d.ts +0 -2
- package/dist/governance-audit.js +2 -2
- package/dist/hooks/after-tool-call-helpers.d.ts +5 -12
- package/dist/hooks/after-tool-call-types.d.ts +0 -2
- package/dist/hooks/gate-block-helper.d.ts +1 -1
- package/dist/hooks/gate.d.ts +3 -4
- package/dist/hooks/pain.d.ts +4 -4
- package/dist/openclaw.plugin.json +1 -1
- package/dist/rulehost-evidence.js +45 -45
- package/dist/templates/pain_settings.json +0 -46
- package/dist/types/event-types.d.ts +1 -1
- package/mcp/launcher.cjs +215 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +4 -4
- package/templates/pain_settings.json +0 -46
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { EventType, EventCategory, EventLogEntry, ToolCallEventData, PainSignalEventData, RulePromotionEventData, GovernanceActionEventData, HookExecutionEventData, GateBlockEventData, GateBypassEventData, EvolutionTaskEventData, EmpathyRollbackEventData, HeartbeatDiagnosisEventData, DiagnosisTaskEventData, DiagnosticianReportEventData, PrincipleCandidateEventData, RuleEnforcedEventData, RuleHostEvaluatedEventData, RuleHostBlockedEventData, RuleHostRequireApprovalEventData, RuleHostAutoCorrectProposedEventData, RuleHostAutoCorrectAppliedEventData, RuntimeV2PromptActivationsInjectedEventData, RuleHostUnhealthyEventData, RuleHostSkippedEventData, TrajectoryObservabilityFailureEventData, ToolCallStats, ErrorStats, EmpathyEventStats,
|
|
1
|
+
export type { EventType, EventCategory, EventLogEntry, ToolCallEventData, PainSignalEventData, RulePromotionEventData, GovernanceActionEventData, HookExecutionEventData, GateBlockEventData, GateBypassEventData, EvolutionTaskEventData, EmpathyRollbackEventData, HeartbeatDiagnosisEventData, DiagnosisTaskEventData, DiagnosticianReportEventData, PrincipleCandidateEventData, RuleEnforcedEventData, RuleHostEvaluatedEventData, RuleHostBlockedEventData, RuleHostRequireApprovalEventData, RuleHostAutoCorrectProposedEventData, RuleHostAutoCorrectAppliedEventData, RuntimeV2PromptActivationsInjectedEventData, RuleHostUnhealthyEventData, RuleHostSkippedEventData, TrajectoryObservabilityFailureEventData, ToolCallStats, ErrorStats, EmpathyEventStats, HookStats, DailyStats, } from '@principles/core/runtime-v2';
|
|
2
2
|
export { createEmptyDailyStats, } from '@principles/core/runtime-v2/types/event-types';
|
package/mcp/launcher.cjs
CHANGED
|
@@ -36,6 +36,7 @@ const fs = require('fs');
|
|
|
36
36
|
const os = require('os');
|
|
37
37
|
const path = require('path');
|
|
38
38
|
const { pathToFileURL } = require('url');
|
|
39
|
+
const crypto = require('crypto');
|
|
39
40
|
|
|
40
41
|
const BINDING_SCHEMA = 'pd.mcp-binding.v1';
|
|
41
42
|
// Ownership stamp (SPEC §7.5/§11.3): installers and `pd health` prove that a
|
|
@@ -60,7 +61,200 @@ const SERVER_ENTRY_SEGMENTS = {
|
|
|
60
61
|
const SERVER_PACKAGE_NAME = '@principles/pd-mcp-server';
|
|
61
62
|
const SEMVER = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
62
63
|
|
|
64
|
+
// ── Durable observability log (default ON, PD_MCP_LOG=0 disables) ──────────
|
|
65
|
+
// Same file contract as the server: ~/.pd/logs/mcp, one JSONL file per
|
|
66
|
+
// process, 2 MiB/file, 64 MiB/dir, 14 days retention. The launcher writes
|
|
67
|
+
// `launcher_start` / `startup_failure` and then hands the SAME file to the
|
|
68
|
+
// server through PD_MCP_LOG_FILE (basename only) so a process keeps one file.
|
|
69
|
+
// Everything here is best-effort: a logging failure never changes the
|
|
70
|
+
// fail-closed decision or the stderr line the host parses.
|
|
71
|
+
const LAUNCHER_VERSION = 'pd-mcp-launcher.v1';
|
|
72
|
+
const LOG_MAX_FILE_BYTES = 2 * 1024 * 1024;
|
|
73
|
+
const LOG_MAX_DIR_BYTES = 64 * 1024 * 1024;
|
|
74
|
+
const LOG_RETENTION_MS = 14 * 24 * 60 * 60 * 1000;
|
|
75
|
+
const LOG_MAX_SHARDS = 3;
|
|
76
|
+
const LOG_DISABLED = ['0', 'false', 'off'].includes(String(process.env.PD_MCP_LOG || '').trim().toLowerCase());
|
|
77
|
+
const INITIAL_ENV_PRESENCE = Object.freeze({
|
|
78
|
+
PD_MCP_WORKSPACE_DIR: typeof process.env.PD_MCP_WORKSPACE_DIR === 'string' && process.env.PD_MCP_WORKSPACE_DIR.length > 0,
|
|
79
|
+
PD_MCP_HOST: typeof process.env.PD_MCP_HOST === 'string' && process.env.PD_MCP_HOST.length > 0,
|
|
80
|
+
PD_WORKSPACE_DIR: typeof process.env.PD_WORKSPACE_DIR === 'string' && process.env.PD_WORKSPACE_DIR.length > 0,
|
|
81
|
+
OPENCLAW_WORKSPACE: typeof process.env.OPENCLAW_WORKSPACE === 'string' && process.env.OPENCLAW_WORKSPACE.length > 0,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const logState = {
|
|
85
|
+
host: 'unknown',
|
|
86
|
+
bindingPathExists: false,
|
|
87
|
+
workspaceResolution: 'not_checked',
|
|
88
|
+
seq: 0,
|
|
89
|
+
runId: null,
|
|
90
|
+
fileName: null,
|
|
91
|
+
currentPath: null,
|
|
92
|
+
bytes: 0,
|
|
93
|
+
shard: 1,
|
|
94
|
+
exhausted: false,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
function pad(value, width) {
|
|
98
|
+
return String(value).padStart(width || 2, '0');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function localTimestamp(date) {
|
|
102
|
+
const offsetMinutes = -date.getTimezoneOffset();
|
|
103
|
+
const sign = offsetMinutes >= 0 ? '+' : '-';
|
|
104
|
+
const abs = Math.abs(offsetMinutes);
|
|
105
|
+
return {
|
|
106
|
+
ts:
|
|
107
|
+
`${pad(date.getFullYear(), 4)}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}` +
|
|
108
|
+
`T${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}.${pad(date.getMilliseconds(), 3)}` +
|
|
109
|
+
`${sign}${pad(Math.floor(abs / 60))}:${pad(abs % 60)}`,
|
|
110
|
+
tzOffsetMinutes: offsetMinutes,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function logDir() {
|
|
115
|
+
const override = process.env.PD_MCP_LOG_DIR;
|
|
116
|
+
if (typeof override === 'string' && override.trim().length > 0) return path.resolve(override);
|
|
117
|
+
return path.join(os.homedir(), '.pd', 'logs', 'mcp');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function sanitizeSegment(value) {
|
|
121
|
+
const cleaned = String(value).replace(/[^A-Za-z0-9_-]/g, '').slice(0, 40);
|
|
122
|
+
return cleaned.length > 0 ? cleaned : 'unknown';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function listOwnLogFiles(dir) {
|
|
126
|
+
try {
|
|
127
|
+
return fs.readdirSync(dir, { withFileTypes: true })
|
|
128
|
+
.filter((entry) => entry.isFile() && /^mcp-.*\.jsonl$/.test(entry.name))
|
|
129
|
+
.map((entry) => {
|
|
130
|
+
const fullPath = path.join(dir, entry.name);
|
|
131
|
+
try {
|
|
132
|
+
const stat = fs.statSync(fullPath);
|
|
133
|
+
return { fullPath, size: stat.size, mtimeMs: stat.mtimeMs };
|
|
134
|
+
} catch {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
.filter((file) => file !== null);
|
|
139
|
+
} catch {
|
|
140
|
+
return [];
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function maintainLogDir(dir, nowMs, keepPath) {
|
|
145
|
+
try {
|
|
146
|
+
const survivors = [];
|
|
147
|
+
for (const file of listOwnLogFiles(dir)) {
|
|
148
|
+
if (nowMs - file.mtimeMs > LOG_RETENTION_MS && file.fullPath !== keepPath) {
|
|
149
|
+
try {
|
|
150
|
+
fs.unlinkSync(file.fullPath);
|
|
151
|
+
continue;
|
|
152
|
+
} catch {
|
|
153
|
+
// Keep it.
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
survivors.push(file);
|
|
157
|
+
}
|
|
158
|
+
let total = survivors.reduce((sum, file) => sum + file.size, 0);
|
|
159
|
+
if (total <= LOG_MAX_DIR_BYTES) return;
|
|
160
|
+
for (const file of survivors.filter((f) => f.fullPath !== keepPath).sort((a, b) => a.mtimeMs - b.mtimeMs)) {
|
|
161
|
+
if (total <= LOG_MAX_DIR_BYTES) break;
|
|
162
|
+
try {
|
|
163
|
+
fs.unlinkSync(file.fullPath);
|
|
164
|
+
total -= file.size;
|
|
165
|
+
} catch {
|
|
166
|
+
// Leave it.
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
} catch {
|
|
170
|
+
// Maintenance is advisory only.
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function ensureLogFile() {
|
|
175
|
+
if (LOG_DISABLED) return null;
|
|
176
|
+
if (logState.currentPath !== null) return logState.currentPath;
|
|
177
|
+
try {
|
|
178
|
+
const dir = logDir();
|
|
179
|
+
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
180
|
+
if (!fs.statSync(dir).isDirectory()) return null;
|
|
181
|
+
maintainLogDir(dir, Date.now(), null);
|
|
182
|
+
const stamp = new Date().toISOString().replace(/[-:]/g, '').replace(/\..+$/, 'Z');
|
|
183
|
+
logState.fileName = `mcp-${sanitizeSegment(logState.host)}-${process.pid}-${stamp}.jsonl`;
|
|
184
|
+
logState.runId = crypto.randomBytes(4).toString('hex');
|
|
185
|
+
logState.currentPath = path.join(dir, logState.fileName);
|
|
186
|
+
try {
|
|
187
|
+
logState.bytes = fs.statSync(logState.currentPath).size;
|
|
188
|
+
} catch {
|
|
189
|
+
logState.bytes = 0;
|
|
190
|
+
}
|
|
191
|
+
return logState.currentPath;
|
|
192
|
+
} catch {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function writeLogEvent(level, event, fields) {
|
|
198
|
+
try {
|
|
199
|
+
const file = ensureLogFile();
|
|
200
|
+
if (file === null) return;
|
|
201
|
+
const dir = path.dirname(file);
|
|
202
|
+
const stamp = localTimestamp(new Date());
|
|
203
|
+
const entry = Object.assign(
|
|
204
|
+
{
|
|
205
|
+
ts: stamp.ts,
|
|
206
|
+
tzOffsetMinutes: stamp.tzOffsetMinutes,
|
|
207
|
+
runId: logState.runId,
|
|
208
|
+
seq: (logState.seq += 1),
|
|
209
|
+
server: 'pd-mcp-launcher',
|
|
210
|
+
version: LAUNCHER_VERSION,
|
|
211
|
+
level,
|
|
212
|
+
event,
|
|
213
|
+
host: logState.host,
|
|
214
|
+
pid: process.pid,
|
|
215
|
+
},
|
|
216
|
+
fields
|
|
217
|
+
);
|
|
218
|
+
const line = JSON.stringify(entry) + '\n';
|
|
219
|
+
const bytes = Buffer.byteLength(line, 'utf8');
|
|
220
|
+
if (logState.exhausted || logState.bytes + bytes > LOG_MAX_FILE_BYTES) {
|
|
221
|
+
if (logState.shard >= LOG_MAX_SHARDS) {
|
|
222
|
+
logState.exhausted = true;
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
logState.shard += 1;
|
|
226
|
+
logState.currentPath = path.join(dir, logState.fileName.replace(/\.jsonl$/, `-${logState.shard}.jsonl`));
|
|
227
|
+
logState.bytes = 0;
|
|
228
|
+
maintainLogDir(dir, Date.now(), logState.currentPath);
|
|
229
|
+
}
|
|
230
|
+
fs.appendFileSync(logState.currentPath, line, { mode: 0o600 });
|
|
231
|
+
logState.bytes += bytes;
|
|
232
|
+
} catch {
|
|
233
|
+
// Logging must never affect launch behaviour.
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** Hand the same file/runId/seq to the server so one process keeps one file. */
|
|
238
|
+
function shareLogFileWithServer() {
|
|
239
|
+
try {
|
|
240
|
+
if (logState.fileName === null) ensureLogFile();
|
|
241
|
+
if (logState.fileName === null) return;
|
|
242
|
+
process.env.PD_MCP_LOG_FILE = path.basename(logState.fileName);
|
|
243
|
+
process.env.PD_MCP_LOG_RUN_ID = logState.runId;
|
|
244
|
+
process.env.PD_MCP_LOG_SEQ = String(logState.seq);
|
|
245
|
+
} catch {
|
|
246
|
+
// The server then opens its own file — still bounded, still silent.
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
63
250
|
function fail(reason, nextAction) {
|
|
251
|
+
writeLogEvent('error', 'startup_failure', {
|
|
252
|
+
stage: 'launcher',
|
|
253
|
+
reason: String(reason).replace(/[^A-Za-z0-9_.:-]/g, '').slice(0, 120),
|
|
254
|
+
bindingPathExists: logState.bindingPathExists,
|
|
255
|
+
workspaceResolution: logState.workspaceResolution,
|
|
256
|
+
envPresence: INITIAL_ENV_PRESENCE,
|
|
257
|
+
});
|
|
64
258
|
process.stderr.write(JSON.stringify({ launcher: 'pd-mcp', status: 'failed', reason, nextAction }) + '\n');
|
|
65
259
|
process.exit(1);
|
|
66
260
|
}
|
|
@@ -179,12 +373,19 @@ if (detectedHosts.length !== 1) {
|
|
|
179
373
|
);
|
|
180
374
|
}
|
|
181
375
|
const host = detectedHosts[0];
|
|
376
|
+
logState.host = host;
|
|
182
377
|
|
|
183
378
|
// rc-1/rc-3/rc-5: the binding file is read as untrusted; every field is
|
|
184
379
|
// validated before use and unknown content is never coerced.
|
|
380
|
+
const bindingPath = path.join(pluginRoot, 'mcp-binding.json');
|
|
381
|
+
try {
|
|
382
|
+
logState.bindingPathExists = fs.statSync(bindingPath).isFile();
|
|
383
|
+
} catch {
|
|
384
|
+
logState.bindingPathExists = false;
|
|
385
|
+
}
|
|
185
386
|
let raw;
|
|
186
387
|
try {
|
|
187
|
-
raw = fs.readFileSync(
|
|
388
|
+
raw = fs.readFileSync(bindingPath, 'utf8');
|
|
188
389
|
} catch {
|
|
189
390
|
fail('binding_missing', 'Re-run the PD host setup (Codex: $pd-control setup) so mcp-binding.json is written into the plugin directory.');
|
|
190
391
|
}
|
|
@@ -294,6 +495,7 @@ try {
|
|
|
294
495
|
if (!workspaceStat.isDirectory()) {
|
|
295
496
|
fail('binding_workspace_not_directory', 'Re-run the PD host setup so the binding points at the governance workspace directory.');
|
|
296
497
|
}
|
|
498
|
+
logState.workspaceResolution = 'ok';
|
|
297
499
|
|
|
298
500
|
// ── OpenClaw workspace-declaration gate (SPEC §3.5, final safety closure) ──
|
|
299
501
|
// The OpenClaw binding is HOST-WIDE while agents have per-agent workspaces, so
|
|
@@ -328,6 +530,18 @@ if (host === 'openclaw') {
|
|
|
328
530
|
process.env.PD_MCP_WORKSPACE_DIR = binding.workspaceDir;
|
|
329
531
|
process.env.PD_MCP_HOST = host;
|
|
330
532
|
|
|
533
|
+
// Validation is complete: record the launch attempt (version, binding
|
|
534
|
+
// presence, workspace resolution and env PRESENCE — never values) and then
|
|
535
|
+
// share this file with the server.
|
|
536
|
+
writeLogEvent('info', 'launcher_start', {
|
|
537
|
+
launcherVersion: LAUNCHER_VERSION,
|
|
538
|
+
mcpServerVersion: packageManifest.version,
|
|
539
|
+
bindingPathExists: logState.bindingPathExists,
|
|
540
|
+
workspaceResolution: logState.workspaceResolution,
|
|
541
|
+
envPresence: INITIAL_ENV_PRESENCE,
|
|
542
|
+
});
|
|
543
|
+
shareLogFileWithServer();
|
|
544
|
+
|
|
331
545
|
// Run the shared server entry in-process (single process per host). Nothing
|
|
332
546
|
// above imports the server, so a rejected binding never emits MCP traffic.
|
|
333
547
|
import(pathToFileURL(realEntry).href)
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.6.1",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "principles-disciple",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"compile-principles": "node scripts/compile-principles.mjs"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@principles/core": "^
|
|
80
|
-
"@principles/host-runtime": "^
|
|
79
|
+
"@principles/core": "^4.0.1",
|
|
80
|
+
"@principles/host-runtime": "^2.0.1",
|
|
81
81
|
"@types/better-sqlite3": "^9.6.0",
|
|
82
82
|
"@types/js-yaml": "^4.0.9",
|
|
83
83
|
"@types/micromatch": "^4.0.10",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"js-yaml": "^5.4.3",
|
|
110
110
|
"micromatch": "^4.0.8"
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "d9bbe994104eac08a8a41fa1c9374f28dc629aec"
|
|
113
113
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"language": "zh",
|
|
3
3
|
"thresholds": {
|
|
4
|
-
"pain_trigger": 40,
|
|
5
4
|
"cognitive_paralysis_input": 4000,
|
|
6
5
|
"semantic_min_score": 0.7,
|
|
7
6
|
"promotion_count_threshold": 3,
|
|
@@ -10,18 +9,12 @@
|
|
|
10
9
|
"scores": {
|
|
11
10
|
"default_confusion": 30,
|
|
12
11
|
"default_loop": 40,
|
|
13
|
-
"tool_failure_friction": 15,
|
|
14
12
|
"exit_code_penalty": 50,
|
|
15
13
|
"spiral_penalty": 30,
|
|
16
14
|
"missing_test_command_penalty": 20,
|
|
17
15
|
"subagent_error_penalty": 60,
|
|
18
16
|
"subagent_timeout_penalty": 50
|
|
19
17
|
},
|
|
20
|
-
"severity_thresholds": {
|
|
21
|
-
"high": 70,
|
|
22
|
-
"medium": 40,
|
|
23
|
-
"low": 20
|
|
24
|
-
},
|
|
25
18
|
"trust": {
|
|
26
19
|
"stages": {
|
|
27
20
|
"stage_1_observer": 30,
|
|
@@ -52,44 +45,5 @@
|
|
|
52
45
|
"stage_2_max_lines": 50,
|
|
53
46
|
"stage_3_max_lines": 300
|
|
54
47
|
}
|
|
55
|
-
},
|
|
56
|
-
"empathy_engine": {
|
|
57
|
-
"enabled": true,
|
|
58
|
-
"dedupe_window_ms": 60000,
|
|
59
|
-
"penalties": {
|
|
60
|
-
"mild": 10,
|
|
61
|
-
"moderate": 25,
|
|
62
|
-
"severe": 40
|
|
63
|
-
},
|
|
64
|
-
"rate_limit": {
|
|
65
|
-
"max_per_turn": 40,
|
|
66
|
-
"max_per_hour": 120
|
|
67
|
-
},
|
|
68
|
-
"model_calibration": {}
|
|
69
|
-
},
|
|
70
|
-
"gfi_gate": {
|
|
71
|
-
"enabled": true,
|
|
72
|
-
"thresholds": {
|
|
73
|
-
"low_risk_block": 70,
|
|
74
|
-
"high_risk_block": 40,
|
|
75
|
-
"large_change_block": 50
|
|
76
|
-
},
|
|
77
|
-
"large_change_lines": 50,
|
|
78
|
-
"bash_safe_patterns": [
|
|
79
|
-
"^(ls|dir|pwd|which|where|echo|env|cat|type|head|tail|less|more)\\b",
|
|
80
|
-
"^git\\s+(status|log|diff|branch|show|remote)\\b",
|
|
81
|
-
"^npm\\s+(run|test|build|start)\\b",
|
|
82
|
-
"^(make|gradle|mvn)\\b"
|
|
83
|
-
],
|
|
84
|
-
"bash_dangerous_patterns": [
|
|
85
|
-
"rm\\s+(-[a-z]*r[a-z]*f|-rf)",
|
|
86
|
-
"del\\s+/s",
|
|
87
|
-
"rmdir\\s+/s",
|
|
88
|
-
"git\\s+(push\\s+.*--force|reset\\s+--hard|clean\\s+-fd)",
|
|
89
|
-
"npm\\s+publish",
|
|
90
|
-
"pip\\s+upload",
|
|
91
|
-
"docker\\s+push",
|
|
92
|
-
"(curl|wget).*\\|\\s*(ba)?sh"
|
|
93
|
-
]
|
|
94
48
|
}
|
|
95
49
|
}
|