@nitra/cursor 1.27.0 → 1.27.2

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
@@ -4,6 +4,23 @@
4
4
 
5
5
  Формат — [Keep a Changelog](https://keepachangelog.com/uk/1.1.0/), нумерація — [SemVer](https://semver.org/lang/uk/).
6
6
 
7
+ ## [1.27.2] - 2026-05-26
8
+
9
+ ### Changed
10
+
11
+ - **`package.json#dependencies`**: `@anthropic-ai/claude-code` (^1.0.0) → `@anthropic-ai/claude-agent-sdk` (^0.3.0). У claude-code v2.x пакет реструктуризовано в CLI-only (бінарі через optionalDependencies, без `sdk.mjs`); SDK з функцією `query` винесли в окремий пакет `@anthropic-ai/claude-agent-sdk`. Сигнатура `query({ prompt, options })` і поля `options.cwd/maxTurns/allowedTools` зберігаються.
12
+ - **`scripts/coverage-fix.mjs`**: дзеркальна заміна імпорту `@anthropic-ai/claude-code` → `@anthropic-ai/claude-agent-sdk`. Тіло споживача без змін.
13
+
14
+ ### Fixed
15
+
16
+ - **ADR Stop-hook у Node v26 / Zed**: `capture-decisions.sh` спавнить bare `claude -p` як subprocess. PATH у Zed Claude Agent-сесіях має `node_modules/.bin` попереду `/opt/homebrew/bin`, тож резолвив локальний `@anthropic-ai/claude-code@1.0.128`, який краш-падає на старті під Node 26 (`TypeError: Cannot read properties of undefined (reading 'prototype')` у bundled google-auth-library коді, який припускає, що `require('stream')` повертає клас зі `.prototype`). Хук фіксував `empty response from LLM CLI` і виходив без створення чернетки. Після зняття v1-залежності з канона `node_modules/.bin/claude` shadow зникає, subprocess резолвить системний `claude` (homebrew або інший global) — той працює під Node 26 без правок.
17
+
18
+ ## [1.27.1] - 2026-05-26
19
+
20
+ ### Changed
21
+
22
+ - Стилістичні правки бенчмарк-артефактів `benchmarks/runner-comparison/` (форматування таблиць, code blocks) після ручного `bun run lint` у dev-репо. Без змін у поведінці rules чи правила `test`.
23
+
7
24
  ## [1.27.0] - 2026-05-26
8
25
 
9
26
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitra/cursor",
3
- "version": "1.27.0",
3
+ "version": "1.27.2",
4
4
  "description": "CLI для завантаження cursor-правил (префікс n-) у локальний репозиторій",
5
5
  "keywords": [
6
6
  "cli",
@@ -50,7 +50,7 @@
50
50
  "rename-yaml-extensions": "bun ./bin/n-cursor.js rename-yaml-extensions"
51
51
  },
52
52
  "dependencies": {
53
- "@anthropic-ai/claude-code": "^1.0.0",
53
+ "@anthropic-ai/claude-agent-sdk": "^0.3.0",
54
54
  "@anthropic-ai/sdk": "^0.54.0",
55
55
  "oxc-parser": "^0.128.0",
56
56
  "picomatch": "^4.0.4",
@@ -16,7 +16,8 @@ import { resolveJsRoot } from '../../../scripts/utils/resolve-js-root.mjs'
16
16
 
17
17
  const TEST_BLOCK_START = /^\s*(it|test)\(/
18
18
  const FILE_EXTENSION = /\.[^.]+$/
19
- const VITEST_HINT = 'js-lint coverage: vitest відсутній у package.json — додай `vitest`, `@vitest/coverage-v8` та `@stryker-mutator/vitest-runner` у devDependencies (див. test.mdc)'
19
+ const VITEST_HINT =
20
+ 'js-lint coverage: vitest відсутній у package.json — додай `vitest`, `@vitest/coverage-v8` та `@stryker-mutator/vitest-runner` у devDependencies (див. test.mdc)'
20
21
 
21
22
  /**
22
23
  * Чи у пакеті встановлено vitest (через dependencies або devDependencies).
@@ -4451,7 +4451,8 @@ export async function collectHttpRouteIngressForWorkload(dir, appLabel, fail) {
4451
4451
  function serviceSelectorAppLabel(spec) {
4452
4452
  if (spec === null || spec === undefined || typeof spec !== 'object' || Array.isArray(spec)) return null
4453
4453
  const selector = /** @type {Record<string, unknown>} */ (spec).selector
4454
- if (selector === null || selector === undefined || typeof selector !== 'object' || Array.isArray(selector)) return null
4454
+ if (selector === null || selector === undefined || typeof selector !== 'object' || Array.isArray(selector))
4455
+ return null
4455
4456
  const app = /** @type {Record<string, unknown>} */ (selector).app
4456
4457
  return typeof app === 'string' && app.trim() !== '' ? app : null
4457
4458
  }
@@ -100,7 +100,14 @@ export function renderMarkdown(rows) {
100
100
  lines.push(`| ${m.line} | \`${m.original}\` | \`${m.replacement}\` | ${m.mutantType} |`)
101
101
  }
102
102
  if (group.exampleTest) {
103
- lines.push('', `**Приклад тесту** (\`${group.exampleTest.testFile}\`):`, '', '```js', group.exampleTest.code ?? '', '```')
103
+ lines.push(
104
+ '',
105
+ `**Приклад тесту** (\`${group.exampleTest.testFile}\`):`,
106
+ '',
107
+ '```js',
108
+ group.exampleTest.code ?? '',
109
+ '```'
110
+ )
104
111
  }
105
112
  if (group.recommendationText) {
106
113
  lines.push('', '**Що треба протестувати:**', '', group.recommendationText)
@@ -75,7 +75,13 @@ export async function check() {
75
75
  }
76
76
 
77
77
  for (const jsRoot of jsRoots) {
78
- await ensureBaselineFile(reporter, cwd, STRYKER_BASELINE_PATH, join(jsRoot, 'stryker.config.mjs'), 'stryker.config.mjs')
78
+ await ensureBaselineFile(
79
+ reporter,
80
+ cwd,
81
+ STRYKER_BASELINE_PATH,
82
+ join(jsRoot, 'stryker.config.mjs'),
83
+ 'stryker.config.mjs'
84
+ )
79
85
  await ensureBaselineFile(reporter, cwd, VITEST_BASELINE_PATH, join(jsRoot, 'vitest.config.js'), 'vitest.config.js')
80
86
  }
81
87
 
@@ -4,7 +4,7 @@
4
4
  * (file, line, оригінальний код, вижилий варіант, тип мутації) і самостійно
5
5
  * знаходить або створює відповідні test-файли.
6
6
  *
7
- * Залежить від `@anthropic-ai/claude-code` (dependencies у npm/package.json).
7
+ * Залежить від `@anthropic-ai/claude-agent-sdk` (dependencies у npm/package.json).
8
8
  */
9
9
  import { readFile } from 'node:fs/promises'
10
10
  import { join } from 'node:path'
@@ -30,9 +30,9 @@ export async function fixSurvivedMutants(survived, projectRoot) {
30
30
  const prompt = await buildFixPrompt(survived, projectRoot)
31
31
  console.log(`\n🤖 coverage --fix: запускаю агента для ${totalMutants} вижилих мутантів...\n`)
32
32
 
33
- // Dynamic import: @anthropic-ai/claude-code завантажується лише при --fix,
33
+ // Dynamic import: @anthropic-ai/claude-agent-sdk завантажується лише при --fix,
34
34
  // щоб не гальмувати звичайний coverage-прогін за відсутності пакету.
35
- const { query } = await import('@anthropic-ai/claude-code')
35
+ const { query } = await import('@anthropic-ai/claude-agent-sdk')
36
36
 
37
37
  for await (const msg of query({
38
38
  prompt,