@h-rig/product-ad-website 0.0.6-alpha.283

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.
Files changed (38) hide show
  1. package/README.md +3 -0
  2. package/package.json +52 -0
  3. package/site/assets/favicon.svg +1 -0
  4. package/site/assets/og-card.png +0 -0
  5. package/site/assets/rig.css +199 -0
  6. package/site/assets/rig.js +66 -0
  7. package/site/assets/search-index.json +1 -0
  8. package/site/assets/site.css +46 -0
  9. package/site/assets/site.js +510 -0
  10. package/site/cli/index.html +88 -0
  11. package/site/config/index.html +256 -0
  12. package/site/docs/agent-tools/index.html +129 -0
  13. package/site/docs/architecture/index.html +42 -0
  14. package/site/docs/capabilities/index.html +84 -0
  15. package/site/docs/entities/index.html +68 -0
  16. package/site/docs/environment/index.html +62 -0
  17. package/site/docs/faq/index.html +17 -0
  18. package/site/docs/fleet-irc/index.html +44 -0
  19. package/site/docs/gate/index.html +128 -0
  20. package/site/docs/getting-started/index.html +50 -0
  21. package/site/docs/glossary/index.html +31 -0
  22. package/site/docs/index.html +68 -0
  23. package/site/docs/operator/index.html +49 -0
  24. package/site/docs/packages/index.html +36 -0
  25. package/site/docs/pi-extensions/index.html +15 -0
  26. package/site/docs/recipes/index.html +28 -0
  27. package/site/docs/runs/index.html +35 -0
  28. package/site/docs/security/index.html +29 -0
  29. package/site/docs/server/index.html +27 -0
  30. package/site/docs/swarm-commander/index.html +41 -0
  31. package/site/docs/task-sources/index.html +129 -0
  32. package/site/docs/troubleshooting/index.html +23 -0
  33. package/site/docs/validators/index.html +177 -0
  34. package/site/index.html +1653 -0
  35. package/site/plugins/examples/index.html +419 -0
  36. package/site/plugins/index.html +193 -0
  37. package/site/skills/index.html +140 -0
  38. package/site/variants/deck/index.html +1 -0
