dsh-permission-rules 0.2.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/CHANGELOG.md +50 -0
- package/LICENSE +201 -0
- package/README.es.md +182 -0
- package/README.hi.md +182 -0
- package/README.md +182 -0
- package/README.pt.md +182 -0
- package/README.zh.md +182 -0
- package/cordis.patch.yml +16 -0
- package/docs/rules-format.en.md +105 -0
- package/docs/rules-format.md +103 -0
- package/docs/rules-format.schema.json +117 -0
- package/lib/index.js +1606 -0
- package/lib/types/config.d.ts +83 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/config.js +72 -0
- package/lib/types/config.js.map +1 -0
- package/lib/types/events.d.ts +68 -0
- package/lib/types/events.d.ts.map +1 -0
- package/lib/types/events.js +21 -0
- package/lib/types/events.js.map +1 -0
- package/lib/types/glob.d.ts +55 -0
- package/lib/types/glob.d.ts.map +1 -0
- package/lib/types/glob.js +307 -0
- package/lib/types/glob.js.map +1 -0
- package/lib/types/index.d.ts +25 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +25 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/prose.d.ts +66 -0
- package/lib/types/prose.d.ts.map +1 -0
- package/lib/types/prose.js +143 -0
- package/lib/types/prose.js.map +1 -0
- package/lib/types/rules.d.ts +226 -0
- package/lib/types/rules.d.ts.map +1 -0
- package/lib/types/rules.js +581 -0
- package/lib/types/rules.js.map +1 -0
- package/lib/types/runtime.d.ts +175 -0
- package/lib/types/runtime.d.ts.map +1 -0
- package/lib/types/runtime.js +497 -0
- package/lib/types/runtime.js.map +1 -0
- package/package.json +103 -0
- package/scripts/repair-session-logs.mjs +327 -0
- package/src/config.ts +141 -0
- package/src/events.ts +75 -0
- package/src/glob.ts +303 -0
- package/src/index.ts +27 -0
- package/src/prose.ts +206 -0
- package/src/rules.ts +695 -0
- package/src/runtime.ts +504 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `dsh-permission-rules` — Claude Code-style declarative permission rules
|
|
3
|
+
* for DeepSeek Harness. A `tools/pre-execute` waterfall listener evaluates
|
|
4
|
+
* an ordered `allow`/`deny`/`ask` rule list (tool-name globs, argument
|
|
5
|
+
* glob/regex matching, workspace-path matching) per session cwd; deny and
|
|
6
|
+
* ask decisions short-circuit the chain, while allow and passthrough always
|
|
7
|
+
* delegate via `next()`. `ask` rides the official approval seam, where
|
|
8
|
+
* answerers such as `dsh-auto-review` or a human UI decide — the plugin
|
|
9
|
+
* itself never runs a reviewer. Every decision is audit-logged.
|
|
10
|
+
*
|
|
11
|
+
* Function plugin — no default export (the Loader unwraps
|
|
12
|
+
* `exports.default ?? exports`, and a stray default would discard
|
|
13
|
+
* `name`/`inject`/`Config`/`apply`).
|
|
14
|
+
* @module dsh-permission-rules
|
|
15
|
+
*/
|
|
16
|
+
import { apply } from './runtime.ts';
|
|
17
|
+
export declare const name = "permission-rules";
|
|
18
|
+
export declare const inject: string[];
|
|
19
|
+
export { apply };
|
|
20
|
+
export { PermissionRulesRuntime } from './runtime.ts';
|
|
21
|
+
export * from './config.ts';
|
|
22
|
+
export * from './events.ts';
|
|
23
|
+
export * from './rules.ts';
|
|
24
|
+
export * from './glob.ts';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEpC,eAAO,MAAM,IAAI,qBAAqB,CAAA;AACtC,eAAO,MAAM,MAAM,UAAwB,CAAA;AAE3C,OAAO,EAAE,KAAK,EAAE,CAAA;AAChB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AACrD,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `dsh-permission-rules` — Claude Code-style declarative permission rules
|
|
3
|
+
* for DeepSeek Harness. A `tools/pre-execute` waterfall listener evaluates
|
|
4
|
+
* an ordered `allow`/`deny`/`ask` rule list (tool-name globs, argument
|
|
5
|
+
* glob/regex matching, workspace-path matching) per session cwd; deny and
|
|
6
|
+
* ask decisions short-circuit the chain, while allow and passthrough always
|
|
7
|
+
* delegate via `next()`. `ask` rides the official approval seam, where
|
|
8
|
+
* answerers such as `dsh-auto-review` or a human UI decide — the plugin
|
|
9
|
+
* itself never runs a reviewer. Every decision is audit-logged.
|
|
10
|
+
*
|
|
11
|
+
* Function plugin — no default export (the Loader unwraps
|
|
12
|
+
* `exports.default ?? exports`, and a stray default would discard
|
|
13
|
+
* `name`/`inject`/`Config`/`apply`).
|
|
14
|
+
* @module dsh-permission-rules
|
|
15
|
+
*/
|
|
16
|
+
import { apply } from "./runtime.js";
|
|
17
|
+
export const name = 'permission-rules';
|
|
18
|
+
export const inject = ['commands', 'tools'];
|
|
19
|
+
export { apply };
|
|
20
|
+
export { PermissionRulesRuntime } from "./runtime.js";
|
|
21
|
+
export * from "./config.js";
|
|
22
|
+
export * from "./events.js";
|
|
23
|
+
export * from "./rules.js";
|
|
24
|
+
export * from "./glob.js";
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEpC,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAA;AACtC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;AAE3C,OAAO,EAAE,KAAK,EAAE,CAAA;AAChB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AACrD,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI-facing prose for the `/rules` session command, per language. Only the
|
|
3
|
+
* command surface localizes: rule `reason`s are author-provided and are
|
|
4
|
+
* never translated, and logger diagnostics stay English for greppability.
|
|
5
|
+
* `en` and `zh` are the reference translations; `es`/`pt`/`hi` are
|
|
6
|
+
* community-quality.
|
|
7
|
+
* @module dsh-permission-rules/prose
|
|
8
|
+
*/
|
|
9
|
+
/** Supported command-output languages. */
|
|
10
|
+
export type UiLanguage = 'en' | 'zh' | 'es' | 'pt' | 'hi';
|
|
11
|
+
/** The localized strings one language provides for the command surface. */
|
|
12
|
+
export interface UiProse {
|
|
13
|
+
/** Header line naming the active rules, their sources, and the workspace. */
|
|
14
|
+
rulesHeader: (count: number, sources: readonly string[], cwd: string) => string;
|
|
15
|
+
/** Line shown when no rule file is in effect. */
|
|
16
|
+
noRules: (cwd: string, fallbackNote: string) => string;
|
|
17
|
+
/** Note appended when a fallback path is configured but missing. */
|
|
18
|
+
fallbackMissing: string;
|
|
19
|
+
/** Success line of `/rules reload`. */
|
|
20
|
+
reloaded: (count: number, source: string) => string;
|
|
21
|
+
/** Error line of a failed reload. */
|
|
22
|
+
reloadFailed: (error: string) => string;
|
|
23
|
+
/** Warning appended to a listing whose last reload failed. */
|
|
24
|
+
lastReloadWarning: (error: string) => string;
|
|
25
|
+
/** Rejection of an unknown `/rules` argument. */
|
|
26
|
+
unknownArg: (arg: string) => string;
|
|
27
|
+
/** Usage hint. */
|
|
28
|
+
usage: string;
|
|
29
|
+
/** Header for `/rules decisions` when decisions exist. */
|
|
30
|
+
decisionsHeader: (shown: number, total: number) => string;
|
|
31
|
+
/** Line shown when the session log holds no audit decisions. */
|
|
32
|
+
noDecisions: string;
|
|
33
|
+
/** Rejection of a malformed decisions count. */
|
|
34
|
+
invalidDecisionsCount: (arg: string) => string;
|
|
35
|
+
/** One audit-decision row. */
|
|
36
|
+
decisionLine: (seq: number, action: string, toolName: string, ruleIndex: number | undefined, reason: string | undefined) => string;
|
|
37
|
+
/** Hit line of `/rules test`. */
|
|
38
|
+
testHit: (tool: string, ruleIndex: number, action: string, reason: string) => string;
|
|
39
|
+
/** No-match line of `/rules test`. */
|
|
40
|
+
testNoMatch: (tool: string) => string;
|
|
41
|
+
/** Rejection of unparseable `/rules test` JSON arguments. */
|
|
42
|
+
testBadJson: (text: string) => string;
|
|
43
|
+
/** Usage hint of `/rules test`. */
|
|
44
|
+
testUsage: string;
|
|
45
|
+
/** Warning naming shadowed (unreachable) rules by 1-based number. */
|
|
46
|
+
unreachableWarning: (numbers: readonly number[]) => string;
|
|
47
|
+
/** Empty-source placeholder in the rules header. */
|
|
48
|
+
emptySource: string;
|
|
49
|
+
}
|
|
50
|
+
/** Tokens `describeRule` uses for its match-dimension prefixes. */
|
|
51
|
+
export interface DescribeTokens {
|
|
52
|
+
allTools: string;
|
|
53
|
+
tools: string;
|
|
54
|
+
params: string;
|
|
55
|
+
paths: string;
|
|
56
|
+
absent: string;
|
|
57
|
+
when: string;
|
|
58
|
+
platform: string;
|
|
59
|
+
disabled: string;
|
|
60
|
+
tags: string;
|
|
61
|
+
}
|
|
62
|
+
/** The localized prose tables by language. */
|
|
63
|
+
export declare const UI_PROSE: Readonly<Record<UiLanguage, UiProse>>;
|
|
64
|
+
/** `describeRule` match-dimension tokens by language. */
|
|
65
|
+
export declare const DESCRIBE_TOKENS: Readonly<Record<UiLanguage, DescribeTokens>>;
|
|
66
|
+
//# sourceMappingURL=prose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prose.d.ts","sourceRoot":"","sources":["../../src/prose.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,0CAA0C;AAC1C,MAAM,MAAM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AAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IACpF,sCAAsC;IACtC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACrC,6DAA6D;IAC7D,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACrC,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAA;IACjB,qEAAqE;IACrE,kBAAkB,EAAE,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,KAAK,MAAM,CAAA;IAC1D,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb;AAoID,8CAA8C;AAC9C,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAA8C,CAAA;AAEzG,yDAAyD;AACzD,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,cAAc,CAAC,CAMxE,CAAA"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI-facing prose for the `/rules` session command, per language. Only the
|
|
3
|
+
* command surface localizes: rule `reason`s are author-provided and are
|
|
4
|
+
* never translated, and logger diagnostics stay English for greppability.
|
|
5
|
+
* `en` and `zh` are the reference translations; `es`/`pt`/`hi` are
|
|
6
|
+
* community-quality.
|
|
7
|
+
* @module dsh-permission-rules/prose
|
|
8
|
+
*/
|
|
9
|
+
/** Truncate long reasons/descriptions in one-line displays. */
|
|
10
|
+
function short(text, limit = 120) {
|
|
11
|
+
return text.length > limit ? `${text.slice(0, limit)}…` : text;
|
|
12
|
+
}
|
|
13
|
+
const EN = {
|
|
14
|
+
rulesHeader: (count, sources, cwd) => `Permission rules: ${count} rule(s) from ${sources.join(', ')} (workspace ${cwd}).`,
|
|
15
|
+
noRules: (cwd, fallbackNote) => `No permission rules active: no rule file found for workspace ${cwd}${fallbackNote}; the empty rule set passes everything through.`,
|
|
16
|
+
fallbackMissing: ' (and the configured fallback path is missing)',
|
|
17
|
+
reloaded: (count, source) => `Reloaded ${count} rule(s) from ${source}.`,
|
|
18
|
+
reloadFailed: error => `Reload failed: ${error}. The previous rules are still active.`,
|
|
19
|
+
lastReloadWarning: error => `Warning: the last reload failed (${error}); the rules listed above are the previous ones.`,
|
|
20
|
+
unknownArg: arg => `Unknown /rules argument "${arg}". ${EN.usage}`,
|
|
21
|
+
usage: 'Usage: /rules [reload | decisions [n] | test <tool> <json-args>]',
|
|
22
|
+
decisionsHeader: (shown, total) => `Last ${shown} of ${total} permission decision(s) for this session:`,
|
|
23
|
+
noDecisions: 'No permission decisions recorded in this session yet.',
|
|
24
|
+
invalidDecisionsCount: arg => `Invalid decisions count "${arg}": give a positive integer (default 10).`,
|
|
25
|
+
decisionLine: (seq, action, toolName, ruleIndex, reason) => {
|
|
26
|
+
const rule = ruleIndex === undefined ? '' : ` (rule ${ruleIndex + 1})`;
|
|
27
|
+
const why = reason === undefined ? '' : `: ${short(reason)}`;
|
|
28
|
+
return `- #${seq} ${action} ${toolName}${rule}${why}`;
|
|
29
|
+
},
|
|
30
|
+
testHit: (tool, ruleIndex, action, reason) => `"${tool}" matches rule ${ruleIndex + 1} (${action}): ${short(reason)}`,
|
|
31
|
+
testNoMatch: tool => `"${tool}" matches no rule — the call passes through.`,
|
|
32
|
+
testBadJson: text => `Invalid JSON arguments "${text}": the arguments must parse as JSON.`,
|
|
33
|
+
testUsage: 'Usage: /rules test <tool> <json-args>, e.g. /rules test bash {"command":"git push origin main"}',
|
|
34
|
+
unreachableWarning: numbers => `Warning: rule${numbers.length > 1 ? 's' : ''} ${numbers.join(', ')} ${numbers.length > 1 ? 'are' : 'is'} unreachable (shadowed by an earlier catch-all rule).`,
|
|
35
|
+
emptySource: '(no rule file — empty rule set)',
|
|
36
|
+
};
|
|
37
|
+
const ZH = {
|
|
38
|
+
rulesHeader: (count, sources, cwd) => `权限规则:共 ${count} 条,来自 ${sources.join('、')}(工作区 ${cwd})。`,
|
|
39
|
+
noRules: (cwd, fallbackNote) => `当前没有生效的权限规则:工作区 ${cwd} 未找到规则文件${fallbackNote};空规则集全部放行。`,
|
|
40
|
+
fallbackMissing: '(且配置的回退路径不存在)',
|
|
41
|
+
reloaded: (count, source) => `已重载 ${count} 条规则,来自 ${source}。`,
|
|
42
|
+
reloadFailed: error => `重载失败:${error}。之前的规则仍然生效。`,
|
|
43
|
+
lastReloadWarning: error => `警告:上次重载失败(${error});以上列出的是之前的规则。`,
|
|
44
|
+
unknownArg: arg => `未知的 /rules 参数 "${arg}"。${ZH.usage}`,
|
|
45
|
+
usage: '用法:/rules [reload | decisions [n] | test <工具名> <json-参数>]',
|
|
46
|
+
decisionsHeader: (shown, total) => `本会话最近 ${shown}/${total} 条权限裁决:`,
|
|
47
|
+
noDecisions: '本会话还没有记录任何权限裁决。',
|
|
48
|
+
invalidDecisionsCount: arg => `无效的裁决条数 "${arg}":请给正整数(默认 10)。`,
|
|
49
|
+
decisionLine: (seq, action, toolName, ruleIndex, reason) => {
|
|
50
|
+
const rule = ruleIndex === undefined ? '' : `(规则 ${ruleIndex + 1})`;
|
|
51
|
+
const why = reason === undefined ? '' : `:${short(reason)}`;
|
|
52
|
+
return `- #${seq} ${action} ${toolName}${rule}${why}`;
|
|
53
|
+
},
|
|
54
|
+
testHit: (tool, ruleIndex, action, reason) => `"${tool}" 命中规则 ${ruleIndex + 1}(${action}):${short(reason)}`,
|
|
55
|
+
testNoMatch: tool => `"${tool}" 未命中任何规则——该调用将透传。`,
|
|
56
|
+
testBadJson: text => `无效的 JSON 参数 "${text}":参数必须能被解析为 JSON。`,
|
|
57
|
+
testUsage: '用法:/rules test <工具名> <json-参数>,例如 /rules test bash {"command":"git push origin main"}',
|
|
58
|
+
unreachableWarning: numbers => `警告:规则 ${numbers.join('、')} 不可达(被前面的通配规则遮蔽)。`,
|
|
59
|
+
emptySource: '(无规则文件——空规则集)',
|
|
60
|
+
};
|
|
61
|
+
const ES = {
|
|
62
|
+
rulesHeader: (count, sources, cwd) => `Reglas de permiso: ${count} regla(s) desde ${sources.join(', ')} (espacio de trabajo ${cwd}).`,
|
|
63
|
+
noRules: (cwd, fallbackNote) => `No hay reglas de permiso activas: no se encontró archivo de reglas para el espacio de trabajo ${cwd}${fallbackNote}; el conjunto vacío lo permite todo.`,
|
|
64
|
+
fallbackMissing: ' (y la ruta de respaldo configurada no existe)',
|
|
65
|
+
reloaded: (count, source) => `Recargadas ${count} regla(s) desde ${source}.`,
|
|
66
|
+
reloadFailed: error => `Error de recarga: ${error}. Las reglas anteriores siguen activas.`,
|
|
67
|
+
lastReloadWarning: error => `Aviso: la última recarga falló (${error}); las reglas mostradas son las anteriores.`,
|
|
68
|
+
unknownArg: arg => `Argumento de /rules desconocido "${arg}". ${ES.usage}`,
|
|
69
|
+
usage: 'Uso: /rules [reload | decisions [n] | test <herramienta> <json-args>]',
|
|
70
|
+
decisionsHeader: (shown, total) => `Últimas ${shown} de ${total} decisión(es) de permiso de esta sesión:`,
|
|
71
|
+
noDecisions: 'Esta sesión aún no registra decisiones de permiso.',
|
|
72
|
+
invalidDecisionsCount: arg => `Cantidad de decisiones inválida "${arg}": indique un entero positivo (por defecto 10).`,
|
|
73
|
+
decisionLine: (seq, action, toolName, ruleIndex, reason) => {
|
|
74
|
+
const rule = ruleIndex === undefined ? '' : ` (regla ${ruleIndex + 1})`;
|
|
75
|
+
const why = reason === undefined ? '' : `: ${short(reason)}`;
|
|
76
|
+
return `- #${seq} ${action} ${toolName}${rule}${why}`;
|
|
77
|
+
},
|
|
78
|
+
testHit: (tool, ruleIndex, action, reason) => `"${tool}" coincide con la regla ${ruleIndex + 1} (${action}): ${short(reason)}`,
|
|
79
|
+
testNoMatch: tool => `"${tool}" no coincide con ninguna regla — la llamada pasa sin restricciones.`,
|
|
80
|
+
testBadJson: text => `Argumentos JSON inválidos "${text}": los argumentos deben poderse analizar como JSON.`,
|
|
81
|
+
testUsage: 'Uso: /rules test <herramienta> <json-args>, p. ej. /rules test bash {"command":"git push origin main"}',
|
|
82
|
+
unreachableWarning: numbers => `Aviso: ${numbers.length > 1 ? 'las reglas' : 'la regla'} ${numbers.join(', ')} ${numbers.length > 1 ? 'son inalcanzables' : 'es inalcanzable'} (tapada por una regla general anterior).`,
|
|
83
|
+
emptySource: '(sin archivo de reglas — conjunto vacío)',
|
|
84
|
+
};
|
|
85
|
+
const PT = {
|
|
86
|
+
rulesHeader: (count, sources, cwd) => `Regras de permissão: ${count} regra(s) de ${sources.join(', ')} (workspace ${cwd}).`,
|
|
87
|
+
noRules: (cwd, fallbackNote) => `Nenhuma regra de permissão ativa: nenhum arquivo de regras encontrado para o workspace ${cwd}${fallbackNote}; o conjunto vazio permite tudo.`,
|
|
88
|
+
fallbackMissing: ' (e o caminho de fallback configurado não existe)',
|
|
89
|
+
reloaded: (count, source) => `Recarregadas ${count} regra(s) de ${source}.`,
|
|
90
|
+
reloadFailed: error => `Falha ao recarregar: ${error}. As regras anteriores continuam ativas.`,
|
|
91
|
+
lastReloadWarning: error => `Aviso: a última recarga falhou (${error}); as regras listadas são as anteriores.`,
|
|
92
|
+
unknownArg: arg => `Argumento de /rules desconhecido "${arg}". ${PT.usage}`,
|
|
93
|
+
usage: 'Uso: /rules [reload | decisions [n] | test <ferramenta> <json-args>]',
|
|
94
|
+
decisionsHeader: (shown, total) => `Últimas ${shown} de ${total} decisão(ões) de permissão desta sessão:`,
|
|
95
|
+
noDecisions: 'Esta sessão ainda não registrou decisões de permissão.',
|
|
96
|
+
invalidDecisionsCount: arg => `Quantidade de decisões inválida "${arg}": informe um inteiro positivo (padrão 10).`,
|
|
97
|
+
decisionLine: (seq, action, toolName, ruleIndex, reason) => {
|
|
98
|
+
const rule = ruleIndex === undefined ? '' : ` (regra ${ruleIndex + 1})`;
|
|
99
|
+
const why = reason === undefined ? '' : `: ${short(reason)}`;
|
|
100
|
+
return `- #${seq} ${action} ${toolName}${rule}${why}`;
|
|
101
|
+
},
|
|
102
|
+
testHit: (tool, ruleIndex, action, reason) => `"${tool}" corresponde à regra ${ruleIndex + 1} (${action}): ${short(reason)}`,
|
|
103
|
+
testNoMatch: tool => `"${tool}" não corresponde a nenhuma regra — a chamada passa livremente.`,
|
|
104
|
+
testBadJson: text => `Argumentos JSON inválidos "${text}": os argumentos precisam ser JSON analisável.`,
|
|
105
|
+
testUsage: 'Uso: /rules test <ferramenta> <json-args>, ex.: /rules test bash {"command":"git push origin main"}',
|
|
106
|
+
unreachableWarning: numbers => `Aviso: ${numbers.length > 1 ? 'as regras' : 'a regra'} ${numbers.join(', ')} ${numbers.length > 1 ? 'são inalcançáveis' : 'é inalcançável'} (encoberta por uma regra geral anterior).`,
|
|
107
|
+
emptySource: '(sem arquivo de regras — conjunto vazio)',
|
|
108
|
+
};
|
|
109
|
+
const HI = {
|
|
110
|
+
rulesHeader: (count, sources, cwd) => `अनुमति नियम: ${count} नियम, स्रोत ${sources.join(', ')} (कार्यक्षेत्र ${cwd})।`,
|
|
111
|
+
noRules: (cwd, fallbackNote) => `कोई अनुमति नियम सक्रिय नहीं: कार्यक्षेत्र ${cwd} के लिए नियम फ़ाइल नहीं मिली${fallbackNote}; खाली नियम-समूह सब कुछ पास कर देता है।`,
|
|
112
|
+
fallbackMissing: ' (और कॉन्फ़िगर किया गया फ़ॉलबैक पथ मौजूद नहीं है)',
|
|
113
|
+
reloaded: (count, source) => `${count} नियम पुनः लोड किए गए, स्रोत ${source}।`,
|
|
114
|
+
reloadFailed: error => `पुनः लोड विफल: ${error}। पिछले नियम अब भी सक्रिय हैं।`,
|
|
115
|
+
lastReloadWarning: error => `चेतावनी: अंतिम पुनः लोड विफल रहा (${error}); ऊपर सूचीबद्ध नियम पिछले वाले हैं।`,
|
|
116
|
+
unknownArg: arg => `अज्ञात /rules तर्क "${arg}"। ${HI.usage}`,
|
|
117
|
+
usage: 'उपयोग: /rules [reload | decisions [n] | test <टूल> <json-args>]',
|
|
118
|
+
decisionsHeader: (shown, total) => `इस सत्र के अंतिम ${shown}/${total} अनुमति निर्णय:`,
|
|
119
|
+
noDecisions: 'इस सत्र में अभी कोई अनुमति निर्णय दर्ज नहीं है।',
|
|
120
|
+
invalidDecisionsCount: arg => `अमान्य निर्णय-संख्या "${arg}": एक धनात्मक पूर्णांक दें (डिफ़ॉल्ट 10)।`,
|
|
121
|
+
decisionLine: (seq, action, toolName, ruleIndex, reason) => {
|
|
122
|
+
const rule = ruleIndex === undefined ? '' : ` (नियम ${ruleIndex + 1})`;
|
|
123
|
+
const why = reason === undefined ? '' : `: ${short(reason)}`;
|
|
124
|
+
return `- #${seq} ${action} ${toolName}${rule}${why}`;
|
|
125
|
+
},
|
|
126
|
+
testHit: (tool, ruleIndex, action, reason) => `"${tool}" नियम ${ruleIndex + 1} से मेल खाता है (${action}): ${short(reason)}`,
|
|
127
|
+
testNoMatch: tool => `"${tool}" किसी नियम से मेल नहीं खाता — कॉल बिना रोक पास होगी।`,
|
|
128
|
+
testBadJson: text => `अमान्य JSON तर्क "${text}": तर्क JSON के रूप में पार्स होने चाहिए।`,
|
|
129
|
+
testUsage: 'उपयोग: /rules test <टूल> <json-args>, जैसे /rules test bash {"command":"git push origin main"}',
|
|
130
|
+
unreachableWarning: numbers => `चेतावनी: नियम ${numbers.join(', ')} अप्राप्य हैं (पहले वाले सर्व-मिलान नियम से ढके हुए)।`,
|
|
131
|
+
emptySource: '(कोई नियम फ़ाइल नहीं — खाली नियम-समूह)',
|
|
132
|
+
};
|
|
133
|
+
/** The localized prose tables by language. */
|
|
134
|
+
export const UI_PROSE = { en: EN, zh: ZH, es: ES, pt: PT, hi: HI };
|
|
135
|
+
/** `describeRule` match-dimension tokens by language. */
|
|
136
|
+
export const DESCRIBE_TOKENS = {
|
|
137
|
+
en: { allTools: 'all tools', tools: 'tools', params: 'params', paths: 'paths', absent: 'absent', when: 'when', platform: 'platform', disabled: 'disabled', tags: 'tags' },
|
|
138
|
+
zh: { allTools: '全部工具', tools: '工具', params: '参数', paths: '路径', absent: '缺省键', when: '条件', platform: '平台', disabled: '已禁用', tags: '标签' },
|
|
139
|
+
es: { allTools: 'todas las herramientas', tools: 'herramientas', params: 'parámetros', paths: 'rutas', absent: 'ausentes', when: 'cuándo', platform: 'plataforma', disabled: 'deshabilitada', tags: 'etiquetas' },
|
|
140
|
+
pt: { allTools: 'todas as ferramentas', tools: 'ferramentas', params: 'parâmetros', paths: 'caminhos', absent: 'ausentes', when: 'quando', platform: 'plataforma', disabled: 'desativada', tags: 'etiquetas' },
|
|
141
|
+
hi: { allTools: 'सभी टूल', tools: 'टूल', params: 'पैरामीटर', paths: 'पथ', absent: 'अनुपस्थित', when: 'शर्त', platform: 'प्लेटफ़ॉर्म', disabled: 'अक्षम', tags: 'टैग' },
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=prose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prose.js","sourceRoot":"","sources":["../../src/prose.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0DH,+DAA+D;AAC/D,SAAS,KAAK,CAAC,IAAY,EAAE,KAAK,GAAG,GAAG;IACtC,OAAO,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;AAChE,CAAC;AAED,MAAM,EAAE,GAAY;IAClB,WAAW,EAAE,CAAC,K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EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IACjN,EAAE,EAAE,EAAE,QAAQ,EAAE,sBAAsB,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE;IAC9M,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE;CACvK,CAAA"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure rule vocabulary: parsing a `.dsh/rules.yaml` document into a
|
|
3
|
+
* validated {@link RulesFileDoc}, compiling patterns, and first-match
|
|
4
|
+
* evaluation. Every function here is pure — no filesystem, clock, or
|
|
5
|
+
* process state — so the parser, the matcher, and the failure modes are all
|
|
6
|
+
* unit-testable and replayable.
|
|
7
|
+
* @module dsh-permission-rules/rules
|
|
8
|
+
*/
|
|
9
|
+
/** What one matched rule does to a pending tool call. */
|
|
10
|
+
export type RuleAction = 'allow' | 'deny' | 'ask';
|
|
11
|
+
/** How param, path, and env patterns are interpreted. */
|
|
12
|
+
export type PatternMode = 'glob' | 'regex';
|
|
13
|
+
/** Closed action list for runtime normalization of untrusted values. */
|
|
14
|
+
export declare const RULE_ACTIONS: readonly RuleAction[];
|
|
15
|
+
/** Platform names a `when.platform` entry may name (Node `process.platform` values). */
|
|
16
|
+
export declare const PLATFORMS: readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* Raised when a rule document cannot be parsed or compiled. The message
|
|
19
|
+
* names the failing rule and field; loading code maps it onto the
|
|
20
|
+
* `badFilePolicy`.
|
|
21
|
+
*/
|
|
22
|
+
export declare class RuleError extends Error {
|
|
23
|
+
constructor(message: string);
|
|
24
|
+
}
|
|
25
|
+
/** A parsed, shape-validated rule document (patterns not yet compiled). */
|
|
26
|
+
export interface RulesFileDoc {
|
|
27
|
+
rules: RuleDocEntry[];
|
|
28
|
+
}
|
|
29
|
+
/** One parsed rule: match dimensions plus the action, reason, and metadata. */
|
|
30
|
+
export interface RuleDocEntry {
|
|
31
|
+
match: RuleMatchDoc;
|
|
32
|
+
action: RuleAction;
|
|
33
|
+
reason: string;
|
|
34
|
+
/** `false` keeps the rule visible but inert (displayed as disabled). */
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
/** Optional one-line explanation shown by `/rules`. */
|
|
37
|
+
description?: string;
|
|
38
|
+
/** Free-form labels shown by `/rules`. */
|
|
39
|
+
tags: string[];
|
|
40
|
+
}
|
|
41
|
+
/** The parsed match dimensions; absent dimensions are empty (= no restriction). */
|
|
42
|
+
export interface RuleMatchDoc {
|
|
43
|
+
/** Tool-name globs; empty matches every tool. */
|
|
44
|
+
tools: string[];
|
|
45
|
+
/** Param key → patterns; EVERY key must be present and match (AND). A `!`-prefixed pattern negates. */
|
|
46
|
+
params: Record<string, string[]>;
|
|
47
|
+
/** Workspace-path globs/regexes; ANY candidate matching ANY pattern satisfies the dimension. */
|
|
48
|
+
paths: string[];
|
|
49
|
+
/** Argument keys that must be ABSENT; every listed key must be missing. */
|
|
50
|
+
absent: string[];
|
|
51
|
+
/** Environment/platform conditions; every listed env key must be present and match. */
|
|
52
|
+
when: WhenDoc;
|
|
53
|
+
}
|
|
54
|
+
/** The parsed `when` conditions. */
|
|
55
|
+
export interface WhenDoc {
|
|
56
|
+
/** Env var name → glob/regex patterns; EVERY key must be present and match (AND). */
|
|
57
|
+
env: Record<string, string[]>;
|
|
58
|
+
/** Platform names; ANY match satisfies the dimension. */
|
|
59
|
+
platform: string[];
|
|
60
|
+
}
|
|
61
|
+
/** One compiled rule, ready for the `tools/pre-execute` hot path. */
|
|
62
|
+
export interface CompiledRule {
|
|
63
|
+
/** 0-based position in the merged rule chain. */
|
|
64
|
+
readonly index: number;
|
|
65
|
+
/** 0-based index into the merged source-chain paths (audit attribution). */
|
|
66
|
+
readonly sourceIndex: number;
|
|
67
|
+
readonly action: RuleAction;
|
|
68
|
+
readonly reason: string;
|
|
69
|
+
readonly enabled: boolean;
|
|
70
|
+
readonly description?: string;
|
|
71
|
+
readonly tags: readonly string[];
|
|
72
|
+
readonly tools: readonly RegExp[];
|
|
73
|
+
/** Param key → positive/negative pattern lists. */
|
|
74
|
+
readonly params: ReadonlyMap<string, {
|
|
75
|
+
positive: readonly RegExp[];
|
|
76
|
+
negative: readonly RegExp[];
|
|
77
|
+
}>;
|
|
78
|
+
readonly paths: readonly RegExp[];
|
|
79
|
+
readonly absent: readonly string[];
|
|
80
|
+
readonly when?: {
|
|
81
|
+
readonly env: ReadonlyMap<string, readonly RegExp[]>;
|
|
82
|
+
readonly platform: readonly string[];
|
|
83
|
+
};
|
|
84
|
+
/** The original source strings, kept for the `/rules` display. */
|
|
85
|
+
readonly source: RuleDocEntry;
|
|
86
|
+
}
|
|
87
|
+
/** A compiled, size-capped ruleset. */
|
|
88
|
+
export interface CompiledRuleset {
|
|
89
|
+
readonly rules: readonly CompiledRule[];
|
|
90
|
+
/** Whether path patterns (and workspace-path normalization) ignore ASCII case. */
|
|
91
|
+
readonly caseInsensitivePaths: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** Compile options for {@link compileRules}. */
|
|
94
|
+
export interface CompileOptions {
|
|
95
|
+
/** Glob or regex interpretation of `params`/`paths`/`when.env` patterns. */
|
|
96
|
+
readonly patternMode: PatternMode;
|
|
97
|
+
/** Hard cap on rule count; exceeding it fails the compile loudly. */
|
|
98
|
+
readonly maxRules: number;
|
|
99
|
+
/** Hard cap on unbounded glob-star quantifiers per pattern (ReDoS degree bound). */
|
|
100
|
+
readonly maxGlobStars: number;
|
|
101
|
+
/** Whether path patterns compile with the `i` flag. */
|
|
102
|
+
readonly caseInsensitivePaths: boolean;
|
|
103
|
+
}
|
|
104
|
+
/** One rule-file text for {@link compileRulesChain}. */
|
|
105
|
+
export interface RulesChainEntry {
|
|
106
|
+
/** Absolute rule-file path, for audit attribution and error messages. */
|
|
107
|
+
readonly path: string;
|
|
108
|
+
/** The raw YAML text. */
|
|
109
|
+
readonly text: string;
|
|
110
|
+
}
|
|
111
|
+
/** Host facts a `when` dimension evaluates against. */
|
|
112
|
+
export interface MatchContext {
|
|
113
|
+
/** Node platform name; defaults to `process.platform` when omitted. */
|
|
114
|
+
readonly platform?: string;
|
|
115
|
+
/** Environment table; defaults to `process.env` when omitted. */
|
|
116
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Parse one rules file body. Unknown document/rule/match fields, invalid
|
|
120
|
+
* actions, missing reasons, and wrong-shaped collections all throw
|
|
121
|
+
* {@link RuleError} — a malformed file fails loudly at load, never silently.
|
|
122
|
+
* @param text - the raw YAML text.
|
|
123
|
+
* @returns the validated document.
|
|
124
|
+
*/
|
|
125
|
+
export declare function parseRulesDocument(text: string): RulesFileDoc;
|
|
126
|
+
/**
|
|
127
|
+
* Compile a parsed document for the hot path: pattern strings become
|
|
128
|
+
* RegExps (invalid globs/regexes throw here, at load), and the rule count
|
|
129
|
+
* is capped by `maxRules`.
|
|
130
|
+
* @param doc - the parsed document.
|
|
131
|
+
* @param options - pattern mode, caps, and case handling.
|
|
132
|
+
* @returns the compiled ruleset (every rule attributed to source 0).
|
|
133
|
+
*/
|
|
134
|
+
export declare function compileRules(doc: RulesFileDoc, options: CompileOptions): CompiledRuleset;
|
|
135
|
+
/**
|
|
136
|
+
* Parse and compile an ordered source chain (nearest file first). Rules
|
|
137
|
+
* keep per-file order and are evaluated in chain order, so a nearer file
|
|
138
|
+
* can override a farther one on first-match semantics; `sourceIndex`
|
|
139
|
+
* attributes every rule to its file. The TOTAL rule count is capped by
|
|
140
|
+
* `maxRules`.
|
|
141
|
+
* @param entries - the rule-file texts, nearest file first.
|
|
142
|
+
* @param options - compile options.
|
|
143
|
+
* @returns the merged ruleset and the source paths it references.
|
|
144
|
+
*/
|
|
145
|
+
export declare function compileRulesChain(entries: readonly RulesChainEntry[], options: CompileOptions): {
|
|
146
|
+
ruleset: CompiledRuleset;
|
|
147
|
+
sources: string[];
|
|
148
|
+
};
|
|
149
|
+
/** A matched rule: its index and the compiled rule that fired. */
|
|
150
|
+
export interface RuleHit {
|
|
151
|
+
/** 0-based index of the first matching rule. */
|
|
152
|
+
readonly ruleIndex: number;
|
|
153
|
+
readonly rule: CompiledRule;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Evaluate rules in order against one pending tool call. First match wins;
|
|
157
|
+
* no match returns `undefined` (passthrough). Pure and synchronous — this
|
|
158
|
+
* is the `tools/pre-execute` hot path, so it runs no I/O.
|
|
159
|
+
* @param ruleset - compiled rules.
|
|
160
|
+
* @param toolName - the tool being called.
|
|
161
|
+
* @param args - the parsed (JSON) tool arguments; non-object values satisfy
|
|
162
|
+
* only tools/when/absent rules.
|
|
163
|
+
* @param cwd - the session's absolute workspace root, for path normalization.
|
|
164
|
+
* @param context - host facts for `when` evaluation; defaults resolve at match time.
|
|
165
|
+
* @returns the first hit, or undefined when every rule passed.
|
|
166
|
+
*/
|
|
167
|
+
export declare function matchRules(ruleset: CompiledRuleset, toolName: string, args: unknown, cwd: string, context?: MatchContext): RuleHit | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* Indices of rules that can never fire: every ENABLED rule after the first
|
|
170
|
+
* enabled rule whose every dimension is empty (an unconditional catch-all).
|
|
171
|
+
* Disabled rules are excluded from both roles. Conservative on purpose —
|
|
172
|
+
* pattern-set inclusion across globs is not analyzed.
|
|
173
|
+
* @param ruleset - the compiled rules.
|
|
174
|
+
* @returns 0-based indices of unreachable rules.
|
|
175
|
+
*/
|
|
176
|
+
export declare function findUnreachableRules(ruleset: CompiledRuleset): number[];
|
|
177
|
+
/**
|
|
178
|
+
* One-line human summary of a compiled rule, for `/rules` output. The
|
|
179
|
+
* 1-based number, action, match dimensions, and reason render first; a
|
|
180
|
+
* disabled marker, tags, and a truncated description follow.
|
|
181
|
+
* @param rule - the compiled rule.
|
|
182
|
+
* @param tokens - dimension-prefix vocabulary for the configured language.
|
|
183
|
+
* @returns a single display line.
|
|
184
|
+
*/
|
|
185
|
+
export declare function describeRule(rule: CompiledRule, tokens: DescribeTokens): string;
|
|
186
|
+
/** The localized dimension-prefix vocabulary {@link describeRule} renders. */
|
|
187
|
+
export interface DescribeTokens {
|
|
188
|
+
readonly allTools: string;
|
|
189
|
+
readonly tools: string;
|
|
190
|
+
readonly params: string;
|
|
191
|
+
readonly paths: string;
|
|
192
|
+
readonly absent: string;
|
|
193
|
+
readonly when: string;
|
|
194
|
+
readonly platform: string;
|
|
195
|
+
readonly disabled: string;
|
|
196
|
+
readonly tags: string;
|
|
197
|
+
}
|
|
198
|
+
/** Top-level argument keys whose string values are path candidates. */
|
|
199
|
+
export declare const PATH_CANDIDATE_KEYS: readonly string[];
|
|
200
|
+
/**
|
|
201
|
+
* Collect path-candidate strings from tool arguments at ANY nesting depth
|
|
202
|
+
* (capped at {@link MAX_ARGUMENT_DEPTH}): scalar strings under the
|
|
203
|
+
* documented {@link PATH_CANDIDATE_KEYS}, plus string elements of arrays
|
|
204
|
+
* under those keys. Nested objects are walked so MCP-style
|
|
205
|
+
* `{ arguments: { path } }` shapes still feed path matching. Iterates the
|
|
206
|
+
* argument object's own key order, so extraction order is deterministic.
|
|
207
|
+
* @param args - the parsed tool arguments.
|
|
208
|
+
* @returns candidate strings in argument key order (duplicates kept).
|
|
209
|
+
*/
|
|
210
|
+
export declare function extractPathCandidates(args: Record<string, unknown>): string[];
|
|
211
|
+
/**
|
|
212
|
+
* Normalize one candidate path against the workspace root: separators
|
|
213
|
+
* become `/`, `./` prefixes drop, and in-root paths become workspace
|
|
214
|
+
* relative. Candidates OUTSIDE the root (absolute or drive-prefixed
|
|
215
|
+
* elsewhere) yield `''` — path patterns address workspace-relative paths
|
|
216
|
+
* only; a still-relative `../…` input is kept so explicit out-of-root
|
|
217
|
+
* globs like `../shared/**` can address it. When `caseInsensitive` is set
|
|
218
|
+
* (Windows default), the drive and root-prefix comparisons ignore ASCII
|
|
219
|
+
* case, matching the case-insensitive filesystem.
|
|
220
|
+
* @param cwd - the session's absolute workspace root (any separator).
|
|
221
|
+
* @param candidate - the raw candidate path.
|
|
222
|
+
* @param caseInsensitive - compare root prefixes without ASCII case.
|
|
223
|
+
* @returns the workspace-relative posix path, or `''` to drop the candidate.
|
|
224
|
+
*/
|
|
225
|
+
export declare function normalizeWorkspacePath(cwd: string, candidate: string, caseInsensitive?: boolean): string;
|
|
226
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAA;AAEjD,yDAAyD;AACzD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAA;AAE1C,wEAAwE;AACxE,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAA6B,CAAA;AAE3E,wFAAwF;AACxF,eAAO,MAAM,SAAS,EAAE,SAAS,MAAM,EAAkF,CAAA;AAQzH;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACtB,OAAO,EAAE,MAAM;CAI5B;AAED,2EAA2E;AAC3E,MAAM,WAAW,Y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