austere-axi 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -54,11 +54,42 @@ agent edits statements ◄── austere-axi poll plan.html ◄─┘ (long-pol
54
54
 
55
55
  ## Install
56
56
 
57
+ Requires Node.js 20 or later.
58
+
59
+ **Run it without installing** (what agents use):
60
+
61
+ ```sh
62
+ npx -y austere-axi --help
63
+ ```
64
+
65
+ `npx` downloads the package into npm's cache and runs it. `-y` skips the install prompt, so a non-interactive agent never stalls on it. Prefix every command below the same way: `npx -y austere-axi spec`, `npx -y austere-axi plan.html`, and so on.
66
+
67
+ **Or install the command globally:**
68
+
69
+ ```sh
70
+ npm install -g austere-axi
71
+ austere-axi --help
72
+ ```
73
+
74
+ A global install stays on the version you installed until `npm update -g austere-axi`. Mixing the two is fine: a newer CLI replaces an older background server automatically.
75
+
76
+ **Agent skill (optional):**
77
+
57
78
  ```sh
58
79
  npx skills add MandalorianBatman/austere-axi --skill austere
59
80
  ```
60
81
 
61
- The skill is a stub that sends the agent to `npx -y austere-axi --help` and `spec`. The CLI is the source of truth, so an installed skill cannot go stale. No setup is needed: any agent can run `npx -y austere-axi` directly.
82
+ The skill tells an agent when a page beats prose and adds an `/austere <request>` command. It is a stub that sends the agent to `npx -y austere-axi --help` and `spec`, so an installed copy cannot go stale. Agents that can run shell commands do not need it.
83
+
84
+ ## Quick start
85
+
86
+ ```sh
87
+ npx -y austere-axi spec # component reference for the agent (read once per session)
88
+ npx -y austere-axi plan.html # validate and open the page for review
89
+ npx -y austere-axi poll plan.html # wait for the reviewer to press Send
90
+ ```
91
+
92
+ `--help` prints the file skeleton and the full review loop.
62
93
 
63
94
  ## CLI
64
95
 
package/dist/austere.js CHANGED
@@ -1257,6 +1257,6 @@ ${n}`}})}}let r=e;return{type:r.type??Cl.ContinueConversation,params:{...r.param
1257
1257
  `;)r++;continue}let l=r,c=n,u=0,d=null,p=!1;for(;r<o;){let x=a[r];if(d){p?p=!1:x==="\\"?p=!0:x===d&&(d=null),x===`
1258
1258
  `&&n++,r++;continue}if(x==='"'||x==="'"){d=x,r++;continue}if(x==="#"||x==="/"&&a[r+1]==="/"){for(;r<o&&a[r]!==`
1259
1259
  `;)r++;continue}if(x==="("||x==="["||x==="{")u++;else if(x===")"||x==="]"||x==="}")u=Math.max(0,u-1);else if(x===`
1260
- `){if(u===0&&!mza(a,r+1))break;n++}r++}let f=a.slice(l,r).replace(/\s+$/,""),m=/^\s*([A-Za-z_$][\w$]*)\s*=/.exec(f);m&&pza.test(m[1][0])&&t.push({id:m[1],text:f,line:c,endLine:n})}return t}function mza(e,t){let a=t;for(;a<e.length&&(e[a]===" "||e[a]===" ");)a++;return e[a]==="?"||e[a]===":"}function ix(e){let t=new Map;for(let a of fza(e))t.set(a.id,a);return t}function WTt(e,t){let a=ix(e),r=ix(t),n=[];for(let[o,i]of r){let l=a.get(o);(!l||GTt(l.text)!==GTt(i.text))&&n.push(o)}return n}function jG(e,t){let a=new RegExp(`(^|[^\\w$])${gza(t)}(?![\\w$])`),r=[];for(let[n,o]of e){if(n===t)continue;let i=o.text.slice(o.text.indexOf("=")+1);a.test(hza(i))&&r.push(n)}return r}function hza(e){return e.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/gs,'""')}function GTt(e){return e.replace(/\s+/g," ").trim()}function gza(e){return e.replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")}var lx=te(kt(),1),UG="0.1.0",yza='script[type="text/openui"], script[type="text/openui-lang"]';function xza(){if(document.getElementById("austere-styles"))return;let e=document.createElement("style");if(e.id="austere-styles",e.textContent=[rne,ene,tne,ane].join(`
1260
+ `){if(u===0&&!mza(a,r+1))break;n++}r++}let f=a.slice(l,r).replace(/\s+$/,""),m=/^\s*([A-Za-z_$][\w$]*)\s*=/.exec(f);m&&pza.test(m[1][0])&&t.push({id:m[1],text:f,line:c,endLine:n})}return t}function mza(e,t){let a=t;for(;a<e.length&&(e[a]===" "||e[a]===" ");)a++;return e[a]==="?"||e[a]===":"}function ix(e){let t=new Map;for(let a of fza(e))t.set(a.id,a);return t}function WTt(e,t){let a=ix(e),r=ix(t),n=[];for(let[o,i]of r){let l=a.get(o);(!l||GTt(l.text)!==GTt(i.text))&&n.push(o)}return n}function jG(e,t){let a=new RegExp(`(^|[^\\w$])${gza(t)}(?![\\w$])`),r=[];for(let[n,o]of e){if(n===t)continue;let i=o.text.slice(o.text.indexOf("=")+1);a.test(hza(i))&&r.push(n)}return r}function hza(e){return e.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/gs,'""')}function GTt(e){return e.replace(/\s+/g," ").trim()}function gza(e){return e.replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")}var lx=te(kt(),1),UG="0.1.1",yza='script[type="text/openui"], script[type="text/openui-lang"]';function xza(){if(document.getElementById("austere-styles"))return;let e=document.createElement("style");if(e.id="austere-styles",e.textContent=[rne,ene,tne,ane].join(`
1261
1261
  `),document.head.appendChild(e),!document.querySelector('meta[name="viewport"]')){let t=document.createElement("meta");t.name="viewport",t.content="width=device-width, initial-scale=1",document.head.appendChild(t)}document.documentElement.classList.add("austere"),document.documentElement.style.colorScheme="dark"}function KTt(e){if(!e||typeof e!="object")return;let t={};for(let[a,r]of Object.entries(e))if(!a.startsWith("$"))if(r&&typeof r=="object"&&!Array.isArray(r))if("value"in r&&Object.keys(r).length<=3)t[a]=r.value;else{let n=KTt(r);n&&Object.keys(n).length&&(t[a]=n)}else t[a]=r;return Object.keys(t).length?t:void 0}function vza(){let e=window.parent&&window.parent!==window,t=new Map,a=r=>{e&&window.parent.postMessage({austere:1,...r},"*")};return window.addEventListener("message",r=>{if(r.source!==window.parent)return;let n=r.data;!n||n.austere!==1||typeof n.type!="string"||t.get(n.type)?.forEach(o=>o(n))}),{framed:e,connected:!1,send:a,on(r,n){return t.has(r)||t.set(r,new Set),t.get(r).add(n),()=>t.get(r).delete(n)}}}function HG(e){let t=document.createElement("div");t.className="austere-toast",t.setAttribute("data-austere-ui",""),t.textContent=e,document.body.appendChild(t),setTimeout(()=>t.classList.add("out"),2600),setTimeout(()=>t.remove(),3100)}function bza(e){let t=[e.message];return e.form&&t.push(`form: ${JSON.stringify(e.form)}`),e.context!==void 0&&t.push(`context: ${JSON.stringify(e.context)}`),t.join(`
1262
1262
  `)}function kza({initialProgram:e,bridge:t,annotator:a,initialState:r}){let[n,o]=(0,Uo.useState)(e),i=(0,Uo.useRef)(e),l=(0,Uo.useRef)(null);(0,Uo.useEffect)(()=>t.on("source",({program:p})=>{if(typeof p!="string"||p===i.current)return;let f=WTt(i.current,p);i.current=p,l.current=f,o(p)}),[t]),(0,Uo.useEffect)(()=>t.on("reveal",({id:p})=>{a?.reveal(p,ix(i.current),jG)}),[t,a]),(0,Uo.useEffect)(()=>{let p=l.current;if(!p)return;l.current=null;let f=setTimeout(()=>{let m=ix(i.current),x=p.filter(b=>b!=="root");a?.flash(x,"changed",m,jG),t.send({type:"changes",ids:x})},120);return()=>clearTimeout(f)},[n,a,t]);let c=(0,Uo.useCallback)(p=>{if(p.type==="open_url"){let x=p.params?.url;typeof x=="string"&&/^(https?:|mailto:)/i.test(x)&&window.open(x,"_blank","noopener");return}if(p.type!=="continue_conversation")return;let f={kind:"action",message:p.humanFriendlyMessage||"(button)"},m=KTt(p.formState);if(m&&(f.form=m),p.params?.context!==void 0&&(f.context=p.params.context),t.connected)t.send({type:"action",item:f}),HG("Queued for the agent \u2014 press Send when ready");else{let x=bza(f);navigator.clipboard?.writeText(x).then(()=>HG("Copied \u2014 paste it to your agent"),()=>HG(x))}},[t]),u=(0,Uo.useCallback)(p=>{t.send({type:"errors",errors:(p||[]).map(f=>({source:f.source,code:f.code,statementId:f.statementId,message:f.message,hint:f.hint}))})},[t]),d=(0,Uo.useCallback)(p=>t.send({type:"state",state:p}),[t]);return(0,lx.jsx)(Qre,{mode:"dark",children:(0,lx.jsx)("main",{className:"austere-page",children:(0,lx.jsx)(L2,{response:n,library:BG,isStreaming:!1,onAction:c,onError:u,onStateUpdate:d,initialState:r})})})}function ZTt(){xza();let e=document.querySelector(yza),t=e?e.textContent:"",a=document.createElement("div");a.id="austere-root",document.body.appendChild(a);let r=vza(),n=null,o=!1,i=l=>{o||(o=!0,(0,XTt.createRoot)(a).render((0,lx.jsx)(kza,{initialProgram:t,bridge:r,annotator:n,initialState:l})))};if(!r.framed){i(void 0);return}n=VTt({post:l=>r.send(l)}),BTt(l=>r.send({type:"runtime-error",error:l})),r.on("init",l=>{if(r.connected=!0,n.setMode(l.mode),i(l.state||void 0),l.scrollY>0){let c=0,u=()=>{window.scrollTo(0,l.scrollY),Math.abs(window.scrollY-l.scrollY)>2&&++c<20&&setTimeout(u,50)};setTimeout(u,30)}r.send({type:"ready",title:document.title,version:UG})}),r.on("mode",l=>n.setMode(l.mode)),window.addEventListener("scroll",()=>r.send({type:"scroll",y:window.scrollY}),{passive:!0}),r.send({type:"hello",title:document.title,version:UG}),setTimeout(()=>i(void 0),600)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ZTt,{once:!0}):ZTt();window.__austere={version:UG,library:BG};})();
package/dist/cli.mjs CHANGED
@@ -605,7 +605,7 @@ var init_paths = __esm({
605
605
  HERE = path.dirname(fileURLToPath(import.meta.url));
606
606
  BUNDLED = true;
607
607
  ASSET_DIR = BUNDLED ? HERE : path.resolve(HERE, "../../dist");
608
- VERSION = true ? "0.1.0" : JSON.parse(fs.readFileSync(path.resolve(HERE, "../../package.json"), "utf8")).version;
608
+ VERSION = true ? "0.1.1" : JSON.parse(fs.readFileSync(path.resolve(HERE, "../../package.json"), "utf8")).version;
609
609
  CLI_ENTRY = BUNDLED ? fileURLToPath(import.meta.url) : path.resolve(HERE, "main.js");
610
610
  }
611
611
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "austere-axi",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Agent-authored review artifacts in OpenUI Lang: a few hundred tokens instead of a whole HTML page, with statement-level annotations fed back to the agent.",
5
5
  "type": "module",
6
6
  "license": "MIT",