jinzd-ai-cli 0.4.21 → 0.4.23

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.
@@ -7,7 +7,7 @@ import {
7
7
  ProviderNotFoundError,
8
8
  RateLimitError,
9
9
  schemaToJsonSchema
10
- } from "./chunk-2JOMWVTE.js";
10
+ } from "./chunk-PDVX5QJA.js";
11
11
  import {
12
12
  APP_NAME,
13
13
  CONFIG_DIR_NAME,
@@ -20,7 +20,7 @@ import {
20
20
  MCP_TOOL_PREFIX,
21
21
  PLUGINS_DIR_NAME,
22
22
  VERSION
23
- } from "./chunk-AR656G5C.js";
23
+ } from "./chunk-UA4BVWKV.js";
24
24
 
25
25
  // src/config/config-manager.ts
26
26
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -6,7 +6,7 @@ import {
6
6
  SUBAGENT_DEFAULT_MAX_ROUNDS,
7
7
  SUBAGENT_MAX_ROUNDS_LIMIT,
8
8
  runTestsTool
9
- } from "./chunk-AR656G5C.js";
9
+ } from "./chunk-UA4BVWKV.js";
10
10
 
11
11
  // src/tools/builtin/bash.ts
12
12
  import { execSync } from "child_process";
@@ -8,7 +8,7 @@ import { platform } from "os";
8
8
  import chalk from "chalk";
9
9
 
10
10
  // src/core/constants.ts
11
- var VERSION = "0.4.21";
11
+ var VERSION = "0.4.23";
12
12
  var APP_NAME = "ai-cli";
13
13
  var CONFIG_DIR_NAME = ".aicli";
14
14
  var CONFIG_FILE_NAME = "config.json";
@@ -6,7 +6,7 @@ import { platform } from "os";
6
6
  import chalk from "chalk";
7
7
 
8
8
  // src/core/constants.ts
9
- var VERSION = "0.4.21";
9
+ var VERSION = "0.4.23";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -387,7 +387,7 @@ ${content}`);
387
387
  }
388
388
  }
389
389
  async function runTaskMode(config, providers, configManager, topic) {
390
- const { TaskOrchestrator } = await import("./task-orchestrator-UZQRB7AO.js");
390
+ const { TaskOrchestrator } = await import("./task-orchestrator-C472QXTJ.js");
391
391
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
392
392
  let interrupted = false;
393
393
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  saveDevState,
24
24
  sessionHasMeaningfulContent,
25
25
  setupProxy
26
- } from "./chunk-7T2W4LN3.js";
26
+ } from "./chunk-GBMVHLPA.js";
27
27
  import {
28
28
  ToolRegistry,
29
29
  askUserContext,
@@ -38,7 +38,7 @@ import {
38
38
  theme,
39
39
  truncateOutput,
40
40
  undoStack
41
- } from "./chunk-2JOMWVTE.js";
41
+ } from "./chunk-PDVX5QJA.js";
42
42
  import {
43
43
  AGENTIC_BEHAVIOR_GUIDELINE,
44
44
  AUTHOR,
@@ -59,7 +59,7 @@ import {
59
59
  SKILLS_DIR_NAME,
60
60
  VERSION,
61
61
  buildUserIdentityPrompt
62
- } from "./chunk-AR656G5C.js";
62
+ } from "./chunk-UA4BVWKV.js";
63
63
 
64
64
  // src/index.ts
65
65
  import { program } from "commander";
@@ -1944,7 +1944,7 @@ ${hint}` : "")
1944
1944
  usage: "/test [command|filter]",
1945
1945
  async execute(args, ctx) {
1946
1946
  try {
1947
- const { executeTests } = await import("./run-tests-ZTVEN2O7.js");
1947
+ const { executeTests } = await import("./run-tests-7ZBI4ZTU.js");
1948
1948
  const argStr = args.join(" ").trim();
1949
1949
  let testArgs = {};
1950
1950
  if (argStr) {
@@ -5691,7 +5691,7 @@ program.command("web").description("Start Web UI server with browser-based chat
5691
5691
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
5692
5692
  process.exit(1);
5693
5693
  }
5694
- const { startWebServer } = await import("./server-IDPMZAUF.js");
5694
+ const { startWebServer } = await import("./server-SD5ICBFP.js");
5695
5695
  await startWebServer({ port, host: options.host });
5696
5696
  });
5697
5697
  program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
@@ -5924,7 +5924,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
5924
5924
  }),
