geneseed 4.25.1 → 4.27.0
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/CHANGELOG.md +43 -0
- package/DESIGN.md +6 -5
- package/README.md +10 -6
- package/SHIPPED.md +4 -3
- package/adapters/bob/README.md +26 -4
- package/adapters/claude-code/README.md +6 -2
- package/adapters/claude-code/skills/geneseed/SKILL.md +2 -2
- package/adapters/opencode/HOW-OPENCODE-LOADS.md +4 -2
- package/adapters/opencode/README.md +5 -2
- package/adapters/opencode/plugins/geneseed-activity.js +331 -31
- package/adapters/opencode/plugins/geneseed-guard.js +79 -4
- package/bin/geneseed-hook.mjs +13 -7
- package/docs/concepts/enforcement-table.md +12 -0
- package/docs/concepts/exclusions.md +15 -1
- package/docs/concepts/hook-gates.md +3 -2
- package/docs/concepts/hooks.md +12 -1
- package/docs/concepts/host-matrix.md +2 -2
- package/docs/concepts/ownership.md +79 -0
- package/docs/concepts/rules.md +1 -1
- package/docs/guides/set-up-ownership.md +77 -0
- package/docs/reference/glossary.md +1 -1
- package/docs/reference/opencode-plugins.md +1 -1
- package/docs/reference/plugin-activity.md +4 -2
- package/docs/reference/plugin-guard.md +1 -0
- package/docs/reference/troubleshoot-doctor.md +2 -2
- package/docs/understand/enforced-vs-asked.md +3 -2
- package/docs/understand/machine-bob.md +1 -1
- package/docs/understand/machine-claude.md +1 -1
- package/docs/understand/machine-opencode.md +2 -2
- package/docs/web-ui.md +21 -2
- package/harness.config.json +1 -1
- package/js/README.md +1 -0
- package/js/build/render.mjs +1 -1
- package/js/build/source.mjs +5 -1
- package/js/cli-table.json +46 -1
- package/js/hosts/activity.mjs +175 -30
- package/js/hosts/hooks-prims.mjs +2 -2
- package/js/hosts/hooks.mjs +45 -5
- package/js/hosts/ownership-gate.mjs +105 -0
- package/js/hosts/settings.mjs +14 -4
- package/js/inspect/cost.mjs +1 -1
- package/js/inspect/inventory.mjs +1 -1
- package/js/inspect/status.mjs +1 -1
- package/js/loop/registry.mjs +17 -0
- package/js/web/activity.mjs +116 -5
- package/package.json +1 -1
- package/registry.json +7 -0
- package/src/AGENT.md.tmpl +5 -0
- package/src/agents/developer.md +7 -1
- package/src/modes/foreman.md +4 -1
- package/src/ontology/universal.md +19 -0
- package/src/skills/_checkpoints.md +15 -0
- package/src/skills/develop.md +4 -0
- package/src/skills/document-project.md +2 -1
- package/src/skills/learn-mode.md +13 -17
- package/src/skills/ownership.md +139 -0
- package/src/skills/pipeline.md +1 -1
- package/themes/README.md +2 -2
- package/themes/_TEMPLATE.json +1 -0
- package/themes/biker.json +1 -0
- package/themes/commentator.json +1 -0
- package/themes/cyberpunk.json +1 -0
- package/themes/gamer.json +1 -0
- package/themes/imperial.json +1 -0
- package/themes/joker.json +1 -0
- package/themes/marvin.json +1 -0
- package/themes/mean.json +1 -0
- package/themes/military.json +1 -0
- package/themes/neutral.json +1 -0
- package/themes/pirate.json +1 -0
- package/themes/sports.json +1 -0
- package/themes/verstappen.json +1 -0
- package/themes/wizard.json +1 -0
- package/web/dist/assets/Activity-DfETiyWm.js +1 -0
- package/web/dist/assets/ActivityDetail-CnP3GPAN.js +1 -0
- package/web/dist/assets/Bonsai-CN4rRAHc.js +1 -0
- package/web/dist/assets/{CopyButton-B6myFV7a.js → CopyButton-CRAUXSG7.js} +1 -1
- package/web/dist/assets/{Dashboard-DEQCBcUW.js → Dashboard-CaqOqtkG.js} +2 -2
- package/web/dist/assets/Docs-BFxyAVdN.js +5 -0
- package/web/dist/assets/{GreenhouseView-CV1squu6.js → GreenhouseView-19roNb5W.js} +1 -1
- package/web/dist/assets/{Installs-C4TQVZ_-.js → Installs-BSoQN7w7.js} +3 -3
- package/web/dist/assets/{JournalView-CpXsT_JD.js → JournalView-BgU2ybaq.js} +1 -1
- package/web/dist/assets/{KitApply-fYh_YjQA.js → KitApply-Ckc0P5kt.js} +1 -1
- package/web/dist/assets/{Kits-BMuGOiTg.js → Kits-BZqWGWMu.js} +1 -1
- package/web/dist/assets/Laws-CnUWiNIx.js +3 -0
- package/web/dist/assets/{Library-DiZqRFL5.js → Library-rYO8owx_.js} +2 -2
- package/web/dist/assets/{Loops-DkwWkdPc.js → Loops-CljFhhQV.js} +2 -2
- package/web/dist/assets/{OperatorHudView-CLmq0lNh.js → OperatorHudView-xs7SCwCe.js} +1 -1
- package/web/dist/assets/{Personal-C70XacpA.js → Personal-CMPwtl36.js} +2 -2
- package/web/dist/assets/{Tabs-ChFhPGP6.js → Tabs-CEfSUVQp.js} +1 -1
- package/web/dist/assets/{index-DxCqnFPy.js → index-FLVXXvV3.js} +2 -2
- package/web/dist/assets/{index-Cqqs-PbJ.css → index-XTGBLKQr.css} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/Activity-BdMwEnFN.js +0 -1
- package/web/dist/assets/ActivityDetail-BgUjDuxO.js +0 -1
- package/web/dist/assets/Docs-ChBYcQbT.js +0 -5
- package/web/dist/assets/Laws-ndHW7Onu.js +0 -3
package/web/dist/index.html
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
<!-- The brand sprout as an inline SVG favicon (no extra asset to serve). -->
|
|
12
12
|
<link rel="icon" type="image/svg+xml"
|
|
13
13
|
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.5v-9' stroke='%233AD4C4' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3Cpath d='M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z' fill='%233AD4C4'/%3E%3Cpath d='M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z' fill='%233AD4C4' opacity='.42'/%3E%3C/svg%3E" />
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-FLVXXvV3.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/react-DlYQp10C.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/api-BfpZmUMI.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/motion-CXaUMNkg.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/sections-ChwaobfW.js">
|
|
20
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
20
|
+
<link rel="stylesheet" crossorigin href="/assets/index-XTGBLKQr.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
23
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{a as i}from"./motion-CXaUMNkg.js";import{A as a,C as o,E as s,F as c,J as l,M as u,N as d,O as ee,T as f,U as te,at as p,ft as m,j as h,k as g,q as ne,u as _,ut as v,w as y}from"./index-DxCqnFPy.js";import{t as b}from"./EmptyState-1sPNleqv.js";import{t as re}from"./usePoll-bDFN-Hr6.js";var x=e(t(),1),S=n(),C=e=>e.catch(()=>null);function w({s:e}){let t=(0,x.useId)(),n=e.todos,r=g(e);return(0,S.jsxs)(`a`,{className:`card pad-md act-card`,href:`#/activity/${encodeURIComponent(e.session_id)}`,"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,S.jsx)(o,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:(0,S.jsx)(p,{name:`chevron`,className:`glyph act-chev`})}),n&&n.total>0&&(0,S.jsx)(`div`,{className:`act-foot`,children:(0,S.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,S.jsx)(f,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,S.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,v(e.updated_at),` ago`]})]})}var T={blocked:`is blocked`,"waiting-input":`waits for your answer`};function E(e,t){if(!Array.isArray(t))return``;let n=t.filter(a),r=e.current;return e.current=new Set(n.map(e=>`${e.session_id}:${e.status}`)),r?n.filter(e=>!r.has(`${e.session_id}:${e.status}`)).map(e=>`${e.title||s(e.cwd)||e.session_id} ${T[e.status]}`).join(`. `):``}var D=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function O(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:D.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``}}function k(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),e.host&&t.set(`host`,e.host),e.project&&t.set(`project`,e.project);let n=t.toString();window.history.replaceState(null,``,`#/activity${n?`?${n}`:``}`)}function A({enabled:e,onToggle:t}){return(0,S.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,S.jsx)(p,{name:`activity`,className:`glyph act-fixed`}),(0,S.jsxs)(`div`,{className:`act-grow`,children:[(0,S.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,S.jsx)(`p`,{className:`dim act-sm act-track-p`,children:`Runs and gate asks below come from the job log and the gate ledger. Turn tracking on to see what each session is doing now.`})]}),(0,S.jsxs)(`div`,{className:`row gap-10 act-fixed act-sm`,children:[(0,S.jsx)(`span`,{id:`act-track-l`,children:`Track live sessions`}),(0,S.jsx)(`div`,{className:`sw-toggle${e?` on`:``}`,role:`switch`,"aria-checked":e,"aria-labelledby":`act-track-l`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),t())}})]})]})}function j({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=h(e?.jobs,{days:14,cap:n}),i=d(r.map(e=>e.nodata?`-`:e.n).join(`,`),`scaleY`),a=Math.max(1,...r.map(e=>e.n)),o=r.reduce((e,t)=>e+t.n,0),s=r.find(e=>!e.nodata),c=r.some(e=>e.nodata),l=`Runs per day: ${r.filter(e=>e.n).map(e=>`${e.n} on ${u(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${u(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,S.jsxs)(`div`,{className:`act-stat-head`,children:[(0,S.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,S.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,S.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,S.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,S.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${u(e.key)}: ${e.n}`},e.key):(0,S.jsx)(`i`,{className:`zero`},e.key))}),(0,S.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,S.jsx)(`span`,{children:u(r[0].key)}),(0,S.jsx)(`span`,{children:u(r[7].key)}),(0,S.jsx)(`span`,{children:`today`})]}),c&&(0,S.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,S.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function M({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,S.jsxs)(`div`,{className:`act-stat-head`,children:[(0,S.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,S.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,S.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,S.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,S.jsxs)(`li`,{children:[(0,S.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,S.jsx)(y,{vals:e.per_day,i:t,sweep:!0}),(0,S.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,S.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var N={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function ie({job:e,longest:t}){let n=c(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=N[e.status]||[``,e.status||`…`],o=e.status===`running`?`Still running`:r?`Took ${r} second${r===1?``:`s`}`:`No duration`,s=e.started?new Date(e.started*1e3).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`}):`—`;return(0,S.jsxs)(`li`,{className:`act-row`,children:[(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,S.jsx)(p,{name:`play`,className:`glyph act-glyph`}),(0,S.jsxs)(`span`,{className:`act-what`,children:[(0,S.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,S.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,S.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,S.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,S.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function ae({gate:e}){return(0,S.jsxs)(`li`,{className:`act-row gate`,children:[(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,S.jsx)(p,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,S.jsxs)(`span`,{className:`act-what`,children:[(0,S.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,S.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,S.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,S.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var P=5,F=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function I(){let[e,t]=(0,x.useState)(null),[n,o]=(0,x.useState)(``),[c,u]=(0,x.useState)(O),[f,p]=(0,x.useState)(!1),[h,g]=(0,x.useState)(``),v=(0,x.useRef)(null),y=e=>{let t={...c,...e};u(t),k(t)};re(e=>r.activity().then(n=>{if(e()){t(n),o(``);let e=E(v,n?.activity);e&&g(t=>t===e?e+`\xA0`:e)}},t=>{e()&&o(t.message)}),2e3,[]);let T=m(()=>C(r.jobs()),[]),N=m(()=>C(r.gates()),[]),I=m(()=>C(r.catalog(`laws`)),[]),L=!e||e.enabled!==!1,R=[...e?.activity||[]].sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),z=i(),B=L&&e?R.filter(a).length:null,V=new Set(R.map(e=>e.session_id)),H=(e?.ended||[]).filter(e=>!V.has(e.session_id)),U=F([...R,...H].map(e=>e.host),c.host),W=F([...R,...H].map(e=>s(e.cwd)),c.project),G=c.host&&c.project?`host or project`:c.host?`host`:c.project?`project`:``,K=e=>(!c.host||e.host===c.host)&&(!c.project||s(e.cwd)===c.project),q=R.filter(e=>K(e)&&(c.f!==`needs`||a(e))),oe=c.f===`all`||c.f===`needs`,J=c.f===`all`&&L?H.filter(K):[],se=f?J:J.slice(0,P),ce=!G&&(c.f===`all`||c.f===`runs`),le=!G&&(c.f===`all`||c.f===`gates`),Y=T.data?.jobs||[],X=_(N.data,I.data),Z=ee(Y,X,N.data?.days).map(e=>({...e,runs:ce?e.runs:[],gate:le?e.gate:null})).filter(e=>e.runs.length||e.gate),ue=Math.max(0,...Y.map(e=>e.duration||0)),Q=d(Z.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),de=async()=>{let e=!L;try{let n=await r.activityToggle(e);if(n.ok===!1){o(n.error||`Could not change tracking`);return}t(e=>({...e||{},enabled:n.enabled,activity:n.enabled&&e?.activity||[],ended:n.enabled&&e?.ended||[]})),o(``)}catch(e){o(e.message)}},$=(e,t,n)=>(0,S.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,S.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,S.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:c[e],disabled:n.length===0,title:n.length===0?`No source carries a ${e} yet`:void 0,onChange:t=>y({[e]:t.target.value}),children:[(0,S.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,S.jsx)(`option`,{value:e,children:e},e))]})]});return(0,S.jsxs)(`div`,{className:`page-fill`,children:[(0,S.jsx)(te,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,S.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:h}),n&&(0,S.jsx)(`div`,{className:`act-gap`,children:(0,S.jsx)(ne,{error:n})}),e&&(0,S.jsx)(A,{enabled:L,onToggle:de}),(0,S.jsxs)(`div`,{className:`act-today`,children:[(0,S.jsx)(j,{jobs:T.data,loading:T.loading}),(0,S.jsx)(M,{rows:X,gates:N.data,loading:N.loading}),(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,S.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,S.jsxs)(`span`,{className:`act-big act-wait`,children:[B??`—`,` `,(0,S.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,S.jsx)(`p`,{className:`dim act-sm`,children:L?`A session that waits on an approval or on your answer counts here.`:`Turn tracking on to count the sessions that wait on you.`})]})]}),(0,S.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,S.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:D.map(([e,t])=>(0,S.jsxs)(`button`,{type:`button`,className:c.f===e?`chip-f on`:`chip-f`,"aria-pressed":c.f===e,onClick:()=>y({f:e}),children:[t,e===`needs`&&B>0?(0,S.jsxs)(`span`,{className:`mono`,children:[` `,B]}):null]},e))}),$(`host`,`Host`,U),$(`project`,`Project`,W)]}),G&&c.f!==`needs`&&(0,S.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,G,`; showing sessions only.`]}),oe&&(e?!L&&c.f!==`needs`?null:q.length===0?c.f===`needs`?(0,S.jsx)(b,{title:`Nothing waits on you`}):(0,S.jsxs)(b,{title:`No active sessions`,children:[`Run `,(0,S.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):(0,S.jsx)(`div`,{className:`stack gap-12 act-live`,ref:z,children:q.map(e=>(0,S.jsx)(`div`,{"data-flip":e.session_id,children:(0,S.jsx)(w,{s:e})},e.session_id))}):(0,S.jsx)(l,{label:`Reading live sessions…`})),J.length>0&&(0,S.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,S.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),se.map(e=>(0,S.jsx)(`div`,{children:(0,S.jsx)(w,{s:e})},e.session_id)),J.length>P&&(0,S.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":f,onClick:()=>p(e=>!e),children:f?`Show fewer`:`Show all ${J.length}`})]}),c.f!==`needs`&&(0,S.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:Q,children:Z.map(e=>(0,S.jsxs)(`section`,{className:`card act-day`,children:[(0,S.jsxs)(`h3`,{className:`act-day-h`,children:[(0,S.jsx)(`span`,{children:e.title}),(0,S.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,S.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,S.jsx)(ie,{job:e,longest:ue},e.id)),e.gate&&(0,S.jsx)(ae,{gate:e.gate})]})]},e.key))})]})}export{I as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{C as i,D as a,E as o,J as s,U as c,at as l,q as u,ut as d}from"./index-DxCqnFPy.js";import{t as f}from"./EmptyState-1sPNleqv.js";import{t as p}from"./usePoll-bDFN-Hr6.js";var m=e(t(),1),h=n();function g(e){return e.kind===`tool`?e.status===`error`?`bad`:e.status===`completed`?`ok`:`acc`:{retry:`warn`,error:`bad`,subtask:`acc`,text:`acc`}[e.kind]||``}function _({rec:e}){let t=e.who===`you`,n=[];t||(e.kind===`tool`&&e.ms!=null&&n.push(`${(e.ms/1e3).toFixed(1)}s`),e.kind===`step`&&(e.tokens&&n.push(`${a(e.tokens)} tok`),e.cost&&n.push(`$${e.cost.toFixed(2)}`)),e.kind===`subtask`&&e.agent&&n.unshift(e.agent));let r=!t&&(e.kind===`text`||e.kind===`thinking`||e.kind===`step`),i=t?e.text:e.label||e.snippet||e.kind;return(0,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,h.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,h.jsx)(`span`,{className:`feed-dot act-inline-dot ${g(e)||`acc`}`}),e.kind===`thinking`&&(0,h.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,h.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,h.jsx)(`b`,{children:i}),e.error&&(0,h.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,h.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,h.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${d(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function v({turns:e}){return!e||e.length===0?(0,h.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,h.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,h.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}function y({sid:e}){let[t,n]=(0,m.useState)(null),[a,g]=(0,m.useState)(``),[y,b]=(0,m.useState)(!1),[x,S]=(0,m.useState)(!1),C=(0,m.useId)();p(t=>y?void 0:r.activityDetail(e).then(e=>{t()&&(n(e),g(``),b(!1))},e=>{t()&&(e.status===404?b(!0):g(e.message))}),2e3,[e,y]);let w=(0,h.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,h.jsx)(l,{name:`arrow`}),` Activity`]});if(y)return(0,h.jsxs)(`div`,{className:`page-fill`,children:[w,(0,h.jsx)(f,{title:`Session ended`,action:(0,h.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!t)return(0,h.jsxs)(`div`,{className:`page-fill`,children:[w,a?(0,h.jsx)(u,{error:a}):(0,h.jsx)(s,{label:`Loading session…`})]});let T=t.session,E=T.files,D=T.todos,O=!!(E&&E.items&&E.items.length>0),k=!!(D&&D.items&&D.items.length>0),A=t.conversation||[],j=t.timeline||[],M=[...A.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...j.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,h.jsxs)(`div`,{className:`page-fill`,children:[w,(0,h.jsx)(c,{title:T.title||o(T.cwd)||T.session_id,sub:T.cwd?(0,h.jsx)(`span`,{className:`mono act-cwd`,title:T.cwd,children:T.cwd}):null}),a&&(0,h.jsx)(`div`,{className:`act-gap`,children:(0,h.jsx)(u,{error:a})}),(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(i,{s:T}),(0,h.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,d(T.updated_at),` ago`]})]}),(O||k)&&(0,h.jsxs)(`div`,{className:`grid gap-12 act-panels${O&&k?` two`:``}`,children:[O&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Files touched `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,E.count,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:E.items.map(e=>(0,h.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,h.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,h.jsxs)(`span`,{className:`act-fixed`,children:[(0,h.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,h.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),k&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Plan`,` `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,D.done,`/`,D.total,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:D.items.map((e,t)=>(0,h.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,h.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,h.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,h.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,h.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,h.jsx)(`h2`,{children:`Timeline`}),j.length>0&&(0,h.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":x,"aria-controls":C,onClick:()=>S(e=>!e),children:x?`Show conversation`:`Show full stream (${M.length})`})]}),(0,h.jsx)(`div`,{id:C,children:x?(0,h.jsx)(`div`,{className:`stack gap-12`,children:M.map((e,t)=>(0,h.jsx)(_,{rec:e},t))}):(0,h.jsx)(v,{turns:A})})]})]})}export{y as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,r as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-BfpZmUMI.js";import{n as a}from"./motion-CXaUMNkg.js";import{$ as o,J as s,Q as c,U as l,X as u,a as d,at as f,c as p,et as m,ft as h,i as ee,n as g,o as _,q as v,r as te,s as ne,yt as y}from"./index-DxCqnFPy.js";import{t as b}from"./EmptyState-1sPNleqv.js";import{a as re,n as x,o as S,r as C,t as ie}from"./RailCats-BuJD4Jou.js";import{t as w}from"./CopyButton-B6myFV7a.js";import{i as T,n as E,r as D}from"./Markdown-DpmmtW2Y.js";var O=e(t(),1),k=n();function A(e,t=0){let n=String(e).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&/^[a-z]/.test(n)?n:`h-${t}-${n||`section`}`}function j(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
|
|
2
|
-
`))r===`before`&&/^\|\s*piece\s*\|/i.test(i)?r=`map`:r===`map`&&!i.trimStart().startsWith(`|`)&&(r=`after`),r===`before`?t.push(i):r===`after`&&n.push(i);return[t.join(`
|
|
3
|
-
`),n.join(`
|
|
4
|
-
`)]}function M(e,t){let n=document.createElement(`template`);return n.innerHTML=e,n.content.querySelectorAll(`h1, h2, h3`).forEach(e=>{e.tagName!==`H1`&&(t.idx+=1);let n=e.id||A(e.textContent||``,t.idx),r=n;for(let e=2;t.ids.has(r);e++)r=`${n}-${e}`;t.ids.add(r),e.id=r,e.tagName!==`H1`&&t.toc.push({level:Number(e.tagName[1]),title:(e.textContent||``).trim(),id:r})}),n.content.querySelectorAll(`table`).forEach(e=>{let t=document.createElement(`div`);t.className=`table-scroll`,t.setAttribute(`tabindex`,`0`),t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Table`),e.replaceWith(t),t.appendChild(e)}),n.innerHTML}function N(e){let t={ids:new Set,idx:0,toc:[]},n=n=>M(E(n,e?.links),t);if(e?.rows){let[r,i]=j(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var P=r(),F={"opencode-global":[`install-opencode`,`Global (recommended)`],opencode:[`install-opencode`,`Per repo`],"claude-global":[`install-claude-code`],claude:[`install-claude-code`],"openclaude-global":[`install-openclaude`],openclaude:[`install-openclaude`],"bob-global":[`install-bob`],bob:[`install-bob`],files:[`install-agent-md`]},I=`you already know this`,L=e=>Math.max(1,Math.ceil((e||``).split(/\s+/).filter(Boolean).length/200));function R(e){return e.querySelectorAll(`pre`).forEach(e=>{if(e.parentElement?.classList.contains(`docs-code`))return;let t=document.createElement(`figure`);t.className=`docs-code`;let n=document.createElement(`figcaption`),r=e.querySelector(`code`)?.className.match(/(?:^|\s)language-(\S+)/)?.[1];if(r){let e=document.createElement(`span`);e.className=`mono`,e.textContent=r,n.append(e)}e.replaceWith(t),t.append(n,e)}),[...e.querySelectorAll(`figure.docs-code > figcaption`)]}var z=e=>(e.parentElement?.querySelector(`pre`)?.textContent||``).replace(/\n+$/,``),B=40,V=e=>{let t=e.split(`
|
|
5
|
-
`)[0].trim();return t?`Copy `+(t.length>B?t.slice(0,39)+`…`:t):`Copy code`};function H({page:e,overview:t,onAction:n,section:r,description:i}){let a=(0,O.useRef)(null),[o,s]=(0,O.useState)([]),c=(0,O.useMemo)(()=>N({body:e.body,links:e.links}).html,[e.body,e.links]);(0,O.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(I)&&e.classList.add(`analogy`)}),s(R(e)))},[c]),(0,O.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&n.startsWith(`#/`)&&(e.preventDefault(),y(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[c]),(0,O.useEffect)(()=>{let n=a.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[r,i]=F[t?.emit]||[];if(!r)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${r}"]`)?.closest(`li`):e.id===r&&i&&(o=[...n.querySelectorAll(`h2`)].find(e=>A(e.textContent||``)===A(i))),o?.classList.add(`docs-here`)},[c,e.id,t?.emit]);let u=[];return e.id===`install`&&(u.push({label:`Run doctor`,action:`doctor`}),u.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&u.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&u.push({label:`Update`,action:`update`}),(0,P.jsxs)(`div`,{className:`detail-doc`,children:[(0,P.jsx)(l,{eyebrow:r&&`${r} · ${L(e.body)} min read`,title:e.title,sub:i,actions:u.length>0&&u.map(e=>e.hash?(0,P.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,P.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,P.jsx)(`div`,{className:`doc-meta`,children:(0,P.jsxs)(`span`,{className:`badge`,children:[(0,P.jsx)(`span`,{className:`dot`}),e.source]})}),(0,P.jsx)(`div`,{className:`markdown`,ref:a,dangerouslySetInnerHTML:{__html:c}}),o.map((e,t)=>{let n=z(e);return(0,k.createPortal)((0,P.jsx)(w,{text:n,label:V(n)}),e,t)}),e.link&&(0,P.jsx)(`div`,{className:`doc-link`,children:(0,P.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var U=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`);function W({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,P.jsxs)(`div`,{className:`cli-arg`,children:[(0,P.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,P.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,P.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function G({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,P.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,P.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,P.jsxs)(`div`,{className:`stack gap-4`,children:[(0,P.jsx)(`h2`,{id:U(e.name),children:(0,P.jsx)(`code`,{children:e.name})}),e.help&&(0,P.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,P.jsx)(w,{text:`${t} ${e.name}`,label:`Copy ${t} ${e.name}`,title:`Copy ${t} ${e.name}`})]}),(0,P.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,P.jsxs)(`div`,{className:`cli-block`,children:[(0,P.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,P.jsx)(W,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,P.jsxs)(`div`,{className:`cli-block`,children:[(0,P.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,P.jsx)(W,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function K({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,P.jsxs)(`div`,{className:`detail-doc`,children:[(0,P.jsx)(l,{title:e.title,sub:(0,P.jsxs)(P.Fragment,{children:[`Every subcommand of `,(0,P.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,P.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,P.jsx)(`div`,{children:n.map(e=>(0,P.jsx)(G,{cmd:e,prog:t},e.name))})]})}function q({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,P.jsxs)(`div`,{className:`detail-doc`,children:[(0,P.jsx)(l,{title:e.title,sub:(0,P.jsxs)(P.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,P.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,P.jsx)(`div`,{className:`card pad-md`,children:(0,P.jsxs)(`table`,{className:`glossary-table`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`Concept`}),(0,P.jsx)(`th`,{children:`Neutral term`}),(0,P.jsxs)(`th`,{children:[`In `,n]}),(0,P.jsx)(`th`,{children:`Meaning`}),(0,P.jsx)(`th`,{children:`In dev terms`})]})}),(0,P.jsx)(`tbody`,{children:t.map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:(0,P.jsx)(`strong`,{children:e.label})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`code`,{children:e.neutral||`—`})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,P.jsx)(`td`,{className:`dim`,children:e.desc}),(0,P.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var J={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},Y=({text:e})=>(0,P.jsx)(`span`,{dangerouslySetInnerHTML:{__html:D(T.parseInline(e||``))}}),X=({kind:e})=>(0,P.jsx)(`span`,{className:`tag ${J[e]||``}`,children:e});function ae({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,O.useState)(0),{before:s,after:c}=(0,O.useMemo)(()=>N(e),[e]);if(!e.rows)return(0,P.jsx)(H,{page:e,overview:t,onAction:n,section:r,description:i});let u=e.rows[a]||e.rows[0];return(0,P.jsxs)(`div`,{className:`detail-doc`,children:[(0,P.jsx)(l,{eyebrow:r&&`${r} · ${L(e.body)} min read`,title:e.title,sub:i}),(0,P.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:s}}),(0,P.jsxs)(`div`,{className:`docs-map`,children:[(0,P.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{className:`map-node ${t===a?`on`:``}`,"aria-pressed":t===a,onClick:()=>o(t),children:[(0,P.jsx)(`span`,{className:`map-piece`,children:(0,P.jsx)(Y,{text:e.piece})}),(0,P.jsx)(X,{kind:e.kind}),(0,P.jsx)(`span`,{className:`mono dim map-cost`,children:(0,P.jsx)(Y,{text:e.cost})})]})},t))}),u&&(0,P.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,P.jsx)(`h2`,{children:(0,P.jsx)(Y,{text:u.piece})}),(0,P.jsx)(X,{kind:u.kind}),(0,P.jsxs)(`dl`,{children:[(0,P.jsx)(`dt`,{children:`Does`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(Y,{text:u.does})}),(0,P.jsx)(`dt`,{children:`Costs`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(Y,{text:u.cost})}),(0,P.jsx)(`dt`,{children:`Turn it off`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(Y,{text:u.off})})]})]})]}),c.trim()&&(0,P.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:c}})]})}function oe(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function se(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var Z=e=>(0,O.useSyncExternalStore)(se,e,()=>null),ce=5,le=96,ue=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function de(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${ue(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===ce)break;return r}var fe=e=>{let t=document.getElementById(e);t&&(t.setAttribute(`tabindex`,`-1`),t.scrollIntoView({behavior:a()?`smooth`:`auto`}),t.focus({preventScroll:!0}))};function pe({page:e,glossaryRows:t}){let n=e?.body,r=(0,O.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:U(e.name),title:e.name,level:2})):N(e).toc,[e]),i=(0,O.useMemo)(()=>de(n,t),[n,t]),a=Z(()=>{let e=null;for(let t of r){let n=document.getElementById(t.id)?.getBoundingClientRect().top;n!=null&&n<=le&&(e=t.id)}return e});return!r.length&&!i.length?null:(0,P.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,P.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,P.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,P.jsx)(`ul`,{children:r.map(e=>(0,P.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,P.jsx)(`a`,{href:`#${e.id}`,"aria-current":a===e.id?`location`:void 0,onClick:t=>{t.preventDefault(),fe(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,P.jsxs)(`div`,{className:`docs-gloss`,children:[(0,P.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,P.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,P.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,P.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function me({page:e,overview:t}){let n=e.version||{},r=[...t?[[`Version`,t.version]]:[],[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,P.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,P.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,P.jsx)(`code`,{children:n.installed_fp||`(none)`},`i`)],[`Source build`,(0,P.jsx)(`code`,{children:n.source_fp||`—`},`s`)],[`Match?`,n.verdict?(0,P.jsx)(`span`,{dangerouslySetInnerHTML:{__html:D(T.parseInline(n.verdict))}},`m`):`—`],[`License`,e.license]];return(0,P.jsxs)(`div`,{className:`detail-doc`,children:[(0,P.jsx)(l,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,P.jsx)(`div`,{className:`card pad-md mb-18`,children:r.map(([e,t])=>(0,P.jsxs)(`div`,{className:`kv`,children:[(0,P.jsx)(`span`,{className:`k`,children:e}),(0,P.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,P.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,P.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,P.jsx)(f,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,P.jsx)(f,{name:`external`}),`File an issue`]}),(0,P.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,P.jsx)(f,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function he({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,P.jsx)(v,{error:t,style:{margin:18}});if(!e)return(0,P.jsx)(s,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,P.jsx)(H,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`map`:return(0,P.jsx)(ae,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`cli`:return(0,P.jsx)(K,{page:e});case`glossary`:return(0,P.jsx)(q,{page:e});case`about`:return(0,P.jsx)(me,{page:e,overview:n});default:return(0,P.jsx)(b,{title:`Unknown page kind`,children:e.kind})}}function ge(){let e=oe(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function _e(){let e=Z(ge);return(0,P.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,P.jsx)(`i`,{style:{width:`${e}%`}})})}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function ve({page:e,overview:t,onAction:n}){let[r,a]=m(o(t?.emit)),{data:l,error:f}=h(()=>i.docs(r),[r]),y=e||Q(l),{data:b,error:w,loading:T}=h(()=>y?i.docsPage(y,r):Promise.resolve(null),[y,r]),{data:E}=h(()=>i.docsPage(`glossary`,r).catch(()=>null),[r],`docs:glossary`);(0,O.useEffect)(()=>{if(l&&y&&!l.groups.some(e=>e.pages.some(e=>e.id===y))){let e=Q(l);e&&e!==y&&window.location.replace(d(e))}},[l,y]),(0,O.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[y]);let D=ne(l,y),k=D.part||l?.groups?.[0]||null,A=k?.id===te;(0,O.useEffect)(()=>{A&&b?.id===y&&_(y)},[A,b,y]);let j=A?[...p(),y]:[],[M,N]=(0,O.useState)(``),[F,I]=(0,O.useState)(`all`),[L,R]=(0,O.useState)(k?.id);k?.id!==L&&(R(k?.id),N(``),I(`all`));let z=$(k),B=x(z),V=F===`all`?z:z.filter(e=>e.group===F),H=S(V,M);return f?(0,P.jsx)(v,{error:f}):(0,P.jsx)(`div`,{className:`docs-wrap`,children:(0,P.jsxs)(`div`,{className:`library docs-lib`,children:[(0,P.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,P.jsxs)(`div`,{className:`lib-title`,children:[(0,P.jsx)(`p`,{className:`h`,children:`Docs`}),(0,P.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,P.jsx)(u,{"aria-label":`Harness`,children:c.map(e=>(0,P.jsx)(`button`,{className:r===e.id?`on`:``,onClick:()=>a(e.id),"aria-pressed":r===e.id,children:e.label},e.id))}),(0,P.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(l?.groups||[]).map(e=>(0,P.jsxs)(O.Fragment,{children:[(0,P.jsxs)(`a`,{href:e.pages[0]?d(e.pages[0].id):`#/docs`,className:k?.id===e.id?`on`:``,"aria-current":k?.id===e.id?`page`:void 0,children:[e.label,(0,P.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),k?.id===e.id&&(0,P.jsx)(ie,{label:`Sections`,total:z.length,cats:B,cat:F,onChange:I})]},e.id))})]}),(0,P.jsx)(re,{label:k?.label||`Docs`,count:M.trim()?`${H.length} of ${V.length}`:V.length||``,extra:A&&(0,P.jsx)(ee,{pages:k.pages,seen:j}),q:M,onQ:N,matched:H.length,inView:[k?.id,y],children:l?(0,P.jsx)(C,{rows:H,activeName:y,hrefOf:e=>d(e.name),pills:A?e=>j.includes(e.name)&&e.name!==y?(0,P.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,P.jsx)(s,{label:`Loading docs…`})}),(0,P.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":D.page?.title||`Page`,children:[(0,P.jsx)(_e,{}),D.page&&(0,P.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,P.jsx)(`a`,{href:d(D.part.pages[0].id),children:D.part.label}),(0,P.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,P.jsx)(`a`,{href:d(D.part.pages.find(e=>(e.section||`General`)===D.section).id),children:D.section}),(0,P.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,P.jsx)(`span`,{"aria-current":`page`,children:D.page.title})]}),(0,P.jsxs)(`div`,{className:`docs-read`,children:[(0,P.jsxs)(`div`,{className:`docs-article`,children:[(0,P.jsx)(he,{data:T?null:b,error:w,overview:t,onAction:n,place:D},`${y}|${r}`),!T&&(0,P.jsx)(g,{menu:l,pageId:y})]}),!T&&(0,P.jsx)(pe,{page:b,glossaryRows:E?.rows})]})]})]})})}export{ve as default,$ as docRows};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{G as i,J as a,L as o,U as s,V as c,W as l,X as u,Z as d,_ as f,d as p,f as m,ft as h,g,h as _,m as v,p as y,q as b,v as ee,y as te,yt as x}from"./index-DxCqnFPy.js";import{t as ne}from"./EmptyState-1sPNleqv.js";import{t as S}from"./FilterInput-CZREvrjX.js";import{t as C}from"./Markdown-DpmmtW2Y.js";var w=e(t(),1);function T({items:e,packs:t,install:n,canApply:r,onAction:a,gateArmed:o}){let s=d(),c=e.filter(e=>e.tier===`doctrine`&&e.active!==!1).map(e=>e.name),u=c.join(`,`),f=i(),p=n?`${n.host}:${n.scope}:${n.path}`:``,m=l(c),{prune:h}=f,g=e.length>0;(0,w.useEffect)(()=>{g&&h(`rules`,(e,t)=>e===p&&t.base!==m)},[g,p,m,h]);let _=f.get(`rules`,p),v=_&&_.base===m?_.value:c,y=e=>f.put(`rules`,p,e(v),m),b=e=>v.includes(e),ee=e=>y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),te=e=>e.rules.some(e=>b(e.addr)),x=e=>{let t=e.rules.map(e=>e.addr),n=e.rules.every(e=>b(e.addr));y(e=>n?e.filter(e=>!t.includes(e)):[...new Set([...e,...t])])},ne=e=>{let t=e.rules.filter(e=>b(e.addr)).length;return t?e.active?`${t} of ${e.rules.length} active`:`staged on · ${t} of ${e.rules.length}`:e.active?`staged off`:`not built in`},S=t.flatMap(e=>e.rules.map(e=>e.addr)),C=S.filter(b),T=C.join(`,`)!==u,E=`process.5`,D=c.includes(E)&&!v.includes(E);return{deployedRules:c,isOn:b,toggleRule:ee,packOn:te,togglePack:x,packState:ne,allRules:S,pickedRules:C,dirty:T,losingConsent:D,applyPacks:async()=>{if(!r||!T)return;let e=t.filter(e=>e.rules.some(e=>b(e.addr))).map(e=>e.pack),i=t.filter(t=>e.includes(t.pack)).flatMap(e=>e.rules.filter(e=>!b(e.addr)).map(e=>e.addr)),c=D?`
|
|
2
|
-
|
|
3
|
-
process 5 carries commit/push consent. Dropping it also removes the git-gate hook, so commits and pushes stop being confirmed at the tool boundary. `+(o?`(Real data loss stays gated: that is Rule IV’s, not the pack’s.)`:`(Rule IV’s deletion gate is off on this install, so real data loss is not asked about either.)`):``,l=C.length?`${C.length} of ${S.length} doctrine rules`:`no doctrine rules`;await s(`Rebuild ${n.host} · ${n.scope} with ${l}? It rebuilds in place, non-destructive.${c}`,{title:`Rebuild with these rules?`,confirmLabel:`Rebuild`})&&await a(`install`,{...n,doctrines:e,excludeRules:i})&&f.startApply(`rules`,p)},revert:()=>f.drop(`rules`,p)}}var E=n();function D({addr:e,isOpen:t,onToggle:n,className:i,style:a,head:o,label:s,rev:c,toggleCol:l=null,renderBody:u,srcLine:d}){let f=(0,w.useId)(),{data:p,error:m,reload:g}=h(()=>t?r.item(`law`,e):Promise.resolve(null),[t,e,c],`law-item`),_=t&&(0,E.jsxs)(`div`,{className:`law-expand`,id:f,children:[m?(0,E.jsx)(b,{error:m,onRetry:g}):p?u(p):(0,E.jsx)(`p`,{className:`dim`,children:`Loading…`}),(0,E.jsx)(`div`,{className:`law-srcline`,children:d})]}),v={type:`button`,onClick:n,"aria-expanded":t,"aria-controls":f,"aria-label":s};return l?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:i,style:a,"data-addr":e,children:[(0,E.jsx)(`button`,{className:`law-disclosure`,...v,children:o}),(0,E.jsx)(`span`,{className:`toggle-col`,children:l})]}),_]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{className:i,style:a,"data-addr":e,...v,children:o}),_]})}function re({law:e,isOpen:t,onToggle:n,rev:r,toggleCol:i=null}){let a=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`span`,{className:`law-no`,children:[(0,E.jsx)(`span`,{className:`x`,"aria-hidden":`true`,children:`›`}),e.no]}),(0,E.jsxs)(`span`,{className:`law-name`,children:[(0,E.jsx)(`span`,{children:e.name}),e.ess?(0,E.jsx)(`span`,{className:`law-princ`,children:e.ess}):null,e.asks?(0,E.jsx)(`span`,{className:`law-asks mono`,children:e.asks}):null]}),(0,E.jsx)(`span`,{className:`law-latin`,children:e.latin}),(0,E.jsx)(`span`,{className:`law-status ${e.statusTone}`,children:e.status}),(0,E.jsx)(`span`,{className:`law-enf${e.enf===`Hook gate`?` hook`:e.enf===`Gate off`?` gate-off`:``}`,children:e.enf})]});return(0,E.jsx)(D,{addr:e.addr,isOpen:t,onToggle:n,className:`law-row${i?` has-toggle`:``}${t?` on`:``}${e.off?` law-off`:``}`,style:{"--cc":e.c},head:a,label:`${e.no?e.no+` `:``}${e.name}, ${e.status}, ${e.enf}`,rev:r,toggleCol:i,renderBody:t=>(0,E.jsx)(C,{body:t.body||e.ess,links:t.links}),srcLine:`$ geneseed law ${e.addr} · ${e.src}`})}var ie=[`invariants`,`doctrines`];function ae({tiers:e,current:t,onPick:n}){return(0,E.jsx)(`div`,{className:`tier-strip`,children:e.map((e,r)=>{let i=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`span`,{className:`tier-head`,children:[(0,E.jsxs)(`span`,{className:`tier-k mono`,children:[`RANK `,r+1]}),e.pill?(0,E.jsx)(`span`,{className:`badge tier-pill ${e.pill[1]}`,children:e.pill[0]}):null]}),(0,E.jsxs)(`span`,{className:`tier-top`,children:[(0,E.jsx)(`span`,{className:`tier-name`,children:e.name}),(0,E.jsx)(`span`,{className:`tier-n mono`,children:e.n})]}),(0,E.jsx)(`span`,{className:`tier-bar`,"aria-hidden":`true`,children:(0,E.jsx)(`span`,{style:{width:`${Math.round(e.fill*100)}%`}})}),(0,E.jsx)(`span`,{className:`tier-sub`,children:e.sub}),(0,E.jsx)(`span`,{className:`tier-sub tier-rule`,children:e.rule})]}),a=`tier${t===e.key?` on`:``}`;return e.href?(0,E.jsx)(`a`,{className:`tier`,href:e.href,children:i},e.key):n&&ie.includes(e.key)?(0,E.jsx)(`button`,{type:`button`,className:a,"aria-pressed":t===e.key,onClick:()=>n(t===e.key?`all`:e.key),children:i},e.key):(0,E.jsx)(`div`,{className:a,children:i},e.key)})})}function oe({gates:e,byAddr:t,onJump:n,disarmed:r=()=>!1}){let i=Object.entries(e?.asks||{}).map(([e,t])=>[e,t,r(g(e))]).sort((e,t)=>e[2]-t[2]||t[1]-e[1]),a=Math.max(1,...i.map(([,e])=>e));return(0,E.jsxs)(`section`,{className:`panel`,"aria-labelledby":`gate-asks`,children:[(0,E.jsxs)(`div`,{className:`panel-head`,children:[(0,E.jsx)(`h2`,{id:`gate-asks`,children:`Gate asks`}),(0,E.jsxs)(`span`,{className:`mono dim`,children:[e?.total??0,` in ledger`]})]}),i.length?(0,E.jsx)(`ul`,{className:`gate-list`,children:i.map(([e,r,i])=>{let s=g(e),c=t[s]?.name||s;return(0,E.jsxs)(`li`,{children:[(0,E.jsx)(`button`,{type:`button`,className:`gate-row`,onClick:()=>n(s),children:(0,E.jsxs)(`span`,{className:`gate-top`,children:[(0,E.jsx)(`span`,{className:`gate-name${i?` dim`:``}`,children:c}),(0,E.jsx)(`span`,{className:`mono dim`,children:s}),i&&(0,E.jsx)(`span`,{className:`mono off`,children:`off`}),(0,E.jsx)(`span`,{className:`mono gate-n`,children:r})]})}),(0,E.jsx)(o,{value:r,max:a,label:`${c} asks`,tone:i?`accent`:`warn`})]},e)})}):(0,E.jsx)(`p`,{className:`sub`,children:`No gate has asked yet.`}),(0,E.jsx)(`p`,{className:`panel-note`,children:e?.standing_down?.length?`Standing down: ${e.standing_down.join(`, `)}.`:`None standing down.`})]})}function se({packs:e,sel:t,canApply:n,install:r,gateArmed:i}){let{isOn:a,packOn:s,togglePack:c,dirty:l,losingConsent:u}=t,d=Math.max(1,...e.map(e=>e.rules.length));return(0,E.jsxs)(`section`,{className:`panel`,"aria-labelledby":`doc-packs`,children:[(0,E.jsxs)(`div`,{className:`panel-head`,children:[(0,E.jsx)(`h2`,{id:`doc-packs`,children:`Doctrine packs`}),(0,E.jsxs)(`span`,{className:`mono dim`,children:[e.filter(s).length,`/`,e.length,` on`]})]}),e.length?(0,E.jsx)(`ul`,{className:`pack-list`,children:e.map(e=>{let t=e.rules.filter(e=>a(e.addr)).length;return(0,E.jsxs)(`li`,{className:s(e)?``:`off`,children:[(0,E.jsx)(`span`,{className:`pl-name`,title:e.desc,children:e.title}),(0,E.jsx)(o,{value:t,max:d,label:`${e.title} rules on`}),(0,E.jsx)(`span`,{className:`mono pl-n`,children:t}),n?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${s(e)?` on`:``}${t&&t<e.rules.length?` mixed`:``}`,role:`checkbox`,"aria-checked":e.rules.length&&t===e.rules.length?`true`:t?`mixed`:`false`,"aria-label":`${e.title} pack`,onClick:()=>c(e)}):null]},e.pack)})}):(0,E.jsx)(`p`,{className:`sub`,children:`This install predates the three-tier constitution.`}),n&&e.length>0&&(0,E.jsxs)(E.Fragment,{children:[u&&(0,E.jsxs)(`p`,{className:`pack-warn`,role:`status`,"aria-live":`polite`,children:[`Dropping `,(0,E.jsx)(`b`,{children:`process 5`}),` also removes the commit/push consent gate:`,` `,(0,E.jsx)(`code`,{children:`git commit`}),` and `,(0,E.jsx)(`code`,{children:`git push`}),` stop being confirmed at the tool boundary.`,` `,i?`Real data loss stays gated by Rule IV.`:`Rule IV’s deletion gate is off on this install too.`]}),(0,E.jsx)(`p`,{className:`panel-note`,role:`status`,"aria-live":`polite`,children:l?`Not applied yet. Apply rebuilds ${r.host} · ${r.scope} once, with every change together.`:`Matches the deployed install. Changing a pack rebuilds it.`})]})]})}function ce(e){let t=[];for(let n of e){if(n.tier!==`doctrine`)continue;let e=t.find(e=>e.pack===n.pack);e||(e={pack:n.pack,title:n.packTitle||n.pack,desc:n.packDesc||``,active:n.packActive!==!1,rules:[]},t.push(e));let r=f(n.title);e.rules.push({addr:n.name,no:`${n.pack} ${n.name.split(`.`)[1]||``}`,name:r.name,latin:r.latin,ess:n.summary||``,enf:_(n.name),c:te[n.pack]||`var(--text-3)`,src:`doctrines/${n.pack}.md`})}return t}function le({selected:e,overview:t,setup:n,onAction:i,dataRev:l}){let C=d(),{data:D,error:ie}=h(()=>r.catalog(`laws`),[l],`catalog:laws`),{data:le}=c(l),[O,k]=(0,w.useState)(`all`),[ue,de]=(0,w.useState)(``),[A,j]=(0,w.useState)(`all`),[fe,pe]=(0,w.useState)(()=>new Set),M=e||null,me=e=>x(M===e?`#/laws`:`#/item/law/${encodeURIComponent(e)}`),[he,ge]=(0,w.useState)(0),_e=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(!e)return;let t=requestAnimationFrame(()=>{let t=document.querySelector(`[data-addr="${CSS.escape(e)}"]`);if(!t)return;let n=_e.current===e;_e.current=null;let r=t.getBoundingClientRect();if(n||r.top<80||r.bottom>window.innerHeight){let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView?.({block:`center`,behavior:e?`auto`:`smooth`})}n&&(t.classList.remove(`law-flash`),t.offsetWidth,t.classList.add(`law-flash`))});return()=>cancelAnimationFrame(t)},[e,he,D]);let N=D?.items||[],P=ce(N),F=e=>t?.install?.[m[e].key]!==!1,ve=F(`IV`),I=t?.install,L=!!(I&&i),R=T({items:N,packs:P,install:I,canApply:L,onAction:i,gateArmed:ve}),{deployedRules:z,isOn:B,toggleRule:ye,packOn:be,packState:xe,allRules:V}=R;if(ie)return(0,E.jsx)(b,{error:ie});if(!D)return(0,E.jsx)(a,{});let H={ontology:D.nouns?.ontology||`Ethos`,law:D.nouns?.law||`Dictate`,laws:D.nouns?.laws||`Dictates`,doctrines:D.nouns?.doctrines||`Doctrines`},U=N.filter(e=>e.tier===`ontology`).map(e=>({addr:e.name,no:``,name:e.title,latin:``,ess:``,status:`Always`,statusTone:`ok`,enf:`Instruction`,c:`var(--text-3)`,src:`ontology/universal.md`})),W=N.filter(e=>(e.tier??`invariant`)===`invariant`).map(e=>{let n=e.klass&&ee[e.klass]?e.klass:`craft`,r=f(e.title);return{addr:e.name,no:e.name,name:r.name,latin:r.latin,ess:e.summary||``,retired:r.retired,status:r.retired?`Retired`:`Active`,statusTone:r.retired?``:`ok`,enf:r.retired?`None`:_(e.name,t?.install),cat:n,c:ee[n].c,off:r.retired,src:`laws/universal.md`}}),Se=e=>{let t=B(e.addr),n=z.includes(e.addr),r=t===n?t?`Active`:`Off`:t?`Staged on`:`Staged off`;return{...e,off:!t,status:r,statusTone:t?`ok`:t===n?``:`warn`}},Ce=P.filter(e=>e.active).flatMap(e=>e.rules.filter(e=>!z.includes(e.addr)).map(e=>e.addr)),we=async e=>{if(!L)return;let{key:t,label:n}=m[e],r=n.toLowerCase(),a=!F(e),o=`${I.host} · ${I.scope}`,s=R.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await C((a?`Re-arm the ${r} on ${o}? ${p[e].arm} It rebuilds in place, non-destructive.`:`Switch the ${r} off on ${o}? ${p[e].off} It rebuilds in place, non-destructive.`)+s,{title:a?`Re-arm the ${r}?`:`Switch the ${r} off?`,confirmLabel:a?`Re-arm`:`Switch off`})&&i(`install`,{...I,[t]:a})},Te=e=>String(e.addr).includes(`.`)&&B(e.addr)!==z.includes(e.addr),G=(e,t=A)=>t===`all`||(t===`gated`?e.enf===`Hook gate`&&(!String(e.addr).includes(`.`)||z.includes(e.addr)):Te(e)),K=ue.trim().toLowerCase(),q=e=>G(e)&&(!K||`${e.addr} ${e.name} ${e.latin} ${e.ess}`.toLowerCase().includes(K)),Ee=e=>{let t=Ne[e],n=String(e).includes(`.`);(n&&O===`invariants`||!n&&O===`doctrines`)&&k(`all`),t&&!G(t)&&j(`all`),t&&!q(t)&&de(``),_e.current=e,ge(e=>e+1),x(`#/item/law/${encodeURIComponent(e)}`)},J={};for(let[e,t]of Object.entries(n?.gates?.asks||{}))J[g(e)]=t;let De=e=>J[e.addr]?{...e,asks:`${J[e.addr]} ask${J[e.addr]===1?``:`s`}`}:e,Y=W.filter(e=>!e.retired).length,X=z.length,Oe=Object.keys(m).filter(e=>W.some(t=>t.addr===e)&&!F(e)).length,ke=V.length-X,Z=le?.stats,Ae={ethos:{name:H.ontology,n:U.length,fill:1,sub:`${U.length} sections`,pill:[`always`,`ok`]},invariants:{name:H.laws,n:Y,fill:W.length?Y/W.length:0,sub:W.length>Y?`${Y} active · ${W.length-Y} retired`:`${Y} active`,pill:Oe?[`${Oe} gate${Oe===1?``:`s`} off`,`warn`]:[`always`,`ok`]},doctrines:{name:H.doctrines,n:X,fill:V.length?X/V.length:0,sub:`${X} rules · ${P.filter(e=>e.active).length} of ${P.length} packs`,pill:ke>0?[`${ke} excluded`,`warn`]:[`all on`,`ok`]},yours:{name:`Your rules`,n:Z?.rules??0,fill:Z?.max_rules?Z.rules/Z.max_rules:0,sub:Z?`${Z.rules} of ${Z.max_rules} · ${Z.tokens}/${Z.max_tokens} tok`:`user-rules.md`,href:`#/personal/rules`,pill:[`yours`,``]}},je=e=>{if(e===`—`)return`Nothing outranks them.`;let t=e.replace(`{{LAW}}`,H.law);return`${t[0].toUpperCase()}${t.slice(1)}.`},Me=y.map(e=>({key:e.key,...Ae[e.key],rule:je(e.against)})),Ne=Object.fromEntries([...W,...P.flatMap(e=>e.rules)].map(e=>[e.addr,e])),Pe=[[`all`,`All`,W.length+V.length],[`invariants`,H.laws,W.length],[`doctrines`,H.doctrines,V.length]],Q=O===`all`||O===`invariants`,Fe=O===`all`||O===`doctrines`,Ie=[...Q?W:[],...Fe?P.flatMap(e=>e.rules):[]],Le=[[`gated`,`Gated`,Ie.filter(e=>G(e,`gated`)).length],[`changed`,`Changed`,Ie.filter(e=>G(e,`changed`)).length]],Re=e=>String(e).includes(`.`)?String(e).split(`.`)[0]:null,ze=e=>A!==`changed`&&fe.has(e)&&Re(M)!==e,Be=e=>{let t=ze(e);pe(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r}),!t&&Re(M)===e&&x(`#/laws`)},Ve=P.flatMap(e=>e.rules.filter(Te).map(e=>({...e,plus:B(e.addr)}))),He=L&&P.length>0&&R.dirty,Ue=()=>{j(`changed`),O===`invariants`&&k(`all`),de(``)},We=(e,t)=>(0,E.jsxs)(`div`,{className:`band-head`,role:`presentation`,children:[(0,E.jsx)(`h2`,{className:`tier-h`,children:e}),(0,E.jsx)(`span`,{className:`mono dim`,children:t})]}),$=W.filter(q),Ge=(Q?$.length:0)+(Fe?P.reduce((e,t)=>e+t.rules.filter(q).length,0):0);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(s,{eyebrow:I?[t?.theme,I.footprint&&`${I.footprint} footprint`,I.host,I.scope].filter(Boolean).join(` · `):null,title:`Constitution`,sub:`What the agent follows on every turn. Ranked: a lower rank may tighten a higher one, never repeal it. Open any rule to read its canonical text.`,actions:(0,E.jsx)(S,{className:`law-filter`,value:ue,onChange:de,placeholder:`Filter rules`,label:`Filter rules`})}),(0,E.jsxs)(`section`,{className:`ladder`,"aria-labelledby":`ladder-h`,children:[(0,E.jsx)(`h2`,{id:`ladder-h`,className:`eyebrow`,children:`Precedence`}),(0,E.jsx)(ae,{tiers:Me,current:O,onPick:k}),(0,E.jsx)(`div`,{className:`ladder-tail`,children:v.map((e,t)=>(0,E.jsxs)(`span`,{className:`ladder-low`,children:[(0,E.jsxs)(`span`,{className:`mono tier-k`,children:[`RANK `,y.length+t+1]}),` `,e.label,` —`,` `,e.against]},e.source))})]}),(0,E.jsxs)(`div`,{className:`split`,children:[(0,E.jsxs)(`section`,{className:`panel flush law-wrap${L?` with-toggle`:``}`,"aria-label":`Rules`,children:[U.length>0&&(0,E.jsxs)(E.Fragment,{children:[We(H.ontology,`ontology/universal.md`),U.map(e=>(0,E.jsx)(re,{law:e,rev:l,isOpen:M===e.addr,onToggle:()=>me(e.addr)},e.addr))]}),(0,E.jsxs)(`div`,{className:`law-toolbar`,children:[(0,E.jsx)(u,{"aria-label":`Show`,children:Pe.map(([e,t,n])=>(0,E.jsxs)(`button`,{type:`button`,className:O===e?`on`:``,"aria-pressed":O===e,onClick:()=>k(e),children:[t,` `,(0,E.jsx)(`span`,{className:`mono`,children:n})]},e))}),(0,E.jsx)(u,{"aria-label":`Narrow`,children:Le.map(([e,t,n])=>(0,E.jsxs)(`button`,{type:`button`,className:A===e?`on`:``,"aria-pressed":A===e,onClick:()=>j(A===e?`all`:e),children:[t,` `,(0,E.jsx)(`span`,{className:`mono`,children:n})]},e))})]}),(0,E.jsxs)(`div`,{className:`law-rowhead`,children:[(0,E.jsx)(`span`,{children:`No.`}),(0,E.jsx)(`span`,{children:`Rule`}),(0,E.jsx)(`span`,{children:`Latin name`}),(0,E.jsx)(`span`,{children:`Status`}),(0,E.jsx)(`span`,{children:`Enforced by`})]}),Q&&$.length>0&&(0,E.jsxs)(E.Fragment,{children:[We(H.laws,`laws/universal.md`),$.map(e=>(0,E.jsx)(re,{law:De(e),rev:l,isOpen:M===e.addr,onToggle:()=>me(e.addr),toggleCol:!L||e.retired?null:m[e.addr]?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${F(e.addr)?` on`:``}`,role:`switch`,"aria-checked":F(e.addr),"aria-label":m[e.addr].label,onClick:()=>we(e.addr)}):(0,E.jsx)(`span`,{className:`no-gate`,title:`Enforced by its text alone: no hook gate`,children:`no gate`})},e.addr))]}),Fe&&P.map(e=>{let t=e.rules.filter(q);if(!t.length)return null;let n=ze(e.pack),r=e.rules.filter(e=>B(e.addr)).length;return(0,E.jsxs)(`div`,{className:`pack-wrap${be(e)?``:` pack-off`}`,children:[(0,E.jsxs)(`div`,{className:`band-head pack-head`,children:[(0,E.jsx)(`h2`,{className:`tier-h`,style:{"--cc":te[e.pack]},children:(0,E.jsx)(`button`,{type:`button`,className:`pack-fold`,"aria-expanded":!n,onClick:()=>Be(e.pack),children:e.title})}),(0,E.jsx)(`span`,{className:`mono dim`,children:e.pack}),(0,E.jsx)(`span`,{className:`pack-desc dim`,children:e.desc}),(0,E.jsx)(`span`,{className:`pack-fill`,children:(0,E.jsx)(o,{value:r,max:e.rules.length,label:`${e.title} rules switched on`})}),(0,E.jsx)(`span`,{className:`pack-state mono`,children:xe(e)})]}),!e.active&&!L&&(0,E.jsxs)(`div`,{className:`pack-enable`,children:[`$ geneseed-build --doctrines`,` `,P.filter(t=>t.active||t.pack===e.pack).map(e=>e.pack).join(`,`),Ce.length>0&&` --exclude-rules ${Ce.join(`,`)}`]}),!n&&t.map(e=>(0,E.jsx)(re,{law:De(Se(e)),rev:l,isOpen:M===e.addr,onToggle:()=>me(e.addr),toggleCol:L?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${B(e.addr)?` on`:``}`,role:`switch`,"aria-checked":B(e.addr),"aria-label":`${e.name} rule`,onClick:()=>ye(e.addr)}):null},e.addr))]},e.pack)}),Ge===0&&(0,E.jsx)(ne,{title:K||A!==`all`?`No matching rules`:`Nothing in this tier`,children:K?(0,E.jsxs)(E.Fragment,{children:[`Nothing matches “`,ue.trim(),`”.`]}):A===`all`?(0,E.jsx)(E.Fragment,{children:`This install predates the tier.`}):(0,E.jsxs)(E.Fragment,{children:[`No `,A,` rule in this tier.`]})})]}),(0,E.jsxs)(`aside`,{className:`aside-stack`,children:[(0,E.jsx)(se,{packs:P,sel:R,canApply:L,install:I,gateArmed:ve}),(0,E.jsx)(oe,{gates:n?.gates,byAddr:Ne,onJump:Ee,disarmed:e=>!!m[e]&&!F(e)})]})]}),He&&(0,E.jsxs)(`div`,{className:`law-bar`,role:`region`,"aria-label":`Unapplied changes`,children:[(0,E.jsxs)(`span`,{className:`law-bar-n`,children:[Ve.length,` unapplied change`,Ve.length===1?``:`s`]}),(0,E.jsx)(`span`,{className:`law-bar-list`,children:Ve.map(e=>(0,E.jsxs)(`span`,{className:`badge ${e.plus?`ok`:`warn`}`,children:[e.plus?`+`:`−`,` `,e.no,` `,e.name]},e.addr))}),(0,E.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:Ue,children:`Review changes`}),(0,E.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>{j(`all`),R.revert()},children:`Revert`}),(0,E.jsxs)(`button`,{type:`button`,className:`btn`,onClick:R.applyPacks,children:[`Apply (`,R.pickedRules.length,`/`,V.length,` rules)`]})]})]})}export{le as default};
|