@pentoshi/clai 3.11.15 → 3.11.17
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/bin/postinstall.mjs +93 -0
- package/dist/tui-v2/components/transcript/thinking-block.d.ts +3 -6
- package/dist/tui-v2/components/transcript/thinking-block.js +6 -7
- package/dist/tui-v2/components/transcript/thinking-block.js.map +1 -1
- package/dist/version.generated.d.ts +2 -2
- package/dist/version.generated.js +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Postinstall script for @pentoshi/clai.
|
|
4
|
+
* Automatically checks for Bun (required by OpenTUI) and installs it into
|
|
5
|
+
* ~/.clai/bin/bun across Linux, macOS, and Windows if missing.
|
|
6
|
+
*/
|
|
7
|
+
import { spawnSync } from "node:child_process";
|
|
8
|
+
import { accessSync, chmodSync, constants, existsSync, mkdirSync } from "node:fs";
|
|
9
|
+
import { homedir } from "node:os";
|
|
10
|
+
import { delimiter, join } from "node:path";
|
|
11
|
+
|
|
12
|
+
function findBun() {
|
|
13
|
+
const binName = process.platform === "win32" ? "bun.exe" : "bun";
|
|
14
|
+
const fromEnv = process.env.BUN_INSTALL
|
|
15
|
+
? join(process.env.BUN_INSTALL, "bin", binName)
|
|
16
|
+
: undefined;
|
|
17
|
+
const targetDir = join(homedir(), ".clai");
|
|
18
|
+
const candidates = [
|
|
19
|
+
fromEnv,
|
|
20
|
+
join(targetDir, "bin", binName),
|
|
21
|
+
join(homedir(), ".bun", "bin", binName),
|
|
22
|
+
...(process.env.PATH ?? "")
|
|
23
|
+
.split(delimiter)
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.map((dir) => join(dir, binName)),
|
|
26
|
+
].filter(Boolean);
|
|
27
|
+
|
|
28
|
+
const checkMode = process.platform === "win32" ? constants.F_OK : constants.X_OK;
|
|
29
|
+
|
|
30
|
+
for (const path of candidates) {
|
|
31
|
+
try {
|
|
32
|
+
accessSync(path, checkMode);
|
|
33
|
+
return path;
|
|
34
|
+
} catch {
|
|
35
|
+
// try next
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!findBun() && process.env.CLAI_NO_BUN_AUTO_INSTALL !== "1") {
|
|
42
|
+
const targetDir = join(homedir(), ".clai");
|
|
43
|
+
const binName = process.platform === "win32" ? "bun.exe" : "bun";
|
|
44
|
+
const targetBin = join(targetDir, "bin", binName);
|
|
45
|
+
|
|
46
|
+
mkdirSync(join(targetDir, "bin"), { recursive: true });
|
|
47
|
+
|
|
48
|
+
const env = {
|
|
49
|
+
...process.env,
|
|
50
|
+
BUN_INSTALL: targetDir,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
console.log("Setting up Bun runtime for OpenTUI (~/.clai/bin)...");
|
|
54
|
+
try {
|
|
55
|
+
if (process.platform === "win32") {
|
|
56
|
+
spawnSync(
|
|
57
|
+
"powershell",
|
|
58
|
+
[
|
|
59
|
+
"-NoProfile",
|
|
60
|
+
"-ExecutionPolicy",
|
|
61
|
+
"Bypass",
|
|
62
|
+
"-Command",
|
|
63
|
+
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; irm https://bun.sh/install.ps1 | iex",
|
|
64
|
+
],
|
|
65
|
+
{ env, stdio: "inherit", windowsHide: true },
|
|
66
|
+
);
|
|
67
|
+
} else {
|
|
68
|
+
const res = spawnSync(
|
|
69
|
+
"sh",
|
|
70
|
+
["-c", "curl -fsSL https://bun.sh/install | bash"],
|
|
71
|
+
{ env, stdio: "inherit" },
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
if (res.status !== 0) {
|
|
75
|
+
spawnSync(
|
|
76
|
+
"sh",
|
|
77
|
+
["-c", "wget -qO- https://bun.sh/install | bash"],
|
|
78
|
+
{ env, stdio: "inherit" },
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (existsSync(targetBin) && process.platform !== "win32") {
|
|
84
|
+
try {
|
|
85
|
+
chmodSync(targetBin, 0o755);
|
|
86
|
+
} catch {
|
|
87
|
+
// ignore
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
} catch (err) {
|
|
91
|
+
console.warn("Notice: Automatic Bun setup skipped or failed:", err?.message || err);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -3,12 +3,9 @@
|
|
|
3
3
|
* Renders a `ThinkingItem` (CHAT-006, V2-053).
|
|
4
4
|
*
|
|
5
5
|
* Live stream: while the model is still reasoning (`item.streaming`), the body
|
|
6
|
-
* is shown
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* verbatim contradicts an explicit `/variants off`. After the block is
|
|
10
|
-
* finalized, the body follows the global Ctrl+T toggle (or a per-block
|
|
11
|
-
* override from clicking the header).
|
|
6
|
+
* is always shown so the user sees live progress — regardless of the global
|
|
7
|
+
* thinking toggle (Ctrl+T). After the block is finalized, the body follows the
|
|
8
|
+
* global Ctrl+T toggle (or a per-block override from clicking the header).
|
|
12
9
|
*
|
|
13
10
|
* Placement: thinking rows always precede the ◆ Response / tool cards for
|
|
14
11
|
* the same model step (agent emits thinking-block before assistant-message
|
|
@@ -4,12 +4,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
|
4
4
|
* Renders a `ThinkingItem` (CHAT-006, V2-053).
|
|
5
5
|
*
|
|
6
6
|
* Live stream: while the model is still reasoning (`item.streaming`), the body
|
|
7
|
-
* is shown
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* verbatim contradicts an explicit `/variants off`. After the block is
|
|
11
|
-
* finalized, the body follows the global Ctrl+T toggle (or a per-block
|
|
12
|
-
* override from clicking the header).
|
|
7
|
+
* is always shown so the user sees live progress — regardless of the global
|
|
8
|
+
* thinking toggle (Ctrl+T). After the block is finalized, the body follows the
|
|
9
|
+
* global Ctrl+T toggle (or a per-block override from clicking the header).
|
|
13
10
|
*
|
|
14
11
|
* Placement: thinking rows always precede the ◆ Response / tool cards for
|
|
15
12
|
* the same model step (agent emits thinking-block before assistant-message
|
|
@@ -27,7 +24,9 @@ const BODY_INDENT = 2;
|
|
|
27
24
|
export function ThinkingBlock(props) {
|
|
28
25
|
const { item, theme, expanded, liveBody = true, contentWidth, onToggle } = props;
|
|
29
26
|
const { width: termWidth } = useTerminalDimensions();
|
|
30
|
-
|
|
27
|
+
// Always show reasoning while it streams so the user sees live progress,
|
|
28
|
+
// then collapse once the block is finalized if thinking is toggled off.
|
|
29
|
+
const showBody = expanded || item.streaming;
|
|
31
30
|
const onMouseUp = (event) => {
|
|
32
31
|
event.preventDefault();
|
|
33
32
|
// Only allow collapse/expand once the block is complete.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinking-block.js","sourceRoot":"","sources":["../../../../src/tui-v2/components/transcript/thinking-block.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC
|
|
1
|
+
{"version":3,"file":"thinking-block.js","sourceRoot":"","sources":["../../../../src/tui-v2/components/transcript/thinking-block.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,cAAc,EAAmB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,wDAAwD;AACxD,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,MAAM,UAAU,aAAa,CAAC,KAY7B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,UAAU,CAAC;wBACvC,KAAK,EAAE,SAAS;wBAChB,EAAE,EAAE,KAAK,CAAC,QAAQ;wBAClB,UAAU,EAAE,cAAc,CAAC,MAAM;qBAClC,IATI,KAAK,CAUV,CACH,CAAC,GACE,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* AUTO-GENERATED by scripts/sync-version.mjs — do not edit by hand.
|
|
3
3
|
* Source of truth: package.json "version".
|
|
4
4
|
*/
|
|
5
|
-
export declare const VERSION: "3.11.
|
|
6
|
-
export declare const VERSION_TAG: "v3.11.
|
|
5
|
+
export declare const VERSION: "3.11.17";
|
|
6
|
+
export declare const VERSION_TAG: "v3.11.17";
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* AUTO-GENERATED by scripts/sync-version.mjs — do not edit by hand.
|
|
3
3
|
* Source of truth: package.json "version".
|
|
4
4
|
*/
|
|
5
|
-
export const VERSION = "3.11.
|
|
6
|
-
export const VERSION_TAG = "v3.11.
|
|
5
|
+
export const VERSION = "3.11.17";
|
|
6
|
+
export const VERSION_TAG = "v3.11.17";
|
|
7
7
|
//# sourceMappingURL=version.generated.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pentoshi/clai",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.17",
|
|
4
4
|
"description": "A fast, cross-platform AI CLI assistant with ask and agent modes for shell tasks, file operations, and cybersecurity workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"prepublishOnly": "npm run build",
|
|
47
47
|
"precompile": "node scripts/sync-version.mjs",
|
|
48
48
|
"compile": "node scripts/embed-prompts.mjs && bun run scripts/build.ts",
|
|
49
|
-
"postinstall": "node
|
|
49
|
+
"postinstall": "node bin/postinstall.mjs",
|
|
50
50
|
"install:opentui-platforms": "node scripts/install-opentui-platforms.mjs",
|
|
51
51
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
52
52
|
"pretest": "node scripts/sync-version.mjs",
|