@horizon_works/banto 0.8.2 → 0.8.3
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/law_bridge.js +11 -2
- package/package.json +3 -2
package/law_bridge.js
CHANGED
|
@@ -29,12 +29,19 @@ const SUPPLEMENT = 'law-parts';
|
|
|
29
29
|
// ★子の場所。★配布版では npm の別パッケージ、開発中はリポジトリの中
|
|
30
30
|
function 子の場所() {
|
|
31
31
|
if (process.env.LAW_PARTS_SERVER) return process.env.LAW_PARTS_SERVER;
|
|
32
|
+
const fs = require('fs');
|
|
32
33
|
const 候補 = [
|
|
34
|
+
// ★配布版=npm から入れた別パッケージ(★番頭の隣に置かれる)
|
|
35
|
+
path.join(__dirname, '..', 'law-parts', 'server.js'),
|
|
36
|
+
path.join(__dirname, 'node_modules', '@horizon_works', 'law-parts', 'server.js'),
|
|
37
|
+
// ★開発中=リポジトリの中
|
|
33
38
|
path.join(__dirname, '..', 'law_parts', 'server.js'),
|
|
34
39
|
path.join(__dirname, 'law_parts', 'server.js'),
|
|
35
40
|
];
|
|
36
|
-
const fs = require('fs');
|
|
37
41
|
for (const p of 候補) { try { if (fs.existsSync(p)) return p; } catch (_) {} }
|
|
42
|
+
// ★入っていなければ、npx で取ってくる(★一度取れば npx が控える)
|
|
43
|
+
try { require.resolve('@horizon_works/law-parts/server.js'); return require.resolve('@horizon_works/law-parts/server.js'); }
|
|
44
|
+
catch (_) {}
|
|
38
45
|
return null;
|
|
39
46
|
}
|
|
40
47
|
|
|
@@ -115,7 +122,9 @@ let 子 = null, 待ち = new Map(), 次のid = 1000, 最後に使った = 0, 掃
|
|
|
115
122
|
function 子を立てる() {
|
|
116
123
|
const srv = 子の場所();
|
|
117
124
|
if (!srv) throw new Error('法令パーツの本体が見つかりません');
|
|
118
|
-
|
|
125
|
+
// ★親が契約を確かめたうえで呼んでいる、という印(★子は二重に鍵を見ない)
|
|
126
|
+
const env = Object.assign({}, process.env, { LAW_PARTS_VIA_BANTO: '1' });
|
|
127
|
+
const p = spawn(process.execPath, [srv], { env, stdio: ['pipe', 'pipe', 'ignore'] });
|
|
119
128
|
let buf = '';
|
|
120
129
|
p.stdout.on('data', (d) => {
|
|
121
130
|
buf += d;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@horizon_works/banto",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "AI番頭のOS。ルール・記憶・検査を1本のMCPで配ります。中身をクラウドへ渡さずに検査できます。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
43
|
"googleapis": "^144.0.0",
|
|
44
|
-
"@google-cloud/local-auth": "^3.0.1"
|
|
44
|
+
"@google-cloud/local-auth": "^3.0.1",
|
|
45
|
+
"@horizon_works/law-parts": "^0.1.0"
|
|
45
46
|
}
|
|
46
47
|
}
|