@comfyorg/comfyui-desktop-bridge-types 0.6.1 → 0.8.0

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.
@@ -124,12 +124,34 @@ export type ComfyDesktop2AuthState =
124
124
  email?: string
125
125
  workspaceId?: string
126
126
  }
127
+ export type ComfyDesktop2BillingHandoffReceiver = 'billing_web' | 'platform'
128
+ export type ComfyDesktop2BillingHandoffIntent = 'top-up' | 'subscription'
129
+ export type ComfyDesktop2BillingHandoff =
130
+ | {
131
+ status: 'issued'
132
+ entryUrl: string
133
+ }
134
+ | {
135
+ status: 'sign_in_again'
136
+ }
137
+ | {
138
+ status: 'refused'
139
+ code?: string
140
+ message?: string
141
+ }
142
+ | {
143
+ status: 'disabled'
144
+ }
127
145
  export interface ComfyDesktop2AuthBridge {
128
146
  getState(): Promise<ComfyDesktop2AuthState>
129
147
  /** The workspace credential, only for an exact workspace Desktop's session
130
148
  * is scoped to; null when signed out, disabled, or the scope is missing,
131
149
  * malformed or different. The refresh token never leaves Desktop. */
132
150
  getWorkspaceToken(workspaceId: string): Promise<string | null>
151
+ /** The partner-node token for prompts in `workspaceId`, under the same rules
152
+ * as `getWorkspaceToken`. Desktop mints and renews it; null means use the
153
+ * workspace token. Absent on Desktop builds before it. */
154
+ getPartnerNodeToken?(workspaceId: string): Promise<string | null>
133
155
  /** Runs Desktop's browser sign-in and resolves with the resulting state. */
134
156
  requestSignIn(): Promise<ComfyDesktop2AuthState>
135
157
  /** Signs Desktop out of its account (every view follows) and resolves with
@@ -144,6 +166,13 @@ export interface ComfyDesktop2AuthBridge {
144
166
  switchWorkspace(workspaceId: string): Promise<ComfyDesktop2AuthState>
145
167
  /** Fires when Desktop signs in, signs out or switches workspace. */
146
168
  onChanged(callback: (state: ComfyDesktop2AuthState) => void): () => void
169
+ /** Issues a billing handoff with Desktop's credential and resolves with only its https entry URL; `intent` picks the landing page and `amountCents` the top-up amount. Absent on older Desktop builds. */
170
+ issueBillingHandoff?(
171
+ workspaceId: string,
172
+ receiver: ComfyDesktop2BillingHandoffReceiver,
173
+ intent?: ComfyDesktop2BillingHandoffIntent,
174
+ amountCents?: number
175
+ ): Promise<ComfyDesktop2BillingHandoff>
147
176
  }
148
177
  export interface ComfyDesktop2TerminalBridge {
149
178
  subscribe(installationId?: string): Promise<TerminalRestore>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfyorg/comfyui-desktop-bridge-types",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
4
4
  "description": "TypeScript definitions for the Comfy Desktop hosted frontend bridge",
5
5
  "type": "module",
6
6
  "main": "./index.js",