




























@@ -11,7 +11,7 @@ title: "Path"
11111212Plugin-provided shell access to the `oc://` addressing substrate — one universal,
1313kind-dispatched path scheme for inspecting and surgically editing workspace
14-files (markdown, jsonc, jsonl, yaml). Self-hosters and editor extensions use
14+files (markdown, jsonc, jsonl). Self-hosters and editor extensions use
1515it to read or write a single leaf inside a workspace file without scripting
1616against the SDK directly.
1717@@ -45,17 +45,17 @@ Slot rules — `field` requires `item`, `item` requires `section`. Across all
4545four slots:
46464747- **Quoted segments** — `"a/b.c"` survives `/` and `.` separators.
48-`"\\"` and `"\""` are the only escapes inside quotes.
49- The file slot is also quote-aware: `oc://"skills/email-drafter"/Tools/-1`
48+Content is byte-literal; `"` and `\` are not allowed inside quotes.
49+ The file slot is also quote-aware: `oc://"skills/email-drafter"/Tools/$last`
5050 treats `skills/email-drafter` as a single file path.
51-- **Predicates** — `[k=v]`, `[k!=v]`, `[k*=v]`, `[k^=v]`, `[k$=v]`,
52-`[k<v]`, `[k<=v]`, `[k>v]`, `[k>=v]`.
51+- **Predicates** — `[k=v]`, `[k!=v]`, `[k<v]`, `[k<=v]`, `[k>v]`,
52+`[k>=v]`. Numeric ops require both sides to coerce to finite numbers.
5353- **Unions** — `{a,b,c}` matches any of the alternatives.
5454- **Wildcards** — `*` (single sub-segment) and `**` (zero-or-more,
5555 recursive). `find` accepts these; `resolve` and `set` reject them as
5656 ambiguous.
57-- **Positional** — `$first`, `$last`, `-N` (Nth from end).
58-- **Ordinal** — `#N` for Nth match.
57+- **Positional** — `$last` resolves to the last index / last-declared key.
58+- **Ordinal** — `#N` for Nth match by document order.
5959- **Insertion markers** — `+`, `+key`, `+nnn` for keyed / indexed
6060 insertion (use with `set`).
6161- **Session scope** — `?session=cron:daily` etc. Orthogonal to slot
@@ -69,7 +69,7 @@ rejected anywhere.
69697070```bash
7171# Validate a path (no filesystem access)
72-openclaw path validate 'oc://AGENTS.md/Tools/-1/risk'
72+openclaw path validate 'oc://AGENTS.md/Tools/$last/risk'
73737474# Read a leaf
7575openclaw path resolve 'oc://gateway.jsonc/version'
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。