5925
5925
  config.get("customProviders")
5926
5926
  );
5927
- const { startHub } = await import("./hub-CNSFX47B.js");
5927
+ const { startHub } = await import("./hub-YN245LMP.js");
5928
5928
  await startHub(
5929
5929
  {
5930
5930
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-6CJX3RST.js";
4
+ } from "./chunk-XMTMCMAP.js";
5
5
  export {
6
6
  executeTests,
7
7
  runTestsTool
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-AR656G5C.js";
5
+ } from "./chunk-UA4BVWKV.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -18,7 +18,7 @@ import {
18
18
  renderDiff,
19
19
  runHook,
20
20
  setupProxy
21
- } from "./chunk-7T2W4LN3.js";
21
+ } from "./chunk-GBMVHLPA.js";
22
22
  import {
23
23
  AuthManager
24
24
  } from "./chunk-BYNY5JPB.js";
@@ -32,7 +32,7 @@ import {
32
32
  spawnAgentContext,
33
33
  truncateOutput,
34
34
  undoStack
35
- } from "./chunk-2JOMWVTE.js";
35
+ } from "./chunk-PDVX5QJA.js";
36
36
  import {
37
37
  AGENTIC_BEHAVIOR_GUIDELINE,
38
38
  AUTHOR,
@@ -50,7 +50,7 @@ import {
50
50
  SKILLS_DIR_NAME,
51
51
  VERSION,
52
52
  buildUserIdentityPrompt
53
- } from "./chunk-AR656G5C.js";
53
+ } from "./chunk-UA4BVWKV.js";
54
54
 
55
55
  // src/web/server.ts
56
56
  import express from "express";
@@ -1090,8 +1090,26 @@ Tokens: in=${this.sessionTokenUsage.inputTokens} out=${this.sessionTokenUsage.ou
1090
1090
  }
1091
1091
  this.send({ type: "info", message: `Deleted ${deleted} session(s).` });
1092
1092
  this.sendSessionList();
1093
+ } else if (sub === "rename" && args[1] && args.length >= 3) {
1094
+ const targetId = args[1];
1095
+ const newTitle = args.slice(2).join(" ").trim();
1096
+ if (!newTitle) {
1097
+ this.send({ type: "error", message: "Title cannot be empty." });
1098
+ break;
1099
+ }
1100
+ const list = this.sessions.listSessions();
1101
+ const found = list.find((s) => s.id.startsWith(targetId));
1102
+ if (found) {
1103
+ const session = this.sessions.loadSession(found.id);
1104
+ session.title = newTitle;
1105
+ this.sessions.save();
1106
+ this.send({ type: "info", message: `Renamed session: "${newTitle}"` });
1107
+ this.sendSessionList();
1108
+ } else {
1109
+ this.send({ type: "error", message: `Session not found: ${targetId}` });
1110
+ }
1093
1111
  } else {
1094
- this.send({ type: "info", message: "Usage: /session new | list | load <id> | delete <id>" });
1112
+ this.send({ type: "info", message: "Usage: /session new | list | load <id> | delete <id> | rename <id> <title>" });
1095
1113
  }
1096
1114
  break;
1097
1115
  }
