@serviceme/devtools-shared 2.0.1 → 2.0.3

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.
Files changed (5) hide show
  1. package/dist/index.d.mts +1063 -1008
  2. package/dist/index.d.ts +1063 -1008
  3. package/dist/index.js +2340 -2350
  4. package/dist/index.mjs +2282 -2268
  5. package/package.json +5 -5
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ //#region src/ai/providers.types.d.ts
1
2
  /**
2
3
  * BYO Model Provider types — Phase 2 of the multi-vendor model
3
4
  * configuration system.
@@ -40,7 +41,7 @@
40
41
  * pre-fill baseUrl / displayName / default model list without
41
42
  * requiring the user to look up endpoint docs.
42
43
  */
43
- type ProviderType = "openai-compatible" | "anthropic-compatible" | "minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft" | "sensenova" | "vscode-builtin";
44
+ export type ProviderType = "openai-compatible" | "anthropic-compatible" | "minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft" | "sensenova" | "vscode-builtin";
44
45
  /**
45
46
  * Curated metadata for named, well-known models. Used as a
46
47
  * **fallback** when a `ProviderModel` entry omits one of the
@@ -72,46 +73,46 @@ type ProviderType = "openai-compatible" | "anthropic-compatible" | "minimax" | "
72
73
  * (CNY values from the per-region pricing pages on
73
74
  * https://api-docs.deepseek.com/quick_start/pricing)
74
75
  */
