@pithosai/pithosai 1.0.1 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pithosai/pithosai",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Pithos AI CLI — multi-role coding and product agents (bundled distribution).",
5
5
  "keywords": [
6
6
  "ai",
@@ -9,36 +9,36 @@
9
9
  "automation"
10
10
  ],
11
11
  "author": "lidh04@gmail.com",
12
- "license": "ISC",
12
+ "license": "UNLICENSED",
13
13
  "type": "module",
14
- "main": "./dist/pithosai.cjs",
14
+ "main": "./dist/pithosai.mjs",
15
15
  "bin": {
16
- "pithosai": "./dist/pithosai.cjs",
17
- "pmsai": "./dist/pmsai.cjs",
18
- "qasai": "./dist/qasai.cjs",
19
- "rdsai": "./dist/rdsai.cjs",
20
- "cosai": "./dist/cosai.cjs",
21
- "mktai": "./dist/mktai.cjs",
22
- "email-monitor": "./dist/heartbeat.cjs",
23
- "wrsai": "./dist/wrsai.cjs",
24
- "render-markdown": "./dist/render-markdown.cjs",
25
- "pithosai-init-db": "./dist/init-pithosai-db.cjs"
16
+ "pithosai": "./dist/pithosai.mjs",
17
+ "pmsai": "./dist/pmsai.mjs",
18
+ "qasai": "./dist/qasai.mjs",
19
+ "rdsai": "./dist/rdsai.mjs",
20
+ "cosai": "./dist/cosai.mjs",
21
+ "mktai": "./dist/mktai.mjs",
22
+ "email-monitor": "./dist/heartbeat.mjs",
23
+ "wrsai": "./dist/wrsai.mjs",
24
+ "render-markdown": "./dist/render-markdown.mjs",
25
+ "pithosai-init-db": "./dist/init-pithosai-db.mjs"
26
26
  },
27
27
  "files": [
28
+ "LICENSE",
28
29
  "dist",
29
- "patches",
30
30
  "shims",
31
31
  "pithosai.sql",
32
- "scripts/npm-global-install.cjs",
33
- "scripts/postinstall-init-db.cjs"
32
+ "scripts/npm-global-install.js",
33
+ "scripts/postinstall-init-db.js"
34
34
  ],
35
35
  "scripts": {
36
36
  "build": "rm -rf dist && rspack build --config rspack.config.cjs && npm run finalize-dist",
37
- "finalize-dist": "node scripts/prefix-bin-shebang.cjs",
37
+ "finalize-dist": "node scripts/prefix-bin-shebang.js",
38
38
  "prepublishOnly": "npm run build",
39
39
  "test": "vitest run",
40
40
  "test:watch": "vitest",
41
- "postinstall": "patch-package && node scripts/postinstall-init-db.cjs",
41
+ "postinstall": "node scripts/postinstall-init-db.js",
42
42
  "playwright:install": "playwright install chromium"
43
43
  },
