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