@lowzj/news-skill 0.1.0 → 0.1.1
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/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# NEWS Skill
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@lowzj/news-skill)
|
|
4
|
+
|
|
5
|
+
在 Codex、Claude Code、OpenCode、Pi 中用自然语言查询 [NEWS](https://xabcnews.com) 已收录的新闻,得到带摘要和来源的简报,并可按需提供原文链接。
|
|
4
6
|
|
|
5
7
|
```text
|
|
6
8
|
用 news 看今天 OpenAI 的重要新闻,给我 5 条,每条附原文链接。
|
|
@@ -11,19 +13,22 @@
|
|
|
11
13
|
|
|
12
14
|
## 安装与使用
|
|
13
15
|
|
|
14
|
-
从 npm
|
|
16
|
+
从 npm 官方仓库安装 [@lowzj/news-skill](https://www.npmjs.com/package/@lowzj/news-skill):
|
|
15
17
|
|
|
16
18
|
```bash
|
|
17
|
-
npm install -g @lowzj/news-skill
|
|
19
|
+
npm install -g @lowzj/news-skill@latest --registry=https://registry.npmjs.org/
|
|
20
|
+
news --version
|
|
18
21
|
news skills install --agent codex
|
|
19
22
|
```
|
|
20
23
|
|
|
21
24
|
也可以直接通过 npx 安装 Skill:
|
|
22
25
|
|
|
23
26
|
```bash
|
|
24
|
-
npx --yes --package=@lowzj/news-skill news skills install --agent codex
|
|
27
|
+
npx --yes --registry=https://registry.npmjs.org/ --package=@lowzj/news-skill@latest news skills install --agent codex
|
|
25
28
|
```
|
|
26
29
|
|
|
30
|
+
以上命令显式使用官方源,避免镜像同步延迟。需要固定版本时,将 `@latest` 替换为 `@0.1.1`。
|
|
31
|
+
|
|
27
32
|
将 `codex` 换成 `claude`、`opencode`、`pi`,或用 `all` 为四个 Agent 安装。默认安装到用户技能目录,跨项目可用;`--scope project` 安装到执行命令时所在的项目。
|
|
28
33
|
|
|
29
34
|
安装后启动新会话,使用对应入口:
|
|
@@ -41,6 +46,23 @@ Skill 会携带编译后的查询脚本,即使全局 `news` 命令不可用,
|
|
|
41
46
|
|
|
42
47
|
完整安装路径、项目安装、更新及本地/GitHub 安装方式见 [安装说明](docs/install.md)。
|
|
43
48
|
|
|
49
|
+
### 更新
|
|
50
|
+
|
|
51
|
+
升级全局 CLI 后,重新安装对应 Agent 的 Skill 副本:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install -g @lowzj/news-skill@latest --registry=https://registry.npmjs.org/
|
|
55
|
+
news skills install --agent codex --force
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
如果使用 npx 安装,执行:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx --yes --registry=https://registry.npmjs.org/ --package=@lowzj/news-skill@latest news skills install --agent codex --force
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`--force` 会替换安装器管理的 Skill 副本;有自定义修改时请先备份。更新全局 CLI 不会自动更新已安装的 Skill。
|
|
65
|
+
|
|
44
66
|
## 命令行
|
|
45
67
|
|
|
46
68
|
```bash
|
|
@@ -99,9 +121,23 @@ news --help
|
|
|
99
121
|
```bash
|
|
100
122
|
npm install
|
|
101
123
|
npm run build
|
|
102
|
-
npm
|
|
124
|
+
npm run check
|
|
103
125
|
```
|
|
104
126
|
|
|
105
127
|
TypeScript 提供 API 响应、查询参数和安装逻辑的类型约束;安装包包含编译后的 JavaScript,用户运行时无需 `ts-node`、`tsx` 或 TypeScript 编译器。构建产物同时放入 Skill,使 CLI 与 Agent 使用同一套查询实现。
|
|
106
128
|
|
|
129
|
+
`npm run check` 包含构建、自动化测试与安装包检查,验证无开发依赖安装、npx 安装以及四种 Agent 的独立 Skill 副本。
|
|
130
|
+
|
|
131
|
+
### 发布到 npm
|
|
132
|
+
|
|
133
|
+
维护者在完成版本更新并通过检查后,发布到官方仓库:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npm run check
|
|
137
|
+
npm publish --access public --registry=https://registry.npmjs.org/
|
|
138
|
+
npm view @lowzj/news-skill version --registry=https://registry.npmjs.org/
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
发布需要具备 `@lowzj/news-skill` 写入权限的 npm 账号;每次发布使用新的 `package.json` 版本,并同步 `package-lock.json`。`prepare` 会在发布时重新构建 JavaScript,`publishConfig` 已将目标设为 npm 官方仓库的公开包。
|
|
142
|
+
|
|
107
143
|
安装与 Skill 分发方式参考了 [talkoda-cli](https://github.com/lowzj/talkoda-cli),本项目独立实现。
|
package/package.json
CHANGED
package/skills/news/package.json
CHANGED
|
@@ -21,7 +21,7 @@ Resolve that absolute path from the loaded `SKILL.md`. Node.js 22.12+ is require
|
|
|
21
21
|
| `news skills install --agent AGENT` | Install the skill for a selected Agent. |
|
|
22
22
|
| `news --help` | Show the CLI's current usage. |
|
|
23
23
|
|
|
24
|
-
The default service is `https://
|
|
24
|
+
The default service is `https://xabcnews.com`. Network operations use public GET endpoints: `/topics`, `/days`, `/digest`, and `/insight`. There is no `/search` endpoint; searching is performed locally after retrieving digest pages. The CLI cannot create topics, trigger collection, or generate new server analysis.
|
|
25
25
|
|
|
26
26
|
## Select news
|
|
27
27
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
// The build copies only this metadata into the installed, self-contained skill.
|
|
3
3
|
export const VERSION = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
|
|
4
|
-
export const DEFAULT_API_URL = 'https://
|
|
4
|
+
export const DEFAULT_API_URL = 'https://xabcnews.com';
|