diff --git a/external_plugins/orbtile-start/.zcode-plugin/plugin.json b/external_plugins/orbtile-start/.zcode-plugin/plugin.json new file mode 100644 index 00000000..501de356 --- /dev/null +++ b/external_plugins/orbtile-start/.zcode-plugin/plugin.json @@ -0,0 +1,22 @@ +{ + "name": "orbtile-start", + "description": "Checks whether the Orbtile app is installed and following your ZCode tasks, and tells you the one next step if not. Read-only; sends nothing.", + "description_i18n": { + "en": "Checks whether the Orbtile app is installed and following your ZCode tasks, and tells you the one next step if not. Read-only; sends nothing.", + "zh-CN": "检查 Orbtile 应用是否已安装并在跟踪你的 ZCode 任务;如果没有,告诉你下一步该做什么。只读取本机文件,不发送任何数据。" + }, + "version": "0.1.5", + "author": { + "name": "Orbtile Team", + "url": "https://orbtile.com" + }, + "homepage": "https://orbtile.com", + "repository": "https://github.com/Orbtile/orbtile-plugins", + "license": "MIT", + "keywords": [ + "orbtile", + "keypad", + "status", + "setup" + ] +} diff --git a/external_plugins/orbtile-start/LICENSE b/external_plugins/orbtile-start/LICENSE new file mode 100644 index 00000000..e48e399e --- /dev/null +++ b/external_plugins/orbtile-start/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Orbtile + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/external_plugins/orbtile-start/README.md b/external_plugins/orbtile-start/README.md new file mode 100644 index 00000000..016924be --- /dev/null +++ b/external_plugins/orbtile-start/README.md @@ -0,0 +1,27 @@ +# orbtile-start for ZCode + +[中文](README_CN.md) + +A small starter for [Orbtile](https://orbtile.com), the app for macOS and Windows that shows the live state of your coding agents on a keypad. + +## What it does + +- The `orbtile-status` skill checks this computer: is the Orbtile app installed, is Orbtile's ZCode approval hook on, and is the app running. It tells you the one next step, if any. Ask ZCode to "check my Orbtile setup" or "set up Orbtile for ZCode". +- Once the Orbtile app is installed, there is nothing more to set up: Orbtile follows ZCode tasks from their files. You can then remove this plugin. + +## What it runs, reads and sends + +- Commands: the skill runs one script, `scripts/orbtile.sh` (macOS and Linux) or `scripts/orbtile.ps1` (Windows), only when you ask. +- Files read: `~/.zcode/cli/config.json` and the usual app folders (`/Applications`, `~/Applications`, `%LOCALAPPDATA%\Orbtile`). On macOS it checks whether a process named Orbtile is running. +- Files written: none. +- Network: none. It sends nothing anywhere and fetches nothing. +- Hooks, MCP servers, agents: none. +- It changes no files or settings. It is not Orbtile: the app sets up its own ZCode hook. + +## Requirements + +macOS or Windows, where the Orbtile app runs. On macOS it uses `sh`; on Windows it uses PowerShell. On other systems the check says that Orbtile does not run there. + +## License + +MIT. Made by Orbtile Team. No third-party code or assets. diff --git a/external_plugins/orbtile-start/README_CN.md b/external_plugins/orbtile-start/README_CN.md new file mode 100644 index 00000000..b0385ba9 --- /dev/null +++ b/external_plugins/orbtile-start/README_CN.md @@ -0,0 +1,27 @@ +# orbtile-start(ZCode 版) + +[English](README.md) + +[Orbtile](https://orbtile.com) 的一个小型入门插件。Orbtile 是一款 macOS 和 Windows 应用,在小键盘上实时显示你的编程智能体的状态。 + +## 功能 + +- `orbtile-status` 技能会检查本机:Orbtile 应用是否已安装,Orbtile 的 ZCode 审批钩子是否已开启,应用是否正在运行。如有需要,它会告诉你下一步该做什么。你可以让 ZCode“检查我的 Orbtile 设置”或“为 ZCode 设置 Orbtile”。 +- 安装 Orbtile 应用后无需其他设置:Orbtile 会通过 ZCode 的任务文件跟踪任务。之后你可以移除本插件。 + +## 运行、读取和发送的内容 + +- 命令:只有在你提出要求时,技能才会运行一个脚本:`scripts/orbtile.sh`(macOS 和 Linux)或 `scripts/orbtile.ps1`(Windows)。 +- 读取的文件:`~/.zcode/cli/config.json` 以及常见的应用目录(`/Applications`、`~/Applications`、`%LOCALAPPDATA%\Orbtile`)。在 macOS 上,它会检查是否有名为 Orbtile 的进程在运行。 +- 写入的文件:无。 +- 网络:无。不发送也不获取任何数据。 +- 钩子、MCP 服务器、智能体:无。 +- 它不会修改任何文件或设置。它不是 Orbtile 本身:Orbtile 应用会自行设置它的 ZCode 钩子。 + +## 运行要求 + +macOS 或 Windows(Orbtile 应用支持的系统)。在 macOS 上使用 `sh`,在 Windows 上使用 PowerShell。在其他系统上,检查结果会说明 Orbtile 不支持该系统。 + +## 许可证 + +MIT。由 Orbtile Team 制作。不包含第三方代码或素材。 diff --git a/external_plugins/orbtile-start/skills/orbtile-status/SKILL.md b/external_plugins/orbtile-start/skills/orbtile-status/SKILL.md new file mode 100644 index 00000000..e2cee359 --- /dev/null +++ b/external_plugins/orbtile-start/skills/orbtile-status/SKILL.md @@ -0,0 +1,22 @@ +--- +name: orbtile-status +description: Check whether the Orbtile app is installed and following ZCode, and whether Orbtile's ZCode approval hook is on. Use when the user asks to set up Orbtile, asks about Orbtile or its keypad, asks if the Orbtile hook is working, or asks why their ZCode tasks do not show in Orbtile. +--- + +# Orbtile setup check + +Run this read-only check from this skill's folder and report its result. + +On macOS and Linux: + +``` +sh scripts/orbtile.sh zcode status +``` + +On Windows: + +``` +powershell -NoProfile -ExecutionPolicy Bypass -File scripts\orbtile.ps1 zcode status +``` + +Tell the user the result in a few short lines, using only what the check says. If it lists a next step, give that step and nothing else. The check reads local files only. Do not change any files or settings yourself: the Orbtile app sets up its own ZCode hook. diff --git a/external_plugins/orbtile-start/skills/orbtile-status/scripts/orbtile.ps1 b/external_plugins/orbtile-start/skills/orbtile-status/scripts/orbtile.ps1 new file mode 100644 index 00000000..efae3814 --- /dev/null +++ b/external_plugins/orbtile-start/skills/orbtile-status/scripts/orbtile.ps1 @@ -0,0 +1,91 @@ +# Orbtile starter script for Windows shells without sh (Codex runs hooks with cmd.exe on Windows). +# Source of truth: shared/orbtile.ps1. The Codex plugin carries an identical copy (tests check this). +# Same behaviour and wording as shared/orbtile.sh for Codex, Antigravity and ZCode on Windows. +# +# orbtile.ps1 session-start Session-start hook: at most one line a day pointing to the Orbtile app, +# nothing once the Orbtile app is installed or its hooks are set up. +# orbtile.ps1 status Plain-text setup check. +# : codex | antigravity | zcode (all followed by the app without hooks) +# +# Reads local files only. Sends nothing anywhere. Always exits 0 so it can never block a session. + +param([string]$Agent = '', [string]$Command = '') +$ErrorActionPreference = 'SilentlyContinue' +$downloadUrl = 'https://orbtile.com/download' + +if (($Agent -ne 'codex' -and $Agent -ne 'antigravity' -and $Agent -ne 'zcode') -or ($Command -ne 'session-start' -and $Command -ne 'status')) { + [Console]::Error.WriteLine('usage: orbtile.ps1 codex|antigravity|zcode session-start|status') + exit 0 +} + +if ($Agent -eq 'codex') { + $agentName = 'Codex' + $codexHome = if ($env:CODEX_HOME) { $env:CODEX_HOME } else { Join-Path $env:USERPROFILE '.codex' } + $configFile = Join-Path $codexHome 'hooks.json' + $pitch = 'Orbtile shows your Codex sessions live on a keypad' + $checkHint = 'ask Codex to check your Orbtile setup' + $doneLine = 'Next step: none. Orbtile is set up; this starter plugin stays quiet and can be removed with: codex plugin remove orbtile-start@orbtile-public' + $hooksOptional = 'Orbtile reads Codex sessions without them' +} elseif ($Agent -eq 'zcode') { + $agentName = 'ZCode' + $configFile = Join-Path $env:USERPROFILE '.zcode\cli\config.json' + $pitch = 'Orbtile shows your ZCode tasks live on a keypad' + $checkHint = 'ask ZCode to check your Orbtile setup' + $doneLine = 'Next step: none. Orbtile is set up. You can remove the orbtile-start plugin from ZCode.' + $hooksOptional = 'Orbtile follows ZCode tasks from their files without them' +} else { + $agentName = 'Antigravity' + $configFile = Join-Path $env:USERPROFILE '.gemini\config\hooks.json' + $pitch = 'Orbtile shows your Antigravity sessions live on a keypad' + $checkHint = 'ask Antigravity to check your Orbtile setup' + $doneLine = 'Next step: none. Orbtile is set up. You can remove the orbtile-start plugin from Antigravity.' + $hooksOptional = 'Orbtile reads Antigravity sessions without them' +} + +# Orbtile's hooks for this agent: the Windows app's helper (--orbtile-agent), or the Mac app's script name. +function Get-HookMarker { + if (-not (Test-Path -LiteralPath $configFile)) { return '' } + $text = Get-Content -LiteralPath $configFile -Raw + if ($text -and $text -match "orbtile(-[a-z]+)?-$Agent-hook|--orbtile-agent") { return 'Orbtile hooks' } + return '' +} + +# The Windows app keeps its data in %LOCALAPPDATA%\Orbtile. +function Get-AppPath { + if (-not $env:LOCALAPPDATA) { return '' } + $p = Join-Path $env:LOCALAPPDATA 'Orbtile' + if (Test-Path -LiteralPath $p -PathType Container) { return $p } + return '' +} + +if ($Command -eq 'session-start') { + # Orbtile follows Codex and Antigravity without hooks: an installed app is a set-up app. + if ((Get-HookMarker) -or (Get-AppPath)) { exit 0 } + # Once a day at most. Without a writable state folder it still shows (the hook runs once per new session). + $today = [string][math]::Floor([DateTimeOffset]::UtcNow.ToUnixTimeSeconds() / 86400) + if ($env:PLUGIN_DATA) { + $stateFile = Join-Path $env:PLUGIN_DATA 'last-shown-day' + $last = Get-Content -LiteralPath $stateFile -TotalCount 1 + if ($last -eq $today) { exit 0 } + New-Item -ItemType Directory -Force -Path $env:PLUGIN_DATA | Out-Null + Set-Content -LiteralPath $stateFile -Value $today -Encoding ascii + } + $msg = "${pitch}: $downloadUrl ($checkHint)" + [Console]::Out.WriteLine('{"systemMessage":"' + $msg + '"}') + exit 0 +} + +# status +$marker = Get-HookMarker +$app = Get-AppPath +[Console]::Out.WriteLine("Orbtile setup check for $agentName") +if ($app) { [Console]::Out.WriteLine("- Orbtile app: found at $app") } else { [Console]::Out.WriteLine('- Orbtile app: not found on this computer') } +if ($marker) { [Console]::Out.WriteLine("- Orbtile's $agentName hooks: on ($marker in $configFile)") } +else { [Console]::Out.WriteLine("- Orbtile's $agentName hooks: off (optional: $hooksOptional)") } +if ($marker -or $app) { + if ($marker -and $Agent -eq 'codex') { [Console]::Out.WriteLine("- Note: Codex runs Orbtile's hooks only after you trust them once in /hooks (Settings > Hooks in the Codex app).") } + [Console]::Out.WriteLine($doneLine) +} else { + [Console]::Out.WriteLine("Next step: download Orbtile from $downloadUrl") +} +exit 0 diff --git a/external_plugins/orbtile-start/skills/orbtile-status/scripts/orbtile.sh b/external_plugins/orbtile-start/skills/orbtile-status/scripts/orbtile.sh new file mode 100755 index 00000000..2f4d4efd --- /dev/null +++ b/external_plugins/orbtile-start/skills/orbtile-status/scripts/orbtile.sh @@ -0,0 +1,187 @@ +#!/bin/sh +# Orbtile starter script, shared by the agent plugins in this repo. +# Source of truth: shared/orbtile.sh. Each plugin carries an identical copy (tests check this). +# +# orbtile.sh session-start Session-start hook: at most one line a day pointing to the Orbtile app, +# nothing once Orbtile's own integration for is set up. +# orbtile.sh status Plain-text setup check. +# : claude | codex | antigravity | zcode +# +# Reads local files only. Sends nothing anywhere. Always exits 0 so it can never block a session. + +agent="${1:-}" +command="${2:-}" +download_url="https://orbtile.com/download" + +# The Orbtile app runs on macOS and Windows. Elsewhere (Linux, WSL) the starter never points to a download. +case "${ORBTILE_START_OS:-$(uname -s 2>/dev/null)}" in # ORBTILE_START_OS: override for tests only + Darwin) platform=mac ;; + MINGW*|MSYS*|CYGWIN*|Windows*) platform=windows ;; + *) platform=other ;; +esac + +case "$agent" in + claude) + agent_name="Claude Code" + pitch="Orbtile shows your Claude Code sessions live on a keypad and lets you answer them from the keys" + config_file="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/settings.json" + state_dir="${CLAUDE_PLUGIN_DATA:-}" + check_hint="run /orbtile to check setup" + done_line="Next step: none. Orbtile is set up; this starter plugin stays quiet and can be removed with: /plugin uninstall orbtile-start@orbtile-public" + hooks_optional="" + ;; + codex) + agent_name="Codex" + pitch="Orbtile shows your Codex sessions live on a keypad" + config_file="${CODEX_HOME:-$HOME/.codex}/hooks.json" + state_dir="${PLUGIN_DATA:-}" + check_hint="ask Codex to check your Orbtile setup" + done_line="Next step: none. Orbtile is set up; this starter plugin stays quiet and can be removed with: codex plugin remove orbtile-start@orbtile-public" + hooks_optional="Orbtile reads Codex sessions without them" # Codex is a zero-install adapter in the app + ;; + antigravity) + agent_name="Antigravity" + pitch="Orbtile shows your Antigravity sessions live on a keypad" + config_file="$HOME/.gemini/config/hooks.json" + state_dir="" + check_hint="ask Antigravity to check your Orbtile setup" + done_line="Next step: none. Orbtile is set up. You can remove the orbtile-start plugin from Antigravity." + hooks_optional="Orbtile reads Antigravity sessions without them" # zero-install adapter in the app + ;; + zcode) + agent_name="ZCode" + pitch="Orbtile shows your ZCode tasks live on a keypad" + config_file="$HOME/.zcode/cli/config.json" + state_dir="${ZCODE_PLUGIN_DATA:-}" + check_hint="ask ZCode to check your Orbtile setup" + done_line="Next step: none. Orbtile is set up. You can remove the orbtile-start plugin from ZCode." + hooks_optional="Orbtile follows ZCode tasks from their files without them" # read-only adapter; one optional approval hook + ;; + *) + echo "usage: orbtile.sh claude|codex|antigravity|zcode session-start|status" >&2 + exit 0 + ;; +esac + +# Config text on one line ("" when the file is missing or unreadable). +config_text() { + [ -r "$config_file" ] && tr -d '\r\n' < "$config_file" 2>/dev/null +} + +# Which Orbtile integration is set up for this agent, or nothing. +hook_marker() { + text=$(config_text) + [ -n "$text" ] || return 0 + case "$agent" in + claude) + # Mac app: enabledPlugins "orbtile@orbtile" (or the Enterprise / Sandbox ids) is true, or a + # marketplace path points at an Orbtile claude-plugin folder (Mac, or a remote host the app set up). + id=$(printf '%s' "$text" | grep -Eo '"(orbtile@orbtile|orbtile-enterprise@orbtile-enterprise|orbtile-sandbox@orbtile-sandbox)"[[:space:]]*:[[:space:]]*true' | head -n 1 | cut -d '"' -f 2) + if [ -n "$id" ]; then echo "plugin $id"; return 0; fi + if printf '%s' "$text" | grep -Eq '"path"[[:space:]]*:[[:space:]]*"[^"]*[Oo]rbtile[^"]*claude-plugin[/\\]*"'; then + echo "Orbtile plugin folder"; return 0 + fi + # Windows app: its hook commands carry --orbtile-claude-hook. + if printf '%s' "$text" | grep -q -- '--orbtile-claude-hook'; then echo "Orbtile hooks"; return 0; fi + ;; + codex) + # Mac app and remote hosts: orbtile-codex-hook; Windows app: --orbtile-agent. + if printf '%s' "$text" | grep -Eq -- 'orbtile(-[a-z]+)?-codex-hook|--orbtile-agent'; then + echo "Orbtile hooks"; return 0 + fi + ;; + antigravity) + # Mac app: orbtile-antigravity-hook; Windows app: --orbtile-agent. + if printf '%s' "$text" | grep -Eq -- 'orbtile(-[a-z]+)?-antigravity-hook|--orbtile-agent'; then + echo "Orbtile hooks"; return 0 + fi + ;; + zcode) + # The app's one approval hook. Mac app and remote hosts: orbtile-zcode-hook; Windows app: --orbtile-agent. + if printf '%s' "$text" | grep -Eq -- 'orbtile(-[a-z]+)?-zcode-hook|--orbtile-agent'; then + echo "Orbtile hooks"; return 0 + fi + ;; + esac +} + +# Path of an installed Orbtile app, or nothing. +app_path() { + apps="${ORBTILE_START_APPS_DIR:-/Applications}" # override for tests only + for p in "$apps/Orbtile.app" "$HOME/Applications/Orbtile.app" \ + "$apps/Orbtile Enterprise.app" "$HOME/Applications/Orbtile Enterprise.app"; do + if [ -d "$p" ]; then echo "$p"; return 0; fi + done + # Windows (Git Bash): the app keeps its data in %LOCALAPPDATA%\Orbtile. + if [ -n "${LOCALAPPDATA:-}" ] && [ -d "$LOCALAPPDATA/Orbtile" ]; then echo "$LOCALAPPDATA/Orbtile"; return 0; fi + # Mac app run from another folder. + if app_running; then echo "running"; return 0; fi +} + +# Mac only: is Orbtile running? (false elsewhere) +app_running() { + [ "$platform" = mac ] || return 1 + [ -z "${ORBTILE_START_APPS_DIR:-}" ] || return 1 # tests describe the installed apps themselves + pgrep -x Orbtile >/dev/null 2>&1 || pgrep -x "Orbtile Enterprise" >/dev/null 2>&1 +} + +session_start() { + [ "$platform" != other ] || return 0 + # Codex and ZCode can load Claude-format plugins; they then set PLUGIN_ROOT or ZCODE_PLUGIN_ROOT, which Claude Code + # does not. The Claude Code line stays out of their sessions. + if [ "$agent" = claude ] && { [ -n "${PLUGIN_ROOT:-}" ] || [ -n "${ZCODE_PLUGIN_ROOT:-}" ]; }; then return 0; fi + [ -z "$(hook_marker)" ] || return 0 + # Agents the app follows without hooks: an installed app is a set-up app. + if [ -n "$hooks_optional" ] && [ -n "$(app_path)" ]; then return 0; fi + # Once a day at most. Without a writable state folder it still shows (the hook runs once per new session). + today=$(( $(date +%s) / 86400 )) + if [ -n "$state_dir" ]; then + if [ "$(cat "$state_dir/last-shown-day" 2>/dev/null)" = "$today" ]; then return 0; fi + mkdir -p "$state_dir" 2>/dev/null && printf '%s\n' "$today" > "$state_dir/last-shown-day" 2>/dev/null + fi + if [ -n "$(app_path)" ]; then + msg="Orbtile is installed but not connected to $agent_name yet. Open Orbtile to connect it ($check_hint)." + else + msg="$pitch: $download_url ($check_hint)" + fi + printf '{"systemMessage":"%s"}\n' "$msg" +} + +status() { + marker=$(hook_marker) + app=$(app_path) + echo "Orbtile setup check for $agent_name" + case "$app" in + "") if [ "$platform" = other ]; then echo "- Orbtile app: runs on macOS and Windows, not on this system" + else echo "- Orbtile app: not found on this computer"; fi ;; + running) echo "- Orbtile app: found (running)" ;; + *) echo "- Orbtile app: found at $app" ;; + esac + if [ -n "$hooks_optional" ]; then + if [ -n "$marker" ]; then echo "- Orbtile's $agent_name hooks: on ($marker in $config_file)" + else echo "- Orbtile's $agent_name hooks: off (optional: $hooks_optional)"; fi + elif [ -n "$marker" ]; then echo "- $agent_name integration: on ($marker in $config_file)" + else echo "- $agent_name integration: off (nothing from Orbtile in $config_file)"; fi + if [ -n "$app" ] && [ "$platform" = mac ]; then + if app_running; then echo "- Orbtile running: yes"; else echo "- Orbtile running: no"; fi + fi + if [ -n "$marker" ] || { [ -n "$hooks_optional" ] && [ -n "$app" ]; }; then + if [ "$agent" = "codex" ] && [ -n "$marker" ]; then + echo "- Note: Codex runs Orbtile's hooks only after you trust them once in /hooks (Settings > Hooks in the Codex app)." + fi + echo "$done_line" + elif [ -n "$app" ]; then + echo "Next step: open Orbtile and connect $agent_name in its settings." + elif [ "$platform" = other ]; then + echo "Next step: none here. Orbtile runs on macOS and Windows." + else + echo "Next step: download Orbtile from $download_url" + fi +} + +case "$command" in + session-start) session_start ;; + status) status ;; + *) echo "usage: orbtile.sh claude|codex|antigravity|zcode session-start|status" >&2 ;; +esac +exit 0 diff --git a/marketplace.json b/marketplace.json index c1a9a6ee..91f3da59 100644 --- a/marketplace.json +++ b/marketplace.json @@ -1531,6 +1531,30 @@ "repository": "https://github.com/geer1895/rfauto", "license": "GPL-3.0-only", "icon": "https://cdn-zcode.z.ai/zcode/official-plugin/assets/rfauto/icon.png" + }, + { + "name": "orbtile-start", + "source": "./external_plugins/orbtile-start", + "description": "Checks whether the Orbtile app is installed and following your ZCode tasks, and tells you the one next step if not. Read-only; sends nothing.", + "description_i18n": { + "en": "Checks whether the Orbtile app is installed and following your ZCode tasks, and tells you the one next step if not. Read-only; sends nothing.", + "zh-CN": "检查 Orbtile 应用是否已安装并在跟踪你的 ZCode 任务;如果没有,告诉你下一步该做什么。只读取本机文件,不发送任何数据。" + }, + "version": "0.1.5", + "author": { + "name": "Orbtile Team", + "url": "https://orbtile.com" + }, + "category": "developer-tools", + "keywords": [ + "orbtile", + "keypad", + "status", + "setup" + ], + "homepage": "https://orbtile.com", + "repository": "https://github.com/Orbtile/orbtile-plugins", + "license": "MIT" } ] } \ No newline at end of file