本页内容
Sommatic 文档
打开控制台

Open File/URL

用系统默认应用打开文件或 URL。

以 Markdown 查看
在以下应用中打开
输入与输出 可用 io.desktop.open 版本 1.0.0 执行方式: async

在运行 worker 的机器上,使用默认应用或指定应用打开 URL 或文件。

工作原理

  1. 解析配置。target 和 app 缺失时回退到输入 payload 中的同名键。
  2. target 为空时从 error 失败输出。
  3. 使用系统默认处理程序或 app 指定的应用打开 target。
  4. 打开命令启动后,从 out 返回 { opened: <target> }。

在工作流中

节点在工作流文件(draft_nodes[])中的写法,以及一次成功运行的 envelope。

{
  "node_id": "node-open-report",
  "label": "Open report",
  "operator_slug": "io.desktop.open",
  "operator_version": "1.0.0",
  "config": {
    "target": "https://app.example.com/reports/{{ $json.period }}"
  }
}

配置

target string 必填

URL 或文件路径

app string 可选

可选,指定应用名称

输出端口

out 默认

已为 target 启动打开命令。

数据
{
  "opened": "https://app.example.com/reports/2026-11"
}
error

缺少 target,或无法启动打开命令。

数据
{
  "error": "target is required"
}

在表达式中

后续节点可通过 $("Open File/URL").item.json.<路径> 读取此节点输出中的内容(请把 Open File/URL 换成你的节点标签)。Editor 标记工作流编辑器在 Previous Nodes 中提示的路径(输出契约);Worker 标记 worker 实际通过 out 返回的路径,依据“端口”一节所示的输出。

表达式EditorWorker
$("Open File/URL").item.json.openedstring= "https://app.example.com/reports/2026-11"目标已打开

错误

消息 端口 原因与处理
target is required error 配置和输入 payload 中都没有 target。请设置 URL 或文件的绝对路径。
<open command error message> error 主机无法启动处理程序或 app 指定的应用。请确认该应用存在于该机器上。

输入契约

target string 必填
app string 可选

输出契约

opened string 可选

目标已打开

契约(JSON Schema)

与编排器声明完全一致的定义。All 是完整的 *.definition.js;可与上方各节对照,找出文档与 schema 之间的差异。发布前可用它校验节点。

{
  "slug": "io.desktop.open",
  "name": "Open File/URL",
  "category": "io",
  "version": "1.0.0",
  "description": "Open a file or URL in default system application.",
  "capabilities": [
    "desktop",
    "open",
    "launch"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "target": {
        "type": "string",
        "description": "URL or File Path"
      },
      "app": {
        "type": "string",
        "description": "Optional specific app name"
      }
    },
    "required": [
      "target"
    ]
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "target": {
        "type": "string"
      },
      "app": {
        "type": "string"
      }
    },
    "required": [
      "target"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "opened": {
        "type": "string",
        "description": "Target opened"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Opened",
      "description": "Target opened successfully",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Failed to open target",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "async",
  "required_resources": [],
  "compatible_worker_pools": [
    "desktop-agent"
  ],
  "tags": [
    "desktop",
    "utility"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_link_loom",
    "profile": {
      "name": "Link Loom",
      "verified": true,
      "url": "https://me.veripass.com/link-loom",
      "logo_url": null
    }
  }
}

执行

执行方式
async
有状态
否
能力
desktopopenlaunch
标签
desktoputility

说明与限制

  • out 仅表示已启动打开命令,并不代表应用已完成加载目标。根据平台处理程序的不同,不存在的文件路径也可能到达 out。
  • 目标在运行编排器 worker 的主机上打开,而不是在用户设备上。

已对照编排器代码核实 · 31e874b · 2026-11-26

安装智能体工具

为你的编程智能体接入 Sommatic AI 官方文档:技能包、文档 MCP 服务器与 Markdown 页面,无需再抓取网页。

安装 Sommatic AI CLI,并为检测到的智能体配置合适的插件。

npx @sommatic/cli agent setup
智能体如何读取本文档