@@ -0,0 +1,510 @@
1
+ /* Shared site behaviors: Pi terminal player + docs search.
2
+ Loaded on every page (path-relative); see scripts/site-build.ts. */
3
+
4
+ /* ---------- Pi terminal player ----------
5
+ Markup contract:
6
+ <div class="pi-term" data-title="pi — attach" data-rows="14">
7
+ <script type="application/json">[
8
+ {"t":"u","s":"so now tell me: what's so special about pi?"},
9
+ {"t":"think","ms":1400},
10
+ {"t":"out","s":"Pi is minimal by design, and it can change itself in place."},
11
+ {"t":"del","s":" --recording-font-family: var(--serif);"},
12
+ {"t":"add","s":" --recording-font-family: \"Comic Sans MS\", cursive;"},
13
+ {"t":"pause","ms":2000}
14
+ ]</script>
15
+ <div class="pi-term-status-data" hidden
16
+ data-path="~/work/rig (main)"
17
+ data-stats="&uarr;6.4k &darr;122 R9.3k $0.000 (sub) 5.5%/128k (auto)"
18
+ data-model="worker brain &bull; thinking off"></div>
19
+ </div>
20
+ Step types: u (typed user line), out, dim, code, add, del (instant lines),
21
+ think (transient "Thinking..."), pause. The player builds the chrome,
22
+ plays on viewport entry, loops forever. */
23
+ (function () {
24
+ var terms = document.querySelectorAll(".pi-term");
25
+ if (!terms.length) return;
26
+
27
+ function build(term) {
28
+ var scriptEl = term.querySelector('script[type="application/json"]');
29
+ if (!scriptEl) return null;
30
+ var steps;
31
+ try { steps = JSON.parse(scriptEl.textContent); } catch (e) { return null; }
32
+ var statusData = term.querySelector(".pi-term-status-data");
33
+ var rows = parseInt(term.getAttribute("data-rows") || "12", 10);
34
+
35
+ var bar = document.createElement("div");
36
+ bar.className = "pi-term-bar";
37
+ var t = document.createElement("span");
38
+ t.className = "t";
39
+ t.textContent = term.getAttribute("data-title") || "pi";
40
+ var dot = document.createElement("span");
41
+ dot.className = "dot";
42
+ bar.appendChild(t); bar.appendChild(dot);
43
+
44
+ var body = document.createElement("div");
45
+ body.className = "pi-term-body";
46
+ body.style.height = (rows * 1.85) + "em";
47
+
48
+ var input = document.createElement("div");
49
+ input.className = "pi-term-input";
50
+ var typed = document.createElement("span");
51
+ var cur = document.createElement("span");
52
+ cur.className = "cur";
53
+ cur.innerHTML = "&nbsp;";
54
+ input.appendChild(typed); input.appendChild(cur);
55
+
56
+ var status = document.createElement("div");
57
+ status.className = "pi-term-status";
58
+ var r1 = document.createElement("div");
59
+ r1.className = "row";
60
+ r1.textContent = statusData ? (statusData.getAttribute("data-path") || "") : "";
61
+ var r2 = document.createElement("div");
62
+ r2.className = "row";
63
+ var left = document.createElement("span");
64
+ left.innerHTML = statusData ? (statusData.getAttribute("data-stats") || "") : "";
65
+ var right = document.createElement("span");
66
+ right.className = "right";
67
+ right.innerHTML = statusData ? (statusData.getAttribute("data-model") || "") : "";
68
+ r2.appendChild(left); r2.appendChild(right);
69
+ status.appendChild(r1); status.appendChild(r2);
70
+
71
+ term.appendChild(bar); term.appendChild(body); term.appendChild(input); term.appendChild(status);
72
+ return { steps: steps, body: body, typed: typed, rows: rows };
73
+ }
74
+
75
+ function play(st) {
76
+ var i = 0, lines = [], timer = null, thinkEl = null;
77
+
78
+ function render() {
79
+ while (lines.length > st.rows) lines.shift();
80
+ st.body.innerHTML = "";
81
+ for (var k = 0; k < lines.length; k++) st.body.appendChild(lines[k]);
82
+ }
83
+ function addLine(cls, text) {
84
+ var el = document.createElement("div");
85
+ el.className = "ln " + cls;
86
+ el.textContent = text;
87
+ lines.push(el);
88
+ render();
89
+ return el;
90
+ }
91
+ function schedule(ms) { timer = setTimeout(step, ms); }
92
+
93
+ function step() {
94
+ if (thinkEl) {
95
+ var ix = lines.indexOf(thinkEl);
96
+ if (ix >= 0) lines.splice(ix, 1);
97
+ thinkEl = null;
98
+ render();
99
+ }
100
+ if (i >= st.steps.length) { i = 0; lines = []; st.typed.textContent = ""; render(); schedule(1200); return; }
101
+ var s = st.steps[i++];
102
+ if (s.t === "pause") { schedule(s.ms || 1500); return; }
103
+ if (s.t === "think") {
104
+ thinkEl = addLine("think", "Thinking...");
105
+ schedule(s.ms || 1400);
106
+ return;
107
+ }
108
+ if (s.t === "u") {
109
+ // typewriter into the input slot, then commit to the body
110
+ var text = s.s || "", p = 0;
111
+ st.typed.textContent = "";
112
+ (function type() {
113
+ if (p < text.length) {
114
+ st.typed.textContent += text.charAt(p++);
115
+ timer = setTimeout(type, 24 + Math.random() * 40);
116
+ } else {
117
+ timer = setTimeout(function () {
118
+ st.typed.textContent = "";
119
+ addLine("u", text);
120
+ addLine("dim", "");
121
+ schedule(420);
122
+ }, 380);
123
+ }
124
+ })();
125
+ return;
126
+ }
127
+ addLine(s.t, s.s || "");
128
+ schedule(s.ms || 320);
129
+ }
130
+
131
+ return {
132
+ start: function () { if (!timer) step(); },
133
+ stop: function () { if (timer) { clearTimeout(timer); timer = null; } }
134
+ };
135
+ }
136
+
137
+ var players = [];
138
+ terms.forEach(function (term) {
139
+ var st = build(term);
140
+ if (st) players.push({ el: term, p: play(st), running: false });
141
+ });
142
+ if (!("IntersectionObserver" in window)) {
143
+ players.forEach(function (e) { e.p.start(); });
144
+ return;
145
+ }
146
+ var io = new IntersectionObserver(function (entries) {
147
+ entries.forEach(function (en) {
148
+ var rec = players.find(function (e) { return e.el === en.target; });
149
+ if (!rec) return;
150
+ if (en.isIntersecting && !rec.running) { rec.running = true; rec.p.start(); }
151
+ });
152
+ }, { threshold: 0.25 });
153
+ players.forEach(function (e) { io.observe(e.el); });
154
+ })();
155
+
156
+ /* ---------- docs search (Cmd/Ctrl-K) ---------- */
157
+ (function () {
158
+ // Resolve the site root from this script's own src so every page depth works.
159
+ var me = document.currentScript || document.querySelector('script[src*="site.js"]');
160
+ var base = me ? me.getAttribute("src").replace(/assets\/site\.js.*$/, "") : "./";
161
+
162
+ var overlay = null, input = null, resultsEl = null, index = null, sel = 0, items = [];
163
+
164
+ function ensureUi() {
165
+ if (overlay) return;
166
+ overlay = document.createElement("div");
167
+ overlay.className = "search-overlay";
168
+ overlay.innerHTML =
169
+ '<div class="search-box">' +
170
+ '<input type="text" placeholder="Search the docs..." autocomplete="off" spellcheck="false">' +
171
+ '<div class="search-results"></div>' +
172
+ '<div class="search-hint"><span>&uarr;&darr; navigate</span><span>&crarr; open</span><span>esc close</span></div>' +
173
+ "</div>";
174
+ document.body.appendChild(overlay);
175
+ input = overlay.querySelector("input");
176
+ resultsEl = overlay.querySelector(".search-results");
177
+ overlay.addEventListener("mousedown", function (e) { if (e.target === overlay) close(); });
178
+ input.addEventListener("input", function () { query(input.value); });
179
+ input.addEventListener("keydown", function (e) {
180
+ if (e.key === "ArrowDown") { e.preventDefault(); move(1); }
181
+ else if (e.key === "ArrowUp") { e.preventDefault(); move(-1); }
182
+ else if (e.key === "Enter") { e.preventDefault(); openSel(); }
183
+ else if (e.key === "Escape") { close(); }
184
+ });
185
+ }
186
+
187
+ function load(cb) {
188
+ if (index) { cb(); return; }
189
+ fetch(base + "assets/search-index.json")
190
+ .then(function (r) { return r.json(); })
191
+ .then(function (j) { index = j; cb(); })
192
+ .catch(function () {
193
+ resultsEl.innerHTML = '<div class="search-empty">search index unavailable</div>';
194
+ });
195
+ }
196
+
197
+ function open() {
198
+ ensureUi();
199
+ overlay.classList.add("open");
200
+ input.value = "";
201
+ resultsEl.innerHTML = '<div class="search-empty">type to search every docs page</div>';
202
+ setTimeout(function () { input.focus(); }, 10);
203
+ load(function () {});
204
+ }
205
+ function close() { if (overlay) overlay.classList.remove("open"); }
206
+ window.rigSearchOpen = open;
207
+
208
+ function tokenize(q) {
209
+ return q.toLowerCase().split(/\s+/).filter(function (w) { return w.length > 1; });
210
+ }
211
+
212
+ function query(q) {
213
+ sel = 0;
214
+ var words = tokenize(q);
215
+ if (!index || !words.length) {
216
+ resultsEl.innerHTML = '<div class="search-empty">type to search every docs page</div>';
217
+ items = [];
218
+ return;
219
+ }
220
+ var scored = [];
221
+ index.pages.forEach(function (page) {
222
+ page.sections.forEach(function (sec) {
223
+ var hayTitle = (page.title + " " + sec.heading).toLowerCase();
224
+ var hayBody = sec.text.toLowerCase();
225
+ var score = 0, allFound = true;
226
+ words.forEach(function (w) {
227
+ var inTitle = hayTitle.indexOf(w) >= 0;
228
+ var inBody = hayBody.indexOf(w) >= 0;
229
+ if (inTitle) score += 14;
230
+ if (inBody) score += 3;
231
+ if (!inTitle && !inBody) allFound = false;
232
+ });
233
+ if (allFound && score > 0) scored.push({ page: page, sec: sec, score: score });
234
+ });
235
+ });
236
+ scored.sort(function (a, b) { return b.score - a.score; });
237
+ scored = scored.slice(0, 12);
238
+ items = scored;
239
+ if (!scored.length) {
240
+ resultsEl.innerHTML = '<div class="search-empty">no matches for &ldquo;' + q.replace(/[<>&]/g, "") + '&rdquo;</div>';
241
+ return;
242
+ }
243
+ resultsEl.innerHTML = "";
244
+ scored.forEach(function (it, n) {
245
+ var a = document.createElement("a");
246
+ a.className = "sr" + (n === sel ? " sel" : "");
247
+ a.href = base + it.page.url + (it.sec.id ? "#" + it.sec.id : "");
248
+ var snippet = makeSnippet(it.sec.text, words);
249
+ a.innerHTML =
250
+ '<span class="pg">' + esc(it.page.title) + "</span>" +
251
+ '<span class="hd">' + esc(it.sec.heading || it.page.title) + "</span>" +
252
+ '<span class="sn">' + snippet + "</span>";
253
+ resultsEl.appendChild(a);
254
+ });
255
+ }
256
+
257
+ function esc(s) { return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"); }
258
+
259
+ function makeSnippet(text, words) {
260
+ var lower = text.toLowerCase(), at = -1;
261
+ for (var i = 0; i < words.length; i++) {
262
+ at = lower.indexOf(words[i]);
263
+ if (at >= 0) break;
264
+ }
265
+ var start = Math.max(0, at - 60);
266
+ var chunk = (start > 0 ? "…" : "") + text.slice(start, start + 180) + (start + 180 < text.length ? "…" : "");
267
+ var out = esc(chunk);
268
+ words.forEach(function (w) {
269
+ out = out.replace(new RegExp("(" + w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + ")", "ig"), "<mark>$1</mark>");
270
+ });
271
+ return out;
272
+ }
273
+
274
+ function move(d) {
275
+ var els = resultsEl.querySelectorAll(".sr");
276
+ if (!els.length) return;
277
+ sel = (sel + d + els.length) % els.length;
278
+ els.forEach(function (el, n) { el.classList.toggle("sel", n === sel); });
279
+ els[sel].scrollIntoView({ block: "nearest" });
280
+ }
281
+ function openSel() {
282
+ var els = resultsEl.querySelectorAll(".sr");
283
+ if (els[sel]) window.location.href = els[sel].href;
284
+ }
285
+
286
+ addEventListener("keydown", function (e) {
287
+ if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k") { e.preventDefault(); open(); }
288
+ else if (e.key === "/" && !/input|textarea/i.test((document.activeElement || {}).tagName || "")) { e.preventDefault(); open(); }
289
+ });
290
+ })();
291
+
292
+ /* ===== COMPANION DRONE =====================================================
293
+ A wingman that escorts the cursor on EVERY page (home + docs). Spring-follow
294
+ flight with banking, rotors that rev with speed, thruster exhaust — plus a
295
+ scenario engine: what it does depends on what you're pointing at.
296
+
297
+ Scenarios:
298
+ 1 scan interactive element cyan lock-on beam + cyan eye
299
+ 2 read code / pre / terminal closes in, eye saccades, data bits
300
+ stream from the element into it
301
+ 3 salute first visit to an h1/h2 barrel roll
302
+ 4 judge "the gate" content magenta eye, disapproving head-shake
303
+ 5 ok-ping element containing a ✓ lime radar ping (once per element)
304
+ 6 install the install one-liner orbits it once, then beams the
305
+ copy button
306
+ 7 burst any click spark explosion + 360 spin
307
+ 8 tumble fast scroll rotation kick, stabilizes with
308
+ extra thrust
309
+ 9 patrol idle ~4s lazy lissajous drift
310
+ 10 land idle ~25s perches lower-right, rotors wind
311
+ down, eye dims; dust on takeoff
312
+ 11 duck cursor near the nav flies BELOW the cursor so it never
313
+ hides under the chrome
314
+ 12 greet the hero ASCII sibling / double nod + alternating
315
+ any pi-term lime/cyan blinks
316
+ 13 tail-chase dogfood ("Rig ships Rig") chases its own tail, ouroboros-style
317
+ 14 table-scan any table parks at the edge, sweeps a beam
318
+ down the rows
319
+ 15 assist search modal open (⌘K) parks beside the box, rotors rev,
320
+ eye pulses cyan
321
+ 16 highlight text selection beams the selection, eye flares
322
+ 17 farewell footer slow wide goodbye circle, dips low
323
+
324
+ pointer-events: none — it can never block a click. Skipped on touch devices
325
+ and for prefers-reduced-motion. */
326
+ (function () {
327
+ if (matchMedia("(pointer:coarse)").matches || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
328
+ var cv = document.createElement("canvas"); cv.id = "dronecv"; cv.width = 200; cv.height = 200;
329
+ document.body.appendChild(cv);
330
+ var ctx = cv.getContext("2d");
331
+ var LIME = "204,255,77", PALE = "234,255,176", CYAN = "86,216,255", MAG = "255,121,176";
332
+ var x = innerWidth * 0.72, y = innerHeight * 0.28, vx = 0, vy = 0, tx = x, ty = y;
333
+ var rot = 0, rotV = 0, spin = 0, spinT = 0, t = 0, lastMove = -999, lastSY = scrollY;
334
+ var sparks = [], bits = [], rings = [];
335
+ var mode = { name: "cruise", until: 0, data: null, born: 0 };
336
+ var saluted = new WeakSet(), pinged = new WeakSet(), greetAt = -9999;
337
+ var gatePage = /\/gate\//.test(location.pathname);
338
+
339
+ function setMode(n, dur, data) { if (mode.name === n && mode.data === data) { mode.until = t + dur; return; } mode = { name: n, until: t + dur, data: data || null, born: t }; }
340
+ function on(n) { return mode.name === n && t < mode.until; }
341
+ function age() { return t - mode.born; }
342
+ function rect(el) { try { return el.getBoundingClientRect(); } catch (e) { return null; } }
343
+
344
+ addEventListener("mousemove", function (e) {
345
+ // (11) duck under the cursor when it's near the fixed nav
346
+ tx = e.clientX + 36; ty = e.clientY + (e.clientY < 130 ? 58 : -46);
347
+ lastMove = t;
348
+ if (mode.name === "land") { setMode("takeoff", 40); for (var i = 0; i < 8; i++) sparks.push({ x: (Math.random() - .5) * 14, y: 10, vx: (Math.random() - .5) * 1.6, vy: -Math.random() * 1.2, life: .8 }); }
349
+ var el = e.target, hit;
350
+ if (!el || !el.closest) return;
351
+ if ((hit = el.closest(".inst"))) setMode("install", 280, hit);
352
+ else if ((hit = el.closest("#cine,.mascot,.pi-term"))) {
353
+ if (t - greetAt > 1800) { greetAt = t; setMode("greet", 150, hit); }
354
+ else setMode("read", 50, hit);
355
+ }
356
+ else if ((hit = el.closest("code,pre,.pp,.scr,.pi-term-body"))) setMode("read", 50, hit);
357
+ else if ((hit = el.closest("table"))) setMode("tablescan", 60, hit);
358
+ else if ((hit = el.closest("h1,h2"))) { if (!saluted.has(hit)) { saluted.add(hit); spinT += 6.283; setMode("salute", 80, hit); } }
359
+ else if ((hit = el.closest("a,button,.btn,.pk,.mv,.stage,.vcard,.panel,.nsearch"))) {
360
+ if (hit.querySelector && hit.querySelector(".ok") && !pinged.has(hit)) { pinged.add(hit); rings.push({ r: 6, a: .55, hue: LIME }); setMode("okping", 50, hit); }
361
+ else setMode("scan", 50, hit);
362
+ }
363
+ else {
364
+ var sec = el.closest("section,footer,main");
365
+ if (sec) {
366
+ if (sec.tagName === "FOOTER") setMode("farewell", 200);
367
+ else {
368
+ var eb = sec.querySelector && sec.querySelector(".eyebrow");
369
+ var ebt = (eb && eb.textContent) || "";
370
+ if (/the gate/i.test(ebt) || gatePage) setMode("judge", 120);
371
+ else if (/dogfood/i.test(ebt)) setMode("tail", 180);
372
+ }
373
+ }
374
+ }
375
+ }, { passive: true });
376
+
377
+ addEventListener("mousedown", function () {
378
+ spinT += 6.283;
379
+ for (var i = 0; i < 14; i++) sparks.push({ x: 0, y: 0, vx: (Math.random() - .5) * 3.4, vy: (Math.random() - .5) * 3.4, life: 1 });
380
+ setMode("burst", 40);
381
+ }, { passive: true });
382
+
383
+ addEventListener("scroll", function () {
384
+ var d = Math.abs(scrollY - lastSY); lastSY = scrollY;
385
+ if (on("scan") || on("read") || on("tablescan")) mode.until = 0;
386
+ if (d > 140) { rotV += (Math.random() < .5 ? -1 : 1) * .3; setMode("tumble", 55); }
387
+ }, { passive: true });
388
+
389
+ document.addEventListener("selectionchange", function () {
390
+ var s = getSelection();
391
+ if (s && !s.isCollapsed && String(s).trim().length > 2) setMode("highlight", 200);
392
+ });
393
+
394
+ function selRect() {
395
+ var s = getSelection();
396
+ if (!s || s.isCollapsed || !s.rangeCount) return null;
397
+ var r = s.getRangeAt(0).getBoundingClientRect();
398
+ return r.width || r.height ? r : null;
399
+ }
400
+
401
+ function frame() {
402
+ t++;
403
+ // (15) assist: notice the search modal regardless of pointer
404
+ if (t % 20 === 0) { var so = document.querySelector(".search-overlay.open"); if (so) setMode("assist", 40, so.querySelector(".search-box") || so); }
405
+ // (10) land after long idle
406
+ if (t - lastMove > 1500 && mode.name !== "land" && mode.name !== "assist") setMode("land", 1e9);
407
+
408
+ // ---- flight target per scenario ----
409
+ var ix = tx, iy = ty, r0;
410
+ if (on("install") && mode.data && (r0 = rect(mode.data))) {
411
+ var icx = r0.left + r0.width / 2, icy = r0.top + r0.height / 2;
412
+ if (age() < 170) { var oa = age() * .037; ix = icx + Math.cos(oa) * (r0.width * .55 + 30); iy = icy + Math.sin(oa) * 42; } // one orbit
413
+ else { ix = r0.right - 18; iy = r0.top - 40; } // then hold over the copy button
414
+ } else if (on("read") && mode.data && (r0 = rect(mode.data))) {
415
+ ix = tx * .4 + (r0.left + r0.width / 2) * .6; iy = Math.max(60, r0.top - 26) * .6 + ty * .4; // lean in over the code
416
+ } else if (on("tablescan") && mode.data && (r0 = rect(mode.data))) {
417
+ ix = r0.right + 34; iy = r0.top + ((t * 1.6) % Math.max(40, r0.height));
418
+ } else if (on("assist") && mode.data && (r0 = rect(mode.data))) {
419
+ ix = r0.right + 44; iy = r0.top + 30;
420
+ } else if (on("tail")) { ix = tx + Math.cos(t * .14) * 30; iy = ty + Math.sin(t * .14) * 30; }
421
+ else if (on("farewell")) { ix = tx + Math.cos(t * .02) * 80; iy = ty + 50 + Math.sin(t * .04) * 12; }
422
+ else if (on("greet")) { iy = ty + (age() % 50 < 25 ? 10 : -10); }
423
+ else if (on("judge")) { ix = tx + Math.sin(t * .45) * 9; }
424
+ else if (mode.name === "land") { ix = innerWidth - 90; iy = innerHeight - 74; }
425
+ else if (t - lastMove > 240) { ix = tx + Math.sin(t * .012) * 64; iy = ty + Math.cos(t * .016) * 42; } // (9) patrol
426
+
427
+ // ---- physics ----
428
+ vx += (ix - x) * .012; vy += (iy - y) * .012; vx *= .88; vy *= .88; x += vx; y += vy;
429
+ var spd = Math.hypot(vx, vy);
430
+ var grounded = mode.name === "land" && Math.abs(y - (innerHeight - 74)) < 8;
431
+ var bob = grounded ? 0 : Math.sin(t * .06) * 3;
432
+ rotV *= .9; rot += rotV; rot += (Math.max(-.45, Math.min(.45, vx * .022)) - rot) * .1;
433
+ spin += (spinT - spin) * .09; if (Math.abs(spinT - spin) < .01) spin = spinT;
434
+ cv.style.transform = "translate3d(" + (x - 100) + "px," + (y - 100 + bob) + "px,0)";
435
+
436
+ // ---- draw ----
437
+ ctx.clearRect(0, 0, 200, 200);
438
+ ctx.save(); ctx.translate(100, 100); ctx.rotate(rot + spin);
439
+ var rotorSpd = grounded ? .04 : (.3 + spd * .07 + (on("assist") ? .35 : 0));
440
+
441
+ // thruster exhaust
442
+ if (spd > 1.2 && t % 2 === 0) sparks.push({ x: -vx * 1.6, y: 8, vx: -vx * .3 + (Math.random() - .5), vy: 1 + Math.random(), life: .7 });
443
+ if (on("tumble") && t % 2 === 0) sparks.push({ x: (Math.random() - .5) * 10, y: 8, vx: (Math.random() - .5) * 2, vy: 1.6 + Math.random(), life: .8 });
444
+ for (var i = sparks.length - 1; i >= 0; i--) {
445
+ var sp = sparks[i]; sp.x += sp.vx; sp.y += sp.vy; sp.life -= .04;
446
+ if (sp.life <= 0) { sparks.splice(i, 1); continue; }
447
+ ctx.fillStyle = "rgba(" + LIME + "," + (.5 * sp.life) + ")"; ctx.fillRect(sp.x, sp.y, 1.6, 1.6);
448
+ }
449
+ // radar ping rings
450
+ for (var g = rings.length - 1; g >= 0; g--) {
451
+ var rg = rings[g]; rg.r += 1.7; rg.a *= .93;
452
+ if (rg.a < .02) { rings.splice(g, 1); continue; }
453
+ ctx.strokeStyle = "rgba(" + rg.hue + "," + rg.a + ")"; ctx.lineWidth = 1; ctx.beginPath(); ctx.arc(0, 0, rg.r, 0, 7); ctx.stroke();
454
+ }
455
+
456
+ // beams + data bits toward whatever the scenario is locked on
457
+ var beamTo = null, beamHue = CYAN;
458
+ if (on("scan") && mode.data) beamTo = rect(mode.data);
459
+ else if (on("install") && age() >= 170 && mode.data) { var ir = rect(mode.data); if (ir) beamTo = { left: ir.right - 50, top: ir.top, width: 40, height: ir.height }; }
460
+ else if (on("tablescan") && mode.data) { var tr = rect(mode.data); if (tr) beamTo = { left: tr.left, top: tr.top + ((t * 1.6) % Math.max(40, tr.height)), width: tr.width, height: 2 }; }
461
+ else if (on("highlight")) { beamTo = selRect(); beamHue = LIME; }
462
+ if (beamTo) {
463
+ var bx = beamTo.left + beamTo.width / 2 - x, by = beamTo.top + beamTo.height / 2 - y;
464
+ var bd = Math.hypot(bx, by) || 1, ux = bx / bd, uy = by / bd, len = Math.min(bd, 78);
465
+ var bg = ctx.createLinearGradient(0, 0, ux * len, uy * len);
466
+ bg.addColorStop(0, "rgba(" + beamHue + ",.45)"); bg.addColorStop(1, "rgba(" + beamHue + ",0)");
467
+ ctx.strokeStyle = bg; ctx.lineWidth = 1; ctx.setLineDash([3, 5]); ctx.beginPath(); ctx.moveTo(ux * 11, uy * 11); ctx.lineTo(ux * len, uy * len); ctx.stroke(); ctx.setLineDash([]);
468
+ }
469
+ if (on("read") && mode.data && t % 5 === 0) {
470
+ var rr = rect(mode.data);
471
+ if (rr) { var sxx = rr.left + Math.random() * rr.width - x, syy = rr.top + Math.random() * rr.height - y; var sd = Math.hypot(sxx, syy); if (sd < 320) bits.push({ x: sxx, y: syy, life: 1 }); }
472
+ }
473
+ for (var b2 = bits.length - 1; b2 >= 0; b2--) {
474
+ var bt = bits[b2]; bt.x *= .9; bt.y *= .9; bt.life -= .03;
475
+ if (bt.life <= 0 || (Math.abs(bt.x) < 4 && Math.abs(bt.y) < 4)) { bits.splice(b2, 1); continue; }
476
+ ctx.fillStyle = "rgba(" + CYAN + "," + (.6 * bt.life) + ")"; ctx.fillRect(bt.x, bt.y, 1.5, 1.5);
477
+ }
478
+
479
+ // arms + rotors
480
+ var rs = t * rotorSpd;
481
+ for (var q = 0; q < 4; q++) {
482
+ var aa = q * 1.5708 + .7854, ax = Math.cos(aa) * 16, ay = Math.sin(aa) * 11;
483
+ ctx.strokeStyle = "rgba(169,214,63,.7)"; ctx.lineWidth = 1.2; ctx.beginPath(); ctx.moveTo(0, 0); ctx.lineTo(ax, ay); ctx.stroke();
484
+ ctx.save(); ctx.translate(ax, ay); ctx.rotate(rs * (q % 2 ? 1 : -1));
485
+ ctx.strokeStyle = "rgba(125,158,52,.85)"; ctx.lineWidth = 1; ctx.beginPath(); ctx.ellipse(0, 0, 7, 2.4, 0, 0, 7); ctx.stroke(); ctx.restore();
486
+ ctx.fillStyle = "rgba(" + LIME + ",.8)"; ctx.beginPath(); ctx.arc(ax, ay, 1.6, 0, 7); ctx.fill();
487
+ }
488
+ // body
489
+ ctx.fillStyle = "rgba(18,22,10,.92)"; ctx.strokeStyle = "rgba(" + LIME + ",.75)"; ctx.lineWidth = 1.3;
490
+ ctx.beginPath(); ctx.ellipse(0, 0, 9, 6.4, 0, 0, 7); ctx.fill(); ctx.stroke();
491
+
492
+ // eye — saccades over code, blinks, changes color with intent
493
+ var lx = Math.max(-3, Math.min(3, (tx - x) * .04)), ly = Math.max(-2, Math.min(2, (ty - y) * .04));
494
+ if (on("read")) lx = Math.sin(t * .5) * 3; // reading saccades
495
+ if (on("tail")) { lx = Math.cos(t * .14 + 1.2) * 3; ly = Math.sin(t * .14 + 1.2) * 2; } // watching its own tail
496
+ var ec = PALE, ea = .95;
497
+ if (on("scan") || on("read") || on("tablescan") || on("install")) ec = CYAN;
498
+ else if (on("assist")) { ec = CYAN; ea = .6 + .35 * Math.sin(t * .25); }
499
+ else if (on("judge")) ec = MAG;
500
+ else if (on("highlight") || on("okping")) ec = LIME;
501
+ else if (mode.name === "land" && grounded) { ec = LIME; ea = .25 + .12 * Math.sin(t * .04); } // ember
502
+ var blink = (t % 200) < 5 ? .15 : 1;
503
+ if (on("greet")) { ec = (age() % 50 < 25) ? LIME : CYAN; blink = (age() % 25) < 4 ? .15 : 1; }
504
+ ctx.fillStyle = "rgba(" + ec + "," + (ea * blink) + ")"; ctx.beginPath(); ctx.arc(lx, ly - .5, 2.1, 0, 7); ctx.fill();
505
+ ctx.fillStyle = "rgba(" + ec + ",.25)"; ctx.beginPath(); ctx.arc(lx, ly - .5, 5.5, 0, 7); ctx.fill();
506
+ ctx.restore();
507
+ requestAnimationFrame(frame);
508
+ }
509
+ frame();
510
+ })();
@@ -0,0 +1,88 @@
1
+ <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>CLI reference // RIG</title><meta property="og:image" content="https://how.rig-does.work/assets/og-card.png"><meta name="twitter:card" content="summary_large_image"><meta name="description" content="The Rig launcher: foreground OMP, inline /fleet, /tasks, /drone cards, exact-run attach, rig doctor, and the exact headless CLI over the same operations."><meta property="og:title" content="CLI reference // RIG"><meta property="og:description" content="The Rig launcher: foreground OMP, inline /fleet, /tasks, /drone cards, exact-run attach, rig doctor, and the exact headless CLI over the same operations."><link rel="stylesheet" href="../assets/rig.css?v=v9"><link rel="stylesheet" href="../assets/site.css?v=v9"><link rel="icon" type="image/svg+xml" href="../assets/favicon.svg"></head><body><canvas id="docfield"></canvas><nav class="nav"><div class="nav-in"><a class="brand" href="../index.html"><span class="mk"></span><span class="blk">Rig</span></a><button class="burger" onclick="document.getElementById('nl').classList.toggle('open')">menu</button><div class="nav-links" id="nl"><button class="nsearch" type="button" onclick="rigSearchOpen()">search<kbd>&#8984;K</kbd></button><a href="../index.html" class="">overview</a><a href="../docs/index.html" class="">docs</a><a href="../plugins/index.html" class="">plugins</a><a href="../skills/index.html" class="">skills</a><a href="../cli/index.html" class="active">cli</a><a href="../config/index.html" class="">config</a><a href="https://github.com/humanity-org/rig" class="ext">github</a></div></div></nav><div class="docwrap"><aside class="sidebar"><div class="grp">START</div><a href="../docs/index.html" class="">docs home</a><a href="../docs/capabilities/index.html" class="">capabilities</a><a href="../docs/getting-started/index.html" class="">getting started</a><div class="grp">RUN</div><a href="../docs/runs/index.html" class="">the run lifecycle</a><a href="../docs/operator/index.html" class="">operator guide</a><a href="../docs/swarm-commander/index.html" class="">swarm commander</a><a href="../docs/fleet-irc/index.html" class="">drone messages</a><a href="../docs/agent-tools/index.html" class="">agent tools</a><a href="../docs/gate/index.html" class="">the merge gate</a><a href="../docs/troubleshooting/index.html" class="">troubleshooting</a><div class="grp">ARCHITECTURE</div><a href="../docs/architecture/index.html" class="">how rig works</a><a href="../docs/entities/index.html" class="">entities & data model</a><a href="../docs/server/index.html" class="">OMP relay/web</a><a href="../docs/security/index.html" class="">security & trust</a><a href="../docs/environment/index.html" class="">environment variables</a><div class="grp">EXTEND</div><a href="../plugins/index.html" class="">plugin authoring</a><a href="../plugins/examples/index.html" class="">plugin examples</a><a href="../docs/pi-extensions/index.html" class="">OMP/Pi extensions</a><a href="../skills/index.html" class="">skills</a><a href="../docs/task-sources/index.html" class="">task sources</a><a href="../docs/validators/index.html" class="">validators & hooks</a><div class="grp">OPERATE</div><a href="../cli/index.html" class="active">cli reference</a><a href="../config/index.html" class="">rig.config.ts</a><a href="../docs/recipes/index.html" class="">recipes</a><a href="../docs/glossary/index.html" class="">glossary</a><a href="../docs/faq/index.html" class="">faq</a><div class="grp">ENGINE</div><a href="../docs/packages/index.html" class="">packages</a></aside><main class="doc"><h1>CLI reference</h1>
2
+ <p class="lede">Rig has two first-class faces over one set of CNet and domain operations. Interactively, bare <code>rig</code> opens foreground OMP with the bundled Rig extension; work streams into the cnet and <code>/fleet</code>, <code>/tasks</code>, and <code>/drone</code> materialize focused cards inline. Headlessly, the exact <code>rig</code> command tree runs those same operations non-interactively for scripts, CI, and agents.</p>
3
+
4
+ <div class="note"><b>The interactive session:</b> <code>rig</code> opens foreground OMP with Rig. The Swarm Commander is a model role in that chat; <code>/fleet</code>, <code>/tasks</code>, and <code>/drone [ref]</code> write CNet cards into the transcript, while inline attention items carry pending operator actions. <code>rig doctor</code> stays a terminal diagnostic command.</div>
5
+
6
+ <h2 id="global-options">Global options <span class="ns">// launcher and headless CLI flags</span></h2>
7
+ <p>These flags apply to the launcher and to the exact CLI command groups that run the same domain operations headlessly.</p>
8
+ <table class="t"><thead><tr><th>flag</th><th>what it does</th></tr></thead>
9
+ <tbody>
10
+ <tr><td><code>--workspace &lt;path&gt;</code></td><td>Open the Rig session for an explicit workspace root instead of auto-discovering from the cwd. Useful when operating a project without cd-ing into it.</td></tr>
11
+ <tr><td><code>--json</code></td><td>Structured machine output: subcommands that support it emit a structured record instead of a rendered human view, for scripts, CI, and agents.</td></tr>
12
+ <tr><td><code>--dry-run</code></td><td>Deterministic plan where supported: prints the plan a subcommand would execute without mutating state.</td></tr>
13
+ <tr><td><code>--version</code></td><td>Print the installed Rig CLI version.</td></tr>
14
+ </tbody></table>
15
+
16
+ <h2 id="start-here">Start here <span class="ns">// session first</span></h2>
17
+ <table class="t"><thead><tr><th>command / action</th><th>what it does</th></tr></thead>
18
+ <tbody>
19
+ <tr><td><code>rig</code></td><td>Open the Rig session for the discovered workspace. The day-to-day entry point.</td></tr>
20
+ <tr><td><code>rig --workspace &lt;path&gt;</code></td><td>Open the same session against an explicit workspace root instead of the current dir.</td></tr>
21
+ <tr><td><code>rig attach &lt;run-id&gt; [--web]</code></td><td>Attach a terminal or browser to one exact live detached drone. Rig resolves its private credential internally.</td></tr>
22
+ <tr><td><code>/fleet</code></td><td>Inside the session, materialize the current fleet as inline CNet cards.</td></tr>
23
+ <tr><td><code>/tasks</code></td><td>Inside the session, materialize configured tasks with their create, rename, and close actions inline.</td></tr>
24
+ <tr><td><code>/drone [ref]</code></td><td>Inside the session, materialize one exact run and its controls inline. With no ref, it targets the newest projected run.</td></tr>
25
+ <tr><td><code>rig doctor</code></td><td>Diagnose sandbox backend and collaboration seams from the terminal.</td></tr>
26
+ <tr><td><code>rig --version</code></td><td>Print the installed Rig CLI version.</td></tr>
27
+ </tbody></table>
28
+ <div class="note"><b>Attach boundary:</b> the relay carries the detached run session, but raw room credentials are transport data, not public UX. Operators select a run id; foreground Rig and the Swarm Commander role are not attach targets.</div>
29
+
30
+ <h2 id="session-surfaces">Session surfaces <span class="ns">// one transcript, inline CNet cards</span></h2>
31
+ <p>The Rig session is one chat-first surface. CNet maintains a bounded current projection, human-needed work appears as inline attention items, and the Swarm Commander model role can query or act through generated discoverable tools. Query aliases and exact receipts append to this same transcript.</p>
32
+ <table class="t"><thead><tr><th>surface</th><th>command</th><th>what it shows</th></tr></thead>
33
+ <tbody>
34
+ <tr><td>CNet</td><td>automatic</td><td>One current fleet aggregate plus active or attention-requiring run items, with explicit query snapshots and receipts in OMP history.</td></tr>
35
+ <tr><td>attention</td><td>inline items</td><td>Runs, approvals, or questions that currently need operator input, each with actions from its owning plugin.</td></tr>
36
+ <tr><td>Swarm Commander</td><td>chat</td><td>Ask for state or an operation; the role receives bounded current context and discovers generated query/action tools.</td></tr>
37
+ <tr><td>fleet</td><td><code>/fleet</code></td><td>One aggregate fleet card with counts, bounded rows, and a fleet-owned dispatch action.</td></tr>
38
+ <tr><td>tasks</td><td><code>/tasks</code></td><td>One bounded task summary with task-owned create, rename, and close actions; exact dispatch is the <code>/fleet</code> action or <code>rig run dispatch &lt;taskId&gt;</code>.</td></tr>
39
+ <tr><td>drone</td><td><code>/drone [ref]</code></td><td>One run&rsquo;s status, placement, progress, recent timeline, controls, and exact-run attach actions inline.</td></tr>
40
+ <tr><td>doctor</td><td><code>rig doctor</code></td><td>Terminal diagnostics for sandbox backend and collaboration setup.</td></tr>
41
+ </tbody></table>
42
+
43
+ <h2 id="headless-cli">Headless CLI <span class="ns">// scripts, CI, and agents</span></h2>
44
+ <p>The exact CLI command families are a first-class headless adapter over the same CNet and domain operations the session surfaces interactively &mdash; reach for them from scripts, CI, release checks, and agents, and add <code>--json</code> for structured output.</p>
45
+ <table class="t"><thead><tr><th>command</th><th>surface</th><th>what it does</th></tr></thead>
46
+ <tbody>
47
+ <tr><td><code>rig task</code></td><td>headless</td><td>Read the configured task source non-interactively &mdash; the same task facts <code>/tasks</code> renders in the session.</td></tr>
48
+ <tr><td><code>rig run start</code> / <code>start-serial</code> / <code>start-parallel</code></td><td>headless</td><td>Batch run starters for scripted dispatch; the interactive path is the <code>/fleet</code> action or <code>rig run dispatch &lt;taskId&gt;</code>.</td></tr>
49
+ <tr><td><code>rig inbox</code> / <code>rig stats</code> / <code>rig inspect</code></td><td>headless</td><td>Inspect run and fleet state non-interactively; the same state lands as inline CNet items and <code>/drone</code> in the session.</td></tr>
50
+ <tr><td><code>rig doctor</code></td><td>diagnostic</td><td>Terminal setup diagnostics for sandbox backend and collaboration seams.</td></tr>
51
+ <tr><td><code>rig server task-run</code> / <code>rig server notify-test</code></td><td>headless</td><td>Server-owned task execution and event-notification checks for automation and CI.</td></tr>
52
+ <tr><td><code>rig plugin</code></td><td>headless</td><td>Plugin introspection over the composed plugin graph.</td></tr>
53
+ </tbody></table>
54
+
55
+ <h2 id="configuration">Configuration <span class="ns">// what the session reads</span></h2>
56
+ <p>The declarative <a href="../config/index.html"><code>.rig/rigfig.toml</code></a> (or the power-path <code>.rig/rig.config.ts</code>) declares project identity, loaded plugins/packages, the task source, workspace checkout + sandbox, runtime defaults, review policy, merge policy, and GitHub sync. It does <b>not</b> store OMP collab keys, relay credentials, or live session state.</p>
57
+ <pre class="code"><span class="p">$</span> rig --workspace .
58
+ <span class="p">$</span> rig attach 8a31e7
59
+ <span class="p">$</span> rig attach 8a31e7 --web
60
+ <span class="p">$</span> rig doctor
61
+ <span class="p">$</span> rig --version</pre>
62
+
63
+ <h2 id="advanced-groups">More CLI groups <span class="ns">// the full headless surface</span></h2>
64
+ <p><b>Interactive UX:</b> <code>rig</code>, <code>rig --workspace &lt;path&gt;</code>, <code>rig attach &lt;run-id&gt; [--web]</code>, <code>/fleet</code>, <code>/tasks</code>, <code>/drone</code>, <code>rig doctor</code>, and <code>rig --version</code>. Every group below is a first-class headless entry point to the same operations. Run <code>rig help --advanced</code> for the live listing and <code>rig &lt;group&gt; --help</code> for per-group help.</p>
65
+ <table class="t"><thead><tr><th>group</th><th>summary</th></tr></thead>
66
+ <tbody>
67
+ <tr><td><code>rig pi &lt;list|add|remove|search&gt;</code></td><td>Manage Pi extension packages for this project (community extensions from npm/git).</td></tr>
68
+ <tr><td><code>rig profile</code></td><td>Runtime profile/model defaults.</td></tr>
69
+ <tr><td><code>rig agent</code></td><td>Runtime agent workspace helpers.</td></tr>
70
+ <tr><td><code>rig setup</code></td><td>Setup bootstrap/check helpers for automation and CI.</td></tr>
71
+ <tr><td><code>rig test &lt;unit|e2e|all&gt;</code></td><td>Project test wrappers.</td></tr>
72
+ <tr><td><code>rig review &lt;show|set&gt;</code></td><td>Inspect or change the completion review gate policy.</td></tr>
73
+ </tbody></table>
74
+ <p>More top-level groups round out the headless surface: <code>pipeline</code>, <code>graph</code>, <code>status</code>, <code>summary</code>, <code>blockers</code>, <code>doctor</code>, <code>plan</code>, <code>repo</code>, <code>github</code>, <code>triage</code>, <code>init</code>, <code>config</code>, <code>plugin</code>, <code>server</code>, <code>run</code>, <code>inbox</code>, <code>stats</code>, <code>inspect</code>, <code>task</code>, and <code>drift</code>. Each runs the same domain operations non-interactively; add <code>--json</code> for structured output and <code>--dry-run</code> for a plan where supported. Interactively, the same work flows through the Rig session, <code>/fleet</code>, <code>/tasks</code>, <code>/drone</code>, and <code>rig doctor</code>.</p>
75
+
76
+ <h2 id="boot-banner">The launcher</h2>
77
+ <p>On an interactive TTY, <code>rig</code> resolves the workspace, starts foreground OMP, loads the bundled Rig extension, and drops you into the CNet chat with the first fleet projection warming. Detached drone sessions start only when work is dispatched.</p>
78
+
79
+ <h2 id="see-also">See also</h2>
80
+ <ul>
81
+ <li><b><a href="../docs/getting-started/index.html">Getting started</a></b> &mdash; install Rig, open the Rig session, and dispatch your first run.</li>
82
+ <li><b><a href="../docs/operator/index.html">Operator guide</a></b> &mdash; driving CNet, attention items, the Swarm Commander role, inline queries, and exact-run attach.</li>
83
+ <li><b><a href="../config/index.html">config</a></b> &mdash; project identity, task source, package list, runtime, gate, and merge policy.</li>
84
+ <li><b><a href="../docs/environment/index.html">Environment variables</a></b> &mdash; runtime-only knobs outside config.</li>
85
+ </ul>
86
+
87
+ <div class="nextnav"><a href="../docs/validators/index.html"><span class="dir">&larr; Back</span><span class="ttl">Validators & hooks</span></a><a href="../config/index.html"><span class="dir">Next &rarr;</span><span class="ttl">rig.config.ts</span></a></div>
88
+ </main></div><footer><div class="wrap"><div class="foot"><div class="col"><h5>orchestrate</h5><a href="../docs/getting-started/index.html">getting started</a><a href="../docs/runs/index.html">the run lifecycle</a><a href="../docs/operator/index.html">operator guide</a><a href="../docs/gate/index.html">the merge gate</a></div><div class="col"><h5>extend</h5><a href="../plugins/index.html">plugin authoring</a><a href="../skills/index.html">skills guide</a><a href="../docs/pi-extensions/index.html">OMP/Pi extensions</a><a href="../docs/packages/index.html">packages</a></div><div class="col"><h5>live</h5><a href="../index.html">the home rig</a><a href="../cli/index.html">cli reference</a><a href="https://where.rig-does.work/install">install script</a></div><div class="sig">Rig is the OMP session extension.<br><span class="blk">You are the operator.</span><br>release: rig --version</div></div></div></footer><script>document.querySelectorAll('[data-tab]').forEach(function(t){t.onclick=function(){document.querySelectorAll('[data-tab]').forEach(function(x){x.classList.remove('on')});document.querySelectorAll('[data-cmd]').forEach(function(x){x.style.display='none'});t.classList.add('on');var c=document.querySelector('[data-cmd="'+t.dataset.tab+'"]');if(c)c.style.display='flex';};});document.querySelectorAll('.cp').forEach(function(b){b.onclick=function(){var code=b.parentElement.querySelector('code');if(navigator.clipboard)navigator.clipboard.writeText(code.innerText);var o=b.innerText;b.innerText='copied';setTimeout(function(){b.innerText=o;},1200);};});</script><script src="../assets/rig.js"></script><script src="../assets/site.js?v=v9"></script></body></html>