From 225aa9f9e70b7343dd66b6c2b10a55773398d750 Mon Sep 17 00:00:00 2001 From: uncle6me-web Date: Sun, 28 Jun 2026 16:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=20parts.ts=20=E9=99=8D=E7=B4=9A?= =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E6=AE=98=E7=95=99=EF=BC=9Atelegram/gmail/she?= =?UTF-8?q?ets/line=20=E6=94=B9=E8=B5=B0=20recipe=E3=80=81=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=B7=B2=E5=88=AA=E7=9A=84=20ai=5Ftransform=EF=BC=88i?= =?UTF-8?q?ssue=20#13=20=E6=AD=A5=E9=A9=9F2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit telegram/gmail/google_sheets/line_notify 已於 2026-05-29 Phase 2 降級為 recipe, 但 acr parts 仍列舊 component: 形態誤導 CC。參照 notion 樣板改成「走 recipe」描述 + canonical_id 對齊 api-recipe-seeds.ts(telegram_send/gmail_send/google_sheets_append/line_notify_send)。 ai_transform_compile/run 已刪除(mindset §2),整段移除。 canonical_id 均已核實存在於 cypher-executor/src/lib/api-recipe-seeds.ts。 Co-Authored-By: Claude Opus 4.8 (1M context) --- cli/src/commands/parts.ts | 98 +++++++++++++++------------------------ 1 file changed, 37 insertions(+), 61 deletions(-) diff --git a/cli/src/commands/parts.ts b/cli/src/commands/parts.ts index 6bdf54d..33a3536 100644 --- a/cli/src/commands/parts.ts +++ b/cli/src/commands/parts.ts @@ -174,27 +174,9 @@ const BUILTIN_COMPONENTS: ComponentDef[] = [ type: string format: email`, }, - // ── AI 類 ────────────────────────────────────────────────────────────────── - { - canonical_id: 'ai_transform_compile', - display_name: 'AI Transform Compile', - category: 'ai', - description: '將自然語言規則編譯成可執行轉換程式', - config_example: -` compile_node: - component: ai_transform_compile - rule: "把 name 轉成大寫,並在前面加上 Hello "`, - }, - { - canonical_id: 'ai_transform_run', - display_name: 'AI Transform Run', - category: 'ai', - description: '執行 ai_transform_compile 產生的轉換程式', - config_example: -` run_node: - component: ai_transform_run - program: "{{compiled_program}}"`, - }, + // ── AI 類:已移除 ────────────────────────────────────────────────────────── + // ai_transform_compile / ai_transform_run 於 2026-05-29 刪除(mindset §2:arcrun 是 + // AI 呼叫的工具,不是工具回頭呼叫 LLM)。需要 AI 判斷/轉換由操盤的 CC 自己做。 // ── API 整合類(Recipe 型,不需 deploy Worker) ──────────────────────────── { canonical_id: 'http_request', @@ -212,63 +194,57 @@ const BUILTIN_COMPONENTS: ComponentDef[] = [ key: "{{value}}"`, }, { - canonical_id: 'gmail', - display_name: 'Gmail', + canonical_id: 'gmail_send', + display_name: 'Gmail Send', category: 'api', - description: '寄送 Gmail(需要 gmail_token credential)', + description: '透過 recipe 寄送 Gmail(recipe gmail_send,auth: google service_account)。注意:Gmail 讀取尚無對應 recipe(待 seed 補 gmail_list)。', config_example: -` mail_node: - component: gmail - to: "recipient@example.com" - subject: "來自 arcrun 的通知" - body: "{{message}}"`, - credentials_required: [ - { key: 'gmail_token', type: 'OAuth2 access token', inject_as: 'access_token' }, - ], +` # 寄信用內建 recipe gmail_send;body 帶 raw(base64url MIME) + mail_node: + component: gmail_send + method: POST + body: + raw: "{{mime_base64url}}"`, }, { - canonical_id: 'google_sheets', - display_name: 'Google Sheets', + canonical_id: 'google_sheets_append', + display_name: 'Google Sheets Append', category: 'api', - description: 'Google Sheets 讀寫(需要 google_oauth credential)', + description: '透過 recipe 追加一列到 Sheets(recipe google_sheets_append;讀取用 google_sheets_read。auth: google service_account)', config_example: -` sheet_node: - component: google_sheets - spreadsheet_id: "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms" - range: "Sheet1!A:B" - operation: append - values: - - ["{{name}}", "{{email}}"]`, - credentials_required: [ - { key: 'google_oauth', type: 'OAuth2 access token', inject_as: 'access_token' }, - ], +` # 追加用內建 recipe google_sheets_append(讀取改用 google_sheets_read) + sheet_node: + component: google_sheets_append + method: POST + _path: "/v4/spreadsheets/{{spreadsheet_id}}/values/Sheet1!A:B:append?valueInputOption=RAW" + body: + values: + - ["{{name}}", "{{email}}"]`, }, { - canonical_id: 'telegram', - display_name: 'Telegram', + canonical_id: 'telegram_send', + display_name: 'Telegram Send', category: 'api', - description: '發送 Telegram 訊息(需要 telegram_bot_token credential)', + description: '透過 recipe 發送 Telegram 訊息(recipe telegram_send,auth: static_key,token 注入 URL path)', config_example: -` tg_node: - component: telegram +` # 內建 recipe telegram_send(token 由 auth 注入 URL,不寫在這) + tg_node: + component: telegram_send chat_id: "123456789" text: "{{message}}"`, - credentials_required: [ - { key: 'telegram_bot_token', type: 'Bot token', inject_as: 'bot_token' }, - ], }, { - canonical_id: 'line_notify', + canonical_id: 'line_notify_send', display_name: 'LINE Notify', category: 'api', - description: '發送 LINE Notify 通知(需要 line_token credential)', + description: '透過 recipe 發送 LINE Notify 通知(recipe line_notify_send,auth: static_key Bearer)', config_example: -` line_node: - component: line_notify - message: "{{notification}}"`, - credentials_required: [ - { key: 'line_token', type: 'LINE Notify token', inject_as: 'token' }, - ], +` # 內建 recipe line_notify_send(POST notify,body form-urlencoded) + line_node: + component: line_notify_send + method: POST + body: + message: "{{notification}}"`, }, { canonical_id: 'notion',