@1agents/acp-service 0.8.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -2
- package/dist/bin/a2a.js +3 -2
- package/dist/src/a2a/executor.d.ts +2 -0
- package/dist/src/a2a/executor.js +63 -10
- package/dist/src/a2a/gateway.d.ts +407 -14
- package/dist/src/a2a/gateway.js +719 -37
- package/dist/src/a2a/index.d.ts +8 -1
- package/dist/src/a2a/index.js +4 -0
- package/dist/src/a2a/notices.d.ts +24 -0
- package/dist/src/a2a/notices.js +56 -0
- package/dist/src/a2a/preflight.d.ts +52 -0
- package/dist/src/a2a/preflight.js +153 -0
- package/dist/src/a2a/result-metadata.d.ts +59 -0
- package/dist/src/a2a/result-metadata.js +156 -0
- package/dist/src/a2a/server.js +30 -0
- package/dist/src/a2a/session-delivery.d.ts +69 -0
- package/dist/src/a2a/session-delivery.js +260 -0
- package/dist/src/a2a/session-hosts.d.ts +34 -0
- package/dist/src/a2a/session-hosts.js +211 -0
- package/dist/src/a2a/store.js +3 -1
- package/dist/src/a2a/types.d.ts +33 -0
- package/dist/src/execution/delivery-progress.d.ts +108 -0
- package/dist/src/execution/delivery-progress.js +57 -0
- package/dist/src/execution/ledger.d.ts +235 -0
- package/dist/src/execution/ledger.js +396 -0
- package/dist/src/execution/ppt-delivery.d.ts +231 -0
- package/dist/src/execution/ppt-delivery.js +625 -0
- package/dist/src/execution/targets.d.ts +349 -0
- package/dist/src/execution/targets.js +428 -0
- package/package.json +11 -12
- package/skills/acp-service/SKILL.md +9 -2
- package/skills/acp-service/references/a2a.md +72 -4
- package/vendor/dsh/a2a-executor.d.ts +2 -1
- package/vendor/dsh/a2a-executor.js +28 -1
- package/vendor/dsh/a2a.js +1 -0
- package/vendor/dsh/client.js +95 -27
- package/vendor/runtime/dist/{agent-registry-CMg8LHKY.js → agent-registry-R7A3MSpr.js} +9 -1
- package/vendor/runtime/dist/agent-registry-R7A3MSpr.js.map +1 -0
- package/vendor/runtime/dist/agent-registry.d.ts +1 -0
- package/vendor/runtime/dist/agent-registry.d.ts.map +1 -1
- package/vendor/runtime/dist/agent-registry.js +1 -2
- package/vendor/runtime/dist/{cli-Bdzplbpj.js → cli-DeOpE2Xz.js} +4 -4
- package/vendor/runtime/dist/{cli-Bdzplbpj.js.map → cli-DeOpE2Xz.js.map} +1 -1
- package/vendor/runtime/dist/cli.d.ts +2 -1
- package/vendor/runtime/dist/cli.js +10 -10
- package/vendor/runtime/dist/cli.js.map +1 -1
- package/vendor/runtime/dist/{client-BXOiB0ND.d.ts → client-VQsqcIOJ.d.ts} +2 -2
- package/vendor/runtime/dist/{client-BXOiB0ND.d.ts.map → client-VQsqcIOJ.d.ts.map} +1 -1
- package/vendor/runtime/dist/docs-site/.nojekyll +0 -0
- package/vendor/runtime/dist/docs-site/CLI.html +833 -0
- package/vendor/runtime/dist/docs-site/VISION.html +415 -0
- package/vendor/runtime/dist/docs-site/agents.html +391 -0
- package/vendor/runtime/dist/docs-site/compare.html +359 -0
- package/vendor/runtime/dist/docs-site/config.html +450 -0
- package/vendor/runtime/dist/docs-site/custom-agents.html +408 -0
- package/vendor/runtime/dist/docs-site/exit-codes.html +347 -0
- package/vendor/runtime/dist/docs-site/favicon.svg +21 -0
- package/vendor/runtime/dist/docs-site/flows.html +498 -0
- package/vendor/runtime/dist/docs-site/index.html +367 -0
- package/vendor/runtime/dist/docs-site/install.html +386 -0
- package/vendor/runtime/dist/docs-site/llms.txt +36 -0
- package/vendor/runtime/dist/docs-site/output-formats.html +407 -0
- package/vendor/runtime/dist/docs-site/permissions.html +422 -0
- package/vendor/runtime/dist/docs-site/prompting.html +460 -0
- package/vendor/runtime/dist/docs-site/quickstart.html +382 -0
- package/vendor/runtime/dist/docs-site/releasing.html +341 -0
- package/vendor/runtime/dist/docs-site/runtime-environment.html +329 -0
- package/vendor/runtime/dist/docs-site/runtime-process-lifecycle.html +335 -0
- package/vendor/runtime/dist/docs-site/safe-errors.html +323 -0
- package/vendor/runtime/dist/docs-site/session-control.html +408 -0
- package/vendor/runtime/dist/docs-site/session-watch.html +354 -0
- package/vendor/runtime/dist/docs-site/sessions.html +488 -0
- package/vendor/runtime/dist/docs-site/shared-sessions.html +377 -0
- package/vendor/runtime/dist/{flows-BKlAuzM8.js → flows-oaBGn31w.js} +5 -5
- package/vendor/runtime/dist/{flows-BKlAuzM8.js.map → flows-oaBGn31w.js.map} +1 -1
- package/vendor/runtime/dist/flows.d.ts +2 -2
- package/vendor/runtime/dist/flows.d.ts.map +1 -1
- package/vendor/runtime/dist/flows.js +1 -2
- package/vendor/runtime/dist/{invocation-options-DMy77sEU.js → invocation-options-CUDEE8vW.js} +5 -5
- package/vendor/runtime/dist/{invocation-options-DMy77sEU.js.map → invocation-options-CUDEE8vW.js.map} +1 -1
- package/vendor/runtime/dist/{ipc-CLv2iL89.js → ipc-BQQpcEdP.js} +98 -20
- package/vendor/runtime/dist/ipc-BQQpcEdP.js.map +1 -0
- package/vendor/runtime/dist/{output-I-t-v55D.js → output-CFv3jcOQ.js} +86 -22
- package/vendor/runtime/dist/output-CFv3jcOQ.js.map +1 -0
- package/vendor/runtime/dist/{queue-owner-runtime-RN3uSid0.js → queue-owner-runtime-DvMJiGbP.js} +86 -27
- package/vendor/runtime/dist/queue-owner-runtime-DvMJiGbP.js.map +1 -0
- package/vendor/runtime/dist/runtime.d.ts +5 -2
- package/vendor/runtime/dist/runtime.d.ts.map +1 -1
- package/vendor/runtime/dist/runtime.js +77 -29
- package/vendor/runtime/dist/runtime.js.map +1 -1
- package/vendor/runtime/dist/{session-options-DNnDfiUt.d.ts → session-options-NjpFwf-c.d.ts} +5 -1
- package/vendor/runtime/dist/session-options-NjpFwf-c.d.ts.map +1 -0
- package/vendor/runtime/dist/{session-watch-CmHbH0jS.js → session-watch-Di-wIdCH.js} +4 -4
- package/vendor/runtime/dist/{session-watch-CmHbH0jS.js.map → session-watch-Di-wIdCH.js.map} +1 -1
- package/vendor/runtime/dist/{watch-BE-kKa7o.js → watch-CIpoMaWD.js} +2 -2
- package/vendor/runtime/dist/{watch-BE-kKa7o.js.map → watch-CIpoMaWD.js.map} +1 -1
- package/vendor/runtime/package.json +1 -1
- package/vendor/runtime/skills/acpx/SKILL.md +7 -2
- package/vendor/runtime/dist/agent-registry-CMg8LHKY.js.map +0 -1
- package/vendor/runtime/dist/ipc-CLv2iL89.js.map +0 -1
- package/vendor/runtime/dist/output-I-t-v55D.js.map +0 -1
- package/vendor/runtime/dist/queue-owner-runtime-RN3uSid0.js.map +0 -1
- package/vendor/runtime/dist/session-options-DNnDfiUt.d.ts.map +0 -1
|
@@ -0,0 +1,833 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>acpx CLI Reference — acpx</title>
|
|
7
|
+
<meta name="description" content="Definitive command and behavior reference for the acpx CLI, including grammar, options, session rules, output modes, permissions, and exit codes.">
|
|
8
|
+
<link rel="canonical" href="CLI.html">
|
|
9
|
+
<meta property="og:type" content="website">
|
|
10
|
+
<meta property="og:site_name" content="acpx">
|
|
11
|
+
<meta property="og:title" content="acpx CLI Reference — acpx">
|
|
12
|
+
<meta property="og:description" content="Definitive command and behavior reference for the acpx CLI, including grammar, options, session rules, output modes, permissions, and exit codes.">
|
|
13
|
+
<meta property="og:url" content="CLI.html">
|
|
14
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
15
|
+
<meta name="twitter:title" content="acpx CLI Reference — acpx">
|
|
16
|
+
<meta name="twitter:description" content="Definitive command and behavior reference for the acpx CLI, including grammar, options, session rules, output modes, permissions, and exit codes.">
|
|
17
|
+
<link rel="icon" href="favicon.svg" type="image/svg+xml">
|
|
18
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
19
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
20
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
21
|
+
<script>(function(){var s;try{s=localStorage.getItem('theme')}catch(e){}var d=window.matchMedia&&matchMedia('(prefers-color-scheme: dark)').matches;document.documentElement.dataset.theme=s||(d?'dark':'light')})();</script>
|
|
22
|
+
<style>
|
|
23
|
+
:root{
|
|
24
|
+
--ink:#0b0e14;
|
|
25
|
+
--text:#1f2530;
|
|
26
|
+
--muted:#6a7282;
|
|
27
|
+
--subtle:#9aa1ab;
|
|
28
|
+
--bg:#f7f8fa;
|
|
29
|
+
--paper:#ffffff;
|
|
30
|
+
--accent:#0ea5e9;
|
|
31
|
+
--accent-soft:rgba(14,165,233,.10);
|
|
32
|
+
--accent-strong:#0284c7;
|
|
33
|
+
--accent-2:#a855f7;
|
|
34
|
+
--accent-3:#22c55e;
|
|
35
|
+
--accent-4:#f59e0b;
|
|
36
|
+
--line:#e5e7eb;
|
|
37
|
+
--line-soft:#eef0f3;
|
|
38
|
+
--code-bg:#0a0d14;
|
|
39
|
+
--code-fg:#e6edf3;
|
|
40
|
+
--code-inline-fg:#1c2128;
|
|
41
|
+
--pill-border:#dbe2eb;
|
|
42
|
+
--shadow-card:0 4px 14px rgba(15,17,21,.08);
|
|
43
|
+
--scrollbar:#cbd5e1;
|
|
44
|
+
}
|
|
45
|
+
:root[data-theme="dark"]{
|
|
46
|
+
--ink:#f3f5f9;
|
|
47
|
+
--text:#cdd3dd;
|
|
48
|
+
--muted:#8d96a4;
|
|
49
|
+
--subtle:#5d6371;
|
|
50
|
+
--bg:#08090f;
|
|
51
|
+
--paper:#13161f;
|
|
52
|
+
--accent:#38bdf8;
|
|
53
|
+
--accent-soft:rgba(56,189,248,.18);
|
|
54
|
+
--accent-strong:#7dd3fc;
|
|
55
|
+
--line:#23283a;
|
|
56
|
+
--line-soft:#1a1d28;
|
|
57
|
+
--code-bg:#040611;
|
|
58
|
+
--code-fg:#e6edf3;
|
|
59
|
+
--code-inline-fg:#e6edf3;
|
|
60
|
+
--pill-border:#2a2f3c;
|
|
61
|
+
--shadow-card:0 4px 18px rgba(0,0,0,.45);
|
|
62
|
+
--scrollbar:#3a4154;
|
|
63
|
+
}
|
|
64
|
+
:root{color-scheme:light}
|
|
65
|
+
:root[data-theme="dark"]{color-scheme:dark}
|
|
66
|
+
*{box-sizing:border-box}
|
|
67
|
+
html{scroll-behavior:smooth;scroll-padding-top:24px}
|
|
68
|
+
body{margin:0;background:var(--bg);color:var(--text);font-family:"Inter",ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;line-height:1.65;overflow-x:hidden;-webkit-font-smoothing:antialiased;font-feature-settings:"cv02","cv03","cv04","cv11";transition:background-color .18s,color .18s}
|
|
69
|
+
::selection{background:var(--accent);color:#04121d}
|
|
70
|
+
a{color:var(--accent);text-decoration:none;transition:color .12s}
|
|
71
|
+
a:hover{text-decoration:underline;text-underline-offset:.2em}
|
|
72
|
+
.shell{display:grid;grid-template-columns:268px minmax(0,1fr);min-height:100vh}
|
|
73
|
+
.sidebar{position:sticky;top:0;height:100vh;overflow:auto;padding:24px 22px;background:var(--paper);border-right:1px solid var(--line);scrollbar-width:thin;scrollbar-color:var(--line) transparent;transition:background-color .18s,border-color .18s}
|
|
74
|
+
.sidebar::-webkit-scrollbar{width:6px}
|
|
75
|
+
.sidebar::-webkit-scrollbar-thumb{background:var(--line);border-radius:6px}
|
|
76
|
+
.sidebar-head{display:flex;align-items:center;gap:10px;margin-bottom:24px}
|
|
77
|
+
.brand{display:flex;align-items:center;gap:11px;color:var(--ink);text-decoration:none;flex:1;min-width:0}
|
|
78
|
+
.brand:hover{text-decoration:none}
|
|
79
|
+
.brand .mark{flex:0 0 34px;width:34px;height:34px;border-radius:8px;background:linear-gradient(145deg,#08111f 0%,#101827 58%,#172554 100%);position:relative;overflow:hidden;display:grid;place-items:center;box-shadow:0 1px 0 rgba(255,255,255,.08) inset,0 10px 24px -13px rgba(14,165,233,.7)}
|
|
80
|
+
.brand .mark::before{content:"";position:absolute;inset:0;background:linear-gradient(135deg,rgba(125,211,252,.22),transparent 42%),linear-gradient(315deg,rgba(167,139,250,.2),transparent 48%);pointer-events:none}
|
|
81
|
+
.brand .mark::after{content:"";position:absolute;inset:1px;border-radius:7px;border:1px solid rgba(255,255,255,.1);pointer-events:none}
|
|
82
|
+
.brand .mark svg{position:relative;z-index:1;width:23px;height:23px;display:block}
|
|
83
|
+
.brand .mark .cursor{transform-origin:center;animation:acpx-blink 1.2s steps(2,jump-none) infinite}
|
|
84
|
+
@keyframes acpx-blink{0%,49%{opacity:1}50%,100%{opacity:.25}}
|
|
85
|
+
@media (prefers-reduced-motion: reduce){.brand .mark .cursor{animation:none}}
|
|
86
|
+
.brand strong{display:block;font-size:1.05rem;line-height:1.1;font-weight:600;letter-spacing:0;color:var(--ink)}
|
|
87
|
+
.brand small{display:block;color:var(--muted);font-size:.74rem;margin-top:3px;font-weight:400}
|
|
88
|
+
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:34px;height:34px;border-radius:8px;border:1px solid var(--line);background:var(--paper);color:var(--muted);cursor:pointer;padding:0;transition:border-color .15s,color .15s,background-color .15s,transform .12s}
|
|
89
|
+
.theme-toggle:hover{border-color:var(--ink);color:var(--ink)}
|
|
90
|
+
.theme-toggle:active{transform:scale(.94)}
|
|
91
|
+
.theme-toggle svg{width:16px;height:16px;display:block}
|
|
92
|
+
.theme-icon-sun{display:none}
|
|
93
|
+
:root[data-theme="dark"] .theme-icon-sun{display:block}
|
|
94
|
+
:root[data-theme="dark"] .theme-icon-moon{display:none}
|
|
95
|
+
.search{display:block;margin:0 0 22px}
|
|
96
|
+
.search span{display:block;color:var(--muted);font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:0;margin-bottom:7px}
|
|
97
|
+
.search input{width:100%;border:1px solid var(--line);background:var(--paper);border-radius:8px;padding:9px 12px;font:inherit;font-size:.9rem;color:var(--text);outline:none;transition:border-color .15s,box-shadow .15s,background-color .18s}
|
|
98
|
+
.search input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
|
|
99
|
+
nav section{margin:0 0 18px}
|
|
100
|
+
nav h2{font-size:.68rem;color:var(--muted);text-transform:uppercase;letter-spacing:0;margin:0 0 6px;font-weight:600}
|
|
101
|
+
.nav-link{display:block;color:var(--text);text-decoration:none;border-radius:6px;padding:5px 10px;margin:1px 0;font-size:.9rem;line-height:1.4;transition:background .12s,color .12s}
|
|
102
|
+
.nav-link:hover{background:var(--line-soft);color:var(--ink);text-decoration:none}
|
|
103
|
+
.nav-link.active{background:var(--accent-soft);color:var(--accent);font-weight:600}
|
|
104
|
+
main{min-width:0;padding:32px clamp(20px,4.5vw,56px) 80px;max-width:1180px;margin:0 auto;width:100%}
|
|
105
|
+
.hero{display:flex;align-items:flex-end;justify-content:space-between;gap:22px;border-bottom:1px solid var(--line);padding:8px 0 22px;margin-bottom:8px;flex-wrap:wrap}
|
|
106
|
+
.hero-text{min-width:0;flex:1 1 320px}
|
|
107
|
+
.eyebrow{margin:0 0 8px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:0;font-size:.7rem}
|
|
108
|
+
.hero h1{font-size:2.25rem;line-height:1.1;letter-spacing:-.01em;margin:0;font-weight:700;color:var(--ink)}
|
|
109
|
+
.hero-meta{display:flex;gap:8px;flex:0 0 auto;flex-wrap:wrap}
|
|
110
|
+
.repo,.edit,.btn-ghost{border:1px solid var(--line);color:var(--text);text-decoration:none;border-radius:7px;padding:6px 11px;font-weight:500;font-size:.83rem;background:var(--paper);transition:border-color .15s,color .15s,background .15s}
|
|
111
|
+
.repo:hover,.edit:hover,.btn-ghost:hover{border-color:var(--ink);color:var(--ink);text-decoration:none}
|
|
112
|
+
.edit{color:var(--muted)}
|
|
113
|
+
.home-hero{padding:14px 0 28px;margin-bottom:8px;border-bottom:1px solid var(--line)}
|
|
114
|
+
.home-hero .eyebrow{display:inline-flex;align-items:center;gap:8px}
|
|
115
|
+
.home-hero .eyebrow .dot{width:7px;height:7px;border-radius:50%;background:var(--accent-3);box-shadow:0 0 0 3px rgba(34,197,94,.2)}
|
|
116
|
+
.home-hero h1{font-size:3.25rem;line-height:1.04;letter-spacing:-.015em;margin:0 0 .35em;font-weight:700;color:var(--ink)}
|
|
117
|
+
.home-hero h1 .accent{background:linear-gradient(110deg,var(--accent) 0%,var(--accent-2) 70%);-webkit-background-clip:text;background-clip:text;color:transparent}
|
|
118
|
+
.home-hero .lede{font-size:1.18rem;line-height:1.55;color:var(--text);margin:0 0 1.2em;max-width:60ch}
|
|
119
|
+
.home-cta{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:0 0 18px}
|
|
120
|
+
.home-cta .btn{display:inline-flex;align-items:center;gap:7px;border-radius:8px;padding:10px 16px;font-weight:600;font-size:.92rem;text-decoration:none;transition:background .15s,border-color .15s,color .15s,transform .12s}
|
|
121
|
+
.home-cta .btn-primary{background:var(--ink);color:var(--paper);border:1px solid var(--ink)}
|
|
122
|
+
.home-cta .btn-primary:hover{background:var(--accent);border-color:var(--accent);color:#04121d;text-decoration:none}
|
|
123
|
+
.home-cta .btn-ghost{padding:10px 16px}
|
|
124
|
+
.home-install{display:flex;align-items:center;gap:12px;background:var(--code-bg);color:var(--code-fg);border-radius:8px;padding:10px 10px 10px 16px;font:500 .9rem/1.2 "JetBrains Mono","SF Mono",ui-monospace,monospace;max-width:32em;border:1px solid #1f2937}
|
|
125
|
+
.home-install .prompt{color:#7dd3fc;user-select:none;flex:0 0 auto}
|
|
126
|
+
.home-install code{flex:1;background:transparent;border:0;color:var(--code-fg);font:inherit;padding:0;white-space:pre;overflow:hidden;text-overflow:ellipsis}
|
|
127
|
+
.home-install .copy{flex:0 0 auto;background:rgba(255,255,255,.08);color:var(--code-fg);border:1px solid rgba(255,255,255,.16);border-radius:6px;padding:5px 11px;font:500 .72rem/1 "Inter",sans-serif;cursor:pointer;transition:background .15s,border-color .15s}
|
|
128
|
+
.home-install .copy:hover{background:rgba(255,255,255,.16)}
|
|
129
|
+
.home-install .copy.copied{background:var(--accent);border-color:var(--accent);color:#04121d}
|
|
130
|
+
.home-services{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 18px}
|
|
131
|
+
.home-services span{display:inline-block;padding:3px 9px;border:1px solid var(--line);border-radius:999px;font-size:.78rem;color:var(--muted);background:var(--paper);font-family:"JetBrains Mono","SF Mono",ui-monospace,monospace}
|
|
132
|
+
.doc-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:48px;margin-top:24px}
|
|
133
|
+
.doc-grid-home{margin-top:8px}
|
|
134
|
+
@media(min-width:1180px){.doc-grid{grid-template-columns:minmax(0,72ch) 200px;justify-content:start}.doc-grid-home{grid-template-columns:minmax(0,76ch);justify-content:start}}
|
|
135
|
+
.doc{min-width:0;max-width:72ch;overflow-wrap:break-word}
|
|
136
|
+
.doc-home{max-width:76ch}
|
|
137
|
+
.doc h1{font-size:2.6rem;line-height:1.08;letter-spacing:-.015em;margin:0 0 .4em;font-weight:700;color:var(--ink)}
|
|
138
|
+
body:not(.home) .doc>h1:first-child{display:none}
|
|
139
|
+
.doc h2{font-size:1.45rem;line-height:1.2;margin:2em 0 .5em;font-weight:600;letter-spacing:-.005em;color:var(--ink);position:relative}
|
|
140
|
+
.doc h3{font-size:1.1rem;margin:1.7em 0 .35em;position:relative;font-weight:600;color:var(--ink);letter-spacing:0}
|
|
141
|
+
.doc h4{font-size:.98rem;margin:1.4em 0 .25em;color:var(--ink);position:relative;font-weight:600}
|
|
142
|
+
.doc h2:first-child,.doc h3:first-child,.doc h4:first-child{margin-top:.2em}
|
|
143
|
+
.doc :is(h2,h3,h4) .anchor{position:absolute;left:-1.05em;top:0;color:var(--subtle);opacity:0;text-decoration:none;font-weight:400;padding-right:.3em;transition:opacity .12s,color .12s}
|
|
144
|
+
.doc :is(h2,h3,h4):hover .anchor{opacity:.7}
|
|
145
|
+
.doc :is(h2,h3,h4) .anchor:hover{opacity:1;color:var(--accent);text-decoration:none}
|
|
146
|
+
.doc p{margin:0 0 1.05em}
|
|
147
|
+
.doc ul,.doc ol{padding-left:1.3rem;margin:0 0 1.15em}
|
|
148
|
+
.doc li{margin:.25em 0}
|
|
149
|
+
.doc li>p{margin:0 0 .4em}
|
|
150
|
+
.doc strong{font-weight:600;color:var(--ink)}
|
|
151
|
+
.doc em{font-style:italic}
|
|
152
|
+
.doc code{font-family:"JetBrains Mono","SF Mono",ui-monospace,monospace;font-size:.84em;background:var(--line-soft);border:1px solid var(--line);border-radius:5px;padding:.08em .35em;color:var(--code-inline-fg)}
|
|
153
|
+
.doc pre{position:relative;overflow:auto;background:var(--code-bg);color:var(--code-fg);border-radius:8px;padding:14px 18px;margin:1.3em 0;font-size:.85em;line-height:1.6;scrollbar-width:thin;scrollbar-color:#334155 transparent;border:1px solid #1f2937}
|
|
154
|
+
.doc pre::-webkit-scrollbar{height:8px;width:8px}
|
|
155
|
+
.doc pre::-webkit-scrollbar-thumb{background:#334155;border-radius:8px}
|
|
156
|
+
.doc pre code{display:block;background:transparent;border:0;color:inherit;padding:0;font-size:1em;white-space:pre}
|
|
157
|
+
.doc pre .hl-com{color:#7a8597;font-style:italic}
|
|
158
|
+
.doc pre .hl-str{color:#86efac}
|
|
159
|
+
.doc pre .hl-num{color:#fbbf24}
|
|
160
|
+
.doc pre .hl-kw{color:#c4b5fd;font-weight:500}
|
|
161
|
+
.doc pre .hl-lit{color:#f0abfc}
|
|
162
|
+
.doc pre .hl-flag{color:#7dd3fc}
|
|
163
|
+
.doc pre .hl-var{color:#fca5a5}
|
|
164
|
+
.doc pre .hl-prop{color:#7dd3fc}
|
|
165
|
+
.doc pre .hl-op{color:#94a3b8}
|
|
166
|
+
.doc pre .hl-typ{color:#fde68a}
|
|
167
|
+
.doc pre .copy{position:absolute;top:8px;right:8px;background:rgba(255,255,255,.06);color:var(--code-fg);border:1px solid rgba(255,255,255,.16);border-radius:6px;padding:3px 9px;font:500 .7rem/1 "Inter",sans-serif;cursor:pointer;opacity:0;transition:opacity .15s,background .15s,border-color .15s}
|
|
168
|
+
.doc pre:hover .copy,.doc pre .copy:focus{opacity:1}
|
|
169
|
+
.doc pre .copy:hover{background:rgba(255,255,255,.12)}
|
|
170
|
+
.doc pre .copy.copied{background:var(--accent);border-color:var(--accent);color:#04121d;opacity:1}
|
|
171
|
+
.doc blockquote{margin:1.4em 0;padding:10px 16px;border-left:3px solid var(--accent);background:var(--accent-soft);border-radius:0 8px 8px 0;color:var(--text)}
|
|
172
|
+
.doc blockquote p:last-child{margin-bottom:0}
|
|
173
|
+
.doc table{width:100%;border-collapse:collapse;margin:1.2em 0;font-size:.92em}
|
|
174
|
+
.doc th,.doc td{border-bottom:1px solid var(--line);padding:9px 10px;text-align:left;vertical-align:top}
|
|
175
|
+
.doc th{font-weight:600;color:var(--ink);background:var(--line-soft);border-bottom:1px solid var(--line)}
|
|
176
|
+
.doc hr{border:0;border-top:1px solid var(--line);margin:2.2em 0}
|
|
177
|
+
.toc{position:sticky;top:24px;align-self:start;font-size:.84rem;padding-left:14px;border-left:1px solid var(--line);max-height:calc(100vh - 48px);overflow:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
|
|
178
|
+
.toc::-webkit-scrollbar{width:5px}
|
|
179
|
+
.toc::-webkit-scrollbar-thumb{background:var(--line);border-radius:5px}
|
|
180
|
+
.toc h2{font-size:.66rem;color:var(--muted);text-transform:uppercase;letter-spacing:0;margin:0 0 10px;font-weight:600}
|
|
181
|
+
.toc a{display:block;color:var(--muted);text-decoration:none;padding:4px 0 4px 10px;line-height:1.35;border-left:2px solid transparent;margin-left:-12px;transition:color .12s,border-color .12s}
|
|
182
|
+
.toc a:hover{color:var(--ink);text-decoration:none}
|
|
183
|
+
.toc a.active{color:var(--accent);border-left-color:var(--accent);font-weight:500}
|
|
184
|
+
.toc-l3{padding-left:22px!important;font-size:.94em}
|
|
185
|
+
@media(max-width:1179px){.toc{display:none}}
|
|
186
|
+
.page-nav{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:48px;border-top:1px solid var(--line);padding-top:20px}
|
|
187
|
+
.page-nav>a{display:block;border:1px solid var(--line);background:var(--paper);border-radius:9px;padding:13px 16px;text-decoration:none;color:var(--text);transition:border-color .15s,transform .15s,box-shadow .15s,background-color .18s}
|
|
188
|
+
.page-nav>a:hover{border-color:var(--accent);text-decoration:none;color:var(--ink)}
|
|
189
|
+
.page-nav small{display:block;color:var(--muted);font-size:.7rem;text-transform:uppercase;letter-spacing:0;margin-bottom:5px;font-weight:600}
|
|
190
|
+
.page-nav span{display:block;font-weight:600;line-height:1.3;color:var(--ink)}
|
|
191
|
+
.page-nav-prev{text-align:left}
|
|
192
|
+
.page-nav-next{text-align:right;grid-column:2}
|
|
193
|
+
.page-nav-prev:only-child{grid-column:1}
|
|
194
|
+
.nav-toggle{display:none;position:fixed;top:14px;right:14px;top:calc(14px + env(safe-area-inset-top, 0px));right:calc(14px + env(safe-area-inset-right, 0px));z-index:20;width:40px;height:40px;border-radius:9px;background:var(--paper);border:1px solid var(--line);color:var(--ink);cursor:pointer;padding:10px 9px;flex-direction:column;align-items:stretch;justify-content:space-between;box-shadow:var(--shadow-card)}
|
|
195
|
+
.nav-toggle span{display:block;width:100%;height:2px;flex:0 0 2px;background:currentColor;border-radius:2px;transition:transform .2s,opacity .2s}
|
|
196
|
+
.nav-toggle[aria-expanded="true"] span:nth-child(1){transform:translateY(8px) rotate(45deg)}
|
|
197
|
+
.nav-toggle[aria-expanded="true"] span:nth-child(2){opacity:0}
|
|
198
|
+
.nav-toggle[aria-expanded="true"] span:nth-child(3){transform:translateY(-8px) rotate(-45deg)}
|
|
199
|
+
@media(max-width:900px){
|
|
200
|
+
.shell{display:block}
|
|
201
|
+
.sidebar{position:fixed;inset:0 30% 0 0;max-width:320px;height:100vh;z-index:15;transform:translateX(-100%);transition:transform .25s ease,background-color .18s,border-color .18s;box-shadow:0 18px 40px rgba(0,0,0,.18);background:var(--paper);pointer-events:none}
|
|
202
|
+
.sidebar.open{transform:translateX(0);pointer-events:auto}
|
|
203
|
+
.nav-toggle{display:flex}
|
|
204
|
+
main{padding:64px 18px 56px}
|
|
205
|
+
.hero{padding-top:6px}
|
|
206
|
+
.hero h1{font-size:1.8rem}
|
|
207
|
+
.home-hero h1{font-size:2.45rem}
|
|
208
|
+
.doc h1{font-size:2.1rem}
|
|
209
|
+
.hero-meta{width:100%;justify-content:flex-start}
|
|
210
|
+
.home-hero{padding-top:8px}
|
|
211
|
+
.doc{padding:0}
|
|
212
|
+
.doc-grid{margin-top:18px;gap:24px}
|
|
213
|
+
.doc :is(h2,h3,h4) .anchor{display:none}
|
|
214
|
+
}
|
|
215
|
+
@media(max-width:520px){
|
|
216
|
+
main{padding:60px 14px 48px}
|
|
217
|
+
.doc pre{margin-left:-14px;margin-right:-14px;border-radius:0;border-left:0;border-right:0}
|
|
218
|
+
.home-install{flex-wrap:wrap}
|
|
219
|
+
}
|
|
220
|
+
</style>
|
|
221
|
+
</head>
|
|
222
|
+
<body>
|
|
223
|
+
<button class="nav-toggle" type="button" aria-label="Toggle navigation" aria-expanded="false">
|
|
224
|
+
<span aria-hidden="true"></span><span aria-hidden="true"></span><span aria-hidden="true"></span>
|
|
225
|
+
</button>
|
|
226
|
+
<div class="shell">
|
|
227
|
+
<aside class="sidebar">
|
|
228
|
+
<div class="sidebar-head">
|
|
229
|
+
<a class="brand" href="./" aria-label="acpx docs home">
|
|
230
|
+
<span class="mark" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.8 6.8 10 12l-5.2 5.2" stroke="#7dd3fc" stroke-width="2.7" stroke-linecap="round" stroke-linejoin="round"/><path d="M13.2 7.2h2.9c1.7 0 3.1 1.4 3.1 3.1v.5c0 1.7-1.4 3.1-3.1 3.1h-1.4c-1.7 0-3.1 1.4-3.1 3.1v.5" stroke="#a78bfa" stroke-width="1.8" stroke-linecap="round"/><circle cx="13.2" cy="7.2" r="1.6" fill="#7dd3fc"/><circle cx="19.2" cy="12" r="1.6" fill="#a78bfa"/><rect class="cursor" x="13.2" y="16.2" width="6.6" height="2.5" rx="1.25" fill="#e0e7ff"/></svg></span>
|
|
231
|
+
<span><strong>acpx</strong><small>ACP CLI docs</small></span>
|
|
232
|
+
</a>
|
|
233
|
+
<button class="theme-toggle" type="button" aria-label="Toggle dark mode" aria-pressed="false" data-theme-toggle>
|
|
234
|
+
<svg class="theme-icon-moon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.6 12.1A6.5 6.5 0 0 1 7.4 2.7a6.5 6.5 0 1 0 7.2 9.4z" fill="currentColor"/></svg>
|
|
235
|
+
<svg class="theme-icon-sun" viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="3.4" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="10" y1="2" x2="10" y2="4"/><line x1="10" y1="16" x2="10" y2="18"/><line x1="2" y1="10" x2="4" y2="10"/><line x1="16" y1="10" x2="18" y2="10"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="14.4" y1="14.4" x2="15.8" y2="15.8"/><line x1="4.2" y1="15.8" x2="5.6" y2="14.4"/><line x1="14.4" y1="5.6" x2="15.8" y2="4.2"/></g></svg>
|
|
236
|
+
</button>
|
|
237
|
+
</div>
|
|
238
|
+
<label class="search"><span>Search</span><input id="doc-search" type="search" placeholder="sessions, flows, json…"></label>
|
|
239
|
+
<nav><section><h2>Start</h2><a class="nav-link" href="./">Overview</a><a class="nav-link" href="install.html">Install</a><a class="nav-link" href="quickstart.html">Quickstart</a></section><section><h2>Agents</h2><a class="nav-link" href="agents.html">Agents</a><a class="nav-link" href="custom-agents.html">Custom agents</a></section><section><h2>Sessions</h2><a class="nav-link" href="sessions.html">Sessions</a><a class="nav-link" href="prompting.html">Prompting</a><a class="nav-link" href="session-control.html">Session control</a></section><section><h2>Output & Policy</h2><a class="nav-link" href="output-formats.html">Output formats</a><a class="nav-link" href="permissions.html">Permissions</a><a class="nav-link" href="config.html">Config</a></section><section><h2>Flows</h2><a class="nav-link" href="flows.html">Flows</a></section><section><h2>Reference</h2><a class="nav-link active" href="CLI.html">CLI Reference</a><a class="nav-link" href="exit-codes.html">Exit codes</a><a class="nav-link" href="VISION.html">Vision</a></section></nav>
|
|
240
|
+
</aside>
|
|
241
|
+
<main>
|
|
242
|
+
<header class="hero">
|
|
243
|
+
<div class="hero-text">
|
|
244
|
+
<p class="eyebrow">Reference</p>
|
|
245
|
+
<h1>acpx CLI Reference</h1>
|
|
246
|
+
</div>
|
|
247
|
+
<div class="hero-meta">
|
|
248
|
+
<a class="repo" href="https://github.com/scottzx/1acp" rel="noopener">GitHub</a>
|
|
249
|
+
<a class="edit" href="https://github.com/scottzx/1acp/edit/main/packages/runtime/docs/CLI.md" rel="noopener">Edit page</a>
|
|
250
|
+
</div>
|
|
251
|
+
</header>
|
|
252
|
+
<div class="doc-grid">
|
|
253
|
+
<article class="doc"><h2 id="overview"><a class="anchor" href="#overview" aria-label="Anchor link">#</a>Overview</h2>
|
|
254
|
+
<p><code>acpx</code> is a headless ACP client for scriptable agent workflows.</p>
|
|
255
|
+
<p>Default behavior is conversational:</p>
|
|
256
|
+
<ul>
|
|
257
|
+
<li>prompt commands use a persisted session</li>
|
|
258
|
+
<li>session lookup is scoped by agent command and working directory (plus optional session name)</li>
|
|
259
|
+
<li><code>exec</code> runs one prompt in a temporary session</li>
|
|
260
|
+
</ul>
|
|
261
|
+
<h2 id="full-command-grammar"><a class="anchor" href="#full-command-grammar" aria-label="Anchor link">#</a>Full command grammar</h2>
|
|
262
|
+
<p>Global options apply to all commands.</p>
|
|
263
|
+
<pre><code class="language-bash">acpx [global_options] [prompt_text...]
|
|
264
|
+
acpx [global_options] prompt [prompt_options] [prompt_text...]
|
|
265
|
+
acpx [global_options] exec [prompt_options] [prompt_text...]
|
|
266
|
+
acpx [global_options] compare <span class="hl-op"><</span>agent<span class="hl-op">></span>... <span class="hl-str">'<prompt_text>'</span>
|
|
267
|
+
acpx [global_options] compare <span class="hl-op"><</span>agent<span class="hl-op">></span>... <span class="hl-flag">--file</span> <span class="hl-op"><</span>path<span class="hl-op">></span>
|
|
268
|
+
acpx [global_options] flow run <span class="hl-op"><</span>file<span class="hl-op">></span> [<span class="hl-flag">--input-json</span> <span class="hl-op"><</span>json<span class="hl-op">></span> <span class="hl-op">|</span> <span class="hl-flag">--input-file</span> <span class="hl-op"><</span>path<span class="hl-op">></span>] [<span class="hl-flag">--default-agent</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
269
|
+
acpx [global_options] cancel [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
270
|
+
acpx [global_options] set-mode <span class="hl-op"><</span>mode<span class="hl-op">></span> [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
271
|
+
acpx [global_options] set <span class="hl-op"><</span>key<span class="hl-op">></span> <span class="hl-op"><</span>value<span class="hl-op">></span> [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
272
|
+
acpx [global_options] status [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
273
|
+
acpx [global_options] sessions [list <span class="hl-op">|</span> new [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> ensure [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> close [name] <span class="hl-op">|</span> show [name] <span class="hl-op">|</span> history [name] [<span class="hl-flag">--limit</span> <span class="hl-op"><</span>count<span class="hl-op">></span>] <span class="hl-op">|</span> watch [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] [<span class="hl-flag">--cursor</span> <span class="hl-op"><</span>cursor<span class="hl-op">></span>] <span class="hl-op">|</span> export [name] <span class="hl-flag">--output</span> <span class="hl-op"><</span>path<span class="hl-op">></span> <span class="hl-op">|</span> import <span class="hl-op"><</span>archive<span class="hl-op">></span> [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] [<span class="hl-flag">--cwd</span> <span class="hl-op"><</span>dir<span class="hl-op">></span>]]
|
|
274
|
+
acpx [global_options] config [show <span class="hl-op">|</span> init]
|
|
275
|
+
|
|
276
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> [prompt_options] [prompt_text...]
|
|
277
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> prompt [prompt_options] [prompt_text...]
|
|
278
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> exec [prompt_options] [prompt_text...]
|
|
279
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> cancel [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
280
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> set-mode <span class="hl-op"><</span>mode<span class="hl-op">></span> [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
281
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> set <span class="hl-op"><</span>key<span class="hl-op">></span> <span class="hl-op"><</span>value<span class="hl-op">></span> [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
282
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> status [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
283
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions [list <span class="hl-op">|</span> new [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> ensure [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> close [name] <span class="hl-op">|</span> show [name] <span class="hl-op">|</span> history [name] [<span class="hl-flag">--limit</span> <span class="hl-op"><</span>count<span class="hl-op">></span>] <span class="hl-op">|</span> watch [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] [<span class="hl-flag">--cursor</span> <span class="hl-op"><</span>cursor<span class="hl-op">></span>] <span class="hl-op">|</span> export [name] <span class="hl-flag">--output</span> <span class="hl-op"><</span>path<span class="hl-op">></span> <span class="hl-op">|</span> import <span class="hl-op"><</span>archive<span class="hl-op">></span> [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] [<span class="hl-flag">--cwd</span> <span class="hl-op"><</span>dir<span class="hl-op">></span>]]</code></pre>
|
|
284
|
+
<p>The global <code>--mcp-config <path></code> option loads an external JSON file's <code>mcpServers</code> array for the invocation, replacing project/global MCP configuration. Relative paths resolve from <code>--cwd</code>. For a persistent session, close the existing session before switching its MCP config.</p>
|
|
285
|
+
<p><code><agent></code> can be:</p>
|
|
286
|
+
<ul>
|
|
287
|
+
<li>built-in friendly name from <a href="https://github.com/openclaw/acpx/blob/main/README.md">the README</a></li>
|
|
288
|
+
<li>unknown token (treated as raw command)</li>
|
|
289
|
+
<li>overridden by <code>--agent <command></code> escape hatch</li>
|
|
290
|
+
</ul>
|
|
291
|
+
<p>Additional built-in agent docs live in <a href="agents.html">the Agents page</a>.</p>
|
|
292
|
+
<p>Prompt options:</p>
|
|
293
|
+
<pre><code class="language-bash"><span class="hl-flag">-s</span>, <span class="hl-flag">--session</span> <span class="hl-op"><</span>name<span class="hl-op">></span> Use named session instead of cwd default
|
|
294
|
+
<span class="hl-flag">--no-wait</span> Queue prompt and return immediately if session is busy
|
|
295
|
+
<span class="hl-flag">-f</span>, <span class="hl-flag">--file</span> <span class="hl-op"><</span>path<span class="hl-op">></span> Read prompt text from file (<span class="hl-str">`-`</span> means stdin)</code></pre>
|
|
296
|
+
<p>Notes:</p>
|
|
297
|
+
<ul>
|
|
298
|
+
<li>Top-level <code>prompt</code>, <code>exec</code>, <code>cancel</code>, <code>set-mode</code>, <code>set</code>, <code>sessions</code>, and bare <code>acpx <prompt></code> default to <code>codex</code>.</li>
|
|
299
|
+
<li>Top-level <code>flow run <file></code> executes a user-authored workflow module and persists run state under <code>~/.acpx/flows/runs/</code>.</li>
|
|
300
|
+
<li>If a prompt argument is omitted, <code>acpx</code> reads prompt text from stdin when piped.</li>
|
|
301
|
+
<li><code>--file</code> works for implicit prompt, <code>prompt</code>, and <code>exec</code> commands.</li>
|
|
302
|
+
<li>After an agent name, <code>--file</code> may appear before or after <code>prompt</code>/<code>exec</code>; an explicit value on the subcommand wins. <code>--no-wait</code> works before or after <code>prompt</code>, and omission still waits normally.</li>
|
|
303
|
+
<li><code>acpx</code> with no args in an interactive terminal shows help.</li>
|
|
304
|
+
</ul>
|
|
305
|
+
<h2 id="flow-run-subcommand"><a class="anchor" href="#flow-run-subcommand" aria-label="Anchor link">#</a><code>flow run</code> subcommand</h2>
|
|
306
|
+
<pre><code class="language-bash">acpx [global_options] flow run <span class="hl-op"><</span>file<span class="hl-op">></span> [<span class="hl-flag">--input-json</span> <span class="hl-op"><</span>json<span class="hl-op">></span> <span class="hl-op">|</span> <span class="hl-flag">--input-file</span> <span class="hl-op"><</span>path<span class="hl-op">></span>] [<span class="hl-flag">--default-agent</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]</code></pre>
|
|
307
|
+
<ul>
|
|
308
|
+
<li>Runs a user-authored workflow module step by step through the <code>acpx/flows</code> runtime.</li>
|
|
309
|
+
<li>Persists run artifacts under <code>~/.acpx/flows/runs/<runId>/</code>.</li>
|
|
310
|
+
<li>Reuses one implicit main ACP session by default for non-isolated <code>acp</code> nodes.</li>
|
|
311
|
+
<li><code>acp</code> nodes may override their working directory per step, which lets flows prepare an isolated workspace with an action node and then keep the agent session inside that cwd.</li>
|
|
312
|
+
<li><code>acp</code> and <code>action</code> nodes use the global <code>--timeout</code> value as their default step timeout. If <code>--timeout</code> is omitted, flows default to 15 minutes per active step.</li>
|
|
313
|
+
<li>Flows may declare permission requirements. If a flow requires an explicit grant such as <code>approve-all</code>, <code>acpx</code> fails fast before starting the flow and tells you which permission flag to pass.</li>
|
|
314
|
+
<li><code>--input-json</code> passes flow input inline as JSON.</li>
|
|
315
|
+
<li><code>--input-file</code> reads flow input JSON from disk.</li>
|
|
316
|
+
<li><code>--default-agent</code> supplies the default agent profile for <code>acp</code> nodes that do not pin one.</li>
|
|
317
|
+
<li>The file is always provided by the caller at runtime. <code>acpx</code> does not require any built-in flow registry.</li>
|
|
318
|
+
<li>The source repo includes example flow files under <code>examples/flows/</code>, including a larger PR-triage example under <code>examples/flows/pr-triage/</code>.</li>
|
|
319
|
+
</ul>
|
|
320
|
+
<p>Example invocations:</p>
|
|
321
|
+
<pre><code class="language-bash">acpx flow run ./my-flow.ts <span class="hl-flag">--input-file</span> ./flow-input.json
|
|
322
|
+
|
|
323
|
+
acpx flow run examples/flows/branch.flow.ts \
|
|
324
|
+
<span class="hl-flag">--input-json</span> <span class="hl-str">'{"task":"FIX: add a regression test for the reconnect bug"}'</span>
|
|
325
|
+
|
|
326
|
+
acpx <span class="hl-flag">--approve-all</span> flow run examples/flows/pr-triage/pr-triage.flow.ts \
|
|
327
|
+
<span class="hl-flag">--input-json</span> <span class="hl-str">'{"repo":"openclaw/acpx","prNumber":150}'</span></code></pre>
|
|
328
|
+
<p>The PR-triage example is only an example workflow. It can post GitHub comments or close a PR if you run it against a live repository.</p>
|
|
329
|
+
<p><code>acpx help</code> and <code>acpx help <command></code> display command help without sending an agent prompt.</p>
|
|
330
|
+
<h2 id="global-options"><a class="anchor" href="#global-options" aria-label="Anchor link">#</a>Global options</h2>
|
|
331
|
+
<p>All global options:</p>
|
|
332
|
+
<table><thead><tr><th>Option</th><th>Description</th><th>Details</th></tr></thead><tbody><tr><td><code>--agent <command></code></td><td>Raw ACP agent command (escape hatch)</td><td>Do not combine with positional agent token.</td></tr><tr><td><code>--cwd <dir></code></td><td>Working directory</td><td>Defaults to current directory. Stored as absolute path for scoping.</td></tr><tr><td><code>--approve-all</code></td><td>Approve remaining tool requests</td><td>Per-tool policy takes precedence over permission mode <code>approve-all</code>.</td></tr><tr><td><code>--approve-reads</code></td><td>Approve remaining reads/searches; prompt for others</td><td>Default mode; per-tool policy takes precedence.</td></tr><tr><td><code>--deny-all</code></td><td>Deny remaining tool requests</td><td>Per-tool policy takes precedence over permission mode <code>deny-all</code>.</td></tr><tr><td><code>--format <fmt></code></td><td>Output format</td><td><code>text</code> (default), <code>json</code>, <code>quiet</code>.</td></tr><tr><td><code>--suppress-reads</code></td><td>Suppress read file contents</td><td>Replaces raw read payloads with <code>[read output suppressed]</code>.</td></tr><tr><td><code>--json-strict</code></td><td>Strict JSON mode</td><td>Requires <code>--format json</code>; suppresses non-JSON stderr output.</td></tr><tr><td><code>--no-fs</code></td><td>Disable ACP filesystem capabilities</td><td>Advertises <code>clientCapabilities.fs.readTextFile</code> and <code>writeTextFile</code> as <code>false</code> during ACP initialize for new agent clients.</td></tr><tr><td><code>--no-terminal</code></td><td>Disable ACP terminal capability</td><td>Advertises <code>clientCapabilities.terminal: false</code> during ACP initialize for new agent clients.</td></tr><tr><td><code>--non-interactive-permissions <policy></code></td><td>Non-TTY prompt policy</td><td><code>deny</code> (default) or <code>fail</code> when approval prompt cannot be shown.</td></tr><tr><td><code>--permission-policy <json-or-file></code></td><td>Per-tool permission policy</td><td>JSON object or file path with <code>autoApprove</code>, <code>autoDeny</code>, <code>escalate</code>, and optional <code>defaultAction</code> (<code>approve</code>, <code>deny</code>, <code>escalate</code>). Alias: <code>--policy</code>.</td></tr><tr><td><code>--timeout <seconds></code></td><td>Max wait time for agent response</td><td>Must be positive. Decimal seconds allowed.</td></tr><tr><td><code>--ttl <seconds></code></td><td>Queue owner idle TTL before shutdown</td><td>Default <code>300</code>. <code>0</code> disables TTL.</td></tr><tr><td><code>--model <id></code></td><td>Set agent model</td><td>Claude-compatible adapters may consume session creation metadata; other agents must advertise a model config option or legacy <code>models</code> metadata.</td></tr><tr><td><code>--verbose</code></td><td>Enable verbose logs</td><td>Prints ACP/debug details to stderr.</td></tr></tbody></table>
|
|
333
|
+
<p>Permission flags are mutually exclusive. Using more than one of <code>--approve-all</code>, <code>--approve-reads</code>, <code>--deny-all</code> is a usage error.</p>
|
|
334
|
+
<p>For model configuration, acpx prefers a valid select control with both <code>category: "model"</code> and <code>id: "model"</code>. Otherwise it uses the first valid model-category control, including custom IDs, then the legacy <code>id: "model"</code> fallback. This keeps provider selectors in the same category from taking over the actual model control.</p>
|
|
335
|
+
<h3 id="global-option-examples"><a class="anchor" href="#global-option-examples" aria-label="Anchor link">#</a>Global option examples</h3>
|
|
336
|
+
<pre><code class="language-bash">acpx <span class="hl-flag">--approve-all</span> codex <span class="hl-str">'apply this patch and run tests'</span>
|
|
337
|
+
acpx <span class="hl-flag">--approve-reads</span> codex <span class="hl-str">'inspect the repo and propose a plan'</span>
|
|
338
|
+
acpx <span class="hl-flag">--deny-all</span> codex <span class="hl-str">'summarize this code without running tools'</span>
|
|
339
|
+
acpx <span class="hl-flag">--non-interactive-permissions</span> fail codex <span class="hl-str">'fail fast when prompt cannot be shown'</span>
|
|
340
|
+
acpx <span class="hl-flag">--policy</span> <span class="hl-str">'{"escalate":["execute"],"defaultAction":"deny"}'</span> <span class="hl-flag">--format</span> json codex exec <span class="hl-str">'run tests'</span>
|
|
341
|
+
|
|
342
|
+
acpx <span class="hl-flag">--cwd</span> ~/repos/api codex <span class="hl-str">'review auth middleware'</span>
|
|
343
|
+
acpx <span class="hl-flag">--format</span> json codex exec <span class="hl-str">'summarize open TODO items'</span>
|
|
344
|
+
acpx <span class="hl-flag">--format</span> json <span class="hl-flag">--json-strict</span> codex exec <span class="hl-str">'machine-safe JSON output'</span>
|
|
345
|
+
acpx <span class="hl-flag">--no-fs</span> codex exec <span class="hl-str">'use agent-native file operations'</span>
|
|
346
|
+
acpx <span class="hl-flag">--no-terminal</span> codex exec <span class="hl-str">'summarize without terminal capability'</span>
|
|
347
|
+
acpx <span class="hl-flag">--timeout</span> <span class="hl-num">120</span> codex <span class="hl-str">'investigate flaky test failures'</span>
|
|
348
|
+
acpx <span class="hl-flag">--ttl</span> <span class="hl-num">30</span> codex <span class="hl-str">'keep queue owner warm for quick follow-up'</span>
|
|
349
|
+
acpx <span class="hl-flag">--verbose</span> codex <span class="hl-str">'debug adapter startup issues'</span></code></pre>
|
|
350
|
+
<h2 id="agent-commands"><a class="anchor" href="#agent-commands" aria-label="Anchor link">#</a>Agent commands</h2>
|
|
351
|
+
<p>Each agent command supports the same shape.</p>
|
|
352
|
+
<h3 id="pi"><a class="anchor" href="#pi" aria-label="Anchor link">#</a><code>pi</code></h3>
|
|
353
|
+
<pre><code class="language-bash">acpx [global_options] pi [prompt_options] [prompt_text...]
|
|
354
|
+
acpx [global_options] pi prompt [prompt_options] [prompt_text...]
|
|
355
|
+
acpx [global_options] pi exec [prompt_text...]
|
|
356
|
+
acpx [global_options] pi sessions [list <span class="hl-op">|</span> new [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> ensure [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> close [name]]</code></pre>
|
|
357
|
+
<p>Built-in command mapping: <code>pi -> npx pi-acp</code></p>
|
|
358
|
+
<h3 id="openclaw"><a class="anchor" href="#openclaw" aria-label="Anchor link">#</a><code>openclaw</code></h3>
|
|
359
|
+
<pre><code class="language-bash">acpx [global_options] openclaw [prompt_options] [prompt_text...]
|
|
360
|
+
acpx [global_options] openclaw prompt [prompt_options] [prompt_text...]
|
|
361
|
+
acpx [global_options] openclaw exec [prompt_text...]
|
|
362
|
+
acpx [global_options] openclaw sessions [list <span class="hl-op">|</span> new [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> ensure [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> close [name]]</code></pre>
|
|
363
|
+
<p>Built-in command mapping: <code>openclaw -> openclaw acp</code></p>
|
|
364
|
+
<p>For repo-local OpenClaw checkouts, override the built-in command in config:</p>
|
|
365
|
+
<pre><code class="language-json"><span class="hl-op">{</span>
|
|
366
|
+
<span class="hl-prop">"agents"</span><span class="hl-op">:</span> <span class="hl-op">{</span>
|
|
367
|
+
<span class="hl-prop">"openclaw"</span><span class="hl-op">:</span> <span class="hl-op">{</span>
|
|
368
|
+
<span class="hl-prop">"command"</span><span class="hl-op">:</span> <span class="hl-str">"env OPENCLAW_HIDE_BANNER=1 OPENCLAW_SUPPRESS_NOTES=1 node scripts/run-node.mjs acp --url ws://127.0.0.1:18789 --token-file ~/.openclaw/gateway.token --session agent:main:main"</span>
|
|
369
|
+
<span class="hl-op">}</span>
|
|
370
|
+
<span class="hl-op">}</span>
|
|
371
|
+
<span class="hl-op">}</span></code></pre>
|
|
372
|
+
<h3 id="codex"><a class="anchor" href="#codex" aria-label="Anchor link">#</a><code>codex</code></h3>
|
|
373
|
+
<pre><code class="language-bash">acpx [global_options] codex [prompt_options] [prompt_text...]
|
|
374
|
+
acpx [global_options] codex prompt [prompt_options] [prompt_text...]
|
|
375
|
+
acpx [global_options] codex exec [prompt_text...]
|
|
376
|
+
acpx [global_options] codex sessions [list <span class="hl-op">|</span> new [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> ensure [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> close [name]]</code></pre>
|
|
377
|
+
<p>Built-in command mapping: <code>codex -> npx -y @agentclientprotocol/codex-acp</code></p>
|
|
378
|
+
<h3 id="claude"><a class="anchor" href="#claude" aria-label="Anchor link">#</a><code>claude</code></h3>
|
|
379
|
+
<pre><code class="language-bash">acpx [global_options] claude [prompt_options] [prompt_text...]
|
|
380
|
+
acpx [global_options] claude prompt [prompt_options] [prompt_text...]
|
|
381
|
+
acpx [global_options] claude exec [prompt_text...]
|
|
382
|
+
acpx [global_options] claude sessions [list <span class="hl-op">|</span> new [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> ensure [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-op">|</span> close [name]]</code></pre>
|
|
383
|
+
<p>Built-in command mapping: <code>claude -> npx -y @agentclientprotocol/claude-agent-acp</code></p>
|
|
384
|
+
<p>Additional built-in agent docs live in <a href="agents.html">the Agents page</a>.</p>
|
|
385
|
+
<h3 id="custom-positional-agents"><a class="anchor" href="#custom-positional-agents" aria-label="Anchor link">#</a>Custom positional agents</h3>
|
|
386
|
+
<p>Unknown agent names are treated as raw commands:</p>
|
|
387
|
+
<pre><code class="language-bash">acpx [global_options] my-agent [prompt_options] [prompt_text...]
|
|
388
|
+
acpx [global_options] my-agent exec [prompt_text...]
|
|
389
|
+
acpx [global_options] my-agent sessions</code></pre>
|
|
390
|
+
<h2 id="prompt-subcommand-explicit"><a class="anchor" href="#prompt-subcommand-explicit" aria-label="Anchor link">#</a><code>prompt</code> subcommand (explicit)</h2>
|
|
391
|
+
<p>Persistent-session prompt command:</p>
|
|
392
|
+
<pre><code class="language-bash">acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> prompt [prompt_options] [prompt_text...]
|
|
393
|
+
acpx [global_options] prompt [prompt_options] [prompt_text...]</code></pre>
|
|
394
|
+
<p>Behavior:</p>
|
|
395
|
+
<ul>
|
|
396
|
+
<li>Finds existing session for scope key <code>(agentCommand, cwd, name?)</code></li>
|
|
397
|
+
<li>Does not auto-create sessions; missing scope exits with code <code>4</code> and guidance to run <code>sessions new</code></li>
|
|
398
|
+
<li>Sends prompt on resumed/new session</li>
|
|
399
|
+
<li>If another prompt is already running for that session, submits to the running queue owner instead of starting a second ACP subprocess</li>
|
|
400
|
+
<li>By default waits for queued prompt completion; <code>--no-wait</code> returns after queue acknowledgement</li>
|
|
401
|
+
<li>Updates session metadata after completion</li>
|
|
402
|
+
</ul>
|
|
403
|
+
<p>The agent command itself also has an implicit prompt form:</p>
|
|
404
|
+
<pre><code class="language-bash">acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> [prompt_options] [prompt_text...]
|
|
405
|
+
acpx [global_options] [prompt_text...] <span class="hl-com"># defaults to codex</span></code></pre>
|
|
406
|
+
<h2 id="exec-subcommand"><a class="anchor" href="#exec-subcommand" aria-label="Anchor link">#</a><code>exec</code> subcommand</h2>
|
|
407
|
+
<p>One-shot prompt (no saved session):</p>
|
|
408
|
+
<pre><code class="language-bash">acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> exec [prompt_options] [prompt_text...]
|
|
409
|
+
acpx [global_options] exec [prompt_options] [prompt_text...] <span class="hl-com"># defaults to codex</span></code></pre>
|
|
410
|
+
<p>Behavior:</p>
|
|
411
|
+
<ul>
|
|
412
|
+
<li>Creates temporary ACP session</li>
|
|
413
|
+
<li>Applies <code>--model</code>, then each repeatable <code>--config-option <key=value></code>, before prompting</li>
|
|
414
|
+
<li>Uses the temporary session's latest catalog update received during creation for startup selections, including removal of model support</li>
|
|
415
|
+
<li>Sends prompt once</li>
|
|
416
|
+
<li>Does not write/use a saved session record</li>
|
|
417
|
+
<li>Supports prompt text from args, stdin, <code>--file <path></code>, and <code>--file -</code></li>
|
|
418
|
+
<li>Stops without prompting if the adapter rejects a requested config option</li>
|
|
419
|
+
</ul>
|
|
420
|
+
<pre><code class="language-bash">acpx <span class="hl-flag">--model</span> gpt-<span class="hl-num">5</span>.<span class="hl-num">4</span> codex exec \
|
|
421
|
+
<span class="hl-flag">--config-option</span> reasoning_effort=high \
|
|
422
|
+
<span class="hl-str">'review this checkout'</span></code></pre>
|
|
423
|
+
<h2 id="compare-subcommand"><a class="anchor" href="#compare-subcommand" aria-label="Anchor link">#</a><code>compare</code> subcommand</h2>
|
|
424
|
+
<p>One-shot prompt against multiple agents:</p>
|
|
425
|
+
<pre><code class="language-bash">acpx [global_options] compare <span class="hl-op"><</span>agent<span class="hl-op">></span>... <span class="hl-str">'<prompt_text>'</span>
|
|
426
|
+
acpx [global_options] compare <span class="hl-op"><</span>agent<span class="hl-op">></span>... <span class="hl-flag">--file</span> <span class="hl-op"><</span>path<span class="hl-op">></span>
|
|
427
|
+
acpx [global_options] compare <span class="hl-op"><</span>agent<span class="hl-op">></span>... -- prompt words after the delimiter</code></pre>
|
|
428
|
+
<p>Behavior:</p>
|
|
429
|
+
<ul>
|
|
430
|
+
<li>Runs each agent with the same temporary <code>exec</code>-style ACP session.</li>
|
|
431
|
+
<li>Uses the same global execution controls as <code>exec</code>, including <code>--cwd</code>, <code>--timeout</code>, permission flags, <code>--policy</code>, auth, terminal advertising, retries, model/system options, and <code>--format</code>.</li>
|
|
432
|
+
<li><code>--format text</code> prints one summary table row per agent.</li>
|
|
433
|
+
<li><code>--format json</code> or command-local <code>--json</code> prints a <code>CompareRow[]</code> summary payload.</li>
|
|
434
|
+
<li><code>--format quiet</code> prints <code><agent>\t<status></code> per row.</li>
|
|
435
|
+
<li>Agents run serially in the requested workspace. The command does not create saved sessions or separate compare transcript directories. Use <code>--format json</code> when you need a machine-readable artifact.</li>
|
|
436
|
+
</ul>
|
|
437
|
+
<p><code>CompareRow.status</code> is <code>ok</code>, <code>cancelled</code>, <code>permission_denied</code>, or <code>error</code>.</p>
|
|
438
|
+
<h2 id="cancel-command"><a class="anchor" href="#cancel-command" aria-label="Anchor link">#</a><code>cancel</code> command</h2>
|
|
439
|
+
<pre><code class="language-bash">acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> cancel [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
440
|
+
acpx [global_options] cancel [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-com"># defaults to codex</span></code></pre>
|
|
441
|
+
<p>Behavior:</p>
|
|
442
|
+
<ul>
|
|
443
|
+
<li>Sends cooperative <code>session/cancel</code> through queue-owner IPC when a prompt is running.</li>
|
|
444
|
+
<li>If no prompt is running, prints <code>nothing to cancel</code> and exits success.</li>
|
|
445
|
+
</ul>
|
|
446
|
+
<h2 id="set-mode-command"><a class="anchor" href="#set-mode-command" aria-label="Anchor link">#</a><code>set-mode</code> command</h2>
|
|
447
|
+
<pre><code class="language-bash">acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> set-mode <span class="hl-op"><</span>mode<span class="hl-op">></span> [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
448
|
+
acpx [global_options] set-mode <span class="hl-op"><</span>mode<span class="hl-op">></span> [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-com"># defaults to codex</span></code></pre>
|
|
449
|
+
<p>Behavior:</p>
|
|
450
|
+
<ul>
|
|
451
|
+
<li>Calls ACP <code>session/set_mode</code>.</li>
|
|
452
|
+
<li><code><mode></code> values are adapter-defined (not globally standardized across all ACP adapters).</li>
|
|
453
|
+
<li>Unsupported mode ids are rejected by the adapter (often as <code>Invalid params</code>).</li>
|
|
454
|
+
<li>Routes through queue-owner IPC when an owner is active.</li>
|
|
455
|
+
<li>Falls back to a direct client reconnect when no owner is running.</li>
|
|
456
|
+
<li>When fresh fallback is allowed, replaces the previous saved mode without replaying it; other saved settings restore first. A rejected replacement keeps the previous mode preference.</li>
|
|
457
|
+
<li>Prompt reconnect uses model metadata received while restoring a saved mode, including changed model controls and removed model support.</li>
|
|
458
|
+
</ul>
|
|
459
|
+
<h2 id="set-command"><a class="anchor" href="#set-command" aria-label="Anchor link">#</a><code>set</code> command</h2>
|
|
460
|
+
<pre><code class="language-bash">acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> set <span class="hl-op"><</span>key<span class="hl-op">></span> <span class="hl-op"><</span>value<span class="hl-op">></span> [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>]
|
|
461
|
+
acpx [global_options] set <span class="hl-op"><</span>key<span class="hl-op">></span> <span class="hl-op"><</span>value<span class="hl-op">></span> [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] <span class="hl-com"># defaults to codex</span></code></pre>
|
|
462
|
+
<p>Behavior:</p>
|
|
463
|
+
<ul>
|
|
464
|
+
<li>Calls ACP <code>session/set_config_option</code>.</li>
|
|
465
|
+
<li>Routes through queue-owner IPC when an owner is active.</li>
|
|
466
|
+
<li>Falls back to a direct client reconnect when no owner is running.</li>
|
|
467
|
+
<li><strong><code>set model <id></code></strong>: Uses the advertised model config option through <code>session/set_config_option</code>; adapters that explicitly advertise legacy <code>models</code> metadata use <code>session/set_model</code>.</li>
|
|
468
|
+
<li>A config key named <code>mode</code> keeps config-option transport; use <code>set-mode</code> for the separate legacy mode control.</li>
|
|
469
|
+
<li>Saves accepted values for existing config selections, including reasoning effort adjusted or removed by a model switch; does not pin unselected defaults. An acknowledgement that omits the option catalog retains the advertised options and the accepted value; an explicit empty catalog removes those options.</li>
|
|
470
|
+
<li>Restores saved model and config selections after reconnect, before the next prompt; already loaded sessions are reused without replay. Prompts without <code>--model</code> retain the current selection, including changes made through <code>set model</code>.</li>
|
|
471
|
+
</ul>
|
|
472
|
+
<h2 id="sessions-subcommand"><a class="anchor" href="#sessions-subcommand" aria-label="Anchor link">#</a><code>sessions</code> subcommand</h2>
|
|
473
|
+
<pre><code class="language-bash">acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions
|
|
474
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions list
|
|
475
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions list [<span class="hl-flag">--cursor</span> <span class="hl-op"><</span>cursor<span class="hl-op">></span>] [<span class="hl-flag">--filter-cwd</span> <span class="hl-op"><</span>dir<span class="hl-op">></span>] [<span class="hl-flag">--local</span>]
|
|
476
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions new
|
|
477
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions new <span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>
|
|
478
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions ensure
|
|
479
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions ensure <span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>
|
|
480
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions close
|
|
481
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions close <span class="hl-op"><</span>name<span class="hl-op">></span>
|
|
482
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions show
|
|
483
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions show <span class="hl-op"><</span>name<span class="hl-op">></span>
|
|
484
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions history
|
|
485
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions history <span class="hl-op"><</span>name<span class="hl-op">></span> [<span class="hl-flag">--limit</span> <span class="hl-op"><</span>count<span class="hl-op">></span>]
|
|
486
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions watch [<span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] [<span class="hl-flag">--cursor</span> <span class="hl-op"><</span>cursor<span class="hl-op">></span>]
|
|
487
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions export [name] <span class="hl-flag">--output</span> <span class="hl-op"><</span>path<span class="hl-op">></span> [<span class="hl-flag">--cwd</span> <span class="hl-op"><</span>dir<span class="hl-op">></span>]
|
|
488
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions import <span class="hl-op"><</span>archive<span class="hl-op">></span> [<span class="hl-flag">--name</span> <span class="hl-op"><</span>name<span class="hl-op">></span>] [<span class="hl-flag">--cwd</span> <span class="hl-op"><</span>dir<span class="hl-op">></span>]
|
|
489
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> sessions prune [<span class="hl-flag">--dry-run</span>] [<span class="hl-flag">--before</span> <span class="hl-op"><</span>date<span class="hl-op">></span> <span class="hl-op">|</span> <span class="hl-flag">--older-than</span> <span class="hl-op"><</span>days<span class="hl-op">></span>] [<span class="hl-flag">--include-history</span>]
|
|
490
|
+
|
|
491
|
+
acpx [global_options] sessions ... <span class="hl-com"># defaults to codex</span></code></pre>
|
|
492
|
+
<p>Behavior:</p>
|
|
493
|
+
<ul>
|
|
494
|
+
<li><code>sessions</code> and <code>sessions list</code> are equivalent</li>
|
|
495
|
+
<li><code>--local</code>, <code>--filter-cwd</code>, and the list <code>--cursor</code> may appear on <code>sessions</code> or <code>list</code>; explicit <code>list</code> values win. Combining <code>--local</code> with a cursor is rejected across either placement.</li>
|
|
496
|
+
<li>list uses ACP <code>session/list</code> when the agent advertises</li>
|
|
497
|
+
<p><code>sessionCapabilities.list</code>, returning agent-native <code>SessionInfo</code> metadata and <code>nextCursor</code> in JSON output</p>
|
|
498
|
+
<li><code>sessions list --cursor <cursor></code> fetches an agent-side page from an ACP</li>
|
|
499
|
+
<p>cursor returned by a prior list response</p>
|
|
500
|
+
<li><code>sessions list --filter-cwd <dir></code> sends the ACP cwd filter; relative values</li>
|
|
501
|
+
<p>resolve against global <code>--cwd</code></p>
|
|
502
|
+
<li><code>sessions list --local</code> reads saved acpx records for selected <code>agentCommand</code></li>
|
|
503
|
+
<p>instead of contacting the agent</p>
|
|
504
|
+
<li>when the agent does not support <code>session/list</code>, list falls back to local saved</li>
|
|
505
|
+
<p>records unless agent-side list filters were requested</p>
|
|
506
|
+
<li><code>sessions new</code> creates a fresh cwd-scoped default session; a failed creation leaves the previous session open</li>
|
|
507
|
+
<li><code>sessions new --name <name></code> creates a fresh named session for cwd</li>
|
|
508
|
+
<li>creating a fresh session soft-closes the previous open session in that scope (if present)</li>
|
|
509
|
+
<li>When <code>--resume-session <id></code> selects an existing local record for the same resolved command, <code>sessions new</code> and a creating <code>sessions ensure</code> retire that record's owner before loading its associated ACP session, including changes to cwd or name. A successful resume reopens the same record; a failed resume leaves it closed. Resuming a provider session without a matching local record creates a new independent local ID.</li>
|
|
510
|
+
<li>text and quiet output print the local <code>acpxRecordId</code>; JSON output also includes</li>
|
|
511
|
+
<p><code>acpxSessionId</code> and, when the adapter exposes one, <code>agentSessionId</code></p>
|
|
512
|
+
<li><code>sessions ensure</code> returns the nearest matching active session or creates one for cwd</li>
|
|
513
|
+
<li><code>sessions ensure --name <name></code> does the same for named sessions</li>
|
|
514
|
+
<li><code>sessions close</code> soft-closes the current cwd default session</li>
|
|
515
|
+
<li><code>sessions close <name></code> soft-closes current cwd named session</li>
|
|
516
|
+
<li><code>sessions show [name]</code> displays stored session metadata</li>
|
|
517
|
+
<li><code>sessions history [name]</code> displays stored turn history previews (default 20, configurable with <code>--limit</code>); images use compact labels with their MIME type when available, without printing encoded image data</li>
|
|
518
|
+
<li><code>sessions watch [-s <name>] [--cursor <cursor>]</code> replays retained events and follows new ones without affecting the active turn; see <a href="session-watch.html">Watching sessions</a></li>
|
|
519
|
+
<li>Watch inherits the agent's <code>-s</code>/<code>--session</code> selection unless its own <code>-s</code>/<code>--name</code> is set. Its journal cursor comes only from <code>watch --cursor</code>, independently of the list pagination cursor on <code>sessions</code>.</li>
|
|
520
|
+
<li><code>sessions export [name] --output <path></code> writes a portable JSON archive with session state and event history; <code>--cwd <dir></code> selects a different source cwd relative to global <code>--cwd</code></li>
|
|
521
|
+
<li><code>sessions import <archive></code> writes a fresh local record from a portable archive, reopens it as idle, keeps the provider session id, and clears source-machine process metadata</li>
|
|
522
|
+
<li>Imported sessions must resume that provider session; if the destination agent cannot load it, prompts fail clearly instead of starting an empty conversation</li>
|
|
523
|
+
<li><code>sessions import --name <name></code> and <code>--cwd <dir></code> override the imported destination scope; import fails instead of creating a duplicate when an active session already exists for that <code>(agent, cwd, name)</code> scope or when another local record already uses the same provider session id</li>
|
|
524
|
+
<li>Concurrent imports into the same local store wait for one another and recheck these collisions before publishing</li>
|
|
525
|
+
<li>Imports and CLI/shared session ensures coordinate for the same exact scope: ensure reuses an import that publishes first, while import rejects a scope created by ensure first</li>
|
|
526
|
+
<li><code>sessions prune --dry-run</code> previews closed sessions that can be deleted</li>
|
|
527
|
+
<li><code>sessions prune</code> verifies the saved closed status and selected agent before deleting a record; add <code>--include-history</code> to delete only that session's active and rotated event files</li>
|
|
528
|
+
<li><code>sessions prune --before <date></code> and <code>--older-than <days></code> filter by close time, falling back to last-used time for older records</li>
|
|
529
|
+
<li>close errors if the target session does not exist</li>
|
|
530
|
+
</ul>
|
|
531
|
+
<h2 id="status-command"><a class="anchor" href="#status-command" aria-label="Anchor link">#</a><code>status</code> command</h2>
|
|
532
|
+
<pre><code class="language-bash">acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> status
|
|
533
|
+
acpx [global_options] <span class="hl-op"><</span>agent<span class="hl-op">></span> status <span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span>
|
|
534
|
+
acpx [global_options] status
|
|
535
|
+
acpx [global_options] status <span class="hl-flag">-s</span> <span class="hl-op"><</span>name<span class="hl-op">></span></code></pre>
|
|
536
|
+
<p>Shows local process status for the cwd-scoped session:</p>
|
|
537
|
+
<ul>
|
|
538
|
+
<li><code>running</code>, <code>idle</code>, <code>dead</code>, or <code>no-session</code></li>
|
|
539
|
+
<li>session id, agent command, live queue-owner pid when available</li>
|
|
540
|
+
<li>time since the most recent agent process launch, when the queue owner is running</li>
|
|
541
|
+
<li>last prompt timestamp</li>
|
|
542
|
+
<li>last known exit code/signal when dead</li>
|
|
543
|
+
</ul>
|
|
544
|
+
<p>The displayed <code>pid</code> identifies the queue owner, while <code>uptime</code> uses the most recent agent process start time. Uptime can keep advancing after that agent exits and resets when a replacement starts, even if the queue-owner PID stays the same. It uses wall-clock time, rounded down to whole seconds.</p>
|
|
545
|
+
<p><code>idle</code> means the persistent session is saved and resumable, but no queue owner is currently running. The next prompt starts a queue owner and reconnects the session.</p>
|
|
546
|
+
<p>Status checks are local and PID-based (<code>kill(pid, 0)</code> semantics). Cached session PIDs are not reported unless a live queue-owner lease ties them to the session.</p>
|
|
547
|
+
<h2 id="config-command"><a class="anchor" href="#config-command" aria-label="Anchor link">#</a><code>config</code> command</h2>
|
|
548
|
+
<pre><code class="language-bash">acpx [global_options] config show
|
|
549
|
+
acpx [global_options] config init</code></pre>
|
|
550
|
+
<ul>
|
|
551
|
+
<li><code>config show</code> prints the resolved config from global + project files.</li>
|
|
552
|
+
<li><code>config init</code> writes a default global config template if missing.</li>
|
|
553
|
+
</ul>
|
|
554
|
+
<p>Config files:</p>
|
|
555
|
+
<ul>
|
|
556
|
+
<li>global: <code>~/.acpx/config.json</code></li>
|
|
557
|
+
<li>project: <code><cwd>/.acpxrc.json</code> (merged on top of global)</li>
|
|
558
|
+
</ul>
|
|
559
|
+
<p>Supported keys:</p>
|
|
560
|
+
<pre><code class="language-json"><span class="hl-op">{</span>
|
|
561
|
+
<span class="hl-prop">"defaultAgent"</span><span class="hl-op">:</span> <span class="hl-str">"codex"</span><span class="hl-op">,</span>
|
|
562
|
+
<span class="hl-prop">"defaultPermissions"</span><span class="hl-op">:</span> <span class="hl-str">"approve-all"</span><span class="hl-op">,</span>
|
|
563
|
+
<span class="hl-prop">"nonInteractivePermissions"</span><span class="hl-op">:</span> <span class="hl-str">"deny"</span><span class="hl-op">,</span>
|
|
564
|
+
<span class="hl-prop">"authPolicy"</span><span class="hl-op">:</span> <span class="hl-str">"skip"</span><span class="hl-op">,</span>
|
|
565
|
+
<span class="hl-prop">"ttl"</span><span class="hl-op">:</span> <span class="hl-num">300</span><span class="hl-op">,</span>
|
|
566
|
+
<span class="hl-prop">"timeout"</span><span class="hl-op">:</span> <span class="hl-lit">null</span><span class="hl-op">,</span>
|
|
567
|
+
<span class="hl-prop">"format"</span><span class="hl-op">:</span> <span class="hl-str">"text"</span><span class="hl-op">,</span>
|
|
568
|
+
<span class="hl-prop">"agents"</span><span class="hl-op">:</span> <span class="hl-op">{</span>
|
|
569
|
+
<span class="hl-prop">"my-custom"</span><span class="hl-op">:</span> <span class="hl-op">{</span> <span class="hl-prop">"argv"</span><span class="hl-op">:</span> <span class="hl-op">[</span><span class="hl-str">"./bin/my-acp-server"</span><span class="hl-op">,</span> <span class="hl-str">"acp"</span><span class="hl-op">]</span> <span class="hl-op">}</span>
|
|
570
|
+
<span class="hl-op">}</span><span class="hl-op">,</span>
|
|
571
|
+
<span class="hl-prop">"auth"</span><span class="hl-op">:</span> <span class="hl-op">{</span>
|
|
572
|
+
<span class="hl-prop">"my_auth_method_id"</span><span class="hl-op">:</span> <span class="hl-str">"credential-value"</span>
|
|
573
|
+
<span class="hl-op">}</span>
|
|
574
|
+
<span class="hl-op">}</span></code></pre>
|
|
575
|
+
<p>CLI flags always override config values.</p>
|
|
576
|
+
<p>Custom agents should use structured <code>agents.<name>.argv</code>, which is required on Windows. Legacy <code>command</code> plus <code>args</code> entries migrate when <code>command</code> is an unquoted executable with no whitespace. Raw command strings, including <code>--agent</code>, are supported only on Unix.</p>
|
|
577
|
+
<p>For ACP <code>authenticate</code> handshakes, use either config <code>auth</code> entries or explicit <code>ACPX_AUTH_<METHOD_ID></code> environment variables such as <code>ACPX_AUTH_OPENAI_API_KEY</code>. Ambient provider env vars such as <code>OPENAI_API_KEY</code> are still passed through to child agents, but they do not trigger ACP auth-method selection on their own.</p>
|
|
578
|
+
<h2 id="agent-escape-hatch"><a class="anchor" href="#agent-escape-hatch" aria-label="Anchor link">#</a><code>--agent</code> escape hatch</h2>
|
|
579
|
+
<p><code>--agent <command></code> sets a raw adapter command explicitly on Unix. On Windows, define a named agent with <code>agents.<name>.argv</code> so executable and argument boundaries remain unambiguous.</p>
|
|
580
|
+
<p>Examples:</p>
|
|
581
|
+
<pre><code class="language-bash">acpx <span class="hl-flag">--agent</span> ./my-custom-acp-server <span class="hl-str">'do something'</span>
|
|
582
|
+
acpx <span class="hl-flag">--agent</span> <span class="hl-str">'node ./scripts/acp-dev-server.mjs --mode ci'</span> exec <span class="hl-str">'summarize changes'</span></code></pre>
|
|
583
|
+
<p>Rules:</p>
|
|
584
|
+
<ul>
|
|
585
|
+
<li>Do not combine positional agent and <code>--agent</code> in one command.</li>
|
|
586
|
+
<li>The resolved command string becomes the session scope key (<code>agentCommand</code>).</li>
|
|
587
|
+
<li>Invalid empty command or unterminated quoting in <code>--agent</code> is a usage error.</li>
|
|
588
|
+
<li>An explicitly empty or whitespace-only <code>--agent</code> is rejected before prompt input or adapter startup; omit the flag to use the configured default.</li>
|
|
589
|
+
</ul>
|
|
590
|
+
<h2 id="session-behavior-and-scoping"><a class="anchor" href="#session-behavior-and-scoping" aria-label="Anchor link">#</a>Session behavior and scoping</h2>
|
|
591
|
+
<p>Session records are stored in:</p>
|
|
592
|
+
<pre><code class="language-text">~/.acpx/sessions/*.json</code></pre>
|
|
593
|
+
<p>On POSIX systems, session records are written with mode <code>0600</code>, and their session directory uses <code>0700</code>. Each write reapplies these private permissions, including when replacing an older, more permissive file. The embedded runtime's <code>createFileSessionStore()</code> uses the same policy. This is storage hardening; it does not isolate agents running under the same OS user. Operator-managed session-directory symlinks remain supported; permissions apply to their target directory. Windows access remains governed by the directory's ACLs.</p>
|
|
594
|
+
<h3 id="auto-resume"><a class="anchor" href="#auto-resume" aria-label="Anchor link">#</a>Auto-resume</h3>
|
|
595
|
+
<p>For prompt commands:</p>
|
|
596
|
+
<ol>
|
|
597
|
+
<li>Detect the nearest git root by checking for a <code>.git</code> directory or file while walking up from <code>absoluteCwd</code>, including worktrees and submodules.</li>
|
|
598
|
+
<li>If a git root is found, walk from <code>absoluteCwd</code> up to that git root (inclusive).</li>
|
|
599
|
+
<li>If no git root exists, only check exact <code>absoluteCwd</code> (no parent-directory walk).</li>
|
|
600
|
+
<li>At each checked directory, find the first active (non-closed) session matching <code>(agentCommand, dir, optionalName)</code>.</li>
|
|
601
|
+
<li>If found, use that session record for prompt queueing and resume attempts.</li>
|
|
602
|
+
<li>If not found, exit with code <code>4</code> and print guidance to create one via <code>sessions new</code>.</li>
|
|
603
|
+
</ol>
|
|
604
|
+
<p>Use <code>sessions new [--name <name>]</code> when you explicitly want a fresh scoped session. Use <code>sessions ensure [--name <name>]</code> when you want idempotent "get-or-create" behavior.</p>
|
|
605
|
+
<p>If a saved session PID is dead, <code>acpx</code> respawns the agent, tries <code>session/resume</code> when advertised or <code>session/load</code> otherwise, and transparently falls back to <code>session/new</code> when reconnecting fails.</p>
|
|
606
|
+
<h3 id="prompt-queueing"><a class="anchor" href="#prompt-queueing" aria-label="Anchor link">#</a>Prompt queueing</h3>
|
|
607
|
+
<p>When a prompt is already in flight for a session, <code>acpx</code> uses a per-session queue owner process:</p>
|
|
608
|
+
<ol>
|
|
609
|
+
<li>owner process keeps the active turn running</li>
|
|
610
|
+
<li>other <code>acpx</code> invocations enqueue prompts through local IPC</li>
|
|
611
|
+
<li>owner drains queued prompts one-by-one after each completed turn</li>
|
|
612
|
+
<li>after the queue drains, owner waits for new work up to TTL (<code>--ttl</code>, default 300s)</li>
|
|
613
|
+
<li>submitter either blocks until completion (default) or exits immediately with <code>--no-wait</code></li>
|
|
614
|
+
<li>if interrupted (<code>Ctrl+C</code>) during an active turn, <code>acpx</code> sends <code>session/cancel</code> first, waits briefly for cancelled completion, then force-kills only if needed</li>
|
|
615
|
+
</ol>
|
|
616
|
+
<p>Slow submitters retain ordered live output in a temporary disk spool instead of an unbounded socket buffer. Each observer can retain up to 64 MiB of unread spool data; one queue owner allows at most 256 MiB of spool file extent, 64 open spools, and 64 observers with pending output, including completed responses whose last chunk is still buffered by the socket. Consumed disk space is reused. These are backlog limits, not limits on the total output of a progressing turn. The current serialized message still requires memory proportional to its size.</p>
|
|
617
|
+
<p>Waiting clients assemble each owner response as a complete JSON line without an additional response-size ceiling. Client memory grows with the current response and its parsed data, including an unfinished line from a broken owner. Older clients retain their previous receive-buffer limit. Owner backlog limits still apply: even one large response can disconnect its observer if its remaining bytes cannot fit the available spool capacity.</p>
|
|
618
|
+
<p>Spill and replay use bounded synchronous file operations. A full spool, exhausted owner budget, or storage failure disconnects that observer with a nonretryable unknown-outcome error. The admitted prompt continues and is not automatically replayed or cancelled. Use <code>sessions watch</code> or <code>sessions history</code> to inspect the recorded outcome before submitting again. When all output slots are occupied, new prompt and control responses are disconnected before queuing their bytes; their commands may still execute. Spools are unlinked before receiving payload and are discarded on disconnect or owner exit; they do not provide transport replay after a crash. macOS and Linux still disconnect readers that make no socket progress for one second. Windows preserves paused named-pipe readers within the storage limits because partial write progress is opaque.</p>
|
|
619
|
+
<p>Queue-owner records remain private across heartbeat updates. Shutdown finishes pending record updates and closes the IPC server before releasing ownership. On macOS and Linux, repeated stop signals keep the same graceful shutdown in progress until cleanup and lease release finish. Current clients serialize lease publication, heartbeat updates, and cleanup across processes, so stale recovery cannot remove a replacement owner's files. Recovery rechecks the owner's generation and recorded OS birth identity before each termination signal. A confirmed exit or a different birth identity permits cleanup of that generation's abandoned files without signaling a replacement process. Linux uses raw process start ticks, boot identity, and the observer's PID and time namespaces, so wall-clock changes do not change process identity. Other POSIX birth timestamps have one-second precision. Process queries and signals are separate OS operations.</p>
|
|
620
|
+
<p>Healthy owners from older versions remain usable through IPC. Explicit close requests their normal shutdown and waits for exit. A live owner without a verifiable birth identity is never forcibly terminated: recovery preserves its lease and reports <code>QUEUE_OWNER_IDENTITY_UNVERIFIED</code>. Restore local process-query access and retry, or let the owner finish its normal shutdown or idle expiry. Missing identity data also preserves a live owner's lease; confirmed local process exit still permits cleanup of older records. Incompatible identity kinds, unknown process scope, and another namespace in the same boot preserve custody, even when the numeric PID does not exist locally.</p>
|
|
621
|
+
<p>An invalid descendant-retirement receipt also preserves its owner's lease and reports <code>QUEUE_OWNER_RETIREMENT_INCOMPLETE</code>. This includes receipt data that cannot be sized safely; recovery does not treat it as an absent owner.</p>
|
|
622
|
+
<p>Abandoned incomplete reservations remain recoverable after the stale-owner window; ambiguous mutation guards are preserved instead of being removed by age. Guard cleanup errors remain retryable on the next status or ownership operation. A live owner stops accepting work and shuts down normally if its guard cleanup fails. The exclusion guarantee requires current clients in the same machine's local PID and time namespaces; do not share the queue home across hosts or namespaces. Older clients that bypass the guard do not participate.</p>
|
|
623
|
+
<p>If an ambiguous <code>.acpx/queues/<queue-key>.lock.guard</code> file or its <code>.reclaim</code> directory prevents recovery, first stop all acpx commands, queue owners, and embedding hosts using that home directory, and prevent them from restarting. Only after establishing exclusive access may an operator remove the affected guard and reclamation directory. Leave the lease and socket for normal recovery, then retry status or the intended command. File age alone does not establish that cleanup is safe; if exclusive access cannot be established, preserve the files.</p>
|
|
624
|
+
<h3 id="soft-close-behavior"><a class="anchor" href="#soft-close-behavior" aria-label="Anchor link">#</a>Soft-close behavior</h3>
|
|
625
|
+
<ul>
|
|
626
|
+
<li>soft-closed sessions remain on disk with <code>closed: true</code> and <code>closedAt</code></li>
|
|
627
|
+
<li>auto-resume ignores closed sessions during scope lookup</li>
|
|
628
|
+
<li>closed sessions still keep full record data and can be resumed explicitly via record id/session load flows</li>
|
|
629
|
+
<li>session records also keep lightweight turn history previews used by <code>sessions history</code></li>
|
|
630
|
+
</ul>
|
|
631
|
+
<h3 id="named-sessions"><a class="anchor" href="#named-sessions" aria-label="Anchor link">#</a>Named sessions</h3>
|
|
632
|
+
<p><code>-s, --session <name></code> adds <code>name</code> into the scope key so multiple parallel conversations can coexist in the same repo and agent command.</p>
|
|
633
|
+
<h3 id="cwd-scoping"><a class="anchor" href="#cwd-scoping" aria-label="Anchor link">#</a>CWD scoping</h3>
|
|
634
|
+
<p><code>--cwd</code> sets the starting point for directory-walk routing (bounded by git root) and the exact scope directory when creating sessions via <code>sessions new</code>.</p>
|
|
635
|
+
<h2 id="output-formats"><a class="anchor" href="#output-formats" aria-label="Anchor link">#</a>Output formats</h2>
|
|
636
|
+
<p><code>--format</code> controls output mode:</p>
|
|
637
|
+
<ul>
|
|
638
|
+
<li><code>text</code> (default): human-readable stream</li>
|
|
639
|
+
<li><code>json</code>: raw ACP NDJSON stream for automation</li>
|
|
640
|
+
<li><code>quiet</code>: assistant text on stdout; failed prompts emit one structured <code>[acpx] error:</code> line on stderr</li>
|
|
641
|
+
<li><code>--format json --json-strict</code>: same ACP NDJSON stream, with non-JSON stderr output suppressed</li>
|
|
642
|
+
</ul>
|
|
643
|
+
<h3 id="prompt-exec-output-behavior"><a class="anchor" href="#prompt-exec-output-behavior" aria-label="Anchor link">#</a>Prompt/exec output behavior</h3>
|
|
644
|
+
<ul>
|
|
645
|
+
<li><code>text</code>: assistant text, tool status blocks, client-operation logs, plan updates, and <code>[done] <reason></code></li>
|
|
646
|
+
<li><code>json</code>: one raw ACP JSON-RPC message per line</li>
|
|
647
|
+
<li><code>quiet</code>: concatenated assistant text on stdout; failed prompts emit one structured <code>[acpx] error:</code> line on stderr</li>
|
|
648
|
+
</ul>
|
|
649
|
+
<p>For failed prompts, text and quiet output prefer the adapter's nonempty error <code>data.details</code> or <code>data.message</code> over the generic protocol error message. Text output also suggests checking provider quota when the error reports a usage limit. JSON output preserves the original ACP error payload.</p>
|
|
650
|
+
<p>When <code>--suppress-reads</code> is enabled:</p>
|
|
651
|
+
<ul>
|
|
652
|
+
<li><code>text</code>: read-like tool outputs render as <code>[read output suppressed]</code></li>
|
|
653
|
+
<li><code>json</code>: ACP <code>fs/read_text_file</code> responses and read-like tool-call outputs replace raw file contents with <code>[read output suppressed]</code></li>
|
|
654
|
+
<li><code>quiet</code>: unchanged, because quiet mode only prints assistant text</li>
|
|
655
|
+
</ul>
|
|
656
|
+
<p>ACP message examples:</p>
|
|
657
|
+
<pre><code class="language-json"><span class="hl-op">{</span><span class="hl-prop">"jsonrpc"</span><span class="hl-op">:</span><span class="hl-str">"2.0"</span><span class="hl-op">,</span><span class="hl-prop">"id"</span><span class="hl-op">:</span><span class="hl-str">"req-1"</span><span class="hl-op">,</span><span class="hl-prop">"method"</span><span class="hl-op">:</span><span class="hl-str">"session/prompt"</span><span class="hl-op">,</span><span class="hl-prop">"params"</span><span class="hl-op">:</span><span class="hl-op">{</span><span class="hl-prop">"sessionId"</span><span class="hl-op">:</span><span class="hl-str">"019c..."</span><span class="hl-op">,</span><span class="hl-prop">"prompt"</span><span class="hl-op">:</span><span class="hl-op">[</span><span class="hl-op">{</span><span class="hl-prop">"type"</span><span class="hl-op">:</span><span class="hl-str">"text"</span><span class="hl-op">,</span><span class="hl-prop">"text"</span><span class="hl-op">:</span><span class="hl-str">"hi"</span><span class="hl-op">}</span><span class="hl-op">]</span><span class="hl-op">}</span><span class="hl-op">}</span>
|
|
658
|
+
<span class="hl-op">{</span><span class="hl-prop">"jsonrpc"</span><span class="hl-op">:</span><span class="hl-str">"2.0"</span><span class="hl-op">,</span><span class="hl-prop">"method"</span><span class="hl-op">:</span><span class="hl-str">"session/update"</span><span class="hl-op">,</span><span class="hl-prop">"params"</span><span class="hl-op">:</span><span class="hl-op">{</span><span class="hl-prop">"sessionId"</span><span class="hl-op">:</span><span class="hl-str">"019c..."</span><span class="hl-op">,</span><span class="hl-prop">"update"</span><span class="hl-op">:</span><span class="hl-op">{</span><span class="hl-prop">"sessionUpdate"</span><span class="hl-op">:</span><span class="hl-str">"agent_message_chunk"</span><span class="hl-op">,</span><span class="hl-prop">"content"</span><span class="hl-op">:</span><span class="hl-op">{</span><span class="hl-prop">"type"</span><span class="hl-op">:</span><span class="hl-str">"text"</span><span class="hl-op">,</span><span class="hl-prop">"text"</span><span class="hl-op">:</span><span class="hl-str">"Hello"</span><span class="hl-op">}</span><span class="hl-op">}</span><span class="hl-op">}</span><span class="hl-op">}</span>
|
|
659
|
+
<span class="hl-op">{</span><span class="hl-prop">"jsonrpc"</span><span class="hl-op">:</span><span class="hl-str">"2.0"</span><span class="hl-op">,</span><span class="hl-prop">"id"</span><span class="hl-op">:</span><span class="hl-str">"req-1"</span><span class="hl-op">,</span><span class="hl-prop">"result"</span><span class="hl-op">:</span><span class="hl-op">{</span><span class="hl-prop">"stopReason"</span><span class="hl-op">:</span><span class="hl-str">"end_turn"</span><span class="hl-op">}</span><span class="hl-op">}</span></code></pre>
|
|
660
|
+
<p>Hard rule for the ACP stream:</p>
|
|
661
|
+
<ul>
|
|
662
|
+
<li>no acpx-specific event envelope,</li>
|
|
663
|
+
<li>no synthetic <code>type</code>/<code>stream</code> wrapper fields,</li>
|
|
664
|
+
<li>no ACP payload key renaming.</li>
|
|
665
|
+
</ul>
|
|
666
|
+
<h3 id="command-specific-json-shapes"><a class="anchor" href="#command-specific-json-shapes" aria-label="Anchor link">#</a>Command-specific JSON shapes</h3>
|
|
667
|
+
<p>With <code>--format json</code>, <code>prompt</code> and <code>exec</code> emit raw ACP JSON-RPC messages. Controls such as <code>cancel</code>, <code>set-mode</code>, and <code>set</code>, and queries such as <code>sessions list</code>, <code>show</code>, and <code>history</code>, emit command-specific JSON result documents. A command contacting an adapter does not by itself determine its output shape.</p>
|
|
668
|
+
<h3 id="sessions-query-command-output-behavior"><a class="anchor" href="#sessions-query-command-output-behavior" aria-label="Anchor link">#</a>Sessions/query command output behavior</h3>
|
|
669
|
+
<ul>
|
|
670
|
+
<li>Agent-side <code>sessions list</code> with <code>text</code>: tab-separated <code>sessionId</code>, <code>title</code>, <code>cwd</code>, <code>updatedAt</code>, and metadata; a next cursor is printed when supplied.</li>
|
|
671
|
+
<li>Agent-side <code>sessions list</code> with <code>json</code>: one object with <code>source: "agent"</code> and <code>sessions</code>, plus optional <code>_meta</code>, <code>cursor</code>, <code>cwd</code>, and <code>nextCursor</code>. Entries use the adapter's <code>sessionId</code>.</li>
|
|
672
|
+
<li>Agent-side <code>sessions list</code> with <code>quiet</code>: one adapter session id per line.</li>
|
|
673
|
+
<li>Local <code>sessions list --local</code>, or a local fallback, with <code>text</code>: tab-separated local id, name, cwd, and last-used time.</li>
|
|
674
|
+
<li>Local listing with <code>json</code>: one array of full local session records.</li>
|
|
675
|
+
<li>Local listing with <code>quiet</code>: one local record id per line. Closed local records have a <code>[closed]</code> marker in text and quiet output.</li>
|
|
676
|
+
<li><code>sessions show</code> with <code>text</code>: key/value metadata dump</li>
|
|
677
|
+
<li><code>sessions show</code> with <code>json</code>: full session record object</li>
|
|
678
|
+
<li><code>sessions history</code> with <code>text</code>: tab-separated <code>timestamp role textPreview</code> entries</li>
|
|
679
|
+
<li><code>sessions history</code> with <code>json</code>: object containing <code>id</code>, <code>sessionId</code>, <code>limit</code>, <code>count</code>, and <code>entries</code></li>
|
|
680
|
+
<li><code>sessions export</code> with <code>text</code>: output path summary</li>
|
|
681
|
+
<li><code>sessions export</code> with <code>json</code>: object containing <code>action</code> and <code>output</code></li>
|
|
682
|
+
<li><code>sessions export</code> with <code>quiet</code>: output path</li>
|
|
683
|
+
<li><code>sessions import</code> with <code>text</code>: imported record id and cwd summary</li>
|
|
684
|
+
<li><code>sessions import</code> with <code>json</code>: object containing <code>action</code>, <code>record_id</code>, and <code>cwd</code></li>
|
|
685
|
+
<li><code>sessions import</code> with <code>quiet</code>: imported record id</li>
|
|
686
|
+
<li><code>sessions prune</code> with <code>text</code>: summary plus pruned ids and close/last-used time</li>
|
|
687
|
+
<li><code>sessions prune</code> with <code>json</code>: object containing <code>action</code>, <code>dryRun</code>, <code>count</code>, <code>bytesFreed</code>, and <code>pruned</code></li>
|
|
688
|
+
<li><code>sessions prune</code> with <code>quiet</code>: one pruned session id per line</li>
|
|
689
|
+
<li><code>status</code> with <code>text</code>: key/value process status lines</li>
|
|
690
|
+
</ul>
|
|
691
|
+
<h2 id="permission-modes"><a class="anchor" href="#permission-modes" aria-label="Anchor link">#</a>Permission modes</h2>
|
|
692
|
+
<p>Choose exactly one mode:</p>
|
|
693
|
+
<ul>
|
|
694
|
+
<li><code>--approve-all</code>: approve tool permission requests not resolved by a per-tool policy</li>
|
|
695
|
+
<li><code>--approve-reads</code>: approve remaining read/search requests and prompt for other tools (default)</li>
|
|
696
|
+
<li><code>--deny-all</code>: deny tool permission requests not resolved by a per-tool policy</li>
|
|
697
|
+
</ul>
|
|
698
|
+
<p>Prompting behavior in <code>--approve-reads</code>:</p>
|
|
699
|
+
<ul>
|
|
700
|
+
<li>interactive TTY: asks <code>Allow <tool>? (y/N)</code> for non-read/search requests</li>
|
|
701
|
+
<li>non-interactive (no TTY): non-read/search requests are not approved</li>
|
|
702
|
+
</ul>
|
|
703
|
+
<p>Non-interactive prompt policy:</p>
|
|
704
|
+
<ul>
|
|
705
|
+
<li><code>--non-interactive-permissions deny</code>: deny non-read/search prompts when no TTY (default)</li>
|
|
706
|
+
<li><code>--non-interactive-permissions fail</code>: fail with <code>PERMISSION_PROMPT_UNAVAILABLE</code></li>
|
|
707
|
+
</ul>
|
|
708
|
+
<p>Per-tool policy:</p>
|
|
709
|
+
<ul>
|
|
710
|
+
<li><code>--permission-policy <json-or-file></code> or <code>--policy <json-or-file></code> matches ACP permission requests by tool kind, title head, title, or raw input tool/name.</li>
|
|
711
|
+
<li><code>autoDeny</code> wins over <code>autoApprove</code>, which wins over <code>escalate</code>; unmatched requests use <code>defaultAction</code> when set, otherwise the selected permission mode.</li>
|
|
712
|
+
<li>Non-interactive escalations deny the current request. Text mode prints a <code>[permission]</code> notice; JSON mode keeps raw ACP NDJSON and includes escalation details, including tool input when supplied by the agent, on the <code>session/request_permission</code> response at <code>_meta.acpx.permissionEscalation</code>.</li>
|
|
713
|
+
</ul>
|
|
714
|
+
<h2 id="exit-codes"><a class="anchor" href="#exit-codes" aria-label="Anchor link">#</a>Exit codes</h2>
|
|
715
|
+
<table><thead><tr><th>Code</th><th>Meaning</th></tr></thead><tbody><tr><td><code>0</code></td><td>Success</td></tr><tr><td><code>1</code></td><td>Agent/protocol/runtime error</td></tr><tr><td><code>2</code></td><td>CLI usage error</td></tr><tr><td><code>3</code></td><td>Timeout</td></tr><tr><td><code>4</code></td><td>No session found (prompt requires an explicit <code>sessions new</code>)</td></tr><tr><td><code>5</code></td><td>Permission denied in this turn (permission requested, none approved, and at least one denied/cancelled)</td></tr><tr><td><code>130</code></td><td>Interrupted (<code>SIGINT</code>/<code>SIGTERM</code>)</td></tr></tbody></table>
|
|
716
|
+
<h2 id="environment-variables"><a class="anchor" href="#environment-variables" aria-label="Anchor link">#</a>Environment variables</h2>
|
|
717
|
+
<p><code>ACPX_CLAUDE_INCLUDE_USER_SETTINGS=1</code> makes built-in <code>claude</code> sessions include Claude Code user settings. By default, they load only project and local settings to avoid globally enabled channel or daemon plugins interfering with spawned ACP sessions.</p>
|
|
718
|
+
<p><code>ACPX_PERF_METRICS_FILE</code> enables optional NDJSON performance capture, including command arguments. On POSIX, capture files use <code>0600</code>; existing parent directory permissions are preserved. Symbolic links, hardlinked files, and special files such as FIFOs are skipped. Capture failures leave the command's exit status unchanged.</p>
|
|
719
|
+
<p>Related runtime behavior:</p>
|
|
720
|
+
<ul>
|
|
721
|
+
<li>session storage path is derived from OS home directory (<code>~/.acpx/sessions</code>)</li>
|
|
722
|
+
<li>child processes inherit the current environment by default</li>
|
|
723
|
+
<li>Windows shell commands keep stdout and stderr available through <code>terminal/output</code>. Terminal kill and release requests fail if process cleanup cannot finish after escalation. The terminal remains available for a cleanup retry; restore a working <code>taskkill</code> command before retrying.</li>
|
|
724
|
+
<li>ACP <code>terminal/create</code> honors agent <code>outputByteLimit</code>; <code>0</code> stores nothing and the default when omitted is 64 KiB. Hosts can opt into an additional per-terminal retention ceiling with <code>ACPX_TERMINAL_MAX_OUTPUT_BYTES</code> (for example, <code>16777216</code> for 16 MiB). Unset, empty, or zero disables only the host ceiling, preserving the agent limit and default. Positive values must be safe integers. The smaller limit applies to combined stdout and stderr, retaining the newest UTF-8 output and reporting <code>truncated: true</code> when exceeded. Truncation drops an incomplete leading code point across writes; the retained output can be empty if no complete code point fits. This bounds retained output per terminal, not total process memory. Each ACP client snapshots the setting at construction; restart warm queue owners to change it.</li>
|
|
725
|
+
</ul>
|
|
726
|
+
<h2 id="practical-examples"><a class="anchor" href="#practical-examples" aria-label="Anchor link">#</a>Practical examples</h2>
|
|
727
|
+
<pre><code class="language-bash"><span class="hl-com"># Review a PR in a dedicated named session</span>
|
|
728
|
+
acpx <span class="hl-flag">--cwd</span> ~/repos/shop codex sessions new <span class="hl-flag">--name</span> pr-<span class="hl-num">842</span>
|
|
729
|
+
acpx <span class="hl-flag">--cwd</span> ~/repos/shop codex <span class="hl-flag">-s</span> pr-<span class="hl-num">842</span> \
|
|
730
|
+
<span class="hl-str">'Review PR #842, list risks, and propose a minimal patch'</span>
|
|
731
|
+
|
|
732
|
+
<span class="hl-com"># Continue that same PR review later</span>
|
|
733
|
+
acpx <span class="hl-flag">--cwd</span> ~/repos/shop codex <span class="hl-flag">-s</span> pr-<span class="hl-num">842</span> \
|
|
734
|
+
<span class="hl-str">'Now draft commit message and rollout checklist'</span>
|
|
735
|
+
|
|
736
|
+
<span class="hl-com"># Parallel workstreams in one repo</span>
|
|
737
|
+
acpx codex sessions new <span class="hl-flag">--name</span> backend
|
|
738
|
+
acpx codex sessions new <span class="hl-flag">--name</span> docs
|
|
739
|
+
acpx codex <span class="hl-flag">-s</span> backend <span class="hl-str">'fix checkout timeout'</span>
|
|
740
|
+
acpx codex <span class="hl-flag">-s</span> docs <span class="hl-str">'document payment retry behavior'</span>
|
|
741
|
+
|
|
742
|
+
<span class="hl-com"># Manage sessions</span>
|
|
743
|
+
acpx codex sessions
|
|
744
|
+
acpx codex sessions new <span class="hl-flag">--name</span> docs
|
|
745
|
+
acpx codex sessions show docs
|
|
746
|
+
acpx codex sessions history docs <span class="hl-flag">--limit</span> <span class="hl-num">10</span>
|
|
747
|
+
acpx codex sessions close docs
|
|
748
|
+
acpx codex status
|
|
749
|
+
|
|
750
|
+
<span class="hl-com"># Prompt from file/stdin</span>
|
|
751
|
+
echo <span class="hl-str">'triage failing tests'</span> <span class="hl-op">|</span> acpx codex
|
|
752
|
+
acpx codex <span class="hl-flag">--file</span> prompt.md
|
|
753
|
+
acpx codex <span class="hl-flag">--file</span> - <span class="hl-str">'also check lint warnings'</span>
|
|
754
|
+
|
|
755
|
+
<span class="hl-com"># Config inspection</span>
|
|
756
|
+
acpx config show
|
|
757
|
+
acpx config init
|
|
758
|
+
|
|
759
|
+
<span class="hl-com"># JSON automation pipeline</span>
|
|
760
|
+
acpx <span class="hl-flag">--format</span> json codex exec <span class="hl-str">'review latest diff for security issues'</span> \
|
|
761
|
+
<span class="hl-op">|</span> jq <span class="hl-flag">-r</span> <span class="hl-str">'select(.method=="session/update") | .params.update
|
|
762
|
+
| select(.sessionUpdate=="tool_call" or .sessionUpdate=="tool_call_update")
|
|
763
|
+
| [(.status // "-"), (.title // "-")] | @tsv'</span>
|
|
764
|
+
|
|
765
|
+
<span class="hl-com"># One-shot ask with no saved context</span>
|
|
766
|
+
acpx claude exec <span class="hl-str">'summarize src/session.ts in 5 bullets'</span></code></pre>
|
|
767
|
+
<h3 id="queue-request-size"><a class="anchor" href="#queue-request-size" aria-label="Anchor link">#</a>Queue request size</h3>
|
|
768
|
+
<p><code>ACPX_QUEUE_MAX_REQUEST_BYTES</code> optionally bounds a queue owner's incoming request lines in UTF-8 bytes, excluding the newline. Unset, empty, or zero keeps the existing unlimited request size. Positive values must be safe integers. Clients with the same setting reject oversized submissions with <code>QUEUE_REQUEST_TOO_LARGE</code> before opening a socket. Owners disconnect a raw peer that exceeds the cap, including incomplete lines, while continuing to serve other clients. Responses use the separate <a href="#prompt-queueing">queue output policy</a>.</p>
|
|
769
|
+
<p>An owner keeps the setting with which it starts; setting the variable does not reconfigure an already-running owner. Request JSON can be larger than the prompt file because it carries both structured content and display text.</p><nav class="page-nav" aria-label="Pager"><a class="page-nav-prev" href="flows.html"><small>Previous</small><span>Flows</span></a><a class="page-nav-next" href="exit-codes.html"><small>Next</small><span>Exit codes</span></a></nav></article>
|
|
770
|
+
<nav class="toc" aria-label="On this page"><h2>On this page</h2><a class="toc-l2" href="#overview">#Overview</a><a class="toc-l2" href="#full-command-grammar">#Full command grammar</a><a class="toc-l2" href="#flow-run-subcommand">#flow run subcommand</a><a class="toc-l2" href="#global-options">#Global options</a><a class="toc-l3" href="#global-option-examples">#Global option examples</a><a class="toc-l2" href="#agent-commands">#Agent commands</a><a class="toc-l3" href="#pi">#pi</a><a class="toc-l3" href="#openclaw">#openclaw</a><a class="toc-l3" href="#codex">#codex</a><a class="toc-l3" href="#claude">#claude</a><a class="toc-l3" href="#custom-positional-agents">#Custom positional agents</a><a class="toc-l2" href="#prompt-subcommand-explicit">#prompt subcommand (explicit)</a><a class="toc-l2" href="#exec-subcommand">#exec subcommand</a><a class="toc-l2" href="#compare-subcommand">#compare subcommand</a><a class="toc-l2" href="#cancel-command">#cancel command</a><a class="toc-l2" href="#set-mode-command">#set-mode command</a><a class="toc-l2" href="#set-command">#set command</a><a class="toc-l2" href="#sessions-subcommand">#sessions subcommand</a><a class="toc-l2" href="#status-command">#status command</a><a class="toc-l2" href="#config-command">#config command</a><a class="toc-l2" href="#agent-escape-hatch">#--agent escape hatch</a><a class="toc-l2" href="#session-behavior-and-scoping">#Session behavior and scoping</a><a class="toc-l3" href="#auto-resume">#Auto-resume</a><a class="toc-l3" href="#prompt-queueing">#Prompt queueing</a><a class="toc-l3" href="#soft-close-behavior">#Soft-close behavior</a><a class="toc-l3" href="#named-sessions">#Named sessions</a><a class="toc-l3" href="#cwd-scoping">#CWD scoping</a><a class="toc-l2" href="#output-formats">#Output formats</a><a class="toc-l3" href="#prompt-exec-output-behavior">#Prompt/exec output behavior</a><a class="toc-l3" href="#command-specific-json-shapes">#Command-specific JSON shapes</a><a class="toc-l3" href="#sessions-query-command-output-behavior">#Sessions/query command output behavior</a><a class="toc-l2" href="#permission-modes">#Permission modes</a><a class="toc-l2" href="#exit-codes">#Exit codes</a><a class="toc-l2" href="#environment-variables">#Environment variables</a><a class="toc-l2" href="#practical-examples">#Practical examples</a><a class="toc-l3" href="#queue-request-size">#Queue request size</a></nav>
|
|
771
|
+
</div>
|
|
772
|
+
</main>
|
|
773
|
+
</div>
|
|
774
|
+
<script>
|
|
775
|
+
const themeRoot=document.documentElement;
|
|
776
|
+
function applyTheme(mode){themeRoot.dataset.theme=mode;document.querySelectorAll('[data-theme-toggle]').forEach(b=>b.setAttribute('aria-pressed',mode==='dark'?'true':'false'))}
|
|
777
|
+
function storedTheme(){try{return localStorage.getItem('theme')}catch(e){return null}}
|
|
778
|
+
function persistTheme(mode){try{localStorage.setItem('theme',mode)}catch(e){}}
|
|
779
|
+
applyTheme(themeRoot.dataset.theme==='dark'?'dark':'light');
|
|
780
|
+
document.querySelectorAll('[data-theme-toggle]').forEach(btn=>{btn.addEventListener('click',()=>{const next=themeRoot.dataset.theme==='dark'?'light':'dark';applyTheme(next);persistTheme(next)})});
|
|
781
|
+
const systemDark=window.matchMedia&&matchMedia('(prefers-color-scheme: dark)');
|
|
782
|
+
function onSystemChange(e){if(storedTheme())return;applyTheme(e.matches?'dark':'light')}
|
|
783
|
+
if(systemDark){if(systemDark.addEventListener)systemDark.addEventListener('change',onSystemChange);else if(systemDark.addListener)systemDark.addListener(onSystemChange)}
|
|
784
|
+
const sidebar=document.querySelector('.sidebar');
|
|
785
|
+
const toggle=document.querySelector('.nav-toggle');
|
|
786
|
+
const mobileNav=window.matchMedia('(max-width: 900px)');
|
|
787
|
+
const sidebarFocusable='a[href],button,input,select,textarea,[tabindex]';
|
|
788
|
+
function setSidebarFocusable(enabled){
|
|
789
|
+
sidebar?.querySelectorAll(sidebarFocusable).forEach((el)=>{
|
|
790
|
+
if(enabled){
|
|
791
|
+
if(el.dataset.sidebarTabindex!==undefined){
|
|
792
|
+
if(el.dataset.sidebarTabindex)el.setAttribute('tabindex',el.dataset.sidebarTabindex);
|
|
793
|
+
else el.removeAttribute('tabindex');
|
|
794
|
+
delete el.dataset.sidebarTabindex;
|
|
795
|
+
}
|
|
796
|
+
}else if(el.dataset.sidebarTabindex===undefined){
|
|
797
|
+
el.dataset.sidebarTabindex=el.getAttribute('tabindex')??'';
|
|
798
|
+
el.setAttribute('tabindex','-1');
|
|
799
|
+
}
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
function setSidebarOpen(open){
|
|
803
|
+
if(!sidebar||!toggle)return;
|
|
804
|
+
sidebar.classList.toggle('open',open);
|
|
805
|
+
toggle.setAttribute('aria-expanded',open?'true':'false');
|
|
806
|
+
if(mobileNav.matches){
|
|
807
|
+
sidebar.inert=!open;
|
|
808
|
+
if(open)sidebar.removeAttribute('aria-hidden');
|
|
809
|
+
else sidebar.setAttribute('aria-hidden','true');
|
|
810
|
+
setSidebarFocusable(open);
|
|
811
|
+
}else{
|
|
812
|
+
sidebar.inert=false;
|
|
813
|
+
sidebar.removeAttribute('aria-hidden');
|
|
814
|
+
setSidebarFocusable(true);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
setSidebarOpen(false);
|
|
818
|
+
toggle?.addEventListener('click',()=>setSidebarOpen(!sidebar?.classList.contains('open')));
|
|
819
|
+
document.addEventListener('click',(e)=>{if(!sidebar?.classList.contains('open'))return;if(sidebar.contains(e.target)||toggle?.contains(e.target))return;setSidebarOpen(false)});
|
|
820
|
+
document.addEventListener('keydown',(e)=>{if(e.key==='Escape')setSidebarOpen(false)});
|
|
821
|
+
const syncSidebarForViewport=()=>setSidebarOpen(sidebar?.classList.contains('open')??false);
|
|
822
|
+
if(mobileNav.addEventListener)mobileNav.addEventListener('change',syncSidebarForViewport);
|
|
823
|
+
else mobileNav.addListener?.(syncSidebarForViewport);
|
|
824
|
+
const input=document.getElementById('doc-search');
|
|
825
|
+
input?.addEventListener('input',()=>{const q=input.value.trim().toLowerCase();document.querySelectorAll('nav section').forEach(sec=>{let any=false;sec.querySelectorAll('.nav-link').forEach(a=>{const m=!q||a.textContent.toLowerCase().includes(q);a.style.display=m?'block':'none';if(m)any=true});sec.style.display=any?'block':'none'})});
|
|
826
|
+
function attachCopy(target,getText){const btn=document.createElement('button');btn.type='button';btn.className='copy';btn.textContent='Copy';btn.addEventListener('click',async()=>{try{await navigator.clipboard.writeText(getText());btn.textContent='Copied';btn.classList.add('copied');setTimeout(()=>{btn.textContent='Copy';btn.classList.remove('copied')},1400)}catch{btn.textContent='Failed';setTimeout(()=>{btn.textContent='Copy'},1400)}});target.appendChild(btn)}
|
|
827
|
+
document.querySelectorAll('.doc pre').forEach(pre=>attachCopy(pre,()=>pre.querySelector('code')?.textContent??''));
|
|
828
|
+
document.querySelectorAll('.home-install').forEach(el=>attachCopy(el,()=>el.querySelector('code')?.textContent??''));
|
|
829
|
+
const tocLinks=document.querySelectorAll('.toc a');
|
|
830
|
+
if(tocLinks.length){const map=new Map();tocLinks.forEach(a=>{const id=a.getAttribute('href').slice(1);const el=document.getElementById(id);if(el)map.set(el,a)});const setActive=l=>{tocLinks.forEach(x=>x.classList.remove('active'));l.classList.add('active')};const obs=new IntersectionObserver(entries=>{const visible=entries.filter(e=>e.isIntersecting).sort((a,b)=>a.boundingClientRect.top-b.boundingClientRect.top);if(visible.length){const link=map.get(visible[0].target);if(link)setActive(link)}},{rootMargin:'-15% 0px -65% 0px',threshold:0});map.forEach((_,el)=>obs.observe(el))}
|
|
831
|
+
</script>
|
|
832
|
+
</body>
|
|
833
|
+
</html>
|