建立互動式網站
位於 https://{prefix}.interactive.vidmoat.com 的網站,是使用者個人互動式影片的專屬空間,不含任何第三方內容。影片是焦點,網站則是框架。每個頁面應能在一個畫面內引導訪客進入播放器。
工具:get_interactive_site、edit_interactive_site、publish_interactive_site(MCP 與 API)。在應用程式中,相同的呼叫會透過 agentWorkspace 與 action: "interactive_site" 及 site: {tool, ...arguments} 進行。
工作流程
- 先讀取。 使用
get_interactive_site並加上videos: true。它會顯示網站是否存在(canCreate)、頁面及每個sectionId、問題(problems)與版本號(rev)。僅根據要求修改特定sectionId,並回傳rev。 - 僅限已發佈且分享的影片。 網站僅顯示帳戶中已發佈且分享的互動式影片;
videos: true會列出這些影片及其 ID。若使用者指定的影片不在清單中,則需先發佈(publish_interactive搭配share: true,在使用者同意後),不得猜測或替換為其他影片。 - 僅命名一次。 使用
get_interactive_site與prefix: "name"檢查名稱(限制:一或兩次嘗試,不是反覆嘗試),然後使用edit_interactive_site與create: {prefix, title}。使用使用者自己的姓名或品牌;每個帳戶僅一個網站。 - 一個主題。
setTheme:tone(dark、light)、palette(warm、neutral、cool、forest、plum)、font與headingFont(system、serif、mono、rounded)、corners(soft、round、square)、density(comfortable、compact、airy)、width(normal、narrow、wide)、playerAccent(video保留各影片外觀,site使用網站主題)、accent#RRGGBB。配合影片類型:暗色適合電影或夜間畫面,亮色適合教學或課程。省略某個 token 則保留預設值。 - 首頁順序: 先放
hero(標題、一句話、最強影片作為video、按鈕),接著是其他影片的grid,然後是說明內容(story用於分支電影、text、about),最後是cta或links。僅一個精選影片,不要三個。 - 頁面宜少。 通常僅首頁就足夠。僅當內容超過一個畫面時,才新增
films或about頁面。setNav列出頁面;setHeader提供標題、副標題和由images: true提供的標誌。 - 批次編輯。 一次
edit_interactive_site呼叫包含所有ops(全部套用或全部不套用),然後讀取回覆中的problems。 - 顯示後再發佈。 提供使用者
previewUrl(草稿在真實地址上,時效一小時)。僅在使用者要求時再使用publish_interactive_site發佈:這是公開頁面。publish: false可立即下架。
範例
{"create": {"prefix": "river-films", "title": "River Films"}}
{"rev": 3, "ops": [
{"op": "setTheme", "tone": "dark", "palette": "cool", "headingFont": "serif", "accent": "#4CC9F0"},
{"op": "setHeader", "title": "River Films", "tagline": "Short films you play"},
{"op": "addPage", "slug": "films", "title": "Films"},
{"op": "setNav", "links": [{"label": "Home", "page": ""}, {"label": "Films", "page": "films"}]},
{"op": "addSection", "page": "", "section": {"kind": "hero", "heading": "Films where you choose what happens next", "body": "Pick a path, then go back and take the other one.", "video": "<id from videos:true>", "cta": {"label": "See every film", "page": "films"}}},
{"op": "addSection", "page": "", "section": {"kind": "grid", "heading": "Play them all", "videos": ["<id>", "<id>"], "columns": 3}},
{"op": "addSection", "page": "", "section": {"kind": "story", "video": "<id>", "heading": "How it branches"}}
]}
{"rev": 4, "ops": [{"op": "updateSection", "sectionId": "<from the digest>", "set": {"heading": "New films every month", "body": null}}]}
注意事項
- 無自訂程式碼。 不允許 HTML、CSS、腳本、嵌入或「自訂樣式」;絕對不要提供這些選項。被拒絕的值會連同允許清單一併回傳:從中選擇。
- 頁面
""代表首頁。 其他頁面使用 slug(如films、about);重新命名的 slug 會自動更新其連結。 - 按鈕(
cta)為{label, page}或{label, href}且href必須為https網址。links僅限 https。 text使用受限的 Markdown: 僅支援##與###、清單、粗體、斜體、https 連結。不允許 HTML 或圖片。about使用圖片 ID(來自images: true),絕不允許 URL。- 強調色可能被拒絕,若其上的文字或頁面上的其他顏色難以閱讀。暗色背景嘗試淺色強調色,亮色背景嘗試深色強調色。
- 限制會被拒絕,不會被截斷: 6 個頁面、每頁 12 個區塊、每個 grid 12 個影片、6 個導航連結、10 個連結;標題 90 字元、內文 600 字元。請自行縮短文字。
null用於移除updateSection中的可選欄位;若省略則保留原值。- 搜尋引擎可找到已發佈的網站(會附帶網站地圖與影片資料)。為不認識的使用者撰寫每個頁面的
title與description;若希望網站保持私密,可使用setSettings的indexing: false。 - 故事地圖會破壞遊戲體驗。 預設僅顯示開場與答案,並統計場景與結局數量。僅在課程或指南中使用
reveal: "full",絕不用於遊戲或謎團中,也不得與承諾秘密的文案相鄰。 - 海報很重要。 播放器與 grid 卡片在播放前會顯示影片海報;請選擇海報為真實標題卡而非黑色第一幀的影片。
- 重新命名網址(使用
edit_interactive_site的prefix)會保留舊名稱並暫時轉發;請勿隨意重新命名。 - 休閒帳戶會被拒絕並附上原因;請直接告知,不要設法繞過。