@kenhkl/agent-moss 0.17.40 → 0.17.42

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.
@@ -42,10 +42,19 @@ interface SecurityJudgment {
42
42
  source: string;
43
43
  violatedLayers: string[];
44
44
  isCredential?: boolean;
45
+ /** 原命中的路径规则明确禁止读取时赋值,供内联读取确认复核 */
46
+ deniedReadPath?: string;
45
47
  /** 组合式拦截的结构化攻击链(前端可视化用) */
46
48
  violationGraph?: AttackChainGraph | null;
47
49
  /** 兼容旧调用方:反例路径数组 */
48
50
  violationChain?: unknown[];
51
+ /** L2 不确定但值得 L3 关注的结构化提示(不拦截,只注入 L3) */
52
+ l3Hint?: string;
53
+ /** 本次判定的能力降级说明(空 = 全层完整跑过) */
54
+ degraded?: string[];
55
+ /** Deny 但建议向用户确认(如 L3 fail_closed) */
56
+ ask_recommended?: boolean;
57
+ ask_reason?: string;
49
58
  }
50
59
 
51
60
  /** 把命令按 shell 的连接符切成若干段,去掉空白段。
@@ -123,10 +132,17 @@ interface AnalysisInput {
123
132
  declare const TRUSTED_SKILLS_BASE: Set<string>;
124
133
 
125
134
  declare function whitelistTier(command: string, fullySafe: RegExp[], readonlySensitive: RegExp[]): 'full' | 'readonly' | '';
135
+ /**
136
+ * 仅复核和内联脚本并列的一条普通命令,复杂 shell 继续原暂缓流程。
137
+ *
138
+ * 镜像 Python `_independent_file_command`:`cat /etc/shadow && python3 -c ...`
139
+ * 这种「真实文件命令 + 内联脚本」不能因为后半段是内联脚本就整体豁免 L1。
140
+ */
141
+ declare function independentFileCommand(command: string, osType: string): string;
126
142
  /** 导出供白名单测试直接断言;正则都带 /i 且无 /g,test() 无 lastIndex 副作用 */
127
143
  declare function matchesAny(cmd: string, patterns: RegExp[]): boolean;
128
144
  /** 供测试隔离:重置 brain 单例 */
129
145
  declare function _resetBrainForTest(): void;
130
146
  declare function runAnalysis(input: AnalysisInput): Promise<SecurityJudgment>;
131
147
 
132
- export { type AnalysisInput, TRUSTED_SKILLS_BASE, _resetBrainForTest, extractFirstCommand, matchesAny, runAnalysis, splitCommandSegments, whitelistTier };
148
+ export { type AnalysisInput, TRUSTED_SKILLS_BASE, _resetBrainForTest, extractFirstCommand, independentFileCommand, matchesAny, runAnalysis, splitCommandSegments, whitelistTier };