@eddyskywalker/dsh-chatgpt-subscription 0.34.0 → 0.35.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.
- package/CHANGELOG.md +51 -110
- package/lib/client.js +781 -2041
- package/lib/client.js.map +1 -1
- package/lib/index.js +3104 -9297
- package/lib/types/client/CodexSubscriptionSection.d.ts.map +1 -1
- package/lib/types/client/ProviderHubSection.d.ts.map +1 -1
- package/lib/types/client/antigravity/locales.d.ts +2 -5
- package/lib/types/client/antigravity/locales.d.ts.map +1 -1
- package/lib/types/client/claude/locales.d.ts +2 -5
- package/lib/types/client/claude/locales.d.ts.map +1 -1
- package/lib/types/client/claude/styles.d.ts +2 -2
- package/lib/types/client/cline-pass/locales.d.ts +0 -6
- package/lib/types/client/cline-pass/locales.d.ts.map +1 -1
- package/lib/types/client/command-code/locales.d.ts +2 -5
- package/lib/types/client/command-code/locales.d.ts.map +1 -1
- package/lib/types/client/common/AccountPoolSection.d.ts +3 -2
- package/lib/types/client/common/AccountPoolSection.d.ts.map +1 -1
- package/lib/types/client/common/account-pool-labels.d.ts +0 -2
- package/lib/types/client/common/account-pool-labels.d.ts.map +1 -1
- package/lib/types/client/common/format.d.ts +2 -2
- package/lib/types/client/common/styles.d.ts.map +1 -1
- package/lib/types/client/glm-coding-plan/GlmCodingPlanSection.d.ts +1 -1
- package/lib/types/client/glm-coding-plan/locales.d.ts +2 -5
- package/lib/types/client/glm-coding-plan/locales.d.ts.map +1 -1
- package/lib/types/client/glm-coding-plan/styles.d.ts +3 -2
- package/lib/types/client/glm-coding-plan/styles.d.ts.map +1 -1
- package/lib/types/client/glm-coding-plan/useGlmCodingPlanSection.d.ts.map +1 -1
- package/lib/types/client/hub/UpdateCheck.d.ts +9 -0
- package/lib/types/client/hub/UpdateCheck.d.ts.map +1 -0
- package/lib/types/client/hub/brand-icons.d.ts +1 -1
- package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
- package/lib/types/client/hub/brand-svg.d.ts +0 -4
- package/lib/types/client/hub/brand-svg.d.ts.map +1 -1
- package/lib/types/client/hub/hub-styles.d.ts.map +1 -1
- package/lib/types/client/hub/providers.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +0 -2
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/kimi-code/locales.d.ts +2 -5
- package/lib/types/client/kimi-code/locales.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +39 -3
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/minimax-code/locales.d.ts +2 -5
- package/lib/types/client/minimax-code/locales.d.ts.map +1 -1
- package/lib/types/client/minimax-code/useMinimaxCodeSection.d.ts +2 -2
- package/lib/types/client/minimax-code/useMinimaxCodeSection.d.ts.map +1 -1
- package/lib/types/client/ollama/locales.d.ts +0 -6
- package/lib/types/client/ollama/locales.d.ts.map +1 -1
- package/lib/types/client/opendesign/locales.d.ts +0 -6
- package/lib/types/client/opendesign/locales.d.ts.map +1 -1
- package/lib/types/client/qoder/QoderSection.d.ts +1 -1
- package/lib/types/client/qoder/locales.d.ts +1 -3
- package/lib/types/client/qoder/locales.d.ts.map +1 -1
- package/lib/types/client/qoder/useQoderSection.d.ts.map +1 -1
- package/lib/types/client/step-code/StepCodeComposerQuota.d.ts +2 -2
- package/lib/types/client/step-code/StepCodeSection.d.ts +1 -1
- package/lib/types/client/step-code/locales.d.ts +2 -5
- package/lib/types/client/step-code/locales.d.ts.map +1 -1
- package/lib/types/client/step-code/styles.d.ts +1 -1
- package/lib/types/client/step-code/useStepCodeSection.d.ts.map +1 -1
- package/lib/types/host/claude/account-pool.d.ts +2 -2
- package/lib/types/host/claude/account-pool.d.ts.map +1 -1
- package/lib/types/host/claude/routes.d.ts +1 -1
- package/lib/types/host/common/capabilities.d.ts.map +1 -1
- package/lib/types/host/common/credential-read-cache.d.ts +2 -3
- package/lib/types/host/common/credential-read-cache.d.ts.map +1 -1
- package/lib/types/host/common/model-request-control.d.ts +1 -1
- package/lib/types/host/common/model-request-control.d.ts.map +1 -1
- package/lib/types/host/common/request-diagnostics.d.ts +2 -2
- package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
- package/lib/types/host/glm-coding-plan/mapper-openai.d.ts +1 -1
- package/lib/types/host/glm-coding-plan/model-catalog.d.ts +4 -4
- package/lib/types/host/minimax-code/account-pool.d.ts +6 -7
- package/lib/types/host/minimax-code/account-pool.d.ts.map +1 -1
- package/lib/types/host/minimax-code/checkin.d.ts +7 -8
- package/lib/types/host/minimax-code/checkin.d.ts.map +1 -1
- package/lib/types/host/minimax-code/routes.d.ts +1 -1
- package/lib/types/host/step-code/adapter.d.ts +1 -1
- package/lib/types/host/step-code/client.d.ts +1 -1
- package/lib/types/host/step-code/mapper.d.ts +3 -3
- package/lib/types/host/step-code/oauth.d.ts +1 -1
- package/lib/types/host/update-check.d.ts +118 -0
- package/lib/types/host/update-check.d.ts.map +1 -0
- package/lib/types/index.d.ts +0 -6
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/account-pool-contracts.d.ts +0 -24
- package/lib/types/shared/account-pool-contracts.d.ts.map +1 -1
- package/lib/types/shared/hub-contracts.d.ts +1 -1
- package/lib/types/shared/hub-contracts.d.ts.map +1 -1
- package/lib/types/shared/minimax-code-contracts.d.ts +2 -2
- package/lib/types/shared/update-contracts.d.ts +124 -0
- package/lib/types/shared/update-contracts.d.ts.map +1 -0
- package/package.json +1 -1
- package/lib/types/client/workbuddy/WorkBuddyComposerQuota.d.ts +0 -22
- package/lib/types/client/workbuddy/WorkBuddyComposerQuota.d.ts.map +0 -1
- package/lib/types/client/workbuddy/WorkBuddySection.d.ts +0 -50
- package/lib/types/client/workbuddy/WorkBuddySection.d.ts.map +0 -1
- package/lib/types/client/workbuddy/locales.d.ts +0 -635
- package/lib/types/client/workbuddy/locales.d.ts.map +0 -1
- package/lib/types/client/workbuddy/styles.d.ts +0 -15
- package/lib/types/client/workbuddy/styles.d.ts.map +0 -1
- package/lib/types/client/workbuddy/useWorkBuddySection.d.ts +0 -149
- package/lib/types/client/workbuddy/useWorkBuddySection.d.ts.map +0 -1
- package/lib/types/host/workbuddy/account-pool.d.ts +0 -235
- package/lib/types/host/workbuddy/account-pool.d.ts.map +0 -1
- package/lib/types/host/workbuddy/adapter.d.ts +0 -129
- package/lib/types/host/workbuddy/adapter.d.ts.map +0 -1
- package/lib/types/host/workbuddy/atrest.d.ts +0 -98
- package/lib/types/host/workbuddy/atrest.d.ts.map +0 -1
- package/lib/types/host/workbuddy/checkin.d.ts +0 -150
- package/lib/types/host/workbuddy/checkin.d.ts.map +0 -1
- package/lib/types/host/workbuddy/client.d.ts +0 -169
- package/lib/types/host/workbuddy/client.d.ts.map +0 -1
- package/lib/types/host/workbuddy/dsml.d.ts +0 -55
- package/lib/types/host/workbuddy/dsml.d.ts.map +0 -1
- package/lib/types/host/workbuddy/guardrails.d.ts +0 -111
- package/lib/types/host/workbuddy/guardrails.d.ts.map +0 -1
- package/lib/types/host/workbuddy/identity.d.ts +0 -71
- package/lib/types/host/workbuddy/identity.d.ts.map +0 -1
- package/lib/types/host/workbuddy/mapper.d.ts +0 -131
- package/lib/types/host/workbuddy/mapper.d.ts.map +0 -1
- package/lib/types/host/workbuddy/model-catalog.d.ts +0 -217
- package/lib/types/host/workbuddy/model-catalog.d.ts.map +0 -1
- package/lib/types/host/workbuddy/oauth.d.ts +0 -47
- package/lib/types/host/workbuddy/oauth.d.ts.map +0 -1
- package/lib/types/host/workbuddy/outbound-identity.d.ts +0 -66
- package/lib/types/host/workbuddy/outbound-identity.d.ts.map +0 -1
- package/lib/types/host/workbuddy/routes.d.ts +0 -56
- package/lib/types/host/workbuddy/routes.d.ts.map +0 -1
- package/lib/types/host/workbuddy/token-store.d.ts +0 -360
- package/lib/types/host/workbuddy/token-store.d.ts.map +0 -1
- package/lib/types/host/workbuddy/types.d.ts +0 -161
- package/lib/types/host/workbuddy/types.d.ts.map +0 -1
- package/lib/types/shared/workbuddy-contracts.d.ts +0 -353
- package/lib/types/shared/workbuddy-contracts.d.ts.map +0 -1
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wire contracts between the WorkBuddy host routes and the browser settings
|
|
3
|
-
* card. Everything here is public: no credential ever crosses this boundary.
|
|
4
|
-
*/
|
|
5
|
-
import type { AccountPoolStatusDto, PoolAccountSummaryDto } from './account-pool-contracts.ts';
|
|
6
|
-
/**
|
|
7
|
-
* Which deployment region an account belongs to.
|
|
8
|
-
*
|
|
9
|
-
* The two regions are separate backends serving overlapping-but-different model
|
|
10
|
-
* catalogs, and a model asked of the wrong region answers 400 `code 11102`
|
|
11
|
-
* ("service info not found") rather than failing over. The region is therefore
|
|
12
|
-
* a property of the credential, not of the request.
|
|
13
|
-
*/
|
|
14
|
-
export type WorkBuddyRegion = 'cn' | 'intl';
|
|
15
|
-
/**
|
|
16
|
-
* Local quota guardrails, as the settings card edits them.
|
|
17
|
-
*
|
|
18
|
-
* The host owns the enforcement; this is the wire shape. `0` means OFF for every
|
|
19
|
-
* field, and all-off is the default, so an untouched install behaves exactly as
|
|
20
|
-
* before the guardrails existed.
|
|
21
|
-
*/
|
|
22
|
-
export interface WorkBuddyGuardrailsDto {
|
|
23
|
-
/** Stop serving an account whose remaining credits are below this. */
|
|
24
|
-
reserveCredits: number;
|
|
25
|
-
/** Stop serving an account for the rest of the local day at this many tokens. */
|
|
26
|
-
dailyTokens: number;
|
|
27
|
-
/** Stop serving one model for the rest of the local day at this many tokens. */
|
|
28
|
-
modelDailyTokens: number;
|
|
29
|
-
}
|
|
30
|
-
/** Client families this line can present to the gateway. */
|
|
31
|
-
export type WorkBuddyOutboundProduct = 'cli' | 'workbuddy' | 'vscode';
|
|
32
|
-
/**
|
|
33
|
-
* Stored preference for which client family requests present.
|
|
34
|
-
*
|
|
35
|
-
* `auto` assigns one product per account and keeps it for that account's whole
|
|
36
|
-
* life; every other value pins it line-wide. The shipped default (`cli`) is the
|
|
37
|
-
* identity this line has always sent.
|
|
38
|
-
*/
|
|
39
|
-
export type WorkBuddyOutboundSetting = 'auto' | WorkBuddyOutboundProduct;
|
|
40
|
-
/**
|
|
41
|
-
* Consumption multiplier of one model, per region.
|
|
42
|
-
*
|
|
43
|
-
* The subscription publishes a \`credits\` string per model in its own
|
|
44
|
-
* \`/v3/config\` catalog — \`x0.79 credits\`, \`x6.67\` — which is the relative rate at
|
|
45
|
-
* which that model consumes the package allowance. The official CodeBuddy
|
|
46
|
-
* client renders it as \`6.67x\` beside the model in its picker; this route
|
|
47
|
-
* carries the same fact to the settings card, so a model's cost is visible at
|
|
48
|
-
* the moment it is chosen rather than only on the bill.
|
|
49
|
-
*
|
|
50
|
-
* Keyed by region because the two backends do not always agree: measured
|
|
51
|
-
* 2026-10-09, \`deepseek-v4.1-flash\` is \`0.11\` on cn against \`0.00\` on intl. A
|
|
52
|
-
* region the catalog did not name for this model is absent rather than guessed,
|
|
53
|
-
* and a model whose publisher declares no usable rate (\`default-model\` ships an
|
|
54
|
-
* empty string) carries no entry at all.
|
|
55
|
-
*
|
|
56
|
-
* Values are the bare numeric form (\`'0.79'\`), never the wire spelling: the
|
|
57
|
-
* label and the \`x\` suffix belong to whichever surface renders it.
|
|
58
|
-
*/
|
|
59
|
-
export type WorkBuddyModelCredits = Partial<Record<WorkBuddyRegion, string>>;
|
|
60
|
-
/**
|
|
61
|
-
* Parse one gateway \`credits\` string into the bare multiplier it names.
|
|
62
|
-
*
|
|
63
|
-
* Measured shapes: \`x6.67\` (intl), \`x0.79 credits\` (cn), and \`''\` for a model
|
|
64
|
-
* whose publisher declares no rate. \`x0.00\` is deliberately kept — it is a real
|
|
65
|
-
* declaration ("this model does not consume allowance"), not a missing value,
|
|
66
|
-
* so it must not be confused with the empty string that means nothing is known.
|
|
67
|
-
*
|
|
68
|
-
* The return is \`null\` rather than \`0\` for anything unparseable, so a caller can
|
|
69
|
-
* tell "no rate published" from "a rate of zero".
|
|
70
|
-
*/
|
|
71
|
-
export declare function parseWorkBuddyCreditMultiplier(raw: unknown): string | null;
|
|
72
|
-
/**
|
|
73
|
-
* Reasoning levels this route can name.
|
|
74
|
-
*
|
|
75
|
-
* Deliberately the widest set any model declares, so a saved default is not
|
|
76
|
-
* discarded merely because the model that suggested it is no longer selected.
|
|
77
|
-
* The settings card renders the subset the account's models actually declare.
|
|
78
|
-
*/
|
|
79
|
-
export type WorkBuddyReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
80
|
-
/**
|
|
81
|
-
* Every level this route can name, in escalating order (the card's sort key).
|
|
82
|
-
*
|
|
83
|
-
* `none` is the one level that is not a rung of any ladder: it is the measured
|
|
84
|
-
* spelling that turns the reasoning trace OFF upstream (`reasoning_effort:
|
|
85
|
-
* "none"`, the value the sibling gateway sends on its own cheap calls). It is
|
|
86
|
-
* only ever offered on a model the catalog marks `canDisableThinking`, so it
|
|
87
|
-
* sorts below everything and is never used to converge a level onto a ladder.
|
|
88
|
-
*/
|
|
89
|
-
export declare const WORKBUDDY_REASONING_EFFORTS: readonly WorkBuddyReasoningEffort[];
|
|
90
|
-
/**
|
|
91
|
-
* Ladder of a WorkBuddy model that leaves the level choice to the gateway.
|
|
92
|
-
*
|
|
93
|
-
* `/v3/config` publishes a model's ladder in two shapes: an explicit
|
|
94
|
-
* `supportedEfforts` list, or a lone `{ effort }` field that names only the
|
|
95
|
-
* DEFAULT. Conflating them was a real bug — the lone field first became a
|
|
96
|
-
* one-entry ladder, which rejected an explicit `low`; widening it to every
|
|
97
|
-
* level this route can name then advertised `minimal`/`xhigh` on a model that
|
|
98
|
-
* has three. Measured against the live gateway, such a model accepts exactly
|
|
99
|
-
* `low`/`high`/`max` — the same three `glm-5.3-flash` and
|
|
100
|
-
* `kimi-k2.8-preview` declare explicitly — and every other value is routed
|
|
101
|
-
* into the nearest of them rather than honoured as a level of its own.
|
|
102
|
-
*/
|
|
103
|
-
export declare const WORKBUDDY_STANDARD_EFFORTS: readonly WorkBuddyReasoningEffort[];
|
|
104
|
-
/**
|
|
105
|
-
* Snap a level onto the nearest rung a model's ladder actually exposes.
|
|
106
|
-
*
|
|
107
|
-
* The gateway names a default from a wider vocabulary than the ladder it
|
|
108
|
-
* publishes for the same model: an effort-only entry (minimax-m3, kimi-k3,
|
|
109
|
-
* `glm-5.3` in the cn region) reports `effort: 'medium'` while exposing only
|
|
110
|
-
* `low`/`high`/`max`. Letting that value through is not cosmetic — a default
|
|
111
|
-
* outside the ladder is discarded by the level-resolution step, the request
|
|
112
|
-
* then carries no `reasoning_effort`, and the model returns an EMPTY
|
|
113
|
-
* `reasoning_content` (measured on minimax-m3: 0 characters across three
|
|
114
|
-
* samples, versus 282-659 with the field). Ties resolve upward, which is the
|
|
115
|
-
* mapping the sibling Kimi line documents for `medium`. A ladder that names
|
|
116
|
-
* no level (a text-only model) yields nothing to converge to.
|
|
117
|
-
*/
|
|
118
|
-
export declare function convergeWorkBuddyEffort(effort: string, ladder: readonly string[]): WorkBuddyReasoningEffort | null;
|
|
119
|
-
/** One model offered by the WorkBuddy subscription. */
|
|
120
|
-
export interface WorkBuddyModelOption {
|
|
121
|
-
id: string;
|
|
122
|
-
name: string;
|
|
123
|
-
/** Enabled models are the ones DSH offers in the conversation model picker. */
|
|
124
|
-
enabled: boolean;
|
|
125
|
-
/** Context window this route assumes when the caller saves no override. */
|
|
126
|
-
defaultContextWindow: number;
|
|
127
|
-
/** Effective context window: the override when one is saved, else the default. */
|
|
128
|
-
contextWindow: number;
|
|
129
|
-
/** Maximum output tokens this route requests when a caller omits one. */
|
|
130
|
-
defaultMaxTokens: number;
|
|
131
|
-
/** Reasoning levels this route exposes; absent for non-reasoning models. */
|
|
132
|
-
reasoningEfforts?: string[];
|
|
133
|
-
/** Whether the model accepts image input on this route. */
|
|
134
|
-
supportsImage: boolean;
|
|
135
|
-
/** Regions that serve this model; the account's own region must be listed. */
|
|
136
|
-
regions: WorkBuddyRegion[];
|
|
137
|
-
/**
|
|
138
|
-
* Consumption multiplier per region, as the gateway declares it.
|
|
139
|
-
*
|
|
140
|
-
* Absent when nothing usable was published for this model — an unreachable
|
|
141
|
-
* gateway served by the shipped fallback for a model it does not rate, or an
|
|
142
|
-
* account whose region is not among the keys. The card must then show no
|
|
143
|
-
* multiplier rather than a placeholder: a guessed rate on a spend figure is
|
|
144
|
-
* worse than a missing one.
|
|
145
|
-
*/
|
|
146
|
-
credits?: WorkBuddyModelCredits;
|
|
147
|
-
/** One-line description shown beside the model in the settings card. */
|
|
148
|
-
description?: string;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Daily check-in preference for the CN-region billing activity.
|
|
152
|
-
*
|
|
153
|
-
* The activity is CN-only: the international deployment answers no check-in
|
|
154
|
-
* surface, so the scheduler skips those accounts outright. There is no window
|
|
155
|
-
* to configure: the first tick after the host starts is the daily run.
|
|
156
|
-
*/
|
|
157
|
-
export interface WorkBuddyCheckinSettings {
|
|
158
|
-
/** Whether the in-process scheduler signs eligible accounts in. */
|
|
159
|
-
enabled: boolean;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Aggregate check-in state the settings card renders.
|
|
163
|
-
*
|
|
164
|
-
* Deliberately account-less: the card shows one line ("checked in x/y today"),
|
|
165
|
-
* not a per-account breakdown, so no account identity crosses here either.
|
|
166
|
-
*/
|
|
167
|
-
export interface WorkBuddyCheckinSummary {
|
|
168
|
-
enabled: boolean;
|
|
169
|
-
/** CN-region accounts eligible for the check-in activity. */
|
|
170
|
-
totalAccounts: number;
|
|
171
|
-
/** Accounts confirmed signed in today (already signed, or signed by a run). */
|
|
172
|
-
doneToday: number;
|
|
173
|
-
/**
|
|
174
|
-
* Accounts whose activity reported no entitlement today.
|
|
175
|
-
*
|
|
176
|
-
* Kept apart from {@link doneToday} because "the activity is inactive" is not
|
|
177
|
-
* "you are checked in": counting them together let the card claim a sign-in
|
|
178
|
-
* that never happened.
|
|
179
|
-
*/
|
|
180
|
-
skippedToday: number;
|
|
181
|
-
/** Accounts that exhausted today's retry cap without signing in. */
|
|
182
|
-
failedToday: number;
|
|
183
|
-
/** Unix milliseconds the scheduler last ran, automatic or manual. */
|
|
184
|
-
lastRunAt: number | null;
|
|
185
|
-
}
|
|
186
|
-
/** One credit allowance reported by the billing service. */
|
|
187
|
-
export interface WorkBuddyMeter {
|
|
188
|
-
id: string;
|
|
189
|
-
label: string;
|
|
190
|
-
/** Used fraction in [0, 1] when the service reports a bounded allowance. */
|
|
191
|
-
usedFraction: number | null;
|
|
192
|
-
/** Remaining fraction in [0, 1], when the service reports one. */
|
|
193
|
-
remainingFraction: number | null;
|
|
194
|
-
used: string | null;
|
|
195
|
-
limit: string | null;
|
|
196
|
-
/** Unix milliseconds the meter resets, when reported. */
|
|
197
|
-
resetsAt: number | null;
|
|
198
|
-
description: string | null;
|
|
199
|
-
}
|
|
200
|
-
/** Account identity read from the local CodeBuddy credential file. */
|
|
201
|
-
export interface WorkBuddyAccount {
|
|
202
|
-
/** Stable, non-secret selection key derived from region + account identity. */
|
|
203
|
-
id: string;
|
|
204
|
-
uid: string | null;
|
|
205
|
-
nickname: string | null;
|
|
206
|
-
/** Tencent UIN, masked by the card rather than sent in full. */
|
|
207
|
-
uin: string | null;
|
|
208
|
-
/** Account kind the client reports, e.g. `personal`. */
|
|
209
|
-
accountType: string | null;
|
|
210
|
-
/** Enterprise/tenant id when the account is an enterprise one. */
|
|
211
|
-
enterpriseId: string | null;
|
|
212
|
-
region: WorkBuddyRegion;
|
|
213
|
-
/** Backend base URL this account's region resolves to. */
|
|
214
|
-
backend: string;
|
|
215
|
-
/** Auth domain recorded in the credential, e.g. `copilot.tencent.com`. */
|
|
216
|
-
domain: string;
|
|
217
|
-
/** Unix milliseconds the access token expires. */
|
|
218
|
-
expiresAt: number | null;
|
|
219
|
-
/** File the credential was read from; null for plugin-managed accounts. */
|
|
220
|
-
sourceFile: string | null;
|
|
221
|
-
/** Desktop credentials are external; managed credentials belong to this plugin. */
|
|
222
|
-
source: 'desktop' | 'managed';
|
|
223
|
-
/** Managed credentials may be deleted; desktop credentials may only be hidden. */
|
|
224
|
-
removable: boolean;
|
|
225
|
-
/** Hidden desktop accounts do not participate in automatic selection. */
|
|
226
|
-
hidden: boolean;
|
|
227
|
-
}
|
|
228
|
-
/** One WorkBuddy account as the shared pool card renders it. Never carries a token. */
|
|
229
|
-
export interface WorkBuddyAccountSummaryDto extends PoolAccountSummaryDto {
|
|
230
|
-
region: WorkBuddyRegion;
|
|
231
|
-
/** Which store owns the credential; only managed accounts may be deleted. */
|
|
232
|
-
source: 'desktop' | 'managed';
|
|
233
|
-
/** Whether the card may offer Delete for this account. */
|
|
234
|
-
removable: boolean;
|
|
235
|
-
nickname?: string;
|
|
236
|
-
/** Tencent UIN, masked by the card rather than shown in full. */
|
|
237
|
-
uin?: string;
|
|
238
|
-
/** IDE file a desktop account was adopted from. */
|
|
239
|
-
sourceFile?: string;
|
|
240
|
-
/** Auth domain recorded in the credential, e.g. `copilot.tencent.com`. */
|
|
241
|
-
domain?: string;
|
|
242
|
-
/** Backend base URL the account's region resolves to. */
|
|
243
|
-
backend?: string;
|
|
244
|
-
/** Account kind the client reports, e.g. `personal`. */
|
|
245
|
-
accountType?: string;
|
|
246
|
-
/**
|
|
247
|
-
* Whether the plugin currently routes to this account.
|
|
248
|
-
*
|
|
249
|
-
* Distinct from the pool's `activeAccountId`: a hidden account keeps its
|
|
250
|
-
* place in the pool but is not offered for routing while hidden.
|
|
251
|
-
*/
|
|
252
|
-
hidden?: boolean;
|
|
253
|
-
}
|
|
254
|
-
/** One point-in-time quota snapshot for the signed-in WorkBuddy account. */
|
|
255
|
-
export interface WorkBuddyAccountQuota {
|
|
256
|
-
account: WorkBuddyAccount;
|
|
257
|
-
/** Package name the billing service reports, e.g. `Free Plan Subscription`. */
|
|
258
|
-
packageName: string | null;
|
|
259
|
-
/** Total credits the package grants, as reported. */
|
|
260
|
-
totalCredits: number | null;
|
|
261
|
-
/** Credits remaining in the current cycle. */
|
|
262
|
-
remainingCredits: number | null;
|
|
263
|
-
/** Credits consumed in the current cycle. */
|
|
264
|
-
cycleUsedCredits: number | null;
|
|
265
|
-
/** Cycle allowance, when the service reports a per-cycle cap. */
|
|
266
|
-
cycleCredits: number | null;
|
|
267
|
-
/** Start of the current billing cycle, as Unix milliseconds. */
|
|
268
|
-
cycleStartsAt: number | null;
|
|
269
|
-
/** End of the current billing cycle, as Unix milliseconds. */
|
|
270
|
-
cycleEndsAt: number | null;
|
|
271
|
-
meters: WorkBuddyMeter[];
|
|
272
|
-
/** When this snapshot was read. */
|
|
273
|
-
fetchedAt: number;
|
|
274
|
-
/** Billing routes that answered, for diagnostics in the settings card. */
|
|
275
|
-
sources: string[];
|
|
276
|
-
}
|
|
277
|
-
/** Everything the settings card and the composer badge render. */
|
|
278
|
-
export interface WorkBuddyWebStatus extends Partial<AccountPoolStatusDto> {
|
|
279
|
-
enabled?: boolean;
|
|
280
|
-
authenticated: boolean;
|
|
281
|
-
hasCredentials: boolean;
|
|
282
|
-
/** Where credentials are read from; the local CodeBuddy auth directory. */
|
|
283
|
-
authDirectory: string;
|
|
284
|
-
/** Storage description for the plugin's own settings file. */
|
|
285
|
-
storagePath: string;
|
|
286
|
-
account: WorkBuddyAccount | null;
|
|
287
|
-
quota: WorkBuddyAccountQuota | null;
|
|
288
|
-
lastFetchedAt: number | null;
|
|
289
|
-
/**
|
|
290
|
-
* Whether a quota refresh is running behind this answer.
|
|
291
|
-
*
|
|
292
|
-
* The card renders the snapshot it already had instead of waiting on the
|
|
293
|
-
* upstream request; when this is true the client asks again shortly so the
|
|
294
|
-
* refreshed snapshot reaches the UI.
|
|
295
|
-
*/
|
|
296
|
-
quotaRefreshing?: boolean;
|
|
297
|
-
models: WorkBuddyModelOption[];
|
|
298
|
-
contextWindowOverrides: Record<string, number>;
|
|
299
|
-
defaultReasoningEffort: WorkBuddyReasoningEffort | null;
|
|
300
|
-
/** Account selected for model discovery and all requests; null means automatic. */
|
|
301
|
-
selectedAccountId: string | null;
|
|
302
|
-
/** Encrypted storage used for accounts added from this plugin. */
|
|
303
|
-
managedStoragePath: string;
|
|
304
|
-
/** Route the plugin currently serves; false when another plugin owns it. */
|
|
305
|
-
serving: boolean;
|
|
306
|
-
/** Diagnostic when the route is owned by a different adapter family. */
|
|
307
|
-
conflict: string | null;
|
|
308
|
-
/** Pool summaries the shared account card renders; empty without a pool. */
|
|
309
|
-
accounts?: WorkBuddyAccountSummaryDto[];
|
|
310
|
-
/** Aggregate daily check-in state; absent when the host predates check-in. */
|
|
311
|
-
checkin?: WorkBuddyCheckinSummary | null;
|
|
312
|
-
/** Which client identity chat requests present. */
|
|
313
|
-
outboundIdentity?: WorkBuddyOutboundSetting;
|
|
314
|
-
/** Local quota guardrails currently armed (all zero when off). */
|
|
315
|
-
guardrails?: WorkBuddyGuardrailsDto;
|
|
316
|
-
/**
|
|
317
|
-
* Whether this process holds the key that opens `$wbEncrypted` credentials.
|
|
318
|
-
*
|
|
319
|
-
* False with {@link sealedAccounts} above zero is the actionable state: the
|
|
320
|
-
* desktop client has sealed its tokens and nothing can read them yet.
|
|
321
|
-
*/
|
|
322
|
-
atRestKeySet?: boolean;
|
|
323
|
-
/** Sealed desktop credential files the last scan met. */
|
|
324
|
-
sealedAccounts?: number;
|
|
325
|
-
/** Why the last sealed file refused to open, when one did. */
|
|
326
|
-
sealedAccountsError?: string | null;
|
|
327
|
-
}
|
|
328
|
-
/** Patch accepted by the models/settings route. */
|
|
329
|
-
export interface WorkBuddySettingsUpdateDto {
|
|
330
|
-
enabled?: boolean;
|
|
331
|
-
enabledModelIds?: string[];
|
|
332
|
-
/** A number sets an override for that model; `null` restores the catalog default. */
|
|
333
|
-
contextWindowOverrides?: Record<string, number | null>;
|
|
334
|
-
defaultReasoningEffort?: WorkBuddyReasoningEffort | null;
|
|
335
|
-
selectedAccountId?: string | null;
|
|
336
|
-
/** Partial check-in update; omitted fields keep their stored value. */
|
|
337
|
-
checkin?: Partial<WorkBuddyCheckinSettings>;
|
|
338
|
-
/** Which client identity chat requests present. */
|
|
339
|
-
outboundIdentity?: WorkBuddyOutboundSetting;
|
|
340
|
-
/** Partial guardrail update; omitted fields keep their stored value. */
|
|
341
|
-
guardrails?: Partial<WorkBuddyGuardrailsDto>;
|
|
342
|
-
}
|
|
343
|
-
/** Result of a connection test against the upstream chat endpoint. */
|
|
344
|
-
export interface WorkBuddyConnectionDto {
|
|
345
|
-
connected: boolean;
|
|
346
|
-
account: WorkBuddyAccount | null;
|
|
347
|
-
/** Round-trip time of the probe request. */
|
|
348
|
-
latencyMs: number;
|
|
349
|
-
/** Model the probe asked for. */
|
|
350
|
-
model: string;
|
|
351
|
-
checkedAt: number;
|
|
352
|
-
}
|
|
353
|
-
//# sourceMappingURL=workbuddy-contracts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workbuddy-contracts.d.ts","sourceRoot":"","sources":["../../../src/shared/workbuddy-contracts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAE9F;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,MAAM,CAAA;AAE3C;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,cAAc,EAAE,MAAM,CAAA;IACtB,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAA;IACnB,gFAAgF;IAChF,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,4DAA4D;AAC5D,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,WAAW,GAAG,QAAQ,CAAA;AAErE;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,wBAAwB,CAAA;AAExE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAA;AAE5E;;;;;;;;;;GAUG;AACH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