konoha-mcp 2.1.10 → 2.1.12
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/.agents/skills/anbu-skill/references/devops-engineer-assets/references/platform-engineering.md +5 -1
- package/.agents/skills/kage-skill/references/drawio-skill-assets/scripts/timelapse.py +11 -2
- package/.agents/skills/tokubetsu-jonin-skill/references/docx-assets/scripts/office/soffice.py +15 -10
- package/.agents/skills.fingerprint +1 -1
- package/README.md +3 -3
- package/apps/web/build/adapter-node.js +1 -1
- 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/package.json +1 -1
- package/bin/cli.js +8 -26
- package/docs/SETUP-CLI.md +1 -1
- package/docs/SETUP-MCP-CLIENTS.md +2 -2
- package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.11_2026-10-07.md +78 -0
- package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.12_2026-10-07.md +105 -0
- package/docs/TROUBLESHOOTING.md +1 -1
- package/package.json +1 -1
- package/src/antigravity_manager.js +14 -10
- package/src/codex_manager.js +14 -7
- package/src/cursor_bootstrap.js +18 -5
- package/src/cursor_manager.js +23 -40
- package/src/deploy_utils.js +42 -1
- package/src/mcp_clients_manager.js +60 -57
- package/src/opencode_manager.js +5 -7
- package/src/pi_manager.js +1 -1
- package/src/prompt_hook.js +42 -0
- package/src/skill_manager.js +17 -5
- package/src/templates/skills/anbu-skill/references/devops-engineer-assets/references/platform-engineering.md +5 -1
- package/src/templates/skills/kage-skill/references/drawio-skill-assets/scripts/timelapse.py +11 -2
- package/src/templates/skills/tokubetsu-jonin-skill/references/docx-assets/scripts/office/soffice.py +15 -10
- package/src/vector_search.js +20 -4
- package/src/web_server.js +9 -0
|
@@ -109,7 +109,7 @@ metadata:
|
|
|
109
109
|
name: payment-service
|
|
110
110
|
annotations:
|
|
111
111
|
github.com/project-slug: org/payment-service
|
|
112
|
-
pagerduty.com/integration-key:
|
|
112
|
+
pagerduty.com/integration-key: "${PAGERDUTY_INTEGRATION_KEY}"
|
|
113
113
|
grafana/dashboard-selector: service=payment
|
|
114
114
|
spec:
|
|
115
115
|
type: service
|
|
@@ -293,6 +293,8 @@ from pydantic import BaseModel
|
|
|
293
293
|
|
|
294
294
|
app = FastAPI()
|
|
295
295
|
|
|
296
|
+
ALLOWED_LANGUAGES = {"python", "go", "typescript", "java", "rust"}
|
|
297
|
+
|
|
296
298
|
class ServiceRequest(BaseModel):
|
|
297
299
|
name: str
|
|
298
300
|
environment: str
|
|
@@ -301,6 +303,8 @@ class ServiceRequest(BaseModel):
|
|
|
301
303
|
|
|
302
304
|
@app.post("/api/v1/services")
|
|
303
305
|
async def create_service(request: ServiceRequest):
|
|
306
|
+
if request.language not in ALLOWED_LANGUAGES:
|
|
307
|
+
raise HTTPException(status_code=400, detail=f"Unsupported language: {request.language}")
|
|
304
308
|
# Validate and enqueue
|
|
305
309
|
task = platform.provision_service(
|
|
306
310
|
name=request.name,
|
|
@@ -75,12 +75,21 @@ def history(root, subpath):
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
def extract_tree(root, commit, subpath, dest):
|
|
78
|
-
"""Extract subpath of `commit` into dest via git archive. False if absent."""
|
|
78
|
+
"""Extract subpath of `commit` into dest via git archive safely. False if absent."""
|
|
79
79
|
code, tar_bytes = git(root, "archive", commit, subpath or ".")
|
|
80
80
|
if code != 0 or not tar_bytes:
|
|
81
81
|
return False
|
|
82
|
+
dest_path = os.path.abspath(dest)
|
|
82
83
|
with tarfile.open(fileobj=io.BytesIO(tar_bytes)) as tf:
|
|
83
|
-
|
|
84
|
+
safe_members = []
|
|
85
|
+
for member in tf.getmembers():
|
|
86
|
+
target_path = os.path.abspath(os.path.join(dest_path, member.name))
|
|
87
|
+
if os.path.commonpath([dest_path, target_path]) == dest_path:
|
|
88
|
+
safe_members.append(member)
|
|
89
|
+
if hasattr(tarfile, 'data_filter'):
|
|
90
|
+
tf.extractall(dest_path, members=safe_members, filter='data')
|
|
91
|
+
else:
|
|
92
|
+
tf.extractall(dest_path, members=safe_members)
|
|
84
93
|
return True
|
|
85
94
|
|
|
86
95
|
|
package/src/templates/skills/tokubetsu-jonin-skill/references/docx-assets/scripts/office/soffice.py
CHANGED
|
@@ -47,10 +47,9 @@ def run_soffice(args: Iterable[str], **kwargs) -> subprocess.CompletedProcess:
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
_SHIM_SO = Path(tempfile.gettempdir()) / "lo_socket_shim.so"
|
|
51
|
-
|
|
52
|
-
|
|
53
50
|
def _needs_shim() -> bool:
|
|
51
|
+
if os.environ.get("ENABLE_SOFFICE_SOCKET_SHIM") != "1":
|
|
52
|
+
return False
|
|
54
53
|
try:
|
|
55
54
|
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
56
55
|
s.close()
|
|
@@ -60,18 +59,24 @@ def _needs_shim() -> bool:
|
|
|
60
59
|
|
|
61
60
|
|
|
62
61
|
def _ensure_shim() -> Path:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
# Use a secure, user-private directory (mode 0700) to avoid shared temp attacks
|
|
63
|
+
uid = getattr(os, "getuid", lambda: "safe")()
|
|
64
|
+
shim_dir = Path(tempfile.gettempdir()) / f"lo_shim_uid_{uid}"
|
|
65
|
+
shim_dir.mkdir(mode=0o700, parents=True, exist_ok=True)
|
|
66
|
+
shim_so = shim_dir / "lo_socket_shim.so"
|
|
67
|
+
if shim_so.exists():
|
|
68
|
+
return shim_so
|
|
69
|
+
|
|
70
|
+
src = shim_dir / "lo_socket_shim.c"
|
|
67
71
|
src.write_text(_SHIM_SOURCE)
|
|
68
72
|
subprocess.run(
|
|
69
|
-
["gcc", "-shared", "-fPIC", "-o", str(
|
|
73
|
+
["gcc", "-shared", "-fPIC", "-o", str(shim_so), str(src), "-ldl"],
|
|
70
74
|
check=True,
|
|
71
75
|
capture_output=True,
|
|
72
76
|
)
|
|
73
|
-
src.
|
|
74
|
-
|
|
77
|
+
if src.exists():
|
|
78
|
+
src.unlink()
|
|
79
|
+
return shim_so
|
|
75
80
|
|
|
76
81
|
|
|
77
82
|
|
package/src/vector_search.js
CHANGED
|
@@ -244,7 +244,8 @@ function getBundledModelsDir() {
|
|
|
244
244
|
async function getEmbedPipeline() {
|
|
245
245
|
if (_pipelineExtractor) return _pipelineExtractor;
|
|
246
246
|
try {
|
|
247
|
-
const
|
|
247
|
+
const tfModule = '@huggingface/transformers';
|
|
248
|
+
const { pipeline, env } = require(tfModule);
|
|
248
249
|
const cacheDir = getBundledModelsDir();
|
|
249
250
|
env.cacheDir = cacheDir;
|
|
250
251
|
env.localModelPath = cacheDir;
|
|
@@ -286,7 +287,8 @@ async function getEmbedPipeline() {
|
|
|
286
287
|
async function getRerankPipeline() {
|
|
287
288
|
if (_pipelineReranker) return _pipelineReranker;
|
|
288
289
|
try {
|
|
289
|
-
const
|
|
290
|
+
const tfModule = '@huggingface/transformers';
|
|
291
|
+
const { AutoTokenizer, AutoModelForSequenceClassification, env } = require(tfModule);
|
|
290
292
|
const cacheDir = getBundledModelsDir();
|
|
291
293
|
env.cacheDir = cacheDir;
|
|
292
294
|
env.localModelPath = cacheDir;
|
|
@@ -461,8 +463,22 @@ async function embedText(text) {
|
|
|
461
463
|
|
|
462
464
|
const extractor = await getEmbedPipeline();
|
|
463
465
|
if (!extractor) {
|
|
464
|
-
// Return pseudo-deterministic
|
|
465
|
-
|
|
466
|
+
// Return pseudo-deterministic L2-normalized vector if neural embedder unavailable
|
|
467
|
+
const vec = new Float32Array(VECTOR_DIMENSION);
|
|
468
|
+
let sumSq = 0;
|
|
469
|
+
for (let i = 0; i < VECTOR_DIMENSION; i++) {
|
|
470
|
+
const byteVal = parseInt(textHash.slice((i * 2) % 62, ((i * 2) % 62) + 2) || '1', 16);
|
|
471
|
+
vec[i] = (byteVal - 128) / 128.0;
|
|
472
|
+
sumSq += vec[i] * vec[i];
|
|
473
|
+
}
|
|
474
|
+
const normVal = Math.sqrt(sumSq) || 1.0;
|
|
475
|
+
for (let i = 0; i < VECTOR_DIMENSION; i++) vec[i] /= normVal;
|
|
476
|
+
if (_EMBED_CACHE.size >= _MAX_EMBED_CACHE) {
|
|
477
|
+
const firstKey = _EMBED_CACHE.keys().next().value;
|
|
478
|
+
_EMBED_CACHE.delete(firstKey);
|
|
479
|
+
}
|
|
480
|
+
_EMBED_CACHE.set(textHash, new Float32Array(vec));
|
|
481
|
+
return vec;
|
|
466
482
|
}
|
|
467
483
|
|
|
468
484
|
let output;
|
package/src/web_server.js
CHANGED
|
@@ -228,6 +228,15 @@ function createWebServer(options = {}) {
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
if (method === 'GET' && (pathname === '/api/v1/csrf' || pathname === '/api/v1/token')) {
|
|
231
|
+
const cookieHeader = req.headers.cookie || '';
|
|
232
|
+
const hasCookie = cookieHeader.split(';').some(c => c.trim() === `konoha-web-token=${sessionToken}`);
|
|
233
|
+
const secFetchSite = req.headers['sec-fetch-site'];
|
|
234
|
+
const origin = req.headers.origin || req.headers.referer;
|
|
235
|
+
const isLoopback = ['127.0.0.1', '::1', '::ffff:127.0.0.1'].includes(req.socket.remoteAddress);
|
|
236
|
+
const isSameOrigin = !origin || origin.includes(`127.0.0.1:${port}`) || origin.includes(`localhost:${port}`);
|
|
237
|
+
if (!hasCookie && (!isLoopback || !isSameOrigin || (secFetchSite && secFetchSite !== 'same-origin' && secFetchSite !== 'none'))) {
|
|
238
|
+
return sendJson(res, 403, { error: 'Forbidden: Missing or invalid session authentication' });
|
|
239
|
+
}
|
|
231
240
|
return sendJson(res, 200, { token: sessionToken });
|
|
232
241
|
}
|
|
233
242
|
|