rulesync 8.11.0 → 8.12.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/{chunk-ZX2YPC22.js → chunk-643VJ2QM.js} +11 -7
- package/dist/cli/index.cjs +12 -8
- package/dist/cli/index.js +2 -2
- package/dist/index.cjs +11 -7
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -4196,7 +4196,8 @@ var CODEXCLI_HOOK_EVENTS = [
|
|
|
4196
4196
|
"preToolUse",
|
|
4197
4197
|
"postToolUse",
|
|
4198
4198
|
"beforeSubmitPrompt",
|
|
4199
|
-
"stop"
|
|
4199
|
+
"stop",
|
|
4200
|
+
"permissionRequest"
|
|
4200
4201
|
];
|
|
4201
4202
|
var hooksRecordSchema = z17.record(z17.string(), z17.array(HookDefinitionSchema));
|
|
4202
4203
|
var HooksConfigSchema = z17.looseObject({
|
|
@@ -4313,7 +4314,8 @@ var CANONICAL_TO_CODEXCLI_EVENT_NAMES = {
|
|
|
4313
4314
|
preToolUse: "PreToolUse",
|
|
4314
4315
|
postToolUse: "PostToolUse",
|
|
4315
4316
|
beforeSubmitPrompt: "UserPromptSubmit",
|
|
4316
|
-
stop: "Stop"
|
|
4317
|
+
stop: "Stop",
|
|
4318
|
+
permissionRequest: "PermissionRequest"
|
|
4317
4319
|
};
|
|
4318
4320
|
var CODEXCLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
4319
4321
|
Object.entries(CANONICAL_TO_CODEXCLI_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
@@ -19266,7 +19268,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19266
19268
|
if (root) {
|
|
19267
19269
|
return new _CopilotRule({
|
|
19268
19270
|
baseDir,
|
|
19269
|
-
frontmatter:
|
|
19271
|
+
frontmatter: {},
|
|
19270
19272
|
body,
|
|
19271
19273
|
relativeDirPath: paths.root.relativeDirPath,
|
|
19272
19274
|
relativeFilePath: paths.root.relativeFilePath,
|
|
@@ -19292,12 +19294,14 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19292
19294
|
}
|
|
19293
19295
|
static async fromFile({
|
|
19294
19296
|
baseDir = process.cwd(),
|
|
19297
|
+
relativeDirPath,
|
|
19295
19298
|
relativeFilePath,
|
|
19296
19299
|
validate = true,
|
|
19297
19300
|
global = false
|
|
19298
19301
|
}) {
|
|
19299
19302
|
const paths = this.getSettablePaths({ global });
|
|
19300
|
-
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
19303
|
+
const isRoot = relativeDirPath ? join126(relativeDirPath, relativeFilePath) === join126(paths.root.relativeDirPath, paths.root.relativeFilePath) : relativeFilePath === paths.root.relativeFilePath;
|
|
19304
|
+
const resolvedRelativeDirPath = relativeDirPath ?? (isRoot ? paths.root.relativeDirPath : paths.nonRoot?.relativeDirPath ?? paths.root.relativeDirPath);
|
|
19301
19305
|
if (isRoot) {
|
|
19302
19306
|
const relativePath2 = join126(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19303
19307
|
const filePath2 = join126(baseDir, relativePath2);
|
|
@@ -19315,7 +19319,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19315
19319
|
if (!paths.nonRoot) {
|
|
19316
19320
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19317
19321
|
}
|
|
19318
|
-
const relativePath = join126(
|
|
19322
|
+
const relativePath = join126(resolvedRelativeDirPath, relativeFilePath);
|
|
19319
19323
|
const filePath = join126(baseDir, relativePath);
|
|
19320
19324
|
const fileContent = await readFileContent(filePath);
|
|
19321
19325
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
@@ -19325,7 +19329,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19325
19329
|
}
|
|
19326
19330
|
return new _CopilotRule({
|
|
19327
19331
|
baseDir,
|
|
19328
|
-
relativeDirPath:
|
|
19332
|
+
relativeDirPath: resolvedRelativeDirPath,
|
|
19329
19333
|
relativeFilePath: relativeFilePath.endsWith(".instructions.md") ? relativeFilePath : relativeFilePath.replace(/\.md$/, ".instructions.md"),
|
|
19330
19334
|
frontmatter: result.data,
|
|
19331
19335
|
body: content.trim(),
|
|
@@ -19340,7 +19344,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19340
19344
|
global = false
|
|
19341
19345
|
}) {
|
|
19342
19346
|
const paths = this.getSettablePaths({ global });
|
|
19343
|
-
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
19347
|
+
const isRoot = join126(relativeDirPath, relativeFilePath) === join126(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19344
19348
|
return new _CopilotRule({
|
|
19345
19349
|
baseDir,
|
|
19346
19350
|
relativeDirPath,
|
package/dist/cli/index.cjs
CHANGED
|
@@ -4056,7 +4056,8 @@ var CODEXCLI_HOOK_EVENTS = [
|
|
|
4056
4056
|
"preToolUse",
|
|
4057
4057
|
"postToolUse",
|
|
4058
4058
|
"beforeSubmitPrompt",
|
|
4059
|
-
"stop"
|
|
4059
|
+
"stop",
|
|
4060
|
+
"permissionRequest"
|
|
4060
4061
|
];
|
|
4061
4062
|
var hooksRecordSchema = import_mini17.z.record(import_mini17.z.string(), import_mini17.z.array(HookDefinitionSchema));
|
|
4062
4063
|
var HooksConfigSchema = import_mini17.z.looseObject({
|
|
@@ -4173,7 +4174,8 @@ var CANONICAL_TO_CODEXCLI_EVENT_NAMES = {
|
|
|
4173
4174
|
preToolUse: "PreToolUse",
|
|
4174
4175
|
postToolUse: "PostToolUse",
|
|
4175
4176
|
beforeSubmitPrompt: "UserPromptSubmit",
|
|
4176
|
-
stop: "Stop"
|
|
4177
|
+
stop: "Stop",
|
|
4178
|
+
permissionRequest: "PermissionRequest"
|
|
4177
4179
|
};
|
|
4178
4180
|
var CODEXCLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
4179
4181
|
Object.entries(CANONICAL_TO_CODEXCLI_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
@@ -19299,7 +19301,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19299
19301
|
if (root) {
|
|
19300
19302
|
return new _CopilotRule({
|
|
19301
19303
|
baseDir,
|
|
19302
|
-
frontmatter:
|
|
19304
|
+
frontmatter: {},
|
|
19303
19305
|
body,
|
|
19304
19306
|
relativeDirPath: paths.root.relativeDirPath,
|
|
19305
19307
|
relativeFilePath: paths.root.relativeFilePath,
|
|
@@ -19325,12 +19327,14 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19325
19327
|
}
|
|
19326
19328
|
static async fromFile({
|
|
19327
19329
|
baseDir = process.cwd(),
|
|
19330
|
+
relativeDirPath,
|
|
19328
19331
|
relativeFilePath,
|
|
19329
19332
|
validate = true,
|
|
19330
19333
|
global = false
|
|
19331
19334
|
}) {
|
|
19332
19335
|
const paths = this.getSettablePaths({ global });
|
|
19333
|
-
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
19336
|
+
const isRoot = relativeDirPath ? (0, import_node_path129.join)(relativeDirPath, relativeFilePath) === (0, import_node_path129.join)(paths.root.relativeDirPath, paths.root.relativeFilePath) : relativeFilePath === paths.root.relativeFilePath;
|
|
19337
|
+
const resolvedRelativeDirPath = relativeDirPath ?? (isRoot ? paths.root.relativeDirPath : paths.nonRoot?.relativeDirPath ?? paths.root.relativeDirPath);
|
|
19334
19338
|
if (isRoot) {
|
|
19335
19339
|
const relativePath2 = (0, import_node_path129.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19336
19340
|
const filePath2 = (0, import_node_path129.join)(baseDir, relativePath2);
|
|
@@ -19348,7 +19352,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19348
19352
|
if (!paths.nonRoot) {
|
|
19349
19353
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19350
19354
|
}
|
|
19351
|
-
const relativePath = (0, import_node_path129.join)(
|
|
19355
|
+
const relativePath = (0, import_node_path129.join)(resolvedRelativeDirPath, relativeFilePath);
|
|
19352
19356
|
const filePath = (0, import_node_path129.join)(baseDir, relativePath);
|
|
19353
19357
|
const fileContent = await readFileContent(filePath);
|
|
19354
19358
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
@@ -19358,7 +19362,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19358
19362
|
}
|
|
19359
19363
|
return new _CopilotRule({
|
|
19360
19364
|
baseDir,
|
|
19361
|
-
relativeDirPath:
|
|
19365
|
+
relativeDirPath: resolvedRelativeDirPath,
|
|
19362
19366
|
relativeFilePath: relativeFilePath.endsWith(".instructions.md") ? relativeFilePath : relativeFilePath.replace(/\.md$/, ".instructions.md"),
|
|
19363
19367
|
frontmatter: result.data,
|
|
19364
19368
|
body: content.trim(),
|
|
@@ -19373,7 +19377,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19373
19377
|
global = false
|
|
19374
19378
|
}) {
|
|
19375
19379
|
const paths = this.getSettablePaths({ global });
|
|
19376
|
-
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
19380
|
+
const isRoot = (0, import_node_path129.join)(relativeDirPath, relativeFilePath) === (0, import_node_path129.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19377
19381
|
return new _CopilotRule({
|
|
19378
19382
|
baseDir,
|
|
19379
19383
|
relativeDirPath,
|
|
@@ -29596,7 +29600,7 @@ function wrapCommand({
|
|
|
29596
29600
|
}
|
|
29597
29601
|
|
|
29598
29602
|
// src/cli/index.ts
|
|
29599
|
-
var getVersion = () => "8.
|
|
29603
|
+
var getVersion = () => "8.12.0";
|
|
29600
29604
|
function wrapCommand2(name, errorCode, handler) {
|
|
29601
29605
|
return wrapCommand({ name, errorCode, handler, getVersion });
|
|
29602
29606
|
}
|
package/dist/cli/index.js
CHANGED
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
stringifyFrontmatter,
|
|
80
80
|
toPosixPath,
|
|
81
81
|
writeFileContent
|
|
82
|
-
} from "../chunk-
|
|
82
|
+
} from "../chunk-643VJ2QM.js";
|
|
83
83
|
|
|
84
84
|
// src/cli/index.ts
|
|
85
85
|
import { Command } from "commander";
|
|
@@ -6435,7 +6435,7 @@ function wrapCommand({
|
|
|
6435
6435
|
}
|
|
6436
6436
|
|
|
6437
6437
|
// src/cli/index.ts
|
|
6438
|
-
var getVersion = () => "8.
|
|
6438
|
+
var getVersion = () => "8.12.0";
|
|
6439
6439
|
function wrapCommand2(name, errorCode, handler) {
|
|
6440
6440
|
return wrapCommand({ name, errorCode, handler, getVersion });
|
|
6441
6441
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -4034,7 +4034,8 @@ var CODEXCLI_HOOK_EVENTS = [
|
|
|
4034
4034
|
"preToolUse",
|
|
4035
4035
|
"postToolUse",
|
|
4036
4036
|
"beforeSubmitPrompt",
|
|
4037
|
-
"stop"
|
|
4037
|
+
"stop",
|
|
4038
|
+
"permissionRequest"
|
|
4038
4039
|
];
|
|
4039
4040
|
var hooksRecordSchema = import_mini17.z.record(import_mini17.z.string(), import_mini17.z.array(HookDefinitionSchema));
|
|
4040
4041
|
var HooksConfigSchema = import_mini17.z.looseObject({
|
|
@@ -4151,7 +4152,8 @@ var CANONICAL_TO_CODEXCLI_EVENT_NAMES = {
|
|
|
4151
4152
|
preToolUse: "PreToolUse",
|
|
4152
4153
|
postToolUse: "PostToolUse",
|
|
4153
4154
|
beforeSubmitPrompt: "UserPromptSubmit",
|
|
4154
|
-
stop: "Stop"
|
|
4155
|
+
stop: "Stop",
|
|
4156
|
+
permissionRequest: "PermissionRequest"
|
|
4155
4157
|
};
|
|
4156
4158
|
var CODEXCLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
4157
4159
|
Object.entries(CANONICAL_TO_CODEXCLI_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
@@ -19172,7 +19174,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19172
19174
|
if (root) {
|
|
19173
19175
|
return new _CopilotRule({
|
|
19174
19176
|
baseDir,
|
|
19175
|
-
frontmatter:
|
|
19177
|
+
frontmatter: {},
|
|
19176
19178
|
body,
|
|
19177
19179
|
relativeDirPath: paths.root.relativeDirPath,
|
|
19178
19180
|
relativeFilePath: paths.root.relativeFilePath,
|
|
@@ -19198,12 +19200,14 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19198
19200
|
}
|
|
19199
19201
|
static async fromFile({
|
|
19200
19202
|
baseDir = process.cwd(),
|
|
19203
|
+
relativeDirPath,
|
|
19201
19204
|
relativeFilePath,
|
|
19202
19205
|
validate = true,
|
|
19203
19206
|
global = false
|
|
19204
19207
|
}) {
|
|
19205
19208
|
const paths = this.getSettablePaths({ global });
|
|
19206
|
-
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
19209
|
+
const isRoot = relativeDirPath ? (0, import_node_path129.join)(relativeDirPath, relativeFilePath) === (0, import_node_path129.join)(paths.root.relativeDirPath, paths.root.relativeFilePath) : relativeFilePath === paths.root.relativeFilePath;
|
|
19210
|
+
const resolvedRelativeDirPath = relativeDirPath ?? (isRoot ? paths.root.relativeDirPath : paths.nonRoot?.relativeDirPath ?? paths.root.relativeDirPath);
|
|
19207
19211
|
if (isRoot) {
|
|
19208
19212
|
const relativePath2 = (0, import_node_path129.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19209
19213
|
const filePath2 = (0, import_node_path129.join)(baseDir, relativePath2);
|
|
@@ -19221,7 +19225,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19221
19225
|
if (!paths.nonRoot) {
|
|
19222
19226
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19223
19227
|
}
|
|
19224
|
-
const relativePath = (0, import_node_path129.join)(
|
|
19228
|
+
const relativePath = (0, import_node_path129.join)(resolvedRelativeDirPath, relativeFilePath);
|
|
19225
19229
|
const filePath = (0, import_node_path129.join)(baseDir, relativePath);
|
|
19226
19230
|
const fileContent = await readFileContent(filePath);
|
|
19227
19231
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
@@ -19231,7 +19235,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19231
19235
|
}
|
|
19232
19236
|
return new _CopilotRule({
|
|
19233
19237
|
baseDir,
|
|
19234
|
-
relativeDirPath:
|
|
19238
|
+
relativeDirPath: resolvedRelativeDirPath,
|
|
19235
19239
|
relativeFilePath: relativeFilePath.endsWith(".instructions.md") ? relativeFilePath : relativeFilePath.replace(/\.md$/, ".instructions.md"),
|
|
19236
19240
|
frontmatter: result.data,
|
|
19237
19241
|
body: content.trim(),
|
|
@@ -19246,7 +19250,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19246
19250
|
global = false
|
|
19247
19251
|
}) {
|
|
19248
19252
|
const paths = this.getSettablePaths({ global });
|
|
19249
|
-
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
19253
|
+
const isRoot = (0, import_node_path129.join)(relativeDirPath, relativeFilePath) === (0, import_node_path129.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19250
19254
|
return new _CopilotRule({
|
|
19251
19255
|
baseDir,
|
|
19252
19256
|
relativeDirPath,
|
package/dist/index.js
CHANGED