// dsh-client-ui-model-selection/lib/client.js (0.1.2-rc.1 反混淆,行号对应源)
private syncInputs() {
if (this.disposed) return
const catalog = this.catalog.store.getSnapshot()
const projected = modelSelectionProjection(this.projected.getSnapshot())
if (catalog.status !== 'ready' || catalog.value === null || projected === undefined) {
if (this.resolved) {
if (catalog.status === 'error') this.store.update((state) => {
state.status = 'error'
state.error = catalog.error
})
return // ← BUG:曾 resolved,保留旧的 routable:false,block 不清
}
this.store.set({ current: null, routable: null /* not blocked */, groups: [], failures: [], status: catalog.status === 'error' ? 'error' : 'loading', error: catalog.error })
return
}
const current = projected.next ?? catalog.value.default
this.resolved = true
this.store.set({
current,
routable: catalog.value.routableProviders.includes(current.provider), // false 时下面会 block
groups: catalog.value.groups, failures: catalog.value.failures,
status: this.store.getSnapshot().status === 'selecting' ? 'selecting' : 'ready', error: null
})
}
// 同一文件 directoryFor():routable === false 才注册 composer block
const publish = () => {
conversation.blocks.set(sessionId,
directory.store.getSnapshot().routable === false ? { reason: this.blockReason() } : void 0)
}
publish()
actx.effect(() => { const stop = directory.store.subscribe(publish); ... })
// 消费端 dsh-client-ui-conversation/lib/client.js
const disabled = removed || inert || !live || blocked !== void 0 || parentOffline // :15365
const machineBusy = input?.phase === 'adjudicating' || input?.phase === 'submitting' // :15368
// 发送按钮 disabled: empty || disabled || machineBusy // :15683