oc-pilot 0.114.5 → 0.114.6

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.114.6
4
+
5
+ - `ready` и `doctor` теперь сравнивают версию найденного бинарника хука с текущим CLI. Устаревший глобальный `oc-pilot` больше не выглядит здоровым хуком: отчёт предупреждает, какую версию запустит pre-commit.
6
+ - Общие `readBinaryVersion`, `parseBinaryVersion` и `versionInvocation` вынесены в `src/core/hooks.ts`; на Windows локальный `.cmd`-шим выбирается раньше shell-обёртки, поэтому проверка версии работает и там.
7
+ - README описывает проверку версии; 861 тест; версия 0.114.6.
8
+
3
9
  ## 0.114.5
4
10
 
5
11
  - `resolveHookBinary` проверяет, что установленный управляемый хук действительно найдёт oc-pilot: `OC_PILOT_BIN`, локальный `node_modules/.bin/oc-pilot`, затем `PATH`.
package/README.md CHANGED
@@ -610,7 +610,7 @@ oc-pilot install-hook --pre-push
610
610
  oc-pilot install-hook --uninstall
611
611
  ```
612
612
 
613
- Hooks are opt-in and reversible. A hook that does not belong to oc-pilot is never overwritten unless `--force` is passed, and then the old file is kept as `<hook>.oc-pilot.bak`. Every managed hook is stamped with a marker; hooks written by older versions are reported as outdated by `oc-pilot doctor` and upgraded in place with `oc-pilot doctor --fix`. Set `OC_PILOT_SKIP=1` to bypass the hooks for a single command. The hook prefers `OC_PILOT_BIN`, then `./node_modules/.bin/oc-pilot`, then `oc-pilot` from `PATH`; if none is found, it prints a warning and skips the check. `core.hooksPath` and worktrees are respected.
613
+ Hooks are opt-in and reversible. A hook that does not belong to oc-pilot is never overwritten unless `--force` is passed, and then the old file is kept as `<hook>.oc-pilot.bak`. Every managed hook is stamped with a marker; hooks written by older versions are reported as outdated by `oc-pilot doctor` and upgraded in place with `oc-pilot doctor --fix`. Set `OC_PILOT_SKIP=1` to bypass the hooks for a single command. The hook prefers `OC_PILOT_BIN`, then `./node_modules/.bin/oc-pilot`, then `oc-pilot` from `PATH`; if none is found, it prints a warning and skips the check. `oc-pilot ready` and `oc-pilot doctor` also compare the resolved binary version with the running CLI and warn when they differ. `core.hooksPath` and worktrees are respected.
614
614
 
615
615
  ### `restore`
616
616
 
@@ -1034,7 +1034,7 @@ Start the server manually with an explicit project directory:
1034
1034
  ```bash
1035
1035
  oc-pilot-mcp --cwd /absolute/path/to/project
1036
1036
  # pinned for reproducibility:
1037
- npx -y oc-pilot@0.114.5 mcp --cwd /absolute/path/to/project
1037
+ npx -y oc-pilot@0.114.6 mcp --cwd /absolute/path/to/project
1038
1038
  ```
1039
1039
 
1040
1040
  The `diff` and `log` tool arguments are text, not file paths. `paths` and `files` are project-relative and cannot escape the project directory. `context` is literal text, not an `@file` reference. `base` must be a git ref. `lang`, `fail_on`, `repo_context`, and `no_secret_scan` are available where the corresponding CLI command supports them.
@@ -1209,7 +1209,7 @@ jobs:
1209
1209
  - uses: actions/checkout@v4
1210
1210
  with:
1211
1211
  fetch-depth: 0
1212
- - uses: MyNameIsNikki/oc-pilot@v0.114.5
1212
+ - uses: MyNameIsNikki/oc-pilot@v0.114.6
1213
1213
  with:
1214
1214
  command: scan
1215
1215
  args: --base origin/${{ github.base_ref }} --fail-on-secrets
@@ -1232,7 +1232,7 @@ jobs:
1232
1232
  - uses: actions/setup-node@v4
1233
1233
  with:
1234
1234
  node-version: 22
1235
- - run: npm install -g https://github.com/MyNameIsNikki/oc-pilot/archive/refs/tags/v0.114.5.tar.gz
1235
+ - run: npm install -g https://github.com/MyNameIsNikki/oc-pilot/archive/refs/tags/v0.114.6.tar.gz
1236
1236
  - run: oc-pilot scan --base origin/${{ github.base_ref }}
1237
1237
  - run: oc-pilot review --base origin/${{ github.base_ref }} --fail-on warning --fail-on-secrets --github
1238
1238
  env:
package/README.ru.md CHANGED
@@ -621,7 +621,7 @@ oc-pilot install-hook --pre-push
621
621
  oc-pilot install-hook --uninstall
622
622
  ```
