@volter-ai-dev/supercode-ui 0.1.4 → 0.1.6
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 +2 -1
- package/controller.mjs +21 -1
- package/conversation.d.ts +1 -0
- package/conversation.mjs +2 -1
- package/embed.mjs +2 -1
- package/index.d.ts +8 -0
- package/messenger.mjs +2 -1
- package/package.json +4 -3
package/components.mjs
CHANGED
|
@@ -647,6 +647,7 @@ function Conversation({ state, adapter, components = {}, slots = {}, memoryKey =
|
|
|
647
647
|
const blocks = groupConversation(state.transcript);
|
|
648
648
|
const Entry = components.TranscriptEntry ?? TranscriptEntry;
|
|
649
649
|
const Group = components.ActivityGroup ?? ActivityGroup;
|
|
650
|
+
const Plan = components.TaskPlan ?? TaskPlan;
|
|
650
651
|
const Before = slots.beforeConversation;
|
|
651
652
|
const After = slots.afterConversation;
|
|
652
653
|
const Empty = slots.emptyConversation;
|
|
@@ -681,7 +682,7 @@ function Conversation({ state, adapter, components = {}, slots = {}, memoryKey =
|
|
|
681
682
|
remember({ top: element.scrollTop, atBottom: bottom });
|
|
682
683
|
}, children: /* @__PURE__ */ jsxs2("div", { children: [
|
|
683
684
|
Before ? /* @__PURE__ */ jsx3(Before, { state, adapter, value: null }) : null,
|
|
684
|
-
/* @__PURE__ */ jsx3(
|
|
685
|
+
/* @__PURE__ */ jsx3(Plan, { plan: state.taskPlan, value: state.taskPlan, state, adapter }),
|
|
685
686
|
/* @__PURE__ */ jsx3(SessionDetails, { semantics: state.semantics }),
|
|
686
687
|
state.history.hasEarlier ? /* @__PURE__ */ jsx3("button", { class: "scui-load", type: "button", disabled: Boolean(state.operation), onClick: () => {
|
|
687
688
|
const element = scroller.current;
|
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/conversation.d.ts
CHANGED
package/conversation.mjs
CHANGED
|
@@ -315,6 +315,7 @@ function Conversation({ state, adapter, components = {}, slots = {}, memoryKey =
|
|
|
315
315
|
const blocks = groupConversation(state.transcript);
|
|
316
316
|
const Entry = components.TranscriptEntry ?? TranscriptEntry;
|
|
317
317
|
const Group = components.ActivityGroup ?? ActivityGroup;
|
|
318
|
+
const Plan = components.TaskPlan ?? TaskPlan;
|
|
318
319
|
const Before = slots.beforeConversation;
|
|
319
320
|
const After = slots.afterConversation;
|
|
320
321
|
const Empty = slots.emptyConversation;
|
|
@@ -349,7 +350,7 @@ function Conversation({ state, adapter, components = {}, slots = {}, memoryKey =
|
|
|
349
350
|
remember({ top: element.scrollTop, atBottom: bottom });
|
|
350
351
|
}, children: /* @__PURE__ */ jsxs("div", { children: [
|
|
351
352
|
Before ? /* @__PURE__ */ jsx2(Before, { state, adapter, value: null }) : null,
|
|
352
|
-
/* @__PURE__ */ jsx2(
|
|
353
|
+
/* @__PURE__ */ jsx2(Plan, { plan: state.taskPlan, value: state.taskPlan, state, adapter }),
|
|
353
354
|
/* @__PURE__ */ jsx2(SessionDetails, { semantics: state.semantics }),
|
|
354
355
|
state.history.hasEarlier ? /* @__PURE__ */ jsx2("button", { class: "scui-load", type: "button", disabled: Boolean(state.operation), onClick: () => {
|
|
355
356
|
const element = scroller.current;
|
package/embed.mjs
CHANGED
|
@@ -653,6 +653,7 @@ function Conversation({ state, adapter, components = {}, slots = {}, memoryKey =
|
|
|
653
653
|
const blocks = groupConversation(state.transcript);
|
|
654
654
|
const Entry = components.TranscriptEntry ?? TranscriptEntry;
|
|
655
655
|
const Group = components.ActivityGroup ?? ActivityGroup;
|
|
656
|
+
const Plan = components.TaskPlan ?? TaskPlan;
|
|
656
657
|
const Before = slots.beforeConversation;
|
|
657
658
|
const After = slots.afterConversation;
|
|
658
659
|
const Empty = slots.emptyConversation;
|
|
@@ -687,7 +688,7 @@ function Conversation({ state, adapter, components = {}, slots = {}, memoryKey =
|
|
|
687
688
|
remember({ top: element.scrollTop, atBottom: bottom });
|
|
688
689
|
}, children: /* @__PURE__ */ jsxs2("div", { children: [
|
|
689
690
|
Before ? /* @__PURE__ */ jsx3(Before, { state, adapter, value: null }) : null,
|
|
690
|
-
/* @__PURE__ */ jsx3(
|
|
691
|
+
/* @__PURE__ */ jsx3(Plan, { plan: state.taskPlan, value: state.taskPlan, state, adapter }),
|
|
691
692
|
/* @__PURE__ */ jsx3(SessionDetails, { semantics: state.semantics }),
|
|
692
693
|
state.history.hasEarlier ? /* @__PURE__ */ jsx3("button", { class: "scui-load", type: "button", disabled: Boolean(state.operation), onClick: () => {
|
|
693
694
|
const element = scroller.current;
|
package/index.d.ts
CHANGED
|
@@ -240,10 +240,18 @@ export interface ActivityGroupProps {
|
|
|
240
240
|
adapter: UiAdapter;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
export interface TaskPlanProps {
|
|
244
|
+
plan: TaskPlanModel;
|
|
245
|
+
value?: TaskPlanModel;
|
|
246
|
+
state: SupercodeUiState;
|
|
247
|
+
adapter: UiAdapter;
|
|
248
|
+
}
|
|
249
|
+
|
|
243
250
|
export interface MessengerComponents {
|
|
244
251
|
SessionRow?: ComponentType<SessionRowProps>;
|
|
245
252
|
TranscriptEntry?: ComponentType<TranscriptEntryProps>;
|
|
246
253
|
ActivityGroup?: ComponentType<ActivityGroupProps>;
|
|
254
|
+
TaskPlan?: ComponentType<TaskPlanProps>;
|
|
247
255
|
HarnessLogo?: ComponentType<{ id: HarnessId; activity?: SessionActivity; size?: number }>;
|
|
248
256
|
}
|
|
249
257
|
|
package/messenger.mjs
CHANGED
|
@@ -650,6 +650,7 @@ function Conversation({ state, adapter, components = {}, slots = {}, memoryKey =
|
|
|
650
650
|
const blocks = groupConversation(state.transcript);
|
|
651
651
|
const Entry = components.TranscriptEntry ?? TranscriptEntry;
|
|
652
652
|
const Group = components.ActivityGroup ?? ActivityGroup;
|
|
653
|
+
const Plan = components.TaskPlan ?? TaskPlan;
|
|
653
654
|
const Before = slots.beforeConversation;
|
|
654
655
|
const After = slots.afterConversation;
|
|
655
656
|
const Empty = slots.emptyConversation;
|
|
@@ -684,7 +685,7 @@ function Conversation({ state, adapter, components = {}, slots = {}, memoryKey =
|
|
|
684
685
|
remember({ top: element.scrollTop, atBottom: bottom });
|
|
685
686
|
}, children: /* @__PURE__ */ jsxs2("div", { children: [
|
|
686
687
|
Before ? /* @__PURE__ */ jsx3(Before, { state, adapter, value: null }) : null,
|
|
687
|
-
/* @__PURE__ */ jsx3(
|
|
688
|
+
/* @__PURE__ */ jsx3(Plan, { plan: state.taskPlan, value: state.taskPlan, state, adapter }),
|
|
688
689
|
/* @__PURE__ */ jsx3(SessionDetails, { semantics: state.semantics }),
|
|
689
690
|
state.history.hasEarlier ? /* @__PURE__ */ jsx3("button", { class: "scui-load", type: "button", disabled: Boolean(state.operation), onClick: () => {
|
|
690
691
|
const element = scroller.current;
|
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.6",
|
|
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": {
|