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