75
- interface CuratedModelMetadata {
76
- /** Short description for the picker's `detail` column. */
77
- detail: ModelDetail;
78
- /** Whether the model advertises vision. */
79
- imageInput: boolean;
80
- /** Whether the model supports tool calling. */
81
- toolCalling: boolean;
82
- /** USD pricing (per million tokens). */
83
- pricingUSD: ModelPricing;
84
- /** CNY pricing (per million tokens). */
85
- pricingCNY: ModelPricing;
86
- /** Tier tag for the picker's price column. */
87
- priceCategory: ModelPriceCategory;
88
- /** Thinking-dropdown schema (omit = no thinking dropdown). */
89
- thinkingSchema?: Exclude<ModelThinkingSchema, "none">;
90
- /**
91
- * Whether the endpoint additionally accepts the `reasoning_effort`
92
- * field (Zhipu official OpenAPI: "仅 GLM-5.2 及其以上模型支持",
93
- * fetched 2026-08-19). Distinct from {@link thinkingSchema}: the
94
- * 3-level dropdown rides every GLM-4.5+ model (thinking switch
95
- * on/off), while the effort field is a 5.2+ extra that older
96
- * endpoints may reject. Consumed by the OpenAI adapter to gate the
97
- * `reasoning_effort` wire field (mirrors `supportsReasoningEffort`
98
- * in `docs/references/GLM-for-copilot-main/src/consts.ts`).
99
- */
100
- supportsReasoningEffort?: boolean;
101
- /**
102
- * Context-window token caps. Centralized here (rather than as
103
- * magic numbers scattered across `BUILTIN_PROVIDER_PRESETS` call
104
- * sites) so every consumer — the named-vendor Add-form presets,
105
- * "Fetch from API" enrichment (`ProviderRegistry.fetchRemoteModels`),
106
- * and the chat-registration fallback
107
- * (`LmChatProviderRegistrar.resolveModelMetadata`) — agrees on the
108
- * same numbers for a given model id. Optional: a curated entry can
109
- * exist purely for capability/pricing metadata without token caps
110
- * (uncommon, but keeps the field honest for cases where only the
111
- * cost/capability data is verified).
112
- */
113
- maxInputTokens?: number;
114
- maxOutputTokens?: number;
76
+ export interface CuratedModelMetadata {
77
+ /** Short description for the picker's `detail` column. */
78
+ detail: ModelDetail;
79
+ /** Whether the model advertises vision. */
80
+ imageInput: boolean;
81
+ /** Whether the model supports tool calling. */
82
+ toolCalling: boolean;
83
+ /** USD pricing (per million tokens). */
84
+ pricingUSD: ModelPricing;
85
+ /** CNY pricing (per million tokens). */
86
+ pricingCNY: ModelPricing;
87
+ /** Tier tag for the picker's price column. */
88
+ priceCategory: ModelPriceCategory;
89
+ /** Thinking-dropdown schema (omit = no thinking dropdown). */
90
+ thinkingSchema?: Exclude<ModelThinkingSchema, "none">;
91
+ /**
92
+ * Whether the endpoint additionally accepts the `reasoning_effort`
93
+ * field (Zhipu official OpenAPI: "仅 GLM-5.2 及其以上模型支持",
94
+ * fetched 2026-08-19). Distinct from {@link thinkingSchema}: the
95
+ * 3-level dropdown rides every GLM-4.5+ model (thinking switch
96
+ * on/off), while the effort field is a 5.2+ extra that older
97
+ * endpoints may reject. Consumed by the OpenAI adapter to gate the
98
+ * `reasoning_effort` wire field (mirrors `supportsReasoningEffort`
99
+ * in `docs/references/GLM-for-copilot-main/src/consts.ts`).
100
+ */
101
+ supportsReasoningEffort?: boolean;
102
+ /**
103
+ * Context-window token caps. Centralized here (rather than as
104
+ * magic numbers scattered across `BUILTIN_PROVIDER_PRESETS` call
105
+ * sites) so every consumer — the named-vendor Add-form presets,
106
+ * "Fetch from API" enrichment (`ProviderRegistry.fetchRemoteModels`),
107
+ * and the chat-registration fallback
108
+ * (`LmChatProviderRegistrar.resolveModelMetadata`) — agrees on the
109
+ * same numbers for a given model id. Optional: a curated entry can
110
+ * exist purely for capability/pricing metadata without token caps
111
+ * (uncommon, but keeps the field honest for cases where only the
112
+ * cost/capability data is verified).
113
+ */
114
+ maxInputTokens?: number;
115
+ maxOutputTokens?: number;
115
116
  }
116
117
  /**
117
118
  * Short one-line description rendered in the VSCode chat model
@@ -119,7 +120,7 @@ interface CuratedModelMetadata {
119
120
  * surfaced separately as the picker's `tooltip` (multi-line). Kept
120
121
  * short (one sentence) so it fits on a single line in the picker.
121
122
  */
122
- type ModelDetail = string;
123
+ export type ModelDetail = string;
123
124
  /**
124
125
  * Pricing column metadata. Both the chat model picker and the
125
126
  * ProvidersTab form render this. `cacheRead` is the cache-hit cost
@@ -129,20 +130,20 @@ type ModelDetail = string;
129
130
  * provider has not published a cache-hit price; the picker shows
130
131
  * "(not published)" rather than a misleading zero.
131
132
  */
132
- interface ModelPricing {
133
- /** Input cost per million tokens (USD or CNY per `currencyForBaseUrl`). */
134
- input: number;
135
- /** Output cost per million tokens. */
136
- output: number;
137
- /** Cache-hit cost per million tokens. `null` = provider has not published one. */
138
- cacheRead: number | null;
133
+ export interface ModelPricing {
134
+ /** Input cost per million tokens (USD or CNY per `currencyForBaseUrl`). */
135
+ input: number;
136
+ /** Output cost per million tokens. */
137
+ output: number;
138
+ /** Cache-hit cost per million tokens. `null` = provider has not published one. */
139
+ cacheRead: number | null;
139
140
  }
140
141
  /**
141
142
  * Tier tag for the picker's price column. Aligned with the
142
143
  * upstream Copilot Chat price categories so the visual bucket
143
144
  * matches what GitHub Copilot uses for its own models.
144
145
  */
145
- type ModelPriceCategory = "low" | "medium" | "high" | "very_high";
146
+ export type ModelPriceCategory = "low" | "medium" | "high" | "very_high";
146
147
  /**
147
148
  * Thinking dropdown schema the picker renders beneath the model
148
149
  * name. The user's selection is delivered to
@@ -157,7 +158,7 @@ type ModelPriceCategory = "low" | "medium" | "high" | "very_high";
157
158
  * - `none` — picker hides the thinking dropdown
158
159
  * entirely (model has no configurable reasoning depth)
159
160
  */
160
- type ModelThinkingSchema = "thinkingEnabled" | "reasoningEffort" | "none";
161
+ export type ModelThinkingSchema = "thinkingEnabled" | "reasoningEffort" | "none";
161
162
  /**
162
163
  * One model that a provider exposes. Stable id within the provider.
163
164
  *
@@ -173,37 +174,37 @@ type ModelThinkingSchema = "thinkingEnabled" | "reasoningEffort" | "none";
173
174
  * just show up in the picker without the cost column or thinking
174
175
  * dropdown.
175
176
  */
176
- interface ProviderModel {
177
- /** Stable id within the provider (e.g. "deepseek-v4-flash", "MiniMax-M2.7") */
178
- id: string;
179
- /** Human-readable display name (defaults to id if omitted) */
180
- displayName?: string;
181
- /** Max input tokens (best-effort, may be approximate) */
182
- maxInputTokens?: number;
183
- /** Max output tokens */
184
- maxOutputTokens?: number;
185
- /** Short one-line description for the picker's `detail` column. */
186
- detail?: ModelDetail;
187
- /** Capability flags (advisory — adapter honors only what it supports) */
188
- capabilities?: {
189
- supportsImageToText?: boolean;
190
- supportsToolCalling?: boolean;
191
- };
192
- /**
193
- * Pricing block. Renders in the picker's `Input` / `Output` /
194
- * `Cache Read` columns when this model is selected. Currency is
195
- * resolved from `baseUrl` (minimaxi.com / deepseek.com → CNY,
196
- * minimax.io / others → USD); the same numeric value is shown
197
- * with the resolved currency symbol.
198
- */
199
- pricing?: ModelPricing;
200
- /** Tier tag for the picker's price column (default bucket per upstream). */
201
- priceCategory?: ModelPriceCategory;
202
- /**
203
- * Thinking-dropdown schema the picker renders for this model.
204
- * Omit (or set to `none`) to hide the dropdown entirely.
205
- */
206
- thinkingSchema?: ModelThinkingSchema;
177
+ export interface ProviderModel {
178
+ /** Stable id within the provider (e.g. "deepseek-v4-flash", "MiniMax-M2.7") */
179
+ id: string;
180
+ /** Human-readable display name (defaults to id if omitted) */
181
+ displayName?: string;
182
+ /** Max input tokens (best-effort, may be approximate) */
183
+ maxInputTokens?: number;
184
+ /** Max output tokens */
185
+ maxOutputTokens?: number;
186
+ /** Short one-line description for the picker's `detail` column. */
187
+ detail?: ModelDetail;
188
+ /** Capability flags (advisory — adapter honors only what it supports) */
189
+ capabilities?: {
190
+ supportsImageToText?: boolean;
191
+ supportsToolCalling?: boolean;
192
+ };
193
+ /**
194
+ * Pricing block. Renders in the picker's `Input` / `Output` /
195
+ * `Cache Read` columns when this model is selected. Currency is
196
+ * resolved from `baseUrl` (minimaxi.com / deepseek.com → CNY,
197
+ * minimax.io / others → USD); the same numeric value is shown
198
+ * with the resolved currency symbol.
199
+ */
200
+ pricing?: ModelPricing;
201
+ /** Tier tag for the picker's price column (default bucket per upstream). */
202
+ priceCategory?: ModelPriceCategory;
203
+ /**
204
+ * Thinking-dropdown schema the picker renders for this model.
205
+ * Omit (or set to `none`) to hide the dropdown entirely.
206
+ */
207
+ thinkingSchema?: ModelThinkingSchema;
207
208
  }
208
209
  /**
209
210
  * Per-model vision handling mode (BYOM-depth #3).
@@ -227,65 +228,65 @@ interface ProviderModel {
227
228
  * for text-only models and self-hosted gateways where inline
228
229
  * base64 is undesirable.
229
230
  */
230
- type ProviderVisionMode = "native" | "mcp";
231
+ export type ProviderVisionMode = "native" | "mcp";
231
232
  /**
232
233
  * Persisted provider configuration. `apiKeyRef` is the SecretStorage
233
234
  * key; the actual key never appears in this object after creation
234
235
  * (it's stored under `ms-devtools.providers.<id>.apiKey` and resolved
235
236
  * by `ProviderRegistry.getApiKey(id)`).
236
237
  */
237
- interface ProviderConfig {
238
- /** Stable identifier (UUID v4) — used as SecretStorage key suffix */
239
- id: string;
240
- /** UI-facing name, e.g. "MiniMax (prod)" */
241
- displayName: string;
242
- /** Provider type — picks the adapter */
243
- type: ProviderType;
244
- /** HTTP base URL (no trailing slash) */
245
- baseUrl: string;
246
- /** Reference to SecretStorage key. Format: "ms-devtools.providers.<id>.apiKey" */
247
- apiKeyRef: string;
248
- /** Models this provider exposes */
249
- models: ProviderModel[];
250
- /** Whether this provider is the user's default. At most one at a time. */
251
- isDefault?: boolean;
252
- /**
253
- * Whether this provider is active. `undefined` is treated as
254
- * `true` (pre-existing providers persisted before this field
255
- * existed default to enabled). Set to `false` to stop the
256
- * provider's models from being registered with `vscode.lm`
257
- * (see `LmChatProviderRegistrar`) without deleting the provider
258
- * config or its SecretStorage-held API key — the user can
259
- * re-enable it later without re-entering credentials.
260
- */
261
- enabled?: boolean;
262
- /**
263
- * MiniMax billing type for this provider's API key.
264
- * `token_plan` — key is on a coding plan; usage can be fetched via the coding_plan API.
265
- * `pay_as_you_go` — key is pure pay-as-you-go; no usage API available.
266
- * Ignored for non-minimax providers.
267
- */
268
- minimaxBillingType?: "token_plan" | "pay_as_you_go";
269
- /**
270
- * Per-provider vision handling mode (BYOM-depth #3). Defaults
271
- * to `"native"` when absent — the existing v0 behaviour,
272
- * byte-identical to the pre-BYOM-depth path. Set to `"mcp"`
273
- * to route image-bearing requests through the on-disk
274
- * placeholder path (useful for text-only models and self-
275
- * hosted gateways). See {@link ProviderVisionMode} for the
276
- * full contract.
277
- */
278
- visionMode?: ProviderVisionMode;
279
- /** Created / updated timestamps (informational) */
280
- createdAt: string;
281
- updatedAt: string;
282
- /**
283
- * Display order hint. Lower values sort first. User-added providers
284
- * that never had their order explicitly set default to `0`. Builtin
285
- * (`vscode-builtin`) is always injected at position `0` regardless
286
- * of this field — its sort order is fixed.
287
- */
288
- sortOrder?: number;
238
+ export interface ProviderConfig {
239
+ /** Stable identifier (UUID v4) — used as SecretStorage key suffix */
240
+ id: string;
241
+ /** UI-facing name, e.g. "MiniMax (prod)" */
242
+ displayName: string;
243
+ /** Provider type — picks the adapter */
244
+ type: ProviderType;
245
+ /** HTTP base URL (no trailing slash) */
246
+ baseUrl: string;
247
+ /** Reference to SecretStorage key. Format: "ms-devtools.providers.<id>.apiKey" */
248
+ apiKeyRef: string;
249
+ /** Models this provider exposes */
250
+ models: ProviderModel[];
251
+ /** Whether this provider is the user's default. At most one at a time. */
252
+ isDefault?: boolean;
253
+ /**
254
+ * Whether this provider is active. `undefined` is treated as
255
+ * `true` (pre-existing providers persisted before this field
256
+ * existed default to enabled). Set to `false` to stop the
257
+ * provider's models from being registered with `vscode.lm`
258
+ * (see `LmChatProviderRegistrar`) without deleting the provider
259
+ * config or its SecretStorage-held API key — the user can
260
+ * re-enable it later without re-entering credentials.
261
+ */
262
+ enabled?: boolean;
263
+ /**
264
+ * MiniMax billing type for this provider's API key.
265
+ * `token_plan` — key is on a coding plan; usage can be fetched via the coding_plan API.
266
+ * `pay_as_you_go` — key is pure pay-as-you-go; no usage API available.
267
+ * Ignored for non-minimax providers.
268
+ */
269
+ minimaxBillingType?: "token_plan" | "pay_as_you_go";
270
+ /**
271
+ * Per-provider vision handling mode (BYOM-depth #3). Defaults
272
+ * to `"native"` when absent — the existing v0 behaviour,
273
+ * byte-identical to the pre-BYOM-depth path. Set to `"mcp"`
274
+ * to route image-bearing requests through the on-disk
275
+ * placeholder path (useful for text-only models and self-
276
+ * hosted gateways). See {@link ProviderVisionMode} for the
277
+ * full contract.
278
+ */
279
+ visionMode?: ProviderVisionMode;
280
+ /** Created / updated timestamps (informational) */
281
+ createdAt: string;
282
+ updatedAt: string;
283
+ /**
284
+ * Display order hint. Lower values sort first. User-added providers
285
+ * that never had their order explicitly set default to `0`. Builtin
286
+ * (`vscode-builtin`) is always injected at position `0` regardless
287
+ * of this field — its sort order is fixed.
288
+ */
289
+ sortOrder?: number;
289
290
  }
290
291
  /**
291
292
  * Public-facing projection of {@link ProviderConfig}. Strips
@@ -295,9 +296,9 @@ interface ProviderConfig {
295
296
  * resolves it at chat time. `hasApiKey` is a boolean only — never
296
297
  * the actual value.
297
298
  */
298
- type PublicProvider = Omit<ProviderConfig, "apiKeyRef"> & {
299
- /** Whether this provider has a key configured (boolean only, never the value) */
300
- hasApiKey: boolean;
299
+ export type PublicProvider = Omit<ProviderConfig, "apiKeyRef"> & {
300
+ /** Whether this provider has a key configured (boolean only, never the value) */
301
+ hasApiKey: boolean;
301
302
  };
302
303
  /**
303
304
  * Result of a connectivity probe. `ok=true` means credentials +
@@ -306,19 +307,19 @@ type PublicProvider = Omit<ProviderConfig, "apiKeyRef"> & {
306
307
  * `sampleModelId` is the first model id the provider reported
307
308
  * (helpful when validating "does this base URL serve the models I expect").
308
309
  */
309
- interface ProviderTestResult {
310
- ok: boolean;
311
- latencyMs?: number;
312
- sampleModelId?: string;
313
- error?: string;
310
+ export interface ProviderTestResult {
311
+ ok: boolean;
312
+ latencyMs?: number;
313
+ sampleModelId?: string;
314
+ error?: string;
314
315
  }
315
316
  /**
316
317
  * Message types for the providers list. Used in `GetProviders` /
317
318
  * `ProvidersResponse` envelopes.
318
319
  */
319
- interface ProvidersResponsePayload {
320
- providers: PublicProvider[];
321
- defaultProviderId: string | null;
320
+ export interface ProvidersResponsePayload {
321
+ providers: PublicProvider[];
322
+ defaultProviderId: string | null;
322
323
  }
323
324
  /**
324
325
  * Payload for `AddProvider` / `UpdateProvider`. Does NOT include
@@ -329,101 +330,101 @@ interface ProvidersResponsePayload {
329
330
  * SecretStorage and never echoes it back. Pass empty string to
330
331
  * leave an existing key untouched on update.
331
332
  */
332
- interface ProviderMutationPayload {
333
- id?: string;
334
- displayName: string;
335
- type: ProviderType;
336
- baseUrl: string;
337
- apiKey: string;
338
- models: ProviderModel[];
339
- isDefault?: boolean;
340
- /** See {@link ProviderConfig.enabled}. Omit to leave unchanged on update / default to `true` on add. */
341
- enabled?: boolean;
342
- /** See {@link ProviderConfig.minimaxBillingType}. */
343
- minimaxBillingType?: "token_plan" | "pay_as_you_go";
344
- /**
345
- * See {@link ProviderConfig.visionMode} (2026-08-20 — surfaced in
346
- * the ProvidersTab form). Omit to leave unchanged on update /
347
- * default to `"native"` on add.
348
- */
349
- visionMode?: ProviderVisionMode;
333
+ export interface ProviderMutationPayload {
334
+ id?: string;
335
+ displayName: string;
336
+ type: ProviderType;
337
+ baseUrl: string;
338
+ apiKey: string;
339
+ models: ProviderModel[];
340
+ isDefault?: boolean;
341
+ /** See {@link ProviderConfig.enabled}. Omit to leave unchanged on update / default to `true` on add. */
342
+ enabled?: boolean;
343
+ /** See {@link ProviderConfig.minimaxBillingType}. */
344
+ minimaxBillingType?: "token_plan" | "pay_as_you_go";
345
+ /**
346
+ * See {@link ProviderConfig.visionMode} (2026-08-20 — surfaced in
347
+ * the ProvidersTab form). Omit to leave unchanged on update /
348
+ * default to `"native"` on add.
349
+ */
350
+ visionMode?: ProviderVisionMode;
350
351
  }
351
352
  /** Which vendor API to call for usage data. */
352
- type ProviderUsageKind = "minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita";
353
+ export type ProviderUsageKind = "minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita";
353
354
  /**
354
355
  * One quota window (5h or weekly) from a coding-plan provider.
355
356
  * `utilizationPercent` is precomputed as `100 - remaining_percent`.
356
357
  */
357
- interface UsageWindow {
358
- /** 0..100 utilization */
359
- utilizationPercent: number;
360
- /** ISO 8601 reset time */
361
- resetsAt: string;
362
- /** Precomputed epoch ms (webview convenience) */
363
- resetsAtMs: number;
358
+ export interface UsageWindow {
359
+ /** 0..100 utilization */
360
+ utilizationPercent: number;
361
+ /** ISO 8601 reset time */
362
+ resetsAt: string;
363
+ /** Precomputed epoch ms (webview convenience) */
364
+ resetsAtMs: number;
364
365
  }
365
366
  /** MiniMax `/coding_plan/remains` response, normalised. */
366
- interface MinimaxUsage {
367
- kind: "minimax";
368
- /** 5-hour billing window (always present, derived from model_name === "general") */
369
- interval: UsageWindow;
370
- /** Weekly quota — only present when the account has a weekly cap. */
371
- weekly?: UsageWindow;
367
+ export interface MinimaxUsage {
368
+ kind: "minimax";
369
+ /** 5-hour billing window (always present, derived from model_name === "general") */
370
+ interval: UsageWindow;
371
+ /** Weekly quota — only present when the account has a weekly cap. */
372
+ weekly?: UsageWindow;
372
373
  }
373
374
  /**
374
375
  * Shared coding-plan usage for Kimi / Zhipu (same five_hour + optional weekly structure).
375
376
  * Parsed from their respective API responses into this normalised shape.
376
377
  */
377
- interface CodingPlanUsage {
378
- kind: "kimi" | "zhipu";
379
- /** Five-hour billing window */
380
- interval: UsageWindow;
381
- /** Weekly quota — only present when the account has a weekly cap. */
382
- weekly?: UsageWindow;
378
+ export interface CodingPlanUsage {
379
+ kind: "kimi" | "zhipu";
380
+ /** Five-hour billing window */
381
+ interval: UsageWindow;
382
+ /** Weekly quota — only present when the account has a weekly cap. */
383
+ weekly?: UsageWindow;
383
384
  }
384
385
  /** One currency row in a balance response. */
385
- interface BalanceEntry {
386
- currency: string;
387
- totalBalance: number;
386
+ export interface BalanceEntry {
387
+ currency: string;
388
+ totalBalance: number;
388
389
  }
389
390
  /** DeepSeek-specific balance entry (includes granted + topped-up breakdown). */
390
- interface DeepseekBalanceEntry {
391
- currency: string;
392
- totalBalance: number;
393
- grantedBalance?: number;
394
- toppedUpBalance?: number;
391
+ export interface DeepseekBalanceEntry {
392
+ currency: string;
393
+ totalBalance: number;
394
+ grantedBalance?: number;
395
+ toppedUpBalance?: number;
395
396
  }
396
397
  /** DeepSeek `/user/balance` response, normalised. */
397
- interface DeepseekUsage {
398
- kind: "deepseek";
399
- isAvailable: boolean;
400
- balances: DeepseekBalanceEntry[];
398
+ export interface DeepseekUsage {
399
+ kind: "deepseek";
400
+ isAvailable: boolean;
401
+ balances: DeepseekBalanceEntry[];
401
402
  }
402
403
  /**
403
404
  * Generic balance for StepFun / SiliconFlow / OpenRouter / Novita.
404
405
  * Each provider returns a different response shape; the parse function normalises
405
406
  * all four into this shared interface.
406
407
  */
407
- interface GenericBalanceUsage {
408
- kind: "stepfun" | "siliconflow" | "openrouter" | "novita";
409
- balances: BalanceEntry[];
408
+ export interface GenericBalanceUsage {
409
+ kind: "stepfun" | "siliconflow" | "openrouter" | "novita";
410
+ balances: BalanceEntry[];
410
411
  }
411
412
  /** Union of all supported vendor usage shapes. */
412
- type ProviderUsageData = MinimaxUsage | DeepseekUsage | CodingPlanUsage | GenericBalanceUsage;
413
+ export type ProviderUsageData = MinimaxUsage | DeepseekUsage | CodingPlanUsage | GenericBalanceUsage;
413
414
  /**
414
415
  * Result of a usage probe. `transient` governs the webview's keep-last-good
415
416
  * strategy: true = network/timeout (retry silently), false = deterministic
416
417
  * (auth/parse/4xx — drop last good, show hard error).
417
418
  */
418
- type ProviderUsageResult = {
419
- ok: true;
420
- data: ProviderUsageData;
421
- fetchedAtMs: number;
419
+ export type ProviderUsageResult = {
420
+ ok: true;
421
+ data: ProviderUsageData;
422
+ fetchedAtMs: number;
422
423
  } | {
423
- ok: false;
424
- transient: boolean;
425
- code: string;
426
- message: string;
424
+ ok: false;
425
+ transient: boolean;
426
+ code: string;
427
+ message: string;
427
428
  };
428
429
  /**
429
430
  * Cache_control capability declaration, keyed by provider type.
@@ -442,9 +443,9 @@ type ProviderUsageResult = {
442
443
  * == entire cache path is SKIPPED. Avoids 400 risk on unknown
443
444
  * upstreams.
444
445
  */
445
- interface ProviderCacheControlMetadata {
446
- /** Stable prompt-prefix cache declared by the upstream? (OpenAI path reads this) */
447
- supportsCacheControl?: boolean;
446
+ export interface ProviderCacheControlMetadata {
447
+ /** Stable prompt-prefix cache declared by the upstream? (OpenAI path reads this) */
448
+ supportsCacheControl?: boolean;
448
449
  }
449
450
  /**
450
451
  * A single known-good baseUrl candidate for a provider type, offered
@@ -452,12 +453,13 @@ interface ProviderCacheControlMetadata {
452
453
  * `<input>` stays freely editable — these are suggestions, not an
453
454
  * enum; the user can always type a custom endpoint.
454
455
  */
455
- interface ProviderBaseUrlPreset {
456
- /** Short human label distinguishing candidates (e.g. "国内" / "全球"). */
457
- label: string;
458
- baseUrl: string;
456
+ export interface ProviderBaseUrlPreset {
457
+ /** Short human label distinguishing candidates (e.g. "国内" / "全球"). */
458
+ label: string;
459
+ baseUrl: string;
459
460
  }
460
-
461
+ //#endregion
462
+ //#region src/ai/protocol.d.ts
461
463
  /**
462
464
  * Wire protocol implied by a `baseUrl`.
463
465
  *
@@ -488,8 +490,8 @@ interface ProviderBaseUrlPreset {
488
490
  * we do not currently support routing to Anthropic's own
489
491
  * production API (their models are first-class VSCode features).
490
492
  */
491
- type ProviderWireProtocol = "openai" | "anthropic";
492
- declare function protocolForBaseUrl(baseUrl: string): ProviderWireProtocol;
493
+ export type ProviderWireProtocol = "openai" | "anthropic";
494
+ export declare function protocolForBaseUrl(baseUrl: string): ProviderWireProtocol;
493
495
  /**
494
496
  * Resolve the actual `ProviderType` whose adapter should handle a
495
497
  * request with the given `configuredType` + `baseUrl`.
@@ -513,8 +515,9 @@ declare function protocolForBaseUrl(baseUrl: string): ProviderWireProtocol;
513
515
  * `configuredType` unchanged — these vendors don't publish an
514
516
  * alternate-protocol endpoint on the same host.
515
517
  */
516
- declare function effectiveAdapterType(configuredType: ProviderType, baseUrl: string): ProviderType;
517
-
518
+ export declare function effectiveAdapterType(configuredType: ProviderType, baseUrl: string): ProviderType;
519
+ //#endregion
520
+ //#region src/ai/providers.base-url.d.ts
518
521
  /**
519
522
  * Provider-type → known baseUrl candidates (e.g. mainland-China vs.
520
523
  * global endpoints for the same vendor, like Agnes/MiniMax/DeepSeek).
@@ -522,28 +525,30 @@ declare function effectiveAdapterType(configuredType: ProviderType, baseUrl: str
522
525
  * no runtime auto-switching reads this (that mechanism was removed;
523
526
  * see git history for the retired `autoSwitch` feature).
524
527
  */
525
- declare const PROVIDER_BASE_URL_PRESETS: Readonly<Record<ProviderType, readonly ProviderBaseUrlPreset[]>>;
528
+ export declare const PROVIDER_BASE_URL_PRESETS: Readonly<Record<ProviderType, readonly ProviderBaseUrlPreset[]>>;
526
529
  /**
527
530
  * Resolve the dropdown candidate list for a provider type. Returns
528
531
  * an empty array (NEVER throws) for `-compatible` types or provider
529
532
  * types the table doesn't cover.
530
533
  */
531
- declare function getProviderBaseUrlPresets(type: ProviderType): readonly ProviderBaseUrlPreset[];
532
-
534
+ export declare function getProviderBaseUrlPresets(type: ProviderType): readonly ProviderBaseUrlPreset[];
535
+ //#endregion
536
+ //#region src/ai/providers.cache-control.d.ts
533
537
  /**
534
538
  * Provider-type → cache_control capability lookup. Read by the
535
539
  * OpenAI adapter's `prompt_cache_key` decision (T-04) via
536
540
  * {@link isProviderCacheControlAware}.
537
541
  */
538
- declare const PROVIDER_CACHE_CONTROL_METADATA: Readonly<Record<ProviderType, ProviderCacheControlMetadata>>;
542
+ export declare const PROVIDER_CACHE_CONTROL_METADATA: Readonly<Record<ProviderType, ProviderCacheControlMetadata>>;
539
543
  /**
540
544
  * Does this provider type declare "stable prompt cache" support?
541
545
  * The OpenAI path reads this flag to decide whether to write
542
546
  * `prompt_cache_key`; the Anthropic path uses its own 4-breakpoint
543
547
  * logic and ignores this flag.
544
548
  */
545
- declare function isProviderCacheControlAware(type: ProviderType): boolean;
546
-
549
+ export declare function isProviderCacheControlAware(type: ProviderType): boolean;
550
+ //#endregion
551
+ //#region src/ai/providers.metadata.d.ts
547
552
  /**
548
553
  * Map of namespaced model ids (used by aggregator platforms like
549
554
  * SiliconFlow and Novita) to their primary entry. **Exported** so
@@ -556,9 +561,9 @@ declare function isProviderCacheControlAware(type: ProviderType): boolean;
556
561
  * aggregator alias, do it here so the merged `MODEL_METADATA`
557
562
  * auto-tracks the primary.
558
563
  */
559
- declare const NAMESPACE_ALIASES: Readonly<Record<string, string>>;
560
- declare const NAMESPACE_ALIAS_FAMILY: Readonly<Record<string, string>>;
561
- declare const MODEL_METADATA: Readonly<Record<string, CuratedModelMetadata>>;
564
+ export declare const NAMESPACE_ALIASES: Readonly<Record<string, string>>;
565
+ export declare const NAMESPACE_ALIAS_FAMILY: Readonly<Record<string, string>>;
566
+ export declare const MODEL_METADATA: Readonly<Record<string, CuratedModelMetadata>>;
562
567
  /**
563
568
  * Look up curated metadata for a model by its un-qualified id
564
569
  * (the part after the last `::` in a qualified id, or the raw id
@@ -567,7 +572,7 @@ declare const MODEL_METADATA: Readonly<Record<string, CuratedModelMetadata>>;
567
572
  * callers should then fall back to whatever the user typed into
568
573
  * the ProvidersTab.
569
574
  */
570
- declare function lookupModelMetadata(modelId: string): CuratedModelMetadata | undefined;
575
+ export declare function lookupModelMetadata(modelId: string): CuratedModelMetadata | undefined;
571
576
  /**
572
577
  * Resolve the currency for a baseUrl. Strict hostname match —
573
578
  * `api.minimaxi.com` and `api.minimaxi.cn` map to CNY (the China
@@ -585,8 +590,9 @@ declare function lookupModelMetadata(modelId: string): CuratedModelMetadata | un
585
590
  * the price those users actually pay. The DeepSeek entries pin the
586
591
  * PEAK tier (conservative worst-case; off-peak is exactly half).
587
592
  */
588
- declare function currencyForBaseUrl(baseUrl: string): "USD" | "CNY";
589
-
593
+ export declare function currencyForBaseUrl(baseUrl: string): "USD" | "CNY";
594
+ //#endregion
595
+ //#region src/ai/providers.presets.d.ts
590
596
  /**
591
597
  * Default configuration snippets shipped with named vendor types.
592
598
  *
@@ -638,7 +644,7 @@ declare function currencyForBaseUrl(baseUrl: string): "USD" | "CNY";
638
644
  * `PROVIDER_BASE_URL_PRESETS` dropdown or user-typed); the empty
639
645
  * `""` default picks USD as a safe fallback.
640
646
  */
641
- declare function buildPresetModel(id: string, displayName: string, baseUrl?: string): ProviderModel;
647
+ export declare function buildPresetModel(id: string, displayName: string, baseUrl?: string): ProviderModel;
642
648
  /**
643
649
  * Union a model row returned by the "Fetch from API" flow with its
644
650
  * curated preset metadata, when the id matches an entry in
@@ -690,18 +696,18 @@ declare function buildPresetModel(id: string, displayName: string, baseUrl?: str
690
696
  * so `lookupModelMetadata("deepseek-ai/DeepSeek-V4-Pro")` returns
691
697
  * the same object as `lookupModelMetadata("deepseek-v4-pro")`.
692
698
  */
693
- declare function unionProviderModelWithPreset(fetched: ProviderModel, baseUrl: string): ProviderModel;
699
+ export declare function unionProviderModelWithPreset(fetched: ProviderModel, baseUrl: string): ProviderModel;
694
700
  /**
695
701
  * One entry in the "Pick from preset" dropdown shown next to the
696
702
  * "+ Add model" button in ProvidersTab.
697
703
  */
698
- interface PresetModelListing {
699
- /** Canonical (primary, non-alias) model id; safe to feed to {@link buildPresetModel}. */
700
- id: string;
701
- /** Short human label; the dropdown option text. */
702
- displayName: string;
703
- /** Vendor family bucket — drives the `<optgroup>` grouping. */
704
- vendorFamily: string;
704
+ export interface PresetModelListing {
705
+ /** Canonical (primary, non-alias) model id; safe to feed to {@link buildPresetModel}. */
706
+ id: string;
707
+ /** Short human label; the dropdown option text. */
708
+ displayName: string;
709
+ /** Vendor family bucket — drives the `<optgroup>` grouping. */
710
+ vendorFamily: string;
705
711
  }
706
712
  /**
707
713
  * The list of vendor family groups shown in the preset dropdown.
@@ -716,7 +722,7 @@ interface PresetModelListing {
716
722
  * last because users on aggregators usually type the namespaced
717
723
  * id by hand rather than reach for a curated dropdown.
718
724
  */
719
- declare const PRESET_MODEL_FAMILIES: readonly string[];
725
+ export declare const PRESET_MODEL_FAMILIES: readonly string[];
720
726
  /**
721
727
  * The "Pick from preset" dropdown options — every curated primary
722
728
  * entry in `MODEL_METADATA` PLUS every alias tagged with an
@@ -755,7 +761,7 @@ declare const PRESET_MODEL_FAMILIES: readonly string[];
755
761
  * still rename the field after picking — this is just a starter
756
762
  * label.
757
763
  */
758
- declare const LISTABLE_PRESET_MODELS: readonly PresetModelListing[];
764
+ export declare const LISTABLE_PRESET_MODELS: readonly PresetModelListing[];
759
765
  /**
760
766
  * Group {@link LISTABLE_PRESET_MODELS} by `vendorFamily`, preserving
761
767
  * the order declared in {@link PRESET_MODEL_FAMILIES} (most-common
@@ -765,15 +771,15 @@ declare const LISTABLE_PRESET_MODELS: readonly PresetModelListing[];
765
771
  * Returns: array of `{ family, entries }` — the shape a UI
766
772
  * `<select>` renderer expects when building `<optgroup>`s.
767
773
  */
768
- interface PresetModelFamilyGroup {
769
- family: string;
770
- entries: readonly PresetModelListing[];
774
+ export interface PresetModelFamilyGroup {
775
+ family: string;
776
+ entries: readonly PresetModelListing[];
771
777
  }
772
- declare function listPresetModelGroups(): readonly PresetModelFamilyGroup[];
773
- declare const BUILTIN_PROVIDER_PRESETS: Readonly<Record<"minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft" | "sensenova", {
774
- displayName: string;
775
- baseUrl: string;
776
- models: ProviderModel[];
778
+ export declare function listPresetModelGroups(): readonly PresetModelFamilyGroup[];
779
+ export declare const BUILTIN_PROVIDER_PRESETS: Readonly<Record<"minimax" | "deepseek" | "kimi" | "zhipu" | "stepfun" | "siliconflow" | "openrouter" | "novita" | "agnes" | "medalsoft" | "sensenova", {
780
+ displayName: string;
781
+ baseUrl: string;
782
+ models: ProviderModel[];
777
783
  }>>;
778
784
  /**
779
785
  * Look up the curated friendly displayName for a model id. Two
@@ -814,18 +820,19 @@ declare const BUILTIN_PROVIDER_PRESETS: Readonly<Record<"minimax" | "deepseek" |
814
820
  * or "GLM-4.7 Flash" instead of the bare id right after the
815
821
  * fetch result lands.
816
822
  */
817
- declare function getPresetModelDisplayName(id: string): string | undefined;
823
+ export declare function getPresetModelDisplayName(id: string): string | undefined;
818
824
  /**
819
825
  * Look up the default config (displayName / baseUrl / models) for a
820
826
  * named vendor type. Returns `null` for the `-compatible` family —
821
827
  * those have no canned defaults; the user enters them by hand.
822
828
  */
823
- declare function getBuiltinProviderPreset(type: ProviderType): {
824
- displayName: string;
825
- baseUrl: string;
826
- models: ProviderModel[];
829
+ export declare function getBuiltinProviderPreset(type: ProviderType): {
830
+ displayName: string;
831
+ baseUrl: string;
832
+ models: ProviderModel[];
827
833
  } | null;
828
-
834
+ //#endregion
835
+ //#region src/ai-models.d.ts
829
836
  /**
830
837
  * Shared AI model types.
831
838
  *
@@ -842,10 +849,10 @@ declare function getBuiltinProviderPreset(type: ProviderType): {
842
849
  * `context.globalState` and used to select a model from
843
850
  * `vscode.lm.selectChatModels({ vendor, family })`.
844
851
  */
845
- interface AIModelConfig {
846
- vendor: string;
847
- family?: string;
848
- version?: string;
852
+ export interface AIModelConfig {
853
+ vendor: string;
854
+ family?: string;
855
+ version?: string;
849
856
  }
850
857
  /**
851
858
  * Webview-friendly projection of `vscode.LanguageModelChat`.
@@ -856,20 +863,21 @@ interface AIModelConfig {
856
863
  * Webview can render capability badges (tool calling, image input)
857
864
  * without a second round-trip.
858
865
  */
859
- interface AIModelInfo {
860
- id: string;
861
- name: string;
862
- vendor: string;
863
- family?: string;
864
- version?: string;
865
- maxInputTokens?: number;
866
- maxOutputTokens?: number;
867
- capabilities?: {
868
- supportsImageToText?: boolean;
869
- supportsToolCalling?: boolean;
870
- };
871
- }
872
-
866
+ export interface AIModelInfo {
867
+ id: string;
868
+ name: string;
869
+ vendor: string;
870
+ family?: string;
871
+ version?: string;
872
+ maxInputTokens?: number;
873
+ maxOutputTokens?: number;
874
+ capabilities?: {
875
+ supportsImageToText?: boolean;
876
+ supportsToolCalling?: boolean;
877
+ };
878
+ }
879
+ //#endregion
880
+ //#region src/certificate-bundle.d.ts
873
881
  /**
874
882
  * Certificate bundle download — wire types shared between the certificate
875
883
  * Webview (apps/webview-ui/src/certificate) and the extension panel service
@@ -879,58 +887,59 @@ interface AIModelInfo {
879
887
  * format and receiving the resulting zip.
880
888
  */
881
889
  /** Target formats that the extension can produce via `sslkit`. */
882
- type CertificateBundleFormat = "pem" | "pfx" | "crt" | "jks";
890
+ export type CertificateBundleFormat = "pem" | "pfx" | "crt" | "jks";
883
891
  /** Static metadata describing each supported bundle format — used by the UI
884
892
  * to render the format picker without hard-coding labels in two places. */
885
- interface CertificateBundleFormatDescriptor {
886
- readonly format: CertificateBundleFormat;
887
- /** Short label shown in the picker (e.g. "Nginx PEM"). */
888
- readonly label: string;
889
- /** One-line description of what the format is for. */
890
- readonly description: string;
891
- /** Icon name (lucide) for the picker button. */
892
- readonly icon: string;
893
- /** Whether this format requires a password (PFX / JKS). */
894
- readonly requiresPassword: boolean;
895
- /** Conventional file extension(s) for the primary artifact(s) the user
896
- * is downloading, shown in the picker subtitle. */
897
- readonly artifactExtension: string;
898
- }
899
- declare const CERTIFICATE_BUNDLE_FORMATS: readonly CertificateBundleFormatDescriptor[];
893
+ export interface CertificateBundleFormatDescriptor {
894
+ readonly format: CertificateBundleFormat;
895
+ /** Short label shown in the picker (e.g. "Nginx PEM"). */
896
+ readonly label: string;
897
+ /** One-line description of what the format is for. */
898
+ readonly description: string;
899
+ /** Icon name (lucide) for the picker button. */
900
+ readonly icon: string;
901
+ /** Whether this format requires a password (PFX / JKS). */
902
+ readonly requiresPassword: boolean;
903
+ /** Conventional file extension(s) for the primary artifact(s) the user
904
+ * is downloading, shown in the picker subtitle. */
905
+ readonly artifactExtension: string;
906
+ }
907
+ export declare const CERTIFICATE_BUNDLE_FORMATS: readonly CertificateBundleFormatDescriptor[];
900
908
  /** Request sent from the Webview when the user picks a format. */
901
- interface DownloadCertificateBundleRequest {
902
- id: string;
903
- format: CertificateBundleFormat;
904
- /** Override for the export password (PFX / JKS only). When omitted, the
905
- * extension falls back to the `ms-devtools.certificate.exportPassword`
906
- * setting; when that is unset, a strong random password is generated
907
- * per export. */
908
- password?: string;
909
+ export interface DownloadCertificateBundleRequest {
910
+ id: string;
911
+ format: CertificateBundleFormat;
912
+ /** Override for the export password (PFX / JKS only). When omitted, the
913
+ * extension falls back to the `ms-devtools.certificate.exportPassword`
914
+ * setting; when that is unset, a strong random password is generated
915
+ * per export. */
916
+ password?: string;
909
917
  }
910
918
  /** Response sent back to the Webview — same shape as the existing PEM bundle
911
919
  * download (filename + base64 zip), so the Webview side can reuse its
912
920
  * existing download helper without branching on format. */
913
- interface DownloadCertificateBundleResponse {
914
- success: boolean;
915
- filename?: string;
916
- mime?: string;
917
- base64?: string;
918
- error?: string;
921
+ export interface DownloadCertificateBundleResponse {
922
+ success: boolean;
923
+ filename?: string;
924
+ mime?: string;
925
+ base64?: string;
926
+ error?: string;
919
927
  }
920
928
  /** Feature availability reported by the extension to the Webview so the UI
921
929
  * can grey out formats whose prerequisites aren't met on this machine. */
922
- interface CertificateBundleEnvironmentSupport {
923
- /** `true` once `sslkit` was resolved via `node_modules/.bin` or PATH. */
924
- sslkitAvailable: boolean;
925
- /** `true` once `keytool` was found on PATH (required only for JKS). */
926
- jdkAvailable: boolean;
927
- /** Mirror of `msDevTools.certificate.exportPassword` — surfaces the
928
- * effective default (the configured value, or a freshly generated
929
- * random one when unset) so the UI doesn't have to subscribe to config
930
- * change events. */
931
- defaultPassword: string;
932
- }
933
-
930
+ export interface CertificateBundleEnvironmentSupport {
931
+ /** `true` once `sslkit` was resolved via `node_modules/.bin` or PATH. */
932
+ sslkitAvailable: boolean;
933
+ /** `true` once `keytool` was found on PATH (required only for JKS). */
934
+ jdkAvailable: boolean;
935
+ /** Mirror of `msDevTools.certificate.exportPassword` — surfaces the
936
+ * effective default (the configured value, or a freshly generated
937
+ * random one when unset) so the UI doesn't have to subscribe to config
938
+ * change events. */
939
+ defaultPassword: string;
940
+ }
941
+ //#endregion
942
+ //#region src/constants.d.ts
934
943
  /**
935
944
  * Medalsoft-internal infrastructure addresses.
936
945
  *
@@ -945,46 +954,47 @@ interface CertificateBundleEnvironmentSupport {
945
954
  * needs — ADL-003 forbids core → shared. Keep those in lock-step.
946
955
  */
947
956
  /** Medalsoft 内网 LLM 网关(OpenAI-compatible `/v1`),仅办公网可达。 */
948
- declare const MEDALSOFT_PRIVATE_GATEWAY_URL = "http://10.10.10.249:3000/v1";
957
+ export declare const MEDALSOFT_PRIVATE_GATEWAY_URL = "http://10.10.10.249:3000/v1";
949
958
  /** Medalsoft 私有 NuGet 源,仅办公网可达。 */
950
- declare const MEDALSOFT_NUGET_PRIVATE_SOURCE = "http://192.168.20.209:10010/nuget";
951
-
952
- type CopilotCustomizationScope = "workspace" | "personal";
953
- type CopilotCustomizationArtifactKind = "agent" | "skill" | "prompt" | "instruction" | "mcp" | "hook";
954
- type CopilotCustomizationInstallIntent = "available" | "selected" | "moving" | "removing";
955
- type CopilotCustomizationHealth = "healthy" | "missing" | "drifted" | "conflict" | "source-unavailable" | "unsupported";
956
- type CopilotCustomizationGate = "ready" | "approval-required" | "configuration-required";
957
- type CopilotCustomizationStatus = "healthy" | "action-required" | "blocked" | "not-enabled";
958
- interface CopilotArtifactStatePayload {
959
- intent: CopilotCustomizationInstallIntent;
960
- health: CopilotCustomizationHealth;
961
- gate: CopilotCustomizationGate;
962
- }
963
- interface CopilotArtifactSummaryPayload {
964
- id: string;
965
- packageId: string;
966
- kind: CopilotCustomizationArtifactKind;
967
- displayName: string;
968
- description?: string;
969
- installStrategy: "link" | "generated-config" | "approval-gated";
970
- risk: "none" | "review-required";
971
- }
972
- interface CopilotPackageInstallationPayload {
973
- packageId: string;
974
- scope: CopilotCustomizationScope;
975
- selectedArtifactIds: string[];
976
- pinnedVersion?: string;
977
- }
978
- interface CopilotPackageDefinitionPayload {
979
- id: string;
980
- sourceId: string;
981
- displayName: string;
982
- description?: string;
983
- version?: string;
984
- artifacts: CopilotArtifactSummaryPayload[];
985
- /** Whole-package registrar installation — the home package list shows
986
- * these; per-artifact v1 manifest plugins stay in enabled-content. */
987
- wholePackage?: boolean;
959
+ export declare const MEDALSOFT_NUGET_PRIVATE_SOURCE = "http://192.168.20.209:10010/nuget";
960
+ //#endregion
961
+ //#region src/copilot-customizations.d.ts
962
+ export type CopilotCustomizationScope = "workspace" | "personal";
963
+ export type CopilotCustomizationArtifactKind = "agent" | "skill" | "prompt" | "instruction" | "mcp" | "hook";
964
+ export type CopilotCustomizationInstallIntent = "available" | "selected" | "moving" | "removing";
965
+ export type CopilotCustomizationHealth = "healthy" | "missing" | "drifted" | "conflict" | "source-unavailable" | "unsupported";
966
+ export type CopilotCustomizationGate = "ready" | "approval-required" | "configuration-required";
967
+ export type CopilotCustomizationStatus = "healthy" | "action-required" | "blocked" | "not-enabled";
968
+ export interface CopilotArtifactStatePayload {
969
+ intent: CopilotCustomizationInstallIntent;
970
+ health: CopilotCustomizationHealth;
971
+ gate: CopilotCustomizationGate;
972
+ }
973
+ export interface CopilotArtifactSummaryPayload {
974
+ id: string;
975
+ packageId: string;
976
+ kind: CopilotCustomizationArtifactKind;
977
+ displayName: string;
978
+ description?: string;
979
+ installStrategy: "link" | "generated-config" | "approval-gated";
980
+ risk: "none" | "review-required";
981
+ }
982
+ export interface CopilotPackageInstallationPayload {
983
+ packageId: string;
984
+ scope: CopilotCustomizationScope;
985
+ selectedArtifactIds: string[];
986
+ pinnedVersion?: string;
987
+ }
988
+ export interface CopilotPackageDefinitionPayload {
989
+ id: string;
990
+ sourceId: string;
991
+ displayName: string;
992
+ description?: string;
993
+ version?: string;
994
+ artifacts: CopilotArtifactSummaryPayload[];
995
+ /** Whole-package registrar installation the home package list shows
996
+ * these; per-artifact v1 manifest plugins stay in enabled-content. */
997
+ wholePackage?: boolean;
988
998
  }
989
999
  /**
990
1000
  * Whole-package registrar install marker: the explicit `wholePackage`
@@ -992,16 +1002,16 @@ interface CopilotPackageDefinitionPayload {
992
1002
  * packages are PERSONAL-scope only — registrar-owned, so per-artifact
993
1003
  * scope actions (move to workspace) do not apply.
994
1004
  */
995
- declare function isWholePackageInstall(definition: Pick<CopilotPackageDefinitionPayload, "wholePackage" | "artifacts">): boolean;
1005
+ export declare function isWholePackageInstall(definition: Pick<CopilotPackageDefinitionPayload, "wholePackage" | "artifacts">): boolean;
996
1006
  /**
997
1007
  * Registrar record id (`repo:plugin`) from a view/package payload id
998
1008
  * (`repo::plugin`). Both spellings float around the wire; the registrar
999
1009
  * and the settings keys always use the single-colon form.
1000
1010
  */
1001
- declare function registrationIdFromPackageId(packageId: string): string;
1002
- interface CopilotArtifactViewPayload {
1003
- artifact: CopilotArtifactSummaryPayload;
1004
- state: CopilotArtifactStatePayload;
1011
+ export declare function registrationIdFromPackageId(packageId: string): string;
1012
+ export interface CopilotArtifactViewPayload {
1013
+ artifact: CopilotArtifactSummaryPayload;
1014
+ state: CopilotArtifactStatePayload;
1005
1015
  }
1006
1016
  /**
1007
1017
  * An installable plugin.json package found by scanning an enabled git
@@ -1010,88 +1020,89 @@ interface CopilotArtifactViewPayload {
1010
1020
  * `copilotCustomizations.list` result; `packageId` is directly usable
1011
1021
  * as the install input.
1012
1022
  */
1013
- interface CopilotAvailablePackagePayload {
1014
- /** `${sourceId}::${pluginId}` — directly usable as the install input. */
1015
- packageId: string;
1016
- sourceId: string;
1017
- displayName: string;
1018
- description?: string;
1019
- version?: string;
1020
- /** Full artifact summaries so the install preview can select artifacts. */
1021
- artifacts: CopilotArtifactSummaryPayload[];
1022
- /** Which scopes currently have this packageId installed (may be both). */
1023
- installedScopes: CopilotCustomizationScope[];
1024
- /** VS Code enablement (`chat.pluginLocations` value) for registered
1025
- * packages — overlaid extension-side; `undefined` for not-registered
1026
- * packages or older extension builds. */
1027
- enabled?: boolean;
1028
- }
1029
- interface CopilotPackageViewPayload {
1030
- definition: CopilotPackageDefinitionPayload;
1031
- installation: CopilotPackageInstallationPayload;
1032
- artifacts: CopilotArtifactViewPayload[];
1033
- selectedArtifactCount: number;
1034
- /** VS Code enablement for whole-package (registrar) rows —
1035
- * overlaid extension-side; `undefined` for artifact-level packages
1036
- * or older extension builds. */
1037
- enabled?: boolean;
1038
- status: CopilotCustomizationStatus;
1039
- }
1040
- interface CopilotSourceViewPayload {
1041
- id: string;
1042
- type: "marketplace" | "git" | "local";
1043
- displayName: string;
1044
- updateCapability: "pinned" | "live" | "none";
1045
- packages: CopilotPackageViewPayload[];
1023
+ export interface CopilotAvailablePackagePayload {
1024
+ /** `${sourceId}::${pluginId}` — directly usable as the install input. */
1025
+ packageId: string;
1026
+ sourceId: string;
1027
+ displayName: string;
1028
+ description?: string;
1029
+ version?: string;
1030
+ /** Full artifact summaries so the install preview can select artifacts. */
1031
+ artifacts: CopilotArtifactSummaryPayload[];
1032
+ /** Which scopes currently have this packageId installed (may be both). */
1033
+ installedScopes: CopilotCustomizationScope[];
1034
+ /** VS Code enablement (`chat.pluginLocations` value) for registered
1035
+ * packages — overlaid extension-side; `undefined` for not-registered
1036
+ * packages or older extension builds. */
1037
+ enabled?: boolean;
1038
+ }
1039
+ export interface CopilotPackageViewPayload {
1040
+ definition: CopilotPackageDefinitionPayload;
1041
+ installation: CopilotPackageInstallationPayload;
1042
+ artifacts: CopilotArtifactViewPayload[];
1043
+ selectedArtifactCount: number;
1044
+ /** VS Code enablement for whole-package (registrar) rows —
1045
+ * overlaid extension-side; `undefined` for artifact-level packages
1046
+ * or older extension builds. */
1047
+ enabled?: boolean;
1048
+ status: CopilotCustomizationStatus;
1049
+ }
1050
+ export interface CopilotSourceViewPayload {
1051
+ id: string;
1052
+ type: "marketplace" | "git" | "local";
1053
+ displayName: string;
1054
+ updateCapability: "pinned" | "live" | "none";
1055
+ packages: CopilotPackageViewPayload[];
1046
1056
  }
1047
1057
  /** Task 10 — normalized source record for the source manager UI. */
1048
- interface CopilotSourceRecordPayload {
1049
- id: string;
1050
- type: "marketplace" | "git" | "local";
1051
- displayName: string;
1052
- updateCapability: "pinned" | "live" | "none";
1053
- /** Whether the source content is currently materialized on disk. */
1054
- available: boolean;
1055
- /** Where this source is declared: "workspace" (manifest), "personal" (intent), or both. */
1056
- declaredIn: Array<"workspace" | "personal">;
1058
+ export interface CopilotSourceRecordPayload {
1059
+ id: string;
1060
+ type: "marketplace" | "git" | "local";
1061
+ displayName: string;
1062
+ updateCapability: "pinned" | "live" | "none";
1063
+ /** Whether the source content is currently materialized on disk. */
1064
+ available: boolean;
1065
+ /** Where this source is declared: "workspace" (manifest), "personal" (intent), or both. */
1066
+ declaredIn: Array<"workspace" | "personal">;
1057
1067
  }
1058
1068
  /** Task 10 — deterministic, side-effect-free package update preview. */
1059
- interface CopilotPackageUpdatePreviewPayload {
1060
- packageId: string;
1061
- fromVersion?: string;
1062
- toVersion: string;
1063
- addedArtifactIds: string[];
1064
- removedArtifactIds: string[];
1065
- changedArtifactIds: string[];
1066
- approvalInvalidatedArtifactIds: string[];
1067
- }
1068
- interface CopilotCustomizationViewPayload {
1069
- scope: CopilotCustomizationScope;
1070
- generatedAt: string;
1071
- sources: CopilotSourceViewPayload[];
1072
- packages: CopilotPackageViewPayload[];
1073
- attention: CopilotArtifactViewPayload[];
1074
- summary: {
1075
- packageCount: number;
1076
- enabledArtifactCount: number;
1077
- attentionCount: number;
1078
- };
1079
- legacyMigration?: {
1080
- count: number;
1081
- sourceLabel: "~/.agents";
1082
- };
1083
- }
1084
-
1069
+ export interface CopilotPackageUpdatePreviewPayload {
1070
+ packageId: string;
1071
+ fromVersion?: string;
1072
+ toVersion: string;
1073
+ addedArtifactIds: string[];
1074
+ removedArtifactIds: string[];
1075
+ changedArtifactIds: string[];
1076
+ approvalInvalidatedArtifactIds: string[];
1077
+ }
1078
+ export interface CopilotCustomizationViewPayload {
1079
+ scope: CopilotCustomizationScope;
1080
+ generatedAt: string;
1081
+ sources: CopilotSourceViewPayload[];
1082
+ packages: CopilotPackageViewPayload[];
1083
+ attention: CopilotArtifactViewPayload[];
1084
+ summary: {
1085
+ packageCount: number;
1086
+ enabledArtifactCount: number;
1087
+ attentionCount: number;
1088
+ };
1089
+ legacyMigration?: {
1090
+ count: number;
1091
+ sourceLabel: "~/.agents";
1092
+ };
1093
+ }
1094
+ //#endregion
1095
+ //#region src/device-auth.d.ts
1085
1096
  /**
1086
1097
  * Device-auth wire contract shared by the extension (signer) and the
1087
1098
  * server (verifier).
1088
1099
  *
1089
1100
  * Single source of truth for the `x-ms-device-*` header names and the
1090
- * HMAC-SHA-256 request-signature algorithm. Previously the same
1091
- * constants + function were copy-pasted in three places
1092
- * (extension `services/device/deviceAuth.ts`, core `device/deviceAuth.ts`,
1093
- * server `lib/auth/device-signature-guard.ts`) and kept in sync by
1094
- * comments alone. Server and extension now import from here.
1101
+ * request-signature algorithms. Previously the same constants +
1102
+ * functions were copy-pasted in three places (extension
1103
+ * `services/device/deviceAuth.ts`, core `device/deviceAuth.ts`, server
1104
+ * `lib/auth/device-signature-guard.ts`) and kept in sync by comments
1105
+ * alone. Server and extension now import from here.
1095
1106
  *
1096
1107
  * NOTE: `packages/serviceme-core/src/device/deviceAuth.ts` keeps its own
1097
1108
  * copy — ADL-003 forbids core → shared (and shared → core) so the core
@@ -1100,31 +1111,68 @@ interface CopilotCustomizationViewPayload {
1100
1111
  * for the wire format.
1101
1112
  */
1102
1113
  /** Canonical header names — MUST match the server's verifier. */
1103
- declare const DeviceAuthHeaders: {
1104
- readonly deviceId: "x-ms-device-id";
1105
- readonly deviceSecret: "x-ms-device-secret";
1106
- readonly signature: "x-ms-device-signature";
1107
- readonly timestamp: "x-ms-device-timestamp";
1108
- readonly secretVersion: "x-ms-device-secret-version";
1114
+ export declare const DeviceAuthHeaders: {
1115
+ readonly deviceId: "x-ms-device-id";
1116
+ readonly deviceSecret: "x-ms-device-secret";
1117
+ readonly signature: "x-ms-device-signature";
1118
+ readonly timestamp: "x-ms-device-timestamp";
1119
+ readonly secretVersion: "x-ms-device-secret-version";
1120
+ /** v2 only — algorithm self-declaration so the server can verify
1121
+ * both schemes during the legacy-client rollout window. */
1122
+ readonly sigAlg: "x-ms-device-sig-alg";
1123
+ /** v2 only — one-time value folded into the signature basis and
1124
+ * checked against a server-side replay cache. */
1125
+ readonly nonce: "x-ms-device-nonce";
1109
1126
  };
1110
- interface DeviceRequestSignatureParams {
1111
- method: string;
1112
- path: string;
1113
- timestamp: number;
1114
- body: string;
1115
- secret: string;
1127
+ /** v2 signature algorithm identifier carried in `x-ms-device-sig-alg`. */
1128
+ export declare const DEVICE_SIG_ALG_V2 = "hmac-sha256-v2";
1129
+ export interface DeviceRequestSignatureParams {
1130
+ method: string;
1131
+ path: string;
1132
+ timestamp: number;
1133
+ body: string;
1134
+ secret: string;
1116
1135
  }
1117
1136
  /**
1118
- * Basis is `METHOD\nPATH\nTIMESTAMP\nBODY\nSECRET` (LF-joined, NOT JSON).
1119
- * Output is lowercase hex SHA-256.
1137
+ * Legacy (v1) basis: `METHOD\nPATH\nTIMESTAMP\nBODY\nSECRET`
1138
+ * (LF-joined, NOT JSON), hashed with a secret-suffix SHA-256.
1139
+ * Output is lowercase hex.
1140
+ *
1141
+ * Retained for backward compatibility with fielded extensions that
1142
+ * predate v2; new code should use `createDeviceRequestSignatureV2`.
1120
1143
  *
1121
1144
  * Uses `js-sha256` (pure JS, synchronous, browser + Node) instead of
1122
1145
  * `node:crypto` so this module stays importable from the webview (the
1123
1146
  * shared barrel is consumed by browser bundles — `node:crypto` breaks
1124
1147
  * the vite/rollup build).
1125
1148
  */
1126
- declare function createDeviceRequestSignature(params: DeviceRequestSignatureParams): string;
1127
-
1149
+ export declare function createDeviceRequestSignature(params: DeviceRequestSignatureParams): string;
1150
+ export interface DeviceRequestSignatureV2Params {
1151
+ method: string;
1152
+ /** Full request path INCLUDING the query string (e.g.
1153
+ * `/api/v1/tools/rtk/download?version=1.2.0&target=darwin-arm64`).
1154
+ * v2 signs the query so GET parameters cannot be substituted or
1155
+ * replayed independently of the signed basis. */
1156
+ path: string;
1157
+ timestamp: number;
1158
+ /** One-time value; the server tracks seen nonces per device and
1159
+ * rejects replays within the timestamp window. */
1160
+ nonce: string;
1161
+ body: string;
1162
+ secret: string;
1163
+ }
1164
+ /**
1165
+ * v2 basis: `METHOD\nPATH?QUERY\nTIMESTAMP\nNONCE\nBODY\nSECRET`
1166
+ * (LF-joined, NOT JSON), MACed with real HMAC-SHA-256 keyed by the
1167
+ * device secret. Output is lowercase hex.
1168
+ *
1169
+ * The client MUST build the exact query string it will send before
1170
+ * signing — the server verifies against the raw `request.url` search,
1171
+ * so the signed string and the wire URL have to match byte-for-byte.
1172
+ */
1173
+ export declare function createDeviceRequestSignatureV2(params: DeviceRequestSignatureV2Params): string;
1174
+ //#endregion
1175
+ //#region src/git-utils.d.ts
1128
1176
  /**
1129
1177
  * Git URL Utilities
1130
1178
  *
@@ -1142,12 +1190,12 @@ declare function createDeviceRequestSignature(params: DeviceRequestSignaturePara
1142
1190
  * in `apps/server/src/app/api/v1/projects/_validators.ts`) consistent with
1143
1191
  * whatever the client already resolved and sent as `canonical_slug`.
1144
1192
  */
1145
- declare const GIT_REMOTE_HOST_ALIASES: Readonly<Record<string, string>>;
1193
+ export declare const GIT_REMOTE_HOST_ALIASES: Readonly<Record<string, string>>;
1146
1194
  /**
1147
1195
  * Apply {@link GIT_REMOTE_HOST_ALIASES} to an already-canonical `host/owner/repo`
1148
1196
  * slug string (as opposed to a raw Git URL — see `normalizeGitUrl` for that).
1149
1197
  */
1150
- declare function normalizeCanonicalSlug(slug: string): string;
1198
+ export declare function normalizeCanonicalSlug(slug: string): string;
1151
1199
  /**
1152
1200
  * Normalize a Git remote URL to a canonical slug: host/owner/repo
1153
1201
  * - Supports HTTPS, SSH, and SCP-like syntax
@@ -1157,42 +1205,43 @@ declare function normalizeCanonicalSlug(slug: string): string;
1157
1205
  *
1158
1206
  * @throws Error if the input cannot be parsed into a valid slug
1159
1207
  */
1160
- declare function normalizeGitUrl(input: string): string;
1208
+ export declare function normalizeGitUrl(input: string): string;
1161
1209
  /**
1162
1210
  * Validate whether a string matches the canonical slug format: host/owner/repo
1163
1211
  * Requires at least three segments (host + two path parts).
1164
1212
  * Allows percent-encoded characters (e.g. %20) for hosts like Azure DevOps
1165
1213
  * that permit spaces in project/repo names.
1166
1214
  */
1167
- declare function isValidCanonicalSlug(slug: string): boolean;
1168
-
1169
- interface GitHubUser {
1170
- id: number;
1171
- login: string;
1172
- email: string | null;
1173
- name: string | null;
1174
- avatar_url: string | null;
1175
- plan?: {
1176
- name: string;
1177
- space: number;
1178
- collaborators: number;
1179
- private_repos: number;
1180
- };
1181
- [key: string]: unknown;
1215
+ export declare function isValidCanonicalSlug(slug: string): boolean;
1216
+ //#endregion
1217
+ //#region src/github-api.d.ts
1218
+ export interface GitHubUser {
1219
+ id: number;
1220
+ login: string;
1221
+ email: string | null;
1222
+ name: string | null;
1223
+ avatar_url: string | null;
1224
+ plan?: {
1225
+ name: string;
1226
+ space: number;
1227
+ collaborators: number;
1228
+ private_repos: number;
1229
+ };
1230
+ [key: string]: unknown;
1182
1231
  }
1183
1232
  interface GitHubEmailRecord {
1184
- email: string;
1185
- primary: boolean;
1186
- verified: boolean;
1187
- visibility: "public" | "private" | null;
1233
+ email: string;
1234
+ primary: boolean;
1235
+ verified: boolean;
1236
+ visibility: "public" | "private" | null;
1188
1237
  }
1189
- type GitHubOrgMembershipStatus = "active" | "pending" | "not_member" | "forbidden" | "unauthorized";
1190
- interface GitHubOrgMembershipCheckResult {
1191
- status: GitHubOrgMembershipStatus;
1192
- httpStatus: number;
1193
- organization: string;
1194
- role: string | null;
1195
- directMembership: boolean | null;
1238
+ export type GitHubOrgMembershipStatus = "active" | "pending" | "not_member" | "forbidden" | "unauthorized";
1239
+ export interface GitHubOrgMembershipCheckResult {
1240
+ status: GitHubOrgMembershipStatus;
1241
+ httpStatus: number;
1242
+ organization: string;
1243
+ role: string | null;
1244
+ directMembership: boolean | null;
1196
1245
  }
1197
1246
  /**
1198
1247
  * Fetch user info from GitHub API
@@ -1200,19 +1249,19 @@ interface GitHubOrgMembershipCheckResult {
1200
1249
  * @returns GitHubUser object
1201
1250
  * @throws Error if request fails or token is invalid
1202
1251
  */
1203
- declare function fetchGitHubUser(token: string): Promise<GitHubUser>;
1252
+ export declare function fetchGitHubUser(token: string): Promise<GitHubUser>;
1204
1253
  declare function pickPreferredGitHubEmail(emails: GitHubEmailRecord[]): string | null;
1205
1254
  declare function sanitizeEmail(email: string | null | undefined): string | null;
1206
- declare const __internal: {
1207
- pickPreferredGitHubEmail: typeof pickPreferredGitHubEmail;
1208
- sanitizeEmail: typeof sanitizeEmail;
1255
+ export declare const __internal: {
1256
+ pickPreferredGitHubEmail: typeof pickPreferredGitHubEmail;
1257
+ sanitizeEmail: typeof sanitizeEmail;
1209
1258
  };
1210
1259
  /**
1211
1260
  * Fetch the authenticated user's membership details for a GitHub organization.
1212
1261
  * Uses the memberships list endpoint so callers can distinguish active, pending,
1213
1262
  * and indeterminate states instead of collapsing everything into a boolean.
1214
1263
  */
1215
- declare function getGitHubOrgMembership(token: string, org: string): Promise<GitHubOrgMembershipCheckResult>;
1264
+ export declare function getGitHubOrgMembership(token: string, org: string): Promise<GitHubOrgMembershipCheckResult>;
1216
1265
  /**
1217
1266
  * Check if the token owner is authorized for a given GitHub organization.
1218
1267
  * Uses the authenticated user's own token — works for both public and private membership.
@@ -1220,12 +1269,14 @@ declare function getGitHubOrgMembership(token: string, org: string): Promise<Git
1220
1269
  * @param token GitHub Personal Access Token or OAuth Access Token
1221
1270
  * @param org GitHub organization name
1222
1271
  */
1223
- declare function checkGitHubOrgMembership(token: string, org: string): Promise<boolean>;
1224
-
1225
- declare function isGitHubLocalEmail(email: string | null | undefined): boolean;
1226
- declare function buildGitHubLocalEmail(login: string): string;
1227
- declare function resolvePrimaryEmail(login: string, email: string | null | undefined): string;
1228
-
1272
+ export declare function checkGitHubOrgMembership(token: string, org: string): Promise<boolean>;
1273
+ //#endregion
1274
+ //#region src/github-user-email.d.ts
1275
+ export declare function isGitHubLocalEmail(email: string | null | undefined): boolean;
1276
+ export declare function buildGitHubLocalEmail(login: string): string;
1277
+ export declare function resolvePrimaryEmail(login: string, email: string | null | undefined): string;
1278
+ //#endregion
1279
+ //#region src/logger/index.d.ts
1229
1280
  /**
1230
1281
  * Unified, environment-agnostic logger contract for the SERVICEME monorepo.
1231
1282
  *
@@ -1243,11 +1294,11 @@ declare function resolvePrimaryEmail(login: string, email: string | null | undef
1243
1294
  * {@link createConsoleLogger} fallback defined here.
1244
1295
  */
1245
1296
  /** Severity levels, ordered low → high. */
1246
- declare enum LogLevel {
1247
- DEBUG = 0,
1248
- INFO = 1,
1249
- WARN = 2,
1250
- ERROR = 3
1297
+ export declare enum LogLevel {
1298
+ DEBUG = 0,
1299
+ INFO = 1,
1300
+ WARN = 2,
1301
+ ERROR = 3
1251
1302
  }
1252
1303
  /**
1253
1304
  * The logger contract every package implements / consumes.
@@ -1258,16 +1309,16 @@ declare enum LogLevel {
1258
1309
  * implementation can normalize / redact it; implementations SHOULD run
1259
1310
  * {@link normalizeErrorForLog} on that value before emitting.
1260
1311
  */
1261
- interface ILogger {
1262
- debug(message: string, ...args: unknown[]): void;
1263
- info(message: string, ...args: unknown[]): void;
1264
- warn(message: string, ...args: unknown[]): void;
1265
- error(message: string, error?: unknown, ...args: unknown[]): void;
1266
- setLevel(level: LogLevel): void;
1267
- /** Optional — file-backed loggers return their directory. */
1268
- getLogDir?(): string | undefined;
1269
- /** Optional — UI-backed loggers reveal their sink (e.g. an OutputChannel). */
1270
- show?(): void;
1312
+ export interface ILogger {
1313
+ debug(message: string, ...args: unknown[]): void;
1314
+ info(message: string, ...args: unknown[]): void;
1315
+ warn(message: string, ...args: unknown[]): void;
1316
+ error(message: string, error?: unknown, ...args: unknown[]): void;
1317
+ setLevel(level: LogLevel): void;
1318
+ /** Optional — file-backed loggers return their directory. */
1319
+ getLogDir?(): string | undefined;
1320
+ /** Optional — UI-backed loggers reveal their sink (e.g. an OutputChannel). */
1321
+ show?(): void;
1271
1322
  }
1272
1323
  /**
1273
1324
  * Normalize any thrown value into a serializable record for logging.
@@ -1279,7 +1330,7 @@ interface ILogger {
1279
1330
  * `apps/extension/src/core/logger/Logger.ts` so every package shares one
1280
1331
  * normalization path.
1281
1332
  */
1282
- declare function normalizeErrorForLog(error: unknown): Record<string, unknown>;
1333
+ export declare function normalizeErrorForLog(error: unknown): Record<string, unknown>;
1283
1334
  /**
1284
1335
  * Create a console-backed {@link ILogger}.
1285
1336
  *
@@ -1293,8 +1344,9 @@ declare function normalizeErrorForLog(error: unknown): Record<string, unknown>;
1293
1344
  * This is the canonical fallback for packages without a richer sink (cli,
1294
1345
  * webview bootstrap, extension logger self-diagnostics).
1295
1346
  */
1296
- declare function createConsoleLogger(name: string): ILogger;
1297
-
1347
+ export declare function createConsoleLogger(name: string): ILogger;
1348
+ //#endregion
1349
+ //#region src/types/protocol-contracts.d.ts
1298
1350
  /**
1299
1351
  * Protocol Contract Types — single source of truth.
1300
1352
  *
@@ -1325,180 +1377,181 @@ declare function createConsoleLogger(name: string): ILogger;
1325
1377
  * the module stays self-contained (e.g. `ScheduledTaskV1`, `TaskWorkspaceRef`,
1326
1378
  * `TaskRunStatus`, `BridgeLinkMode`).
1327
1379
  */
1328
- type ScheduledTaskType = "command" | "shell" | "http_request" | "github_copilot_cli";
1329
- interface CommandPayload {
1330
- command: string;
1331
- args?: unknown[];
1332
- }
1333
- interface ShellPayload {
1334
- script: string;
1335
- cwd?: string;
1336
- /** Timeout in seconds. Omit for default 60s; use 0 for no limit. */
1337
- timeout?: number;
1338
- }
1339
- interface HttpRequestPayload {
1340
- url: string;
1341
- method: string;
1342
- headers?: Record<string, string>;
1343
- body?: string;
1344
- /** Timeout in seconds. Omit for default 30s; use 0 for no limit. */
1345
- timeout?: number;
1346
- }
1347
- interface GithubCopilotCliPayload {
1348
- prompt: string;
1349
- workspace?: string;
1350
- autopilot?: boolean;
1351
- allowTools?: string[];
1352
- /** Timeout in seconds. Omit for default 300s; use 0 for no limit. */
1353
- timeout?: number;
1354
- model?: string;
1355
- agent?: string;
1356
- }
1357
- type TaskPayload = CommandPayload | ShellPayload | HttpRequestPayload | GithubCopilotCliPayload;
1380
+ export type ScheduledTaskType = "command" | "shell" | "http_request" | "github_copilot_cli";
1381
+ export interface CommandPayload {
1382
+ command: string;
1383
+ args?: unknown[];
1384
+ }
1385
+ export interface ShellPayload {
1386
+ script: string;
1387
+ cwd?: string;
1388
+ /** Timeout in seconds. Omit for default 60s; use 0 for no limit. */
1389
+ timeout?: number;
1390
+ }
1391
+ export interface HttpRequestPayload {
1392
+ url: string;
1393
+ method: string;
1394
+ headers?: Record<string, string>;
1395
+ body?: string;
1396
+ /** Timeout in seconds. Omit for default 30s; use 0 for no limit. */
1397
+ timeout?: number;
1398
+ }
1399
+ export interface GithubCopilotCliPayload {
1400
+ prompt: string;
1401
+ workspace?: string;
1402
+ autopilot?: boolean;
1403
+ allowTools?: string[];
1404
+ /** Timeout in seconds. Omit for default 300s; use 0 for no limit. */
1405
+ timeout?: number;
1406
+ model?: string;
1407
+ agent?: string;
1408
+ }
1409
+ export type TaskPayload = CommandPayload | ShellPayload | HttpRequestPayload | GithubCopilotCliPayload;
1358
1410
  /** Reference to the workspace a scheduled task is bound to. Required by v2. */
1359
- interface TaskWorkspaceRef {
1360
- /** Absolute path to the workspace root. Required and unique. */
1361
- path: string;
1362
- /** Display name. Defaults to `path` basename; users may override. */
1363
- name: string;
1364
- /** `git@github.com:owner/repo.git` — auto-detected at task creation. */
1365
- gitRemote?: string;
1366
- /** Current branch — auto-detected at task creation; verified at execute. */
1367
- gitBranch?: string;
1368
- /** Last time the extension saw this workspace alive. */
1369
- lastSeenAt?: string;
1411
+ export interface TaskWorkspaceRef {
1412
+ /** Absolute path to the workspace root. Required and unique. */
1413
+ path: string;
1414
+ /** Display name. Defaults to `path` basename; users may override. */
1415
+ name: string;
1416
+ /** `git@github.com:owner/repo.git` — auto-detected at task creation. */
1417
+ gitRemote?: string;
1418
+ /** Current branch — auto-detected at task creation; verified at execute. */
1419
+ gitBranch?: string;
1420
+ /** Last time the extension saw this workspace alive. */
1421
+ lastSeenAt?: string;
1370
1422
  }
1371
1423
  /**
1372
1424
  * v1 task shape — kept for reading legacy `<workspace>/.serviceme/scheduled-tasks.json`
1373
1425
  * during migration. New code should always use {@link ScheduledTask} (v2).
1374
1426
  */
1375
- interface ScheduledTaskV1 {
1376
- id: string;
1377
- name: string;
1378
- description?: string;
1379
- enabled: boolean;
1380
- scheduleType: "cron" | "interval";
1381
- schedule: string;
1382
- taskType: ScheduledTaskType;
1383
- payload: TaskPayload;
1384
- createdAt: string;
1385
- updatedAt: string;
1427
+ export interface ScheduledTaskV1 {
1428
+ id: string;
1429
+ name: string;
1430
+ description?: string;
1431
+ enabled: boolean;
1432
+ scheduleType: "cron" | "interval";
1433
+ schedule: string;
1434
+ taskType: ScheduledTaskType;
1435
+ payload: TaskPayload;
1436
+ createdAt: string;
1437
+ updatedAt: string;
1386
1438
  }
1387
1439
  /** Runtime status of the most recent execution for a task. */
1388
- type TaskRunStatus = "ok" | "error" | "skipped";
1440
+ export type TaskRunStatus = "ok" | "error" | "skipped";
1389
1441
  /**
1390
1442
  * v2 scheduled task — adds required `workspace` reference and runtime metadata
1391
1443
  * fields. See `docs/architecture/skill-agent-v2-repo.md` §14.2.
1392
1444
  */
1393
- interface ScheduledTask extends ScheduledTaskV1 {
1394
- /** Required in v2. The workspace this task executes in. */
1395
- workspace: TaskWorkspaceRef;
1396
- /** ISO timestamp of the most recent execution. */
1397
- lastRunAt?: string;
1398
- /** Status of the most recent execution. */
1399
- lastRunStatus?: TaskRunStatus;
1400
- /** Error message from the most recent failed execution. */
1401
- lastRunError?: string;
1402
- /** Duration of the most recent execution, in milliseconds. */
1403
- lastRunDurationMs?: number;
1404
- /** Next scheduled run (computed by scheduler). */
1405
- nextRunAt?: string;
1406
- /** Total successful executions. */
1407
- runCount?: number;
1445
+ export interface ScheduledTask extends ScheduledTaskV1 {
1446
+ /** Required in v2. The workspace this task executes in. */
1447
+ workspace: TaskWorkspaceRef;
1448
+ /** ISO timestamp of the most recent execution. */
1449
+ lastRunAt?: string;
1450
+ /** Status of the most recent execution. */
1451
+ lastRunStatus?: TaskRunStatus;
1452
+ /** Error message from the most recent failed execution. */
1453
+ lastRunError?: string;
1454
+ /** Duration of the most recent execution, in milliseconds. */
1455
+ lastRunDurationMs?: number;
1456
+ /** Next scheduled run (computed by scheduler). */
1457
+ nextRunAt?: string;
1458
+ /** Total successful executions. */
1459
+ runCount?: number;
1408
1460
  }
1409
1461
  /** v2 config — single source of truth for the global scheduler. */
1410
- interface ScheduledTasksConfig {
1411
- version: 2;
1412
- tasks: ScheduledTask[];
1413
- }
1414
- type TaskExecutionStatus = "running" | "success" | "failure" | "timeout" | "cancelled";
1415
- interface TaskExecutionLog {
1416
- id: string;
1417
- taskId: string;
1418
- taskName: string;
1419
- startedAt: string;
1420
- finishedAt: string;
1421
- status: Exclude<TaskExecutionStatus, "running">;
1422
- output?: string;
1423
- error?: string;
1424
- }
1425
- type AgentToolRiskLevel = "high" | "medium" | "low";
1426
- interface AgentToolPermission {
1427
- tool: string;
1428
- riskLevel: AgentToolRiskLevel;
1429
- }
1430
- interface AgentPermissionSummary {
1431
- agentId: string;
1432
- agentName: string;
1433
- tools: AgentToolPermission[];
1434
- highRiskCount: number;
1435
- mediumRiskCount: number;
1436
- lowRiskCount: number;
1462
+ export interface ScheduledTasksConfig {
1463
+ version: 2;
1464
+ tasks: ScheduledTask[];
1465
+ }
1466
+ export type TaskExecutionStatus = "running" | "success" | "failure" | "timeout" | "cancelled";
1467
+ export interface TaskExecutionLog {
1468
+ id: string;
1469
+ taskId: string;
1470
+ taskName: string;
1471
+ startedAt: string;
1472
+ finishedAt: string;
1473
+ status: Exclude<TaskExecutionStatus, "running">;
1474
+ output?: string;
1475
+ error?: string;
1476
+ }
1477
+ export type AgentToolRiskLevel = "high" | "medium" | "low";
1478
+ export interface AgentToolPermission {
1479
+ tool: string;
1480
+ riskLevel: AgentToolRiskLevel;
1481
+ }
1482
+ export interface AgentPermissionSummary {
1483
+ agentId: string;
1484
+ agentName: string;
1485
+ tools: AgentToolPermission[];
1486
+ highRiskCount: number;
1487
+ mediumRiskCount: number;
1488
+ lowRiskCount: number;
1437
1489
  }
1438
1490
  /** Kinds of artifacts in the catalog. */
1439
- type BridgeSkillKind = "skill" | "agent";
1491
+ export type BridgeSkillKind = "skill" | "agent";
1440
1492
  /** Which side of the link is reported. Matches SkillLinker's `LinkMode`. */
1441
- type BridgeLinkMode = "symlink" | "junction" | "copy";
1493
+ export type BridgeLinkMode = "symlink" | "junction" | "copy";
1442
1494
  /** A single skill/agent entry inside a repo (SkillStore.SkillEntry). */
1443
- interface BridgeSkillRepoEntry {
1444
- repoId: string;
1445
- name: string;
1446
- kind: BridgeSkillKind;
1447
- /** Absolute path to the manifest file. */
1448
- manifestPath: string;
1449
- /** Absolute path to the entry's directory. */
1450
- dir: string;
1451
- /** Best-effort parsed frontmatter. */
1452
- frontmatter: Record<string, unknown>;
1453
- /** ISO timestamp of the manifest's mtime. */
1454
- modifiedAt: string;
1455
- /** Machine-local disable mark — true when the entry's link is removed
1456
- * on this machine while its installation intent stays. Overlaid by
1457
- * the bridge; absent on older CLIs. */
1458
- disabled?: boolean;
1495
+ export interface BridgeSkillRepoEntry {
1496
+ repoId: string;
1497
+ name: string;
1498
+ kind: BridgeSkillKind;
1499
+ /** Absolute path to the manifest file. */
1500
+ manifestPath: string;
1501
+ /** Absolute path to the entry's directory. */
1502
+ dir: string;
1503
+ /** Best-effort parsed frontmatter. */
1504
+ frontmatter: Record<string, unknown>;
1505
+ /** ISO timestamp of the manifest's mtime. */
1506
+ modifiedAt: string;
1507
+ /** Machine-local disable mark — true when the entry's link is removed
1508
+ * on this machine while its installation intent stays. Overlaid by
1509
+ * the bridge; absent on older CLIs. */
1510
+ disabled?: boolean;
1459
1511
  }
1460
1512
  /** A single file inside an entry (SkillStore.SkillFile). */
1461
- interface BridgeSkillRepoFile {
1462
- /** Path relative to the entry's directory. */
1463
- path: string;
1464
- /** UTF-8 content. */
1465
- content: string;
1513
+ export interface BridgeSkillRepoFile {
1514
+ /** Path relative to the entry's directory. */
1515
+ path: string;
1516
+ /** UTF-8 content. */
1517
+ content: string;
1466
1518
  }
1467
1519
  /** A symlink/junction currently present in a workspace or user (global) scope. */
1468
- interface BridgeLinkedSkill {
1469
- repoId: string;
1470
- name: string;
1471
- linkPath: string;
1472
- targetPath: string;
1473
- mode: BridgeLinkMode;
1474
- /** Which scope this link lives in — "workspace" or "user" (global, `~/.agents/...`). */
1475
- scope: "workspace" | "user";
1520
+ export interface BridgeLinkedSkill {
1521
+ repoId: string;
1522
+ name: string;
1523
+ linkPath: string;
1524
+ targetPath: string;
1525
+ mode: BridgeLinkMode;
1526
+ /** Which scope this link lives in — "workspace" or "user" (global, `~/.agents/...`). */
1527
+ scope: "workspace" | "user";
1476
1528
  }
1477
1529
  /** A single entry from `repos.json` (subset of RepoConfig). */
1478
- interface BridgeRepoEntry {
1479
- id: string;
1480
- name: string;
1481
- url: string;
1482
- branch: string;
1483
- enabled: boolean;
1484
- useProxy?: boolean;
1485
- writeEnabled: boolean;
1486
- source: "default" | "user";
1487
- description?: string;
1488
- addedAt: string;
1489
- lastSyncAt?: string;
1490
- lastSyncCommitSha?: string;
1491
- lastSyncStatus?: "ok" | "error";
1492
- lastSyncError?: string;
1530
+ export interface BridgeRepoEntry {
1531
+ id: string;
1532
+ name: string;
1533
+ url: string;
1534
+ branch: string;
1535
+ enabled: boolean;
1536
+ useProxy?: boolean;
1537
+ writeEnabled: boolean;
1538
+ source: "default" | "user";
1539
+ description?: string;
1540
+ addedAt: string;
1541
+ lastSyncAt?: string;
1542
+ lastSyncCommitSha?: string;
1543
+ lastSyncStatus?: "ok" | "error";
1544
+ lastSyncError?: string;
1493
1545
  }
1494
1546
  /** A single line of a sync run. */
1495
- interface BridgeRepoSyncPull {
1496
- repoId: string;
1497
- status: "ok" | "error";
1498
- commitSha?: string;
1499
- error?: string;
1547
+ export interface BridgeRepoSyncPull {
1548
+ repoId: string;
1549
+ status: "ok" | "error";
1550
+ commitSha?: string;
1551
+ error?: string;
1500
1552
  }
1501
-
1553
+ //#endregion
1554
+ //#region src/webview-contract.d.ts
1502
1555
  /**
1503
1556
  * Webview ↔ extension message-contract types.
1504
1557
  *
@@ -1515,180 +1568,181 @@ interface BridgeRepoSyncPull {
1515
1568
  * NOTE: `apps/webview-ui/src/types/index.ts` re-exports these so
1516
1569
  * existing webview imports keep working unchanged.
1517
1570
  */
1518
- interface ExternalTool {
1519
- id: string;
1520
- name: string;
1521
- url: string;
1522
- description?: string;
1523
- icon?: string;
1524
- isDefault?: boolean;
1525
- }
1526
- interface AzureProfile {
1527
- id: string;
1528
- name: string;
1529
- method: "FTP" | "MSDeploy";
1530
- host: string;
1531
- username?: string;
1532
- password?: string;
1533
- remotePath?: string;
1534
- port?: number;
1535
- }
1536
- interface ApiConfig {
1537
- schemaPath: string;
1538
- requestLibPath?: string;
1539
- projectName?: string;
1540
- namespace?: string;
1541
- serversPath?: string;
1542
- apiPrefix?: string;
1543
- mock?: boolean;
1544
- templatesFolder?: string;
1545
- enumStyle?: "string-literal" | "enum";
1546
- }
1547
-
1548
- declare enum WebviewMessageType {
1549
- WebviewReady = "webviewReady",
1550
- Ready = "ready",
1551
- Log = "log",
1552
- ExecuteCommand = "executeCommand",
1553
- OpenUrl = "openUrl",
1554
- UsePrompt = "usePrompt",
1555
- UpdateAzureProfiles = "updateAzureProfiles",
1556
- UpdateAzureProfile = "updateAzureProfile",
1557
- GetApiConfig = "getApiConfig",
1558
- UpdateApiConfig = "updateApiConfig",
1559
- SaveApiConfig = "saveApiConfig",
1560
- ApiConfigSaveFailed = "apiConfigSaveFailed",
1561
- ExportApiConfig = "exportApiConfig",
1562
- ImportApiConfig = "importApiConfig",
1563
- ApiConfigImported = "apiConfigImported",
1564
- AddExternalTool = "addExternalTool",
1565
- UpdateExternalTool = "updateExternalTool",
1566
- UpdateExternalTools = "updateExternalTools",
1567
- DeleteExternalTool = "deleteExternalTool",
1568
- ReorderExternalTools = "reorderExternalTools",
1569
- UpdateNgrokStatus = "updateNgrokStatus",
1570
- UpdateServerStatus = "updateServerStatus",
1571
- UpdateOcxStatus = "updateOcxStatus",
1572
- UpdateRtkStatus = "updateRtkStatus",
1573
- UpdateCodegraphStatus = "updateCodegraphStatus",
1574
- GetAuthState = "getAuthState",
1575
- UpdateAuthState = "updateAuthState",
1576
- Login = "login",
1577
- Logout = "logout",
1578
- GetAccounts = "getAccounts",
1579
- UpdateAccounts = "updateAccounts",
1580
- SwitchAccount = "switchAccount",
1581
- GetUserProfile = "getUserProfile",
1582
- UpdateUserProfile = "updateUserProfile",
1583
- UserProfileUpdated = "userProfileUpdated",
1584
- AddExtraEmail = "addExtraEmail",
1585
- DeleteExtraEmail = "deleteExtraEmail",
1586
- GetCalendarHolidays = "getCalendarHolidays",
1587
- UpdateCalendarHolidays = "updateCalendarHolidays",
1588
- GetCalendarLeaves = "getCalendarLeaves",
1589
- UpdateCalendarLeaves = "updateCalendarLeaves",
1590
- CreateCalendarLeave = "createCalendarLeave",
1591
- DeleteCalendarLeave = "deleteCalendarLeave",
1592
- GetCalendarNotes = "getCalendarNotes",
1593
- UpdateCalendarNotes = "updateCalendarNotes",
1594
- SaveCalendarNote = "saveCalendarNote",
1595
- GetCalendarMonthSchedule = "getCalendarMonthSchedule",
1596
- GetScheduledTasks = "getScheduledTasks",
1597
- UpdateScheduledTasks = "updateScheduledTasks",
1598
- CreateScheduledTask = "createScheduledTask",
1599
- EditScheduledTask = "editScheduledTask",
1600
- DeleteScheduledTask = "deleteScheduledTask",
1601
- ToggleScheduledTask = "toggleScheduledTask",
1602
- TriggerScheduledTask = "triggerScheduledTask",
1603
- CancelTaskExecution = "cancelTaskExecution",
1604
- GetTaskExecutionLogs = "getTaskExecutionLogs",
1605
- ClearTaskExecutionLogs = "clearTaskExecutionLogs",
1606
- UpdateTaskExecutionLogs = "updateTaskExecutionLogs",
1607
- UpdateTaskExecutionState = "updateTaskExecutionState",
1608
- GetCurrentWorkspace = "getCurrentWorkspace",
1609
- UpdateCurrentWorkspace = "updateCurrentWorkspace",
1610
- GetProviders = "getProviders",
1611
- ProvidersResponse = "providersResponse",
1612
- AddProvider = "addProvider",
1613
- UpdateProvider = "updateProvider",
1614
- RemoveProvider = "removeProvider",
1615
- SetDefaultProvider = "setDefaultProvider",
1616
- SetProviderEnabled = "setProviderEnabled",
1617
- SetProviderOrder = "setProviderOrder",
1618
- TestProvider = "testProvider",
1619
- ProviderTestResultMessage = "providerTestResult",
1620
- TestProviderModel = "testProviderModel",
1621
- ProviderTestModelResultMessage = "providerTestModelResult",
1622
- DefaultProviderChanged = "defaultProviderChanged",
1623
- FetchProviderModels = "fetchProviderModels",
1624
- FetchProviderModelsResult = "fetchProviderModelsResult",
1625
- GetProviderUsage = "getProviderUsage",
1626
- ProviderUsageResponse = "providerUsageResponse",
1627
- SetCacheControlEnabled = "setCacheControlEnabled",
1628
- GetByomSettings = "getByomSettings",
1629
- ByomSettingsResponse = "byomSettingsResponse",
1630
- ListSkillRepoEntries = "listSkillRepoEntries",
1631
- GetSkillRepoEntry = "getSkillRepoEntry",
1632
- InstallSkillRepoEntry = "installSkillRepoEntry",
1633
- ConvertSkillRepoEntryToSymlink = "convertSkillRepoEntryToSymlink",
1634
- UninstallSkillRepoEntry = "uninstallSkillRepoEntry",
1635
- SetSkillRepoEntryEnabled = "setSkillRepoEntryEnabled",
1636
- ListLinkedSkills = "listLinkedSkills",
1637
- UpdateSkillRepoCatalog = "updateSkillRepoCatalog",
1638
- UpdateSkillRepoInstall = "updateSkillRepoInstall",
1639
- UpdateLinkedSkills = "updateLinkedSkills",
1640
- CreateSkillRepoDraft = "createSkillRepoDraft",
1641
- CommitSkillRepoDraft = "commitSkillRepoDraft",
1642
- ListSkillRepoDrafts = "listSkillRepoDrafts",
1643
- DeleteSkillRepoDraft = "deleteSkillRepoDraft",
1644
- UpdateSkillRepoDraft = "updateSkillRepoDraft",
1645
- ListRepositories = "listRepositories",
1646
- AddRepository = "addRepository",
1647
- UpdateRepository = "updateRepository",
1648
- RemoveRepository = "removeRepository",
1649
- EnableRepository = "enableRepository",
1650
- DisableRepository = "disableRepository",
1651
- SyncRepository = "syncRepository",
1652
- SyncAllRepositories = "syncAllRepositories",
1653
- ResetParseCache = "resetParseCache",
1654
- ListCopilotPlugins = "listCopilotPlugins",
1655
- RegisterCopilotPlugin = "registerCopilotPlugin",
1656
- UnregisterCopilotPlugin = "unregisterCopilotPlugin",
1657
- SetCopilotPluginEnabled = "setCopilotPluginEnabled",
1658
- GetCopilotContentStatus = "getCopilotContentStatus",
1659
- RestoreCopilotContent = "restoreCopilotContent",
1660
- ApproveCopilotContent = "approveCopilotContent",
1661
- UpdateRepositoryList = "updateRepositoryList",
1662
- UpdateRepositoryAdd = "updateRepositoryAdd",
1663
- UpdateRepositoryUpdate = "updateRepositoryUpdate",
1664
- UpdateRepositoryRemove = "updateRepositoryRemove",
1665
- UpdateRepositoryToggle = "updateRepositoryToggle",
1666
- UpdateRepositorySyncResult = "updateRepositorySyncResult",
1667
- UpdateCopilotContentStatus = "updateCopilotContentStatus",
1668
- GetCopilotCustomizations = "getCopilotCustomizations",
1669
- SyncCopilotCustomizations = "syncCopilotCustomizations",
1670
- UpdateCopilotCustomizations = "updateCopilotCustomizations",
1671
- InstallCopilotPackage = "installCopilotPackage",
1672
- MoveCopilotPackage = "moveCopilotPackage",
1673
- UninstallCopilotPackage = "uninstallCopilotPackage",
1674
- ListCopilotSources = "listCopilotSources",
1675
- RemoveCopilotSource = "removeCopilotSource",
1676
- PreviewCopilotUpdate = "previewCopilotUpdate",
1677
- UpdateCopilotPackage = "updateCopilotPackage",
1678
- PreviewCopilotLegacy = "previewCopilotLegacy",
1679
- MigrateCopilotLegacy = "migrateCopilotLegacy",
1680
- UpdateCopilotSources = "updateCopilotSources",
1681
- UpdateCopilotUpdatePreview = "updateCopilotUpdatePreview",
1682
- UpdateCopilotLegacyPreview = "updateCopilotLegacyPreview",
1683
- GetUtilityModels = "getUtilityModels",
1684
- UtilityModelsResponse = "utilityModelsResponse",
1685
- UpdateUtilityModels = "updateUtilityModels",
1686
- GetServerProxyState = "getServerProxyState",
1687
- ServerProxyStateResponse = "serverProxyStateResponse",
1688
- SetServerProxyEnabled = "setServerProxyEnabled",
1689
- SetServerProxyAllowOverride = "setServerProxyAllowOverride",
1690
- GetCachedServerUrl = "getCachedServerUrl",
1691
- CachedServerUrlResponse = "cachedServerUrlResponse"
1571
+ export interface ExternalTool {
1572
+ id: string;
1573
+ name: string;
1574
+ url: string;
1575
+ description?: string;
1576
+ icon?: string;
1577
+ isDefault?: boolean;
1578
+ }
1579
+ export interface AzureProfile {
1580
+ id: string;
1581
+ name: string;
1582
+ method: "FTP" | "MSDeploy";
1583
+ host: string;
1584
+ username?: string;
1585
+ password?: string;
1586
+ remotePath?: string;
1587
+ port?: number;
1588
+ }
1589
+ export interface ApiConfig {
1590
+ schemaPath: string;
1591
+ requestLibPath?: string;
1592
+ projectName?: string;
1593
+ namespace?: string;
1594
+ serversPath?: string;
1595
+ apiPrefix?: string;
1596
+ mock?: boolean;
1597
+ templatesFolder?: string;
1598
+ enumStyle?: "string-literal" | "enum";
1599
+ }
1600
+ //#endregion
1601
+ //#region src/messages.d.ts
1602
+ export declare enum WebviewMessageType {
1603
+ WebviewReady = "webviewReady",
1604
+ Ready = "ready",
1605
+ Log = "log",
1606
+ ExecuteCommand = "executeCommand",
1607
+ OpenUrl = "openUrl",
1608
+ UsePrompt = "usePrompt",
1609
+ UpdateAzureProfiles = "updateAzureProfiles",
1610
+ UpdateAzureProfile = "updateAzureProfile",
1611
+ GetApiConfig = "getApiConfig",
1612
+ UpdateApiConfig = "updateApiConfig",
1613
+ SaveApiConfig = "saveApiConfig",
1614
+ ApiConfigSaveFailed = "apiConfigSaveFailed",
1615
+ ExportApiConfig = "exportApiConfig",
1616
+ ImportApiConfig = "importApiConfig",
1617
+ ApiConfigImported = "apiConfigImported",
1618
+ AddExternalTool = "addExternalTool",
1619
+ UpdateExternalTool = "updateExternalTool",
1620
+ UpdateExternalTools = "updateExternalTools",
1621
+ DeleteExternalTool = "deleteExternalTool",
1622
+ ReorderExternalTools = "reorderExternalTools",
1623
+ UpdateNgrokStatus = "updateNgrokStatus",
1624
+ UpdateServerStatus = "updateServerStatus",
1625
+ UpdateOcxStatus = "updateOcxStatus",
1626
+ UpdateRtkStatus = "updateRtkStatus",
1627
+ UpdateCodegraphStatus = "updateCodegraphStatus",
1628
+ GetAuthState = "getAuthState",
1629
+ UpdateAuthState = "updateAuthState",
1630
+ Login = "login",
1631
+ Logout = "logout",
1632
+ GetAccounts = "getAccounts",
1633
+ UpdateAccounts = "updateAccounts",
1634
+ SwitchAccount = "switchAccount",
1635
+ GetUserProfile = "getUserProfile",
1636
+ UpdateUserProfile = "updateUserProfile",
1637
+ UserProfileUpdated = "userProfileUpdated",
1638
+ AddExtraEmail = "addExtraEmail",
1639
+ DeleteExtraEmail = "deleteExtraEmail",
1640
+ GetCalendarHolidays = "getCalendarHolidays",
1641
+ UpdateCalendarHolidays = "updateCalendarHolidays",
1642
+ GetCalendarLeaves = "getCalendarLeaves",
1643
+ UpdateCalendarLeaves = "updateCalendarLeaves",
1644
+ CreateCalendarLeave = "createCalendarLeave",
1645
+ DeleteCalendarLeave = "deleteCalendarLeave",
1646
+ GetCalendarNotes = "getCalendarNotes",
1647
+ UpdateCalendarNotes = "updateCalendarNotes",
1648
+ SaveCalendarNote = "saveCalendarNote",
1649
+ GetCalendarMonthSchedule = "getCalendarMonthSchedule",
1650
+ GetScheduledTasks = "getScheduledTasks",
1651
+ UpdateScheduledTasks = "updateScheduledTasks",
1652
+ CreateScheduledTask = "createScheduledTask",
1653
+ EditScheduledTask = "editScheduledTask",
1654
+ DeleteScheduledTask = "deleteScheduledTask",
1655
+ ToggleScheduledTask = "toggleScheduledTask",
1656
+ TriggerScheduledTask = "triggerScheduledTask",
1657
+ CancelTaskExecution = "cancelTaskExecution",
1658
+ GetTaskExecutionLogs = "getTaskExecutionLogs",
1659
+ ClearTaskExecutionLogs = "clearTaskExecutionLogs",
1660
+ UpdateTaskExecutionLogs = "updateTaskExecutionLogs",
1661
+ UpdateTaskExecutionState = "updateTaskExecutionState",
1662
+ GetCurrentWorkspace = "getCurrentWorkspace",
1663
+ UpdateCurrentWorkspace = "updateCurrentWorkspace",
1664
+ GetProviders = "getProviders",
1665
+ ProvidersResponse = "providersResponse",
1666
+ AddProvider = "addProvider",
1667
+ UpdateProvider = "updateProvider",
1668
+ RemoveProvider = "removeProvider",
1669
+ SetDefaultProvider = "setDefaultProvider",
1670
+ SetProviderEnabled = "setProviderEnabled",
1671
+ SetProviderOrder = "setProviderOrder",
1672
+ TestProvider = "testProvider",
1673
+ ProviderTestResultMessage = "providerTestResult",
1674
+ TestProviderModel = "testProviderModel",
1675
+ ProviderTestModelResultMessage = "providerTestModelResult",
1676
+ DefaultProviderChanged = "defaultProviderChanged",
1677
+ FetchProviderModels = "fetchProviderModels",
1678
+ FetchProviderModelsResult = "fetchProviderModelsResult",
1679
+ GetProviderUsage = "getProviderUsage",
1680
+ ProviderUsageResponse = "providerUsageResponse",
1681
+ SetCacheControlEnabled = "setCacheControlEnabled",
1682
+ GetByomSettings = "getByomSettings",
1683
+ ByomSettingsResponse = "byomSettingsResponse",
1684
+ ListSkillRepoEntries = "listSkillRepoEntries",
1685
+ GetSkillRepoEntry = "getSkillRepoEntry",
1686
+ InstallSkillRepoEntry = "installSkillRepoEntry",
1687
+ ConvertSkillRepoEntryToSymlink = "convertSkillRepoEntryToSymlink",
1688
+ UninstallSkillRepoEntry = "uninstallSkillRepoEntry",
1689
+ SetSkillRepoEntryEnabled = "setSkillRepoEntryEnabled",
1690
+ ListLinkedSkills = "listLinkedSkills",
1691
+ UpdateSkillRepoCatalog = "updateSkillRepoCatalog",
1692
+ UpdateSkillRepoInstall = "updateSkillRepoInstall",
1693
+ UpdateLinkedSkills = "updateLinkedSkills",
1694
+ CreateSkillRepoDraft = "createSkillRepoDraft",
1695
+ CommitSkillRepoDraft = "commitSkillRepoDraft",
1696
+ ListSkillRepoDrafts = "listSkillRepoDrafts",
1697
+ DeleteSkillRepoDraft = "deleteSkillRepoDraft",
1698
+ UpdateSkillRepoDraft = "updateSkillRepoDraft",
1699
+ ListRepositories = "listRepositories",
1700
+ AddRepository = "addRepository",
1701
+ UpdateRepository = "updateRepository",
1702
+ RemoveRepository = "removeRepository",
1703
+ EnableRepository = "enableRepository",
1704
+ DisableRepository = "disableRepository",
1705
+ SyncRepository = "syncRepository",
1706
+ SyncAllRepositories = "syncAllRepositories",
1707
+ ResetParseCache = "resetParseCache",
1708
+ ListCopilotPlugins = "listCopilotPlugins",
1709
+ RegisterCopilotPlugin = "registerCopilotPlugin",
1710
+ UnregisterCopilotPlugin = "unregisterCopilotPlugin",
1711
+ SetCopilotPluginEnabled = "setCopilotPluginEnabled",
1712
+ GetCopilotContentStatus = "getCopilotContentStatus",
1713
+ RestoreCopilotContent = "restoreCopilotContent",
1714
+ ApproveCopilotContent = "approveCopilotContent",
1715
+ UpdateRepositoryList = "updateRepositoryList",
1716
+ UpdateRepositoryAdd = "updateRepositoryAdd",
1717
+ UpdateRepositoryUpdate = "updateRepositoryUpdate",
1718
+ UpdateRepositoryRemove = "updateRepositoryRemove",
1719
+ UpdateRepositoryToggle = "updateRepositoryToggle",
1720
+ UpdateRepositorySyncResult = "updateRepositorySyncResult",
1721
+ UpdateCopilotContentStatus = "updateCopilotContentStatus",
1722
+ GetCopilotCustomizations = "getCopilotCustomizations",
1723
+ SyncCopilotCustomizations = "syncCopilotCustomizations",
1724
+ UpdateCopilotCustomizations = "updateCopilotCustomizations",
1725
+ InstallCopilotPackage = "installCopilotPackage",
1726
+ MoveCopilotPackage = "moveCopilotPackage",
1727
+ UninstallCopilotPackage = "uninstallCopilotPackage",
1728
+ ListCopilotSources = "listCopilotSources",
1729
+ RemoveCopilotSource = "removeCopilotSource",
1730
+ PreviewCopilotUpdate = "previewCopilotUpdate",
1731
+ UpdateCopilotPackage = "updateCopilotPackage",
1732
+ PreviewCopilotLegacy = "previewCopilotLegacy",
1733
+ MigrateCopilotLegacy = "migrateCopilotLegacy",
1734
+ UpdateCopilotSources = "updateCopilotSources",
1735
+ UpdateCopilotUpdatePreview = "updateCopilotUpdatePreview",
1736
+ UpdateCopilotLegacyPreview = "updateCopilotLegacyPreview",
1737
+ GetUtilityModels = "getUtilityModels",
1738
+ UtilityModelsResponse = "utilityModelsResponse",
1739
+ UpdateUtilityModels = "updateUtilityModels",
1740
+ GetServerProxyState = "getServerProxyState",
1741
+ ServerProxyStateResponse = "serverProxyStateResponse",
1742
+ SetServerProxyEnabled = "setServerProxyEnabled",
1743
+ SetServerProxyAllowOverride = "setServerProxyAllowOverride",
1744
+ GetCachedServerUrl = "getCachedServerUrl",
1745
+ CachedServerUrlResponse = "cachedServerUrlResponse"
1692
1746
  }
1693
1747
  /**
1694
1748
  * Top-level const aliases for the BYO Utility Models message-type
@@ -1704,18 +1758,18 @@ declare enum WebviewMessageType {
1704
1758
  * sync; Task 5 (extension handler) uses the enum members, the webview
1705
1759
  * component + tests use the consts.
1706
1760
  */
1707
- declare const GetUtilityModels: "getUtilityModels";
1708
- declare const UtilityModelsResponse: "utilityModelsResponse";
1709
- declare const UpdateUtilityModels: "updateUtilityModels";
1710
- declare const SetCacheControlEnabled: "setCacheControlEnabled";
1711
- declare const GetByomSettings: "getByomSettings";
1712
- declare const ByomSettingsResponse: "byomSettingsResponse";
1713
- declare const GetServerProxyState: "getServerProxyState";
1714
- declare const ServerProxyStateResponse: "serverProxyStateResponse";
1715
- declare const SetServerProxyEnabled: "setServerProxyEnabled";
1716
- declare const SetServerProxyAllowOverride: "setServerProxyAllowOverride";
1717
- declare const GetCachedServerUrl: "getCachedServerUrl";
1718
- declare const CachedServerUrlResponse: "cachedServerUrlResponse";
1761
+ export declare const GetUtilityModels: "getUtilityModels";
1762
+ export declare const UtilityModelsResponse: "utilityModelsResponse";
1763
+ export declare const UpdateUtilityModels: "updateUtilityModels";
1764
+ export declare const SetCacheControlEnabled: "setCacheControlEnabled";
1765
+ export declare const GetByomSettings: "getByomSettings";
1766
+ export declare const ByomSettingsResponse: "byomSettingsResponse";
1767
+ export declare const GetServerProxyState: "getServerProxyState";
1768
+ export declare const ServerProxyStateResponse: "serverProxyStateResponse";
1769
+ export declare const SetServerProxyEnabled: "setServerProxyEnabled";
1770
+ export declare const SetServerProxyAllowOverride: "setServerProxyAllowOverride";
1771
+ export declare const GetCachedServerUrl: "getCachedServerUrl";
1772
+ export declare const CachedServerUrlResponse: "cachedServerUrlResponse";
1719
1773
  /**
1720
1774
  * Snapshot of the r7 server-proxy toggle (HTTP CONNECT through intranet
1721
1775
  * Server). Mirrors `IProxyConfigService`'s `ProxyState` shape so the
@@ -1728,24 +1782,24 @@ declare const CachedServerUrlResponse: "cachedServerUrlResponse";
1728
1782
  * See `apps/extension/src/services/proxy/ProxyConfigService.ts` for
1729
1783
  * the authoritative source of truth.
1730
1784
  */
1731
- type ServerProxySupportMode = "off" | "on" | "fallback" | "override";
1732
- interface ServerProxySnapshot {
1733
- httpProxy: string | undefined;
1734
- httpProxyStrictSSL: boolean;
1735
- httpProxySupport: ServerProxySupportMode;
1736
- /** Self-flag at serverProxy.enabled; computed by the extension handler. */
1737
- enabled: boolean;
1738
- /**
1739
- * rev.21 — opt-in to bypass the `proxySupport === "override"`
1740
- * guard. Power users (e.g. corp environments that WANT all
1741
- * extensions including GitHub Copilot Chat to route through the
1742
- * corp tunnel) tick the "Allow under proxySupport=override"
1743
- * checkbox in the Webview; this flag is persisted to
1744
- * `~/.serviceme/server-proxy.json` alongside `enabled`.
1745
- */
1746
- allowOverride: boolean;
1747
- /** Last server URL we toggled ON with. Used for re-toggling and UI hint. */
1748
- lastServerUrl?: string;
1785
+ export type ServerProxySupportMode = "off" | "on" | "fallback" | "override";
1786
+ export interface ServerProxySnapshot {
1787
+ httpProxy: string | undefined;
1788
+ httpProxyStrictSSL: boolean;
1789
+ httpProxySupport: ServerProxySupportMode;
1790
+ /** Self-flag at serverProxy.enabled; computed by the extension handler. */
1791
+ enabled: boolean;
1792
+ /**
1793
+ * rev.21 — opt-in to bypass the `proxySupport === "override"`
1794
+ * guard. Power users (e.g. corp environments that WANT all
1795
+ * extensions including GitHub Copilot Chat to route through the
1796
+ * corp tunnel) tick the "Allow under proxySupport=override"
1797
+ * checkbox in the Webview; this flag is persisted to
1798
+ * `~/.serviceme/server-proxy.json` alongside `enabled`.
1799
+ */
1800
+ allowOverride: boolean;
1801
+ /** Last server URL we toggled ON with. Used for re-toggling and UI hint. */
1802
+ lastServerUrl?: string;
1749
1803
  }
1750
1804
  /**
1751
1805
  * Payload for `SetServerProxyEnabled`. The extension handler is the
@@ -1762,16 +1816,16 @@ interface ServerProxySnapshot {
1762
1816
  * applied as `http.proxy` even when `http.proxy` is currently empty.
1763
1817
  * Still subject to the `proxySupport !== "override"` server-side gate.
1764
1818
  */
1765
- interface ServerProxyTogglePayload {
1766
- enabled: boolean;
1767
- /** Optional — defaults to Workspace. */
1768
- target?: "workspace" | "global";
1769
- /**
1770
- * Optional — override the snapshot's `http.proxy` for the write.
1771
- * Only honoured when `enabled === true`; ignored on disable so the
1772
- * existing "only clear our own write" semantics stay intact.
1773
- */
1774
- serverUrl?: string;
1819
+ export interface ServerProxyTogglePayload {
1820
+ enabled: boolean;
1821
+ /** Optional — defaults to Workspace. */
1822
+ target?: "workspace" | "global";
1823
+ /**
1824
+ * Optional — override the snapshot's `http.proxy` for the write.
1825
+ * Only honoured when `enabled === true`; ignored on disable so the
1826
+ * existing "only clear our own write" semantics stay intact.
1827
+ */
1828
+ serverUrl?: string;
1775
1829
  }
1776
1830
  /**
1777
1831
  * rev.21 — payload for `SetServerProxyAllowOverride`. Toggles the
@@ -1779,8 +1833,8 @@ interface ServerProxyTogglePayload {
1779
1833
  * Persisted across VS Code restarts; defaults to `false` so users
1780
1834
  * must explicitly opt-in to the `override` mode bypass.
1781
1835
  */
1782
- interface ServerProxyAllowOverridePayload {
1783
- allowOverride: boolean;
1836
+ export interface ServerProxyAllowOverridePayload {
1837
+ allowOverride: boolean;
1784
1838
  }
1785
1839
  /**
1786
1840
  * Reply to `GetCachedServerUrl`. Carries the cached base URL resolved
@@ -1792,9 +1846,9 @@ interface ServerProxyAllowOverridePayload {
1792
1846
  * reachable Server — the Webview should hide the "Apply cached base
1793
1847
  * URL" affordance rather than offer a no-op button.
1794
1848
  */
1795
- interface CachedServerUrlSnapshot {
1796
- baseUrl: string | null;
1797
- httpProxySupport: ServerProxySupportMode;
1849
+ export interface CachedServerUrlSnapshot {
1850
+ baseUrl: string | null;
1851
+ httpProxySupport: ServerProxySupportMode;
1798
1852
  }
1799
1853
  /**
1800
1854
  * Where the three `msDevTools.utilityModels.*` settings (and their
@@ -1810,16 +1864,16 @@ interface CachedServerUrlSnapshot {
1810
1864
  * wins over a user value when both are present), so we only need to
1811
1865
  * write to ONE target — the other scope just naturally inherits.
1812
1866
  */
1813
- type UtilityModelScope = "user" | "workspace";
1867
+ export type UtilityModelScope = "user" | "workspace";
1814
1868
  /**
1815
1869
  * Per-field source for UI "this value comes from user / workspace /
1816
1870
  * default" indicators. Mirrors the `ConfigurationInspectionScope`
1817
1871
  * categories of `vscode.WorkspaceConfiguration.inspect(key)`.
1818
1872
  */
1819
- interface UtilityModelsSource {
1820
- small: "user" | "workspace" | "default";
1821
- medium: "user" | "workspace" | "default";
1822
- fallbackToCopilot: "user" | "workspace" | "default";
1873
+ export interface UtilityModelsSource {
1874
+ small: "user" | "workspace" | "default";
1875
+ medium: "user" | "workspace" | "default";
1876
+ fallbackToCopilot: "user" | "workspace" | "default";
1823
1877
  }
1824
1878
  /**
1825
1879
  * The value Copilot is ACTUALLY using right now — VS Code's real
@@ -1828,10 +1882,10 @@ interface UtilityModelsSource {
1828
1882
  * for editing. Computed via `configSection.get(key, default)`, the
1829
1883
  * same call VS Code itself uses to resolve a setting.
1830
1884
  */
1831
- interface UtilityModelsEffective {
1832
- small: string;
1833
- medium: string;
1834
- fallbackToCopilot: boolean;
1885
+ export interface UtilityModelsEffective {
1886
+ small: string;
1887
+ medium: string;
1888
+ fallbackToCopilot: boolean;
1835
1889
  }
1836
1890
  /**
1837
1891
  * Snapshot of the three msDevTools.utilityModels.* settings plus the
@@ -1855,17 +1909,17 @@ interface UtilityModelsEffective {
1855
1909
  * title always shows what's actually in effect regardless of which
1856
1910
  * scope tab happens to be open.
1857
1911
  */
1858
- interface UtilityModelsSnapshot {
1859
- small: string;
1860
- medium: string;
1861
- fallbackToCopilot: boolean;
1862
- enabledModelIds: string[];
1863
- /** Effective scope for the next write. Defaults to `"user"`. */
1864
- scope: UtilityModelScope;
1865
- /** Per-field source (which scope actually defined the value). */
1866
- source?: UtilityModelsSource;
1867
- /** The real merged value Copilot uses right now. See docstring above. */
1868
- effective: UtilityModelsEffective;
1912
+ export interface UtilityModelsSnapshot {
1913
+ small: string;
1914
+ medium: string;
1915
+ fallbackToCopilot: boolean;
1916
+ enabledModelIds: string[];
1917
+ /** Effective scope for the next write. Defaults to `"user"`. */
1918
+ scope: UtilityModelScope;
1919
+ /** Per-field source (which scope actually defined the value). */
1920
+ source?: UtilityModelsSource;
1921
+ /** The real merged value Copilot uses right now. See docstring above. */
1922
+ effective: UtilityModelsEffective;
1869
1923
  }
1870
1924
  /**
1871
1925
  * Partial-update payload for UpdateUtilityModels. Omit a field to
@@ -1876,11 +1930,11 @@ interface UtilityModelsSnapshot {
1876
1930
  * the previous scope; the first call (with no prior scope) defaults
1877
1931
  * to `"user"`.
1878
1932
  */
1879
- interface UpdateUtilityModelsPayload {
1880
- small?: string;
1881
- medium?: string;
1882
- fallbackToCopilot?: boolean;
1883
- scope?: UtilityModelScope;
1933
+ export interface UpdateUtilityModelsPayload {
1934
+ small?: string;
1935
+ medium?: string;
1936
+ fallbackToCopilot?: boolean;
1937
+ scope?: UtilityModelScope;
1884
1938
  }
1885
1939
  /**
1886
1940
  * Per-provider BYOM toggle payload. Used by `SetCacheControlEnabled` —
@@ -1892,9 +1946,9 @@ interface UpdateUtilityModelsPayload {
1892
1946
  * `msDevTools.byom.<providerId>.<key>` key that the
1893
1947
  * `LmChatProviderRegistrar` already reads on every chat invocation.
1894
1948
  */
1895
- interface ByomTogglePayload {
1896
- id: string;
1897
- enabled: boolean;
1949
+ export interface ByomTogglePayload {
1950
+ id: string;
1951
+ enabled: boolean;
1898
1952
  }
1899
1953
  /**
1900
1954
  * Snapshot of every BYOM provider's runtime toggles, keyed by
@@ -1907,16 +1961,16 @@ interface ByomTogglePayload {
1907
1961
  * `byomSettings.ts` default (`cacheEnabled: true`) — the Webview
1908
1962
  * does NOT need a separate "default" branch.
1909
1963
  */
1910
- type ByomSettingsSnapshot = Record<string, ByomProviderToggles>;
1964
+ export type ByomSettingsSnapshot = Record<string, ByomProviderToggles>;
1911
1965
  /**
1912
1966
  * Per-provider BYOM toggles. Mirrors the runtime contract in
1913
1967
  * `apps/extension/src/services/providers/byomSettings.ts`
1914
1968
  * (`ByomProviderToggles`) — keep the two in lock-step so a
1915
1969
  * `GetByomSettings` payload round-trips without reshape code.
1916
1970
  */
1917
- interface ByomProviderToggles {
1918
- /** P0.1 + P0.2 cache toggle — default TRUE (main-line decision Q1). */
1919
- cacheEnabled: boolean;
1971
+ export interface ByomProviderToggles {
1972
+ /** P0.1 + P0.2 cache toggle — default TRUE (main-line decision Q1). */
1973
+ cacheEnabled: boolean;
1920
1974
  }
1921
1975
  /**
1922
1976
  * Strict-typed shape for the inbound messages handled by
@@ -1929,65 +1983,65 @@ interface ByomProviderToggles {
1929
1983
  * Each variant lists ONLY the fields the hook actually reads; optional
1930
1984
  * fields are explicit (`tools?` / `profiles?` / `workspaceOpen`).
1931
1985
  */
1932
- type WebviewInboundMessage = {
1933
- type: typeof WebviewMessageType.UpdateRepositoryList;
1934
- repos: BridgeRepoEntry[];
1986
+ export type WebviewInboundMessage = {
1987
+ type: typeof WebviewMessageType.UpdateRepositoryList;
1988
+ repos: BridgeRepoEntry[];
1935
1989
  } | {
1936
- type: typeof WebviewMessageType.UpdateRepositoryUpdate;
1937
- repos: BridgeRepoEntry[];
1990
+ type: typeof WebviewMessageType.UpdateRepositoryUpdate;
1991
+ repos: BridgeRepoEntry[];
1938
1992
  } | {
1939
- type: typeof WebviewMessageType.UpdateSkillRepoCatalog;
1940
- entries?: BridgeSkillRepoEntry[];
1941
- workspaceOpen?: boolean;
1993
+ type: typeof WebviewMessageType.UpdateSkillRepoCatalog;
1994
+ entries?: BridgeSkillRepoEntry[];
1995
+ workspaceOpen?: boolean;
1942
1996
  } | {
1943
- type: typeof WebviewMessageType.UpdateLinkedSkills;
1944
- links: LinkedSkillPayloadEntry[];
1945
- kind: "skill" | "agent";
1997
+ type: typeof WebviewMessageType.UpdateLinkedSkills;
1998
+ links: LinkedSkillPayloadEntry[];
1999
+ kind: "skill" | "agent";
1946
2000
  } | {
1947
- type: typeof WebviewMessageType.UpdateCopilotContentStatus;
1948
- entries: CopilotContentStatusEntry[];
1949
- changed: boolean;
1950
- workspaceOpen?: boolean;
2001
+ type: typeof WebviewMessageType.UpdateCopilotContentStatus;
2002
+ entries: CopilotContentStatusEntry[];
2003
+ changed: boolean;
2004
+ workspaceOpen?: boolean;
1951
2005
  } | {
1952
- type: typeof WebviewMessageType.UpdateCopilotCustomizations;
1953
- view: CopilotCustomizationViewPayload;
1954
- /** Installable plugin.json packages from the enabled git
1955
- * sources. Optional: older CLI builds omit it. */
1956
- availablePackages?: CopilotAvailablePackagePayload[];
2006
+ type: typeof WebviewMessageType.UpdateCopilotCustomizations;
2007
+ view: CopilotCustomizationViewPayload;
2008
+ /** Installable plugin.json packages from the enabled git
2009
+ * sources. Optional: older CLI builds omit it. */
2010
+ availablePackages?: CopilotAvailablePackagePayload[];
1957
2011
  } | {
1958
- type: typeof WebviewMessageType.UpdateCopilotSources;
1959
- sources: CopilotSourceRecordPayload[];
2012
+ type: typeof WebviewMessageType.UpdateCopilotSources;
2013
+ sources: CopilotSourceRecordPayload[];
1960
2014
  } | {
1961
- type: typeof WebviewMessageType.UpdateCopilotUpdatePreview;
1962
- preview: CopilotPackageUpdatePreviewPayload;
2015
+ type: typeof WebviewMessageType.UpdateCopilotUpdatePreview;
2016
+ preview: CopilotPackageUpdatePreviewPayload;
1963
2017
  } | {
1964
- type: typeof WebviewMessageType.UpdateExternalTools;
1965
- tools?: ExternalTool[];
2018
+ type: typeof WebviewMessageType.UpdateExternalTools;
2019
+ tools?: ExternalTool[];
1966
2020
  } | {
1967
- type: typeof WebviewMessageType.UpdateNgrokStatus;
1968
- isRunning: boolean;
2021
+ type: typeof WebviewMessageType.UpdateNgrokStatus;
2022
+ isRunning: boolean;
1969
2023
  } | {
1970
- type: typeof WebviewMessageType.UpdateOcxStatus;
1971
- isRunning: boolean;
2024
+ type: typeof WebviewMessageType.UpdateOcxStatus;
2025
+ isRunning: boolean;
1972
2026
  } | {
1973
- type: typeof WebviewMessageType.UpdateRtkStatus;
1974
- installed: boolean;
1975
- version?: string;
1976
- workspaceEnabled: boolean;
2027
+ type: typeof WebviewMessageType.UpdateRtkStatus;
2028
+ installed: boolean;
2029
+ version?: string;
2030
+ workspaceEnabled: boolean;
1977
2031
  } | {
1978
- type: typeof WebviewMessageType.UpdateCodegraphStatus;
1979
- installed: boolean;
1980
- version?: string;
1981
- indexed: boolean;
1982
- mcpConfigured?: boolean;
1983
- hookInstalled?: boolean;
1984
- instructionsEnabled?: boolean;
2032
+ type: typeof WebviewMessageType.UpdateCodegraphStatus;
2033
+ installed: boolean;
2034
+ version?: string;
2035
+ indexed: boolean;
2036
+ mcpConfigured?: boolean;
2037
+ hookInstalled?: boolean;
2038
+ instructionsEnabled?: boolean;
1985
2039
  } | {
1986
- type: typeof WebviewMessageType.UpdateAzureProfiles;
1987
- profiles?: AzureProfile[];
2040
+ type: typeof WebviewMessageType.UpdateAzureProfiles;
2041
+ profiles?: AzureProfile[];
1988
2042
  } | {
1989
- type: typeof WebviewMessageType.UpdateApiConfig;
1990
- config: ApiConfig;
2043
+ type: typeof WebviewMessageType.UpdateApiConfig;
2044
+ config: ApiConfig;
1991
2045
  };
1992
2046
  /**
1993
2047
  * One entry inside the `UpdateLinkedSkills.links` array. Mirrors the
@@ -1995,10 +2049,10 @@ type WebviewInboundMessage = {
1995
2049
  * than re-declared at the call site) lets the discriminated union's
1996
2050
  * `links` field carry a real type instead of `unknown[]`.
1997
2051
  */
1998
- interface LinkedSkillPayloadEntry {
1999
- repoId: string;
2000
- name: string;
2001
- scope?: string;
2052
+ export interface LinkedSkillPayloadEntry {
2053
+ repoId: string;
2054
+ name: string;
2055
+ scope?: string;
2002
2056
  }
2003
2057
  /**
2004
2058
  * One entry inside the `UpdateCopilotContentStatus.entries` array.
@@ -2006,10 +2060,10 @@ interface LinkedSkillPayloadEntry {
2006
2060
  * (identity + status + optional message) so the webview can render the
2007
2061
  * reconciliation state without importing the protocol package.
2008
2062
  */
2009
- interface CopilotContentStatusEntry {
2010
- identity: string;
2011
- status: "restored" | "adopted" | "pending_approval" | "missing_source" | "conflict" | "drifted";
2012
- message?: string;
2063
+ export interface CopilotContentStatusEntry {
2064
+ identity: string;
2065
+ status: "restored" | "adopted" | "pending_approval" | "missing_source" | "conflict" | "drifted";
2066
+ message?: string;
2013
2067
  }
2014
2068
  /**
2015
2069
  * Task 7 — webview → extension install intent. Mirrors the Task 3
@@ -2019,64 +2073,66 @@ interface CopilotContentStatusEntry {
2019
2073
  * discovery preview blocks submission until the user picks one) and
2020
2074
  * is omitted for git / marketplace sources.
2021
2075
  */
2022
- interface InstallCopilotPackageAction {
2023
- type: WebviewMessageType.InstallCopilotPackage;
2024
- scope: "workspace" | "personal";
2025
- sourceId: string;
2026
- packageId: string;
2027
- artifactIds: string[];
2028
- pinnedVersion?: string;
2029
- localMode?: "live" | "private-workspace-override";
2076
+ export interface InstallCopilotPackageAction {
2077
+ type: WebviewMessageType.InstallCopilotPackage;
2078
+ scope: "workspace" | "personal";
2079
+ sourceId: string;
2080
+ packageId: string;
2081
+ artifactIds: string[];
2082
+ pinnedVersion?: string;
2083
+ localMode?: "live" | "private-workspace-override";
2030
2084
  }
2031
2085
  /** Task 9 — webview → extension move intent; workspaceDir is resolved extension-side. */
2032
- interface MoveCopilotPackageAction {
2033
- type: WebviewMessageType.MoveCopilotPackage;
2034
- packageId: string;
2035
- from: "workspace" | "personal";
2036
- to: "workspace" | "personal";
2086
+ export interface MoveCopilotPackageAction {
2087
+ type: WebviewMessageType.MoveCopilotPackage;
2088
+ packageId: string;
2089
+ from: "workspace" | "personal";
2090
+ to: "workspace" | "personal";
2037
2091
  }
2038
2092
  /** Task 9 — webview → extension uninstall intent; workspaceDir is resolved extension-side. */
2039
- interface UninstallCopilotPackageAction {
2040
- type: WebviewMessageType.UninstallCopilotPackage;
2041
- scope: "workspace" | "personal";
2042
- packageId: string;
2093
+ export interface UninstallCopilotPackageAction {
2094
+ type: WebviewMessageType.UninstallCopilotPackage;
2095
+ scope: "workspace" | "personal";
2096
+ packageId: string;
2043
2097
  }
2044
2098
  /** Task 10 — webview → extension source list intent; workspaceDir is resolved extension-side. */
2045
- interface ListCopilotSourcesAction {
2046
- type: WebviewMessageType.ListCopilotSources;
2047
- scope: "workspace" | "personal";
2099
+ export interface ListCopilotSourcesAction {
2100
+ type: WebviewMessageType.ListCopilotSources;
2101
+ scope: "workspace" | "personal";
2048
2102
  }
2049
2103
  /** Task 10 — webview → extension source removal intent; workspaceDir is resolved extension-side. */
2050
- interface RemoveCopilotSourceAction {
2051
- type: WebviewMessageType.RemoveCopilotSource;
2052
- scope: "workspace" | "personal";
2053
- sourceId: string;
2104
+ export interface RemoveCopilotSourceAction {
2105
+ type: WebviewMessageType.RemoveCopilotSource;
2106
+ scope: "workspace" | "personal";
2107
+ sourceId: string;
2054
2108
  }
2055
2109
  /** Task 10 — webview → extension update preview intent; workspaceDir is resolved extension-side. */
2056
- interface PreviewCopilotUpdateAction {
2057
- type: WebviewMessageType.PreviewCopilotUpdate;
2058
- scope: "workspace" | "personal";
2059
- packageId: string;
2060
- revision: string;
2061
- }
2062
-
2110
+ export interface PreviewCopilotUpdateAction {
2111
+ type: WebviewMessageType.PreviewCopilotUpdate;
2112
+ scope: "workspace" | "personal";
2113
+ packageId: string;
2114
+ revision: string;
2115
+ }
2116
+ //#endregion
2117
+ //#region src/scheduled-tasks.d.ts
2063
2118
  /** Live execution state pushed to webview during task execution */
2064
- interface TaskExecutionState {
2065
- executionId: string;
2066
- taskId: string;
2067
- taskName: string;
2068
- status: "running" | "success" | "failure" | "timeout" | "cancelled";
2069
- startedAt: string;
2070
- finishedAt?: string;
2071
- output: string;
2072
- error?: string;
2119
+ export interface TaskExecutionState {
2120
+ executionId: string;
2121
+ taskId: string;
2122
+ taskName: string;
2123
+ status: "running" | "success" | "failure" | "timeout" | "cancelled";
2124
+ startedAt: string;
2125
+ finishedAt?: string;
2126
+ output: string;
2127
+ error?: string;
2073
2128
  }
2074
2129
  /** Log file schema for .serviceme/scheduled-tasks-log.json */
2075
- interface ScheduledTasksLogFile {
2076
- version: 1;
2077
- logs: TaskExecutionLog[];
2130
+ export interface ScheduledTasksLogFile {
2131
+ version: 1;
2132
+ logs: TaskExecutionLog[];
2078
2133
  }
2079
-
2134
+ //#endregion
2135
+ //#region src/utils/safe-cast.d.ts
2080
2136
  /**
2081
2137
  * Environment-agnostic cast helpers.
2082
2138
  *
@@ -2096,7 +2152,7 @@ interface ScheduledTasksLogFile {
2096
2152
  * the runtime shape here. Keeping the cast in one place makes the intent
2097
2153
  * (and the assumption) explicit and grep-able.
2098
2154
  */
2099
- declare function parsePayload<T>(raw: unknown): T;
2155
+ export declare function parsePayload<T>(raw: unknown): T;
2100
2156
  /**
2101
2157
  * Best-effort extraction of an `AbortSignal` from an inbound request object.
2102
2158
  *
@@ -2108,7 +2164,7 @@ declare function parsePayload<T>(raw: unknown): T;
2108
2164
  * is the same as "no signal". In practice the request signal is always a real
2109
2165
  * `AbortSignal`, so behavior is unchanged for every production path.
2110
2166
  */
2111
- declare function asAbortSignal(input: unknown): AbortSignal | undefined;
2167
+ export declare function asAbortSignal(input: unknown): AbortSignal | undefined;
2112
2168
  /**
2113
2169
  * Parse a JSON string, returning `fallback` when parsing fails.
2114
2170
  *
@@ -2117,6 +2173,5 @@ declare function asAbortSignal(input: unknown): AbortSignal | undefined;
2117
2173
  * with their own `.catch` so that a body-read failure still yields the same
2118
2174
  * fallback as a malformed-body failure).
2119
2175
  */
2120
- declare function safeJson<T>(text: string, fallback: T): T;
2121
-
2122
- export { type AIModelConfig, type AIModelInfo, type AgentPermissionSummary, type AgentToolPermission, type AgentToolRiskLevel, type ApiConfig, type AzureProfile, BUILTIN_PROVIDER_PRESETS, type BalanceEntry, type BridgeLinkMode, type BridgeLinkedSkill, type BridgeRepoEntry, type BridgeRepoSyncPull, type BridgeSkillKind, type BridgeSkillRepoEntry, type BridgeSkillRepoFile, type ByomProviderToggles, ByomSettingsResponse, type ByomSettingsSnapshot, type ByomTogglePayload, CERTIFICATE_BUNDLE_FORMATS, CachedServerUrlResponse, type CachedServerUrlSnapshot, type CertificateBundleEnvironmentSupport, type CertificateBundleFormat, type CertificateBundleFormatDescriptor, type CodingPlanUsage, type CommandPayload, type CopilotArtifactStatePayload, type CopilotArtifactSummaryPayload, type CopilotArtifactViewPayload, type CopilotAvailablePackagePayload, type CopilotContentStatusEntry, type CopilotCustomizationArtifactKind, type CopilotCustomizationGate, type CopilotCustomizationHealth, type CopilotCustomizationInstallIntent, type CopilotCustomizationScope, type CopilotCustomizationStatus, type CopilotCustomizationViewPayload, type CopilotPackageDefinitionPayload, type CopilotPackageInstallationPayload, type CopilotPackageUpdatePreviewPayload, type CopilotPackageViewPayload, type CopilotSourceRecordPayload, type CopilotSourceViewPayload, type CuratedModelMetadata, type DeepseekBalanceEntry, type DeepseekUsage, DeviceAuthHeaders, type DeviceRequestSignatureParams, type DownloadCertificateBundleRequest, type DownloadCertificateBundleResponse, type ExternalTool, GIT_REMOTE_HOST_ALIASES, type GenericBalanceUsage, GetByomSettings, GetCachedServerUrl, GetServerProxyState, GetUtilityModels, type GitHubOrgMembershipCheckResult, type GitHubOrgMembershipStatus, type GitHubUser, type GithubCopilotCliPayload, type HttpRequestPayload, type ILogger, type InstallCopilotPackageAction, LISTABLE_PRESET_MODELS, type LinkedSkillPayloadEntry, type ListCopilotSourcesAction, LogLevel, MEDALSOFT_NUGET_PRIVATE_SOURCE, MEDALSOFT_PRIVATE_GATEWAY_URL, MODEL_METADATA, type MinimaxUsage, type ModelDetail, type ModelPriceCategory, type ModelPricing, type ModelThinkingSchema, type MoveCopilotPackageAction, NAMESPACE_ALIASES, NAMESPACE_ALIAS_FAMILY, PRESET_MODEL_FAMILIES, PROVIDER_BASE_URL_PRESETS, PROVIDER_CACHE_CONTROL_METADATA, type PresetModelFamilyGroup, type PresetModelListing, type PreviewCopilotUpdateAction, type ProviderBaseUrlPreset, type ProviderCacheControlMetadata, type ProviderConfig, type ProviderModel, type ProviderMutationPayload, type ProviderTestResult, type ProviderType, type ProviderUsageData, type ProviderUsageKind, type ProviderUsageResult, type ProviderVisionMode, type ProviderWireProtocol, type ProvidersResponsePayload, type PublicProvider, type RemoveCopilotSourceAction, type ScheduledTask, type ScheduledTaskType, type ScheduledTaskV1, type ScheduledTasksConfig, type ScheduledTasksLogFile, type ServerProxyAllowOverridePayload, type ServerProxySnapshot, ServerProxyStateResponse, type ServerProxySupportMode, type ServerProxyTogglePayload, SetCacheControlEnabled, SetServerProxyAllowOverride, SetServerProxyEnabled, type ShellPayload, type TaskExecutionLog, type TaskExecutionState, type TaskExecutionStatus, type TaskPayload, type TaskRunStatus, type TaskWorkspaceRef, type UninstallCopilotPackageAction, UpdateUtilityModels, type UpdateUtilityModelsPayload, type UsageWindow, type UtilityModelScope, type UtilityModelsEffective, UtilityModelsResponse, type UtilityModelsSnapshot, type UtilityModelsSource, type WebviewInboundMessage, WebviewMessageType, __internal, asAbortSignal, buildGitHubLocalEmail, buildPresetModel, checkGitHubOrgMembership, createConsoleLogger, createDeviceRequestSignature, currencyForBaseUrl, effectiveAdapterType, fetchGitHubUser, getBuiltinProviderPreset, getGitHubOrgMembership, getPresetModelDisplayName, getProviderBaseUrlPresets, isGitHubLocalEmail, isProviderCacheControlAware, isValidCanonicalSlug, isWholePackageInstall, listPresetModelGroups, lookupModelMetadata, normalizeCanonicalSlug, normalizeErrorForLog, normalizeGitUrl, parsePayload, protocolForBaseUrl, registrationIdFromPackageId, resolvePrimaryEmail, safeJson, unionProviderModelWithPreset };
2176
+ export declare function safeJson<T>(text: string, fallback: T): T;
2177
+ //#endregion