An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
{
"ID": "20260804185001-secvr02",
"Spec": "2",
"Type": "NodeDocument",
"Properties": {
"id": "20260804185001-secvr02",
"title": "金鑰和變數",
"type": "doc",
"updated": "20261024164212"
},
"Children": [
{"ID": "20260804224201-sectw01", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804224201-sectw01", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "概述"}]},
{"ID": "20260804224202-sectw02", "Type": "NodeParagraph", "Properties": {"id": "20260804224202-sectw02", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "金鑰和變數用於集中管理 Skill、MCP 服務、智能體工具和外掛使用的可重複使用值。金鑰適合儲存密碼和 API token 等敏感資料,其值會加密儲存,並且不會進入 AI 對話;變數適合儲存位址、名稱和其他非敏感參數,其值以明文儲存,並且可以進入 AI 對話。"}]},
{"ID": "20260804224203-sectw03", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804224203-sectw03", "updated": "20261016112115"}, "Children": [{"Type": "NodeText", "Data": "設定"}]},
{"ID": "20260804224204-sectw04", "Type": "NodeParagraph", "Properties": {"id": "20260804224204-sectw04", "updated": "20261016112115"}, "Children": [{"Type": "NodeText", "Data": "在 "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "設定"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "金鑰和變數"}, {"Type": "NodeText", "Data": " 中新增、編輯和刪除金鑰或變數。每個項目有名稱和值,金鑰另有允許的主機。填寫不含協議和連接埠的完整主機名稱,例如 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "api.example.com"}, {"Type": "NodeText", "Data": ",以逗號、空白或分號分隔;比對不區分大小寫,不會自動允許子網域。清單為空時,所有對外 HTTP 請求均不展開該金鑰;變數不受主機限制。為相容所有引用方式,名稱建議使用英文字母、數字和底線,並且不要以數字開頭。"}]},
{"ID": "20260804224205-sectw05", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804224205-sectw05", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "引用方式"}]},
{"ID": "20260804224206-sectw06", "Type": "NodeParagraph", "Properties": {"id": "20260804224206-sectw06", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "可以使用簡寫 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "$NAME"}, {"Type": "NodeText", "Data": " 或 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "${NAME}"}, {"Type": "NodeText", "Data": ",也可以使用帶命名空間的 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "{{secrets.NAME}}"}, {"Type": "NodeText", "Data": " 和 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "{{vars.NAME}}"}, {"Type": "NodeText", "Data": "。帶命名空間的寫法含義更明確,適合在共享設定和 Skill 中使用。"}]},
{"ID": "20260804224207-sectw07", "Type": "NodeParagraph", "Properties": {"id": "20260804224207-sectw07", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "如果金鑰和變數存在相同名稱,在同時支援兩者的引用位置使用簡寫時會優先取得金鑰;使用帶命名空間的寫法可以明確指定。找不到對應名稱時,預留位置會保留原文,便於發現尚未設定的項目。"}]},
{"ID": "20260804224208-sectw08", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804224208-sectw08", "updated": "20261024164212"}, "Children": [{"Type": "NodeText", "Data": "使用範例"}]},
{"ID": "20260804224209-sectw09", "Type": "NodeParagraph", "Properties": {"id": "20260804224209-sectw09", "updated": "20261016112115"}, "Children": [{"Type": "NodeText", "Data": "例如,HTTP MCP 服務位址為 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "https://api.example.com"}, {"Type": "NodeText", "Data": " 時,新增金鑰 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "API_TOKEN"}, {"Type": "NodeText", "Data": ",在允許的主機中填寫 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "api.example.com"}, {"Type": "NodeText", "Data": ",再新增變數 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "WORKSPACE"}, {"Type": "NodeText", "Data": ",即可在標頭中這樣引用:"}]},
{"ID": "20260804224210-sectw10", "Type": "NodeCodeBlock", "IsFencedCodeBlock": true, "CodeBlockFenceChar": 96, "CodeBlockFenceLen": 3, "CodeBlockOpenFence": "YGBg", "CodeBlockInfo": "anNvbg==", "CodeBlockCloseFence": "YGBg", "Properties": {"id": "20260804224210-sectw10", "updated": "20260804230000"}, "Children": [{"Type": "NodeCodeBlockFenceOpenMarker", "Data": "```", "CodeBlockFenceLen": 3}, {"Type": "NodeCodeBlockFenceInfoMarker", "CodeBlockInfo": "anNvbg=="}, {"Type": "NodeCodeBlockCode", "Data": "{\n \"Authorization\": \"Bearer {{secrets.API_TOKEN}}\",\n \"X-Workspace\": \"{{vars.WORKSPACE}}\"\n}\n"}, {"Type": "NodeCodeBlockFenceCloseMarker", "Data": "```", "CodeBlockFenceLen": 3}]},
{"ID": "20260804224211-sectw11", "Type": "NodeParagraph", "Properties": {"id": "20260804224211-sectw11", "updated": "20261024164212"}, "Children": [
{"Type": "NodeText", "Data": "內建 HTTP 請求工具只在網址中展開變數,例如 "},
{"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "{{vars.API_BASE}}/v1/items"},
{"Type": "NodeText", "Data": "。HTTP 標頭、請求本文以及 HTTP MCP 服務標頭中的金鑰,僅在目標主機被允許時展開,否則保留預留位置。"}
]},
{
"ID": "20261024164212-f9we05g",
"Type": "NodeParagraph",
"Properties": {
"id": "20261024164212-f9we05g",
"updated": "20261024164212"
},
"Children": [
{
"Type": "NodeText",
"Data": "stdio MCP 服務只繼承使用者勾選的核心環境變數;設定的環境變數項目可以引用金鑰和變數,不受 HTTP 主機清單限制,這相當於明確將明文金鑰交給該程式及其子程序,因此只應為可信程式設定。Skill 本文和對話訊息可以使用變數;金鑰預留位置不會在 AI 對話中展開。"
}
]
},
{"ID": "20260804224212-sectw12", "Type": "NodeParagraph", "Properties": {"id": "20260804224212-sectw12", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "外掛也可以透過介面讀取或解析金鑰和變數。安裝外掛前應確認其來源和權限,因為能夠存取金鑰的外掛可以取得執行時期明文。"}]},
{"ID": "20260804224213-sectw13", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804224213-sectw13", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "安全建議"}]},
{"ID": "20260804224214-sectw14", "Type": "NodeParagraph", "Properties": {"id": "20260804224214-sectw14", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "不要將密碼、存取 token 或私密金鑰儲存為變數,也不要在對話訊息、Skill 本文或一般設定中直接寫入敏感值。刪除或更換金鑰後,應同時檢查使用它的 Skill、MCP 服務和外掛設定。有關智能體使用這些設定的方式,請參閱 "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20260804171002-aiagt02", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "AI 智能體"}, {"Type": "NodeText", "Data": "。"}]}
]
}