Skip to content

Commit c3d3faa

Browse files
committed
fix: tighten CLI type gaps and gateway test imports
Export missing SDK helpers, harden expert-talk/workflow progress types, and restore remote-control/ws test imports after the oauth strip.
1 parent 9b85f48 commit c3d3faa

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎apps/pythinker-code/src/tui/commands/auth.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
function platformValue(sel: string | { value: string }): string {
2+
return typeof sel === 'string' ? sel : sel.value;
3+
}
4+
15
import {
26
applyOpenPlatformConfig,
37
fetchOpenPlatformModels,

‎apps/pythinker-code/src/tui/components/dialogs/model-selector.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export class ModelSelectorComponent extends Container implements Focusable {
196196
private draftFor(choice: ModelChoice): string {
197197
const override = this.thinkingOverrides.get(choice.alias);
198198
if (override !== undefined) return override;
199-
return coerceEffortForModel(choice.model, this.opts.currentThinkingEffort);
199+
return coerceEffortForModel(choice.model as import("@pymodel/pythinker-code-sdk").ModelAlias | undefined, this.opts.currentThinkingEffort);
200200
}
201201

202202
/** Draft coerced onto the model's segment list so rendering/selection never

‎apps/pythinker-code/src/tui/components/messages/agent-dynamic-workflow-progress.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ export class AgentDynamicWorkflowProgressComponent implements Component {
759759
layout.renderText,
760760
layout.cellWidth,
761761
layout.barCells,
762-
estimate === undefined ? member.ticks : estimate.displayTicks,
762+
estimate === undefined ? member.ticks : (estimate?.displayTicks ?? 0),
763763
Math.min(snapshot.phaseElapsedMs, COMPLETE_FILL_MS),
764764
];
765765
const cached = member.cellCache;
@@ -803,7 +803,7 @@ export class AgentDynamicWorkflowProgressComponent implements Component {
803803
});
804804
const id = chalk.hex(memberIdColor(member.id, this.colors))(member.id);
805805
const bar = brailleBar(
806-
estimate.displayTicks,
806+
(estimate?.displayTicks ?? 0),
807807
snapshot.phase,
808808
layout.barCells,
809809
this.colors,
@@ -831,7 +831,7 @@ export class AgentDynamicWorkflowProgressComponent implements Component {
831831
});
832832
const id = chalk.hex(memberIdColor(member.id, this.colors))(member.id);
833833
const bar = brailleBar(
834-
estimate.displayTicks,
834+
(estimate?.displayTicks ?? 0),
835835
estimatePhase,
836836
barCells,
837837
this.colors,

‎apps/pythinker-code/src/tui/components/messages/expert-talk-panel.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export function buildExpertTalkStatusLines(
8686
}
8787

8888
if (status.arm !== undefined) lines.push(currentTheme.fg('primary', 'Armed for the next message'));
89-
if (status.pairValidation.state !== 'valid' && status.pairValidation.reason !== undefined) {
90-
lines.push(currentTheme.fg('error', status.pairValidation.reason));
89+
if (status.pairValidation?.state !== 'valid' && status.pairValidation?.reason !== undefined) {
90+
lines.push(currentTheme.fg('error', status.pairValidation?.reason));
9191
}
9292

9393
if (run !== undefined) {
@@ -322,8 +322,8 @@ export function buildExpertTalkExchangeLines(
322322
width = 120,
323323
): readonly string[] {
324324
const safeWidth = Math.max(1, width);
325-
const lead = displayModel(run.bindings[0].effectiveModelId, models);
326-
const peer = displayModel(run.bindings[1].effectiveModelId, models);
325+
const lead = displayModel((run.bindings ?? [])[0].effectiveModelId, models);
326+
const peer = displayModel((run.bindings ?? [])[1].effectiveModelId, models);
327327
const columnWidth = Math.floor((safeWidth - GRID_GUTTER_WIDTH) / 2);
328328
const grid = columnWidth < MIN_AGENT_COLUMN_WIDTH
329329
? renderAgentGrid(

0 commit comments

Comments
 (0)