konoha-mcp 2.2.24 → 2.2.25
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/NOTICE +14 -46
- package/README.md +19 -4
- package/apps/web/build/adapter-node.js +1 -1
- package/apps/web/build/build-meta.json +2 -2
- package/apps/web/build/client/_app/immutable/entry/{app.CKJ0NhrX.js → app.DtoBIrs4.js} +2 -2
- package/apps/web/build/client/_app/immutable/entry/app.DtoBIrs4.js.br +0 -0
- package/apps/web/build/client/_app/immutable/entry/app.DtoBIrs4.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/{0.7A6fQJ6z.js → 0.B8Iw7Xl1.js} +1 -1
- package/apps/web/build/client/_app/immutable/nodes/0.B8Iw7Xl1.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/{0.7A6fQJ6z.js.gz → 0.B8Iw7Xl1.js.gz} +0 -0
- package/apps/web/build/client/_app/version.json +1 -1
- package/apps/web/build/client/_app/version.json.br +0 -0
- package/apps/web/build/client/_app/version.json.gz +0 -0
- package/apps/web/build/server/chunks/instance.js +3 -3
- package/apps/web/build/server/chunks/internal.js +1 -1
- package/apps/web/build/server/entries/pages/_layout.svelte.js +1 -1
- package/apps/web/build/server/entries/pages/_layout.svelte.js.map +1 -1
- package/apps/web/build/server/manifest-full.js +1 -1
- package/apps/web/build/server/manifest.js +1 -1
- package/apps/web/build/server/nodes/0.js +1 -1
- package/apps/web/build/server/server.js +1 -1
- package/apps/web/package.json +1 -1
- package/assets/demo-agy.webp +0 -0
- package/assets/demo-claude.webp +0 -0
- package/assets/demo-codex.webp +0 -0
- package/assets/demo-commandcode.webp +0 -0
- package/assets/demo-cursor.webp +0 -0
- package/assets/demo-opencode.webp +0 -0
- package/assets/demo-pi.webp +0 -0
- package/assets/demo-skill-embed.webp +0 -0
- package/assets/demo-skills.webp +0 -0
- package/assets/demo-web.webp +0 -0
- package/assets/demo.webp +0 -0
- package/assets/konoha-akatsuki-flow.webp +0 -0
- package/assets/konoha-anbu-flow.webp +0 -0
- package/assets/konoha-flow-12-cli-upgrade-progress-engine.webp +0 -0
- package/assets/konoha-jonin-flow.webp +0 -0
- package/assets/konoha-kage-gate.webp +0 -0
- package/assets/konoha-langgraph-flow.webp +0 -0
- package/assets/konoha-orchestration-flow.webp +0 -0
- package/assets/konoha-qa-flow.webp +0 -0
- package/assets/konoha-telegram-flow.webp +0 -0
- package/assets/testing.webp +0 -0
- package/bin/commands/init.js +13 -3
- package/bin/commands/init_migration.js +32 -1
- package/bin/lib/runtime_install.js +6 -0
- package/node_modules/jszip/package.json +2 -2
- package/node_modules/string_decoder/package.json +1 -1
- package/package.json +9 -3
- package/patches/jszip@3.10.2.patch +11 -0
- package/patches/string_decoder@1.3.0.patch +12 -0
- package/src/agent_contract.js +2 -2
- package/src/antigravity_subagent_hook.js +30 -12
- package/src/chunin_knowledge_ddl.js +95 -0
- package/src/db_schema.js +4 -1
- package/src/deploy_installer.js +212 -11
- package/src/deploy_utils.js +4 -0
- package/src/file_tools/common.js +65 -3
- package/src/file_tools_router.js +67 -6
- package/src/mcp/chunin_knowledge.js +509 -0
- package/src/mcp/tool_dispatch.js +2 -1
- package/src/mcp/web_search.js +27 -3
- package/src/mcp_clients/common.js +31 -0
- package/src/mcp_tool_manifest.json +31 -0
- package/src/pi_fs_helpers.js +31 -0
- package/src/pi_manager.js +68 -28
- package/src/templates/AGENTS.md +1 -1
- package/src/templates/GEMINI.md +1 -1
- package/src/templates/skills/chunin-skill/SKILL.md +34 -0
- package/src/templates/skills/chunin-skill/references/deep-research-analyst.md +27 -10
- package/src/templates/skills/konoha/SKILL.md +1 -1
- package/src/templates/skills/konoha/references/contract.md +1 -1
- package/src/templates/skills/konoha/references/peragent-usage.md +1 -1
- package/src/url_canonical.js +58 -0
- package/src/vector_pipeline.js +6 -4
- package/src/vector_search.js +4 -2
- package/apps/web/build/client/_app/immutable/entry/app.CKJ0NhrX.js.br +0 -0
- package/apps/web/build/client/_app/immutable/entry/app.CKJ0NhrX.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/0.7A6fQJ6z.js.br +0 -0
|
@@ -9,7 +9,7 @@ return {
|
|
|
9
9
|
app_path: "_app",
|
|
10
10
|
assets: new Set(["apple-touch-icon.png","favicon.ico","fox_kyubi_192.png","fox_kyubi_32.png","fox_kyubi_512.png","fox_kyubi_64.png","logos/antigravity.svg","logos/claude.svg","logos/codex.svg","logos/commandcode.svg","logos/cursor.svg","logos/omp.svg","logos/opencode.svg","logos/pi.svg","manifest.webmanifest","rasenshuriken/license.txt","rasenshuriken/scene.bin","rasenshuriken/scene.gltf","rasenshuriken/textures/material_0_baseColor.png","rasenshuriken/textures/material_1_baseColor.png","rasenshuriken/textures/material_2_baseColor.png","rasenshuriken/textures/material_3_baseColor.png","rasenshuriken/textures/material_4_baseColor.png","rasenshuriken/textures/material_6_baseColor.png","rasenshuriken/textures/material_7_baseColor.png","rasenshuriken/textures/material_8_baseColor.png","rasenshuriken/textures/material_9_baseColor.png"]),
|
|
11
11
|
mime_types: {".png":"image/png",".ico":"image/x-icon",".svg":"image/svg+xml",".webmanifest":"application/manifest+json",".txt":"text/plain",".bin":"application/octet-stream",".gltf":"model/gltf+json"},
|
|
12
|
-
client: {start:"_app/immutable/entry/start.DRF2-bMz.js",app:"_app/immutable/entry/app.
|
|
12
|
+
client: {start:"_app/immutable/entry/start.DRF2-bMz.js",app:"_app/immutable/entry/app.DtoBIrs4.js",imports:["_app/immutable/entry/start.DRF2-bMz.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/CRzLMJPS.js","_app/immutable/chunks/B6py__81.js","_app/immutable/chunks/C3xSVOVF.js","_app/immutable/chunks/C5rL-2rZ.js","_app/immutable/chunks/C6Jfgk1u.js","_app/immutable/chunks/l3JvYxR0.js","_app/immutable/chunks/Bbkvzshl.js","_app/immutable/entry/app.DtoBIrs4.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
|
13
13
|
|
|
14
14
|
nodes: [
|
|
15
15
|
__memo(() => import('./nodes/0.js')),
|
|
@@ -9,7 +9,7 @@ return {
|
|
|
9
9
|
app_path: "_app",
|
|
10
10
|
assets: new Set(["apple-touch-icon.png","favicon.ico","fox_kyubi_192.png","fox_kyubi_32.png","fox_kyubi_512.png","fox_kyubi_64.png","logos/antigravity.svg","logos/claude.svg","logos/codex.svg","logos/commandcode.svg","logos/cursor.svg","logos/omp.svg","logos/opencode.svg","logos/pi.svg","manifest.webmanifest","rasenshuriken/license.txt","rasenshuriken/scene.bin","rasenshuriken/scene.gltf","rasenshuriken/textures/material_0_baseColor.png","rasenshuriken/textures/material_1_baseColor.png","rasenshuriken/textures/material_2_baseColor.png","rasenshuriken/textures/material_3_baseColor.png","rasenshuriken/textures/material_4_baseColor.png","rasenshuriken/textures/material_6_baseColor.png","rasenshuriken/textures/material_7_baseColor.png","rasenshuriken/textures/material_8_baseColor.png","rasenshuriken/textures/material_9_baseColor.png"]),
|
|
11
11
|
mime_types: {".png":"image/png",".ico":"image/x-icon",".svg":"image/svg+xml",".webmanifest":"application/manifest+json",".txt":"text/plain",".bin":"application/octet-stream",".gltf":"model/gltf+json"},
|
|
12
|
-
client: {start:"_app/immutable/entry/start.DRF2-bMz.js",app:"_app/immutable/entry/app.
|
|
12
|
+
client: {start:"_app/immutable/entry/start.DRF2-bMz.js",app:"_app/immutable/entry/app.DtoBIrs4.js",imports:["_app/immutable/entry/start.DRF2-bMz.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/CRzLMJPS.js","_app/immutable/chunks/B6py__81.js","_app/immutable/chunks/C3xSVOVF.js","_app/immutable/chunks/C5rL-2rZ.js","_app/immutable/chunks/C6Jfgk1u.js","_app/immutable/chunks/l3JvYxR0.js","_app/immutable/chunks/Bbkvzshl.js","_app/immutable/entry/app.DtoBIrs4.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
|
13
13
|
|
|
14
14
|
nodes: [
|
|
15
15
|
__memo(() => import('./nodes/0.js')),
|
|
@@ -5,6 +5,6 @@ let component_cache;
|
|
|
5
5
|
export const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;
|
|
6
6
|
export { universal };
|
|
7
7
|
export const universal_id = "src/routes/+layout.js";
|
|
8
|
-
export const imports = ["_app/immutable/nodes/0.
|
|
8
|
+
export const imports = ["_app/immutable/nodes/0.B8Iw7Xl1.js","_app/immutable/chunks/DK3Fl9T5.js","_app/immutable/chunks/CRzLMJPS.js","_app/immutable/chunks/C5rL-2rZ.js","_app/immutable/chunks/l3JvYxR0.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/C6Jfgk1u.js","_app/immutable/chunks/B57iJwMM.js","_app/immutable/chunks/CMfYCyHI.js","_app/immutable/chunks/DVDyaR1u.js","_app/immutable/chunks/kQisoOdf.js","_app/immutable/chunks/DExkVRiT.js","_app/immutable/chunks/BCzYYd01.js","_app/immutable/chunks/DuefosH7.js","_app/immutable/chunks/C9Hg4rJI.js"];
|
|
9
9
|
export const stylesheets = ["_app/immutable/assets/0.DzoQ1iMp.css"];
|
|
10
10
|
export const fonts = [];
|
|
@@ -10,7 +10,7 @@ return {
|
|
|
10
10
|
app_path: "_app",
|
|
11
11
|
assets: new Set(["apple-touch-icon.png","favicon.ico","fox_kyubi_192.png","fox_kyubi_32.png","fox_kyubi_512.png","fox_kyubi_64.png","logos/antigravity.svg","logos/claude.svg","logos/codex.svg","logos/commandcode.svg","logos/cursor.svg","logos/omp.svg","logos/opencode.svg","logos/pi.svg","manifest.webmanifest","rasenshuriken/license.txt","rasenshuriken/scene.bin","rasenshuriken/scene.gltf","rasenshuriken/textures/material_0_baseColor.png","rasenshuriken/textures/material_1_baseColor.png","rasenshuriken/textures/material_2_baseColor.png","rasenshuriken/textures/material_3_baseColor.png","rasenshuriken/textures/material_4_baseColor.png","rasenshuriken/textures/material_6_baseColor.png","rasenshuriken/textures/material_7_baseColor.png","rasenshuriken/textures/material_8_baseColor.png","rasenshuriken/textures/material_9_baseColor.png"]),
|
|
12
12
|
mime_types: {".png":"image/png",".ico":"image/x-icon",".svg":"image/svg+xml",".webmanifest":"application/manifest+json",".txt":"text/plain",".bin":"application/octet-stream",".gltf":"model/gltf+json"},
|
|
13
|
-
client: {start:"_app/immutable/entry/start.DRF2-bMz.js",app:"_app/immutable/entry/app.
|
|
13
|
+
client: {start:"_app/immutable/entry/start.DRF2-bMz.js",app:"_app/immutable/entry/app.DtoBIrs4.js",imports:["_app/immutable/entry/start.DRF2-bMz.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/CRzLMJPS.js","_app/immutable/chunks/B6py__81.js","_app/immutable/chunks/C3xSVOVF.js","_app/immutable/chunks/C5rL-2rZ.js","_app/immutable/chunks/C6Jfgk1u.js","_app/immutable/chunks/l3JvYxR0.js","_app/immutable/chunks/Bbkvzshl.js","_app/immutable/entry/app.DtoBIrs4.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
|
14
14
|
|
|
15
15
|
nodes: [
|
|
16
16
|
__memo(() => import('./nodes/0.js')),
|
package/apps/web/package.json
CHANGED
package/assets/demo-agy.webp
CHANGED
|
Binary file
|
package/assets/demo-claude.webp
CHANGED
|
Binary file
|
package/assets/demo-codex.webp
CHANGED
|
Binary file
|
|
Binary file
|
package/assets/demo-cursor.webp
CHANGED
|
Binary file
|
|
Binary file
|
package/assets/demo-pi.webp
CHANGED
|
Binary file
|
|
Binary file
|
package/assets/demo-skills.webp
CHANGED
|
Binary file
|
package/assets/demo-web.webp
CHANGED
|
Binary file
|
package/assets/demo.webp
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/assets/testing.webp
CHANGED
|
Binary file
|
package/bin/commands/init.js
CHANGED
|
@@ -51,7 +51,7 @@ const { installUv } = require('../lib/extension');
|
|
|
51
51
|
const { checkPortActive } = require('../lib/ui_commands');
|
|
52
52
|
const { cmdBridgeStart } = require('./bridge');
|
|
53
53
|
const { parseRequestedClients, setupClientIntegrations } = require('./init_clients');
|
|
54
|
-
const { executeInitMigration, renderInitSummary, measureEmbeddingCoverage } = require('./init_migration');
|
|
54
|
+
const { executeInitMigration, renderInitSummary, measureEmbeddingCoverage, verifyRuntimeDeployment } = require('./init_migration');
|
|
55
55
|
const { createEmbedProgress, INIT_PHASES } = require('../lib/embed_progress');
|
|
56
56
|
const {
|
|
57
57
|
executePreInstallBackup,
|
|
@@ -91,7 +91,12 @@ function recordAutoSetupState() {
|
|
|
91
91
|
try {
|
|
92
92
|
ensureDir(path.dirname(marker));
|
|
93
93
|
fs.writeFileSync(marker, `${Date.now()}\n`);
|
|
94
|
-
} catch {
|
|
94
|
+
} catch (err) {
|
|
95
|
+
// Silent best-effort used to hide the one signal that explains a seed gate
|
|
96
|
+
// failing with exit status 0: the marker is a required seed sentinel, so a
|
|
97
|
+
// swallowed write makes CI report an incomplete seed with no cause.
|
|
98
|
+
log(` ! Could not write ${marker}: ${err && err.message ? err.message : err}`);
|
|
99
|
+
}
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
function checkNodeAndToolchains(options) {
|
|
@@ -432,6 +437,12 @@ async function cmdInit(args, options = {}) {
|
|
|
432
437
|
: 'installation complete');
|
|
433
438
|
}
|
|
434
439
|
|
|
440
|
+
// Write the marker and verify the deployment before the summary claims success:
|
|
441
|
+
// the banner reads its paths from constants, so it used to print "Server: <path>"
|
|
442
|
+
// for a server.js that a failed mirror swap had deleted.
|
|
443
|
+
recordAutoSetupState();
|
|
444
|
+
verifyRuntimeDeployment();
|
|
445
|
+
|
|
435
446
|
const embedCoverage = skipEmbed ? null : measureEmbeddingCoverage();
|
|
436
447
|
renderInitSummary({
|
|
437
448
|
...clientFlags,
|
|
@@ -444,7 +455,6 @@ async function cmdInit(args, options = {}) {
|
|
|
444
455
|
if (args.includes('--with-red-team')) {
|
|
445
456
|
await installCyberPackAfterInit();
|
|
446
457
|
}
|
|
447
|
-
recordAutoSetupState();
|
|
448
458
|
}
|
|
449
459
|
|
|
450
460
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const fs = require('fs');
|
|
3
4
|
const path = require('path');
|
|
4
5
|
const { fileExists } = require('../../src/platform_utils');
|
|
5
6
|
const {
|
|
@@ -194,6 +195,35 @@ function buildClientStatusLines(flags) {
|
|
|
194
195
|
];
|
|
195
196
|
}
|
|
196
197
|
|
|
198
|
+
/**
|
|
199
|
+
* Assert that init actually deployed what the summary is about to claim.
|
|
200
|
+
*
|
|
201
|
+
* The Windows golden seed failed for four runs because the success banner printed
|
|
202
|
+
* `Server: <path>` from a constant, never from the filesystem: a mirror swap had
|
|
203
|
+
* replaced server.js with a dangling link and init still exited 0. Read the paths
|
|
204
|
+
* back and throw with the exact missing file instead of reporting a healthy install.
|
|
205
|
+
*/
|
|
206
|
+
function verifyRuntimeDeployment() {
|
|
207
|
+
const expected = [
|
|
208
|
+
['MCP server', SERVER_PATH],
|
|
209
|
+
['migration script', MIGRATE_PATH],
|
|
210
|
+
['database', DB_PATH],
|
|
211
|
+
['auto-setup marker', path.join(HOME, '.konoha', '.autosetup-done')],
|
|
212
|
+
['Konoha skill', path.join(HOME, '.agents', 'skills', 'konoha', 'SKILL.md')]
|
|
213
|
+
];
|
|
214
|
+
const failures = [];
|
|
215
|
+
for (const [label, target] of expected) {
|
|
216
|
+
try {
|
|
217
|
+
fs.readFileSync(target);
|
|
218
|
+
} catch (err) {
|
|
219
|
+
failures.push(`${label} missing or unreadable: ${target} (${err && err.code ? err.code : err})`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (failures.length > 0) {
|
|
223
|
+
throw new Error(`[INIT] Runtime deployment incomplete:\n ${failures.join('\n ')}`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
197
227
|
function renderInitSummary(flags) {
|
|
198
228
|
const summaryLines = [
|
|
199
229
|
`${C.bold}Konoha MCP Orchestrator installed successfully!${C.reset}`,
|
|
@@ -237,5 +267,6 @@ function renderInitSummary(flags) {
|
|
|
237
267
|
module.exports = {
|
|
238
268
|
executeInitMigration,
|
|
239
269
|
measureEmbeddingCoverage,
|
|
240
|
-
renderInitSummary
|
|
270
|
+
renderInitSummary,
|
|
271
|
+
verifyRuntimeDeployment
|
|
241
272
|
};
|
|
@@ -255,6 +255,12 @@ function copyRuntimeFiles(copyTree, sourceRoot = REPO_ROOT) {
|
|
|
255
255
|
// trustworthy source for docs/, skills, CLI or manifest either.
|
|
256
256
|
if (!srcFresh) return cliDest;
|
|
257
257
|
|
|
258
|
+
// The flat ~/.konoha/mcp copy loses a directory level relative to src/mcp, so
|
|
259
|
+
// modules below it that reach upward (../../web/...) must resolve against the
|
|
260
|
+
// mirrored src/ tree instead. Link the flat name at that tree.
|
|
261
|
+
deployUtils.ensureMirroredSubdirLinks(SKILLS_DB_DIR);
|
|
262
|
+
deployUtils.ensureMirroredRootFileLinks(SKILLS_DB_DIR);
|
|
263
|
+
|
|
258
264
|
copyRuntimeAssets(path.join(sourceRoot, 'assets'), copyTree);
|
|
259
265
|
|
|
260
266
|
const sourceCliPath = path.join(sourceRoot, 'bin', 'cli.js');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "konoha-mcp",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.25",
|
|
4
4
|
"description": "Autonomous multi-agent MCP orchestration platform powered by LangGraph state machines, 8 specialist ninja agents, SQLite FTS5 skill indexing, and per-turn token governors saving 83–98% context across 8 AI coding clients",
|
|
5
5
|
"homepage": "https://github.com/andycungkrinx91/konoha#readme",
|
|
6
6
|
"bugs": "https://github.com/andycungkrinx91/konoha/issues",
|
|
@@ -73,7 +73,11 @@
|
|
|
73
73
|
},
|
|
74
74
|
"overrides": {
|
|
75
75
|
"image-size": ">=2.0.3",
|
|
76
|
-
"globalthis": "npm:@socketregistry/globalthis@1.0.7"
|
|
76
|
+
"globalthis": "npm:@socketregistry/globalthis@1.0.7",
|
|
77
|
+
"isarray": "npm:@socketregistry/isarray@1.0.8",
|
|
78
|
+
"readable-stream": "^3.6.2",
|
|
79
|
+
"safe-buffer": "npm:@socketregistry/safe-buffer@1.0.9",
|
|
80
|
+
"setimmediate": "npm:immediate@^3.3.0"
|
|
77
81
|
},
|
|
78
82
|
"bundleDependencies": [
|
|
79
83
|
"cfb",
|
|
@@ -91,8 +95,10 @@
|
|
|
91
95
|
"@langchain/core": "1.3.2",
|
|
92
96
|
"@langchain/langgraph": "1.6.0",
|
|
93
97
|
"@langchain/langgraph-checkpoint": "1.2.2",
|
|
98
|
+
"@napi-rs/canvas": "^1.1.1",
|
|
94
99
|
"cfb": "1.2.2",
|
|
95
100
|
"docx": "9.14.0",
|
|
101
|
+
"gifenc": "^1.0.3",
|
|
96
102
|
"gpt-tokenizer": "4.1.0",
|
|
97
103
|
"hash-wasm": "4.12.0",
|
|
98
104
|
"manifold-3d": "3.2.1",
|
|
@@ -115,7 +121,7 @@
|
|
|
115
121
|
"test:e2e": "node scripts/rtk_exec.js pnpm --dir apps/web run test:e2e",
|
|
116
122
|
"test:parallel": "node scripts/rtk_exec.js node tests/run_all.js --parallel",
|
|
117
123
|
"ci:act": "act -W .github/workflows/cross-platform.yml -j checks --matrix os:ubuntu-latest",
|
|
118
|
-
"ci:act:shard": "act -W .github/workflows/cross-platform.yml -j test
|
|
124
|
+
"ci:act:shard": "act -W .github/workflows/cross-platform.yml -j test-ubuntu --matrix shard:1",
|
|
119
125
|
"test:sandbox": "node scripts/rtk_exec.js node scripts/sandbox.js",
|
|
120
126
|
"audit:socket": "node scripts/rtk_exec.js node scripts/socket_audit_optional.js",
|
|
121
127
|
"test:mcp": "node scripts/rtk_exec.js node tests/test_mcp_protocol.js && node scripts/rtk_exec.js node tests/test_mcp_e2e.js",
|
|
@@ -19,3 +19,14 @@ index d167aab2597e79dd4a5f2332a82838dec76b5b9f..c41ce2e53fc2e89fc18c36b6c28d4708
|
|
|
19
19
|
"types": "./index.d.ts",
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
|
+
@@ -60,8 +56,8 @@
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"lie": "~3.3.0",
|
|
25
|
+
"pako": "~1.0.2",
|
|
26
|
+
- "readable-stream": "~2.3.6",
|
|
27
|
+
- "setimmediate": "^1.0.5"
|
|
28
|
+
+ "readable-stream": "^3.6.2",
|
|
29
|
+
+ "setimmediate": "npm:immediate@^3.3.0"
|
|
30
|
+
},
|
|
31
|
+
"license": "(MIT OR GPL-3.0-or-later)"
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
diff --git a/package.json b/package.json
|
|
2
|
+
--- a/package.json
|
|
3
|
+
+++ b/package.json
|
|
4
|
+
@@ -7,7 +7,7 @@
|
|
5
|
+
"lib"
|
|
6
|
+
],
|
|
7
|
+
"dependencies": {
|
|
8
|
+
- "safe-buffer": "~5.2.0"
|
|
9
|
+
+ "safe-buffer": "npm:@socketregistry/safe-buffer@1.0.9"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"babel-polyfill": "^6.23.0",
|
package/src/agent_contract.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const CONTRACT_VERSION = '2.2.
|
|
3
|
+
const CONTRACT_VERSION = '2.2.25';
|
|
4
4
|
const CONTRACT_START = '<!-- KONOHA-CONTRACT-START -->';
|
|
5
5
|
const CONTRACT_END = '<!-- KONOHA-CONTRACT-END -->';
|
|
6
6
|
|
|
@@ -54,7 +54,7 @@ You are the ${roleLabel} running through ${clientLabel}. This contract is mandat
|
|
|
54
54
|
- **Konoha is mandatory**: use the \`konoha\` MCP for skill discovery, skill loading, and bounded file operations. All clients call skills through \`konoha.find_skills\` (or \`find_skill\`) to discover global and project skills before work, and load matching content with \`konoha.get_skill\`. When a project contains local skills, the client auto-migrates them into the skills database, and the project tree is read alongside it, so an unmigrated skill stays discoverable. Never load raw SKILL.md files directly.
|
|
55
55
|
- **Code intelligence is mandatory**: use the \`konoha\` \`code_search\`, \`code_symbol\`, and \`code_impact\` tools (native SQLite FTS5 index) for all project codebase discovery and search. Always pass the absolute repository \`root\`; run \`code_index\` first. Do not replace them with native grep, glob, find, or IDE search.
|
|
56
56
|
- **Project rules & skills are additive, never replaced**: text a project wrote into \`AGENTS.md\`/\`CLAUDE.md\`/\`GEMINI.md\` outside the \`KONOHA-*\` markers is preserved verbatim, and \`find_skill\`/\`get_skill\`/\`list_skills\` serve the project's own \`.agents/skills\` tree alongside the Konoha skill database, so an unmigrated project skill is still discoverable and loadable.
|
|
57
|
-
- **Cross-platform e2e is mandatory**: a change is done only after 3-OS verification passes across Linux, Windows, and macOS — locally across all 3 CI environments (1. Linux: Debian \`pnpm test:sandbox [-- --shard=I/
|
|
57
|
+
- **Cross-platform e2e is mandatory**: a change is done only after 3-OS verification passes across Linux, Windows, and macOS — locally across all 3 CI environments (1. Linux: Debian \`pnpm test:sandbox [-- --shard=I/N]\` + Ubuntu \`pnpm ci:act\` / \`pnpm ci:act:shard\`; 2. Windows: \`docker/windows-vm/oem/run-ci.cmd [-Shard I/N]\` / \`retest.cmd\` via \`dockur/windows\`; 3. macOS: \`KONOHA_SANDBOX_RUNTIME=container pnpm test:sandbox [-- --shard=I/N]\` + native replay or symlinked-\`HOME\` proxy) and \`.github/workflows/cross-platform.yml\` (push, PR, manual dispatch, 02:00 UTC nightly). A single-OS green is not a delivery verdict.
|
|
58
58
|
- **RTK is mandatory for commands**: ALWAYS force-run all shell/command executions with \`rtk <command>\` first; prefix shell/command execution with \`rtk\` to filter noisy terminal output and minimize token consumption. When RTK is not installed, fails, or is unsupported for a specific command, immediately fall back to direct shell/bash (\`sh\` / \`bash\`) execution without silently claiming RTK was used.
|
|
59
59
|
- **Review token hygiene & strict changed-files scoping (NEVER BURN TOKENS)**: Across all clients (Pi, Antigravity, Cursor, Claude Code, OpenCode, CommandCode, Codex, OMP), agents MUST NEVER execute unscoped full-repository scans (\`aislop_scan\` without target path or \`aislop scan\` without \`--changes\` or specific file arguments). Unscoped full-repo scans evaluate thousands of files, dump giant multi-megabyte payloads, and exhaust agent token context. When invoking \`aislop_scan\` or executing CLI scans, ALWAYS pass specific changed file paths or use \`--changes\` to ensure bounded, token-efficient execution. NEVER dump raw full-repo scan output into conversation context; summarize counts and key findings only (score, error count, rule IDs) or use \`get_slop_findings(compact: true)\`. Single-file edits, isolated bug fixes, or routine configuration changes must NEVER trigger repository-wide slop refactoring loops. Only verify the specific files modified.
|
|
60
60
|
- **Test directory discovery & reuse**: ALWAYS explore the codebase first (\`get_file_structure\` or \`find_files_clean\`) to discover existing test folders (\`tests/\`, \`test/\`, \`spec/\`). NEVER create duplicate test folders (e.g. creating \`test/\` when \`tests/\` exists).
|
|
@@ -39,22 +39,36 @@ const GLOBAL_IDE_AGENTS_DIR = path.join(HOME, '.gemini', 'antigravity-ide', 'age
|
|
|
39
39
|
const GLOBAL_CONFIG_AGENTS_DIR = path.join(HOME, '.gemini', 'antigravity-cli', 'mcp');
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Official ninja roster — the
|
|
43
|
-
* session's `.agents/agents/` directory.
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* shadow the real roster and break `Agent(name: ...)` invocations.
|
|
42
|
+
* Official ninja roster — the directory names Konoha itself deploys into a
|
|
43
|
+
* session's `.agents/agents/` directory. `cleanStaleSessionAgents` reports any
|
|
44
|
+
* other entry but never removes it: a custom or third-party agent is not
|
|
45
|
+
* Konoha's to delete, and the global roster dirs are the authority.
|
|
47
46
|
*/
|
|
48
47
|
const _OFFICIAL_NINJAS = getCanonicalAgentNames();
|
|
49
48
|
|
|
50
49
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
50
|
+
* Report directories under `base` whose name is not in the official ninja
|
|
51
|
+
* roster. Leaked `define_subagent` artifacts and stale `test-*` debug agents
|
|
52
|
+
* can shadow the real roster and break `Agent(name: ...)` invocations, so they
|
|
53
|
+
* are surfaced to the caller.
|
|
54
|
+
*
|
|
55
|
+
* Ownership boundary invariant: this never deletes anything. Konoha does not
|
|
56
|
+
* own custom or third-party agent directories inside `agents/` or session
|
|
57
|
+
* `brain/` directories, so removal stays with the user.
|
|
58
|
+
*
|
|
59
|
+
* @returns {string[]} non-roster directory names found (empty on any error)
|
|
54
60
|
*/
|
|
55
|
-
function cleanStaleSessionAgents(
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
function cleanStaleSessionAgents(base) {
|
|
62
|
+
const allowed = new Set(_OFFICIAL_NINJAS.map((n) => String(n).toLowerCase()));
|
|
63
|
+
const found = [];
|
|
64
|
+
try {
|
|
65
|
+
if (!base || !fs.existsSync(base)) return found;
|
|
66
|
+
for (const entry of fs.readdirSync(base, { withFileTypes: true })) {
|
|
67
|
+
if (!entry.isDirectory()) continue;
|
|
68
|
+
if (!allowed.has(entry.name.toLowerCase())) found.push(entry.name);
|
|
69
|
+
}
|
|
70
|
+
} catch (_) { /* intentional best-effort: reporting must never crash the runtime */ }
|
|
71
|
+
return found;
|
|
58
72
|
}
|
|
59
73
|
|
|
60
74
|
function loadAgentsFromGlobalDir() {
|
|
@@ -92,7 +106,11 @@ function loadAgents() {
|
|
|
92
106
|
function deploySessionAgents(agents, brainDir) {
|
|
93
107
|
if (!brainDir) return;
|
|
94
108
|
const base = path.join(brainDir, '.agents', 'agents');
|
|
95
|
-
|
|
109
|
+
// Report, never delete: a non-roster directory may be the user's own agent.
|
|
110
|
+
const stale = cleanStaleSessionAgents(base);
|
|
111
|
+
if (stale.length > 0) {
|
|
112
|
+
process.stderr.write(`⚠ Antigravity session has non-roster agent dirs (not removed): ${stale.join(', ')}\n`);
|
|
113
|
+
}
|
|
96
114
|
const antigravityManager = require('./antigravity_manager');
|
|
97
115
|
for (const agent of agents) {
|
|
98
116
|
try {
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* src/chunin_knowledge_ddl.js — Schema v11 DDL for the Chunin research knowledge store.
|
|
5
|
+
*
|
|
6
|
+
* Chunin re-runs the same research topics across sessions. This store keeps the
|
|
7
|
+
* verified learnings from earlier runs so a later run can retrieve the top-5
|
|
8
|
+
* relevant references before touching the network, then only search for what is
|
|
9
|
+
* genuinely new.
|
|
10
|
+
*
|
|
11
|
+
* The vector column follows the repository's existing convention: a BLOB
|
|
12
|
+
* `embedding` column registered with the bundled sqlite-vector extension via
|
|
13
|
+
* `vector_init()`, not a sqlite-vec `vec0` virtual table. Reusing the extension
|
|
14
|
+
* already vendored in `vendor/sqlite-vector` avoids a second vector engine and
|
|
15
|
+
* keeps one distance implementation (COSINE, normalized FLOAT32, 384 dims).
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const CHUNIN_KNOWLEDGE_TABLE = 'chunin_knowledge';
|
|
19
|
+
const CHUNIN_KNOWLEDGE_FTS = 'chunin_knowledge_fts';
|
|
20
|
+
|
|
21
|
+
const CHUNIN_KNOWLEDGE_V11_DDL = `
|
|
22
|
+
CREATE TABLE IF NOT EXISTS chunin_knowledge (
|
|
23
|
+
id TEXT PRIMARY KEY,
|
|
24
|
+
query_topic TEXT NOT NULL,
|
|
25
|
+
learning_text TEXT NOT NULL,
|
|
26
|
+
canonical_url TEXT NOT NULL DEFAULT '',
|
|
27
|
+
source_title TEXT NOT NULL DEFAULT '',
|
|
28
|
+
content_hash TEXT NOT NULL,
|
|
29
|
+
citation_id TEXT NOT NULL DEFAULT '',
|
|
30
|
+
confidence_tier TEXT NOT NULL DEFAULT 'unverified',
|
|
31
|
+
created_at TEXT NOT NULL,
|
|
32
|
+
last_verified_at TEXT NOT NULL DEFAULT '',
|
|
33
|
+
embedding BLOB DEFAULT NULL
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_chunin_knowledge_hash
|
|
37
|
+
ON chunin_knowledge(content_hash);
|
|
38
|
+
|
|
39
|
+
CREATE INDEX IF NOT EXISTS idx_chunin_knowledge_topic
|
|
40
|
+
ON chunin_knowledge(query_topic);
|
|
41
|
+
|
|
42
|
+
CREATE INDEX IF NOT EXISTS idx_chunin_knowledge_url
|
|
43
|
+
ON chunin_knowledge(canonical_url);
|
|
44
|
+
|
|
45
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS chunin_knowledge_fts USING fts5(
|
|
46
|
+
learning_text,
|
|
47
|
+
source_title,
|
|
48
|
+
query_topic,
|
|
49
|
+
content='chunin_knowledge',
|
|
50
|
+
content_rowid='rowid'
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
CREATE TRIGGER IF NOT EXISTS chunin_knowledge_fts_ai AFTER INSERT ON chunin_knowledge BEGIN
|
|
54
|
+
INSERT INTO chunin_knowledge_fts(rowid, learning_text, source_title, query_topic)
|
|
55
|
+
VALUES (new.rowid, new.learning_text, new.source_title, new.query_topic);
|
|
56
|
+
END;
|
|
57
|
+
|
|
58
|
+
CREATE TRIGGER IF NOT EXISTS chunin_knowledge_fts_ad AFTER DELETE ON chunin_knowledge BEGIN
|
|
59
|
+
INSERT INTO chunin_knowledge_fts(chunin_knowledge_fts, rowid, learning_text, source_title, query_topic)
|
|
60
|
+
VALUES ('delete', old.rowid, old.learning_text, old.source_title, old.query_topic);
|
|
61
|
+
END;
|
|
62
|
+
|
|
63
|
+
CREATE TRIGGER IF NOT EXISTS chunin_knowledge_fts_au AFTER UPDATE ON chunin_knowledge BEGIN
|
|
64
|
+
INSERT INTO chunin_knowledge_fts(chunin_knowledge_fts, rowid, learning_text, source_title, query_topic)
|
|
65
|
+
VALUES ('delete', old.rowid, old.learning_text, old.source_title, old.query_topic);
|
|
66
|
+
INSERT INTO chunin_knowledge_fts(rowid, learning_text, source_title, query_topic)
|
|
67
|
+
VALUES (new.rowid, new.learning_text, new.source_title, new.query_topic);
|
|
68
|
+
END;
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
const CHUNIN_KNOWLEDGE_COLUMNS = [
|
|
72
|
+
'id',
|
|
73
|
+
'query_topic',
|
|
74
|
+
'learning_text',
|
|
75
|
+
'canonical_url',
|
|
76
|
+
'source_title',
|
|
77
|
+
'content_hash',
|
|
78
|
+
'citation_id',
|
|
79
|
+
'confidence_tier',
|
|
80
|
+
'created_at',
|
|
81
|
+
'last_verified_at'
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
function applyChuninKnowledgeSchema(conn) {
|
|
85
|
+
conn.exec(CHUNIN_KNOWLEDGE_V11_DDL);
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
module.exports = {
|
|
90
|
+
CHUNIN_KNOWLEDGE_TABLE,
|
|
91
|
+
CHUNIN_KNOWLEDGE_FTS,
|
|
92
|
+
CHUNIN_KNOWLEDGE_COLUMNS,
|
|
93
|
+
CHUNIN_KNOWLEDGE_V11_DDL,
|
|
94
|
+
applyChuninKnowledgeSchema
|
|
95
|
+
};
|
package/src/db_schema.js
CHANGED
|
@@ -11,12 +11,13 @@ const {
|
|
|
11
11
|
const { CORE_SCHEMA_DDL } = require('./schema_ddl');
|
|
12
12
|
const { createAndVerifyPreMigrationBackup } = require('./db_migration_safety');
|
|
13
13
|
const { hasCanonicalMemoryBrainLayout, applyMemoryBrainMigration } = require('./memory_brain_ddl');
|
|
14
|
+
const { applyChuninKnowledgeSchema } = require('./chunin_knowledge_ddl');
|
|
14
15
|
const {
|
|
15
16
|
_renameLegacyClaudeHarnessLabel,
|
|
16
17
|
_mergeLegacyAgyClientRows
|
|
17
18
|
} = require('./db_schema_repairs');
|
|
18
19
|
|
|
19
|
-
const CURRENT_SCHEMA_VERSION =
|
|
20
|
+
const CURRENT_SCHEMA_VERSION = 11;
|
|
20
21
|
const _ensuredSchemaInodes = new Map();
|
|
21
22
|
const REQUIRED_FAST_SCHEMA_TABLES = [
|
|
22
23
|
'skills', 'skills_fts', 'persona_memories', 'persona_memories_fts',
|
|
@@ -533,6 +534,8 @@ function setupSchema(conn, backupDatabaseFn = null) {
|
|
|
533
534
|
_applyCodeIntelligenceMigration(conn, ftsSupported);
|
|
534
535
|
// Migration v8: provenance-aware knowledge brain tables & additive columns.
|
|
535
536
|
applyMemoryBrainMigration(conn);
|
|
537
|
+
// Migration v11: Chunin research knowledge store (FTS5 + vector column).
|
|
538
|
+
applyChuninKnowledgeSchema(conn);
|
|
536
539
|
_verifyPostMigrationOrThrow(conn);
|
|
537
540
|
|
|
538
541
|
setUserVersion(conn, CURRENT_SCHEMA_VERSION);
|