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