peertable 0.4.8 → 0.4.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/package.json +1 -1
- package/room/client.mjs +10 -1
- package/room/server.mjs +18 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "peertable",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "A round table of peer agents. No orchestrator at the head. Turn Claude Code, Codex, and Grok sessions into a team of equal, long-lived peers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/room/client.mjs
CHANGED
|
@@ -11,11 +11,12 @@ import { fileURLToPath } from 'node:url'
|
|
|
11
11
|
|
|
12
12
|
// client.mjs 側のハードコード版数。package.json の version と一致していることを
|
|
13
13
|
// diagnostics の version_consistency が見る(2 つの版数源の drift 検出。決定45)
|
|
14
|
-
const MCP_VERSION = '0.4.
|
|
14
|
+
const MCP_VERSION = '0.4.9'
|
|
15
15
|
const PKG_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..')
|
|
16
16
|
|
|
17
17
|
const USAGE = `usage:
|
|
18
18
|
peertable-client room MCP サーバーとして起動する(.mcp.json 経由の通常経路)
|
|
19
|
+
peertable-client --help / --version ヘルプまたはバージョンを表示する
|
|
19
20
|
peertable-client diagnostics 診断を人間可読で出す(fail の理由はこちらに出る)
|
|
20
21
|
peertable-client diagnostics --json schema peertable.native_factory_diagnostics.v1 の JSON で出す
|
|
21
22
|
`
|
|
@@ -24,6 +25,14 @@ const USAGE = `usage:
|
|
|
24
25
|
// 診断のコードは一切走らない(起動ディレイを増やさない)
|
|
25
26
|
const sub = process.argv[2]
|
|
26
27
|
if (sub !== undefined) {
|
|
28
|
+
if (sub === '-h' || sub === '--help') {
|
|
29
|
+
process.stdout.write(USAGE)
|
|
30
|
+
process.exit(0)
|
|
31
|
+
}
|
|
32
|
+
if (sub === '-v' || sub === '--version') {
|
|
33
|
+
process.stdout.write(`${MCP_VERSION}\n`)
|
|
34
|
+
process.exit(0)
|
|
35
|
+
}
|
|
27
36
|
if (sub === 'diagnostics') process.exit(await runDiagnostics(process.argv.includes('--json')))
|
|
28
37
|
process.stderr.write(`unknown subcommand: ${sub}\n${USAGE}`)
|
|
29
38
|
process.exit(1)
|
package/room/server.mjs
CHANGED
|
@@ -3,7 +3,24 @@
|
|
|
3
3
|
// 起動: node server.mjs(PEERTABLE_PORT / PEERTABLE_DATA / PEERTABLE_POST_TOKEN で設定)
|
|
4
4
|
import http from 'node:http'
|
|
5
5
|
import { mkdirSync, readFileSync, writeFileSync, appendFileSync, existsSync, rmSync, readdirSync } from 'node:fs'
|
|
6
|
-
import { join } from 'node:path'
|
|
6
|
+
import { dirname, join } from 'node:path'
|
|
7
|
+
import { fileURLToPath } from 'node:url'
|
|
8
|
+
|
|
9
|
+
const SERVER_USAGE = 'usage: peertable-room\n設定は環境変数: PEERTABLE_PORT(既定8790)/ PEERTABLE_DATA(既定./peertable-data)/ PEERTABLE_POST_TOKEN(設定時のみ書込に要求)\n'
|
|
10
|
+
const serverArg = process.argv[2]
|
|
11
|
+
if (serverArg === '-h' || serverArg === '--help') {
|
|
12
|
+
process.stdout.write(SERVER_USAGE)
|
|
13
|
+
process.exit(0)
|
|
14
|
+
}
|
|
15
|
+
if (serverArg === '-v' || serverArg === '--version') {
|
|
16
|
+
const packagePath = join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json')
|
|
17
|
+
process.stdout.write(`${JSON.parse(readFileSync(packagePath, 'utf8')).version}\n`)
|
|
18
|
+
process.exit(0)
|
|
19
|
+
}
|
|
20
|
+
if (serverArg !== undefined) {
|
|
21
|
+
process.stderr.write(`unknown argument: ${serverArg}\n${SERVER_USAGE}`)
|
|
22
|
+
process.exit(1)
|
|
23
|
+
}
|
|
7
24
|
|
|
8
25
|
const PORT = Number(process.env.PEERTABLE_PORT ?? 8790)
|
|
9
26
|
const DATA = process.env.PEERTABLE_DATA ?? './peertable-data'
|