@serviceme/devtools-protocol 1.0.0 → 2.0.0
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 +413 -6
- package/dist/index.d.ts +413 -6
- package/dist/index.js +527 -144
- package/dist/index.mjs +490 -144
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -183,8 +183,206 @@ function isAuthSwitchResult(value) {
|
|
|
183
183
|
return true;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
// src/bridge-
|
|
186
|
+
// src/bridge-copilot-customizations.ts
|
|
187
|
+
var PRIVATE_RESULT_KEYS = /* @__PURE__ */ new Set([
|
|
188
|
+
"sourcePath",
|
|
189
|
+
"configPath",
|
|
190
|
+
"token",
|
|
191
|
+
"secret",
|
|
192
|
+
"approvalPayload"
|
|
193
|
+
]);
|
|
194
|
+
var SCOPES = /* @__PURE__ */ new Set(["workspace", "personal"]);
|
|
195
|
+
var KINDS = /* @__PURE__ */ new Set(["agent", "skill", "prompt", "instruction", "mcp", "hook"]);
|
|
196
|
+
var INTENTS = /* @__PURE__ */ new Set(["available", "selected", "moving", "removing"]);
|
|
197
|
+
var HEALTH = /* @__PURE__ */ new Set([
|
|
198
|
+
"healthy",
|
|
199
|
+
"missing",
|
|
200
|
+
"drifted",
|
|
201
|
+
"conflict",
|
|
202
|
+
"source-unavailable",
|
|
203
|
+
"unsupported"
|
|
204
|
+
]);
|
|
205
|
+
var GATES = /* @__PURE__ */ new Set(["ready", "approval-required", "configuration-required"]);
|
|
206
|
+
var STATUSES = /* @__PURE__ */ new Set(["healthy", "action-required", "blocked", "not-enabled"]);
|
|
207
|
+
var SOURCE_TYPES = /* @__PURE__ */ new Set(["marketplace", "git", "local"]);
|
|
208
|
+
var UPDATE_CAPABILITIES = /* @__PURE__ */ new Set(["pinned", "live", "none"]);
|
|
187
209
|
function isRecord3(value) {
|
|
210
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
211
|
+
}
|
|
212
|
+
function isString(value) {
|
|
213
|
+
return typeof value === "string" && value.length > 0;
|
|
214
|
+
}
|
|
215
|
+
function isOptionalString(value) {
|
|
216
|
+
return value === void 0 || typeof value === "string";
|
|
217
|
+
}
|
|
218
|
+
function isStringArray2(value, allowEmpty = true) {
|
|
219
|
+
return Array.isArray(value) && (allowEmpty || value.length > 0) && value.every((entry) => isString(entry));
|
|
220
|
+
}
|
|
221
|
+
function hasPrivateResultKey(value) {
|
|
222
|
+
if (Array.isArray(value)) return value.some(hasPrivateResultKey);
|
|
223
|
+
if (!isRecord3(value)) return false;
|
|
224
|
+
return Object.entries(value).some(
|
|
225
|
+
([key, nested]) => PRIVATE_RESULT_KEYS.has(key) || hasPrivateResultKey(nested)
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
function isScope(value) {
|
|
229
|
+
return typeof value === "string" && SCOPES.has(value);
|
|
230
|
+
}
|
|
231
|
+
function hasOptionalWorkspaceDir(value) {
|
|
232
|
+
return value.workspaceDir === void 0 || isString(value.workspaceDir);
|
|
233
|
+
}
|
|
234
|
+
function hasRequiredWorkspaceDirForWorkspaceScope(value) {
|
|
235
|
+
return value.scope !== "workspace" || isString(value.workspaceDir);
|
|
236
|
+
}
|
|
237
|
+
function isArtifactState(value) {
|
|
238
|
+
return isRecord3(value) && typeof value.intent === "string" && INTENTS.has(value.intent) && typeof value.health === "string" && HEALTH.has(value.health) && typeof value.gate === "string" && GATES.has(value.gate);
|
|
239
|
+
}
|
|
240
|
+
function isArtifactSummary(value) {
|
|
241
|
+
return isRecord3(value) && isString(value.id) && isString(value.packageId) && typeof value.kind === "string" && KINDS.has(value.kind) && isString(value.displayName) && isOptionalString(value.description) && (value.installStrategy === "link" || value.installStrategy === "generated-config" || value.installStrategy === "approval-gated") && (value.risk === "none" || value.risk === "review-required");
|
|
242
|
+
}
|
|
243
|
+
function isInstallation(value) {
|
|
244
|
+
return isRecord3(value) && isString(value.packageId) && isScope(value.scope) && isStringArray2(value.selectedArtifactIds) && isOptionalString(value.pinnedVersion);
|
|
245
|
+
}
|
|
246
|
+
function isDefinition(value) {
|
|
247
|
+
return isRecord3(value) && isString(value.id) && isString(value.sourceId) && isString(value.displayName) && isOptionalString(value.description) && isOptionalString(value.version) && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactSummary);
|
|
248
|
+
}
|
|
249
|
+
function isArtifactView(value) {
|
|
250
|
+
return isRecord3(value) && isArtifactSummary(value.artifact) && isArtifactState(value.state);
|
|
251
|
+
}
|
|
252
|
+
function isPackageView(value) {
|
|
253
|
+
return isRecord3(value) && isDefinition(value.definition) && isInstallation(value.installation) && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactView) && Number.isInteger(value.selectedArtifactCount) && value.selectedArtifactCount >= 0 && typeof value.status === "string" && STATUSES.has(value.status);
|
|
254
|
+
}
|
|
255
|
+
function isSourceView(value) {
|
|
256
|
+
return isRecord3(value) && isString(value.id) && (value.type === "marketplace" || value.type === "git" || value.type === "local") && isString(value.displayName) && (value.updateCapability === "pinned" || value.updateCapability === "live" || value.updateCapability === "none") && Array.isArray(value.packages) && value.packages.every(isPackageView);
|
|
257
|
+
}
|
|
258
|
+
function isSourceRecord(value) {
|
|
259
|
+
return isRecord3(value) && isString(value.id) && typeof value.type === "string" && SOURCE_TYPES.has(value.type) && isString(value.displayName) && typeof value.updateCapability === "string" && UPDATE_CAPABILITIES.has(value.updateCapability) && typeof value.available === "boolean" && Array.isArray(value.declaredIn) && value.declaredIn.every((entry) => entry === "workspace" || entry === "personal");
|
|
260
|
+
}
|
|
261
|
+
function isUpdatePreview(value) {
|
|
262
|
+
return isRecord3(value) && isString(value.packageId) && isOptionalString(value.fromVersion) && isString(value.toVersion) && isStringArray2(value.addedArtifactIds) && isStringArray2(value.removedArtifactIds) && isStringArray2(value.changedArtifactIds) && isStringArray2(value.approvalInvalidatedArtifactIds);
|
|
263
|
+
}
|
|
264
|
+
function isCopilotCustomizationViewPayload(value) {
|
|
265
|
+
if (!isRecord3(value) || hasPrivateResultKey(value)) return false;
|
|
266
|
+
const summary = value.summary;
|
|
267
|
+
return isScope(value.scope) && isString(value.generatedAt) && Array.isArray(value.sources) && value.sources.every(isSourceView) && Array.isArray(value.packages) && value.packages.every(isPackageView) && Array.isArray(value.attention) && value.attention.every(isArtifactView) && isRecord3(summary) && Number.isInteger(summary.packageCount) && summary.packageCount >= 0 && Number.isInteger(summary.enabledArtifactCount) && summary.enabledArtifactCount >= 0 && Number.isInteger(summary.attentionCount) && summary.attentionCount >= 0 && (value.legacyMigration === void 0 || isRecord3(value.legacyMigration) && Number.isInteger(value.legacyMigration.count) && value.legacyMigration.count >= 0 && value.legacyMigration.sourceLabel === "~/.agents");
|
|
268
|
+
}
|
|
269
|
+
function isCopilotCustomizationsListParams(value) {
|
|
270
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value);
|
|
271
|
+
}
|
|
272
|
+
function isAvailablePackage(value) {
|
|
273
|
+
return isRecord3(value) && isString(value.packageId) && isString(value.sourceId) && isString(value.displayName) && isOptionalString(value.description) && isOptionalString(value.version) && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactSummary) && Array.isArray(value.installedScopes) && value.installedScopes.every(isScope);
|
|
274
|
+
}
|
|
275
|
+
function isCopilotCustomizationsListResult(value) {
|
|
276
|
+
if (!isRecord3(value) || hasPrivateResultKey(value) || !isCopilotCustomizationViewPayload(value.view)) {
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
return value.availablePackages === void 0 || Array.isArray(value.availablePackages) && value.availablePackages.every(isAvailablePackage);
|
|
280
|
+
}
|
|
281
|
+
function isCopilotPackageInstallParams(value) {
|
|
282
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && hasRequiredWorkspaceDirForWorkspaceScope(value) && isString(value.sourceId) && isString(value.packageId) && isStringArray2(value.artifactIds, false) && isOptionalString(value.pinnedVersion) && (value.localMode === void 0 || value.localMode === "live" || value.localMode === "private-workspace-override");
|
|
283
|
+
}
|
|
284
|
+
function isCopilotPackageUpdateParams(value) {
|
|
285
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && hasRequiredWorkspaceDirForWorkspaceScope(value) && isString(value.packageId) && isStringArray2(value.artifactIds, false) && isOptionalString(value.pinnedVersion);
|
|
286
|
+
}
|
|
287
|
+
function isCopilotPackageUninstallParams(value) {
|
|
288
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && hasRequiredWorkspaceDirForWorkspaceScope(value) && isString(value.packageId);
|
|
289
|
+
}
|
|
290
|
+
function isCopilotPackageMoveParams(value) {
|
|
291
|
+
return isRecord3(value) && hasOptionalWorkspaceDir(value) && isString(value.packageId) && isScope(value.from) && isScope(value.to) && value.from !== value.to && isString(value.workspaceDir);
|
|
292
|
+
}
|
|
293
|
+
function isCopilotLegacyPreviewParams(value) {
|
|
294
|
+
return isRecord3(value) && hasOptionalWorkspaceDir(value);
|
|
295
|
+
}
|
|
296
|
+
function isCopilotLegacyMigrateParams(value) {
|
|
297
|
+
return isRecord3(value) && hasOptionalWorkspaceDir(value) && isStringArray2(value.artifactIds, false);
|
|
298
|
+
}
|
|
299
|
+
function isCopilotSourceListParams(value) {
|
|
300
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value);
|
|
301
|
+
}
|
|
302
|
+
function isCopilotSourceListResult(value) {
|
|
303
|
+
return isRecord3(value) && !hasPrivateResultKey(value) && Array.isArray(value.sources) && value.sources.every(isSourceRecord);
|
|
304
|
+
}
|
|
305
|
+
function isCopilotSourceRemoveParams(value) {
|
|
306
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && isString(value.sourceId);
|
|
307
|
+
}
|
|
308
|
+
function isCopilotSourceRemoveResult(value) {
|
|
309
|
+
return isRecord3(value) && !hasPrivateResultKey(value) && value.removed === true;
|
|
310
|
+
}
|
|
311
|
+
function isCopilotUpdatePreviewParams(value) {
|
|
312
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && isString(value.packageId) && isString(value.revision);
|
|
313
|
+
}
|
|
314
|
+
function isCopilotUpdatePreviewResult(value) {
|
|
315
|
+
return isRecord3(value) && !hasPrivateResultKey(value) && isUpdatePreview(value.preview);
|
|
316
|
+
}
|
|
317
|
+
function isCopilotLegacyPreviewResult(value) {
|
|
318
|
+
return isRecord3(value) && !hasPrivateResultKey(value) && value.sourceLabel === "~/.agents" && Number.isInteger(value.count) && value.count >= 0 && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactSummary);
|
|
319
|
+
}
|
|
320
|
+
var isCopilotPackageInstallResult = isCopilotCustomizationsListResult;
|
|
321
|
+
var isCopilotPackageUpdateResult = isCopilotCustomizationsListResult;
|
|
322
|
+
var isCopilotPackageUninstallResult = isCopilotCustomizationsListResult;
|
|
323
|
+
var isCopilotPackageMoveResult = isCopilotCustomizationsListResult;
|
|
324
|
+
var isCopilotLegacyMigrateResult = isCopilotCustomizationsListResult;
|
|
325
|
+
|
|
326
|
+
// src/json.ts
|
|
327
|
+
var JSON_SORT_ALGORITHMS = [
|
|
328
|
+
"default",
|
|
329
|
+
"keyLength",
|
|
330
|
+
"alphaNum",
|
|
331
|
+
"values",
|
|
332
|
+
"type"
|
|
333
|
+
];
|
|
334
|
+
var JSON_SORT_ORDERS = ["asc", "desc"];
|
|
335
|
+
var DEFAULT_JSON_SORT_OPTIONS = {
|
|
336
|
+
sortOrder: "asc",
|
|
337
|
+
sortAlgo: "default"
|
|
338
|
+
};
|
|
339
|
+
function isRecord4(value) {
|
|
340
|
+
return typeof value === "object" && value !== null;
|
|
341
|
+
}
|
|
342
|
+
function isJsonSortAlgorithm(value) {
|
|
343
|
+
return typeof value === "string" && JSON_SORT_ALGORITHMS.includes(value);
|
|
344
|
+
}
|
|
345
|
+
function isJsonSortOrder(value) {
|
|
346
|
+
return typeof value === "string" && JSON_SORT_ORDERS.includes(value);
|
|
347
|
+
}
|
|
348
|
+
function isJsonSortOptions(value) {
|
|
349
|
+
return isRecord4(value) && isJsonSortOrder(value.sortOrder) && isJsonSortAlgorithm(value.sortAlgo);
|
|
350
|
+
}
|
|
351
|
+
function isJsonValidationResult(value) {
|
|
352
|
+
return isRecord4(value) && typeof value.valid === "boolean" && (value.error === void 0 || typeof value.error === "string");
|
|
353
|
+
}
|
|
354
|
+
function isJsonOutputResult(value) {
|
|
355
|
+
return isRecord4(value) && typeof value.output === "string";
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// src/bridge-copilot-plugins.ts
|
|
359
|
+
var SCOPES2 = /* @__PURE__ */ new Set(["workspace", "personal"]);
|
|
360
|
+
function isOptionalScope(value) {
|
|
361
|
+
return value === void 0 || typeof value === "string" && SCOPES2.has(value);
|
|
362
|
+
}
|
|
363
|
+
function isScopeArray(value) {
|
|
364
|
+
return Array.isArray(value) && value.every((s) => typeof s === "string" && SCOPES2.has(s));
|
|
365
|
+
}
|
|
366
|
+
function isRegistration(value) {
|
|
367
|
+
return isRecord4(value) && typeof value.registrationId === "string" && typeof value.repoId === "string" && typeof value.pluginId === "string" && (value.displayName === void 0 || typeof value.displayName === "string") && (value.version === void 0 || typeof value.version === "string") && isScopeArray(value.scopes) && (value.enabled === void 0 || typeof value.enabled === "boolean") && Array.isArray(value.mcpServers) && value.mcpServers.every((s) => typeof s === "string") && typeof value.hasExtensions === "boolean";
|
|
368
|
+
}
|
|
369
|
+
function isCopilotPluginListParams(value) {
|
|
370
|
+
return isRecord4(value);
|
|
371
|
+
}
|
|
372
|
+
function isCopilotPluginListResult(value) {
|
|
373
|
+
return isRecord4(value) && Array.isArray(value.plugins) && value.plugins.every(isRegistration);
|
|
374
|
+
}
|
|
375
|
+
function isCopilotPluginRegisterParams(value) {
|
|
376
|
+
return isRecord4(value) && isOptionalScope(value.scope) && (value.workspaceDir === void 0 || typeof value.workspaceDir === "string") && typeof value.repoId === "string" && typeof value.pluginId === "string";
|
|
377
|
+
}
|
|
378
|
+
var isCopilotPluginRegisterResult = isCopilotPluginListResult;
|
|
379
|
+
function isCopilotPluginUnregisterParams(value) {
|
|
380
|
+
return isRecord4(value) && isOptionalScope(value.scope) && (value.workspaceDir === void 0 || typeof value.workspaceDir === "string") && typeof value.registrationId === "string";
|
|
381
|
+
}
|
|
382
|
+
var isCopilotPluginUnregisterResult = isCopilotPluginListResult;
|
|
383
|
+
|
|
384
|
+
// src/bridge-skill-repo.ts
|
|
385
|
+
function isRecord5(value) {
|
|
188
386
|
return typeof value === "object" && value !== null;
|
|
189
387
|
}
|
|
190
388
|
function isStringOrUndefined2(value) {
|
|
@@ -212,7 +410,7 @@ function isLinkMode(value) {
|
|
|
212
410
|
return value === "symlink" || value === "junction" || value === "copy";
|
|
213
411
|
}
|
|
214
412
|
function isRepoEntry(value) {
|
|
215
|
-
if (!
|
|
413
|
+
if (!isRecord5(value)) return false;
|
|
216
414
|
if (typeof value.id !== "string") return false;
|
|
217
415
|
if (typeof value.name !== "string") return false;
|
|
218
416
|
if (typeof value.url !== "string") return false;
|
|
@@ -236,7 +434,7 @@ function isRepoEntry(value) {
|
|
|
236
434
|
return true;
|
|
237
435
|
}
|
|
238
436
|
function isSkillEntry(value) {
|
|
239
|
-
if (!
|
|
437
|
+
if (!isRecord5(value)) return false;
|
|
240
438
|
if (typeof value.repoId !== "string") return false;
|
|
241
439
|
if (typeof value.name !== "string") return false;
|
|
242
440
|
if (value.kind !== "skill" && value.kind !== "agent") return false;
|
|
@@ -249,108 +447,155 @@ function isSkillEntry(value) {
|
|
|
249
447
|
return true;
|
|
250
448
|
}
|
|
251
449
|
function isSkillFile(value) {
|
|
252
|
-
return
|
|
450
|
+
return isRecord5(value) && typeof value.path === "string" && typeof value.content === "string";
|
|
253
451
|
}
|
|
254
452
|
function isLinkedSkill(value) {
|
|
255
|
-
return
|
|
453
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.linkPath === "string" && typeof value.targetPath === "string" && isLinkMode(value.mode) && isLinkScope(value.scope);
|
|
256
454
|
}
|
|
257
455
|
function isSyncPull(value) {
|
|
258
|
-
return
|
|
456
|
+
return isRecord5(value) && typeof value.repoId === "string" && (value.status === "ok" || value.status === "error");
|
|
457
|
+
}
|
|
458
|
+
function isCopilotContentStatus(value) {
|
|
459
|
+
return value === "restored" || value === "adopted" || value === "pending_approval" || value === "missing_source" || value === "conflict" || value === "drifted";
|
|
460
|
+
}
|
|
461
|
+
function isCopilotContentEntry(value) {
|
|
462
|
+
if (!isRecord5(value)) return false;
|
|
463
|
+
if (typeof value.identity !== "string") return false;
|
|
464
|
+
if (!isCopilotContentStatus(value.status)) return false;
|
|
465
|
+
if (value.message !== void 0 && typeof value.message !== "string") return false;
|
|
466
|
+
return true;
|
|
467
|
+
}
|
|
468
|
+
function isCopilotContentIntegrationKind(value) {
|
|
469
|
+
return value === "mcp" || value === "hook";
|
|
470
|
+
}
|
|
471
|
+
function isCopilotContentIntegrationStatus(value) {
|
|
472
|
+
return value === "active" || value === "inactive" || value === "pending_approval" || value === "missing_local_configuration";
|
|
473
|
+
}
|
|
474
|
+
function isCopilotContentIntegration(value) {
|
|
475
|
+
if (!isRecord5(value)) return false;
|
|
476
|
+
if (typeof value.identity !== "string") return false;
|
|
477
|
+
if (!isCopilotContentIntegrationKind(value.kind)) return false;
|
|
478
|
+
if (typeof value.configPath !== "string") return false;
|
|
479
|
+
if (!Array.isArray(value.names) || value.names.some((name) => typeof name !== "string")) {
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
return isCopilotContentIntegrationStatus(value.status);
|
|
259
483
|
}
|
|
260
484
|
function isSkillRepoListResult(value) {
|
|
261
|
-
return
|
|
485
|
+
return isRecord5(value) && Array.isArray(value.entries) && value.entries.every(isSkillEntry);
|
|
262
486
|
}
|
|
263
487
|
function isSkillRepoGetResult(value) {
|
|
264
|
-
return
|
|
488
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && (value.kind === "skill" || value.kind === "agent") && typeof value.manifestPath === "string" && typeof value.dir === "string" && typeof value.frontmatter === "object" && value.frontmatter !== null && typeof value.modifiedAt === "string" && Array.isArray(value.files) && value.files.every(isSkillFile);
|
|
265
489
|
}
|
|
266
490
|
function isSkillRepoInstallResult(value) {
|
|
267
|
-
return
|
|
491
|
+
return isRecord5(value) && isLinkMode(value.mode) && typeof value.linkPath === "string" && typeof value.targetPath === "string";
|
|
268
492
|
}
|
|
269
493
|
function isSkillRepoConvertToSymlinkResult(value) {
|
|
270
|
-
return
|
|
494
|
+
return isRecord5(value) && isLinkMode(value.mode) && typeof value.linkPath === "string" && typeof value.targetPath === "string";
|
|
271
495
|
}
|
|
272
496
|
function isSkillRepoUninstallResult(value) {
|
|
273
|
-
return
|
|
497
|
+
return isRecord5(value) && value.removed === true;
|
|
498
|
+
}
|
|
499
|
+
function isSkillRepoSetEntryEnabledResult(value) {
|
|
500
|
+
return isRecord5(value) && typeof value.enabled === "boolean";
|
|
274
501
|
}
|
|
275
502
|
function isSkillRepoListLinkedResult(value) {
|
|
276
|
-
return
|
|
503
|
+
return isRecord5(value) && Array.isArray(value.links) && value.links.every(isLinkedSkill);
|
|
277
504
|
}
|
|
278
505
|
function isSkillRepoDraftCreateResult(value) {
|
|
279
|
-
return
|
|
506
|
+
return isRecord5(value) && typeof value.id === "string";
|
|
280
507
|
}
|
|
281
508
|
function isSkillRepoDraftCommitResult(value) {
|
|
282
|
-
return
|
|
509
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.skillName === "string" && typeof value.commitSha === "string" && isStringOrUndefined2(value.pushedRef) && isStringOrUndefined2(value.pushedSha);
|
|
283
510
|
}
|
|
284
511
|
function isSkillRepoDraftListResult(value) {
|
|
285
|
-
return
|
|
286
|
-
(d) =>
|
|
512
|
+
return isRecord5(value) && Array.isArray(value.drafts) && value.drafts.every(
|
|
513
|
+
(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"
|
|
287
514
|
);
|
|
288
515
|
}
|
|
289
516
|
function isSkillRepoDraftDeleteResult(value) {
|
|
290
|
-
return
|
|
517
|
+
return isRecord5(value) && value.deleted === true;
|
|
291
518
|
}
|
|
292
519
|
function isRepoListResult(value) {
|
|
293
|
-
return
|
|
520
|
+
return isRecord5(value) && Array.isArray(value.repos) && value.repos.every(isRepoEntry);
|
|
294
521
|
}
|
|
295
522
|
function isRepoAddResult(value) {
|
|
296
|
-
return
|
|
523
|
+
return isRecord5(value) && isRepoEntry(value.repo) && typeof value.branch === "string" && typeof value.cloned === "boolean";
|
|
297
524
|
}
|
|
298
525
|
function isRepoRemoveResult(value) {
|
|
299
|
-
return
|
|
526
|
+
return isRecord5(value) && value.removed === true;
|
|
300
527
|
}
|
|
301
528
|
function isRepoEnableResult(value) {
|
|
302
|
-
return
|
|
529
|
+
return isRecord5(value) && isRepoEntry(value.repo);
|
|
303
530
|
}
|
|
304
531
|
function isRepoDisableResult(value) {
|
|
305
|
-
return
|
|
532
|
+
return isRecord5(value) && isRepoEntry(value.repo);
|
|
306
533
|
}
|
|
307
534
|
function isRepoUpdateResult(value) {
|
|
308
|
-
return
|
|
535
|
+
return isRecord5(value) && isRepoEntry(value.repo);
|
|
309
536
|
}
|
|
310
537
|
function isRepoSyncResult(value) {
|
|
311
|
-
return
|
|
538
|
+
return isRecord5(value) && Array.isArray(value.pulls) && value.pulls.length >= 1 && value.pulls.every(isSyncPull);
|
|
312
539
|
}
|
|
313
540
|
function isRepoSyncAllResult(value) {
|
|
314
|
-
return
|
|
541
|
+
return isRecord5(value) && Array.isArray(value.pulls) && value.pulls.every(isSyncPull);
|
|
542
|
+
}
|
|
543
|
+
function isCopilotContentRestoreResult(value) {
|
|
544
|
+
return isRecord5(value) && typeof value.changed === "boolean" && Array.isArray(value.entries) && value.entries.every(isCopilotContentEntry);
|
|
545
|
+
}
|
|
546
|
+
function isCopilotContentStatusResult(value) {
|
|
547
|
+
return isCopilotContentRestoreResult(value);
|
|
548
|
+
}
|
|
549
|
+
function isCopilotContentApproveResult(value) {
|
|
550
|
+
return isCopilotContentRestoreResult(value);
|
|
551
|
+
}
|
|
552
|
+
function isCopilotContentMigrateLegacyResult(value) {
|
|
553
|
+
return isRecord5(value) && Array.isArray(value.entries) && value.entries.every(isCopilotContentEntry);
|
|
554
|
+
}
|
|
555
|
+
function isCopilotContentIntegrationStatusResult(value) {
|
|
556
|
+
return isRecord5(value) && Array.isArray(value.integrations) && value.integrations.every(isCopilotContentIntegration);
|
|
315
557
|
}
|
|
316
558
|
function isSkillRepoListParams(value) {
|
|
317
|
-
return
|
|
559
|
+
return isRecord5(value) && isStringOrUndefined2(value.repoId) && isSkillKindOrUndefined(value.kind) && isStringOrUndefined2(value.workspaceDir);
|
|
318
560
|
}
|
|
319
561
|
function isSkillRepoGetParams(value) {
|
|
320
|
-
return
|
|
562
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string";
|
|
321
563
|
}
|
|
322
564
|
function isSkillRepoInstallParams(value) {
|
|
323
|
-
return
|
|
565
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkModeOrUndefined(value.mode) && isLinkScopeOrUndefined(value.scope);
|
|
324
566
|
}
|
|
325
567
|
function isSkillRepoConvertToSymlinkParams(value) {
|
|
326
|
-
return
|
|
568
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkModeOrUndefined(value.mode) && isLinkScopeOrUndefined(value.scope);
|
|
327
569
|
}
|
|
328
570
|
function isSkillRepoUninstallParams(value) {
|
|
329
|
-
return
|
|
571
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkScopeOrUndefined(value.scope);
|
|
572
|
+
}
|
|
573
|
+
function isSkillRepoSetEntryEnabledParams(value) {
|
|
574
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.enabled === "boolean" && isSkillKindOrUndefined(value.kind) && isLinkScopeOrUndefined(value.scope) && (value.workspaceDir === void 0 || typeof value.workspaceDir === "string");
|
|
330
575
|
}
|
|
331
576
|
function isSkillRepoListLinkedParams(value) {
|
|
332
|
-
return
|
|
577
|
+
return isRecord5(value) && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkScopeFilterOrUndefined(value.scope);
|
|
333
578
|
}
|
|
334
579
|
function isRepoListParams(value) {
|
|
335
|
-
return
|
|
580
|
+
return isRecord5(value) && (value.source === void 0 || value.source === "default" || value.source === "user");
|
|
336
581
|
}
|
|
337
582
|
function isRepoAddParams(value) {
|
|
338
|
-
return
|
|
583
|
+
return isRecord5(value) && typeof value.url === "string" && isStringOrUndefined2(value.branch) && isStringOrUndefined2(value.name) && isBooleanOrUndefined(value.useProxy);
|
|
339
584
|
}
|
|
340
585
|
function isRepoRemoveParams(value) {
|
|
341
|
-
return
|
|
586
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
342
587
|
}
|
|
343
588
|
function isRepoEnableParams(value) {
|
|
344
|
-
return
|
|
589
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
345
590
|
}
|
|
346
591
|
function isRepoDisableParams(value) {
|
|
347
|
-
return
|
|
592
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
348
593
|
}
|
|
349
594
|
function isRepoSyncParams(value) {
|
|
350
|
-
return
|
|
595
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
351
596
|
}
|
|
352
597
|
function isRepoSyncAllParams(value) {
|
|
353
|
-
return
|
|
598
|
+
return isRecord5(value);
|
|
354
599
|
}
|
|
355
600
|
|
|
356
601
|
// src/device.ts
|
|
@@ -360,7 +605,7 @@ var DEVICE_BINDING_STATES = [
|
|
|
360
605
|
"claimed",
|
|
361
606
|
"expired"
|
|
362
607
|
];
|
|
363
|
-
function
|
|
608
|
+
function isRecord6(value) {
|
|
364
609
|
return typeof value === "object" && value !== null;
|
|
365
610
|
}
|
|
366
611
|
function isStringOrUndefined3(value) {
|
|
@@ -370,7 +615,7 @@ function isDeviceBindingState(value) {
|
|
|
370
615
|
return value === "anonymous" || value === "pending" || value === "claimed" || value === "expired";
|
|
371
616
|
}
|
|
372
617
|
function isDeviceIdentityState(value) {
|
|
373
|
-
if (!
|
|
618
|
+
if (!isRecord6(value)) return false;
|
|
374
619
|
if (typeof value.publicId !== "string") return false;
|
|
375
620
|
if (value.publicId.length === 0) return false;
|
|
376
621
|
if (typeof value.secretVersion !== "number") return false;
|
|
@@ -380,7 +625,7 @@ function isDeviceIdentityState(value) {
|
|
|
380
625
|
return true;
|
|
381
626
|
}
|
|
382
627
|
function isDeviceMetadata(value) {
|
|
383
|
-
if (!
|
|
628
|
+
if (!isRecord6(value)) return false;
|
|
384
629
|
if (typeof value.installationId !== "string") return false;
|
|
385
630
|
if (value.installationId.length === 0) return false;
|
|
386
631
|
if (typeof value.machineId !== "string") return false;
|
|
@@ -393,7 +638,7 @@ function isDeviceMetadata(value) {
|
|
|
393
638
|
return true;
|
|
394
639
|
}
|
|
395
640
|
function isDeviceStatus(value) {
|
|
396
|
-
if (!
|
|
641
|
+
if (!isRecord6(value)) return false;
|
|
397
642
|
if (!isDeviceBindingState(value.bindingState)) return false;
|
|
398
643
|
if (value.identity !== void 0 && !isDeviceIdentityState(value.identity)) {
|
|
399
644
|
return false;
|
|
@@ -406,10 +651,10 @@ function isDeviceStatus(value) {
|
|
|
406
651
|
return true;
|
|
407
652
|
}
|
|
408
653
|
function isDeviceEnrollParams(value) {
|
|
409
|
-
return
|
|
654
|
+
return isRecord6(value) && (value.force === void 0 || typeof value.force === "boolean") && (value.requireAuth === void 0 || typeof value.requireAuth === "boolean");
|
|
410
655
|
}
|
|
411
656
|
function isDeviceEnrollResult(value) {
|
|
412
|
-
if (!
|
|
657
|
+
if (!isRecord6(value)) return false;
|
|
413
658
|
if (typeof value.publicId !== "string") return false;
|
|
414
659
|
if (value.publicId.length === 0) return false;
|
|
415
660
|
if (!isDeviceBindingState(value.bindingState)) return false;
|
|
@@ -417,14 +662,14 @@ function isDeviceEnrollResult(value) {
|
|
|
417
662
|
return true;
|
|
418
663
|
}
|
|
419
664
|
function isDeviceRotateSecretParams(value) {
|
|
420
|
-
if (!
|
|
665
|
+
if (!isRecord6(value)) return false;
|
|
421
666
|
if (value.gracePeriodDays !== void 0 && (typeof value.gracePeriodDays !== "number" || !Number.isInteger(value.gracePeriodDays) || value.gracePeriodDays < 0 || value.gracePeriodDays > 365)) {
|
|
422
667
|
return false;
|
|
423
668
|
}
|
|
424
669
|
return true;
|
|
425
670
|
}
|
|
426
671
|
function isDeviceRotateSecretResult(value) {
|
|
427
|
-
if (!
|
|
672
|
+
if (!isRecord6(value)) return false;
|
|
428
673
|
if (typeof value.publicId !== "string") return false;
|
|
429
674
|
if (value.publicId.length === 0) return false;
|
|
430
675
|
if (typeof value.secretVersion !== "number") return false;
|
|
@@ -451,18 +696,18 @@ var VALID_TERMINAL_STATUSES = [
|
|
|
451
696
|
"timeout",
|
|
452
697
|
"cancelled"
|
|
453
698
|
];
|
|
454
|
-
function
|
|
699
|
+
function isRecord7(value) {
|
|
455
700
|
return typeof value === "object" && value !== null;
|
|
456
701
|
}
|
|
457
702
|
function isScheduledTaskType(value) {
|
|
458
703
|
return typeof value === "string" && VALID_TASK_TYPES.includes(value);
|
|
459
704
|
}
|
|
460
705
|
function isScheduledTaskV1(value) {
|
|
461
|
-
if (!
|
|
462
|
-
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) &&
|
|
706
|
+
if (!isRecord7(value)) return false;
|
|
707
|
+
return typeof value.id === "string" && typeof value.name === "string" && typeof value.enabled === "boolean" && VALID_SCHEDULE_TYPES.includes(value.scheduleType) && typeof value.schedule === "string" && isScheduledTaskType(value.taskType) && isRecord7(value.payload) && typeof value.createdAt === "string" && typeof value.updatedAt === "string";
|
|
463
708
|
}
|
|
464
709
|
function isTaskWorkspaceRef(value) {
|
|
465
|
-
if (!
|
|
710
|
+
if (!isRecord7(value)) return false;
|
|
466
711
|
if (typeof value.path !== "string" || value.path.length === 0) return false;
|
|
467
712
|
if (typeof value.name !== "string" || value.name.length === 0) return false;
|
|
468
713
|
if (value.gitRemote !== void 0 && typeof value.gitRemote !== "string") {
|
|
@@ -481,48 +726,48 @@ function isScheduledTask(value) {
|
|
|
481
726
|
return isTaskWorkspaceRef(value.workspace);
|
|
482
727
|
}
|
|
483
728
|
function isScheduledTasksConfig(value) {
|
|
484
|
-
if (!
|
|
729
|
+
if (!isRecord7(value)) return false;
|
|
485
730
|
if (value.version !== 2) return false;
|
|
486
731
|
if (!Array.isArray(value.tasks)) return false;
|
|
487
732
|
return value.tasks.every((t) => isScheduledTask(t));
|
|
488
733
|
}
|
|
489
734
|
function isScheduledTasksConfigV1(value) {
|
|
490
|
-
if (!
|
|
735
|
+
if (!isRecord7(value)) return false;
|
|
491
736
|
if (value.version !== 1) return false;
|
|
492
737
|
if (!Array.isArray(value.tasks)) return false;
|
|
493
738
|
return value.tasks.every((t) => isScheduledTaskV1(t));
|
|
494
739
|
}
|
|
495
740
|
function isTaskExecutionLog(value) {
|
|
496
|
-
if (!
|
|
741
|
+
if (!isRecord7(value)) return false;
|
|
497
742
|
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);
|
|
498
743
|
}
|
|
499
744
|
function isSchedulerStatus(value) {
|
|
500
|
-
if (!
|
|
745
|
+
if (!isRecord7(value)) return false;
|
|
501
746
|
return typeof value.running === "boolean" && typeof value.tasksRegistered === "number" && typeof value.workspacePath === "string";
|
|
502
747
|
}
|
|
503
748
|
function isTaskExecuteResult(value) {
|
|
504
|
-
return
|
|
749
|
+
return isRecord7(value) && typeof value.executionId === "string" && value.accepted === true;
|
|
505
750
|
}
|
|
506
751
|
function isTaskCancelResult(value) {
|
|
507
|
-
return
|
|
752
|
+
return isRecord7(value) && typeof value.executionId === "string" && typeof value.cancelled === "boolean";
|
|
508
753
|
}
|
|
509
754
|
function isTaskListRunningResult(value) {
|
|
510
|
-
return
|
|
755
|
+
return isRecord7(value) && Array.isArray(value.executions);
|
|
511
756
|
}
|
|
512
757
|
function isTaskStartedEventParams(value) {
|
|
513
|
-
return
|
|
758
|
+
return isRecord7(value) && typeof value.executionId === "string" && typeof value.taskId === "string" && typeof value.startedAt === "string";
|
|
514
759
|
}
|
|
515
760
|
function isTaskOutputEventParams(value) {
|
|
516
|
-
return
|
|
761
|
+
return isRecord7(value) && typeof value.executionId === "string" && (value.stream === "stdout" || value.stream === "stderr") && typeof value.data === "string";
|
|
517
762
|
}
|
|
518
763
|
function isTaskCompletedEventParams(value) {
|
|
519
|
-
return
|
|
764
|
+
return isRecord7(value) && typeof value.executionId === "string" && isTaskExecutionLog(value.log);
|
|
520
765
|
}
|
|
521
766
|
function isTaskFailedEventParams(value) {
|
|
522
|
-
return
|
|
767
|
+
return isRecord7(value) && typeof value.executionId === "string" && (value.status === "failure" || value.status === "timeout") && (value.reason === "error" || value.reason === "timeout") && isTaskExecutionLog(value.log);
|
|
523
768
|
}
|
|
524
769
|
function isTaskCancelledEventParams(value) {
|
|
525
|
-
return
|
|
770
|
+
return isRecord7(value) && typeof value.executionId === "string" && isTaskExecutionLog(value.log);
|
|
526
771
|
}
|
|
527
772
|
function isAgentSessionStatus(value) {
|
|
528
773
|
return value === "idle" || value === "running" || value === "needs-input" || value === "completed" || value === "failed" || value === "aborted";
|
|
@@ -556,7 +801,7 @@ function migrateV1ToV2(v1Config, workspace) {
|
|
|
556
801
|
|
|
557
802
|
// src/toolbox.ts
|
|
558
803
|
var TOOLBOX_SCOPES = ["user", "workspace"];
|
|
559
|
-
function
|
|
804
|
+
function isRecord8(value) {
|
|
560
805
|
return typeof value === "object" && value !== null;
|
|
561
806
|
}
|
|
562
807
|
function isStringOrUndefined4(value) {
|
|
@@ -569,7 +814,7 @@ function isToolboxScope(value) {
|
|
|
569
814
|
return value === "user" || value === "workspace";
|
|
570
815
|
}
|
|
571
816
|
function isExternalTool(value) {
|
|
572
|
-
if (!
|
|
817
|
+
if (!isRecord8(value)) return false;
|
|
573
818
|
if (typeof value.id !== "string") return false;
|
|
574
819
|
if (value.id.length === 0) return false;
|
|
575
820
|
if (typeof value.name !== "string") return false;
|
|
@@ -587,7 +832,7 @@ function isExternalTool(value) {
|
|
|
587
832
|
return true;
|
|
588
833
|
}
|
|
589
834
|
function isExternalToolPatch(value) {
|
|
590
|
-
if (!
|
|
835
|
+
if (!isRecord8(value)) return false;
|
|
591
836
|
if (value.name !== void 0) {
|
|
592
837
|
if (typeof value.name !== "string" || value.name.length === 0) return false;
|
|
593
838
|
}
|
|
@@ -607,7 +852,7 @@ function isExternalToolPatch(value) {
|
|
|
607
852
|
return true;
|
|
608
853
|
}
|
|
609
854
|
function isToolboxList(value) {
|
|
610
|
-
if (!
|
|
855
|
+
if (!isRecord8(value)) return false;
|
|
611
856
|
if (!isToolboxScope(value.scope)) return false;
|
|
612
857
|
if (!Array.isArray(value.tools)) return false;
|
|
613
858
|
for (const tool of value.tools) {
|
|
@@ -616,26 +861,26 @@ function isToolboxList(value) {
|
|
|
616
861
|
return true;
|
|
617
862
|
}
|
|
618
863
|
function isToolboxListParams(value) {
|
|
619
|
-
return
|
|
864
|
+
return isRecord8(value) && (value.scope === void 0 || isToolboxScope(value.scope));
|
|
620
865
|
}
|
|
621
866
|
function isToolboxAddParams(value) {
|
|
622
867
|
return isExternalTool(value);
|
|
623
868
|
}
|
|
624
869
|
function isToolboxAddResult(value) {
|
|
625
|
-
if (!
|
|
870
|
+
if (!isRecord8(value)) return false;
|
|
626
871
|
if (!isToolboxScope(value.scope)) return false;
|
|
627
872
|
if (!isExternalTool(value.tool)) return false;
|
|
628
873
|
return true;
|
|
629
874
|
}
|
|
630
875
|
function isToolboxRemoveParams(value) {
|
|
631
|
-
if (!
|
|
876
|
+
if (!isRecord8(value)) return false;
|
|
632
877
|
if (typeof value.id !== "string") return false;
|
|
633
878
|
if (value.id.length === 0) return false;
|
|
634
879
|
if (value.scope !== void 0 && !isToolboxScope(value.scope)) return false;
|
|
635
880
|
return true;
|
|
636
881
|
}
|
|
637
882
|
function isToolboxRemoveResult(value) {
|
|
638
|
-
if (!
|
|
883
|
+
if (!isRecord8(value)) return false;
|
|
639
884
|
if (!isToolboxScope(value.scope)) return false;
|
|
640
885
|
if (typeof value.toolId !== "string") return false;
|
|
641
886
|
if (value.toolId.length === 0) return false;
|
|
@@ -643,7 +888,7 @@ function isToolboxRemoveResult(value) {
|
|
|
643
888
|
return true;
|
|
644
889
|
}
|
|
645
890
|
function isToolboxUpdateParams(value) {
|
|
646
|
-
if (!
|
|
891
|
+
if (!isRecord8(value)) return false;
|
|
647
892
|
if (typeof value.id !== "string") return false;
|
|
648
893
|
if (value.id.length === 0) return false;
|
|
649
894
|
if (!isExternalToolPatch(value.patch)) return false;
|
|
@@ -651,7 +896,7 @@ function isToolboxUpdateParams(value) {
|
|
|
651
896
|
return true;
|
|
652
897
|
}
|
|
653
898
|
function isToolboxUpdateResult(value) {
|
|
654
|
-
if (!
|
|
899
|
+
if (!isRecord8(value)) return false;
|
|
655
900
|
if (!isToolboxScope(value.scope)) return false;
|
|
656
901
|
if (!isExternalTool(value.tool)) return false;
|
|
657
902
|
return true;
|
|
@@ -659,14 +904,14 @@ function isToolboxUpdateResult(value) {
|
|
|
659
904
|
|
|
660
905
|
// src/bridge.ts
|
|
661
906
|
var SERVICEME_PROTOCOL_VERSION = 2;
|
|
662
|
-
function
|
|
907
|
+
function isRecord9(value) {
|
|
663
908
|
return typeof value === "object" && value !== null;
|
|
664
909
|
}
|
|
665
910
|
function isValidProtocolVersion(value) {
|
|
666
911
|
return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= SERVICEME_PROTOCOL_VERSION;
|
|
667
912
|
}
|
|
668
913
|
function isBridgeCapabilities(value) {
|
|
669
|
-
return
|
|
914
|
+
return isRecord9(value) && value.bridge === true && value.json === 1 && value.env === 1 && (value.tasks === void 0 || value.tasks === 1) && (value.skillRepo === void 0 || value.skillRepo === 1) && (value.repoMgmt === void 0 || value.repoMgmt === 1) && (value.copilotContent === void 0 || value.copilotContent === 1) && (value.auth === void 0 || value.auth === 1) && (value.device === void 0 || value.device === 1) && (value.toolbox === void 0 || value.toolbox === 1) && (value["auth.tokenRead"] === void 0 || value["auth.tokenRead"] === 1);
|
|
670
915
|
}
|
|
671
916
|
var BRIDGE_METHODS = [
|
|
672
917
|
"system.hello",
|
|
@@ -675,11 +920,23 @@ var BRIDGE_METHODS = [
|
|
|
675
920
|
"task.execute",
|
|
676
921
|
"task.cancel",
|
|
677
922
|
"task.list-running",
|
|
923
|
+
"copilotContent.list",
|
|
924
|
+
"copilotContent.get",
|
|
925
|
+
"copilotContent.install",
|
|
926
|
+
"copilotContent.convertToSymlink",
|
|
927
|
+
"copilotContent.uninstall",
|
|
928
|
+
"copilotContent.setEntryEnabled",
|
|
929
|
+
"copilotContent.listLinked",
|
|
930
|
+
"copilotContent.draft.create",
|
|
931
|
+
"copilotContent.draft.commit",
|
|
932
|
+
"copilotContent.draft.list",
|
|
933
|
+
"copilotContent.draft.delete",
|
|
678
934
|
"skillRepo.list",
|
|
679
935
|
"skillRepo.get",
|
|
680
936
|
"skillRepo.install",
|
|
681
937
|
"skillRepo.convertToSymlink",
|
|
682
938
|
"skillRepo.uninstall",
|
|
939
|
+
"skillRepo.setEntryEnabled",
|
|
683
940
|
"skillRepo.listLinked",
|
|
684
941
|
"skillRepo.draft.create",
|
|
685
942
|
"skillRepo.draft.commit",
|
|
@@ -693,6 +950,25 @@ var BRIDGE_METHODS = [
|
|
|
693
950
|
"repo.update",
|
|
694
951
|
"repo.sync",
|
|
695
952
|
"repo.syncAll",
|
|
953
|
+
"repo.resetParseCache",
|
|
954
|
+
"copilotContent.status",
|
|
955
|
+
"copilotContent.restore",
|
|
956
|
+
"copilotContent.approve",
|
|
957
|
+
"copilotContent.migrateLegacy",
|
|
958
|
+
"copilotContent.integrationStatus",
|
|
959
|
+
"copilotContent.customizations.list",
|
|
960
|
+
"copilotContent.package.install",
|
|
961
|
+
"copilotContent.package.update",
|
|
962
|
+
"copilotContent.package.uninstall",
|
|
963
|
+
"copilotContent.package.move",
|
|
964
|
+
"copilotPlugin.list",
|
|
965
|
+
"copilotPlugin.register",
|
|
966
|
+
"copilotPlugin.unregister",
|
|
967
|
+
"copilotContent.legacy.preview",
|
|
968
|
+
"copilotContent.legacy.migrate",
|
|
969
|
+
"copilotContent.sources.list",
|
|
970
|
+
"copilotContent.sources.remove",
|
|
971
|
+
"copilotContent.package.previewUpdate",
|
|
696
972
|
"auth.status",
|
|
697
973
|
"auth.login",
|
|
698
974
|
"auth.logout",
|
|
@@ -706,6 +982,22 @@ var BRIDGE_METHODS = [
|
|
|
706
982
|
"toolbox.remove",
|
|
707
983
|
"toolbox.update"
|
|
708
984
|
];
|
|
985
|
+
var COPILOT_CONTENT_METHOD_ALIASES = {
|
|
986
|
+
"skillRepo.list": "copilotContent.list",
|
|
987
|
+
"skillRepo.get": "copilotContent.get",
|
|
988
|
+
"skillRepo.install": "copilotContent.install",
|
|
989
|
+
"skillRepo.convertToSymlink": "copilotContent.convertToSymlink",
|
|
990
|
+
"skillRepo.uninstall": "copilotContent.uninstall",
|
|
991
|
+
"skillRepo.setEntryEnabled": "copilotContent.setEntryEnabled",
|
|
992
|
+
"skillRepo.listLinked": "copilotContent.listLinked",
|
|
993
|
+
"skillRepo.draft.create": "copilotContent.draft.create",
|
|
994
|
+
"skillRepo.draft.commit": "copilotContent.draft.commit",
|
|
995
|
+
"skillRepo.draft.list": "copilotContent.draft.list",
|
|
996
|
+
"skillRepo.draft.delete": "copilotContent.draft.delete"
|
|
997
|
+
};
|
|
998
|
+
function normalizeBridgeMethod(method) {
|
|
999
|
+
return COPILOT_CONTENT_METHOD_ALIASES[method] ?? method;
|
|
1000
|
+
}
|
|
709
1001
|
var BRIDGE_EVENTS = [
|
|
710
1002
|
"task.started",
|
|
711
1003
|
"task.output",
|
|
@@ -714,13 +1006,13 @@ var BRIDGE_EVENTS = [
|
|
|
714
1006
|
"task.cancelled"
|
|
715
1007
|
];
|
|
716
1008
|
function isSystemHelloResult(value) {
|
|
717
|
-
return
|
|
1009
|
+
return isRecord9(value) && typeof value.cliVersion === "string" && isValidProtocolVersion(value.protocolVersion) && isBridgeCapabilities(value.capabilities) && typeof value.pid === "number";
|
|
718
1010
|
}
|
|
719
1011
|
function isSystemPingResult(value) {
|
|
720
|
-
return
|
|
1012
|
+
return isRecord9(value) && typeof value.now === "string";
|
|
721
1013
|
}
|
|
722
1014
|
function isSystemShutdownResult(value) {
|
|
723
|
-
return
|
|
1015
|
+
return isRecord9(value) && value.shuttingDown === true;
|
|
724
1016
|
}
|
|
725
1017
|
function getBridgeResultValidator(method) {
|
|
726
1018
|
switch (method) {
|
|
@@ -736,24 +1028,37 @@ function getBridgeResultValidator(method) {
|
|
|
736
1028
|
return isTaskCancelResult;
|
|
737
1029
|
case "task.list-running":
|
|
738
1030
|
return isTaskListRunningResult;
|
|
1031
|
+
case "copilotContent.list":
|
|
739
1032
|
case "skillRepo.list":
|
|
740
1033
|
return isSkillRepoListResult;
|
|
1034
|
+
case "copilotContent.get":
|
|
741
1035
|
case "skillRepo.get":
|
|
742
1036
|
return isSkillRepoGetResult;
|
|
1037
|
+
case "copilotContent.install":
|
|
743
1038
|
case "skillRepo.install":
|
|
744
1039
|
return isSkillRepoInstallResult;
|
|
1040
|
+
case "copilotContent.convertToSymlink":
|
|
745
1041
|
case "skillRepo.convertToSymlink":
|
|
746
1042
|
return isSkillRepoConvertToSymlinkResult;
|
|
1043
|
+
case "copilotContent.uninstall":
|
|
747
1044
|
case "skillRepo.uninstall":
|
|
748
1045
|
return isSkillRepoUninstallResult;
|
|
1046
|
+
case "copilotContent.setEntryEnabled":
|
|
1047
|
+
case "skillRepo.setEntryEnabled":
|
|
1048
|
+
return isSkillRepoSetEntryEnabledResult;
|
|
1049
|
+
case "copilotContent.listLinked":
|
|
749
1050
|
case "skillRepo.listLinked":
|
|
750
1051
|
return isSkillRepoListLinkedResult;
|
|
1052
|
+
case "copilotContent.draft.create":
|
|
751
1053
|
case "skillRepo.draft.create":
|
|
752
1054
|
return isSkillRepoDraftCreateResult;
|
|
1055
|
+
case "copilotContent.draft.commit":
|
|
753
1056
|
case "skillRepo.draft.commit":
|
|
754
1057
|
return isSkillRepoDraftCommitResult;
|
|
1058
|
+
case "copilotContent.draft.list":
|
|
755
1059
|
case "skillRepo.draft.list":
|
|
756
1060
|
return isSkillRepoDraftListResult;
|
|
1061
|
+
case "copilotContent.draft.delete":
|
|
757
1062
|
case "skillRepo.draft.delete":
|
|
758
1063
|
return isSkillRepoDraftDeleteResult;
|
|
759
1064
|
case "repo.list":
|
|
@@ -772,6 +1077,42 @@ function getBridgeResultValidator(method) {
|
|
|
772
1077
|
return isRepoSyncResult;
|
|
773
1078
|
case "repo.syncAll":
|
|
774
1079
|
return isRepoSyncAllResult;
|
|
1080
|
+
case "copilotContent.status":
|
|
1081
|
+
return isCopilotContentStatusResult;
|
|
1082
|
+
case "copilotContent.restore":
|
|
1083
|
+
return isCopilotContentRestoreResult;
|
|
1084
|
+
case "copilotContent.approve":
|
|
1085
|
+
return isCopilotContentApproveResult;
|
|
1086
|
+
case "copilotContent.migrateLegacy":
|
|
1087
|
+
return isCopilotContentMigrateLegacyResult;
|
|
1088
|
+
case "copilotContent.integrationStatus":
|
|
1089
|
+
return isCopilotContentIntegrationStatusResult;
|
|
1090
|
+
case "copilotContent.customizations.list":
|
|
1091
|
+
return isCopilotCustomizationsListResult;
|
|
1092
|
+
case "copilotPlugin.list":
|
|
1093
|
+
return isCopilotPluginListResult;
|
|
1094
|
+
case "copilotPlugin.register":
|
|
1095
|
+
return isCopilotPluginRegisterResult;
|
|
1096
|
+
case "copilotPlugin.unregister":
|
|
1097
|
+
return isCopilotPluginUnregisterResult;
|
|
1098
|
+
case "copilotContent.package.install":
|
|
1099
|
+
return isCopilotPackageInstallResult;
|
|
1100
|
+
case "copilotContent.package.update":
|
|
1101
|
+
return isCopilotPackageUpdateResult;
|
|
1102
|
+
case "copilotContent.package.uninstall":
|
|
1103
|
+
return isCopilotPackageUninstallResult;
|
|
1104
|
+
case "copilotContent.package.move":
|
|
1105
|
+
return isCopilotPackageMoveResult;
|
|
1106
|
+
case "copilotContent.legacy.preview":
|
|
1107
|
+
return isCopilotLegacyPreviewResult;
|
|
1108
|
+
case "copilotContent.legacy.migrate":
|
|
1109
|
+
return isCopilotLegacyMigrateResult;
|
|
1110
|
+
case "copilotContent.sources.list":
|
|
1111
|
+
return isCopilotSourceListResult;
|
|
1112
|
+
case "copilotContent.sources.remove":
|
|
1113
|
+
return isCopilotSourceRemoveResult;
|
|
1114
|
+
case "copilotContent.package.previewUpdate":
|
|
1115
|
+
return isCopilotUpdatePreviewResult;
|
|
775
1116
|
case "auth.status":
|
|
776
1117
|
return isAuthStatus;
|
|
777
1118
|
case "auth.login":
|
|
@@ -823,13 +1164,13 @@ function isBridgeEventName(value) {
|
|
|
823
1164
|
return typeof value === "string" && BRIDGE_EVENTS.includes(value);
|
|
824
1165
|
}
|
|
825
1166
|
function isBridgeRequest(value) {
|
|
826
|
-
if (!
|
|
1167
|
+
if (!isRecord9(value)) {
|
|
827
1168
|
return false;
|
|
828
1169
|
}
|
|
829
1170
|
return isValidProtocolVersion(value.protocolVersion) && value.kind === "request" && typeof value.id === "string" && isBridgeMethod(value.method) && "params" in value;
|
|
830
1171
|
}
|
|
831
1172
|
function isBridgeResponse(value) {
|
|
832
|
-
if (!
|
|
1173
|
+
if (!isRecord9(value)) {
|
|
833
1174
|
return false;
|
|
834
1175
|
}
|
|
835
1176
|
if (!isValidProtocolVersion(value.protocolVersion) || value.kind !== "response" || typeof value.id !== "string" || typeof value.ok !== "boolean") {
|
|
@@ -841,7 +1182,7 @@ function isBridgeResponse(value) {
|
|
|
841
1182
|
return "error" in value;
|
|
842
1183
|
}
|
|
843
1184
|
function isBridgeEvent(value) {
|
|
844
|
-
if (!
|
|
1185
|
+
if (!isRecord9(value)) {
|
|
845
1186
|
return false;
|
|
846
1187
|
}
|
|
847
1188
|
return isValidProtocolVersion(value.protocolVersion) && value.kind === "event" && isBridgeEventName(value.event) && "params" in value;
|
|
@@ -849,7 +1190,7 @@ function isBridgeEvent(value) {
|
|
|
849
1190
|
|
|
850
1191
|
// src/cli.ts
|
|
851
1192
|
var SERVICEME_CLI_SCHEMA_VERSION = 1;
|
|
852
|
-
function
|
|
1193
|
+
function isRecord10(value) {
|
|
853
1194
|
return typeof value === "object" && value !== null;
|
|
854
1195
|
}
|
|
855
1196
|
function createCliSuccess(data) {
|
|
@@ -867,7 +1208,7 @@ function createCliFailure(error) {
|
|
|
867
1208
|
};
|
|
868
1209
|
}
|
|
869
1210
|
function isCliEnvelope(value) {
|
|
870
|
-
if (!
|
|
1211
|
+
if (!isRecord10(value)) {
|
|
871
1212
|
return false;
|
|
872
1213
|
}
|
|
873
1214
|
if (value.schemaVersion !== SERVICEME_CLI_SCHEMA_VERSION || typeof value.ok !== "boolean") {
|
|
@@ -901,20 +1242,20 @@ var KNOWN_ENVIRONMENT_TOOLS = [
|
|
|
901
1242
|
"dotnet",
|
|
902
1243
|
"nuget"
|
|
903
1244
|
];
|
|
904
|
-
function
|
|
1245
|
+
function isRecord11(value) {
|
|
905
1246
|
return typeof value === "object" && value !== null;
|
|
906
1247
|
}
|
|
907
1248
|
function isKnownEnvironmentTool(value) {
|
|
908
1249
|
return KNOWN_ENVIRONMENT_TOOLS.includes(value);
|
|
909
1250
|
}
|
|
910
1251
|
function isToolCheckResult(value) {
|
|
911
|
-
if (!
|
|
1252
|
+
if (!isRecord11(value)) {
|
|
912
1253
|
return false;
|
|
913
1254
|
}
|
|
914
1255
|
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");
|
|
915
1256
|
}
|
|
916
1257
|
function isEnvironmentCheckResult(value) {
|
|
917
|
-
if (!
|
|
1258
|
+
if (!isRecord11(value)) {
|
|
918
1259
|
return false;
|
|
919
1260
|
}
|
|
920
1261
|
return KNOWN_ENVIRONMENT_TOOLS.every((tool) => isToolCheckResult(value[tool]));
|
|
@@ -966,14 +1307,14 @@ var RETRYABLE_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
|
966
1307
|
"executor_timeout",
|
|
967
1308
|
"internal_error"
|
|
968
1309
|
]);
|
|
969
|
-
function
|
|
1310
|
+
function isRecord12(value) {
|
|
970
1311
|
return typeof value === "object" && value !== null;
|
|
971
1312
|
}
|
|
972
1313
|
function isServicemeErrorCode(value) {
|
|
973
1314
|
return typeof value === "string" && SERVICEME_ERROR_CODES.includes(value);
|
|
974
1315
|
}
|
|
975
1316
|
function isServicemeErrorDetails(value) {
|
|
976
|
-
if (!
|
|
1317
|
+
if (!isRecord12(value)) {
|
|
977
1318
|
return false;
|
|
978
1319
|
}
|
|
979
1320
|
return isServicemeErrorCode(value.code) && typeof value.message === "string" && typeof value.retryable === "boolean";
|
|
@@ -1013,7 +1354,7 @@ function normalizeServicemeError(error, fallbackCode = "internal_error") {
|
|
|
1013
1354
|
if (isServicemeErrorDetails(error)) {
|
|
1014
1355
|
return error;
|
|
1015
1356
|
}
|
|
1016
|
-
if (
|
|
1357
|
+
if (isRecord12(error)) {
|
|
1017
1358
|
const code = isServicemeErrorCode(error.code) ? error.code : fallbackCode;
|
|
1018
1359
|
const message = typeof error.message === "string" ? error.message : "Unexpected serviceme error.";
|
|
1019
1360
|
const retryable = typeof error.retryable === "boolean" ? error.retryable : isRetryableErrorCode(code);
|
|
@@ -1044,69 +1385,37 @@ var SERVICEME_IMAGE_FORMATS = [
|
|
|
1044
1385
|
"png",
|
|
1045
1386
|
"webp"
|
|
1046
1387
|
];
|
|
1047
|
-
function
|
|
1388
|
+
function isRecord13(value) {
|
|
1048
1389
|
return typeof value === "object" && value !== null;
|
|
1049
1390
|
}
|
|
1050
1391
|
function isServiceMeImageFormat(value) {
|
|
1051
1392
|
return typeof value === "string" && SERVICEME_IMAGE_FORMATS.includes(value);
|
|
1052
1393
|
}
|
|
1053
1394
|
function isServiceMeImageCompressOptions(value) {
|
|
1054
|
-
if (!
|
|
1395
|
+
if (!isRecord13(value)) {
|
|
1055
1396
|
return false;
|
|
1056
1397
|
}
|
|
1057
1398
|
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");
|
|
1058
1399
|
}
|
|
1059
1400
|
function isServiceMeImageCompressResult(value) {
|
|
1060
|
-
if (!
|
|
1401
|
+
if (!isRecord13(value)) {
|
|
1061
1402
|
return false;
|
|
1062
1403
|
}
|
|
1063
1404
|
return typeof value.originalSize === "number" && typeof value.compressedSize === "number" && typeof value.compressionRatio === "number" && typeof value.outputPath === "string";
|
|
1064
1405
|
}
|
|
1065
1406
|
function isServiceMeImageInfo(value) {
|
|
1066
|
-
if (!
|
|
1407
|
+
if (!isRecord13(value)) {
|
|
1067
1408
|
return false;
|
|
1068
1409
|
}
|
|
1069
1410
|
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");
|
|
1070
1411
|
}
|
|
1071
1412
|
function isServiceMeImageValidationResult(value) {
|
|
1072
|
-
return
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
// src/json.ts
|
|
1076
|
-
var JSON_SORT_ALGORITHMS = [
|
|
1077
|
-
"default",
|
|
1078
|
-
"keyLength",
|
|
1079
|
-
"alphaNum",
|
|
1080
|
-
"values",
|
|
1081
|
-
"type"
|
|
1082
|
-
];
|
|
1083
|
-
var JSON_SORT_ORDERS = ["asc", "desc"];
|
|
1084
|
-
var DEFAULT_JSON_SORT_OPTIONS = {
|
|
1085
|
-
sortOrder: "asc",
|
|
1086
|
-
sortAlgo: "default"
|
|
1087
|
-
};
|
|
1088
|
-
function isRecord12(value) {
|
|
1089
|
-
return typeof value === "object" && value !== null;
|
|
1090
|
-
}
|
|
1091
|
-
function isJsonSortAlgorithm(value) {
|
|
1092
|
-
return typeof value === "string" && JSON_SORT_ALGORITHMS.includes(value);
|
|
1093
|
-
}
|
|
1094
|
-
function isJsonSortOrder(value) {
|
|
1095
|
-
return typeof value === "string" && JSON_SORT_ORDERS.includes(value);
|
|
1096
|
-
}
|
|
1097
|
-
function isJsonSortOptions(value) {
|
|
1098
|
-
return isRecord12(value) && isJsonSortOrder(value.sortOrder) && isJsonSortAlgorithm(value.sortAlgo);
|
|
1099
|
-
}
|
|
1100
|
-
function isJsonValidationResult(value) {
|
|
1101
|
-
return isRecord12(value) && typeof value.valid === "boolean" && (value.error === void 0 || typeof value.error === "string");
|
|
1102
|
-
}
|
|
1103
|
-
function isJsonOutputResult(value) {
|
|
1104
|
-
return isRecord12(value) && typeof value.output === "string";
|
|
1413
|
+
return isRecord13(value) && typeof value.valid === "boolean";
|
|
1105
1414
|
}
|
|
1106
1415
|
|
|
1107
1416
|
// src/metadata.ts
|
|
1108
1417
|
var SERVICEME_CLI_NAME = "serviceme";
|
|
1109
|
-
var SERVICEME_CLI_VERSION = "
|
|
1418
|
+
var SERVICEME_CLI_VERSION = "2.0.0";
|
|
1110
1419
|
var SERVICEME_CLI_CAPABILITIES = {
|
|
1111
1420
|
bridge: true,
|
|
1112
1421
|
tasks: 1,
|
|
@@ -1117,32 +1426,32 @@ var SERVICEME_CLI_CAPABILITIES = {
|
|
|
1117
1426
|
};
|
|
1118
1427
|
|
|
1119
1428
|
// src/project.ts
|
|
1120
|
-
function
|
|
1429
|
+
function isRecord14(value) {
|
|
1121
1430
|
return typeof value === "object" && value !== null;
|
|
1122
1431
|
}
|
|
1123
1432
|
function isServiceMeProjectScaffoldPruneResult(value) {
|
|
1124
|
-
if (!
|
|
1433
|
+
if (!isRecord14(value)) {
|
|
1125
1434
|
return false;
|
|
1126
1435
|
}
|
|
1127
1436
|
return typeof value.applied === "boolean" && typeof value.preset === "string" && Array.isArray(value.commands) && value.commands.every((command) => typeof command === "string");
|
|
1128
1437
|
}
|
|
1129
1438
|
function isServiceMeProjectGitInitResult(value) {
|
|
1130
|
-
return
|
|
1439
|
+
return isRecord14(value) && typeof value.initialized === "boolean" && typeof value.command === "string";
|
|
1131
1440
|
}
|
|
1132
1441
|
function isServiceMeProjectMakeScriptsExecutableResult(value) {
|
|
1133
|
-
if (!
|
|
1442
|
+
if (!isRecord14(value)) {
|
|
1134
1443
|
return false;
|
|
1135
1444
|
}
|
|
1136
1445
|
return typeof value.processedCount === "number" && typeof value.updatedCount === "number" && typeof value.platform === "string" && Array.isArray(value.scripts) && value.scripts.every((script) => typeof script === "string");
|
|
1137
1446
|
}
|
|
1138
1447
|
function isServiceMeProjectInstallDepsResult(value) {
|
|
1139
|
-
return
|
|
1448
|
+
return isRecord14(value) && typeof value.installed === "boolean" && typeof value.command === "string";
|
|
1140
1449
|
}
|
|
1141
1450
|
function isServiceMeProjectExtractTemplateInput(value) {
|
|
1142
|
-
return
|
|
1451
|
+
return isRecord14(value) && typeof value.extractedDirName === "string" && typeof value.projectFilePattern === "string";
|
|
1143
1452
|
}
|
|
1144
1453
|
function isServiceMeProjectExtractTemplateResult(value) {
|
|
1145
|
-
return
|
|
1454
|
+
return isRecord14(value) && typeof value.actualDirName === "string";
|
|
1146
1455
|
}
|
|
1147
1456
|
|
|
1148
1457
|
// src/skill.ts
|
|
@@ -1163,7 +1472,7 @@ var VALID_SKILL_MUTATION_ACTIONS = [
|
|
|
1163
1472
|
"republish",
|
|
1164
1473
|
"submit-to-official"
|
|
1165
1474
|
];
|
|
1166
|
-
function
|
|
1475
|
+
function isRecord15(value) {
|
|
1167
1476
|
return typeof value === "object" && value !== null;
|
|
1168
1477
|
}
|
|
1169
1478
|
function isSkillScope(value) {
|
|
@@ -1175,7 +1484,7 @@ function isSkillScopeStatus(value) {
|
|
|
1175
1484
|
function isSkillMutationAction(value) {
|
|
1176
1485
|
return typeof value === "string" && VALID_SKILL_MUTATION_ACTIONS.includes(value);
|
|
1177
1486
|
}
|
|
1178
|
-
function
|
|
1487
|
+
function isStringArray3(value) {
|
|
1179
1488
|
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
1180
1489
|
}
|
|
1181
1490
|
function isSafeResourceId2(value) {
|
|
@@ -1191,42 +1500,43 @@ function isSafeResourceId2(value) {
|
|
|
1191
1500
|
);
|
|
1192
1501
|
}
|
|
1193
1502
|
function isSkillScopeState(value) {
|
|
1194
|
-
if (!
|
|
1503
|
+
if (!isRecord15(value)) {
|
|
1195
1504
|
return false;
|
|
1196
1505
|
}
|
|
1197
1506
|
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");
|
|
1198
1507
|
}
|
|
1199
1508
|
function isSkillMarketplaceEntry(value) {
|
|
1200
|
-
if (!
|
|
1509
|
+
if (!isRecord15(value)) {
|
|
1201
1510
|
return false;
|
|
1202
1511
|
}
|
|
1203
1512
|
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);
|
|
1204
1513
|
}
|
|
1205
1514
|
function isSkillMarketplaceState(value) {
|
|
1206
|
-
if (!
|
|
1515
|
+
if (!isRecord15(value)) {
|
|
1207
1516
|
return false;
|
|
1208
1517
|
}
|
|
1209
|
-
return typeof value.configPath === "string" && typeof value.userSkillsPath === "string" && Array.isArray(value.skills) && value.skills.every((entry) => isSkillMarketplaceEntry(entry)) && (value.enabledSkillIds === void 0 ||
|
|
1518
|
+
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");
|
|
1210
1519
|
}
|
|
1211
1520
|
function isSkillMutationRequest(value) {
|
|
1212
|
-
return
|
|
1521
|
+
return isRecord15(value) && isSafeResourceId2(value.skillId) && isSkillScope(value.targetScope) && isSkillMutationAction(value.action) && (value.confirmed === void 0 || typeof value.confirmed === "boolean");
|
|
1213
1522
|
}
|
|
1214
1523
|
function isSkillMutationResult(value) {
|
|
1215
|
-
return
|
|
1524
|
+
return isRecord15(value) && isSkillMarketplaceState(value.state) && typeof value.skillId === "string" && isSkillScope(value.targetScope) && isSkillMutationAction(value.action) && typeof value.changed === "boolean" && (value.status === "success" || value.status === "blocked" || value.status === "requires_confirmation") && (value.message === void 0 || typeof value.message === "string") && (value.hasScripts === void 0 || typeof value.hasScripts === "boolean") && (value.hasHooks === void 0 || typeof value.hasHooks === "boolean") && (value.prUrl === void 0 || typeof value.prUrl === "string") && (value.fromVersion === void 0 || typeof value.fromVersion === "string") && (value.toVersion === void 0 || typeof value.toVersion === "string");
|
|
1216
1525
|
}
|
|
1217
1526
|
function isSkillReconcileResult(value) {
|
|
1218
|
-
return
|
|
1527
|
+
return isRecord15(value) && isSkillMarketplaceState(value.state) && typeof value.changed === "boolean";
|
|
1219
1528
|
}
|
|
1220
1529
|
function isPublishableSkillEntry(value) {
|
|
1221
|
-
return
|
|
1530
|
+
return isRecord15(value) && typeof value.id === "string" && typeof value.displayName === "string" && typeof value.path === "string" && (value.version === void 0 || typeof value.version === "string");
|
|
1222
1531
|
}
|
|
1223
1532
|
function isSkillPublishableResult(value) {
|
|
1224
|
-
return
|
|
1533
|
+
return isRecord15(value) && Array.isArray(value.skills) && value.skills.every((entry) => isPublishableSkillEntry(entry));
|
|
1225
1534
|
}
|
|
1226
1535
|
export {
|
|
1227
1536
|
AUTH_PROVIDERS,
|
|
1228
1537
|
BRIDGE_EVENTS,
|
|
1229
1538
|
BRIDGE_METHODS,
|
|
1539
|
+
COPILOT_CONTENT_METHOD_ALIASES,
|
|
1230
1540
|
COPILOT_ERROR_CODES,
|
|
1231
1541
|
DEFAULT_JSON_SORT_OPTIONS,
|
|
1232
1542
|
DEVICE_BINDING_STATES,
|
|
@@ -1271,6 +1581,38 @@ export {
|
|
|
1271
1581
|
isBridgeRequest,
|
|
1272
1582
|
isBridgeResponse,
|
|
1273
1583
|
isCliEnvelope,
|
|
1584
|
+
isCopilotContentApproveResult,
|
|
1585
|
+
isCopilotContentIntegrationStatusResult,
|
|
1586
|
+
isCopilotContentMigrateLegacyResult,
|
|
1587
|
+
isCopilotContentRestoreResult,
|
|
1588
|
+
isCopilotContentStatusResult,
|
|
1589
|
+
isCopilotCustomizationViewPayload,
|
|
1590
|
+
isCopilotCustomizationsListParams,
|
|
1591
|
+
isCopilotCustomizationsListResult,
|
|
1592
|
+
isCopilotLegacyMigrateParams,
|
|
1593
|
+
isCopilotLegacyMigrateResult,
|
|
1594
|
+
isCopilotLegacyPreviewParams,
|
|
1595
|
+
isCopilotLegacyPreviewResult,
|
|
1596
|
+
isCopilotPackageInstallParams,
|
|
1597
|
+
isCopilotPackageInstallResult,
|
|
1598
|
+
isCopilotPackageMoveParams,
|
|
1599
|
+
isCopilotPackageMoveResult,
|
|
1600
|
+
isCopilotPackageUninstallParams,
|
|
1601
|
+
isCopilotPackageUninstallResult,
|
|
1602
|
+
isCopilotPackageUpdateParams,
|
|
1603
|
+
isCopilotPackageUpdateResult,
|
|
1604
|
+
isCopilotPluginListParams,
|
|
1605
|
+
isCopilotPluginListResult,
|
|
1606
|
+
isCopilotPluginRegisterParams,
|
|
1607
|
+
isCopilotPluginRegisterResult,
|
|
1608
|
+
isCopilotPluginUnregisterParams,
|
|
1609
|
+
isCopilotPluginUnregisterResult,
|
|
1610
|
+
isCopilotSourceListParams,
|
|
1611
|
+
isCopilotSourceListResult,
|
|
1612
|
+
isCopilotSourceRemoveParams,
|
|
1613
|
+
isCopilotSourceRemoveResult,
|
|
1614
|
+
isCopilotUpdatePreviewParams,
|
|
1615
|
+
isCopilotUpdatePreviewResult,
|
|
1274
1616
|
isDeviceBindingState,
|
|
1275
1617
|
isDeviceEnrollParams,
|
|
1276
1618
|
isDeviceEnrollResult,
|
|
@@ -1288,6 +1630,7 @@ export {
|
|
|
1288
1630
|
isJsonSortOrder,
|
|
1289
1631
|
isJsonValidationResult,
|
|
1290
1632
|
isKnownEnvironmentTool,
|
|
1633
|
+
isRecord4 as isRecord,
|
|
1291
1634
|
isRepoAddParams,
|
|
1292
1635
|
isRepoAddResult,
|
|
1293
1636
|
isRepoDisableParams,
|
|
@@ -1342,6 +1685,8 @@ export {
|
|
|
1342
1685
|
isSkillRepoListLinkedResult,
|
|
1343
1686
|
isSkillRepoListParams,
|
|
1344
1687
|
isSkillRepoListResult,
|
|
1688
|
+
isSkillRepoSetEntryEnabledParams,
|
|
1689
|
+
isSkillRepoSetEntryEnabledResult,
|
|
1345
1690
|
isSkillRepoUninstallParams,
|
|
1346
1691
|
isSkillRepoUninstallResult,
|
|
1347
1692
|
isSystemHelloResult,
|
|
@@ -1369,5 +1714,6 @@ export {
|
|
|
1369
1714
|
isToolboxUpdateResult,
|
|
1370
1715
|
migrateTaskV1ToV2,
|
|
1371
1716
|
migrateV1ToV2,
|
|
1717
|
+
normalizeBridgeMethod,
|
|
1372
1718
|
normalizeServicemeError
|
|
1373
1719
|
};
|