@@ -1498,7 +1516,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
1498
1516
  case "test": {
1499
1517
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
1500
1518
  try {
1501
- const { executeTests } = await import("./run-tests-ZTVEN2O7.js");
1519
+ const { executeTests } = await import("./run-tests-7ZBI4ZTU.js");
1502
1520
  const argStr = args.join(" ").trim();
1503
1521
  let testArgs = {};
1504
1522
  if (argStr) {
@@ -4,10 +4,10 @@ import {
4
4
  getDangerLevel,
5
5
  googleSearchContext,
6
6
  truncateOutput
7
- } from "./chunk-2JOMWVTE.js";
7
+ } from "./chunk-PDVX5QJA.js";
8
8
  import {
9
9
  SUBAGENT_ALLOWED_TOOLS
10
- } from "./chunk-AR656G5C.js";
10
+ } from "./chunk-UA4BVWKV.js";
11
11
 
12
12
  // src/hub/task-orchestrator.ts
13
13
  import { createInterface } from "readline";
@@ -785,7 +785,7 @@ function renderFilteredSessions(filter) {
785
785
  // Click to load session (only in normal mode)
786
786
  sessionListEl.querySelectorAll('.session-item').forEach(el => {
787
787
  el.addEventListener('click', (e) => {
788
- if (e.target.closest('.session-delete-btn') || e.target.closest('.session-batch-cb')) return;
788
+ if (e.target.closest('.session-delete-btn') || e.target.closest('.session-batch-cb') || e.target.closest('.session-rename-input')) return;
789
789
  if (batchSelectMode) {
790
790
  // In batch mode, clicking the row toggles the checkbox
791
791
  const cb = el.querySelector('.session-batch-cb');
@@ -796,6 +796,17 @@ function renderFilteredSessions(filter) {
796
796
  if (!id) return;
797
797
  send({ type: 'command', name: 'session', args: ['load', id] });
798
798
  });
799
+
800
+ // Double-click session title to rename
801
+ if (!batchSelectMode) {
802
+ const titleEl = el.querySelector('.session-title');
803
+ if (titleEl) {
804
+ titleEl.addEventListener('dblclick', (e) => {
805
+ e.stopPropagation();
806
+ startSessionRename(el, titleEl);
807
+ });
808
+ }
809
+ }
799
810
  });
800
811
 
801
812
  // Checkbox change in batch mode
@@ -822,6 +833,43 @@ function renderFilteredSessions(filter) {
822
833
  }
823
834
  }
824
835
 
836
+ function startSessionRename(itemEl, titleEl) {
837
+ const sessionId = itemEl.dataset.sessionId;
838
+ const currentTitle = titleEl.textContent.trim();
839
+ const input = document.createElement('input');
840
+ input.type = 'text';
841
+ input.value = currentTitle;
842
+ input.className = 'input input-xs input-bordered session-rename-input w-full';
843
+ input.style.fontSize = '0.85rem';
844
+
845
+ titleEl.replaceWith(input);
846
+ input.focus();
847
+ input.select();
848
+
849
+ function commit() {
850
+ const newTitle = input.value.trim();
851
+ if (newTitle && newTitle !== currentTitle) {
852
+ send({ type: 'command', name: 'session', args: ['rename', sessionId, newTitle] });
853
+ } else {
854
+ // Restore original title without server round-trip
855
+ const span = document.createElement('div');
856
+ span.className = 'session-title flex-1';
857
+ span.textContent = currentTitle;
858
+ input.replaceWith(span);
859
+ span.addEventListener('dblclick', (e) => {
860
+ e.stopPropagation();
861
+ startSessionRename(itemEl, span);
862
+ });
863
+ }
864
+ }
865
+
866
+ input.addEventListener('blur', commit);
867
+ input.addEventListener('keydown', (e) => {
868
+ if (e.key === 'Enter') { e.preventDefault(); input.blur(); }
869
+ if (e.key === 'Escape') { input.value = currentTitle; input.blur(); }
870
+ });
871
+ }
872
+
825
873
  function toggleBatchSelect() {
826
874
  batchSelectMode = !batchSelectMode;
827
875
  batchSelectedIds.clear();
@@ -1930,6 +1978,49 @@ function handleLogout() {
1930
1978
  if (ws) ws.close();
1931
1979
  }
1932
1980
 
1981
+ // ── Sidebar resize (drag to adjust width) ────────────────────────────
1982
+
1983
+ {
1984
+ const resizeHandle = document.getElementById('sidebar-resize');
1985
+ const MIN_WIDTH = 160;
1986
+ const MAX_WIDTH = 600;
1987
+ const STORAGE_KEY = 'aicli-sidebar-width';
1988
+
1989
+ // Restore saved width
1990
+ const savedWidth = parseInt(localStorage.getItem(STORAGE_KEY), 10);
1991
+ if (savedWidth && savedWidth >= MIN_WIDTH && savedWidth <= MAX_WIDTH) {
1992
+ sidebar.style.width = savedWidth + 'px';
1993
+ }
1994
+
1995
+ let isResizing = false;
1996
+
1997
+ resizeHandle.addEventListener('mousedown', (e) => {
1998
+ if (window.innerWidth <= 768) return; // Disabled on mobile
1999
+ e.preventDefault();
2000
+ isResizing = true;
2001
+ sidebar.classList.add('no-transition');
2002
+ resizeHandle.classList.add('resizing');
2003
+ document.body.style.cursor = 'col-resize';
2004
+ document.body.style.userSelect = 'none';
2005
+ });
2006
+
2007
+ document.addEventListener('mousemove', (e) => {
2008
+ if (!isResizing) return;
2009
+ const newWidth = Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, e.clientX));
2010
+ sidebar.style.width = newWidth + 'px';
2011
+ });
2012
+
2013
+ document.addEventListener('mouseup', () => {
2014
+ if (!isResizing) return;
2015
+ isResizing = false;
2016
+ sidebar.classList.remove('no-transition');
2017
+ resizeHandle.classList.remove('resizing');
2018
+ document.body.style.cursor = '';
2019
+ document.body.style.userSelect = '';
2020
+ localStorage.setItem(STORAGE_KEY, parseInt(sidebar.style.width, 10));
2021
+ });
2022
+ }
2023
+
1933
2024
  // ── Enable Auth (register first user from Web UI) ────────────────────
1934
2025
 
1935
2026
  async function checkAuthStatus() {
@@ -147,6 +147,8 @@
147
147
  </div>
148
148
  </div>
149
149
  </aside>
150
+ <!-- Sidebar resize handle -->
151
+ <div id="sidebar-resize" class="sidebar-resize-handle" title="Drag to resize sidebar"></div>
150
152
  <!-- Sidebar backdrop (mobile overlay) -->
151
153
  <div id="sidebar-backdrop" class="sidebar-backdrop hidden" onclick="closeSidebar()"></div>
152
154
 
@@ -274,11 +274,37 @@
274
274
  color: oklch(var(--p));
275
275
  }
276
276
 
277
+ /* ── Sidebar resize handle ─────────────────────────── */
278
+ .sidebar-resize-handle {
279
+ width: 4px;
280
+ cursor: col-resize;
281
+ flex-shrink: 0;
282
+ background: transparent;
283
+ transition: background 0.15s;
284
+ position: relative;
285
+ z-index: 5;
286
+ }
287
+ .sidebar-resize-handle::after {
288
+ content: '';
289
+ position: absolute;
290
+ top: 0;
291
+ left: -3px;
292
+ right: -3px;
293
+ bottom: 0;
294
+ }
295
+ .sidebar-resize-handle:hover,
296
+ .sidebar-resize-handle.resizing {
297
+ background: oklch(var(--p) / 0.4);
298
+ }
299
+
277
300
  /* ── Sidebar ───────────────────────────────────────── */
278
301
  .sidebar {
279
302
  width: 18rem;
280
303
  transition: width 0.2s ease;
281
304
  }
305
+ .sidebar.no-transition {
306
+ transition: none;
307
+ }
282
308
  .sidebar .session-item {
283
309
  padding: 0.5rem 0.6rem;
284
310
  border-radius: 0.375rem;
@@ -298,6 +324,12 @@
298
324
  overflow: hidden;
299
325
  text-overflow: ellipsis;
300
326
  font-size: 0.85rem;
327
+ cursor: text;
328
+ }
329
+ .sidebar .session-item .session-rename-input {
330
+ height: 1.5rem;
331
+ min-height: 1.5rem;
332
+ padding: 0 0.4rem;
301
333
  }
302
334
  .sidebar .session-item .session-meta {
303
335
  font-size: 0.7rem;
@@ -612,6 +644,7 @@ button, a, .session-item, .file-tree-row, .template-item, .tool-item, .mcp-serve
612
644
  /* ── Responsive: Tablet ────────────────────────────── */
613
645
  @media (max-width: 768px) {
614
646
  .sidebar-toggle-btn { display: flex; }
647
+ .sidebar-resize-handle { display: none; }
615
648
  .sidebar {
616
649
  width: 0;
617
650
  padding: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.21",
3
+ "version": "0.4.23",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",