rulesync 16.28.0 → 16.29.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/cli/index.cjs +9 -4
- package/dist/cli/index.js +9 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/{import-hiWvR9cE.cjs → import-B_pwsx3d.cjs} +75 -18
- package/dist/{import-CwS7XtJP.js → import-DFeuBVD1.js} +76 -19
- package/dist/import-DFeuBVD1.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/import-CwS7XtJP.js.map +0 -1
|
@@ -4418,6 +4418,7 @@ const CODEXCLI_HOOK_EVENTS = [
|
|
|
4418
4418
|
"postToolUse",
|
|
4419
4419
|
"beforeSubmitPrompt",
|
|
4420
4420
|
"stop",
|
|
4421
|
+
"stopCancelled",
|
|
4421
4422
|
"permissionRequest",
|
|
4422
4423
|
"subagentStart",
|
|
4423
4424
|
"subagentStop",
|
|
@@ -4664,9 +4665,14 @@ const GROKCLI_HOOK_EVENTS = [
|
|
|
4664
4665
|
*
|
|
4665
4666
|
* Kimi Code also exposes `PermissionResult`, `Interrupt`, and the four events
|
|
4666
4667
|
* added in 0.32.0 (`TurnStarted`, `UserPromptQueued`, `TaskStarted`,
|
|
4667
|
-
* `SessionHeartbeat`), none of which
|
|
4668
|
-
*
|
|
4669
|
-
*
|
|
4668
|
+
* `SessionHeartbeat`), none of which is mapped onto a canonical rulesync event
|
|
4669
|
+
* here. `Interrupt` (fires instead of `Stop` when the user interrupts a turn)
|
|
4670
|
+
* does have a canonical shape — `stopCancelled`, which Grok CLI and Codex CLI
|
|
4671
|
+
* map — but Kimi keeps it native-only for now, since an existing `kimi-code`
|
|
4672
|
+
* override addressing it by name would otherwise double up with a canonical
|
|
4673
|
+
* `stopCancelled` block; folding it in is a follow-up. All six are listed in
|
|
4674
|
+
* `KIMI_CODE_NATIVE_HOOK_EVENTS` so a per-tool `kimi-code` override can
|
|
4675
|
+
* address them by their native name.
|
|
4670
4676
|
*
|
|
4671
4677
|
* @see https://moonshotai.github.io/kimi-code/en/customization/hooks.html
|
|
4672
4678
|
*/
|
|
@@ -5199,6 +5205,7 @@ const CANONICAL_TO_CODEXCLI_EVENT_NAMES = {
|
|
|
5199
5205
|
postToolUse: "PostToolUse",
|
|
5200
5206
|
beforeSubmitPrompt: "UserPromptSubmit",
|
|
5201
5207
|
stop: "Stop",
|
|
5208
|
+
stopCancelled: "Interrupt",
|
|
5202
5209
|
permissionRequest: "PermissionRequest",
|
|
5203
5210
|
subagentStart: "SubagentStart",
|
|
5204
5211
|
subagentStop: "SubagentStop",
|
|
@@ -13336,7 +13343,9 @@ function slugForGate({ gate, index, scope }) {
|
|
|
13336
13343
|
* agent step prompt as a completion directive;
|
|
13337
13344
|
* - with `command` in the check's `takt` frontmatter block, a **command
|
|
13338
13345
|
* gate** (`{type: command, name, command, cwd, timeout_ms}`), which Takt
|
|
13339
|
-
* runs after the step
|
|
13346
|
+
* runs after the step (since 0.62.0: after rule resolution and before the
|
|
13347
|
+
* transition, unless the selected rule sets `command_gates: skip`) and
|
|
13348
|
+
* fails on a non-zero exit code.
|
|
13340
13349
|
*
|
|
13341
13350
|
* `steps` / `personas` in that block scope a gate to named workflow steps or
|
|
13342
13351
|
* personas (`workflow_overrides.steps.<step>.quality_gates`); an unscoped gate
|
|
@@ -24177,9 +24186,10 @@ function stripTrustedDirectoryWrapper(command) {
|
|
|
24177
24186
|
* to filter on in the first place.
|
|
24178
24187
|
*
|
|
24179
24188
|
* Keyed on native names because the check runs after the canonical → native
|
|
24180
|
-
* mapping: `SessionHeartbeat` and `Interrupt`
|
|
24181
|
-
*
|
|
24182
|
-
*
|
|
24189
|
+
* mapping: `SessionHeartbeat` and `Interrupt` are not mapped from a canonical
|
|
24190
|
+
* event for Kimi (`Interrupt` is the shape of canonical `stopCancelled`, which
|
|
24191
|
+
* other tools map, but stays native-only here) and are only reachable through
|
|
24192
|
+
* a per-tool `kimi-code` override naming them directly.
|
|
24183
24193
|
*
|
|
24184
24194
|
* Deliberately narrower than Claude Code's equivalent set: Kimi Code's
|
|
24185
24195
|
* `UserPromptSubmit` matches the submitted prompt text, and `PermissionResult`
|
|
@@ -41412,19 +41422,27 @@ const CATEGORY_TO_GROK_TOOL = {
|
|
|
41412
41422
|
edit: "Edit",
|
|
41413
41423
|
write: "Edit",
|
|
41414
41424
|
grep: "Grep",
|
|
41425
|
+
glob: "Glob",
|
|
41415
41426
|
webfetch: "WebFetch",
|
|
41416
|
-
websearch: "WebSearch"
|
|
41427
|
+
websearch: "WebSearch",
|
|
41428
|
+
agent: "AgentMessage"
|
|
41417
41429
|
};
|
|
41418
41430
|
const GROK_TOOL_TO_CATEGORY = {
|
|
41419
41431
|
Bash: "bash",
|
|
41420
41432
|
Read: "read",
|
|
41421
41433
|
Edit: "edit",
|
|
41422
41434
|
Grep: "grep",
|
|
41435
|
+
Glob: "glob",
|
|
41423
41436
|
WebFetch: "webfetch",
|
|
41424
|
-
WebSearch: "websearch"
|
|
41437
|
+
WebSearch: "websearch",
|
|
41438
|
+
AgentMessage: "agent",
|
|
41439
|
+
...Object.fromEntries(["SendSubagentMessage", "SendAgentMessage"].map((tool) => [tool, "agent"]))
|
|
41425
41440
|
};
|
|
41426
41441
|
const GROK_MCP_TOOL = "MCPTool";
|
|
41427
|
-
const GROK_TOOL_TO_CATEGORY_LOWER =
|
|
41442
|
+
const GROK_TOOL_TO_CATEGORY_LOWER = {
|
|
41443
|
+
...Object.fromEntries(Object.entries(GROK_TOOL_TO_CATEGORY).map(([tool, category]) => [tool.toLowerCase(), category])),
|
|
41444
|
+
agent_message: "agent"
|
|
41445
|
+
};
|
|
41428
41446
|
const GROK_MCP_TOOL_ALIASES = /* @__PURE__ */ new Set(["mcp", GROK_MCP_TOOL.toLowerCase()]);
|
|
41429
41447
|
const GROKCLI_PERMISSION_RULES_KEY = "rules";
|
|
41430
41448
|
/**
|
|
@@ -41527,13 +41545,16 @@ function parseGrokRule(rule) {
|
|
|
41527
41545
|
* per-category, per-pattern model maps almost 1:1:
|
|
41528
41546
|
* - Generate: each `permission.<category>.<pattern> = allow|ask|deny` becomes
|
|
41529
41547
|
* the matching Grok entry and is bucketed into the `[permission]` array for
|
|
41530
|
-
* that action. `bash|read|edit|grep|webfetch|websearch` map to
|
|
41531
|
-
* tool; `write` collapses onto `Edit` (Grok has no `Write`
|
|
41532
|
-
* maps to `
|
|
41533
|
-
*
|
|
41534
|
-
*
|
|
41535
|
-
*
|
|
41536
|
-
*
|
|
41548
|
+
* that action. `bash|read|edit|grep|glob|webfetch|websearch|agent` map to
|
|
41549
|
+
* their Grok tool; `write` collapses onto `Edit` (Grok has no `Write`
|
|
41550
|
+
* tool); `glob` maps to `Glob` (an upstream alias of the `Grep` filter);
|
|
41551
|
+
* `agent` maps to `AgentMessage` (which gates messages to a running
|
|
41552
|
+
* subagent rather than its launch, and whose pattern is a subagent id
|
|
41553
|
+
* rather than a subagent type); `mcp__*` maps to `MCPTool(...)` (a scoped
|
|
41554
|
+
* MCP category folds its address into the parentheses, so a non-`*`
|
|
41555
|
+
* argument pattern on it is not represented). The one category with no Grok tool (`notebookedit`) is
|
|
41556
|
+
* skipped (with a warning when it carries a `deny` rule, to surface the
|
|
41557
|
+
* gap). When two canonical rules collapse onto the same Grok
|
|
41537
41558
|
* entry with different actions (e.g. `edit` allow + `write` deny → `Edit`),
|
|
41538
41559
|
* the strictest wins (`deny > ask > allow`) and a warning is logged, so the
|
|
41539
41560
|
* entry never lands contradictorily in two arrays.
|
|
@@ -42645,6 +42666,32 @@ function mergeKimiCodeToolsSection({ existingContent, patch }) {
|
|
|
42645
42666
|
return merged;
|
|
42646
42667
|
}
|
|
42647
42668
|
/**
|
|
42669
|
+
* Carry the existing `[permission]` siblings of `rules` over onto the generated
|
|
42670
|
+
* table. The gateway replaces the owned `permission` key wholesale and rulesync
|
|
42671
|
+
* only ever authors `rules`, so a hand-written sibling such as
|
|
42672
|
+
* `dangerous_command_guard = false` (Kimi Code 0.40.0) would otherwise be
|
|
42673
|
+
* deleted on every generate. Rulesync does not model these keys; they pass
|
|
42674
|
+
* through verbatim and `rules` always comes from the patch.
|
|
42675
|
+
*
|
|
42676
|
+
* @see https://moonshotai.github.io/kimi-code/en/configuration/config-files.html#permission
|
|
42677
|
+
*/
|
|
42678
|
+
function mergeKimiCodePermissionSection({ existingContent, patch }) {
|
|
42679
|
+
let existing;
|
|
42680
|
+
try {
|
|
42681
|
+
existing = parseSharedConfig({
|
|
42682
|
+
format: "toml",
|
|
42683
|
+
fileContent: existingContent
|
|
42684
|
+
}).permission;
|
|
42685
|
+
} catch {
|
|
42686
|
+
existing = void 0;
|
|
42687
|
+
}
|
|
42688
|
+
const { rules: _existingRules, ...siblings } = isRecord$1(existing) ? existing : {};
|
|
42689
|
+
return {
|
|
42690
|
+
...siblings,
|
|
42691
|
+
...isRecord$1(patch.permission) ? patch.permission : {}
|
|
42692
|
+
};
|
|
42693
|
+
}
|
|
42694
|
+
/**
|
|
42648
42695
|
* Build Kimi's `[tools]` section from a rulesync override, or read one back on
|
|
42649
42696
|
* import. Entries pass through verbatim: the section uses agent-file tool syntax
|
|
42650
42697
|
* (exact built-in names, `mcp__server__*` globs), not the canonical
|
|
@@ -42824,12 +42871,17 @@ var KimiCodePermissions = class KimiCodePermissions extends ToolPermissions {
|
|
|
42824
42871
|
existingContent: fileContent,
|
|
42825
42872
|
patch
|
|
42826
42873
|
});
|
|
42874
|
+
const mergedPermission = mergeKimiCodePermissionSection({
|
|
42875
|
+
existingContent: fileContent,
|
|
42876
|
+
patch
|
|
42877
|
+
});
|
|
42827
42878
|
this.fileContent = applySharedConfigPatch({
|
|
42828
42879
|
fileKey: getKimiCodeConfigSharedFileKey({ global: this.global }),
|
|
42829
42880
|
feature: "permissions",
|
|
42830
42881
|
existingContent: fileContent,
|
|
42831
42882
|
patch: {
|
|
42832
42883
|
...patch,
|
|
42884
|
+
permission: mergedPermission,
|
|
42833
42885
|
...mergedTools && { tools: mergedTools }
|
|
42834
42886
|
},
|
|
42835
42887
|
filePath: (0, node_path.join)(paths.relativeDirPath, paths.relativeFilePath)
|
|
@@ -55814,9 +55866,14 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
55814
55866
|
const rulesyncSkills = rulesyncDirs.filter((dir) => dir instanceof RulesyncSkill);
|
|
55815
55867
|
const factory = this.getFactory(this.toolTarget);
|
|
55816
55868
|
return (await Promise.all(rulesyncSkills.map(async (rulesyncSkill) => {
|
|
55817
|
-
|
|
55869
|
+
const isClaudecodeScheduledTask = rulesyncSkill.getFrontmatter().claudecode?.["scheduled-task"] === true;
|
|
55870
|
+
if (isClaudecodeScheduledTask && this.toolTarget !== "claudecode" && this.toolTarget !== "claudecode-legacy") return null;
|
|
55818
55871
|
if (!factory.class.isTargetedByRulesyncSkill(rulesyncSkill)) return null;
|
|
55819
55872
|
const dirName = rulesyncSkill.getDirName();
|
|
55873
|
+
if (isClaudecodeScheduledTask && !this.global) {
|
|
55874
|
+
this.logger.warn(`Skipping skill ${quoteForLog(dirName)} for '${this.toolTarget}': 'claudecode.scheduled-task' skills are only read from the user config directory (~/.claude/scheduled-tasks/), so nothing is written at project scope. Generate it with --global instead; a stale copy an earlier generate left under .claude/scheduled-tasks/ is removed by a generate with --delete.`);
|
|
55875
|
+
return null;
|
|
55876
|
+
}
|
|
55820
55877
|
const dirWriteBlockReason = await factory.class.getDirWriteBlockReason?.({
|
|
55821
55878
|
outputRoot: this.outputRoot,
|
|
55822
55879
|
relativeDirPath: factory.class.getSettablePaths({ global: this.global }).relativeDirPath,
|
|
@@ -4393,6 +4393,7 @@ const CODEXCLI_HOOK_EVENTS = [
|
|
|
4393
4393
|
"postToolUse",
|
|
4394
4394
|
"beforeSubmitPrompt",
|
|
4395
4395
|
"stop",
|
|
4396
|
+
"stopCancelled",
|
|
4396
4397
|
"permissionRequest",
|
|
4397
4398
|
"subagentStart",
|
|
4398
4399
|
"subagentStop",
|
|
@@ -4639,9 +4640,14 @@ const GROKCLI_HOOK_EVENTS = [
|
|
|
4639
4640
|
*
|
|
4640
4641
|
* Kimi Code also exposes `PermissionResult`, `Interrupt`, and the four events
|
|
4641
4642
|
* added in 0.32.0 (`TurnStarted`, `UserPromptQueued`, `TaskStarted`,
|
|
4642
|
-
* `SessionHeartbeat`), none of which
|
|
4643
|
-
*
|
|
4644
|
-
*
|
|
4643
|
+
* `SessionHeartbeat`), none of which is mapped onto a canonical rulesync event
|
|
4644
|
+
* here. `Interrupt` (fires instead of `Stop` when the user interrupts a turn)
|
|
4645
|
+
* does have a canonical shape — `stopCancelled`, which Grok CLI and Codex CLI
|
|
4646
|
+
* map — but Kimi keeps it native-only for now, since an existing `kimi-code`
|
|
4647
|
+
* override addressing it by name would otherwise double up with a canonical
|
|
4648
|
+
* `stopCancelled` block; folding it in is a follow-up. All six are listed in
|
|
4649
|
+
* `KIMI_CODE_NATIVE_HOOK_EVENTS` so a per-tool `kimi-code` override can
|
|
4650
|
+
* address them by their native name.
|
|
4645
4651
|
*
|
|
4646
4652
|
* @see https://moonshotai.github.io/kimi-code/en/customization/hooks.html
|
|
4647
4653
|
*/
|
|
@@ -5174,6 +5180,7 @@ const CANONICAL_TO_CODEXCLI_EVENT_NAMES = {
|
|
|
5174
5180
|
postToolUse: "PostToolUse",
|
|
5175
5181
|
beforeSubmitPrompt: "UserPromptSubmit",
|
|
5176
5182
|
stop: "Stop",
|
|
5183
|
+
stopCancelled: "Interrupt",
|
|
5177
5184
|
permissionRequest: "PermissionRequest",
|
|
5178
5185
|
subagentStart: "SubagentStart",
|
|
5179
5186
|
subagentStop: "SubagentStop",
|
|
@@ -13311,7 +13318,9 @@ function slugForGate({ gate, index, scope }) {
|
|
|
13311
13318
|
* agent step prompt as a completion directive;
|
|
13312
13319
|
* - with `command` in the check's `takt` frontmatter block, a **command
|
|
13313
13320
|
* gate** (`{type: command, name, command, cwd, timeout_ms}`), which Takt
|
|
13314
|
-
* runs after the step
|
|
13321
|
+
* runs after the step (since 0.62.0: after rule resolution and before the
|
|
13322
|
+
* transition, unless the selected rule sets `command_gates: skip`) and
|
|
13323
|
+
* fails on a non-zero exit code.
|
|
13315
13324
|
*
|
|
13316
13325
|
* `steps` / `personas` in that block scope a gate to named workflow steps or
|
|
13317
13326
|
* personas (`workflow_overrides.steps.<step>.quality_gates`); an unscoped gate
|
|
@@ -24152,9 +24161,10 @@ function stripTrustedDirectoryWrapper(command) {
|
|
|
24152
24161
|
* to filter on in the first place.
|
|
24153
24162
|
*
|
|
24154
24163
|
* Keyed on native names because the check runs after the canonical → native
|
|
24155
|
-
* mapping: `SessionHeartbeat` and `Interrupt`
|
|
24156
|
-
*
|
|
24157
|
-
*
|
|
24164
|
+
* mapping: `SessionHeartbeat` and `Interrupt` are not mapped from a canonical
|
|
24165
|
+
* event for Kimi (`Interrupt` is the shape of canonical `stopCancelled`, which
|
|
24166
|
+
* other tools map, but stays native-only here) and are only reachable through
|
|
24167
|
+
* a per-tool `kimi-code` override naming them directly.
|
|
24158
24168
|
*
|
|
24159
24169
|
* Deliberately narrower than Claude Code's equivalent set: Kimi Code's
|
|
24160
24170
|
* `UserPromptSubmit` matches the submitted prompt text, and `PermissionResult`
|
|
@@ -41387,19 +41397,27 @@ const CATEGORY_TO_GROK_TOOL = {
|
|
|
41387
41397
|
edit: "Edit",
|
|
41388
41398
|
write: "Edit",
|
|
41389
41399
|
grep: "Grep",
|
|
41400
|
+
glob: "Glob",
|
|
41390
41401
|
webfetch: "WebFetch",
|
|
41391
|
-
websearch: "WebSearch"
|
|
41402
|
+
websearch: "WebSearch",
|
|
41403
|
+
agent: "AgentMessage"
|
|
41392
41404
|
};
|
|
41393
41405
|
const GROK_TOOL_TO_CATEGORY = {
|
|
41394
41406
|
Bash: "bash",
|
|
41395
41407
|
Read: "read",
|
|
41396
41408
|
Edit: "edit",
|
|
41397
41409
|
Grep: "grep",
|
|
41410
|
+
Glob: "glob",
|
|
41398
41411
|
WebFetch: "webfetch",
|
|
41399
|
-
WebSearch: "websearch"
|
|
41412
|
+
WebSearch: "websearch",
|
|
41413
|
+
AgentMessage: "agent",
|
|
41414
|
+
...Object.fromEntries(["SendSubagentMessage", "SendAgentMessage"].map((tool) => [tool, "agent"]))
|
|
41400
41415
|
};
|
|
41401
41416
|
const GROK_MCP_TOOL = "MCPTool";
|
|
41402
|
-
const GROK_TOOL_TO_CATEGORY_LOWER =
|
|
41417
|
+
const GROK_TOOL_TO_CATEGORY_LOWER = {
|
|
41418
|
+
...Object.fromEntries(Object.entries(GROK_TOOL_TO_CATEGORY).map(([tool, category]) => [tool.toLowerCase(), category])),
|
|
41419
|
+
agent_message: "agent"
|
|
41420
|
+
};
|
|
41403
41421
|
const GROK_MCP_TOOL_ALIASES = /* @__PURE__ */ new Set(["mcp", GROK_MCP_TOOL.toLowerCase()]);
|
|
41404
41422
|
const GROKCLI_PERMISSION_RULES_KEY = "rules";
|
|
41405
41423
|
/**
|
|
@@ -41502,13 +41520,16 @@ function parseGrokRule(rule) {
|
|
|
41502
41520
|
* per-category, per-pattern model maps almost 1:1:
|
|
41503
41521
|
* - Generate: each `permission.<category>.<pattern> = allow|ask|deny` becomes
|
|
41504
41522
|
* the matching Grok entry and is bucketed into the `[permission]` array for
|
|
41505
|
-
* that action. `bash|read|edit|grep|webfetch|websearch` map to
|
|
41506
|
-
* tool; `write` collapses onto `Edit` (Grok has no `Write`
|
|
41507
|
-
* maps to `
|
|
41508
|
-
*
|
|
41509
|
-
*
|
|
41510
|
-
*
|
|
41511
|
-
*
|
|
41523
|
+
* that action. `bash|read|edit|grep|glob|webfetch|websearch|agent` map to
|
|
41524
|
+
* their Grok tool; `write` collapses onto `Edit` (Grok has no `Write`
|
|
41525
|
+
* tool); `glob` maps to `Glob` (an upstream alias of the `Grep` filter);
|
|
41526
|
+
* `agent` maps to `AgentMessage` (which gates messages to a running
|
|
41527
|
+
* subagent rather than its launch, and whose pattern is a subagent id
|
|
41528
|
+
* rather than a subagent type); `mcp__*` maps to `MCPTool(...)` (a scoped
|
|
41529
|
+
* MCP category folds its address into the parentheses, so a non-`*`
|
|
41530
|
+
* argument pattern on it is not represented). The one category with no Grok tool (`notebookedit`) is
|
|
41531
|
+
* skipped (with a warning when it carries a `deny` rule, to surface the
|
|
41532
|
+
* gap). When two canonical rules collapse onto the same Grok
|
|
41512
41533
|
* entry with different actions (e.g. `edit` allow + `write` deny → `Edit`),
|
|
41513
41534
|
* the strictest wins (`deny > ask > allow`) and a warning is logged, so the
|
|
41514
41535
|
* entry never lands contradictorily in two arrays.
|
|
@@ -42620,6 +42641,32 @@ function mergeKimiCodeToolsSection({ existingContent, patch }) {
|
|
|
42620
42641
|
return merged;
|
|
42621
42642
|
}
|
|
42622
42643
|
/**
|
|
42644
|
+
* Carry the existing `[permission]` siblings of `rules` over onto the generated
|
|
42645
|
+
* table. The gateway replaces the owned `permission` key wholesale and rulesync
|
|
42646
|
+
* only ever authors `rules`, so a hand-written sibling such as
|
|
42647
|
+
* `dangerous_command_guard = false` (Kimi Code 0.40.0) would otherwise be
|
|
42648
|
+
* deleted on every generate. Rulesync does not model these keys; they pass
|
|
42649
|
+
* through verbatim and `rules` always comes from the patch.
|
|
42650
|
+
*
|
|
42651
|
+
* @see https://moonshotai.github.io/kimi-code/en/configuration/config-files.html#permission
|
|
42652
|
+
*/
|
|
42653
|
+
function mergeKimiCodePermissionSection({ existingContent, patch }) {
|
|
42654
|
+
let existing;
|
|
42655
|
+
try {
|
|
42656
|
+
existing = parseSharedConfig({
|
|
42657
|
+
format: "toml",
|
|
42658
|
+
fileContent: existingContent
|
|
42659
|
+
}).permission;
|
|
42660
|
+
} catch {
|
|
42661
|
+
existing = void 0;
|
|
42662
|
+
}
|
|
42663
|
+
const { rules: _existingRules, ...siblings } = isRecord$1(existing) ? existing : {};
|
|
42664
|
+
return {
|
|
42665
|
+
...siblings,
|
|
42666
|
+
...isRecord$1(patch.permission) ? patch.permission : {}
|
|
42667
|
+
};
|
|
42668
|
+
}
|
|
42669
|
+
/**
|
|
42623
42670
|
* Build Kimi's `[tools]` section from a rulesync override, or read one back on
|
|
42624
42671
|
* import. Entries pass through verbatim: the section uses agent-file tool syntax
|
|
42625
42672
|
* (exact built-in names, `mcp__server__*` globs), not the canonical
|
|
@@ -42799,12 +42846,17 @@ var KimiCodePermissions = class KimiCodePermissions extends ToolPermissions {
|
|
|
42799
42846
|
existingContent: fileContent,
|
|
42800
42847
|
patch
|
|
42801
42848
|
});
|
|
42849
|
+
const mergedPermission = mergeKimiCodePermissionSection({
|
|
42850
|
+
existingContent: fileContent,
|
|
42851
|
+
patch
|
|
42852
|
+
});
|
|
42802
42853
|
this.fileContent = applySharedConfigPatch({
|
|
42803
42854
|
fileKey: getKimiCodeConfigSharedFileKey({ global: this.global }),
|
|
42804
42855
|
feature: "permissions",
|
|
42805
42856
|
existingContent: fileContent,
|
|
42806
42857
|
patch: {
|
|
42807
42858
|
...patch,
|
|
42859
|
+
permission: mergedPermission,
|
|
42808
42860
|
...mergedTools && { tools: mergedTools }
|
|
42809
42861
|
},
|
|
42810
42862
|
filePath: join(paths.relativeDirPath, paths.relativeFilePath)
|
|
@@ -55789,9 +55841,14 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
55789
55841
|
const rulesyncSkills = rulesyncDirs.filter((dir) => dir instanceof RulesyncSkill);
|
|
55790
55842
|
const factory = this.getFactory(this.toolTarget);
|
|
55791
55843
|
return (await Promise.all(rulesyncSkills.map(async (rulesyncSkill) => {
|
|
55792
|
-
|
|
55844
|
+
const isClaudecodeScheduledTask = rulesyncSkill.getFrontmatter().claudecode?.["scheduled-task"] === true;
|
|
55845
|
+
if (isClaudecodeScheduledTask && this.toolTarget !== "claudecode" && this.toolTarget !== "claudecode-legacy") return null;
|
|
55793
55846
|
if (!factory.class.isTargetedByRulesyncSkill(rulesyncSkill)) return null;
|
|
55794
55847
|
const dirName = rulesyncSkill.getDirName();
|
|
55848
|
+
if (isClaudecodeScheduledTask && !this.global) {
|
|
55849
|
+
this.logger.warn(`Skipping skill ${quoteForLog(dirName)} for '${this.toolTarget}': 'claudecode.scheduled-task' skills are only read from the user config directory (~/.claude/scheduled-tasks/), so nothing is written at project scope. Generate it with --global instead; a stale copy an earlier generate left under .claude/scheduled-tasks/ is removed by a generate with --delete.`);
|
|
55850
|
+
return null;
|
|
55851
|
+
}
|
|
55795
55852
|
const dirWriteBlockReason = await factory.class.getDirWriteBlockReason?.({
|
|
55796
55853
|
outputRoot: this.outputRoot,
|
|
55797
55854
|
relativeDirPath: factory.class.getSettablePaths({ global: this.global }).relativeDirPath,
|
|
@@ -70754,4 +70811,4 @@ async function importChecksCore(params) {
|
|
|
70754
70811
|
//#endregion
|
|
70755
70812
|
export { RulesyncCheck as $, ALL_TOOL_TARGETS as $t, CLAUDECODE_SKILLS_DIR_PATH as A, RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH as An, ensureDir as At, RulesyncSkill as B, quoteForLog as Bn, pathEscapesRoot as Bt, ChecksProcessor as C, RULESYNC_PERMISSIONS_FILE_NAME as Cn, applyFileMode as Ct, CLAUDECODE_LOCAL_RULE_FILE_NAME as D, RULESYNC_RELATIVE_DIR_PATH as Dn, checkPathTraversal as Dt, CLAUDECODE_DIR as E, RULESYNC_PERMISSIONS_SCHEMA_URL as En, assertWritablePathInsideRoot as Et, AUGMENTCODE_DIR as F, DEPRECATED_FEATURE_REPLACEMENTS as Fn, isFileSystemError as Ft, RulesyncMcp as G, removeFile as Gt, RulesyncRule as H, stripControlCharactersKeepingLineFeeds as Hn, readFileContentOrNull as Ht, AUGMENTCODE_SETTINGS_LOCAL_FILE_NAME as I, formatError as In, isSymlink as It, getRulesyncSourceCandidates as J, resolvePath as Jt, RulesyncIgnore as K, removeFileStrict as Kt, getLocalSkillDirNames as L, truncateText as Ln, listDirectoryEntryNames as Lt, FACTORYDROID_SETTINGS_LOCAL_FILE_NAME as M, parseCommaSeparatedList as Mn, getFileSize as Mt, caseFoldIdentity as N, ALL_FEATURES as Nn, getHomeDirectory as Nt, CLAUDECODE_MEMORIES_DIR_NAME as O, RULESYNC_RULES_RELATIVE_DIR_PATH as On, createTempDirectory as Ot, groupSpellingsByCaseFoldedIdentity as P, ALL_FEATURES_WITH_WILDCARD as Pn, isFileNotFoundError as Pt, RulesyncCommandFrontmatterSchema as Q, writeFileContent as Qt, RulesyncSubagent as R, hasDeceptiveHiddenCharacters as Rn, listFilePathsRecursively as Rt, QWENCODE_LOCAL_RULE_FILE_NAME as S, RULESYNC_NPM_SOURCES_LOCK_RELATIVE_FILE_PATH as Sn, ErrorCodes as St, CODEXCLI_DIR as T, RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH as Tn, assertTreeContainsNoSymlinks as Tt, RulesyncRuleFrontmatterSchema as U, stripHiddenCharacters as Un, removeDirectory as Ut, RulesyncSkillFrontmatterSchema as V, stripControlCharacters as Vn, readFileContent as Vt, RulesyncPermissions as W, removeDirectoryStrict as Wt, parseJsonc as X, toPosixPath as Xt, resolveRulesyncSourceWritePath as Y, runWithDirectoryRollback as Yt, RulesyncCommand as Z, writeFileBuffer as Zt, IgnoreProcessor as _, RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH as _n, warnOnConflictingFlags as _t, getProcessorRegistryEntry as a, RULESYNC_AIIGNORE_FILE_NAME as an, ConfigResolver as at, CommandsProcessor as b, RULESYNC_MCP_RELATIVE_FILE_PATH as bn, withWarnOnceScope as bt, RulesProcessor as c, RULESYNC_COMMANDS_RELATIVE_DIR_PATH as cn, CONFLICTING_TARGET_PAIRS as ct, CODEBUDDY_DIR as d, RULESYNC_CURATED_RULES_RELATIVE_DIR_PATH as dn, SourceEntrySchema as dt, ALL_TOOL_TARGETS_WITH_WILDCARD as en, RulesyncCheckFrontmatterSchema as et, CODEBUDDY_LOCAL_RULE_FILE_NAME as f, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH as fn, findControlCharacter as ft, McpProcessor as g, RULESYNC_IGNORE_RELATIVE_FILE_PATH as gn, fallbackLogger as gt, shortenToWidth as h, RULESYNC_HOOKS_RELATIVE_FILE_PATH as hn, WarningCollectingLogger as ht, inspectInputRoots as i, MAX_FILE_SIZE as in, SKILL_FILE_NAME as it, FACTORYDROID_DIR as j, RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH as jn, fileExists as jt, CLAUDECODE_SETTINGS_LOCAL_FILE_NAME as k, RULESYNC_SKILLS_RELATIVE_DIR_PATH as kn, directoryExists as kt, SubagentsProcessor as l, RULESYNC_CONFIG_RELATIVE_FILE_PATH as ln, ConfigFileSchema as lt, displayWidthOf as m, RULESYNC_HOOKS_LEGACY_FILE_NAME as mn, JsonLogger as mt, formatSourceLoadFailure as n, ToolTargetSchema as nn, loadYaml as nt, convertFromTool as o, RULESYNC_AIIGNORE_RELATIVE_FILE_PATH as on, mergeInputRootConfigs as ot, ELLIPSIS_WIDTH as p, RULESYNC_HOOKS_FILE_NAME as pn, ConsoleLogger as pt, RulesyncHooks as q, removeTempDirectory as qt, generate as r, CURATED_RULES_FEATURE_SUBDIR as rn, SHARED_USER_MANAGED_CONFIG_PATHS as rt, isPackagingToolTarget as s, RULESYNC_CHECKS_RELATIVE_DIR_PATH as sn, resolveEffectiveInputRoots as st, importFromTool as t, PACKAGING_TOOL_TARGETS as tn, stringifyFrontmatter as tt, SkillsProcessor as u, RULESYNC_CONFIG_SCHEMA_URL as un, GITIGNORE_DESTINATION_KEY as ut, CRUSH_LOCAL_RULE_FILE_NAME as v, RULESYNC_MCP_FILE_NAME as vn, withFallbackLoggerTarget as vt, CODEXCLI_BASH_RULES_FILE_NAME as w, RULESYNC_PERMISSIONS_LEGACY_FILE_NAME as wn, assertDirectoryIfExists as wt, QWENCODE_DIR as x, RULESYNC_MCP_SCHEMA_URL as xn, CLIError as xt, HooksProcessor as y, RULESYNC_MCP_LEGACY_FILE_NAME as yn, resetRunWarningState as yt, RulesyncSubagentFrontmatterSchema as z, hasEnclosingMarkOutsideKeycap as zn, listSubdirectoryNames as zt };
|
|
70756
70813
|
|
|
70757
|
-
//# sourceMappingURL=import-
|
|
70814
|
+
//# sourceMappingURL=import-DFeuBVD1.js.map
|