@prestyj/cli 4.3.15 → 4.3.34
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 +2 -2
- package/dist/cli.js +291 -25
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +39 -23
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +14 -2
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/auto-update.d.ts +16 -3
- package/dist/core/auto-update.d.ts.map +1 -1
- package/dist/core/auto-update.js +126 -56
- package/dist/core/auto-update.js.map +1 -1
- package/dist/core/auto-update.test.d.ts +2 -0
- package/dist/core/auto-update.test.d.ts.map +1 -0
- package/dist/core/auto-update.test.js +205 -0
- package/dist/core/auto-update.test.js.map +1 -0
- package/dist/core/compaction/compactor.d.ts +4 -0
- package/dist/core/compaction/compactor.d.ts.map +1 -1
- package/dist/core/compaction/compactor.js +13 -0
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/compaction/compactor.test.js +39 -6
- package/dist/core/compaction/compactor.test.js.map +1 -1
- package/dist/core/compaction/token-estimator.test.js +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +15 -2
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/prompt-commands.d.ts.map +1 -1
- package/dist/core/prompt-commands.js +134 -0
- package/dist/core/prompt-commands.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +3 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/modes/agent-home-mode.d.ts +21 -0
- package/dist/modes/agent-home-mode.d.ts.map +1 -0
- package/dist/modes/agent-home-mode.js +553 -0
- package/dist/modes/agent-home-mode.js.map +1 -0
- package/dist/system-prompt.d.ts.map +1 -1
- package/dist/system-prompt.js +74 -8
- package/dist/system-prompt.js.map +1 -1
- package/dist/tools/bash.js +1 -1
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/edit.d.ts +4 -2
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +48 -33
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/edit.test.js +80 -20
- package/dist/tools/edit.test.js.map +1 -1
- package/dist/tools/grep.d.ts.map +1 -1
- package/dist/tools/grep.js +12 -0
- package/dist/tools/grep.js.map +1 -1
- package/dist/tools/plan-mode.test.js +2 -2
- package/dist/tools/plan-mode.test.js.map +1 -1
- package/dist/tools/subagent.d.ts.map +1 -1
- package/dist/tools/subagent.js +20 -3
- package/dist/tools/subagent.js.map +1 -1
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +102 -48
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/ui/components/ActivityIndicator.js +0 -1
- package/dist/ui/components/ActivityIndicator.js.map +1 -1
- package/dist/ui/components/Footer.js +1 -1
- package/dist/ui/components/InputArea.js +2 -2
- package/dist/ui/components/InputArea.js.map +1 -1
- package/dist/ui/components/ModelSelector.d.ts.map +1 -1
- package/dist/ui/components/ModelSelector.js +1 -0
- package/dist/ui/components/ModelSelector.js.map +1 -1
- package/dist/ui/hooks/stall-retry-duplicate.test.d.ts +2 -0
- package/dist/ui/hooks/stall-retry-duplicate.test.d.ts.map +1 -0
- package/dist/ui/hooks/stall-retry-duplicate.test.js +94 -0
- package/dist/ui/hooks/stall-retry-duplicate.test.js.map +1 -0
- package/dist/ui/hooks/useAgentLoop.d.ts +1 -1
- package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentLoop.js +19 -0
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/login.d.ts.map +1 -1
- package/dist/ui/login.js +1 -0
- package/dist/ui/login.js.map +1 -1
- package/dist/ui/stores/create-store.d.ts +15 -0
- package/dist/ui/stores/create-store.d.ts.map +1 -0
- package/dist/ui/stores/create-store.js +30 -0
- package/dist/ui/stores/create-store.js.map +1 -0
- package/dist/ui/stores/index.d.ts +3 -0
- package/dist/ui/stores/index.d.ts.map +1 -0
- package/dist/ui/stores/index.js +3 -0
- package/dist/ui/stores/index.js.map +1 -0
- package/dist/ui/stores/taskbar-store.d.ts +19 -0
- package/dist/ui/stores/taskbar-store.d.ts.map +1 -0
- package/dist/ui/stores/taskbar-store.js +59 -0
- package/dist/ui/stores/taskbar-store.js.map +1 -0
- package/package.json +7 -5
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
import { createSignal } from "../utils/signal.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create a lightweight external store compatible with React's useSyncExternalStore.
|
|
5
|
+
* Uses createSignal for pub/sub and Object.freeze for snapshot immutability.
|
|
6
|
+
*/
|
|
7
|
+
export function createStore(initialState) {
|
|
8
|
+
const signal = createSignal();
|
|
9
|
+
let state = Object.freeze({ ...initialState });
|
|
10
|
+
return {
|
|
11
|
+
subscribe(cb) {
|
|
12
|
+
return signal.subscribe(cb);
|
|
13
|
+
},
|
|
14
|
+
getSnapshot() {
|
|
15
|
+
return state;
|
|
16
|
+
},
|
|
17
|
+
setState(update) {
|
|
18
|
+
const partial = typeof update === "function" ? update(state) : update;
|
|
19
|
+
state = Object.freeze({ ...state, ...partial });
|
|
20
|
+
signal.emit();
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* React hook for consuming a store. Triggers re-render when any state changes.
|
|
26
|
+
*/
|
|
27
|
+
export function useStore(store) {
|
|
28
|
+
return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=create-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-store.js","sourceRoot":"","sources":["../../../src/ui/stores/create-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAQlD;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAmB,YAAe;IAC3D,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,IAAI,KAAK,GAAM,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,YAAY,EAAE,CAAM,CAAC;IAEvD,OAAO;QACL,SAAS,CAAC,EAAc;YACtB,OAAO,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAC9B,CAAC;QACD,WAAW;YACT,OAAO,KAAK,CAAC;QACf,CAAC;QACD,QAAQ,CAAC,MAA8C;YACrD,MAAM,OAAO,GAAG,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YACtE,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE,CAAM,CAAC;YACrD,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAmB,KAAe;IACxD,OAAO,oBAAoB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createStore, useStore, type Store } from "./create-store.js";
|
|
2
|
+
export { taskBarStore, useTaskBarStore, useTaskBarPolling, focusTaskBar, exitTaskBar, expandTaskBar, collapseTaskBar, navigateTaskBar, killTask, } from "./taskbar-store.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,eAAe,EACf,eAAe,EACf,QAAQ,GACT,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAc,MAAM,mBAAmB,CAAC;AACtE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,eAAe,EACf,eAAe,EACf,QAAQ,GACT,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ProcessManager, BackgroundProcess } from "../../core/process-manager.js";
|
|
2
|
+
interface TaskBarState {
|
|
3
|
+
bgTasks: BackgroundProcess[];
|
|
4
|
+
focused: boolean;
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
selectedIndex: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const taskBarStore: import("./create-store.js").Store<TaskBarState>;
|
|
9
|
+
export declare function useTaskBarStore(): TaskBarState;
|
|
10
|
+
export declare function focusTaskBar(): void;
|
|
11
|
+
export declare function exitTaskBar(): void;
|
|
12
|
+
export declare function expandTaskBar(): void;
|
|
13
|
+
export declare function collapseTaskBar(): void;
|
|
14
|
+
export declare function navigateTaskBar(index: number): void;
|
|
15
|
+
export declare function killTask(pm: ProcessManager, id: string): void;
|
|
16
|
+
/** Poll ProcessManager every 2s and auto-manage panel state. */
|
|
17
|
+
export declare function useTaskBarPolling(pm: ProcessManager | undefined): void;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=taskbar-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskbar-store.d.ts","sourceRoot":"","sources":["../../../src/ui/stores/taskbar-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvF,UAAU,YAAY;IACpB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,iDAKvB,CAAC;AAEH,wBAAgB,eAAe,iBAE9B;AAID,wBAAgB,YAAY,SAK3B;AAED,wBAAgB,WAAW,SAE1B;AAED,wBAAgB,aAAa,SAE5B;AAED,wBAAgB,eAAe,SAE9B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,QAE5C;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,QAEtD;AAID,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,cAAc,GAAG,SAAS,QAuB/D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { createStore, useStore } from "./create-store.js";
|
|
3
|
+
export const taskBarStore = createStore({
|
|
4
|
+
bgTasks: [],
|
|
5
|
+
focused: false,
|
|
6
|
+
expanded: false,
|
|
7
|
+
selectedIndex: 0,
|
|
8
|
+
});
|
|
9
|
+
export function useTaskBarStore() {
|
|
10
|
+
return useStore(taskBarStore);
|
|
11
|
+
}
|
|
12
|
+
// ── Actions ──────────────────────────────────────────────
|
|
13
|
+
export function focusTaskBar() {
|
|
14
|
+
const { bgTasks } = taskBarStore.getSnapshot();
|
|
15
|
+
if (bgTasks.length > 0) {
|
|
16
|
+
taskBarStore.setState({ focused: true });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function exitTaskBar() {
|
|
20
|
+
taskBarStore.setState({ focused: false, expanded: false });
|
|
21
|
+
}
|
|
22
|
+
export function expandTaskBar() {
|
|
23
|
+
taskBarStore.setState({ expanded: true, selectedIndex: 0 });
|
|
24
|
+
}
|
|
25
|
+
export function collapseTaskBar() {
|
|
26
|
+
taskBarStore.setState({ expanded: false });
|
|
27
|
+
}
|
|
28
|
+
export function navigateTaskBar(index) {
|
|
29
|
+
taskBarStore.setState({ selectedIndex: index });
|
|
30
|
+
}
|
|
31
|
+
export function killTask(pm, id) {
|
|
32
|
+
pm.stop(id);
|
|
33
|
+
}
|
|
34
|
+
// ── Effects (call from component) ────────────────────────
|
|
35
|
+
/** Poll ProcessManager every 2s and auto-manage panel state. */
|
|
36
|
+
export function useTaskBarPolling(pm) {
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (!pm)
|
|
39
|
+
return;
|
|
40
|
+
const poll = () => {
|
|
41
|
+
const running = pm.list().filter((p) => p.exitCode === null);
|
|
42
|
+
const prev = taskBarStore.getSnapshot();
|
|
43
|
+
taskBarStore.setState({ bgTasks: running });
|
|
44
|
+
// Auto-exit when all tasks gone
|
|
45
|
+
if (running.length === 0 && (prev.focused || prev.expanded)) {
|
|
46
|
+
taskBarStore.setState({ focused: false, expanded: false });
|
|
47
|
+
}
|
|
48
|
+
// Clamp selected index
|
|
49
|
+
const maxIdx = Math.min(running.length, 5) - 1;
|
|
50
|
+
if (prev.selectedIndex > maxIdx && maxIdx >= 0) {
|
|
51
|
+
taskBarStore.setState({ selectedIndex: maxIdx });
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
poll();
|
|
55
|
+
const interval = setInterval(poll, 2000);
|
|
56
|
+
return () => clearInterval(interval);
|
|
57
|
+
}, [pm]);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=taskbar-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskbar-store.js","sourceRoot":"","sources":["../../../src/ui/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GED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prestyj/cli",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.34",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI coding agent with OAuth authentication for Anthropic and OpenAI",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@huggingface/transformers": "^3.6.0",
|
|
26
25
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
27
26
|
"chalk": "^5.6.2",
|
|
28
27
|
"cli-highlight": "^2.1.11",
|
|
@@ -31,15 +30,18 @@
|
|
|
31
30
|
"ignore": "^7.0.5",
|
|
32
31
|
"ink": "^6.8.0",
|
|
33
32
|
"marked": "^15.0.12",
|
|
34
|
-
"ogg-opus-decoder": "^1.6.13",
|
|
35
33
|
"marked-terminal": "^7.3.0",
|
|
36
34
|
"react": "^19.2.4",
|
|
37
35
|
"sharp": "^0.34.5",
|
|
38
36
|
"string-width": "^8.2.0",
|
|
39
37
|
"wrap-ansi": "^10.0.0",
|
|
40
38
|
"zod": "^4.3.6",
|
|
41
|
-
"@prestyj/agent": "4.3.
|
|
42
|
-
"@prestyj/ai": "4.3.
|
|
39
|
+
"@prestyj/agent": "4.3.34",
|
|
40
|
+
"@prestyj/ai": "4.3.34"
|
|
41
|
+
},
|
|
42
|
+
"optionalDependencies": {
|
|
43
|
+
"@huggingface/transformers": "^3.6.0",
|
|
44
|
+
"ogg-opus-decoder": "^1.6.13"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
|
45
47
|
"@types/node": "^25.5.0",
|