@pithosai/pithosai 1.0.7 → 1.0.32

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.
@@ -0,0 +1,63 @@
1
+ # Krouter — `krouter.js`
2
+
3
+ OpenAI-compatible access to models through a local [Krouter](https://github.com/sifxprime/krouter) gateway.
4
+
5
+ Catalog lists only dashboard **combos** as CLI shortcuts:
6
+
7
+ - `krouter-rd` → `RD`
8
+ - `krouter-arch` → `ARCH`
9
+ - `krouter-pm` → `PM`
10
+ - `krouter-qa` → `QA`
11
+
12
+ Any other id from `GET /v1/models` is selected as a composite: `--model krouter/<id>` (alias `kiro/<id>`).
13
+
14
+ ## Setup
15
+
16
+ Install the gateway ([`docs/KROUTER.md`](../../docs/KROUTER.md)):
17
+
18
+ ```bash
19
+ npm install -g @sifxprime/krouter@0.5.118
20
+ krouter -t --skip-update
21
+ ```
22
+
23
+ Krouter is **on by default** (base `http://localhost:20128/v1`). Override the URL or opt out:
24
+
25
+ ```bash
26
+ # optional: export KROUTER_API_BASE=http://localhost:20128/v1
27
+ # opt out: export KROUTER_DISABLED=1
28
+ # optional: export KROUTER_API_KEY=...
29
+ ```
30
+
31
+ Legacy aliases `KIRO_API_BASE` / `KIRO_DISABLED` / `KIRO_API_KEY` still work.
32
+
33
+ Default base: `http://localhost:20128/v1` (dummy key `krouter` when unset).
34
+
35
+ ## Which model to pick
36
+
37
+ | Goal | Prefer | CLI |
38
+ |------|--------|-----|
39
+ | Dashboard default agent / coding combo | **RD** | `krouter-rd` |
40
+ | Architecture-focused combo | **ARCH** | `krouter-arch` |
41
+ | Product / planning combo | **PM** | `krouter-pm` |
42
+ | QA combo | **QA** | `krouter-qa` |
43
+ | Any gateway id from `/v1/models` | that id | `krouter/<id>` (e.g. `krouter/cu/default`) |
44
+
45
+ Env-walk default (when Krouter is not disabled and no `--model` is set): `RD` (`krouter-rd`).
46
+
47
+ `/model` lists only the four combo keys. Use `--model krouter/<id>` for other gateway models.
48
+
49
+ ## Examples
50
+
51
+ ```bash
52
+ export KROUTER_API_BASE=http://localhost:20128/v1
53
+
54
+ # Combo shortcut
55
+ pithosai --no-interactive --model krouter-rd "Add tests for this file"
56
+
57
+ # Dynamic id from the local gateway
58
+ pithosai --no-interactive --model krouter/cu/default "Summarize this module"
59
+ ```
60
+
61
+ ## Metadata
62
+
63
+ On first krouter resolve, pithosai fire-and-forgets `GET {base}/models` and caches `context_length` / `max_completion_tokens` when present. Sync resolve never blocks on the network; unknown ids still use shared catalog defaults.
package/dist/935.mjs DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export const __rspack_esm_id="935";export const __rspack_esm_ids=["935"];export const __webpack_modules__={8498(t,e,i){i.a(t,async function(t,s){try{i.d(e,{showMarkdownInPiTui:()=>a});var l=i(8691),r=i(2421),n=i(4127),h=t([l,r,n]);[l,r,n]=h.then?(await h)():h;let o=!1;class c{constructor(t){let{terminal:e,tui:i,markdown:s,hintText:l,documentTitle:r,onClose:n}=t;this.terminal=e,this.tui=i,this._markdown=s,this.hintText=l,this.documentTitle=r?.trim()||"",this.onClose=n,this.scrollTop=0,this._fullLines=null,this._cachedWidth=null,this._ggAwaitingSecondG=!1,this._ggTimer=null}clearGgPrefixState(){null!=this._ggTimer&&(clearTimeout(this._ggTimer),this._ggTimer=null),this._ggAwaitingSecondG=!1}invalidate(){this._markdown.invalidate(),this._fullLines=null,this._cachedWidth=null}handleInput(t){let e=this.terminal.columns,i=this.terminal.rows,s=+!!this.documentTitle,l=Math.max(1,i-s-1),r=this._getFullLines(e).length,h=Math.max(0,r-l);if((0,n.matchesKey)(t,"escape")||(0,n.matchesKey)(t,"esc")||(0,n.matchesKey)(t,"q")||(0,n.matchesKey)(t,"shift+q")||(0,n.matchesKey)(t,"ctrl+c")){this.clearGgPrefixState(),this.onClose();return}if((0,n.matchesKey)(t,"shift+g")){this.clearGgPrefixState(),this.scrollTop=h;return}if((0,n.matchesKey)(t,"g")){if(this._ggAwaitingSecondG){this.clearGgPrefixState(),this.scrollTop=0;return}this._ggAwaitingSecondG=!0,null!=this._ggTimer&&clearTimeout(this._ggTimer),this._ggTimer=setTimeout(()=>{this._ggTimer=null,this._ggAwaitingSecondG=!1},500);return}if(this.clearGgPrefixState(),(0,n.matchesKey)(t,"up")||(0,n.matchesKey)(t,"k")){this.scrollTop=Math.max(0,this.scrollTop-1);return}if((0,n.matchesKey)(t,"down")||(0,n.matchesKey)(t,"j")){this.scrollTop=Math.min(h,this.scrollTop+1);return}if((0,n.matchesKey)(t,"pageUp")||(0,n.matchesKey)(t,"ctrl+u")){this.scrollTop=Math.max(0,this.scrollTop-l);return}if((0,n.matchesKey)(t,"pageDown")||(0,n.matchesKey)(t,"ctrl+d")){this.scrollTop=Math.min(h,this.scrollTop+l);return}if((0,n.matchesKey)(t,"home")){this.scrollTop=0;return}if((0,n.matchesKey)(t,"end")){this.scrollTop=h;return}}_getFullLines(t){return this._fullLines&&this._cachedWidth===t||(this._cachedWidth=t,this._fullLines=this._markdown.render(t)),this._fullLines}render(t){let e=this.terminal.rows,i=this.documentTitle?[l.m.bold.cyan((0,n.truncateToWidth)(this.documentTitle,t))]:[],s=i.length,r=Math.max(1,e-s-1);null!=this._cachedWidth&&this._cachedWidth!==t&&this.invalidate();let h=this._getFullLines(t),a=Math.max(0,h.length-r);this.scrollTop=Math.min(this.scrollTop,a);let o=h.slice(this.scrollTop,this.scrollTop+r);for(;o.length<r;)o.push("");let c=l.m.dim((0,n.truncateToWidth)(this.hintText,t));return[...i,...o,c]}}async function a(t){let{markdown:e,t:i,documentTitle:s,tuiSession:l=null}=t;if(!e||"string"!=typeof e||!e.trim())return;if(!(process.stdout.isTTY&&process.stdin.isTTY))return void process.stdout.write(`${e}
3
- `);let h=l&&"function"==typeof l.suspendForReadline&&"function"==typeof l.resumeFromReadline;h&&l.suspendForReadline();try{o||((0,r.initTheme)("dark"),o=!0);let t=(0,r.getMarkdownTheme)(),l=new n.Markdown(e,1,1,t),h=i("cli.resultPreviewTerminalHint"),a=new n.ProcessTerminal,m=new n.TUI(a);m.setClearOnShrink(!0),await new Promise(t=>{let e,i=new c({terminal:a,tui:m,markdown:l,hintText:h,documentTitle:s,onClose:()=>{e?.clearGgPrefixState(),m.stop(),t()}});e=i;let r=new n.Container;r.addChild(i),m.addChild(r),m.setFocus(i),m.start(),m.requestRender(!0)})}finally{h&&l.resumeFromReadline()}}s()}catch(t){s(t)}})}};