[Init] Initial commit - NetMesh terminal manager
Some checks failed
build-packages / resolve bundled mosh-client (push) Has been cancelled
build-packages / resolve bundled et-client (push) Has been cancelled
build-packages / build-macos (push) Has been cancelled
build-packages / build-windows (push) Has been cancelled
build-packages / build-linux-x64 (push) Has been cancelled
build-packages / build-linux-arm64 (push) Has been cancelled
build-packages / release (push) Has been cancelled
build-packages / update Nix release metadata (push) Has been cancelled
build-packages / bump homebrew tap (push) Has been cancelled
test / lint-and-test (push) Has been cancelled
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
build-et-binaries / build-linux-x64 (push) Has been cancelled
build-et-binaries / build-linux-arm64 (push) Has been cancelled
build-et-binaries / build-macos-universal (push) Has been cancelled
build-et-binaries / build-windows-x64 (push) Has been cancelled
build-et-binaries / release (push) Has been cancelled

This commit is contained in:
2026-09-13 18:24:01 +08:00
commit 3c72efcb7f
3255 changed files with 907009 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
"use strict";
/**
* Shared Vault tool-selection guidance for MCP external agents and get_environment.
* Keep in sync with infrastructure/ai/cattyAgent/systemPrompt.ts (Catty sidebar).
*/
const VAULT_HOSTS_VS_NOTES_GUIDANCE =
"Vault → Hosts vs Vault → Notes: When the user asks to add/create/import a host "
+ "(创建主机、添加主机、保存 SSH 连接凭据), use vault_hosts_create with dryRun=true first, "
+ "or vault_hosts_import for known export formats (PuTTY, MobaXterm, CSV, SecureCRT, ssh_config) — "
+ "NOT vault_notes_create. For attached host files, use vault_hosts_import only when the attachment is a known export format; "
+ "for unknown attached host/server text, read the attachment content, extract hostname, username, password, port, group, tags, and label yourself, "
+ "then call vault_hosts_create with dryRun=true first. Extract hostname, username, password or local keyPath, port, group, tags, and label from the user's text; "
+ "put long admin tables or remarks in the host notes field (host_notes_set / Host Details metadata), "
+ "not Vault sidebar Notes. Use vault_notes_create or vault_notes_update ONLY when the user explicitly wants "
+ "markdown documentation in Vault → Notes (保险箱笔记 sidebar). "
+ "Use vault_hosts_list to resolve hostId before vault_hosts_update or vault_hosts_delete. "
+ "If vault_hosts_create or vault_hosts_import fails, report the error — do not silently create a Vault note instead.";
const VAULT_SCRIPTS_GUIDANCE =
"Snippets vs automation scripts: snippets_* for shell command text (optional {{variables}}). "
+ "scripts_* for nct JavaScript automation (await nct.screen.sendLine, waitForText/waitForRegex, dialogs). "
+ "Call scripts_reference before authoring scripts. scripts_run with wait=true blocks until completion; "
+ "use scripts_runs_list / scripts_run_stop / scripts_run_pause / scripts_run_resume for lifecycle. "
+ "Triggers: manual, onConnect (runs after connect), onOutput (regex triggerPattern). "
+ "Host/group linking: scripts_targets_set supports targets and dynamic targetGroups; "
+ "per-host connect order: host_connect_scripts_list / host_connect_scripts_set.";
function appendVaultAgentGuidance(description) {
const base = typeof description === "string" ? description.trim() : "";
let result = base;
if (!result.includes("Vault → Hosts vs Vault → Notes")) {
result = result ? `${result} ${VAULT_HOSTS_VS_NOTES_GUIDANCE}` : VAULT_HOSTS_VS_NOTES_GUIDANCE;
}
if (!result.includes("Snippets vs automation scripts")) {
result = result ? `${result} ${VAULT_SCRIPTS_GUIDANCE}` : VAULT_SCRIPTS_GUIDANCE;
}
return result;
}
module.exports = {
VAULT_HOSTS_VS_NOTES_GUIDANCE,
VAULT_SCRIPTS_GUIDANCE,
appendVaultAgentGuidance,
};