docs(client): clarify draft initialization lifecycle
This commit is contained in:
1 parent
2c93df5620
commit
9aa8e788ba
3 files changed
+13
-16
No files matched your search
@@ -217,6 +217,7 @@ export interface SessionInputResolver {
|
||||
* @param binding - target Session generation, already retained by the caller.
|
||||
* @param options - content to adopt and explicit permission to replace existing text.
|
||||
* @returns applied, preserved, or blocked by a pending submission or disposal.
|
||||
* @throws when binding is not the currently retained Session generation.
|
||||
*/
|
||||
requestDraftInitialization(binding: SessionBinding, options: DraftInitializationOptions): DraftInitializationResult
|
||||
}
|
||||
|
||||
@@ -34,10 +34,9 @@ export interface PopupDismissFace {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construction dependencies of one facade. The slash/popup faces are THUNKS: the
|
||||
* shell is created inside the sessions provide materialization (before the
|
||||
* scope record is queryable), where `slash.sessionOf`/`command.popupFor`
|
||||
* cannot resolve yet — resolution defers to first interactive use.
|
||||
* Construction dependencies of one input model. Trigger and popup callbacks
|
||||
* resolve the currently available Session-scoped services on demand. InputHub
|
||||
* owns the lexicon subscription through the Session scope's inject lifecycle.
|
||||
*/
|
||||
export interface SessionInputDeps {
|
||||
/** Session-scope ctx handed to claim.submit transactions. */
|
||||
@@ -242,7 +241,8 @@ export class SessionInputShell implements SessionInput {
|
||||
/**
|
||||
* Apply one new-task request to this already-initialized input model.
|
||||
* @param options - replacement content and explicit permission to clear existing text.
|
||||
* @returns whether text changed, was preserved, or submission prevented editing.
|
||||
* @returns applied when the requested text is adopted, even if unchanged;
|
||||
* preserved when the current draft is kept; blocked after disposal or during a pending submission.
|
||||
*/
|
||||
requestDraftInitialization(options: DraftInitializationOptions): DraftInitializationResult {
|
||||
if (this.draftInitializationBlocked()) return 'blocked'
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
/**
|
||||
* InputHub: the SessionInputResolver implementation (`ctx.conversation.input`) — one
|
||||
* SessionInputShell per session, created inside the uiSession provide
|
||||
* materialization (the 'input' standard-kit entry IS the
|
||||
* creation trigger) and torn down by the scope disposer (instance-and-scope
|
||||
* share one lifecycle). The hub registers the scoped input-mutation
|
||||
* listeners on each Session context and owns the default-sink choreography: every session is a
|
||||
* real host entity, so the sink is one unconditional prompt path.
|
||||
* Session-bound input registry and default-send routing for Conversation.
|
||||
* Each retained Session binding owns one shell, its input listeners, and its
|
||||
* catalog subscription. Saved drafts enter the model before the first lookup
|
||||
* returns; Session-scope disposal releases the shell and its resources.
|
||||
*/
|
||||
import type {} from '@deepseek-ai/dsh-client-product-analytics/client'
|
||||
import type { ModelSelectionProjection } from '@deepseek-ai/dsh-api-session-controller/types'
|
||||
@@ -90,10 +87,9 @@ export class InputHub implements SessionInputResolver {
|
||||
}
|
||||
|
||||
/**
|
||||
* Resident shell for one session binding — the provide-channel entry
|
||||
* (called during scope materialization, BEFORE the scope record is
|
||||
* queryable, hence binding-fed and hence the thunked slash/popup deps).
|
||||
* Wires the scoped event listeners + teardown into the session scope.
|
||||
* Resolve the resident shell for an already-retained, addressable Session binding.
|
||||
* Draft import completes before return. The Session scope owns input listeners,
|
||||
* the inject-managed catalog subscription, and shell teardown.
|
||||
* @param binding - session assembly handle.
|
||||
* @returns the shell.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user