cogn 2.2.7 → 2.2.9

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
@@ -2,7 +2,15 @@
2
2
 
3
3
  All notable changes to this package are documented in this file.
4
4
 
5
+ ## 2.2.9 - 2026-02-07
6
+
7
+ - Alias package aligned with `cognitive-modules-cli@2.2.9`.
8
+
9
+ ## 2.2.8 - 2026-02-07
10
+
11
+ - Fix: make `npx cogn` work with Node 24+ by spawning the CLI entry (avoids "exports" subpath and CJS/ESM issues).
12
+ - Alias package aligned with `cognitive-modules-cli@2.2.8`.
13
+
5
14
  ## 2.2.7 - 2026-02-06
6
15
 
7
16
  - Alias package aligned with `cognitive-modules-cli@2.2.7`.
8
- - Added package-level publish metadata and explicit file whitelist.
package/README.md CHANGED
@@ -6,19 +6,19 @@ Cognitive Modules CLI 的短名别名包,安装后提供 `cog` 命令。
6
6
 
7
7
  ```bash
8
8
  # 零安装运行
9
- npx cogn@2.2.7 run code-reviewer --args "def login(u,p): pass"
9
+ npx cogn@2.2.9 run code-reviewer --args "def login(u,p): pass"
10
10
 
11
11
  # 列出模块
12
- npx cogn@2.2.7 list
12
+ npx cogn@2.2.9 list
13
13
 
14
14
  # 查看帮助
15
- npx cogn@2.2.7 --help
15
+ npx cogn@2.2.9 --help
16
16
  ```
17
17
 
18
18
  ## 全局安装
19
19
 
20
20
  ```bash
21
- npm install -g cogn@2.2.7
21
+ npm install -g cogn@2.2.9
22
22
 
23
23
  # 然后直接使用
24
24
  cog run code-reviewer --args "..."
@@ -26,8 +26,8 @@ cog run code-reviewer --args "..."
26
26
 
27
27
  ## 更多信息
28
28
 
29
- - GitHub: https://github.com/ziel-io/cognitive-modules
30
- - 文档(仓库内):README.md
29
+ - GitHub: https://github.com/Cognary/cognitive
30
+ - 文档: https://cognary.github.io/cognitive/
31
31
 
32
32
  ## 发布前检查
33
33
 
package/bin.js CHANGED
@@ -1,2 +1,40 @@
1
1
  #!/usr/bin/env node
2
- require('cognitive-modules-cli/dist/cli.js');
2
+ 'use strict';
3
+
4
+ // `cognitive-modules-cli` is ESM with a restrictive "exports" map. We must not
5
+ // `require(".../dist/cli.js")` (blocked by exports + would hit ERR_REQUIRE_ESM).
6
+ // Instead, resolve its bin entry and spawn Node on that file.
7
+
8
+ const cp = require('node:child_process');
9
+ const fs = require('node:fs');
10
+ const path = require('node:path');
11
+
12
+ function resolveCliEntry() {
13
+ const pkgJsonPath = require.resolve('cognitive-modules-cli/package.json');
14
+ const pkgDir = path.dirname(pkgJsonPath);
15
+ const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
16
+
17
+ let rel = null;
18
+ if (typeof pkg.bin === 'string') {
19
+ rel = pkg.bin;
20
+ } else if (pkg.bin && typeof pkg.bin === 'object') {
21
+ rel = pkg.bin.cog || pkg.bin['cognitive-modules-cli'] || Object.values(pkg.bin)[0];
22
+ }
23
+
24
+ if (!rel || typeof rel !== 'string') rel = 'dist/cli.js';
25
+ return path.join(pkgDir, rel);
26
+ }
27
+
28
+ let cliPath;
29
+ try {
30
+ cliPath = resolveCliEntry();
31
+ } catch (err) {
32
+ const msg = err && err.message ? err.message : String(err);
33
+ console.error(`[cogn] Failed to resolve cognitive-modules-cli. ${msg}`);
34
+ console.error('[cogn] Try: npm i -g cogn (or cognitive-modules-cli)');
35
+ process.exit(1);
36
+ }
37
+
38
+ const args = process.argv.slice(2);
39
+ const res = cp.spawnSync(process.execPath, [cliPath, ...args], { stdio: 'inherit' });
40
+ process.exitCode = typeof res.status === 'number' ? res.status : 1;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "cogn",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
4
4
  "description": "Cognitive Modules CLI - Structured AI Task Execution (alias for cognitive-modules-cli)",
5
5
  "bin": {
6
- "cogn": "./bin.js",
7
- "cog": "./bin.js"
6
+ "cogn": "bin.js",
7
+ "cog": "bin.js"
8
8
  },
9
9
  "scripts": {
10
10
  "pack:check": "npm pack --dry-run --json --cache ../../.npm-cache"
@@ -21,7 +21,7 @@
21
21
  "author": "ziel-io",
22
22
  "repository": {
23
23
  "type": "git",
24
- "url": "https://github.com/Cognary/cognitive.git"
24
+ "url": "git+https://github.com/Cognary/cognitive.git"
25
25
  },
26
26
  "homepage": "https://cognary.github.io/cognitive/",
27
27
  "bugs": {
@@ -40,6 +40,6 @@
40
40
  "node": ">=18.0.0"
41
41
  },
42
42
  "dependencies": {
43
- "cognitive-modules-cli": "2.2.7"
43
+ "cognitive-modules-cli": "2.2.9"
44
44
  }
45
45
  }