@serviceme/devtools-protocol 1.0.0 → 2.0.1
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 +487 -6
- package/dist/index.d.ts +487 -6
- package/dist/index.js +584 -144
- package/dist/index.mjs +543 -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,198 @@ 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";
|
|
501
|
+
}
|
|
502
|
+
function isSkillKind(value) {
|
|
503
|
+
return value === "skill" || value === "agent";
|
|
504
|
+
}
|
|
505
|
+
function isCopilotContentDetectUnmanagedParams(value) {
|
|
506
|
+
return isRecord5(value) && typeof value.workspaceDir === "string";
|
|
507
|
+
}
|
|
508
|
+
function isCopilotContentDetectUnmanagedResult(value) {
|
|
509
|
+
if (!isRecord5(value)) return false;
|
|
510
|
+
if (!Array.isArray(value.adoptions) || !Array.isArray(value.ambiguous)) return false;
|
|
511
|
+
if (!Array.isArray(value.integrations) || !Array.isArray(value.unmatched)) return false;
|
|
512
|
+
return value.adoptions.every(
|
|
513
|
+
(a) => isRecord5(a) && typeof a.repoId === "string" && typeof a.name === "string" && isSkillKind(a.kind) && (a.source === "symlink" || a.source === "fingerprint")
|
|
514
|
+
) && value.ambiguous.every(
|
|
515
|
+
(a) => isRecord5(a) && typeof a.name === "string" && isSkillKind(a.kind) && Array.isArray(a.candidates) && a.candidates.every((c) => typeof c === "string")
|
|
516
|
+
) && value.integrations.every(
|
|
517
|
+
(i) => isRecord5(i) && typeof i.repoId === "string" && typeof i.pluginId === "string" && (i.kind === "hook" || i.kind === "mcp")
|
|
518
|
+
) && value.unmatched.every(
|
|
519
|
+
(u) => isRecord5(u) && typeof u.name === "string" && typeof u.reason === "string"
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
function isCopilotContentAdoptUnmanagedParams(value) {
|
|
523
|
+
if (!isRecord5(value) || typeof value.workspaceDir !== "string") return false;
|
|
524
|
+
if (!Array.isArray(value.entries)) return false;
|
|
525
|
+
if (!value.entries.every(
|
|
526
|
+
(e) => isRecord5(e) && typeof e.repoId === "string" && typeof e.name === "string" && isSkillKind(e.kind) && (e.convertRealCopy === void 0 || typeof e.convertRealCopy === "boolean")
|
|
527
|
+
)) {
|
|
528
|
+
return false;
|
|
529
|
+
}
|
|
530
|
+
if (value.integrations !== void 0 && !Array.isArray(value.integrations)) return false;
|
|
531
|
+
if (Array.isArray(value.integrations)) {
|
|
532
|
+
return value.integrations.every(
|
|
533
|
+
(i) => isRecord5(i) && typeof i.repoId === "string" && typeof i.pluginId === "string" && (i.kind === "hook" || i.kind === "mcp")
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
return true;
|
|
537
|
+
}
|
|
538
|
+
function isCopilotContentAdoptUnmanagedResult(value) {
|
|
539
|
+
if (!isRecord5(value) || typeof value.changed !== "boolean") return false;
|
|
540
|
+
if (!Array.isArray(value.entries)) return false;
|
|
541
|
+
return value.entries.every(
|
|
542
|
+
(e) => isRecord5(e) && typeof e.identity === "string" && typeof e.status === "string" && (e.message === void 0 || typeof e.message === "string")
|
|
543
|
+
);
|
|
274
544
|
}
|
|
275
545
|
function isSkillRepoListLinkedResult(value) {
|
|
276
|
-
return
|
|
546
|
+
return isRecord5(value) && Array.isArray(value.links) && value.links.every(isLinkedSkill);
|
|
277
547
|
}
|
|
278
548
|
function isSkillRepoDraftCreateResult(value) {
|
|
279
|
-
return
|
|
549
|
+
return isRecord5(value) && typeof value.id === "string";
|
|
280
550
|
}
|
|
281
551
|
function isSkillRepoDraftCommitResult(value) {
|
|
282
|
-
return
|
|
552
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.skillName === "string" && typeof value.commitSha === "string" && isStringOrUndefined2(value.pushedRef) && isStringOrUndefined2(value.pushedSha);
|
|
283
553
|
}
|
|
284
554
|
function isSkillRepoDraftListResult(value) {
|
|
285
|
-
return
|
|
286
|
-
(d) =>
|
|
555
|
+
return isRecord5(value) && Array.isArray(value.drafts) && value.drafts.every(
|
|
556
|
+
(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
557
|
);
|
|
288
558
|
}
|
|
289
559
|
function isSkillRepoDraftDeleteResult(value) {
|
|
290
|
-
return
|
|
560
|
+
return isRecord5(value) && value.deleted === true;
|
|
291
561
|
}
|
|
292
562
|
function isRepoListResult(value) {
|
|
293
|
-
return
|
|
563
|
+
return isRecord5(value) && Array.isArray(value.repos) && value.repos.every(isRepoEntry);
|
|
294
564
|
}
|
|
295
565
|
function isRepoAddResult(value) {
|
|
296
|
-
return
|
|
566
|
+
return isRecord5(value) && isRepoEntry(value.repo) && typeof value.branch === "string" && typeof value.cloned === "boolean";
|
|
297
567
|
}
|
|
298
568
|
function isRepoRemoveResult(value) {
|
|
299
|
-
return
|
|
569
|
+
return isRecord5(value) && value.removed === true;
|
|
300
570
|
}
|
|
301
571
|
function isRepoEnableResult(value) {
|
|
302
|
-
return
|
|
572
|
+
return isRecord5(value) && isRepoEntry(value.repo);
|
|
303
573
|
}
|
|
304
574
|
function isRepoDisableResult(value) {
|
|
305
|
-
return
|
|
575
|
+
return isRecord5(value) && isRepoEntry(value.repo);
|
|
306
576
|
}
|
|
307
577
|
function isRepoUpdateResult(value) {
|
|
308
|
-
return
|
|
578
|
+
return isRecord5(value) && isRepoEntry(value.repo);
|
|
309
579
|
}
|
|
310
580
|
function isRepoSyncResult(value) {
|
|
311
|
-
return
|
|
581
|
+
return isRecord5(value) && Array.isArray(value.pulls) && value.pulls.length >= 1 && value.pulls.every(isSyncPull);
|
|
312
582
|
}
|
|
313
583
|
function isRepoSyncAllResult(value) {
|
|
314
|
-
return
|
|
584
|
+
return isRecord5(value) && Array.isArray(value.pulls) && value.pulls.every(isSyncPull);
|
|
585
|
+
}
|
|
586
|
+
function isCopilotContentRestoreResult(value) {
|
|
587
|
+
return isRecord5(value) && typeof value.changed === "boolean" && Array.isArray(value.entries) && value.entries.every(isCopilotContentEntry);
|
|
588
|
+
}
|
|
589
|
+
function isCopilotContentStatusResult(value) {
|
|
590
|
+
return isCopilotContentRestoreResult(value);
|
|
591
|
+
}
|
|
592
|
+
function isCopilotContentApproveResult(value) {
|
|
593
|
+
return isCopilotContentRestoreResult(value);
|
|
594
|
+
}
|
|
595
|
+
function isCopilotContentMigrateLegacyResult(value) {
|
|
596
|
+
return isRecord5(value) && Array.isArray(value.entries) && value.entries.every(isCopilotContentEntry);
|
|
597
|
+
}
|
|
598
|
+
function isCopilotContentIntegrationStatusResult(value) {
|
|
599
|
+
return isRecord5(value) && Array.isArray(value.integrations) && value.integrations.every(isCopilotContentIntegration);
|
|
315
600
|
}
|
|
316
601
|
function isSkillRepoListParams(value) {
|
|
317
|
-
return
|
|
602
|
+
return isRecord5(value) && isStringOrUndefined2(value.repoId) && isSkillKindOrUndefined(value.kind) && isStringOrUndefined2(value.workspaceDir);
|
|
318
603
|
}
|
|
319
604
|
function isSkillRepoGetParams(value) {
|
|
320
|
-
return
|
|
605
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string";
|
|
321
606
|
}
|
|
322
607
|
function isSkillRepoInstallParams(value) {
|
|
323
|
-
return
|
|
608
|
+
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
609
|
}
|
|
325
610
|
function isSkillRepoConvertToSymlinkParams(value) {
|
|
326
|
-
return
|
|
611
|
+
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
612
|
}
|
|
328
613
|
function isSkillRepoUninstallParams(value) {
|
|
329
|
-
return
|
|
614
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkScopeOrUndefined(value.scope);
|
|
615
|
+
}
|
|
616
|
+
function isSkillRepoSetEntryEnabledParams(value) {
|
|
617
|
+
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
618
|
}
|
|
331
619
|
function isSkillRepoListLinkedParams(value) {
|
|
332
|
-
return
|
|
620
|
+
return isRecord5(value) && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkScopeFilterOrUndefined(value.scope);
|
|
333
621
|
}
|
|
334
622
|
function isRepoListParams(value) {
|
|
335
|
-
return
|
|
623
|
+
return isRecord5(value) && (value.source === void 0 || value.source === "default" || value.source === "user");
|
|
336
624
|
}
|
|
337
625
|
function isRepoAddParams(value) {
|
|
338
|
-
return
|
|
626
|
+
return isRecord5(value) && typeof value.url === "string" && isStringOrUndefined2(value.branch) && isStringOrUndefined2(value.name) && isBooleanOrUndefined(value.useProxy);
|
|
339
627
|
}
|
|
340
628
|
function isRepoRemoveParams(value) {
|
|
341
|
-
return
|
|
629
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
342
630
|
}
|
|
343
631
|
function isRepoEnableParams(value) {
|
|
344
|
-
return
|
|
632
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
345
633
|
}
|
|
346
634
|
function isRepoDisableParams(value) {
|
|
347
|
-
return
|
|
635
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
348
636
|
}
|
|
349
637
|
function isRepoSyncParams(value) {
|
|
350
|
-
return
|
|
638
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
351
639
|
}
|
|
352
640
|
function isRepoSyncAllParams(value) {
|
|
353
|
-
return
|
|
641
|
+
return isRecord5(value);
|
|
354
642
|
}
|
|
355
643
|
|
|
356
644
|
// src/device.ts
|
|
@@ -360,7 +648,7 @@ var DEVICE_BINDING_STATES = [
|
|
|
360
648
|
"claimed",
|
|
361
649
|
"expired"
|
|
362
650
|
];
|
|
363
|
-
function
|
|
651
|
+
function isRecord6(value) {
|
|
364
652
|
return typeof value === "object" && value !== null;
|
|
365
653
|
}
|
|
366
654
|
function isStringOrUndefined3(value) {
|
|
@@ -370,7 +658,7 @@ function isDeviceBindingState(value) {
|
|
|
370
658
|
return value === "anonymous" || value === "pending" || value === "claimed" || value === "expired";
|
|
371
659
|
}
|
|
372
660
|
function isDeviceIdentityState(value) {
|
|
373
|
-
if (!
|
|
661
|
+
if (!isRecord6(value)) return false;
|
|
374
662
|
if (typeof value.publicId !== "string") return false;
|
|
375
663
|
if (value.publicId.length === 0) return false;
|
|
376
664
|
if (typeof value.secretVersion !== "number") return false;
|
|
@@ -380,7 +668,7 @@ function isDeviceIdentityState(value) {
|
|
|
380
668
|
return true;
|
|
381
669
|
}
|
|
382
670
|
function isDeviceMetadata(value) {
|
|
383
|
-
if (!
|
|
671
|
+
if (!isRecord6(value)) return false;
|
|
384
672
|
if (typeof value.installationId !== "string") return false;
|
|
385
673
|
if (value.installationId.length === 0) return false;
|
|
386
674
|
if (typeof value.machineId !== "string") return false;
|
|
@@ -393,7 +681,7 @@ function isDeviceMetadata(value) {
|
|
|
393
681
|
return true;
|
|
394
682
|
}
|
|
395
683
|
function isDeviceStatus(value) {
|
|
396
|
-
if (!
|
|
684
|
+
if (!isRecord6(value)) return false;
|
|
397
685
|
if (!isDeviceBindingState(value.bindingState)) return false;
|
|
398
686
|
if (value.identity !== void 0 && !isDeviceIdentityState(value.identity)) {
|
|
399
687
|
return false;
|
|
@@ -406,10 +694,10 @@ function isDeviceStatus(value) {
|
|
|
406
694
|
return true;
|
|
407
695
|
}
|
|
408
696
|
function isDeviceEnrollParams(value) {
|
|
409
|
-
return
|
|
697
|
+
return isRecord6(value) && (value.force === void 0 || typeof value.force === "boolean") && (value.requireAuth === void 0 || typeof value.requireAuth === "boolean");
|
|
410
698
|
}
|
|
411
699
|
function isDeviceEnrollResult(value) {
|
|
412
|
-
if (!
|
|
700
|
+
if (!isRecord6(value)) return false;
|
|
413
701
|
if (typeof value.publicId !== "string") return false;
|
|
414
702
|
if (value.publicId.length === 0) return false;
|
|
415
703
|
if (!isDeviceBindingState(value.bindingState)) return false;
|
|
@@ -417,14 +705,14 @@ function isDeviceEnrollResult(value) {
|
|
|
417
705
|
return true;
|
|
418
706
|
}
|
|
419
707
|
function isDeviceRotateSecretParams(value) {
|
|
420
|
-
if (!
|
|
708
|
+
if (!isRecord6(value)) return false;
|
|
421
709
|
if (value.gracePeriodDays !== void 0 && (typeof value.gracePeriodDays !== "number" || !Number.isInteger(value.gracePeriodDays) || value.gracePeriodDays < 0 || value.gracePeriodDays > 365)) {
|
|
422
710
|
return false;
|
|
423
711
|
}
|
|
424
712
|
return true;
|
|
425
713
|
}
|
|
426
714
|
function isDeviceRotateSecretResult(value) {
|
|
427
|
-
if (!
|
|
715
|
+
if (!isRecord6(value)) return false;
|
|
428
716
|
if (typeof value.publicId !== "string") return false;
|
|
429
717
|
if (value.publicId.length === 0) return false;
|
|
430
718
|
if (typeof value.secretVersion !== "number") return false;
|
|
@@ -451,18 +739,18 @@ var VALID_TERMINAL_STATUSES = [
|
|
|
451
739
|
"timeout",
|
|
452
740
|
"cancelled"
|
|
453
741
|
];
|
|
454
|
-
function
|
|
742
|
+
function isRecord7(value) {
|
|
455
743
|
return typeof value === "object" && value !== null;
|
|
456
744
|
}
|
|
457
745
|
function isScheduledTaskType(value) {
|
|
458
746
|
return typeof value === "string" && VALID_TASK_TYPES.includes(value);
|
|
459
747
|
}
|
|
460
748
|
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) &&
|
|
749
|
+
if (!isRecord7(value)) return false;
|
|
750
|
+
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
751
|
}
|
|
464
752
|
function isTaskWorkspaceRef(value) {
|
|
465
|
-
if (!
|
|
753
|
+
if (!isRecord7(value)) return false;
|
|
466
754
|
if (typeof value.path !== "string" || value.path.length === 0) return false;
|
|
467
755
|
if (typeof value.name !== "string" || value.name.length === 0) return false;
|
|
468
756
|
if (value.gitRemote !== void 0 && typeof value.gitRemote !== "string") {
|
|
@@ -481,48 +769,48 @@ function isScheduledTask(value) {
|
|
|
481
769
|
return isTaskWorkspaceRef(value.workspace);
|
|
482
770
|
}
|
|
483
771
|
function isScheduledTasksConfig(value) {
|
|
484
|
-
if (!
|
|
772
|
+
if (!isRecord7(value)) return false;
|
|
485
773
|
if (value.version !== 2) return false;
|
|
486
774
|
if (!Array.isArray(value.tasks)) return false;
|
|
487
775
|
return value.tasks.every((t) => isScheduledTask(t));
|
|
488
776
|
}
|
|
489
777
|
function isScheduledTasksConfigV1(value) {
|
|
490
|
-
if (!
|
|
778
|
+
if (!isRecord7(value)) return false;
|
|
491
779
|
if (value.version !== 1) return false;
|
|
492
780
|
if (!Array.isArray(value.tasks)) return false;
|
|
493
781
|
return value.tasks.every((t) => isScheduledTaskV1(t));
|
|
494
782
|
}
|
|
495
783
|
function isTaskExecutionLog(value) {
|
|
496
|
-
if (!
|
|
784
|
+
if (!isRecord7(value)) return false;
|
|
497
785
|
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
786
|
}
|
|
499
787
|
function isSchedulerStatus(value) {
|
|
500
|
-
if (!
|
|
788
|
+
if (!isRecord7(value)) return false;
|
|
501
789
|
return typeof value.running === "boolean" && typeof value.tasksRegistered === "number" && typeof value.workspacePath === "string";
|
|
502
790
|
}
|
|
503
791
|
function isTaskExecuteResult(value) {
|
|
504
|
-
return
|
|
792
|
+
return isRecord7(value) && typeof value.executionId === "string" && value.accepted === true;
|
|
505
793
|
}
|
|
506
794
|
function isTaskCancelResult(value) {
|
|
507
|
-
return
|
|
795
|
+
return isRecord7(value) && typeof value.executionId === "string" && typeof value.cancelled === "boolean";
|
|
508
796
|
}
|
|
509
797
|
function isTaskListRunningResult(value) {
|
|
510
|
-
return
|
|
798
|
+
return isRecord7(value) && Array.isArray(value.executions);
|
|
511
799
|
}
|
|
512
800
|
function isTaskStartedEventParams(value) {
|
|
513
|
-
return
|
|
801
|
+
return isRecord7(value) && typeof value.executionId === "string" && typeof value.taskId === "string" && typeof value.startedAt === "string";
|
|
514
802
|
}
|
|
515
803
|
function isTaskOutputEventParams(value) {
|
|
516
|
-
return
|
|
804
|
+
return isRecord7(value) && typeof value.executionId === "string" && (value.stream === "stdout" || value.stream === "stderr") && typeof value.data === "string";
|
|
517
805
|
}
|
|
518
806
|
function isTaskCompletedEventParams(value) {
|
|
519
|
-
return
|
|
807
|
+
return isRecord7(value) && typeof value.executionId === "string" && isTaskExecutionLog(value.log);
|
|
520
808
|
}
|
|
521
809
|
function isTaskFailedEventParams(value) {
|
|
522
|
-
return
|
|
810
|
+
return isRecord7(value) && typeof value.executionId === "string" && (value.status === "failure" || value.status === "timeout") && (value.reason === "error" || value.reason === "timeout") && isTaskExecutionLog(value.log);
|
|
523
811
|
}
|
|
524
812
|
function isTaskCancelledEventParams(value) {
|
|
525
|
-
return
|
|
813
|
+
return isRecord7(value) && typeof value.executionId === "string" && isTaskExecutionLog(value.log);
|
|
526
814
|
}
|
|
527
815
|
function isAgentSessionStatus(value) {
|
|
528
816
|
return value === "idle" || value === "running" || value === "needs-input" || value === "completed" || value === "failed" || value === "aborted";
|
|
@@ -556,7 +844,7 @@ function migrateV1ToV2(v1Config, workspace) {
|
|
|
556
844
|
|
|
557
845
|
// src/toolbox.ts
|
|
558
846
|
var TOOLBOX_SCOPES = ["user", "workspace"];
|
|
559
|
-
function
|
|
847
|
+
function isRecord8(value) {
|
|
560
848
|
return typeof value === "object" && value !== null;
|
|
561
849
|
}
|
|
562
850
|
function isStringOrUndefined4(value) {
|
|
@@ -569,7 +857,7 @@ function isToolboxScope(value) {
|
|
|
569
857
|
return value === "user" || value === "workspace";
|
|
570
858
|
}
|
|
571
859
|
function isExternalTool(value) {
|
|
572
|
-
if (!
|
|
860
|
+
if (!isRecord8(value)) return false;
|
|
573
861
|
if (typeof value.id !== "string") return false;
|
|
574
862
|
if (value.id.length === 0) return false;
|
|
575
863
|
if (typeof value.name !== "string") return false;
|
|
@@ -587,7 +875,7 @@ function isExternalTool(value) {
|
|
|
587
875
|
return true;
|
|
588
876
|
}
|
|
589
877
|
function isExternalToolPatch(value) {
|
|
590
|
-
if (!
|
|
878
|
+
if (!isRecord8(value)) return false;
|
|
591
879
|
if (value.name !== void 0) {
|
|
592
880
|
if (typeof value.name !== "string" || value.name.length === 0) return false;
|
|
593
881
|
}
|
|
@@ -607,7 +895,7 @@ function isExternalToolPatch(value) {
|
|
|
607
895
|
return true;
|
|
608
896
|
}
|
|
609
897
|
function isToolboxList(value) {
|
|
610
|
-
if (!
|
|
898
|
+
if (!isRecord8(value)) return false;
|
|
611
899
|
if (!isToolboxScope(value.scope)) return false;
|
|
612
900
|
if (!Array.isArray(value.tools)) return false;
|
|
613
901
|
for (const tool of value.tools) {
|
|
@@ -616,26 +904,26 @@ function isToolboxList(value) {
|
|
|
616
904
|
return true;
|
|
617
905
|
}
|
|
618
906
|
function isToolboxListParams(value) {
|
|
619
|
-
return
|
|
907
|
+
return isRecord8(value) && (value.scope === void 0 || isToolboxScope(value.scope));
|
|
620
908
|
}
|
|
621
909
|
function isToolboxAddParams(value) {
|
|
622
910
|
return isExternalTool(value);
|
|
623
911
|
}
|
|
624
912
|
function isToolboxAddResult(value) {
|
|
625
|
-
if (!
|
|
913
|
+
if (!isRecord8(value)) return false;
|
|
626
914
|
if (!isToolboxScope(value.scope)) return false;
|
|
627
915
|
if (!isExternalTool(value.tool)) return false;
|
|
628
916
|
return true;
|
|
629
917
|
}
|
|
630
918
|
function isToolboxRemoveParams(value) {
|
|
631
|
-
if (!
|
|
919
|
+
if (!isRecord8(value)) return false;
|
|
632
920
|
if (typeof value.id !== "string") return false;
|
|
633
921
|
if (value.id.length === 0) return false;
|
|
634
922
|
if (value.scope !== void 0 && !isToolboxScope(value.scope)) return false;
|
|
635
923
|
return true;
|
|
636
924
|
}
|
|
637
925
|
function isToolboxRemoveResult(value) {
|
|
638
|
-
if (!
|
|
926
|
+
if (!isRecord8(value)) return false;
|
|
639
927
|
if (!isToolboxScope(value.scope)) return false;
|
|
640
928
|
if (typeof value.toolId !== "string") return false;
|
|
641
929
|
if (value.toolId.length === 0) return false;
|
|
@@ -643,7 +931,7 @@ function isToolboxRemoveResult(value) {
|
|
|
643
931
|
return true;
|
|
644
932
|
}
|
|
645
933
|
function isToolboxUpdateParams(value) {
|
|
646
|
-
if (!
|
|
934
|
+
if (!isRecord8(value)) return false;
|
|
647
935
|
if (typeof value.id !== "string") return false;
|
|
648
936
|
if (value.id.length === 0) return false;
|
|
649
937
|
if (!isExternalToolPatch(value.patch)) return false;
|
|
@@ -651,7 +939,7 @@ function isToolboxUpdateParams(value) {
|
|
|
651
939
|
return true;
|
|
652
940
|
}
|
|
653
941
|
function isToolboxUpdateResult(value) {
|
|
654
|
-
if (!
|
|
942
|
+
if (!isRecord8(value)) return false;
|
|
655
943
|
if (!isToolboxScope(value.scope)) return false;
|
|
656
944
|
if (!isExternalTool(value.tool)) return false;
|
|
657
945
|
return true;
|
|
@@ -659,14 +947,14 @@ function isToolboxUpdateResult(value) {
|
|
|
659
947
|
|
|
660
948
|
// src/bridge.ts
|
|
661
949
|
var SERVICEME_PROTOCOL_VERSION = 2;
|
|
662
|
-
function
|
|
950
|
+
function isRecord9(value) {
|
|
663
951
|
return typeof value === "object" && value !== null;
|
|
664
952
|
}
|
|
665
953
|
function isValidProtocolVersion(value) {
|
|
666
954
|
return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= SERVICEME_PROTOCOL_VERSION;
|
|
667
955
|
}
|
|
668
956
|
function isBridgeCapabilities(value) {
|
|
669
|
-
return
|
|
957
|
+
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
958
|
}
|
|
671
959
|
var BRIDGE_METHODS = [
|
|
672
960
|
"system.hello",
|
|
@@ -675,11 +963,25 @@ var BRIDGE_METHODS = [
|
|
|
675
963
|
"task.execute",
|
|
676
964
|
"task.cancel",
|
|
677
965
|
"task.list-running",
|
|
966
|
+
"copilotContent.list",
|
|
967
|
+
"copilotContent.get",
|
|
968
|
+
"copilotContent.install",
|
|
969
|
+
"copilotContent.convertToSymlink",
|
|
970
|
+
"copilotContent.uninstall",
|
|
971
|
+
"copilotContent.setEntryEnabled",
|
|
972
|
+
"copilotContent.detectUnmanaged",
|
|
973
|
+
"copilotContent.adoptUnmanaged",
|
|
974
|
+
"copilotContent.listLinked",
|
|
975
|
+
"copilotContent.draft.create",
|
|
976
|
+
"copilotContent.draft.commit",
|
|
977
|
+
"copilotContent.draft.list",
|
|
978
|
+
"copilotContent.draft.delete",
|
|
678
979
|
"skillRepo.list",
|
|
679
980
|
"skillRepo.get",
|
|
680
981
|
"skillRepo.install",
|
|
681
982
|
"skillRepo.convertToSymlink",
|
|
682
983
|
"skillRepo.uninstall",
|
|
984
|
+
"skillRepo.setEntryEnabled",
|
|
683
985
|
"skillRepo.listLinked",
|
|
684
986
|
"skillRepo.draft.create",
|
|
685
987
|
"skillRepo.draft.commit",
|
|
@@ -693,6 +995,25 @@ var BRIDGE_METHODS = [
|
|
|
693
995
|
"repo.update",
|
|
694
996
|
"repo.sync",
|
|
695
997
|
"repo.syncAll",
|
|
998
|
+
"repo.resetParseCache",
|
|
999
|
+
"copilotContent.status",
|
|
1000
|
+
"copilotContent.restore",
|
|
1001
|
+
"copilotContent.approve",
|
|
1002
|
+
"copilotContent.migrateLegacy",
|
|
1003
|
+
"copilotContent.integrationStatus",
|
|
1004
|
+
"copilotContent.customizations.list",
|
|
1005
|
+
"copilotContent.package.install",
|
|
1006
|
+
"copilotContent.package.update",
|
|
1007
|
+
"copilotContent.package.uninstall",
|
|
1008
|
+
"copilotContent.package.move",
|
|
1009
|
+
"copilotPlugin.list",
|
|
1010
|
+
"copilotPlugin.register",
|
|
1011
|
+
"copilotPlugin.unregister",
|
|
1012
|
+
"copilotContent.legacy.preview",
|
|
1013
|
+
"copilotContent.legacy.migrate",
|
|
1014
|
+
"copilotContent.sources.list",
|
|
1015
|
+
"copilotContent.sources.remove",
|
|
1016
|
+
"copilotContent.package.previewUpdate",
|
|
696
1017
|
"auth.status",
|
|
697
1018
|
"auth.login",
|
|
698
1019
|
"auth.logout",
|
|
@@ -706,6 +1027,22 @@ var BRIDGE_METHODS = [
|
|
|
706
1027
|
"toolbox.remove",
|
|
707
1028
|
"toolbox.update"
|
|
708
1029
|
];
|
|
1030
|
+
var COPILOT_CONTENT_METHOD_ALIASES = {
|
|
1031
|
+
"skillRepo.list": "copilotContent.list",
|
|
1032
|
+
"skillRepo.get": "copilotContent.get",
|
|
1033
|
+
"skillRepo.install": "copilotContent.install",
|
|
1034
|
+
"skillRepo.convertToSymlink": "copilotContent.convertToSymlink",
|
|
1035
|
+
"skillRepo.uninstall": "copilotContent.uninstall",
|
|
1036
|
+
"skillRepo.setEntryEnabled": "copilotContent.setEntryEnabled",
|
|
1037
|
+
"skillRepo.listLinked": "copilotContent.listLinked",
|
|
1038
|
+
"skillRepo.draft.create": "copilotContent.draft.create",
|
|
1039
|
+
"skillRepo.draft.commit": "copilotContent.draft.commit",
|
|
1040
|
+
"skillRepo.draft.list": "copilotContent.draft.list",
|
|
1041
|
+
"skillRepo.draft.delete": "copilotContent.draft.delete"
|
|
1042
|
+
};
|
|
1043
|
+
function normalizeBridgeMethod(method) {
|
|
1044
|
+
return COPILOT_CONTENT_METHOD_ALIASES[method] ?? method;
|
|
1045
|
+
}
|
|
709
1046
|
var BRIDGE_EVENTS = [
|
|
710
1047
|
"task.started",
|
|
711
1048
|
"task.output",
|
|
@@ -714,13 +1051,13 @@ var BRIDGE_EVENTS = [
|
|
|
714
1051
|
"task.cancelled"
|
|
715
1052
|
];
|
|
716
1053
|
function isSystemHelloResult(value) {
|
|
717
|
-
return
|
|
1054
|
+
return isRecord9(value) && typeof value.cliVersion === "string" && isValidProtocolVersion(value.protocolVersion) && isBridgeCapabilities(value.capabilities) && typeof value.pid === "number";
|
|
718
1055
|
}
|
|
719
1056
|
function isSystemPingResult(value) {
|
|
720
|
-
return
|
|
1057
|
+
return isRecord9(value) && typeof value.now === "string";
|
|
721
1058
|
}
|
|
722
1059
|
function isSystemShutdownResult(value) {
|
|
723
|
-
return
|
|
1060
|
+
return isRecord9(value) && value.shuttingDown === true;
|
|
724
1061
|
}
|
|
725
1062
|
function getBridgeResultValidator(method) {
|
|
726
1063
|
switch (method) {
|
|
@@ -736,24 +1073,41 @@ function getBridgeResultValidator(method) {
|
|
|
736
1073
|
return isTaskCancelResult;
|
|
737
1074
|
case "task.list-running":
|
|
738
1075
|
return isTaskListRunningResult;
|
|
1076
|
+
case "copilotContent.list":
|
|
739
1077
|
case "skillRepo.list":
|
|
740
1078
|
return isSkillRepoListResult;
|
|
1079
|
+
case "copilotContent.get":
|
|
741
1080
|
case "skillRepo.get":
|
|
742
1081
|
return isSkillRepoGetResult;
|
|
1082
|
+
case "copilotContent.install":
|
|
743
1083
|
case "skillRepo.install":
|
|
744
1084
|
return isSkillRepoInstallResult;
|
|
1085
|
+
case "copilotContent.convertToSymlink":
|
|
745
1086
|
case "skillRepo.convertToSymlink":
|
|
746
1087
|
return isSkillRepoConvertToSymlinkResult;
|
|
1088
|
+
case "copilotContent.uninstall":
|
|
747
1089
|
case "skillRepo.uninstall":
|
|
748
1090
|
return isSkillRepoUninstallResult;
|
|
1091
|
+
case "copilotContent.setEntryEnabled":
|
|
1092
|
+
case "skillRepo.setEntryEnabled":
|
|
1093
|
+
return isSkillRepoSetEntryEnabledResult;
|
|
1094
|
+
case "copilotContent.detectUnmanaged":
|
|
1095
|
+
return isCopilotContentDetectUnmanagedResult;
|
|
1096
|
+
case "copilotContent.adoptUnmanaged":
|
|
1097
|
+
return isCopilotContentAdoptUnmanagedResult;
|
|
1098
|
+
case "copilotContent.listLinked":
|
|
749
1099
|
case "skillRepo.listLinked":
|
|
750
1100
|
return isSkillRepoListLinkedResult;
|
|
1101
|
+
case "copilotContent.draft.create":
|
|
751
1102
|
case "skillRepo.draft.create":
|
|
752
1103
|
return isSkillRepoDraftCreateResult;
|
|
1104
|
+
case "copilotContent.draft.commit":
|
|
753
1105
|
case "skillRepo.draft.commit":
|
|
754
1106
|
return isSkillRepoDraftCommitResult;
|
|
1107
|
+
case "copilotContent.draft.list":
|
|
755
1108
|
case "skillRepo.draft.list":
|
|
756
1109
|
return isSkillRepoDraftListResult;
|
|
1110
|
+
case "copilotContent.draft.delete":
|
|
757
1111
|
case "skillRepo.draft.delete":
|
|
758
1112
|
return isSkillRepoDraftDeleteResult;
|
|
759
1113
|
case "repo.list":
|
|
@@ -772,6 +1126,42 @@ function getBridgeResultValidator(method) {
|
|
|
772
1126
|
return isRepoSyncResult;
|
|
773
1127
|
case "repo.syncAll":
|
|
774
1128
|
return isRepoSyncAllResult;
|
|
1129
|
+
case "copilotContent.status":
|
|
1130
|
+
return isCopilotContentStatusResult;
|
|
1131
|
+
case "copilotContent.restore":
|
|
1132
|
+
return isCopilotContentRestoreResult;
|
|
1133
|
+
case "copilotContent.approve":
|
|
1134
|
+
return isCopilotContentApproveResult;
|
|
1135
|
+
case "copilotContent.migrateLegacy":
|
|
1136
|
+
return isCopilotContentMigrateLegacyResult;
|
|
1137
|
+
case "copilotContent.integrationStatus":
|
|
1138
|
+
return isCopilotContentIntegrationStatusResult;
|
|
1139
|
+
case "copilotContent.customizations.list":
|
|
1140
|
+
return isCopilotCustomizationsListResult;
|
|
1141
|
+
case "copilotPlugin.list":
|
|
1142
|
+
return isCopilotPluginListResult;
|
|
1143
|
+
case "copilotPlugin.register":
|
|
1144
|
+
return isCopilotPluginRegisterResult;
|
|
1145
|
+
case "copilotPlugin.unregister":
|
|
1146
|
+
return isCopilotPluginUnregisterResult;
|
|
1147
|
+
case "copilotContent.package.install":
|
|
1148
|
+
return isCopilotPackageInstallResult;
|
|
1149
|
+
case "copilotContent.package.update":
|
|
1150
|
+
return isCopilotPackageUpdateResult;
|
|
1151
|
+
case "copilotContent.package.uninstall":
|
|
1152
|
+
return isCopilotPackageUninstallResult;
|
|
1153
|
+
case "copilotContent.package.move":
|
|
1154
|
+
return isCopilotPackageMoveResult;
|
|
1155
|
+
case "copilotContent.legacy.preview":
|
|
1156
|
+
return isCopilotLegacyPreviewResult;
|
|
1157
|
+
case "copilotContent.legacy.migrate":
|
|
1158
|
+
return isCopilotLegacyMigrateResult;
|
|
1159
|
+
case "copilotContent.sources.list":
|
|
1160
|
+
return isCopilotSourceListResult;
|
|
1161
|
+
case "copilotContent.sources.remove":
|
|
1162
|
+
return isCopilotSourceRemoveResult;
|
|
1163
|
+
case "copilotContent.package.previewUpdate":
|
|
1164
|
+
return isCopilotUpdatePreviewResult;
|
|
775
1165
|
case "auth.status":
|
|
776
1166
|
return isAuthStatus;
|
|
777
1167
|
case "auth.login":
|
|
@@ -823,13 +1213,13 @@ function isBridgeEventName(value) {
|
|
|
823
1213
|
return typeof value === "string" && BRIDGE_EVENTS.includes(value);
|
|
824
1214
|
}
|
|
825
1215
|
function isBridgeRequest(value) {
|
|
826
|
-
if (!
|
|
1216
|
+
if (!isRecord9(value)) {
|
|
827
1217
|
return false;
|
|
828
1218
|
}
|
|
829
1219
|
return isValidProtocolVersion(value.protocolVersion) && value.kind === "request" && typeof value.id === "string" && isBridgeMethod(value.method) && "params" in value;
|
|
830
1220
|
}
|
|
831
1221
|
function isBridgeResponse(value) {
|
|
832
|
-
if (!
|
|
1222
|
+
if (!isRecord9(value)) {
|
|
833
1223
|
return false;
|
|
834
1224
|
}
|
|
835
1225
|
if (!isValidProtocolVersion(value.protocolVersion) || value.kind !== "response" || typeof value.id !== "string" || typeof value.ok !== "boolean") {
|
|
@@ -841,7 +1231,7 @@ function isBridgeResponse(value) {
|
|
|
841
1231
|
return "error" in value;
|
|
842
1232
|
}
|
|
843
1233
|
function isBridgeEvent(value) {
|
|
844
|
-
if (!
|
|
1234
|
+
if (!isRecord9(value)) {
|
|
845
1235
|
return false;
|
|
846
1236
|
}
|
|
847
1237
|
return isValidProtocolVersion(value.protocolVersion) && value.kind === "event" && isBridgeEventName(value.event) && "params" in value;
|
|
@@ -849,7 +1239,7 @@ function isBridgeEvent(value) {
|
|
|
849
1239
|
|
|
850
1240
|
// src/cli.ts
|
|
851
1241
|
var SERVICEME_CLI_SCHEMA_VERSION = 1;
|
|
852
|
-
function
|
|
1242
|
+
function isRecord10(value) {
|
|
853
1243
|
return typeof value === "object" && value !== null;
|
|
854
1244
|
}
|
|
855
1245
|
function createCliSuccess(data) {
|
|
@@ -867,7 +1257,7 @@ function createCliFailure(error) {
|
|
|
867
1257
|
};
|
|
868
1258
|
}
|
|
869
1259
|
function isCliEnvelope(value) {
|
|
870
|
-
if (!
|
|
1260
|
+
if (!isRecord10(value)) {
|
|
871
1261
|
return false;
|
|
872
1262
|
}
|
|
873
1263
|
if (value.schemaVersion !== SERVICEME_CLI_SCHEMA_VERSION || typeof value.ok !== "boolean") {
|
|
@@ -901,20 +1291,20 @@ var KNOWN_ENVIRONMENT_TOOLS = [
|
|
|
901
1291
|
"dotnet",
|
|
902
1292
|
"nuget"
|
|
903
1293
|
];
|
|
904
|
-
function
|
|
1294
|
+
function isRecord11(value) {
|
|
905
1295
|
return typeof value === "object" && value !== null;
|
|
906
1296
|
}
|
|
907
1297
|
function isKnownEnvironmentTool(value) {
|
|
908
1298
|
return KNOWN_ENVIRONMENT_TOOLS.includes(value);
|
|
909
1299
|
}
|
|
910
1300
|
function isToolCheckResult(value) {
|
|
911
|
-
if (!
|
|
1301
|
+
if (!isRecord11(value)) {
|
|
912
1302
|
return false;
|
|
913
1303
|
}
|
|
914
1304
|
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
1305
|
}
|
|
916
1306
|
function isEnvironmentCheckResult(value) {
|
|
917
|
-
if (!
|
|
1307
|
+
if (!isRecord11(value)) {
|
|
918
1308
|
return false;
|
|
919
1309
|
}
|
|
920
1310
|
return KNOWN_ENVIRONMENT_TOOLS.every((tool) => isToolCheckResult(value[tool]));
|
|
@@ -966,14 +1356,14 @@ var RETRYABLE_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
|
966
1356
|
"executor_timeout",
|
|
967
1357
|
"internal_error"
|
|
968
1358
|
]);
|
|
969
|
-
function
|
|
1359
|
+
function isRecord12(value) {
|
|
970
1360
|
return typeof value === "object" && value !== null;
|
|
971
1361
|
}
|
|
972
1362
|
function isServicemeErrorCode(value) {
|
|
973
1363
|
return typeof value === "string" && SERVICEME_ERROR_CODES.includes(value);
|
|
974
1364
|
}
|
|
975
1365
|
function isServicemeErrorDetails(value) {
|
|
976
|
-
if (!
|
|
1366
|
+
if (!isRecord12(value)) {
|
|
977
1367
|
return false;
|
|
978
1368
|
}
|
|
979
1369
|
return isServicemeErrorCode(value.code) && typeof value.message === "string" && typeof value.retryable === "boolean";
|
|
@@ -1013,7 +1403,7 @@ function normalizeServicemeError(error, fallbackCode = "internal_error") {
|
|
|
1013
1403
|
if (isServicemeErrorDetails(error)) {
|
|
1014
1404
|
return error;
|
|
1015
1405
|
}
|
|
1016
|
-
if (
|
|
1406
|
+
if (isRecord12(error)) {
|
|
1017
1407
|
const code = isServicemeErrorCode(error.code) ? error.code : fallbackCode;
|
|
1018
1408
|
const message = typeof error.message === "string" ? error.message : "Unexpected serviceme error.";
|
|
1019
1409
|
const retryable = typeof error.retryable === "boolean" ? error.retryable : isRetryableErrorCode(code);
|
|
@@ -1044,69 +1434,37 @@ var SERVICEME_IMAGE_FORMATS = [
|
|
|
1044
1434
|
"png",
|
|
1045
1435
|
"webp"
|
|
1046
1436
|
];
|
|
1047
|
-
function
|
|
1437
|
+
function isRecord13(value) {
|
|
1048
1438
|
return typeof value === "object" && value !== null;
|
|
1049
1439
|
}
|
|
1050
1440
|
function isServiceMeImageFormat(value) {
|
|
1051
1441
|
return typeof value === "string" && SERVICEME_IMAGE_FORMATS.includes(value);
|
|
1052
1442
|
}
|
|
1053
1443
|
function isServiceMeImageCompressOptions(value) {
|
|
1054
|
-
if (!
|
|
1444
|
+
if (!isRecord13(value)) {
|
|
1055
1445
|
return false;
|
|
1056
1446
|
}
|
|
1057
1447
|
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
1448
|
}
|
|
1059
1449
|
function isServiceMeImageCompressResult(value) {
|
|
1060
|
-
if (!
|
|
1450
|
+
if (!isRecord13(value)) {
|
|
1061
1451
|
return false;
|
|
1062
1452
|
}
|
|
1063
1453
|
return typeof value.originalSize === "number" && typeof value.compressedSize === "number" && typeof value.compressionRatio === "number" && typeof value.outputPath === "string";
|
|
1064
1454
|
}
|
|
1065
1455
|
function isServiceMeImageInfo(value) {
|
|
1066
|
-
if (!
|
|
1456
|
+
if (!isRecord13(value)) {
|
|
1067
1457
|
return false;
|
|
1068
1458
|
}
|
|
1069
1459
|
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
1460
|
}
|
|
1071
1461
|
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";
|
|
1462
|
+
return isRecord13(value) && typeof value.valid === "boolean";
|
|
1105
1463
|
}
|
|
1106
1464
|
|
|
1107
1465
|
// src/metadata.ts
|
|
1108
1466
|
var SERVICEME_CLI_NAME = "serviceme";
|
|
1109
|
-
var SERVICEME_CLI_VERSION = "
|
|
1467
|
+
var SERVICEME_CLI_VERSION = "2.0.1";
|
|
1110
1468
|
var SERVICEME_CLI_CAPABILITIES = {
|
|
1111
1469
|
bridge: true,
|
|
1112
1470
|
tasks: 1,
|
|
@@ -1117,32 +1475,32 @@ var SERVICEME_CLI_CAPABILITIES = {
|
|
|
1117
1475
|
};
|
|
1118
1476
|
|
|
1119
1477
|
// src/project.ts
|
|
1120
|
-
function
|
|
1478
|
+
function isRecord14(value) {
|
|
1121
1479
|
return typeof value === "object" && value !== null;
|
|
1122
1480
|
}
|
|
1123
1481
|
function isServiceMeProjectScaffoldPruneResult(value) {
|
|
1124
|
-
if (!
|
|
1482
|
+
if (!isRecord14(value)) {
|
|
1125
1483
|
return false;
|
|
1126
1484
|
}
|
|
1127
1485
|
return typeof value.applied === "boolean" && typeof value.preset === "string" && Array.isArray(value.commands) && value.commands.every((command) => typeof command === "string");
|
|
1128
1486
|
}
|
|
1129
1487
|
function isServiceMeProjectGitInitResult(value) {
|
|
1130
|
-
return
|
|
1488
|
+
return isRecord14(value) && typeof value.initialized === "boolean" && typeof value.command === "string";
|
|
1131
1489
|
}
|
|
1132
1490
|
function isServiceMeProjectMakeScriptsExecutableResult(value) {
|
|
1133
|
-
if (!
|
|
1491
|
+
if (!isRecord14(value)) {
|
|
1134
1492
|
return false;
|
|
1135
1493
|
}
|
|
1136
1494
|
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
1495
|
}
|
|
1138
1496
|
function isServiceMeProjectInstallDepsResult(value) {
|
|
1139
|
-
return
|
|
1497
|
+
return isRecord14(value) && typeof value.installed === "boolean" && typeof value.command === "string";
|
|
1140
1498
|
}
|
|
1141
1499
|
function isServiceMeProjectExtractTemplateInput(value) {
|
|
1142
|
-
return
|
|
1500
|
+
return isRecord14(value) && typeof value.extractedDirName === "string" && typeof value.projectFilePattern === "string";
|
|
1143
1501
|
}
|
|
1144
1502
|
function isServiceMeProjectExtractTemplateResult(value) {
|
|
1145
|
-
return
|
|
1503
|
+
return isRecord14(value) && typeof value.actualDirName === "string";
|
|
1146
1504
|
}
|
|
1147
1505
|
|
|
1148
1506
|
// src/skill.ts
|
|
@@ -1163,7 +1521,7 @@ var VALID_SKILL_MUTATION_ACTIONS = [
|
|
|
1163
1521
|
"republish",
|
|
1164
1522
|
"submit-to-official"
|
|
1165
1523
|
];
|
|
1166
|
-
function
|
|
1524
|
+
function isRecord15(value) {
|
|
1167
1525
|
return typeof value === "object" && value !== null;
|
|
1168
1526
|
}
|
|
1169
1527
|
function isSkillScope(value) {
|
|
@@ -1175,7 +1533,7 @@ function isSkillScopeStatus(value) {
|
|
|
1175
1533
|
function isSkillMutationAction(value) {
|
|
1176
1534
|
return typeof value === "string" && VALID_SKILL_MUTATION_ACTIONS.includes(value);
|
|
1177
1535
|
}
|
|
1178
|
-
function
|
|
1536
|
+
function isStringArray3(value) {
|
|
1179
1537
|
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
1180
1538
|
}
|
|
1181
1539
|
function isSafeResourceId2(value) {
|
|
@@ -1191,42 +1549,43 @@ function isSafeResourceId2(value) {
|
|
|
1191
1549
|
);
|
|
1192
1550
|
}
|
|
1193
1551
|
function isSkillScopeState(value) {
|
|
1194
|
-
if (!
|
|
1552
|
+
if (!isRecord15(value)) {
|
|
1195
1553
|
return false;
|
|
1196
1554
|
}
|
|
1197
1555
|
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
1556
|
}
|
|
1199
1557
|
function isSkillMarketplaceEntry(value) {
|
|
1200
|
-
if (!
|
|
1558
|
+
if (!isRecord15(value)) {
|
|
1201
1559
|
return false;
|
|
1202
1560
|
}
|
|
1203
1561
|
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
1562
|
}
|
|
1205
1563
|
function isSkillMarketplaceState(value) {
|
|
1206
|
-
if (!
|
|
1564
|
+
if (!isRecord15(value)) {
|
|
1207
1565
|
return false;
|
|
1208
1566
|
}
|
|
1209
|
-
return typeof value.configPath === "string" && typeof value.userSkillsPath === "string" && Array.isArray(value.skills) && value.skills.every((entry) => isSkillMarketplaceEntry(entry)) && (value.enabledSkillIds === void 0 ||
|
|
1567
|
+
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
1568
|
}
|
|
1211
1569
|
function isSkillMutationRequest(value) {
|
|
1212
|
-
return
|
|
1570
|
+
return isRecord15(value) && isSafeResourceId2(value.skillId) && isSkillScope(value.targetScope) && isSkillMutationAction(value.action) && (value.confirmed === void 0 || typeof value.confirmed === "boolean");
|
|
1213
1571
|
}
|
|
1214
1572
|
function isSkillMutationResult(value) {
|
|
1215
|
-
return
|
|
1573
|
+
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
1574
|
}
|
|
1217
1575
|
function isSkillReconcileResult(value) {
|
|
1218
|
-
return
|
|
1576
|
+
return isRecord15(value) && isSkillMarketplaceState(value.state) && typeof value.changed === "boolean";
|
|
1219
1577
|
}
|
|
1220
1578
|
function isPublishableSkillEntry(value) {
|
|
1221
|
-
return
|
|
1579
|
+
return isRecord15(value) && typeof value.id === "string" && typeof value.displayName === "string" && typeof value.path === "string" && (value.version === void 0 || typeof value.version === "string");
|
|
1222
1580
|
}
|
|
1223
1581
|
function isSkillPublishableResult(value) {
|
|
1224
|
-
return
|
|
1582
|
+
return isRecord15(value) && Array.isArray(value.skills) && value.skills.every((entry) => isPublishableSkillEntry(entry));
|
|
1225
1583
|
}
|
|
1226
1584
|
export {
|
|
1227
1585
|
AUTH_PROVIDERS,
|
|
1228
1586
|
BRIDGE_EVENTS,
|
|
1229
1587
|
BRIDGE_METHODS,
|
|
1588
|
+
COPILOT_CONTENT_METHOD_ALIASES,
|
|
1230
1589
|
COPILOT_ERROR_CODES,
|
|
1231
1590
|
DEFAULT_JSON_SORT_OPTIONS,
|
|
1232
1591
|
DEVICE_BINDING_STATES,
|
|
@@ -1271,6 +1630,42 @@ export {
|
|
|
1271
1630
|
isBridgeRequest,
|
|
1272
1631
|
isBridgeResponse,
|
|
1273
1632
|
isCliEnvelope,
|
|
1633
|
+
isCopilotContentAdoptUnmanagedParams,
|
|
1634
|
+
isCopilotContentAdoptUnmanagedResult,
|
|
1635
|
+
isCopilotContentApproveResult,
|
|
1636
|
+
isCopilotContentDetectUnmanagedParams,
|
|
1637
|
+
isCopilotContentDetectUnmanagedResult,
|
|
1638
|
+
isCopilotContentIntegrationStatusResult,
|
|
1639
|
+
isCopilotContentMigrateLegacyResult,
|
|
1640
|
+
isCopilotContentRestoreResult,
|
|
1641
|
+
isCopilotContentStatusResult,
|
|
1642
|
+
isCopilotCustomizationViewPayload,
|
|
1643
|
+
isCopilotCustomizationsListParams,
|
|
1644
|
+
isCopilotCustomizationsListResult,
|
|
1645
|
+
isCopilotLegacyMigrateParams,
|
|
1646
|
+
isCopilotLegacyMigrateResult,
|
|
1647
|
+
isCopilotLegacyPreviewParams,
|
|
1648
|
+
isCopilotLegacyPreviewResult,
|
|
1649
|
+
isCopilotPackageInstallParams,
|
|
1650
|
+
isCopilotPackageInstallResult,
|
|
1651
|
+
isCopilotPackageMoveParams,
|
|
1652
|
+
isCopilotPackageMoveResult,
|
|
1653
|
+
isCopilotPackageUninstallParams,
|
|
1654
|
+
isCopilotPackageUninstallResult,
|
|
1655
|
+
isCopilotPackageUpdateParams,
|
|
1656
|
+
isCopilotPackageUpdateResult,
|
|
1657
|
+
isCopilotPluginListParams,
|
|
1658
|
+
isCopilotPluginListResult,
|
|
1659
|
+
isCopilotPluginRegisterParams,
|
|
1660
|
+
isCopilotPluginRegisterResult,
|
|
1661
|
+
isCopilotPluginUnregisterParams,
|
|
1662
|
+
isCopilotPluginUnregisterResult,
|
|
1663
|
+
isCopilotSourceListParams,
|
|
1664
|
+
isCopilotSourceListResult,
|
|
1665
|
+
isCopilotSourceRemoveParams,
|
|
1666
|
+
isCopilotSourceRemoveResult,
|
|
1667
|
+
isCopilotUpdatePreviewParams,
|
|
1668
|
+
isCopilotUpdatePreviewResult,
|
|
1274
1669
|
isDeviceBindingState,
|
|
1275
1670
|
isDeviceEnrollParams,
|
|
1276
1671
|
isDeviceEnrollResult,
|
|
@@ -1288,6 +1683,7 @@ export {
|
|
|
1288
1683
|
isJsonSortOrder,
|
|
1289
1684
|
isJsonValidationResult,
|
|
1290
1685
|
isKnownEnvironmentTool,
|
|
1686
|
+
isRecord4 as isRecord,
|
|
1291
1687
|
isRepoAddParams,
|
|
1292
1688
|
isRepoAddResult,
|
|
1293
1689
|
isRepoDisableParams,
|
|
@@ -1342,6 +1738,8 @@ export {
|
|
|
1342
1738
|
isSkillRepoListLinkedResult,
|
|
1343
1739
|
isSkillRepoListParams,
|
|
1344
1740
|
isSkillRepoListResult,
|
|
1741
|
+
isSkillRepoSetEntryEnabledParams,
|
|
1742
|
+
isSkillRepoSetEntryEnabledResult,
|
|
1345
1743
|
isSkillRepoUninstallParams,
|
|
1346
1744
|
isSkillRepoUninstallResult,
|
|
1347
1745
|
isSystemHelloResult,
|
|
@@ -1369,5 +1767,6 @@ export {
|
|
|
1369
1767
|
isToolboxUpdateResult,
|
|
1370
1768
|
migrateTaskV1ToV2,
|
|
1371
1769
|
migrateV1ToV2,
|
|
1770
|
+
normalizeBridgeMethod,
|
|
1372
1771
|
normalizeServicemeError
|
|
1373
1772
|
};
|