koneck 2.25.49 → 2.25.51
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/dist/compressor.d.ts +45 -0
- package/dist/compressor.d.ts.map +1 -1
- package/dist/compressor.js +96 -9
- package/dist/compressor.js.map +1 -1
- package/dist/glyphs.d.ts +2 -0
- package/dist/glyphs.d.ts.map +1 -1
- package/dist/glyphs.js +2 -0
- package/dist/glyphs.js.map +1 -1
- package/dist/ink-chat.d.ts.map +1 -1
- package/dist/ink-chat.js +2 -1
- package/dist/ink-chat.js.map +1 -1
- package/dist/logo.d.ts +26 -0
- package/dist/logo.d.ts.map +1 -0
- package/dist/logo.js +46 -0
- package/dist/logo.js.map +1 -0
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +15 -4
- package/dist/tui.js.map +1 -1
- package/package.json +1 -1
package/dist/compressor.d.ts
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
import type OpenAI from 'openai';
|
|
2
2
|
import type { Message } from './types.js';
|
|
3
3
|
declare function estimateTokens(messages: Message[]): number;
|
|
4
|
+
/**
|
|
5
|
+
* How many tool calls are still unanswered at each point in the history.
|
|
6
|
+
*
|
|
7
|
+
* An assistant message contributes one for every tool call it makes; each `tool` result answers
|
|
8
|
+
* one. A cut is only safe where the count is zero — anywhere else leaves a result whose call was
|
|
9
|
+
* summarised away, and the API rejects an orphaned tool result outright rather than degrading.
|
|
10
|
+
*
|
|
11
|
+
* Taken from the DeepSeek Harness, which validates compaction edges by this balance rather than
|
|
12
|
+
* by looking at message roles. The role heuristic this replaces walked back over `tool` messages
|
|
13
|
+
* and then returned its floor regardless — so when the walk ran out of room it produced exactly
|
|
14
|
+
* the orphan it existed to prevent, and it could not see a batch of calls at all.
|
|
15
|
+
*/
|
|
16
|
+
export declare function unansweredToolCalls(messages: readonly Message[], upTo: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* Which cut positions are balanced, in one pass.
|
|
19
|
+
*
|
|
20
|
+
* `balanced[i]` answers "may the history be cut immediately before message i". The whole array is
|
|
21
|
+
* folded once rather than recomputed per candidate, which is how the harness does it: searching
|
|
22
|
+
* backwards while recounting from zero each time is quadratic, and a long session is exactly
|
|
23
|
+
* where compaction runs.
|
|
24
|
+
*
|
|
25
|
+
* A count that goes negative means a result arrived with no call to answer — corrupt history
|
|
26
|
+
* rather than a tight squeeze — so every later position is treated as unsafe instead of the
|
|
27
|
+
* arithmetic wrapping back to zero and offering a cut in the middle of the damage.
|
|
28
|
+
*/
|
|
29
|
+
export declare function toolPairingBalance(messages: readonly Message[]): boolean[];
|
|
30
|
+
/** Whether the history may be cut immediately before message `index`. */
|
|
31
|
+
export declare function toolPairingBalancedBefore(messages: readonly Message[], index: number): boolean;
|
|
32
|
+
/** Whether the history may be cut immediately after message `index`. */
|
|
33
|
+
export declare function toolPairingBalancedAfter(messages: readonly Message[], index: number): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The latest safe cut at or before `from`, or null if there is none.
|
|
36
|
+
*
|
|
37
|
+
* Preferred over searching forwards because a cut is where the retained tail begins: earlier
|
|
38
|
+
* keeps more of the recent conversation, which is the part worth keeping.
|
|
39
|
+
*/
|
|
40
|
+
export declare function safeCutAtOrBefore(messages: readonly Message[], from: number, min?: number, balanced?: boolean[]): number | null;
|
|
41
|
+
/**
|
|
42
|
+
* The earliest safe cut at or after `from`, or null if there is none.
|
|
43
|
+
*
|
|
44
|
+
* The fallback when nothing earlier is safe. It summarises more than asked — the tail it leaves
|
|
45
|
+
* is shorter — but compacting slightly too much beats not compacting at all when the alternative
|
|
46
|
+
* is a prompt the model will refuse.
|
|
47
|
+
*/
|
|
48
|
+
export declare function safeCutAtOrAfter(messages: readonly Message[], from: number, balanced?: boolean[]): number | null;
|
|
4
49
|
export interface CompressOptions {
|
|
5
50
|
/** The model's context window, so compaction happens before the model overflows rather than
|
|
6
51
|
* at a number chosen without reference to it. */
|
package/dist/compressor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compressor.d.ts","sourceRoot":"","sources":["../src/compressor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAM1C,iBAAS,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAenD;
|
|
1
|
+
{"version":3,"file":"compressor.d.ts","sourceRoot":"","sources":["../src/compressor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAM1C,iBAAS,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAenD;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMtF;AAUD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,CAW1E;AAED,yEAAyE;AACzE,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAE9F;AAED,wEAAwE;AACxE,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAE7F;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,IAAI,EAAE,MAAM,EACZ,GAAG,SAAI,EACP,QAAQ,YAA+B,GACtC,MAAM,GAAG,IAAI,CAKf;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,IAAI,EAAE,MAAM,EACZ,QAAQ,YAA+B,GACtC,MAAM,GAAG,IAAI,CAKf;AAED,MAAM,WAAW,eAAe;IAC9B;sDACkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uFAAuF;IACvF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,OAAO,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EAGb,OAAO,GAAE,eAAkD,GAC1D,OAAO,CAAC;IAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,CAgEvD;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/compressor.js
CHANGED
|
@@ -30,15 +30,92 @@ function renderForSummary(messages) {
|
|
|
30
30
|
.join('\n---\n');
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
33
|
+
* How many tool calls are still unanswered at each point in the history.
|
|
34
|
+
*
|
|
35
|
+
* An assistant message contributes one for every tool call it makes; each `tool` result answers
|
|
36
|
+
* one. A cut is only safe where the count is zero — anywhere else leaves a result whose call was
|
|
37
|
+
* summarised away, and the API rejects an orphaned tool result outright rather than degrading.
|
|
38
|
+
*
|
|
39
|
+
* Taken from the DeepSeek Harness, which validates compaction edges by this balance rather than
|
|
40
|
+
* by looking at message roles. The role heuristic this replaces walked back over `tool` messages
|
|
41
|
+
* and then returned its floor regardless — so when the walk ran out of room it produced exactly
|
|
42
|
+
* the orphan it existed to prevent, and it could not see a batch of calls at all.
|
|
36
43
|
*/
|
|
37
|
-
function
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
i
|
|
41
|
-
|
|
44
|
+
export function unansweredToolCalls(messages, upTo) {
|
|
45
|
+
let open = 0;
|
|
46
|
+
for (let i = 0; i < Math.min(upTo, messages.length); i++) {
|
|
47
|
+
open += messageDelta(messages[i]);
|
|
48
|
+
}
|
|
49
|
+
return open;
|
|
50
|
+
}
|
|
51
|
+
/** What one message does to the count of unanswered calls. */
|
|
52
|
+
function messageDelta(message) {
|
|
53
|
+
if (!message)
|
|
54
|
+
return 0;
|
|
55
|
+
if (message.role === 'tool')
|
|
56
|
+
return -1;
|
|
57
|
+
const calls = message.tool_calls;
|
|
58
|
+
return Array.isArray(calls) ? calls.length : 0;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Which cut positions are balanced, in one pass.
|
|
62
|
+
*
|
|
63
|
+
* `balanced[i]` answers "may the history be cut immediately before message i". The whole array is
|
|
64
|
+
* folded once rather than recomputed per candidate, which is how the harness does it: searching
|
|
65
|
+
* backwards while recounting from zero each time is quadratic, and a long session is exactly
|
|
66
|
+
* where compaction runs.
|
|
67
|
+
*
|
|
68
|
+
* A count that goes negative means a result arrived with no call to answer — corrupt history
|
|
69
|
+
* rather than a tight squeeze — so every later position is treated as unsafe instead of the
|
|
70
|
+
* arithmetic wrapping back to zero and offering a cut in the middle of the damage.
|
|
71
|
+
*/
|
|
72
|
+
export function toolPairingBalance(messages) {
|
|
73
|
+
const balanced = new Array(messages.length + 1);
|
|
74
|
+
let open = 0;
|
|
75
|
+
let corrupt = false;
|
|
76
|
+
balanced[0] = true; // before everything is always safe
|
|
77
|
+
for (let i = 0; i < messages.length; i++) {
|
|
78
|
+
open += messageDelta(messages[i]);
|
|
79
|
+
if (open < 0)
|
|
80
|
+
corrupt = true;
|
|
81
|
+
balanced[i + 1] = !corrupt && open === 0;
|
|
82
|
+
}
|
|
83
|
+
return balanced;
|
|
84
|
+
}
|
|
85
|
+
/** Whether the history may be cut immediately before message `index`. */
|
|
86
|
+
export function toolPairingBalancedBefore(messages, index) {
|
|
87
|
+
return toolPairingBalance(messages)[index] ?? false;
|
|
88
|
+
}
|
|
89
|
+
/** Whether the history may be cut immediately after message `index`. */
|
|
90
|
+
export function toolPairingBalancedAfter(messages, index) {
|
|
91
|
+
return toolPairingBalance(messages)[index + 1] ?? false;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The latest safe cut at or before `from`, or null if there is none.
|
|
95
|
+
*
|
|
96
|
+
* Preferred over searching forwards because a cut is where the retained tail begins: earlier
|
|
97
|
+
* keeps more of the recent conversation, which is the part worth keeping.
|
|
98
|
+
*/
|
|
99
|
+
export function safeCutAtOrBefore(messages, from, min = 2, balanced = toolPairingBalance(messages)) {
|
|
100
|
+
for (let i = Math.min(from, messages.length); i >= min; i--) {
|
|
101
|
+
if (balanced[i])
|
|
102
|
+
return i;
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The earliest safe cut at or after `from`, or null if there is none.
|
|
108
|
+
*
|
|
109
|
+
* The fallback when nothing earlier is safe. It summarises more than asked — the tail it leaves
|
|
110
|
+
* is shorter — but compacting slightly too much beats not compacting at all when the alternative
|
|
111
|
+
* is a prompt the model will refuse.
|
|
112
|
+
*/
|
|
113
|
+
export function safeCutAtOrAfter(messages, from, balanced = toolPairingBalance(messages)) {
|
|
114
|
+
for (let i = Math.max(from, 0); i <= messages.length; i++) {
|
|
115
|
+
if (balanced[i])
|
|
116
|
+
return i;
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
42
119
|
}
|
|
43
120
|
export async function compressIfNeeded(messages, client, model,
|
|
44
121
|
// Defaulted rather than required: a caller that forgets should compact conservatively, not
|
|
@@ -59,7 +136,17 @@ options = { limit: DEFAULT_CONTEXT_LIMIT }) {
|
|
|
59
136
|
// irregular because one assistant message can batch several tool calls, so this cannot be
|
|
60
137
|
// fixed by choosing a luckier constant.
|
|
61
138
|
const head = messages.slice(0, 2);
|
|
62
|
-
const
|
|
139
|
+
const balanced = toolPairingBalance(messages);
|
|
140
|
+
const wanted = Math.max(2, messages.length - KEEP_RECENT_MESSAGES);
|
|
141
|
+
// Backwards first, because that keeps more of the recent conversation. Forwards as a fallback:
|
|
142
|
+
// it summarises more than intended, which still beats sending a prompt the model will refuse.
|
|
143
|
+
const cut = safeCutAtOrBefore(messages, wanted, 2, balanced)
|
|
144
|
+
?? safeCutAtOrAfter(messages, wanted, balanced);
|
|
145
|
+
if (cut === null || cut >= messages.length) {
|
|
146
|
+
// Every candidate edge would orphan a tool result, or the only safe one keeps nothing.
|
|
147
|
+
// Leaving the history alone is the lesser problem by a long way.
|
|
148
|
+
return { messages, compressed: false };
|
|
149
|
+
}
|
|
63
150
|
const tail = messages.slice(cut);
|
|
64
151
|
const middle = messages.slice(2, cut);
|
|
65
152
|
if (middle.length === 0) {
|
package/dist/compressor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compressor.js","sourceRoot":"","sources":["../src/compressor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,SAAS,cAAc,CAAC,QAAmB;IACzC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACpC,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACpC,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC;QACrB,CAAC;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YACtC,IAAI,GAAG,GAAG,CAAC,OAAO;iBACf,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,IAAI,CAAC,CAAC,CAAC,CAAE,CAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;iBACpF,IAAI,CAAC,EAAE,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,CAAC,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/glyphs.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ export interface GlyphSet {
|
|
|
27
27
|
right: string;
|
|
28
28
|
/** The working animation, in order. */
|
|
29
29
|
spinner: readonly string[];
|
|
30
|
+
/** True for the fallback set, so callers can pick a matching form of anything larger. */
|
|
31
|
+
ascii: boolean;
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
34
|
* Which set to use.
|
package/dist/glyphs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glyphs.d.ts","sourceRoot":"","sources":["../src/glyphs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,QAAQ;IACvB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"glyphs.d.ts","sourceRoot":"","sources":["../src/glyphs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,QAAQ;IACvB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,yFAAyF;IACzF,KAAK,EAAE,OAAO,CAAC;CAChB;AA2BD;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,QAAQ,GAAE,MAAyB,EACnC,QAAQ,GAAE,MAAM,GAAG,SAAwC,EAC3D,IAAI,GAAE,MAAM,GAAG,SAA+B,GAC7C,QAAQ,CAKV;AAED,eAAO,MAAM,CAAC,EAAE,QAAuB,CAAC"}
|
package/dist/glyphs.js
CHANGED
|
@@ -21,6 +21,7 @@ const UNICODE = {
|
|
|
21
21
|
left: '←',
|
|
22
22
|
right: '→',
|
|
23
23
|
spinner: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'],
|
|
24
|
+
ascii: false,
|
|
24
25
|
};
|
|
25
26
|
const ASCII = {
|
|
26
27
|
// Two K's back to back, which is what the mark is meant to read as when the turned K is missing.
|
|
@@ -32,6 +33,7 @@ const ASCII = {
|
|
|
32
33
|
left: '<',
|
|
33
34
|
right: '>',
|
|
34
35
|
spinner: ['|', '/', '-', '\\'],
|
|
36
|
+
ascii: true,
|
|
35
37
|
};
|
|
36
38
|
/**
|
|
37
39
|
* Which set to use.
|
package/dist/glyphs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glyphs.js","sourceRoot":"","sources":["../src/glyphs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"glyphs.js","sourceRoot":"","sources":["../src/glyphs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAqBH,MAAM,OAAO,GAAa;IACxB,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,GAAG;IACV,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,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AgB,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ,CAMpD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAIpF;AAsDD,UAAU,UAAU;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE;AAUtG,qDAAqD;AACrD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAK7E;AAeD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,EAAE,CAWlF;AAGD,iGAAiG;AACjG,UAAU,SAAS;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAepE;AAo9FD,wBAAsB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAQvE"}
|
package/dist/ink-chat.js
CHANGED
|
@@ -34,6 +34,7 @@ import { startBus, listSessions as listBusSessions, resolveTarget, deliver, } fr
|
|
|
34
34
|
import { MODES as MODE_SPECS, modeSpec, decide, loadRules, saveRules, addRule, commandPrefixSuggestion, describeRule, } from './permissions.js';
|
|
35
35
|
import { AskQueue } from './ask-queue.js';
|
|
36
36
|
import { planSummary } from './plan.js';
|
|
37
|
+
import { logoFor } from './logo.js';
|
|
37
38
|
import { describeSandbox, resolveSandbox } from './sandbox.js';
|
|
38
39
|
const CYAN = '#54D7E7';
|
|
39
40
|
const GREEN = '#9BCB8F';
|
|
@@ -2914,7 +2915,7 @@ function App({ config: initialConfig }) {
|
|
|
2914
2915
|
* by <Static> in inline mode, and re-rendered every frame inside a clipped viewport in
|
|
2915
2916
|
* alt-screen mode. Two copies of this markup would drift apart within a release.
|
|
2916
2917
|
*/
|
|
2917
|
-
const renderRow = (row, index) => (row.role === 'header' ? (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "column", alignItems: "center", marginTop: 1, marginBottom: 1, children: [_jsx(Text, { color: CYAN, bold: true, children: "KONECK / SOFTWARE DELIVERY SYSTEM" }), _jsx(Text, { color: MUTED, children: "Deliberate engineering, with control at every change." })] }), _jsx(Panel, { width: barWidth, color: CYAN, title: "KONECK", children: [`MODEL: \`${modelShort}\` PROVIDER: \`${cfg.provider}\` WORKSPACE: \`${workspace}\``] })] }, index)) : row.role === 'user' ? (
|
|
2918
|
+
const renderRow = (row, index) => (row.role === 'header' ? (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "column", alignItems: "center", marginTop: 1, marginBottom: 1, children: [logoFor(uiWidth, G.ascii).map((line, i) => (_jsx(Text, { color: CYAN, bold: true, children: line }, i))), _jsx(Text, { color: CYAN, bold: true, children: "KONECK / SOFTWARE DELIVERY SYSTEM" }), _jsx(Text, { color: MUTED, children: "Deliberate engineering, with control at every change." })] }), _jsx(Panel, { width: barWidth, color: CYAN, title: "KONECK", children: [`MODEL: \`${modelShort}\` PROVIDER: \`${cfg.provider}\` WORKSPACE: \`${workspace}\``] })] }, index)) : row.role === 'user' ? (
|
|
2918
2919
|
// Painted as a filled bar so the user's own words are the most findable thing
|
|
2919
2920
|
// on screen when scrolling back through a long session.
|
|
2920
2921
|
_jsx(Box, { marginTop: 1, flexDirection: "column", children: wrapPreserving(row.text ?? '', barWidth - 2).map((line, li) => (_jsx(Text, { backgroundColor: USER_BG, color: USER_FG, bold: li === 0, children: (li === 0 ? `${G.caret} ` : ' ') + fitCells(line, barWidth - 2) }, li))) }, index)) : row.role === 'plan' ? (() => {
|