623
623
 
624
- Хуки опциональны и обратимы. Чужой хук не перезаписывается без `--force`, а при замене сохраняется как `<hook>.oc-pilot.bak`. Каждый управляемый хук помечен маркером; хуки старых версий `oc-pilot doctor` показывает как устаревшие и обновляет через `oc-pilot doctor --fix`. Обход на одну команду — `OC_PILOT_SKIP=1`. Хук сначала берёт `OC_PILOT_BIN`, затем `./node_modules/.bin/oc-pilot`, затем `oc-pilot` из `PATH`; если ничего не найдено, он печатает предупреждение и пропускает проверку. Поддерживаются `core.hooksPath` и worktrees.
624
+ Хуки опциональны и обратимы. Чужой хук не перезаписывается без `--force`, а при замене сохраняется как `<hook>.oc-pilot.bak`. Каждый управляемый хук помечен маркером; хуки старых версий `oc-pilot doctor` показывает как устаревшие и обновляет через `oc-pilot doctor --fix`. Обход на одну команду — `OC_PILOT_SKIP=1`. Хук сначала берёт `OC_PILOT_BIN`, затем `./node_modules/.bin/oc-pilot`, затем `oc-pilot` из `PATH`; если ничего не найдено, он печатает предупреждение и пропускает проверку. `oc-pilot ready` и `oc-pilot doctor` также сравнивают версию найденного бинарника с текущим CLI и предупреждают при расхождении. Поддерживаются `core.hooksPath` и worktrees.
625
625
 
626
626
  ### `restore`
627
627
 
@@ -985,7 +985,7 @@ ZCode импортирует серверы из Claude Code, Codex, OpenCode и
985
985
  ```bash
986
986
  oc-pilot-mcp --cwd "C:\path\to\project"
987
987
  # версия зафиксирована для воспроизводимости:
988
- npx -y oc-pilot@0.114.5 mcp --cwd "C:\path\to\project"
988
+ npx -y oc-pilot@0.114.6 mcp --cwd "C:\path\to\project"
989
989
  ```
990
990
 
991
991
  Пример для Claude Code (`.mcp.json`):
@@ -1057,7 +1057,7 @@ jobs:
1057
1057
  - uses: actions/checkout@v4
1058
1058
  with:
1059
1059
  fetch-depth: 0
1060
- - uses: MyNameIsNikki/oc-pilot@v0.114.5
1060
+ - uses: MyNameIsNikki/oc-pilot@v0.114.6
1061
1061
  with:
1062
1062
  command: scan
1063
1063
  args: --base origin/${{ github.base_ref }} --fail-on-secrets
package/dist/cli.test.js CHANGED
@@ -4,6 +4,7 @@ import { tmpdir } from "node:os";
4
4
  import { delimiter, join, resolve } from "node:path";
5
5
  import { spawn, spawnSync } from "node:child_process";
6
6
  import { test } from "node:test";
7
+ import { VERSION } from "./version.js";
7
8
  const CLI = resolve("dist/cli.js");
8
9
  const AWS_KEY = ["AKIA", "IOSFODNN7EXAMPLE"].join("");
9
10
  function runCli(args, cwd, extraEnv = {}) {
@@ -1589,10 +1590,14 @@ test("ready --fix installs the hook, config and instructions", () => {
1589
1590
  writeFileSync(join(dir, "package-lock.json"), JSON.stringify({ name: "demo", lockfileVersion: 3, packages: { "": { name: "demo" } } }), "utf8");
1590
1591
  const binDir = join(dir, "node_modules", ".bin");
1591
1592
  mkdirSync(binDir, { recursive: true });
1592
- const bin = join(binDir, "oc-pilot");
1593
- writeFileSync(bin, "#!/bin/sh\nexit 0\n", "utf8");
1594
- if (process.platform !== "win32")
1593
+ if (process.platform === "win32") {
1594
+ writeFileSync(join(binDir, "oc-pilot.cmd"), `@echo oc-pilot ${VERSION}\r\n`, "utf8");
1595
+ }
1596
+ else {
1597
+ const bin = join(binDir, "oc-pilot");
1598
+ writeFileSync(bin, `#!/bin/sh\necho "oc-pilot ${VERSION}"\n`, "utf8");
1595
1599
  chmodSync(bin, 0o755);
1600
+ }
1596
1601
  const before = runCli(["ready", "--cwd", dir, "--json"], dir);
1597
1602
  assert.equal(before.status, 0, before.stderr);
1598
1603
  const baseline = JSON.parse(before.stdout);