@1agents/acp-service 0.10.8 → 0.10.10
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/dist/bin/a2a.js +12 -1
- package/dist/src/a2a/gateway.d.ts +268 -2
- package/dist/src/a2a/gateway.js +337 -25
- package/dist/src/a2a/job-directory.d.ts +5 -0
- package/dist/src/a2a/job-directory.js +15 -0
- package/dist/src/a2a/preflight.d.ts +38 -0
- package/dist/src/a2a/preflight.js +56 -8
- package/dist/src/a2a/types.d.ts +8 -0
- package/dist/src/execution/case-view.d.ts +109 -0
- package/dist/src/execution/case-view.js +125 -0
- package/dist/src/execution/cases.d.ts +56 -0
- package/dist/src/execution/cases.js +77 -0
- package/dist/src/execution/externals.d.ts +83 -0
- package/dist/src/execution/externals.js +61 -0
- package/dist/src/execution/handoff.d.ts +54 -1
- package/dist/src/execution/handoff.js +80 -15
- package/dist/src/execution/ledger.d.ts +35 -2
- package/dist/src/execution/ledger.js +72 -2
- package/dist/src/execution/snapshots.d.ts +28 -0
- package/dist/src/execution/snapshots.js +64 -0
- package/dist/src/execution/targets.d.ts +63 -0
- package/dist/src/execution/targets.js +15 -1
- package/dist/src/execution/workbench.d.ts +5 -1
- package/dist/src/execution/workbench.js +13 -4
- package/dist/workbench-ui/app.css +18 -0
- package/dist/workbench-ui/app.js +13 -13
- package/package.json +12 -13
- package/vendor/dsh/a2a-executor.d.ts +2 -2
- package/vendor/dsh/adapter.d.ts +4 -4
- package/vendor/dsh/cordis.patch.yml +6 -5
- package/vendor/dsh/handoff-executor.d.ts +7 -0
- package/vendor/dsh/handoff-executor.js +28 -0
- package/vendor/dsh/handoff-spec.d.ts +26 -0
- package/vendor/dsh/handoff-spec.js +14 -0
- package/vendor/dsh/handoff-tools.d.ts +4 -0
- package/vendor/dsh/handoff-tools.js +20 -0
- package/vendor/dsh/index.js +8 -0
- package/vendor/dsh/review-mcp.js +6 -2
- package/vendor/dsh/review.d.ts +3 -0
- package/vendor/dsh/review.js +19 -0
- package/vendor/dsh/service-process.d.ts +9 -1
- package/vendor/dsh/service-process.js +69 -3
- package/vendor/dsh/ticket-tools.d.ts +1 -1
- package/vendor/runtime/dist/{cli-DXmYwv3U.js → cli-BwanDcOo.js} +4 -4
- package/vendor/runtime/dist/{cli-DXmYwv3U.js.map → cli-BwanDcOo.js.map} +1 -1
- package/vendor/runtime/dist/cli.js +8 -8
- package/vendor/runtime/dist/{client-VQsqcIOJ.d.ts → client-C5zneoBs.d.ts} +3 -1
- package/vendor/runtime/dist/{client-VQsqcIOJ.d.ts.map → client-C5zneoBs.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 +336 -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-DJ17ajbw.js → flows-CzLUHUTS.js} +4 -4
- package/vendor/runtime/dist/{flows-DJ17ajbw.js.map → flows-CzLUHUTS.js.map} +1 -1
- package/vendor/runtime/dist/flows.d.ts +1 -1
- package/vendor/runtime/dist/flows.js +1 -1
- package/vendor/runtime/dist/{invocation-options-PBfCgrdi.js → invocation-options-B6pIpdpR.js} +4 -4
- package/vendor/runtime/dist/{invocation-options-PBfCgrdi.js.map → invocation-options-B6pIpdpR.js.map} +1 -1
- package/vendor/runtime/dist/{ipc-BQQpcEdP.js → ipc-ivLtSAdL.js} +21 -3
- package/vendor/runtime/dist/ipc-ivLtSAdL.js.map +1 -0
- package/vendor/runtime/dist/{output-B3MDn7kv.js → output-BqKnXXb0.js} +3 -3
- package/vendor/runtime/dist/{output-B3MDn7kv.js.map → output-BqKnXXb0.js.map} +1 -1
- package/vendor/runtime/dist/{queue-owner-runtime-DXCVngwU.js → queue-owner-runtime-DXJND10J.js} +11 -2
- package/vendor/runtime/dist/queue-owner-runtime-DXJND10J.js.map +1 -0
- package/vendor/runtime/dist/runtime.d.ts +1 -1
- package/vendor/runtime/dist/runtime.d.ts.map +1 -1
- package/vendor/runtime/dist/runtime.js +3 -3
- package/vendor/runtime/dist/{session-watch-DURyCw31.js → session-watch-BHB3_PXm.js} +4 -4
- package/vendor/runtime/dist/{session-watch-DURyCw31.js.map → session-watch-BHB3_PXm.js.map} +1 -1
- package/vendor/runtime/dist/{watch-CIpoMaWD.js → watch-UjokHUfS.js} +2 -2
- package/vendor/runtime/dist/{watch-CIpoMaWD.js.map → watch-UjokHUfS.js.map} +1 -1
- package/vendor/runtime/dist/ipc-BQQpcEdP.js.map +0 -1
- package/vendor/runtime/dist/queue-owner-runtime-DXCVngwU.js.map +0 -1
|
@@ -0,0 +1,354 @@
|
|
|
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>Watching sessions — acpx</title>
|
|
7
|
+
<meta name="description" content="Passively replay and follow a session through the CLI or shared runtime, with resumable cursors and settled turn results.">
|
|
8
|
+
<link rel="canonical" href="session-watch.html">
|
|
9
|
+
<meta property="og:type" content="website">
|
|
10
|
+
<meta property="og:site_name" content="acpx">
|
|
11
|
+
<meta property="og:title" content="Watching sessions — acpx">
|
|
12
|
+
<meta property="og:description" content="Passively replay and follow a session through the CLI or shared runtime, with resumable cursors and settled turn results.">
|
|
13
|
+
<meta property="og:url" content="session-watch.html">
|
|
14
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
15
|
+
<meta name="twitter:title" content="Watching sessions — acpx">
|
|
16
|
+
<meta name="twitter:description" content="Passively replay and follow a session through the CLI or shared runtime, with resumable cursors and settled turn results.">
|
|
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" 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>Watching sessions</h1>
|
|
246
|
+
</div>
|
|
247
|
+
<div class="hero-meta">
|
|
248
|
+
<a class="repo" href="https://github.com/scottzx/agent-workflow" rel="noopener">GitHub</a>
|
|
249
|
+
<a class="edit" href="https://github.com/scottzx/agent-workflow/edit/main/packages/runtime/docs/session-watch.md" rel="noopener">Edit page</a>
|
|
250
|
+
</div>
|
|
251
|
+
</header>
|
|
252
|
+
<div class="doc-grid">
|
|
253
|
+
<article class="doc"><h1 id="watching-sessions">Watching sessions</h1>
|
|
254
|
+
<p>Watch a named session from another terminal:</p>
|
|
255
|
+
<pre><code class="language-bash">acpx <span class="hl-flag">--format</span> json pi sessions watch <span class="hl-flag">-s</span> reviewer</code></pre>
|
|
256
|
+
<p>Watching replays retained events and then follows new ones. Attaching, disconnecting, pressing Ctrl+C, or closing a watcher leaves the active turn running. Watching an idle session waits without starting an agent or extending the owner's idle TTL. A closed session finishes after replaying its retained events.</p>
|
|
257
|
+
<p>If the session closes while the consumer is handling an event, watching rereads and drains retained history before finishing. An unfinished attempt still reports an unknown outcome instead of becoming a successful end of the stream.</p>
|
|
258
|
+
<p>You can also select the session on the agent, as in <code>acpx pi -s reviewer sessions watch</code>. An explicit <code>watch -s</code> or <code>watch --name</code> takes precedence. Without either selector, watch uses the cwd's default session.</p>
|
|
259
|
+
<p>Session discovery reads records without creating or repairing the index. A readable session store does not need to be writable to watch it.</p>
|
|
260
|
+
<p>Use <code>--cursor <cursor></code> to resume after the last received event:</p>
|
|
261
|
+
<pre><code class="language-bash">acpx <span class="hl-flag">--format</span> json pi sessions watch <span class="hl-flag">-s</span> reviewer <span class="hl-flag">--cursor</span> <span class="hl-str">"$LAST_CURSOR"</span></code></pre>
|
|
262
|
+
<p>Cursors are opaque, ordered within a local session record, and exclusive on resume. Do not decode or compare their strings. A malformed, foreign, future, or expired cursor produces an explicit error. Omit the cursor to replay the currently retained window.</p>
|
|
263
|
+
<p>The watch cursor is independent of ACP session-list pagination: place it after <code>watch</code>. A <code>--cursor</code> on the parent <code>sessions</code> command does not become a journal cursor.</p>
|
|
264
|
+
<h2 id="shared-runtime"><a class="anchor" href="#shared-runtime" aria-label="Anchor link">#</a>Shared runtime</h2>
|
|
265
|
+
<p>The <a href="shared-sessions.html">shared runtime</a> exposes the same stream:</p>
|
|
266
|
+
<pre><code class="language-ts"><span class="hl-kw">const</span> controller = <span class="hl-kw">new</span> <span class="hl-typ">AbortController</span>();
|
|
267
|
+
<span class="hl-kw">for</span> <span class="hl-kw">await</span> (<span class="hl-kw">const</span> event <span class="hl-kw">of</span> runtime.watchSession({
|
|
268
|
+
handle,
|
|
269
|
+
cursor: savedCursor,
|
|
270
|
+
signal: controller.signal,
|
|
271
|
+
})) {
|
|
272
|
+
savedCursor = event.cursor;
|
|
273
|
+
<span class="hl-kw">if</span> (event.<span class="hl-kw">type</span> === <span class="hl-str">"turn_result"</span>) {
|
|
274
|
+
console.log(event.requestId, event.result.status);
|
|
275
|
+
}
|
|
276
|
+
}</code></pre>
|
|
277
|
+
<p>Breaking out of the loop, calling the iterator's <code>return()</code>, aborting its signal, or shutting down this shared client stops observation. Use the explicit cancellation methods when you want to cancel work. Custom stores used by the in-process runtime do not automatically publish this CLI/shared journal.</p>
|
|
278
|
+
<h2 id="event-contract"><a class="anchor" href="#event-contract" aria-label="Anchor link">#</a>Event contract</h2>
|
|
279
|
+
<p>JSON output is NDJSON with three event kinds:</p>
|
|
280
|
+
<table><thead><tr><th>Type</th><th>Fields</th><th>Meaning</th></tr></thead><tbody><tr><td><code>message</code></td><td><code>cursor</code>, <code>requestId</code>, <code>message</code></td><td>An ACP JSON-RPC message, associated with its current prompt attempt. The request ID is null when no attempt owns that message.</td></tr><tr><td><code>turn_started</code></td><td><code>cursor</code>, <code>requestId</code></td><td>The owner has selected an attempt and is preparing or dispatching it. The turn's separate <code>promptStarted</code> promise indicates actual ACP prompt transport acceptance.</td></tr><tr><td><code>turn_result</code></td><td><code>cursor</code>, <code>requestId</code>, <code>result</code></td><td>The owner has finished normal cleanup and checkpoint attempts. The result is <code>completed</code>, <code>cancelled</code>, or <code>failed</code>.</td></tr></tbody></table>
|
|
281
|
+
<p><code>requestId</code> is the submitting acpx request ID; it is independent of the ACP message's own JSON-RPC <code>id</code>. Use <code>turn_result</code> for settlement. A raw ACP response containing <code>stopReason</code> can arrive before local finalization finishes.</p>
|
|
282
|
+
<p>The stream covers attempts selected for execution. Requests cancelled while still queued receive their ordinary cancellation response without starting an agent attempt or transcript.</p>
|
|
283
|
+
<p>Text output renders agent content and lifecycle lines with request IDs and cursors. Quiet output prints agent text. <code>--suppress-reads</code> also applies to watching; on resume, unclassified result/tool content is suppressed conservatively when its original announcement is unavailable. This flag suppresses raw read output, not text the agent independently writes about it.</p>
|
|
284
|
+
<h2 id="recovery-and-retained-history"><a class="anchor" href="#recovery-and-retained-history" aria-label="Anchor link">#</a>Recovery and retained history</h2>
|
|
285
|
+
<p>If an owner disappears before recording a settled result, watching fails with <code>WATCH_OUTCOME_UNKNOWN</code>. The prompt may have executed. Resume from the last cursor after recovery and inspect the result before considering another submission. A replacement owner records an unfinished earlier attempt as failed with an unknown-outcome detail before starting the next attempt.</p>
|
|
286
|
+
<p>Older running owners lack watch support and produce <code>WATCH_OWNER_UNSUPPORTED</code>. Let an idle owner expire, or explicitly close the session before ensuring it again. Observers do not restart owners.</p>
|
|
287
|
+
<p>History retention remains the existing rotating journal policy. Replay reads bounded pages, approximately 1 MiB plus one larger event. A slow observer whose unread history has been rotated away receives a cursor-expired error rather than silently skipping events.</p>
|
|
288
|
+
<p>Journal reads retry when segment paths change during capture. A rejected page does not advance the reader's delivered position; stable corruption and filesystem errors still fail explicitly.</p>
|
|
289
|
+
<p>Watching can replay only events recorded after watch support is enabled. Earlier history remains available through <code>sessions read</code> and export. Portable imports start a fresh watch history; historical request IDs and local results are not invented.</p>
|
|
290
|
+
<p>The existing journal now includes local segment and lifecycle records alongside unchanged ACP messages. Direct <code>.stream.ndjson</code> consumers must distinguish these local records from entries with <code>jsonrpc: "2.0"</code>. Built-in history readers, prompt JSON output, and portable archives continue to expose ACP data without local journal markers. See the <a href="https://github.com/openclaw/acpx/blob/main/docs/2026-02-27-acpx-session-model.md">session model</a> for the storage contract.</p></article>
|
|
291
|
+
<nav class="toc" aria-label="On this page"><h2>On this page</h2><a class="toc-l2" href="#shared-runtime">#Shared runtime</a><a class="toc-l2" href="#event-contract">#Event contract</a><a class="toc-l2" href="#recovery-and-retained-history">#Recovery and retained history</a></nav>
|
|
292
|
+
</div>
|
|
293
|
+
</main>
|
|
294
|
+
</div>
|
|
295
|
+
<script>
|
|
296
|
+
const themeRoot=document.documentElement;
|
|
297
|
+
function applyTheme(mode){themeRoot.dataset.theme=mode;document.querySelectorAll('[data-theme-toggle]').forEach(b=>b.setAttribute('aria-pressed',mode==='dark'?'true':'false'))}
|
|
298
|
+
function storedTheme(){try{return localStorage.getItem('theme')}catch(e){return null}}
|
|
299
|
+
function persistTheme(mode){try{localStorage.setItem('theme',mode)}catch(e){}}
|
|
300
|
+
applyTheme(themeRoot.dataset.theme==='dark'?'dark':'light');
|
|
301
|
+
document.querySelectorAll('[data-theme-toggle]').forEach(btn=>{btn.addEventListener('click',()=>{const next=themeRoot.dataset.theme==='dark'?'light':'dark';applyTheme(next);persistTheme(next)})});
|
|
302
|
+
const systemDark=window.matchMedia&&matchMedia('(prefers-color-scheme: dark)');
|
|
303
|
+
function onSystemChange(e){if(storedTheme())return;applyTheme(e.matches?'dark':'light')}
|
|
304
|
+
if(systemDark){if(systemDark.addEventListener)systemDark.addEventListener('change',onSystemChange);else if(systemDark.addListener)systemDark.addListener(onSystemChange)}
|
|
305
|
+
const sidebar=document.querySelector('.sidebar');
|
|
306
|
+
const toggle=document.querySelector('.nav-toggle');
|
|
307
|
+
const mobileNav=window.matchMedia('(max-width: 900px)');
|
|
308
|
+
const sidebarFocusable='a[href],button,input,select,textarea,[tabindex]';
|
|
309
|
+
function setSidebarFocusable(enabled){
|
|
310
|
+
sidebar?.querySelectorAll(sidebarFocusable).forEach((el)=>{
|
|
311
|
+
if(enabled){
|
|
312
|
+
if(el.dataset.sidebarTabindex!==undefined){
|
|
313
|
+
if(el.dataset.sidebarTabindex)el.setAttribute('tabindex',el.dataset.sidebarTabindex);
|
|
314
|
+
else el.removeAttribute('tabindex');
|
|
315
|
+
delete el.dataset.sidebarTabindex;
|
|
316
|
+
}
|
|
317
|
+
}else if(el.dataset.sidebarTabindex===undefined){
|
|
318
|
+
el.dataset.sidebarTabindex=el.getAttribute('tabindex')??'';
|
|
319
|
+
el.setAttribute('tabindex','-1');
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
function setSidebarOpen(open){
|
|
324
|
+
if(!sidebar||!toggle)return;
|
|
325
|
+
sidebar.classList.toggle('open',open);
|
|
326
|
+
toggle.setAttribute('aria-expanded',open?'true':'false');
|
|
327
|
+
if(mobileNav.matches){
|
|
328
|
+
sidebar.inert=!open;
|
|
329
|
+
if(open)sidebar.removeAttribute('aria-hidden');
|
|
330
|
+
else sidebar.setAttribute('aria-hidden','true');
|
|
331
|
+
setSidebarFocusable(open);
|
|
332
|
+
}else{
|
|
333
|
+
sidebar.inert=false;
|
|
334
|
+
sidebar.removeAttribute('aria-hidden');
|
|
335
|
+
setSidebarFocusable(true);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
setSidebarOpen(false);
|
|
339
|
+
toggle?.addEventListener('click',()=>setSidebarOpen(!sidebar?.classList.contains('open')));
|
|
340
|
+
document.addEventListener('click',(e)=>{if(!sidebar?.classList.contains('open'))return;if(sidebar.contains(e.target)||toggle?.contains(e.target))return;setSidebarOpen(false)});
|
|
341
|
+
document.addEventListener('keydown',(e)=>{if(e.key==='Escape')setSidebarOpen(false)});
|
|
342
|
+
const syncSidebarForViewport=()=>setSidebarOpen(sidebar?.classList.contains('open')??false);
|
|
343
|
+
if(mobileNav.addEventListener)mobileNav.addEventListener('change',syncSidebarForViewport);
|
|
344
|
+
else mobileNav.addListener?.(syncSidebarForViewport);
|
|
345
|
+
const input=document.getElementById('doc-search');
|
|
346
|
+
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'})});
|
|
347
|
+
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)}
|
|
348
|
+
document.querySelectorAll('.doc pre').forEach(pre=>attachCopy(pre,()=>pre.querySelector('code')?.textContent??''));
|
|
349
|
+
document.querySelectorAll('.home-install').forEach(el=>attachCopy(el,()=>el.querySelector('code')?.textContent??''));
|
|
350
|
+
const tocLinks=document.querySelectorAll('.toc a');
|
|
351
|
+
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))}
|
|
352
|
+
</script>
|
|
353
|
+
</body>
|
|
354
|
+
</html>
|