@cmodjs/rulebook 0.6.0 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmodjs/rulebook",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Checks every file, reply, tool call, and commit against your rules and linters before it lands.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -46,7 +46,7 @@
46
46
  "@ast-grep/lang-yaml": "0.0.6",
47
47
  "@ast-grep/napi": "0.51.1",
48
48
  "@biomejs/biome": "2.6.4",
49
- "@cmodjs/core": "6.0.2",
49
+ "@cmodjs/core": "6.2.0",
50
50
  "diff": "9.0.0",
51
51
  "marked": "15.0.0",
52
52
  "oxlint": "1.86.0",
package/src/api.ts CHANGED
@@ -23,6 +23,7 @@ export type Command = {
23
23
  readonly argv: readonly [string, ...string[]]
24
24
  readonly folder: string
25
25
  readonly input?: number
26
+ readonly runner?: number
26
27
  }
27
28
 
28
29
  export type Shell = {
package/src/rules.ts CHANGED
@@ -162,9 +162,9 @@ function linesOf({ path, lines }: CheckedFile): readonly Line[] {
162
162
  }
163
163
 
164
164
  function commandsOf({ shell, lines }: CheckedFile): readonly Command[] {
165
- return (shell?.commands ?? []).map(({ argv, folder, input }) => {
165
+ return (shell?.commands ?? []).map(({ argv, folder, input, runner }) => {
166
166
  const index = lines.findIndex((line) => line.includes(argv[0]))
167
- return { lineNumber: index === -1 ? 1 : index + 1, program: basename(argv[0]), args: argv.slice(1), argv, folder, ...(input === undefined ? {} : { input }) }
167
+ return { lineNumber: index === -1 ? 1 : index + 1, program: basename(argv[0]), args: argv.slice(1), argv, folder, ...(input === undefined ? {} : { input }), ...(runner === undefined ? {} : { runner }) }
168
168
  })
169
169
  }
170
170