@openlucaskaka/kagent 0.1.7 → 0.1.8

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/npm/lib/App.js CHANGED
@@ -144,6 +144,7 @@ function KagentInkApp({ React, Ink, runtimeSessionFactory = runtime_client_1.cre
144
144
  const pagingLayout = (0, ui_components_1.createTerminalLayout)(terminalSize.columns, terminalSize.rows, {
145
145
  approval: approval !== null,
146
146
  commandMenu: status === "idle" && commandMenu ? commandMenu : false,
147
+ introVisible: transcript.entries.length === 0,
147
148
  prompt: editor.value,
148
149
  promptCursor: editor.cursor,
149
150
  });
@@ -255,6 +256,7 @@ function KagentInkApp({ React, Ink, runtimeSessionFactory = runtime_client_1.cre
255
256
  const promptLayout = (0, ui_components_1.createTerminalLayout)(terminalSize.columns, terminalSize.rows, {
256
257
  approval: approval !== null,
257
258
  commandMenu: false,
259
+ introVisible: transcript.entries.length === 0,
258
260
  prompt: editor.value,
259
261
  promptCursor: editor.cursor,
260
262
  });
@@ -448,6 +450,7 @@ function KagentInkApp({ React, Ink, runtimeSessionFactory = runtime_client_1.cre
448
450
  ? { ...approval, showDetails: showApprovalDetails }
449
451
  : false,
450
452
  commandMenu: status === "idle" && commandMenu ? commandMenu : false,
453
+ introVisible: transcript.entries.length === 0,
451
454
  prompt: editor.value,
452
455
  promptCursor: editor.cursor,
453
456
  });
@@ -459,15 +462,17 @@ function KagentInkApp({ React, Ink, runtimeSessionFactory = runtime_client_1.cre
459
462
  rows: layout.rows,
460
463
  reservedRows: layout.reservedRows + (transcriptOffset > 0 ? 1 : 0),
461
464
  }, transcriptOffset);
462
- return React.createElement(Box, { flexDirection: "column", paddingX: layout.horizontalPadding }, React.createElement(ui_components_1.Header, {
463
- React,
464
- Box,
465
- Text,
466
- compact: layout.compact,
467
- provider,
468
- setup: false,
469
- workspace: process.cwd(),
470
- }), React.createElement(ui_components_1.TranscriptPosition, {
465
+ return React.createElement(Box, { flexDirection: "column", paddingX: layout.horizontalPadding }, transcript.entries.length === 0
466
+ ? React.createElement(ui_components_1.Header, {
467
+ React,
468
+ Box,
469
+ Text,
470
+ compact: layout.compact,
471
+ provider,
472
+ setup: false,
473
+ workspace: process.cwd(),
474
+ })
475
+ : null, React.createElement(ui_components_1.TranscriptPosition, {
471
476
  React,
472
477
  Text,
473
478
  newerCount: transcriptOffset,
@@ -144,6 +144,7 @@ function selectTranscriptViewport(entries, viewport, offset = 0) {
144
144
  usedRows += rows;
145
145
  start = index;
146
146
  }
147
+ start = avoidOrphanedLeadingAssistant(entries, start, end, usedRows, availableRows, viewport.columns);
147
148
  return entries.slice(start, end);
148
149
  }
149
150
  function moveTranscriptViewport(entries, viewport, offset, direction) {
@@ -216,6 +217,22 @@ function retain(state) {
216
217
  : null;
217
218
  return { ...state, entries, activeAssistantId };
218
219
  }
220
+ function avoidOrphanedLeadingAssistant(entries, start, end, usedRows, availableRows, columns) {
221
+ let nextStart = start;
222
+ let nextUsedRows = usedRows;
223
+ while (nextStart > 0 &&
224
+ nextStart < end - 1 &&
225
+ entries[nextStart].role === "assistant" &&
226
+ entries[nextStart - 1].role === "user") {
227
+ const userRows = estimateEntryRows(entries[nextStart - 1], columns);
228
+ if (nextUsedRows + userRows <= availableRows) {
229
+ return nextStart - 1;
230
+ }
231
+ nextUsedRows -= estimateEntryRows(entries[nextStart], columns);
232
+ nextStart += 1;
233
+ }
234
+ return nextStart;
235
+ }
219
236
  function estimateEntryRows(entry, columns) {
220
237
  const contentColumns = Math.max(4, columns - 4);
221
238
  const titleRows = entry.title ? (0, terminal_width_1.estimateTextRows)(entry.title, contentColumns) : 0;
@@ -24,7 +24,7 @@ function createTerminalLayout(columns, rows, overlays) {
24
24
  const compact = safeColumns < 56;
25
25
  const horizontalPadding = compact ? 0 : 1;
26
26
  const defaultCommandLimit = compact ? 4 : 6;
27
- const headerRows = compact ? 2 : 3;
27
+ const headerRows = overlays.introVisible === false ? 0 : compact ? 2 : 3;
28
28
  const promptChromeRows = 1;
29
29
  const fixedBaseRows = headerRows + promptChromeRows;
30
30
  const approvalColumns = Math.max(4, safeColumns - horizontalPadding * 2 - (compact ? 0 : 2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openlucaskaka/kagent",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Codex-style LangGraph agent runtime for internal non-coding workflows.",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "kagent"
7
- version = "0.1.7"
7
+ version = "0.1.8"
8
8
  description = "A bounded kagent built with LangGraph."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -22,7 +22,7 @@ def _source_tree_version() -> str:
22
22
  try:
23
23
  __version__ = _source_tree_version() or version("kagent")
24
24
  except PackageNotFoundError:
25
- __version__ = "0.1.7"
25
+ __version__ = "0.1.8"
26
26
 
27
27
  __all__ = [
28
28
  "AgentConfig",
@@ -42,7 +42,7 @@ def service_openapi() -> Dict[str, Any]:
42
42
  "openapi": "3.1.0",
43
43
  "info": {
44
44
  "title": "kagent API",
45
- "version": "0.1.7",
45
+ "version": "0.1.8",
46
46
  },
47
47
  "components": {
48
48
  "securitySchemes": {