@volter-ai-dev/supercode-ui 0.1.3 → 0.1.5
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/components.mjs +1 -1
- package/controller.mjs +21 -1
- package/core.mjs +1 -1
- package/embed.mjs +1 -1
- package/index.d.ts +1 -1
- package/messenger.mjs +1 -1
- package/package.json +4 -3
package/components.mjs
CHANGED
|
@@ -192,7 +192,7 @@ function readTerminalHandoff(value) {
|
|
|
192
192
|
}
|
|
193
193
|
function readExportReceipt(value) {
|
|
194
194
|
const receipt = record(value);
|
|
195
|
-
if (!receipt || typeof receipt.targetHarness !== "string" || !["byte_lossless", "value_lossless"].includes(receipt.fidelity) || typeof receipt.path !== "string" || !receipt.path.trim() || !Number.isInteger(receipt.files) || receipt.files < 1 || !Number.isInteger(receipt.residueCount) || receipt.residueCount < 0) return null;
|
|
195
|
+
if (!receipt || typeof receipt.targetHarness !== "string" || !["byte_lossless", "value_lossless", "semantic"].includes(receipt.fidelity) || typeof receipt.path !== "string" || !receipt.path.trim() || !Number.isInteger(receipt.files) || receipt.files < 1 || !Number.isInteger(receipt.residueCount) || receipt.residueCount < 0) return null;
|
|
196
196
|
return {
|
|
197
197
|
targetHarness: receipt.targetHarness,
|
|
198
198
|
fidelity: receipt.fidelity,
|
package/controller.mjs
CHANGED
|
@@ -178,12 +178,32 @@ function projectConversation(conversation, options) {
|
|
|
178
178
|
// Start at the tail and stop as soon as the bounded render window is full. Hidden harness
|
|
179
179
|
// context never consumes a slot. The independent scan cap prevents a corrupt/all-context
|
|
180
180
|
// transcript from turning this display projection back into an unbounded whole-history walk.
|
|
181
|
-
|
|
181
|
+
let index = conversation.length - 1;
|
|
182
|
+
let scanned = 0;
|
|
183
|
+
for (;
|
|
182
184
|
index >= 0 && rows.length < maxEntries && scanned < maxScanEntries;
|
|
183
185
|
index -= 1, scanned += 1) {
|
|
184
186
|
const row = projectConversationEntry(conversation[index], maxEntryChars);
|
|
185
187
|
if (row) rows.push(row);
|
|
186
188
|
}
|
|
189
|
+
|
|
190
|
+
// A messenger tail needs a conversational anchor. If the hard entry boundary landed inside a
|
|
191
|
+
// long assistant/tool run, use the remaining scan budget to find its nearest preceding human
|
|
192
|
+
// prompt and spend one existing render slot on it. When a prompt is already present, discard
|
|
193
|
+
// older orphaned activity so the visible slice begins on that turn boundary. Both the render
|
|
194
|
+
// count and native-history scan remain strictly bounded.
|
|
195
|
+
const oldestVisibleUser = rows.findLastIndex((row) => row.role === 'user');
|
|
196
|
+
if (oldestVisibleUser >= 0) {
|
|
197
|
+
rows.length = oldestVisibleUser + 1;
|
|
198
|
+
} else {
|
|
199
|
+
for (; index >= 0 && scanned < maxScanEntries; index -= 1, scanned += 1) {
|
|
200
|
+
const row = projectConversationEntry(conversation[index], maxEntryChars);
|
|
201
|
+
if (row?.role !== 'user') continue;
|
|
202
|
+
if (rows.length === maxEntries) rows[rows.length - 1] = row;
|
|
203
|
+
else rows.push(row);
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
187
207
|
rows.reverse();
|
|
188
208
|
return rows;
|
|
189
209
|
}
|
package/core.mjs
CHANGED
|
@@ -216,7 +216,7 @@ function readExportReceipt(value) {
|
|
|
216
216
|
if (
|
|
217
217
|
!receipt ||
|
|
218
218
|
typeof receipt.targetHarness !== 'string' ||
|
|
219
|
-
!['byte_lossless', 'value_lossless'].includes(receipt.fidelity) ||
|
|
219
|
+
!['byte_lossless', 'value_lossless', 'semantic'].includes(receipt.fidelity) ||
|
|
220
220
|
typeof receipt.path !== 'string' ||
|
|
221
221
|
!receipt.path.trim() ||
|
|
222
222
|
!Number.isInteger(receipt.files) ||
|
package/embed.mjs
CHANGED
|
@@ -195,7 +195,7 @@ function readTerminalHandoff(value) {
|
|
|
195
195
|
}
|
|
196
196
|
function readExportReceipt(value) {
|
|
197
197
|
const receipt = record(value);
|
|
198
|
-
if (!receipt || typeof receipt.targetHarness !== "string" || !["byte_lossless", "value_lossless"].includes(receipt.fidelity) || typeof receipt.path !== "string" || !receipt.path.trim() || !Number.isInteger(receipt.files) || receipt.files < 1 || !Number.isInteger(receipt.residueCount) || receipt.residueCount < 0) return null;
|
|
198
|
+
if (!receipt || typeof receipt.targetHarness !== "string" || !["byte_lossless", "value_lossless", "semantic"].includes(receipt.fidelity) || typeof receipt.path !== "string" || !receipt.path.trim() || !Number.isInteger(receipt.files) || receipt.files < 1 || !Number.isInteger(receipt.residueCount) || receipt.residueCount < 0) return null;
|
|
199
199
|
return {
|
|
200
200
|
targetHarness: receipt.targetHarness,
|
|
201
201
|
fidelity: receipt.fidelity,
|
package/index.d.ts
CHANGED
|
@@ -150,7 +150,7 @@ export interface SupercodeUiState {
|
|
|
150
150
|
exportBackTarget: HarnessId | null;
|
|
151
151
|
exportReceipt: {
|
|
152
152
|
targetHarness: HarnessId;
|
|
153
|
-
fidelity: 'byte_lossless' | 'value_lossless';
|
|
153
|
+
fidelity: 'byte_lossless' | 'value_lossless' | 'semantic';
|
|
154
154
|
path: string;
|
|
155
155
|
files: number;
|
|
156
156
|
residueCount: number;
|
package/messenger.mjs
CHANGED
|
@@ -192,7 +192,7 @@ function readTerminalHandoff(value) {
|
|
|
192
192
|
}
|
|
193
193
|
function readExportReceipt(value) {
|
|
194
194
|
const receipt = record(value);
|
|
195
|
-
if (!receipt || typeof receipt.targetHarness !== "string" || !["byte_lossless", "value_lossless"].includes(receipt.fidelity) || typeof receipt.path !== "string" || !receipt.path.trim() || !Number.isInteger(receipt.files) || receipt.files < 1 || !Number.isInteger(receipt.residueCount) || receipt.residueCount < 0) return null;
|
|
195
|
+
if (!receipt || typeof receipt.targetHarness !== "string" || !["byte_lossless", "value_lossless", "semantic"].includes(receipt.fidelity) || typeof receipt.path !== "string" || !receipt.path.trim() || !Number.isInteger(receipt.files) || receipt.files < 1 || !Number.isInteger(receipt.residueCount) || receipt.residueCount < 0) return null;
|
|
196
196
|
return {
|
|
197
197
|
targetHarness: receipt.targetHarness,
|
|
198
198
|
fidelity: receipt.fidelity,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter-ai-dev/supercode-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Composable default UI kit for Supercode-powered coding-agent experiences",
|
|
6
6
|
"exports": {
|
|
@@ -77,15 +77,16 @@
|
|
|
77
77
|
"storybook": "npm run build && storybook dev -p 6006",
|
|
78
78
|
"build:storybook": "npm run build && storybook build",
|
|
79
79
|
"test:storybook": "npm run build && vitest --run",
|
|
80
|
+
"test:headless": "npm run build && npm run typecheck && npm test",
|
|
80
81
|
"typecheck": "tsc -p tsconfig.json && tsc -p test/tsconfig.json",
|
|
81
82
|
"test": "node --test test/*.test.mjs",
|
|
82
|
-
"prepack": "npm run
|
|
83
|
+
"prepack": "npm run test:headless"
|
|
83
84
|
},
|
|
84
85
|
"dependencies": {
|
|
85
86
|
"markdown-it": "^14.1.0"
|
|
86
87
|
},
|
|
87
88
|
"peerDependencies": {
|
|
88
|
-
"@volter-ai-dev/supercode-client": ">=0.3.
|
|
89
|
+
"@volter-ai-dev/supercode-client": ">=0.3.10 <0.4.0",
|
|
89
90
|
"preact": ">=10.19.0 <11"
|
|
90
91
|
},
|
|
91
92
|
"peerDependenciesMeta": {
|