{
  "schemaVersion": "1.0",
  "item": {
    "slug": "line-oa",
    "name": "LINE Chat for Official Account",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/PicSeeInc/line-oa",
    "canonicalUrl": "https://clawhub.ai/PicSeeInc/line-oa",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/line-oa",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=line-oa",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "_meta.json",
      "README.md",
      "SKILL.md",
      "scripts/click-login.js",
      "scripts/click-line-account.js",
      "scripts/read-messages.js"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/line-oa"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/line-oa",
    "agentPageUrl": "https://openagent3.xyz/skills/line-oa/agent",
    "manifestUrl": "https://openagent3.xyz/skills/line-oa/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/line-oa/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "LINE Official Account Manager",
        "body": "⚠️ CRITICAL: Always use profile:\"openclaw\" (isolated browser) for all browser actions. Never use Chrome relay. Keep the same targetId across operations to avoid losing the tab.\n\n⚠️ CONTEXT Management:\n\nSnapshot results are large. Do NOT repeat them in thinking.\nExtract needed info and process immediately. Do not re-describe the entire snapshot.\nPreferred approach: Use snapshot refs:\"aria\" compact:true to find element refs, then act + click/type with ref.\nAvoid: Hard-coded evaluate with textContent.includes() — unreliable due to DOM timing and structure variations.\n\n⚠️ AUTO-LOGIN SCRIPTS:\n\nauto-login.mjs is a reference implementation (not directly executable by agents)\nlogin-flow.md is the agent-executable version (use this for automation)\nWhy separate? Agents use browser tool calls, not Node module imports"
      },
      {
        "title": "Configuration",
        "body": "Before first use, check if config.json exists:\n\nread file_path:\"skills/line-oa/config.json\"\n\n⚠️ PATH RULE: Always use workspace-relative paths starting from skills/line-oa/. Never use ../ or absolute paths starting with /.\n\nIf missing, help the user run the following command to start the setup wizard:\n\ncd skills/line-oa\nnode scripts/setup.js"
      },
      {
        "title": "Enter LINE OA Manager",
        "body": "This is the first step for all operations below.\n\nCheck and start browser service:\nbrowser action:\"status\"\n\nIf \"running\": false, start the browser service:\nbrowser action:\"start\" profile:\"openclaw\"\n\nWait 2-3 seconds for the service to initialize.\n\n\nRead config to get chatUrl:\nread file_path:\"skills/line-oa/config.json\"\n\nExtract chatUrl from the JSON (e.g., https://chat.line.biz/U1234567890abcdef1234567890abcdef/).\n\n\nOpen browser:\nbrowser action:\"open\" profile:\"openclaw\" targetUrl:\"<chatUrl>\"\n\nCapture targetId and url from response.\n\n\nWait for page load:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<targetId>\" request:{\"kind\":\"wait\",\"timeMs\":2000}\n\n\n\nCheck current URL:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"function(){return window.location.href;}\"}\n\nKey result: If the current URL matches chatUrl, you have successfully logged in! Go to step 5, else proceed to troubleshooting.\nTroubleshooting\nIf you see the login page (the URL redirects to account.line.biz), use these automation scripts:\na. Click LINE Account button:\nread file_path:\"skills/line-oa/scripts/click-line-account.js\"\n\nExecute the script directly:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"<script_content>\"}\n\nWait 2 seconds.\nb. Click Login button:\nread file_path:\"skills/line-oa/scripts/click-login.js\"\n\nExecute the script directly:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"<script_content>\"}\n\nWait 3 seconds.\nc. Reload chatUrl:\nbrowser action:\"navigate\" profile:\"openclaw\" targetId:\"<targetId>\" targetUrl:\"<chatUrl>\"\n\nWait 2 seconds, then take snapshot to verify left-side chat list is visible.\nAfter Check\n\n\nProceed with the user's other requests.\n\n\nClean Up Browser Tabs:\na. Open a blank tab:\nbrowser action:\"open\" profile:\"openclaw\" targetUrl:\"about:blank\"\n\nb. Get all tabs:\nbrowser action:\"tabs\" profile:\"openclaw\"\n\nc. Close all tabs except the newest one (about:blank):\nbrowser action:\"close\" profile:\"openclaw\" targetId:\"<your_targetId>\"\n\nImportant: Always clean up tabs after all operations to prevent resource accumulation. The blank tab keeps the browser service running for faster next use."
      },
      {
        "title": "Troubleshooting",
        "body": "If you see the login page (the URL redirects to account.line.biz), use these automation scripts:\n\na. Click LINE Account button:\n\nread file_path:\"skills/line-oa/scripts/click-line-account.js\"\n\nExecute the script directly:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"<script_content>\"}\n\nWait 2 seconds.\n\nb. Click Login button:\n\nread file_path:\"skills/line-oa/scripts/click-login.js\"\n\nExecute the script directly:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"<script_content>\"}\n\nWait 3 seconds.\n\nc. Reload chatUrl:\n\nbrowser action:\"navigate\" profile:\"openclaw\" targetId:\"<targetId>\" targetUrl:\"<chatUrl>\"\n\nWait 2 seconds, then take snapshot to verify left-side chat list is visible."
      },
      {
        "title": "Quick Check (for cron / automated checks)",
        "body": "Complete flow: login → list chats → report. Follow these steps exactly.\n\nRead config: read file_path:\"skills/line-oa/config.json\" → get chatUrl\nOpen browser: browser action:\"open\" profile:\"openclaw\" targetUrl:<chatUrl> → get targetId\nWait: browser action:\"act\" profile:\"openclaw\" targetId:<targetId> request:{\"kind\":\"wait\",\"timeMs\":3000}\nCheck URL: browser action:\"act\" profile:\"openclaw\" targetId:<targetId> request:{\"kind\":\"evaluate\",\"fn\":\"function(){return window.location.href;}\"}\n\nIf URL contains account.line.biz → go to Troubleshooting section below to login, then come back\nIf URL contains chat.line.biz → continue\n\n\nRun this one-liner script as-is, do not modify:\nbrowser action:\"act\" profile:\"openclaw\" targetId:<targetId> request:{\"kind\":\"evaluate\",\"fn\":\"(function(){var r=document.querySelectorAll('.list-group-item-chat');return Array.from(r).map(function(e){var h=e.querySelector('h6');var p=e.querySelector('.text-muted.small');var pt=p?p.textContent.trim():'';var ms=e.querySelectorAll('.text-muted');var t='';for(var i=0;i<ms.length;i++){var v=ms[i].textContent.trim();if(v&&v.length<20&&v!==pt)t=v;}var d=e.querySelector('span.badge.badge-pin');var u=!!d&&getComputedStyle(d).display!=='none';return{name:h?h.textContent.trim():'',time:t,lastMsg:pt.substring(0,100),unread:u};}).filter(function(i){return i.name;});})()\"}\n\n⚠️ CHECKPOINT: Did you actually call the browser tool above? If you only thought about it but didn't call it, STOP and call it NOW. You MUST see a tool result before continuing.\nReport: take the first 5 items, format each as: <name> (<time>) <lastMsg> [未讀] or [已讀] based on unread field. If empty array, say \"目前沒有聊天記錄\".\nClean up: open about:blank, list all tabs, close everything except about:blank."
      },
      {
        "title": "Check LINE Messages",
        "body": "Extracts all chats from the left-side chat list with unread status. Does NOT require clicking into each chat.\n\nPrerequisites: You must be logged in and on the chat list page (see Login section Step 5 for verification)."
      },
      {
        "title": "Steps",
        "body": "Read the script content:\nread file_path:\"skills/line-oa/scripts/list-chats.js\"\n\n\n\nRun the script via browser evaluate:\nPass the script content directly as the fn parameter:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"<script_content>\"}\n\n\n\nThe script returns a JSON array of all chat items with structure:\n[{ name: string, time: string, lastMsg: string, unread: boolean }]\n\n\nname: customer display name\ntime: timestamp (e.g., \"21:32\", \"Yesterday\", \"Friday\")\nlastMsg: last message preview (~100 chars)\nunread: true if green dot present, false otherwise\n\n\n\nGet URLs for unread chats (optional but recommended for faster follow-up):\nFor each unread chat, click into it to get the direct URL, then return to list:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"function(){const items=document.querySelectorAll('.list-group-item-chat');const target=Array.from(items).find(el=>{const h6=el.querySelector('h6');return h6&&h6.textContent.includes('<customer_name>');});if(target){const link=target.querySelector('a.d-flex');if(link){link.click();return {clicked:true};}return {linkNotFound:true};}return {itemNotFound:true};}\"}\n\nWait 500ms, then get the URL:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"function(){return window.location.href;}\"}\n\nNavigate back to list:\nbrowser action:\"navigate\" profile:\"openclaw\" targetId:\"<your_targetId>\" targetUrl:\"<chatUrl>\"\n\nWait 1 second before processing next unread chat.\nResult: Store the chat URL (e.g., https://chat.line.biz/U1234567890abcdef1234567890abcdef/chat/U803dc04f...) alongside the chat info for faster access later."
      },
      {
        "title": "How to Report Results",
        "body": "If unread: true exists: List each unread chat with name, time, preview, and URL (if obtained)\nIf no unread: Say \"No unread messages at this time\""
      },
      {
        "title": "Notes",
        "body": "Unread indicator: span.badge.badge-pin inside each chat list item (green dot)\nLimitation: lastMsg shows the last message in the thread, which may be an auto-response rather than the customer's original message\nChat URLs: Getting URLs requires clicking each chat. Do this for unread chats to enable faster replies later.\nTo read full messages: See \"View Specific Messages\" section below"
      },
      {
        "title": "View Specific Messages",
        "body": "Opens any chat (read or unread) and displays its messages. Works for viewing message history, checking context, or preparing to reply.\n\nPrerequisites: You must be logged in and on the chat list page. You should know the customer name (from list-chats.js or user request)."
      },
      {
        "title": "Steps",
        "body": "Find and click the chat item to open messages:\nUse evaluate to find the chat item by name (more reliable than snapshot for dynamic chat list):\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"function(){const items=document.querySelectorAll('.list-group-item-chat');const target=Array.from(items).find(el=>{const h6=el.querySelector('h6');return h6&&h6.textContent.includes('<customer_name>');});if(target){const link=target.querySelector('a.d-flex');if(link){link.click();return {clicked:true};}return {linkNotFound:true};}return {itemNotFound:true};}\"}\n\nReplace <customer_name> with the actual customer name.\n\n\nWait for messages panel to load:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"wait\",\"timeMs\":2000}\n\n\n\nTake a screenshot to view the messages:\nbrowser action:\"screenshot\" profile:\"openclaw\" targetId:\"<your_targetId>\"\n\nThe screenshot will show:\n\nRecent messages in the chat (right panel)\nCustomer info and tags (far right panel)\nAuto-response status banner (if active)\n\n\n\nOptional: Read recent messages programmatically\nIf you need structured message data instead of a screenshot, read and run this script:\nread file_path:\"skills/line-oa/scripts/read-messages.js\"\n\nExecute:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"<script_content>\"}\n\nReturns an array of recent messages with:\n\ntime: timestamp\ntext: message content\nisCustomer: true if from customer, false if from you\nhasImage: true if message contains an image"
      },
      {
        "title": "Navigation Tips",
        "body": "To scroll to earlier messages:\n\nThe messages panel auto-scrolls to the bottom by default\nTo see earlier history, use:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"function(){const panel=document.querySelector('.conversation-panel, .messages-container, [class*=\\\"chat-container\\\"]');if(panel){panel.scrollTo({top:0,behavior:'smooth'});return {scrolled:true};}return {error:'Messages panel not found'};}\"}\n\n\nWait 1 second after scrolling, then take another screenshot\n\nCommon issues:\n\nIf messages don't load: increase wait time to 3000ms\nIf customer name has special characters: use partial match (e.g., \"John\" instead of \"John ⭐️\")\nIf click fails: the chat might not be visible in the current scroll position of the left panel"
      },
      {
        "title": "Handling Images",
        "body": "When you see images in the screenshot or hasImage: true in message data:\n\nFind and download the image:\nfunction(){\n  const allPhotoImgs = Array.from(document.querySelectorAll('img[alt=\"Photo\"]'));\n  const targetImg = allPhotoImgs.find(img => {\n    const parent = img.closest('.chat');\n    return parent && !parent.classList.contains('chat-reverse') && parent.innerText.includes('<time>');\n  });\n  \n  if (!targetImg) return {error: 'Image not found'};\n  \n  const parent = targetImg.closest('.chat');\n  const downloadLink = Array.from(parent.querySelectorAll('a')).find(a => a.textContent.trim() === 'Download');\n  \n  if (downloadLink) {\n    downloadLink.click();\n    return {clicked: true};\n  }\n  return {error: 'Download link not found'};\n}\n\nReplace <time> with the message timestamp (e.g., \"09:11\").\n\n\nWait and locate downloaded file:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"wait\",\"timeMs\":2000}\n\nexec command:\"ls -t ~/Downloads/line_oa_chat_*.jpg 2>/dev/null | head -1\"\n\n\n\nSend to user:\nmessage action:\"send\" target:\"<user>\" filePath:\"<path>\" message:\"Customer sent this image\"\n\nNote: Downloaded images are named line_oa_chat_YYMMDD_HHMMSS.jpg"
      },
      {
        "title": "Reply to a Message",
        "body": "⚡ Fast Path: If you already have the chat URL from a previous \"Check LINE Messages\" operation, skip steps 1-2 and go directly to step 3:\n\nbrowser action:\"navigate\" profile:\"openclaw\" targetId:\"<your_targetId>\" targetUrl:\"<chat_url>\"\n\nWait 2 seconds, then proceed to step 3.\n\nStandard Path (when you don't have the chat URL):\n\nTake a snapshot to find the chat item:\nbrowser action:\"snapshot\" profile:\"openclaw\" targetId:\"<your_targetId>\" refs:\"aria\"\n\n\nClick a chat item link in the left panel (e.g., ref:\"e68\"):\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"click\",\"ref\":\"e68\"}\n\n\nIf the input box is locked (auto-response mode), click the manual chat toggle button in the top banner to unlock it.\nTake another snapshot to find the input box and send button.\nClick the text input box (e.g., ref:\"e509\"):\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"click\",\"ref\":\"e509\"}\n\n\nType the reply message:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"type\",\"ref\":\"e509\",\"text\":\"Hello! I'm Emma, happy to help you!\"}\n\n\nClick the green Send button (e.g., ref:\"e522\") or press Enter:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"click\",\"ref\":\"e522\"}"
      },
      {
        "title": "Manage Notes",
        "body": "Each chat has a Notes panel on the right side. Notes are internal-only (not visible to customers). Max 300 characters per note."
      },
      {
        "title": "Add a note",
        "body": "Open the conversation.\nClick the + button next to the Notes heading in the right panel.\nType content in the textarea.\nClick Save."
      },
      {
        "title": "Edit a note",
        "body": "Find the note in the right panel.\nClick the pencil icon at the note's bottom-right corner.\nModify the textarea content.\nClick Save."
      },
      {
        "title": "Delete a note",
        "body": "Click the trash icon at the note's bottom-right corner.\nA confirmation dialog appears — click Delete to confirm."
      },
      {
        "title": "Manage Tags",
        "body": "Tags are shown in the right panel below the user's name. They are predefined labels for categorizing chats."
      },
      {
        "title": "Add a tag",
        "body": "Open the conversation.\nClick the Add tags link (or the pencil icon next to existing tags) in the right panel.\nThe Edit tags modal opens, showing an input field and all available tags.\nClick a tag from the \"All tags\" list to select it (it moves to the input field).\nClick Save."
      },
      {
        "title": "Remove a tag",
        "body": "Open the Edit tags modal (same as above).\nClick the × next to the tag in the input field to deselect it.\nClick Save."
      },
      {
        "title": "Switch Account",
        "body": "LINE OA Manager can manage multiple official accounts. Switch between them using the account dropdown in the top-left corner.\n\nTake a snapshot to find the account selector:\nbrowser action:\"snapshot\" profile:\"openclaw\" targetId:\"<your_targetId>\" refs:\"aria\"\n\n\nClick the account combobox (shows current account name):\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"click\",\"ref\":\"e11\"}\n\n\nWait for the dropdown menu to appear:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"wait\",\"timeMs\":1000}\n\n\nTake another snapshot to see available accounts in the listbox:\nbrowser action:\"snapshot\" profile:\"openclaw\" targetId:\"<your_targetId>\" refs:\"aria\"\n\nThe snapshot will show a list of accounts you have access to. Look for generic items in the listbox (each account will have a name and \"Administrator\" or role label).\nClick the desired account item (e.g., ref:\"e589\"):\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"click\",\"ref\":\"e589\"}\n\n\nWait for the page to load the new account's chat list:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"wait\",\"timeMs\":2000}"
      },
      {
        "title": "Notes",
        "body": "LINE periodically expires sessions; re-login required when that happens\nSession is usually active for several hours if the browser remains open"
      }
    ],
    "body": "LINE Official Account Manager\n\n⚠️ CRITICAL: Always use profile:\"openclaw\" (isolated browser) for all browser actions. Never use Chrome relay. Keep the same targetId across operations to avoid losing the tab.\n\n⚠️ CONTEXT Management:\n\nSnapshot results are large. Do NOT repeat them in thinking.\nExtract needed info and process immediately. Do not re-describe the entire snapshot.\nPreferred approach: Use snapshot refs:\"aria\" compact:true to find element refs, then act + click/type with ref.\nAvoid: Hard-coded evaluate with textContent.includes() — unreliable due to DOM timing and structure variations.\n\n⚠️ AUTO-LOGIN SCRIPTS:\n\nauto-login.mjs is a reference implementation (not directly executable by agents)\nlogin-flow.md is the agent-executable version (use this for automation)\nWhy separate? Agents use browser tool calls, not Node module imports\nConfiguration\n\nBefore first use, check if config.json exists:\n\nread file_path:\"skills/line-oa/config.json\"\n\n\n⚠️ PATH RULE: Always use workspace-relative paths starting from skills/line-oa/. Never use ../ or absolute paths starting with /.\n\nIf missing, help the user run the following command to start the setup wizard:\n\ncd skills/line-oa\nnode scripts/setup.js\n\nEnter LINE OA Manager\n\nThis is the first step for all operations below.\n\nCheck and start browser service:\n\nbrowser action:\"status\"\n\n\nIf \"running\": false, start the browser service:\n\nbrowser action:\"start\" profile:\"openclaw\"\n\n\nWait 2-3 seconds for the service to initialize.\n\nRead config to get chatUrl:\n\nread file_path:\"skills/line-oa/config.json\"\n\n\nExtract chatUrl from the JSON (e.g., https://chat.line.biz/U1234567890abcdef1234567890abcdef/).\n\nOpen browser:\n\nbrowser action:\"open\" profile:\"openclaw\" targetUrl:\"<chatUrl>\"\n\n\nCapture targetId and url from response.\n\nWait for page load:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<targetId>\" request:{\"kind\":\"wait\",\"timeMs\":2000}\n\n\nCheck current URL:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"function(){return window.location.href;}\"}\n\n\nKey result: If the current URL matches chatUrl, you have successfully logged in! Go to step 5, else proceed to troubleshooting.\n\nTroubleshooting\n\nIf you see the login page (the URL redirects to account.line.biz), use these automation scripts:\n\na. Click LINE Account button:\n\nread file_path:\"skills/line-oa/scripts/click-line-account.js\"\n\n\nExecute the script directly:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"<script_content>\"}\n\n\nWait 2 seconds.\n\nb. Click Login button:\n\nread file_path:\"skills/line-oa/scripts/click-login.js\"\n\n\nExecute the script directly:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"<script_content>\"}\n\n\nWait 3 seconds.\n\nc. Reload chatUrl:\n\nbrowser action:\"navigate\" profile:\"openclaw\" targetId:\"<targetId>\" targetUrl:\"<chatUrl>\"\n\n\nWait 2 seconds, then take snapshot to verify left-side chat list is visible.\n\nAfter Check\n\nProceed with the user's other requests.\n\nClean Up Browser Tabs:\n\na. Open a blank tab:\n\nbrowser action:\"open\" profile:\"openclaw\" targetUrl:\"about:blank\"\n\n\nb. Get all tabs:\n\nbrowser action:\"tabs\" profile:\"openclaw\"\n\n\nc. Close all tabs except the newest one (about:blank):\n\nbrowser action:\"close\" profile:\"openclaw\" targetId:\"<your_targetId>\"\n\n\nImportant: Always clean up tabs after all operations to prevent resource accumulation. The blank tab keeps the browser service running for faster next use.\n\nQuick Check (for cron / automated checks)\n\nComplete flow: login → list chats → report. Follow these steps exactly.\n\nRead config: read file_path:\"skills/line-oa/config.json\" → get chatUrl\nOpen browser: browser action:\"open\" profile:\"openclaw\" targetUrl:<chatUrl> → get targetId\nWait: browser action:\"act\" profile:\"openclaw\" targetId:<targetId> request:{\"kind\":\"wait\",\"timeMs\":3000}\nCheck URL: browser action:\"act\" profile:\"openclaw\" targetId:<targetId> request:{\"kind\":\"evaluate\",\"fn\":\"function(){return window.location.href;}\"}\nIf URL contains account.line.biz → go to Troubleshooting section below to login, then come back\nIf URL contains chat.line.biz → continue\nRun this one-liner script as-is, do not modify:\nbrowser action:\"act\" profile:\"openclaw\" targetId:<targetId> request:{\"kind\":\"evaluate\",\"fn\":\"(function(){var r=document.querySelectorAll('.list-group-item-chat');return Array.from(r).map(function(e){var h=e.querySelector('h6');var p=e.querySelector('.text-muted.small');var pt=p?p.textContent.trim():'';var ms=e.querySelectorAll('.text-muted');var t='';for(var i=0;i<ms.length;i++){var v=ms[i].textContent.trim();if(v&&v.length<20&&v!==pt)t=v;}var d=e.querySelector('span.badge.badge-pin');var u=!!d&&getComputedStyle(d).display!=='none';return{name:h?h.textContent.trim():'',time:t,lastMsg:pt.substring(0,100),unread:u};}).filter(function(i){return i.name;});})()\"}\n\n⚠️ CHECKPOINT: Did you actually call the browser tool above? If you only thought about it but didn't call it, STOP and call it NOW. You MUST see a tool result before continuing.\nReport: take the first 5 items, format each as: <name> (<time>) <lastMsg> [未讀] or [已讀] based on unread field. If empty array, say \"目前沒有聊天記錄\".\nClean up: open about:blank, list all tabs, close everything except about:blank.\nCheck LINE Messages\n\nExtracts all chats from the left-side chat list with unread status. Does NOT require clicking into each chat.\n\nPrerequisites: You must be logged in and on the chat list page (see Login section Step 5 for verification).\n\nSteps\n\nRead the script content:\n\nread file_path:\"skills/line-oa/scripts/list-chats.js\"\n\n\nRun the script via browser evaluate:\n\nPass the script content directly as the fn parameter:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"<script_content>\"}\n\n\nThe script returns a JSON array of all chat items with structure:\n\n[{ name: string, time: string, lastMsg: string, unread: boolean }]\n\nname: customer display name\ntime: timestamp (e.g., \"21:32\", \"Yesterday\", \"Friday\")\nlastMsg: last message preview (~100 chars)\nunread: true if green dot present, false otherwise\n\nGet URLs for unread chats (optional but recommended for faster follow-up):\n\nFor each unread chat, click into it to get the direct URL, then return to list:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"function(){const items=document.querySelectorAll('.list-group-item-chat');const target=Array.from(items).find(el=>{const h6=el.querySelector('h6');return h6&&h6.textContent.includes('<customer_name>');});if(target){const link=target.querySelector('a.d-flex');if(link){link.click();return {clicked:true};}return {linkNotFound:true};}return {itemNotFound:true};}\"}\n\n\nWait 500ms, then get the URL:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"function(){return window.location.href;}\"}\n\n\nNavigate back to list:\n\nbrowser action:\"navigate\" profile:\"openclaw\" targetId:\"<your_targetId>\" targetUrl:\"<chatUrl>\"\n\n\nWait 1 second before processing next unread chat.\n\nResult: Store the chat URL (e.g., https://chat.line.biz/U1234567890abcdef1234567890abcdef/chat/U803dc04f...) alongside the chat info for faster access later.\n\nHow to Report Results\nIf unread: true exists: List each unread chat with name, time, preview, and URL (if obtained)\nIf no unread: Say \"No unread messages at this time\"\nNotes\nUnread indicator: span.badge.badge-pin inside each chat list item (green dot)\nLimitation: lastMsg shows the last message in the thread, which may be an auto-response rather than the customer's original message\nChat URLs: Getting URLs requires clicking each chat. Do this for unread chats to enable faster replies later.\nTo read full messages: See \"View Specific Messages\" section below\nView Specific Messages\n\nOpens any chat (read or unread) and displays its messages. Works for viewing message history, checking context, or preparing to reply.\n\nPrerequisites: You must be logged in and on the chat list page. You should know the customer name (from list-chats.js or user request).\n\nSteps\n\nFind and click the chat item to open messages:\n\nUse evaluate to find the chat item by name (more reliable than snapshot for dynamic chat list):\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"function(){const items=document.querySelectorAll('.list-group-item-chat');const target=Array.from(items).find(el=>{const h6=el.querySelector('h6');return h6&&h6.textContent.includes('<customer_name>');});if(target){const link=target.querySelector('a.d-flex');if(link){link.click();return {clicked:true};}return {linkNotFound:true};}return {itemNotFound:true};}\"}\n\n\nReplace <customer_name> with the actual customer name.\n\nWait for messages panel to load:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"wait\",\"timeMs\":2000}\n\n\nTake a screenshot to view the messages:\n\nbrowser action:\"screenshot\" profile:\"openclaw\" targetId:\"<your_targetId>\"\n\n\nThe screenshot will show:\n\nRecent messages in the chat (right panel)\nCustomer info and tags (far right panel)\nAuto-response status banner (if active)\n\nOptional: Read recent messages programmatically\n\nIf you need structured message data instead of a screenshot, read and run this script:\n\nread file_path:\"skills/line-oa/scripts/read-messages.js\"\n\n\nExecute:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"<script_content>\"}\n\n\nReturns an array of recent messages with:\n\ntime: timestamp\ntext: message content\nisCustomer: true if from customer, false if from you\nhasImage: true if message contains an image\nNavigation Tips\n\nTo scroll to earlier messages:\n\nThe messages panel auto-scrolls to the bottom by default\nTo see earlier history, use:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"evaluate\",\"fn\":\"function(){const panel=document.querySelector('.conversation-panel, .messages-container, [class*=\\\"chat-container\\\"]');if(panel){panel.scrollTo({top:0,behavior:'smooth'});return {scrolled:true};}return {error:'Messages panel not found'};}\"}\n\nWait 1 second after scrolling, then take another screenshot\n\nCommon issues:\n\nIf messages don't load: increase wait time to 3000ms\nIf customer name has special characters: use partial match (e.g., \"John\" instead of \"John ⭐️\")\nIf click fails: the chat might not be visible in the current scroll position of the left panel\nHandling Images\n\nWhen you see images in the screenshot or hasImage: true in message data:\n\nFind and download the image:\n\nfunction(){\n  const allPhotoImgs = Array.from(document.querySelectorAll('img[alt=\"Photo\"]'));\n  const targetImg = allPhotoImgs.find(img => {\n    const parent = img.closest('.chat');\n    return parent && !parent.classList.contains('chat-reverse') && parent.innerText.includes('<time>');\n  });\n  \n  if (!targetImg) return {error: 'Image not found'};\n  \n  const parent = targetImg.closest('.chat');\n  const downloadLink = Array.from(parent.querySelectorAll('a')).find(a => a.textContent.trim() === 'Download');\n  \n  if (downloadLink) {\n    downloadLink.click();\n    return {clicked: true};\n  }\n  return {error: 'Download link not found'};\n}\n\n\nReplace <time> with the message timestamp (e.g., \"09:11\").\n\nWait and locate downloaded file:\n\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"wait\",\"timeMs\":2000}\n\nexec command:\"ls -t ~/Downloads/line_oa_chat_*.jpg 2>/dev/null | head -1\"\n\n\nSend to user:\n\nmessage action:\"send\" target:\"<user>\" filePath:\"<path>\" message:\"Customer sent this image\"\n\n\nNote: Downloaded images are named line_oa_chat_YYMMDD_HHMMSS.jpg\n\nReply to a Message\n\n⚡ Fast Path: If you already have the chat URL from a previous \"Check LINE Messages\" operation, skip steps 1-2 and go directly to step 3:\n\nbrowser action:\"navigate\" profile:\"openclaw\" targetId:\"<your_targetId>\" targetUrl:\"<chat_url>\"\n\n\nWait 2 seconds, then proceed to step 3.\n\nStandard Path (when you don't have the chat URL):\n\nTake a snapshot to find the chat item:\nbrowser action:\"snapshot\" profile:\"openclaw\" targetId:\"<your_targetId>\" refs:\"aria\"\n\nClick a chat item link in the left panel (e.g., ref:\"e68\"):\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"click\",\"ref\":\"e68\"}\n\nIf the input box is locked (auto-response mode), click the manual chat toggle button in the top banner to unlock it.\nTake another snapshot to find the input box and send button.\nClick the text input box (e.g., ref:\"e509\"):\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"click\",\"ref\":\"e509\"}\n\nType the reply message:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"type\",\"ref\":\"e509\",\"text\":\"Hello! I'm Emma, happy to help you!\"}\n\nClick the green Send button (e.g., ref:\"e522\") or press Enter:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"click\",\"ref\":\"e522\"}\n\nManage Notes\n\nEach chat has a Notes panel on the right side. Notes are internal-only (not visible to customers). Max 300 characters per note.\n\nAdd a note\nOpen the conversation.\nClick the + button next to the Notes heading in the right panel.\nType content in the textarea.\nClick Save.\nEdit a note\nFind the note in the right panel.\nClick the pencil icon at the note's bottom-right corner.\nModify the textarea content.\nClick Save.\nDelete a note\nClick the trash icon at the note's bottom-right corner.\nA confirmation dialog appears — click Delete to confirm.\nManage Tags\n\nTags are shown in the right panel below the user's name. They are predefined labels for categorizing chats.\n\nAdd a tag\nOpen the conversation.\nClick the Add tags link (or the pencil icon next to existing tags) in the right panel.\nThe Edit tags modal opens, showing an input field and all available tags.\nClick a tag from the \"All tags\" list to select it (it moves to the input field).\nClick Save.\nRemove a tag\nOpen the Edit tags modal (same as above).\nClick the × next to the tag in the input field to deselect it.\nClick Save.\nSwitch Account\n\nLINE OA Manager can manage multiple official accounts. Switch between them using the account dropdown in the top-left corner.\n\nTake a snapshot to find the account selector:\nbrowser action:\"snapshot\" profile:\"openclaw\" targetId:\"<your_targetId>\" refs:\"aria\"\n\nClick the account combobox (shows current account name):\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"click\",\"ref\":\"e11\"}\n\nWait for the dropdown menu to appear:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"wait\",\"timeMs\":1000}\n\nTake another snapshot to see available accounts in the listbox:\nbrowser action:\"snapshot\" profile:\"openclaw\" targetId:\"<your_targetId>\" refs:\"aria\"\n\nThe snapshot will show a list of accounts you have access to. Look for generic items in the listbox (each account will have a name and \"Administrator\" or role label).\nClick the desired account item (e.g., ref:\"e589\"):\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"click\",\"ref\":\"e589\"}\n\nWait for the page to load the new account's chat list:\nbrowser action:\"act\" profile:\"openclaw\" targetId:\"<your_targetId>\" request:{\"kind\":\"wait\",\"timeMs\":2000}\n\nNotes\nLINE periodically expires sessions; re-login required when that happens\nSession is usually active for several hours if the browser remains open"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/PicSeeInc/line-oa",
    "publisherUrl": "https://clawhub.ai/PicSeeInc/line-oa",
    "owner": "PicSeeInc",
    "version": "1.0.2",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/line-oa",
    "downloadUrl": "https://openagent3.xyz/downloads/line-oa",
    "agentUrl": "https://openagent3.xyz/skills/line-oa/agent",
    "manifestUrl": "https://openagent3.xyz/skills/line-oa/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/line-oa/agent.md"
  }
}