@clubs.place/cli 0.1.23 → 0.1.24
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/PROVENANCE.json +9 -10
- package/README.md +13 -15
- package/bin/clubs.mjs +8 -8
- package/package.json +1 -1
- package/src/autorun.mjs +1 -1
- package/src/autorun.test.mjs +2 -2
- package/src/mcp.mjs +26 -4
- package/src/profiles.mjs +12 -1
- package/src/profiles.test.mjs +9 -2
package/PROVENANCE.json
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@clubs.place/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"repository": "https://github.com/frame00/@clubs.place/cli",
|
|
5
|
-
"commit": "
|
|
5
|
+
"commit": "6d066f264458d284128da7cf981ac30e81c86be2",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"generated_at": "2026-10-
|
|
7
|
+
"generated_at": "2026-10-26T06:41:39.425Z",
|
|
8
8
|
"files": {
|
|
9
9
|
".env.example": "sha256-6b151ffb18a84ae9e468d77e82d6af1ebb344ee5f4a45f065e396c56859d6cf6",
|
|
10
|
-
"PROVENANCE.json": "sha256-c51a96a78d92b41e769bfe94fd931ced19181a5c50a9c8d25d7544bc02f6d42d",
|
|
11
10
|
"bin/clubs-nippo": "sha256-03868da2fca1cbd333f2260d08bcb0b14a258a7e7df0da8bfce3e2ed7bee2c62",
|
|
12
11
|
"bin/clubs-nippo-web.mjs": "sha256-23734c47f22cd686c30fd3425b904174ee265ca113a66c34b45916905ff06b4a",
|
|
13
12
|
"bin/clubs-nippo.mjs": "sha256-51102bf7467c7794770c6046305384f2209c450136af3dced39b6cc2a974cff7",
|
|
14
|
-
"bin/clubs.mjs": "sha256-
|
|
13
|
+
"bin/clubs.mjs": "sha256-c2bb887a6f5f059e4e490e92de4e83bedd4549461adc382e273cdafa6f6fb0e4",
|
|
15
14
|
"docs/events-schema.md": "sha256-6be7a614351c2a3dbf15c5201dbf5d466649e4b91d17206c603f0c26b0290256",
|
|
16
15
|
"examples/hermes-events.sample.jsonl": "sha256-bb895a3d5abeeab10a46835af2771d077b71564286a816caf8d73682dbfec9cf",
|
|
17
16
|
"src/aggregate.mjs": "sha256-2b8c9185ee133a115e98e2ed6d05c536e4d9f6cc71e390ceab2fca89f7dc6512",
|
|
18
17
|
"src/aggregate.slots.test.mjs": "sha256-e0952c2cd41ca974a933d37a7737c3805620bff3398f3789bc4fcffa8bed5049",
|
|
19
|
-
"src/autorun.mjs": "sha256-
|
|
20
|
-
"src/autorun.test.mjs": "sha256-
|
|
18
|
+
"src/autorun.mjs": "sha256-0c8de9555458536b4070185d8590e7a40f6f0d88b89f1312ebdbea6f1c064446",
|
|
19
|
+
"src/autorun.test.mjs": "sha256-868260443886a4ee29ce259f890f04615d0ce69d651ff9960441a5255f2358cd",
|
|
21
20
|
"src/cards.mjs": "sha256-e301d3039eccbab6efad4a98679de898be75f95dc3542aaab15a1d629191eca5",
|
|
22
21
|
"src/collect.mjs": "sha256-60f9d89d373fd8392008aaf6055815248e76485a61d72afcc6aa0b2b6d84a343",
|
|
23
22
|
"src/config.mjs": "sha256-aec9aed44e618d5c1adc6ed9b314de23aefcc9c0f7c26f827f461d127143a0ea",
|
|
@@ -33,11 +32,11 @@
|
|
|
33
32
|
"src/lemma.docHash.test.mjs": "sha256-7446ac23bdfbe7e92490134cbe74470266afc1efd176c3e40078d70bd1d1a141",
|
|
34
33
|
"src/lemma.mjs": "sha256-48fdf89267bf09c90eafde180f0fe00fb443ea0dbf87b7dd970689d1fc192675",
|
|
35
34
|
"src/mask.mjs": "sha256-324c47cf78db4596965f0e0f39ff8f63ed794baf8b9f1796de5feb0e69891471",
|
|
36
|
-
"src/mcp.mjs": "sha256-
|
|
35
|
+
"src/mcp.mjs": "sha256-d1f06c54ba174abb7979f3ec08218d1f00bd8e886f8dc1e11c04ce2fea1986bc",
|
|
37
36
|
"src/narrative.blockRepos.test.mjs": "sha256-0be41c34bf5a2848667dbca9456cd7eac250f19deaec5bd2ba36ae572baf7ad3",
|
|
38
37
|
"src/narrative.mjs": "sha256-5b29d30c451fd05781384c4793623c303c4e52333cb70f3ef52a4164094f5ccb",
|
|
39
|
-
"src/profiles.mjs": "sha256-
|
|
40
|
-
"src/profiles.test.mjs": "sha256-
|
|
38
|
+
"src/profiles.mjs": "sha256-b5f3fe14d2469334e199a2e4a4a870735940f66117ec80c969ff300aae565c69",
|
|
39
|
+
"src/profiles.test.mjs": "sha256-c781597ba9d1da643a41e732ff8fe1669972d39ab2a60b8ce6b310aabde2fcf5",
|
|
41
40
|
"src/prompt.mjs": "sha256-0f0f01bc4b8b88cd752dd667f6b903847fc0e9f09d5e98a7c05f3d3873085f98",
|
|
42
41
|
"src/prompt.test.mjs": "sha256-972c6962fd7baea0495a3f17694944a841c9b2f90c1f7397264c5e4aca8b2d48",
|
|
43
42
|
"src/remote-config.mjs": "sha256-8988c6dac675775e6e33fd3aeda71d335eb2880bcfe9b5266f78e8a023fe74d6",
|
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# clubs-nippo — AI業務日報
|
|
2
2
|
|
|
3
3
|
AIエージェントの実行ログから、前日ぶんの日報を自動生成してメール送信する CLI ツール。
|
|
4
|
+
CLUBS の日報の自動化専用(AI を CLUBS につなぐのは接続画面のリモート MCP)。
|
|
4
5
|
|
|
5
6
|
- **pull 型**: 生ログはあなたの端末を出ない。集計値とマスク済み本文だけを送る
|
|
6
7
|
- **依存ゼロ**: Node 20+ の標準機能のみ。`npm install` 不要
|
|
@@ -11,7 +12,7 @@ AIエージェントの実行ログから、前日ぶんの日報を自動生成
|
|
|
11
12
|
CLUBS の接続画面が発行するコマンドをそのまま貼る:
|
|
12
13
|
|
|
13
14
|
```bash
|
|
14
|
-
npx clubs
|
|
15
|
+
npx @clubs.place/cli@latest init --url=<取込URL> --code=<接続コード>
|
|
15
16
|
```
|
|
16
17
|
|
|
17
18
|
接続コードは 10 分・1 回限り有効で、init がその場で連携トークンに引き換える
|
|
@@ -27,9 +28,9 @@ AI が一度も動かなかった日は日報にならない(メールも来
|
|
|
27
28
|
## 使い方
|
|
28
29
|
|
|
29
30
|
```bash
|
|
30
|
-
npx clubs
|
|
31
|
-
npx clubs
|
|
32
|
-
npx clubs
|
|
31
|
+
npx @clubs.place/cli@latest # 前日ぶんを生成して送信
|
|
32
|
+
npx @clubs.place/cli@latest --dry-run # 送信せず out/ に HTML を書くだけ
|
|
33
|
+
npx @clubs.place/cli@latest --date=2026-07-13 # 対象日を指定
|
|
33
34
|
```
|
|
34
35
|
|
|
35
36
|
### 1台で複数の AI(Claude Code と Codex など)
|
|
@@ -40,21 +41,18 @@ npx clubs-nippo@latest --date=2026-07-13 # 対象日を指定
|
|
|
40
41
|
ときは、これまでどおり上書きします。
|
|
41
42
|
|
|
42
43
|
```bash
|
|
43
|
-
npx clubs
|
|
44
|
+
npx @clubs.place/cli@latest --date=2026-10-08 --only=claude-code # その収集元だけ(あとから作るとき)
|
|
44
45
|
```
|
|
45
46
|
|
|
46
|
-
##
|
|
47
|
+
## AI を CLUBS につなぐ
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
この CLI は**日報の自動化だけ**を受け持つ。AI を CLUBS につなぐ(案件・ルールを
|
|
50
|
+
読む・残す)のは、CLUBS の接続画面(https://clubs.place/connections )が案内する
|
|
51
|
+
リモート MCP(URL+許可)で行う。
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
claude mcp
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
ツールは `clubs_register`(接続画面が発行した取込URL・連携トークンで登録)と
|
|
56
|
-
`clubs_link_status`(設定・サーバ疎通・トークン有効性)の2本だけ。日報の
|
|
57
|
-
取り込み・シールの発行は MCP からはできない(判定・発行はサーバ専権)。
|
|
53
|
+
以前の `claude mcp add clubs -- npx … mcp`(手元の MCP・`clubs_register` /
|
|
54
|
+
`clubs_link_status`)は終わる。登録してあれば `claude mcp remove clubs` で外し、
|
|
55
|
+
接続画面からつなぎ直す。
|
|
58
56
|
|
|
59
57
|
## 環境変数
|
|
60
58
|
|
package/bin/clubs.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
listProfiles,
|
|
12
12
|
readEnvFile,
|
|
13
13
|
runProfiles,
|
|
14
|
+
writeLastInit,
|
|
14
15
|
} from "../src/profiles.mjs";
|
|
15
16
|
import { fileURLToPath } from "node:url";
|
|
16
17
|
import { collect } from "../src/collect.mjs";
|
|
@@ -132,11 +133,6 @@ const HELP = `clubs-nippo — Claude Code の実行ログから前日ぶんの A
|
|
|
132
133
|
clubs-nippo cards カードを評価して発行(送信はしない)
|
|
133
134
|
clubs-nippo cards --dry-run 評価するが発行しない。しきい値を試すときは必ずこちら
|
|
134
135
|
(達成カードは剥奪できないので、誤発行は取り消せない)
|
|
135
|
-
clubs-nippo mcp MCP サーバー(stdio)として起動。AIクライアント
|
|
136
|
-
(Claude Code / Cursor 等)に登録すると、対話の中で
|
|
137
|
-
CLUBS への登録(clubs_register)と疎通確認
|
|
138
|
-
(clubs_link_status)ができる。例:
|
|
139
|
-
claude mcp add clubs -- npx -y clubs-nippo@latest mcp
|
|
140
136
|
|
|
141
137
|
収集元:
|
|
142
138
|
--source=claude-code この端末の Claude Code セッション記録(既定)
|
|
@@ -171,7 +167,10 @@ const main = async () => {
|
|
|
171
167
|
return;
|
|
172
168
|
}
|
|
173
169
|
|
|
174
|
-
// ── mcp: MCP
|
|
170
|
+
// ── mcp: 手元の MCP(stdio)。終わる(CLUBS 判断 #26・2026-10-16)──────
|
|
171
|
+
// AI を CLUBS につなぐのはリモート MCP。前に登録した人の AI が起動したとき
|
|
172
|
+
// 黙って落ちないよう、しばらくは動かしたまま「つなぎ直して」を伝える。
|
|
173
|
+
// stdout はプロトコル専用になる。
|
|
175
174
|
if (argv._[0] === "mcp") {
|
|
176
175
|
const { runMcpServer } = await import("../src/mcp.mjs");
|
|
177
176
|
await runMcpServer();
|
|
@@ -285,6 +284,7 @@ const main = async () => {
|
|
|
285
284
|
else lines.push(row);
|
|
286
285
|
}
|
|
287
286
|
writeFileSync(envPath, lines.join("\n") + "\n", "utf8");
|
|
287
|
+
writeLastInit(APP_HOME, envPath);
|
|
288
288
|
console.log(`設定を書きました: ${envPath}`);
|
|
289
289
|
console.log(` ${Object.keys(updates).join(", ")}`);
|
|
290
290
|
// cron は PATH が細く npx が見つからないことが多い。実際に動いている node の
|
|
@@ -295,7 +295,7 @@ const main = async () => {
|
|
|
295
295
|
if (home !== APP_HOME) {
|
|
296
296
|
// 自動実行は1本のまま。毎時の tick が並べた AI の分も動かす。
|
|
297
297
|
console.log("毎朝の自動実行は今のものがこの AI の分も動かします(登録し直しは不要)。");
|
|
298
|
-
console.log(`今すぐ試す(前日分を発行): CLUBS_NIPPO_HOME=${home} npx clubs
|
|
298
|
+
console.log(`今すぐ試す(前日分を発行): CLUBS_NIPPO_HOME=${home} npx @clubs.place/cli@latest`);
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
301
|
const yes = await promptYesNo("毎朝の自動実行を登録しますか? [Y/n]");
|
|
@@ -312,7 +312,7 @@ const main = async () => {
|
|
|
312
312
|
console.log(` ${hourlyLine}`);
|
|
313
313
|
}
|
|
314
314
|
console.log("");
|
|
315
|
-
console.log("今すぐ試す(前日分を発行): npx clubs
|
|
315
|
+
console.log("今すぐ試す(前日分を発行): npx @clubs.place/cli@latest");
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
318
|
|
package/package.json
CHANGED
package/src/autorun.mjs
CHANGED
package/src/autorun.test.mjs
CHANGED
|
@@ -16,14 +16,14 @@ test("macOS では caffeinate で包む(実行中のスリープを止める
|
|
|
16
16
|
"--",
|
|
17
17
|
NPX,
|
|
18
18
|
"-y",
|
|
19
|
-
"clubs
|
|
19
|
+
"@clubs.place/cli@latest",
|
|
20
20
|
"tick",
|
|
21
21
|
]);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
test("macOS 以外では包まない(caffeinate が無い)", () => {
|
|
25
25
|
for (const plat of ["linux", "freebsd", "win32"]) {
|
|
26
|
-
assert.deepEqual(tickCommand(NPX, plat), [NPX, "-y", "clubs
|
|
26
|
+
assert.deepEqual(tickCommand(NPX, plat), [NPX, "-y", "@clubs.place/cli@latest", "tick"]);
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
|
package/src/mcp.mjs
CHANGED
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
* - 出力はサーバ確定値・ローカル設定の定型フィールドのみ(自由文・他ユーザー
|
|
12
12
|
* 由来のテキストを返さない=注入面の最小化)。
|
|
13
13
|
*
|
|
14
|
+
* **終わる(CLUBS 判断 #26・2026-10-16)**: AI を CLUBS につなぐのはリモート MCP
|
|
15
|
+
* (接続画面の URL+許可)になり、この CLI は日報の自動化専用になった。前に
|
|
16
|
+
* 登録した人の AI が起動したとき黙って落ちないよう、しばらくは動かしたまま、
|
|
17
|
+
* 起動・道具の説明・返事のすべてで「つなぎ直して」を伝える(DEPRECATION)。
|
|
18
|
+
*
|
|
14
19
|
* 依存ゼロ方針(このリポの流儀)のため SDK は使わず、MCP の stdio
|
|
15
20
|
* トランスポート(JSON-RPC 2.0・1行1メッセージ)を最小実装する。
|
|
16
21
|
* stdout はプロトコル専用。ログは必ず stderr へ。
|
|
@@ -25,6 +30,12 @@ import { readHistory } from "./history.mjs";
|
|
|
25
30
|
|
|
26
31
|
const PROTOCOL_FALLBACK = "2025-06-18";
|
|
27
32
|
|
|
33
|
+
/** 終わることの知らせ。決まった文だけ(自由文を返さない方針のまま)。 */
|
|
34
|
+
export const DEPRECATION =
|
|
35
|
+
"この手元の MCP(clubs_register / clubs_link_status)は終わります。" +
|
|
36
|
+
"CLUBS の接続画面 https://clubs.place/connections からリモート MCP につなぎ直し、" +
|
|
37
|
+
"この登録は `claude mcp remove clubs` などで外してください。日報の自動化(tick)はこのまま動きます。";
|
|
38
|
+
|
|
28
39
|
const pkgVersion = () => {
|
|
29
40
|
try {
|
|
30
41
|
return JSON.parse(readFileSync(join(ROOT, "package.json"), "utf8")).version;
|
|
@@ -105,7 +116,9 @@ const TOOLS = [
|
|
|
105
116
|
{
|
|
106
117
|
name: "clubs_register",
|
|
107
118
|
description:
|
|
108
|
-
"
|
|
119
|
+
"【終わります】" +
|
|
120
|
+
DEPRECATION +
|
|
121
|
+
" / この端末を CLUBS に登録する(clubs-nippo init と同じ設定を書く)。url と token は CLUBS の接続画面(/nippo/connections)が発行した値をそのまま渡すこと。登録後にサーバへ疎通確認する。",
|
|
109
122
|
inputSchema: {
|
|
110
123
|
type: "object",
|
|
111
124
|
properties: {
|
|
@@ -127,12 +140,19 @@ const TOOLS = [
|
|
|
127
140
|
{
|
|
128
141
|
name: "clubs_link_status",
|
|
129
142
|
description:
|
|
130
|
-
"
|
|
143
|
+
"【終わります】" +
|
|
144
|
+
DEPRECATION +
|
|
145
|
+
" / CLUBS との連携状態を返す(設定の有無・サーバ疎通・トークン有効性・ローカル最終記録日)。",
|
|
131
146
|
inputSchema: { type: "object", properties: {} },
|
|
132
147
|
},
|
|
133
148
|
];
|
|
134
149
|
|
|
135
|
-
const callTool = async (name, args = {}) => {
|
|
150
|
+
export const callTool = async (name, args = {}) => ({
|
|
151
|
+
deprecated: DEPRECATION,
|
|
152
|
+
...(await callToolInner(name, args)),
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
const callToolInner = async (name, args = {}) => {
|
|
136
156
|
if (name === "clubs_register") {
|
|
137
157
|
const url = String(args.url ?? "");
|
|
138
158
|
const token = String(args.token ?? "");
|
|
@@ -179,7 +199,7 @@ const callTool = async (name, args = {}) => {
|
|
|
179
199
|
ingest_url_host: parsed.host,
|
|
180
200
|
server,
|
|
181
201
|
next: server.token_valid
|
|
182
|
-
? "毎朝の自動配信は crontab に `npx -y clubs
|
|
202
|
+
? "毎朝の自動配信は crontab に `npx -y @clubs.place/cli@latest tick` を登録(clubs-nippo init のヘルプ参照)"
|
|
183
203
|
: "トークンがサーバで確認できませんでした。接続画面で再発行して register し直してください",
|
|
184
204
|
};
|
|
185
205
|
}
|
|
@@ -220,6 +240,7 @@ const replyError = (id, code, message) => {
|
|
|
220
240
|
|
|
221
241
|
export const runMcpServer = async () => {
|
|
222
242
|
const rl = createInterface({ input: process.stdin, terminal: false });
|
|
243
|
+
console.error(`[clubs-nippo mcp] ${DEPRECATION}`);
|
|
223
244
|
console.error(
|
|
224
245
|
`[clubs-nippo mcp] stdio server ready (tools: ${TOOLS.map((t) => t.name).join(", ")})`,
|
|
225
246
|
);
|
|
@@ -243,6 +264,7 @@ export const runMcpServer = async () => {
|
|
|
243
264
|
protocolVersion: params?.protocolVersion ?? PROTOCOL_FALLBACK,
|
|
244
265
|
capabilities: { tools: { listChanged: false } },
|
|
245
266
|
serverInfo: { name: "clubs-nippo", version: pkgVersion() },
|
|
267
|
+
instructions: DEPRECATION,
|
|
246
268
|
});
|
|
247
269
|
} else if (method === "ping") {
|
|
248
270
|
reply(id, {});
|
package/src/profiles.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
1
|
+
import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
4
|
|
|
@@ -18,6 +18,17 @@ import { spawn } from "node:child_process";
|
|
|
18
18
|
|
|
19
19
|
export const PROFILE_DIR = "agents";
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* 最後の init が書いた .env の場所(APP_HOME/.last-init に1行)。
|
|
23
|
+
* インストールのスクリプトは MCP の Bearer をここから読む——2つ目の AI は
|
|
24
|
+
* agents/<ID>/.env に書かれるので、APP_HOME の .env を読むと前の AI の鍵で
|
|
25
|
+
* 登録して 401 になる(2026-10-24)。
|
|
26
|
+
*/
|
|
27
|
+
export const LAST_INIT_FILE = ".last-init";
|
|
28
|
+
|
|
29
|
+
export const writeLastInit = (home, envPath) =>
|
|
30
|
+
writeFileSync(join(home, LAST_INIT_FILE), envPath + "\n", "utf8");
|
|
31
|
+
|
|
21
32
|
/** 子プロセスの目印(子は並べた分をさらに回さない)。 */
|
|
22
33
|
export const CHILD_FLAG = "CLUBS_NIPPO_CHILD";
|
|
23
34
|
|
package/src/profiles.test.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { test } from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
|
-
import { mkdtempSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { mkdtempSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
|
-
import { chooseInitHome, childEnv, listProfiles, CHILD_FLAG } from "./profiles.mjs";
|
|
6
|
+
import { chooseInitHome, childEnv, listProfiles, writeLastInit, CHILD_FLAG, LAST_INIT_FILE } from "./profiles.mjs";
|
|
7
7
|
|
|
8
8
|
const home = () => mkdtempSync(join(tmpdir(), "nippo-"));
|
|
9
9
|
|
|
@@ -64,3 +64,10 @@ test("子プロセスには APP_HOME の .env の値を渡さない", () => {
|
|
|
64
64
|
assert.equal(env.CLUBS_NIPPO_HOME, "/x");
|
|
65
65
|
assert.equal(env[CHILD_FLAG], "1");
|
|
66
66
|
});
|
|
67
|
+
|
|
68
|
+
test("最後に書いた .env の場所を APP_HOME/.last-init に残す(並べた AI でも)", () => {
|
|
69
|
+
const h = home();
|
|
70
|
+
const env = join(h, "agents", "B", ".env");
|
|
71
|
+
writeLastInit(h, env);
|
|
72
|
+
assert.equal(readFileSync(join(h, LAST_INIT_FILE), "utf8"), env + "\n");
|
|
73
|
+
});
|