@serviceme/devtools-protocol 2.0.1 → 2.0.2

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 +1651 -1676
  2. package/dist/index.d.ts +1651 -1676
  3. package/dist/index.js +1195 -1534
  4. package/dist/index.mjs +1008 -1321
  5. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -1,1985 +1,1646 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- AUTH_PROVIDERS: () => AUTH_PROVIDERS,
24
- BRIDGE_EVENTS: () => BRIDGE_EVENTS,
25
- BRIDGE_METHODS: () => BRIDGE_METHODS,
26
- COPILOT_CONTENT_METHOD_ALIASES: () => COPILOT_CONTENT_METHOD_ALIASES,
27
- COPILOT_ERROR_CODES: () => COPILOT_ERROR_CODES,
28
- DEFAULT_JSON_SORT_OPTIONS: () => DEFAULT_JSON_SORT_OPTIONS,
29
- DEVICE_BINDING_STATES: () => DEVICE_BINDING_STATES,
30
- JSON_SORT_ALGORITHMS: () => JSON_SORT_ALGORITHMS,
31
- JSON_SORT_ORDERS: () => JSON_SORT_ORDERS,
32
- KNOWN_ENVIRONMENT_TOOLS: () => KNOWN_ENVIRONMENT_TOOLS,
33
- SERVICEME_CLI_CAPABILITIES: () => SERVICEME_CLI_CAPABILITIES,
34
- SERVICEME_CLI_NAME: () => SERVICEME_CLI_NAME,
35
- SERVICEME_CLI_SCHEMA_VERSION: () => SERVICEME_CLI_SCHEMA_VERSION,
36
- SERVICEME_CLI_VERSION: () => SERVICEME_CLI_VERSION,
37
- SERVICEME_ERROR_CODES: () => SERVICEME_ERROR_CODES,
38
- SERVICEME_IMAGE_FORMATS: () => SERVICEME_IMAGE_FORMATS,
39
- SERVICEME_PROTOCOL_VERSION: () => SERVICEME_PROTOCOL_VERSION,
40
- ServicemeProtocolError: () => ServicemeProtocolError,
41
- TOOLBOX_SCOPES: () => TOOLBOX_SCOPES,
42
- createCliFailure: () => createCliFailure,
43
- createCliSuccess: () => createCliSuccess,
44
- createServicemeError: () => createServicemeError,
45
- getBridgeEventParamsValidator: () => getBridgeEventParamsValidator,
46
- getBridgeResultValidator: () => getBridgeResultValidator,
47
- isAgentMarketplaceState: () => isAgentMarketplaceState,
48
- isAgentMutationRequest: () => isAgentMutationRequest,
49
- isAgentMutationResult: () => isAgentMutationResult,
50
- isAgentPermissionSummary: () => isAgentPermissionSummary,
51
- isAgentPermissionsResult: () => isAgentPermissionsResult,
52
- isAgentSessionStatus: () => isAgentSessionStatus,
53
- isAuthAccountMeta: () => isAuthAccountMeta,
54
- isAuthLoginParams: () => isAuthLoginParams,
55
- isAuthLoginResult: () => isAuthLoginResult,
56
- isAuthLogoutParams: () => isAuthLogoutParams,
57
- isAuthLogoutResult: () => isAuthLogoutResult,
58
- isAuthProvider: () => isAuthProvider,
59
- isAuthSessionHandle: () => isAuthSessionHandle,
60
- isAuthStatus: () => isAuthStatus,
61
- isAuthSwitchParams: () => isAuthSwitchParams,
62
- isAuthSwitchResult: () => isAuthSwitchResult,
63
- isAuthWhoamiResult: () => isAuthWhoamiResult,
64
- isBridgeCapabilities: () => isBridgeCapabilities,
65
- isBridgeEvent: () => isBridgeEvent,
66
- isBridgeEventName: () => isBridgeEventName,
67
- isBridgeMethod: () => isBridgeMethod,
68
- isBridgeRequest: () => isBridgeRequest,
69
- isBridgeResponse: () => isBridgeResponse,
70
- isCliEnvelope: () => isCliEnvelope,
71
- isCopilotContentAdoptUnmanagedParams: () => isCopilotContentAdoptUnmanagedParams,
72
- isCopilotContentAdoptUnmanagedResult: () => isCopilotContentAdoptUnmanagedResult,
73
- isCopilotContentApproveResult: () => isCopilotContentApproveResult,
74
- isCopilotContentDetectUnmanagedParams: () => isCopilotContentDetectUnmanagedParams,
75
- isCopilotContentDetectUnmanagedResult: () => isCopilotContentDetectUnmanagedResult,
76
- isCopilotContentIntegrationStatusResult: () => isCopilotContentIntegrationStatusResult,
77
- isCopilotContentMigrateLegacyResult: () => isCopilotContentMigrateLegacyResult,
78
- isCopilotContentRestoreResult: () => isCopilotContentRestoreResult,
79
- isCopilotContentStatusResult: () => isCopilotContentStatusResult,
80
- isCopilotCustomizationViewPayload: () => isCopilotCustomizationViewPayload,
81
- isCopilotCustomizationsListParams: () => isCopilotCustomizationsListParams,
82
- isCopilotCustomizationsListResult: () => isCopilotCustomizationsListResult,
83
- isCopilotLegacyMigrateParams: () => isCopilotLegacyMigrateParams,
84
- isCopilotLegacyMigrateResult: () => isCopilotLegacyMigrateResult,
85
- isCopilotLegacyPreviewParams: () => isCopilotLegacyPreviewParams,
86
- isCopilotLegacyPreviewResult: () => isCopilotLegacyPreviewResult,
87
- isCopilotPackageInstallParams: () => isCopilotPackageInstallParams,
88
- isCopilotPackageInstallResult: () => isCopilotPackageInstallResult,
89
- isCopilotPackageMoveParams: () => isCopilotPackageMoveParams,
90
- isCopilotPackageMoveResult: () => isCopilotPackageMoveResult,
91
- isCopilotPackageUninstallParams: () => isCopilotPackageUninstallParams,
92
- isCopilotPackageUninstallResult: () => isCopilotPackageUninstallResult,
93
- isCopilotPackageUpdateParams: () => isCopilotPackageUpdateParams,
94
- isCopilotPackageUpdateResult: () => isCopilotPackageUpdateResult,
95
- isCopilotPluginListParams: () => isCopilotPluginListParams,
96
- isCopilotPluginListResult: () => isCopilotPluginListResult,
97
- isCopilotPluginRegisterParams: () => isCopilotPluginRegisterParams,
98
- isCopilotPluginRegisterResult: () => isCopilotPluginRegisterResult,
99
- isCopilotPluginUnregisterParams: () => isCopilotPluginUnregisterParams,
100
- isCopilotPluginUnregisterResult: () => isCopilotPluginUnregisterResult,
101
- isCopilotSourceListParams: () => isCopilotSourceListParams,
102
- isCopilotSourceListResult: () => isCopilotSourceListResult,
103
- isCopilotSourceRemoveParams: () => isCopilotSourceRemoveParams,
104
- isCopilotSourceRemoveResult: () => isCopilotSourceRemoveResult,
105
- isCopilotUpdatePreviewParams: () => isCopilotUpdatePreviewParams,
106
- isCopilotUpdatePreviewResult: () => isCopilotUpdatePreviewResult,
107
- isDeviceBindingState: () => isDeviceBindingState,
108
- isDeviceEnrollParams: () => isDeviceEnrollParams,
109
- isDeviceEnrollResult: () => isDeviceEnrollResult,
110
- isDeviceIdentityState: () => isDeviceIdentityState,
111
- isDeviceMetadata: () => isDeviceMetadata,
112
- isDeviceRotateSecretParams: () => isDeviceRotateSecretParams,
113
- isDeviceRotateSecretResult: () => isDeviceRotateSecretResult,
114
- isDeviceStatus: () => isDeviceStatus,
115
- isEnvironmentCheckResult: () => isEnvironmentCheckResult,
116
- isExternalTool: () => isExternalTool,
117
- isExternalToolPatch: () => isExternalToolPatch,
118
- isJsonOutputResult: () => isJsonOutputResult,
119
- isJsonSortAlgorithm: () => isJsonSortAlgorithm,
120
- isJsonSortOptions: () => isJsonSortOptions,
121
- isJsonSortOrder: () => isJsonSortOrder,
122
- isJsonValidationResult: () => isJsonValidationResult,
123
- isKnownEnvironmentTool: () => isKnownEnvironmentTool,
124
- isRecord: () => isRecord4,
125
- isRepoAddParams: () => isRepoAddParams,
126
- isRepoAddResult: () => isRepoAddResult,
127
- isRepoDisableParams: () => isRepoDisableParams,
128
- isRepoDisableResult: () => isRepoDisableResult,
129
- isRepoEnableParams: () => isRepoEnableParams,
130
- isRepoEnableResult: () => isRepoEnableResult,
131
- isRepoListParams: () => isRepoListParams,
132
- isRepoListResult: () => isRepoListResult,
133
- isRepoRemoveParams: () => isRepoRemoveParams,
134
- isRepoRemoveResult: () => isRepoRemoveResult,
135
- isRepoSyncAllParams: () => isRepoSyncAllParams,
136
- isRepoSyncAllResult: () => isRepoSyncAllResult,
137
- isRepoSyncParams: () => isRepoSyncParams,
138
- isRepoSyncResult: () => isRepoSyncResult,
139
- isRepoUpdateResult: () => isRepoUpdateResult,
140
- isRetryableErrorCode: () => isRetryableErrorCode,
141
- isScheduledTask: () => isScheduledTask,
142
- isScheduledTaskType: () => isScheduledTaskType,
143
- isScheduledTaskV1: () => isScheduledTaskV1,
144
- isScheduledTasksConfig: () => isScheduledTasksConfig,
145
- isScheduledTasksConfigV1: () => isScheduledTasksConfigV1,
146
- isSchedulerStatus: () => isSchedulerStatus,
147
- isServiceMeImageCompressOptions: () => isServiceMeImageCompressOptions,
148
- isServiceMeImageCompressResult: () => isServiceMeImageCompressResult,
149
- isServiceMeImageFormat: () => isServiceMeImageFormat,
150
- isServiceMeImageInfo: () => isServiceMeImageInfo,
151
- isServiceMeImageValidationResult: () => isServiceMeImageValidationResult,
152
- isServiceMeProjectExtractTemplateInput: () => isServiceMeProjectExtractTemplateInput,
153
- isServiceMeProjectExtractTemplateResult: () => isServiceMeProjectExtractTemplateResult,
154
- isServiceMeProjectGitInitResult: () => isServiceMeProjectGitInitResult,
155
- isServiceMeProjectInstallDepsResult: () => isServiceMeProjectInstallDepsResult,
156
- isServiceMeProjectMakeScriptsExecutableResult: () => isServiceMeProjectMakeScriptsExecutableResult,
157
- isServiceMeProjectScaffoldPruneResult: () => isServiceMeProjectScaffoldPruneResult,
158
- isServicemeErrorCode: () => isServicemeErrorCode,
159
- isServicemeErrorDetails: () => isServicemeErrorDetails,
160
- isSkillMarketplaceState: () => isSkillMarketplaceState,
161
- isSkillMutationRequest: () => isSkillMutationRequest,
162
- isSkillMutationResult: () => isSkillMutationResult,
163
- isSkillPublishableResult: () => isSkillPublishableResult,
164
- isSkillReconcileResult: () => isSkillReconcileResult,
165
- isSkillRepoConvertToSymlinkParams: () => isSkillRepoConvertToSymlinkParams,
166
- isSkillRepoConvertToSymlinkResult: () => isSkillRepoConvertToSymlinkResult,
167
- isSkillRepoDraftCommitResult: () => isSkillRepoDraftCommitResult,
168
- isSkillRepoDraftCreateResult: () => isSkillRepoDraftCreateResult,
169
- isSkillRepoDraftDeleteResult: () => isSkillRepoDraftDeleteResult,
170
- isSkillRepoDraftListResult: () => isSkillRepoDraftListResult,
171
- isSkillRepoGetParams: () => isSkillRepoGetParams,
172
- isSkillRepoGetResult: () => isSkillRepoGetResult,
173
- isSkillRepoInstallParams: () => isSkillRepoInstallParams,
174
- isSkillRepoInstallResult: () => isSkillRepoInstallResult,
175
- isSkillRepoListLinkedParams: () => isSkillRepoListLinkedParams,
176
- isSkillRepoListLinkedResult: () => isSkillRepoListLinkedResult,
177
- isSkillRepoListParams: () => isSkillRepoListParams,
178
- isSkillRepoListResult: () => isSkillRepoListResult,
179
- isSkillRepoSetEntryEnabledParams: () => isSkillRepoSetEntryEnabledParams,
180
- isSkillRepoSetEntryEnabledResult: () => isSkillRepoSetEntryEnabledResult,
181
- isSkillRepoUninstallParams: () => isSkillRepoUninstallParams,
182
- isSkillRepoUninstallResult: () => isSkillRepoUninstallResult,
183
- isSystemHelloResult: () => isSystemHelloResult,
184
- isSystemPingResult: () => isSystemPingResult,
185
- isSystemShutdownResult: () => isSystemShutdownResult,
186
- isTaskCancelResult: () => isTaskCancelResult,
187
- isTaskCancelledEventParams: () => isTaskCancelledEventParams,
188
- isTaskCompletedEventParams: () => isTaskCompletedEventParams,
189
- isTaskExecuteResult: () => isTaskExecuteResult,
190
- isTaskExecutionLog: () => isTaskExecutionLog,
191
- isTaskFailedEventParams: () => isTaskFailedEventParams,
192
- isTaskListRunningResult: () => isTaskListRunningResult,
193
- isTaskOutputEventParams: () => isTaskOutputEventParams,
194
- isTaskStartedEventParams: () => isTaskStartedEventParams,
195
- isTaskWorkspaceRef: () => isTaskWorkspaceRef,
196
- isToolCheckResult: () => isToolCheckResult,
197
- isToolboxAddParams: () => isToolboxAddParams,
198
- isToolboxAddResult: () => isToolboxAddResult,
199
- isToolboxList: () => isToolboxList,
200
- isToolboxListParams: () => isToolboxListParams,
201
- isToolboxRemoveParams: () => isToolboxRemoveParams,
202
- isToolboxRemoveResult: () => isToolboxRemoveResult,
203
- isToolboxScope: () => isToolboxScope,
204
- isToolboxUpdateParams: () => isToolboxUpdateParams,
205
- isToolboxUpdateResult: () => isToolboxUpdateResult,
206
- migrateTaskV1ToV2: () => migrateTaskV1ToV2,
207
- migrateV1ToV2: () => migrateV1ToV2,
208
- normalizeBridgeMethod: () => normalizeBridgeMethod,
209
- normalizeServicemeError: () => normalizeServicemeError
210
- });
211
- module.exports = __toCommonJS(index_exports);
212
-
213
- // src/agent.ts
214
- var VALID_AGENT_SCOPES = ["workspace", "user"];
215
- var VALID_AGENT_SCOPE_STATUSES = [
216
- "absent",
217
- "available",
218
- "installed",
219
- "blocked",
220
- "conflict"
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/agent.ts
3
+ const VALID_AGENT_SCOPES = ["workspace", "user"];
4
+ const VALID_AGENT_SCOPE_STATUSES = [
5
+ "absent",
6
+ "available",
7
+ "installed",
8
+ "blocked",
9
+ "conflict"
221
10
  ];
222
- var VALID_AGENT_MUTATION_ACTIONS = [
223
- "install",
224
- "uninstall",
225
- "move",
226
- "removeExternal",
227
- "publish",
228
- "republish",
229
- "submit-to-official"
11
+ const VALID_AGENT_MUTATION_ACTIONS = [
12
+ "install",
13
+ "uninstall",
14
+ "move",
15
+ "removeExternal",
16
+ "publish",
17
+ "republish",
18
+ "submit-to-official"
230
19
  ];
231
- var VALID_AGENT_TOOL_RISK_LEVELS = ["high", "medium", "low"];
232
- function isRecord(value) {
233
- return typeof value === "object" && value !== null;
20
+ const VALID_AGENT_TOOL_RISK_LEVELS = [
21
+ "high",
22
+ "medium",
23
+ "low"
24
+ ];
25
+ function isRecord$14(value) {
26
+ return typeof value === "object" && value !== null;
234
27
  }
235
- function isStringArray(value) {
236
- return Array.isArray(value) && value.every((item) => typeof item === "string");
28
+ function isStringArray$2(value) {
29
+ return Array.isArray(value) && value.every((item) => typeof item === "string");
237
30
  }
238
31
  function isAgentScope(value) {
239
- return typeof value === "string" && VALID_AGENT_SCOPES.includes(value);
32
+ return typeof value === "string" && VALID_AGENT_SCOPES.includes(value);
240
33
  }
241
34
  function isAgentScopeStatus(value) {
242
- return typeof value === "string" && VALID_AGENT_SCOPE_STATUSES.includes(value);
35
+ return typeof value === "string" && VALID_AGENT_SCOPE_STATUSES.includes(value);
243
36
  }
244
37
  function isAgentMutationAction(value) {
245
- return typeof value === "string" && VALID_AGENT_MUTATION_ACTIONS.includes(value);
38
+ return typeof value === "string" && VALID_AGENT_MUTATION_ACTIONS.includes(value);
246
39
  }
247
- function isSafeResourceId(value) {
248
- if (typeof value !== "string" || value.length === 0 || value.includes("\\")) {
249
- return false;
250
- }
251
- const segments = value.split("/");
252
- if (segments.some((segment) => segment.length === 0)) {
253
- return false;
254
- }
255
- return segments.every(
256
- (segment) => segment !== "." && segment !== ".." && /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(segment)
257
- );
40
+ function isSafeResourceId$1(value) {
41
+ if (typeof value !== "string" || value.length === 0 || value.includes("\\")) return false;
42
+ const segments = value.split("/");
43
+ if (segments.some((segment) => segment.length === 0)) return false;
44
+ return segments.every((segment) => segment !== "." && segment !== ".." && /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(segment));
258
45
  }
259
46
  function isAgentScopeState(value) {
260
- if (!isRecord(value)) {
261
- return false;
262
- }
263
- return isAgentScope(value.scope) && isAgentScopeStatus(value.status) && (value.kind === void 0 || value.kind === "builtin" || value.kind === "external") && (value.path === void 0 || typeof value.path === "string") && typeof value.isInstalled === "boolean" && typeof value.canInstall === "boolean" && typeof value.canUninstall === "boolean" && typeof value.canRemove === "boolean" && typeof value.canMoveHere === "boolean" && (value.summary === void 0 || typeof value.summary === "string");
47
+ if (!isRecord$14(value)) return false;
48
+ return isAgentScope(value.scope) && isAgentScopeStatus(value.status) && (value.kind === void 0 || value.kind === "builtin" || value.kind === "external") && (value.path === void 0 || typeof value.path === "string") && typeof value.isInstalled === "boolean" && typeof value.canInstall === "boolean" && typeof value.canUninstall === "boolean" && typeof value.canRemove === "boolean" && typeof value.canMoveHere === "boolean" && (value.summary === void 0 || typeof value.summary === "string");
264
49
  }
265
50
  function isAgentMarketplaceEntry(value) {
266
- if (!isRecord(value)) {
267
- return false;
268
- }
269
- return typeof value.id === "string" && typeof value.displayName === "string" && typeof value.description === "string" && typeof value.version === "string" && typeof value.updatedAt === "string" && (value.categoryId === void 0 || typeof value.categoryId === "string") && typeof value.isCatalogAgent === "boolean" && typeof value.recommended === "boolean" && typeof value.installCount === "number" && (value.ownerScope === void 0 || isAgentScope(value.ownerScope)) && (value.ownerKind === void 0 || value.ownerKind === "builtin" || value.ownerKind === "external") && typeof value.hasConflict === "boolean" && isStringArray(value.tools) && (value.source === void 0 || value.source === "official" || value.source === "community" || value.source === "local") && (value.localAgentPath === void 0 || typeof value.localAgentPath === "string") && (value.canPublish === void 0 || typeof value.canPublish === "boolean") && isAgentScopeState(value.workspaceState) && isAgentScopeState(value.userState);
51
+ if (!isRecord$14(value)) return false;
52
+ return typeof value.id === "string" && typeof value.displayName === "string" && typeof value.description === "string" && typeof value.version === "string" && typeof value.updatedAt === "string" && (value.categoryId === void 0 || typeof value.categoryId === "string") && typeof value.isCatalogAgent === "boolean" && typeof value.recommended === "boolean" && typeof value.installCount === "number" && (value.ownerScope === void 0 || isAgentScope(value.ownerScope)) && (value.ownerKind === void 0 || value.ownerKind === "builtin" || value.ownerKind === "external") && typeof value.hasConflict === "boolean" && isStringArray$2(value.tools) && (value.source === void 0 || value.source === "official" || value.source === "community" || value.source === "local") && (value.localAgentPath === void 0 || typeof value.localAgentPath === "string") && (value.canPublish === void 0 || typeof value.canPublish === "boolean") && isAgentScopeState(value.workspaceState) && isAgentScopeState(value.userState);
270
53
  }
271
54
  function isAgentMarketplaceState(value) {
272
- if (!isRecord(value)) {
273
- return false;
274
- }
275
- return typeof value.configPath === "string" && typeof value.userAgentsPath === "string" && Array.isArray(value.agents) && value.agents.every((entry) => isAgentMarketplaceEntry(entry)) && (value.installedAgentIds === void 0 || isStringArray(value.installedAgentIds)) && (value.workspaceOpen === void 0 || typeof value.workspaceOpen === "boolean");
55
+ if (!isRecord$14(value)) return false;
56
+ return typeof value.configPath === "string" && typeof value.userAgentsPath === "string" && Array.isArray(value.agents) && value.agents.every((entry) => isAgentMarketplaceEntry(entry)) && (value.installedAgentIds === void 0 || isStringArray$2(value.installedAgentIds)) && (value.workspaceOpen === void 0 || typeof value.workspaceOpen === "boolean");
276
57
  }
277
58
  function isAgentMutationRequest(value) {
278
- return isRecord(value) && isSafeResourceId(value.agentId) && isAgentScope(value.targetScope) && isAgentMutationAction(value.action) && (value.confirmed === void 0 || typeof value.confirmed === "boolean");
59
+ return isRecord$14(value) && isSafeResourceId$1(value.agentId) && isAgentScope(value.targetScope) && isAgentMutationAction(value.action) && (value.confirmed === void 0 || typeof value.confirmed === "boolean");
279
60
  }
280
61
  function isAgentMutationResult(value) {
281
- return isRecord(value) && isAgentMarketplaceState(value.state) && typeof value.agentId === "string" && isAgentScope(value.targetScope) && isAgentMutationAction(value.action) && typeof value.changed === "boolean" && (value.status === "success" || value.status === "blocked" || value.status === "requires_confirmation") && (value.message === void 0 || typeof value.message === "string") && (value.tools === void 0 || isStringArray(value.tools)) && (value.prUrl === void 0 || typeof value.prUrl === "string") && (value.fromVersion === void 0 || typeof value.fromVersion === "string") && (value.toVersion === void 0 || typeof value.toVersion === "string");
62
+ return isRecord$14(value) && isAgentMarketplaceState(value.state) && typeof value.agentId === "string" && isAgentScope(value.targetScope) && isAgentMutationAction(value.action) && typeof value.changed === "boolean" && (value.status === "success" || value.status === "blocked" || value.status === "requires_confirmation") && (value.message === void 0 || typeof value.message === "string") && (value.tools === void 0 || isStringArray$2(value.tools)) && (value.prUrl === void 0 || typeof value.prUrl === "string") && (value.fromVersion === void 0 || typeof value.fromVersion === "string") && (value.toVersion === void 0 || typeof value.toVersion === "string");
282
63
  }
283
64
  function isAgentToolPermission(value) {
284
- return isRecord(value) && typeof value.tool === "string" && typeof value.riskLevel === "string" && VALID_AGENT_TOOL_RISK_LEVELS.includes(value.riskLevel);
65
+ return isRecord$14(value) && typeof value.tool === "string" && typeof value.riskLevel === "string" && VALID_AGENT_TOOL_RISK_LEVELS.includes(value.riskLevel);
285
66
  }
286
67
  function isAgentPermissionSummary(value) {
287
- return isRecord(value) && typeof value.agentId === "string" && typeof value.agentName === "string" && Array.isArray(value.tools) && value.tools.every((tool) => isAgentToolPermission(tool)) && typeof value.highRiskCount === "number" && typeof value.mediumRiskCount === "number" && typeof value.lowRiskCount === "number";
68
+ return isRecord$14(value) && typeof value.agentId === "string" && typeof value.agentName === "string" && Array.isArray(value.tools) && value.tools.every((tool) => isAgentToolPermission(tool)) && typeof value.highRiskCount === "number" && typeof value.mediumRiskCount === "number" && typeof value.lowRiskCount === "number";
288
69
  }
289
70
  function isAgentPermissionsResult(value) {
290
- return isRecord(value) && typeof value.agentId === "string" && isAgentPermissionSummary(value.summary);
71
+ return isRecord$14(value) && typeof value.agentId === "string" && isAgentPermissionSummary(value.summary);
291
72
  }
292
-
293
- // src/auth.ts
294
- var AUTH_PROVIDERS = ["github", "microsoft"];
295
- function isRecord2(value) {
296
- return typeof value === "object" && value !== null;
73
+ //#endregion
74
+ //#region src/auth.ts
75
+ const AUTH_PROVIDERS = ["github", "microsoft"];
76
+ function isRecord$13(value) {
77
+ return typeof value === "object" && value !== null;
297
78
  }
298
79
  function isAuthProvider(value) {
299
- return value === "github" || value === "microsoft";
80
+ return value === "github" || value === "microsoft";
300
81
  }
301
- function isStringOrUndefined(value) {
302
- return value === void 0 || typeof value === "string";
82
+ function isStringOrUndefined$3(value) {
83
+ return value === void 0 || typeof value === "string";
303
84
  }
304
85
  function isNumberOrUndefined(value) {
305
- return value === void 0 || value === null || typeof value === "number" && Number.isFinite(value);
86
+ return value === void 0 || value === null || typeof value === "number" && Number.isFinite(value);
306
87
  }
307
88
  function isAuthAccountMeta(value) {
308
- if (!isRecord2(value)) return false;
309
- if (typeof value.id !== "string") return false;
310
- if (!isAuthProvider(value.provider)) return false;
311
- if (value.id.length === 0) return false;
312
- if (!isStringOrUndefined(value.displayName)) return false;
313
- if (!isStringOrUndefined(value.login)) return false;
314
- if (!isStringOrUndefined(value.email)) return false;
315
- if (!isStringOrUndefined(value.avatarUrl)) return false;
316
- if (!isNumberOrUndefined(value.expiresAt)) return false;
317
- return true;
89
+ if (!isRecord$13(value)) return false;
90
+ if (typeof value.id !== "string") return false;
91
+ if (!isAuthProvider(value.provider)) return false;
92
+ if (value.id.length === 0) return false;
93
+ if (!isStringOrUndefined$3(value.displayName)) return false;
94
+ if (!isStringOrUndefined$3(value.login)) return false;
95
+ if (!isStringOrUndefined$3(value.email)) return false;
96
+ if (!isStringOrUndefined$3(value.avatarUrl)) return false;
97
+ if (!isNumberOrUndefined(value.expiresAt)) return false;
98
+ return true;
318
99
  }
319
100
  function isAuthLoginResult(value) {
320
- if (!isRecord2(value)) return false;
321
- if (!isAuthProvider(value.provider)) return false;
322
- if (value.deviceCode !== void 0 && typeof value.deviceCode !== "string") {
323
- return false;
324
- }
325
- if (value.userCode !== void 0 && typeof value.userCode !== "string") {
326
- return false;
327
- }
328
- if (value.verificationUrl !== void 0 && typeof value.verificationUrl !== "string") {
329
- return false;
330
- }
331
- if (value.expiresAt !== void 0 && (typeof value.expiresAt !== "number" || !Number.isFinite(value.expiresAt))) {
332
- return false;
333
- }
334
- if (value.pollIntervalMs !== void 0 && (typeof value.pollIntervalMs !== "number" || !Number.isFinite(value.pollIntervalMs))) {
335
- return false;
336
- }
337
- if (!isStringOrUndefined(value.message)) return false;
338
- return true;
101
+ if (!isRecord$13(value)) return false;
102
+ if (!isAuthProvider(value.provider)) return false;
103
+ if (value.deviceCode !== void 0 && typeof value.deviceCode !== "string") return false;
104
+ if (value.userCode !== void 0 && typeof value.userCode !== "string") return false;
105
+ if (value.verificationUrl !== void 0 && typeof value.verificationUrl !== "string") return false;
106
+ if (value.expiresAt !== void 0 && (typeof value.expiresAt !== "number" || !Number.isFinite(value.expiresAt))) return false;
107
+ if (value.pollIntervalMs !== void 0 && (typeof value.pollIntervalMs !== "number" || !Number.isFinite(value.pollIntervalMs))) return false;
108
+ if (!isStringOrUndefined$3(value.message)) return false;
109
+ return true;
339
110
  }
340
111
  function isAuthSessionHandle(value) {
341
- if (!isRecord2(value)) return false;
342
- if (!isAuthProvider(value.provider)) return false;
343
- if (value.account !== void 0 && value.account !== null && !isAuthAccountMeta(value.account)) {
344
- return false;
345
- }
346
- if (!isNumberOrUndefined(value.expiresAt)) return false;
347
- return true;
112
+ if (!isRecord$13(value)) return false;
113
+ if (!isAuthProvider(value.provider)) return false;
114
+ if (value.account !== void 0 && value.account !== null && !isAuthAccountMeta(value.account)) return false;
115
+ if (!isNumberOrUndefined(value.expiresAt)) return false;
116
+ return true;
348
117
  }
349
118
  function isAuthStatus(value) {
350
- if (!isRecord2(value)) return false;
351
- if (value.activeProvider !== null && !isAuthProvider(value.activeProvider)) {
352
- return false;
353
- }
354
- if (!isRecord2(value.accounts)) return false;
355
- for (const [provider, account] of Object.entries(value.accounts)) {
356
- if (!isAuthProvider(provider)) return false;
357
- if (account !== void 0 && account !== null && !isAuthAccountMeta(account)) {
358
- return false;
359
- }
360
- }
361
- if (typeof value.hasAnySession !== "boolean") return false;
362
- if (!isStringOrUndefined(value.lastError)) return false;
363
- return true;
119
+ if (!isRecord$13(value)) return false;
120
+ if (value.activeProvider !== null && !isAuthProvider(value.activeProvider)) return false;
121
+ if (!isRecord$13(value.accounts)) return false;
122
+ for (const [provider, account] of Object.entries(value.accounts)) {
123
+ if (!isAuthProvider(provider)) return false;
124
+ if (account !== void 0 && account !== null && !isAuthAccountMeta(account)) return false;
125
+ }
126
+ if (typeof value.hasAnySession !== "boolean") return false;
127
+ if (!isStringOrUndefined$3(value.lastError)) return false;
128
+ return true;
364
129
  }
365
130
  function isAuthLoginParams(value) {
366
- return isRecord2(value) && isAuthProvider(value.provider) && (value.force === void 0 || typeof value.force === "boolean");
131
+ return isRecord$13(value) && isAuthProvider(value.provider) && (value.force === void 0 || typeof value.force === "boolean");
367
132
  }
368
133
  function isAuthLogoutParams(value) {
369
- return isRecord2(value) && (value.provider === void 0 || isAuthProvider(value.provider));
134
+ return isRecord$13(value) && (value.provider === void 0 || isAuthProvider(value.provider));
370
135
  }
371
136
  function isAuthLogoutResult(value) {
372
- if (!isRecord2(value)) return false;
373
- if (value.provider !== null && !isAuthProvider(value.provider)) return false;
374
- if (typeof value.success !== "boolean") return false;
375
- return true;
137
+ if (!isRecord$13(value)) return false;
138
+ if (value.provider !== null && !isAuthProvider(value.provider)) return false;
139
+ if (typeof value.success !== "boolean") return false;
140
+ return true;
376
141
  }
377
142
  function isAuthWhoamiResult(value) {
378
- if (!isRecord2(value)) return false;
379
- if (value.provider !== null && !isAuthProvider(value.provider)) return false;
380
- if (!isStringOrUndefined(value.login)) return false;
381
- if (!isStringOrUndefined(value.name)) return false;
382
- if (!isStringOrUndefined(value.avatarUrl)) return false;
383
- if (!isStringOrUndefined(value.email)) return false;
384
- return true;
143
+ if (!isRecord$13(value)) return false;
144
+ if (value.provider !== null && !isAuthProvider(value.provider)) return false;
145
+ if (!isStringOrUndefined$3(value.login)) return false;
146
+ if (!isStringOrUndefined$3(value.name)) return false;
147
+ if (!isStringOrUndefined$3(value.avatarUrl)) return false;
148
+ if (!isStringOrUndefined$3(value.email)) return false;
149
+ return true;
385
150
  }
386
151
  function isAuthSwitchParams(value) {
387
- return isRecord2(value) && isAuthProvider(value.provider);
152
+ return isRecord$13(value) && isAuthProvider(value.provider);
388
153
  }
389
154
  function isAuthSwitchResult(value) {
390
- if (!isRecord2(value)) return false;
391
- if (value.activeProvider !== null && !isAuthProvider(value.activeProvider)) {
392
- return false;
393
- }
394
- if (value.account !== null && !isAuthAccountMeta(value.account)) return false;
395
- return true;
396
- }
397
-
398
- // src/bridge-copilot-customizations.ts
399
- var PRIVATE_RESULT_KEYS = /* @__PURE__ */ new Set([
400
- "sourcePath",
401
- "configPath",
402
- "token",
403
- "secret",
404
- "approvalPayload"
155
+ if (!isRecord$13(value)) return false;
156
+ if (value.activeProvider !== null && !isAuthProvider(value.activeProvider)) return false;
157
+ if (value.account !== null && !isAuthAccountMeta(value.account)) return false;
158
+ return true;
159
+ }
160
+ //#endregion
161
+ //#region src/bridge-copilot-customizations.ts
162
+ const PRIVATE_RESULT_KEYS = /* @__PURE__ */ new Set([
163
+ "sourcePath",
164
+ "configPath",
165
+ "token",
166
+ "secret",
167
+ "approvalPayload"
168
+ ]);
169
+ const SCOPES$1 = /* @__PURE__ */ new Set(["workspace", "personal"]);
170
+ const KINDS = /* @__PURE__ */ new Set([
171
+ "agent",
172
+ "skill",
173
+ "prompt",
174
+ "instruction",
175
+ "mcp",
176
+ "hook"
177
+ ]);
178
+ const INTENTS = /* @__PURE__ */ new Set([
179
+ "available",
180
+ "selected",
181
+ "moving",
182
+ "removing"
183
+ ]);
184
+ const HEALTH = /* @__PURE__ */ new Set([
185
+ "healthy",
186
+ "missing",
187
+ "drifted",
188
+ "conflict",
189
+ "source-unavailable",
190
+ "unsupported"
191
+ ]);
192
+ const GATES = /* @__PURE__ */ new Set([
193
+ "ready",
194
+ "approval-required",
195
+ "configuration-required"
196
+ ]);
197
+ const STATUSES = /* @__PURE__ */ new Set([
198
+ "healthy",
199
+ "action-required",
200
+ "blocked",
201
+ "not-enabled"
405
202
  ]);
406
- var SCOPES = /* @__PURE__ */ new Set(["workspace", "personal"]);
407
- var KINDS = /* @__PURE__ */ new Set(["agent", "skill", "prompt", "instruction", "mcp", "hook"]);
408
- var INTENTS = /* @__PURE__ */ new Set(["available", "selected", "moving", "removing"]);
409
- var HEALTH = /* @__PURE__ */ new Set([
410
- "healthy",
411
- "missing",
412
- "drifted",
413
- "conflict",
414
- "source-unavailable",
415
- "unsupported"
203
+ const SOURCE_TYPES = /* @__PURE__ */ new Set([
204
+ "marketplace",
205
+ "git",
206
+ "local"
416
207
  ]);
417
- var GATES = /* @__PURE__ */ new Set(["ready", "approval-required", "configuration-required"]);
418
- var STATUSES = /* @__PURE__ */ new Set(["healthy", "action-required", "blocked", "not-enabled"]);
419
- var SOURCE_TYPES = /* @__PURE__ */ new Set(["marketplace", "git", "local"]);
420
- var UPDATE_CAPABILITIES = /* @__PURE__ */ new Set(["pinned", "live", "none"]);
421
- function isRecord3(value) {
422
- return typeof value === "object" && value !== null && !Array.isArray(value);
208
+ const UPDATE_CAPABILITIES = /* @__PURE__ */ new Set([
209
+ "pinned",
210
+ "live",
211
+ "none"
212
+ ]);
213
+ function isRecord$12(value) {
214
+ return typeof value === "object" && value !== null && !Array.isArray(value);
423
215
  }
424
216
  function isString(value) {
425
- return typeof value === "string" && value.length > 0;
217
+ return typeof value === "string" && value.length > 0;
426
218
  }
427
219
  function isOptionalString(value) {
428
- return value === void 0 || typeof value === "string";
220
+ return value === void 0 || typeof value === "string";
429
221
  }
430
- function isStringArray2(value, allowEmpty = true) {
431
- return Array.isArray(value) && (allowEmpty || value.length > 0) && value.every((entry) => isString(entry));
222
+ function isStringArray$1(value, allowEmpty = true) {
223
+ return Array.isArray(value) && (allowEmpty || value.length > 0) && value.every((entry) => isString(entry));
432
224
  }
433
225
  function hasPrivateResultKey(value) {
434
- if (Array.isArray(value)) return value.some(hasPrivateResultKey);
435
- if (!isRecord3(value)) return false;
436
- return Object.entries(value).some(
437
- ([key, nested]) => PRIVATE_RESULT_KEYS.has(key) || hasPrivateResultKey(nested)
438
- );
226
+ if (Array.isArray(value)) return value.some(hasPrivateResultKey);
227
+ if (!isRecord$12(value)) return false;
228
+ return Object.entries(value).some(([key, nested]) => PRIVATE_RESULT_KEYS.has(key) || hasPrivateResultKey(nested));
439
229
  }
440
230
  function isScope(value) {
441
- return typeof value === "string" && SCOPES.has(value);
231
+ return typeof value === "string" && SCOPES$1.has(value);
442
232
  }
443
233
  function hasOptionalWorkspaceDir(value) {
444
- return value.workspaceDir === void 0 || isString(value.workspaceDir);
234
+ return value.workspaceDir === void 0 || isString(value.workspaceDir);
445
235
  }
446
236
  function hasRequiredWorkspaceDirForWorkspaceScope(value) {
447
- return value.scope !== "workspace" || isString(value.workspaceDir);
237
+ return value.scope !== "workspace" || isString(value.workspaceDir);
448
238
  }
449
239
  function isArtifactState(value) {
450
- return isRecord3(value) && typeof value.intent === "string" && INTENTS.has(value.intent) && typeof value.health === "string" && HEALTH.has(value.health) && typeof value.gate === "string" && GATES.has(value.gate);
240
+ return isRecord$12(value) && typeof value.intent === "string" && INTENTS.has(value.intent) && typeof value.health === "string" && HEALTH.has(value.health) && typeof value.gate === "string" && GATES.has(value.gate);
451
241
  }
452
242
  function isArtifactSummary(value) {
453
- return isRecord3(value) && isString(value.id) && isString(value.packageId) && typeof value.kind === "string" && KINDS.has(value.kind) && isString(value.displayName) && isOptionalString(value.description) && (value.installStrategy === "link" || value.installStrategy === "generated-config" || value.installStrategy === "approval-gated") && (value.risk === "none" || value.risk === "review-required");
243
+ return isRecord$12(value) && isString(value.id) && isString(value.packageId) && typeof value.kind === "string" && KINDS.has(value.kind) && isString(value.displayName) && isOptionalString(value.description) && (value.installStrategy === "link" || value.installStrategy === "generated-config" || value.installStrategy === "approval-gated") && (value.risk === "none" || value.risk === "review-required");
454
244
  }
455
245
  function isInstallation(value) {
456
- return isRecord3(value) && isString(value.packageId) && isScope(value.scope) && isStringArray2(value.selectedArtifactIds) && isOptionalString(value.pinnedVersion);
246
+ return isRecord$12(value) && isString(value.packageId) && isScope(value.scope) && isStringArray$1(value.selectedArtifactIds) && isOptionalString(value.pinnedVersion);
457
247
  }
458
248
  function isDefinition(value) {
459
- return isRecord3(value) && isString(value.id) && isString(value.sourceId) && isString(value.displayName) && isOptionalString(value.description) && isOptionalString(value.version) && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactSummary);
249
+ return isRecord$12(value) && isString(value.id) && isString(value.sourceId) && isString(value.displayName) && isOptionalString(value.description) && isOptionalString(value.version) && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactSummary);
460
250
  }
461
251
  function isArtifactView(value) {
462
- return isRecord3(value) && isArtifactSummary(value.artifact) && isArtifactState(value.state);
252
+ return isRecord$12(value) && isArtifactSummary(value.artifact) && isArtifactState(value.state);
463
253
  }
464
254
  function isPackageView(value) {
465
- return isRecord3(value) && isDefinition(value.definition) && isInstallation(value.installation) && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactView) && Number.isInteger(value.selectedArtifactCount) && value.selectedArtifactCount >= 0 && typeof value.status === "string" && STATUSES.has(value.status);
255
+ return isRecord$12(value) && isDefinition(value.definition) && isInstallation(value.installation) && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactView) && Number.isInteger(value.selectedArtifactCount) && value.selectedArtifactCount >= 0 && typeof value.status === "string" && STATUSES.has(value.status);
466
256
  }
467
257
  function isSourceView(value) {
468
- return isRecord3(value) && isString(value.id) && (value.type === "marketplace" || value.type === "git" || value.type === "local") && isString(value.displayName) && (value.updateCapability === "pinned" || value.updateCapability === "live" || value.updateCapability === "none") && Array.isArray(value.packages) && value.packages.every(isPackageView);
258
+ return isRecord$12(value) && isString(value.id) && (value.type === "marketplace" || value.type === "git" || value.type === "local") && isString(value.displayName) && (value.updateCapability === "pinned" || value.updateCapability === "live" || value.updateCapability === "none") && Array.isArray(value.packages) && value.packages.every(isPackageView);
469
259
  }
470
260
  function isSourceRecord(value) {
471
- return isRecord3(value) && isString(value.id) && typeof value.type === "string" && SOURCE_TYPES.has(value.type) && isString(value.displayName) && typeof value.updateCapability === "string" && UPDATE_CAPABILITIES.has(value.updateCapability) && typeof value.available === "boolean" && Array.isArray(value.declaredIn) && value.declaredIn.every((entry) => entry === "workspace" || entry === "personal");
261
+ return isRecord$12(value) && isString(value.id) && typeof value.type === "string" && SOURCE_TYPES.has(value.type) && isString(value.displayName) && typeof value.updateCapability === "string" && UPDATE_CAPABILITIES.has(value.updateCapability) && typeof value.available === "boolean" && Array.isArray(value.declaredIn) && value.declaredIn.every((entry) => entry === "workspace" || entry === "personal");
472
262
  }
473
263
  function isUpdatePreview(value) {
474
- return isRecord3(value) && isString(value.packageId) && isOptionalString(value.fromVersion) && isString(value.toVersion) && isStringArray2(value.addedArtifactIds) && isStringArray2(value.removedArtifactIds) && isStringArray2(value.changedArtifactIds) && isStringArray2(value.approvalInvalidatedArtifactIds);
264
+ return isRecord$12(value) && isString(value.packageId) && isOptionalString(value.fromVersion) && isString(value.toVersion) && isStringArray$1(value.addedArtifactIds) && isStringArray$1(value.removedArtifactIds) && isStringArray$1(value.changedArtifactIds) && isStringArray$1(value.approvalInvalidatedArtifactIds);
475
265
  }
476
266
  function isCopilotCustomizationViewPayload(value) {
477
- if (!isRecord3(value) || hasPrivateResultKey(value)) return false;
478
- const summary = value.summary;
479
- return isScope(value.scope) && isString(value.generatedAt) && Array.isArray(value.sources) && value.sources.every(isSourceView) && Array.isArray(value.packages) && value.packages.every(isPackageView) && Array.isArray(value.attention) && value.attention.every(isArtifactView) && isRecord3(summary) && Number.isInteger(summary.packageCount) && summary.packageCount >= 0 && Number.isInteger(summary.enabledArtifactCount) && summary.enabledArtifactCount >= 0 && Number.isInteger(summary.attentionCount) && summary.attentionCount >= 0 && (value.legacyMigration === void 0 || isRecord3(value.legacyMigration) && Number.isInteger(value.legacyMigration.count) && value.legacyMigration.count >= 0 && value.legacyMigration.sourceLabel === "~/.agents");
267
+ if (!isRecord$12(value) || hasPrivateResultKey(value)) return false;
268
+ const summary = value.summary;
269
+ return isScope(value.scope) && isString(value.generatedAt) && Array.isArray(value.sources) && value.sources.every(isSourceView) && Array.isArray(value.packages) && value.packages.every(isPackageView) && Array.isArray(value.attention) && value.attention.every(isArtifactView) && isRecord$12(summary) && Number.isInteger(summary.packageCount) && summary.packageCount >= 0 && Number.isInteger(summary.enabledArtifactCount) && summary.enabledArtifactCount >= 0 && Number.isInteger(summary.attentionCount) && summary.attentionCount >= 0 && (value.legacyMigration === void 0 || isRecord$12(value.legacyMigration) && Number.isInteger(value.legacyMigration.count) && value.legacyMigration.count >= 0 && value.legacyMigration.sourceLabel === "~/.agents");
480
270
  }
481
271
  function isCopilotCustomizationsListParams(value) {
482
- return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value);
272
+ return isRecord$12(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value);
483
273
  }
484
274
  function isAvailablePackage(value) {
485
- return isRecord3(value) && isString(value.packageId) && isString(value.sourceId) && isString(value.displayName) && isOptionalString(value.description) && isOptionalString(value.version) && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactSummary) && Array.isArray(value.installedScopes) && value.installedScopes.every(isScope);
275
+ return isRecord$12(value) && isString(value.packageId) && isString(value.sourceId) && isString(value.displayName) && isOptionalString(value.description) && isOptionalString(value.version) && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactSummary) && Array.isArray(value.installedScopes) && value.installedScopes.every(isScope);
486
276
  }
487
277
  function isCopilotCustomizationsListResult(value) {
488
- if (!isRecord3(value) || hasPrivateResultKey(value) || !isCopilotCustomizationViewPayload(value.view)) {
489
- return false;
490
- }
491
- return value.availablePackages === void 0 || Array.isArray(value.availablePackages) && value.availablePackages.every(isAvailablePackage);
278
+ if (!isRecord$12(value) || hasPrivateResultKey(value) || !isCopilotCustomizationViewPayload(value.view)) return false;
279
+ return value.availablePackages === void 0 || Array.isArray(value.availablePackages) && value.availablePackages.every(isAvailablePackage);
492
280
  }
493
281
  function isCopilotPackageInstallParams(value) {
494
- return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && hasRequiredWorkspaceDirForWorkspaceScope(value) && isString(value.sourceId) && isString(value.packageId) && isStringArray2(value.artifactIds, false) && isOptionalString(value.pinnedVersion) && (value.localMode === void 0 || value.localMode === "live" || value.localMode === "private-workspace-override");
282
+ return isRecord$12(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && hasRequiredWorkspaceDirForWorkspaceScope(value) && isString(value.sourceId) && isString(value.packageId) && isStringArray$1(value.artifactIds, false) && isOptionalString(value.pinnedVersion) && (value.localMode === void 0 || value.localMode === "live" || value.localMode === "private-workspace-override");
495
283
  }
496
284
  function isCopilotPackageUpdateParams(value) {
497
- return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && hasRequiredWorkspaceDirForWorkspaceScope(value) && isString(value.packageId) && isStringArray2(value.artifactIds, false) && isOptionalString(value.pinnedVersion);
285
+ return isRecord$12(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && hasRequiredWorkspaceDirForWorkspaceScope(value) && isString(value.packageId) && isStringArray$1(value.artifactIds, false) && isOptionalString(value.pinnedVersion);
498
286
  }
499
287
  function isCopilotPackageUninstallParams(value) {
500
- return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && hasRequiredWorkspaceDirForWorkspaceScope(value) && isString(value.packageId);
288
+ return isRecord$12(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && hasRequiredWorkspaceDirForWorkspaceScope(value) && isString(value.packageId);
501
289
  }
502
290
  function isCopilotPackageMoveParams(value) {
503
- return isRecord3(value) && hasOptionalWorkspaceDir(value) && isString(value.packageId) && isScope(value.from) && isScope(value.to) && value.from !== value.to && isString(value.workspaceDir);
291
+ return isRecord$12(value) && hasOptionalWorkspaceDir(value) && isString(value.packageId) && isScope(value.from) && isScope(value.to) && value.from !== value.to && isString(value.workspaceDir);
504
292
  }
505
293
  function isCopilotLegacyPreviewParams(value) {
506
- return isRecord3(value) && hasOptionalWorkspaceDir(value);
294
+ return isRecord$12(value) && hasOptionalWorkspaceDir(value);
507
295
  }
508
296
  function isCopilotLegacyMigrateParams(value) {
509
- return isRecord3(value) && hasOptionalWorkspaceDir(value) && isStringArray2(value.artifactIds, false);
297
+ return isRecord$12(value) && hasOptionalWorkspaceDir(value) && isStringArray$1(value.artifactIds, false);
510
298
  }
511
299
  function isCopilotSourceListParams(value) {
512
- return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value);
300
+ return isRecord$12(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value);
513
301
  }
514
302
  function isCopilotSourceListResult(value) {
515
- return isRecord3(value) && !hasPrivateResultKey(value) && Array.isArray(value.sources) && value.sources.every(isSourceRecord);
303
+ return isRecord$12(value) && !hasPrivateResultKey(value) && Array.isArray(value.sources) && value.sources.every(isSourceRecord);
516
304
  }
517
305
  function isCopilotSourceRemoveParams(value) {
518
- return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && isString(value.sourceId);
306
+ return isRecord$12(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && isString(value.sourceId);
519
307
  }
520
308
  function isCopilotSourceRemoveResult(value) {
521
- return isRecord3(value) && !hasPrivateResultKey(value) && value.removed === true;
309
+ return isRecord$12(value) && !hasPrivateResultKey(value) && value.removed === true;
522
310
  }
523
311
  function isCopilotUpdatePreviewParams(value) {
524
- return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && isString(value.packageId) && isString(value.revision);
312
+ return isRecord$12(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && isString(value.packageId) && isString(value.revision);
525
313
  }
526
314
  function isCopilotUpdatePreviewResult(value) {
527
- return isRecord3(value) && !hasPrivateResultKey(value) && isUpdatePreview(value.preview);
315
+ return isRecord$12(value) && !hasPrivateResultKey(value) && isUpdatePreview(value.preview);
528
316
  }
529
317
  function isCopilotLegacyPreviewResult(value) {
530
- return isRecord3(value) && !hasPrivateResultKey(value) && value.sourceLabel === "~/.agents" && Number.isInteger(value.count) && value.count >= 0 && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactSummary);
531
- }
532
- var isCopilotPackageInstallResult = isCopilotCustomizationsListResult;
533
- var isCopilotPackageUpdateResult = isCopilotCustomizationsListResult;
534
- var isCopilotPackageUninstallResult = isCopilotCustomizationsListResult;
535
- var isCopilotPackageMoveResult = isCopilotCustomizationsListResult;
536
- var isCopilotLegacyMigrateResult = isCopilotCustomizationsListResult;
537
-
538
- // src/json.ts
539
- var JSON_SORT_ALGORITHMS = [
540
- "default",
541
- "keyLength",
542
- "alphaNum",
543
- "values",
544
- "type"
318
+ return isRecord$12(value) && !hasPrivateResultKey(value) && value.sourceLabel === "~/.agents" && Number.isInteger(value.count) && value.count >= 0 && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactSummary);
319
+ }
320
+ const isCopilotPackageInstallResult = isCopilotCustomizationsListResult;
321
+ const isCopilotPackageUpdateResult = isCopilotCustomizationsListResult;
322
+ const isCopilotPackageUninstallResult = isCopilotCustomizationsListResult;
323
+ const isCopilotPackageMoveResult = isCopilotCustomizationsListResult;
324
+ const isCopilotLegacyMigrateResult = isCopilotCustomizationsListResult;
325
+ //#endregion
326
+ //#region src/json.ts
327
+ const JSON_SORT_ALGORITHMS = [
328
+ "default",
329
+ "keyLength",
330
+ "alphaNum",
331
+ "values",
332
+ "type"
545
333
  ];
546
- var JSON_SORT_ORDERS = ["asc", "desc"];
547
- var DEFAULT_JSON_SORT_OPTIONS = {
548
- sortOrder: "asc",
549
- sortAlgo: "default"
334
+ const JSON_SORT_ORDERS = ["asc", "desc"];
335
+ const DEFAULT_JSON_SORT_OPTIONS = {
336
+ sortOrder: "asc",
337
+ sortAlgo: "default"
550
338
  };
551
- function isRecord4(value) {
552
- return typeof value === "object" && value !== null;
339
+ function isRecord(value) {
340
+ return typeof value === "object" && value !== null;
553
341
  }
554
342
  function isJsonSortAlgorithm(value) {
555
- return typeof value === "string" && JSON_SORT_ALGORITHMS.includes(value);
343
+ return typeof value === "string" && JSON_SORT_ALGORITHMS.includes(value);
556
344
  }
557
345
  function isJsonSortOrder(value) {
558
- return typeof value === "string" && JSON_SORT_ORDERS.includes(value);
346
+ return typeof value === "string" && JSON_SORT_ORDERS.includes(value);
559
347
  }
560
348
  function isJsonSortOptions(value) {
561
- return isRecord4(value) && isJsonSortOrder(value.sortOrder) && isJsonSortAlgorithm(value.sortAlgo);
349
+ return isRecord(value) && isJsonSortOrder(value.sortOrder) && isJsonSortAlgorithm(value.sortAlgo);
562
350
  }
563
351
  function isJsonValidationResult(value) {
564
- return isRecord4(value) && typeof value.valid === "boolean" && (value.error === void 0 || typeof value.error === "string");
352
+ return isRecord(value) && typeof value.valid === "boolean" && (value.error === void 0 || typeof value.error === "string");
565
353
  }
566
354
  function isJsonOutputResult(value) {
567
- return isRecord4(value) && typeof value.output === "string";
355
+ return isRecord(value) && typeof value.output === "string";
568
356
  }
569
-
570
- // src/bridge-copilot-plugins.ts
571
- var SCOPES2 = /* @__PURE__ */ new Set(["workspace", "personal"]);
357
+ //#endregion
358
+ //#region src/bridge-copilot-plugins.ts
359
+ const SCOPES = /* @__PURE__ */ new Set(["workspace", "personal"]);
572
360
  function isOptionalScope(value) {
573
- return value === void 0 || typeof value === "string" && SCOPES2.has(value);
361
+ return value === void 0 || typeof value === "string" && SCOPES.has(value);
574
362
  }
575
363
  function isScopeArray(value) {
576
- return Array.isArray(value) && value.every((s) => typeof s === "string" && SCOPES2.has(s));
364
+ return Array.isArray(value) && value.every((s) => typeof s === "string" && SCOPES.has(s));
577
365
  }
578
366
  function isRegistration(value) {
579
- return isRecord4(value) && typeof value.registrationId === "string" && typeof value.repoId === "string" && typeof value.pluginId === "string" && (value.displayName === void 0 || typeof value.displayName === "string") && (value.version === void 0 || typeof value.version === "string") && isScopeArray(value.scopes) && (value.enabled === void 0 || typeof value.enabled === "boolean") && Array.isArray(value.mcpServers) && value.mcpServers.every((s) => typeof s === "string") && typeof value.hasExtensions === "boolean";
367
+ return isRecord(value) && typeof value.registrationId === "string" && typeof value.repoId === "string" && typeof value.pluginId === "string" && (value.displayName === void 0 || typeof value.displayName === "string") && (value.version === void 0 || typeof value.version === "string") && isScopeArray(value.scopes) && (value.enabled === void 0 || typeof value.enabled === "boolean") && Array.isArray(value.mcpServers) && value.mcpServers.every((s) => typeof s === "string") && typeof value.hasExtensions === "boolean";
580
368
  }
581
369
  function isCopilotPluginListParams(value) {
582
- return isRecord4(value);
370
+ return isRecord(value);
583
371
  }
584
372
  function isCopilotPluginListResult(value) {
585
- return isRecord4(value) && Array.isArray(value.plugins) && value.plugins.every(isRegistration);
373
+ return isRecord(value) && Array.isArray(value.plugins) && value.plugins.every(isRegistration);
586
374
  }
587
375
  function isCopilotPluginRegisterParams(value) {
588
- return isRecord4(value) && isOptionalScope(value.scope) && (value.workspaceDir === void 0 || typeof value.workspaceDir === "string") && typeof value.repoId === "string" && typeof value.pluginId === "string";
376
+ return isRecord(value) && isOptionalScope(value.scope) && (value.workspaceDir === void 0 || typeof value.workspaceDir === "string") && typeof value.repoId === "string" && typeof value.pluginId === "string";
589
377
  }
590
- var isCopilotPluginRegisterResult = isCopilotPluginListResult;
378
+ const isCopilotPluginRegisterResult = isCopilotPluginListResult;
591
379
  function isCopilotPluginUnregisterParams(value) {
592
- return isRecord4(value) && isOptionalScope(value.scope) && (value.workspaceDir === void 0 || typeof value.workspaceDir === "string") && typeof value.registrationId === "string";
380
+ return isRecord(value) && isOptionalScope(value.scope) && (value.workspaceDir === void 0 || typeof value.workspaceDir === "string") && typeof value.registrationId === "string";
593
381
  }
594
- var isCopilotPluginUnregisterResult = isCopilotPluginListResult;
595
-
596
- // src/bridge-skill-repo.ts
597
- function isRecord5(value) {
598
- return typeof value === "object" && value !== null;
382
+ const isCopilotPluginUnregisterResult = isCopilotPluginListResult;
383
+ //#endregion
384
+ //#region src/bridge-skill-repo.ts
385
+ function isRecord$11(value) {
386
+ return typeof value === "object" && value !== null;
599
387
  }
600
- function isStringOrUndefined2(value) {
601
- return value === void 0 || typeof value === "string";
388
+ function isStringOrUndefined$2(value) {
389
+ return value === void 0 || typeof value === "string";
602
390
  }
603
391
  function isBooleanOrUndefined(value) {
604
- return value === void 0 || typeof value === "boolean";
392
+ return value === void 0 || typeof value === "boolean";
605
393
  }
606
394
  function isSkillKindOrUndefined(value) {
607
- return value === void 0 || value === "skill" || value === "agent";
395
+ return value === void 0 || value === "skill" || value === "agent";
608
396
  }
609
397
  function isLinkScope(value) {
610
- return value === "workspace" || value === "user";
398
+ return value === "workspace" || value === "user";
611
399
  }
612
400
  function isLinkScopeOrUndefined(value) {
613
- return value === void 0 || isLinkScope(value);
401
+ return value === void 0 || isLinkScope(value);
614
402
  }
615
403
  function isLinkScopeFilterOrUndefined(value) {
616
- return value === void 0 || value === "workspace" || value === "user" || value === "all";
404
+ return value === void 0 || value === "workspace" || value === "user" || value === "all";
617
405
  }
618
406
  function isLinkModeOrUndefined(value) {
619
- return value === void 0 || value === "auto" || value === "symlink" || value === "junction" || value === "copy";
407
+ return value === void 0 || value === "auto" || value === "symlink" || value === "junction" || value === "copy";
620
408
  }
621
409
  function isLinkMode(value) {
622
- return value === "symlink" || value === "junction" || value === "copy";
410
+ return value === "symlink" || value === "junction" || value === "copy";
623
411
  }
624
412
  function isRepoEntry(value) {
625
- if (!isRecord5(value)) return false;
626
- if (typeof value.id !== "string") return false;
627
- if (typeof value.name !== "string") return false;
628
- if (typeof value.url !== "string") return false;
629
- if (typeof value.branch !== "string") return false;
630
- if (typeof value.enabled !== "boolean") return false;
631
- if (value.useProxy !== void 0 && typeof value.useProxy !== "boolean") return false;
632
- if (typeof value.writeEnabled !== "boolean") return false;
633
- if (value.source !== "default" && value.source !== "user") return false;
634
- if (typeof value.addedAt !== "string") return false;
635
- if (value.description !== void 0 && typeof value.description !== "string") return false;
636
- if (value.lastSyncAt !== void 0 && typeof value.lastSyncAt !== "string") return false;
637
- if (value.lastSyncCommitSha !== void 0 && typeof value.lastSyncCommitSha !== "string") {
638
- return false;
639
- }
640
- if (value.lastSyncStatus !== void 0 && value.lastSyncStatus !== "ok" && value.lastSyncStatus !== "error") {
641
- return false;
642
- }
643
- if (value.lastSyncError !== void 0 && typeof value.lastSyncError !== "string") {
644
- return false;
645
- }
646
- return true;
413
+ if (!isRecord$11(value)) return false;
414
+ if (typeof value.id !== "string") return false;
415
+ if (typeof value.name !== "string") return false;
416
+ if (typeof value.url !== "string") return false;
417
+ if (typeof value.branch !== "string") return false;
418
+ if (typeof value.enabled !== "boolean") return false;
419
+ if (value.useProxy !== void 0 && typeof value.useProxy !== "boolean") return false;
420
+ if (typeof value.writeEnabled !== "boolean") return false;
421
+ if (value.source !== "default" && value.source !== "user") return false;
422
+ if (typeof value.addedAt !== "string") return false;
423
+ if (value.description !== void 0 && typeof value.description !== "string") return false;
424
+ if (value.lastSyncAt !== void 0 && typeof value.lastSyncAt !== "string") return false;
425
+ if (value.lastSyncCommitSha !== void 0 && typeof value.lastSyncCommitSha !== "string") return false;
426
+ if (value.lastSyncStatus !== void 0 && value.lastSyncStatus !== "ok" && value.lastSyncStatus !== "error") return false;
427
+ if (value.lastSyncError !== void 0 && typeof value.lastSyncError !== "string") return false;
428
+ return true;
647
429
  }
648
430
  function isSkillEntry(value) {
649
- if (!isRecord5(value)) return false;
650
- if (typeof value.repoId !== "string") return false;
651
- if (typeof value.name !== "string") return false;
652
- if (value.kind !== "skill" && value.kind !== "agent") return false;
653
- if (typeof value.manifestPath !== "string") return false;
654
- if (typeof value.dir !== "string") return false;
655
- if (typeof value.frontmatter !== "object" || value.frontmatter === null) {
656
- return false;
657
- }
658
- if (typeof value.modifiedAt !== "string") return false;
659
- return true;
431
+ if (!isRecord$11(value)) return false;
432
+ if (typeof value.repoId !== "string") return false;
433
+ if (typeof value.name !== "string") return false;
434
+ if (value.kind !== "skill" && value.kind !== "agent") return false;
435
+ if (typeof value.manifestPath !== "string") return false;
436
+ if (typeof value.dir !== "string") return false;
437
+ if (typeof value.frontmatter !== "object" || value.frontmatter === null) return false;
438
+ if (typeof value.modifiedAt !== "string") return false;
439
+ return true;
660
440
  }
661
441
  function isSkillFile(value) {
662
- return isRecord5(value) && typeof value.path === "string" && typeof value.content === "string";
442
+ return isRecord$11(value) && typeof value.path === "string" && typeof value.content === "string";
663
443
  }
664
444
  function isLinkedSkill(value) {
665
- return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.linkPath === "string" && typeof value.targetPath === "string" && isLinkMode(value.mode) && isLinkScope(value.scope);
445
+ return isRecord$11(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.linkPath === "string" && typeof value.targetPath === "string" && isLinkMode(value.mode) && isLinkScope(value.scope);
666
446
  }
667
447
  function isSyncPull(value) {
668
- return isRecord5(value) && typeof value.repoId === "string" && (value.status === "ok" || value.status === "error");
448
+ return isRecord$11(value) && typeof value.repoId === "string" && (value.status === "ok" || value.status === "error");
669
449
  }
670
450
  function isCopilotContentStatus(value) {
671
- return value === "restored" || value === "adopted" || value === "pending_approval" || value === "missing_source" || value === "conflict" || value === "drifted";
451
+ return value === "restored" || value === "adopted" || value === "pending_approval" || value === "missing_source" || value === "conflict" || value === "drifted";
672
452
  }
673
453
  function isCopilotContentEntry(value) {
674
- if (!isRecord5(value)) return false;
675
- if (typeof value.identity !== "string") return false;
676
- if (!isCopilotContentStatus(value.status)) return false;
677
- if (value.message !== void 0 && typeof value.message !== "string") return false;
678
- return true;
454
+ if (!isRecord$11(value)) return false;
455
+ if (typeof value.identity !== "string") return false;
456
+ if (!isCopilotContentStatus(value.status)) return false;
457
+ if (value.message !== void 0 && typeof value.message !== "string") return false;
458
+ return true;
679
459
  }
680
460
  function isCopilotContentIntegrationKind(value) {
681
- return value === "mcp" || value === "hook";
461
+ return value === "mcp" || value === "hook";
682
462
  }
683
463
  function isCopilotContentIntegrationStatus(value) {
684
- return value === "active" || value === "inactive" || value === "pending_approval" || value === "missing_local_configuration";
464
+ return value === "active" || value === "inactive" || value === "pending_approval" || value === "missing_local_configuration";
685
465
  }
686
466
  function isCopilotContentIntegration(value) {
687
- if (!isRecord5(value)) return false;
688
- if (typeof value.identity !== "string") return false;
689
- if (!isCopilotContentIntegrationKind(value.kind)) return false;
690
- if (typeof value.configPath !== "string") return false;
691
- if (!Array.isArray(value.names) || value.names.some((name) => typeof name !== "string")) {
692
- return false;
693
- }
694
- return isCopilotContentIntegrationStatus(value.status);
467
+ if (!isRecord$11(value)) return false;
468
+ if (typeof value.identity !== "string") return false;
469
+ if (!isCopilotContentIntegrationKind(value.kind)) return false;
470
+ if (typeof value.configPath !== "string") return false;
471
+ if (!Array.isArray(value.names) || value.names.some((name) => typeof name !== "string")) return false;
472
+ return isCopilotContentIntegrationStatus(value.status);
695
473
  }
696
474
  function isSkillRepoListResult(value) {
697
- return isRecord5(value) && Array.isArray(value.entries) && value.entries.every(isSkillEntry);
475
+ return isRecord$11(value) && Array.isArray(value.entries) && value.entries.every(isSkillEntry);
698
476
  }
699
477
  function isSkillRepoGetResult(value) {
700
- return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && (value.kind === "skill" || value.kind === "agent") && typeof value.manifestPath === "string" && typeof value.dir === "string" && typeof value.frontmatter === "object" && value.frontmatter !== null && typeof value.modifiedAt === "string" && Array.isArray(value.files) && value.files.every(isSkillFile);
478
+ return isRecord$11(value) && typeof value.repoId === "string" && typeof value.name === "string" && (value.kind === "skill" || value.kind === "agent") && typeof value.manifestPath === "string" && typeof value.dir === "string" && typeof value.frontmatter === "object" && value.frontmatter !== null && typeof value.modifiedAt === "string" && Array.isArray(value.files) && value.files.every(isSkillFile);
701
479
  }
702
480
  function isSkillRepoInstallResult(value) {
703
- return isRecord5(value) && isLinkMode(value.mode) && typeof value.linkPath === "string" && typeof value.targetPath === "string";
481
+ return isRecord$11(value) && isLinkMode(value.mode) && typeof value.linkPath === "string" && typeof value.targetPath === "string";
704
482
  }
705
483
  function isSkillRepoConvertToSymlinkResult(value) {
706
- return isRecord5(value) && isLinkMode(value.mode) && typeof value.linkPath === "string" && typeof value.targetPath === "string";
484
+ return isRecord$11(value) && isLinkMode(value.mode) && typeof value.linkPath === "string" && typeof value.targetPath === "string";
707
485
  }
708
486
  function isSkillRepoUninstallResult(value) {
709
- return isRecord5(value) && value.removed === true;
487
+ return isRecord$11(value) && value.removed === true;
710
488
  }
711
489
  function isSkillRepoSetEntryEnabledResult(value) {
712
- return isRecord5(value) && typeof value.enabled === "boolean";
490
+ return isRecord$11(value) && typeof value.enabled === "boolean";
713
491
  }
714
492
  function isSkillKind(value) {
715
- return value === "skill" || value === "agent";
493
+ return value === "skill" || value === "agent";
716
494
  }
717
495
  function isCopilotContentDetectUnmanagedParams(value) {
718
- return isRecord5(value) && typeof value.workspaceDir === "string";
496
+ return isRecord$11(value) && typeof value.workspaceDir === "string";
719
497
  }
720
498
  function isCopilotContentDetectUnmanagedResult(value) {
721
- if (!isRecord5(value)) return false;
722
- if (!Array.isArray(value.adoptions) || !Array.isArray(value.ambiguous)) return false;
723
- if (!Array.isArray(value.integrations) || !Array.isArray(value.unmatched)) return false;
724
- return value.adoptions.every(
725
- (a) => isRecord5(a) && typeof a.repoId === "string" && typeof a.name === "string" && isSkillKind(a.kind) && (a.source === "symlink" || a.source === "fingerprint")
726
- ) && value.ambiguous.every(
727
- (a) => isRecord5(a) && typeof a.name === "string" && isSkillKind(a.kind) && Array.isArray(a.candidates) && a.candidates.every((c) => typeof c === "string")
728
- ) && value.integrations.every(
729
- (i) => isRecord5(i) && typeof i.repoId === "string" && typeof i.pluginId === "string" && (i.kind === "hook" || i.kind === "mcp")
730
- ) && value.unmatched.every(
731
- (u) => isRecord5(u) && typeof u.name === "string" && typeof u.reason === "string"
732
- );
499
+ if (!isRecord$11(value)) return false;
500
+ if (!Array.isArray(value.adoptions) || !Array.isArray(value.ambiguous)) return false;
501
+ if (!Array.isArray(value.integrations) || !Array.isArray(value.unmatched)) return false;
502
+ return value.adoptions.every((a) => isRecord$11(a) && typeof a.repoId === "string" && typeof a.name === "string" && isSkillKind(a.kind) && (a.source === "symlink" || a.source === "fingerprint")) && value.ambiguous.every((a) => isRecord$11(a) && typeof a.name === "string" && isSkillKind(a.kind) && Array.isArray(a.candidates) && a.candidates.every((c) => typeof c === "string")) && value.integrations.every((i) => isRecord$11(i) && typeof i.repoId === "string" && typeof i.pluginId === "string" && (i.kind === "hook" || i.kind === "mcp")) && value.unmatched.every((u) => isRecord$11(u) && typeof u.name === "string" && typeof u.reason === "string");
733
503
  }
734
504
  function isCopilotContentAdoptUnmanagedParams(value) {
735
- if (!isRecord5(value) || typeof value.workspaceDir !== "string") return false;
736
- if (!Array.isArray(value.entries)) return false;
737
- if (!value.entries.every(
738
- (e) => isRecord5(e) && typeof e.repoId === "string" && typeof e.name === "string" && isSkillKind(e.kind) && (e.convertRealCopy === void 0 || typeof e.convertRealCopy === "boolean")
739
- )) {
740
- return false;
741
- }
742
- if (value.integrations !== void 0 && !Array.isArray(value.integrations)) return false;
743
- if (Array.isArray(value.integrations)) {
744
- return value.integrations.every(
745
- (i) => isRecord5(i) && typeof i.repoId === "string" && typeof i.pluginId === "string" && (i.kind === "hook" || i.kind === "mcp")
746
- );
747
- }
748
- return true;
505
+ if (!isRecord$11(value) || typeof value.workspaceDir !== "string") return false;
506
+ if (!Array.isArray(value.entries)) return false;
507
+ if (!value.entries.every((e) => isRecord$11(e) && typeof e.repoId === "string" && typeof e.name === "string" && isSkillKind(e.kind) && (e.convertRealCopy === void 0 || typeof e.convertRealCopy === "boolean"))) return false;
508
+ if (value.integrations !== void 0 && !Array.isArray(value.integrations)) return false;
509
+ if (Array.isArray(value.integrations)) return value.integrations.every((i) => isRecord$11(i) && typeof i.repoId === "string" && typeof i.pluginId === "string" && (i.kind === "hook" || i.kind === "mcp"));
510
+ return true;
749
511
  }
750
512
  function isCopilotContentAdoptUnmanagedResult(value) {
751
- if (!isRecord5(value) || typeof value.changed !== "boolean") return false;
752
- if (!Array.isArray(value.entries)) return false;
753
- return value.entries.every(
754
- (e) => isRecord5(e) && typeof e.identity === "string" && typeof e.status === "string" && (e.message === void 0 || typeof e.message === "string")
755
- );
513
+ if (!isRecord$11(value) || typeof value.changed !== "boolean") return false;
514
+ if (!Array.isArray(value.entries)) return false;
515
+ return value.entries.every((e) => isRecord$11(e) && typeof e.identity === "string" && typeof e.status === "string" && (e.message === void 0 || typeof e.message === "string"));
756
516
  }
757
517
  function isSkillRepoListLinkedResult(value) {
758
- return isRecord5(value) && Array.isArray(value.links) && value.links.every(isLinkedSkill);
518
+ return isRecord$11(value) && Array.isArray(value.links) && value.links.every(isLinkedSkill);
759
519
  }
760
520
  function isSkillRepoDraftCreateResult(value) {
761
- return isRecord5(value) && typeof value.id === "string";
521
+ return isRecord$11(value) && typeof value.id === "string";
762
522
  }
763
523
  function isSkillRepoDraftCommitResult(value) {
764
- return isRecord5(value) && typeof value.repoId === "string" && typeof value.skillName === "string" && typeof value.commitSha === "string" && isStringOrUndefined2(value.pushedRef) && isStringOrUndefined2(value.pushedSha);
524
+ return isRecord$11(value) && typeof value.repoId === "string" && typeof value.skillName === "string" && typeof value.commitSha === "string" && isStringOrUndefined$2(value.pushedRef) && isStringOrUndefined$2(value.pushedSha);
765
525
  }
766
526
  function isSkillRepoDraftListResult(value) {
767
- return isRecord5(value) && Array.isArray(value.drafts) && value.drafts.every(
768
- (d) => isRecord5(d) && typeof d.id === "string" && (d.kind === "skill" || d.kind === "agent") && typeof d.name === "string" && typeof d.description === "string" && typeof d.modifiedAt === "string"
769
- );
527
+ return isRecord$11(value) && Array.isArray(value.drafts) && value.drafts.every((d) => isRecord$11(d) && typeof d.id === "string" && (d.kind === "skill" || d.kind === "agent") && typeof d.name === "string" && typeof d.description === "string" && typeof d.modifiedAt === "string");
770
528
  }
771
529
  function isSkillRepoDraftDeleteResult(value) {
772
- return isRecord5(value) && value.deleted === true;
530
+ return isRecord$11(value) && value.deleted === true;
773
531
  }
774
532
  function isRepoListResult(value) {
775
- return isRecord5(value) && Array.isArray(value.repos) && value.repos.every(isRepoEntry);
533
+ return isRecord$11(value) && Array.isArray(value.repos) && value.repos.every(isRepoEntry);
776
534
  }
777
535
  function isRepoAddResult(value) {
778
- return isRecord5(value) && isRepoEntry(value.repo) && typeof value.branch === "string" && typeof value.cloned === "boolean";
536
+ return isRecord$11(value) && isRepoEntry(value.repo) && typeof value.branch === "string" && typeof value.cloned === "boolean";
779
537
  }
780
538
  function isRepoRemoveResult(value) {
781
- return isRecord5(value) && value.removed === true;
539
+ return isRecord$11(value) && value.removed === true;
782
540
  }
783
541
  function isRepoEnableResult(value) {
784
- return isRecord5(value) && isRepoEntry(value.repo);
542
+ return isRecord$11(value) && isRepoEntry(value.repo);
785
543
  }
786
544
  function isRepoDisableResult(value) {
787
- return isRecord5(value) && isRepoEntry(value.repo);
545
+ return isRecord$11(value) && isRepoEntry(value.repo);
788
546
  }
789
547
  function isRepoUpdateResult(value) {
790
- return isRecord5(value) && isRepoEntry(value.repo);
548
+ return isRecord$11(value) && isRepoEntry(value.repo);
791
549
  }
792
550
  function isRepoSyncResult(value) {
793
- return isRecord5(value) && Array.isArray(value.pulls) && value.pulls.length >= 1 && value.pulls.every(isSyncPull);
551
+ return isRecord$11(value) && Array.isArray(value.pulls) && value.pulls.length >= 1 && value.pulls.every(isSyncPull);
794
552
  }
795
553
  function isRepoSyncAllResult(value) {
796
- return isRecord5(value) && Array.isArray(value.pulls) && value.pulls.every(isSyncPull);
554
+ return isRecord$11(value) && Array.isArray(value.pulls) && value.pulls.every(isSyncPull);
797
555
  }
798
556
  function isCopilotContentRestoreResult(value) {
799
- return isRecord5(value) && typeof value.changed === "boolean" && Array.isArray(value.entries) && value.entries.every(isCopilotContentEntry);
557
+ return isRecord$11(value) && typeof value.changed === "boolean" && Array.isArray(value.entries) && value.entries.every(isCopilotContentEntry);
800
558
  }
801
559
  function isCopilotContentStatusResult(value) {
802
- return isCopilotContentRestoreResult(value);
560
+ return isCopilotContentRestoreResult(value);
803
561
  }
804
562
  function isCopilotContentApproveResult(value) {
805
- return isCopilotContentRestoreResult(value);
563
+ return isCopilotContentRestoreResult(value);
806
564
  }
807
565
  function isCopilotContentMigrateLegacyResult(value) {
808
- return isRecord5(value) && Array.isArray(value.entries) && value.entries.every(isCopilotContentEntry);
566
+ return isRecord$11(value) && Array.isArray(value.entries) && value.entries.every(isCopilotContentEntry);
809
567
  }
810
568
  function isCopilotContentIntegrationStatusResult(value) {
811
- return isRecord5(value) && Array.isArray(value.integrations) && value.integrations.every(isCopilotContentIntegration);
569
+ return isRecord$11(value) && Array.isArray(value.integrations) && value.integrations.every(isCopilotContentIntegration);
812
570
  }
813
571
  function isSkillRepoListParams(value) {
814
- return isRecord5(value) && isStringOrUndefined2(value.repoId) && isSkillKindOrUndefined(value.kind) && isStringOrUndefined2(value.workspaceDir);
572
+ return isRecord$11(value) && isStringOrUndefined$2(value.repoId) && isSkillKindOrUndefined(value.kind) && isStringOrUndefined$2(value.workspaceDir);
815
573
  }
816
574
  function isSkillRepoGetParams(value) {
817
- return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string";
575
+ return isRecord$11(value) && typeof value.repoId === "string" && typeof value.name === "string";
818
576
  }
819
577
  function isSkillRepoInstallParams(value) {
820
- return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkModeOrUndefined(value.mode) && isLinkScopeOrUndefined(value.scope);
578
+ return isRecord$11(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkModeOrUndefined(value.mode) && isLinkScopeOrUndefined(value.scope);
821
579
  }
822
580
  function isSkillRepoConvertToSymlinkParams(value) {
823
- return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkModeOrUndefined(value.mode) && isLinkScopeOrUndefined(value.scope);
581
+ return isRecord$11(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkModeOrUndefined(value.mode) && isLinkScopeOrUndefined(value.scope);
824
582
  }
825
583
  function isSkillRepoUninstallParams(value) {
826
- return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkScopeOrUndefined(value.scope);
584
+ return isRecord$11(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkScopeOrUndefined(value.scope);
827
585
  }
828
586
  function isSkillRepoSetEntryEnabledParams(value) {
829
- return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.enabled === "boolean" && isSkillKindOrUndefined(value.kind) && isLinkScopeOrUndefined(value.scope) && (value.workspaceDir === void 0 || typeof value.workspaceDir === "string");
587
+ return isRecord$11(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.enabled === "boolean" && isSkillKindOrUndefined(value.kind) && isLinkScopeOrUndefined(value.scope) && (value.workspaceDir === void 0 || typeof value.workspaceDir === "string");
830
588
  }
831
589
  function isSkillRepoListLinkedParams(value) {
832
- return isRecord5(value) && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkScopeFilterOrUndefined(value.scope);
590
+ return isRecord$11(value) && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkScopeFilterOrUndefined(value.scope);
833
591
  }
834
592
  function isRepoListParams(value) {
835
- return isRecord5(value) && (value.source === void 0 || value.source === "default" || value.source === "user");
593
+ return isRecord$11(value) && (value.source === void 0 || value.source === "default" || value.source === "user");
836
594
  }
837
595
  function isRepoAddParams(value) {
838
- return isRecord5(value) && typeof value.url === "string" && isStringOrUndefined2(value.branch) && isStringOrUndefined2(value.name) && isBooleanOrUndefined(value.useProxy);
596
+ return isRecord$11(value) && typeof value.url === "string" && isStringOrUndefined$2(value.branch) && isStringOrUndefined$2(value.name) && isBooleanOrUndefined(value.useProxy);
839
597
  }
840
598
  function isRepoRemoveParams(value) {
841
- return isRecord5(value) && typeof value.repoId === "string";
599
+ return isRecord$11(value) && typeof value.repoId === "string";
842
600
  }
843
601
  function isRepoEnableParams(value) {
844
- return isRecord5(value) && typeof value.repoId === "string";
602
+ return isRecord$11(value) && typeof value.repoId === "string";
845
603
  }
846
604
  function isRepoDisableParams(value) {
847
- return isRecord5(value) && typeof value.repoId === "string";
605
+ return isRecord$11(value) && typeof value.repoId === "string";
848
606
  }
849
607
  function isRepoSyncParams(value) {
850
- return isRecord5(value) && typeof value.repoId === "string";
608
+ return isRecord$11(value) && typeof value.repoId === "string";
851
609
  }
852
610
  function isRepoSyncAllParams(value) {
853
- return isRecord5(value);
854
- }
855
-
856
- // src/device.ts
857
- var DEVICE_BINDING_STATES = [
858
- "anonymous",
859
- "pending",
860
- "claimed",
861
- "expired"
611
+ return isRecord$11(value);
612
+ }
613
+ //#endregion
614
+ //#region src/device.ts
615
+ const DEVICE_BINDING_STATES = [
616
+ "anonymous",
617
+ "pending",
618
+ "claimed",
619
+ "expired"
862
620
  ];
863
- function isRecord6(value) {
864
- return typeof value === "object" && value !== null;
621
+ function isRecord$10(value) {
622
+ return typeof value === "object" && value !== null;
865
623
  }
866
- function isStringOrUndefined3(value) {
867
- return value === void 0 || typeof value === "string";
624
+ function isStringOrUndefined$1(value) {
625
+ return value === void 0 || typeof value === "string";
868
626
  }
869
627
  function isDeviceBindingState(value) {
870
- return value === "anonymous" || value === "pending" || value === "claimed" || value === "expired";
628
+ return value === "anonymous" || value === "pending" || value === "claimed" || value === "expired";
871
629
  }
872
630
  function isDeviceIdentityState(value) {
873
- if (!isRecord6(value)) return false;
874
- if (typeof value.publicId !== "string") return false;
875
- if (value.publicId.length === 0) return false;
876
- if (typeof value.secretVersion !== "number") return false;
877
- if (!Number.isInteger(value.secretVersion)) return false;
878
- if (value.secretVersion < 0) return false;
879
- if (!isDeviceBindingState(value.bindingState)) return false;
880
- return true;
631
+ if (!isRecord$10(value)) return false;
632
+ if (typeof value.publicId !== "string") return false;
633
+ if (value.publicId.length === 0) return false;
634
+ if (typeof value.secretVersion !== "number") return false;
635
+ if (!Number.isInteger(value.secretVersion)) return false;
636
+ if (value.secretVersion < 0) return false;
637
+ if (!isDeviceBindingState(value.bindingState)) return false;
638
+ return true;
881
639
  }
882
640
  function isDeviceMetadata(value) {
883
- if (!isRecord6(value)) return false;
884
- if (typeof value.installationId !== "string") return false;
885
- if (value.installationId.length === 0) return false;
886
- if (typeof value.machineId !== "string") return false;
887
- if (value.machineId.length === 0) return false;
888
- if (typeof value.platform !== "string") return false;
889
- if (value.platform.length === 0) return false;
890
- if (!isStringOrUndefined3(value.hostname)) return false;
891
- if (!isStringOrUndefined3(value.vscodeVersion)) return false;
892
- if (!isStringOrUndefined3(value.extensionVersion)) return false;
893
- return true;
641
+ if (!isRecord$10(value)) return false;
642
+ if (typeof value.installationId !== "string") return false;
643
+ if (value.installationId.length === 0) return false;
644
+ if (typeof value.machineId !== "string") return false;
645
+ if (value.machineId.length === 0) return false;
646
+ if (typeof value.platform !== "string") return false;
647
+ if (value.platform.length === 0) return false;
648
+ if (!isStringOrUndefined$1(value.hostname)) return false;
649
+ if (!isStringOrUndefined$1(value.vscodeVersion)) return false;
650
+ if (!isStringOrUndefined$1(value.extensionVersion)) return false;
651
+ return true;
894
652
  }
895
653
  function isDeviceStatus(value) {
896
- if (!isRecord6(value)) return false;
897
- if (!isDeviceBindingState(value.bindingState)) return false;
898
- if (value.identity !== void 0 && !isDeviceIdentityState(value.identity)) {
899
- return false;
900
- }
901
- if (value.metadata !== void 0 && !isDeviceMetadata(value.metadata)) {
902
- return false;
903
- }
904
- if (!isStringOrUndefined3(value.lastSyncAt)) return false;
905
- if (!isStringOrUndefined3(value.lastSyncError)) return false;
906
- return true;
654
+ if (!isRecord$10(value)) return false;
655
+ if (!isDeviceBindingState(value.bindingState)) return false;
656
+ if (value.identity !== void 0 && !isDeviceIdentityState(value.identity)) return false;
657
+ if (value.metadata !== void 0 && !isDeviceMetadata(value.metadata)) return false;
658
+ if (!isStringOrUndefined$1(value.lastSyncAt)) return false;
659
+ if (!isStringOrUndefined$1(value.lastSyncError)) return false;
660
+ return true;
907
661
  }
908
662
  function isDeviceEnrollParams(value) {
909
- return isRecord6(value) && (value.force === void 0 || typeof value.force === "boolean") && (value.requireAuth === void 0 || typeof value.requireAuth === "boolean");
663
+ return isRecord$10(value) && (value.force === void 0 || typeof value.force === "boolean") && (value.requireAuth === void 0 || typeof value.requireAuth === "boolean");
910
664
  }
911
665
  function isDeviceEnrollResult(value) {
912
- if (!isRecord6(value)) return false;
913
- if (typeof value.publicId !== "string") return false;
914
- if (value.publicId.length === 0) return false;
915
- if (!isDeviceBindingState(value.bindingState)) return false;
916
- if (!isStringOrUndefined3(value.expiresAt)) return false;
917
- return true;
666
+ if (!isRecord$10(value)) return false;
667
+ if (typeof value.publicId !== "string") return false;
668
+ if (value.publicId.length === 0) return false;
669
+ if (!isDeviceBindingState(value.bindingState)) return false;
670
+ if (!isStringOrUndefined$1(value.expiresAt)) return false;
671
+ return true;
918
672
  }
919
673
  function isDeviceRotateSecretParams(value) {
920
- if (!isRecord6(value)) return false;
921
- if (value.gracePeriodDays !== void 0 && (typeof value.gracePeriodDays !== "number" || !Number.isInteger(value.gracePeriodDays) || value.gracePeriodDays < 0 || value.gracePeriodDays > 365)) {
922
- return false;
923
- }
924
- return true;
674
+ if (!isRecord$10(value)) return false;
675
+ if (value.gracePeriodDays !== void 0 && (typeof value.gracePeriodDays !== "number" || !Number.isInteger(value.gracePeriodDays) || value.gracePeriodDays < 0 || value.gracePeriodDays > 365)) return false;
676
+ return true;
925
677
  }
926
678
  function isDeviceRotateSecretResult(value) {
927
- if (!isRecord6(value)) return false;
928
- if (typeof value.publicId !== "string") return false;
929
- if (value.publicId.length === 0) return false;
930
- if (typeof value.secretVersion !== "number") return false;
931
- if (!Number.isInteger(value.secretVersion)) return false;
932
- if (value.secretVersion < 0) return false;
933
- if (typeof value.gracePeriodDays !== "number") return false;
934
- if (!Number.isInteger(value.gracePeriodDays)) return false;
935
- if (value.gracePeriodDays < 0) return false;
936
- if (!isStringOrUndefined3(value.gracePeriodEndsAt)) return false;
937
- return true;
938
- }
939
-
940
- // src/scheduled-tasks.ts
941
- var VALID_TASK_TYPES = [
942
- "command",
943
- "shell",
944
- "http_request",
945
- "github_copilot_cli"
679
+ if (!isRecord$10(value)) return false;
680
+ if (typeof value.publicId !== "string") return false;
681
+ if (value.publicId.length === 0) return false;
682
+ if (typeof value.secretVersion !== "number") return false;
683
+ if (!Number.isInteger(value.secretVersion)) return false;
684
+ if (value.secretVersion < 0) return false;
685
+ if (typeof value.gracePeriodDays !== "number") return false;
686
+ if (!Number.isInteger(value.gracePeriodDays)) return false;
687
+ if (value.gracePeriodDays < 0) return false;
688
+ if (!isStringOrUndefined$1(value.gracePeriodEndsAt)) return false;
689
+ return true;
690
+ }
691
+ //#endregion
692
+ //#region src/scheduled-tasks.ts
693
+ const VALID_TASK_TYPES = [
694
+ "command",
695
+ "shell",
696
+ "http_request",
697
+ "github_copilot_cli"
946
698
  ];
947
- var VALID_SCHEDULE_TYPES = ["cron", "interval"];
948
- var VALID_TERMINAL_STATUSES = [
949
- "success",
950
- "failure",
951
- "timeout",
952
- "cancelled"
699
+ const VALID_SCHEDULE_TYPES = ["cron", "interval"];
700
+ const VALID_TERMINAL_STATUSES = [
701
+ "success",
702
+ "failure",
703
+ "timeout",
704
+ "cancelled"
953
705
  ];
954
- function isRecord7(value) {
955
- return typeof value === "object" && value !== null;
706
+ function isRecord$9(value) {
707
+ return typeof value === "object" && value !== null;
956
708
  }
957
709
  function isScheduledTaskType(value) {
958
- return typeof value === "string" && VALID_TASK_TYPES.includes(value);
710
+ return typeof value === "string" && VALID_TASK_TYPES.includes(value);
959
711
  }
712
+ /**
713
+ * Validates a v1 task shape (no `workspace`). Used for reading legacy config
714
+ * during migration only. New code should validate against {@link ScheduledTask}
715
+ * with {@link isScheduledTask}.
716
+ */
960
717
  function isScheduledTaskV1(value) {
961
- if (!isRecord7(value)) return false;
962
- return typeof value.id === "string" && typeof value.name === "string" && typeof value.enabled === "boolean" && VALID_SCHEDULE_TYPES.includes(value.scheduleType) && typeof value.schedule === "string" && isScheduledTaskType(value.taskType) && isRecord7(value.payload) && typeof value.createdAt === "string" && typeof value.updatedAt === "string";
718
+ if (!isRecord$9(value)) return false;
719
+ return typeof value.id === "string" && typeof value.name === "string" && typeof value.enabled === "boolean" && VALID_SCHEDULE_TYPES.includes(value.scheduleType) && typeof value.schedule === "string" && isScheduledTaskType(value.taskType) && isRecord$9(value.payload) && typeof value.createdAt === "string" && typeof value.updatedAt === "string";
963
720
  }
721
+ /** Validates a {@link TaskWorkspaceRef} payload. */
964
722
  function isTaskWorkspaceRef(value) {
965
- if (!isRecord7(value)) return false;
966
- if (typeof value.path !== "string" || value.path.length === 0) return false;
967
- if (typeof value.name !== "string" || value.name.length === 0) return false;
968
- if (value.gitRemote !== void 0 && typeof value.gitRemote !== "string") {
969
- return false;
970
- }
971
- if (value.gitBranch !== void 0 && typeof value.gitBranch !== "string") {
972
- return false;
973
- }
974
- if (value.lastSeenAt !== void 0 && typeof value.lastSeenAt !== "string") {
975
- return false;
976
- }
977
- return true;
978
- }
723
+ if (!isRecord$9(value)) return false;
724
+ if (typeof value.path !== "string" || value.path.length === 0) return false;
725
+ if (typeof value.name !== "string" || value.name.length === 0) return false;
726
+ if (value.gitRemote !== void 0 && typeof value.gitRemote !== "string") return false;
727
+ if (value.gitBranch !== void 0 && typeof value.gitBranch !== "string") return false;
728
+ if (value.lastSeenAt !== void 0 && typeof value.lastSeenAt !== "string") return false;
729
+ return true;
730
+ }
731
+ /** Validates a v2 task shape. Requires the `workspace` field. */
979
732
  function isScheduledTask(value) {
980
- if (!isScheduledTaskV1(value)) return false;
981
- return isTaskWorkspaceRef(value.workspace);
733
+ if (!isScheduledTaskV1(value)) return false;
734
+ return isTaskWorkspaceRef(value.workspace);
982
735
  }
736
+ /** Validates a v2 {@link ScheduledTasksConfig} (version: 2). */
983
737
  function isScheduledTasksConfig(value) {
984
- if (!isRecord7(value)) return false;
985
- if (value.version !== 2) return false;
986
- if (!Array.isArray(value.tasks)) return false;
987
- return value.tasks.every((t) => isScheduledTask(t));
738
+ if (!isRecord$9(value)) return false;
739
+ if (value.version !== 2) return false;
740
+ if (!Array.isArray(value.tasks)) return false;
741
+ return value.tasks.every((t) => isScheduledTask(t));
988
742
  }
743
+ /** Validates a v1 {@link ScheduledTasksConfigV1} (version: 1). */
989
744
  function isScheduledTasksConfigV1(value) {
990
- if (!isRecord7(value)) return false;
991
- if (value.version !== 1) return false;
992
- if (!Array.isArray(value.tasks)) return false;
993
- return value.tasks.every((t) => isScheduledTaskV1(t));
745
+ if (!isRecord$9(value)) return false;
746
+ if (value.version !== 1) return false;
747
+ if (!Array.isArray(value.tasks)) return false;
748
+ return value.tasks.every((t) => isScheduledTaskV1(t));
994
749
  }
995
750
  function isTaskExecutionLog(value) {
996
- if (!isRecord7(value)) return false;
997
- return typeof value.id === "string" && typeof value.taskId === "string" && typeof value.taskName === "string" && typeof value.startedAt === "string" && typeof value.finishedAt === "string" && VALID_TERMINAL_STATUSES.includes(value.status);
751
+ if (!isRecord$9(value)) return false;
752
+ return typeof value.id === "string" && typeof value.taskId === "string" && typeof value.taskName === "string" && typeof value.startedAt === "string" && typeof value.finishedAt === "string" && VALID_TERMINAL_STATUSES.includes(value.status);
998
753
  }
999
754
  function isSchedulerStatus(value) {
1000
- if (!isRecord7(value)) return false;
1001
- return typeof value.running === "boolean" && typeof value.tasksRegistered === "number" && typeof value.workspacePath === "string";
755
+ if (!isRecord$9(value)) return false;
756
+ return typeof value.running === "boolean" && typeof value.tasksRegistered === "number" && typeof value.workspacePath === "string";
1002
757
  }
1003
758
  function isTaskExecuteResult(value) {
1004
- return isRecord7(value) && typeof value.executionId === "string" && value.accepted === true;
759
+ return isRecord$9(value) && typeof value.executionId === "string" && value.accepted === true;
1005
760
  }
1006
761
  function isTaskCancelResult(value) {
1007
- return isRecord7(value) && typeof value.executionId === "string" && typeof value.cancelled === "boolean";
762
+ return isRecord$9(value) && typeof value.executionId === "string" && typeof value.cancelled === "boolean";
1008
763
  }
1009
764
  function isTaskListRunningResult(value) {
1010
- return isRecord7(value) && Array.isArray(value.executions);
765
+ return isRecord$9(value) && Array.isArray(value.executions);
1011
766
  }
1012
767
  function isTaskStartedEventParams(value) {
1013
- return isRecord7(value) && typeof value.executionId === "string" && typeof value.taskId === "string" && typeof value.startedAt === "string";
768
+ return isRecord$9(value) && typeof value.executionId === "string" && typeof value.taskId === "string" && typeof value.startedAt === "string";
1014
769
  }
1015
770
  function isTaskOutputEventParams(value) {
1016
- return isRecord7(value) && typeof value.executionId === "string" && (value.stream === "stdout" || value.stream === "stderr") && typeof value.data === "string";
771
+ return isRecord$9(value) && typeof value.executionId === "string" && (value.stream === "stdout" || value.stream === "stderr") && typeof value.data === "string";
1017
772
  }
1018
773
  function isTaskCompletedEventParams(value) {
1019
- return isRecord7(value) && typeof value.executionId === "string" && isTaskExecutionLog(value.log);
774
+ return isRecord$9(value) && typeof value.executionId === "string" && isTaskExecutionLog(value.log);
1020
775
  }
1021
776
  function isTaskFailedEventParams(value) {
1022
- return isRecord7(value) && typeof value.executionId === "string" && (value.status === "failure" || value.status === "timeout") && (value.reason === "error" || value.reason === "timeout") && isTaskExecutionLog(value.log);
777
+ return isRecord$9(value) && typeof value.executionId === "string" && (value.status === "failure" || value.status === "timeout") && (value.reason === "error" || value.reason === "timeout") && isTaskExecutionLog(value.log);
1023
778
  }
1024
779
  function isTaskCancelledEventParams(value) {
1025
- return isRecord7(value) && typeof value.executionId === "string" && isTaskExecutionLog(value.log);
780
+ return isRecord$9(value) && typeof value.executionId === "string" && isTaskExecutionLog(value.log);
1026
781
  }
1027
782
  function isAgentSessionStatus(value) {
1028
- return value === "idle" || value === "running" || value === "needs-input" || value === "completed" || value === "failed" || value === "aborted";
1029
- }
783
+ return value === "idle" || value === "running" || value === "needs-input" || value === "completed" || value === "failed" || value === "aborted";
784
+ }
785
+ /**
786
+ * Converts a single v1 task to v2 by attaching the given workspace context.
787
+ * Preserves all v1 fields (id, name, description, schedule, payload, etc.)
788
+ * and adds the new runtime metadata fields as undefined.
789
+ *
790
+ * The `workspace` argument supplies the workspace binding that the v1 task
791
+ * lacked. Callers (e.g. `MigrateToGlobal`) build this from the file location
792
+ * of the v1 config plus auto-probed git metadata.
793
+ */
1030
794
  function migrateTaskV1ToV2(v1, workspace) {
1031
- const issues = [];
1032
- if (!isScheduledTaskType(v1.taskType)) {
1033
- issues.push(`unknown taskType: ${String(v1.taskType)}`);
1034
- }
1035
- const task = {
1036
- ...v1,
1037
- workspace
1038
- };
1039
- return { task, issues };
1040
- }
795
+ const issues = [];
796
+ if (!isScheduledTaskType(v1.taskType)) issues.push(`unknown taskType: ${String(v1.taskType)}`);
797
+ return {
798
+ task: {
799
+ ...v1,
800
+ workspace
801
+ },
802
+ issues
803
+ };
804
+ }
805
+ /**
806
+ * Converts a v1 config (from a single per-workspace file) to a v2 config
807
+ * (the global config). Every v1 task inherits the supplied workspace context
808
+ * — v1 had no per-task workspace, so the file's location is authoritative.
809
+ *
810
+ * The returned v2 config can be appended to the global config by the caller.
811
+ * Tasks with structural issues (unknown task type) are still migrated but
812
+ * surface a non-fatal issue string.
813
+ */
1041
814
  function migrateV1ToV2(v1Config, workspace) {
1042
- if (!isTaskWorkspaceRef(workspace)) {
1043
- const w = workspace;
1044
- throw new Error(
1045
- `migrateV1ToV2: invalid workspace ref (path=${String(w.path)}, name=${String(w.name)})`
1046
- );
1047
- }
1048
- const allIssues = [];
1049
- const tasks = v1Config.tasks.map((t) => {
1050
- const { task, issues } = migrateTaskV1ToV2(t, workspace);
1051
- allIssues.push(...issues);
1052
- return task;
1053
- });
1054
- return { config: { version: 2, tasks }, issues: allIssues };
1055
- }
1056
-
1057
- // src/toolbox.ts
1058
- var TOOLBOX_SCOPES = ["user", "workspace"];
1059
- function isRecord8(value) {
1060
- return typeof value === "object" && value !== null;
1061
- }
1062
- function isStringOrUndefined4(value) {
1063
- return value === void 0 || typeof value === "string";
815
+ if (!isTaskWorkspaceRef(workspace)) {
816
+ const w = workspace;
817
+ throw new Error(`migrateV1ToV2: invalid workspace ref (path=${String(w.path)}, name=${String(w.name)})`);
818
+ }
819
+ const allIssues = [];
820
+ return {
821
+ config: {
822
+ version: 2,
823
+ tasks: v1Config.tasks.map((t) => {
824
+ const { task, issues } = migrateTaskV1ToV2(t, workspace);
825
+ allIssues.push(...issues);
826
+ return task;
827
+ })
828
+ },
829
+ issues: allIssues
830
+ };
831
+ }
832
+ //#endregion
833
+ //#region src/toolbox.ts
834
+ const TOOLBOX_SCOPES = ["user", "workspace"];
835
+ function isRecord$8(value) {
836
+ return typeof value === "object" && value !== null;
837
+ }
838
+ function isStringOrUndefined(value) {
839
+ return value === void 0 || typeof value === "string";
1064
840
  }
1065
841
  function isFiniteNumberOrUndefined(value) {
1066
- return value === void 0 || typeof value === "number" && Number.isFinite(value);
842
+ return value === void 0 || typeof value === "number" && Number.isFinite(value);
1067
843
  }
1068
844
  function isToolboxScope(value) {
1069
- return value === "user" || value === "workspace";
845
+ return value === "user" || value === "workspace";
1070
846
  }
1071
847
  function isExternalTool(value) {
1072
- if (!isRecord8(value)) return false;
1073
- if (typeof value.id !== "string") return false;
1074
- if (value.id.length === 0) return false;
1075
- if (typeof value.name !== "string") return false;
1076
- if (value.name.length === 0) return false;
1077
- if (typeof value.description !== "string") return false;
1078
- if (typeof value.icon !== "string") return false;
1079
- if (typeof value.url !== "string") return false;
1080
- if (value.url.length === 0) return false;
1081
- if (value.isDefault !== void 0 && typeof value.isDefault !== "boolean") {
1082
- return false;
1083
- }
1084
- if (!isFiniteNumberOrUndefined(value.order)) return false;
1085
- if (value.scope !== void 0 && !isToolboxScope(value.scope)) return false;
1086
- if (!isStringOrUndefined4(value.lastUsedAt)) return false;
1087
- return true;
848
+ if (!isRecord$8(value)) return false;
849
+ if (typeof value.id !== "string") return false;
850
+ if (value.id.length === 0) return false;
851
+ if (typeof value.name !== "string") return false;
852
+ if (value.name.length === 0) return false;
853
+ if (typeof value.description !== "string") return false;
854
+ if (typeof value.icon !== "string") return false;
855
+ if (typeof value.url !== "string") return false;
856
+ if (value.url.length === 0) return false;
857
+ if (value.isDefault !== void 0 && typeof value.isDefault !== "boolean") return false;
858
+ if (!isFiniteNumberOrUndefined(value.order)) return false;
859
+ if (value.scope !== void 0 && !isToolboxScope(value.scope)) return false;
860
+ if (!isStringOrUndefined(value.lastUsedAt)) return false;
861
+ return true;
1088
862
  }
1089
863
  function isExternalToolPatch(value) {
1090
- if (!isRecord8(value)) return false;
1091
- if (value.name !== void 0) {
1092
- if (typeof value.name !== "string" || value.name.length === 0) return false;
1093
- }
1094
- if (value.description !== void 0 && typeof value.description !== "string") {
1095
- return false;
1096
- }
1097
- if (value.icon !== void 0 && typeof value.icon !== "string") return false;
1098
- if (value.url !== void 0) {
1099
- if (typeof value.url !== "string" || value.url.length === 0) return false;
1100
- }
1101
- if (value.isDefault !== void 0 && typeof value.isDefault !== "boolean") {
1102
- return false;
1103
- }
1104
- if (!isFiniteNumberOrUndefined(value.order)) return false;
1105
- if (value.scope !== void 0 && !isToolboxScope(value.scope)) return false;
1106
- if (!isStringOrUndefined4(value.lastUsedAt)) return false;
1107
- return true;
864
+ if (!isRecord$8(value)) return false;
865
+ if (value.name !== void 0) {
866
+ if (typeof value.name !== "string" || value.name.length === 0) return false;
867
+ }
868
+ if (value.description !== void 0 && typeof value.description !== "string") return false;
869
+ if (value.icon !== void 0 && typeof value.icon !== "string") return false;
870
+ if (value.url !== void 0) {
871
+ if (typeof value.url !== "string" || value.url.length === 0) return false;
872
+ }
873
+ if (value.isDefault !== void 0 && typeof value.isDefault !== "boolean") return false;
874
+ if (!isFiniteNumberOrUndefined(value.order)) return false;
875
+ if (value.scope !== void 0 && !isToolboxScope(value.scope)) return false;
876
+ if (!isStringOrUndefined(value.lastUsedAt)) return false;
877
+ return true;
1108
878
  }
1109
879
  function isToolboxList(value) {
1110
- if (!isRecord8(value)) return false;
1111
- if (!isToolboxScope(value.scope)) return false;
1112
- if (!Array.isArray(value.tools)) return false;
1113
- for (const tool of value.tools) {
1114
- if (!isExternalTool(tool)) return false;
1115
- }
1116
- return true;
880
+ if (!isRecord$8(value)) return false;
881
+ if (!isToolboxScope(value.scope)) return false;
882
+ if (!Array.isArray(value.tools)) return false;
883
+ for (const tool of value.tools) if (!isExternalTool(tool)) return false;
884
+ return true;
1117
885
  }
1118
886
  function isToolboxListParams(value) {
1119
- return isRecord8(value) && (value.scope === void 0 || isToolboxScope(value.scope));
887
+ return isRecord$8(value) && (value.scope === void 0 || isToolboxScope(value.scope));
1120
888
  }
1121
889
  function isToolboxAddParams(value) {
1122
- return isExternalTool(value);
890
+ return isExternalTool(value);
1123
891
  }
1124
892
  function isToolboxAddResult(value) {
1125
- if (!isRecord8(value)) return false;
1126
- if (!isToolboxScope(value.scope)) return false;
1127
- if (!isExternalTool(value.tool)) return false;
1128
- return true;
893
+ if (!isRecord$8(value)) return false;
894
+ if (!isToolboxScope(value.scope)) return false;
895
+ if (!isExternalTool(value.tool)) return false;
896
+ return true;
1129
897
  }
1130
898
  function isToolboxRemoveParams(value) {
1131
- if (!isRecord8(value)) return false;
1132
- if (typeof value.id !== "string") return false;
1133
- if (value.id.length === 0) return false;
1134
- if (value.scope !== void 0 && !isToolboxScope(value.scope)) return false;
1135
- return true;
899
+ if (!isRecord$8(value)) return false;
900
+ if (typeof value.id !== "string") return false;
901
+ if (value.id.length === 0) return false;
902
+ if (value.scope !== void 0 && !isToolboxScope(value.scope)) return false;
903
+ return true;
1136
904
  }
1137
905
  function isToolboxRemoveResult(value) {
1138
- if (!isRecord8(value)) return false;
1139
- if (!isToolboxScope(value.scope)) return false;
1140
- if (typeof value.toolId !== "string") return false;
1141
- if (value.toolId.length === 0) return false;
1142
- if (typeof value.success !== "boolean") return false;
1143
- return true;
906
+ if (!isRecord$8(value)) return false;
907
+ if (!isToolboxScope(value.scope)) return false;
908
+ if (typeof value.toolId !== "string") return false;
909
+ if (value.toolId.length === 0) return false;
910
+ if (typeof value.success !== "boolean") return false;
911
+ return true;
1144
912
  }
1145
913
  function isToolboxUpdateParams(value) {
1146
- if (!isRecord8(value)) return false;
1147
- if (typeof value.id !== "string") return false;
1148
- if (value.id.length === 0) return false;
1149
- if (!isExternalToolPatch(value.patch)) return false;
1150
- if (value.scope !== void 0 && !isToolboxScope(value.scope)) return false;
1151
- return true;
914
+ if (!isRecord$8(value)) return false;
915
+ if (typeof value.id !== "string") return false;
916
+ if (value.id.length === 0) return false;
917
+ if (!isExternalToolPatch(value.patch)) return false;
918
+ if (value.scope !== void 0 && !isToolboxScope(value.scope)) return false;
919
+ return true;
1152
920
  }
1153
921
  function isToolboxUpdateResult(value) {
1154
- if (!isRecord8(value)) return false;
1155
- if (!isToolboxScope(value.scope)) return false;
1156
- if (!isExternalTool(value.tool)) return false;
1157
- return true;
922
+ if (!isRecord$8(value)) return false;
923
+ if (!isToolboxScope(value.scope)) return false;
924
+ if (!isExternalTool(value.tool)) return false;
925
+ return true;
1158
926
  }
1159
-
1160
- // src/bridge.ts
1161
- var SERVICEME_PROTOCOL_VERSION = 2;
1162
- function isRecord9(value) {
1163
- return typeof value === "object" && value !== null;
927
+ //#endregion
928
+ //#region src/bridge.ts
929
+ const SERVICEME_PROTOCOL_VERSION = 2;
930
+ function isRecord$7(value) {
931
+ return typeof value === "object" && value !== null;
1164
932
  }
1165
933
  function isValidProtocolVersion(value) {
1166
- return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= SERVICEME_PROTOCOL_VERSION;
934
+ return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 2;
1167
935
  }
1168
936
  function isBridgeCapabilities(value) {
1169
- return isRecord9(value) && value.bridge === true && value.json === 1 && value.env === 1 && (value.tasks === void 0 || value.tasks === 1) && (value.skillRepo === void 0 || value.skillRepo === 1) && (value.repoMgmt === void 0 || value.repoMgmt === 1) && (value.copilotContent === void 0 || value.copilotContent === 1) && (value.auth === void 0 || value.auth === 1) && (value.device === void 0 || value.device === 1) && (value.toolbox === void 0 || value.toolbox === 1) && (value["auth.tokenRead"] === void 0 || value["auth.tokenRead"] === 1);
1170
- }
1171
- var BRIDGE_METHODS = [
1172
- "system.hello",
1173
- "system.ping",
1174
- "system.shutdown",
1175
- "task.execute",
1176
- "task.cancel",
1177
- "task.list-running",
1178
- "copilotContent.list",
1179
- "copilotContent.get",
1180
- "copilotContent.install",
1181
- "copilotContent.convertToSymlink",
1182
- "copilotContent.uninstall",
1183
- "copilotContent.setEntryEnabled",
1184
- "copilotContent.detectUnmanaged",
1185
- "copilotContent.adoptUnmanaged",
1186
- "copilotContent.listLinked",
1187
- "copilotContent.draft.create",
1188
- "copilotContent.draft.commit",
1189
- "copilotContent.draft.list",
1190
- "copilotContent.draft.delete",
1191
- "skillRepo.list",
1192
- "skillRepo.get",
1193
- "skillRepo.install",
1194
- "skillRepo.convertToSymlink",
1195
- "skillRepo.uninstall",
1196
- "skillRepo.setEntryEnabled",
1197
- "skillRepo.listLinked",
1198
- "skillRepo.draft.create",
1199
- "skillRepo.draft.commit",
1200
- "skillRepo.draft.list",
1201
- "skillRepo.draft.delete",
1202
- "repo.list",
1203
- "repo.add",
1204
- "repo.remove",
1205
- "repo.enable",
1206
- "repo.disable",
1207
- "repo.update",
1208
- "repo.sync",
1209
- "repo.syncAll",
1210
- "repo.resetParseCache",
1211
- "copilotContent.status",
1212
- "copilotContent.restore",
1213
- "copilotContent.approve",
1214
- "copilotContent.migrateLegacy",
1215
- "copilotContent.integrationStatus",
1216
- "copilotContent.customizations.list",
1217
- "copilotContent.package.install",
1218
- "copilotContent.package.update",
1219
- "copilotContent.package.uninstall",
1220
- "copilotContent.package.move",
1221
- "copilotPlugin.list",
1222
- "copilotPlugin.register",
1223
- "copilotPlugin.unregister",
1224
- "copilotContent.legacy.preview",
1225
- "copilotContent.legacy.migrate",
1226
- "copilotContent.sources.list",
1227
- "copilotContent.sources.remove",
1228
- "copilotContent.package.previewUpdate",
1229
- "auth.status",
1230
- "auth.login",
1231
- "auth.logout",
1232
- "auth.whoami",
1233
- "auth.switch",
1234
- "device.status",
1235
- "device.enroll",
1236
- "device.rotate-secret",
1237
- "toolbox.list",
1238
- "toolbox.add",
1239
- "toolbox.remove",
1240
- "toolbox.update"
937
+ return isRecord$7(value) && value.bridge === true && value.json === 1 && value.env === 1 && (value.tasks === void 0 || value.tasks === 1) && (value.skillRepo === void 0 || value.skillRepo === 1) && (value.repoMgmt === void 0 || value.repoMgmt === 1) && (value.copilotContent === void 0 || value.copilotContent === 1) && (value.auth === void 0 || value.auth === 1) && (value.device === void 0 || value.device === 1) && (value.toolbox === void 0 || value.toolbox === 1) && (value["auth.tokenRead"] === void 0 || value["auth.tokenRead"] === 1);
938
+ }
939
+ const BRIDGE_METHODS = [
940
+ "system.hello",
941
+ "system.ping",
942
+ "system.shutdown",
943
+ "task.execute",
944
+ "task.cancel",
945
+ "task.list-running",
946
+ "copilotContent.list",
947
+ "copilotContent.get",
948
+ "copilotContent.install",
949
+ "copilotContent.convertToSymlink",
950
+ "copilotContent.uninstall",
951
+ "copilotContent.setEntryEnabled",
952
+ "copilotContent.detectUnmanaged",
953
+ "copilotContent.adoptUnmanaged",
954
+ "copilotContent.listLinked",
955
+ "copilotContent.draft.create",
956
+ "copilotContent.draft.commit",
957
+ "copilotContent.draft.list",
958
+ "copilotContent.draft.delete",
959
+ "skillRepo.list",
960
+ "skillRepo.get",
961
+ "skillRepo.install",
962
+ "skillRepo.convertToSymlink",
963
+ "skillRepo.uninstall",
964
+ "skillRepo.setEntryEnabled",
965
+ "skillRepo.listLinked",
966
+ "skillRepo.draft.create",
967
+ "skillRepo.draft.commit",
968
+ "skillRepo.draft.list",
969
+ "skillRepo.draft.delete",
970
+ "repo.list",
971
+ "repo.add",
972
+ "repo.remove",
973
+ "repo.enable",
974
+ "repo.disable",
975
+ "repo.update",
976
+ "repo.sync",
977
+ "repo.syncAll",
978
+ "repo.resetParseCache",
979
+ "copilotContent.status",
980
+ "copilotContent.restore",
981
+ "copilotContent.approve",
982
+ "copilotContent.migrateLegacy",
983
+ "copilotContent.integrationStatus",
984
+ "copilotContent.customizations.list",
985
+ "copilotContent.package.install",
986
+ "copilotContent.package.update",
987
+ "copilotContent.package.uninstall",
988
+ "copilotContent.package.move",
989
+ "copilotPlugin.list",
990
+ "copilotPlugin.register",
991
+ "copilotPlugin.unregister",
992
+ "copilotContent.legacy.preview",
993
+ "copilotContent.legacy.migrate",
994
+ "copilotContent.sources.list",
995
+ "copilotContent.sources.remove",
996
+ "copilotContent.package.previewUpdate",
997
+ "auth.status",
998
+ "auth.login",
999
+ "auth.logout",
1000
+ "auth.whoami",
1001
+ "auth.switch",
1002
+ "device.status",
1003
+ "device.enroll",
1004
+ "device.rotate-secret",
1005
+ "toolbox.list",
1006
+ "toolbox.add",
1007
+ "toolbox.remove",
1008
+ "toolbox.update"
1241
1009
  ];
1242
- var COPILOT_CONTENT_METHOD_ALIASES = {
1243
- "skillRepo.list": "copilotContent.list",
1244
- "skillRepo.get": "copilotContent.get",
1245
- "skillRepo.install": "copilotContent.install",
1246
- "skillRepo.convertToSymlink": "copilotContent.convertToSymlink",
1247
- "skillRepo.uninstall": "copilotContent.uninstall",
1248
- "skillRepo.setEntryEnabled": "copilotContent.setEntryEnabled",
1249
- "skillRepo.listLinked": "copilotContent.listLinked",
1250
- "skillRepo.draft.create": "copilotContent.draft.create",
1251
- "skillRepo.draft.commit": "copilotContent.draft.commit",
1252
- "skillRepo.draft.list": "copilotContent.draft.list",
1253
- "skillRepo.draft.delete": "copilotContent.draft.delete"
1010
+ /**
1011
+ * Legacy `skillRepo.*` → canonical `copilotContent.*` method aliases.
1012
+ * Both names stay wire-compatible during the migration window; new
1013
+ * callers must use the canonical names. Servers should dispatch both
1014
+ * spellings to the same handler and always answer with the method name
1015
+ * the request actually used.
1016
+ */
1017
+ const COPILOT_CONTENT_METHOD_ALIASES = {
1018
+ "skillRepo.list": "copilotContent.list",
1019
+ "skillRepo.get": "copilotContent.get",
1020
+ "skillRepo.install": "copilotContent.install",
1021
+ "skillRepo.convertToSymlink": "copilotContent.convertToSymlink",
1022
+ "skillRepo.uninstall": "copilotContent.uninstall",
1023
+ "skillRepo.setEntryEnabled": "copilotContent.setEntryEnabled",
1024
+ "skillRepo.listLinked": "copilotContent.listLinked",
1025
+ "skillRepo.draft.create": "copilotContent.draft.create",
1026
+ "skillRepo.draft.commit": "copilotContent.draft.commit",
1027
+ "skillRepo.draft.list": "copilotContent.draft.list",
1028
+ "skillRepo.draft.delete": "copilotContent.draft.delete"
1254
1029
  };
1030
+ /**
1031
+ * Normalize a legacy `skillRepo.*` method name to its canonical
1032
+ * `copilotContent.*` spelling. Unknown names pass through unchanged.
1033
+ */
1255
1034
  function normalizeBridgeMethod(method) {
1256
- return COPILOT_CONTENT_METHOD_ALIASES[method] ?? method;
1257
- }
1258
- var BRIDGE_EVENTS = [
1259
- "task.started",
1260
- "task.output",
1261
- "task.completed",
1262
- "task.failed",
1263
- "task.cancelled"
1035
+ return COPILOT_CONTENT_METHOD_ALIASES[method] ?? method;
1036
+ }
1037
+ const BRIDGE_EVENTS = [
1038
+ "task.started",
1039
+ "task.output",
1040
+ "task.completed",
1041
+ "task.failed",
1042
+ "task.cancelled"
1264
1043
  ];
1265
1044
  function isSystemHelloResult(value) {
1266
- return isRecord9(value) && typeof value.cliVersion === "string" && isValidProtocolVersion(value.protocolVersion) && isBridgeCapabilities(value.capabilities) && typeof value.pid === "number";
1045
+ return isRecord$7(value) && typeof value.cliVersion === "string" && isValidProtocolVersion(value.protocolVersion) && isBridgeCapabilities(value.capabilities) && typeof value.pid === "number";
1267
1046
  }
1268
1047
  function isSystemPingResult(value) {
1269
- return isRecord9(value) && typeof value.now === "string";
1048
+ return isRecord$7(value) && typeof value.now === "string";
1270
1049
  }
1271
1050
  function isSystemShutdownResult(value) {
1272
- return isRecord9(value) && value.shuttingDown === true;
1051
+ return isRecord$7(value) && value.shuttingDown === true;
1273
1052
  }
1274
1053
  function getBridgeResultValidator(method) {
1275
- switch (method) {
1276
- case "system.hello":
1277
- return isSystemHelloResult;
1278
- case "system.ping":
1279
- return isSystemPingResult;
1280
- case "system.shutdown":
1281
- return isSystemShutdownResult;
1282
- case "task.execute":
1283
- return isTaskExecuteResult;
1284
- case "task.cancel":
1285
- return isTaskCancelResult;
1286
- case "task.list-running":
1287
- return isTaskListRunningResult;
1288
- case "copilotContent.list":
1289
- case "skillRepo.list":
1290
- return isSkillRepoListResult;
1291
- case "copilotContent.get":
1292
- case "skillRepo.get":
1293
- return isSkillRepoGetResult;
1294
- case "copilotContent.install":
1295
- case "skillRepo.install":
1296
- return isSkillRepoInstallResult;
1297
- case "copilotContent.convertToSymlink":
1298
- case "skillRepo.convertToSymlink":
1299
- return isSkillRepoConvertToSymlinkResult;
1300
- case "copilotContent.uninstall":
1301
- case "skillRepo.uninstall":
1302
- return isSkillRepoUninstallResult;
1303
- case "copilotContent.setEntryEnabled":
1304
- case "skillRepo.setEntryEnabled":
1305
- return isSkillRepoSetEntryEnabledResult;
1306
- case "copilotContent.detectUnmanaged":
1307
- return isCopilotContentDetectUnmanagedResult;
1308
- case "copilotContent.adoptUnmanaged":
1309
- return isCopilotContentAdoptUnmanagedResult;
1310
- case "copilotContent.listLinked":
1311
- case "skillRepo.listLinked":
1312
- return isSkillRepoListLinkedResult;
1313
- case "copilotContent.draft.create":
1314
- case "skillRepo.draft.create":
1315
- return isSkillRepoDraftCreateResult;
1316
- case "copilotContent.draft.commit":
1317
- case "skillRepo.draft.commit":
1318
- return isSkillRepoDraftCommitResult;
1319
- case "copilotContent.draft.list":
1320
- case "skillRepo.draft.list":
1321
- return isSkillRepoDraftListResult;
1322
- case "copilotContent.draft.delete":
1323
- case "skillRepo.draft.delete":
1324
- return isSkillRepoDraftDeleteResult;
1325
- case "repo.list":
1326
- return isRepoListResult;
1327
- case "repo.add":
1328
- return isRepoAddResult;
1329
- case "repo.remove":
1330
- return isRepoRemoveResult;
1331
- case "repo.enable":
1332
- return isRepoEnableResult;
1333
- case "repo.disable":
1334
- return isRepoDisableResult;
1335
- case "repo.update":
1336
- return isRepoUpdateResult;
1337
- case "repo.sync":
1338
- return isRepoSyncResult;
1339
- case "repo.syncAll":
1340
- return isRepoSyncAllResult;
1341
- case "copilotContent.status":
1342
- return isCopilotContentStatusResult;
1343
- case "copilotContent.restore":
1344
- return isCopilotContentRestoreResult;
1345
- case "copilotContent.approve":
1346
- return isCopilotContentApproveResult;
1347
- case "copilotContent.migrateLegacy":
1348
- return isCopilotContentMigrateLegacyResult;
1349
- case "copilotContent.integrationStatus":
1350
- return isCopilotContentIntegrationStatusResult;
1351
- case "copilotContent.customizations.list":
1352
- return isCopilotCustomizationsListResult;
1353
- case "copilotPlugin.list":
1354
- return isCopilotPluginListResult;
1355
- case "copilotPlugin.register":
1356
- return isCopilotPluginRegisterResult;
1357
- case "copilotPlugin.unregister":
1358
- return isCopilotPluginUnregisterResult;
1359
- case "copilotContent.package.install":
1360
- return isCopilotPackageInstallResult;
1361
- case "copilotContent.package.update":
1362
- return isCopilotPackageUpdateResult;
1363
- case "copilotContent.package.uninstall":
1364
- return isCopilotPackageUninstallResult;
1365
- case "copilotContent.package.move":
1366
- return isCopilotPackageMoveResult;
1367
- case "copilotContent.legacy.preview":
1368
- return isCopilotLegacyPreviewResult;
1369
- case "copilotContent.legacy.migrate":
1370
- return isCopilotLegacyMigrateResult;
1371
- case "copilotContent.sources.list":
1372
- return isCopilotSourceListResult;
1373
- case "copilotContent.sources.remove":
1374
- return isCopilotSourceRemoveResult;
1375
- case "copilotContent.package.previewUpdate":
1376
- return isCopilotUpdatePreviewResult;
1377
- case "auth.status":
1378
- return isAuthStatus;
1379
- case "auth.login":
1380
- return isAuthLoginResult;
1381
- case "auth.logout":
1382
- return isAuthLogoutResult;
1383
- case "auth.whoami":
1384
- return isAuthWhoamiResult;
1385
- case "auth.switch":
1386
- return isAuthSwitchResult;
1387
- case "device.status":
1388
- return isDeviceStatus;
1389
- case "device.enroll":
1390
- return isDeviceEnrollResult;
1391
- case "device.rotate-secret":
1392
- return isDeviceRotateSecretResult;
1393
- case "toolbox.list":
1394
- return isToolboxList;
1395
- case "toolbox.add":
1396
- return isToolboxAddResult;
1397
- case "toolbox.remove":
1398
- return isToolboxRemoveResult;
1399
- case "toolbox.update":
1400
- return isToolboxUpdateResult;
1401
- default:
1402
- return void 0;
1403
- }
1054
+ switch (method) {
1055
+ case "system.hello": return isSystemHelloResult;
1056
+ case "system.ping": return isSystemPingResult;
1057
+ case "system.shutdown": return isSystemShutdownResult;
1058
+ case "task.execute": return isTaskExecuteResult;
1059
+ case "task.cancel": return isTaskCancelResult;
1060
+ case "task.list-running": return isTaskListRunningResult;
1061
+ case "copilotContent.list":
1062
+ case "skillRepo.list": return isSkillRepoListResult;
1063
+ case "copilotContent.get":
1064
+ case "skillRepo.get": return isSkillRepoGetResult;
1065
+ case "copilotContent.install":
1066
+ case "skillRepo.install": return isSkillRepoInstallResult;
1067
+ case "copilotContent.convertToSymlink":
1068
+ case "skillRepo.convertToSymlink": return isSkillRepoConvertToSymlinkResult;
1069
+ case "copilotContent.uninstall":
1070
+ case "skillRepo.uninstall": return isSkillRepoUninstallResult;
1071
+ case "copilotContent.setEntryEnabled":
1072
+ case "skillRepo.setEntryEnabled": return isSkillRepoSetEntryEnabledResult;
1073
+ case "copilotContent.detectUnmanaged": return isCopilotContentDetectUnmanagedResult;
1074
+ case "copilotContent.adoptUnmanaged": return isCopilotContentAdoptUnmanagedResult;
1075
+ case "copilotContent.listLinked":
1076
+ case "skillRepo.listLinked": return isSkillRepoListLinkedResult;
1077
+ case "copilotContent.draft.create":
1078
+ case "skillRepo.draft.create": return isSkillRepoDraftCreateResult;
1079
+ case "copilotContent.draft.commit":
1080
+ case "skillRepo.draft.commit": return isSkillRepoDraftCommitResult;
1081
+ case "copilotContent.draft.list":
1082
+ case "skillRepo.draft.list": return isSkillRepoDraftListResult;
1083
+ case "copilotContent.draft.delete":
1084
+ case "skillRepo.draft.delete": return isSkillRepoDraftDeleteResult;
1085
+ case "repo.list": return isRepoListResult;
1086
+ case "repo.add": return isRepoAddResult;
1087
+ case "repo.remove": return isRepoRemoveResult;
1088
+ case "repo.enable": return isRepoEnableResult;
1089
+ case "repo.disable": return isRepoDisableResult;
1090
+ case "repo.update": return isRepoUpdateResult;
1091
+ case "repo.sync": return isRepoSyncResult;
1092
+ case "repo.syncAll": return isRepoSyncAllResult;
1093
+ case "copilotContent.status": return isCopilotContentStatusResult;
1094
+ case "copilotContent.restore": return isCopilotContentRestoreResult;
1095
+ case "copilotContent.approve": return isCopilotContentApproveResult;
1096
+ case "copilotContent.migrateLegacy": return isCopilotContentMigrateLegacyResult;
1097
+ case "copilotContent.integrationStatus": return isCopilotContentIntegrationStatusResult;
1098
+ case "copilotContent.customizations.list": return isCopilotCustomizationsListResult;
1099
+ case "copilotPlugin.list": return isCopilotPluginListResult;
1100
+ case "copilotPlugin.register": return isCopilotPluginRegisterResult;
1101
+ case "copilotPlugin.unregister": return isCopilotPluginUnregisterResult;
1102
+ case "copilotContent.package.install": return isCopilotPackageInstallResult;
1103
+ case "copilotContent.package.update": return isCopilotPackageUpdateResult;
1104
+ case "copilotContent.package.uninstall": return isCopilotPackageUninstallResult;
1105
+ case "copilotContent.package.move": return isCopilotPackageMoveResult;
1106
+ case "copilotContent.legacy.preview": return isCopilotLegacyPreviewResult;
1107
+ case "copilotContent.legacy.migrate": return isCopilotLegacyMigrateResult;
1108
+ case "copilotContent.sources.list": return isCopilotSourceListResult;
1109
+ case "copilotContent.sources.remove": return isCopilotSourceRemoveResult;
1110
+ case "copilotContent.package.previewUpdate": return isCopilotUpdatePreviewResult;
1111
+ case "auth.status": return isAuthStatus;
1112
+ case "auth.login": return isAuthLoginResult;
1113
+ case "auth.logout": return isAuthLogoutResult;
1114
+ case "auth.whoami": return isAuthWhoamiResult;
1115
+ case "auth.switch": return isAuthSwitchResult;
1116
+ case "device.status": return isDeviceStatus;
1117
+ case "device.enroll": return isDeviceEnrollResult;
1118
+ case "device.rotate-secret": return isDeviceRotateSecretResult;
1119
+ case "toolbox.list": return isToolboxList;
1120
+ case "toolbox.add": return isToolboxAddResult;
1121
+ case "toolbox.remove": return isToolboxRemoveResult;
1122
+ case "toolbox.update": return isToolboxUpdateResult;
1123
+ default: return;
1124
+ }
1404
1125
  }
1405
1126
  function getBridgeEventParamsValidator(event) {
1406
- switch (event) {
1407
- case "task.started":
1408
- return isTaskStartedEventParams;
1409
- case "task.output":
1410
- return isTaskOutputEventParams;
1411
- case "task.completed":
1412
- return isTaskCompletedEventParams;
1413
- case "task.failed":
1414
- return isTaskFailedEventParams;
1415
- case "task.cancelled":
1416
- return isTaskCancelledEventParams;
1417
- default:
1418
- return void 0;
1419
- }
1127
+ switch (event) {
1128
+ case "task.started": return isTaskStartedEventParams;
1129
+ case "task.output": return isTaskOutputEventParams;
1130
+ case "task.completed": return isTaskCompletedEventParams;
1131
+ case "task.failed": return isTaskFailedEventParams;
1132
+ case "task.cancelled": return isTaskCancelledEventParams;
1133
+ default: return;
1134
+ }
1420
1135
  }
1421
1136
  function isBridgeMethod(value) {
1422
- return typeof value === "string" && BRIDGE_METHODS.includes(value);
1137
+ return typeof value === "string" && BRIDGE_METHODS.includes(value);
1423
1138
  }
1424
1139
  function isBridgeEventName(value) {
1425
- return typeof value === "string" && BRIDGE_EVENTS.includes(value);
1140
+ return typeof value === "string" && BRIDGE_EVENTS.includes(value);
1426
1141
  }
1427
1142
  function isBridgeRequest(value) {
1428
- if (!isRecord9(value)) {
1429
- return false;
1430
- }
1431
- return isValidProtocolVersion(value.protocolVersion) && value.kind === "request" && typeof value.id === "string" && isBridgeMethod(value.method) && "params" in value;
1143
+ if (!isRecord$7(value)) return false;
1144
+ return isValidProtocolVersion(value.protocolVersion) && value.kind === "request" && typeof value.id === "string" && isBridgeMethod(value.method) && "params" in value;
1432
1145
  }
1433
1146
  function isBridgeResponse(value) {
1434
- if (!isRecord9(value)) {
1435
- return false;
1436
- }
1437
- if (!isValidProtocolVersion(value.protocolVersion) || value.kind !== "response" || typeof value.id !== "string" || typeof value.ok !== "boolean") {
1438
- return false;
1439
- }
1440
- if (value.ok) {
1441
- return "result" in value;
1442
- }
1443
- return "error" in value;
1147
+ if (!isRecord$7(value)) return false;
1148
+ if (!isValidProtocolVersion(value.protocolVersion) || value.kind !== "response" || typeof value.id !== "string" || typeof value.ok !== "boolean") return false;
1149
+ if (value.ok) return "result" in value;
1150
+ return "error" in value;
1444
1151
  }
1445
1152
  function isBridgeEvent(value) {
1446
- if (!isRecord9(value)) {
1447
- return false;
1448
- }
1449
- return isValidProtocolVersion(value.protocolVersion) && value.kind === "event" && isBridgeEventName(value.event) && "params" in value;
1153
+ if (!isRecord$7(value)) return false;
1154
+ return isValidProtocolVersion(value.protocolVersion) && value.kind === "event" && isBridgeEventName(value.event) && "params" in value;
1450
1155
  }
1451
-
1452
- // src/cli.ts
1453
- var SERVICEME_CLI_SCHEMA_VERSION = 1;
1454
- function isRecord10(value) {
1455
- return typeof value === "object" && value !== null;
1156
+ //#endregion
1157
+ //#region src/cli.ts
1158
+ const SERVICEME_CLI_SCHEMA_VERSION = 1;
1159
+ function isRecord$6(value) {
1160
+ return typeof value === "object" && value !== null;
1456
1161
  }
1457
1162
  function createCliSuccess(data) {
1458
- return {
1459
- schemaVersion: SERVICEME_CLI_SCHEMA_VERSION,
1460
- ok: true,
1461
- data
1462
- };
1163
+ return {
1164
+ schemaVersion: 1,
1165
+ ok: true,
1166
+ data
1167
+ };
1463
1168
  }
1464
1169
  function createCliFailure(error) {
1465
- return {
1466
- schemaVersion: SERVICEME_CLI_SCHEMA_VERSION,
1467
- ok: false,
1468
- error
1469
- };
1170
+ return {
1171
+ schemaVersion: 1,
1172
+ ok: false,
1173
+ error
1174
+ };
1470
1175
  }
1471
1176
  function isCliEnvelope(value) {
1472
- if (!isRecord10(value)) {
1473
- return false;
1474
- }
1475
- if (value.schemaVersion !== SERVICEME_CLI_SCHEMA_VERSION || typeof value.ok !== "boolean") {
1476
- return false;
1477
- }
1478
- if (value.ok) {
1479
- return "data" in value;
1480
- }
1481
- return "error" in value;
1482
- }
1483
-
1484
- // src/copilot.ts
1485
- var COPILOT_ERROR_CODES = {
1486
- NOT_INSTALLED: "copilot_not_installed",
1487
- AUTH_REQUIRED: "copilot_auth_required",
1488
- EXECUTION_FAILED: "copilot_execution_failed",
1489
- TIMEOUT: "copilot_timeout"
1177
+ if (!isRecord$6(value)) return false;
1178
+ if (value.schemaVersion !== 1 || typeof value.ok !== "boolean") return false;
1179
+ if (value.ok) return "data" in value;
1180
+ return "error" in value;
1181
+ }
1182
+ //#endregion
1183
+ //#region src/copilot.ts
1184
+ const COPILOT_ERROR_CODES = {
1185
+ NOT_INSTALLED: "copilot_not_installed",
1186
+ AUTH_REQUIRED: "copilot_auth_required",
1187
+ EXECUTION_FAILED: "copilot_execution_failed",
1188
+ TIMEOUT: "copilot_timeout"
1490
1189
  };
1491
-
1492
- // src/env.ts
1493
- var KNOWN_ENVIRONMENT_TOOLS = [
1494
- "git",
1495
- "node",
1496
- "npm",
1497
- "pnpm",
1498
- "nvm",
1499
- "nrm",
1500
- "rtk",
1501
- "codegraph",
1502
- "ocx",
1503
- "dotnet",
1504
- "nuget"
1190
+ //#endregion
1191
+ //#region src/env.ts
1192
+ const KNOWN_ENVIRONMENT_TOOLS = [
1193
+ "git",
1194
+ "node",
1195
+ "npm",
1196
+ "pnpm",
1197
+ "nvm",
1198
+ "nrm",
1199
+ "rtk",
1200
+ "codegraph",
1201
+ "ocx",
1202
+ "dotnet",
1203
+ "nuget"
1505
1204
  ];
1506
- function isRecord11(value) {
1507
- return typeof value === "object" && value !== null;
1205
+ function isRecord$5(value) {
1206
+ return typeof value === "object" && value !== null;
1508
1207
  }
1509
1208
  function isKnownEnvironmentTool(value) {
1510
- return KNOWN_ENVIRONMENT_TOOLS.includes(value);
1209
+ return KNOWN_ENVIRONMENT_TOOLS.includes(value);
1511
1210
  }
1512
1211
  function isToolCheckResult(value) {
1513
- if (!isRecord11(value)) {
1514
- return false;
1515
- }
1516
- return typeof value.installed === "boolean" && (value.version === void 0 || typeof value.version === "string") && (value.path === void 0 || typeof value.path === "string") && (value.error === void 0 || typeof value.error === "string");
1212
+ if (!isRecord$5(value)) return false;
1213
+ return typeof value.installed === "boolean" && (value.version === void 0 || typeof value.version === "string") && (value.path === void 0 || typeof value.path === "string") && (value.error === void 0 || typeof value.error === "string");
1517
1214
  }
1518
1215
  function isEnvironmentCheckResult(value) {
1519
- if (!isRecord11(value)) {
1520
- return false;
1521
- }
1522
- return KNOWN_ENVIRONMENT_TOOLS.every((tool) => isToolCheckResult(value[tool]));
1523
- }
1524
-
1525
- // src/errors.ts
1526
- var SERVICEME_ERROR_CODES = [
1527
- "protocol_mismatch",
1528
- "cli_not_found",
1529
- "cli_start_failed",
1530
- "command_timeout",
1531
- "request_cancelled",
1532
- "invalid_params",
1533
- "opencode_not_installed",
1534
- "opencode_startup_timeout",
1535
- "opencode_request_failed",
1536
- "opencode_backend_not_running",
1537
- "opencode_session_not_found",
1538
- "copilot_not_installed",
1539
- "copilot_auth_required",
1540
- "copilot_execution_failed",
1541
- "copilot_timeout",
1542
- "json_invalid_input",
1543
- "env_tool_not_found",
1544
- "task_not_found",
1545
- "task_already_exists",
1546
- "invalid_schedule",
1547
- "invalid_payload",
1548
- "confirmation_required",
1549
- "workspace_not_found",
1550
- "daemon_not_running",
1551
- "executor_timeout",
1552
- "executor_error",
1553
- "task_already_running",
1554
- "not_found",
1555
- "internal_error",
1556
- "auth_not_logged_in",
1557
- "auth_provider_not_registered",
1558
- "device_not_enrolled",
1559
- "toolbox_invalid_scope"
1216
+ if (!isRecord$5(value)) return false;
1217
+ return KNOWN_ENVIRONMENT_TOOLS.every((tool) => isToolCheckResult(value[tool]));
1218
+ }
1219
+ //#endregion
1220
+ //#region src/errors.ts
1221
+ const SERVICEME_ERROR_CODES = [
1222
+ "protocol_mismatch",
1223
+ "cli_not_found",
1224
+ "cli_start_failed",
1225
+ "command_timeout",
1226
+ "request_cancelled",
1227
+ "invalid_params",
1228
+ "opencode_not_installed",
1229
+ "opencode_startup_timeout",
1230
+ "opencode_request_failed",
1231
+ "opencode_backend_not_running",
1232
+ "opencode_session_not_found",
1233
+ "copilot_not_installed",
1234
+ "copilot_auth_required",
1235
+ "copilot_execution_failed",
1236
+ "copilot_timeout",
1237
+ "json_invalid_input",
1238
+ "env_tool_not_found",
1239
+ "task_not_found",
1240
+ "task_already_exists",
1241
+ "invalid_schedule",
1242
+ "invalid_payload",
1243
+ "confirmation_required",
1244
+ "workspace_not_found",
1245
+ "daemon_not_running",
1246
+ "executor_timeout",
1247
+ "executor_error",
1248
+ "task_already_running",
1249
+ "not_found",
1250
+ "internal_error",
1251
+ "auth_not_logged_in",
1252
+ "auth_provider_not_registered",
1253
+ "device_not_enrolled",
1254
+ "toolbox_invalid_scope"
1560
1255
  ];
1561
- var RETRYABLE_ERROR_CODES = /* @__PURE__ */ new Set([
1562
- "command_timeout",
1563
- "request_cancelled",
1564
- "opencode_startup_timeout",
1565
- "opencode_request_failed",
1566
- "opencode_backend_not_running",
1567
- "copilot_timeout",
1568
- "executor_timeout",
1569
- "internal_error"
1256
+ const RETRYABLE_ERROR_CODES = /* @__PURE__ */ new Set([
1257
+ "command_timeout",
1258
+ "request_cancelled",
1259
+ "opencode_startup_timeout",
1260
+ "opencode_request_failed",
1261
+ "opencode_backend_not_running",
1262
+ "copilot_timeout",
1263
+ "executor_timeout",
1264
+ "internal_error"
1570
1265
  ]);
1571
- function isRecord12(value) {
1572
- return typeof value === "object" && value !== null;
1266
+ function isRecord$4(value) {
1267
+ return typeof value === "object" && value !== null;
1573
1268
  }
1574
1269
  function isServicemeErrorCode(value) {
1575
- return typeof value === "string" && SERVICEME_ERROR_CODES.includes(value);
1270
+ return typeof value === "string" && SERVICEME_ERROR_CODES.includes(value);
1576
1271
  }
1577
1272
  function isServicemeErrorDetails(value) {
1578
- if (!isRecord12(value)) {
1579
- return false;
1580
- }
1581
- return isServicemeErrorCode(value.code) && typeof value.message === "string" && typeof value.retryable === "boolean";
1273
+ if (!isRecord$4(value)) return false;
1274
+ return isServicemeErrorCode(value.code) && typeof value.message === "string" && typeof value.retryable === "boolean";
1582
1275
  }
1583
1276
  function isRetryableErrorCode(code) {
1584
- return RETRYABLE_ERROR_CODES.has(code);
1277
+ return RETRYABLE_ERROR_CODES.has(code);
1585
1278
  }
1586
1279
  var ServicemeProtocolError = class extends Error {
1587
- constructor(input) {
1588
- super(input.message);
1589
- this.name = "ServicemeProtocolError";
1590
- this.code = input.code;
1591
- this.retryable = input.retryable ?? isRetryableErrorCode(input.code);
1592
- this.details = input.details;
1593
- Object.setPrototypeOf(this, new.target.prototype);
1594
- }
1595
- toJSON() {
1596
- return {
1597
- code: this.code,
1598
- message: this.message,
1599
- retryable: this.retryable,
1600
- details: this.details
1601
- };
1602
- }
1280
+ constructor(input) {
1281
+ super(input.message);
1282
+ this.name = "ServicemeProtocolError";
1283
+ this.code = input.code;
1284
+ this.retryable = input.retryable ?? isRetryableErrorCode(input.code);
1285
+ this.details = input.details;
1286
+ Object.setPrototypeOf(this, new.target.prototype);
1287
+ }
1288
+ toJSON() {
1289
+ return {
1290
+ code: this.code,
1291
+ message: this.message,
1292
+ retryable: this.retryable,
1293
+ details: this.details
1294
+ };
1295
+ }
1603
1296
  };
1604
1297
  function createServicemeError(code, message, details) {
1605
- return new ServicemeProtocolError({
1606
- code,
1607
- message,
1608
- details
1609
- });
1298
+ return new ServicemeProtocolError({
1299
+ code,
1300
+ message,
1301
+ details
1302
+ });
1610
1303
  }
1611
1304
  function normalizeServicemeError(error, fallbackCode = "internal_error") {
1612
- if (error instanceof ServicemeProtocolError) {
1613
- return error.toJSON();
1614
- }
1615
- if (isServicemeErrorDetails(error)) {
1616
- return error;
1617
- }
1618
- if (isRecord12(error)) {
1619
- const code = isServicemeErrorCode(error.code) ? error.code : fallbackCode;
1620
- const message = typeof error.message === "string" ? error.message : "Unexpected serviceme error.";
1621
- const retryable = typeof error.retryable === "boolean" ? error.retryable : isRetryableErrorCode(code);
1622
- return {
1623
- code,
1624
- message,
1625
- retryable,
1626
- details: error.details
1627
- };
1628
- }
1629
- if (error instanceof Error) {
1630
- return {
1631
- code: fallbackCode,
1632
- message: error.message,
1633
- retryable: isRetryableErrorCode(fallbackCode)
1634
- };
1635
- }
1636
- return {
1637
- code: fallbackCode,
1638
- message: typeof error === "string" ? error : "Unexpected serviceme error.",
1639
- retryable: isRetryableErrorCode(fallbackCode)
1640
- };
1641
- }
1642
-
1643
- // src/image.ts
1644
- var SERVICEME_IMAGE_FORMATS = [
1645
- "jpeg",
1646
- "png",
1647
- "webp"
1305
+ if (error instanceof ServicemeProtocolError) return error.toJSON();
1306
+ if (isServicemeErrorDetails(error)) return error;
1307
+ if (isRecord$4(error)) {
1308
+ const code = isServicemeErrorCode(error.code) ? error.code : fallbackCode;
1309
+ return {
1310
+ code,
1311
+ message: typeof error.message === "string" ? error.message : "Unexpected serviceme error.",
1312
+ retryable: typeof error.retryable === "boolean" ? error.retryable : isRetryableErrorCode(code),
1313
+ details: error.details
1314
+ };
1315
+ }
1316
+ if (error instanceof Error) return {
1317
+ code: fallbackCode,
1318
+ message: error.message,
1319
+ retryable: isRetryableErrorCode(fallbackCode)
1320
+ };
1321
+ return {
1322
+ code: fallbackCode,
1323
+ message: typeof error === "string" ? error : "Unexpected serviceme error.",
1324
+ retryable: isRetryableErrorCode(fallbackCode)
1325
+ };
1326
+ }
1327
+ //#endregion
1328
+ //#region src/image.ts
1329
+ const SERVICEME_IMAGE_FORMATS = [
1330
+ "jpeg",
1331
+ "png",
1332
+ "webp"
1648
1333
  ];
1649
- function isRecord13(value) {
1650
- return typeof value === "object" && value !== null;
1334
+ function isRecord$3(value) {
1335
+ return typeof value === "object" && value !== null;
1651
1336
  }
1652
1337
  function isServiceMeImageFormat(value) {
1653
- return typeof value === "string" && SERVICEME_IMAGE_FORMATS.includes(value);
1338
+ return typeof value === "string" && SERVICEME_IMAGE_FORMATS.includes(value);
1654
1339
  }
1655
1340
  function isServiceMeImageCompressOptions(value) {
1656
- if (!isRecord13(value)) {
1657
- return false;
1658
- }
1659
- return typeof value.quality === "number" && typeof value.replaceOriginImage === "boolean" && (value.outputPath === void 0 || typeof value.outputPath === "string") && (value.format === void 0 || isServiceMeImageFormat(value.format)) && (value.sharpModulePath === void 0 || typeof value.sharpModulePath === "string") && (value.minimumCompressionRatio === void 0 || typeof value.minimumCompressionRatio === "number");
1341
+ if (!isRecord$3(value)) return false;
1342
+ return typeof value.quality === "number" && typeof value.replaceOriginImage === "boolean" && (value.outputPath === void 0 || typeof value.outputPath === "string") && (value.format === void 0 || isServiceMeImageFormat(value.format)) && (value.sharpModulePath === void 0 || typeof value.sharpModulePath === "string") && (value.minimumCompressionRatio === void 0 || typeof value.minimumCompressionRatio === "number");
1660
1343
  }
1661
1344
  function isServiceMeImageCompressResult(value) {
1662
- if (!isRecord13(value)) {
1663
- return false;
1664
- }
1665
- return typeof value.originalSize === "number" && typeof value.compressedSize === "number" && typeof value.compressionRatio === "number" && typeof value.outputPath === "string";
1345
+ if (!isRecord$3(value)) return false;
1346
+ return typeof value.originalSize === "number" && typeof value.compressedSize === "number" && typeof value.compressionRatio === "number" && typeof value.outputPath === "string";
1666
1347
  }
1667
1348
  function isServiceMeImageInfo(value) {
1668
- if (!isRecord13(value)) {
1669
- return false;
1670
- }
1671
- return typeof value.width === "number" && typeof value.height === "number" && typeof value.format === "string" && typeof value.size === "number" && (value.colorSpace === void 0 || typeof value.colorSpace === "string");
1349
+ if (!isRecord$3(value)) return false;
1350
+ return typeof value.width === "number" && typeof value.height === "number" && typeof value.format === "string" && typeof value.size === "number" && (value.colorSpace === void 0 || typeof value.colorSpace === "string");
1672
1351
  }
1673
1352
  function isServiceMeImageValidationResult(value) {
1674
- return isRecord13(value) && typeof value.valid === "boolean";
1675
- }
1676
-
1677
- // src/metadata.ts
1678
- var SERVICEME_CLI_NAME = "serviceme";
1679
- var SERVICEME_CLI_VERSION = "2.0.1";
1680
- var SERVICEME_CLI_CAPABILITIES = {
1681
- bridge: true,
1682
- tasks: 1,
1683
- json: 1,
1684
- env: 1,
1685
- image: 1,
1686
- project: 1
1353
+ return isRecord$3(value) && typeof value.valid === "boolean";
1354
+ }
1355
+ //#endregion
1356
+ //#region src/metadata.ts
1357
+ const SERVICEME_CLI_NAME = "serviceme";
1358
+ const SERVICEME_CLI_VERSION = "2.0.2";
1359
+ const SERVICEME_CLI_CAPABILITIES = {
1360
+ bridge: true,
1361
+ tasks: 1,
1362
+ json: 1,
1363
+ env: 1,
1364
+ image: 1,
1365
+ project: 1
1687
1366
  };
1688
-
1689
- // src/project.ts
1690
- function isRecord14(value) {
1691
- return typeof value === "object" && value !== null;
1367
+ //#endregion
1368
+ //#region src/project.ts
1369
+ function isRecord$2(value) {
1370
+ return typeof value === "object" && value !== null;
1692
1371
  }
1693
1372
  function isServiceMeProjectScaffoldPruneResult(value) {
1694
- if (!isRecord14(value)) {
1695
- return false;
1696
- }
1697
- return typeof value.applied === "boolean" && typeof value.preset === "string" && Array.isArray(value.commands) && value.commands.every((command) => typeof command === "string");
1373
+ if (!isRecord$2(value)) return false;
1374
+ return typeof value.applied === "boolean" && typeof value.preset === "string" && Array.isArray(value.commands) && value.commands.every((command) => typeof command === "string");
1698
1375
  }
1699
1376
  function isServiceMeProjectGitInitResult(value) {
1700
- return isRecord14(value) && typeof value.initialized === "boolean" && typeof value.command === "string";
1377
+ return isRecord$2(value) && typeof value.initialized === "boolean" && typeof value.command === "string";
1701
1378
  }
1702
1379
  function isServiceMeProjectMakeScriptsExecutableResult(value) {
1703
- if (!isRecord14(value)) {
1704
- return false;
1705
- }
1706
- return typeof value.processedCount === "number" && typeof value.updatedCount === "number" && typeof value.platform === "string" && Array.isArray(value.scripts) && value.scripts.every((script) => typeof script === "string");
1380
+ if (!isRecord$2(value)) return false;
1381
+ return typeof value.processedCount === "number" && typeof value.updatedCount === "number" && typeof value.platform === "string" && Array.isArray(value.scripts) && value.scripts.every((script) => typeof script === "string");
1707
1382
  }
1708
1383
  function isServiceMeProjectInstallDepsResult(value) {
1709
- return isRecord14(value) && typeof value.installed === "boolean" && typeof value.command === "string";
1384
+ return isRecord$2(value) && typeof value.installed === "boolean" && typeof value.command === "string";
1710
1385
  }
1711
1386
  function isServiceMeProjectExtractTemplateInput(value) {
1712
- return isRecord14(value) && typeof value.extractedDirName === "string" && typeof value.projectFilePattern === "string";
1387
+ return isRecord$2(value) && typeof value.extractedDirName === "string" && typeof value.projectFilePattern === "string";
1713
1388
  }
1714
1389
  function isServiceMeProjectExtractTemplateResult(value) {
1715
- return isRecord14(value) && typeof value.actualDirName === "string";
1716
- }
1717
-
1718
- // src/skill.ts
1719
- var VALID_SKILL_SCOPES = ["workspace", "user"];
1720
- var VALID_SKILL_SCOPE_STATUSES = [
1721
- "absent",
1722
- "available",
1723
- "installed",
1724
- "blocked",
1725
- "conflict"
1390
+ return isRecord$2(value) && typeof value.actualDirName === "string";
1391
+ }
1392
+ //#endregion
1393
+ //#region src/skill.ts
1394
+ const VALID_SKILL_SCOPES = ["workspace", "user"];
1395
+ const VALID_SKILL_SCOPE_STATUSES = [
1396
+ "absent",
1397
+ "available",
1398
+ "installed",
1399
+ "blocked",
1400
+ "conflict"
1726
1401
  ];
1727
- var VALID_SKILL_MUTATION_ACTIONS = [
1728
- "install",
1729
- "uninstall",
1730
- "move",
1731
- "removeExternal",
1732
- "publish",
1733
- "republish",
1734
- "submit-to-official"
1402
+ const VALID_SKILL_MUTATION_ACTIONS = [
1403
+ "install",
1404
+ "uninstall",
1405
+ "move",
1406
+ "removeExternal",
1407
+ "publish",
1408
+ "republish",
1409
+ "submit-to-official"
1735
1410
  ];
1736
- function isRecord15(value) {
1737
- return typeof value === "object" && value !== null;
1411
+ function isRecord$1(value) {
1412
+ return typeof value === "object" && value !== null;
1738
1413
  }
1739
1414
  function isSkillScope(value) {
1740
- return typeof value === "string" && VALID_SKILL_SCOPES.includes(value);
1415
+ return typeof value === "string" && VALID_SKILL_SCOPES.includes(value);
1741
1416
  }
1742
1417
  function isSkillScopeStatus(value) {
1743
- return typeof value === "string" && VALID_SKILL_SCOPE_STATUSES.includes(value);
1418
+ return typeof value === "string" && VALID_SKILL_SCOPE_STATUSES.includes(value);
1744
1419
  }
1745
1420
  function isSkillMutationAction(value) {
1746
- return typeof value === "string" && VALID_SKILL_MUTATION_ACTIONS.includes(value);
1747
- }
1748
- function isStringArray3(value) {
1749
- return Array.isArray(value) && value.every((item) => typeof item === "string");
1750
- }
1751
- function isSafeResourceId2(value) {
1752
- if (typeof value !== "string" || value.length === 0 || value.includes("\\")) {
1753
- return false;
1754
- }
1755
- const segments = value.split("/");
1756
- if (segments.some((segment) => segment.length === 0)) {
1757
- return false;
1758
- }
1759
- return segments.every(
1760
- (segment) => segment !== "." && segment !== ".." && /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(segment)
1761
- );
1421
+ return typeof value === "string" && VALID_SKILL_MUTATION_ACTIONS.includes(value);
1422
+ }
1423
+ function isStringArray(value) {
1424
+ return Array.isArray(value) && value.every((item) => typeof item === "string");
1425
+ }
1426
+ function isSafeResourceId(value) {
1427
+ if (typeof value !== "string" || value.length === 0 || value.includes("\\")) return false;
1428
+ const segments = value.split("/");
1429
+ if (segments.some((segment) => segment.length === 0)) return false;
1430
+ return segments.every((segment) => segment !== "." && segment !== ".." && /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(segment));
1762
1431
  }
1763
1432
  function isSkillScopeState(value) {
1764
- if (!isRecord15(value)) {
1765
- return false;
1766
- }
1767
- return isSkillScope(value.scope) && isSkillScopeStatus(value.status) && (value.kind === void 0 || value.kind === "builtin" || value.kind === "external") && (value.path === void 0 || typeof value.path === "string") && typeof value.isInstalled === "boolean" && typeof value.canInstall === "boolean" && typeof value.canUninstall === "boolean" && typeof value.canRemove === "boolean" && typeof value.canMoveHere === "boolean" && (value.summary === void 0 || typeof value.summary === "string");
1433
+ if (!isRecord$1(value)) return false;
1434
+ return isSkillScope(value.scope) && isSkillScopeStatus(value.status) && (value.kind === void 0 || value.kind === "builtin" || value.kind === "external") && (value.path === void 0 || typeof value.path === "string") && typeof value.isInstalled === "boolean" && typeof value.canInstall === "boolean" && typeof value.canUninstall === "boolean" && typeof value.canRemove === "boolean" && typeof value.canMoveHere === "boolean" && (value.summary === void 0 || typeof value.summary === "string");
1768
1435
  }
1769
1436
  function isSkillMarketplaceEntry(value) {
1770
- if (!isRecord15(value)) {
1771
- return false;
1772
- }
1773
- return typeof value.id === "string" && typeof value.displayName === "string" && typeof value.description === "string" && typeof value.version === "string" && typeof value.updatedAt === "string" && (value.categoryId === void 0 || typeof value.categoryId === "string") && (value.enabled === void 0 || typeof value.enabled === "boolean") && typeof value.isCatalogSkill === "boolean" && typeof value.recommended === "boolean" && typeof value.installCount === "number" && (value.requiresSetup === void 0 || typeof value.requiresSetup === "boolean") && (value.setupHint === void 0 || typeof value.setupHint === "string") && (value.homepage === void 0 || typeof value.homepage === "string") && (value.ownerScope === void 0 || isSkillScope(value.ownerScope)) && (value.ownerKind === void 0 || value.ownerKind === "builtin" || value.ownerKind === "external") && typeof value.hasConflict === "boolean" && (value.hasScripts === void 0 || typeof value.hasScripts === "boolean") && (value.hasHooks === void 0 || typeof value.hasHooks === "boolean") && (value.source === void 0 || value.source === "official" || value.source === "community" || value.source === "local") && (value.localSkillPath === void 0 || typeof value.localSkillPath === "string") && (value.canPublish === void 0 || typeof value.canPublish === "boolean") && isSkillScopeState(value.workspaceState) && isSkillScopeState(value.userState);
1437
+ if (!isRecord$1(value)) return false;
1438
+ return typeof value.id === "string" && typeof value.displayName === "string" && typeof value.description === "string" && typeof value.version === "string" && typeof value.updatedAt === "string" && (value.categoryId === void 0 || typeof value.categoryId === "string") && (value.enabled === void 0 || typeof value.enabled === "boolean") && typeof value.isCatalogSkill === "boolean" && typeof value.recommended === "boolean" && typeof value.installCount === "number" && (value.requiresSetup === void 0 || typeof value.requiresSetup === "boolean") && (value.setupHint === void 0 || typeof value.setupHint === "string") && (value.homepage === void 0 || typeof value.homepage === "string") && (value.ownerScope === void 0 || isSkillScope(value.ownerScope)) && (value.ownerKind === void 0 || value.ownerKind === "builtin" || value.ownerKind === "external") && typeof value.hasConflict === "boolean" && (value.hasScripts === void 0 || typeof value.hasScripts === "boolean") && (value.hasHooks === void 0 || typeof value.hasHooks === "boolean") && (value.source === void 0 || value.source === "official" || value.source === "community" || value.source === "local") && (value.localSkillPath === void 0 || typeof value.localSkillPath === "string") && (value.canPublish === void 0 || typeof value.canPublish === "boolean") && isSkillScopeState(value.workspaceState) && isSkillScopeState(value.userState);
1774
1439
  }
1775
1440
  function isSkillMarketplaceState(value) {
1776
- if (!isRecord15(value)) {
1777
- return false;
1778
- }
1779
- return typeof value.configPath === "string" && typeof value.userSkillsPath === "string" && Array.isArray(value.skills) && value.skills.every((entry) => isSkillMarketplaceEntry(entry)) && (value.enabledSkillIds === void 0 || isStringArray3(value.enabledSkillIds)) && (value.recommendedSkillIds === void 0 || isStringArray3(value.recommendedSkillIds)) && typeof value.onboardingRequired === "boolean" && typeof value.hasPersistedSelection === "boolean" && (value.workspaceOpen === void 0 || typeof value.workspaceOpen === "boolean");
1441
+ if (!isRecord$1(value)) return false;
1442
+ return typeof value.configPath === "string" && typeof value.userSkillsPath === "string" && Array.isArray(value.skills) && value.skills.every((entry) => isSkillMarketplaceEntry(entry)) && (value.enabledSkillIds === void 0 || isStringArray(value.enabledSkillIds)) && (value.recommendedSkillIds === void 0 || isStringArray(value.recommendedSkillIds)) && typeof value.onboardingRequired === "boolean" && typeof value.hasPersistedSelection === "boolean" && (value.workspaceOpen === void 0 || typeof value.workspaceOpen === "boolean");
1780
1443
  }
1781
1444
  function isSkillMutationRequest(value) {
1782
- return isRecord15(value) && isSafeResourceId2(value.skillId) && isSkillScope(value.targetScope) && isSkillMutationAction(value.action) && (value.confirmed === void 0 || typeof value.confirmed === "boolean");
1445
+ return isRecord$1(value) && isSafeResourceId(value.skillId) && isSkillScope(value.targetScope) && isSkillMutationAction(value.action) && (value.confirmed === void 0 || typeof value.confirmed === "boolean");
1783
1446
  }
1784
1447
  function isSkillMutationResult(value) {
1785
- return isRecord15(value) && isSkillMarketplaceState(value.state) && typeof value.skillId === "string" && isSkillScope(value.targetScope) && isSkillMutationAction(value.action) && typeof value.changed === "boolean" && (value.status === "success" || value.status === "blocked" || value.status === "requires_confirmation") && (value.message === void 0 || typeof value.message === "string") && (value.hasScripts === void 0 || typeof value.hasScripts === "boolean") && (value.hasHooks === void 0 || typeof value.hasHooks === "boolean") && (value.prUrl === void 0 || typeof value.prUrl === "string") && (value.fromVersion === void 0 || typeof value.fromVersion === "string") && (value.toVersion === void 0 || typeof value.toVersion === "string");
1448
+ return isRecord$1(value) && isSkillMarketplaceState(value.state) && typeof value.skillId === "string" && isSkillScope(value.targetScope) && isSkillMutationAction(value.action) && typeof value.changed === "boolean" && (value.status === "success" || value.status === "blocked" || value.status === "requires_confirmation") && (value.message === void 0 || typeof value.message === "string") && (value.hasScripts === void 0 || typeof value.hasScripts === "boolean") && (value.hasHooks === void 0 || typeof value.hasHooks === "boolean") && (value.prUrl === void 0 || typeof value.prUrl === "string") && (value.fromVersion === void 0 || typeof value.fromVersion === "string") && (value.toVersion === void 0 || typeof value.toVersion === "string");
1786
1449
  }
1787
1450
  function isSkillReconcileResult(value) {
1788
- return isRecord15(value) && isSkillMarketplaceState(value.state) && typeof value.changed === "boolean";
1451
+ return isRecord$1(value) && isSkillMarketplaceState(value.state) && typeof value.changed === "boolean";
1789
1452
  }
1790
1453
  function isPublishableSkillEntry(value) {
1791
- return isRecord15(value) && typeof value.id === "string" && typeof value.displayName === "string" && typeof value.path === "string" && (value.version === void 0 || typeof value.version === "string");
1454
+ return isRecord$1(value) && typeof value.id === "string" && typeof value.displayName === "string" && typeof value.path === "string" && (value.version === void 0 || typeof value.version === "string");
1792
1455
  }
1793
1456
  function isSkillPublishableResult(value) {
1794
- return isRecord15(value) && Array.isArray(value.skills) && value.skills.every((entry) => isPublishableSkillEntry(entry));
1795
- }
1796
- // Annotate the CommonJS export names for ESM import in node:
1797
- 0 && (module.exports = {
1798
- AUTH_PROVIDERS,
1799
- BRIDGE_EVENTS,
1800
- BRIDGE_METHODS,
1801
- COPILOT_CONTENT_METHOD_ALIASES,
1802
- COPILOT_ERROR_CODES,
1803
- DEFAULT_JSON_SORT_OPTIONS,
1804
- DEVICE_BINDING_STATES,
1805
- JSON_SORT_ALGORITHMS,
1806
- JSON_SORT_ORDERS,
1807
- KNOWN_ENVIRONMENT_TOOLS,
1808
- SERVICEME_CLI_CAPABILITIES,
1809
- SERVICEME_CLI_NAME,
1810
- SERVICEME_CLI_SCHEMA_VERSION,
1811
- SERVICEME_CLI_VERSION,
1812
- SERVICEME_ERROR_CODES,
1813
- SERVICEME_IMAGE_FORMATS,
1814
- SERVICEME_PROTOCOL_VERSION,
1815
- ServicemeProtocolError,
1816
- TOOLBOX_SCOPES,
1817
- createCliFailure,
1818
- createCliSuccess,
1819
- createServicemeError,
1820
- getBridgeEventParamsValidator,
1821
- getBridgeResultValidator,
1822
- isAgentMarketplaceState,
1823
- isAgentMutationRequest,
1824
- isAgentMutationResult,
1825
- isAgentPermissionSummary,
1826
- isAgentPermissionsResult,
1827
- isAgentSessionStatus,
1828
- isAuthAccountMeta,
1829
- isAuthLoginParams,
1830
- isAuthLoginResult,
1831
- isAuthLogoutParams,
1832
- isAuthLogoutResult,
1833
- isAuthProvider,
1834
- isAuthSessionHandle,
1835
- isAuthStatus,
1836
- isAuthSwitchParams,
1837
- isAuthSwitchResult,
1838
- isAuthWhoamiResult,
1839
- isBridgeCapabilities,
1840
- isBridgeEvent,
1841
- isBridgeEventName,
1842
- isBridgeMethod,
1843
- isBridgeRequest,
1844
- isBridgeResponse,
1845
- isCliEnvelope,
1846
- isCopilotContentAdoptUnmanagedParams,
1847
- isCopilotContentAdoptUnmanagedResult,
1848
- isCopilotContentApproveResult,
1849
- isCopilotContentDetectUnmanagedParams,
1850
- isCopilotContentDetectUnmanagedResult,
1851
- isCopilotContentIntegrationStatusResult,
1852
- isCopilotContentMigrateLegacyResult,
1853
- isCopilotContentRestoreResult,
1854
- isCopilotContentStatusResult,
1855
- isCopilotCustomizationViewPayload,
1856
- isCopilotCustomizationsListParams,
1857
- isCopilotCustomizationsListResult,
1858
- isCopilotLegacyMigrateParams,
1859
- isCopilotLegacyMigrateResult,
1860
- isCopilotLegacyPreviewParams,
1861
- isCopilotLegacyPreviewResult,
1862
- isCopilotPackageInstallParams,
1863
- isCopilotPackageInstallResult,
1864
- isCopilotPackageMoveParams,
1865
- isCopilotPackageMoveResult,
1866
- isCopilotPackageUninstallParams,
1867
- isCopilotPackageUninstallResult,
1868
- isCopilotPackageUpdateParams,
1869
- isCopilotPackageUpdateResult,
1870
- isCopilotPluginListParams,
1871
- isCopilotPluginListResult,
1872
- isCopilotPluginRegisterParams,
1873
- isCopilotPluginRegisterResult,
1874
- isCopilotPluginUnregisterParams,
1875
- isCopilotPluginUnregisterResult,
1876
- isCopilotSourceListParams,
1877
- isCopilotSourceListResult,
1878
- isCopilotSourceRemoveParams,
1879
- isCopilotSourceRemoveResult,
1880
- isCopilotUpdatePreviewParams,
1881
- isCopilotUpdatePreviewResult,
1882
- isDeviceBindingState,
1883
- isDeviceEnrollParams,
1884
- isDeviceEnrollResult,
1885
- isDeviceIdentityState,
1886
- isDeviceMetadata,
1887
- isDeviceRotateSecretParams,
1888
- isDeviceRotateSecretResult,
1889
- isDeviceStatus,
1890
- isEnvironmentCheckResult,
1891
- isExternalTool,
1892
- isExternalToolPatch,
1893
- isJsonOutputResult,
1894
- isJsonSortAlgorithm,
1895
- isJsonSortOptions,
1896
- isJsonSortOrder,
1897
- isJsonValidationResult,
1898
- isKnownEnvironmentTool,
1899
- isRecord,
1900
- isRepoAddParams,
1901
- isRepoAddResult,
1902
- isRepoDisableParams,
1903
- isRepoDisableResult,
1904
- isRepoEnableParams,
1905
- isRepoEnableResult,
1906
- isRepoListParams,
1907
- isRepoListResult,
1908
- isRepoRemoveParams,
1909
- isRepoRemoveResult,
1910
- isRepoSyncAllParams,
1911
- isRepoSyncAllResult,
1912
- isRepoSyncParams,
1913
- isRepoSyncResult,
1914
- isRepoUpdateResult,
1915
- isRetryableErrorCode,
1916
- isScheduledTask,
1917
- isScheduledTaskType,
1918
- isScheduledTaskV1,
1919
- isScheduledTasksConfig,
1920
- isScheduledTasksConfigV1,
1921
- isSchedulerStatus,
1922
- isServiceMeImageCompressOptions,
1923
- isServiceMeImageCompressResult,
1924
- isServiceMeImageFormat,
1925
- isServiceMeImageInfo,
1926
- isServiceMeImageValidationResult,
1927
- isServiceMeProjectExtractTemplateInput,
1928
- isServiceMeProjectExtractTemplateResult,
1929
- isServiceMeProjectGitInitResult,
1930
- isServiceMeProjectInstallDepsResult,
1931
- isServiceMeProjectMakeScriptsExecutableResult,
1932
- isServiceMeProjectScaffoldPruneResult,
1933
- isServicemeErrorCode,
1934
- isServicemeErrorDetails,
1935
- isSkillMarketplaceState,
1936
- isSkillMutationRequest,
1937
- isSkillMutationResult,
1938
- isSkillPublishableResult,
1939
- isSkillReconcileResult,
1940
- isSkillRepoConvertToSymlinkParams,
1941
- isSkillRepoConvertToSymlinkResult,
1942
- isSkillRepoDraftCommitResult,
1943
- isSkillRepoDraftCreateResult,
1944
- isSkillRepoDraftDeleteResult,
1945
- isSkillRepoDraftListResult,
1946
- isSkillRepoGetParams,
1947
- isSkillRepoGetResult,
1948
- isSkillRepoInstallParams,
1949
- isSkillRepoInstallResult,
1950
- isSkillRepoListLinkedParams,
1951
- isSkillRepoListLinkedResult,
1952
- isSkillRepoListParams,
1953
- isSkillRepoListResult,
1954
- isSkillRepoSetEntryEnabledParams,
1955
- isSkillRepoSetEntryEnabledResult,
1956
- isSkillRepoUninstallParams,
1957
- isSkillRepoUninstallResult,
1958
- isSystemHelloResult,
1959
- isSystemPingResult,
1960
- isSystemShutdownResult,
1961
- isTaskCancelResult,
1962
- isTaskCancelledEventParams,
1963
- isTaskCompletedEventParams,
1964
- isTaskExecuteResult,
1965
- isTaskExecutionLog,
1966
- isTaskFailedEventParams,
1967
- isTaskListRunningResult,
1968
- isTaskOutputEventParams,
1969
- isTaskStartedEventParams,
1970
- isTaskWorkspaceRef,
1971
- isToolCheckResult,
1972
- isToolboxAddParams,
1973
- isToolboxAddResult,
1974
- isToolboxList,
1975
- isToolboxListParams,
1976
- isToolboxRemoveParams,
1977
- isToolboxRemoveResult,
1978
- isToolboxScope,
1979
- isToolboxUpdateParams,
1980
- isToolboxUpdateResult,
1981
- migrateTaskV1ToV2,
1982
- migrateV1ToV2,
1983
- normalizeBridgeMethod,
1984
- normalizeServicemeError
1985
- });
1457
+ return isRecord$1(value) && Array.isArray(value.skills) && value.skills.every((entry) => isPublishableSkillEntry(entry));
1458
+ }
1459
+ //#endregion
1460
+ exports.AUTH_PROVIDERS = AUTH_PROVIDERS;
1461
+ exports.BRIDGE_EVENTS = BRIDGE_EVENTS;
1462
+ exports.BRIDGE_METHODS = BRIDGE_METHODS;
1463
+ exports.COPILOT_CONTENT_METHOD_ALIASES = COPILOT_CONTENT_METHOD_ALIASES;
1464
+ exports.COPILOT_ERROR_CODES = COPILOT_ERROR_CODES;
1465
+ exports.DEFAULT_JSON_SORT_OPTIONS = DEFAULT_JSON_SORT_OPTIONS;
1466
+ exports.DEVICE_BINDING_STATES = DEVICE_BINDING_STATES;
1467
+ exports.JSON_SORT_ALGORITHMS = JSON_SORT_ALGORITHMS;
1468
+ exports.JSON_SORT_ORDERS = JSON_SORT_ORDERS;
1469
+ exports.KNOWN_ENVIRONMENT_TOOLS = KNOWN_ENVIRONMENT_TOOLS;
1470
+ exports.SERVICEME_CLI_CAPABILITIES = SERVICEME_CLI_CAPABILITIES;
1471
+ exports.SERVICEME_CLI_NAME = SERVICEME_CLI_NAME;
1472
+ exports.SERVICEME_CLI_SCHEMA_VERSION = SERVICEME_CLI_SCHEMA_VERSION;
1473
+ exports.SERVICEME_CLI_VERSION = SERVICEME_CLI_VERSION;
1474
+ exports.SERVICEME_ERROR_CODES = SERVICEME_ERROR_CODES;
1475
+ exports.SERVICEME_IMAGE_FORMATS = SERVICEME_IMAGE_FORMATS;
1476
+ exports.SERVICEME_PROTOCOL_VERSION = SERVICEME_PROTOCOL_VERSION;
1477
+ exports.ServicemeProtocolError = ServicemeProtocolError;
1478
+ exports.TOOLBOX_SCOPES = TOOLBOX_SCOPES;
1479
+ exports.createCliFailure = createCliFailure;
1480
+ exports.createCliSuccess = createCliSuccess;
1481
+ exports.createServicemeError = createServicemeError;
1482
+ exports.getBridgeEventParamsValidator = getBridgeEventParamsValidator;
1483
+ exports.getBridgeResultValidator = getBridgeResultValidator;
1484
+ exports.isAgentMarketplaceState = isAgentMarketplaceState;
1485
+ exports.isAgentMutationRequest = isAgentMutationRequest;
1486
+ exports.isAgentMutationResult = isAgentMutationResult;
1487
+ exports.isAgentPermissionSummary = isAgentPermissionSummary;
1488
+ exports.isAgentPermissionsResult = isAgentPermissionsResult;
1489
+ exports.isAgentSessionStatus = isAgentSessionStatus;
1490
+ exports.isAuthAccountMeta = isAuthAccountMeta;
1491
+ exports.isAuthLoginParams = isAuthLoginParams;
1492
+ exports.isAuthLoginResult = isAuthLoginResult;
1493
+ exports.isAuthLogoutParams = isAuthLogoutParams;
1494
+ exports.isAuthLogoutResult = isAuthLogoutResult;
1495
+ exports.isAuthProvider = isAuthProvider;
1496
+ exports.isAuthSessionHandle = isAuthSessionHandle;
1497
+ exports.isAuthStatus = isAuthStatus;
1498
+ exports.isAuthSwitchParams = isAuthSwitchParams;
1499
+ exports.isAuthSwitchResult = isAuthSwitchResult;
1500
+ exports.isAuthWhoamiResult = isAuthWhoamiResult;
1501
+ exports.isBridgeCapabilities = isBridgeCapabilities;
1502
+ exports.isBridgeEvent = isBridgeEvent;
1503
+ exports.isBridgeEventName = isBridgeEventName;
1504
+ exports.isBridgeMethod = isBridgeMethod;
1505
+ exports.isBridgeRequest = isBridgeRequest;
1506
+ exports.isBridgeResponse = isBridgeResponse;
1507
+ exports.isCliEnvelope = isCliEnvelope;
1508
+ exports.isCopilotContentAdoptUnmanagedParams = isCopilotContentAdoptUnmanagedParams;
1509
+ exports.isCopilotContentAdoptUnmanagedResult = isCopilotContentAdoptUnmanagedResult;
1510
+ exports.isCopilotContentApproveResult = isCopilotContentApproveResult;
1511
+ exports.isCopilotContentDetectUnmanagedParams = isCopilotContentDetectUnmanagedParams;
1512
+ exports.isCopilotContentDetectUnmanagedResult = isCopilotContentDetectUnmanagedResult;
1513
+ exports.isCopilotContentIntegrationStatusResult = isCopilotContentIntegrationStatusResult;
1514
+ exports.isCopilotContentMigrateLegacyResult = isCopilotContentMigrateLegacyResult;
1515
+ exports.isCopilotContentRestoreResult = isCopilotContentRestoreResult;
1516
+ exports.isCopilotContentStatusResult = isCopilotContentStatusResult;
1517
+ exports.isCopilotCustomizationViewPayload = isCopilotCustomizationViewPayload;
1518
+ exports.isCopilotCustomizationsListParams = isCopilotCustomizationsListParams;
1519
+ exports.isCopilotCustomizationsListResult = isCopilotCustomizationsListResult;
1520
+ exports.isCopilotLegacyMigrateParams = isCopilotLegacyMigrateParams;
1521
+ exports.isCopilotLegacyMigrateResult = isCopilotLegacyMigrateResult;
1522
+ exports.isCopilotLegacyPreviewParams = isCopilotLegacyPreviewParams;
1523
+ exports.isCopilotLegacyPreviewResult = isCopilotLegacyPreviewResult;
1524
+ exports.isCopilotPackageInstallParams = isCopilotPackageInstallParams;
1525
+ exports.isCopilotPackageInstallResult = isCopilotPackageInstallResult;
1526
+ exports.isCopilotPackageMoveParams = isCopilotPackageMoveParams;
1527
+ exports.isCopilotPackageMoveResult = isCopilotPackageMoveResult;
1528
+ exports.isCopilotPackageUninstallParams = isCopilotPackageUninstallParams;
1529
+ exports.isCopilotPackageUninstallResult = isCopilotPackageUninstallResult;
1530
+ exports.isCopilotPackageUpdateParams = isCopilotPackageUpdateParams;
1531
+ exports.isCopilotPackageUpdateResult = isCopilotPackageUpdateResult;
1532
+ exports.isCopilotPluginListParams = isCopilotPluginListParams;
1533
+ exports.isCopilotPluginListResult = isCopilotPluginListResult;
1534
+ exports.isCopilotPluginRegisterParams = isCopilotPluginRegisterParams;
1535
+ exports.isCopilotPluginRegisterResult = isCopilotPluginRegisterResult;
1536
+ exports.isCopilotPluginUnregisterParams = isCopilotPluginUnregisterParams;
1537
+ exports.isCopilotPluginUnregisterResult = isCopilotPluginUnregisterResult;
1538
+ exports.isCopilotSourceListParams = isCopilotSourceListParams;
1539
+ exports.isCopilotSourceListResult = isCopilotSourceListResult;
1540
+ exports.isCopilotSourceRemoveParams = isCopilotSourceRemoveParams;
1541
+ exports.isCopilotSourceRemoveResult = isCopilotSourceRemoveResult;
1542
+ exports.isCopilotUpdatePreviewParams = isCopilotUpdatePreviewParams;
1543
+ exports.isCopilotUpdatePreviewResult = isCopilotUpdatePreviewResult;
1544
+ exports.isDeviceBindingState = isDeviceBindingState;
1545
+ exports.isDeviceEnrollParams = isDeviceEnrollParams;
1546
+ exports.isDeviceEnrollResult = isDeviceEnrollResult;
1547
+ exports.isDeviceIdentityState = isDeviceIdentityState;
1548
+ exports.isDeviceMetadata = isDeviceMetadata;
1549
+ exports.isDeviceRotateSecretParams = isDeviceRotateSecretParams;
1550
+ exports.isDeviceRotateSecretResult = isDeviceRotateSecretResult;
1551
+ exports.isDeviceStatus = isDeviceStatus;
1552
+ exports.isEnvironmentCheckResult = isEnvironmentCheckResult;
1553
+ exports.isExternalTool = isExternalTool;
1554
+ exports.isExternalToolPatch = isExternalToolPatch;
1555
+ exports.isJsonOutputResult = isJsonOutputResult;
1556
+ exports.isJsonSortAlgorithm = isJsonSortAlgorithm;
1557
+ exports.isJsonSortOptions = isJsonSortOptions;
1558
+ exports.isJsonSortOrder = isJsonSortOrder;
1559
+ exports.isJsonValidationResult = isJsonValidationResult;
1560
+ exports.isKnownEnvironmentTool = isKnownEnvironmentTool;
1561
+ exports.isRecord = isRecord;
1562
+ exports.isRepoAddParams = isRepoAddParams;
1563
+ exports.isRepoAddResult = isRepoAddResult;
1564
+ exports.isRepoDisableParams = isRepoDisableParams;
1565
+ exports.isRepoDisableResult = isRepoDisableResult;
1566
+ exports.isRepoEnableParams = isRepoEnableParams;
1567
+ exports.isRepoEnableResult = isRepoEnableResult;
1568
+ exports.isRepoListParams = isRepoListParams;
1569
+ exports.isRepoListResult = isRepoListResult;
1570
+ exports.isRepoRemoveParams = isRepoRemoveParams;
1571
+ exports.isRepoRemoveResult = isRepoRemoveResult;
1572
+ exports.isRepoSyncAllParams = isRepoSyncAllParams;
1573
+ exports.isRepoSyncAllResult = isRepoSyncAllResult;
1574
+ exports.isRepoSyncParams = isRepoSyncParams;
1575
+ exports.isRepoSyncResult = isRepoSyncResult;
1576
+ exports.isRepoUpdateResult = isRepoUpdateResult;
1577
+ exports.isRetryableErrorCode = isRetryableErrorCode;
1578
+ exports.isScheduledTask = isScheduledTask;
1579
+ exports.isScheduledTaskType = isScheduledTaskType;
1580
+ exports.isScheduledTaskV1 = isScheduledTaskV1;
1581
+ exports.isScheduledTasksConfig = isScheduledTasksConfig;
1582
+ exports.isScheduledTasksConfigV1 = isScheduledTasksConfigV1;
1583
+ exports.isSchedulerStatus = isSchedulerStatus;
1584
+ exports.isServiceMeImageCompressOptions = isServiceMeImageCompressOptions;
1585
+ exports.isServiceMeImageCompressResult = isServiceMeImageCompressResult;
1586
+ exports.isServiceMeImageFormat = isServiceMeImageFormat;
1587
+ exports.isServiceMeImageInfo = isServiceMeImageInfo;
1588
+ exports.isServiceMeImageValidationResult = isServiceMeImageValidationResult;
1589
+ exports.isServiceMeProjectExtractTemplateInput = isServiceMeProjectExtractTemplateInput;
1590
+ exports.isServiceMeProjectExtractTemplateResult = isServiceMeProjectExtractTemplateResult;
1591
+ exports.isServiceMeProjectGitInitResult = isServiceMeProjectGitInitResult;
1592
+ exports.isServiceMeProjectInstallDepsResult = isServiceMeProjectInstallDepsResult;
1593
+ exports.isServiceMeProjectMakeScriptsExecutableResult = isServiceMeProjectMakeScriptsExecutableResult;
1594
+ exports.isServiceMeProjectScaffoldPruneResult = isServiceMeProjectScaffoldPruneResult;
1595
+ exports.isServicemeErrorCode = isServicemeErrorCode;
1596
+ exports.isServicemeErrorDetails = isServicemeErrorDetails;
1597
+ exports.isSkillMarketplaceState = isSkillMarketplaceState;
1598
+ exports.isSkillMutationRequest = isSkillMutationRequest;
1599
+ exports.isSkillMutationResult = isSkillMutationResult;
1600
+ exports.isSkillPublishableResult = isSkillPublishableResult;
1601
+ exports.isSkillReconcileResult = isSkillReconcileResult;
1602
+ exports.isSkillRepoConvertToSymlinkParams = isSkillRepoConvertToSymlinkParams;
1603
+ exports.isSkillRepoConvertToSymlinkResult = isSkillRepoConvertToSymlinkResult;
1604
+ exports.isSkillRepoDraftCommitResult = isSkillRepoDraftCommitResult;
1605
+ exports.isSkillRepoDraftCreateResult = isSkillRepoDraftCreateResult;
1606
+ exports.isSkillRepoDraftDeleteResult = isSkillRepoDraftDeleteResult;
1607
+ exports.isSkillRepoDraftListResult = isSkillRepoDraftListResult;
1608
+ exports.isSkillRepoGetParams = isSkillRepoGetParams;
1609
+ exports.isSkillRepoGetResult = isSkillRepoGetResult;
1610
+ exports.isSkillRepoInstallParams = isSkillRepoInstallParams;
1611
+ exports.isSkillRepoInstallResult = isSkillRepoInstallResult;
1612
+ exports.isSkillRepoListLinkedParams = isSkillRepoListLinkedParams;
1613
+ exports.isSkillRepoListLinkedResult = isSkillRepoListLinkedResult;
1614
+ exports.isSkillRepoListParams = isSkillRepoListParams;
1615
+ exports.isSkillRepoListResult = isSkillRepoListResult;
1616
+ exports.isSkillRepoSetEntryEnabledParams = isSkillRepoSetEntryEnabledParams;
1617
+ exports.isSkillRepoSetEntryEnabledResult = isSkillRepoSetEntryEnabledResult;
1618
+ exports.isSkillRepoUninstallParams = isSkillRepoUninstallParams;
1619
+ exports.isSkillRepoUninstallResult = isSkillRepoUninstallResult;
1620
+ exports.isSystemHelloResult = isSystemHelloResult;
1621
+ exports.isSystemPingResult = isSystemPingResult;
1622
+ exports.isSystemShutdownResult = isSystemShutdownResult;
1623
+ exports.isTaskCancelResult = isTaskCancelResult;
1624
+ exports.isTaskCancelledEventParams = isTaskCancelledEventParams;
1625
+ exports.isTaskCompletedEventParams = isTaskCompletedEventParams;
1626
+ exports.isTaskExecuteResult = isTaskExecuteResult;
1627
+ exports.isTaskExecutionLog = isTaskExecutionLog;
1628
+ exports.isTaskFailedEventParams = isTaskFailedEventParams;
1629
+ exports.isTaskListRunningResult = isTaskListRunningResult;
1630
+ exports.isTaskOutputEventParams = isTaskOutputEventParams;
1631
+ exports.isTaskStartedEventParams = isTaskStartedEventParams;
1632
+ exports.isTaskWorkspaceRef = isTaskWorkspaceRef;
1633
+ exports.isToolCheckResult = isToolCheckResult;
1634
+ exports.isToolboxAddParams = isToolboxAddParams;
1635
+ exports.isToolboxAddResult = isToolboxAddResult;
1636
+ exports.isToolboxList = isToolboxList;
1637
+ exports.isToolboxListParams = isToolboxListParams;
1638
+ exports.isToolboxRemoveParams = isToolboxRemoveParams;
1639
+ exports.isToolboxRemoveResult = isToolboxRemoveResult;
1640
+ exports.isToolboxScope = isToolboxScope;
1641
+ exports.isToolboxUpdateParams = isToolboxUpdateParams;
1642
+ exports.isToolboxUpdateResult = isToolboxUpdateResult;
1643
+ exports.migrateTaskV1ToV2 = migrateTaskV1ToV2;
1644
+ exports.migrateV1ToV2 = migrateV1ToV2;
1645
+ exports.normalizeBridgeMethod = normalizeBridgeMethod;
1646
+ exports.normalizeServicemeError = normalizeServicemeError;