922a57fe34
Self-hosted 開源:WASM 零件 + recipe + cypher-executor,跑在你自己的 Cloudflare。 此為重建的乾淨歷史起點(移除曾誤 commit 的 GCP SA 金鑰,舊歷史保留在 richblack/arcrun 與本地 backup 分支)。含: - acr init --self-hosted installer(建 KV/R2 + codeload 拉預編譯 wasm + wrangler deploy + seed recipe) - recipe push 把關(資料外流提醒 + 打通檢查) - 19 個正當零件預編譯 wasm(claude_api/km_writer/kbdb_upsert_block 排除:違反 DECISIONS §1) - CLI / cypher-executor / registry / 完整 SDD Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
68 lines
2.2 KiB
YAML
68 lines
2.2 KiB
YAML
canonical_id: "km_writer"
|
||
display_name: "KM Writer"
|
||
category: "api"
|
||
version: "v1"
|
||
wasi_target: "preview1"
|
||
stability: "floating"
|
||
runtime_compat:
|
||
- "cf-workers"
|
||
- "workerd"
|
||
constraints:
|
||
max_size_kb: 2048
|
||
max_cold_start_ms: 50
|
||
no_network_syscall: false
|
||
no_filesystem_syscall: true
|
||
io_model: "stdin_stdout_json"
|
||
input_schema:
|
||
type: object
|
||
required: [action, mira_url, token]
|
||
properties:
|
||
action:
|
||
type: string
|
||
description: "操作類型:read_journal | read_journal_date | append_journal | list_pages | read_page | write_page"
|
||
enum: [read_journal, read_journal_date, append_journal, list_pages, read_page, write_page]
|
||
mira_url:
|
||
type: string
|
||
description: "Mira 服務基礎 URL(例:https://mira.uncle6.me)"
|
||
token:
|
||
type: string
|
||
description: "Mira MIRA_TOKEN(Bearer token)"
|
||
content:
|
||
type: string
|
||
description: "內容(append_journal / write_page 時必填)"
|
||
timestamp:
|
||
type: string
|
||
description: "ISO 8601 時間戳(append_journal 時選填,影響日期和時間顯示)"
|
||
date:
|
||
type: string
|
||
description: "日期 YYYY-MM-DD(read_journal_date 時必填)"
|
||
name:
|
||
type: string
|
||
description: "頁面名稱(read_page / write_page 時必填)"
|
||
output_schema:
|
||
type: object
|
||
properties:
|
||
success:
|
||
type: boolean
|
||
data:
|
||
type: object
|
||
description: "Mira API 回應資料"
|
||
error:
|
||
type: string
|
||
description: "錯誤訊息(success=false 時)"
|
||
gherkin_tests:
|
||
- scenario: "缺少 action"
|
||
given: '{"mira_url":"https://mira.uncle6.me","token":"abc"}'
|
||
then_contains: '{"success":false'
|
||
- scenario: "缺少 token"
|
||
given: '{"action":"list_pages","mira_url":"https://mira.uncle6.me"}'
|
||
then_contains: '{"success":false'
|
||
tags: [km, journal, logseq, mira, knowledge-management]
|
||
description: "讀寫 Mira leo-graph 的 journals 和 pages。透過 host function 呼叫 Mira /km/* API,支援讀取、新增日誌條目,以及讀寫頁面。"
|
||
config_example: |
|
||
append_to_journal:
|
||
action: "append_journal"
|
||
mira_url: "https://mira.uncle6.me"
|
||
token: "<mira_token>"
|
||
content: "今天完成了 arcrun km_writer 元件"
|