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>
76 lines
2.4 KiB
YAML
76 lines
2.4 KiB
YAML
canonical_id: "claude_api"
|
||
display_name: "Claude AI 對話"
|
||
category: "ai"
|
||
version: "v2"
|
||
wasi_target: "preview1"
|
||
stability: "floating"
|
||
runtime_compat:
|
||
- "cf-workers"
|
||
- "workerd"
|
||
- "wazero"
|
||
constraints:
|
||
max_size_kb: 2048
|
||
max_cold_start_ms: 80
|
||
no_network_syscall: false
|
||
no_filesystem_syscall: true
|
||
io_model: "stdin_stdout_json"
|
||
input_schema:
|
||
type: object
|
||
required: [mira_token, prompt]
|
||
properties:
|
||
mira_token:
|
||
type: string
|
||
description: Mira daemon Bearer token(Hetzner cloud-cto Mira daemon 的 MIRA_TOKEN)
|
||
prompt:
|
||
type: string
|
||
description: 要送給 Mira 的訊息(已內建 Mira 副駕 persona,不需重複設角色)
|
||
mira_url:
|
||
type: string
|
||
description: Mira daemon URL,預設 https://mira.uncle6.me
|
||
default: "https://mira.uncle6.me"
|
||
timeout_ms:
|
||
type: integer
|
||
description: Daemon 協商模式 timeout,預設 25000ms(協商上限)
|
||
default: 25000
|
||
output_schema:
|
||
type: object
|
||
properties:
|
||
success:
|
||
type: boolean
|
||
data:
|
||
type: object
|
||
description: 同步完成時的回應
|
||
properties:
|
||
text: { type: string, description: Mira 的回覆文字 }
|
||
task_id: { type: string }
|
||
model: { type: string, description: 「實際 routing 用的模型(haiku / sonnet)」 }
|
||
pending:
|
||
type: boolean
|
||
description: 「true 時表示 daemon 切到非同步模式,task 還在跑,需 polling」
|
||
task_id:
|
||
type: string
|
||
description: pending=true 時用此 id polling
|
||
poll_url:
|
||
type: string
|
||
description: GET 此 URL 查詢任務進度 / 結果
|
||
error:
|
||
type: string
|
||
gherkin_tests:
|
||
- scenario: "缺 mira_token"
|
||
given: '{"prompt":"hi"}'
|
||
then_contains: '{"success":false'
|
||
- scenario: "簡短對話 25s 內回完"
|
||
given: '{"mira_token":"...","prompt":"1+1=?"}'
|
||
then_contains: 'success'
|
||
tags: [ai, llm, claude, mira, primitive]
|
||
description: "呼叫 Mira daemon (Hetzner cloud-cto) 進行 AI 對話。Daemon 內部用 Claude Agent SDK,內建 Mira 副駕 persona,可長執行任務。所有 mira-app 的 AI workflow(自動回覆、wiki 合成、新聞註解)都用此零件。"
|
||
config_example: |
|
||
ai_reply:
|
||
mira_token: "{{secret.mira_token}}"
|
||
prompt: |
|
||
用戶 leo 在 mira 河道發了這則貼文:
|
||
「{{trigger.post_content}}」
|
||
|
||
請以副駕 AI 的身份留言回應,簡短繁中,務實。
|
||
timeout_ms: 25000
|