44
44
  "dependencies": {
@@ -58,7 +58,6 @@
58
58
  "mailparser": "^3.7.1",
59
59
  "marked": "^17.0.2",
60
60
  "nodemailer": "^6.9.16",
61
- "patch-package": "^8.0.0",
62
61
  "pdf-parse": "^1.1.1",
63
62
  "playwright": "^1.58.2",
64
63
  "proper-lockfile": "^4.1.2",
@@ -1,12 +1,8 @@
1
- "use strict";
2
-
3
1
  /**
4
2
  * Whether the current npm lifecycle is a global install (`npm install -g`).
5
3
  * @returns {boolean}
6
4
  */
7
- function isNpmGlobalInstall() {
5
+ export function isNpmGlobalInstall() {
8
6
  const g = process.env.npm_config_global;
9
7
  return g === "true" || g === "1";
10
8
  }
11
-
12
- module.exports = { isNpmGlobalInstall };
@@ -1,18 +1,19 @@
1
- "use strict";
1
+ import { spawnSync } from "node:child_process";
2
+ import path from "node:path";
3
+ import fs from "node:fs";
4
+ import { fileURLToPath } from "node:url";
5
+ import { isNpmGlobalInstall } from "./npm-global-install.js";
6
+
7
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
2
8
 
3
9
  /**
4
10
  * After a global `npm install -g @pithosai/pithosai`, ensure `~/.pithosai/pithosai.db` exists.
5
11
  * Local / non-global installs skip this (no-op).
6
12
  */
7
- const { spawnSync } = require("node:child_process");
8
- const path = require("node:path");
9
- const fs = require("node:fs");
10
- const { isNpmGlobalInstall } = require("./npm-global-install.cjs");
11
-
12
13
  function main() {
13
14
  if (!isNpmGlobalInstall()) return;
14
15
  const root = path.join(__dirname, "..");
15
- const initCli = path.join(root, "dist", "init-pithosai-db.cjs");
16
+ const initCli = path.join(root, "dist", "init-pithosai-db.mjs");
16
17
  if (!fs.existsSync(initCli)) return;
17
18
  const r = spawnSync(process.execPath, [initCli], { stdio: "inherit", cwd: root });
18
19
  if (r.status !== 0) process.exit(r.status ?? 1);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  /**
4
- * Resolves the npm package install root (directory containing package.json and templates/).
4
+ * Resolves the npm package install root (directory containing this package's package.json).
5
5
  * Parent of shims/ — keeps dist/*.cjs able to locate assets with `join(__dirname, "..", "shims", ...)` → `require(this)`.
6
6
  */
7
7
  const path = require("node:path");
package/dist/935.cjs DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";exports.ids=["935"],exports.modules={117(t,e,i){i.d(e,{showMarkdownInPiTui:()=>a});var s=i(691),l=i(950),r=i(168);let h=!1;class n{constructor(t){const{terminal:e,tui:i,markdown:s,hintText:l,documentTitle:r,onClose:h}=t;this.terminal=e,this.tui=i,this._markdown=s,this.hintText=l,this.documentTitle=r?.trim()||"",this.onClose=h,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=Math.max(1,this.terminal.rows-!!this.documentTitle-1),s=Math.max(0,this._getFullLines(e).length-i);if((0,r.matchesKey)(t,"escape")||(0,r.matchesKey)(t,"esc")||(0,r.matchesKey)(t,"q")||(0,r.matchesKey)(t,"shift+q")||(0,r.matchesKey)(t,"ctrl+c")){this.clearGgPrefixState(),this.onClose();return}if((0,r.matchesKey)(t,"shift+g")){this.clearGgPrefixState(),this.scrollTop=s;return}if((0,r.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,r.matchesKey)(t,"up")||(0,r.matchesKey)(t,"k")){this.scrollTop=Math.max(0,this.scrollTop-1);return}if((0,r.matchesKey)(t,"down")||(0,r.matchesKey)(t,"j")){this.scrollTop=Math.min(s,this.scrollTop+1);return}if((0,r.matchesKey)(t,"pageUp")||(0,r.matchesKey)(t,"ctrl+u")){this.scrollTop=Math.max(0,this.scrollTop-i);return}if((0,r.matchesKey)(t,"pageDown")||(0,r.matchesKey)(t,"ctrl+d")){this.scrollTop=Math.min(s,this.scrollTop+i);return}if((0,r.matchesKey)(t,"home")){this.scrollTop=0;return}if((0,r.matchesKey)(t,"end")){this.scrollTop=s;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?[s.m.bold.cyan((0,r.truncateToWidth)(this.documentTitle,t))]:[],l=Math.max(1,e-i.length-1);null!=this._cachedWidth&&this._cachedWidth!==t&&this.invalidate();let h=this._getFullLines(t),n=Math.max(0,h.length-l);this.scrollTop=Math.min(this.scrollTop,n);let a=h.slice(this.scrollTop,this.scrollTop+l);for(;a.length<l;)a.push("");return[...i,...a,s.m.dim((0,r.truncateToWidth)(this.hintText,t))]}}async function a(t){let{markdown:e,t:i,documentTitle:s,tuiSession:a=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 o=a&&"function"==typeof a.suspendForReadline&&"function"==typeof a.resumeFromReadline;o&&a.suspendForReadline();try{h||((0,l.CK)("dark"),h=!0);let t=(0,l.pd)(),a=new r.Markdown(e,1,1,t),o=i("cli.resultPreviewTerminalHint"),c=new r.ProcessTerminal,m=new r.TUI(c);m.setClearOnShrink(!0),await new Promise(t=>{let e,i=new n({terminal:c,tui:m,markdown:a,hintText:o,documentTitle:s,onClose:()=>{e?.clearGgPrefixState(),m.stop(),t()}});e=i;let l=new r.Container;l.addChild(i),m.addChild(l),m.setFocus(i),m.start(),m.requestRender(!0)})}finally{o&&a.resumeFromReadline()}}}};