那份值是设备上线时取的一次性快照,会随连接时长过期,放在 list 里容易被当成实时状态。 health 改为纯按需查询(action=health),list 只留设备身份与在线信息。
510 lines
31 KiB
JSON
510 lines
31 KiB
JSON
[
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "copy_path",
|
||
"description": "Copies a file or directory, preserving the original; directories are copied recursively. More efficient than reading then writing contents. Returns confirmation with the destination path.\n\nImport past work: source_path accepts '@<session-id>/<rel>' to copy from your OWN past session (find the id with recall, browse with list_directory). destination_path never accepts '@' - past stays read-only, imports land in the current session directory. The destination must not exist yet; nothing is overwritten.\n\nAfter import the file is fully local: read_file (images included), terminal, mint_public_link all work on it. You can peek a past text file without importing (read_file takes the same '@' form); importing is what makes it workable (terminal, edit_file, images).\n\nLimits: max 200 MB / 200 files per call; symlinks refused.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"source_path",
|
||
"destination_path"
|
||
],
|
||
"properties": {
|
||
"source_path": {
|
||
"type": "string",
|
||
"description": "File or directory to copy, relative to the session working directory (absolute paths inside it accepted). '@<session-id>/<rel>' imports from a same-user past session."
|
||
},
|
||
"destination_path": {
|
||
"type": "string",
|
||
"description": "Where to place the copy inside the CURRENT session directory (relative, or absolute inside it). '@' paths are rejected here. Must not already exist."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "db",
|
||
"description": "Execute operations on the session's SQLite database (data.db in the session working directory). The database file is isolated per session and auto-created on first use. For inserting rows (especially batches), prefer op=insert which avoids writing SQL by hand; use exec/query for DDL, updates, deletes and complex SQL.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"op"
|
||
],
|
||
"properties": {
|
||
"op": {
|
||
"type": "string",
|
||
"enum": [
|
||
"exec",
|
||
"query",
|
||
"insert",
|
||
"tables",
|
||
"schema"
|
||
],
|
||
"description": "Operation type:\n- exec: run a write statement (CREATE / UPDATE / DELETE / ALTER / DROP), in a transaction\n- query: run a read-only statement (SELECT / WITH), returns an array of rows\n- insert: insert one or more rows from row objects (structured, no SQL needed, one transaction)\n- tables: list all tables with row counts\n- schema: show column definitions for a table"
|
||
},
|
||
"sql": {
|
||
"type": "string",
|
||
"description": "A single SQL statement. Required when op is exec or query. Use ? placeholders for parameterized queries to avoid SQL injection; multiple statements are rejected."
|
||
},
|
||
"params": {
|
||
"type": "array",
|
||
"description": "Values bound to the ? placeholders in order. Used by op=exec/query only. Booleans are stored as 0/1.",
|
||
"items": {}
|
||
},
|
||
"table": {
|
||
"type": "string",
|
||
"description": "Table name. Required for insert/schema."
|
||
},
|
||
"rows": {
|
||
"type": "array",
|
||
"description": "Array of row objects for op=insert. Each object maps column names to values; all objects must have the same keys.",
|
||
"items": {
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "edit_file",
|
||
"description": "This is a tool for applying edits to an existing file.\n\nBefore using this tool, use the `read_file` tool to understand the file's contents and context.\nTo create a new file or overwrite an existing one with completely new contents, use the `write_file` tool instead.\n\nWhen copying text from `read_file` output into `old_text` or `new_text`, strip the line-number prefix and the tab after it, and keep the original indentation exactly.\n\nMatching rules:\n- `old_text` is first matched exactly. If there is no exact match, a fuzzy match tolerating minor whitespace and formatting differences is attempted.\n- If `old_text` matches more than one location (overlapping matches count as separate locations), the edit fails. Include enough surrounding context to make it unique; avoid very short or repetitive `old_text`.\n- If no match is found at all, the edit fails. For very large files the fuzzy stage degrades to per-line whitespace-insensitive exact matching; the error message says so — do not retry the same text, locate with `read_file` by line numbers or use `terminal` with sed.\n\nTo delete whole lines, put the exact line(s) in `old_text` and set `new_text` to an empty string — matched whole lines are removed cleanly together with their line endings (a trailing newline in `old_text` makes no difference).\n\nEdits are applied in order. If one edit fails, the edits before it are already written to disk and the file has changed: the error message tells you how many were applied. You must call `read_file` again before retrying; do not reuse the previous `old_text` values.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"path",
|
||
"edits"
|
||
],
|
||
"properties": {
|
||
"path": {
|
||
"type": "string",
|
||
"description": "Path of the file to edit, relative to the session working directory. Absolute paths are also accepted. '@' paths are rejected here — copy a past file in with copy_path first."
|
||
},
|
||
"edits": {
|
||
"type": "array",
|
||
"description": "List of edit operations to apply sequentially. Each edit finds `old_text` in the file and replaces it with `new_text`. If any edit fails, the edits before it remain applied.",
|
||
"items": {
|
||
"type": "object",
|
||
"required": [
|
||
"old_text",
|
||
"new_text"
|
||
],
|
||
"properties": {
|
||
"old_text": {
|
||
"type": "string",
|
||
"description": "The text to find in the file. Matched exactly first, then fuzzily (whitespace / minor formatting differences tolerated). Provide enough context to make the match unique; short or repeated snippets are reported as ambiguous. A trailing newline, if present, is stripped before matching. For whole-line deletion, put the exact line(s) in old_text and pass an empty new_text."
|
||
},
|
||
"new_text": {
|
||
"type": "string",
|
||
"description": "The replacement text. Use an empty string together with a trailing-newline-free `old_text` to delete a whole line."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "fetch",
|
||
"description": "Fetches a URL and returns its content as Markdown. Only http and https are supported; if the scheme is omitted, https is assumed.\n\nHTML pages are converted to Markdown. JSON, XML, plain text, and Markdown responses are returned as-is. Binary responses are not returned — only their HTTP status, content-type, and size.\n\nThe response always starts with a line `HTTP <status>`, followed by the body. Check the status line: a non-2xx status means the fetch did not succeed, even if body content is present.\n\nReturned text is capped per call (default 12000 chars; a call may raise it with `max_chars`, hard cap 64000). When truncated, the tail hint gives the total length and the `offset` to continue from — re-call with that `offset` to page through WITHOUT re-downloading. Most pages fit in the first window; only page further when you actually need more.\n\nTargets that resolve to private/loopback addresses are refused (SSRF guard). Redirects are followed up to 5 hops, each hop checked.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"url"
|
||
],
|
||
"properties": {
|
||
"url": {
|
||
"type": "string",
|
||
"description": "The URL to fetch. Must be http or https; if no scheme is given, https is assumed."
|
||
},
|
||
"offset": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"default": 0,
|
||
"description": "Character offset into the converted page body, for continuing a truncated fetch. Use the offset value given in the previous truncation hint. Requires no re-download."
|
||
},
|
||
"max_chars": {
|
||
"type": "integer",
|
||
"minimum": 1,
|
||
"description": "Max characters to return for this call. Optional; raise only when the default window clearly cut off content you need. Values above the hard cap are clamped."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "lab",
|
||
"description": "Unified entry point for calling any available tool by name.\n\nCall a tool:\n lab(tool: \"<name>\", args: {<arguments>})\n\nThe target tool's arguments go inside `args` as a JSON object. Omit `args` for tools that take no arguments.\n\nDiscovering tools:\n lab(tool: \"help\") → list all tools with a one-line description each\n lab(tool: \"help\", args: {tool: \"<name>\"}) → full description and parameter schema of <name>\n\nAn unknown tool name also returns the list of available tools.\nNested lab calls are rejected; inner tool errors surface unchanged.\n\nCalling a tool directly and calling it through lab are equivalent. When the tool you need is already in your tool list, call it directly. Use lab to discover or reach tools that are not in the current list.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"tool"
|
||
],
|
||
"properties": {
|
||
"tool": {
|
||
"type": "string",
|
||
"description": "Name of the tool to call, or \"help\"."
|
||
},
|
||
"args": {
|
||
"type": "object",
|
||
"description": "Arguments for the target tool, matching its own schema (look it up with lab(tool: \"help\", args: {tool: \"<name>\"}) if unsure). Omit for tools that take no arguments."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "list_directory",
|
||
"description": "Lists the entries directly inside one directory (one level, like `ls`): folders and files, sorted; hidden entries (starting with '.') omitted; max 200 per call, go deeper with a deeper path.\n\npath is relative to the session working directory (absolute paths inside it accepted); empty/omitted lists the current task directory.\n\nPast sessions: '@<session-id>/<rel>' lists a PAST session's own directory, same user only (read-only view). Find the id with recall op=search. In '@' mode entries print as complete '@<session-id>/...' paths, ready to feed copy_path.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"properties": {
|
||
"path": {
|
||
"type": "string",
|
||
"description": "Directory to list, relative to the session working directory. Absolute paths accepted. '@<session-id>/<rel>' lists that past session's directory (same user only; id from recall)."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "mint_public_link",
|
||
"description": "Create a short-lived (default 30 minutes, server-configurable 1min-24h), publicly reachable URL for a local file, so an external service that cannot authenticate can download it. The link works repeatedly until it expires; re-mint for a fresh one.\nUse this when another tool or API needs to fetch a local file by URL. Returns the URL as plain text on a single line.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"path"
|
||
],
|
||
"properties": {
|
||
"path": {
|
||
"type": "string",
|
||
"description": "Path of the file to publish, relative to the session working directory. Absolute paths inside the session working directory are also accepted."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "profile",
|
||
"description": "Maintain the current user's profile — stable facts that persist across conversations and get injected into the context of NEW sessions (the current session's injected copy is frozen). Ops: list (read the live profile), set (honorific or industry, single short value), add (append preference tags), remove (delete exact preference tags). Rules: only record what the user has clearly stated or asked to be remembered (form of address, domain, stable output/work preferences); never guess personality, never store one-time task parameters; brief tags beat essays. Preference is a 、-separated tag list (each tag ≤15 chars, ≤24 tags, ≤300 chars total; overflow is rejected — consolidate or remove first). When unsure what is already recorded, op=list returns live state — trust it over memory.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"op"
|
||
],
|
||
"properties": {
|
||
"op": {
|
||
"type": "string",
|
||
"enum": [
|
||
"list",
|
||
"set",
|
||
"add",
|
||
"remove"
|
||
],
|
||
"description": "list = read live profile; set = single-value honorific/industry; add/remove = preference tags."
|
||
},
|
||
"honorific": {
|
||
"type": "string",
|
||
"description": "op=set: how to address the user (≤20 chars, e.g. 王工). Pass empty string to clear. Exactly one of honorific/industry per call."
|
||
},
|
||
"industry": {
|
||
"type": "string",
|
||
"description": "op=set: the user's industry/domain (≤20 chars, e.g. 金融). Pass empty string to clear."
|
||
},
|
||
"tags": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "op=add/remove: preference tag list, e.g. [\"偏好简洁回复\", \"图表中文标注\"]. Matching is exact text."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "read_file",
|
||
"description": "Reads the content of a file.\n\nText files: each returned line is prefixed with a line number right-aligned in a 6-character field, followed by a tab, then the line content.\n\nCross-session peek: `path` accepts '@<session-id>/<rel>' to read a text file from your OWN past session, read-only (find the id with recall op=search, browse with list_directory). It is a look, not an import: nothing lands in your session directory, so `terminal`, grep and `edit_file` cannot see it, and past images are refused. When you need to work with a file or view a past image, `copy_path` it first (its `source_path` takes the same '@' form). '@' is never accepted by `write_file` or `edit_file`.\n\nLarge text files (roughly over 16 KB) are not returned in full: you get an outline listing top-level symbols (or Markdown headings) with line numbers instead. The outline IS a successful response — do NOT retry the same call without a line range; use the outline line numbers with `start_line` / `end_line` to read specific sections. If no outline can be extracted, a first-1KB excerpt is returned instead. Supplying `start_line` or `end_line` disables outline mode.\n\nImage files (PNG, JPEG, WebP, GIF, BMP, TIFF): the receipt is a single JSON object, not prose — read its fields instead of interpreting the text. Success shape: {\"ok\":true,\"tool\":\"read_file\",\"kind\":\"image\",\"path\":\"...\",\"image_attached\":true,\"width\":1080,\"height\":1920,\"format\":\"jpeg\",\"bytes_in\":3550000,\"bytes_out\":210000,\"resized\":true,\"source_width\":4000,\"source_height\":7111}. `width`/`height` are the delivered pixel size; `source_width`/`source_height` appear only when the image was downscaled. `image_attached:true` means the server produced the image and it will arrive as an image block in the separate user message that immediately follows the batch of tool results; that message labels each image `[图片 N] read_file <path> <w>×<h>` and asks you to describe it before continuing. The tool result itself never carries pixels. Refusal or failure shape: {\"ok\":false,\"kind\":\"image\",\"path\":\"...\",\"image_attached\":false,\"reason\":\"...\",\"retryable\":false,\"hint\":\"...\"} where `reason` is one of no_vision (this model cannot see images), too_large (roughly over 50 MB), past_session (import it with copy_path first), decode_failed, sharp_missing, already_delivered (this same image was already delivered by an earlier call in the SAME batch of tool calls, so this duplicate was not attached again — reading it again in a later batch always delivers the current pixels, which may have changed since), link_unavailable (no public URL could be minted, so the pixels did not arrive for that request). `ok:true` with `image_attached:false` is still a successful call, e.g. a deduplicated re-read. When `retryable` is false do not retry — tell the user instead. Images may be downscaled (long edge ~2000 px, re-encoded as JPEG) before delivery.\n\nBinary files are not returned as text; a short notice is returned instead. Text files over 32 MB cannot be read by this tool — use `terminal` (grep -n / head / sed -n).",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"path"
|
||
],
|
||
"properties": {
|
||
"path": {
|
||
"type": "string",
|
||
"description": "Path of the file to read, relative to the session working directory. Absolute paths are also accepted. '@<session-id>/<rel>' reads a same-user past session's file (text only; past images need copy_path first)."
|
||
},
|
||
"start_line": {
|
||
"type": "integer",
|
||
"nullable": true,
|
||
"description": "Optional 1-based line number to start reading from.",
|
||
"default": null,
|
||
"minimum": 1
|
||
},
|
||
"end_line": {
|
||
"type": "integer",
|
||
"nullable": true,
|
||
"description": "Optional 1-based line number to end reading at (inclusive). Must be >= start_line. Supplying either bound disables outline mode.",
|
||
"default": null,
|
||
"minimum": 1
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "recall",
|
||
"description": "Access your long-term memory: the work diary. Each finished session leaves one short fragment (a few dozen chars) there, headed by its source session id; fragments are kept permanently, but only the newest were injected at session start - recall reads the whole archive on demand. Read-only.\n\nop=search Fuzzy keyword match over ALL fragments, best first. Primary entry when the user vaguely recalls something - you cannot know what you have forgotten.\nop=days Index of days that have entries (newest first) - when the user remembers roughly WHEN but not what.\nop=day Full fragments of one day.\n\nReturns are plain text: search hits print '--- date (match%) ---' then the session id and fragment; days list dates with entry counts; day lists fragments. A miss comes back as a short 'no records' line - a normal answer, not an error.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"op"
|
||
],
|
||
"properties": {
|
||
"op": {
|
||
"type": "string",
|
||
"enum": [
|
||
"search",
|
||
"days",
|
||
"day"
|
||
],
|
||
"description": "Recall operation; what each op does is in the tool description."
|
||
},
|
||
"query": {
|
||
"type": "string",
|
||
"description": "op=search: keywords; space-separated words rank best (e.g. '身份证 水印'). Chinese and English, case-insensitive; Chinese tolerates partial phrases."
|
||
},
|
||
"count": {
|
||
"type": "integer",
|
||
"minimum": 1,
|
||
"maximum": 30,
|
||
"default": 10,
|
||
"description": "op=search: max fragments to return (default 10, max 30)."
|
||
},
|
||
"date": {
|
||
"type": "string",
|
||
"description": "op=day: the day to open, YYYY-MM-DD exactly as shown by op=days."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "schedule",
|
||
"description": "Manage scheduled tasks (alarms). Call this ONLY when the user explicitly asks for something to run periodically or at a specific time.\n\nModel: each task lives on exactly one session (at most one per session) and is addressed by its task id — the home session id shown by op=list, format 'task-YYYYMMDD-NNN'. Omit id to act on THIS session's task. At each trigger the prompt is delivered to the task's session as a new user message; prior history is archived first. Cron times are Asia/Shanghai (UTC+8). Returns are compact key=value blocks; failures come back as 'Error: ...' and are safe to retry after fixing arguments.\n\nop=get Optional id.\nop=list No arguments. All tasks of the current user across sessions, one block per task starting with its id — pass that id straight to get/update/delete; never ask the user to switch sessions.\nop=create THIS session only; id is rejected. Requires cron_expr, prompt and brief; optional script.\n Side effect: the creating session retires into the task's dedicated home — it gets archived and the user's next message starts a fresh session.\nop=update Optional id. Requires at least one of cron_expr, prompt; other fields unchanged.\nop=delete Optional id. Cancels the task.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"op"
|
||
],
|
||
"properties": {
|
||
"op": {
|
||
"type": "string",
|
||
"enum": [
|
||
"get",
|
||
"list",
|
||
"create",
|
||
"update",
|
||
"delete"
|
||
],
|
||
"description": "Operation to perform."
|
||
},
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Task id as shown by op=list (the session the task lives on). Omit for THIS session's task. Not allowed with op=create."
|
||
},
|
||
"cron_expr": {
|
||
"type": "string",
|
||
"description": "Standard 5-field cron expression, e.g. '0 9 * * *' for 09:00 daily. Runs must be at least 1 hour apart — denser expressions are rejected (not silently adjusted). Required with op=create; optional with op=update (recomputes next run)."
|
||
},
|
||
"prompt": {
|
||
"type": "string",
|
||
"description": "Self-contained instruction delivered as the only input at each trigger (prior history is archived). Each run's closing reply plus newly written artifact files are automatically pushed to the user via WeChat, so do not wire a webhook/email push into the prompt. Required with op=create; optional with op=update."
|
||
},
|
||
"brief": {
|
||
"type": "string",
|
||
"description": "One short plain line (<= 40 characters; CJK counts as 1) saying what the task accomplishes, e.g. 'collect and produce a daily news PDF report'. Goes into the assistant's long-term memory diary. Required with op=create; immutable afterwards."
|
||
},
|
||
"script": {
|
||
"type": "string",
|
||
"description": "Optional for op=create. A script filename (relative to the session working dir) meant to carry this task's routine so triggers reuse muscle memory instead of redoing everything. Supplying it means: distill the workflow into that script NOW (language, invocation and how the prompt references it are yours to decide). Never validated at create or trigger — a missing/broken script surfaces as a runtime error in the trigger turn. Immutable afterwards."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "skill",
|
||
"description": "Run or inspect the skills installed on this server. Each skill describes its purpose and input_schema.\n\n{\"op\":\"list\"} list every skill with a one-line description\n{\"op\":\"get\",\"name\":\"<skill>\"} return the skill's full details; call it before the first run\n{\"op\":\"run\",\"name\":\"<skill>\",\"args\":{...}} execute it; args follow its input_schema\n\nop is required. op=get and op=run require name. Put skill arguments inside args, never at the top level.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"op"
|
||
],
|
||
"properties": {
|
||
"op": {
|
||
"type": "string",
|
||
"enum": [
|
||
"list",
|
||
"get",
|
||
"run"
|
||
],
|
||
"description": "Operation to perform on skills."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Skill name. Required with op=get and op=run."
|
||
},
|
||
"args": {
|
||
"type": "object",
|
||
"description": "Only with op=run: the skill's input arguments, e.g. {\"input\":\"a.md\",\"output\":\"b.pdf\"}. Omit for skills that take no arguments."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "terminal",
|
||
"description": "Executes a shell one-liner and returns combined stdout/stderr output.\n\n- Run commands relative to the session working directory. Use the `cd` parameter to specify a different directory if needed.\n- Do not use shell substitutions or interpolations (e.g., `$VAR`, `${VAR}`, `$(...)`, backticks). Resolve values yourself first.\n- Do not pipe output to `head` or `tail`; use the `head_lines` and `tail_lines` parameters to limit what is returned while keeping full output visible to the user. Both can be combined: the result is the first head_lines lines, a blank line, then the last tail_lines lines.\n- Avoid commands that run indefinitely (servers, watchers). For long-running commands, set `timeout_ms`.\n- Each invocation starts a new shell; do not rely on state from previous calls.\n- If a command may open a pager or editor, disable it using environment variables (e.g., `GIT_PAGER=cat`, `EDITOR=true`).",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"command"
|
||
],
|
||
"properties": {
|
||
"command": {
|
||
"type": "string",
|
||
"description": "The shell one-liner to execute. Do not include shell substitutions; use literal values."
|
||
},
|
||
"cd": {
|
||
"type": "string",
|
||
"nullable": true,
|
||
"description": "Optional working directory for the command. If omitted, runs in the session working directory. Accepts relative or absolute path."
|
||
},
|
||
"timeout_ms": {
|
||
"type": "integer",
|
||
"nullable": true,
|
||
"description": "Optional maximum runtime in milliseconds. If exceeded, the process is killed.",
|
||
"minimum": 0
|
||
},
|
||
"head_lines": {
|
||
"type": "integer",
|
||
"nullable": true,
|
||
"description": "Return only the first N lines of output to the model. The user still sees full live output.",
|
||
"minimum": 0,
|
||
"default": null
|
||
},
|
||
"tail_lines": {
|
||
"type": "integer",
|
||
"nullable": true,
|
||
"description": "Return only the last N lines of output to the model. The user still sees full live output.",
|
||
"minimum": 0,
|
||
"default": null
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "device",
|
||
"description": "Operate the remote devices (other machines) connected to this server. Devices dial out to this server, so they need no inbound port; they stay connected until closed.\n\n- action=list: no other params. Returns every online device with os/arch/shell/root. Always call this first when you don't know device names.\n- action=health: requires device. Returns host uptime, load, memory, disk and temperature (fields the platform can't provide are -1).\n- action=exec: requires device and command. Runs the command through a shell on that device (sh -c on Unix, cmd /c on Windows) and returns stdout, stderr and the exit code. `cwd` must be inside that device's work root; omit it to use the root.\n\n- action=pull: requires device and remote_path; copies a file from the device into the session directory so read_file / skills can use it.\n- action=push: requires device, local_path and remote_path; sends a session file to the device.\n\nUse it when the work has to happen on the user's own machine (laptop, box, Windows PC). For the machine running this server use `terminal` instead. If a device is offline, say so explicitly — do not silently run the command elsewhere.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"action"
|
||
],
|
||
"properties": {
|
||
"action": {
|
||
"type": "string",
|
||
"enum": [
|
||
"list",
|
||
"health",
|
||
"exec",
|
||
"pull",
|
||
"push"
|
||
],
|
||
"description": "Operation to perform."
|
||
},
|
||
"device": {
|
||
"type": "string",
|
||
"description": "Device name from action=list."
|
||
},
|
||
"command": {
|
||
"type": "string",
|
||
"description": "Shell command line (action=exec). Avoid interactive commands."
|
||
},
|
||
"cwd": {
|
||
"type": "string",
|
||
"description": "Working directory on the device; must be inside its work root (action=exec)."
|
||
},
|
||
"timeout_ms": {
|
||
"type": "integer",
|
||
"description": "Default 120000, max 600000 (action=exec)."
|
||
},
|
||
"remote_path": {
|
||
"type": "string",
|
||
"description": "设备上的绝对路径,必须在设备工作根内(pull/push)。"
|
||
},
|
||
"local_path": {
|
||
"type": "string",
|
||
"description": "会话目录内的相对路径。pull 省略则用远端文件名;push 必填(源文件)。"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "write_file",
|
||
"description": "Creates a new file or overwrites an existing file with the given content.\n\nParent directories are created automatically, so the path does not need to exist beforehand.\n\nOverwriting replaces the file's entire content irreversibly. If the file already exists, read it first, or use `edit_file` for targeted changes instead.\n\nText is written as UTF-8. To produce binary files, use `terminal` instead.",
|
||
"parameters": {
|
||
"type": "object",
|
||
"required": [
|
||
"path",
|
||
"content"
|
||
],
|
||
"properties": {
|
||
"path": {
|
||
"type": "string",
|
||
"description": "Path of the file to create or overwrite, relative to the session working directory. Absolute paths inside the working directory are also accepted. '@' paths are rejected here — the past is read-only."
|
||
},
|
||
"content": {
|
||
"type": "string",
|
||
"description": "The entire content to write. Required — pass an empty string to create an empty file; omitting it is an error."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|